[Scummvm-cvs-logs] scummvm master -> 17711622429c980a0c3a3c549a7b55dbab7a2239

wjp wjp at usecode.org
Thu Oct 17 22:54:35 CEST 2013


This automated email contains information about 734 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a2adda516b AVALANCHE: Initial PtoC output.
cc5b8732bb AVALANCHE: Remove #include "ptoc.h" lines from the beginning every .cpp files.
a183d560c1 AVALANCHE: Add standard header.
d33da0a429 Revert "AVALANCHE: Add standard header."
7939ab1f62 AVALANCHE: Add standard header. (Now the right one...)
a3025b8dad AVALANCHE: Add namespace.
38bc20a076 AVALANCHE: Use Artistic Style.
f974bccbb0 AVALANCHE: Remove empty lines with only ";" characters in them.
2c0e16d6e4 AVALANCHE: Hook the engine into ScummVM.
d53f5d9885 AVALANCHE: Add skeleton.
d2009c014f AVALANCHE: Add detection. Some fix in console.h.
17ee13f2c1 AVALANCHE: Start stubbing with bootstrp.cpp.
cf80573799 AVALANCHE: Fix compilation
b916ab6f02 AVALANCHE: Messing around with GameDescription.
b2f62278b6 AVALANCHE: Remove some functions from detection.
1453413d24 AVALANCHE: Fix detection.
a33797b272 AVALANCHE: Partially implement run_avalot().
fa10b10ec7 AVALANCHE: Keep the functions connected to command line arguments and the main menu for later. Minimal cosmetic modifica
3946d0ed92 AVALANCHE: Add class Avalot. Cosmetic modifications.
6d35a794cd AVALANCHE: Getting GYRO to compile.
6317297b39 AVALANCHE: Implement ROOMNUMS.INC.
1ce5e3bc3f AVALANCHE: Add color.h to replace the color constants from the CRT unit of Pascal.
aeff42074a AVALANCHE: Reorganise source files.
178386f1c4 AVALANCHE: Stub gyro2.cpp. Fix readmes.
5750410279 AVALANCHE: Add some detail in debug strings
46849fcc42 AVALANCHE: Start continuously adding parts to Avalot as I proceed with the conversion of the necessary Pascal units.
c79387608b AVALANCHE: Add Scrolls2. Logger is needed to proceed.
dc05ec1964 AVALANCHE: Relocate used sources. (Should have happened sooner.)
a267dc3025 AVALANCHE: Add Logger.
11efe29da8 AVALANCHE: Add Enhanced.
c39434f37e AVALANCHE: Add Lucerna.
7f1a322de4 AVALANCHE: Repair compilation.
ca807d74bf AVALANCHE: Add Visa.
3e48a4e187 AVALANCHE:  Add Celer.
b807337282 AVALANCHE: Add Sequence.
f558eb2e56 AVALANCHE: Add Enid.
1d950021b8 AVALANCHE: Add Pingo.
49e411f557 AVALANCHE: Add Timeout.
ee5fb07c91 AVALANCHE: Gyro: Change constants to variables with initial values to be equal to the Pascal code.
1d88f5c2f9 AVALANCHE: Add a little self-warning.
0a355ea368 AVALANCHE: Add Trippancy.
784a6aa821 AVALANCHE: Change constant into initialized variable according to the Pascal sources.
a9cc1f78b4 AVALANCHE: Gyro: Replace namespace with class.
c2d3c5fcf8 AVALANCHE: Enhanced: Replace namespace with class.
8398250387 AVALANCHE: Repair Enhanced and Gyro.
dd40c1896b AVALANCHE: Instantiate finished classes in the engine.
b7ef84983e AVALANCHE: Pingo: replace namespace with class.
e4c8d82f9d AVALANCHE: Scrolls: replace namespace with class.
140e205227 AVALANCHE: Update the main class.
612582f016 AVALANCHE: Repair Pingo.
44a9dd2083 AVALANCHE: Visa: replace namespace with class.
7623ea79fe AVALANCHE: Celer: replace namespace with class.
3c413c7ccb AVALANCHE: Enid: replace namespace with class.
5ce7e689b4 AVALANCHE: Repair Enhanced, cosmetics in Gyro.
edaba46087 AVALANCHE: Logger: replace namespace with class.
7c43ab471f AVALANCHE: Lucerna: replace namespace with class.
e28d3263dc AVALANCHE: Sequence: replace namespace with class.
adf4a357ce AVALANCHE: Timeout: replace namespace with class.
c9baa8f456 AVALANCHE: Trip: replace namespace with class.
17fe756073 AVALANCHE: Repair class Avalot.
90bc42f5c2 AVALANCHE: Repair compilation.
8ba4050b1f AVALANCHE: Add Acci.
cb9ec866ac AVALANCHE: Repair compilation, minor modifications.
1d11268eb4 AVALANCHE: Reorganise includes.
7c147c920f AVALANCHE: Fix code formatting
63737c3878 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
539ce56124 AVALANCHE: Fix some more code formatting
5e2ec51025 AVALANCHE: Add Basher.
8aa251722f AVALANCHE: Add Dropdown.
3fd8a18246 AVALANCHE: Finish stubbing of Lucerna. Cosmetic change in Trip.
712ccac0b2 AVALANCHE: Finish stubbing of Scrolls.
7526af940c AVALANCHE: Scrolls: Repair compilation.
76423aa712 AVALANCHE: Add Closing.
e4e3574b91 AVALANCHE: Finish stubbing of Avalot.
ef1f254b03 AVALANCHE: Finish stubbing Avalot vol. 2.
ae1f189370 AVALANCHE: Change constructor of Scrolls, repair string handling in Lucerna and Scrolls.
e27948a1a5 AVALANCHE: Minor repair in Trip, move initialization of the engine into the constructor.
f47bc39f64 AVALANCHE: Update the description of classes.
8d03232cf8 AVALANCHE: Minor repair.
590f89e90e AVALANCHE: Celer: Implement file handling.
490e66e239 AVALANCHE: Gyro: Implement file handling.
d66e89c888 AVALANCHE: Update module.mk.
218c7c3ffb AVALANCHE: Gyro: change void* to byte*, make memory handling more C++-like.
78befcb24a AVALANCHE: Lucerna: implement load_also().
d27a3e07f7 AVALANCHE: Gyro: expand initialization.
7078b4de14 AVALANCHE: Avalot: repair initialization.
430dcc037f AVALANCHE: Lucerna: Repair load_also().
9a6684b37c AVALANCHE:  Celer: implement load_chunks() further.
617898d42c AVALANCHE: Celer: implement show_one().
397ebad385 AVALANCHE: Minor repairs regarding file handling.
cc5e4bbad0 AVALANCHE: Partly implement load() in Lucerna, change char * to Common::String in parameter lists.
c6ff09a246 AVALANCHE: Lucerna: implement thinkabout(). Modify newpointer() in Gyro.
fcaf659c7a AVALANCHE: Lucerna: implement load_digits().
14dfc468ea AVALANCHE: Lucerna: implement toolbar().
0f2a0cf2a4 AVALANCHE: Pingo: partially implement winning_pic().
755d07a8de AVALANCHE: Scrolls: implement file handling.
8a44a94bb6 AVALANCHE: Celer: implement show_one_at().
f01cbaa4e1 AVALANCHE: Enid: update header.
2d4f710c9c AVALANCHE: Trip: implement triptype::init().
848860a5fb AVALANCHE: Trip: modify trptype::init(), minor modifications in other functions parameter lists.
a394fea15d AVALANCHE: Add a comment to Gyro, remove test line from Avalot.
2c0b694371 AVALANCHE: update file handling in multiple files.
223c2d82e5 AVALANCHE: Implement file handling in Visa.
c90357724f AVALANCHE: Implement Basher's initialization.
11cbacfe9d AVALANCHE: Implement file loadfont() in Scrolls. Move initializations to run(), so loadfont() can access the data files 
c99abdeb61 AVALANCHE: Implement log_epsonroman() in Logger.
4656a7a285 AVALANCHE: Don't call the menu by default.
6b87fc4f45 AVALANCHE: Little revision in Gyro.
0aaffcfb94 AVALANCHE: Add Graph.
096bd2df76 AVALANCHE: Major update in the Engine (include Graph), minor updates in Graph and Lucerna.
d7b8240920 AVALANCHE: Update Graph, leave a comment in Lucerna.
0fc20c25de AVALANCHE: Repair Lucerna.
1bb9d2b996 AVALANCHE: Grap: rename drawToScreen to refreshScreen, add drawBar.
a096ee1957 AVALANCHE: Partially implement Scrolls::state. (Bother with the patterns later.)
fa881567db AVALANCHE: Update Graph.
c18b41b21d AVALANCHE: Lucerna: finish implementation of load().
b4f5642765 AVALANCHE: Revise Lucerna::load().
a1673fe167 AVALANCHE: Lucerna: finish load().
0f8a091597 AVALANCHE: Update Lucerna::load(), update makefile, increase screen height (in Graph).
58dc18a2da AVALANCHE: Move the height-doubling part from Lucerna to Graph.
bc15033c14 AVALANCHE: Remove unnecessary comments from Lucerna::load().
4a373a1925 AVALANCHE: update Avalot.
885a8113bc AVALANCHE: repair Avalot.
9683ced39e AVALANCHE: implement Lucerna::toolbar(), revise Graph::copySurface() and Graph::setPixel(), update Lucerna::load() accor
fa1b5d3f3a AVALANCHE: Update Graph.
1c95316924 AVALANCHE: Implement getsettype::remember().
c8bf87918a AVALANCHE: Repair Scrolls::state().
964374024b AVALANCHE: Add new Graph::readImage(), implement Lucerna::thinkabout() using it and use it in Lucerna::toolbar() as well
251c4b0acb AVALANCHE: Revise Lucerna, remove a blank line in Trip.
66cf00ab11 AVALANCHE: Change the source of data in Graph::readImage() for further use. Change existing use of the function accordin
90788cec11 AVALANCHE: Implement Lucerna::showscore().
b6f42c532e AVALANCHE: Partially implement Lucerna::points(). (No sounds.)
d3ec729c8f AVALANCHE: Add Graph::drawLine().
4292850297 AVALANCHE: Stub Dropdown::lightup().
dd511cfc09 AVALANCHE: Implement Gyro::newgame(), update Avalot::setup() and Avalot::run(), add some comment in gyro2.h.
c46bb2449f AVALANCHE: Add comment in Avalot::run().
293c8f9b7e AVALANCHE: Add class SpriteInfo to graph.h, use it in Trip.
c96ac1664a AVALANCHE: Repair build errors due to the introduction of _info in Trip::triptype.
a2dfb3635f AVALANCHE: Implement/repair multiple functions in Trip.
bcab639266 AVALANCHE: Add Graph::drawSprite().
4fc9de5d46 AVALANCHE: Replace Pingo::copy03() with Graph::refreshScreen().
e5614ef0dc AVALANCHE: Fix Gyro::newgame().
467246c004 AVALANCHE: Add refreshScreen() to every iteration of the main loop in Avalot::run().
e2e979897e AVALANCHE: Update Graph::drawSprite(), update Trip::axendor() accordingly, fix Trip::call_axendors().
c71d4dcc64 AVALANCHE: Lucerna:load() - put the background lower, making space for the toolbar on the top.
c6d2b45df9 AVALANCHE: Implement Lucerna::showrw().
b18ed9a5ff AVALANCHE: Remove Graph::drawLine().
4dc97824e6 AVALANCHE: Incorporate Graph::readImage() into Grap::copySurface(), update Lucerna's functions accordingly. Delete Graph
f8ad6eb650 AVALANCHE: Rename copySurface() to drawPicture(), add some comment to it.
ef77a84c83 AVALANCHE: Trip: repair triptype:init(), remove unnecessary data field from definition.
459a8ce2f5 AVALANCHE: Partially implement Graph::drawSprite().
09877044b3 AVALANCHE: Repair Graph::drawSprite().
097572193f AVALANCHE: Update Graph::drawPicture().
137d334144 AVALANCHE: Finish implementation of Graph::drawSprite().
6f20b8f5a2 AVALANCHE: Graph: change 'becouse' to 'because' in comments...
e70b5167c9 AVALANCHE: Change computing method of picnum in triptype::andexor().
79c6a48bd2 AVALANCHE: Add some blank lines in Trip.
d6f93d06ee AVALANCHE: Move flesh_colours() from Lucerna to Graph. Implement it.
44bf47f75e AVALANCHE: Update Graph::flesh_colours().
a16dc4c558 AVALANCHE: Add comments to Graph::drawSprite().
050c60c192 AVALANCHE: Implement menuset::update().
9970ab90fb AVALANCHE: Dropdown: Repair menuset::update(), implement Dropdown:chalk().
de066939d1 AVALANCHE: Remove warning from menuset::update().
2af413cccf AVALANCHE: Cosmetic correction in Dropdown::chalk().
984b478132 AVALANCHE: Modify comment in Dropdown::chalk().
9e15eee970 AVALANCHE: Modify Avalot::run() to don't exit after a single loop, comment out the error in getsettype::remember() until
5dc6abe87b AVALANCHE: Add event handling.
3058a02ab9 AVALANCHE: Fix commas.
bddc0e5cbf AVALANCHE: Move handleMoveKey() from Avalot to Trip.
e8841fbe5c AVALANCHE: Implement Trip::handleMoveKey(), update Avalot::handleKeyDown().
aed0c42f15 AVALANCHE: Add comments to Avalot:handleKeyDown().
aa0603cf42 AVALANCHE: rename constants to follow our code formatting conventions.
0d6a327f98 AVALANCHE: Remove unnecessary indents from avalanche.cpp.
bc5b3fbb65 AVALANCHE: Rename Graph to Graphics. Update everything accordingly.
043ded8185 AVALANCHE: Implement triptype::walk().
ba581b0b32 AVALANCHE: Fix indents in avalanche.cpp.
8c5ce549e6 AVALANCHE: Change _graphics into a pointer, modify the rest of the code accordingly. Introduce AvalanhceEngine::initiali
cc6197d77f AVALANCHE: Change _avalot into pointer, update everything accordingly.
f035622b14 AVALANCHE: Get rid of parts of the engine I don't use yet.
10ec7e0e0f AVALANCHE: Change _gyro into pointer, update everything accordingly.
ca51bf19c9 AVALANCHE: Change _timeout into pointer, update everything accordingly.
bc9823ad9b AVALANCHE: Change _enhanced into pointer, update everything accordingly.
4d25117135 AVALANCHE: Change _logger into pointer, update everything accordingly.
c0823f3e79 AVALANCHE: Change _pingo into pointer, update everything accordingly.
39dfddff1f AVALANCHE: Change class variables to pointers, update everything accordingly.
03665fac21 AVALANCHE: Graphics: double screen height.
0beae3b95c AVALANCHE: free() the surfaces in Graphics' functions.
e5fb4e3866 AVALANCHE: Cosmetic modifications in triptype::walk().
63fbb1d04f AVALANCHE: Implement Lucerna::find_people().
ab04dd7aa6 AVALANCHE: Cosmetic modification in Gyro.
28b0076e63 AVALANCHE: Celer: add new flavour: ch_natural_image.
502cd7a017 AVALANCHE: Improve Celer::display_it(), update Celer::load_chunks() to work properly with it.
6644905eac AVALANCHE: Fix cycle in Trip::trippancy_link().
9b4c9e496f AVALANCHE: Add Graphics::drawFrame().
63e7c5b3d1 AVALANCHE: Repair array indexes in Timeout and Trip.
06bde8b277 AVALANCHE: Implement Celer::load_chunks().
395b917e94 AVALANCHE: Repair Timeout.
5e257a500b AVALANCHE: Implement Timeout::one_tick().
a955f6acab AVALANCHE: Revise Celer::pics_link() a bit.
37ea01644a AVALANCHE: Replace Gyro::slowdown() with ScummVM's own utilities.
9a26bb502f AVALANCHE: Remove parenthesis and add comment to Avalot::run().
b0d4019cea AVALANCHE: Remove Celer:mdrop().
6e8dec45dd AVALANCHE: Add loadPictureGraphic, loadPictureRow, revise drawPicture in Graphics, update almost everything accordingly.
0a4747d915 AVALANCHE: Update rest of Celer accorded to the revision in Graphics.
efe3a662bf AVALANCHE: Add comments to Graphics.
ff1bc9e5a5 AVALANCHE: Get rid of Lucerna::mblit() and Lucerna::blitfix().
190e37d3f9 AVALANCHE: Remove Graphics::drawPicture_old().
5fe090a38c AVALANCHE: Add comments in Graphics and Trip, repair functions in Trip.
d3ff894ff6 AVALANCHE: Replace call of Basher::keyboard_link() with Avalanche::updateEvents() in Avalot::run().
c9fbfb6d32 AVALANCHE: Remove unnecessary indents from Visa.
de97da2fe6 AVALANCHE: Implement Basher::plottext().
9c96417041 AVALANCHE: Add comments to Basher::plottext().
bda09042b5 AVALANCHE: Rename little[] to characters[] and current to inputText in Gyro.
7d3b69251f AVALANCHE: Minor repairs in Basher.
541f5f9c3b AVALANCHE: Implement Avalot::handleKeyDown() further.
0703085d20 AVALANCHE: Repair Avalot::handleKeyDown().
7c8d415a94 AVALANCHE: Remove comment from Graphics.
341bf679c0 AVALANCHE: Cosmetic repairs in Graphics.
eec48fa42e AVALANCHE: Introduce new class: Parser. Update rest of the code accordingly.
31f8e91444 AVALANCHE: Rename variables in Parser. Add _leftMargin to Parser. Fix _leftMargins in Basher.
df427ba7e8 AVALANCHE: Broaden comment in avalot.h.
825df596e6 AVALANCHE: Add Parser::handleBackspace(). Update Avalot::handleKeyDown() accordingly.
a1a2fa2da8 AVALANCHE: Implement handling of the cursor in Parser.
ad7f8add4d AVALANCHE: Add tryDropdown() and _inputTextBackup to Parser, implement handleReturn(), stub tryDropdown() in Parser.
17b2fb02c0 AVALANCHE: Partially implement Acci::parse(), add Acci::pos(),  Acci::clearwords(), reimplement Acci::wordnum(), impleme
9474e2dc61 AVALANCHE: Revisions in acci2.h and lucerna2.cpp, partially implement Acci::parse() and functions connected to it.
591a4852c4 AVALANCHE: Repair parser, implement Acci::replace(), further implement Acci:parse().
9b9c9d0fa5 AVALANCHE: Implement Acci::do_pronouns() and Acci::displaywhat().
c2ac2fdc87 AVALANCHE: Finish implementation of Acci::parse(), repair Acci::displaywhat() and Acci::words[].
e08980c7a4 AVALANCHE: Repair Acci::person_speaks().
e32110339e AVALANCHE: Move wipeText() from Basher to Parser, implement it. Fix parts of Acci::do_that().
b182fd814e AVALANCHE: Partially implement Acci::stand_up(), repair Acci::parse().
a1f87fdaeb AVALANCHE: Modify Graphics and Lucerna, so the engine saves the background and redraws it every time before a sprite is 
3b11fc1224 AVALANCHE: Repair Celer::load_chunks(), remove background drawing from Graphics::drawSprite().
9855cb8f1f AVALANCHE: Add warning to Acci::do_that(), remove blank lines from Avalot::run(), remove unnecessary cycle from Lucerna:
2857f5aad2 AVALANCHE: Revise Graphics::drawSprite(), repair Trip::apped().
a13d37e5ca AVALANCHE: Implement Trip::checkfeet(), repair Trip::stopwalking(). Repair Acci::stand_up().  Repair Gyro::newgame().
06f86bedb0 AVALANCHE: Add _magics to Graphics, implement Lucerna::draw_also_lines(), update Trip::checkfeet() accordingly.
7800c4735f AVALANCHE: Repair Acci::parse().
2e741241c5 AVALANCHE: Broaden Avalot::handleKeyDown().
6ffcb714af AVALANCHE: Broaden Avalot::handleKeyDown().
5290eb9879 AVALANCHE: Repair Lucerna::draw_also_lines().
d66feb32a0 AVALANCHE: Implement rest of Acci::do_that().
599aa9a063 AVALANCHE: Move pos() from Acci to Parser, update other code accordingly.
544cf37757 AVALANCHE: Move strf() from Avalanche to Gyro.
9660c1a566 AVALANCHE: Add some constatns to Scolls, implement Scrolls::calldrivers(), Scrolls::solidify() and Scrolls::strip().
832a11a2ba AVALANCHE: Repair Scrolls::resetscroll() and Scrolls::calldrivers().
471933a3fd AVALANCHE: Remove comment from Graphics, partially implement Scrolls::drawscroll(), repair Scrolls::solidify(), broaden 
1956ca280b AVALANCHE: Repair Logger::log_scrollchar(), cosmetic corrections in Scrolls and Timeout.
15f6ba8b2a AVALANCHE: Introduce _screen in Graphics.
ba00b2a7d9 AVALANCHE: Mostly cosmetic modifications in Visa, stub Timeout::arkata_shouts() until dixi() works, partially implement 
a971cf3a39 AVALANCHE: Implement Scrolls::say().
532306f8cb AVALANCHE: Introduce AvalancheEngine::getEvent().
bd516f4244 AVALANCHE: Implement Scrolls::say(). Introduce Graphics::_scrolls, implement Scrolls::normscroll() and update Scrolls::d
26b7333137 AVALANCHE: Repair parts of the scrolls system, implement the death of Avalot and almost everything connected to it.
84aac3e49b AVALANCHE: Rework Scrolls::normscroll().
84bf0984b0 AVALANCHE: Introduce Graphics::drawArc(), use it in Scrolls::drawscroll().
c182d28b02 AVALANCHE: Introduce Graphics::drawPieSlice(), use it in Scrolls::drawscroll().
59ff20b32c AVALANCHE: Implement the clock in Lucerna, upgrade Graphics::drawArc() to work in synergy with that.
44ec5b68b5 AVALANCHE: Repair Graphics::drawArc(), update Scrolls::drawscroll() accordingly.
ae2d657dc6 AVALANCHE: Update comments connected to Graphics::drawArc().
ad199c4929 AVALANCHE: Repair Graphics::drawArc().
626d8aa8c1 AVALANCHE: Implement switching between rooms (Trip::fliproom(), Lucerna::enterroom()),  implement drawing multiple sprit
2a6d70cfb8 AVALANCHE: Repair Acci::parse().
1443d8ce16 AVALANCHE: Repair Lucerna::enterroom(), Lucerna::put_geida_at(), broaden Roomnums.
288abffafa AVALANCHE: Repair Visa::unskrimble() and Scrolls::calldrivers().
a41736e698 AVALANCHE: Introduce Graphics::drawTriangle(), use it in Scrolls::bubble(). Modify Graphics::drawPieSlice(), update func
c519ea0aa2 AVALANCHE: Remove unnecessary consts from Graphics.
ee6119d07f AVALANCHE: Repair Timeout::lose_timer().
698dae201a AVALANCHE: Introduce Graphics::drawText(). Rename raw to fontType, move it from Gyro to Graphics. Update the rest of the
6a187a04ee AVALANCHE: Finish implementation of Scrolls::bubble().
960c8b2630 AVALANCHE: Improve comments in Scrolls::bubble().
14076ad0e9 AVALANCHE: Remove unnecessary comments from Avalot::setup().
d8798e978a AVALANCHE: Repair Graphics::drawText() and Scrolls::say().
caed4470f1 AVALANCHE: Implement Acci::personshere(), Visa::talkto(), make control-constants in Scrolls public.
20c2a756b2 AVALANCHE: Add typecasts to Acci::parse(), repair Scrolls::calldrivers() and Acci::personshere().
670c7c4863 AVALANCHE: Repair Scrolls::bubble() and Visa::talkto().
2bbf25e948 AVALANCHE: Repair Scrolls::bubble().
24312c45f8 AVALANCHE: Repair Scrolls::say().
31a165c700 AVALANCHE: Repair constants in Gyro, repair Lucerna::enterroom(), Trip::back_and_forth(), Trip::geida_procs(), Visa::tal
fde5508502 AVALANCHE: Rename variables in Graphics::drawSprite().
ea65a86678 AVALANCHE: Implement Gyro::load_a_mouse(), some cosmetic correction in Gyro.
681fe7029a AVALANCHE: Remove useless parts/comments from Gyro, replace some comments in it.
1f751ff157 AVALANCHE: Stub Gyro::super_off() and Gyro::super_on().
d860bc5925 AVALANCHE: Remove Gyro::on_virtual(), Gyro::off_virtual(), Gyro::super_off(), Gyro::super_on(). Replace their calls with
5e2627542a AVALANCHE: Remove functions connected to mouse handling from Gyro, remove Lucerna::flip_page().
dc1e9022b1 AVALANCHE: Add AvalancheEngine::getMousePos(), remove Gyro::hopto(), implement Scrolls::dodgem() and Scrolls::undodgem()
4430e435d8 AVALANCHE: Upgrade Scrolls::normscroll().
2bcca8a0dd AVALANCHE: Remove multiple definition. (Already defined in Graphics.)
05f3838b16 AVALANCHE: Partially implement Lucerna::checkclick(), upgrade other parts of the code during the process. Repair Gyro::l
27d7ae56a6 AVALANCHE: Repair Lucerna::verte().
84bf98c9e5 AVALANCHE: Repair Avalot::handleKeyDown(), add comments to parser.h.
87159b9639 AVALANCHE: Implement the rest of Lucerna::checkclick() and everything connected to it. (Except sounds.)
6555d7d5db AVALANCHE: Repair Scrolls::drawscroll().
50831c1901 AVALANCHE: Implement Trip::newspeed().
8e03019731 AVALANCHE: Minor repairs in Avalanche and Trip.
c4891ace82 AVALANCHE: Repair Acci::do_that(), remove comments from Lucerna::topcheck().
b591434940 AVALANCHE: Add saving/loading during run time.
99b4b12b1c AVALANCHE: Add AvalancheEngine::synchronize(),   AvalancheEngine::generateSaveFileName(), AvalancheEngine::saveGame().
52c07d08c0 AVALANCHE: AvalancheEngine: Revise synchronize(), saveGame(), loadGameState(). Add loadGame(). Rename generateSaveFileNa
f9047bb83d AVALANCHE: Repair synchronize() and loadGame(), update canSaveGameStateCurrently() and canLoadGameStateCurrently() in Av
aab3930779 AVALANCHE: Implement loading from the Launcher. Upgrade saveGame(), loadGame() in, add expandDate() to AvalancheEngine. 
f8796e720e AVALANCHE: Add thumbnail support and version tracking to the saving/loading system. Repair Trip::trippancy_link().
44f7802777 AVALANCHE: Rename Gyro::reloaded to Gyro::isLoaded. Repair a bug in the original engine regarding timing of animations/s
c43373f7ae AVALANCHE: Implement opening of doors. Rethink a bit the graphics and the timer system to do so.
dbd330bf2f AVALANCHE: Rename special() to openBox() in Acci, implement it.
457d898ff3 AVALANCHE: Upgrade Lucerna::enterroom(). Add r__yourhall to roomnums.h, handle it's cases in Lucerna:enterroom() and Tri
90da6c5e6c AVALANCHE: Repair Acci::do_that(), Gyro::getname(), Lucerna::find_people(), triptype::walkto().
38c51209a4 AVALANCHE: Upgrade Trip::apped(). Update rest of the code to call it and the previously upgraded Celer::show_one() prope
c19b50b3f4 AVALANCHE: Upgrade Trip::infield(), update the rest of the code accordingly. Repair Trip::neardoor(). Introduce Parser::
29f159b3ac AVALANCHE: Implement/repair Acci::do_that() and (almost) everything connected to it.
f4824986ec AVALANCHE: Repair Lucerna::bearing().
f729e9e848 AVALANCHE: Repair Acci::wordnum().
26d2e1bd18 AVALANCHE: Fix array indexes in Acci::do_that(), upgrade Lucerna::enterroom().
6df55520b7 AVALANCHE: Implement Acci::exampers(). Repair Avalot::setup().
762e91218d AVALANCHE: Repair array indexes in Timeout.
f2049db1db AVALANCHE: Repair array indexes in Trip.
e36d90f8b8 AVALANCHE: Repair Lucerna::callverb().
934170b353 AVALANCHE: Implement Acci::inv().
06346339a9 AVALANCHE: Implement Timeout::after_the_shootemup(), repair a lot of array indexes in various places.
338dac4e10 AVALANCHE: Implement Acci::store_interrogation() and all the functions it uses.
f0dbe10cb2 AVALANCHE: Repair exampers(), openBox() and do_that() in Acci. Repair loading from the Launcher.
f7d17fd7b7 AVALANCHE: Partially implement the music room. (Without music.)
f53d998e53 AVALANCHE: Repair Gyro::whereis indexes.
6531ca39b9 AVALANCHE: Various index fixes in Lucerna.
499d176ab1 AVALANCHE: Repair Acci::do_that() and roomnums.h. Some cosmetic repairs here and there.
f95834ca05 AVALANCHE: Repair "entrance hall" room and everything connected to it.
3aa059848a AVALANCHE: Repair the catacombs.
bdde166c49 AVALANCHE: Repair the Oubliette in the catacombs and wrong parameters connected to Geida's follow-function. Repair the s
06d0ce1b0f AVALANCHE: Minor cosmetic fixes.
73048872b2 AVALANCHE: Upgrade show_one() so it can replace show_one_at(), preventing code duplication.
0abeaababb AVALANCHE: Replace the mini-game "Nim" until implementation.
c421426d8a AVALANCHE: Make the game finally completable.
a9e9a8b9af AVALANCHE: Cosmetic and other repairs in Timeout.
4d6573a80e AVALANCHE: Start implementation of the drop-down menu.
5720fa1dba AVALANCHE: Implement drop-down menu. (Only with mouse control yet.)
cf5f150d9b AVALANCHE: Upgrade the drop-down menu.
9e848e8e64 AVALANCHE: Upgrade drop-down menu. (Now it's complete.) Fix Trip::neardoor().
9b7f138659 AVALANCHE: Repair drop-down menu, so the already implemented functions are working.
0afbcf1cf0 AVALANCHE: Rename/refactor avalanche.h/.cpp.
74979869ff AVALANCHE: Rename/refactor Acci. Implement Acci::peopleInRoom().
59317d6ac7 AVALANCHE: Rename/refactor Avalot.
84ae6db893 AVALANCHE: Get rid of Basher. Move everything needed from it to Parser::init().
09ee31e4ce AVALANCHE: Get rid of the rest of Basher.
38ceb705f2 AVALANCHE: Do renaming in Celer.
a6fb557a51 AVALANCHE: Some more renaming and a little bit of refactoring in Celer.
3fe9c6d90b AVALANCHE: Removing the file variable from Celer's member variables.
212391f337 AVALANCHE: Refactor Celer.
4ae897e3a9 AVALANCHE: Repair comments in Celer.
4cf40bc87a AVALANCHE: Rename refreshBackgroundSprites() to updateBackgroundSprites() in Celer.
a2c42df2b2 AVALANCHE: Fix compile errors
458dd5d0cc AVALANCHE: Fix link error using MSVC9
ccba9863eb AVALANCHE: Silent a warning
a8d9978de8 AVALANCHE: Silent a sign mismatch warning, improve loop condition
b38fd85d70 AVALANCHE: Do renaming/refactoring in Closing.
d148d08683 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
666d3eecfc AVALANCHE: Replace some British terms by American ones
543c4f59da AVALANCHE: Remove logger
d418b2c50c AVALANCHE: Fix MSVC warnings in lucerna2
cd808484af AVALANCHE: Fix some more MSVC warnings
c3ce7d4840 AVALANCHE: Fix MSVC warnings in trip6
fce3fe8381 AVALANCHE: Fix MSVC warnings in acci2
8e14821306 AVALANCHE: Fix bug in verbOpt()
8c8990368e AVALANCHE: Fix bug in lookAround()
53d9848f66 AVALANCHE: Fix bug in openDoor()
c781727a03 AVALANCHE: Fix bug in giveToSpludwick, add doxygen comment
caeb46f3ce AVALANCHE: Fix bugs in getProc() and giveGeidaTheLute(), add doxygen comment
3820462448 AVALANCHE: Fix bugs in winSequence() and doThat()
8e7921d19d AVALANCHE: USe the default return value in giveToSpludwick()
9c5cc7bba4 AVALANCHE: Add a default value to color in state(), remove dead code
e4b3fc8064 AVALANCHE: Add default value to Direction in updateBackgroundSprites()
ff31d8e521 AVALANCHE: Replace a STUB by a call to updateBackgroundSprites()
fe8e5c7325 AVALANCHE: Fix coding style: ++ and --
d2312e626b AVALANCHE: Review use of brackets in acci2
93a5fadcb8 AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction
3f3757e03f AVALANCHE: Use a class-key when declaring a friend class
bbaa645b6c AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction in acci2
316e84a4d4 AVALANCHE: cleanup acci2.h
41416f0c05 AVALANCHE: Clean up celer2
70aa840f0b AVALANCHE: Fix GCC warnings reported by GCC
6818dd2eb4 AVALANCHE: Fix some more GCC warnings
ad5529b5d2 AVALANCHE: Fix more GCC warnings
d77eafb0db AVALANCHE: Partially do the renaming in Dropdown.
8cb9c3825f Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
97843d9e94 AVALANCHE: Repair regression in Acci::inventory().
08e8e92e3a AVALANCHE: Fix even more GCC warnings
a952ae3f87 AVALANCHE: Fix some more GCC warnings
247bf3ca26 AVALANCHE: Fix very verbose source of warning
90494e01fd AVALANCHE: Do renaming/refactoring in Acci, Avalanche and Dropdown. Unify drawing of menus' text in Dropdown in a single
15947cec7d AVALANCHE: Get rid of Enhanced. Further renamings and refactoring in Avalanche and Avalot.
c7e78ec6b7 AVALANCHE: Fix some more GCC warnings
b52c873c5b AVALANCHE: Fix GCC warnings
17033bdc2d AVALANCHE: Fix uninitialized variable
d52c410118 AVALANCHE: Fix systematic typo in comments
71af29e979 AVALANCHE: Remove dead code reported by CppCheck
e5cc0fa495 AVALANCHE: Fix more warnings reported by CppCheck
dab2988947 AVALANCHE: Start replacing C-style comments by C++-style
b690c9ad31 AVALANCHE: Finish replacing C-style comments by C++-style
31bd1369d9 AVALANCHE: Add some brackets to improve readability
8011d24ee2 AVALANCHE: Fix warnings reported by GCC
c0d9677979 AVALANCHE: Fix one more GCC warning
0c47dc858a AVALANCHE: Fix GCC warning.
9740287721 AVALANCHE: Fix some memory leak problems.
a698a2a2f9 AVALANCHE: Repair another bunch of memory leaks.
ce95f738be AVALANCHE: Do renaming in Enid. (Keep the refactoring for the implementation of it.)
390ecc6a6b AVALANCHE: Do renaming/refactoring in Graphics.
3de1b45b62 AVALANCHE: Repair memory leaks in Dropdown.
2d99f5bfc6 AVALANCHE: Repair some initialization to silence Valgrind warnings.
63d1d289a5 AVALANCHE: Silence more Valgrind warnings.
3b10b079f7 AVALANCHE: Silence Valgrind warnings.
f3377c67e0 AVALANCHE: Fix initialization of kEdnaId
3f822be0ab AVALANCHE: Silence Valgrind warnings.
77607ab6ed Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
c1bc8eee64 AVALANCHE: Rename/refactor Colors.
b6306976cf AVALANCHE: Start renaming in Gyro.
82484b139a AVALANCHE: More renaming in Gyro.
dd897be038 AVALANCHE: Identify currently dead code in enid2
56ce2398d8 AVALANCHE: Remove 2 high-ascii characters
95a4ccac51 AVALANCHE: Some renaming in lucerna2
200670d327 AVALANCHE: More renaming in gyro2.h.
f1bac0f193 AVALANCHE: (Hopefully) fix some warnings reported by GCC and Clang
e340767395 AVALANCHE: Move some static arrays to function bodies
c537d2f1e5 AVALANCHE: Comment out some dead code
73afd0d8e1 AVALANCHE: Fix some more warnings
7be84e9d52 AVALANCHE: Fix some more Clang warnings
e859e17e3b AVALANCHE: Janitorial - Remove trailing spaces, fix define names
5d2547c8f0 AVALANCHE: Rename some constants in trip6
cb05ea9bc6 AVALANCHE: Finish renaming/refactoring in Gyro.
cfd7d06539 AVALANCHE: Fix bug due to unsaved changes.
2bed64b447 AVALANCHE: Do renaming/refactoring in Lucerna.
467a7b1cce AVALANCHE: Introduce a new class: Clock.
00a963b840 AVALANCHE: Do renaming/refactoring in Parser.
0fa45b0fd2 AVALANCHE: Do renaming in Pingo.
0ad51df7d9 AVALANCHE: Remove 2 variables from Visa2
9097e80153 AVALANCHE: Minor cosmetic fixes in Lucerna.
d96555406e AVALANCHE: Rename trip into animation, some more renaming
9198b166f7 AVALANCHE: Some more renaming in Animation
c087998a8a AVALANCHE: Do renaming in scrolls2.h.
347d970634 AVALANCHE: Fix Clang warnings
f1e699199b AVALANCHE: Some more renaming in Animation
c158abc313 AVALANCHE: Add some missing brackets in Lucerna
fcd32da865 AVALANCHE: Missing file from previous commit
6383c7397d AVALANCHE: Fix one more Clang warning
5c00d5fe34 AVALANCHE: More renaming, use int16 for loops based on kSpriteNumbMax
f59892b45e AVALANCHE: More renaming in animation
d2b554ab41 AVALANCHE: More renaming in Lucerna. Fix accidentally modified strings in Acci.
e5d014d29d Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
93013b5c76 AVALANCHE: Do renaming in Sequence.
1847a0ddbf AVALANCHE: Start renaming in Timeout.
3f2ed1c803 AVALANCHE: Everything that is missing from the last commit...
f783f2c28a AVALANCHE: Silent some CppCheck warnings, rename some loop variables
8a4a5b3c56 AVALANCHE: Renaming in timeout2.h
db6fcd5e9b Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
21ff074fda AVALANCHE: Fix uninitialized variable in TimeOut
26099360a9 AVALANCHE: Renaming/refactoring in Visa.
b9c14ccb08 AVALANCHE: Some more renaming in Timeout. Add some Doxygen comments
1b25defe34 AVALANCHE: Missing files from last commit...
f42f29d8f8 AVALANCHE: Rename Timeout into Timer
aafaaef37f AVALANCHE: Some renaming in Animation.
f7de651560 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
8f152c0833 AVALANCHE: Renaming/refactoring in Animation.
3cc438171a AVALANCHE: Review variable scope in Visa2, add some doxygen comments
c0243036a2 AVALANCHE: Renaming/refactoring in Animation.
b8d16e894c AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
55d64e1ed1 AVALANCHE: Add some doxygen comments in Lucerna
b7844c3548 AVALANCHE: More renaming/refactoring in Animation.
0f20e7fe37 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
2eb4002e36 AVALANCHE: Check function scope in Animation, set a function private
c6183993f2 AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
e6956a994b AVALANCHE: Change type of kSpriteNumbMax to byte
48f2a79ed2 AVALANCHE: Rename _tr to _anim.
3950c871f2 AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
7df4c94aeb AVALANCHE: Some renaming in Timer and Acci2, add some doxygen comments
599d2eeb06 Merge branch 'master' into avalanche
b60767fce8 AVALANCHE: Do not set pixels directly
78417de0d1 AVALANCHE: Start simplifying String use
f33ba71924 AVALANCHE: Fix bug in Visa2
cb66911ed2 AVALANCHE: Rework more strings in Scroll2
e77db05208 AVALANCHE: Rework some more string uses
f7bce3bede AVALANCHE: Rework some more strings
2d2ce624a9 AVALANCHE: Rework some more strings
524edfcbc3 AVALANCHE: Rework more strings (still WIP)
e12e0eb2ff AVALANCHE: Rework some more strings, identify some dead code in avalanche.cpp
1ca62e51b9 AVALANCHE: refactor the way ControlCharacter enum is accessed
bc64dcf276 AVALANCHE: harmonize the use of constants for kMagic, kProc, kObject, kPeople
1cb0c0ec5e AVALANCHE: harmonize the use of constants for kDir, kDirection, kVerbs
94b98ac5f6 AVALANCHE: Various cleanup
49dbac6a2a AVALANCHE: Some polishing in Acci2
da1a427e79 Merge branch 'master' of https://github.com/urukgit/scummvm into avalanche
2f42e9ce46 AVALANCHE: Identify useless variables and function in Closing2
4c12daf55a AVALANCHE: Polish some more strings
11c496c31b AVALANCHE: Complete 2 comments, get rid of Scrolls::kControlToBuffer in one function (for further discussions)
b936611e03 AVALANCHE: Fix various warnings reported by GCC and/or wjp
65f39c14c9 AVALANCHE: Remove some verbosity related to excessive use of Common::String in Acci2
7fdb5c439e AVALANCHE: Fix bug in scrollModeNormal()
8a59c9c1b2 AVALANCHE: undo previous commit, add comments about kControlNegative and a missing stub
f7c34949db AVALANCHE: Error out when critical files are missing
5e59ade554 AVALANCHE: Fix compilation
59532fd567 AVALANCHE: Fix crash.
44ff5eeafb AVALANCHE: Remove unnecessary error() call.
82e76e7b53 AVALANCHE: Remove DNA structure which was essentially a savegame structure unused in ScummVM
b083878dbe AVALANCHE: Remove duplicated direction enum, move direction to animation class
a773f0eb2b AVALANCHE: Remove some dead/useless code
c288b09ca0 AVALANCHE: Simplify the use of string for displayQuestion()
ef219d5c99 AVALANCHE: Silence clang warning.
7d7e9ef7e6 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
b710844971 AVALANCHE: Repair regression introduced when removing DNA.
5be2d50e14 AVALANCHE: Reduce verbosity related to animation sprites
d7c2f49595 AVALANCHE: reduce the verbosity of a forgotten animation sprite
fb86c6db0d AVALANCHE: Janitorial: remove extra space after ! in boolean operations
a506b0b3e4 AVALANCHE: Reduce some more verbosity
010d9f854e AVALANCHE: Remove comment from AvalancheEngine::expandDate. It works as intended, no need to repair.
f7ee139501 AVALANCHE: Reduce verbosity some more
ba05f95bb4 AVALANCHE: Get rid of Visa. Move everything from it to Scrolls.
4979cc5f69 AVALANCHE: Rename Gyro::_dogFoodPos. Add comments to clarify it's function.
7ee6e8699f AVALANCHE: Remove the '2' from the source files' names.
a81b499062 AVALANCHE: Get rid of Enid.
cccc126d15 AVALANCHE: Convert index use from Pascal to C in Bearing()
ecbd87353e AVALANCHE: Convert index use from Pascal to C in walkTo()
ddd7a95737 AVALANCHE: Convert index use from Pascal to C in appearPed()
83ee99a381 AVALANCHE: Convert index use from Pascal to C in putGeidaAt()
d70b856da9 AVALANCHE: Rename room number constans. Repair Lucerna::enterRoom().
98cb1cd52b Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
eaf6ecb7cd AVALANCHE: Fix indexes used by kQuasipeds (Pascal -> C)
ac49e6d09b AVALANCHE: Get rid of a magic value in kQuasipeds initialization
34acc80d73 AVALANCHE: Get rid of several magic values
982e8c6523 AVALANCHE: Remove hardcoded room number from the initialization of kQuadipeds
18a992856e AVALANCHE: Get rid of some more magic values
ca59642380 AVALANCHE: for consistency, replace fv and ff loop variables by i and j. Remove some commented dead code
b3c1a64aa1 AVALANCHE: Fix multiple bugs.
5de5c3900d AVALANCHE: Repair Acci::exampers().
45dc123b84 AVALANCHE: Rework exampers()
c877ddf411 AVALANCHE: Rework Acci:exampers().
d6be9ed7db AVALANCHE: More index conversion in appearPed
23ba373c91 AVALANCHE: More index conversion in inField()
9d259d0a07 AVALANCHE: fix index in loadMouse, misc cleanup
3f19e7a0fb AVALANCHE: Repair exit condition of the main loop.
5f6fc0de6b AVALANCHE: Remove unnecessary error() call.
fe72db6c85 AVALANCHE: Make Graphics::drawPicture more safe. Fix an index-bug regarding Gyro::_objectList.
7f26871be1 AVALANCHE: Remove dead code
68533445a0 AVALANCHE: Index conversion related to drawBackgroundSprite()
6e08f55160 AVALANCHE: Review all for statements
7790b4cc5b AVALANCHE: Janitorial - Clean up misc style glitches
8be433b960 AVALANCHE: Rename DropDown into Menu, add some access functions
9ba81f6097 AVALANCHE: move some engine init instructions to Gyro
edc1477741 AVALANCHE: Remove index hack used for mouse pointer (Pascal to C conversion)
23b225ca0d AVALANCHE: Add sound class, blip(), playNote() and click()
d26a06a970 AVALANCHE: Remove useless includes
2238db712c AVALANCHE: Remove useless function, add _soundFl
0356040910 AVALANCHE: Remove some STUBs, add calls to stopSound()
21a9de5df2 AVALANCHE: Rename Celer to Background.
31637f1983 AVALANCHE: Cosmetic modifications.
16f5f32376 AVALANCHE: Repair Scrolls::musicalScroll() and Scrolls::store().
5ccff749a5 AVALANCHE: Add minigame: playing the harp.
207335d0f2 AVALANCHE: Repair minigame: Harp.
4b84999a30 AVALANCHE: Another addition regarding the harp game.
95b2e27243 AVALANCHE: A little revision of the harp minigame.
f78de9b382 AVALANCHE: Add check on shouldQuit() in Harp mini-game
bb58813eee AVALANCHE: Remove code used for Demo
f88ca9dc81 AVALANCHE: Remove misc dead or useless code: useless arguments, stubbed ini file reading, etc
b11bf988f4 AVALANCHE: Remove roomnums.h
a7bb292cba AVALANCHE: Remove color.h
6943fcfb03 AVALANCHE: Janitorial - leftover Bristish -> American English
2b63646740 AVALANCHE: Remove some useless/dead code
c7f888de7c AVALANCHE: Remove remaining off and on calls in commented code
39b4d8b71c AVALANCHE: Some cleanup and comment modifications.
c34bc12af2 AVALANCHE: Remove useless code.
8d5ce97ca4 AVALANCHE: Mostly cosmetic modifications in avalot.cpp.
3650f5d6a7 AVALANCHE: More clean up, removement of dead code.
2df1aa6287 AVALANCHE: More clean up, removement of dead code, some rearranging.
2dcdca5711 AVALANCHE: Silence GCC warnings and repair Scrolls::scrollModeNormal().
3b57efaf99 AVALANCHE: Revise Graphics::drawPicture().
897a0d0a61 AVALANCHE: Silence more GCC warnings.
e0b4280a94 AVALANCHE: Change byte to unsigned int in for loops.
ba103fd5dd AVALANCHE: Some polishing in Animation
d82975fc38 AVALANCHE: Add an assert in flipRoom(), fix an issue in post-STU functions
628c5bb515 AVALANCHE: Remove comment. (Answer: It is.)
350d622324 AVALANCHE: rename scrolls to dialogs
a80af5326e AVALANCHE: Merge Acci and Parser
183f10e4a0 AVALANCHE: Simplify Sequence::firstShow().
ed7e71d226 AVALANCHE: Some revision in Sequence.
89471e76d1 AVALANCHE: More revision in Sequence.
4b4f07a7f6 AVALANCHE: Merge Gyro, Lucerna and Avalot
45ad88b73b AVALANCHE: uncomment some sound code, code cleanup
66fe0b2ebc AVALANCHE: Remove useless comments.
79a961c89d AVALANCHE: Move some variables, fix savegame counter increment when saving
9450faf150 AVALANCHE: Implement Clock::chime().
2ffcd492be AVALANCHE: Implement Avalot::zoomOut().
03f6a56e20 AVALANCHE: Remove comment, replace character.
302e74cac1 AVALANCHE: Fix GCC warning
863709ca57 AVALANCHE: Move some variables
061c06c128 AVALANCHE: (hopefully) fix a GCC warning
61eb94e5c8 AVALANCHE: Use struct for consistency in Avalot
02caaa5735 AVALANCHE: Optimize Animation::updateSpeed().
cbe9c151aa AVALANCHE: Refactor some variables. This breaks savegame compatibility
f4e37939c7 AVALANCHE: Move 2 enums out of Avalot classes, set private some parser variables
0b7de38dc1 AVALANCHE: Use Room enum instead of byte in misc place
3ae30372bc AVALANCHE: Repair bug regarding uninitialized direction in Avalot. Some renaming in Animation.
b3f6ce975f AVALANCHE: Use People enum as a type for several variables, modify functions accordingly
b4a81fc2ac AVALANCHE: Use enum for verbs
929dcd42f5 AVALANCHE: Reduce verbosity in Background, remove a useless variable
5637987bd7 AVALANCHE: Simplify loadMouse()
1b1655d0c8 AVALANCHE: use nullptr for empty pointers
890eed446c AVALANCHE: rename a parameter, remove a useless (unitialized) variable, disable some menu entries
6cd9bd141c AVALANCHE: Move some variables to Animation, break savegame compatibility
90c6e6a689 AVALANCHE: Janitorial - Use ++ and -- when possible
8efaa45425 AVALANCHE: Partially implement (there are still missing features: icon, keyboard control) the last missing type of scrol
df3fe7b0ec AVALANCHE: Objectify Sequence. This commit breaks savegames.
03cae64498 AVALANCHE: Fix bug in Sequence.
dc3471bc09 AVALANCHE: Rename Sequence functions
75cbbda822 AVALANCHE: More function deduplication, remove a magic value
e166f6fc44 AVALANCHE: Move a couple of variables to Sequence, more private variables
08883a807f AVALANCHE: Merge Avalot and AvalancheEngine
64f799773e AVALANCHE: Misc minor polishing
d7230fe856 AVALANCHE: Remove a couple of unused variables
649fa6e5f0 AVALANCHE: Use the Color enum, remove some magic values, identify some dead variables
75258758ef AVALANCHE: Move Zoom to Graphics
00e5a4830b AVALANCHE: Move background loading to Graphics
7a8d252ddb AVALANCHE: Move Digits and Directions to Graphics
7d66cdf417 AVALANCHE: Move mouse cursor display functions to Graphics
726fa64bbf AVALANCHE: Use an enum for the Mouse cursor identifier
fdbcb5f785 AVALANCHE: Move some more functions to Graphics
0edb0e0434 AVALANCHE: Set the Magic surface as private, some associated rework
6a7326ec26 AVALANCHE: More rework on Graphic code
ef8b661c3d AVALANCHE: Partially move drawScroll to Graphics
1af03774cc AVALANCHE: Add some more graphic functions
ffbe4646c1 AVALANCHE: move some more functions to Graphics
063bc8d8c9 AVALANCHE: Scrolls is now set to private
de12f46db5 AVALANCHE: Rename Graphics to avoid confusion, add drawBackgroundSprite(), set _background private
6b41b38049 AVALANCHE: Move code from Menu to Graphics
1c9ac623fa AVALANCHE: Rework calcHand, move another function to Graphics
4464409d73 AVALANCHE: Set drawArc private
bea6980529 AVALANCHE: Move debug display of magic lines to debugger
24bca9d927 AVALANCHE: Silent warnings reported by wjp
55a3af61c9 AVALANCHE: Fix more gcc warnings reported by wjp
ec41600795 AVALANCHE: Rename getFlag(), change _roomTime to uint32
c2da192e7f AVALANCHE: Remove bytefields, which are set but never used
53f6c2f693 AVALANCHE: Implement keyboard control in Dialogs::scrollModeDialogue().
b160a156c1 AVALANCHE: Little refactoring in background
98b5fe757f AVALANCHE: Remove various dead variables and associated code
9b8566ae18 AVALANCHE: Move several variables to make them private
6c11712373 AVALANCHE: More refactoring
15acaa1a77 AVALANCHE: Move _scroll and _scrollNum to Dialogs. Remove a useless variable
bc4a8f8671 AVALANCHE: _scrollNum is now a C index
a06bbb4fe7 AVALANCHE: Rename _scrollNum to improve readibility
63f43aa959 AVALANCHE: Move some more variables out of Avalanche
bfb28c7a39 AVALANCHE: Move drawSign() from Dialogs to Graphics. Implement it.
8408fa46c7 AVALANCHE: Implement Dialogs::displayQuestion(), repair setSeed() and getRandomNumber() calls.
bb8157772c AVALANCHE: Rename getIcon() to drawIcon(), move it to Graphics from Dialogs, implement it. Repair Dialogs::scrollModeDia
f9a5eb4629 AVALANCHE: Set private some more variables
ce50d86987 AVALANCHE: Remove useless variable, move variables to dialogs
ae45671973 AVALANCHE: More work on variables
199ba0ddf4 AVALANCHE: Remove verbosity related to the use of Magics enum
c9432b8467 AVALANCHE: more work on variables
5a4bd0d837 AVALANCHE: some more work on variables
546e911af9 AVALANCHE: Use Doxygen comments in Animation
4b93e25435 AVALANCHE: Repair shadowed variable.
8652224e58 AVALANCHE: Move ControlCharacter enum to enums
9093b2c258 AVALANCHE: Use Doxygen comments in Dialogs, set private some members
efe6236e7b AVALANCHE: Make _surface private
26626125d9 AVALANCHE: Use Doxygen comments in Graphics
2d8fa4fdad AVALANCHE: Set some variables private in Menu
a6bdec5ca5 AVALANCHE: Don't refresh screen after every event in scroll mode
97f26f6794 AVALANCHE: Use memcpy in refreshScreen
9a4d1683c9 AVALANCHE: Remove code commented in the original but not in the engine.
49960992ca AVALANCHE: Fix naming convention, reduce the scope of a couple of variables
9b9462bcee AVALANCHE: Check | occurrence as pointed by LordHoto
19cc272763 AVALANCHE: Remove s_engine
650613f5ca AVALANCHE: Use MKTAG for signature. This breaks prior savegames.
493c02ae22 AVALANCHE: Use ConfMan short name
89559e07a3 AVALANCHE: Remove file variable from AvalancheEngine
300859aa43 AVALANCHE: Fix static array names
1cbe175a74 AVALANCHE: Fix naming conventions in getItem()
221faca286 AVALANCHE: Fix ifndef check in header files
0ec40a5f80 AVALANCHE: Add static to 2 array definitions in closing
72d1f58733 AVALANCHE: Fix savegame naming. This breaks previous savegames
c53917ec64 AVALANCHE: Add indentation on REGISTER_PLUGIN_* lines
b0a498c1e5 Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche
304ab6da15 AVALANCHE: Start cleaning includes - remove useless include in header files
a357dc4d0c AVALANCHE: Cleaning includes - remove useless includes in cpp files
eeabd8a0dd AVALANCHE: Answer a couple of comments made by LordHoto
03ca6ef76f AVALANCHE: Fix bug introduced in badc727883c14d13702fc61a0a6912a3d61ce9a4
d3cd7e237a AVALANCHE: Change disposeAfterUse value in Sound handler as suggested by LordHoto
b6d6c17727 AVALANCHE: Replace static strings by static char*
1844dcf05c AVALANCHE: Remove a missed useless include
bf41366fd7 AVALANCHE: Fix error not reported by MSVC
0f42dd4511 AVALANCHE: Use floats instead of double. Use M_PI where it is possible.
61983d027a AVALANCHE: Add a comment to Dialogs::stripTrailingSpaces().
fed8546444 AVALANCHE: Update credit files.
14dee780e0 AVALANCHE: Get rid of FP in Parser::totalTime().
ac231eb838 AVALANCHE: Rework totalTime()
6216430428 AVALANCHE: Rework bearing()
b7f7644cc6 AVALANCHE: Fix potential integer overflow
c99061e7c5 AVALANCHE: Fix time output
a246dbad26 AVALANCHE: Fix parser bug when pressing F5
a30cc19ca8 AVALANCHE: Fix two other broken verb usages
8430288fef AVALANCHE: Hook some more function keys
31b01f0d11 AVALANCHE: Add save/load code
77c10447c3 AVALANCHE: Repair credits.h
7b11be0a92 AVALANCHE: Fix savegame patterns
c36adb83e2 AVALANCHE: Fix savegames list
10b4495b51 AVALANCHE: Hook some more function keys
eebbdfbfb3 AVALANCHE: Add code for Shift-F10
0bfe150dca AVALANCHE: Fix coding conventions in Graphics
cf36706b98 AVALANCHE: Remove empty case in verb handling, clarify output when the opcode is unhandled
b0255c9406 AVALANCHE: Implement fadeIn and fadeOut (dusk and dawn)
72e55fab70 AVALANCHE: Implement Bleep(), improve one comment
f76284a95e AVALANCHE: Polish 'File' menu
d202d898da AVALANCHE: Remove code duplicate in runMenuWith()
aba6b02b5b AVALANCHE: Fix two blocking loops not checking shouldQuit()
ccebfc78fd AVALANCHE: Remove useless check and move some comments in Sequence
46c5bfa508 AVALANCHE: Move some variables around
0deb94c1b8 AVALANCHE: Move some parser functions to Dialogs. Improve some comments
1a40c8c5d2 AVALANCHE: Move/Improve some comments in parser
91e70ce2a8 AVALANCHE: Modifiy AnimationType initialization, add private Animation pointer
609846ab8a AVALANCHE: Reduce verbosity in Animation and AnimationType
cb54243763 AVALANCHE: Remove GraphicManager::fleshColors(), move everything from it to GraphicManager::init().
2c09933641 AVALANCHE: Remove StatType, reduce verbosity some more
652331a3a9 AVALANCHE: Remove some extra parenthesis in Animation
597690ae9d AVALANCHE: Fix memory corruption in background (drawpicture) blitting
6437179de3 AVALANCHE: Get rid of SpriteInfo
1f943c0362 AVALANCHE: Fix crash when entering inn, add safeguards
f24267874e AVALANCHE: Fix iteration in Dialogs::talkTo().
964fd22e4a AVALANCHE: Fix crash on "With" after loading from Launcher.
96ae25eca9 AVALANCHE: Remove a couple of useless variables from Animation. This breaks savegames.
b82a5e6a8b AVALANCHE: Rework AvalancheEngine::bearing(), repair Background::update().
ecb1bf69b9 AVALANCHE: Repair parameters for calling zoomOut().
06f94c1085 AVALANCHE: Remove 3 useless variables in Animation
5f180a06ba AVALANCHE: Rework animation init/remove some more
5f0361c03a AVALANCHE: Move Bubble pos to Dialogs, make them private
1c3fcf22a1 AVALANCHE: Some more refactoring
38b842ba71 AVALANCHE: callDialogDriver, displayText, unSkrimble, doTheBubble string cleanup
748ba2475a AVALANCHE: Fix broken xml entity in credits
1771162242 Merge branch 'avalanche'


Commit: a2adda516bdf790651283201a666f253a8bfcc49
    https://github.com/scummvm/scummvm/commit/a2adda516bdf790651283201a666f253a8bfcc49
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T01:38:38-07:00

Commit Message:
AVALANCHE: Initial PtoC output.

Changed paths:
  A engines/avalanche/1stoff.cpp
  A engines/avalanche/access.cpp
  A engines/avalanche/access.h
  A engines/avalanche/acci.cpp
  A engines/avalanche/acci.h
  A engines/avalanche/also.cpp
  A engines/avalanche/andexor.cpp
  A engines/avalanche/andexor2.cpp
  A engines/avalanche/andextst.cpp
  A engines/avalanche/arch.cpp
  A engines/avalanche/arch.h
  A engines/avalanche/avalot9.cpp
  A engines/avalanche/avbkgrnd.cpp
  A engines/avalanche/avmenu.cpp
  A engines/avalanche/avvyans.cpp
  A engines/avalanche/avvyans2.cpp
  A engines/avalanche/avvymonk.cpp
  A engines/avalanche/bakchunk.cpp
  A engines/avalanche/basher.cpp
  A engines/avalanche/basher.h
  A engines/avalanche/bootstrp.cpp
  A engines/avalanche/cadburys.cpp
  A engines/avalanche/cadburys.h
  A engines/avalanche/celer.cpp
  A engines/avalanche/celer.h
  A engines/avalanche/ch_egats.cpp
  A engines/avalanche/charmap.cpp
  A engines/avalanche/chunker.cpp
  A engines/avalanche/chunkxf1.cpp
  A engines/avalanche/chunkxf2.cpp
  A engines/avalanche/chunkxf3.cpp
  A engines/avalanche/chunkxf4.cpp
  A engines/avalanche/chunkxf5.cpp
  A engines/avalanche/chunkxf6.cpp
  A engines/avalanche/chunkxf7.cpp
  A engines/avalanche/chunkxf8.cpp
  A engines/avalanche/chunkxf9.cpp
  A engines/avalanche/chunkxfa.cpp
  A engines/avalanche/chunkxfb.cpp
  A engines/avalanche/chunkxfc.cpp
  A engines/avalanche/chunkxfd.cpp
  A engines/avalanche/chunkxfe.cpp
  A engines/avalanche/chunkxff.cpp
  A engines/avalanche/chunkxfg.cpp
  A engines/avalanche/chunkxfh.cpp
  A engines/avalanche/chunkxfi.cpp
  A engines/avalanche/chunkxfj.cpp
  A engines/avalanche/chunkxfk.cpp
  A engines/avalanche/chunkxfl.cpp
  A engines/avalanche/clock.cpp
  A engines/avalanche/closing.cpp
  A engines/avalanche/closing.h
  A engines/avalanche/convert.cpp
  A engines/avalanche/convmous.cpp
  A engines/avalanche/credits.cpp
  A engines/avalanche/displtxt.cpp
  A engines/avalanche/dropdown.cpp
  A engines/avalanche/dropdown.h
  A engines/avalanche/dwidth.cpp
  A engines/avalanche/edhead.cpp
  A engines/avalanche/edna.cpp
  A engines/avalanche/enhanced.cpp
  A engines/avalanche/enhanced.h
  A engines/avalanche/enid.cpp
  A engines/avalanche/enid.h
  A engines/avalanche/filer.cpp
  A engines/avalanche/fileunit.cpp
  A engines/avalanche/fileunit.h
  A engines/avalanche/filing.cpp
  A engines/avalanche/folktemp.cpp
  A engines/avalanche/fontslid.cpp
  A engines/avalanche/frere.cpp
  A engines/avalanche/g-room.cpp
  A engines/avalanche/golden.cpp
  A engines/avalanche/gyro.cpp
  A engines/avalanche/gyro.h
  A engines/avalanche/help.cpp
  A engines/avalanche/help2.cpp
  A engines/avalanche/helpbak.cpp
  A engines/avalanche/helpbak.h
  A engines/avalanche/helper.cpp
  A engines/avalanche/helper.h
  A engines/avalanche/hibits.cpp
  A engines/avalanche/highs.cpp
  A engines/avalanche/highs.h
  A engines/avalanche/hiz.cpp
  A engines/avalanche/incline.cpp
  A engines/avalanche/incline.h
  A engines/avalanche/initxf.cpp
  A engines/avalanche/inputtes.cpp
  A engines/avalanche/intro.cpp
  A engines/avalanche/ints.cpp
  A engines/avalanche/joysetup.cpp
  A engines/avalanche/joystick.cpp
  A engines/avalanche/joystick.h
  A engines/avalanche/loading.cpp
  A engines/avalanche/logger.cpp
  A engines/avalanche/logger.h
  A engines/avalanche/lucerna.cpp
  A engines/avalanche/lucerna.h
  A engines/avalanche/magic2.cpp
  A engines/avalanche/magidraw.cpp
  A engines/avalanche/magishuf.cpp
  A engines/avalanche/make!.cpp
  A engines/avalanche/makeregi.cpp
  A engines/avalanche/makesez.cpp
  A engines/avalanche/makevmou.cpp
  A engines/avalanche/menuxf.cpp
  A engines/avalanche/minstran.cpp
  A engines/avalanche/newsprit.cpp
  A engines/avalanche/nim.cpp
  A engines/avalanche/nimdraw.cpp
  A engines/avalanche/nimunit.cpp
  A engines/avalanche/nimunit.h
  A engines/avalanche/oldfiler.cpp
  A engines/avalanche/oldhighs.cpp
  A engines/avalanche/oldincln.cpp
  A engines/avalanche/oldincln.h
  A engines/avalanche/oldtrip.cpp
  A engines/avalanche/oldtrip.h
  A engines/avalanche/omtest.cpp
  A engines/avalanche/oopmenu.cpp
  A engines/avalanche/oopmenu.h
  A engines/avalanche/overlap.cpp
  A engines/avalanche/overscro.cpp
  A engines/avalanche/particle.cpp
  A engines/avalanche/pictemp.cpp
  A engines/avalanche/pictemp2.cpp
  A engines/avalanche/pingo.cpp
  A engines/avalanche/pingo.h
  A engines/avalanche/plottest.cpp
  A engines/avalanche/preview1.cpp
  A engines/avalanche/qintro.cpp
  A engines/avalanche/qstars.cpp
  A engines/avalanche/rawupd.cpp
  A engines/avalanche/readsez.cpp
  A engines/avalanche/reginam.cpp
  A engines/avalanche/sackb1.cpp
  A engines/avalanche/sackb1.h
  A engines/avalanche/sackb3.cpp
  A engines/avalanche/sackblas.cpp
  A engines/avalanche/saving.cpp
  A engines/avalanche/scr_1.cpp
  A engines/avalanche/scr_2.cpp
  A engines/avalanche/scr_3.cpp
  A engines/avalanche/scr_4.cpp
  A engines/avalanche/scr_5.cpp
  A engines/avalanche/scr_9.cpp
  A engines/avalanche/scrolls.cpp
  A engines/avalanche/scrolls.h
  A engines/avalanche/sequence.cpp
  A engines/avalanche/sequence.h
  A engines/avalanche/setup.cpp
  A engines/avalanche/seu.cpp
  A engines/avalanche/seu_avvy.cpp
  A engines/avalanche/sez.cpp
  A engines/avalanche/sezedit.cpp
  A engines/avalanche/sezunit.cpp
  A engines/avalanche/sezunit.h
  A engines/avalanche/sezxfr.cpp
  A engines/avalanche/shell1.cpp
  A engines/avalanche/shell2.cpp
  A engines/avalanche/slope.cpp
  A engines/avalanche/spread.cpp
  A engines/avalanche/spread2.cpp
  A engines/avalanche/squish.cpp
  A engines/avalanche/ss_blank.cpp
  A engines/avalanche/ss_clock.cpp
  A engines/avalanche/stars.cpp
  A engines/avalanche/status.cpp
  A engines/avalanche/sticks.cpp
  A engines/avalanche/sticks.h
  A engines/avalanche/sunrise.cpp
  A engines/avalanche/tempo.cpp
  A engines/avalanche/test.cpp
  A engines/avalanche/test2.cpp
  A engines/avalanche/testblit.cpp
  A engines/avalanche/testcard.cpp
  A engines/avalanche/testenh.cpp
  A engines/avalanche/timeout.cpp
  A engines/avalanche/timeout.h
  A engines/avalanche/travel.cpp
  A engines/avalanche/trip.cpp
  A engines/avalanche/trip.h
  A engines/avalanche/trip3.cpp
  A engines/avalanche/trip3.h
  A engines/avalanche/trip42.cpp
  A engines/avalanche/trip42.h
  A engines/avalanche/trip5.cpp
  A engines/avalanche/trip5.h
  A engines/avalanche/trip5tst.cpp
  A engines/avalanche/trip5xf.cpp
  A engines/avalanche/tripoop.cpp
  A engines/avalanche/ttmenuxf.cpp
  A engines/avalanche/unsquish.cpp
  A engines/avalanche/viewdocs.cpp
  A engines/avalanche/visa.cpp
  A engines/avalanche/visa.h
  A engines/avalanche/visatest.cpp
  A engines/avalanche/waver.cpp
  A engines/avalanche/xf_gover.cpp
  A engines/avalanche/xf_help.cpp
  A engines/avalanche/xf_visa.cpp
  A engines/avalanche/xfbutton.cpp
  A engines/avalanche/xfghost.cpp
  A engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
new file mode 100644
index 0000000..99198b4
--- /dev/null
+++ b/engines/avalanche/1stoff.cpp
@@ -0,0 +1,57 @@
+#include "ptoc.h"
+
+
+/*#include "Crt.h"*/
+/*#include "Dos.h"*/
+
+
+matrix<1,7,1,3,byte> cols;
+byte fv;
+
+void adjust()
+{
+ registers r;
+;
+ {;
+  ax=0x1012;
+  bx=1;
+  cx=2;
+  es=seg(cols);
+  dx=ofs(cols);
+
+ }
+
+ intr(0x10,r);
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ textattr=0;
+ clrscr;
+
+ fillchar(cols,sizeof(cols),'\0');
+ adjust();
+
+ gotoxy(29,10); textattr=1; output << "Thorsoft of Letchworth";
+ gotoxy(36,12); textattr=2; output << "presents";
+
+ for( fv=1; fv <= 77; fv ++)
+ {;
+  delay(77);
+  if (fv<64)  fillchar(cols[1],3,chr(fv));
+  if (fv>14)  fillchar(cols[2],3,chr(fv-14));
+  adjust();
+ }
+
+ delay(100);
+
+ for( fv=63; fv >= 1; fv --)
+ {;
+  fillchar(cols,sizeof(cols),chr(fv));
+  delay(37);
+  adjust();
+ }
+
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
new file mode 100644
index 0000000..37c9649
--- /dev/null
+++ b/engines/avalanche/access.cpp
@@ -0,0 +1,170 @@
+#include "ptoc.h"
+
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 ACCESS           The temporary Sez handler. */
+
+#define __access_implementation__
+
+
+#include "access.h"
+
+
+/*#include "Gyro.h"*/
+/*#include "Scrolls.h"*/
+/*#include "Acci.h"*/
+/*#include "Trip5.h"*/
+/*#include "Lucerna.h"*/
+
+
+boolean int_say_went_ok;
+
+void int_say(string filename, boolean bubble)
+ /* Internal use ONLY! */
+{
+    untyped_file f;
+;
+ /*$I-*/
+ assign(f,filename);
+ reset(f,1);
+ if (ioresult!=0) 
+ {;
+  int_say_went_ok=false;
+  return;
+ }
+ bufsize=filesize(f);
+ blockread(f,buffer,bufsize);
+ if (bubble) 
+ {;
+  bufsize += 1;
+  buffer[bufsize]='\2';
+ }
+ close(f);
+ /*$I+*/
+
+ calldrivers;
+
+ int_say_went_ok=true;
+}
+
+void dixi(char p, byte n)
+{; exit(153);
+ int_say(string('s')+p+strf(n)+".raw",false);
+}
+
+void talkto(byte whom)
+{
+ byte fv;
+ boolean no_matches;
+; exit(153);
+ if (person==pardon) 
+ {;
+  person=chr(subjnumber);
+  subjnumber=0;
+ }
+
+ switch (chr(whom)) {
+  case pspludwick:
+
+    if ((dna.lustie_is_asleep) & (~ dna.obj[potion])) 
+    {;
+     dixi('q',68);
+     dna.obj[potion]=true;
+     objectlist; points(3); return;
+    } else
+    {;
+     if (dna.talked_to_crapulus) 
+      switch (dna.given2spludwick) { /* Spludwick - what does he need? */
+         /* 0 - let it through to use normal routine. */
+         case RANGE_2(1,2): {;
+                display(string("Can you get me ")+
+                 get_better(spludwick_order[dna.given2spludwick])+", please?"+
+                  "\232\2");
+                return;
+               }
+               break;
+         case 3: {;
+             dixi('q',30); /* need any help with the game? */
+             return;
+            }
+            break;
+       }
+     else dixi('q',42); /* Haven't talked to Crapulus. Go and talk to him. */
+    }
+    break;
+
+  case pibythneth: if (dna.givenbadgetoiby) 
+              {;
+               dixi('q',33); /* Thanks a lot! */
+               return; /* And leave the proc. */
+              }
+              break; /* Or... just continue, 'cos he hasn't got it. */
+  case pdogfood: if (dna.wonnim) 
+            {;     /* We've won the game. */
+             dixi('q',6); /* "I'm Not Playing!" */
+             return; /* Zap back. */
+            }
+            break;
+  case payles: if (~ dna.ayles_is_awake) 
+          {;
+           dixi('q',43); /* He's fast asleep! */
+           return;
+          }
+          break;
+  case pgeida: if (dna.geida_given_potion) 
+           dna.geida_follows=true; else
+          {;
+           dixi('u',17);
+           return;
+          }
+          break;
+ }
+
+ if (whom>149)  whom -= 149;
+
+ no_matches=true;
+ for( fv=1; fv <= numtr; fv ++)
+  if (tr[fv].a.accinum==whom) 
+  {;
+   display(string('\23')+chr(fv+48)+'\4');
+   no_matches=false;
+   flush();
+  }
+
+ if (no_matches)  display("\23\23\4");
+
+ if (subjnumber==0)   /* For the moment... later we'll parse "say". */
+  int_say(string("ss")+strf(whom)+".raw",true);
+ else
+ {;
+  int_say(string("ss")+strf(whom)+'-'+strf(subjnumber)+".raw",true);
+  if (! int_say_went_ok)      /* File not found! */
+   dixi('n',whom);
+ }
+
+ switch (chr(whom+149)) {
+  case pcrapulus:
+     {;     /* Crapulus: get the badge - first time only */
+      dna.obj[badge]=true;
+      objectlist;
+      dixi('q',1); /* Circular from Cardiff. */
+      dna.talked_to_crapulus=true;
+
+      whereis[pcrapulus]=177;  /* Crapulus walks off. */
+
+      tr[2].vanishifstill=true;
+      tr[2].walkto(4); /* Walks away. */
+
+      points(2);
+     }
+     break;
+
+  case payles: dixi('q',44); break; /* Can you get me a pen? */
+
+ }
+}
+
+
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
new file mode 100644
index 0000000..825deeb
--- /dev/null
+++ b/engines/avalanche/access.h
@@ -0,0 +1,9 @@
+#ifndef __access_h__
+#define __access_h__
+
+
+void dixi(char p, byte n);
+
+void talkto(byte whom);
+
+#endif
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
new file mode 100644
index 0000000..86fac18
--- /dev/null
+++ b/engines/avalanche/acci.cpp
@@ -0,0 +1,1671 @@
+#include "ptoc.h"
+
+/*  $D-*/
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 ACCIDENCE II     The parser. */
+#define __acci_implementation__
+
+
+/*$V-*/
+
+#include "acci.h"
+
+/*#include "Gyro.h"*/
+/*#include "Lucerna.h"*/
+/*#include "Scrolls.h"*/
+/*#include "Pingo.h"*/
+/*#include "Trip5.h"*/
+/*#include "Visa.h"*/
+/*#include "Enid.h"*/
+/*#include "NimUnit.h"*/
+/*#include "Timeout.h"*/
+/*#include "Celer.h"*/
+/*#include "Highs.h"*/
+/*#include "Helper.h"*/
+/*#include "Sequence.h"*/
+
+
+byte fv;
+
+string wordnum(string x);
+static char whatsit; 
+static word fv; 
+static boolean gotcha;
+
+static void checkword(string& x) /* Checks word "fv". */
+{
+ {
+  vocab& with = words[fv]; 
+
+  if ((with.w==x) || ((copy(with.w,1,length(x))==x) && ! gotcha))
+        whatsit=chr(with.n);
+  if (with.w==x)  gotcha=true;
+ }
+}
+
+string wordnum(string x)
+
+{
+ string wordnum_result;
+ if (x=="")  { wordnum_result=""; return wordnum_result; }
+ whatsit=pardon; gotcha=false;
+ for( fv=nowords; fv >= 1; fv --) checkword(x);
+ wordnum_result=whatsit;
+ return wordnum_result;
+}
+
+void replace(string old1,string new1)
+{
+    byte q;
+
+ q=pos(old1,thats);
+ while (q!=0) 
+ {
+  thats=copy(thats,1,q-1)+new1+copy(thats,q+length(old1),255);
+  q=pos(old1,thats);
+ }
+}
+
+/*procedure ninetydump;
+var f:file; y:integer; bit:byte; a:byte absolute $A000:800;
+begin
+ off;
+ assign(f,'avvydump.avd');
+ rewrite(f,1);
+ blockwrite(f,dna,177); { just anything }
+ for bit:=0 to 3 do
+ begin
+  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
+  blockwrite(f,a,12080);
+ end;
+ close(f); on;
+ display('Dumped.');
+end;*/
+
+string rank()
+{
+    byte fv;
+
+ string rank_result;
+ for( fv=1; fv <= 8; fv ++)
+  if ((dna.score>=ranks[fv].score)
+   && (dna.score<ranks[fv+1].score)) 
+   {
+    rank_result=ranks[fv].title;
+    return rank_result;
+   }
+ return rank_result;
+}
+
+string totaltime()
+{
+      const real ticks_in_1_sec = (real)(65535)/3600;
+ word h,m,s; varying_string<70> a;
+
+  /* There are 65535 clock ticks in a second,
+    1092.25 in a minute, and
+    65535 in an hour. */
+ string totaltime_result;
+ h=trunc(dna.total_time/ticks_in_1_sec);  /* No. of seconds. */
+ m=h % 3600; h=h / 3600;
+ s=m % 60;   m=m / 60;
+
+ a="You've been playing for ";
+
+ if (h>0)  a=a+strf(h)+" hours, ";
+ if ((m>0) || (h!=0))  a=a+strf(m)+" minutes and ";
+ a=a+strf(s)+" seconds.";
+
+ totaltime_result=a;
+ return totaltime_result;
+}
+
+void cheatparse(string codes);
+static word num; 
+static integer e;
+
+static void number(string& codes)
+{
+ val(codes,num,e);
+}
+
+void cheatparse(string codes)
+{
+    char cmd;integer se,sx,sy;
+
+ if (~ cheat) 
+ {     /* put them off the scent! */
+  display("Have you gone dotty\??!");
+  return;
+ }
+ cmd=upcase(codes[2]); Delete(codes,1,2);  /* strip header */
+ display("\6Ninety: \22\4");
+ switch (cmd) {
+  case 'R': {
+        number(codes); if (e!=0)  return;
+        display(string("room swap to ")+codes+'.');
+        fliproom(num,1);
+       }
+       break;
+  case 'Z': { zonk; display("Zonk OK!"); } break;
+  case 'W': { wobble; display("Ow my head!"); } break;
+  case 'A': {
+        tr[1].done;
+        tr[1].init(1,true);
+        dna.user_moves_avvy=true;
+        alive=true;
+        display("Reincat.");
+       }
+       break;
+  case 'B': {
+        sx=tr[1].x;
+        sy=tr[1].y;
+        se=tr[1].face;
+        delavvy;
+        number(codes);
+        {
+         void& with = tr[1]; 
+
+         done;
+         init(num,true);
+         display(string("Become ")+codes+':'+"\r\r"+a.name+'\15'+a.comment);
+         appear(sx,sy,se);
+        }
+       }
+       break;
+/*  'D': ninetydump;*/
+  case 'G': play_nim; break;
+  case '±': display("\232\25"); break;
+  default: display("unknown code!");
+ }
+}
+
+void punctustrip(string& x)          /* Strips punctuation from x. */
+{
+      const varying_string<32> punct = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
+    byte fv,p;
+
+ for( fv=1; fv <= 32; fv ++)
+  do {
+   p=pos(punct[fv-1],x);
+   if (p==0)  flush(); /* <<< The first time I've ever used it! */
+   Delete(x,p,1);
+  } while (!false);
+}
+
+boolean do_pronouns();
+static boolean ambiguous;
+
+static void displaywhat(char ch, boolean animate) /* << it's an adjective! */
+{
+    byte ff; string z;
+
+ if (ch==pardon) 
+ {
+  ambiguous=true;
+  if (animate)  display("Whom?"); else display("What?");
+ } else
+ {
+  if (animate)  display(string("{ ")+getname(ch)+" }");
+   else
+   {
+     z=get_better(ch);
+     if (z!="")  display(string("{ ")+z+" }");
+   }
+ }
+}
+
+boolean do_pronouns()
+{
+    byte fv;
+
+ boolean do_pronouns_result;
+ ambiguous=false;
+ for( fv=1; fv <= length(thats); fv ++)
+  switch (thats[fv]) {
+   case '\310': {
+          displaywhat(him,true);
+          thats[fv]=him;
+         }
+         break;
+   case '\311': {
+          displaywhat(her,true);
+          thats[fv]=her;
+         }
+         break;
+   case '\312': {
+          displaywhat(it,false);
+          thats[fv]=it;
+         }
+         break;
+  }
+ do_pronouns_result=ambiguous;
+ return do_pronouns_result;
+}
+
+void store_interrogation(byte interrogation);
+
+
+static void lowercase()
+{
+    byte fv;
+
+ for( fv=1; fv <= length(current); fv ++)
+  if (set::of(range('A','Z'), eos).has(current[fv])) 
+   current[fv] += 32;
+}
+
+
+
+static void propernouns()
+{
+    byte fv;
+
+ lowercase();
+ for( fv=2; fv <= length(current)-1; fv ++)
+  if (current[fv]==' ') 
+   current[fv+1]=upcase(current[fv+1]);
+ current[1]=upcase(current[1]);
+}
+
+
+
+static void sayit() /* This makes Avalot say the response. */
+{
+    string x;
+
+ x=current; x[1]=upcase(x[1]);
+ display(string("\231")+x+'.'+'\2'+'\23'+'2');
+}
+
+void store_interrogation(byte interrogation)
+{
+    byte fv;
+
+
+ if (current=="")  return;
+
+ /* Strip current: */
+ while ((current[1]==' ') && (current!=""))  Delete(current,1,1);
+ while ((current[length(current)]==' ') && (current!=""))  current[0] -= 1;
+
+ lose_timer(reason_cardiffsurvey); /* if you want to use any other timer,
+  put this into the case statement. */
+  switch (interrogation) {
+   case 1: {
+       lowercase(); sayit();
+       like2drink=current;
+       dna.cardiff_things=2;
+      }
+      break;
+   case 2: {
+       propernouns(); sayit();
+       favourite_song=current;
+       dna.cardiff_things=3;
+      }
+      break;
+   case 3: {
+       propernouns(); sayit();
+       worst_place_on_earth=current;
+       dna.cardiff_things=4;
+      }
+      break;
+   case 4: {
+       lowercase(); sayit();
+       fillchar(spare_evening,sizeof(spare_evening),'\261');
+       spare_evening=current;
+       dixi('z',5); /* His closing statement... */
+       tr[2].walkto(4); /* The end of the drawbridge */
+       tr[2].vanishifstill=true;  /* Then go away! */
+       magics[2].op=nix;
+       dna.cardiff_things=5;
+      }
+      break;
+
+   case 99: store_high(current); break;
+  }
+ if (interrogation<4)  cardiff_survey;
+}
+
+void clearwords()
+{
+ fillchar(realwords,sizeof(realwords),'\0');
+}
+
+void parse()
+{
+    byte n,fv,ff; string c,cc,thisword; varying_string<1> answer; boolean notfound;
+
+ /* first parsing - word identification */
+
+ thats=""; c=current+'\40'; n=1; polite=false;
+ verb=pardon; thing=pardon; thing2=pardon; person=pardon;
+ clearwords();
+ if (current[1]=='.') 
+ {     /* a cheat mode attempt */
+  cheatparse(current); thats=nowt; return;
+ }    /* not our department! Otherwise... */
+
+ /* Are we being interrogated right now? */
+
+ if (interrogation>0) 
+ {
+  store_interrogation(interrogation);
+  weirdword=true;
+  return;
+ }
+
+ cc=c; for( fv=1; fv <= length(c); fv ++) c[fv]=upcase(c[fv]);
+ while (c!="") 
+ {
+   while ((c[1]=='\40') && (c!="")) 
+     { Delete(c,1,1); Delete(cc,1,1); }
+  thisword=copy(c,1,pos("\40",c)-1);
+  realwords[n]=copy(cc,1,pos("\40",cc)-1);
+  punctustrip(c);
+
+  notfound=true;
+
+  if (thisword!="") 
+  {
+   for( ff=1; ff <= 30; ff ++)
+   {     /* Check Also, FIRST! */
+    if (pos(string(',')+thisword,also[ff][0])>0) 
+    {
+     thats=thats+chr(99+ff);
+     notfound=false;
+    }
+   }
+  }
+
+  if (notfound) 
+  {
+   answer=wordnum(thisword);
+   if (answer==pardon) 
+   {
+    notfound=true;
+    thats=thats+pardon;
+   } else
+    thats=thats+wordnum(thisword);
+   n += 1;
+  }
+  Delete(c,1,pos("\40",c)); Delete(cc,1,pos("\40",cc));
+ }
+
+ if (pos("\376",thats)>0)  unknown=realwords[pos("\376",thats)]; else unknown=""; replace("\377",""); /* zap noise words */
+ replace(string('\15')+'\342',"\1"); /* "look at" = "examine" */
+ replace(string('\15')+'\344',"\1"); /* "look in" = "examine" */
+ replace(string('\4')+'\343',"\21"); /* "get up" = "stand" */
+ replace(string('\4')+'\347',"\21"); /* "get down" = "stand"... well, why not? */
+ replace(string('\22')+'\344',"\2"); /* "go in" = "open [door]" */
+ replace(string('\34')+'\345',"\375"); /* "P' off" is a swear word */
+ replace(string('\4')+'\6',"\6"); /* "Take inventory" (remember Colossal Adventure?) */
+ replace(string('\50')+'\350',"\25"); /* "put on" = "don" */
+ replace(string('\4')+'\345',"\24"); /* "take off" = "doff" */
+
+             /* Words that could mean more than one person */
+ {
+  if (room==r__nottspub)  replace("\314","\244"); /* Barman = Port */
+   else replace("\314","\232");                   /* Barman = Malagauche */
+  switch (room) {
+   case r__aylesoffice: replace("\313","\243"); break;        /* Monk = Ayles */
+   case r__musicroom: replace("\313","\246"); break;          /* Monk = Jacques */
+   default: replace("\313","\242");                   /* Monk = Ibythneth */
+  }
+ }
+
+ if (do_pronouns()) 
+ {
+  weirdword=true;
+  thats=nowt;
+  return;
+ }
+
+ /* second parsing - accidence */
+
+ subject=""; subjnumber=0;   /* Find subject of conversation. */
+ for( fv=1; fv <= 11; fv ++)
+  if (set::of('`','\'', eos).has(realwords[fv][1])) 
+  {
+   subjnumber=ord(thats[fv]);
+   thats[fv]=moved;
+   flush(); /* Only the second time I've used that! */
+  }
+ if (subjnumber==0)   /* Still not found. */
+  for( fv=1; fv <= 10; fv ++)
+   if (thats[fv]=='\374')  /* the word is "about", or something similar */
+   {
+    subjnumber=ord(thats[fv+1]);
+    thats[fv+1]='\0';
+    flush(); /* ...Third! */
+   }
+ if (subjnumber==0)   /* STILL not found! Must be the word after "say". */
+  for( fv=1; fv <= 10; fv ++)
+   if ((thats[fv]=='\7') && ! (set::of('\0',range('\341','\345'), eos).has(thats[fv+1]))) 
+   {     /* SAY not followed by a preposition */
+    subjnumber=ord(thats[fv+1]);
+    thats[fv+1]='\0';
+    flush(); /* ...Fourth! */
+   }
+
+ for( fv=length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
+  switch (thats[fv]) {
+   case '\1' ... '\61':case '\375':case '\371': verb=thats[fv]; break;
+   case '\62' ... '\225': { thing2=thing; thing=thats[fv]; } break;
+   case '\226' ... '\307': person=thats[fv]; break;
+   case '\373': polite=true; break;
+  }
+
+ if ((unknown!="") && !
+  (set::of(vb_exam,vb_talk,vb_save,vb_load,vb_dir, eos).has(verb))) 
+ {
+  display(string("Sorry, but I have no idea what `")+unknown+
+    "\" means. Can you rephrase it?");
+  weirdword=true;
+ } else weirdword=false;
+ if (thats=="")  thats=nowt;
+
+ if (thing!=pardon)  it=thing;
+ if (person!=pardon) 
+ {
+  if (person<'\257')  him=person; else her=person;
+ }
+}
+
+void examobj()     /* Examine a standard object-thing */
+{
+ if (thing!=thinks)  thinkabout(thing,a_thing);
+  switch (thing) {
+   case wine : switch (winestate) {
+         /* 4 is perfect wine. 0 is not holding the wine. */
+           case 1: dixi('t',1); break; /* Normal examine wine scroll */
+           case 2: dixi('d',6); break; /* Bad wine */
+           case 3: dixi('d',7); break; /* Vinegar */
+          }
+          break;
+   case onion: if (rotten_onion) 
+           dixi('q',21); /* Yucky onion. */
+          else
+           dixi('t',18);
+           break;        /* Normal onion scroll */
+  default:
+   dixi('t',ord(thing)); /* <<< Ordinarily */
+  }
+}
+
+boolean personshere()         /* Person equivalent of "holding" */
+{
+ boolean personshere_result;
+ if ((person==pardon) || (person=='\0')
+   || (whereis[person]==dna.room))  personshere_result=true;
+ else {
+  if (person<'\257')  display("H\4"); else display("Sh\4");
+  display("e isn't around at the moment.");
+  personshere_result=false;
+ }
+ return personshere_result;
+}
+
+void exampers()
+{
+ if (personshere()) 
+ {
+  if (thing!=thinks)  thinkabout(person,a_person);
+  person -= 149;
+   switch (person) { /* Special cases */
+    case '\13': if (wonnim) 
+         {
+          dixi('Q',8); /* "I'm Not Playing!" */
+          return;
+         }
+         break;
+    case '\11': if (lustie_is_asleep) 
+        { dixi('Q',65);     /* He's asleep. (65! Wow!) */ return; }
+        break;
+   }
+   /* Otherwise... */ dixi('p',ord(person));
+ }    /* And afterwards... */
+ switch (person) {
+  case '\16': if (~ dna.ayles_is_awake)  dixi('Q',13); break; /* u.f.s.? */
+ }
+}
+
+boolean holding()
+{
+ boolean holding_result;
+ if (set::of(range('\63','\143'), eos).has(thing))  { holding_result=true; return holding_result; } /* Also */
+ holding_result=false;
+ if (thing>'\144')  display("Be reasonable!"); else
+  if (~ dna.obj[thing])      /* verbs that need "thing" to be in the inventory */
+   display("You're not holding it, Avvy."); else
+    holding_result=true;
+ return holding_result;
+}
+
+void examine();
+
+static void special(boolean before)
+{
+ switch (dna.room) {
+  case r__yours: switch (thing) {
+             case '\66': if (before)  show_one(5); else show_one(6); break;
+            }
+            break;
+ }
+}
+
+void examine()
+{
+ /* Examine. EITHER it's an object OR it's an Also OR it's a person OR
+    it's something else. */
+ if ((person==pardon) && (thing!=pardon)) 
+ {
+  if (holding()) 
+   switch (thing) { /* remember it's been Slipped- ie subtract 49 */
+       case '\1' ... '\61' : examobj(); break; /* Standard object */
+     case '\62' ... '\144' : {
+                  special(true);
+                  display(also[ord(thing)-50][1]); /* Also thing */
+                  special(false);
+                 }
+                 break;
+   }
+ } else
+  if (person!=pardon)  exampers();
+   else display("It's just as it looks on the picture.");  /* don't know- guess */
+}
+
+void inv()     /* the time-honoured command... */
+{
+    char fv; byte q;
+
+ q=0; display(string("You're carrying ")+'\4');
+ {
+  for( fv='\1'; fv <= numobjs; fv ++)
+   if (obj[fv]) 
+   {
+    q += 1; if (q==carrying)  display(string("and ")+'\4');
+    display(get_better(fv)+'\4');
+    if (fv==wearing)  display(string(", which you're wearing")+'\4');
+     if (q<carrying)  display(string(", ")+'\4');
+   }
+  if (wearing==nowt)  display("...\r\r...and you're stark naked!"); else
+   display('.');
+ }
+}
+
+void swallow()     /* Eat something. */
+{
+ switch (thing) {
+  case wine: switch (dna.winestate) {
+         /* 4 is perfect */
+          case 1: {
+              if (dna.teetotal)  { dixi('D',6); return; }
+              dixi('U',1); wobble; dixi('U',2);
+              dna.obj[wine]=false; objectlist;
+              have_a_drink();
+             }
+             break;
+          case 2:case 3: dixi('d',8); break; /* You can't drink it! */
+         }
+         break;
+  case potion: { background(4); dixi('U',3); gameover; background(0); } break;
+  case ink: dixi('U',4); break;
+  case chastity: dixi('U',5); break;
+  case mushroom: {
+             dixi('U',6);
+             gameover;
+            }
+            break;
+  case onion: if (dna.rotten_onion)  dixi('U',11);
+         else {
+          dixi('U',8);
+          dna.obj[onion]=false;
+          objectlist;
+         }
+         break;
+  default:
+    if (set::of(r__argentpub,r__nottspub, eos).has(dna.room)) 
+      display("Try BUYing things before you drink them!");
+    else
+      display("The taste of it makes you retch!");
+         /* Constant- leave this one */
+ }
+}
+
+void others()
+ /* This lists the other people in the room. */
+{
+ char fv;
+ byte num_people,this_person,here;
+
+
+ num_people=0;
+ this_person=0;
+ here=dna.room;
+
+ for( fv='\227'; fv <= '\262'; fv ++) /* Start at 151 so we don't list Avvy himself! */
+  if (whereis[fv]==here) 
+   num_people += 1;
+
+ /* If nobody's here, we can cut out straight away. */
+
+ if (num_people==0)  return; /* Leave the procedure. */
+
+ for( fv='\227'; fv <= '\262'; fv ++)
+  if (whereis[fv]==here) 
+  {
+   this_person += 1;
+   if (this_person==1)   /* First on the list. */
+    display(getname(fv)+'\4'); else
+    if (this_person<num_people)    /* The middle... */
+     display(string(", ")+getname(fv)+'\4'); else
+      display(string(" and ")+getname(fv)+'\4'); /* The end. */
+  }
+
+ if (num_people==1)  display(" is\4"); else display(" are\4");
+
+ display(" here."); /* End and display it. */
+}
+
+void lookaround()
+/* This is called when you say "look." */
+{
+ display(also[0][1]);
+ switch (dna.room) {
+  case r__spludwicks: if (dna.avaricius_talk>0)  dixi('q',23); else others(); break;
+  case r__robins: {
+              if (dna.tied_up)  dixi('q',38);
+              if (dna.mushroom_growing)  dixi('q',55);
+             }
+             break;
+  case r__insidecardiffcastle: if (~ dna.taken_pen)  dixi('q',49); break;
+  case r__lustiesroom: if (dna.lustie_is_asleep)  dixi('q',65); break;
+  case r__catacombs: switch (dna.cat_y*256+dna.cat_x) {
+                 case 258 : dixi('q',80); break; /* Inside art gallery */
+                 case 514 : dixi('q',81); break; /* Outside ditto */
+                 case 260 : dixi('q',82); break; /* Outside Geida's room. */
+                }
+                break;
+  default: others();
+ }
+}
+
+void opendoor()     /* so whaddya THINK this does?! */
+{
+    byte fv;
+
+ switch (dna.room) {   /* Special cases. */
+   case r__yours: if (infield(2)) 
+             {     /* Opening the box. */
+              thing='\66'; /* The box. */ person=pardon;
+              examine();
+              return;
+             }
+             break;
+   case r__spludwicks: if (thing=='\75')  {
+                    dixi('q',85);
+                    return;
+                  }
+                  break;
+ }
+
+
+ if ((~ dna.user_moves_avvy) & (dna.room!=r__lusties))
+        return; /* No doors can open if you can't move Avvy. */
+ for( fv=9; fv <= 15; fv ++)
+  if (infield(fv)) 
+  {
+   { void& with = portals[fv]; 
+    switch (op) {
+     case exclaim: { tr[1].bounce; dixi('x',data); } break;
+     case transport: fliproom(hi(data),lo(data)); break;
+     case unfinished: {
+                  tr[1].bounce;
+                  display("\7Sorry.\3\rThis place is not available yet!");
+                 }
+                 break;
+     case special: call_special(data); break;
+     case mopendoor: open_the_door(hi(data),lo(data),fv); break;
+    }}
+    return;
+   }
+ if (dna.room==r__map) 
+  display(string("Avvy, you can complete the whole game without ever going ")+
+                 "to anywhere other than Argent, Birmingham, Cardiff, "+
+                 "Nottingham and Norwich.");
+ else display("Door? What door?");
+}
+
+void putproc();
+
+
+static void silly()
+{
+ display("Don't be silly!");
+}
+
+void putproc()     /* Called when you call vb_put. */
+{
+    char temp;
+
+
+ if (! holding())  return;
+ thing2 -= 49;   /* Slip the second object */
+ temp=thing; thing=thing2; if (! holding())  return;
+ thing=temp;
+
+ /* Thing is the thing which you're putting in. Thing2 is where you're
+   putting it. */
+             /* Convenience thing. */
+  switch (thing2) {
+   case wine: if (thing==onion) 
+         {
+          if (dna.rotten_onion) 
+          display(string("That's a bit like shutting the stable door after the ")+
+                   "horse has bolted!");
+          else {     /* Put onion into wine? */
+           if (dna.winestate!=3) 
+            display("\6Oignon au vin\22 is a bit too strong for your tastes!");
+           else {     /* Put onion into vinegar! Yes! */
+            onion_in_vinegar=true;
+            points(7);
+            dixi('u',9);
+           }
+          }
+         } else silly();
+         break;
+
+    case '\66': if (room==1)  /* Put something into the box. */
+         {
+          if (box_contents!=nowt) 
+           display(string("There's something in the box already, Avvy. Try taking")+
+            " that out first.");
+          else
+           switch (thing) {
+            case money: display("You'd better keep some ready cash on you!"); break;
+            case bell: display("That's a silly place to keep a bell."); break;
+            case bodkin: display("But you might need it!"); break;
+            case onion: display("Just give it to Spludwick, Avvy!"); break;
+            default:
+            {     /* Put the object into the box... */
+             if (wearing==thing) 
+              display(string("You'd better take ")+get_better(thing)+" off first!");
+             else
+             {
+              show_one(5); /* Open box. */
+              box_contents=thing;
+              dna.obj[thing]=false;
+              objectlist;
+              display("OK, it's in the box.");
+              show_one(6); /* Shut box. */
+             }
+            }
+           }
+         } else silly();
+         break;
+
+   default: silly();
+  }
+}
+
+boolean give2spludwick();
+
+ /* The result of this fn is whether or not he says "Hey, thanks!" */
+static void not_in_order()
+{
+ display(string("Sorry, I need the ingredients in the right order for this potion.")+
+  " What I need next is "+
+   get_better(spludwick_order[dna.given2spludwick])+".\232\2");
+}
+
+
+
+static void go_to_cauldron()
+{
+   tr[2].call_eachstep=false;  /* Stops Geida_Procs. */
+   set_up_timer(1,procspludwick_goes_to_cauldron,reason_spludwalk);
+   tr[2].walkto(2);
+}
+
+boolean give2spludwick()
+
+{
+ boolean give2spludwick_result;
+ {
+
+  give2spludwick_result=false;
+
+  if (spludwick_order[given2spludwick]!=thing) 
+  {
+   not_in_order();
+   return give2spludwick_result;
+  }
+
+  switch (thing) {
+   case onion:
+    {
+     obj[onion]=false;
+     if (rotten_onion) 
+      dixi('q',22);
+     else {
+      given2spludwick += 1;
+      dixi('q',20);
+      go_to_cauldron();
+      points(3);
+     }
+     objectlist;
+    }
+    break;
+   case ink: {
+         obj[ink]=false;
+         objectlist;
+         given2spludwick += 1;
+         dixi('q',24);
+         go_to_cauldron();
+         points(3);
+        }
+        break;
+   case mushroom: {
+              obj[mushroom]=false;
+              dixi('q',25);
+              points(5);
+              given2spludwick += 1;
+              go_to_cauldron();
+              obj[potion]=true;
+              objectlist;
+             }
+             break;
+   default: give2spludwick_result=true;
+  }
+ }
+ return give2spludwick_result;
+}
+
+void have_a_drink()
+{
+ {
+  alcohol += 1;
+  if (alcohol==5) 
+  {
+   obj[key]=true;  /* Get the key. */
+   teetotal=true;
+   avvy_is_awake=false;
+   avvy_in_bed=true;
+   objectlist;
+   dusk;
+   hang_around_for_a_while;
+   fliproom(1,1);
+   background(14);
+   new_game_for_trippancy; /* Not really */
+  }
+ }
+}
+
+void cardiff_climbing()
+{
+ if (dna.standing_on_dais) 
+ {     /* Clamber up. */
+  display("You climb down, back onto the floor.");
+  dna.standing_on_dais=false;
+  apped(1,3);
+ } else
+ {     /* Clamber down. */
+  if (infield(1)) 
+  {
+    display("You clamber up onto the dais.");
+    dna.standing_on_dais=true;
+    apped(1,2);
+  } else
+    display("Get a bit closer, Avvy.");
+ }
+}
+
+void stand_up();
+
+  /* Called when you ask Avvy to stand. */
+static void already()
+{
+ display("You're already standing!");
+}
+
+void stand_up()
+{
+  switch (dna.room) {
+   case r__yours: /* Avvy isn't asleep. */
+              if (avvy_in_bed)    /* But he's in bed. */
+              {
+               if (teetotal) 
+               {
+                dixi('d',12);
+                background(0);
+                dixi('d',14);
+               }
+               tr[1].visible=true;
+               user_moves_avvy=true;
+               apped(1,2);
+               dna.rw=left;
+               show_one(4); /* Picture of empty pillow. */
+               points(1);
+               avvy_in_bed=false;
+               lose_timer(reason_arkata_shouts);
+              } else already();
+              break;
+
+    case r__insidecardiffcastle: cardiff_climbing(); break;
+
+    case r__nottspub: if (sitting_in_pub)  {
+                  show_one(4); /* Not sitting down. */
+                  tr[1].visible=true;  /* But standing up. */
+                  apped(1,4); /* And walking away. */
+                  sitting_in_pub=false;  /* Really not sitting down. */
+                  user_moves_avvy=true;  /* And ambulant. */
+                 } else already();
+                 break;
+   default: already();
+  }
+}
+
+void getproc(char thing)
+{
+  switch (room) {
+   case r__yours:
+     if (infield(2)) 
+     {
+      if (box_contents==thing) 
+      {
+       show_one(5);
+       display("OK, I've got it.");
+       obj[thing]=true; objectlist;
+       box_contents=nowt;
+       show_one(6);
+      } else
+       display(string("I can't see ")+get_better(thing)+" in the box.");
+     } else dixi('q',57);
+     break;
+  case r__insidecardiffcastle:
+    switch (thing) {
+     case pen:
+     {
+      if (infield(2)) 
+      {     /* Standing on the dais. */
+
+       if (dna.taken_pen) 
+        display("It's not there, Avvy.");
+       else
+       {     /* OK: we're taking the pen, and it's there. */
+        show_one(4); /* No pen there now. */
+        call_special(3); /* Zap! */
+        dna.taken_pen=true;
+        dna.obj[pen]=true;
+        objectlist;
+        display("Taken.");
+       }
+      } else if (dna.standing_on_dais)  dixi('q',53); else dixi('q',51);
+     }
+     break;
+      case bolt: dixi('q',52); break;
+     default: dixi('q',57);
+    }
+    break;
+  case r__robins: if ((thing==mushroom) & (infield(1)) & (dna.mushroom_growing))
+                  {
+              show_one(3);
+              display("Got it!");
+              dna.mushroom_growing=false;
+              dna.taken_mushroom=true;
+              dna.obj[mushroom]=true;
+              objectlist;
+              points(3);
+             } else dixi('q',57);
+             break;
+  default: dixi('q',57);
+ }
+}
+
+void give_geida_the_lute()
+{
+ {
+  if (room!=r__lustiesroom) 
+  {
+   display("Not yet. Try later!\232\2");
+   return;
+  }
+  dna.obj[lute]=false;
+  objectlist;
+  dixi('q',64); /* She plays it. */
+
+   /* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+
+  set_up_timer(1,procgive_lute_to_geida,reason_geida_sings);
+  back_to_bootstrap(4);
+ }
+}
+
+void play_harp()
+{
+ if (infield(7)) 
+  musical_scroll;
+ else display("Get a bit closer to it, Avvy!");
+}
+
+void winsequence()
+{
+ dixi('q',78);
+ first_show(7); then_show(8); then_show(9);
+ start_to_close;
+ set_up_timer(30,procwinning,reason_winning);
+}
+
+void person_speaks()
+{
+    boolean found; byte fv; char cfv;
+
+
+  if ((person==pardon) || (person=='\0')) 
+  {
+   if ((him==pardon) || (whereis[him]!=dna.room))  person=her;
+    else person=him;
+  }
+
+  if (whereis[person]!=dna.room) 
+  {
+   display("\231\4"); /* Avvy himself! */
+   return;
+  }
+
+  found=false;  /* The person we're looking for's code is in Person. */
+
+  for( fv=1; fv <= numtr; fv ++)
+   if (tr[fv].quick & (chr(tr[fv].a.accinum+149)==person)) 
+   {
+    display(string('\23')+chr(fv+48)+'\4');
+    found=true;
+   }
+
+  if (! found) 
+    for( fv=10; fv <= 25; fv ++)
+     { void& with = quasipeds[fv]; 
+     if ((who==person) && (room==dna.room)) 
+     {
+      display(string('\23')+chr(fv+55)+'\4');
+     }}
+}
+
+void do_that();
+
+static void heythanks()
+{
+  person_speaks();
+  display("Hey, thanks!\2(But now, you've lost it!)");
+  dna.obj[thing]=false;
+}
+
+void do_that()
+{
+      const array<'\63','\72',varying_string<6> > booze = {{"Bitter","GIED","Whisky","Cider","","","","Mead"}};
+    byte fv,ff; integer sx,sy; boolean ok;
+
+
+ if (thats==nowt)  { thats=""; return; }
+ if (weirdword)  return;
+ if (thing<'\310')  thing -= 49;   /* "Slip" */
+
+ if ((~ alive) &
+  ! (set::of(vb_load,vb_save,vb_quit,vb_info,vb_help,vb_larrypass,
+     vb_phaon,vb_boss,vb_cheat,vb_restart,vb_dir,vb_score,
+     vb_highscores,vb_smartalec, eos).has(verb)))
+       {
+        display(string("You're dead, so don't talk. What are you, a ghost ")+
+         "or something? Try restarting, or restoring a saved game!"); return;
+       }
+
+ if ((~ dna.avvy_is_awake) &
+  ! (set::of(vb_load,vb_save,vb_quit,vb_info,vb_help,vb_larrypass,
+     vb_phaon,vb_boss,vb_cheat,vb_restart,vb_dir,vb_die,vb_score,
+     vb_highscores,vb_smartalec,vb_expletive,vb_wake, eos).has(verb)))
+       {
+        display("Talking in your sleep? Try waking up!"); return;
+       }
+
+
+ switch (verb) {
+  case vb_exam: examine(); break;
+  case vb_open: opendoor(); break;
+  case vb_pause: display(string("Game paused.")+'\3'+'\15'+'\15'+"Press Enter, Esc, or click "+
+             "the mouse on the `O.K.\" box to continue.");
+             break;
+  case vb_get: {
+           if (thing!=pardon) 
+           {     /* Legitimate try to pick something up. */
+            if (dna.carrying>=maxobjs)  display("You can't carry any more!");
+            else getproc(thing);
+
+           } else
+           {     /* Not... ditto. */
+            if (person!=pardon) 
+             display("You can't sweep folk off their feet!"); else
+            display("I assure you, you don't need it.");
+           }
+          }
+          break;
+  case vb_drop: display(string("Two years ago you dropped a florin in the street. Three days ")+
+       "later it was gone! So now you never leave ANYTHING lying around. OK?");
+       break;
+/*       begin dna.obj[thing]:=false; objectlist; end;*/
+  case vb_inv: inv(); break;
+  case vb_talk:  if (person==pardon) 
+            {
+              if (subjnumber==99)   /* They typed "say password". */
+                display("Yes, but what \6is\22 the password?");
+              else if (set::of(range(1,49),253,249, eos).has(subjnumber)) 
+              {
+                Delete(thats,1,1);
+                move(realwords[2],realwords[1],sizeof(realwords)-sizeof(realwords[1]));
+                verb=chr(subjnumber);
+                do_that(); return;
+              } else
+              {
+                person=chr(subjnumber); subjnumber=0;
+                if (set::of(pardon,'\0', eos).has(person))  display("Talk to whom?");
+                 else if (personshere())  talkto(ord(person));
+              }
+            } else if (person==pardon)  display("Talk to whom?");
+            else if (personshere())  talkto(ord(person));
+            break;
+
+  case vb_give: if (holding()) 
+           {
+            if (person==pardon)  display("Give to whom?"); else
+            if (personshere()) 
+            {
+             switch (thing) {
+              case money : display("You can't bring yourself to give away your moneybag."); break;
+              case bodkin:case bell:case clothes:case habit :
+                    display("Don't give it away, it might be useful!");
+                    break;
+              default: switch (person) {
+                      case pcrapulus: switch (thing) {
+                                 case wine: {
+                                        display("Crapulus grabs the wine and gulps it down.");
+                                        dna.obj[wine]=false;
+                                       }
+                                       break;
+                                 default: heythanks();
+                                }
+                                break;
+                     case pcwytalot: if (set::of(crossbow,bolt, eos).has(thing)) 
+                                 display(string("You might be able to influence ")+
+                                 "Cwytalot more if you used it!");
+                                else heythanks();
+                                break;
+                     case pspludwick: if (give2spludwick())  heythanks(); break;
+                     case pibythneth: if (thing==badge) 
+                                 {
+                                  dixi('q',32); /* Thanks! Wow! */
+                                  points(3);
+                                  dna.obj[badge]=false;
+                                  dna.obj[habit]=true;
+                                  dna.givenbadgetoiby=true;
+                                  show_one(8); show_one(9);
+                                 } else heythanks();
+                                 break;
+                     case payles: if (dna.ayles_is_awake) 
+                             {
+                               if (thing==pen) 
+                               {
+                                dna.obj[pen]=false;
+                                dixi('q',54);
+                                dna.obj[ink]=true;
+                                dna.given_pen_to_ayles=true;
+                                objectlist;
+                                points(2);
+                               } else heythanks();
+                             } else
+                               display("But he's asleep!");
+                               break;
+                     case pgeida: switch (thing) {
+                              case potion : {
+                                        dna.obj[potion]=false;
+                                        dixi('u',16); /* She drinks it. */
+                                        points(2);
+                                        dna.geida_given_potion=true;
+                                        objectlist;
+                                       }
+                                       break;
+                              case lute: give_geida_the_lute(); break;
+                              default: heythanks();
+                             }
+                             break;
+                     case parkata: switch (thing) {
+                              case potion: if (dna.geida_given_potion) 
+                                       winsequence();
+                                      else dixi('q',77);
+                                      break;             /* That Geida woman! */
+                              default: heythanks();
+                             }
+                             break;
+                    default: heythanks();
+                   }
+             }
+            }
+            objectlist; /* Just in case... */
+           }
+           break;
+
+  case vb_eat:case vb_drink: if (holding())  swallow(); break;
+  case vb_load: edna_load(realwords[2]); break;
+  case vb_save: if (alive)  edna_save(realwords[2]);
+           else display("It's a bit late now to save your game!");
+           break;
+  case vb_pay: display("No money need change hands."); break;
+  case vb_look: lookaround(); break;
+  case vb_break: display("Vandalism is prohibited within this game!"); break;
+  case vb_quit: { /* quit */
+            if (demo) 
+            {
+             dixi('q',31);
+             close(demofile);
+             exit(0); /* Change this later!!! */
+            }
+        if (! polite)  display("How about a `please\", Avvy?"); else
+         if (ask("\23C\26Do you really want to quit?"))  lmo=true;
+       }
+       break;
+  case vb_go: display("Just use the arrow keys to walk there."); break;
+  case vb_info: {
+            aboutscroll=true;
+/*            display('Thorsoft of Letchworth presents:'+^c+^m+^m+
+             'The medi‘val descendant of'+^m+
+             'Denarius Avaricius Sextus'+^m+'in:'+
+             ^m+^m+'LORD AVALOT D''ARGENT'+
+             ^m+'version '+vernum+^m+^m+'Copyright ï '
+             +copyright+', Mark, Mike and Thomas Thurman.');*/
+             display(string("\r\r\r\r\r\r\r")+"LORD AVALOT D'ARGENT"+"\3\r"+
+              "The medi‘val descendant of"+'\15'+
+              "Denarius Avaricius Sextus"+
+              '\15'+'\15'+"version "+vernum+'\15'+'\15'+"Copyright ï "
+              +copyright+", Mark, Mike and Thomas Thurman."+'\23'+'Y'+'\26');
+             aboutscroll=false;
+           }
+           break;
+  case vb_undress: if (dna.wearing==nowt)  display("You're already stark naked!");
+               else
+            if (dna.avvys_in_the_cupboard) 
+            {
+             display(string("You take off ")+get_better(dna.wearing)+'.');
+             dna.wearing=nowt; objectlist;
+            } else
+            display("Hadn't you better find somewhere more private, Avvy?");
+            break;
+  case vb_wear: if (holding()) 
+       {     /* wear something */
+        switch (thing) {
+         case chastity: display("Hey, what kind of a weirdo are you\??!"); break;
+         case clothes:case habit: { /* Change this! */
+                         if (dna.wearing!=nowt) 
+                         {
+                          if (dna.wearing==thing) 
+                            display("You're already wearing that.");
+                          else
+                            display(string("You'll be rather warm wearing two ")+
+                           "sets of clothes!");
+                          return;
+                         } else
+                         dna.wearing=thing; objectlist;
+                         if (thing==habit)  fv=3; else fv=0;
+                         { void& with = tr[1]; 
+                          if (whichsprite!=fv) 
+                          {
+                           sx=tr[1].x; sy=tr[1].y;
+                           done;
+                           init(fv,true);
+                           appear(sx,sy,left);
+                           tr[1].visible=false;
+                          }}
+                        }
+                        break;
+         default: display(what);
+        }
+       }
+       break;
+  case vb_play: if (thing==pardon) 
+            switch (dna.room) { /* They just typed "play"... */
+             case r__argentpub: play_nim; break; /* ...in the pub, => play Nim. */
+             case r__musicroom: play_harp(); break;
+            }
+           else if (holding()) 
+           {
+            switch (thing) {
+             case lute : {
+                     dixi('U',7);
+                     if (whereis[pcwytalot]==dna.room)  dixi('U',10);
+                     if (whereis[pdulustie]==dna.room)  dixi('U',15);
+                    }
+                    break;
+             case '\64' : if (dna.room==r__musicroom)  play_harp();
+                    else display(what);
+                    break;
+             case '\67' : if (dna.room==r__argentpub)  play_nim;
+                    else display(what);
+                    break;
+             default: display(what);
+            }
+           }
+           break;
+  case vb_ring: if (holding()) 
+       {
+        if (thing==bell) 
+        {
+         display("Ding, dong, ding, dong, ding, dong, ding, dong...");
+         if ((dna.ringing_bells) & (flagset('B'))) 
+          display("(Are you trying to join in, Avvy\?\?!)");
+        } else display(what);
+       }
+       break;
+  case vb_help: boot_help; break;
+  case vb_larrypass: display("Wrong game!"); break;
+  case vb_phaon: display("Hello, Phaon!"); break;
+  case vb_boss: bosskey; break;
+  case vb_pee: if (flagset('P')) 
+          {
+           display("Hmm, I don't think anyone will notice...");
+           set_up_timer(4,procurinate,reason_gototoilet);
+          } else display("It would be \6VERY\22 unwise to do that here, Avvy!");
+          break;
+  case vb_cheat: {
+             display(string('\6')+"Cheat mode now enabled.");
+             cheat=true;
+            }
+            break;
+  case vb_magic: if (dna.avaricius_talk>0) 
+             dixi('q',19);
+            else {
+             if ((dna.room==12) & (infield(2))) 
+             {     /* Avaricius appears! */
+              dixi('q',17);
+              if (whereis['\227']==12) 
+               dixi('q',18);
+              else
+              {
+               tr[2].init(1,false); /* Avaricius */
+               apped(2,4);
+               tr[2].walkto(5);
+               tr[2].call_eachstep=true;
+               tr[2].eachstep=procback_and_forth;
+               dna.avaricius_talk=14;
+               set_up_timer(177,procavaricius_talks,reason_avariciustalks);
+              }
+             } else display("Nothing appears to happen...");
+            }
+            break;
+  case vb_smartalec: display("Listen, smart alec, that was just rhetoric."); break;
+  case vb_expletive: {
+         switch (swore) {
+          case 0: display(string("Avvy! Do you mind? There might be kids playing!\r\r")+
+              "(I shouldn't say it again, if I were you!)");
+              break;
+          case 1: display(string("You hear a distant rumble of thunder. Must you always ")+
+              "do things I tell you not to?\r\rDon't do it again!");
+              break;
+         default:
+          {
+           zonk;
+           display(string("A crack of lightning shoots from the sky, ")+
+            "and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
+           gameover;
+          }
+         }
+         swore += 1;
+        }
+        break;
+  case vb_listen: if ((dna.ringing_bells) & (flagset('B'))) 
+              display(string("All other noise is drowned out by the ringing of ")+
+                       "the bells.");
+             else
+              if (listen=="") 
+               display("You can't hear anything much at the moment, Avvy.");
+                else display(listen);
+                break;
+  case vb_buy: {
+           /* What are they trying to buy? */
+           switch (dna.room) {
+            case r__argentpub: if (infield(6)) 
+                {     /* We're in a pub, and near the bar. */
+                 switch (thing) {
+                  case '\63':case '\65':case '\66':case '\72': { /* Beer, whisky, cider or mead */
+                            if (dna.malagauche==177)   /* Already getting us one. */
+                              { dixi('D',15); return; }
+                            if (dna.teetotal)  { dixi('D',6); return; }
+                            if (dna.alcohol==0)  points(3);
+                            show_one(12);
+                            display(booze[thing]+", please.\231\2");
+                            dna.drinking=thing;
+
+                            show_one(10);
+                            dna.malagauche=177;
+                            set_up_timer(27,procbuydrinks,reason_drinks);
+                           }
+                           break;
+                  case '\64': examine(); break; /* We have a right one here- buy Pepsi??! */
+                  case wine: if (dna.obj[wine])  /* We've already got the wine! */
+                          dixi('D',2); /* 1 bottle's shufishent! */
+                         else {
+                          if (dna.malagauche==177)   /* Already getting us one. */
+                            { dixi('D',15); return; }
+                          if (dna.carrying>=maxobjs) 
+                             { display("Your hands are full."); return; }
+                          show_one(12); display("Wine, please.\231\2");
+                          if (dna.alcohol==0)  points(3);
+                          show_one(10);
+                          dna.malagauche=177;
+
+                          set_up_timer(27,procbuywine,reason_drinks);
+                         }
+                         break;
+                 }
+                } else dixi('D',5);
+                break;                /* Go to the bar! */
+
+            case r__outsideducks: if (infield(6)) 
+             {
+              if (thing==onion) 
+              {
+               if (dna.obj[onion]) 
+                dixi('D',10); /* not planning to juggle with the things! */
+               else
+               if (dna.carrying>=maxobjs) 
+                  display("Before you ask, you remember that your hands are full.");
+               else
+               {
+                if (dna.bought_onion) 
+                 dixi('D',11); else
+                  { dixi('D',9); points(3); }
+                pennycheck(3); /* It costs thruppence. */
+                dna.obj[onion]=true;
+                objectlist;
+                dna.bought_onion=true;
+                dna.rotten_onion=false;  /* It's OK when it leaves the stall! */
+                dna.onion_in_vinegar=false;
+               }
+              } else dixi('D',0);
+             } else dixi('D',0);
+             break;
+
+             case r__nottspub: dixi('n',15); break; /* Can't sell to southerners. */
+            default: dixi('D',0); /* Can't buy that. */
+           }
+          }
+          break;
+  case vb_attack: {
+              if ((dna.room==r__brummieroad) &&
+               ((person=='\235') || (thing==crossbow) || (thing==bolt))
+               && (whereis['\235']==dna.room)) 
+              {
+               switch (ord(dna.obj[bolt])+ord(dna.obj[crossbow])*2) {
+                /* 0 = neither, 1 = only bolt, 2 = only crossbow,
+                  3 = both. */
+                case 0: {
+                    dixi('Q',10);
+                    display("(At the very least, don't use your bare hands!)");
+                   }
+                   break;
+                case 1: display(string("Attack him with only a crossbow bolt? Are you ")+
+                    "planning on playing darts?!");
+                    break;
+                case 2: display(string("Come on, Avvy! You're not going to get very far ")+
+                     "with only a crossbow!");
+                     break;
+                case 3: {
+                    dixi('Q',11);
+                    dna.cwytalot_gone=true;
+                    dna.obj[bolt]=false; dna.obj[crossbow]=false;
+                    objectlist;
+                    magics[12].op=nix;
+                    points(7);
+                    tr[2].walkto(2);
+                    tr[2].vanishifstill=true;
+                    tr[2].call_eachstep=false;
+                    whereis['\235']=177;
+                   }
+                   break;
+                default: dixi('Q',10); /* Please try not to be so violent! */
+               }
+              } else dixi('Q',10);
+             }
+             break;
+  case vb_password: if (dna.room!=r__bridge) 
+                dixi('Q',12); else
+               {
+                ok=true;
+                for( ff=1; ff <= length(thats); ff ++)
+                 for( fv=1; fv <= length(words[dna.pass_num+first_password].w); fv ++)
+                  if (words[dna.pass_num+first_password].w[fv] !=
+                          upcase(realwords[ff][fv]))
+                        ok=false;
+                if (ok) 
+                {
+                 if (dna.drawbridge_open!=0) 
+                   display("Contrary to your expectations, the drawbridge fails to close again.");
+                 else
+                 {
+                    points(4);
+                    display("The drawbridge opens!");
+                    set_up_timer(7,procopen_drawbridge,reason_drawbridgefalls);
+                    dna.drawbridge_open=1;
+                 }
+                } else dixi('Q',12);
+               }
+               break;
+   case vb_dir: dir(realwords[2]); break;
+   case vb_die: gameover; break;
+   case vb_score: display(string("Your score is ")+strf(dna.score)+",\3\rout of a "+
+                      "possible 128.\r\rThis gives you a rank of "+rank()+
+                      ".\r\r"+totaltime());
+                      break;
+   case vb_put: putproc(); break;
+   case vb_stand: stand_up(); break;
+
+   case vb_kiss: if (person==pardon)
+                   display("Kiss whom?");
+            else if (personshere()) 
+            switch (person) {
+             case '\226' ... '\256': display("Hey, what kind of a weirdo are you??"); break;
+             case parkata: dixi('U',12); break;
+             case pgeida: dixi('U',13); break;
+             case pwisewoman: dixi('U',14); break;
+             default: dixi('U',5); /* You WHAT? */
+            }
+            break;
+
+   case vb_climb: if (dna.room==r__insidecardiffcastle)  cardiff_climbing();
+             else /* In the wrong room! */
+              display("Not with your head for heights, Avvy!");
+              break;
+
+   case vb_jump: {
+             set_up_timer(1,procjump,reason_jumping);
+             dna.user_moves_avvy=false;
+            }
+            break;
+
+   case vb_highscores: show_highs; break;
+
+   case vb_wake: if (personshere()) 
+              switch (person) {
+               case pardon:case pavalot:case '\0': if (~ avvy_is_awake) 
+                    {
+                     avvy_is_awake=true;
+                     points(1);
+                     avvy_in_bed=true;
+                     show_one(3); /* Picture of Avvy, awake in bed. */
+                     if (teetotal)  dixi('d',13);
+                    } else display("You're already awake, Avvy!");
+                    break;
+               case payles: if (~ ayles_is_awake)  display("You can't seem to wake him by yourself."); break;
+               case pjacques: display(string("Brother Jacques, Brother Jacques, are you asleep?\231\2")+
+                          "Hmmm... that doesn't seem to do any good...");
+                          break;
+               default: display("It's difficult to awaken people who aren't asleep...!");
+              }
+              break;
+
+   case vb_sit: if (dna.room==r__nottspub) 
+           {
+            if (dna.sitting_in_pub) 
+             display("You're already sitting!");
+            else
+            {
+             tr[1].walkto(4); /* Move Avvy to the place, and sit him down. */
+             set_up_timer(1,procavvy_sit_down,reason_sitting_down);
+            }
+           } else
+           {     /* Default doodah. */
+            dusk;
+            hang_around_for_a_while;
+            dawn;
+            display("A few hours later...\20nothing much has happened...");
+           }
+           break;
+
+   case vb_restart: if (ask("Restart game and lose changes?"))  {
+                dusk;
+                newgame;
+                dawn;
+               }
+               break;
+
+  case pardon: display("Hey, a verb would be helpful!"); break;
+
+  case vb_hello: { person_speaks(); display("Hello.\2"); } break;
+  case vb_thanks: { person_speaks(); display("That's OK.\2"); } break;
+  default: display(string('\7')+"Parser bug!");
+ }
+}
+
+void verbopt(char n, string& answer, char& anskey)
+{
+ switch (n) {
+   case vb_exam: { answer="Examine"; anskey='x'; } break; /* the ubiqutous one */
+   /* vb_give isn't dealt with by this procedure, but by ddm__with */
+  case vb_drink: { answer="Drink";   anskey='D'; } break;
+  case vb_wear:  { answer="Wear";    anskey='W'; } break;
+  case vb_ring:  { answer="Ring";    anskey='R'; } break; /* only the bell! */
+  case vb_play:  { answer="Play";    anskey='P'; } break;
+  case vb_eat:   { answer="Eat";     anskey='E'; } break;
+  default:      { answer="? Unknown!"; anskey='?'; }      /* Bug! */
+ }
+}
+
+class unit_acci_initialize {
+  public: unit_acci_initialize();
+};
+static unit_acci_initialize acci_constructor;
+
+unit_acci_initialize::unit_acci_initialize() {
+ weirdword=false;
+}
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
new file mode 100644
index 0000000..f9d1265
--- /dev/null
+++ b/engines/avalanche/acci.h
@@ -0,0 +1,223 @@
+#ifndef __acci_h__
+#define __acci_h__
+
+
+/* verb codes */
+const char vb_exam = '\1'; const char vb_open = '\2'; const char vb_pause = '\3'; const char vb_get = '\4'; const char vb_drop = '\5';
+const char vb_inv = '\6'; const char vb_talk = '\7'; const char vb_give = '\10'; const char vb_drink = '\11'; const char vb_load = '\12';
+const char vb_save = '\13'; const char vb_pay = '\14'; const char vb_look = '\15'; const char vb_break = '\16'; const char vb_quit = '\17';
+const char vb_sit = '\20'; const char vb_stand = '\21'; const char vb_go = '\22'; const char vb_info = '\23'; const char vb_undress = '\24';
+const char vb_wear = '\25'; const char vb_play = '\26'; const char vb_ring = '\27'; const char vb_help = '\30';
+const char vb_larrypass = '\31'; const char vb_phaon = '\32'; const char vb_boss = '\33'; const char vb_pee = '\34';
+const char vb_cheat = '\35'; const char vb_magic = '\36'; const char vb_restart = '\37'; const char vb_eat = '\40';
+const char vb_listen = '\41'; const char vb_buy = '\42'; const char vb_attack = '\43'; const char vb_password = '\44';
+const char vb_dir = '\45'; const char vb_die = '\46'; const char vb_score = '\47'; const char vb_put = '\50';
+const char vb_kiss = '\51'; const char vb_climb = '\52'; const char vb_jump = '\53'; const char vb_highscores = '\54';
+const char vb_wake = '\55'; const char vb_hello = '\56'; const char vb_thanks = '\57';
+
+const char vb_smartalec = '\371'; const char vb_expletive = '\375';
+
+const char pardon = '\376'; /* =didn't understand / wasn't given. */
+
+struct vocab {
+         byte n; varying_string<11> w;
+};
+
+struct ranktype {
+            word score; varying_string<12> title;
+};
+
+
+const integer nowords = 277; /* how many words does the parser know? */
+const char nowt = '\372';
+const char moved = '\0'; /* This word was moved. (Usually because it was the subject of
+  conversation.) */
+
+const integer first_password = 89; /* Words[first_password] should equal "TIROS". */
+
+const array<1,nowords,vocab> words = 
+
+/* Verbs, 1-49 */
+{{{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
+ {2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
+ {3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
+ {4, "TAKE"},      {4, "GET"},       {4, "PICK"},
+ {5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
+ {7, "SAY"},       {7, "ASK"},
+ {8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
+ {9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
+ {11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
+ {13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
+ {15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
+ {17, "STAND"},
+
+ {18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
+ {20, "DOFF"},
+ {21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
+ {22, "PLAY"},
+ {22, "STRUM"},     {23, "RING"},      {24, "HELP"},
+ {25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
+ {255,"NINET"},     /* block for NINETY */
+ {28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
+ {30,"ABRACADABRA"},{30, "PLUGH"},     {30, "XYZZY"},
+ {30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
+ {30, "WIZZY"},     {30, "PLOVER"},
+ {30,"MELENKURION"},{30, "ZORTON"},    {30, "BLERBI"},
+ {30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
+ {30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
+ {30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
+ {30, "BONESCROLLS"},{30, "RADOF"},
+
+ {31, "RESTART"},
+ {32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
+ {33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
+ {34, "ORDER"},     {34, "DEMAND"},
+ {35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
+ {35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
+ {35, "FIRE"},
+
+ /* Passwords, 36: */
+
+ {36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
+ {36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
+ {36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
+ {36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
+ {36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
+ {36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
+ {36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
+ {36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
+ {36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
+ {36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
+
+ {37, "DIR"},       {37, "LS"},        {38, "DIE"},
+ {39, "SCORE"},
+ {40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
+ {41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
+ {42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
+ {44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
+ {46, "HELLO"},     {46, "HI"},        {46, "YO"},
+ {47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
+
+
+/* Nouns - Objects: 50-100. */
+
+ {50, "WINE"},      {50, "BOOZE"},    {50,"NASTY"},
+ {50, "VINEGAR"},   {51, "MONEYBAG"},
+ {51, "BAG"},       {51, "CASH"},     {51,"DOSH"},
+ {51, "WALLET"},
+ {52, "BODKIN"},    {52, "DAGGER"},   {53,"POTION"},
+ {54, "CHASTITY"},  {54, "BELT"},     {55,"BOLT"},
+ {55, "ARROW"},     {55, "DART"},
+ {56, "CROSSBOW"},  {56, "BOW"},      {57,"LUTE"},
+ {58, "PILGRIM"},   {58, "BADGE"},    {59,"MUSHROOMS"},
+ {59, "TOADSTOOLS"},{60, "KEY"},      {61,"BELL"},
+ {62, "PRESCRIPT"}, {62, "SCROLL"},   {62,"MESSAGE"},
+ {63, "PEN"},       {63, "QUILL"},    {64,"INK"},
+ {64, "INKPOT"},    {65, "CLOTHES"},  {66,"HABIT"},
+ {66, "DISGUISE"},  {67, "ONION"},
+
+ {99,"PASSWORD"},
+
+/* Objects from Also are placed between 101 and 131. */
+
+/* Nouns - People - Male, 150-174 */
+ {150, "AVVY"},      {150,"AVALOT"},    {150,"YOURSELF"},
+ {150, "ME"},        {150,"MYSELF"},    {151,"SPLUDWICK"},
+ {151, "THOMAS"},    {151,"ALCHEMIST"}, {151,"CHEMIST"},
+ {152, "CRAPULUS"},  {152,"SERF"},      {152,"SLAVE"},
+ {158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
+ {152, "CRAPPY"},    {153,"DUCK"},      {153,"DOCTOR"},
+ {154, "MALAGAUCHE"},
+ {155, "FRIAR"},     {155,"TUCK"},      {156,"ROBIN"},
+ {156, "HOOD"},      {157,"CWYTALOT"},  {157,"GUARD"},
+ {157, "BRIDGEKEEP"},{158,"BARON"},     {158,"LUSTIE"},
+ {159, "DUKE"},      {159,"GRACE"},     {160,"DOGFOOD"},
+ {160, "MINSTREL"},  {161,"TRADER"},    {161,"SHOPKEEPER"},
+ {161,"STALLHOLDER"},
+ {162, "PILGRIM"},   {162,"IBYTHNETH"}, {163,"ABBOT"},
+ {163, "AYLES"},     {164,"PORT"},      {165,"SPURGE"},
+ {166, "JACQUES"},   {166,"SLEEPER"},   {166,"RINGER"},
+
+/* Nouns- People - Female: 175-199 */
+ {175, "WIFE"},      {175,"ARKATA"},    {176,"GEDALODAVA"},
+ {176, "GEIDA"},     {176,"PRINCESS"},  {178,"WISE"},
+ {178, "WITCH"},
+
+/* Pronouns, 200-224 */
+ {200, "HIM"},       {200,"MAN"},       {200,"GUY"},
+ {200, "DUDE"},      {200,"CHAP"},      {200,"FELLOW"},
+ {201, "HER"},       {201,"GIRL"},      {201,"WOMAN"},
+ {202, "IT"},        {202,"THING"},
+
+ {203,"MONK"},       {204,"BARMAN"},    {204,"BARTENDER"},
+
+/* Prepositions, 225-249 */
+ {225, "TO"},        {226,"AT"},        {227,"UP"},
+ {228, "INTO"},      {228,"INSIDE"},    {229,"OFF"},
+ {230, "UP"},        {231,"DOWN"},      {232,"ON"},
+
+
+/* Please, 251 */
+ {251, "PLEASE"},
+
+/* About, 252 */
+ {252, "ABOUT"}, {252, "CONCERNING"},
+
+/* Swear words, 253 */
+       /*              I M P O R T A N T    M E S S A G E
+
+          DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+          DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+          GOODNESS KNOWS WHO WROTE THEM.
+          READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+          WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+
+ {253, "SHIT"},      {28 ,"PISS"},    {28 ,"PEE"},
+ {253, "FART"},      {253,"FUCK"},    {253,"BALLS"},
+ {253, "BLAST"},     {253,"BUGGER"},  {253,"KNICKERS"},
+ {253, "BLOODY"},    {253,"HELL"},    {253,"DAMN"},
+ {253, "SMEG"},
+   /* and other even ruder words. You didn't read them, did you? Good. */
+
+/* Answer-back smart-alec words, 249 */
+ {249, "YES"},       {249,"NO"},        {249,"BECAUSE"},
+
+/* Noise words, 255 */
+ {255, "THE"},       {255,'A'},         {255,"NOW"},
+ {255, "SOME"},      {255,"AND"},       {255,"THAT"},
+ {255, "POCUS"},     {255,"HIS"},       
+ {255, "THIS"},      {255,"SENTINEL"}}};        /* for "Ken SENT Me" */
+
+const char what[] = "That's not possible!";
+
+const array<1,9,ranktype> ranks = 
+{{{0, "Beginner"},    {10, "Novice"},
+{20, "Improving"},   {35, "Not bad"},
+{50, "Passable"},    {65, "Good"},
+{80, "Experienced"}, {108, "The BEST!"},
+{maxint, "copyright'93"}}};
+
+
+#ifdef __acci_implementation__
+#undef EXTERN
+#define EXTERN
+#endif
+
+EXTERN varying_string<11> thats;
+EXTERN varying_string<20> unknown;
+EXTERN array<1,11,varying_string<20> > realwords;
+EXTERN char verb,person,thing,thing2;
+EXTERN boolean polite;
+#undef EXTERN
+#define EXTERN extern
+
+
+void clearwords();
+void parse();
+void lookaround();
+void opendoor();
+void do_that();
+void verbopt(char n, string& answer, char& anskey);
+void have_a_drink();
+
+#endif
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
new file mode 100644
index 0000000..17853e6
--- /dev/null
+++ b/engines/avalanche/also.cpp
@@ -0,0 +1,1028 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Rodent.h"*/
+/*#include "Crt.h"*/
+
+/*$R+,V-*/
+
+typedef matrix<0,255,0,15,byte> fonttype;
+
+class fieldtype {
+public:
+             integer x1,y1,x2,y2;
+};
+
+class linetype : public fieldtype {
+public:
+            byte col;
+};
+
+struct pedtype {
+           integer x,y; byte dir;
+};
+
+struct magictype {
+             byte op; /* one of the operations */
+             word data; /* data for them */
+};
+
+const integer numlines = 50; const integer up = 0; const integer right = 1; const integer down = 2; const integer left = 3; const integer ur = 4; const integer dr = 5; const integer dl = 6; const integer ul = 7;
+const integer still = 8;
+
+const integer nay = maxint;
+
+/* Magic commands are */
+
+/*N*/ const integer nix = 0; /* ignore it if this line is touched */
+/*B*/ const integer bounce = 1; /* bounce off this line */
+/*E*/ const integer exclaim = 2; /* put up a chain of scrolls */
+/*T*/ const integer transport = 3; /* enter new room */
+/*U*/ const integer unfinished = 4; /* unfinished connection */
+/*S*/ const integer special = 5; /* special call */
+/*O*/ const integer opendoor = 6; /* slowly opening door. */
+
+integer gd,gm;
+array<1,numlines,linetype> lines;
+array<1,numlines,fieldtype> fields;
+boolean do1;
+byte current;
+string n;
+matrix<0,29,1,2,string> names;
+file<fonttype> f;
+fonttype skinny;
+byte tx,ty;
+matrix<0,79,0,22,char> chars;
+byte cursorflash;
+array<1,15,pedtype> peds;
+array<1,15,magictype> magics;
+array<9,15,magictype> portals;
+varying_string<26> flags;
+string listen;
+
+const graphcursmasktype crosshairs = 
+{ 
+    ((63551,63807,63807,63807,61727,257,897,32765,897,257,61727,63807,63807,63807,63551,65535),
+     (4368,21140,8840,53910,640,640,31868,33026,31868,640,640,53910,8840,21140,4368,0)),
+               7,
+               7};
+
+const graphcursmasktype hook = 
+{ 
+    ((32831,32831,49279,49279,57599,61695,61471,61447,63491,57089,36801,32771,49159,57375,63743,65535),
+     (0,16256,7936,7936,3584,1536,1792,2016,248,28,8220,12344,8160,1792,0,0)),
+               2,
+               9};
+
+const graphcursmasktype tthand = 
+{ 
+    ((62463,57855,57855,57855,57471,49167,32769,0,0,0,0,32768,49152,57344,61441,61443),
+     (3072,4608,4608,4608,4992,12912,21070,36937,36873,36865,32769,16385,8193,4097,2050,4092)),
+               4,
+               0};
+
+string strf(longint x)
+{
+    string q;
+string strf_result;
+;
+ str(x,q); strf_result=q;
+return strf_result;
+}
+
+void glimpse(byte ret)       /* glimpse of screen 3 */
+{
+    char sink;
+;
+ hidemousecursor; setvisualpage(3); setcrtpagenumber(3); showmousecursor;
+ do {; } while (!(~ anymousekeypressed));
+ do {; } while (!anymousekeypressed);
+ hidemousecursor; setvisualpage(ret); setcrtpagenumber(ret); showmousecursor;
+ while (keypressed())  sink=readkey();
+}
+
+void newline(byte t, integer p,integer q,integer r,integer s, byte c)
+{;
+ {
+ linetype& with = lines[t]; 
+ ;
+  x1=p; y1=q; x2=r; y2=s; with.col=c;
+ }
+}
+
+void newfield(byte t, integer p,integer q,integer r,integer s)
+{; {
+                         fieldtype& with = fields[t];  ; with.x1=p; with.y1=q; with.x2=r; with.y2=s; } }
+
+void drawped(byte p)
+{;
+ { pedtype& with = peds[p]; 
+  if (with.dir<177) 
+  {;
+   setcolor(p); circle(with.x,with.y,5); moveto(with.x,with.y);
+   switch (with.dir) {
+    case up:   linerel(0,-5); break;  case down:  linerel(0,5); break;
+    case left: linerel(-7,0); break;  case right: linerel(7,0); break;
+    case ul:   linerel(-7,-5); break; case dl:    linerel(-7, 5); break;
+    case ur:   linerel( 7,-5); break; case dr:    linerel( 7, 5); break;
+   }
+  }}
+}
+
+void drawup()
+{
+    byte fv;
+;
+ cleardevice();
+ for( fv=1; fv <= numlines; fv ++)
+  { linetype& with = lines[fv]; 
+   if (x1!=nay) 
+   {;
+    setcolor(with.col);
+    line(x1,y1,x2,y2);
+   }}
+ for( fv=1; fv <= numlines; fv ++)
+  { fieldtype& with = fields[fv]; 
+   if (with.x1!=nay) 
+   {;
+    setcolor(fv);
+    rectangle(with.x1,with.y1,with.x2,with.y2);
+   }}
+ for( fv=1; fv <= 15; fv ++) drawped(fv);
+}
+
+void addped()
+{
+    byte n,fv;
+;
+ n=0; do { n += 1; } while (!((n==16) || (peds[n].dir==177)));
+ setcrtpagenumber(0); setactivepage(0); setvisualpage(0);
+ drawup(); setgraphicscursor(tthand); showmousecursor;
+ do {
+  if (rightmousekeypressed)  return;
+  if (keypressed())  glimpse(0);
+ } while (!leftmousekeypressed);
+ hidemousecursor;
+ {
+ pedtype& with = peds[n]; 
+ ;
+  with.x=mousex; with.y=mousey;
+ }
+ cleardevice(); setfillstyle(6,9); for( fv=1; fv <= 3; fv ++) bar(200*fv,0,200*fv,200);
+ for( fv=1; fv <= 2; fv ++) bar(0,60*fv,640,60*fv);
+ showmousecursor;
+ do { if (rightmousekeypressed)  return; } while (!leftmousekeypressed);
+ hidemousecursor;
+ { pedtype& with = peds[n]; 
+  switch (((mousex / 200)*10)+(mousey / 60)) {
+   case 0: with.dir=ul; break;   case 10: with.dir=up; break;    case 20: with.dir=ur; break;
+   case 1: with.dir=left; break; case 11: with.dir=still; break; case 21: with.dir=right; break;
+   case 2: with.dir=dl; break;   case 12: with.dir=down; break;  case 22: with.dir=dr; break;
+  }}
+}
+
+void addline(byte ccc)
+{
+    byte fv;
+;
+ do {
+  for( fv=1; fv <= numlines; fv ++)
+   { linetype& with = lines[fv]; 
+    if (x1==nay) 
+    {;
+     x1=fv*17; x2=x1; y1=200; y2=190; with.col=ccc;
+     return; /* bad style! */
+    }}
+ } while (!false);
+}
+
+byte colour()
+{
+    byte fv;
+byte colour_result;
+;
+ setactivepage(0); setvisualpage(0); setcrtpagenumber(0);
+ outtextxy(0,0,"Select a colour, please...");
+ for( fv=1; fv <= 15; fv ++)
+ {;
+  setfillstyle(1,fv);
+  bar(fv*40,27,39+fv*40,200);
+ }
+ showmousecursor;
+ do {
+  if (rightmousekeypressed)  {; hidemousecursor; return colour_result; }
+  if (keypressed())  glimpse(2);
+ } while (!leftmousekeypressed);
+ hidemousecursor;
+ colour_result=getpixel(mousex,mousey); cleardevice();
+return colour_result;
+}
+
+void addfield()
+{
+    byte fv; boolean ok;
+;
+ do {
+  fv=colour();
+  ok=fields[fv].x1==nay;
+  if (! ok)  output << '\7';
+ } while (!ok);
+ {
+ fieldtype& with = fields[fv]; 
+ ;
+  with.x1=300+fv*17; with.x2=with.x1+1; with.y1=200; with.y2=177;
+ }
+}
+
+byte checkline()
+{
+    byte fv,ans;
+byte checkline_result;
+;
+ setgraphicscursor(crosshairs);
+ setcrtpagenumber(0); setactivepage(0); setvisualpage(0); drawup();
+ do {
+  showmousecursor;
+  do {
+   if (rightmousekeypressed)  {; checkline_result=255; return checkline_result; }
+   if (keypressed())  glimpse(0);
+  } while (!leftmousekeypressed);
+  hidemousecursor;
+  setactivepage(1); ans=177;
+  for( fv=1; fv <= numlines; fv ++) /*  */
+  {;
+   { linetype& with = lines[fv]; 
+    if (x1!=nay) 
+    {;
+     setcolor( 9); line(x1,y1,x2,y2);
+     if (getpixel(mousex,mousey)==9)  ans=fv;
+     setcolor( 0); line(x1,y1,x2,y2);
+    }}
+   { fieldtype& with = fields[fv]; 
+    if (with.x1!=nay) 
+    {;
+     setcolor( 9); rectangle(with.x1,with.y1,with.x2,with.y2);
+     if (getpixel(mousex,mousey)==9)  ans=fv+100;
+     setcolor( 0); rectangle(with.x1,with.y1,with.x2,with.y2);
+    }}
+  }
+  setactivepage(0);
+ } while (!(ans!=177));
+ checkline_result=ans;
+return checkline_result;
+}
+
+void chooseside();
+static boolean itsaline; 
+
+static void plotline()
+{;
+ if (itsaline) 
+  { linetype& with = lines[gd]; 
+   if (do1)  line(mousex,mousey,x2,y2); else
+    line(x1,y1,mousex,mousey);}
+ else
+  { fieldtype& with = fields[gd]; 
+   if (do1)  rectangle(mousex,mousey,with.x2,with.y2); else
+    rectangle(with.x1,with.y1,mousex,mousey);}
+}
+
+void chooseside()
+{
+    byte clicol,savelcol;fieldtype current; integer temp;
+;
+ do {
+  gd=checkline(); itsaline=gd<100;
+  if (gd==255)  {; hidemousecursor; return; }
+  if (! itsaline)  gd -= 100;
+  setactivepage(2); setvisualpage(2); cleardevice();
+  setgraphicscursor(tthand); setcrtpagenumber(2);
+  if (itsaline) 
+  {;
+   current=lines[gd];
+   savelcol=lines[gd].col;
+  } else current=fields[gd];
+  {;
+   setcolor(9);
+   if (itsaline)  line(current.x1,current.y1,current.x2,current.y2); else rectangle(current.x1,current.y1,current.x2,current.y2);
+    setcolor(9);
+    setfillstyle(1,red);   bar(current.x1-3,current.y1-3,current.x1+3,current.y1+3);
+    setfillstyle(1,green); bar(current.x2-3,current.y2-3,current.x2+3,current.y2+3);
+   do {; } while (!(~ anymousekeypressed));
+   clicol=177; showmousecursor;
+  do {
+   if (anymousekeypressed) 
+   {;
+    hidemousecursor;
+    clicol=getpixel(mousex,mousey);
+    showmousecursor;
+   }
+   if (rightmousekeypressed) 
+    {; hidemousecursor; return; }
+   if (keypressed())  glimpse(2);
+  } while (!(set::of(red,green, eos).has(clicol)));
+  do1=clicol==red; hidemousecursor;
+  setgraphicscursor(hook); setcrtpagenumber(0);
+  setactivepage(0); setvisualpage(0); setcolor(0);
+  if (itsaline) 
+  {
+                     linetype& with1 = lines[gd];  ; line(current.x1,current.y1,current.x2,current.y2); setcolor(with1.col); } else
+  {
+                     fieldtype& with1 = fields[gd];  ; rectangle(with1.x1,with1.y1,with1.x2,with1.y2); setcolor(gd); }
+  setwritemode(xorput);
+  while (~ anymousekeypressed) 
+  {;
+   plotline();
+   showmousecursor; delay(1); hidemousecursor;
+   plotline();
+   if (rightmousekeypressed)  {; hidemousecursor; return; }
+   if (keypressed())  glimpse(0);
+  }
+  /* update "current" rec */
+  if (do1)  {; current.x1=mousex; current.y1=mousey; }
+   else {; current.x2=mousex; current.y2=mousey; }
+  if (! itsaline) 
+  {;
+   if (current.x1>current.x2)  {; temp=current.x2; current.x2=current.x1; current.x1=temp; }
+   if (current.y1>current.y2)  {; temp=current.y2; current.y2=current.y1; current.y1=temp; }
+  }
+  /* copy "current" to line/field */
+  if (itsaline) 
+   {
+   linetype& with1 = lines[gd]; 
+   ;
+    current.x1=current.x1; current.x2=current.x2; current.y1=current.y1; current.y2=current.y2;
+    with1.col=savelcol;
+   } else fields[gd]=current;
+ }
+ setwritemode(0);
+ } while (!false);
+}
+
+void delped()
+{;
+ setcrtpagenumber(0); setactivepage(0); setvisualpage(0);
+ drawup(); setgraphicscursor(tthand); showmousecursor;
+ do {; } while (!leftmousekeypressed); peds[colour()].dir=177;
+}
+
+byte menu();
+
+static void say(byte y, string x)
+{;
+ setfillstyle(1,y);
+ bar(0,y*17,100,y*17+15); outtextxy(123,y*17,x);
+}
+
+byte menu()
+{
+    byte clicol;
+byte menu_result;
+;
+  setcolor(15); settextstyle(0,0,2); clicol=0; setgraphicscursor(tthand);
+  setvisualpage(2); setactivepage(2); setcrtpagenumber(2); cleardevice();
+  say(3,"Move lines around");
+  say(4,"Add a new line");
+  say(5,"Delete a line");
+  say(6,"Add a ped");
+  say(7,"Delete a ped");
+  say(8,"Add a field");
+  say(10,"Return to Also.");
+  showmousecursor;
+  do {
+   if (leftmousekeypressed) 
+   {;
+    hidemousecursor;
+    clicol=getpixel(mousex,mousey);
+    showmousecursor;
+   }
+   if (rightmousekeypressed)  {; hidemousecursor; return menu_result; }
+   if (keypressed())  glimpse(2);
+  } while (!(clicol>0));
+  do {; } while (!(~ anymousekeypressed));
+  hidemousecursor;
+  menu_result=clicol;
+return menu_result;
+}
+
+void removeline()
+{;
+ gd=checkline(); if (gd==255)  {; hidemousecursor; return; }
+ if (gd>100) 
+  fields[gd-100].x1=nay;
+ else lines[gd].x1=nay;  /* cancels it out */
+ cleardevice(); drawup();
+}
+
+void lino()
+{;
+ resetmouse;
+ do {
+  switch (menu()) {
+   case 3: chooseside(); break;
+   case 4: addline(colour()); break;
+   case 5: removeline(); break;
+   case 6: addped(); break;
+   case 7: delped(); break;
+   case 8: addfield(); break;
+  case 10: return; break;
+  }
+ } while (!false);
+}
+
+void loadscreen()     /* load2 */
+{
+ byte a /*absolute $A000:246560*/;
+ byte bit;
+ untyped_file f;
+;
+ setactivepage(3); setvisualpage(3);
+ assign(f,string("c:\\avalot\\place")+n+".avd"); reset(f,1); seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a,12080);
+ }
+ close(f);
+ setvisualpage(0);
+ outtextxy(0,190,"Look carefully, and then press any key...");
+ setactivepage(0);
+}
+
+void ctrlsout(string& x)          /* Replace real ctrls with caret codes */
+{
+    byte fv; string xx;
+;
+ xx="";
+ for( fv=1; fv <= length(x); fv ++)
+  if (x[fv]>'\37')  xx=xx+x[fv]; else xx=xx+'^'+chr(ord(x[fv])+64);
+ x=xx;
+}
+
+void ctrlsin(string& x)          /* Opposite of ctrlsout */
+{
+    byte fv; string xx; boolean ctrlwas;
+;
+ xx=""; ctrlwas=false;
+ for( fv=1; fv <= length(x); fv ++)
+  if (ctrlwas)    /* last char was a caret */
+   {;
+    xx=xx+chr(ord(upcase(x[fv]))-64);
+    ctrlwas=false;
+   }
+  else
+  {;     /* last char wasn't a caret... */
+   if (x[fv]=='^')  ctrlwas=true; else  /* ...but this one is */
+    xx=xx+x[fv];  /* ...but this one isn't */
+  }
+ x=xx;
+}
+
+void flipover()     /* temp view other screen */
+{
+    char r;
+;
+ setvisualpage(3); r=readkey(); setvisualpage(0);
+}
+
+void plotchar(byte x,byte y, char n)
+{
+    byte fv;
+;
+ if (chars[x][y]==n)  return;
+ for( fv=0; fv <= 15; fv ++)
+  mem[0xa000*y*1200+(fv+3)*80+x]=skinny[ord(n)][fv];
+ chars[x][y]=n;
+}
+
+void cursor()
+{
+    byte fv;
+;
+ cursorflash += 1;
+ switch (cursorflash) {
+  case 1:case 127: for( fv=12; fv <= 14; fv ++)
+          mem[0xa000*ty*1200+(3+fv)*80+tx]=~(mem[0xa000*ty*1200+(3+fv)*80+tx]);
+          break;
+  case 255: cursorflash=0; break;
+ }
+}
+
+void losecursor()
+{;
+ if (cursorflash<127)  {; cursorflash=126; cursor(); }
+ cursorflash=0;
+}
+
+void gwrite(string x)
+{
+    byte fv;
+;
+ for( fv=1; fv <= length(x); fv ++)
+ {;
+  plotchar(tx,ty,x[fv]);
+  tx += 1;
+  if (tx==80)  {; ty += 1; tx=0; }
+ }
+}
+
+string typein(string x)
+{
+      const char marker = '\2';
+    byte p; char r;
+string typein_result;
+;
+ setvisualpage(0); setactivepage(0); cleardevice();
+ settextstyle(0,0,1); setcolor(15);
+ outtextxy( 0,  0,"Press TAB to see the room...");
+ outtextxy( 0, 20,"You may use any of these Control Codes:");
+ outtextxy(30, 30,"Anywhere: ^M = new line, ^P = new scroll, |1 fix to speaker 1.");
+ outtextxy(90, 40,"^B = new bubble");
+ outtextxy(30, 50,"At end of line: ^C = centre line, ^L = left justify.");
+ outtextxy(30, 60,"At end of scroll: ^D = Don't add automatic ^P here.");
+ outtextxy( 0, 80,"(Use by typing in (eg for ^P) ^ then P, not Ctrl-P.)");
+ p=0; ctrlsout(x); fillchar(chars,sizeof(chars),'\40');
+ do {
+  tx=0; ty=6; gwrite(x+'\4'+'\40');
+  tx=(p % 80); ty=(p / 80)+6;
+  while (! keypressed())  {; delay(1); cursor(); } losecursor();
+  r=readkey();
+  switch (r) {
+   case '\10': if (p>0)  {; x=copy(x,1,p-1)+copy(x,p+1,255); p -= 1; } break; /* backspace */
+   case '\11': flipover(); break;
+   case '\40' ... '\377': {; x=copy(x,1,p)+r+copy(x,p+1,255); p += 1; } break;
+   case '\0': switch (readkey()) { /* extd. keystroke */
+        case 'G': p=0; break; /* Home */
+        case 'K': if (p>0)  p -= 1; break; /* left */
+        case 'M': if (p<length(x))  p += 1; break; /* right */
+        case 'H': if (p>80)  p -= 80; break; /* up */
+        case 'P': if (p<length(x)-80)  p += 80; break; /* down */
+        case 'O': p=length(x); break; /* End */
+        case 'S': x=copy(x,1,p)+copy(x,p+2,255); break; /* Del */
+       }
+       break;
+  }
+ } while (!(r=='\15'));
+ ctrlsin(x); typein_result=x;
+return typein_result;
+}
+
+byte typeno(string title)
+{
+ varying_string<2> x; char r; integer e; word p;
+byte typeno_result;
+;
+ cleardevice(); x="000";
+ settextstyle(0,0,3); setcolor(9); outtextxy(0,0,title);
+ setfillstyle(1,0); setcolor(10); fillchar(chars,sizeof(chars),'\40');
+ do {
+  bar(100,100,150,125);
+  outtextxy(100,100,x);
+  do { r=readkey(); } while (!(set::of(range('0','9'),'\33','\15', eos).has(r)));
+  if (r=='\33')  {; typeno_result=255; return typeno_result; }
+  if (r!='\15')  x=string(x[2])+r;
+ } while (!(r=='\15'));
+ val(x,p,e); typeno_result=p;
+return typeno_result;
+}
+
+void showallnames()
+{
+    byte fv; varying_string<2> s; char r;
+;
+ settextstyle(0,0,2); cleardevice(); setcolor(13); outtextxy(0,0,"Descriptions start...");
+ settextstyle(0,0,1); setcolor(7);
+ for( fv=1; fv <= 29; fv ++)
+ {;
+  str(fv,2,s);
+  outtextxy((fv / 15)*320,((fv % 15)*10)+30,s+'='+copy(names[fv][1],0,33));
+ }
+ setcolor(15); outtextxy(500,190,"Press any key...");
+ r=readkey();
+}
+
+void showallassoc();
+
+
+static void saascreen()
+{;
+ settextstyle(0,0,2); cleardevice(); setcolor(10); outtextxy(0,0,"Everything...");
+ settextstyle(0,0,1); setcolor(2);
+ outtextxy(17,20,"(Format: <number> : <start of names> : <start of desc.>)");
+}
+
+void showallassoc()
+{
+    byte fv; varying_string<2> s; char r;
+
+;
+ saascreen();
+ for( fv=1; fv <= 30; fv ++)
+ {;
+  str(fv-1,2,s);
+  outtextxy(0,(((fv-1) % 10)*10)+30,
+   s+':'+copy(names[fv-1][1],1,7)+':'+copy(names[fv-1][2],1,70));
+  if ((fv % 10)==0)  {; r=readkey(); saascreen(); }
+ }
+ setcolor(15); outtextxy(500,190,"Press any key...");
+ r=readkey();
+}
+
+void clear()
+{
+    byte fv;
+;
+ fillchar(names ,sizeof(names ),  '\0');
+ for( fv=1; fv <= numlines; fv ++) {; lines[fv].x1=nay; fields[fv].x1=nay; }
+ fillchar(peds  ,sizeof(peds  ),'\261');
+}
+
+void scramble();
+
+static void scram1(string& x)
+{
+    byte fz;
+;
+ for( fz=1; fz <= length(x); fz ++)
+  x[fz]=chr(ord(x[fz]) ^ 177);
+}
+
+void scramble()     /* Works both ways. */
+{
+    byte fv,ff;
+;
+ for( fv=0; fv <= 29; fv ++)
+  for( ff=1; ff <= 2; ff ++)
+   scram1(names[fv][ff]);
+ scram1(listen);
+ scram1(flags);
+}
+
+void save()
+{
+    string x; untyped_file f; byte minnames,minlines,minpeds,minfields,fv,ff;
+;
+ minnames =0; for( fv=0; fv <= 29; fv ++) if (names[fv][1]!="")     minnames =fv;
+ minlines =0; for( fv=1; fv <= numlines; fv ++)
+                if (lines[fv].x1!=nay)   minlines =fv;
+ minpeds  =0; for( fv=1; fv <= 15; fv ++) if (peds[fv].dir<177)    minpeds  =fv;
+ minfields=0; for( fv=1; fv <= 30; fv ++) if (fields[fv].x1!=nay)  minfields=fv;
+ assign(f,string("c:\\avalot\\also")+n+".avd");
+ rewrite(f,1);
+ x=string("This is an Also .AVD file, which belongs to AVALOT.EXE. Its contents")+
+ '\15'+'\12'+"are subject to copyright, so there. Have fun!"+'\32'+" *Minstrel* ";
+ blockwrite(f,x[1],128);
+ scramble();
+ blockwrite(f,minnames,1);
+ for( fv=0; fv <= minnames; fv ++)
+  for( ff=1; ff <= 2; ff ++)
+   blockwrite(f,names[fv][ff],length(names[fv][ff])+1);
+ blockwrite(f,minlines,1);
+ blockwrite(f,lines,sizeof(lines[1])*minlines);
+ blockwrite(f,minpeds,1);
+ blockwrite(f,peds,sizeof(peds[1])*minpeds);
+ blockwrite(f,minfields,1);
+ blockwrite(f,fields,sizeof(fields[1])*minfields);
+ blockwrite(f,magics,sizeof(magics));
+ blockwrite(f,portals,sizeof(portals));
+ blockwrite(f,flags,sizeof(flags));
+ blockwrite(f,listen[0],1);
+ blockwrite(f,listen[1],length(listen));
+ close(f);
+ scramble();
+}
+
+void load();
+static untyped_file f; 
+
+
+static string nextstring()
+{
+    byte l; string x;
+string nextstring_result;
+;
+ x=""; blockread(f,l,1); blockread(f,x[1],l); x[0]=chr(l); nextstring_result=x;
+return nextstring_result;
+}
+
+void load()
+{
+            byte minnames,minlines,minpeds,minfields; byte ff,fv;
+
+;
+ clear();
+ assign(f,string("c:\\avalot\\also")+n+".avd");
+/*$I-*/ reset(f,1); /*$I+*/ if (ioresult!=0)  return; /* no Also file */
+ seek(f,128); blockread(f,minnames,1);
+ for( fv=0; fv <= minnames; fv ++)
+  for( ff=1; ff <= 2; ff ++)
+   names[fv][ff]=nextstring();
+ blockread(f,minlines,1);
+ blockread(f,lines,sizeof(lines[1])*minlines);
+ blockread(f,minpeds,1);
+ blockread(f,peds,sizeof(peds[1])*minpeds);
+ blockread(f,minfields,1);
+ blockread(f,fields,sizeof(fields[1])*minfields);
+ blockread(f,magics,sizeof(magics));
+ blockread(f,portals,sizeof(portals));
+ blockread(f,flags,sizeof(flags));
+ blockread(f,listen[0],1);
+ blockread(f,listen[1],length(listen));
+ close(f);
+ scramble();
+}
+
+void editmagics();
+const array<1,15,char> codes = "123456789ABCDEF";
+
+static integer y;
+
+
+static void display()
+{
+    byte fv;
+;
+ cleardevice();
+ settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Magics.");
+ settextstyle(0,0,1);
+ for( fv=1; fv <= 15; fv ++)
+ {;
+  y=23+fv*10;
+  setcolor(fv); outtextxy(100,y,string('$')+codes[fv-1]);
+  {
+  magictype& with = magics[fv]; 
+  ;
+   switch (with.op) {
+    case nix: {; setcolor(8); outtextxy(140,y,"Nix"); } break;
+    case bounce: {; setcolor(10); outtextxy(143,y,"Bounce!"); } break;
+    case exclaim: {;
+              setcolor(14); outtextxy(143,y,string("Exclaim: ")+strf(with.data));
+             }
+             break;
+    case transport: {;
+                setcolor(12);
+                outtextxy(143,y,string("Transport to ")+strf(hi(with.data))+
+                 ", ped "+strf(lo(with.data)));
+               }
+               break;
+    case unfinished: {;
+                 setcolor(15); outtextxy(143,y,"*** UNFINISHED! ***");
+                }
+                break;
+    case special: {;
+              setcolor(6); outtextxy(143,y,string("Special call no. ")+strf(with.data));
+             }
+             break;
+    case opendoor: {;
+               setcolor(11);
+               outtextxy(143,y,string("Opening door to ")+strf(hi(with.data))+
+                ", ped "+strf(lo(with.data)));
+              }
+              break;
+   }
+  }
+ }
+ outtextxy(177,190,"Which do you want to change\? (Esc=Exit) $");
+}
+
+
+
+static word ask(string x)
+{
+    string q; word thomaswashere; integer e;
+word ask_result;
+;
+ cleardevice();
+ setcolor(10); settextstyle(0,0,3); outtextxy(0,100,x);
+ do {
+  input >> q >> NL; val(q,thomaswashere,e);
+ } while (!(e==0)); ask_result=thomaswashere;
+return ask_result;
+}
+
+void editmagics()
+{
+ char r,rr; byte p;
+
+;
+ do {
+  display();
+  do {
+   r=upcase(readkey());
+   if (r=='\33')  return;
+   p=pos(r,codes);  /* which are we editing? */
+  } while (!(p>0)); /* it must BE there... */
+  setcolor(p); cleardevice();
+  outtextxy(177,17,string("Editing magic $")+r+'.');
+  outtextxy(0,30,"New operation ( (N)ix, (B)ounce, (E)xclaim, (T)ransport, (U)nfinished),");
+  outtextxy(30,40,"(S)pecial, (O)pening Door?");
+  do { rr=upcase(readkey()); } while (!(set::of('N','B','E','T','U','S','O','\33', eos).has(rr)));
+  { magictype& with = magics[p]; 
+   switch (rr) {
+    case '\33': return; break; /* cancelling code */
+    case 'N': with.op=nix; break;
+    case 'B': with.op=bounce; break;
+    case 'E': {; with.op=exclaim; with.data=ask("Which scroll?"); } break;
+    case 'T': {; with.op=transport; with.data=ask("Ped no.?")+ask("Whither?")*256; } break;
+    case 'U': with.op=unfinished; break;
+    case 'S': {; with.op=special; with.data=ask("Which call?"); } break;
+    case 'O': {; with.op=opendoor; with.data=ask("Ped no.?")+ask("Whither?")*256; } break;
+   }}
+ } while (!false);
+}
+
+void editportals();
+const array<9,15,char> codes1 = "9ABCDEF";
+
+static integer y2;
+
+
+static void display1()
+{
+    byte fv;
+;
+ cleardevice();
+ settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Portals.");
+ settextstyle(0,0,1);
+ for( fv=9; fv <= 15; fv ++)
+ {;
+  y2=fv*10-53;
+  setcolor(fv); outtextxy(100,y2,string('$')+codes1[fv-1]);
+  {
+  magictype& with = portals[fv]; 
+  ;
+   switch (with.op) {
+    case nix: {; setcolor(8); outtextxy(140,y2,"Nix"); } break;
+    case exclaim: {;
+              setcolor(14); outtextxy(143,y2,string("Exclaim: ")+strf(with.data));
+             }
+             break;
+    case transport: {;
+                setcolor(12);
+                outtextxy(143,y2,string("Transport to ")+strf(hi(with.data))+
+                 ", ped "+strf(lo(with.data)));
+               }
+               break;
+    case unfinished: {;
+                 setcolor(15); outtextxy(143,y2,"*** UNFINISHED! ***");
+                }
+                break;
+    case special: {;
+              setcolor(6); outtextxy(143,y2,string("Special call no. ")+strf(with.data));
+             }
+             break;
+    case opendoor: {;
+               setcolor(11);
+               outtextxy(143,y2,string("Opening door to ")+strf(hi(with.data))+
+                ", ped "+strf(lo(with.data)));
+              }
+              break;
+   }
+  }
+ }
+ outtextxy(177,190,"Which do you want to change\? (Esc=Exit) $");
+}
+
+
+
+static word ask1(string x)
+{
+    string q; word thomaswashere; integer e;
+word ask1_result;
+;
+ cleardevice();
+ setcolor(10); settextstyle(0,0,3); outtextxy(0,100,x);
+ do {
+  input >> q >> NL; val(q,thomaswashere,e);
+ } while (!(e==0)); ask1_result=thomaswashere;
+return ask1_result;
+}
+
+void editportals()     /* much t'same as editmagics */
+{
+ char r,rr; byte p;
+
+;
+ do {
+  display1();
+  do {
+   r=upcase(readkey());
+   if (r=='\33')  return;
+   p=pos(r,codes1); /* which are we editing? */
+  } while (!(p>0)); /* it must BE there... */
+  p += 8; setcolor(p); cleardevice();
+  outtextxy(177,17,string("Editing portal $")+r+'.');
+  outtextxy(0,30,"New operation ( (N)ix, (E)xclaim, (T)ransport, (U)nfinished),");
+  outtextxy(30,40,"(S)pecial, (O)pening Door?");
+  do { rr=upcase(readkey()); } while (!(set::of('N','E','T','U','S','O','\33', eos).has(rr)));
+  { magictype& with = portals[p]; 
+   switch (rr) {
+    case '\33': return; break; /* cancelling code */
+    case 'N': with.op=nix; break;
+    case 'E': {; with.op=exclaim; with.data=ask1("Which scroll?"); } break;
+    case 'T': {; with.op=transport; with.data=ask1("Ped no.?")+ask1("Whither?")*256; } break;
+    case 'U': with.op=unfinished; break;
+    case 'S': {; with.op=special; with.data=ask1("Which call?"); } break;
+    case 'O': {; with.op=opendoor; with.data=ask1("Ped no.?")+ask1("Whither?")*256; } break;
+   }}
+ } while (!false);
+}
+
+void editflags()
+{
+    char r;
+;
+ cleardevice();
+ settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Flags.");
+ settextstyle(0,0,1); setcolor(10);
+ outtextxy(100,30,"Press the letter of the flag you want to toggle.");
+ outtextxy(100,40,"Tab = flip screens, Esc/Enter = return to menu.");
+ setcolor(14); setfillstyle(1,0);
+ for( r='A'; r <= 'Z'; r ++)
+  if (pos(r,flags)>0)  outtextxy(ord(r)*20-1223,77,r);
+ do {
+  do { r=upcase(readkey()); } while (!(set::of(range('A','Z'),'\33','\15','\11', eos).has(r)));
+  switch (r) {
+   case RANGE_26('A','Z'): {;
+              if (pos(r,flags)>0) 
+              {;     /* flag is on- switch it off */
+               Delete(flags,pos(r,flags),1);
+               bar(ord(r)*20-1223,77,ord(r)*20-1213,87);
+               sound(1777); delay(7); nosound;
+              } else
+              {;     /* flag is off- switch it on */
+               flags=flags+r;
+               outtextxy(ord(r)*20-1223,77,r);
+               sound(177); delay(7); nosound;
+              }
+             }
+             break;
+   case '\33':case '\15': return; break;
+   case '\11': flipover(); break;
+  }
+ } while (!false);
+}
+
+void alsomenu()
+{
+    char r; byte t;
+;
+ do {
+  setactivepage(0); setvisualpage(0);
+  cleardevice(); setcolor(15); settextstyle(0,0,2);
+  outtextxy(0,0,"Also... Main Menu");
+  settextstyle(0,0,1); setcolor(10);
+  outtextxy(100, 40,"1) Edit the names of an object");
+  outtextxy(100, 50,"2) View all names");
+  outtextxy(100, 60,"3) Edit the description of this object");
+  outtextxy(100, 70,"4) View all associations.");
+  outtextxy(100, 80,"5) Enter Lino mode.");
+  outtextxy(100, 90,"6) Edit magics.");
+  outtextxy(100,100,"7) Edit portals.");
+  outtextxy(100,110,"8) Edit flags.");
+  outtextxy(100,120,"9) Edit listen field.");
+  outtextxy(100,160,"S) Save");
+  outtextxy(100,170,"L) Load");
+  outtextxy( 80,180,"Tab) View other screen");
+  if (current==0)  outtextxy(0,140,"< Main description of room >"); else
+   outtextxy(0,140,string('<')+names[current][1]+'>');
+  do {
+   r=upcase(readkey()); if (r=='\11')  flipover();
+  } while (!(set::of(range('1','9'),'S','L','\0', eos).has(r)));
+  switch (r) {
+   case '1': {;
+         do {
+          t=typeno("Which object\? (0-30)");
+         } while (!((t<30) || (t==255)));
+         if ((t!=255) && (t!=0))  names[t][1]=typein(names[t][1]);
+         current=t;
+        }
+        break;
+   case '2': showallnames(); break;
+   case '3': names[current][2]=typein(names[current][2]); break;
+   case '4': showallassoc(); break;
+   case '5': lino(); break;
+   case '6': editmagics(); break;
+   case '7': editportals(); break;
+   case '8': editflags(); break;
+   case '9': listen=typein(listen); break;
+   case 'S': save(); break;
+   case 'L': load(); break;
+   case '\0': if (readkey()=='\55')  return; break;
+  }
+ } while (!false);
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ output << "*** ALSO ***" << NL;
+ output << NL;
+ output << "No. of screen to edit?"; input >> n >> NL; load();
+ assign(f,"v:avalot.fnt"); reset(f); f >> skinny; close(f);
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi"); current=0;
+ loadscreen();
+ alsomenu();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
new file mode 100644
index 0000000..03cedfd
--- /dev/null
+++ b/engines/avalanche/andexor.cpp
@@ -0,0 +1,122 @@
+#include "ptoc.h"
+
+                 /* Trippancy IV - original file */
+#include "graph.h"
+
+const integer taboo = cyan;
+
+struct adxtype {
+           varying_string<12> name; /* name of character */
+           byte num; /* number of pictures */
+           byte xl,yl; /* x & y lengths of pictures */
+           byte seq; /* how many in one stride */
+           word size; /* the size of all the pictures */
+};
+
+
+integer gd,gm;
+adxtype adx;
+matrix<1,24,0,1,pointer> adxpic;     /* the pictures themselves */
+untyped_file f; string x; byte n;
+
+void load(string nam)
+{
+    byte z;
+ array<1,4,pointer> a;
+ untyped_file f; word s;
+ varying_string<40> xxx;
+ string check;
+
+;
+ assign(f,nam);
+ reset(f,1);
+ blockread(f,xxx,41);
+ blockread(f,check,13);
+ blockread(f,check,31);
+ s=imagesize(0,0,getmaxx(),75);
+ for( z=1; z <= 2; z ++)
+ {;
+  getmem(a[z],s);
+  blockread(f,a[z],s);
+  putimage(0,15+(z-1)*75,a[z],0);
+  freemem(a[z],s);
+ }
+ close(f);
+}
+
+void silhouette()
+{
+    byte x,y,c;
+;
+ setvisualpage(1); setactivepage(1); setfillstyle(1,15);
+ for( gm=0; gm <= 3; gm ++)
+  for( gd=1; gd <= 6; gd ++)
+  {;     /* 26,15 */
+/*   bar((gm div 2)*320+gd*40,20+(gm mod 2)*40,(gm div 2)*320+gd*40+35,(gm mod 2)*40+60); */
+   for( y=1; y <= adx.yl; y ++)
+    for( x=1; x <= adx.xl; x ++)
+    {;
+     setactivepage(0);
+     c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
+     setactivepage(1);
+/*     if c<>taboo then putpixel((gm div 2)*320+gd*40+x,20+(gm mod 2)*40+y,0); */
+     if (c==taboo)  putpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y,15);
+    }
+   getmem(adxpic[gm*6+gd][0],adx.size);
+   getimage((gm / 2)*320+gd*40+1,20+(gm % 2)*40+1,
+     (gm / 2)*320+gd*40+adx.xl,20+(gm % 2)*40+adx.yl,
+      adxpic[gm*6+gd][0]);
+  }
+}
+
+void standard()
+{
+    byte x,y,c;
+;
+ setvisualpage(2); setactivepage(2);
+ for( gm=0; gm <= 3; gm ++)
+  for( gd=1; gd <= 6; gd ++)
+  {;     /* 26,15 */
+   for( y=1; y <= adx.yl; y ++)
+    for( x=1; x <= adx.xl; x ++)
+    {;
+     setactivepage(0);
+     c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
+     setactivepage(2);
+     if (c!=taboo)  putpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y,c);
+    }
+   getmem(adxpic[gm*6+gd][1],adx.size);
+   getimage((gm / 2)*320+gd*40+1,20+(gm % 2)*40+1,
+     (gm / 2)*320+gd*40+adx.xl,20+(gm % 2)*40+adx.yl,
+      adxpic[gm*6+gd][1]);
+  }
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,""); fillchar(adxpic,sizeof(adxpic),'\261');
+ load("v:avalots.avd");
+/* getmem(adxpic[1,1,1],adx.size); getimage(40,20,75,60,adxpic[1,1,1]^);
+ putimage(100,100,adxpic[1,1,1]^,0); */
+ {;
+  adx.name="Avalot";
+  adx.num=24; adx.seq=6;
+  adx.xl=32; adx.yl=35; /* 35,40 */
+
+  adx.size=imagesize(40,20,40+adx.xl,60+adx.yl);
+ }
+ silhouette();
+ standard();
+ x=string("Sprite file for Avvy - Trippancy IV. Subject to copyright.")+'\32';
+ assign(f,"v:sprite1.avd");
+ rewrite(f,1);
+ blockwrite(f,x[1],59);
+ blockwrite(f,adx,sizeof(adx));
+ for( gd=1; gd <= adx.num; gd ++)
+  for( gm=0; gm <= 1; gm ++)
+   blockwrite(f,adxpic[gd][gm],adx.size); /* next image */
+ close(f);
+ closegraph();
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
new file mode 100644
index 0000000..41f27af
--- /dev/null
+++ b/engines/avalanche/andexor2.cpp
@@ -0,0 +1,133 @@
+#include "ptoc.h"
+
+                  /* Trippancy IV - original file */
+#include "graph.h"
+
+const integer taboo = cyan;
+
+struct adxtype {
+           varying_string<12> name; /* name of character */
+           byte num; /* number of pictures */
+           byte xl,yl; /* x & y lengths of pictures */
+           byte seq; /* how many in one stride */
+           word size; /* the size of all the pictures */
+           byte fgc,bgc; /* foreground & background bubble colours */
+};
+
+
+integer gd,gm;
+adxtype adx;
+array<0,1,pointer> adxpic;     /* the pictures themselves */
+untyped_file f; string x; byte n; integer side2; word bigsize;
+
+void load(string n)
+{
+    byte z;
+ array<1,4,pointer> a;
+ untyped_file f; word s;
+ varying_string<40> xxx;
+ string check;
+
+;
+ assign(f,n);
+ reset(f,1);
+ blockread(f,xxx,41);
+ blockread(f,check,13);
+ blockread(f,check,31);
+ s=imagesize(0,0,getmaxx(),75);
+ for( z=1; z <= 2; z ++)
+ {;
+  getmem(a[z],s);
+  blockread(f,a[z],s);
+  putimage(0,15+(z-1)*75,a[z],0);
+  freemem(a[z],s);
+ }
+ close(f);
+}
+
+void silhouette()
+{
+    byte x,y,c;
+;
+ setvisualpage(1); setactivepage(1); setfillstyle(1,15);
+ {;
+  for( gm=0; gm <= 3; gm ++)
+   for( gd=1; gd <= 6; gd ++)
+   {;     /* 26,15 */
+    side2=adx.xl*6;
+    for( y=1; y <= adx.yl; y ++)
+     for( x=1; x <= adx.xl; x ++)
+     {;
+      setactivepage(0);
+      c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
+      setactivepage(1);
+      if (c==taboo) 
+       putpixel((gm / 2)*side2+gd*adx.xl+x,20+(gm % 2)*adx.yl+y,15);
+     }
+   }
+  bigsize=imagesize(adx.xl+1,21,adx.xl*13,20+adx.yl*2);
+  getmem(adxpic[0],bigsize);
+  getimage(adx.xl+1,21,adx.xl*13,20+adx.yl*2,adxpic[0]);
+  putimage(adx.xl+1,21,adxpic[0],notput);
+ }
+}
+
+void standard()
+{
+    byte x,y,c;
+;
+ setvisualpage(2); setactivepage(2);
+ {;
+  for( gm=0; gm <= 3; gm ++)
+   for( gd=1; gd <= 6; gd ++)
+   {;     /* 26,15 */
+    for( y=1; y <= adx.yl; y ++)
+     for( x=1; x <= adx.xl; x ++)
+     {;
+      setactivepage(0);
+      c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
+      setactivepage(2);
+      if (c!=taboo) 
+       putpixel((gm / 2)*side2+gd*adx.xl+x,20+(gm % 2)*adx.yl+y,c);
+     }
+/*    getmem(adxpic[gm*6+gd,1],adx.size);
+    getimage((gm div 2)*side2+gd*xl+x,20+(gm mod 2)*yl+y,
+       (gm div 2)*side2+gd*xl*2+x,20+(gm mod 2)*yl*2+y,
+       adxpic[gm*6+gd,1]^); */
+  }
+  getmem(adxpic[1],bigsize);
+  getimage(adx.xl+1,21,adx.xl*13,20+adx.yl*2,adxpic[1]);
+  putimage(adx.xl+1,21,adxpic[1],notput);
+ }
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,""); fillchar(adxpic,sizeof(adxpic),'\261');
+ load("v:avalots.avd");
+ {;
+  adx.name="Avalot";
+  adx.num=24; adx.seq=6;
+  adx.xl=33; adx.yl=35; /* 35,40 */
+  adx.fgc=yellow; adx.bgc=red;
+
+  adx.size=imagesize(40,20,40+adx.xl,60+adx.yl);
+ }
+ silhouette();
+ standard();
+ x=string("Sprite file for Avvy - Trippancy IV. Subject to copyright.")+'\32';
+ assign(f,"v:sprite1.avd");
+ rewrite(f,1);
+ blockwrite(f,x[1],59);
+ blockwrite(f,adx,sizeof(adx));
+ blockwrite(f,bigsize,2);
+ for( gm=0; gm <= 1; gm ++)
+ {;
+  putimage(0,0,adxpic[gm],0);
+  blockwrite(f,adxpic[gm],bigsize);  /* next image */
+ }
+ close(f);
+ closegraph();
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
new file mode 100644
index 0000000..8aff717
--- /dev/null
+++ b/engines/avalanche/andextst.cpp
@@ -0,0 +1,64 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+
+
+typedef matrix<1,24,0,1,pointer> adxtype;
+
+integer gd,gm;
+word s; untyped_file f; byte n,anim,cp,t;
+array<0,0,adxtype> adx;
+array<0,1,pointer> back;
+integer x;
+array<0,1,integer> ox;
+
+void andex(integer x,integer y, byte n,byte num)
+{;
+ putimage(x,y,adx[num][n][0],andput);
+ putimage(x,y,adx[num][n][1],xorput);
+}
+
+void loadadx(byte num, string x)
+{
+    byte n;
+;
+ assign(f,x);
+ reset(f,1); seek(f,59);
+ blockread(f,n,1); /* No. of images... */
+ for( gd=1; gd <= n; gd ++)
+  for( gm=0; gm <= 1; gm ++)
+  {;
+   blockread(f,s,2); /* size of next image... */
+   getmem(adx[num][gd][gm],s);
+   blockread(f,adx[num][gd][gm],s); /* next image */
+  }
+ close(f);
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ loadadx(0,"d:sprite0.avd");
+ loadadx(1,"d:sprite0.avd");
+ gd=3; gm=0; initgraph(gd,gm,"");
+ for( gd=0; gd <= 1; gd ++)
+ {;
+  setactivepage(gd); setfillstyle(6,1); bar(0,0,640,200);
+  getmem(back[gd],s);
+ }
+ x=0; anim=1; cp=0; t=2; setactivepage(0);
+ do {
+  setactivepage(cp); setvisualpage(1-cp);
+  for( gm=0; gm <= 1; gm ++)
+  {;
+   if (t>0)  t -= 1; else
+    putimage(ox[cp],77,back[cp],copyput);
+   getimage(x,77,x+31,77+35,back[cp]);
+   andex(x,177,anim+6,gm);
+   ox[gm][cp]=x; x += 5;
+  }
+  anim += 1; if (anim==7)  anim=1;cp=1-cp;
+ } while (!false);
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
new file mode 100644
index 0000000..1ff2f1f
--- /dev/null
+++ b/engines/avalanche/arch.cpp
@@ -0,0 +1,122 @@
+#include "ptoc.h"
+
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 ENID             Edna's manager. */
+
+#define __arch_implementation__
+           /* Loads/ saves files. */
+
+#include "arch.h"
+
+
+/*#include "Dos.h"*/
+#include "scrolls.h"
+
+
+struct ednahead { /* Edna header */
+          /* This header starts at byte offset 177 in the .ASG file. */
+          array<1,9,char> id;     /* signature */
+          word revision; /* EDNA revision, here 2 (1=dna256) */
+          varying_string<50> game; /* Long name, eg Lord Avalot D'Argent */
+          varying_string<15> shortname; /* Short name, eg Avalot */
+          word number; /* Game's code number, here 2 */
+          word ver; /* Version number as integer (eg 1.00 = 100) */
+          varying_string<5> verstr; /* Vernum as string (eg 1.00 = "1.00" */
+          varying_string<12> filename; /* Filename, eg AVALOT.EXE */
+          byte os; /* Saving OS (here 1=DOS. See below for others.) */
+
+          /* Info on this particular game */
+
+          varying_string<8> fn; /* Filename (not extension ('cos that's .ASG)) */
+          byte d,m; /* D, M, Y are the Day, Month & Year this game was... */
+          word y;  /* ...saved on. */
+          varying_string<40> desc; /* Description of game (same as in Avaricius!) */
+          word len; /* Length of DNA (it's not going to be above 65535!) */
+
+          /* Quick reference & miscellaneous */
+
+          word saves; /* no. of times this game has been saved */
+          integer cash; /* contents of your wallet in numerical form */
+          varying_string<20> money; /* ditto in string form (eg 5/-, or 1 denarius)*/
+          word points; /* your score */
+
+          /* DNA values follow, then footer (which is ignored) */
+};
+  /* Possible values of edhead.os:
+     1 = DOS        4 = Mac
+     2 = Windows    5 = Amiga
+     3 = OS/2       6 = ST */
+const string crlf = string('\15')+'\12';
+
+const array<1,177,char> ednafirst = 
+ string("This is an EDNA-based file, saved by a Thorsoft game. Good luck!")+crlf+
+ '\32'+ /* 67 bytes... */
+ crlf+crlf+ /* 71 bytes... */
+ "12345678901234567890123456789012345678901234567890"+
+ "12345678901234567890123456789012345678901234567890"+
+ "123456";
+
+const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
+const string ednaid = string("TT")+'\261'+'\60'+'\1'+'\165'+'\261'+'\231'+'\261';
+
+const integer ttage = 18;
+const char ttwashere[] = "Thomas was here ";
+
+void save(string name)
+{
+ untyped_file f;
+ edhead eh;
+ word groi;
+ string groi2;
+;
+ fillchar(eh,sizeof(eh),'\261'); /* Fill up the edhead */
+
+ dna.saves += 1; /* It's been saved one more time... */
+
+ {;
+
+  /* Info about this program */
+
+  id=ednaid;   /* Edna's signature */
+  revision=2;  /* Second revision of .ASG format */
+  game="Lord Avalot d'Argent";   /* Title of game */
+  shortname="Avalot";
+  number=2;  /* Second Avvy game */
+  ver=100;  /* Version 1.00 */
+  verstr="1.00";  /* ditto */
+  filename="AVALOT.EXE";  /* program's filename */
+  os=1;  /* Saved under DOS */
+
+  /* Info on this particular game */
+
+  fsplit(name,groi2,fn,groi2); /* fn = filename of this game */
+  getdate(d,m,y,groi); /* Day, month & year when the game was saved */
+  desc=roomname;  /* Description of game (same as in Avaricius!) */
+  len=sizeof(dna);  /* Length of DNA (it's not going to be above 65535!) */
+
+  /* Quick reference & miscellaneous */
+
+  saves=dna.saves;  /* no. of times this game has been saved */
+  cash=dna.pence;  /* contents of your wallet in numerical form */
+  money=lsd(); /* ditto in string form (eg 5/-, or 1 denarius)*/
+  points=dna.score;  /* your score */
+ }
+
+ assign(f,name);
+ rewrite(f,1);
+
+ blockwrite(f,ednafirst,177);
+ blockwrite(f,eh,sizeof(eh));
+ blockwrite(f,dna,sizeof(dna));
+
+ for( groi=1; groi <= ttage; groi ++)
+  blockwrite(f,ttwashere,sizeof(ttwashere));
+
+ close(f);
+}
+
+
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
new file mode 100644
index 0000000..cb0960f
--- /dev/null
+++ b/engines/avalanche/arch.h
@@ -0,0 +1,10 @@
+#ifndef __arch_h__
+#define __arch_h__
+
+
+#include "gyro.h"
+
+
+void save(string name);
+
+#endif
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
new file mode 100644
index 0000000..a439f87
--- /dev/null
+++ b/engines/avalanche/avalot9.cpp
@@ -0,0 +1,114 @@
+#include "ptoc.h"
+
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 AVALOT           The kernel of the program. */
+
+
+#include "graph.h"
+/*#include "Crt.h"*/
+/*#include "Trip5.h"*/
+/*#include "Gyro.h"*/
+/*#include "Lucerna.h"*/
+/*#include "Scrolls.h"*/
+/*#include "Basher.h"*/
+/*#include "Dropdown.h"*/
+/*#include "Pingo.h"*/
+/*#include "Logger.h"*/
+/*#include "Timeout.h"*/
+/*#include "Celer.h"*/
+/*#include "Enid.h"*/
+/*#include "Incline.h"*/
+/*#include "Closing.h"*/
+/*#include "Visa.h"*/
+
+
+void setup()
+{
+ integer gd,gm;
+
+ checkbreak=false; visible=m_no; to_do=0; lmo=false; resetscroll;
+ Randomize(); setup_vmc; on_virtual;
+ gd=3; gm=0; initgraph(gd,gm,"");
+ holdthedawn=true; dusk;
+ cmp=177; mouse_init;  /*on;*/ dropsok=true; ctrl=ckey; oldjw=177;
+ mousetext=""; c=999; settextjustify(0,0); ddmnow=false; load_digits;
+ cheat=false; cp=0; curpos=1; 
+ quote=true; ledstatus=177; defaultled=2;
+/* TSkellern:=0; { Replace with a more local variable sometime }*/
+ dna.rw=stopped; enid_filename="";   /* undefined. */
+ toolbar; state(2); copy03; lastscore="TJA";
+
+/* for gd:=0 to 1 do
+ begin
+  setactivepage(gd); outtextxy(7,177,chr(48+gd));
+ end;*/
+
+ loadtrip;
+
+ if ((filetoload=="") & (~ reloaded)) 
+  newgame; /* no game was requested- load the default */
+ else {
+  if (~ reloaded)  avvy_background;
+  standard_bar; sprite_run;
+  if (reloaded)  edna_reload; else
+  {     /* Filename given on the command line (or loadfirst) */
+   edna_load(filetoload);
+   if (there_was_a_problem) 
+   {
+    display("So let's start from the beginning instead...");
+    holdthedawn=true; dusk; newgame;
+   }
+  }
+ }
+
+ if (~ reloaded) 
+ {
+  soundfx=~ soundfx; fxtoggle;
+  thinkabout(money,a_thing);
+ }
+
+ get_back_loretta; gm=getpixel(0,0); setcolor(7);
+ holdthedawn=false; dawn; cursoron=false; cursor_on; newspeed;
+
+ if (~ reloaded) 
+   dixi('q',83); /* Info on the game, etc. */
+}
+
+int main(int argc, const char* argv[])
+{
+ pio_initialize(argc, argv);
+ setup();
+
+ do {
+
+  clock;
+  keyboard_link;
+  menu_link;
+  readstick;
+  force_numlock;
+  get_back_loretta;
+  trippancy_link;
+  pics_link;
+  checkclick;
+
+  if (visible==m_virtual)  plot_vmc(mx,my,cp);
+  flip_page; /* <<<! */
+  slowdown;
+  if (visible==m_virtual)  wipe_vmc(cp);
+
+  one_tick;
+
+ } while (!lmo);
+
+ restorecrtmode();
+ if (logging)  close(logfile);
+
+ end_of_program;
+ return EXIT_SUCCESS;
+}
+
+/*  typein; commanded; last:=current; */
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
new file mode 100644
index 0000000..13e6cea
--- /dev/null
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -0,0 +1,88 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+
+integer gd,gm;
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ /* Screen size: Starts at $A000:$320 (coords 0,10).
+ Length: 12000 (150*80) bytes.
+ If we divide it into sets of 5 lines (400 bytes) each, there are 30.
+ There are 40 words on a line.
+
+ Patterns:
+  4AAA = "AVVY"
+  AAAE
+  EAA4
+  A444
+
+  A4AA = "YAVV"
+  AEAA
+  4EAA
+  4A44 */
+/*
+ asm
+  mov bx,$A000;
+  mov es,bx; { The segment to copy it to... }
+  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
+
+  mov cx,10;
+  mov ax,$AA4A; call @sameline; { Print "AVVY" }
+  mov ax,$AEAA; call @sameline;
+  mov ax,$A4EA; call @sameline;
+  mov ax,$44A4; call @sameline;
+
+  mov cx,9;
+  mov ax,$AAA4; call @sameline; { Print "YAVV" }
+  mov ax,$AAEA; call @sameline;
+  mov ax,$AA4E; call @sameline;
+  mov ax,$444A; call @sameline;
+
+  mov ax,$4AAA; call @sameline; { Print "VYAV" }
+  mov ax,$AAAE; call @sameline;
+  mov ax,$EAA4; call @sameline;
+  mov ax,$A444; call @sameline;
+
+  mov ax,$A4AA; call @sameline; { Print "VVYA" }
+  mov ax,$EAAA; call @sameline;
+  mov ax,$4EAA; call @sameline;
+  mov ax,$4A44; call @sameline;
+
+  jmp @the_end;
+
+  { Replicate the same line many times. }
+
+  @sameline:
+   { Requires:
+      what to copy in AX,
+      how many lines in CX, and
+      original offset in DI. }
+   push cx;
+   push di;
+
+   @samelineloop:
+
+    push cx;
+    mov cx,40; { No. of times to repeat it on one line. }
+
+    repz stosw; { Fast word-copying }
+
+    pop cx;
+
+    add di,1200; { The next one will be 16 lines down. }
+
+   loop @samelineloop;
+   pop di;
+   add di,80;
+   pop cx;
+
+   ret;
+
+  @the_end:
+ end;
+*/
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
new file mode 100644
index 0000000..3cfff7d
--- /dev/null
+++ b/engines/avalanche/avmenu.cpp
@@ -0,0 +1,312 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Crt.h"*/
+/*#include "Tommys.h"*/
+
+typedef matrix<'\0','\377',0,15,byte> fonttype;
+
+fonttype font;
+word storage_seg,storage_ofs;
+byte result;
+string registrant;
+
+void icons()
+{
+ untyped_file f;
+ word gd,gm; byte bit;
+ byte v;
+
+ assign(f,"menu.avd");
+ reset(f,1);
+
+ for( bit=0; bit <= 3; bit ++)
+ {
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( gd=70; gd <= 266; gd ++)
+   blockread(f,mem[0xa000*gd*80+6],9);
+
+  for( gd=0; gd <= 32; gd ++)
+  {
+    blockread(f,v,1);
+   for( gm=0; gm <= 5; gm ++)
+    mem[0xa000*73+((70+gd+gm*33)*80)]=v; /* 79 */
+  }
+
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ setfillstyle(1, 7); for( gd=0; gd <= 5; gd ++) bar(114, 73+gd*33,583, 99+gd*33);
+ setfillstyle(1,15); for( gd=0; gd <= 5; gd ++) bar(114, 70+gd*33,583, 72+gd*33);
+ setfillstyle(1, 8); for( gd=0; gd <= 5; gd ++) bar(114,100+gd*33,583,102+gd*33);
+
+}
+
+void load_regi_info();
+
+
+static char decode1(char c)
+{
+    byte b;
+
+  char decode1_result;
+  b=ord(c)-32;
+  decode1_result=chr(( (b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
+  return decode1_result;
+}
+
+
+
+static char decode2(char c)
+{
+  char decode2_result;
+  decode2_result=chr( ((ord(c) & 0xf) << 2) + 0x43);
+  return decode2_result;
+}
+
+
+
+static boolean checker(string proper,string check)
+{
+    byte fv; boolean ok;
+
+  boolean checker_result;
+  ok=true;
+  for( fv=1; fv <= length(proper); fv ++)
+    if ((ord(proper[fv]) & 0xf)!=((cardinal)(ord(check[fv])-0x43) >> 2))
+           ok=false;
+
+  checker_result=ok;
+  return checker_result;
+}
+
+void load_regi_info()
+{
+ text t;
+ byte fv;
+ string x;
+ byte namelen,numlen;
+ string namechk,numchk;
+ string reginum;
+
+
+  /*$I-*/
+  assign(t,"register.dat"); reset(t);
+  /*$I+*/
+
+  if (ioresult!=0) 
+  {
+    registrant="(Unregistered evaluation copy.)";
+    return;
+  }
+
+  for( fv=1; fv <= 53; fv ++) t >> NL;
+  t >> x >> NL;
+  close(t);
+
+  namelen=107-ord(x[1]); numlen=107-ord(x[2]);
+
+  registrant=copy(x,3,namelen);
+  reginum=copy(x,4+namelen,numlen);
+  namechk=copy(x,4+namelen+numlen,namelen);
+  numchk=copy(x,4+namelen+numlen+namelen,numlen);
+
+  for( fv=1; fv <= namelen; fv ++) registrant[fv]=decode1(registrant[fv]);
+  for( fv=1; fv <= numlen; fv ++) reginum[fv]=decode1(reginum[fv]);
+
+  if ((! checker(registrant,namechk)) || (! checker(reginum,numchk)))
+        registrant="\?\"!\? ((.)";
+  else
+   registrant=registrant+" ("+reginum+").";
+
+}
+
+void flesh_colours() {;        /* assembler;
+asm
+  mov ax,$1012;
+  mov bx,21;                 { 21 = light pink (why?) */
+  /* mov cx,1;
+  mov dx,seg    @flesh;
+  mov es,dx;
+  mov dx,offset @flesh;
+  int $10;
+
+  mov dx,seg    @darkflesh;
+  mov es,dx;
+  mov dx,offset @darkflesh;
+  mov bx,5;                 { 5 = dark pink. */
+  /*int $10;
+
+  jmp @TheEnd;
+
+ @flesh:
+  db 56,35,35;
+
+ @darkflesh:
+  db 43,22,22;
+
+ @TheEnd: */
+                     }
+
+void setup()
+{
+ integer gd,gm;
+ file<fonttype> ff;
+
+ if (paramstr(1)!="jsb")  exit(255);
+ checkbreak=false;
+ val(paramstr(2),storage_seg,gd);
+ val(paramstr(3),storage_ofs,gd);
+
+ assign(ff,"avalot.fnt");
+ reset(ff); ff >> font; close(ff);
+
+ gd=3; gm=1; initgraph(gd,gm,"");
+ setvisualpage(1); 
+
+ icons();
+}
+
+void big(word x,word y, string z, boolean notted);
+static word start,image; 
+
+
+static void generate(byte from, boolean& notted)
+{
+    byte fv;
+
+ image=0;
+ for( fv=0; fv <= 7; fv ++)
+  image += (from & (1 << fv)) << fv;
+
+ image += image << 1;
+ image=hi(image)+lo(image)*256;
+ if (notted)  image=~ image;
+}
+
+void big(word x,word y, string z, boolean notted)
+{
+    byte fv,ff;byte bit;
+
+ start=x+y*80;
+
+ for( fv=1; fv <= length(z); fv ++)
+ {
+  for( ff=1; ff <= 12; ff ++)
+  {
+   generate(font[z[fv]][ff+1], notted);
+   for( bit=0; bit <= 2; bit ++)
+   {
+    port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+    memw[0xa000*start+   ff*160]=image;
+    memw[0xa000*start+80+ff*160]=image;
+   }
+  }
+  start += 2;
+ }
+ bit=getpixel(0,0);
+}
+
+void centre(integer y, string z)
+{
+ big(40-(length(z)),y,z,false);
+}
+
+void option(byte which, string what)
+{
+ big(16,41+which*33,string((char)(which+48))+')',true);
+ big(24,41+which*33,what,true);
+}
+
+void invert(integer x1,integer y1,integer x2,integer y2)
+{
+    word s; pointer p;
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+ putimage(x1,y1,p,4);
+ sound(y1); delay(30);
+ sound(600-y2); delay(20);
+ nosound;  delay(200);
+ putimage(x1,y1,p,0);
+ delay(250);
+}
+
+void wait()
+{
+    word x; char r; boolean pressed;
+
+ x=0; pressed=false;
+ do {
+  setfillstyle(6,15); bar(x  ,330,x-1,337);
+  setfillstyle(1, 0); bar(x-2,330,x-3,337);
+  delay(40); x += 1;
+
+  if (keypressed()) 
+  {
+   r=readkey();
+   if (r=='\0') 
+   {
+    r=readkey(); /* and...? */
+   } else
+   {     /* Not an extended keystroke. */
+    if (set::of(range('1','6'),cspace,cescape,creturn, eos).has(r))  pressed=true;
+   }
+  }
+
+ } while (!((x==640) || pressed));
+
+ if ((r==cspace) || (r==creturn))  r='1';
+ if (r==cescape)  r='6';
+ if (pressed) 
+ {
+  result=ord(r)-48;
+  invert(48,37+result*33,114,69+result*33);
+ } else result=177;
+}
+
+void show_up()
+{
+ setvisualpage(0);
+}
+
+void loadmenu()
+{
+    untyped_file f; byte bit;
+
+ assign(f,"mainmenu.avd");
+ reset(f,1);
+ for( bit=0; bit <= 3; bit ++)
+  {
+   port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+   blockread(f,mem[0xa000*0],59*80);
+  }
+ close(f);
+ bit=getpixel(0,0);
+}
+
+int main(int argc, const char* argv[])
+{
+ pio_initialize(argc, argv);
+ setup();
+ loadmenu();
+ load_regi_info();
+ option(1,"Play the game.");
+ option(2,"Read the background.");
+ option(3,"Preview... perhaps...");
+ option(4,"View the documentation.");
+ option(5,"Registration info.");
+ option(6,"Exit back to DOS.");
+ centre(275,registrant);
+ centre(303,"Make your choice, or wait for the demo.");
+
+ show_up();
+ wait();
+ mem[storage_seg*storage_ofs]=result;
+ closegraph();
+ return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
new file mode 100644
index 0000000..6875687
--- /dev/null
+++ b/engines/avalanche/avvyans.cpp
@@ -0,0 +1,84 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Crt.h"*/
+
+integer gd,gm;
+untyped_file f;
+array<1,16000,byte> aa;
+matrix<0,27,0,35,byte> cols;
+text t;
+string x;
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ fillchar(cols,sizeof(cols),'\0');
+ assign(f,"v:avvypic.ptx");
+ reset(f,1);
+ blockread(f,aa,filesize(f));
+ close(f);
+ putimage(0,0,aa,0);
+ for( gd=0; gd <= 27; gd ++)
+  for( gm=0; gm <= 34; gm ++)
+   cols[gd][gm+1]=getpixel(gd,gm);
+
+ restorecrtmode();
+/*
+   asm
+      mov ax,$1003
+      mov bl,0
+      int $10
+   end;
+*/
+ for( gm=0; gm <= 17; gm ++)
+  for( gd=0; gd <= 27; gd ++)
+  {;
+   gotoxy(gd+1,gm+1);
+   if (cols[gd][2*gm]==cols[gd][2*gm+1]) 
+   {;
+    textattr=cols[gd][2*gm]; output << 'Û';
+   } else
+    if ((cols[gd][2*gm]>7) && (cols[gd][2*gm+1]<8)) 
+    {;
+     textattr=cols[gd][2*gm]+cols[gd][2*gm+1]*16;
+     output << 'ß';
+    } else
+    {;
+     textattr=cols[gd][2*gm]*16+cols[gd][2*gm+1];
+     if (textattr>blink)  textattr -= blink;
+     output << 'Ü';
+    }
+  }
+  gotoxy(23,5); textattr=red; output << 'ß';
+
+  assign(t,"v:avalot.txt"); reset(t);
+  textattr=9; gm=2;
+  do {
+   gm += 1;
+   t >> x >> NL;
+   gotoxy(30,gm);
+   output << x << NL;
+  } while (!(eof(t)));
+
+  textattr=7; gotoxy(35,2); output << "Back in good old A.D. ";
+  textattr=15; output << "1176"; textattr=7; output << "...";
+  textattr=9; gotoxy(40,4); output << "Lord";
+  gotoxy(67,9); output << "d'Argent";
+  textattr=yellow;
+  gotoxy(37,12); output << "He's back...";
+  gotoxy(47,14); output << "And this time,";
+  gotoxy(52,15); output << "he's wearing tights...";
+  textattr=4;
+  gotoxy(36,17); output << "A Thorsoft of Letchworth game. * Requires EGA";
+  gotoxy(38,18); output << "and HD. * By Mike, Mark and Thomas Thurman.";
+  gotoxy(40,19); output << "Sfx archive- ";
+  textattr=9; output << "Download ";
+  textattr=14; output << "AVLT10.EXE";
+  textattr=9; output << " now!";
+  gotoxy(1,1);
+  input >> NL;
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
new file mode 100644
index 0000000..915a33d
--- /dev/null
+++ b/engines/avalanche/avvyans2.cpp
@@ -0,0 +1,185 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Crt.h"*/
+/*#include "Ansi.h"*/
+
+integer gd,gm;
+untyped_file f;
+array<1,16000,byte> aa;
+matrix<0,27,0,35,byte> cols;
+text t;
+string x;
+byte n;
+byte spaces;
+byte cfg,cbg; /* Current foreground & background. */
+byte ofg,obg;  /* Old fg & bg. */
+
+void do_spaces()
+{;
+ if (spaces==0)  return;
+ along(spaces);
+ spaces=0;
+}
+
+void finishline();
+static byte wx,wy;
+
+static void jumpto(byte xx)
+{;
+ along(xx-wx);
+}
+
+void finishline()
+{;
+ wx=29-spaces; wy=gm+1;
+ switch (wy) {
+  case 1: {;
+      sgr(7); jumpto(35); output << "Back in good old A.D. ";
+      sgr(15); output << "1189"; sgr(7); output << "..." << NL; cfg=7;
+     }
+     break;
+  case RANGE_5(3,7): {;
+         t >> x >> NL;
+         while (x[length(x)]=='\40')  x[0] -= 1;
+         if (x!="") 
+         {;
+          jumpto(30);
+          sgr(9);
+          spaces=0;
+          while (x!="") 
+          {;
+           if (x[1]==' ') 
+            spaces += 1;
+           else
+           {;
+            do_spaces();
+            output << x[1];
+           }
+           Delete(x,1,1);
+          }
+          if (wy==7)  close(t);
+          output << NL;
+         }
+        }
+        break;
+  case 8: {;
+      jumpto(67); sgr(9); output << "d'Argent" << NL; cfg=9;
+     }
+     break;
+  case 11: {;
+       jumpto(37); sgr(14); output << "He's back..." << NL;
+      }
+      break;
+  case 13: {;
+       jumpto(47); sgr(14); output << "And this time," << NL;
+      }
+      break;
+  case 14: {;
+       jumpto(52); sgr(14); output << "he's wearing tights..." << NL;
+      }
+      break;
+  case 16: {;
+       jumpto(35); sgr(4);
+       output << "A Thorsoft of Letchworth game. * Requires EGA" << NL;
+      }
+      break;
+  case 17: {;
+       jumpto(37); sgr(4);
+       output << "and HD. * By Mike, Mark and Thomas Thurman." << NL;
+      }
+      break;
+  case 18: {;
+       jumpto(39);
+       sgr( 4); output << "Sfx archive- ";
+       sgr( 9); output << "Download ";
+       sgr(14); output << "AVLT10.EXE";
+       sgr( 9); output << " now!";
+      }
+      break;
+  default: output << NL;
+ }
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ fillchar(cols,sizeof(cols),'\0');
+ assign(f,"v:avvypic.ptx");
+ reset(f,1);
+ blockread(f,aa,filesize(f));
+ close(f);
+ putimage(0,0,aa,0);
+ for( gd=0; gd <= 27; gd ++)
+  for( gm=0; gm <= 34; gm ++)
+   cols[gd][gm+1]=getpixel(gd,gm);
+
+ restorecrtmode();
+
+ assign(output,"v:avalot.ans"); rewrite(output); normal; ed;
+/* assign(output,''); rewrite(output); normal; ed;*/
+ assign(t,"v:avalot.txt"); reset(t);
+
+ for( gm=0; gm <= 17; gm ++)
+ {;
+  spaces=0;
+  for( gd=0; gd <= 27; gd ++)
+  {;
+   if ((gd==22) && (gm==4)) 
+   {;
+    do_spaces();
+    sgr(red); output << 'ß';
+   } else
+   {;
+    if (cols[gd][2*gm]==cols[gd][2*gm+1]) 
+    {;
+     if (cols[gd][2*gm]==0) 
+      spaces += 1; /* a blank space */
+     else {;
+      do_spaces();
+
+      if (cfg==cols[gd][2*gm])  output << 'Û'; else
+       if (cbg==cols[gd][2*gm])  output << ' '; else
+       {;
+        sgr((cols[gd][2*gm])+(cbg*16));
+        cfg=cols[gd][2*gm];
+        output << 'Û';
+       }
+     }
+    } else
+     if ((cols[gd][2*gm]>7) && (cols[gd][2*gm+1]<8)) 
+     {;
+      do_spaces();
+      sgr(cols[gd][2*gm]+cols[gd][2*gm+1]*16);
+      cfg=cols[gd][2*gm]; cbg=cols[gd][2*gm+1]*16;
+      output << 'ß';
+     } else
+     {;
+      do_spaces();
+
+      ofg=cfg; obg=cbg;
+      cbg=cols[gd][2*gm]; cfg=cols[gd][2*gm+1];
+
+      if ((cbg==ofg) && (cfg==obg)) 
+      {;
+       n=cfg*16+cbg;
+       if (n>128)  n -= 128;
+       output << 'ß';
+      } else
+      {;
+       n=cbg*16+cfg;
+       if (n>128)  n -= 128;
+       if ((cfg!=ofg) || (cbg!=obg))  sgr(n);
+       output << 'Ü';
+      }
+
+     }
+    }
+   } finishline();
+  }
+ output << NL;
+ normal;
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
new file mode 100644
index 0000000..5a4b70c
--- /dev/null
+++ b/engines/avalanche/avvymonk.cpp
@@ -0,0 +1,72 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+
+integer gd,gm;
+byte z;
+array<1,4,pointer> a;
+untyped_file f; word s;
+string check;
+integer x,y;
+void savesc()
+{
+    varying_string<40> adf; untyped_file f; byte z; array<1,2,pointer> c; word s;
+varying_string<14> nam; varying_string<30> screenname;
+;
+ nam="v:avvymonk.avd";
+ adf=string("aved as a stuff file, so there! TJAT.")+'\15'+'\12'+'\32';
+ adf[0]='S';
+ screenname="Avalot in a monk's costume";
+ assign(f,nam); /* not scrambled */
+ rewrite(f,1);
+ blockwrite(f,adf,41);
+ blockwrite(f,nam,13);
+ blockwrite(f,screenname,31);
+ s=imagesize(0,0,getmaxx(),75);
+ for( z=1; z <= 2; z ++)
+ {;
+  getmem(c[z],s);
+  getimage(0,15+(z-1)*75,getmaxx(),15+(z)*75,c[z]);
+  blockwrite(f,c[z],s);
+  freemem(c[z],s);
+ }
+}
+void loadscreen(string nam)
+{;
+ assign(f,nam);
+ reset(f,1);
+ blockread(f,check,41);
+ blockread(f,check,13);
+ blockread(f,check,31);
+ s=imagesize(0,0,getmaxx(),75);
+ for( z=1; z <= 2; z ++)
+ {;
+  getmem(a[z],s);
+  blockread(f,a[z],s);
+  setactivepage(0);
+  putimage(0,15+(z-1)*75,a[z],0);
+  freemem(a[z],s);
+ }
+ close(f);
+}
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0;
+ x=0; y=0;
+ initgraph(gd,gm,"o:");
+ loadscreen("v:legion.avd");
+ while (y<100) 
+ {;
+  switch (getpixel(x,y)) {
+   case 7: putpixel(x,y,0); break;
+   case 8: putpixel(x,y,0); break;
+   case 9: putpixel(x,y,15); break;
+  }
+  x += 1;
+  if (x>640)  {; y += 1; x=0; }
+ }
+ savesc();
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
new file mode 100644
index 0000000..5cea62d
--- /dev/null
+++ b/engines/avalanche/bakchunk.cpp
@@ -0,0 +1,28 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Celer.h"*/
+/*#include "Lucerna.h"*/
+
+integer gd,gm;
+int main(int argc, const char* argv[])
+{
+ pio_initialize(argc, argv);
+ gd=3; gm=0; initgraph(gd,gm,"");
+ setvisualpage(3);
+ load_chunks('1');
+
+ for( gd=0; gd <= num_chunks; gd ++)
+  show_one_at(gd,0,gd*40);
+
+ mblit(0,0,79,200,3,0);
+
+ gd=getpixel(0,0);
+ setvisualpage(0); setactivepage(0);
+
+ settextstyle(0,0,4); setcolor(15);
+ outtextxy(100,50,"Chunk1");
+ input >> NL;
+ return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
new file mode 100644
index 0000000..56cfcca
--- /dev/null
+++ b/engines/avalanche/basher.cpp
@@ -0,0 +1,385 @@
+#include "ptoc.h"
+
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 BASHER           Handles the keyboard. */
+
+#define __basher_implementation__
+
+
+ /* Note: this unit can record keystrokes, for the demo. If you want it
+   to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
+   cause them to be played back. */
+
+#include "basher.h"
+
+
+#include "enhanced.h"
+#include "lucerna.h"
+#include "Graph.h"
+#include "scrolls.h"
+#include "acci.h"
+#include "trip5.h"
+#include "pingo.h"
+#include "dropdown.h"
+#include "logger.h"
+#include "Sticks.h"
+#include "enid.h"
+
+
+boolean entering_filename;
+byte left_margin;
+
+void plottext()
+{
+      const array<0,2,byte> p = {{0,1,3}};
+    byte x,y,n;
+
+ x=0; if (mouse_near_text())  super_off();
+ cursor_off();
+ for( n=0; n <= 2; n ++)
+  for( y=0; y <= 7; y ++)
+  {
+   for( x=1; x <= length(current); x ++)
+    mem[0xa000*p[n]*pagetop+12882+y*80+x]=little[current[x]][y];
+   fillchar(mem[0xa000*p[n]*pagetop+12883+y*80+x],77-x,'\0');
+  }
+ cursor_on();
+ super_on();
+}
+
+void wipetext()
+{
+      const array<0,2,byte> n = {{0,1,3}};
+    byte y,p;
+
+ if (mouse_near_text())  super_off();
+ cursor_off();
+ for( y=0; y <= 7; y ++)
+  for( p=0; p <= 2; p ++)
+   fillchar(mem[0xa000*n[p]*pagetop+12883+y*80],77,'\0');
+ quote=true; curpos=1; cursor_on();
+ super_on();
+}
+
+/*procedure cursor;
+begin
+ if curflash=0 then
+ begin
+  if mouse_near_text then Super_Off;
+  cursoron:=not cursoron;
+  mem[$A000*13442+curpos]:=not mem[$A000*13442+curpos];
+  mem[$A000*pagetop+13442+curpos]:=not mem[$A000*pagetop+13442+curpos];
+  curflash:=17;
+  Super_On;
+ end else dec(curflash);
+end;*/
+
+void do_cursor()
+{
+ bytefield bf;
+ byte fv;
+
+ mem[0xac00*13442+curpos]=~ mem[0xac00*13442+curpos];
+ {
+  bf.x1=curpos+1; bf.x2=curpos+2; bf.y1=168; bf.y2=168;
+ }
+ for( fv=0; fv <= 1; fv ++) getset[fv].remember(bf);
+}
+
+void cursor_on()
+{
+ if (cursoron)  return;
+ do_cursor(); cursoron=true;
+}
+
+void cursor_off()
+{
+ if (! cursoron)  return;
+ do_cursor(); cursoron=false;
+}
+
+
+void get_demorec()
+{
+ demofile >> demo_rec;
+ inchar=demo_rec.key;
+   extd=demo_rec.extd;
+   demo_rec.delay -= 1;
+}
+
+#ifdef RECORD
+  void record_one()
+  {
+   demo_rec.delay=count;
+   demo_rec.key=inchar;
+   demo_rec.extd=extd;
+
+   demofile << demo_rec;
+   count=0;
+  }
+#endif
+/*
+procedure storeline(whatwhat:string);
+var
+ fv:byte;
+ what:string[77];
+ ok:boolean;
+
+  function upline(x:string):string;
+  var fv:byte; n:string[77];
+  begin
+   for fv:=1 to length(x) do n[fv]:=upcase(x[fv]);
+   n[0]:=x[0]; upline:=n;
+  end;
+begin
+
+ what:=upline(whatwhat); ok:=false;
+ for fv:=1 to 20 do
+  if what=upline(previous^[fv]) then
+  begin { it already exists, in string "fv" }
+   move(previous^[fv+1],previous^[fv],(20-fv)*78);
+   previous^[20]:=whatwhat; ok:=true;
+  end;
+ if ok then exit;
+ { it's not on the list, so add it }
+ move(previous^[2],previous^[1],1482); { shove up }
+ previous^[20]:=whatwhat;
+end;
+*/
+void typein();
+
+static char firstchar(string x) { char firstchar_result;
+                                         firstchar_result=x[1]; return firstchar_result;
+                                }
+
+
+static void try_dd() /* This asks the Parsekey proc in Dropdown if it knows it. */
+{
+ parsekey(inchar,extd);
+}
+
+void typein()
+{
+    byte w;
+
+ inkey();
+ #ifdef RECORD record_one(); #endif
+
+ switch (inchar) {
+  case RANGE_15('\40','\56'):case '\60' ... '\337':case '\341' ... '\377': if (ddm_o.menunow) 
+             {
+              parsekey(inchar,extd);
+             } else
+             {
+              if (length(current)<76) 
+              {
+               if ((inchar=='"') || (inchar=='`')) 
+               {
+                if (quote)  inchar='`'; else inchar='"';
+                quote=! quote;    /* Quote- Unquote... */
+               }
+               insert(inchar,current,curpos);
+               curpos += 1;
+               plottext();
+              } else blip();
+             }
+             break;
+  case '\10': if (! ddm_o.menunow) 
+      {
+       if (curpos>left_margin) 
+       {
+        curpos -= 1;
+        if (set::of('"','`', eos).has(current[curpos]))  quote=! quote;
+        Delete(current,curpos,1);
+        plottext();
+       } else blip();
+      }
+      break;
+  case '\0':case '\340': {
+       switch (extd) {
+              /* Function keys: */
+        case cf1: callverb(vb_help); break; /* f1 - help (obviously) */
+        case cf2: fxtoggle(); break; /* f2 - sound */
+        case ccf2:case cf11: { clearwords(); callverb(vb_save); } break; /* ^f2 - save */
+        case cf3: if (length(current)<length(/*previous^[20]*/last))  /* f3 - rec last */
+             {
+              current=current+copy( /*previous^[20]*/last,length(current)+1,255);
+              curpos=length(current)+1;
+              plottext();
+             }
+             break;
+        case ccf3:case cf12: { clearwords(); callverb(vb_load); } break; /* ^f3 - load */
+        case cf4: callverb(vb_restart); break; /* f4 - restart game */
+        case cf5: {
+                person=pardon; thing=pardon;
+                callverb(firstchar(f5_does())); /* f5 - get up/ whatever */
+             }
+             break;
+        case cf6: callverb(vb_pause); break; /* f6 - pause */
+        case cf7: callverb(vb_open); break; /* f7 - open door */
+        case cf8: callverb(vb_look); break; /* f8 - look */
+        case cf9: callverb(vb_score); break; /* f9 - score */
+        case ccf7: major_redraw(); break; /* ^f7 - open door */
+        case cf10:case c_ax:case caf4: {
+                      #ifdef RECORD
+                       display("Hi. You have just finished recording. GIED.");
+                       close(demofile); exit(0);
+                      #endif
+                       callverb(vb_quit); /* f10, alt-X, alt-f4 - quit */
+                     }
+                     break;
+        case ccf5: back_to_bootstrap(2); break; /* ^f5 - Dos shell. */
+        case csf10: callverb(vb_info); break; /* sf10 - version */
+
+        case c_ab: callverb(vb_boss); break; /* alt-B */
+        case c_ad: display("Wrong game!"); break; /* alt-D */
+        case ccleft: if (curpos>left_margin) 
+              { cursor_off(); curpos -= 1; cursor_on(); }
+              break;                                         /* ^left */
+        case ccright: if (curpos<=length(current))  /* ^right */
+              { cursor_off(); curpos += 1; cursor_on(); }
+              break;
+        case cchome: { cursor_off(); curpos=1; cursor_on(); } break; /* ^home */
+        case ccend: { cursor_off(); curpos=length(current)+1; cursor_on(); } break; /* ^end */
+        case c_ar: oh=177; break; /* alt-R = repeater (re-chime) */
+        case cup:case cdown:case cleft:case cright:case cpgup:case cpgdn:case chome:case cend: if (ddm_o.menunow)  try_dd();
+              else tripkey(extd);
+              break;              /* Up/Down/Left/Right/PgUp/PgDn */
+        case cnum5: tripkey(extd); break; /* Numeric 5 */
+        case cdel: if (! ddm_o.menunow) 
+             {
+              if (curpos<=length(current)) 
+              {
+               if (set::of('"','`', eos).has(current[curpos]))  quote=! quote;
+               Delete(current,curpos,1);
+               plottext();
+              } else blip();
+             }
+             break;
+        default: try_dd();
+       }
+      }
+      break;
+  case cescape:case '/': if (ddm_o.menunow)  /* Escape */
+           { ddm_o.wipe(); } else
+            if (entering_filename) 
+              { normal_edit(); wipetext(); } else
+                ddm_m.getcertain(ddm_o.menunum);
+                break;
+  case creturn: if (ddm_o.menunow)  try_dd(); /* Return */
+       else {
+        log_command(current);
+        if (entering_filename) 
+        {
+          edna_save(copy(current,24,255));
+          normal_edit(); wipetext();
+        } else
+        {
+          if (current!="")  last=current;
+          parse(); do_that();
+          if (! entering_filename) 
+          {
+            current="";
+            wipetext();
+          }
+        }
+       }
+       break;
+  case '\11': callverb(vb_inv); break; /* Ctrl-I= inventory */
+  case '\7': errorled(); break;
+  case '\25': {
+       current="";
+       wipetext();
+      }
+      break;
+
+  case '\27': { tr[1].xs=walk; newspeed(); } break;
+  case '\22': { tr[1].xs=run;  newspeed(); } break;
+
+  case '\2': bosskey(); break;
+  case '\12': ctrl=cjoy; break; /* Joystick */
+  case '\13': ctrl=ckey; break; /* Keyboard */
+  case '\3': callverb(vb_quit); break; /* Ctrl-C= request to quit */
+
+ }
+ showrw();
+
+ if (demo)  get_demorec();
+}
+
+/*        'x'..'z': begin setvisualpage(ord(extd)-63); write(#7); inkey; end;
+        '': begin setvisualpage(0); write(#7); inkey; end;*/
+
+void keyboard_link()
+{
+ state(defaultled); /* if defaultled=1 then on; { For the menus }*/
+ joykeys(); /* Test joystick buttons- I know that's not keyboard. */
+
+ if (demo) 
+ {
+  if (keypressede())  exit(0);
+  if (demo_rec.delay>0) 
+   demo_rec.delay -= 1;
+  else typein();
+  return;
+ }
+
+ #ifdef RECORD count += 1;   #endif
+
+ if (! keypressede())  return;
+ if (keyboardclick)  click();
+ typein();
+}
+
+boolean demo_ready()
+{
+ boolean demo_ready_result;
+ if (demo_rec.delay>0) 
+ {
+  slowdown();
+  demo_rec.delay -= 1;
+ }
+ demo_ready_result=demo_rec.delay==0;
+ return demo_ready_result;
+}
+
+void filename_edit()
+{
+ entering_filename=true;
+ current="Filename\? (Esc=cancel):";
+ left_margin=24; curpos=24;
+ plottext();
+}
+
+void normal_edit()
+{
+ entering_filename=false;
+ current="";
+ left_margin=1; curpos=1;
+}
+
+class unit_basher_initialize {
+  public: unit_basher_initialize();
+};
+static unit_basher_initialize basher_constructor;
+
+unit_basher_initialize::unit_basher_initialize() {
+/* new(previous);*/ last=""; normal_edit();
+
+ if (demo) 
+ {
+  assign(demofile,"demo.avd");
+  reset(demofile);
+ }
+
+ #ifdef RECORD
+  count=0;
+  assign(demofile,"demo.avd");
+  rewrite(demofile);
+ #endif
+
+}
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
new file mode 100644
index 0000000..1afecae
--- /dev/null
+++ b/engines/avalanche/basher.h
@@ -0,0 +1,40 @@
+#ifndef __basher_h__
+#define __basher_h__
+
+
+#include "gyro.h"
+/*#include "Tommys.h"*/
+
+
+#ifdef RECORD
+
+#ifdef __basher_implementation__
+#undef EXTERN
+#define EXTERN
+#endif
+
+EXTERN word count;
+#undef EXTERN
+#define EXTERN extern
+
+#endif
+
+ void plottext();
+
+ void keyboard_link();
+
+ void cursor_on();
+
+ void get_demorec();
+
+ boolean demo_ready();
+
+ void cursor_off();
+
+ void filename_edit();
+ void normal_edit();
+#ifdef RECORD
+  void record_one();
+#endif
+
+#endif
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
new file mode 100644
index 0000000..a903679
--- /dev/null
+++ b/engines/avalanche/bootstrp.cpp
@@ -0,0 +1,349 @@
+#include "ptoc.h"
+
+
+/*#include "Dos.h"*/
+
+
+/*$M 8192,0,$6000, S-*/
+
+enum elm {normal, musical, elmpoyten, regi, last_elm};
+
+const integer run_shootemup = 1;
+const integer run_dosshell = 2;
+const integer run_ghostroom = 3;
+const integer run_golden = 4;
+
+const array<false,true,varying_string<2> > runcodes = {{"et","Go"}};
+
+const integer reset_ = 0;
+
+const boolean jsb = true;  const boolean no_jsb = false;
+const boolean bflight = true; const boolean no_bflight = false;
+
+
+struct {
+          byte operation;
+          word skellern;
+          array<1,10000,byte> contents;
+} storage;
+
+string arguments,demo_args,args_with_no_filename;
+
+boolean first_time;
+
+byte original_mode;
+pointer old_1c;
+
+string segofs;
+
+boolean zoomy;
+
+longint soundcard,speed,baseaddr,irq,dma;
+
+void cursor_off()     /*assembler; */
+{;
+/* asm
+ mov ah,01; { Change cursor size. */
+/* mov cx,8224; { CH & CL are now 32. */
+/* int $10;  { Call the Bios */
+
+}    /* That's all. */
+
+void cursor_on()     /*assembler; */
+{;
+/*
+asm
+ mov ah,01; { Change cursor size. */
+/* mov ch,5;  { Top line is 5. */
+/* mov cl,7;  { Bottom line is 7. */
+/* int $10;   { Call the Bios. */
+
+}
+
+void quit()
+{
+ cursor_on();
+ exit(0);
+}
+
+string strf(longint x)
+{
+    string q;
+string strf_result;
+;
+ str(x,q); strf_result=q;
+return strf_result;
+}
+
+string command_com()
+{
+    string temp;
+
+ string command_com_result;
+ temp=getenv("comspec");
+ if (temp=="") 
+  output << "avvy_bootstrap: COMSPEC not defined, => cannot run Dos shell." << NL;
+ command_com_result=temp;
+ return command_com_result;
+}
+
+void explain(byte error)
+{
+ output << " (";
+ switch (error) {
+  case 2: output << "it's not there"; break;
+  case 8: output << "out of memory"; break;
+  default: output << "error " << error;
+ }
+ output << ")." << NL;
+}
+
+/*$F+*/
+
+void b_flight()     /*interrupt;*/
+{
+ storage.skellern += 1;
+}
+
+/*$F-*/
+
+void bflight_on()
+{
+ storage.skellern=reset_;
+ setintvec(0x1c,&b_flight);
+}
+
+void bflight_off()
+{
+ setintvec(0x1c,old_1c);
+}
+
+void run(string what, boolean with_jsb,boolean with_bflight, elm how);
+
+
+static string elm2str(elm how)
+{
+ string elm2str_result;
+ switch (how) {
+  case normal: case musical: elm2str_result="jsb"; break;
+  case regi: elm2str_result="REGI"; break;
+  case elmpoyten: elm2str_result="ELMPOYTEN"; break;
+ }
+ return elm2str_result;
+}
+
+void run(string what, boolean with_jsb,boolean with_bflight, elm how)
+{
+ string which_dir,args;
+ integer error;
+
+
+ if (what=="")  return;
+
+ getdir(0,which_dir);
+
+ if (with_jsb) 
+ {
+   if (how==musical) 
+     args=elm2str(how)+' '+args_with_no_filename; /* FN is NOT given if musical*/
+   else
+     args=elm2str(how)+' '+arguments;
+ } else args="";
+
+ if (how==musical)  args=args+strf(soundcard)+' '+strf(speed)+' '+
+                      strf(baseaddr)+' '+strf(dma)+' '+strf(irq);
+ if (with_bflight)  bflight_on();
+
+ swapvectors;
+ exec(what,args);
+ swapvectors;
+ cursor_off();
+
+ error=doserror;
+
+ if (with_bflight)  bflight_off();
+
+ chdir(which_dir);
+
+ if (error!=0) 
+ {
+  output << "avvy_bootstrap: cannot execute " << what << '!';
+  explain(error);
+  output << "Press Enter:"; input >> NL; quit();
+ }
+}
+
+void run_avalot()
+{
+    integer error;
+
+
+ bflight_on();
+
+ swapvectors;
+ exec("avalot.avx",runcodes[first_time]+arguments);
+ swapvectors;
+
+ error=doserror;
+
+ bflight_off();
+
+ if (error!=0) 
+ {
+  output << "avvy_bootstrap: error in loading AVALOT.AVX!";
+  explain(error);
+  quit();
+ }
+
+ first_time=false;
+}
+
+void run_the_demo()
+{
+    string args;
+
+ args=arguments;
+ arguments=demo_args;  /* Force the demo. */
+
+ run_avalot();
+
+ arguments=args;    /* Put all back to normal again. */
+ first_time=true;
+}
+
+void get_arguments()
+{
+ byte fv;
+
+ arguments="";
+
+ for( fv=1; fv <= paramcount; fv ++)
+  arguments=arguments+paramstr(fv)+' ';
+
+ arguments[0] -= 1; /* Get rid of the trailing space. */
+
+ segofs=string(' ')+strf(seg(storage))+' '+strf(ofs(storage));
+
+ arguments=segofs+' '+arguments;
+}
+
+void dos_shell()
+{
+    registers r;
+
+ r.ax=original_mode; intr(0x10,r);
+ output << NL;
+ output << "The Avalot Dos Shell." << NL;
+ output << "---------------------" << NL;
+ output << NL;
+ output << "Type EXIT to return to Avalot." << NL;
+ output << NL;
+
+ cursor_on();
+ run(command_com(),no_jsb,no_bflight,normal);
+ cursor_off();
+
+ output << "Please wait, restoring your game..." << NL;
+}
+
+boolean keypressed1() {
+                                 registers r;
+
+ boolean keypressed1_result;
+ r.ah=0xb;
+ msdos(r);
+ keypressed1_result=r.al==0xff;
+ return keypressed1_result;
+                      }
+
+void flush_buffer() {
+                            registers r;  r.ah=7;
+ while (keypressed1())  msdos(r); }
+
+void demo()
+{
+ run_the_demo(); if (keypressed1())  return;
+ run("intro.avx",jsb,bflight,musical); if (keypressed1())  return;
+ run("stars.avx",jsb,no_bflight,musical); if (keypressed1())  return;
+
+ flush_buffer();
+}
+
+void call_menu()
+{
+ run("stars.avx",jsb,no_bflight,musical);
+ flush_buffer();
+ do {
+  run("avmenu.avx",jsb,no_bflight,normal);
+
+  switch (storage.operation) {
+   case 1: return; break; /* Play the game. */
+   case 2: run("intro.avx",jsb,bflight,musical); break;
+   case 3: run("preview1.avd",jsb,no_bflight,normal); break;
+   case 4: run("viewdocs.avx",jsb,bflight,elmpoyten); break;
+   case 5: run("viewdocs.avx",jsb,bflight,regi); break;
+   case 6: quit(); break;
+   case 177: demo(); break;
+  }
+
+  flush_buffer();
+ } while (!false);
+}
+
+void get_slope()
+{
+ run("slope.avx",jsb,no_bflight,normal);
+ if (dosexitcode!=0) 
+ {
+  cursor_on();
+  exit(0);
+ }
+
+ move(storage.contents,arguments,sizeof(arguments));
+ move(storage.contents[4998],soundcard,4);
+ move(storage.contents[5002],baseaddr,4);
+ move(storage.contents[5006],irq,4);
+ move(storage.contents[5010],dma,4);
+ move(storage.contents[5014],speed,4);
+
+ zoomy=(arguments[8]=='y') || (arguments[2]=='y');
+ demo_args=arguments; demo_args[7]='y';
+ arguments=segofs+' '+arguments;
+ demo_args=segofs+' '+demo_args;
+
+ args_with_no_filename=arguments;
+ if (arguments[length(arguments)]!=' ') 
+ {        /* Filename was given */
+   args_with_no_filename=arguments;
+   while ((args_with_no_filename!="")
+     && (args_with_no_filename[length(args_with_no_filename)]!=' ')) 
+      args_with_no_filename[0] -= 1; /* Strip off the filename. */
+ }
+}
+
+int main(int argc, const char* argv[])
+{
+ pio_initialize(argc, argv);
+ original_mode=mem[seg0040*0x49]; getintvec(0x1c,old_1c);
+ first_time=true; cursor_off();
+
+ get_arguments();
+ get_slope();
+
+ if (! zoomy)  call_menu();    /* Not run when zoomy. */
+
+ do {
+  run_avalot();
+
+  if (dosexitcode!=77)  quit(); /* Didn't stop for us. */
+
+  switch (storage.operation) {
+   case run_shootemup: run("seu.avx",jsb,bflight,normal); break;
+   case run_dosshell: dos_shell(); break;
+   case run_ghostroom: run("g-room.avx",jsb,no_bflight,normal); break;
+   case run_golden: run("golden.avx",jsb,bflight,musical); break;
+  }
+
+ } while (!false);
+ return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
new file mode 100644
index 0000000..b891123
--- /dev/null
+++ b/engines/avalanche/cadburys.cpp
@@ -0,0 +1,109 @@
+#include "ptoc.h"
+
+#define __cadburys_implementation__
+
+
+#include "cadburys.h"
+
+
+#include "graph.h"
+
+
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=((realx-ch.x*8)+(x2-x1)+7) / 8;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
new file mode 100644
index 0000000..65e7bd7
--- /dev/null
+++ b/engines/avalanche/cadburys.h
@@ -0,0 +1,41 @@
+#ifndef __cadburys_h__
+#define __cadburys_h__
+
+
+const integer arraysize = 12000;
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+
+#ifdef __cadburys_implementation__
+#undef EXTERN
+#define EXTERN
+#endif
+
+EXTERN array<0,arraysize,byte> aa;
+EXTERN byte num_chunks,this_chunk;
+EXTERN integer gd,gm;
+EXTERN array<1,30,longint> offsets;
+EXTERN untyped_file f;
+#undef EXTERN
+#define EXTERN extern
+
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat);
+
+#endif
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
new file mode 100644
index 0000000..61357f5
--- /dev/null
+++ b/engines/avalanche/celer.cpp
@@ -0,0 +1,472 @@
+#include "ptoc.h"
+
+/*
+  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
+  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
+  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
+
+                 CELER            The unit for updating the screen pics. */
+
+#define __celer_implementation__
+
+
+#include "celer.h"
+
+
+#include "Graph.h"
+#include "trip5.h"
+#include "lucerna.h"
+/*#include "Crt.h"*/
+
+
+untyped_file f; /* Private variable- not accessible from elsewhere. */
+
+const integer on_disk = -1; /* Value of memos[fv].x when it's not in memory. */
+
+void pics_link()
+{
+    byte xx;
+
+ if (ddmnow)  return; /* No animation when the menus are up. */
+
+ { dnatype& with = dna; 
+  switch (with.room) {
+
+   case r__outsideargentpub: {
+    if ((roomtime % longint(12))==0) 
+     show_one(longint(1)+(roomtime / longint(12)) % longint(4));
+   }
+   break;
+
+   case r__brummieroad: if ((roomtime % longint(2))==0) 
+    show_one(longint(1)+(roomtime / longint(2)) % longint(4));
+    break;
+
+   case r__bridge: if ((roomtime % longint(2))==0) 
+    show_one(longint(4)+(roomtime / longint(2)) % longint(4));
+    break;
+
+   case r__yours: if ((! with.avvy_is_awake) && ((roomtime % longint(4))==0)) 
+              show_one(longint(1)+(roomtime / longint(12)) % longint(2));
+              break;
+
+   case r__argentpub: {
+                  if (((roomtime % longint(7))==1) && (dna.malagauche!=177)) 
+                  {     /* Malagauche cycle */
+                   dna.malagauche += 1;
+                   switch (dna.malagauche) {
+                    case 1:case 11:case 21: show_one(12); break; /* Looks forwards. */
+                    case 8:case 18:case 28:case 32: show_one(11); break; /* Looks at you. */
+                    case 30: show_one(13); break; /* Winks. */
+                    case 33: dna.malagauche=0; break;
+                   }
+                  }
+
+                  switch (roomtime % longint(200)) {
+                   case 179:case 197: show_one(5); break; /* Dogfood's drinking cycle */
+                   case 182:case 194: show_one(6); break;
+                   case 185: show_one(7); break;
+                   case 199: dna.dogfoodpos=177; break; /* Impossible value for this. */
+                   case 0 ... 178: { /* Normally. */
+                            switch (bearing(2)) {/* Bearing of Avvy from Dogfood. */
+                              case 1 ... 90:case RANGE_3(358,360): xx=3; break;
+                              case 293 ... 357: xx=2; break;
+                              case 271 ... 292: xx=4; break;
+                            }
+                            if (xx!=dna.dogfoodpos)    /* Only if it's changed.*/
+                            {
+                             show_one(xx);
+                             dna.dogfoodpos=xx;
+                            }
+                           }
+                           break;
+                  }
+                 }
+                 break;
+
+   case r__westhall: if ((roomtime % longint(3))==0) 
+                 switch ((roomtime / longint(3)) % longint(6)) {
+                  case 4: show_one(1); break;
+                  case 1:case 3:case 5: show_one(2); break;
+                  case 0:case 2: show_one(3); break;
+                 }
+                 break;
+   case r__lustiesroom: if (! (dna.lustie_is_asleep))  {
+                    if ((roomtime % longint(45))>42)  xx=4; /* du Lustie blinks */
+                    else
+                    switch (bearing(2)) {/* Bearing of Avvy from du Lustie. */
+                      case 0 ... 45:case 315 ... 360: xx=1; break; /* Middle. */
+                       case 45 ... 180: xx=2; break; /* Left. */
+                      case 181 ... 314: xx=3; break; /* Right. */
+                    }
+                    if (xx!=dna.dogfoodpos)    /* Only if it's changed.*/
+                    {
+                     show_one(xx);
+                     dna.dogfoodpos=xx;  /* We use DogfoodPos here too- why not? */
+                    }
+                   }
+                   break;
+
+   case r__aylesoffice: if ((! dna.ayles_is_awake) && (roomtime % longint(14)==0)) 
+                   {
+                    switch ((roomtime / longint(14)) % longint(2)) {
+                     case 0: show_one(1); break; /* Frame 2: EGA. */
+                     case 1: show_one(3); break; /* Frame 1: Natural. */
+                    }
+                   }
+                   break;
+
+   case r__robins: if (dna.tied_up) 
+               switch (roomtime % longint(54)) {
+                case 20: show_one(4); break; /* Frame 4: Avalot blinks. */
+                case 23: show_one(2); break; /* Frame 1: Back to normal. */
+               }
+               break;
+
+   case r__nottspub: {
+                 switch (bearing(5)) { /* Bearing of Avvy from Port. */
+                   case 0 ... 45:case 315 ... 360: xx=2; break; /* Middle. */
+                    case 45 ... 180: xx=6; break; /* Left. */
+                   case 181 ... 314: xx=8; break; /* Right. */
+                 }
+
+                 if ((roomtime % longint(60))>57)  xx -= 1; /* Blinks */
+
+                 if (xx!=dna.dogfoodpos)    /* Only if it's changed.*/
+                 {
+                  show_one(xx);
+                  dna.dogfoodpos=xx;  /* We use DogfoodPos here too- why not? */
+                 }
+
+                 switch (roomtime % longint(50)) {
+                  case 45 : show_one(9); break; /* Spurge blinks */
+                  case 49 : show_one(10); break;
+                 }
+                }
+                break;
+
+   case r__ducks: {
+              if ((roomtime % longint(3))==0)  /* The fire flickers */
+               show_one(longint(1)+(roomtime / longint(3)) % longint(3));
+
+              switch (bearing(2)) {/* Bearing of Avvy from Duck. */
+                case 0 ... 45:case 315 ... 360: xx=4; break; /* Middle. */
+                 case 45 ... 180: xx=6; break; /* Left. */
+                case 181 ... 314: xx=8; break; /* Right. */
+              }
+
+              if ((roomtime % longint(45))>42)  xx += 1; /* Duck blinks */
+
+              if (xx!=dna.dogfoodpos)    /* Only if it's changed.*/
+              {
+               show_one(xx);
+               dna.dogfoodpos=xx;  /* We use DogfoodPos here too- why not? */
+              }
+             }
+             break;
+
+  }}
+
+ if ((dna.ringing_bells) && (flagset('B'))) 
+   /* They're ringing the bells. */
+  switch (roomtime % longint(4)) {
+   case 1: {
+       dnatype& with = dna; 
+
+       if (with.nextbell<5)  with.nextbell=12;
+       with.nextbell -= 1;
+       note(notes[with.nextbell]);
+           }
+           break;
+   case 2: nosound; break;
+  }
+
+}
+
+void load_chunks(string xx)
+{
+ chunkblocktype ch;
+ byte fv;
+
+ /*$I-*/
+ assign(f,string("chunk")+xx+".avd"); /* strf is done for us by Lucerna. */
+ reset(f,1);
+ if (ioresult!=0)  return; /* no Chunk file. */
+ seek(f,44);
+ blockread(f,num_chunks,1);
+ blockread(f,offsets,num_chunks*4);
+
+ for( fv=1; fv <= num_chunks; fv ++)
+ {
+  seek(f,offsets[fv]);
+  blockread(f,ch,sizeof(ch));
+  {
+   if (ch.memorise) 
+   {
+
+    {
+     memotype& with1 = memos[fv]; 
+
+     with1.x=ch.x; with1.xl=ch.xl;
+     with1.y=ch.y; with1.yl=ch.yl;
+     with1.flavour=ch.flavour;
+     with1.size=ch.size;
+    }
+
+    getmem(memory[fv],ch.size);
+
+    if (ch.natural) 
+    {
+     getimage(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl,memory[fv]);
+    } else
+     blockread(f,memory[fv],ch.size);
+   } else memos[fv].x=on_disk;
+  }
+ }
+
+ close(f);
+ /*$I+*/
+}
+
+void forget_chunks()
+{
+    byte fv;
+
+ for( fv=1; fv <= num_chunks; fv ++)
+  if (memos[fv].x>on_disk) 
+   freemem(memory[fv],memos[fv].size);
+ fillchar(memos,sizeof(memos),'\377'); /* x=-1, => on disk. */
+}
+
+void mdrop(integer x,integer y,integer xl,integer yl, pointer p) /* assembler;
+asm
+  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
+  push bp;      { Nor BP! }
+
+
+  { DI holds the offset on this page. It starts at the top left-hand corner. }
+  { (It should equal ch.y*80+ch.x. }
+
+  mov ax,y;
+  mov dl,80;
+  mul dl; { Line offset now calculated. }
+  mov di,ax; { Move it into DI. }
+  mov ax,x;
+  add di,ax; { Full offset now calculated. }
+
+  mov bx,yl; { No. of times to repeat lineloop. }
+  inc bx;        { "loop" doesn't execute the zeroth time. }
+  mov bh,bl;     { Put it into BH. }
+
+  { BP holds the length of the string to copy. It's equal to ch.xl.}
+
+  mov ax,word(p);   { Data is held at DS:SI. }
+  mov si,ax;
+  mov ax,word(p+2); { This will be moved over into ds in just a tick... }
+
+  mov bp,xl;
+
+  mov ds,ax;
+
+
+  cld;          { We're allowed to hack around with the flags! }
+
+  mov ax,$AC00; { Top of the first EGA page. }
+  mov es,ax;    { Offset on this page is calculated below... }
+
+
+{    port[$3c4]:=2; port[$3ce]:=4; }
+
+  mov dx,$3c4;
+  mov al,2;
+  out dx,al;
+  mov dx,$3ce;
+  mov al,4;
+  out dx,al;
+
+  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
+  mov bl,0;
+
+
+ @mainloop:
+
+    push di;
+    push cx;
+
+{    port[$3C5]:=1 shl bit; }
+    mov dx,$3C5;
+    mov al,1;
+    mov cl,bl; { BL = bit. }
+    shl al,cl;
+    out dx,al;
+{     port[$3CF]:=bit; }
+    mov dx,$3CF;
+    mov al,bl; { BL = bit. }
+    out dx,al;
+
+    xor ch,ch;
+    mov cl,bh; { BH = ch.yl. }
+
+   @lineloop:
+
+     push cx;
+
+     mov cx,bp;
+
+     repz movsb; { Copy the data. }
+
+     sub di,bp;
+     add di,80;
+
+     pop cx;
+
+   loop @lineloop;
+
+    inc bl; { One more on BL. }
+
+    pop cx;
+    pop di;
+
+ loop @mainloop;
+
+  pop bp;
+  pop ds;       { Get DS back again. }
+*/
+{;
+}
+
+void show_one(byte which);
+
+static bytefield r;
+
+static void display_it(integer x,integer y,integer xl,integer yl, flavourtype flavour, pointer p)
+{
+ {
+  switch (flavour) {
+   case ch_bgi : {
+             putimage(x*8,y,p,0);
+             r.x1=x; r.y1=y;
+             r.x2=x+xl+1; r.y2=y+yl;
+            }
+            break;
+   case ch_ega : {
+             mdrop(x,y,xl,yl,p); blitfix();
+             r.x1=x; r.y1=y; r.x2=x+xl; r.y2=y+yl;
+            }
+            break;
+  }
+}
+}
+
+void show_one(byte which)
+{
+ chunkblocktype ch;
+ pointer p;
+ byte fv;
+
+
+ setactivepage(3);
+
+ {
+  memotype& with = memos[which]; 
+
+  if (with.x>on_disk) 
+  {
+   display_it(with.x,with.y,with.xl,with.yl,with.flavour,memory[which]);
+  } else
+  {
+   reset(f,1);
+   seek(f,offsets[which]);
+   blockread(f,ch,sizeof(ch));
+
+   {
+    getmem(p,ch.size);
+    blockread(f,p,ch.size);
+
+    display_it(ch.x,ch.y,ch.xl,ch.yl,ch.flavour,p);
+    freemem(p,ch.size);
+
+    close(f);
+   }
+
+  }
+
+  setactivepage(1-cp);
+
+  for( fv=0; fv <= 1; fv ++)
+   getset[fv].remember(r);
+ }
+
+}
+
+void show_one_at(byte which, integer xxx,integer yyy);
+
+static bytefield r1;
+
+static void display_it1(integer xl,integer yl, flavourtype flavour, pointer p, integer& xxx, integer& yyy)
+{
+ {
+  switch (flavour) {
+   case ch_bgi : {
+             putimage(xxx,yyy,p,0);
+             r1.x1=xxx; r1.y1=yyy;
+             r1.x2=xxx+xl+1; r1.y2=yyy+yl;
+            }
+            break;
+   case ch_ega : {
+             mdrop(xxx / 8,yyy,xl,yl,p); blitfix();
+             r1.x1=xxx / 8; r1.y1=yyy; r1.x2=(xxx / 8)+xl; r1.y2=yyy+yl;
+            }
+            break;
+  }
+}
+}
+
+void show_one_at(byte which, integer xxx,integer yyy)
+{
+ chunkblocktype ch;
+ pointer p;
+ byte fv;
+
+
+ setactivepage(3);
+
+ {
+  memotype& with = memos[which]; 
+
+  if (with.x>on_disk) 
+  {
+   display_it1(with.xl,with.yl,with.flavour,memory[which], xxx, yyy);
+  } else
+  {
+   reset(f,1);
+   seek(f,offsets[which]);
+   blockread(f,ch,sizeof(ch));
+
+   {
+    getmem(p,ch.size);
+    blockread(f,p,ch.size);
+
+    display_it1(ch.xl,ch.yl,ch.flavour,p, xxx, yyy);
+    freemem(p,ch.size);
+
+    close(f);
+   }
+
+  }
+
+  setactivepage(1-cp);
+
+  for( fv=0; fv <= 1; fv ++)
+   getset[fv].remember(r1);
+ }
+}
+
+class unit_celer_initialize {
+  public: unit_celer_initialize();
+};
+static unit_celer_initialize celer_constructor;
+
+unit_celer_initialize::unit_celer_initialize() {
+ num_chunks=0;
+}
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
new file mode 100644
index 0000000..f6ad52f
--- /dev/null
+++ b/engines/avalanche/celer.h
@@ -0,0 +1,53 @@
+#ifndef __celer_h__
+#define __celer_h__
+
+
+#include "closing.h"
+#include "incline.h"
+#include "gyro.h"
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+struct memotype {
+            integer x,y;
+            integer xl,yl;
+            flavourtype flavour;
+            word size;
+};
+
+
+#ifdef __celer_implementation__
+#undef EXTERN
+#define EXTERN
+#endif
+
+EXTERN array<1,40,longint> offsets;
+EXTERN byte num_chunks;
+EXTERN array<1,40,memotype> memos;
+EXTERN array<1,40,pointer> memory;
+#undef EXTERN
+#define EXTERN extern
+
+
+   void pics_link();
+
+   void load_chunks(string xx);
+
+   void forget_chunks();
+
+   void show_one(byte which);
+
+   void show_one_at(byte which, integer xxx,integer yyy);
+
+#endif
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
new file mode 100644
index 0000000..a27c261
--- /dev/null
+++ b/engines/avalanche/ch_egats.cpp
@@ -0,0 +1,155 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+untyped_file f;
+longint offset;
+chunkblocktype ch;
+integer gd,gm;
+byte bit;
+pointer p;
+
+void mdrop(integer x,integer y,integer xl,integer yl, pointer p) /* assembler;
+asm
+  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
+  push bp;      { Nor BP! }
+
+
+  { DI holds the offset on this page. It starts at the top left-hand corner. }
+  { (It should equal ch.y*80+ch.x. }
+
+  mov ax,y;
+  mov dl,80;
+  mul dl; { Line offset now calculated. }
+  mov di,ax; { Move it into DI. }
+  mov ax,x;
+  add di,ax; { Full offset now calculated. }
+
+  mov bx,yl; { No. of times to repeat lineloop. }
+  inc bx;        { "loop" doesn't execute the zeroth time. }
+  mov bh,bl;     { Put it into BH. }
+
+  { BP holds the length of the string to copy. It's equal to ch.xl.}
+
+  mov ax,word(p);   { Data is held at DS:SI. }
+  mov si,ax;
+  mov ax,word(p+2); { This will be moved over into ds in just a tick... }
+
+  mov bp,xl;
+
+  mov ds,ax;
+
+
+  cld;          { We're allowed to hack around with the flags! }
+
+  mov ax,$A000; { Top of the first EGA page. }
+  mov es,ax;    { Offset on this page is calculated below... }
+
+
+{    port[$3c4]:=2; port[$3ce]:=4; }
+
+  mov dx,$3c4;
+  mov al,2;
+  out dx,al;
+  mov dx,$3ce;
+  mov al,4;
+  out dx,al;
+
+  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
+  mov bl,0;
+
+
+ @mainloop:
+
+    push di;
+    push cx;
+
+{    port[$3C5]:=1 shl bit; }
+    mov dx,$3C5;
+    mov al,1;
+    mov cl,bl; { BL = bit. }
+    shl al,cl;
+    out dx,al;
+{     port[$3CF]:=bit; }
+    mov dx,$3CF;
+    mov al,bl; { BL = bit. }
+    out dx,al;
+
+    xor ch,ch;
+    mov cl,bh; { BH = ch.yl. }
+
+   @lineloop:
+
+     push cx;
+
+     mov cx,bp;
+
+     repz movsb; { Copy the data. }
+
+     sub di,bp;
+     add di,80;
+
+     pop cx;
+
+   loop @lineloop;
+
+    inc bl; { One more on BL. }
+
+    pop cx;
+    pop di;
+
+ loop @mainloop;
+
+  pop bp;
+  pop ds;       { Get DS back again. }
+*/
+{;
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ assign(f,"chunk21.avd");
+ reset(f,1);
+
+ seek(f,49);
+ blockread(f,offset,4);
+
+ seek(f,offset);
+
+ blockread(f,ch,sizeof(ch));
+
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+
+ getmem(p,ch.size);
+ blockread(f,p,ch.size);
+/* putimage(0,0,p^,0);*/
+
+
+/* with ch do
+  for bit:=0 to 3 do
+  begin;
+   port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
+   for gm:=0 to yl do
+    blockread(f,mem[$A000*gm*80],(ch.xl+7) div 8);
+  end;*/
+
+  mdrop(ch.x,ch.y,ch.xl,ch.yl,p);
+
+ close(f);
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
new file mode 100644
index 0000000..8b38f8a
--- /dev/null
+++ b/engines/avalanche/charmap.cpp
@@ -0,0 +1,30 @@
+#include "ptoc.h"
+
+
+/*#include "Dos.h"*/
+
+struct infotype {
+            matrix<128,255,1,8,byte> chars;
+            string data;
+};
+infotype table;
+pointer where;
+byte w,fv,ff,num;
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ getintvec(0x1f,where); move(where,table,1024);
+ for( w=128; w <= 255; w ++)
+ {; output << w << NL;
+ for( fv=1; fv <= 8; fv ++)
+ {;
+  num=table.chars[w][fv];
+  for( ff=1; ff <= 8; ff ++)
+  {;
+   if ((num & 128)==0)  output << "  "; else output << "ÛÛ";
+   num=num << 1;
+  }
+  output << NL;
+ } }
+return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
new file mode 100644
index 0000000..6d48054
--- /dev/null
+++ b/engines/avalanche/chunker.cpp
@@ -0,0 +1,86 @@
+#include "ptoc.h"
+
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+untyped_file f;
+string fn;
+byte num_chunks,fv;
+longint offset;
+chunkblocktype ch;
+
+int main(int argc, const char* argv[])
+{
+   pio_initialize(argc, argv);
+   output << NL;
+   output << "CHUNKER 12/3/1995 TT" << NL;
+   output << NL;
+
+   if (paramcount!=1) 
+   {
+      output << "which chunk file?" << NL;
+      exit(0);
+   }
+
+   fn=paramstr(1);
+   assign(f,fn);
+   reset(f,1);
+   output << "----- In chunk file " << fn << ", there are: -----" << NL;
+
+   seek(f,44);
+   blockread(f,num_chunks,1);
+   output << format(num_chunks,4) << " chunks:" << NL;
+
+   output << "  No  Hdr    Offset  Flvr  Mem Nat      X      Y  Width Height Size of image" << NL;
+
+   for( fv=1; fv <= num_chunks; fv ++)
+   {
+
+      output << "Ch" << format(fv,2) << ':';
+
+      seek(f,41+fv*4);
+
+      output << format(41+fv*4,4);
+      blockread(f,offset,4);
+      output << format(offset,10);
+
+      seek(f,offset);
+      blockread(f,ch,sizeof(ch));
+      {
+         if (ch.flavour==ch_bgi) 
+            output << " ch_BGI";
+         else
+            output << " ch_EGA";
+
+         if (ch.memorise) 
+            output << " yes";
+         else
+            output << " no ";
+
+         if (ch.natural) 
+            output << " yes";
+         else
+            output << " no ";
+
+         output << format(ch.x,7) << format(ch.y,7) << format(ch.xl,7) << format(ch.yl,7) << format(ch.size,10);
+      }
+
+      output << NL;
+   }
+
+   output << "---ENDS---" << NL;
+
+   close(f);
+   return EXIT_SUCCESS;
+}
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
new file mode 100644
index 0000000..dce3722
--- /dev/null
+++ b/engines/avalanche/chunkxf1.cpp
@@ -0,0 +1,259 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+#include "cadburys.h"
+
+
+/*type
+ flavourtype = (ch_EGA,ch_BGI);
+
+ chunkblocktype = record
+                   flavour:flavourtype;
+                   x,y:integer;
+                   xl,yl:integer;
+                   size:longint;
+                   natural:boolean;
+
+                   memorise:boolean; { Hold it in memory? }
+                  end;*/
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+/* arraysize = 12000;*/
+
+/* offsets:array[1..30] of longint;*/
+byte num_chunks/*,this_chunk*/;
+integer gd,gm;
+/* f:file;*/
+/* aa:array[0..arraysize] of byte;*/
+
+void load()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+ assign(f,"chunkbit.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ assign(f,"place21.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk21.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+/*
+procedure mgrab(x1,y1,x2,y2:integer; size:word);
+var yy:integer; aapos:word; length,bit:byte;
+begin;
+ if size>arraysize then
+ begin;
+  writeln('*** SORRY! *** Increase the arraysize constant to be greater');
+  writeln(' than ',size,'.');
+  halt;
+ end;
+
+ aapos:=0;
+
+ length:=x2-x1;
+
+ for bit:=0 to 3 do
+ begin;
+  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
+  for yy:=y1 to y2 do
+  begin;
+   move(mem[$A400*yy*80+x1],aa[aapos],length);
+   move(aa[aapos],mem[$A400*yy*80],length);
+(*   fillchar(mem[$A400:yy*80+x1],length,#177);*)
+   inc(aapos,length);
+  end;
+ end;
+ bit:=getpixel(0,0);
+
+end;
+*/
+/*procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
+ mem,nat:boolean);
+ { yes, I *do* know how to spell "really"! }
+var
+ s:word;
+ p:pointer;
+ ch:chunkblocktype;
+begin;
+ inc(this_chunk);
+ offsets[this_chunk]:=filepos(f);
+
+
+ s:=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p^);
+
+ with ch do
+ begin;
+  flavour:=flav;
+  x:=realx; y:=realy;
+
+  xl:=x2-x1;
+  yl:=y2-y1;
+  size:=s;
+  memorise:=mem;
+  natural:=nat;
+ end;
+
+ setvisualpage(1);
+ setactivepage(1);
+ readln;
+ putimage(ch.x,ch.y,p^,0);
+
+ if flav=ch_EGA then
+ begin;
+  freemem(p,s);
+  s:=4*((x2-x1+7) div 8)*(y2-y1+1);
+  with ch do
+  begin;
+   size:=s;
+   x:=x div 8;
+   xl:=(xl+7) div 8;
+   mgrab(x,y,x+xl,y+yl,s);
+  end;
+ end;
+
+ readln;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ case flav of
+  ch_EGA : if not nat then blockwrite(f,aa,s);
+  ch_BGI : begin;
+            if not nat then blockwrite(f,p^,s);
+            freemem(p,s);
+           end;
+ end;
+{ rectangle(x1,y1,x2,y2);}
+end;*/
+
+/*procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
+ mem,nat:boolean);*/
+ /* yes, I *do* know how to spell "really"! */
+/*var
+ s:word;
+ p:pointer;
+ ch:chunkblocktype;
+begin;
+(* rectangle(x1,y1,x2,y2); exit;*)
+ inc(this_chunk);
+ offsets[this_chunk]:=filepos(f);
+
+
+ s:=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p^);
+
+ with ch do
+ begin;
+  flavour:=flav;
+  x:=realx; y:=realy;
+
+  xl:=x2-x1;
+  yl:=y2-y1;
+  size:=s;
+  memorise:=mem;
+  natural:=nat;
+ end;
+
+ setvisualpage(1);
+ setactivepage(1);
+ readln;
+ putimage(ch.x,ch.y,p^,0);
+
+ if flav=ch_EGA then
+ begin;
+  freemem(p,s);
+  s:=4*(((x2 div 8)-(x1 div 8))+2)*(y2-y1+1);
+  with ch do
+  begin;
+   size:=s;
+   x:=x div 8;
+   xl:=(xl div 8)+2;
+   mgrab(x,y,x+xl,y+yl,s);
+  end;
+ end else
+  with ch do { For BGI pictures. *//*
+  begin;
+   x:=x div 8;
+   xl:=(xl+7) div 8;
+   size:=imagesize(x*8,y,(x+xl)*8,y+yl);
+  end;
+
+ readln;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ case flav of
+  ch_EGA : if not nat then blockwrite(f,aa,s);
+  ch_BGI : begin;
+            if not nat then blockwrite(f,p^,s);
+            freemem(p,s);
+           end;
+ end;
+(* rectangle(x1,y1,x2,y2);*)
+end;*/
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ setwritemode(xorput);
+
+ num_chunks=7;
+
+ open_chunk();
+
+ grab( 98,10,181,41,247,82,ch_ega,false,false); /* Drawbridge... */
+ grab(223,10,320,41,233,82,ch_ega,false,false);
+ grab(361,10,458,64,233,82,ch_ega,false,false);
+
+ grab( 11,10, 39,22,172,17,ch_bgi,true,true);
+ grab( 11,38, 39,50,172,17,ch_ega,true,false); /* Flag. */
+ grab( 11,24, 39,36,172,17,ch_ega,true,false);
+ grab( 11,10, 39,22,172,17,ch_ega,true,false);
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
new file mode 100644
index 0000000..5d77d29
--- /dev/null
+++ b/engines/avalanche/chunkxf2.cpp
@@ -0,0 +1,192 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 32000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void load()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place9.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+}
+
+void load_temp(string which)
+{
+ byte a0 /*absolute $A000:800*/;
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+ assign(f,which); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+ bit=getpixel(0,0);
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk9.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2, integer realx, integer realy, boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  if (nat) 
+   ch.flavour=ch_bgi;
+  else ch.flavour=ch_ega; /* At the moment, Celer can't handle natural ch_EGAs. */
+  ch.x=realx;
+  ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ freemem(p,s);
+ {;
+  if (ch.flavour==ch_bgi)  s=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+   else s=4*((x2-x1+7) / 8)*(y2-y1+1);
+  ch.size=s;
+  ch.x=ch.x / 8;
+  ch.xl=(ch.xl+7) / 8;
+  mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+ }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ if (! nat)  blockwrite(f,aa,s);
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ load_temp("d:chunkbit.avd");
+ setwritemode(xorput);
+
+ num_chunks=7;
+
+ open_chunk();
+
+ grab( 78, 78,232,102,212, 10,true,false); /* 154 across */
+ grab(235, 78,389,102,212, 10,true,false);
+ grab(392, 78,546,102,212, 10,true,false);
+ grab(392, 78,546,102,212, 10,true,true);
+
+ load_temp("d:chunkbi3.avd");
+
+ grab(437, 51,475, 78,147,120,false,false); /* 5 = door half-open. */
+ grab(397, 51,435, 78,147,120,false,false); /* 6 = door open. */
+ grab(397, 51,435, 78,147,120,true,true);   /* 7 = door shut. */
+
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
new file mode 100644
index 0000000..220d07b
--- /dev/null
+++ b/engines/avalanche/chunkxf3.cpp
@@ -0,0 +1,250 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+#include "cadburys.h"
+
+
+/*type
+ flavourtype = (ch_EGA,ch_BGI);
+
+ chunkblocktype = record
+                   flavour:flavourtype;
+                   x,y:integer;
+                   xl,yl:integer;
+                   size:longint;
+                   natural:boolean;
+
+                   memorise:boolean; { Hold it in memory? }
+                  end;
+
+const
+ chunkheader : array[1..44] of char =
+ 'Chunk-type AVD file, for an Avvy game.'+#26+#177+#$30+#$01+#$75+#177;
+
+ arraysize = 12000;
+
+var
+ offsets:array[1..30] of longint;
+ num_chunks,this_chunk:byte;
+ gd,gm:integer;
+ f:file;
+ aa:array[0..arraysize] of byte;*/
+
+string strf(longint x)
+{
+    string q;
+string strf_result;
+;
+ str(x,q); strf_result=q;
+return strf_result;
+}
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void loadtemp(string n)
+{
+ byte a0 /*absolute $A000:800*/;
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+ assign(f,n); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+ bit=getpixel(0,0);
+ finder();
+}
+
+void load()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+ assign(f,"place22.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setactivepage(1); setvisualpage(1); finder();
+ setactivepage(0); setvisualpage(0);
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk22.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+/*procedure mgrab(x1,y1,x2,y2:integer; size:word);
+var yy:integer; aapos:word; length,bit:byte;
+begin;
+ if size>arraysize then
+ begin;
+  writeln('*** SORRY! *** Increase the arraysize constant to be greater');
+  writeln(' than ',size,'.');
+  halt;
+ end;
+
+ aapos:=0;
+
+ length:=x2-x1;
+
+ for bit:=0 to 3 do
+ begin;
+  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
+  for yy:=y1 to y2 do
+  begin;
+   move(mem[$A400*yy*80+x1],aa[aapos],length);
+   inc(aapos,length);
+  end;
+ end;
+ bit:=getpixel(0,0);
+
+end;
+
+procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
+ mem,nat:boolean);
+ { yes, I *do* know how to spell "really"! }
+var
+ s:word;
+ p:pointer;
+ ch:chunkblocktype;
+begin;
+ inc(this_chunk);
+ offsets[this_chunk]:=filepos(f);
+
+
+ s:=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p^);
+
+ with ch do
+ begin;
+  flavour:=flav;
+  x:=realx; y:=realy;
+
+  xl:=x2-x1;
+  yl:=y2-y1;
+  size:=s;
+  memorise:=mem;
+  natural:=nat;
+ end;
+
+ setvisualpage(1);
+ setactivepage(1);
+ readln;
+ putimage(ch.x,ch.y,p^,0);
+
+ if flav=ch_EGA then
+ begin;
+  freemem(p,s);
+  s:=4*((x2-x1+7) div 8)*(y2-y1+1);
+  with ch do
+  begin;
+   size:=s;
+   x:=x div 8;
+   xl:=(xl+7) div 8;
+   mgrab(x,y,x+xl,y+yl,s);
+  end;
+ end;
+
+ readln;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ case flav of
+  ch_EGA : if not nat then blockwrite(f,aa,s);
+  ch_BGI : begin;
+            if not nat then blockwrite(f,p^,s);
+            freemem(p,s);
+           end;
+ end;
+{ rectangle(x1,y1,x2,y2);}
+end;*/
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ loadtemp("chunkbit.avd"); load();
+ setwritemode(xorput);
+
+ num_chunks=9;
+
+ open_chunk();
+
+ grab(  0,103,169,159, 72,86,ch_ega,false,false); /* Stairs... */
+ grab(172,103,341,159, 72,86,ch_ega,false,false);
+
+ loadtemp("chunkbi3.avd");
+
+ grab(  0,130, 79,157,341,94,ch_bgi,true ,true );
+ grab(  0,130, 79,157,341,94,ch_ega,false,false);
+ grab(  0,102, 79,129,341,94,ch_ega,false,false);
+ grab(  0, 74, 79,101,341,94,ch_ega,false,false); /* Far door. */
+
+ loadtemp("chunkbi2.avd");
+
+ grab(393, 92,451,137,512,98,ch_bgi,true ,true ); /* Right-hand door. */
+ grab(393, 92,451,137,512,98,ch_ega,false,false);
+ grab(453, 92,511,137,512,98,ch_ega,false,false);
+
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
new file mode 100644
index 0000000..2dfa34d
--- /dev/null
+++ b/engines/avalanche/chunkxf4.cpp
@@ -0,0 +1,285 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+enum kind {walled,unwalled, last_kind};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+const kind w = walled; const kind uw = unwalled;
+
+array<1,50,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void rdln()
+{
+    char r;
+      return;
+ do { r=readkey(); } while (!(! keypressed()));
+}
+
+void load(kind k)
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+
+
+ if (k==unwalled)  assign(f,"place29.avd");
+  else assign(f,"walled.avd");
+
+ reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+}
+
+void finder()
+{
+    char r; integer x,y;
+      return;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void loadtemp(string which)
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+
+
+ assign(f,string("corr")+which+"tmp.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{
+ assign(f,"chunk29.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+
+ if (size>arraysize) 
+ {
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat, kind k)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ load(k);
+
+ setvisualpage(1);
+ setactivepage(1);
+ rdln();
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=((realx-ch.x*8)+(x2-x1)+7) / 8;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ rdln();
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{
+ pio_initialize(argc, argv);
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ setwritemode(xorput);
+
+ loadtemp("2");
+
+ num_chunks=32;
+
+ open_chunk();
+
+ grab(  0, 11,100,104,260,41,ch_ega,false,false,uw); /*1 Geida's door. */
+ grab(103, 12,203, 55,207,61,ch_ega,false,false,uw); /*2 "Ite mingite" sign. */
+ grab(123, 59,185,103,254,90,ch_ega,false,false,uw); /*3 Normal N door (rt handle)*/
+ grab(227, 10,289, 56,254,88,ch_ega,false,false,uw); /*4 Normal N door (lt handle)*/
+ grab(207, 63,294,105,  9,47,ch_ega,false,false, w); /*5 Window in left wall. */
+ grab(312, 10,416, 56,233,88,ch_ega,false,false,uw); /*6 North archway */
+ grab(331, 78,384,101, 32,64,ch_ega,false,false, w); /*7 2 torches, L wall. */
+ grab(607,142,621,157,233,88,ch_ega,false,false,uw); /*8 1 torch, N wall. */
+ grab(417, 11,577, 59,311,61,ch_ega,false,false,uw); /*9 "The Wrong Way!" sign. */
+
+ loadtemp("3");
+
+ grab(  0, 11, 62, 63,557,108,ch_ega,false,false, w); /*10 Near right candle */
+ grab( 64, 11,120, 63, 18,108,ch_ega,false,false, w); /*11 Near left candle */
+ grab(122, 11,169, 55, 93,100,ch_ega,false,false, w); /*12 Far left candle */
+ grab(171, 11,222, 52,500,100,ch_ega,false,false, w); /*13 Far right candle */
+ grab( 32, 68, 84,104,285, 70,ch_ega,false,false,uw); /*14 Far window */
+ grab(138, 65,190, 92,233, 88,ch_ega,false,false,uw); /*15 Baron du Lustie pic 1 */
+ grab(244, 65,296, 92,103, 51,ch_ega,false,false,uw); /*16 Baron du Lustie pic 2 */
+ grab(172, 54,280, 63,233, 88,ch_ega,false,false,uw); /*17 "Art Gallery" sign */
+ grab(341, 18,402, 47,563, 48,ch_ega,false,false, w); /*18 Right wall torches */
+ grab(528, 10,639,160,528, 10,ch_ega,false,false,uw); /*19 Right wall */
+ grab(430, 50,526, 88,543, 50,ch_ega,false,false, w); /*20 Window in right wall */
+ grab(451, 91,494,152,566, 91,ch_ega,false,false, w); /*21 Door in right wall */
+ grab(238, 10,307, 14,484,156,ch_ega,false,false, w); /*22 Near wall door: right */
+ grab(239, 16,300, 20,300,156,ch_ega,false,false, w); /*23 Near wall door: middle */
+ grab(234, 22,306, 26,100,156,ch_ega,false,false, w); /*24 Near wall door: left */
+ grab( 25,113, 87,156,254, 90,ch_ega,false,false, w); /*25 Far door opening stage 1 */
+ grab(131,113,193,156,254, 90,ch_ega,false,false, w); /*26 Far door opening stage 2 */
+ grab(237,113,299,156,254, 90,ch_ega,false,false, w); /*27 Far door opening stage 3 */
+
+ loadtemp("4");
+
+ grab(  0, 11,112,160,  0, 11,ch_ega,false,false,uw); /*28 Left wall */
+ grab(144, 44,197, 76, 30, 44,ch_ega,false,false, w); /*29 Shield on L wall. */
+ grab(149, 90,192,152, 35, 90,ch_ega,false,false, w); /*30 Door in L wall. */
+ grab(463, 28,527, 43,252,100,ch_ega,false,false, w); /*31 Archway x 2 */
+ grab(463, 79,527, 94,252,100,ch_ega,false,false, w); /*32 Archway x 3 */
+
+ close_chunk();
+ return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
new file mode 100644
index 0000000..c976683
--- /dev/null
+++ b/engines/avalanche/chunkxf5.cpp
@@ -0,0 +1,244 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"v:place1.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+
+ setvisualpage(1); setactivepage(1);
+ finder();
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"chunkbi9.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ setvisualpage(0); setactivepage(0);
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk1.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ if (! nat)  putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2+7) / 8)-(x1 / 8))*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=9;
+
+ open_chunk();
+
+ grab( 48, 42, 94, 66,400,105,ch_ega, true,false); /*1 Avvy asleep. */
+ grab(100, 42,146, 66,400,105,ch_ega, true,false); /*2 Avvy asleep again. */
+ grab(152, 42,198, 66,400,105,ch_ega,false,false); /*3 Avvy awake in bed. */
+ grab(106,113,152,137,400,105,ch_bgi,true ,true ); /*4 No Avvy in bed. */
+
+ grab(206, 42,279, 75,150, 91,ch_ega,false,false); /*5 Open trunk. */
+ grab(206, 42,287, 75,150, 91,ch_bgi,true,  true); /*6 Shut trunk. */
+
+ grab( 69, 70,102, 88,431,100,ch_ega,false,false); /*7 Arkata 1. */
+ grab(118, 70,151, 88,431,100,ch_ega,false,false); /*8 Arkata 2. */
+ grab(167, 70,200, 88,431,100,ch_ega,false,false); /*9 Arkata 3. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
new file mode 100644
index 0000000..6652222
--- /dev/null
+++ b/engines/avalanche/chunkxf6.cpp
@@ -0,0 +1,251 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+const integer x_ofs = 165;
+const integer y_ofs = 58;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"v:place19.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"d:temp1.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+/* finder;*/
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk19.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+ x1 -= x_ofs; x2 -= x_ofs;
+ y1 -= y_ofs; y2 -= y_ofs;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+/* readln;*/
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+/* readln;*/
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=13;
+
+ open_chunk();
+
+ grab(165, 68,207, 87,127,105,ch_ega,false,false); /*1 The settle with no lute*/
+ grab(209, 68,255, 96,159, 84,ch_bgi, true, true); /*2 Dogfood looks right. */
+ grab(209, 68,255, 96,159, 84,ch_ega, true,false); /*3 Dogfood- straight ahead. */
+ grab(257, 68,303, 96,159, 84,ch_ega, true,false); /*4 Dogfood- left. */
+ grab(305, 68,351, 96,159, 84,ch_ega, true,false); /*5 DF drinks: stage 1. */
+ grab(353, 68,399, 96,159, 84,ch_ega, true,false); /*6 DF drinks: stage 2. */
+ grab(401, 68,447, 96,159, 84,ch_ega, true,false); /*7 DF drinks: stage 3. */
+ grab(449, 84,465, 94,392, 87,ch_ega, true,false); /*8 Ibythneth smiles. */
+ grab(449, 75,488, 82,341,123,ch_ega, true,false); /*9 No habit under the settle. */
+ grab(508, 68,580,106,485,105,ch_ega, true,false); /*10 M gets your drink. */
+ grab(508, 68,580,106,485,105,ch_bgi, true, true); /*11 M gets up again. */
+ grab(470, 84,486, 91,510,108,ch_ega, true,false); /*12 M looks right. */
+ grab(488, 84,504, 91,510,108,ch_ega, true,false); /*13 M winks. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
new file mode 100644
index 0000000..97bacb5
--- /dev/null
+++ b/engines/avalanche/chunkxf7.cpp
@@ -0,0 +1,236 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place25.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"chunkbi3.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk25.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=3;
+
+ open_chunk();
+
+ grab( 16, 24,101, 45,448,116,ch_ega, true,false); /*2 The fire again. */
+ grab(118, 20,203, 45,448,112,ch_bgi, true, true); /*1 The natural fire. */
+ grab(118, 20,203, 45,448,112,ch_ega, true,false); /*3 Third stage of the fire. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
new file mode 100644
index 0000000..4435ee4
--- /dev/null
+++ b/engines/avalanche/chunkxf8.cpp
@@ -0,0 +1,243 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place23.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp(string x)
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,x); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk23.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp("chunkbi3.avd");
+ setwritemode(xorput);
+
+ num_chunks=6;
+
+ open_chunk();
+
+ grab(226, 21,242, 29,348, 96,ch_bgi, true,true ); /*1 Looking forwards. */
+ grab(226, 21,242, 29,348, 96,ch_ega, true,false); /*2 Looking left. */
+ grab(253, 21,269, 29,348, 96,ch_ega, true,false); /*3 Looking right. */
+ grab(240, 11,256, 19,348, 96,ch_ega, true,false); /*4 Blinking. */
+
+ loadtemp("chunkbi4.avd");
+
+ grab( 48, 83,110,126,324, 96,ch_ega,false,false); /*5 Eyes shut... */
+ grab(112, 83,173,126,325, 96,ch_ega,false,false); /*6 Asleep. */
+
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
new file mode 100644
index 0000000..96241d1
--- /dev/null
+++ b/engines/avalanche/chunkxf9.cpp
@@ -0,0 +1,237 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+;
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place42.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"a:chunkbi3.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk42.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=4;
+
+ open_chunk();
+
+ grab(276, 36,329, 73, 94, 97,ch_bgi, true,true ); /*1 Not tied to the tree.*/
+ grab(276, 36,329, 73, 94, 97,ch_ega,false,false); /*2 Tied to the tree. */
+ grab(182, 80,226, 88,311,132,ch_ega,false,false); /*3 Mushrooms have gone! */
+ grab(253, 75,267, 82,114, 98,ch_ega,false,false); /*4 Avalot blinks. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
new file mode 100644
index 0000000..6493e52
--- /dev/null
+++ b/engines/avalanche/chunkxfa.cpp
@@ -0,0 +1,240 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place7.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+/* finder;*/
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"chunkbi3.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+/* finder;*/
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk7.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=7;
+
+ open_chunk();
+
+ grab(220, 32,269, 62,370,115,ch_ega,false,false); /*1 Jacques awake... */
+ grab(400, 12,450, 48,369,112,ch_ega,false,false); /*2 Jacques gone! */
+ grab(116, 47,176, 98,393, 87,ch_ega,false,false); /*3 Jacques going... */
+ grab(333, 31,393, 82,393, 87,ch_ega,false,false); /*4 The open door. */
+ grab(396, 80,452,135, 39, 91,ch_ega,false,false); /*5 The left door opening. */
+ grab(455, 80,510,135, 39, 91,ch_ega,false,false); /*6 The left door open. */
+ grab(455, 80,510,135, 39, 91,ch_bgi,true ,true ); /*7 The left door shut. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
new file mode 100644
index 0000000..7fda96c
--- /dev/null
+++ b/engines/avalanche/chunkxfb.cpp
@@ -0,0 +1,238 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place71.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"d:chunkbi2.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk71.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=5;
+
+ open_chunk();
+
+ grab( 54, 57,124,116,188, 94,ch_ega,false,false); /*1 Door half-shut. */
+ grab(144, 57,203,116,188, 94,ch_ega,false,false); /*2 Door shut. */
+ grab(513, 92,572,151,188, 94,ch_ega,false,false); /*3 Door with arrow. */
+ grab(610, 94,627,106,367,122,ch_ega,false,false); /*4 Holder with no pen. */
+ grab( 54, 57,124,116,188, 94,ch_bgi,true ,true ); /*5 Door wide open. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
new file mode 100644
index 0000000..aefb15f
--- /dev/null
+++ b/engines/avalanche/chunkxfc.cpp
@@ -0,0 +1,236 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place2.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"d:chunkbi2.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk2.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=3;
+
+ open_chunk();
+
+ grab( 59, 15,166, 55,226, 86,ch_ega,false,false); /*1 Door half-shut. */
+ grab(171, 15,278, 55,226, 86,ch_ega,false,false); /*2 Door half-open. */
+ grab(283, 15,390, 55,226, 86,ch_ega,false,false); /*3 Door open. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
new file mode 100644
index 0000000..e87fbba
--- /dev/null
+++ b/engines/avalanche/chunkxfd.cpp
@@ -0,0 +1,236 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place15.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"d:chunkbi3.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk15.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=3;
+
+ open_chunk();
+
+ grab(535, 11,633, 74, 46, 97,ch_ega,false,false); /*1 Door half-open. */
+ grab(539, 76,637,139, 46, 97,ch_ega,false,false); /*2 Door open. */
+ grab(539, 76,637,139, 46, 97,ch_bgi,true ,true ); /*3 Door shut. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
new file mode 100644
index 0000000..adb7f86
--- /dev/null
+++ b/engines/avalanche/chunkxfe.cpp
@@ -0,0 +1,236 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place5.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"chunkbi2.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk5.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;
+
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  for( yy=y1; yy <= y2; yy ++)
+  {;
+   move(mem[0xa400*yy*80+x1],aa[aapos],length);
+   aapos += length;
+  }
+ }
+ bit=getpixel(0,0);
+
+}
+
+void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
+ boolean mem,boolean nat)
+ /* yes, I *do* know how to spell "really"! */
+{
+ word s;
+ pointer p;
+ chunkblocktype ch;
+;
+/* rectangle(x1,y1,x2,y2); exit;*/
+ this_chunk += 1;
+ offsets[this_chunk]=filepos(f);
+
+
+ s=imagesize(x1,y1,x2,y2);
+ getmem(p,s);
+ getimage(x1,y1,x2,y2,p);
+
+ {;
+  ch.flavour=flav;
+  ch.x=realx; ch.y=realy;
+
+  ch.xl=x2-x1;
+  ch.yl=y2-y1;
+  ch.size=s;
+  ch.memorise=mem;
+  ch.natural=nat;
+ }
+
+ setvisualpage(1);
+ setactivepage(1);
+ input >> NL;
+ putimage(ch.x,ch.y,p,0);
+
+ if (flav==ch_ega) 
+ {;
+  freemem(p,s);
+  s=4*(((x2 / 8)-(x1 / 8))+2)*(y2-y1+1);
+  {;
+   ch.size=s;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl / 8)+2;
+   mgrab(ch.x,ch.y,ch.x+ch.xl,ch.y+ch.yl,s);
+  }
+ } else
+             /* For BGI pictures. */
+  {;
+   ch.x=ch.x / 8;
+   ch.xl=(ch.xl+7) / 8;
+   ch.size=imagesize(ch.x*8,ch.y,(ch.x+ch.xl)*8,ch.y+ch.yl);
+  }
+
+ input >> NL;
+ setvisualpage(0);
+ setactivepage(0);
+
+ blockwrite(f,ch,sizeof(ch));
+
+ switch (flav) {
+  case ch_ega : if (! nat)  blockwrite(f,aa,s); break;
+  case ch_bgi : {;
+            if (! nat)  blockwrite(f,p,s);
+            freemem(p,s);
+           }
+           break;
+ }
+/* rectangle(x1,y1,x2,y2);*/
+}
+
+int main(int argc, const char* argv[])
+{pio_initialize(argc, argv);
+;
+ gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
+ load();
+ loadtemp();
+ setwritemode(xorput);
+
+ num_chunks=3;
+
+ open_chunk();
+
+ grab(252, 57,375,132,501, 85,ch_ega,false,false); /*1 Door half-open. */
+ grab(418, 15,553, 90,504, 85,ch_ega,false,false); /*2 Door open. */
+ grab(252, 57,375,132,504, 85,ch_bgi,true ,true ); /*3 Door shut. */
+ close_chunk();
+return EXIT_SUCCESS;
+}
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
new file mode 100644
index 0000000..9fb2a2e
--- /dev/null
+++ b/engines/avalanche/chunkxff.cpp
@@ -0,0 +1,236 @@
+#include "ptoc.h"
+
+
+#include "graph.h"
+/*#include "Tommys.h"*/
+/*#include "Crt.h"*/
+
+
+enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
+
+struct chunkblocktype {
+                  flavourtype flavour;
+                  integer x,y;
+                  integer xl,yl;
+                  longint size;
+                  boolean natural;
+
+                  boolean memorise; /* Hold it in memory? */
+};
+
+const array<1,44,char> chunkheader = 
+string("Chunk-type AVD file, for an Avvy game.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
+
+const integer arraysize = 12000;
+
+array<1,30,longint> offsets;
+byte num_chunks,this_chunk;
+integer gd,gm;
+untyped_file f;
+array<0,arraysize,byte> aa;
+
+void finder()
+{
+    char r; integer x,y;
+; 
+ setfillstyle(0,0); setcolor(14);
+ x=320; y=100; setwritemode(xorput);
+ do {
+  bar(0,0,200,10);
+  outtextxy(0,0,strf(x)+','+strf(y));
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  do {; } while (!keypressed());
+  line(x-20,y,x+20,y); line(x,y-20,x,y+20);
+  switch (readkey()) {
+   case '\15': return; break;
+   case '8': y -= 10; break;
+   case '4': x -= 10; break;
+   case '6': x += 10; break;
+   case '2': y += 10; break;
+    case '\0': switch (readkey()) {
+         case cup: y -= 1; break;
+         case cdown: y += 1; break;
+         case cleft: x -= 1; break;
+         case cright: x += 1; break;
+        }
+        break;
+  }
+ } while (!false);
+}
+
+void load()
+{
+ byte a1 /*absolute $A400:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"place13.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a1,12080);
+ }
+
+ close(f);
+ bit=getpixel(0,0);
+ setvisualpage(1); setactivepage(1);
+ finder();
+ setvisualpage(0); setactivepage(0);
+}
+
+void loadtemp()
+{
+ byte a0 /*absolute $A000:800*/;
+ byte bit;
+ untyped_file f;
+;
+
+ assign(f,"chunkbi3.avd"); reset(f,1);
+ seek(f,177);
+ for( bit=0; bit <= 3; bit ++)
+ {;
+  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
+  blockread(f,a0,12080);
+ }
+ close(f);
+
+ bit=getpixel(0,0);
+
+ finder();
+}
+
+void open_chunk()
+{;
+ assign(f,"chunk13.avd");
+ rewrite(f,1);
+ blockwrite(f,chunkheader,sizeof(chunkheader));
+ blockwrite(f,num_chunks,1);
+ blockwrite(f,offsets,num_chunks*4);
+
+ this_chunk=0;
+}
+
+void close_chunk()
+{;
+ seek(f,45);
+ blockwrite(f,offsets,num_chunks*4); /* make sure they're right! */
+ close(f);
+}
+
+void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
+{
+    integer yy; word aapos; byte length,bit;
+;
+ if (size>arraysize) 
+ {;
+  restorecrtmode();
+  output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
+  output << " than " << size << '.' << NL;
+  exit(0);
+ }
+
+ aapos=0;
+
+ length=x2-x1;


Commit: cc5b8732bbd525c1e6a50ab73eadbd6b2bf2398c
    https://github.com/scummvm/scummvm/commit/cc5b8732bbd525c1e6a50ab73eadbd6b2bf2398c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T02:57:27-07:00

Commit Message:
AVALANCHE: Remove #include "ptoc.h" lines from the beginning every .cpp files.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/acci.cpp
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enid.cpp
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helper.cpp
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldtrip.cpp
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb3.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip3.cpp
    engines/avalanche/trip42.cpp
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visatest.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index 99198b4..e8debc3 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index 37c9649..faa00bb 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 86fac18..32fde0c 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*  $D-*/
 /*
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index 17853e6..e5af131 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index 03cedfd..9cf259e 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                  /* Trippancy IV - original file */
 #include "graph.h"
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index 41f27af..b5355d7 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                   /* Trippancy IV - original file */
 #include "graph.h"
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index 8aff717..db5c659 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index 1ff2f1f..e05f173 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index a439f87..3780b79 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 13e6cea..6488fb8 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index 3cfff7d..9b366a9 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index 6875687..1985194 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index 915a33d..9702ec2 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 5a4b70c..7d5143b 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index 5cea62d..296c55a 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index 56cfcca..3ac401e 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index a903679..141c69b 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index b891123..3839875 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __cadburys_implementation__
 
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 61357f5..bedab4b 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index a27c261..0488d21 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index 8b38f8a..0eb701b 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
index 6d48054..00cb696 100644
--- a/engines/avalanche/chunker.cpp
+++ b/engines/avalanche/chunker.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index dce3722..4b8d99e 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index 5d77d29..252f132 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index 220d07b..d8b89dd 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index 2dfa34d..4a644d2 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index c976683..a2d02f9 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index 6652222..b319f2b 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index 97bacb5..8d2f7a9 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index 4435ee4..98ada51 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index 96241d1..156827b 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index 6493e52..1703d4f 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 7fda96c..71fd991 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index aefb15f..ec5ff4b 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index e87fbba..9752345 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index adb7f86..bc11f36 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index 9fb2a2e..e2c6a27 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index 077a330..762a44a 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index 163ae51..4736700 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index 84157a8..917d83b 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 34a7109..1f7f234 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 70748b9..38523f6 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index 01a0550..8b942d9 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index 16ec6f5..6674401 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index b2af987..bfed58e 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index 08639ee..ca41b36 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index c607b11..b5efcba 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index 7669c85..d37849b 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index 3c706dc..376c346 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 6c03a47..9319408 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index f66a417..aa0fd75 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index 9fcb685..c06d2b1 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/edna.cpp b/engines/avalanche/edna.cpp
index 74352fe..d700a85 100644
--- a/engines/avalanche/edna.cpp
+++ b/engines/avalanche/edna.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*$M 10000,0,1000*/ /*$V-*/
 
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index 299aec2..34a46ff 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __enhanced_implementation__
 
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
index 89e1327..fb2577a 100644
--- a/engines/avalanche/enid.cpp
+++ b/engines/avalanche/enid.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index 036aa94..4ae92c3 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index a944fbc..d9de210 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __fileunit_implementation__
                /* v:filer.pas - "avvyfiler" - in unit form. */
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index f990f8c..841163f 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index c715aa9..47d5d58 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                   /* Get 'em back! */
 #include "graph.h"
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 4a2ceb2..31154aa 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index b3118dd..5f1b517 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index fc8f47e..386a16c 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index 009a828..3643f43 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$I c:\sleep5\DSMI.INC*/ #include "graph.h"
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index b530e45..0e05d77 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index d155263..804ded4 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index b062015..148f578 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index 9182523..367fd20 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index 50e6a07..0708413 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index 8dba55c..c6a80cb 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 file<char> inf,outf;
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 2ffd271..38d929e 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index bcff8ab..d9508b5 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$M 6000,600,600*/
diff --git a/engines/avalanche/incline.cpp b/engines/avalanche/incline.cpp
index 4103089..8cc8170 100644
--- a/engines/avalanche/incline.cpp
+++ b/engines/avalanche/incline.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index 964aa51..a485c1b 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index 0c7300b..7d95ff9 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index 5d34d69..54cd3e6 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$I c:\sleep5\DSMI.INC*/
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index 71c2d47..acb607c 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
               /* Avalot interrupt handler */
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index 0c07a35..7d22a50 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                        /* Avalot joystick setup routines. To be incorporated
                          into Setup2 whenever I get a chance. */
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index 20f803e..c3ab14a 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __joystick_implementation__
 
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index 4e48cb5..9bc4a0c 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index 5029dab..b95e450 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index e268ac9..777e9bd 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index 03f54d0..b7e9d12 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 282eb5d..3c6b35e 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 09db4d2..0f1c494 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index 447f540..2079547 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                                  /* Phew! */
 #include "graph.h"
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index 574d346..2e927c8 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                        /* regname's name starts at $7D1 (2001). */
 
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index 50e5810..c264dc1 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index 5ed3885..a5f3e25 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/menuxf.cpp b/engines/avalanche/menuxf.cpp
index 1919b11..6a5342e 100644
--- a/engines/avalanche/menuxf.cpp
+++ b/engines/avalanche/menuxf.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index 824fc80..29b3da7 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index 073e546..5f21ecd 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index e5da17a..7dab81b 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index afcac6d..21618d6 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/nimunit.cpp b/engines/avalanche/nimunit.cpp
index 0becd47..4aae41b 100644
--- a/engines/avalanche/nimunit.cpp
+++ b/engines/avalanche/nimunit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index c54a469..c917060 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index 1aed0c5..4286ee2 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index 252d8b3..6dd38b6 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index 5e0fb99..1dddecb 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index 52b1a03..a683bf2 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index 5c1b13f..641b9ba 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __oopmenu_implementation__
 
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index 973bafb..b39b5ba 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index 6e0b9fc..e4a2fc9 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index e4c5b3e..30f0cd3 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index 144d956..cc5386d 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index 54e9e0d..d396c67 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                   /* Get 'em back! */
 #include "graph.h"
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 1bb3066..5a98ba3 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index 80f7937..b9c7fc7 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index aff9f1b..bd5e4d4 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index 3843d80..b727033 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index 3a31a9e..d6877ae 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                /* Demonstration of the Bigo II system. */
 #include "graph.h"
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index a911e1d..d37a113 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index 744d221..9937a46 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index c85dee3..65bd0b5 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 const array<1,36,char> letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index 8007388..b84788a 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sackb3.cpp b/engines/avalanche/sackb3.cpp
index b48379d..4d70bf6 100644
--- a/engines/avalanche/sackb3.cpp
+++ b/engines/avalanche/sackb3.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*$M 16384,0,0*/
 
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index 6f35a21..962495f 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/scr_1.cpp b/engines/avalanche/scr_1.cpp
index 5118cd8..258ca6b 100644
--- a/engines/avalanche/scr_1.cpp
+++ b/engines/avalanche/scr_1.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scr_2.cpp b/engines/avalanche/scr_2.cpp
index 7a88efc..55eba41 100644
--- a/engines/avalanche/scr_2.cpp
+++ b/engines/avalanche/scr_2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scr_3.cpp b/engines/avalanche/scr_3.cpp
index 0c866fc..96c9d9e 100644
--- a/engines/avalanche/scr_3.cpp
+++ b/engines/avalanche/scr_3.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scr_4.cpp b/engines/avalanche/scr_4.cpp
index 605a1dc..183104e 100644
--- a/engines/avalanche/scr_4.cpp
+++ b/engines/avalanche/scr_4.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scr_5.cpp b/engines/avalanche/scr_5.cpp
index e90e55e..ab2359f 100644
--- a/engines/avalanche/scr_5.cpp
+++ b/engines/avalanche/scr_5.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scr_9.cpp b/engines/avalanche/scr_9.cpp
index e136347..6d46fac 100644
--- a/engines/avalanche/scr_9.cpp
+++ b/engines/avalanche/scr_9.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 4a2a0d9..4f02f06 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 00c838a..fccb01b 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/setup.cpp b/engines/avalanche/setup.cpp
index 60f91e3..32fee35 100644
--- a/engines/avalanche/setup.cpp
+++ b/engines/avalanche/setup.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/seu.cpp b/engines/avalanche/seu.cpp
index 9b1c1c2..f1729f2 100644
--- a/engines/avalanche/seu.cpp
+++ b/engines/avalanche/seu.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/seu_avvy.cpp b/engines/avalanche/seu_avvy.cpp
index fb236b9..c9c30f8 100644
--- a/engines/avalanche/seu_avvy.cpp
+++ b/engines/avalanche/seu_avvy.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/sezedit.cpp b/engines/avalanche/sezedit.cpp
index 946e318..5db639c 100644
--- a/engines/avalanche/sezedit.cpp
+++ b/engines/avalanche/sezedit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$M 65520,0,655360*/
diff --git a/engines/avalanche/sezunit.cpp b/engines/avalanche/sezunit.cpp
index 755f247..1f15cf1 100644
--- a/engines/avalanche/sezunit.cpp
+++ b/engines/avalanche/sezunit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __sezunit_implementation__
 
diff --git a/engines/avalanche/sezxfr.cpp b/engines/avalanche/sezxfr.cpp
index bcc4603..37c9cf0 100644
--- a/engines/avalanche/sezxfr.cpp
+++ b/engines/avalanche/sezxfr.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/shell1.cpp b/engines/avalanche/shell1.cpp
index e8dfb59..75296bf 100644
--- a/engines/avalanche/shell1.cpp
+++ b/engines/avalanche/shell1.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$M $800,0,0*/
diff --git a/engines/avalanche/shell2.cpp b/engines/avalanche/shell2.cpp
index 053bca9..b0ef13a 100644
--- a/engines/avalanche/shell2.cpp
+++ b/engines/avalanche/shell2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/slope.cpp b/engines/avalanche/slope.cpp
index a4b2f8a..c566246 100644
--- a/engines/avalanche/slope.cpp
+++ b/engines/avalanche/slope.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/spread.cpp b/engines/avalanche/spread.cpp
index 57361e8..5e52228 100644
--- a/engines/avalanche/spread.cpp
+++ b/engines/avalanche/spread.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/spread2.cpp b/engines/avalanche/spread2.cpp
index 96545c2..267bf8e 100644
--- a/engines/avalanche/spread2.cpp
+++ b/engines/avalanche/spread2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/squish.cpp b/engines/avalanche/squish.cpp
index 4f8cad4..6ff3b90 100644
--- a/engines/avalanche/squish.cpp
+++ b/engines/avalanche/squish.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 
diff --git a/engines/avalanche/ss_blank.cpp b/engines/avalanche/ss_blank.cpp
index 670d12c..f8bc96b 100644
--- a/engines/avalanche/ss_blank.cpp
+++ b/engines/avalanche/ss_blank.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/ss_clock.cpp b/engines/avalanche/ss_clock.cpp
index 1880ee5..e169f37 100644
--- a/engines/avalanche/ss_clock.cpp
+++ b/engines/avalanche/ss_clock.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/stars.cpp b/engines/avalanche/stars.cpp
index 309d9a4..5181241 100644
--- a/engines/avalanche/stars.cpp
+++ b/engines/avalanche/stars.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                /* Demonstration of the Bigo II system. */
 /* $I c:\sleep5\DSMI.INC*/
diff --git a/engines/avalanche/status.cpp b/engines/avalanche/status.cpp
index 1e046fc..761f11c 100644
--- a/engines/avalanche/status.cpp
+++ b/engines/avalanche/status.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/sticks.cpp b/engines/avalanche/sticks.cpp
index 1fc11cd..b47b6fb 100644
--- a/engines/avalanche/sticks.cpp
+++ b/engines/avalanche/sticks.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sunrise.cpp b/engines/avalanche/sunrise.cpp
index 1ed894a..4a0e3ac 100644
--- a/engines/avalanche/sunrise.cpp
+++ b/engines/avalanche/sunrise.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/tempo.cpp b/engines/avalanche/tempo.cpp
index 634f321..b8887ef 100644
--- a/engines/avalanche/tempo.cpp
+++ b/engines/avalanche/tempo.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/test.cpp b/engines/avalanche/test.cpp
index 6d48084..1ac5671 100644
--- a/engines/avalanche/test.cpp
+++ b/engines/avalanche/test.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*$M 2048,0,0*/
diff --git a/engines/avalanche/test2.cpp b/engines/avalanche/test2.cpp
index a4f678d..e5b2347 100644
--- a/engines/avalanche/test2.cpp
+++ b/engines/avalanche/test2.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/testblit.cpp b/engines/avalanche/testblit.cpp
index bc00393..2949f30 100644
--- a/engines/avalanche/testblit.cpp
+++ b/engines/avalanche/testblit.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/testcard.cpp b/engines/avalanche/testcard.cpp
index 064b0a1..e1e8696 100644
--- a/engines/avalanche/testcard.cpp
+++ b/engines/avalanche/testcard.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/testenh.cpp b/engines/avalanche/testenh.cpp
index 8077ca3..34e1d67 100644
--- a/engines/avalanche/testenh.cpp
+++ b/engines/avalanche/testenh.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Enhanced.h"*/
diff --git a/engines/avalanche/timeout.cpp b/engines/avalanche/timeout.cpp
index 26ab449..d5b964d 100644
--- a/engines/avalanche/timeout.cpp
+++ b/engines/avalanche/timeout.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/travel.cpp b/engines/avalanche/travel.cpp
index b759767..6f48f99 100644
--- a/engines/avalanche/travel.cpp
+++ b/engines/avalanche/travel.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/trip.cpp b/engines/avalanche/trip.cpp
index 3dc89ac..58ae537 100644
--- a/engines/avalanche/trip.cpp
+++ b/engines/avalanche/trip.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip3.cpp b/engines/avalanche/trip3.cpp
index c67f6e1..d95eba5 100644
--- a/engines/avalanche/trip3.cpp
+++ b/engines/avalanche/trip3.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 #define __trip3_implementation__
             /* Project Minstrel- Trippancy routines */
diff --git a/engines/avalanche/trip42.cpp b/engines/avalanche/trip42.cpp
index b55b209..923e32e 100644
--- a/engines/avalanche/trip42.cpp
+++ b/engines/avalanche/trip42.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip5.cpp b/engines/avalanche/trip5.cpp
index 3674b1f..721268b 100644
--- a/engines/avalanche/trip5.cpp
+++ b/engines/avalanche/trip5.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip5tst.cpp b/engines/avalanche/trip5tst.cpp
index 4b95ff4..c669cc7 100644
--- a/engines/avalanche/trip5tst.cpp
+++ b/engines/avalanche/trip5tst.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/trip5xf.cpp b/engines/avalanche/trip5xf.cpp
index 0aa5f32..f6225b4 100644
--- a/engines/avalanche/trip5xf.cpp
+++ b/engines/avalanche/trip5xf.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/tripoop.cpp b/engines/avalanche/tripoop.cpp
index 15035c8..b8db1a7 100644
--- a/engines/avalanche/tripoop.cpp
+++ b/engines/avalanche/tripoop.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                  /* Trip Oop (Trippancy 4 Andexor */
 #include "graph.h"
diff --git a/engines/avalanche/ttmenuxf.cpp b/engines/avalanche/ttmenuxf.cpp
index 51903e9..2d870fa 100644
--- a/engines/avalanche/ttmenuxf.cpp
+++ b/engines/avalanche/ttmenuxf.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/unsquish.cpp b/engines/avalanche/unsquish.cpp
index ad8bd58..9183e1b 100644
--- a/engines/avalanche/unsquish.cpp
+++ b/engines/avalanche/unsquish.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                             /*$S-*/
 #include "graph.h"
diff --git a/engines/avalanche/viewdocs.cpp b/engines/avalanche/viewdocs.cpp
index effb1c5..a9e1e6e 100644
--- a/engines/avalanche/viewdocs.cpp
+++ b/engines/avalanche/viewdocs.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
                    /*$S-*/
 /*#include "dos.h"*/
diff --git a/engines/avalanche/visa.cpp b/engines/avalanche/visa.cpp
index f5bd511..664dca9 100644
--- a/engines/avalanche/visa.cpp
+++ b/engines/avalanche/visa.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/visatest.cpp b/engines/avalanche/visatest.cpp
index 52970ad..df856f6 100644
--- a/engines/avalanche/visatest.cpp
+++ b/engines/avalanche/visatest.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/xf_gover.cpp b/engines/avalanche/xf_gover.cpp
index 67bb5ff..683e6ca 100644
--- a/engines/avalanche/xf_gover.cpp
+++ b/engines/avalanche/xf_gover.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/xf_help.cpp b/engines/avalanche/xf_help.cpp
index 1f80639..b0f6844 100644
--- a/engines/avalanche/xf_help.cpp
+++ b/engines/avalanche/xf_help.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/xf_visa.cpp b/engines/avalanche/xf_visa.cpp
index 888df55..5fe7156 100644
--- a/engines/avalanche/xf_visa.cpp
+++ b/engines/avalanche/xf_visa.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/xfbutton.cpp b/engines/avalanche/xfbutton.cpp
index dfbaf5e..980eff8 100644
--- a/engines/avalanche/xfbutton.cpp
+++ b/engines/avalanche/xfbutton.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/xfghost.cpp b/engines/avalanche/xfghost.cpp
index 8809bb5..86996ba 100644
--- a/engines/avalanche/xfghost.cpp
+++ b/engines/avalanche/xfghost.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"
diff --git a/engines/avalanche/zapdraw.cpp b/engines/avalanche/zapdraw.cpp
index 5645fa9..2c4f712 100644
--- a/engines/avalanche/zapdraw.cpp
+++ b/engines/avalanche/zapdraw.cpp
@@ -1,4 +1,4 @@
-#include "ptoc.h"
+
 
 
 #include "graph.h"


Commit: a183d560c1bd2c234b9bc7a8aa32af9b0f0d6182
    https://github.com/scummvm/scummvm/commit/a183d560c1bd2c234b9bc7a8aa32af9b0f0d6182
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T04:42:47-07:00

Commit Message:
AVALANCHE: Add standard header.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/access.h
    engines/avalanche/acci.cpp
    engines/avalanche/acci.h
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/arch.h
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/basher.h
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/cadburys.h
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enhanced.h
    engines/avalanche/enid.cpp
    engines/avalanche/enid.h
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/fileunit.h
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helpbak.h
    engines/avalanche/helper.cpp
    engines/avalanche/helper.h
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/highs.h
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/incline.h
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/joystick.h
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/logger.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/nimunit.h
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldincln.h
    engines/avalanche/oldtrip.cpp
    engines/avalanche/oldtrip.h
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/oopmenu.h
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/pingo.h
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb1.h
    engines/avalanche/sackb3.cpp
    engines/avalanche/sackblas.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/scrolls.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sez.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezunit.h
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sticks.h
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/timeout.h
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip.h
    engines/avalanche/trip3.cpp
    engines/avalanche/trip3.h
    engines/avalanche/trip42.cpp
    engines/avalanche/trip42.h
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5.h
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visa.h
    engines/avalanche/visatest.cpp
    engines/avalanche/waver.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index e8debc3..2ba27a6 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index faa00bb..71aaa7c 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
index 825deeb..a6d412f 100644
--- a/engines/avalanche/access.h
+++ b/engines/avalanche/access.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __access_h__
 #define __access_h__
 
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 32fde0c..f816019 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*  $D-*/
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
index f9d1265..ab220b3 100644
--- a/engines/avalanche/acci.h
+++ b/engines/avalanche/acci.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __acci_h__
 #define __acci_h__
 
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index e5af131..9fac1d0 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index 9cf259e..f1db882 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                  /* Trippancy IV - original file */
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index b5355d7..5c77fc8 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                   /* Trippancy IV - original file */
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index db5c659..6e9ec94 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index e05f173..f59d28d 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
index cb0960f..031f9f3 100644
--- a/engines/avalanche/arch.h
+++ b/engines/avalanche/arch.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __arch_h__
 #define __arch_h__
 
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index 3780b79..d960a39 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 6488fb8..4b7beba 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index 9b366a9..aa1ea69 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index 1985194..f45966b 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index 9702ec2..7bdb1e9 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 7d5143b..74cc61d 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index 296c55a..fb148e2 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index 3ac401e..0e6e164 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
index 1afecae..22ad306 100644
--- a/engines/avalanche/basher.h
+++ b/engines/avalanche/basher.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __basher_h__
 #define __basher_h__
 
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index 141c69b..1d74184 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index 3839875..e37821a 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __cadburys_implementation__
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
index 65e7bd7..917fd4b 100644
--- a/engines/avalanche/cadburys.h
+++ b/engines/avalanche/cadburys.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __cadburys_h__
 #define __cadburys_h__
 
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index bedab4b..e700c62 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
index f6ad52f..409729f 100644
--- a/engines/avalanche/celer.h
+++ b/engines/avalanche/celer.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __celer_h__
 #define __celer_h__
 
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index 0488d21..64f1c9d 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index 0eb701b..6839b85 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
index 00cb696..6903439 100644
--- a/engines/avalanche/chunker.cpp
+++ b/engines/avalanche/chunker.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index 4b8d99e..b2dc01a 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index 252f132..2c25a52 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index d8b89dd..7f3adf4 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index 4a644d2..ad64d6e 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index a2d02f9..9c80b53 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index b319f2b..a2089f4 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index 8d2f7a9..8f02032 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index 98ada51..6dacd0c 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index 156827b..a94f432 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index 1703d4f..fd10258 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 71fd991..4698be2 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index ec5ff4b..30b13e2 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index 9752345..e8e7860 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index bc11f36..f2eb675 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index e2c6a27..1b0b7d7 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index 762a44a..bb289b3 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index 4736700..210c08b 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index 917d83b..27d4122 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 1f7f234..0f19c65 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 38523f6..78083b6 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index 8b942d9..c5f9797 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index 6674401..849846a 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index bfed58e..aa72aef 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index 97dd37e..2c4eec4 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __closing_h__
 #define __closing_h__
 
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index ca41b36..d0b0f23 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index b5efcba..ef79ff8 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index d37849b..2481229 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index 376c346..e002978 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 9319408..320a555 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
index 9d32fb9..349b1a0 100644
--- a/engines/avalanche/dropdown.h
+++ b/engines/avalanche/dropdown.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __dropdown_h__
 #define __dropdown_h__
 
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index aa0fd75..ec9e250 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index c06d2b1..e8eca65 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/edna.cpp b/engines/avalanche/edna.cpp
index d700a85..ebc7e4c 100644
--- a/engines/avalanche/edna.cpp
+++ b/engines/avalanche/edna.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*$M 10000,0,1000*/ /*$V-*/
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index 34a46ff..543d768 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __enhanced_implementation__
diff --git a/engines/avalanche/enhanced.h b/engines/avalanche/enhanced.h
index a028648..d7296ca 100644
--- a/engines/avalanche/enhanced.h
+++ b/engines/avalanche/enhanced.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __enhanced_h__
 #define __enhanced_h__
 
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
index fb2577a..c3dd4a8 100644
--- a/engines/avalanche/enid.cpp
+++ b/engines/avalanche/enid.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
index abf20a2..6ebfc3d 100644
--- a/engines/avalanche/enid.h
+++ b/engines/avalanche/enid.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __enid_h__
 #define __enid_h__
 
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index 4ae92c3..ba76ee2 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index d9de210..6d758b6 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __fileunit_implementation__
diff --git a/engines/avalanche/fileunit.h b/engines/avalanche/fileunit.h
index 08f9262..0f5fb7a 100644
--- a/engines/avalanche/fileunit.h
+++ b/engines/avalanche/fileunit.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __fileunit_h__
 #define __fileunit_h__
 
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index 841163f..bc6ce17 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index 47d5d58..ac371f3 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                   /* Get 'em back! */
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 31154aa..863de0b 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index 5f1b517..a4a6951 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index 386a16c..521cbb2 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index 3643f43..3b64783 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 0e05d77..e7fdc2a 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 8a1fdb5..5d6128b 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __gyro_h__
 #define __gyro_h__
 
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index 804ded4..7768fb6 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index 148f578..aae1cc8 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index 367fd20..087f199 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/helpbak.h b/engines/avalanche/helpbak.h
index 12a7869..ac8898a 100644
--- a/engines/avalanche/helpbak.h
+++ b/engines/avalanche/helpbak.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __helpbak_h__
 #define __helpbak_h__
 
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index 0708413..76680b0 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/helper.h b/engines/avalanche/helper.h
index 9c1c43c..86d1930 100644
--- a/engines/avalanche/helper.h
+++ b/engines/avalanche/helper.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __helper_h__
 #define __helper_h__
 
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index c6a80cb..ed041f5 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 38d929e..552211b 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/highs.h b/engines/avalanche/highs.h
index 3d6eb65..187b31c 100644
--- a/engines/avalanche/highs.h
+++ b/engines/avalanche/highs.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __highs_h__
 #define __highs_h__
 
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index d9508b5..11c54f8 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/incline.cpp b/engines/avalanche/incline.cpp
index 8cc8170..99433f9 100644
--- a/engines/avalanche/incline.cpp
+++ b/engines/avalanche/incline.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/incline.h b/engines/avalanche/incline.h
index 4b252a1..2d858bd 100644
--- a/engines/avalanche/incline.h
+++ b/engines/avalanche/incline.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __incline_h__
 #define __incline_h__
 
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index a485c1b..2dfde79 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index 7d95ff9..b34c59a 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index 54cd3e6..ba230c0 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index acb607c..48eab01 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
               /* Avalot interrupt handler */
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index 7d22a50..e4e73dc 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                        /* Avalot joystick setup routines. To be incorporated
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index c3ab14a..9d329ef 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __joystick_implementation__
diff --git a/engines/avalanche/joystick.h b/engines/avalanche/joystick.h
index 0a3147e..00da7f0 100644
--- a/engines/avalanche/joystick.h
+++ b/engines/avalanche/joystick.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __joystick_h__
 #define __joystick_h__
 
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index 9bc4a0c..70acdd0 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index b95e450..344f99f 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/logger.h b/engines/avalanche/logger.h
index 016bfb6..803227d 100644
--- a/engines/avalanche/logger.h
+++ b/engines/avalanche/logger.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __logger_h__
 #define __logger_h__
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 777e9bd..4bc776a 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
index a602f8c..578557a 100644
--- a/engines/avalanche/lucerna.h
+++ b/engines/avalanche/lucerna.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __lucerna_h__
 #define __lucerna_h__
 
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index b7e9d12..3e9e986 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 3c6b35e..3fe305b 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 0f1c494..8099c32 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index 2079547..b035329 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                                  /* Phew! */
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index 2e927c8..eaedee4 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                        /* regname's name starts at $7D1 (2001). */
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index c264dc1..4455fbc 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index a5f3e25..9e933b3 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/menuxf.cpp b/engines/avalanche/menuxf.cpp
index 6a5342e..f1d8df6 100644
--- a/engines/avalanche/menuxf.cpp
+++ b/engines/avalanche/menuxf.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index 29b3da7..fa8f948 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index 5f21ecd..245bda6 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 7dab81b..4d05e34 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index 21618d6..0577410 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/nimunit.cpp b/engines/avalanche/nimunit.cpp
index 4aae41b..83a5260 100644
--- a/engines/avalanche/nimunit.cpp
+++ b/engines/avalanche/nimunit.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/nimunit.h b/engines/avalanche/nimunit.h
index 5e3386d..4e23124 100644
--- a/engines/avalanche/nimunit.h
+++ b/engines/avalanche/nimunit.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __nimunit_h__
 #define __nimunit_h__
 
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index c917060..cd1f874 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index 4286ee2..4fd83e0 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index 6dd38b6..4a2ee46 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/oldincln.h b/engines/avalanche/oldincln.h
index a0db659..18ed82e 100644
--- a/engines/avalanche/oldincln.h
+++ b/engines/avalanche/oldincln.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __oldincln_h__
 #define __oldincln_h__
 
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index 1dddecb..bee0294 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/oldtrip.h b/engines/avalanche/oldtrip.h
index dc36efd..e737214 100644
--- a/engines/avalanche/oldtrip.h
+++ b/engines/avalanche/oldtrip.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __oldtrip_h__
 #define __oldtrip_h__
 
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index a683bf2..8e89fc7 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index 641b9ba..d2d2415 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __oopmenu_implementation__
diff --git a/engines/avalanche/oopmenu.h b/engines/avalanche/oopmenu.h
index ee928e2..f753f5e 100644
--- a/engines/avalanche/oopmenu.h
+++ b/engines/avalanche/oopmenu.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __oopmenu_h__
 #define __oopmenu_h__
 
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index b39b5ba..8659943 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index e4a2fc9..853a434 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index 30f0cd3..01657e7 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index cc5386d..009ced5 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index d396c67..b2eddc2 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                   /* Get 'em back! */
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 5a98ba3..8bc6149 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index fdb49b7..6979229 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __pingo_h__
 #define __pingo_h__
 
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index b9c7fc7..12f3785 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index bd5e4d4..a5d8f05 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index b727033..477b1ff 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index d6877ae..08de16e 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                /* Demonstration of the Bigo II system. */
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index d37a113..c8e4b15 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index 9937a46..0417c28 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index 65bd0b5..590809c 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index b84788a..3d3d172 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/sackb1.h b/engines/avalanche/sackb1.h
index b671da2..42fd668 100644
--- a/engines/avalanche/sackb1.h
+++ b/engines/avalanche/sackb1.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __sackb1_h__
 #define __sackb1_h__
 
diff --git a/engines/avalanche/sackb3.cpp b/engines/avalanche/sackb3.cpp
index 4d70bf6..1bf586c 100644
--- a/engines/avalanche/sackb3.cpp
+++ b/engines/avalanche/sackb3.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*$M 16384,0,0*/
diff --git a/engines/avalanche/sackblas.cpp b/engines/avalanche/sackblas.cpp
index e69de29..4bf6eba 100644
--- a/engines/avalanche/sackblas.cpp
+++ b/engines/avalanche/sackblas.cpp
@@ -0,0 +1,4 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index 962495f..3827007 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/scr_1.cpp b/engines/avalanche/scr_1.cpp
index 258ca6b..6e9ba57 100644
--- a/engines/avalanche/scr_1.cpp
+++ b/engines/avalanche/scr_1.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scr_2.cpp b/engines/avalanche/scr_2.cpp
index 55eba41..3c54438 100644
--- a/engines/avalanche/scr_2.cpp
+++ b/engines/avalanche/scr_2.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scr_3.cpp b/engines/avalanche/scr_3.cpp
index 96c9d9e..1d959b8 100644
--- a/engines/avalanche/scr_3.cpp
+++ b/engines/avalanche/scr_3.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scr_4.cpp b/engines/avalanche/scr_4.cpp
index 183104e..db9a430 100644
--- a/engines/avalanche/scr_4.cpp
+++ b/engines/avalanche/scr_4.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scr_5.cpp b/engines/avalanche/scr_5.cpp
index ab2359f..dfc3e9c 100644
--- a/engines/avalanche/scr_5.cpp
+++ b/engines/avalanche/scr_5.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scr_9.cpp b/engines/avalanche/scr_9.cpp
index 6d46fac..d398a3e 100644
--- a/engines/avalanche/scr_9.cpp
+++ b/engines/avalanche/scr_9.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 4f02f06..57aac31 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/scrolls.h b/engines/avalanche/scrolls.h
index d71ec5d..f035f3f 100644
--- a/engines/avalanche/scrolls.h
+++ b/engines/avalanche/scrolls.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __scrolls_h__
 #define __scrolls_h__
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index fccb01b..853d2fb 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index a6c59a6..a14e0e0 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __sequence_h__
 #define __sequence_h__
 
diff --git a/engines/avalanche/setup.cpp b/engines/avalanche/setup.cpp
index 32fee35..94e969a 100644
--- a/engines/avalanche/setup.cpp
+++ b/engines/avalanche/setup.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/seu.cpp b/engines/avalanche/seu.cpp
index f1729f2..f896da8 100644
--- a/engines/avalanche/seu.cpp
+++ b/engines/avalanche/seu.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/seu_avvy.cpp b/engines/avalanche/seu_avvy.cpp
index c9c30f8..6e7d31c 100644
--- a/engines/avalanche/seu_avvy.cpp
+++ b/engines/avalanche/seu_avvy.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/sez.cpp b/engines/avalanche/sez.cpp
index e69de29..4bf6eba 100644
--- a/engines/avalanche/sez.cpp
+++ b/engines/avalanche/sez.cpp
@@ -0,0 +1,4 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
diff --git a/engines/avalanche/sezedit.cpp b/engines/avalanche/sezedit.cpp
index 5db639c..3a57ee8 100644
--- a/engines/avalanche/sezedit.cpp
+++ b/engines/avalanche/sezedit.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/sezunit.cpp b/engines/avalanche/sezunit.cpp
index 1f15cf1..4a4ca60 100644
--- a/engines/avalanche/sezunit.cpp
+++ b/engines/avalanche/sezunit.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __sezunit_implementation__
diff --git a/engines/avalanche/sezunit.h b/engines/avalanche/sezunit.h
index 6b0a99e..b5644c9 100644
--- a/engines/avalanche/sezunit.h
+++ b/engines/avalanche/sezunit.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __sezunit_h__
 #define __sezunit_h__
 
diff --git a/engines/avalanche/sezxfr.cpp b/engines/avalanche/sezxfr.cpp
index 37c9cf0..3b48c43 100644
--- a/engines/avalanche/sezxfr.cpp
+++ b/engines/avalanche/sezxfr.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/shell1.cpp b/engines/avalanche/shell1.cpp
index 75296bf..a5e0f13 100644
--- a/engines/avalanche/shell1.cpp
+++ b/engines/avalanche/shell1.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/shell2.cpp b/engines/avalanche/shell2.cpp
index b0ef13a..d9bb2d1 100644
--- a/engines/avalanche/shell2.cpp
+++ b/engines/avalanche/shell2.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/slope.cpp b/engines/avalanche/slope.cpp
index c566246..d9957df 100644
--- a/engines/avalanche/slope.cpp
+++ b/engines/avalanche/slope.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/spread.cpp b/engines/avalanche/spread.cpp
index 5e52228..87a8417 100644
--- a/engines/avalanche/spread.cpp
+++ b/engines/avalanche/spread.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/spread2.cpp b/engines/avalanche/spread2.cpp
index 267bf8e..843550b 100644
--- a/engines/avalanche/spread2.cpp
+++ b/engines/avalanche/spread2.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/squish.cpp b/engines/avalanche/squish.cpp
index 6ff3b90..521c144 100644
--- a/engines/avalanche/squish.cpp
+++ b/engines/avalanche/squish.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/ss_blank.cpp b/engines/avalanche/ss_blank.cpp
index f8bc96b..40641c9 100644
--- a/engines/avalanche/ss_blank.cpp
+++ b/engines/avalanche/ss_blank.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/ss_clock.cpp b/engines/avalanche/ss_clock.cpp
index e169f37..9b3d538 100644
--- a/engines/avalanche/ss_clock.cpp
+++ b/engines/avalanche/ss_clock.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/stars.cpp b/engines/avalanche/stars.cpp
index 5181241..d626b35 100644
--- a/engines/avalanche/stars.cpp
+++ b/engines/avalanche/stars.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                /* Demonstration of the Bigo II system. */
diff --git a/engines/avalanche/status.cpp b/engines/avalanche/status.cpp
index 761f11c..cae0182 100644
--- a/engines/avalanche/status.cpp
+++ b/engines/avalanche/status.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/sticks.cpp b/engines/avalanche/sticks.cpp
index b47b6fb..0297bff 100644
--- a/engines/avalanche/sticks.cpp
+++ b/engines/avalanche/sticks.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/sticks.h b/engines/avalanche/sticks.h
index 5a54cd4..2312d45 100644
--- a/engines/avalanche/sticks.h
+++ b/engines/avalanche/sticks.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __sticks_h__
 #define __sticks_h__
 
diff --git a/engines/avalanche/sunrise.cpp b/engines/avalanche/sunrise.cpp
index 4a0e3ac..035d81b 100644
--- a/engines/avalanche/sunrise.cpp
+++ b/engines/avalanche/sunrise.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/tempo.cpp b/engines/avalanche/tempo.cpp
index b8887ef..d58a818 100644
--- a/engines/avalanche/tempo.cpp
+++ b/engines/avalanche/tempo.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/test.cpp b/engines/avalanche/test.cpp
index 1ac5671..b13d734 100644
--- a/engines/avalanche/test.cpp
+++ b/engines/avalanche/test.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/test2.cpp b/engines/avalanche/test2.cpp
index e5b2347..116344a 100644
--- a/engines/avalanche/test2.cpp
+++ b/engines/avalanche/test2.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/testblit.cpp b/engines/avalanche/testblit.cpp
index 2949f30..11146a8 100644
--- a/engines/avalanche/testblit.cpp
+++ b/engines/avalanche/testblit.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/testcard.cpp b/engines/avalanche/testcard.cpp
index e1e8696..2ca0c0b 100644
--- a/engines/avalanche/testcard.cpp
+++ b/engines/avalanche/testcard.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/testenh.cpp b/engines/avalanche/testenh.cpp
index 34e1d67..0fc936f 100644
--- a/engines/avalanche/testenh.cpp
+++ b/engines/avalanche/testenh.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/timeout.cpp b/engines/avalanche/timeout.cpp
index d5b964d..5a4cc9e 100644
--- a/engines/avalanche/timeout.cpp
+++ b/engines/avalanche/timeout.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/timeout.h b/engines/avalanche/timeout.h
index 5fa9800..7068e7e 100644
--- a/engines/avalanche/timeout.h
+++ b/engines/avalanche/timeout.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __timeout_h__
 #define __timeout_h__
 
diff --git a/engines/avalanche/travel.cpp b/engines/avalanche/travel.cpp
index 6f48f99..e27e48c 100644
--- a/engines/avalanche/travel.cpp
+++ b/engines/avalanche/travel.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/trip.cpp b/engines/avalanche/trip.cpp
index 58ae537..add6fa1 100644
--- a/engines/avalanche/trip.cpp
+++ b/engines/avalanche/trip.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/trip.h b/engines/avalanche/trip.h
index 520e323..c018264 100644
--- a/engines/avalanche/trip.h
+++ b/engines/avalanche/trip.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __trip_h__
 #define __trip_h__
 
diff --git a/engines/avalanche/trip3.cpp b/engines/avalanche/trip3.cpp
index d95eba5..38227b0 100644
--- a/engines/avalanche/trip3.cpp
+++ b/engines/avalanche/trip3.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 #define __trip3_implementation__
diff --git a/engines/avalanche/trip3.h b/engines/avalanche/trip3.h
index ccad153..32144e1 100644
--- a/engines/avalanche/trip3.h
+++ b/engines/avalanche/trip3.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __trip3_h__
 #define __trip3_h__
 
diff --git a/engines/avalanche/trip42.cpp b/engines/avalanche/trip42.cpp
index 923e32e..5ae624c 100644
--- a/engines/avalanche/trip42.cpp
+++ b/engines/avalanche/trip42.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/trip42.h b/engines/avalanche/trip42.h
index b5e4f13..bed52bb 100644
--- a/engines/avalanche/trip42.h
+++ b/engines/avalanche/trip42.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __trip42_h__
 #define __trip42_h__
 
diff --git a/engines/avalanche/trip5.cpp b/engines/avalanche/trip5.cpp
index 721268b..6dd4113 100644
--- a/engines/avalanche/trip5.cpp
+++ b/engines/avalanche/trip5.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/trip5.h b/engines/avalanche/trip5.h
index 9e7b3a3..a06b6e9 100644
--- a/engines/avalanche/trip5.h
+++ b/engines/avalanche/trip5.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __trip5_h__
 #define __trip5_h__
 
diff --git a/engines/avalanche/trip5tst.cpp b/engines/avalanche/trip5tst.cpp
index c669cc7..c4ab58e 100644
--- a/engines/avalanche/trip5tst.cpp
+++ b/engines/avalanche/trip5tst.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/trip5xf.cpp b/engines/avalanche/trip5xf.cpp
index f6225b4..582c8af 100644
--- a/engines/avalanche/trip5xf.cpp
+++ b/engines/avalanche/trip5xf.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/tripoop.cpp b/engines/avalanche/tripoop.cpp
index b8db1a7..322dba8 100644
--- a/engines/avalanche/tripoop.cpp
+++ b/engines/avalanche/tripoop.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                  /* Trip Oop (Trippancy 4 Andexor */
diff --git a/engines/avalanche/ttmenuxf.cpp b/engines/avalanche/ttmenuxf.cpp
index 2d870fa..b92db51 100644
--- a/engines/avalanche/ttmenuxf.cpp
+++ b/engines/avalanche/ttmenuxf.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/unsquish.cpp b/engines/avalanche/unsquish.cpp
index 9183e1b..a5f0840 100644
--- a/engines/avalanche/unsquish.cpp
+++ b/engines/avalanche/unsquish.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                             /*$S-*/
diff --git a/engines/avalanche/viewdocs.cpp b/engines/avalanche/viewdocs.cpp
index a9e1e6e..09cd333 100644
--- a/engines/avalanche/viewdocs.cpp
+++ b/engines/avalanche/viewdocs.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
                    /*$S-*/
diff --git a/engines/avalanche/visa.cpp b/engines/avalanche/visa.cpp
index 664dca9..aec063f 100644
--- a/engines/avalanche/visa.cpp
+++ b/engines/avalanche/visa.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 /*
diff --git a/engines/avalanche/visa.h b/engines/avalanche/visa.h
index 8b79d6b..1cfb77f 100644
--- a/engines/avalanche/visa.h
+++ b/engines/avalanche/visa.h
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 #ifndef __visa_h__
 #define __visa_h__
 
diff --git a/engines/avalanche/visatest.cpp b/engines/avalanche/visatest.cpp
index df856f6..56c9595 100644
--- a/engines/avalanche/visatest.cpp
+++ b/engines/avalanche/visatest.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/waver.cpp b/engines/avalanche/waver.cpp
index e69de29..4bf6eba 100644
--- a/engines/avalanche/waver.cpp
+++ b/engines/avalanche/waver.cpp
@@ -0,0 +1,4 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
diff --git a/engines/avalanche/xf_gover.cpp b/engines/avalanche/xf_gover.cpp
index 683e6ca..402f3ab 100644
--- a/engines/avalanche/xf_gover.cpp
+++ b/engines/avalanche/xf_gover.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/xf_help.cpp b/engines/avalanche/xf_help.cpp
index b0f6844..162fcec 100644
--- a/engines/avalanche/xf_help.cpp
+++ b/engines/avalanche/xf_help.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/xf_visa.cpp b/engines/avalanche/xf_visa.cpp
index 5fe7156..2eb565a 100644
--- a/engines/avalanche/xf_visa.cpp
+++ b/engines/avalanche/xf_visa.cpp
@@ -1,3 +1,8 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 
 
 
diff --git a/engines/avalanche/xfbutton.cpp b/engines/avalanche/xfbutton.cpp
index 980eff8..1881e97 100644
--- a/engines/avalanche/xfbutton.cpp
+++ b/engines/avalanche/xfbutton.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/xfghost.cpp b/engines/avalanche/xfghost.cpp
index 86996ba..e03399a 100644
--- a/engines/avalanche/xfghost.cpp
+++ b/engines/avalanche/xfghost.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 
diff --git a/engines/avalanche/zapdraw.cpp b/engines/avalanche/zapdraw.cpp
index 2c4f712..5ab55d1 100644
--- a/engines/avalanche/zapdraw.cpp
+++ b/engines/avalanche/zapdraw.cpp
@@ -1,3 +1,7 @@
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 
 


Commit: d33da0a429b2c62b9ac9b72003beee4ee097c302
    https://github.com/scummvm/scummvm/commit/d33da0a429b2c62b9ac9b72003beee4ee097c302
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T04:49:08-07:00

Commit Message:
Revert "AVALANCHE: Add standard header."

This reverts commit b87de38cc8dc270c272b681b8581decc602ae984.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/access.h
    engines/avalanche/acci.cpp
    engines/avalanche/acci.h
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/arch.h
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/basher.h
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/cadburys.h
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enhanced.h
    engines/avalanche/enid.cpp
    engines/avalanche/enid.h
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/fileunit.h
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helpbak.h
    engines/avalanche/helper.cpp
    engines/avalanche/helper.h
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/highs.h
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/incline.h
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/joystick.h
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/logger.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/nimunit.h
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldincln.h
    engines/avalanche/oldtrip.cpp
    engines/avalanche/oldtrip.h
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/oopmenu.h
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/pingo.h
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb1.h
    engines/avalanche/sackb3.cpp
    engines/avalanche/sackblas.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/scrolls.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sez.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezunit.h
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sticks.h
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/timeout.h
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip.h
    engines/avalanche/trip3.cpp
    engines/avalanche/trip3.h
    engines/avalanche/trip42.cpp
    engines/avalanche/trip42.h
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5.h
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visa.h
    engines/avalanche/visatest.cpp
    engines/avalanche/waver.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index 2ba27a6..e8debc3 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index 71aaa7c..faa00bb 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
index a6d412f..825deeb 100644
--- a/engines/avalanche/access.h
+++ b/engines/avalanche/access.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __access_h__
 #define __access_h__
 
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index f816019..32fde0c 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*  $D-*/
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
index ab220b3..f9d1265 100644
--- a/engines/avalanche/acci.h
+++ b/engines/avalanche/acci.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __acci_h__
 #define __acci_h__
 
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index 9fac1d0..e5af131 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index f1db882..9cf259e 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                  /* Trippancy IV - original file */
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index 5c77fc8..b5355d7 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                   /* Trippancy IV - original file */
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index 6e9ec94..db5c659 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index f59d28d..e05f173 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
index 031f9f3..cb0960f 100644
--- a/engines/avalanche/arch.h
+++ b/engines/avalanche/arch.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __arch_h__
 #define __arch_h__
 
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index d960a39..3780b79 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 4b7beba..6488fb8 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index aa1ea69..9b366a9 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index f45966b..1985194 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index 7bdb1e9..9702ec2 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 74cc61d..7d5143b 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index fb148e2..296c55a 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index 0e6e164..3ac401e 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
index 22ad306..1afecae 100644
--- a/engines/avalanche/basher.h
+++ b/engines/avalanche/basher.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __basher_h__
 #define __basher_h__
 
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index 1d74184..141c69b 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index e37821a..3839875 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __cadburys_implementation__
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
index 917fd4b..65e7bd7 100644
--- a/engines/avalanche/cadburys.h
+++ b/engines/avalanche/cadburys.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __cadburys_h__
 #define __cadburys_h__
 
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index e700c62..bedab4b 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
index 409729f..f6ad52f 100644
--- a/engines/avalanche/celer.h
+++ b/engines/avalanche/celer.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __celer_h__
 #define __celer_h__
 
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index 64f1c9d..0488d21 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index 6839b85..0eb701b 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
index 6903439..00cb696 100644
--- a/engines/avalanche/chunker.cpp
+++ b/engines/avalanche/chunker.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index b2dc01a..4b8d99e 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index 2c25a52..252f132 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index 7f3adf4..d8b89dd 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index ad64d6e..4a644d2 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index 9c80b53..a2d02f9 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index a2089f4..b319f2b 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index 8f02032..8d2f7a9 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index 6dacd0c..98ada51 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index a94f432..156827b 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index fd10258..1703d4f 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 4698be2..71fd991 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index 30b13e2..ec5ff4b 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index e8e7860..9752345 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index f2eb675..bc11f36 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index 1b0b7d7..e2c6a27 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index bb289b3..762a44a 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index 210c08b..4736700 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index 27d4122..917d83b 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 0f19c65..1f7f234 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 78083b6..38523f6 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index c5f9797..8b942d9 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index 849846a..6674401 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index aa72aef..bfed58e 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index 2c4eec4..97dd37e 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __closing_h__
 #define __closing_h__
 
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index d0b0f23..ca41b36 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index ef79ff8..b5efcba 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index 2481229..d37849b 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index e002978..376c346 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 320a555..9319408 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
index 349b1a0..9d32fb9 100644
--- a/engines/avalanche/dropdown.h
+++ b/engines/avalanche/dropdown.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __dropdown_h__
 #define __dropdown_h__
 
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index ec9e250..aa0fd75 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index e8eca65..c06d2b1 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/edna.cpp b/engines/avalanche/edna.cpp
index ebc7e4c..d700a85 100644
--- a/engines/avalanche/edna.cpp
+++ b/engines/avalanche/edna.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*$M 10000,0,1000*/ /*$V-*/
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index 543d768..34a46ff 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __enhanced_implementation__
diff --git a/engines/avalanche/enhanced.h b/engines/avalanche/enhanced.h
index d7296ca..a028648 100644
--- a/engines/avalanche/enhanced.h
+++ b/engines/avalanche/enhanced.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __enhanced_h__
 #define __enhanced_h__
 
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
index c3dd4a8..fb2577a 100644
--- a/engines/avalanche/enid.cpp
+++ b/engines/avalanche/enid.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
index 6ebfc3d..abf20a2 100644
--- a/engines/avalanche/enid.h
+++ b/engines/avalanche/enid.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __enid_h__
 #define __enid_h__
 
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index ba76ee2..4ae92c3 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index 6d758b6..d9de210 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __fileunit_implementation__
diff --git a/engines/avalanche/fileunit.h b/engines/avalanche/fileunit.h
index 0f5fb7a..08f9262 100644
--- a/engines/avalanche/fileunit.h
+++ b/engines/avalanche/fileunit.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __fileunit_h__
 #define __fileunit_h__
 
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index bc6ce17..841163f 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index ac371f3..47d5d58 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                   /* Get 'em back! */
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 863de0b..31154aa 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index a4a6951..5f1b517 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index 521cbb2..386a16c 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index 3b64783..3643f43 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index e7fdc2a..0e05d77 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 5d6128b..8a1fdb5 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __gyro_h__
 #define __gyro_h__
 
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index 7768fb6..804ded4 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index aae1cc8..148f578 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index 087f199..367fd20 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/helpbak.h b/engines/avalanche/helpbak.h
index ac8898a..12a7869 100644
--- a/engines/avalanche/helpbak.h
+++ b/engines/avalanche/helpbak.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __helpbak_h__
 #define __helpbak_h__
 
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index 76680b0..0708413 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/helper.h b/engines/avalanche/helper.h
index 86d1930..9c1c43c 100644
--- a/engines/avalanche/helper.h
+++ b/engines/avalanche/helper.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __helper_h__
 #define __helper_h__
 
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index ed041f5..c6a80cb 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 552211b..38d929e 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/highs.h b/engines/avalanche/highs.h
index 187b31c..3d6eb65 100644
--- a/engines/avalanche/highs.h
+++ b/engines/avalanche/highs.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __highs_h__
 #define __highs_h__
 
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index 11c54f8..d9508b5 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/incline.cpp b/engines/avalanche/incline.cpp
index 99433f9..8cc8170 100644
--- a/engines/avalanche/incline.cpp
+++ b/engines/avalanche/incline.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/incline.h b/engines/avalanche/incline.h
index 2d858bd..4b252a1 100644
--- a/engines/avalanche/incline.h
+++ b/engines/avalanche/incline.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __incline_h__
 #define __incline_h__
 
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index 2dfde79..a485c1b 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index b34c59a..7d95ff9 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index ba230c0..54cd3e6 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index 48eab01..acb607c 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
               /* Avalot interrupt handler */
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index e4e73dc..7d22a50 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                        /* Avalot joystick setup routines. To be incorporated
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index 9d329ef..c3ab14a 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __joystick_implementation__
diff --git a/engines/avalanche/joystick.h b/engines/avalanche/joystick.h
index 00da7f0..0a3147e 100644
--- a/engines/avalanche/joystick.h
+++ b/engines/avalanche/joystick.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __joystick_h__
 #define __joystick_h__
 
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index 70acdd0..9bc4a0c 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index 344f99f..b95e450 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/logger.h b/engines/avalanche/logger.h
index 803227d..016bfb6 100644
--- a/engines/avalanche/logger.h
+++ b/engines/avalanche/logger.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __logger_h__
 #define __logger_h__
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 4bc776a..777e9bd 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
index 578557a..a602f8c 100644
--- a/engines/avalanche/lucerna.h
+++ b/engines/avalanche/lucerna.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __lucerna_h__
 #define __lucerna_h__
 
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index 3e9e986..b7e9d12 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 3fe305b..3c6b35e 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 8099c32..0f1c494 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index b035329..2079547 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                                  /* Phew! */
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index eaedee4..2e927c8 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                        /* regname's name starts at $7D1 (2001). */
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index 4455fbc..c264dc1 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index 9e933b3..a5f3e25 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/menuxf.cpp b/engines/avalanche/menuxf.cpp
index f1d8df6..6a5342e 100644
--- a/engines/avalanche/menuxf.cpp
+++ b/engines/avalanche/menuxf.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index fa8f948..29b3da7 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index 245bda6..5f21ecd 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 4d05e34..7dab81b 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index 0577410..21618d6 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/nimunit.cpp b/engines/avalanche/nimunit.cpp
index 83a5260..4aae41b 100644
--- a/engines/avalanche/nimunit.cpp
+++ b/engines/avalanche/nimunit.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/nimunit.h b/engines/avalanche/nimunit.h
index 4e23124..5e3386d 100644
--- a/engines/avalanche/nimunit.h
+++ b/engines/avalanche/nimunit.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __nimunit_h__
 #define __nimunit_h__
 
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index cd1f874..c917060 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index 4fd83e0..4286ee2 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index 4a2ee46..6dd38b6 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/oldincln.h b/engines/avalanche/oldincln.h
index 18ed82e..a0db659 100644
--- a/engines/avalanche/oldincln.h
+++ b/engines/avalanche/oldincln.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __oldincln_h__
 #define __oldincln_h__
 
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index bee0294..1dddecb 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/oldtrip.h b/engines/avalanche/oldtrip.h
index e737214..dc36efd 100644
--- a/engines/avalanche/oldtrip.h
+++ b/engines/avalanche/oldtrip.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __oldtrip_h__
 #define __oldtrip_h__
 
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index 8e89fc7..a683bf2 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index d2d2415..641b9ba 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __oopmenu_implementation__
diff --git a/engines/avalanche/oopmenu.h b/engines/avalanche/oopmenu.h
index f753f5e..ee928e2 100644
--- a/engines/avalanche/oopmenu.h
+++ b/engines/avalanche/oopmenu.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __oopmenu_h__
 #define __oopmenu_h__
 
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index 8659943..b39b5ba 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index 853a434..e4a2fc9 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index 01657e7..30f0cd3 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index 009ced5..cc5386d 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index b2eddc2..d396c67 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                   /* Get 'em back! */
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 8bc6149..5a98ba3 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index 6979229..fdb49b7 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __pingo_h__
 #define __pingo_h__
 
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index 12f3785..b9c7fc7 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index a5d8f05..bd5e4d4 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index 477b1ff..b727033 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index 08de16e..d6877ae 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                /* Demonstration of the Bigo II system. */
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index c8e4b15..d37a113 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index 0417c28..9937a46 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index 590809c..65bd0b5 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index 3d3d172..b84788a 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/sackb1.h b/engines/avalanche/sackb1.h
index 42fd668..b671da2 100644
--- a/engines/avalanche/sackb1.h
+++ b/engines/avalanche/sackb1.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __sackb1_h__
 #define __sackb1_h__
 
diff --git a/engines/avalanche/sackb3.cpp b/engines/avalanche/sackb3.cpp
index 1bf586c..4d70bf6 100644
--- a/engines/avalanche/sackb3.cpp
+++ b/engines/avalanche/sackb3.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*$M 16384,0,0*/
diff --git a/engines/avalanche/sackblas.cpp b/engines/avalanche/sackblas.cpp
index 4bf6eba..e69de29 100644
--- a/engines/avalanche/sackblas.cpp
+++ b/engines/avalanche/sackblas.cpp
@@ -1,4 +0,0 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index 3827007..962495f 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/scr_1.cpp b/engines/avalanche/scr_1.cpp
index 6e9ba57..258ca6b 100644
--- a/engines/avalanche/scr_1.cpp
+++ b/engines/avalanche/scr_1.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scr_2.cpp b/engines/avalanche/scr_2.cpp
index 3c54438..55eba41 100644
--- a/engines/avalanche/scr_2.cpp
+++ b/engines/avalanche/scr_2.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scr_3.cpp b/engines/avalanche/scr_3.cpp
index 1d959b8..96c9d9e 100644
--- a/engines/avalanche/scr_3.cpp
+++ b/engines/avalanche/scr_3.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scr_4.cpp b/engines/avalanche/scr_4.cpp
index db9a430..183104e 100644
--- a/engines/avalanche/scr_4.cpp
+++ b/engines/avalanche/scr_4.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scr_5.cpp b/engines/avalanche/scr_5.cpp
index dfc3e9c..ab2359f 100644
--- a/engines/avalanche/scr_5.cpp
+++ b/engines/avalanche/scr_5.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scr_9.cpp b/engines/avalanche/scr_9.cpp
index d398a3e..6d46fac 100644
--- a/engines/avalanche/scr_9.cpp
+++ b/engines/avalanche/scr_9.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 57aac31..4f02f06 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/scrolls.h b/engines/avalanche/scrolls.h
index f035f3f..d71ec5d 100644
--- a/engines/avalanche/scrolls.h
+++ b/engines/avalanche/scrolls.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __scrolls_h__
 #define __scrolls_h__
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 853d2fb..fccb01b 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index a14e0e0..a6c59a6 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __sequence_h__
 #define __sequence_h__
 
diff --git a/engines/avalanche/setup.cpp b/engines/avalanche/setup.cpp
index 94e969a..32fee35 100644
--- a/engines/avalanche/setup.cpp
+++ b/engines/avalanche/setup.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/seu.cpp b/engines/avalanche/seu.cpp
index f896da8..f1729f2 100644
--- a/engines/avalanche/seu.cpp
+++ b/engines/avalanche/seu.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/seu_avvy.cpp b/engines/avalanche/seu_avvy.cpp
index 6e7d31c..c9c30f8 100644
--- a/engines/avalanche/seu_avvy.cpp
+++ b/engines/avalanche/seu_avvy.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/sez.cpp b/engines/avalanche/sez.cpp
index 4bf6eba..e69de29 100644
--- a/engines/avalanche/sez.cpp
+++ b/engines/avalanche/sez.cpp
@@ -1,4 +0,0 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
diff --git a/engines/avalanche/sezedit.cpp b/engines/avalanche/sezedit.cpp
index 3a57ee8..5db639c 100644
--- a/engines/avalanche/sezedit.cpp
+++ b/engines/avalanche/sezedit.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/sezunit.cpp b/engines/avalanche/sezunit.cpp
index 4a4ca60..1f15cf1 100644
--- a/engines/avalanche/sezunit.cpp
+++ b/engines/avalanche/sezunit.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __sezunit_implementation__
diff --git a/engines/avalanche/sezunit.h b/engines/avalanche/sezunit.h
index b5644c9..6b0a99e 100644
--- a/engines/avalanche/sezunit.h
+++ b/engines/avalanche/sezunit.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __sezunit_h__
 #define __sezunit_h__
 
diff --git a/engines/avalanche/sezxfr.cpp b/engines/avalanche/sezxfr.cpp
index 3b48c43..37c9cf0 100644
--- a/engines/avalanche/sezxfr.cpp
+++ b/engines/avalanche/sezxfr.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/shell1.cpp b/engines/avalanche/shell1.cpp
index a5e0f13..75296bf 100644
--- a/engines/avalanche/shell1.cpp
+++ b/engines/avalanche/shell1.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/shell2.cpp b/engines/avalanche/shell2.cpp
index d9bb2d1..b0ef13a 100644
--- a/engines/avalanche/shell2.cpp
+++ b/engines/avalanche/shell2.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/slope.cpp b/engines/avalanche/slope.cpp
index d9957df..c566246 100644
--- a/engines/avalanche/slope.cpp
+++ b/engines/avalanche/slope.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/spread.cpp b/engines/avalanche/spread.cpp
index 87a8417..5e52228 100644
--- a/engines/avalanche/spread.cpp
+++ b/engines/avalanche/spread.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/spread2.cpp b/engines/avalanche/spread2.cpp
index 843550b..267bf8e 100644
--- a/engines/avalanche/spread2.cpp
+++ b/engines/avalanche/spread2.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/squish.cpp b/engines/avalanche/squish.cpp
index 521c144..6ff3b90 100644
--- a/engines/avalanche/squish.cpp
+++ b/engines/avalanche/squish.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/ss_blank.cpp b/engines/avalanche/ss_blank.cpp
index 40641c9..f8bc96b 100644
--- a/engines/avalanche/ss_blank.cpp
+++ b/engines/avalanche/ss_blank.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/ss_clock.cpp b/engines/avalanche/ss_clock.cpp
index 9b3d538..e169f37 100644
--- a/engines/avalanche/ss_clock.cpp
+++ b/engines/avalanche/ss_clock.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/stars.cpp b/engines/avalanche/stars.cpp
index d626b35..5181241 100644
--- a/engines/avalanche/stars.cpp
+++ b/engines/avalanche/stars.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                /* Demonstration of the Bigo II system. */
diff --git a/engines/avalanche/status.cpp b/engines/avalanche/status.cpp
index cae0182..761f11c 100644
--- a/engines/avalanche/status.cpp
+++ b/engines/avalanche/status.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/sticks.cpp b/engines/avalanche/sticks.cpp
index 0297bff..b47b6fb 100644
--- a/engines/avalanche/sticks.cpp
+++ b/engines/avalanche/sticks.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/sticks.h b/engines/avalanche/sticks.h
index 2312d45..5a54cd4 100644
--- a/engines/avalanche/sticks.h
+++ b/engines/avalanche/sticks.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __sticks_h__
 #define __sticks_h__
 
diff --git a/engines/avalanche/sunrise.cpp b/engines/avalanche/sunrise.cpp
index 035d81b..4a0e3ac 100644
--- a/engines/avalanche/sunrise.cpp
+++ b/engines/avalanche/sunrise.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/tempo.cpp b/engines/avalanche/tempo.cpp
index d58a818..b8887ef 100644
--- a/engines/avalanche/tempo.cpp
+++ b/engines/avalanche/tempo.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/test.cpp b/engines/avalanche/test.cpp
index b13d734..1ac5671 100644
--- a/engines/avalanche/test.cpp
+++ b/engines/avalanche/test.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/test2.cpp b/engines/avalanche/test2.cpp
index 116344a..e5b2347 100644
--- a/engines/avalanche/test2.cpp
+++ b/engines/avalanche/test2.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/testblit.cpp b/engines/avalanche/testblit.cpp
index 11146a8..2949f30 100644
--- a/engines/avalanche/testblit.cpp
+++ b/engines/avalanche/testblit.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/testcard.cpp b/engines/avalanche/testcard.cpp
index 2ca0c0b..e1e8696 100644
--- a/engines/avalanche/testcard.cpp
+++ b/engines/avalanche/testcard.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/testenh.cpp b/engines/avalanche/testenh.cpp
index 0fc936f..34e1d67 100644
--- a/engines/avalanche/testenh.cpp
+++ b/engines/avalanche/testenh.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/timeout.cpp b/engines/avalanche/timeout.cpp
index 5a4cc9e..d5b964d 100644
--- a/engines/avalanche/timeout.cpp
+++ b/engines/avalanche/timeout.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/timeout.h b/engines/avalanche/timeout.h
index 7068e7e..5fa9800 100644
--- a/engines/avalanche/timeout.h
+++ b/engines/avalanche/timeout.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __timeout_h__
 #define __timeout_h__
 
diff --git a/engines/avalanche/travel.cpp b/engines/avalanche/travel.cpp
index e27e48c..6f48f99 100644
--- a/engines/avalanche/travel.cpp
+++ b/engines/avalanche/travel.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/trip.cpp b/engines/avalanche/trip.cpp
index add6fa1..58ae537 100644
--- a/engines/avalanche/trip.cpp
+++ b/engines/avalanche/trip.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/trip.h b/engines/avalanche/trip.h
index c018264..520e323 100644
--- a/engines/avalanche/trip.h
+++ b/engines/avalanche/trip.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __trip_h__
 #define __trip_h__
 
diff --git a/engines/avalanche/trip3.cpp b/engines/avalanche/trip3.cpp
index 38227b0..d95eba5 100644
--- a/engines/avalanche/trip3.cpp
+++ b/engines/avalanche/trip3.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 #define __trip3_implementation__
diff --git a/engines/avalanche/trip3.h b/engines/avalanche/trip3.h
index 32144e1..ccad153 100644
--- a/engines/avalanche/trip3.h
+++ b/engines/avalanche/trip3.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __trip3_h__
 #define __trip3_h__
 
diff --git a/engines/avalanche/trip42.cpp b/engines/avalanche/trip42.cpp
index 5ae624c..923e32e 100644
--- a/engines/avalanche/trip42.cpp
+++ b/engines/avalanche/trip42.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/trip42.h b/engines/avalanche/trip42.h
index bed52bb..b5e4f13 100644
--- a/engines/avalanche/trip42.h
+++ b/engines/avalanche/trip42.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __trip42_h__
 #define __trip42_h__
 
diff --git a/engines/avalanche/trip5.cpp b/engines/avalanche/trip5.cpp
index 6dd4113..721268b 100644
--- a/engines/avalanche/trip5.cpp
+++ b/engines/avalanche/trip5.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/trip5.h b/engines/avalanche/trip5.h
index a06b6e9..9e7b3a3 100644
--- a/engines/avalanche/trip5.h
+++ b/engines/avalanche/trip5.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __trip5_h__
 #define __trip5_h__
 
diff --git a/engines/avalanche/trip5tst.cpp b/engines/avalanche/trip5tst.cpp
index c4ab58e..c669cc7 100644
--- a/engines/avalanche/trip5tst.cpp
+++ b/engines/avalanche/trip5tst.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/trip5xf.cpp b/engines/avalanche/trip5xf.cpp
index 582c8af..f6225b4 100644
--- a/engines/avalanche/trip5xf.cpp
+++ b/engines/avalanche/trip5xf.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/tripoop.cpp b/engines/avalanche/tripoop.cpp
index 322dba8..b8db1a7 100644
--- a/engines/avalanche/tripoop.cpp
+++ b/engines/avalanche/tripoop.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                  /* Trip Oop (Trippancy 4 Andexor */
diff --git a/engines/avalanche/ttmenuxf.cpp b/engines/avalanche/ttmenuxf.cpp
index b92db51..2d870fa 100644
--- a/engines/avalanche/ttmenuxf.cpp
+++ b/engines/avalanche/ttmenuxf.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/unsquish.cpp b/engines/avalanche/unsquish.cpp
index a5f0840..9183e1b 100644
--- a/engines/avalanche/unsquish.cpp
+++ b/engines/avalanche/unsquish.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                             /*$S-*/
diff --git a/engines/avalanche/viewdocs.cpp b/engines/avalanche/viewdocs.cpp
index 09cd333..a9e1e6e 100644
--- a/engines/avalanche/viewdocs.cpp
+++ b/engines/avalanche/viewdocs.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
                    /*$S-*/
diff --git a/engines/avalanche/visa.cpp b/engines/avalanche/visa.cpp
index aec063f..664dca9 100644
--- a/engines/avalanche/visa.cpp
+++ b/engines/avalanche/visa.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 /*
diff --git a/engines/avalanche/visa.h b/engines/avalanche/visa.h
index 1cfb77f..8b79d6b 100644
--- a/engines/avalanche/visa.h
+++ b/engines/avalanche/visa.h
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 #ifndef __visa_h__
 #define __visa_h__
 
diff --git a/engines/avalanche/visatest.cpp b/engines/avalanche/visatest.cpp
index 56c9595..df856f6 100644
--- a/engines/avalanche/visatest.cpp
+++ b/engines/avalanche/visatest.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/waver.cpp b/engines/avalanche/waver.cpp
index 4bf6eba..e69de29 100644
--- a/engines/avalanche/waver.cpp
+++ b/engines/avalanche/waver.cpp
@@ -1,4 +0,0 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
diff --git a/engines/avalanche/xf_gover.cpp b/engines/avalanche/xf_gover.cpp
index 402f3ab..683e6ca 100644
--- a/engines/avalanche/xf_gover.cpp
+++ b/engines/avalanche/xf_gover.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/xf_help.cpp b/engines/avalanche/xf_help.cpp
index 162fcec..b0f6844 100644
--- a/engines/avalanche/xf_help.cpp
+++ b/engines/avalanche/xf_help.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/xf_visa.cpp b/engines/avalanche/xf_visa.cpp
index 2eb565a..5fe7156 100644
--- a/engines/avalanche/xf_visa.cpp
+++ b/engines/avalanche/xf_visa.cpp
@@ -1,8 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
 
 
 
diff --git a/engines/avalanche/xfbutton.cpp b/engines/avalanche/xfbutton.cpp
index 1881e97..980eff8 100644
--- a/engines/avalanche/xfbutton.cpp
+++ b/engines/avalanche/xfbutton.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/xfghost.cpp b/engines/avalanche/xfghost.cpp
index e03399a..86996ba 100644
--- a/engines/avalanche/xfghost.cpp
+++ b/engines/avalanche/xfghost.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 
diff --git a/engines/avalanche/zapdraw.cpp b/engines/avalanche/zapdraw.cpp
index 5ab55d1..2c4f712 100644
--- a/engines/avalanche/zapdraw.cpp
+++ b/engines/avalanche/zapdraw.cpp
@@ -1,7 +1,3 @@
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
 
 
 


Commit: 7939ab1f62959c19a18dfe3d54aef0d0175a3b1d
    https://github.com/scummvm/scummvm/commit/7939ab1f62959c19a18dfe3d54aef0d0175a3b1d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T04:52:44-07:00

Commit Message:
AVALANCHE: Add standard header. (Now the right one...)

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/access.h
    engines/avalanche/acci.cpp
    engines/avalanche/acci.h
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/arch.h
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/basher.h
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/cadburys.h
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enhanced.h
    engines/avalanche/enid.cpp
    engines/avalanche/enid.h
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/fileunit.h
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helpbak.h
    engines/avalanche/helper.cpp
    engines/avalanche/helper.h
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/highs.h
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/incline.h
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/joystick.h
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/logger.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/nimunit.h
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldincln.h
    engines/avalanche/oldtrip.cpp
    engines/avalanche/oldtrip.h
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/oopmenu.h
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/pingo.h
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb1.h
    engines/avalanche/sackb3.cpp
    engines/avalanche/sackblas.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/scrolls.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sez.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezunit.h
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sticks.h
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/timeout.h
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip.h
    engines/avalanche/trip3.cpp
    engines/avalanche/trip3.h
    engines/avalanche/trip42.cpp
    engines/avalanche/trip42.h
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5.h
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visa.h
    engines/avalanche/visatest.cpp
    engines/avalanche/waver.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index e8debc3..12db75a 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index faa00bb..a36a3e5 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
index 825deeb..ff2d3af 100644
--- a/engines/avalanche/access.h
+++ b/engines/avalanche/access.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __access_h__
 #define __access_h__
 
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 32fde0c..703785f 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*  $D-*/
 /*
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
index f9d1265..7049199 100644
--- a/engines/avalanche/acci.h
+++ b/engines/avalanche/acci.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __acci_h__
 #define __acci_h__
 
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index e5af131..5429331 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Rodent.h"*/
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index 9cf259e..1902ecd 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-                 /* Trippancy IV - original file */
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Trippancy IV - original file */
 #include "graph.h"
 
 const integer taboo = cyan;
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index b5355d7..670a3de 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-                  /* Trippancy IV - original file */
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Trippancy IV - original file */
 #include "graph.h"
 
 const integer taboo = cyan;
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index db5c659..3abfbac 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index e05f173..f488a86 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
index cb0960f..781217a 100644
--- a/engines/avalanche/arch.h
+++ b/engines/avalanche/arch.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __arch_h__
 #define __arch_h__
 
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index 3780b79..8f36226 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 6488fb8..f57b0f4 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
 
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index 9b366a9..d7bfac5 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index 1985194..4105eaf 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index 9702ec2..b425b56 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 7d5143b..6267a04 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index 296c55a..b005b03 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Celer.h"*/
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index 3ac401e..5210631 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
index 1afecae..a1996c8 100644
--- a/engines/avalanche/basher.h
+++ b/engines/avalanche/basher.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __basher_h__
 #define __basher_h__
 
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index 141c69b..ff4ab38 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
 
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index 3839875..21c65ae 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -1,4 +1,29 @@
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __cadburys_implementation__
 
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
index 65e7bd7..b513510 100644
--- a/engines/avalanche/cadburys.h
+++ b/engines/avalanche/cadburys.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __cadburys_h__
 #define __cadburys_h__
 
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index bedab4b..c456378 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
index f6ad52f..ff608ea 100644
--- a/engines/avalanche/celer.h
+++ b/engines/avalanche/celer.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __celer_h__
 #define __celer_h__
 
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index 0488d21..9a9718b 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index 0eb701b..f42bf31 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
index 00cb696..46848da 100644
--- a/engines/avalanche/chunker.cpp
+++ b/engines/avalanche/chunker.cpp
@@ -1,6 +1,29 @@
-
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index 4b8d99e..44e1725 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
 
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 #include "cadburys.h"
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index 252f132..ee79085 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index d8b89dd..26b3b49 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index 4a644d2..2083f5b 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index a2d02f9..9300c7b 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index b319f2b..3798e5c 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index 8d2f7a9..fc8da30 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index 98ada51..30be845 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index 156827b..48f5bd2 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index 1703d4f..a574a04 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 71fd991..2ae8f85 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index ec5ff4b..292cc1a 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index 9752345..270d253 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index bc11f36..ef42c8a 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index e2c6a27..eddbc2d 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index 762a44a..0e980e6 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index 4736700..bd303ad 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index 917d83b..52f3be1 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 1f7f234..792c0b5 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 38523f6..86f4935 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index 8b942d9..7fdb52b 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index 6674401..ebdc85b 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 #include "graph.h"
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index bfed58e..722ff37 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index 97dd37e..3d33cd6 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __closing_h__
 #define __closing_h__
 
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index ca41b36..d350f23 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index b5efcba..53147ca 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Binu.h"*/
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index d37849b..6d33127 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index 376c346..be06790 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 9319408..c88d06a 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
index 9d32fb9..ac22571 100644
--- a/engines/avalanche/dropdown.h
+++ b/engines/avalanche/dropdown.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __dropdown_h__
 #define __dropdown_h__
 
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index aa0fd75..67dbdc7 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index c06d2b1..9907281 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -1,6 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
 const string ednaid = string("TT")+'\261'+'\36'+'\1'+'\113'+'\261'+'\231'+'\261';
diff --git a/engines/avalanche/edna.cpp b/engines/avalanche/edna.cpp
index d700a85..03d9c23 100644
--- a/engines/avalanche/edna.cpp
+++ b/engines/avalanche/edna.cpp
@@ -1,4 +1,29 @@
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M 10000,0,1000*/ /*$V-*/
 
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index 34a46ff..634ad63 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __enhanced_implementation__
 
diff --git a/engines/avalanche/enhanced.h b/engines/avalanche/enhanced.h
index a028648..c7031a2 100644
--- a/engines/avalanche/enhanced.h
+++ b/engines/avalanche/enhanced.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __enhanced_h__
 #define __enhanced_h__
 
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
index fb2577a..e6d9106 100644
--- a/engines/avalanche/enid.cpp
+++ b/engines/avalanche/enid.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
index abf20a2..ce9f5fd 100644
--- a/engines/avalanche/enid.h
+++ b/engines/avalanche/enid.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __enid_h__
 #define __enid_h__
 
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index 4ae92c3..5fbc5b3 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index d9de210..26ab496 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -1,4 +1,29 @@
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __fileunit_implementation__
                /* v:filer.pas - "avvyfiler" - in unit form. */
diff --git a/engines/avalanche/fileunit.h b/engines/avalanche/fileunit.h
index 08f9262..ce7d07a 100644
--- a/engines/avalanche/fileunit.h
+++ b/engines/avalanche/fileunit.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __fileunit_h__
 #define __fileunit_h__
 
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index 841163f..a272107 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index 47d5d58..6d9fe75 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -1,6 +1,31 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
-                  /* Get 'em back! */
+/* Get 'em back! */
 #include "graph.h"
 
 
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 31154aa..0d2a412 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index 5f1b517..574fc8d 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index 386a16c..b8dab28 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index 3643f43..e5ad0d6 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$I c:\sleep5\DSMI.INC*/ #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 0e05d77..f4f82bb 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 8a1fdb5..22b8552 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __gyro_h__
 #define __gyro_h__
 
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index 804ded4..c53e4d8 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Rodent.h"*/
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index 148f578..fe9cbec 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index 367fd20..1a7138b 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/helpbak.h b/engines/avalanche/helpbak.h
index 12a7869..3d8f5d8 100644
--- a/engines/avalanche/helpbak.h
+++ b/engines/avalanche/helpbak.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __helpbak_h__
 #define __helpbak_h__
 
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index 0708413..ad489a8 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/helper.h b/engines/avalanche/helper.h
index 9c1c43c..22c6b06 100644
--- a/engines/avalanche/helper.h
+++ b/engines/avalanche/helper.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __helper_h__
 #define __helper_h__
 
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index c6a80cb..dc3d0ab 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 file<char> inf,outf;
 char x;
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 38d929e..419eb38 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/highs.h b/engines/avalanche/highs.h
index 3d6eb65..f147c05 100644
--- a/engines/avalanche/highs.h
+++ b/engines/avalanche/highs.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __highs_h__
 #define __highs_h__
 
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index d9508b5..cb0a627 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M 6000,600,600*/
 /*$V-,I-,R-,F+*/ /* Do not change these directives. */
diff --git a/engines/avalanche/incline.cpp b/engines/avalanche/incline.cpp
index 8cc8170..f6d7926 100644
--- a/engines/avalanche/incline.cpp
+++ b/engines/avalanche/incline.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/incline.h b/engines/avalanche/incline.h
index 4b252a1..799ad79 100644
--- a/engines/avalanche/incline.h
+++ b/engines/avalanche/incline.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __incline_h__
 #define __incline_h__
 
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index a485c1b..342f3ef 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index 7d95ff9..4400fa5 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index 54cd3e6..854db43 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$I c:\sleep5\DSMI.INC*/
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index acb607c..0d96688 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-              /* Avalot interrupt handler */
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Avalot interrupt handler */
 /*#include "Dos.h"*/
 
 /*$F+*/
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index 7d22a50..4326ac8 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-                       /* Avalot joystick setup routines. To be incorporated
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Avalot joystick setup routines. To be incorporated
                          into Setup2 whenever I get a chance. */
 /*#include "Joystick.h"*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index c3ab14a..b18fdd0 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __joystick_implementation__
 
diff --git a/engines/avalanche/joystick.h b/engines/avalanche/joystick.h
index 0a3147e..8a1bcf1 100644
--- a/engines/avalanche/joystick.h
+++ b/engines/avalanche/joystick.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __joystick_h__
 #define __joystick_h__
 
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index 9bc4a0c..a53e3ed 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index b95e450..4d14e3c 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/logger.h b/engines/avalanche/logger.h
index 016bfb6..b068f20 100644
--- a/engines/avalanche/logger.h
+++ b/engines/avalanche/logger.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __logger_h__
 #define __logger_h__
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 777e9bd..9ef67fd 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
index a602f8c..f40364a 100644
--- a/engines/avalanche/lucerna.h
+++ b/engines/avalanche/lucerna.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __lucerna_h__
 #define __lucerna_h__
 
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index b7e9d12..e1729f7 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 3c6b35e..139f216 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 0f1c494..0fdb829 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index 2079547..32d8a6c 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-                                 /* Phew! */
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Phew! */
 #include "graph.h"
 
 /*$S-*/
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index 2e927c8..89b66d7 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -1,6 +1,31 @@
-
-
-                       /* regname's name starts at $7D1 (2001). */
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* regname's name starts at $7D1 (2001). */
 
 const array<1,56,char> padding = 
 "For all the Etruscan armies were ranged beneath his eye";
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index c264dc1..cfb9974 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -1,6 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 struct sezheader {
              array<1,2,char> initials;     /* should be "TT" */
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index a5f3e25..7d3c5f3 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Squeak.h"*/
diff --git a/engines/avalanche/menuxf.cpp b/engines/avalanche/menuxf.cpp
index 6a5342e..be0920e 100644
--- a/engines/avalanche/menuxf.cpp
+++ b/engines/avalanche/menuxf.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index 29b3da7..d404c60 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index 5f21ecd..095fc40 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 7dab81b..a81dfc6 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index 21618d6..45b1c68 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/nimunit.cpp b/engines/avalanche/nimunit.cpp
index 4aae41b..e2d5f6f 100644
--- a/engines/avalanche/nimunit.cpp
+++ b/engines/avalanche/nimunit.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/nimunit.h b/engines/avalanche/nimunit.h
index 5e3386d..4b5f79b 100644
--- a/engines/avalanche/nimunit.h
+++ b/engines/avalanche/nimunit.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __nimunit_h__
 #define __nimunit_h__
 
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index c917060..f802026 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 #include "graph.h"
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index 4286ee2..5fa205c 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index 6dd38b6..c627407 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/oldincln.h b/engines/avalanche/oldincln.h
index a0db659..9590d66 100644
--- a/engines/avalanche/oldincln.h
+++ b/engines/avalanche/oldincln.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __oldincln_h__
 #define __oldincln_h__
 
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index 1dddecb..e7df00f 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/oldtrip.h b/engines/avalanche/oldtrip.h
index dc36efd..7a5e402 100644
--- a/engines/avalanche/oldtrip.h
+++ b/engines/avalanche/oldtrip.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __oldtrip_h__
 #define __oldtrip_h__
 
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index a683bf2..0209619 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Oopmenu.h"*/
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index 641b9ba..9f8445b 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -1,4 +1,29 @@
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __oopmenu_implementation__
 
diff --git a/engines/avalanche/oopmenu.h b/engines/avalanche/oopmenu.h
index ee928e2..4ac4efb 100644
--- a/engines/avalanche/oopmenu.h
+++ b/engines/avalanche/oopmenu.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __oopmenu_h__
 #define __oopmenu_h__
 
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index b39b5ba..d68a292 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index e4a2fc9..307b9e2 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index 30f0cd3..ef1141e 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index cc5386d..c2a05ae 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index d396c67..39087b1 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -1,6 +1,31 @@
+/* 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.
 
-                  /* Get 'em back! */
+ * 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Get 'em back! */
 #include "graph.h"
 
 
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 5a98ba3..6b0f490 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index fdb49b7..71af98e 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __pingo_h__
 #define __pingo_h__
 
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index b9c7fc7..799f1f1 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index bd5e4d4..f76486d 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index b727033..b3e2eb6 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 #include "graph.h"
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index d6877ae..2ed399d 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -1,6 +1,31 @@
-
-
-               /* Demonstration of the Bigo II system. */
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Demonstration of the Bigo II system. */
 #include "graph.h"
 /*#include "Crt.h"*/
 /*#include "Rodent.h"*/
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index d37a113..6d8a300 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index 9937a46..76cfc77 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -1,6 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 struct markertype {
               word length;
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index 65bd0b5..7a2cbac 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 const array<1,36,char> letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
 varying_string<30> name;
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index b84788a..cc11935 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sackb1.h b/engines/avalanche/sackb1.h
index b671da2..e226946 100644
--- a/engines/avalanche/sackb1.h
+++ b/engines/avalanche/sackb1.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __sackb1_h__
 #define __sackb1_h__
 
diff --git a/engines/avalanche/sackb3.cpp b/engines/avalanche/sackb3.cpp
index 4d70bf6..60a259c 100644
--- a/engines/avalanche/sackb3.cpp
+++ b/engines/avalanche/sackb3.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M 16384,0,0*/
 
diff --git a/engines/avalanche/sackblas.cpp b/engines/avalanche/sackblas.cpp
index e69de29..e3261d7 100644
--- a/engines/avalanche/sackblas.cpp
+++ b/engines/avalanche/sackblas.cpp
@@ -0,0 +1,27 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index 962495f..fce157e 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/scr_1.cpp b/engines/avalanche/scr_1.cpp
index 258ca6b..5a9d55d 100644
--- a/engines/avalanche/scr_1.cpp
+++ b/engines/avalanche/scr_1.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scr_2.cpp b/engines/avalanche/scr_2.cpp
index 55eba41..2d5a78c 100644
--- a/engines/avalanche/scr_2.cpp
+++ b/engines/avalanche/scr_2.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scr_3.cpp b/engines/avalanche/scr_3.cpp
index 96c9d9e..0e4ff0d 100644
--- a/engines/avalanche/scr_3.cpp
+++ b/engines/avalanche/scr_3.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scr_4.cpp b/engines/avalanche/scr_4.cpp
index 183104e..44099e1 100644
--- a/engines/avalanche/scr_4.cpp
+++ b/engines/avalanche/scr_4.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scr_5.cpp b/engines/avalanche/scr_5.cpp
index ab2359f..8268631 100644
--- a/engines/avalanche/scr_5.cpp
+++ b/engines/avalanche/scr_5.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scr_9.cpp b/engines/avalanche/scr_9.cpp
index 6d46fac..2dac08c 100644
--- a/engines/avalanche/scr_9.cpp
+++ b/engines/avalanche/scr_9.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 4f02f06..7bf6c6d 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/scrolls.h b/engines/avalanche/scrolls.h
index d71ec5d..d20d361 100644
--- a/engines/avalanche/scrolls.h
+++ b/engines/avalanche/scrolls.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __scrolls_h__
 #define __scrolls_h__
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index fccb01b..243caf4 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index a6c59a6..86d2d89 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __sequence_h__
 #define __sequence_h__
 
diff --git a/engines/avalanche/setup.cpp b/engines/avalanche/setup.cpp
index 32fee35..1416a51 100644
--- a/engines/avalanche/setup.cpp
+++ b/engines/avalanche/setup.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/seu.cpp b/engines/avalanche/seu.cpp
index f1729f2..9e8f4aa 100644
--- a/engines/avalanche/seu.cpp
+++ b/engines/avalanche/seu.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
 
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/seu_avvy.cpp b/engines/avalanche/seu_avvy.cpp
index c9c30f8..206c844 100644
--- a/engines/avalanche/seu_avvy.cpp
+++ b/engines/avalanche/seu_avvy.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/sez.cpp b/engines/avalanche/sez.cpp
index e69de29..e3261d7 100644
--- a/engines/avalanche/sez.cpp
+++ b/engines/avalanche/sez.cpp
@@ -0,0 +1,27 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
diff --git a/engines/avalanche/sezedit.cpp b/engines/avalanche/sezedit.cpp
index 5db639c..d9f0e48 100644
--- a/engines/avalanche/sezedit.cpp
+++ b/engines/avalanche/sezedit.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M 65520,0,655360*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/sezunit.cpp b/engines/avalanche/sezunit.cpp
index 1f15cf1..c98e6f8 100644
--- a/engines/avalanche/sezunit.cpp
+++ b/engines/avalanche/sezunit.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __sezunit_implementation__
 
diff --git a/engines/avalanche/sezunit.h b/engines/avalanche/sezunit.h
index 6b0a99e..76feb66 100644
--- a/engines/avalanche/sezunit.h
+++ b/engines/avalanche/sezunit.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __sezunit_h__
 #define __sezunit_h__
 
diff --git a/engines/avalanche/sezxfr.cpp b/engines/avalanche/sezxfr.cpp
index 37c9cf0..7ae6cec 100644
--- a/engines/avalanche/sezxfr.cpp
+++ b/engines/avalanche/sezxfr.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
  /*$V-*/
diff --git a/engines/avalanche/shell1.cpp b/engines/avalanche/shell1.cpp
index 75296bf..5d6e2c9 100644
--- a/engines/avalanche/shell1.cpp
+++ b/engines/avalanche/shell1.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M $800,0,0*/
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/shell2.cpp b/engines/avalanche/shell2.cpp
index b0ef13a..cd6fec2 100644
--- a/engines/avalanche/shell2.cpp
+++ b/engines/avalanche/shell2.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 #include "graph.h"
diff --git a/engines/avalanche/slope.cpp b/engines/avalanche/slope.cpp
index c566246..83bb1d7 100644
--- a/engines/avalanche/slope.cpp
+++ b/engines/avalanche/slope.cpp
@@ -1,6 +1,29 @@
-
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 struct joysetup {
             word xmid,ymid,xmin,ymin,xmax,ymax;
diff --git a/engines/avalanche/spread.cpp b/engines/avalanche/spread.cpp
index 5e52228..3ee7134 100644
--- a/engines/avalanche/spread.cpp
+++ b/engines/avalanche/spread.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/spread2.cpp b/engines/avalanche/spread2.cpp
index 267bf8e..5a42427 100644
--- a/engines/avalanche/spread2.cpp
+++ b/engines/avalanche/spread2.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/squish.cpp b/engines/avalanche/squish.cpp
index 6ff3b90..d9077ed 100644
--- a/engines/avalanche/squish.cpp
+++ b/engines/avalanche/squish.cpp
@@ -1,6 +1,29 @@
+/* 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.
+ *
+ */
 
-
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /* This is the first version. Thanks to Pib. */
 
diff --git a/engines/avalanche/ss_blank.cpp b/engines/avalanche/ss_blank.cpp
index f8bc96b..7e97654 100644
--- a/engines/avalanche/ss_blank.cpp
+++ b/engines/avalanche/ss_blank.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/ss_clock.cpp b/engines/avalanche/ss_clock.cpp
index e169f37..ae466bc 100644
--- a/engines/avalanche/ss_clock.cpp
+++ b/engines/avalanche/ss_clock.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/stars.cpp b/engines/avalanche/stars.cpp
index 5181241..d6bc8ef 100644
--- a/engines/avalanche/stars.cpp
+++ b/engines/avalanche/stars.cpp
@@ -1,6 +1,31 @@
-
-
-               /* Demonstration of the Bigo II system. */
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Demonstration of the Bigo II system. */
 /* $I c:\sleep5\DSMI.INC*/
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/status.cpp b/engines/avalanche/status.cpp
index 761f11c..c8931e6 100644
--- a/engines/avalanche/status.cpp
+++ b/engines/avalanche/status.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/sticks.cpp b/engines/avalanche/sticks.cpp
index b47b6fb..0e18be0 100644
--- a/engines/avalanche/sticks.cpp
+++ b/engines/avalanche/sticks.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/sticks.h b/engines/avalanche/sticks.h
index 5a54cd4..24f59c4 100644
--- a/engines/avalanche/sticks.h
+++ b/engines/avalanche/sticks.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __sticks_h__
 #define __sticks_h__
 
diff --git a/engines/avalanche/sunrise.cpp b/engines/avalanche/sunrise.cpp
index 4a0e3ac..d512892 100644
--- a/engines/avalanche/sunrise.cpp
+++ b/engines/avalanche/sunrise.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/tempo.cpp b/engines/avalanche/tempo.cpp
index b8887ef..908e762 100644
--- a/engines/avalanche/tempo.cpp
+++ b/engines/avalanche/tempo.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/test.cpp b/engines/avalanche/test.cpp
index 1ac5671..ead8a37 100644
--- a/engines/avalanche/test.cpp
+++ b/engines/avalanche/test.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*$M 2048,0,0*/
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/test2.cpp b/engines/avalanche/test2.cpp
index e5b2347..0001ac0 100644
--- a/engines/avalanche/test2.cpp
+++ b/engines/avalanche/test2.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Dos.h"*/
 
diff --git a/engines/avalanche/testblit.cpp b/engines/avalanche/testblit.cpp
index 2949f30..4154dcb 100644
--- a/engines/avalanche/testblit.cpp
+++ b/engines/avalanche/testblit.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/testcard.cpp b/engines/avalanche/testcard.cpp
index e1e8696..3a3fba5 100644
--- a/engines/avalanche/testcard.cpp
+++ b/engines/avalanche/testcard.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/testenh.cpp b/engines/avalanche/testenh.cpp
index 34e1d67..b304a57 100644
--- a/engines/avalanche/testenh.cpp
+++ b/engines/avalanche/testenh.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Enhanced.h"*/
 
diff --git a/engines/avalanche/timeout.cpp b/engines/avalanche/timeout.cpp
index d5b964d..073d415 100644
--- a/engines/avalanche/timeout.cpp
+++ b/engines/avalanche/timeout.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/timeout.h b/engines/avalanche/timeout.h
index 5fa9800..99090dd 100644
--- a/engines/avalanche/timeout.h
+++ b/engines/avalanche/timeout.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __timeout_h__
 #define __timeout_h__
 
diff --git a/engines/avalanche/travel.cpp b/engines/avalanche/travel.cpp
index 6f48f99..4ce11d5 100644
--- a/engines/avalanche/travel.cpp
+++ b/engines/avalanche/travel.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/trip.cpp b/engines/avalanche/trip.cpp
index 58ae537..64b8878 100644
--- a/engines/avalanche/trip.cpp
+++ b/engines/avalanche/trip.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip.h b/engines/avalanche/trip.h
index 520e323..abef803 100644
--- a/engines/avalanche/trip.h
+++ b/engines/avalanche/trip.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __trip_h__
 #define __trip_h__
 
diff --git a/engines/avalanche/trip3.cpp b/engines/avalanche/trip3.cpp
index d95eba5..4c04ef4 100644
--- a/engines/avalanche/trip3.cpp
+++ b/engines/avalanche/trip3.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #define __trip3_implementation__
             /* Project Minstrel- Trippancy routines */
diff --git a/engines/avalanche/trip3.h b/engines/avalanche/trip3.h
index ccad153..9318726 100644
--- a/engines/avalanche/trip3.h
+++ b/engines/avalanche/trip3.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __trip3_h__
 #define __trip3_h__
 
diff --git a/engines/avalanche/trip42.cpp b/engines/avalanche/trip42.cpp
index 923e32e..2dee669 100644
--- a/engines/avalanche/trip42.cpp
+++ b/engines/avalanche/trip42.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip42.h b/engines/avalanche/trip42.h
index b5e4f13..72b9499 100644
--- a/engines/avalanche/trip42.h
+++ b/engines/avalanche/trip42.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __trip42_h__
 #define __trip42_h__
 
diff --git a/engines/avalanche/trip5.cpp b/engines/avalanche/trip5.cpp
index 721268b..5742bf3 100644
--- a/engines/avalanche/trip5.cpp
+++ b/engines/avalanche/trip5.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/trip5.h b/engines/avalanche/trip5.h
index 9e7b3a3..3811c85 100644
--- a/engines/avalanche/trip5.h
+++ b/engines/avalanche/trip5.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __trip5_h__
 #define __trip5_h__
 
diff --git a/engines/avalanche/trip5tst.cpp b/engines/avalanche/trip5tst.cpp
index c669cc7..5b78efa 100644
--- a/engines/avalanche/trip5tst.cpp
+++ b/engines/avalanche/trip5tst.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
 
-
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/trip5xf.cpp b/engines/avalanche/trip5xf.cpp
index f6225b4..09a8eac 100644
--- a/engines/avalanche/trip5xf.cpp
+++ b/engines/avalanche/trip5xf.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/tripoop.cpp b/engines/avalanche/tripoop.cpp
index b8db1a7..6ddc12c 100644
--- a/engines/avalanche/tripoop.cpp
+++ b/engines/avalanche/tripoop.cpp
@@ -1,6 +1,31 @@
-
-
-                 /* Trip Oop (Trippancy 4 Andexor */
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Trip Oop (Trippancy 4 Andexor */
 #include "graph.h"
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/ttmenuxf.cpp b/engines/avalanche/ttmenuxf.cpp
index 2d870fa..ad986e1 100644
--- a/engines/avalanche/ttmenuxf.cpp
+++ b/engines/avalanche/ttmenuxf.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/unsquish.cpp b/engines/avalanche/unsquish.cpp
index 9183e1b..bf98aeb 100644
--- a/engines/avalanche/unsquish.cpp
+++ b/engines/avalanche/unsquish.cpp
@@ -1,6 +1,31 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
-                            /*$S-*/
+/*$S-*/
 #include "graph.h"
 
 
diff --git a/engines/avalanche/viewdocs.cpp b/engines/avalanche/viewdocs.cpp
index a9e1e6e..52edfe4 100644
--- a/engines/avalanche/viewdocs.cpp
+++ b/engines/avalanche/viewdocs.cpp
@@ -1,6 +1,31 @@
-
-
-                   /*$S-*/
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/*$S-*/
 /*#include "dos.h"*/
 /*#include "crt.h"*/
 /*#include "tommys.h"*/
diff --git a/engines/avalanche/visa.cpp b/engines/avalanche/visa.cpp
index 664dca9..dea03b1 100644
--- a/engines/avalanche/visa.cpp
+++ b/engines/avalanche/visa.cpp
@@ -1,4 +1,29 @@
+/* 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.
+ *
+ */
 
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*
   ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
diff --git a/engines/avalanche/visa.h b/engines/avalanche/visa.h
index 8b79d6b..0c695fb 100644
--- a/engines/avalanche/visa.h
+++ b/engines/avalanche/visa.h
@@ -1,3 +1,30 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
 #ifndef __visa_h__
 #define __visa_h__
 
diff --git a/engines/avalanche/visatest.cpp b/engines/avalanche/visatest.cpp
index df856f6..5cbcf64 100644
--- a/engines/avalanche/visatest.cpp
+++ b/engines/avalanche/visatest.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 
diff --git a/engines/avalanche/waver.cpp b/engines/avalanche/waver.cpp
index e69de29..e3261d7 100644
--- a/engines/avalanche/waver.cpp
+++ b/engines/avalanche/waver.cpp
@@ -0,0 +1,27 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
diff --git a/engines/avalanche/xf_gover.cpp b/engines/avalanche/xf_gover.cpp
index 683e6ca..98590e6 100644
--- a/engines/avalanche/xf_gover.cpp
+++ b/engines/avalanche/xf_gover.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/xf_help.cpp b/engines/avalanche/xf_help.cpp
index b0f6844..ec7b1d1 100644
--- a/engines/avalanche/xf_help.cpp
+++ b/engines/avalanche/xf_help.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 /*#include "Tommys.h"*/
diff --git a/engines/avalanche/xf_visa.cpp b/engines/avalanche/xf_visa.cpp
index 5fe7156..c0b2573 100644
--- a/engines/avalanche/xf_visa.cpp
+++ b/engines/avalanche/xf_visa.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 /*#include "Crt.h"*/
 /*#include "Dos.h"*/
diff --git a/engines/avalanche/xfbutton.cpp b/engines/avalanche/xfbutton.cpp
index 980eff8..197aa96 100644
--- a/engines/avalanche/xfbutton.cpp
+++ b/engines/avalanche/xfbutton.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 
diff --git a/engines/avalanche/xfghost.cpp b/engines/avalanche/xfghost.cpp
index 86996ba..6eeec28 100644
--- a/engines/avalanche/xfghost.cpp
+++ b/engines/avalanche/xfghost.cpp
@@ -1,5 +1,29 @@
-
-
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/
diff --git a/engines/avalanche/zapdraw.cpp b/engines/avalanche/zapdraw.cpp
index 2c4f712..9b13dbb 100644
--- a/engines/avalanche/zapdraw.cpp
+++ b/engines/avalanche/zapdraw.cpp
@@ -1,5 +1,29 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
 
 #include "graph.h"
 /*#include "Crt.h"*/


Commit: a3025b8dad7abfe845c57aee3703451c223fc2e6
    https://github.com/scummvm/scummvm/commit/a3025b8dad7abfe845c57aee3703451c223fc2e6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-17T06:45:25-07:00

Commit Message:
AVALANCHE: Add namespace.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/access.h
    engines/avalanche/acci.cpp
    engines/avalanche/acci.h
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/arch.h
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/basher.h
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/cadburys.h
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enhanced.h
    engines/avalanche/enid.cpp
    engines/avalanche/enid.h
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/fileunit.h
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helpbak.h
    engines/avalanche/helper.cpp
    engines/avalanche/helper.h
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/highs.h
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/joystick.h
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/logger.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/nimunit.h
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldtrip.cpp
    engines/avalanche/oldtrip.h
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/oopmenu.h
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/pingo.h
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb1.h
    engines/avalanche/sackb3.cpp
    engines/avalanche/sackblas.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/scrolls.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezunit.h
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sticks.h
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/timeout.h
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip.h
    engines/avalanche/trip3.cpp
    engines/avalanche/trip3.h
    engines/avalanche/trip42.cpp
    engines/avalanche/trip42.h
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5.h
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visa.h
    engines/avalanche/visatest.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index 12db75a..0f9e19b 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -28,6 +28,7 @@
 /*#include "Crt.h"*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 matrix<1,7,1,3,byte> cols;
 byte fv;
@@ -78,4 +79,6 @@ int main(int argc, const char* argv[])
  }
 
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index a36a3e5..951bc1c 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -44,6 +44,7 @@
 /*#include "Trip5.h"*/
 /*#include "Lucerna.h"*/
 
+namespace Avalanche {
 
 boolean int_say_went_ok;
 
@@ -192,4 +193,4 @@ void talkto(byte whom)
  }
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
index ff2d3af..e985953 100644
--- a/engines/avalanche/access.h
+++ b/engines/avalanche/access.h
@@ -28,9 +28,12 @@
 #ifndef __access_h__
 #define __access_h__
 
+namespace Avalanche {
 
 void dixi(char p, byte n);
 
 void talkto(byte whom);
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 703785f..f33d7c2 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -53,6 +53,7 @@
 /*#include "Helper.h"*/
 /*#include "Sequence.h"*/
 
+namespace Avalanche {
 
 byte fv;
 
@@ -1694,3 +1695,5 @@ static unit_acci_initialize acci_constructor;
 unit_acci_initialize::unit_acci_initialize() {
  weirdword=false;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
index 7049199..6734f66 100644
--- a/engines/avalanche/acci.h
+++ b/engines/avalanche/acci.h
@@ -28,6 +28,7 @@
 #ifndef __acci_h__
 #define __acci_h__
 
+namespace Avalanche {
 
 /* verb codes */
 const char vb_exam = '\1'; const char vb_open = '\2'; const char vb_pause = '\3'; const char vb_get = '\4'; const char vb_drop = '\5';
@@ -247,4 +248,6 @@ void do_that();
 void verbopt(char n, string& answer, char& anskey);
 void have_a_drink();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index 5429331..83dce52 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -31,6 +31,8 @@
 
 /*$R+,V-*/
 
+namespace Avalanche {
+
 typedef matrix<0,255,0,15,byte> fonttype;
 
 class fieldtype {
@@ -1050,3 +1052,5 @@ int main(int argc, const char* argv[])
  alsomenu();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index 1902ecd..df65411 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -28,6 +28,8 @@
 /* Trippancy IV - original file */
 #include "graph.h"
 
+namespace Avalanche {
+
 const integer taboo = cyan;
 
 struct adxtype {
@@ -144,4 +146,6 @@ int main(int argc, const char* argv[])
  close(f);
  closegraph();
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index 670a3de..136f719 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -28,6 +28,8 @@
 /* Trippancy IV - original file */
 #include "graph.h"
 
+namespace Avalanche {
+
 const integer taboo = cyan;
 
 struct adxtype {
@@ -155,4 +157,6 @@ int main(int argc, const char* argv[])
  close(f);
  closegraph();
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index 3abfbac..2cfe410 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 typedef matrix<1,24,0,1,pointer> adxtype;
 
@@ -85,4 +86,6 @@ int main(int argc, const char* argv[])
   anim += 1; if (anim==7)  anim=1;cp=1-cp;
  } while (!false);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index f488a86..815018d 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -41,6 +41,7 @@
 /*#include "Dos.h"*/
 #include "scrolls.h"
 
+namespace Avalanche {
 
 struct ednahead { /* Edna header */
           /* This header starts at byte offset 177 in the .ASG file. */
@@ -144,4 +145,4 @@ void save(string name)
  close(f);
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
index 781217a..840ceb4 100644
--- a/engines/avalanche/arch.h
+++ b/engines/avalanche/arch.h
@@ -31,7 +31,10 @@
 
 #include "gyro.h"
 
+namespace Avalanche {
 
 void save(string name);
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index 8f36226..f793fa5 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -51,6 +51,8 @@
 /*#include "Visa.h"*/
 
 
+namespace Avalanche {
+
 void setup()
 {
  integer gd,gm;
@@ -137,3 +139,5 @@ int main(int argc, const char* argv[])
 }
 
 /*  typein; commanded; last:=current; */
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index f57b0f4..0ca6b72 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -27,6 +27,9 @@
 
 #include "graph.h"
 
+
+namespace Avalanche {
+
 integer gd,gm;
 int main(int argc, const char* argv[])
 {pio_initialize(argc, argv);
@@ -110,3 +113,5 @@ int main(int argc, const char* argv[])
 */
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index d7bfac5..31c2692 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -29,6 +29,8 @@
 /*#include "Crt.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 fonttype font;
@@ -334,3 +336,5 @@ int main(int argc, const char* argv[])
  closegraph();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index 4105eaf..fa70ca1 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 untyped_file f;
 array<1,16000,byte> aa;
@@ -105,4 +107,6 @@ int main(int argc, const char* argv[])
   gotoxy(1,1);
   input >> NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index b425b56..b7f96a5 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -29,6 +29,8 @@
 /*#include "Crt.h"*/
 /*#include "Ansi.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 untyped_file f;
 array<1,16000,byte> aa;
@@ -206,4 +208,6 @@ int main(int argc, const char* argv[])
  output << NL;
  normal;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 6267a04..25fc83e 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 byte z;
 array<1,4,pointer> a;
@@ -93,4 +95,6 @@ int main(int argc, const char* argv[])
  }
  savesc();
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index b005b03..fabda14 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -29,6 +29,8 @@
 /*#include "Celer.h"*/
 /*#include "Lucerna.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 int main(int argc, const char* argv[])
 {
@@ -49,4 +51,6 @@ int main(int argc, const char* argv[])
  outtextxy(100,50,"Chunk1");
  input >> NL;
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index 5210631..b4ceeb3 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -54,6 +54,7 @@
 #include "Sticks.h"
 #include "enid.h"
 
+namespace Avalanche {
 
 boolean entering_filename;
 byte left_margin;
@@ -408,3 +409,5 @@ unit_basher_initialize::unit_basher_initialize() {
  #endif
 
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
index a1996c8..ba26d92 100644
--- a/engines/avalanche/basher.h
+++ b/engines/avalanche/basher.h
@@ -32,6 +32,7 @@
 #include "gyro.h"
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
 
 #ifdef RECORD
 
@@ -64,4 +65,6 @@ EXTERN word count;
   void record_one();
 #endif
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index ff4ab38..9059447 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -30,6 +30,8 @@
 
 /*$M 8192,0,$6000, S-*/
 
+namespace Avalanche {
+
 enum elm {normal, musical, elmpoyten, regi, last_elm};
 
 const integer run_shootemup = 1;
@@ -371,3 +373,5 @@ int main(int argc, const char* argv[])
  } while (!false);
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index 21c65ae..8d1e0c3 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -33,7 +33,7 @@
 
 #include "graph.h"
 
-
+namespace Avalanche {
 
 void mgrab(integer x1,integer y1,integer x2,integer y2, word size)
 {
@@ -131,4 +131,4 @@ void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer real
 /* rectangle(x1,y1,x2,y2);*/
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
index b513510..325bd35 100644
--- a/engines/avalanche/cadburys.h
+++ b/engines/avalanche/cadburys.h
@@ -28,6 +28,7 @@
 #ifndef __cadburys_h__
 #define __cadburys_h__
 
+namespace Avalanche {
 
 const integer arraysize = 12000;
 
@@ -65,4 +66,6 @@ EXTERN untyped_file f;
 void grab(integer x1,integer y1,integer x2,integer y2,integer realx,integer realy, flavourtype flav,
  boolean mem,boolean nat);
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index c456378..1038e6f 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -34,7 +34,6 @@
 
 #define __celer_implementation__
 
-
 #include "celer.h"
 
 
@@ -43,6 +42,7 @@
 #include "lucerna.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 untyped_file f; /* Private variable- not accessible from elsewhere. */
 
@@ -495,3 +495,5 @@ static unit_celer_initialize celer_constructor;
 unit_celer_initialize::unit_celer_initialize() {
  num_chunks=0;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
index ff608ea..c48bb46 100644
--- a/engines/avalanche/celer.h
+++ b/engines/avalanche/celer.h
@@ -33,6 +33,7 @@
 #include "incline.h"
 #include "gyro.h"
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -77,4 +78,6 @@ EXTERN array<1,40,pointer> memory;
 
    void show_one_at(byte which, integer xxx,integer yyy);
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index 9a9718b..a109127 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -177,3 +178,5 @@ int main(int argc, const char* argv[])
  close(f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index f42bf31..985bbf0 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 struct infotype {
             matrix<128,255,1,8,byte> chars;
             string data;
@@ -51,4 +53,6 @@ int main(int argc, const char* argv[])
   output << NL;
  } }
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
index 46848da..4b7dd0e 100644
--- a/engines/avalanche/chunker.cpp
+++ b/engines/avalanche/chunker.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
 struct chunkblocktype {
@@ -106,4 +108,6 @@ int main(int argc, const char* argv[])
 
    close(f);
    return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index 44e1725..5118d7d 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 #include "cadburys.h"
 
+namespace Avalanche {
 
 /*type
  flavourtype = (ch_EGA,ch_BGI);
@@ -281,3 +282,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index ee79085..3b6caa7 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -214,3 +215,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index 26b3b49..ab27863 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -30,6 +30,7 @@
 /*#include "Crt.h"*/
 #include "cadburys.h"
 
+namespace Avalanche {
 
 /*type
  flavourtype = (ch_EGA,ch_BGI);
@@ -272,3 +273,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index 2083f5b..0ac2e1f 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -307,3 +308,5 @@ int main(int argc, const char* argv[])
  close_chunk();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index 9300c7b..c4041d6 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -266,3 +267,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index 3798e5c..b2c6cf4 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -273,3 +274,6 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index fc8da30..c1f189b 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index 30be845..97b9502 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -265,3 +266,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index 48f5bd2..ddf079c 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -259,3 +260,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index a574a04..b2faafe 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -262,3 +263,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 2ae8f85..5249e6c 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -260,3 +261,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index 292cc1a..4c2e58b 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index 270d253..efc94ac 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index ef42c8a..16e4aa1 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index eddbc2d..fa9224b 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index 0e980e6..cc43d7d 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -258,3 +259,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index bd303ad..9ebdbfa 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -259,3 +260,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index 52f3be1..3dd81b2 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -268,3 +269,5 @@ int main(int argc, const char* argv[])
  close_chunk();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 792c0b5..4c37792 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -259,3 +260,5 @@ int main(int argc, const char* argv[])
  close_chunk();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 86f4935..505c4fd 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi, last_flavourtype};
 
@@ -259,3 +260,5 @@ int main(int argc, const char* argv[])
  close_chunk();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index 7fdb52b..4091890 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -30,6 +30,7 @@
 /*#include "Crt.h"*/
 #include "cadburys.h"
 
+namespace Avalanche {
 
 void finder()
 {
@@ -149,3 +150,5 @@ int main(int argc, const char* argv[])
  close_chunk();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index ebdc85b..fb05ad5 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -29,6 +29,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 const integer xm = 511; const integer ym = 184;
 integer gd,gm;
 word oh,om,/*os,*/h,m,s,s1; char r;
@@ -81,4 +83,6 @@ int main(int argc, const char* argv[])
   oh=h; om=m;
  } while (!false);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 722ff37..bc3134b 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -43,6 +43,7 @@
 /*#include "Crt.h"*/
 #include "lucerna.h"
 
+namespace Avalanche {
 
 typedef array<1,3840,char> scrtype;
 
@@ -142,3 +143,5 @@ unit_closing_initialize::unit_closing_initialize() {;
  exitsave=exitproc;
  exitproc=&bug_handler;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index 3d33cd6..a4d539f 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -28,6 +28,7 @@
 #ifndef __closing_h__
 #define __closing_h__
 
+namespace Avalanche {
 
 const integer scr_bugalert = 1;
 const integer scr_ramcram = 2;
@@ -39,4 +40,6 @@ void quit_with(byte which,byte errorlev);
 
 void end_of_program();
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index d350f23..b8d986d 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 string fn1,fn2;
 varying_string<30> desc;
@@ -101,3 +103,5 @@ int main(int argc, const char* argv[])
  closegraph();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index 53147ca..97da69a 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -29,6 +29,7 @@
 /*#include "Binu.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
        /* ...gogogoch */struct cursor {
                           matrix<0,1,0,15,word> mask;
@@ -101,4 +102,6 @@ int main(int argc, const char* argv[])
  load();
  display();
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index 6d33127..b3db08e 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -30,6 +30,8 @@
 
 /*$R+*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 integer gd,gm;
@@ -110,3 +112,5 @@ int main(int argc, const char* argv[])
  close(t);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index be06790..0db15d5 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const char fn[] = "text3.scr";
 
@@ -56,3 +57,5 @@ int main(int argc, const char* argv[])
  gotoxy(1,25); textattr=31; clreol; gotoxy(1,24);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index c88d06a..5637401 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -48,6 +48,8 @@
 #include "enid.h"
 #include "basher.h"
 
+namespace Avalanche {
+
 /*$V-*/
 const integer indent = 5;
 const integer spacing = 10;
@@ -824,4 +826,4 @@ void menu_link()
  }
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
index ac22571..4eae898 100644
--- a/engines/avalanche/dropdown.h
+++ b/engines/avalanche/dropdown.h
@@ -28,6 +28,7 @@
 #ifndef __dropdown_h__
 #define __dropdown_h__
 
+namespace Avalanche {
 
 typedef void(*proc)();
 
@@ -118,4 +119,6 @@ EXTERN varying_string<5> people;
   void standard_bar();
   /*procedure map_bar;*/
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index 67dbdc7..450ee7b 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
@@ -42,3 +43,5 @@ int main(int argc, const char* argv[])
  for( gd=0; gd <= 15; gd ++) mem[0xa000*gd*80]=f['A'][gd];
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index 9907281..ab7b1b8 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
 const string ednaid = string("TT")+'\261'+'\36'+'\1'+'\113'+'\261'+'\231'+'\261';
 
@@ -107,3 +109,5 @@ int main(int argc, const char* argv[])
  output << "Number of saves: " << dna256[6] << NL;
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/edna.cpp b/engines/avalanche/edna.cpp
index 03d9c23..1c4d8d7 100644
--- a/engines/avalanche/edna.cpp
+++ b/engines/avalanche/edna.cpp
@@ -30,6 +30,7 @@
 /*#include "Dos.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
 
 struct ednahead { /* Edna header */
           /* This header starts at byte offset 177 in the .ASG file. */
@@ -359,4 +360,6 @@ int main(int argc, const char* argv[])
   if (info)  show_info();
   load_file();
   return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index 634ad63..212e6fe 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -38,6 +38,7 @@
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 boolean isenh()
 {
@@ -109,3 +110,5 @@ unit_enhanced_initialize::unit_enhanced_initialize() {;
  /* determine bios type */
  atbios=isenh();
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/enhanced.h b/engines/avalanche/enhanced.h
index c7031a2..c7bd48f 100644
--- a/engines/avalanche/enhanced.h
+++ b/engines/avalanche/enhanced.h
@@ -28,7 +28,7 @@
 #ifndef __enhanced_h__
 #define __enhanced_h__
 
-
+namespace Avalanche {
 
 #ifdef __enhanced_implementation__
 #undef EXTERN
@@ -46,4 +46,6 @@ void readkeye();
 
 boolean keypressede();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
index e6d9106..7305d94 100644
--- a/engines/avalanche/enid.cpp
+++ b/engines/avalanche/enid.cpp
@@ -50,6 +50,7 @@
 #include "fileunit.h"
 #include "basher.h"
 
+namespace Avalanche {
 
 const string crlf = string('\15')+'\12';
 const char tab = '\11';
@@ -603,4 +604,4 @@ boolean there_was_a_problem()
  return there_was_a_problem_result;
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
index ce9f5fd..d9f0a54 100644
--- a/engines/avalanche/enid.h
+++ b/engines/avalanche/enid.h
@@ -31,6 +31,7 @@
 
 #include "gyro.h"
 
+namespace Avalanche {
 
 void edna_save(string name);
 
@@ -46,4 +47,6 @@ void back_to_bootstrap(byte what);
 
 boolean there_was_a_problem();
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index 5fbc5b3..c96f445 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -33,6 +33,8 @@
 
 /*$V-*/
 
+namespace Avalanche {
+
 struct windowtype {
               integer x1,y1,x2,y2;
               varying_string<20> title;
@@ -813,3 +815,5 @@ int main(int argc, const char* argv[])
  input >> NL;
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index 26ab496..00c19ed 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -41,6 +41,8 @@
 
 /*$V-*/
 
+namespace Avalanche {
+
 struct windowtype {
               integer x1,y1,x2,y2;
               varying_string<20> title;
@@ -1140,4 +1142,4 @@ string do_filer()
  return do_filer_result;
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/fileunit.h b/engines/avalanche/fileunit.h
index ce7d07a..034d1e5 100644
--- a/engines/avalanche/fileunit.h
+++ b/engines/avalanche/fileunit.h
@@ -28,7 +28,10 @@
 #ifndef __fileunit_h__
 #define __fileunit_h__
 
+namespace Avalanche {
 
 string do_filer();        /* Result is filename, or "" if cancelled. */
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index a272107..51c9334 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -39,6 +39,7 @@
 
 /*#include "Gyro.h"*/
 
+namespace Avalanche {
 
 const array<1,12,varying_string<6> > months = 
  {{"Jan*","Feb*","March","April","May","June","July","August",
@@ -166,4 +167,6 @@ int main(int argc, const char* argv[])
   output << "Number of saves: " << e.saves << NL;
  }
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index 6d9fe75..4745d95 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -28,6 +28,7 @@
 /* Get 'em back! */
 #include "graph.h"
 
+namespace Avalanche {
 
 const integer picsize = 966;
 const integer number_of_objects = 19;
@@ -102,3 +103,5 @@ int main(int argc, const char* argv[])
  close(f); freemem(p,picsize);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 0d2a412..8955546 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 fonttype font1;
@@ -46,4 +48,6 @@ int main(int argc, const char* argv[])
  }
  assign(f,"v:avitalic.fnt"); rewrite(f); f << font1; close(f);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index 574fc8d..ddd622c 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 typedef array<1,31,byte> tunetype;
 
@@ -123,4 +124,6 @@ int main(int argc, const char* argv[])
 
  output << "*** PROGRAM STOPPED! ***" << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index b8dab28..c1e81e0 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -30,6 +30,8 @@
 
 /*$R+*/
 
+namespace Avalanche {
+
 const array<1,5,shortint> adjustment = {{7,0,7,7,7}};
 
 const array<0,3,byte> plane_to_use = {{2,2,2,3}};
@@ -435,3 +437,5 @@ int main(int argc, const char* argv[])
  closegraph();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index e5ad0d6..ec20034 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -28,6 +28,7 @@
 /*$I c:\sleep5\DSMI.INC*/ #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<255> song = 
 string("Golden slumbers kiss your eyes/Smiles awake you when you rise/")+
@@ -459,3 +460,5 @@ int main(int argc, const char* argv[])
   for( gd=320; gd >= 0; gd --) rectangle(320-gd,100-gd / 2,320+gd,100+gd / 2);
   return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index f4f82bb..651c55b 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -47,6 +47,7 @@
 #include "dropdown.h"
 #include "basher.h"
 
+namespace Avalanche {
 
 const array<'\1',numobjs,varying_string<15> > things = 
  {{"Wine","Money-bag","Bodkin","Potion","Chastity belt",
@@ -554,4 +555,4 @@ void super_on()
  if (super_was_virtual)  on_virtual(); else on();
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 22b8552..22d7544 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -33,6 +33,7 @@
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const char numobjs = '\22'; /* always preface with a # */
 const integer maxobjs = 12;  /* carry limit */
@@ -726,4 +727,6 @@ EXTERN word cxmin,cxmax,cymin,cymax; EXTERN boolean use_joy_a;
 
  boolean mouse_near_text();
 
-#endif
+ } // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index c53e4d8..70f7582 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -29,6 +29,8 @@
 /*#include "Rodent.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 typedef graphcursmasktype cursor;
 const char vernum[] = "v1ù00";
 const char copyright[] = "1992";
@@ -246,4 +248,6 @@ int main(int argc, const char* argv[])
   }
  } while (!lmo);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index fe9cbec..1fc41b6 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 struct hypertype {
@@ -266,3 +268,5 @@ int main(int argc, const char* argv[])
  } while (!false);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/helpbak.cpp b/engines/avalanche/helpbak.cpp
index 1a7138b..b5513f3 100644
--- a/engines/avalanche/helpbak.cpp
+++ b/engines/avalanche/helpbak.cpp
@@ -41,6 +41,7 @@
 /*#include "Crt.h"*/
 /*#include "Lucerna.h"*/
 
+namespace Avalanche {
 
 struct buttontype {
              char trigger;
@@ -184,3 +185,4 @@ void boot_help()
  dawn;
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/helpbak.h b/engines/avalanche/helpbak.h
index 3d8f5d8..4025aa8 100644
--- a/engines/avalanche/helpbak.h
+++ b/engines/avalanche/helpbak.h
@@ -32,7 +32,10 @@
 #include "graph.h"
 /*#include "Gyro.h"*/
 
+namespace Avalanche {
 
 void boot_help();
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index ad489a8..397c63f 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -42,6 +42,7 @@
 /*#include "Lucerna.h"*/
 /*#include "Pingo.h"*/
 
+namespace Avalanche {
 
 struct buttontype {
              char trigger;
@@ -305,3 +306,4 @@ void boot_help()
  setactivepage(1-cp);
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/helper.h b/engines/avalanche/helper.h
index 22c6b06..bc4afbd 100644
--- a/engines/avalanche/helper.h
+++ b/engines/avalanche/helper.h
@@ -28,6 +28,7 @@
 #ifndef __helper_h__
 #define __helper_h__
 
+namespace Avalanche {
 
 #include "graph.h"
 /*#include "Gyro.h"*/
@@ -35,4 +36,6 @@
 
 void boot_help();
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index dc3d0ab..fbdc662 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 file<char> inf,outf;
 char x;
 string q;
@@ -48,4 +50,6 @@ int main(int argc, const char* argv[])
  }
  close(inf); close(outf);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 419eb38..bb4909b 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -41,6 +41,7 @@
 /*#include "Gyro.h"*/
 /*#include "Scrolls.h"*/
 
+namespace Avalanche {
 
 typedef array<1,12,struct A1 {
                                  varying_string<30> name;
@@ -138,4 +139,6 @@ static unit_highs_initialize highs_constructor;
 
 unit_highs_initialize::unit_highs_initialize() {;
  get_highs();
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/highs.h b/engines/avalanche/highs.h
index f147c05..a4937cb 100644
--- a/engines/avalanche/highs.h
+++ b/engines/avalanche/highs.h
@@ -28,9 +28,12 @@
 #ifndef __highs_h__
 #define __highs_h__
 
+namespace Avalanche {
 
   void show_highs();
 
   void store_high(string who);
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index cb0a627..f5f106e 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -32,6 +32,7 @@
 /*#include "Dos.h"*/
 /*#include "Tsru.h"*/
 
+namespace Avalanche {
 
     /* program's signature */
 const varying_string<20> tsr_tmark = "FISH FISH FISH!!!";
@@ -309,3 +310,5 @@ int main(int argc, const char* argv[])
  keep(0);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/incline.cpp b/engines/avalanche/incline.cpp
index f6d7926..32dad74 100644
--- a/engines/avalanche/incline.cpp
+++ b/engines/avalanche/incline.cpp
@@ -40,6 +40,7 @@
 #include "gyro.h"
 #include "logger.h"
 
+namespace Avalanche {
 
 byte fv;
 char t;
@@ -195,3 +196,5 @@ unit_incline_initialize::unit_incline_initialize() {
 
  check_slope_line();
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index 342f3ef..e6ebcfb 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 struct inirex {
           varying_string<12> a;
           word num;
@@ -53,4 +55,6 @@ int main(int argc, const char* argv[])
  close(i); close(o);
  output << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index 4400fa5..c24a933 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 integer gd,gm;
@@ -69,3 +71,5 @@ int main(int argc, const char* argv[])
  } while (!false);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index 854db43..010e024 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -30,6 +30,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
  /* This is a stand-alone program. */
 
 /* 0, black, remains 0.
@@ -618,3 +620,5 @@ int main(int argc, const char* argv[])
  graphmode(3);
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index 0d96688..a14ee55 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -28,6 +28,8 @@
 /* Avalot interrupt handler */
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 /*$F+*/
 registers r;
 void() old1b;
@@ -52,3 +54,5 @@ int main(int argc, const char* argv[])
  until false;*/
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index 4326ac8..1ebbc4f 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -30,6 +30,7 @@
 /*#include "Joystick.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 struct joysetup {
             word xmid,ymid,xmin,ymin,xmax,ymax;
@@ -119,4 +120,6 @@ int main(int argc, const char* argv[])
  assign(jf,"v:joytmp.dat");
  rewrite(jf); jf << js; close(jf);     /* write it all out to disk. */
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index b18fdd0..8ebea36 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -27,7 +27,6 @@
 
 #define __joystick_implementation__
 
-
 /*
 Copyright (c) 1989, 1990 David B. Howorth
 
@@ -60,6 +59,7 @@ Hill Road, Portland, Oregon 97219.
 
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 typedef void(*readjoyproc)(byte a,byte b,word& c,word& d);
 typedef boolean(*buttonfunc)(byte a);
@@ -206,3 +206,5 @@ unit_joystick_initialize::unit_joystick_initialize() {
            button = oldbutton;
          }
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/joystick.h b/engines/avalanche/joystick.h
index 8a1bcf1..2cbcd3c 100644
--- a/engines/avalanche/joystick.h
+++ b/engines/avalanche/joystick.h
@@ -28,6 +28,7 @@
 #ifndef __joystick_h__
 #define __joystick_h__
 
+namespace Avalanche {
 
 void readjoya(word& xaxis, word& yaxis);
 /* Reads the X and Y coordinates of Joystick A. */
@@ -46,4 +47,6 @@ boolean buttonb2();
 boolean joystickpresent();
 /* This function indicates whether a joystick is installed. */
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index a53e3ed..3f161ed 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 byte a /*absolute $A000:1200*/;
 byte bit;
@@ -45,3 +47,5 @@ int main(int argc, const char* argv[])
  close(f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index 4d14e3c..7da976d 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -41,6 +41,7 @@
 /*#include "Gyro.h"*/
 /*#include "Trip5.h"*/
 
+namespace Avalanche {
 
 const char divide[] = "--- oOo ---";
 
@@ -232,4 +233,4 @@ void log_score(word credit,word now)
  output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/logger.h b/engines/avalanche/logger.h
index b068f20..94cd938 100644
--- a/engines/avalanche/logger.h
+++ b/engines/avalanche/logger.h
@@ -28,6 +28,7 @@
 #ifndef __logger_h__
 #define __logger_h__
 
+namespace Avalanche {
 
 void log_setup(string name, boolean printing);
 
@@ -57,4 +58,6 @@ void log_aside(string what);
 
 void log_score(word credit,word now);
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 9ef67fd..19466f4 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -54,6 +54,7 @@
 #include "basher.h"
 #include "sequence.h"
 
+namespace Avalanche {
 
 /*$V-*/ /*$S-*/
 boolean fxhidden; array<0,3,palettetype> fxpal;
@@ -1512,3 +1513,5 @@ unit_lucerna_initialize::unit_lucerna_initialize() {
  fxhidden=false; oh=17717; om=17717;
  if (atbios)  atkey="f1"; else atkey="alt-";
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
index f40364a..5bf0782 100644
--- a/engines/avalanche/lucerna.h
+++ b/engines/avalanche/lucerna.h
@@ -28,6 +28,7 @@
 #ifndef __lucerna_h__
 #define __lucerna_h__
 
+namespace Avalanche {
 
 #include "gyro.h"
 
@@ -100,4 +101,6 @@
 
  void fix_flashers();
 
-#endif
+ } // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index e1729f7..130e188 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 const longint pagetop = 81920;
 const word nextcode = 17717;
@@ -59,3 +60,5 @@ int main(int argc, const char* argv[])
  close(magic); close(out);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 139f216..241f692 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const word nextcode = 17717;
 
@@ -56,3 +57,5 @@ int main(int argc, const char* argv[])
 /* close(magic);*/
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 0fdb829..6706ceb 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -28,6 +28,7 @@
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const word nextcode = 17717;
 
@@ -82,3 +83,5 @@ int main(int argc, const char* argv[])
  } while (!keypressed());
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index 32d8a6c..353b461 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -28,6 +28,8 @@
 /* Phew! */
 #include "graph.h"
 
+namespace Avalanche {
+
 /*$S-*/
 integer gd,gm;
 untyped_file f;
@@ -85,3 +87,5 @@ int main(int argc, const char* argv[])
  close(t);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index 89b66d7..35b37d2 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -27,6 +27,8 @@
 
 /* regname's name starts at $7D1 (2001). */
 
+namespace Avalanche {
+
 const array<1,56,char> padding = 
 "For all the Etruscan armies were ranged beneath his eye";
 
@@ -164,4 +166,6 @@ int main(int argc, const char* argv[])
 
  close(txi); close(txo);
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index cfb9974..3c46e18 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 struct sezheader {
              array<1,2,char> initials;     /* should be "TT" */
              word gamecode;
@@ -67,4 +69,7 @@ int main(int argc, const char* argv[])
  blockwrite(sez,x[1],39); /* footer */
  close(sez);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index 7d3c5f3..9f509f1 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -30,6 +30,7 @@
 /*#include "Crt.h"*/
 
 /*$R+*/
+namespace Avalanche {
 
 struct mp { /* mouse-pointer */
       matrix<0,1,0,15,word> mask;
@@ -292,3 +293,5 @@ int main(int argc, const char* argv[])
  show_off_mouse;*/
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/menuxf.cpp b/engines/avalanche/menuxf.cpp
index be0920e..17fa553 100644
--- a/engines/avalanche/menuxf.cpp
+++ b/engines/avalanche/menuxf.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 
 void load()     /* Load2, actually */
@@ -70,3 +72,5 @@ int main(int argc, const char* argv[])
  save();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index d404c60..38608c8 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 pointer p; word s;
 
@@ -59,3 +61,5 @@ int main(int argc, const char* argv[])
  putimage(fx1+100,fy1,p,0); freemem(p,s);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index 095fc40..e18c0be 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const string crlf = string('\15')+'\12'; const char eof_ = '\32';
 const array<1,177,char> trip5head = 
@@ -145,4 +146,6 @@ int main(int argc, const char* argv[])
  blockwrite(out,trip5foot,50);
  close(out);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index a81dfc6..86dd2b2 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -29,6 +29,7 @@
 /*#include "Crt.h"*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 const array<false,true,varying_string<7> > names = {{"Avalot","Dogfood"}};
 
@@ -403,3 +404,5 @@ int main(int argc, const char* argv[])
  endofgame(); /* Winning sequence is A1, B3, B1, C1, C1, btw. */
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index 45b1c68..a81d69f 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 const string header = string("Datafile for Avalot, copyright (c) 1992.")+'\32';
 
@@ -116,3 +117,5 @@ int main(int argc, const char* argv[])
  close(f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/nimunit.cpp b/engines/avalanche/nimunit.cpp
index e2d5f6f..cfec877 100644
--- a/engines/avalanche/nimunit.cpp
+++ b/engines/avalanche/nimunit.cpp
@@ -37,6 +37,7 @@
 
 #include "nimunit.h"
 
+namespace Avalanche {
 
 const array<false,true,varying_string<7> > names = {{"Avalot","Dogfood"}};
 
@@ -466,3 +467,5 @@ void play_nim()     /* Plays the game. Only procedure in this unit to
 }
 
      /* No init part. */
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/nimunit.h b/engines/avalanche/nimunit.h
index 4b5f79b..8919b1a 100644
--- a/engines/avalanche/nimunit.h
+++ b/engines/avalanche/nimunit.h
@@ -28,7 +28,6 @@
 #ifndef __nimunit_h__
 #define __nimunit_h__
 
-
 #include "gyro.h"
   #include "Graph.h"
   /*#include "Crt.h"*/
@@ -38,8 +37,10 @@
 #include "logger.h"
 #include "celer.h"
 
+namespace Avalanche {
 
   void play_nim();
 
+} // End of namespace Avalanche.
 
 #endif
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index f802026..c813f37 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -31,6 +31,7 @@
 /*#include "Rodent.h"*/
 
 /*$V-*/
+namespace Avalanche {
 
 const char more[] = " (more) ";
 const string up = string('-')+'\30'+more+'\30';
@@ -280,5 +281,4 @@ int main(int argc, const char* argv[])
 return EXIT_SUCCESS;
 }
 
-
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index 5fa205c..eaee8eb 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 struct scoretype {
              varying_string<39> name;
@@ -270,4 +271,6 @@ int main(int argc, const char* argv[])
  newtable();
  newscore(/*177*/0);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index c627407..a364cbc 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -40,6 +40,7 @@
 #include "gyro.h"
 #include "logger.h"
 
+namespace Avalanche {
 
 const integer bug_twonames = 255;
 const integer bug_pandl = 254;
@@ -272,3 +273,5 @@ unit_incline_initialize::unit_incline_initialize() {;
  for( fv=4; fv <= paramcount; fv ++)
   parse(paramstr(fv));
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index e7df00f..9a3476e 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -42,6 +42,7 @@
 /*#include "Gyro.h"*/
 /*#include "Dropdown.h"*/
 
+namespace Avalanche {
 
 void copier(integer x1,integer y1,integer x2,integer y2,integer x3,integer y3,integer x4,integer y4);
 
@@ -471,3 +472,4 @@ boolean neardoor_result;
 return neardoor_result;
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oldtrip.h b/engines/avalanche/oldtrip.h
index 7a5e402..70782ee 100644
--- a/engines/avalanche/oldtrip.h
+++ b/engines/avalanche/oldtrip.h
@@ -32,6 +32,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const integer maxgetset = 10;
 
@@ -118,5 +119,6 @@ EXTERN array<1,numtr,triptype> tr;
 #undef EXTERN
 #define EXTERN extern
 
+} // End of namespace Avalanche.
 
-#endif
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index 0209619..c102b3f 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -31,6 +31,8 @@
 /*#include "Crt.h"*/
 /*#include "Enhanced.h"*/
 
+namespace Avalanche {
+
 varying_string<5> st;
 byte fv;
 
@@ -198,4 +200,6 @@ int main(int argc, const char* argv[])
   }
  } while (!false);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index 9f8445b..2d8ae42 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -36,6 +36,7 @@
 /*#include "Rodent.h"*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 const integer indent = 40;
 const integer spacing = 83;
@@ -318,3 +319,4 @@ void parsekey(char r,char re)
   }
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/oopmenu.h b/engines/avalanche/oopmenu.h
index 4ac4efb..32f171e 100644
--- a/engines/avalanche/oopmenu.h
+++ b/engines/avalanche/oopmenu.h
@@ -28,6 +28,7 @@
 #ifndef __oopmenu_h__
 #define __oopmenu_h__
 
+namespace Avalanche {
 
 typedef void(*proc)();
 
@@ -106,4 +107,6 @@ EXTERN string kbuffer;
 
   void parsekey(char r,char re);
 
+} // End of namespace Avalanche.
+
 #endif
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index d68a292..14d5dc8 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 
 void flash(integer x1,integer y1,integer x2,integer y2)
@@ -74,4 +76,6 @@ int main(int argc, const char* argv[])
  test(100,50,200,100,120, 70,220,120);
  test(100,50,200,100,150, 50,250,100);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index 307b9e2..9617e2e 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 int main(int argc, const char* argv[])
 {pio_initialize(argc, argv);
@@ -75,3 +77,5 @@ int main(int argc, const char* argv[])
  end;*/
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index ef1141e..bcccdb9 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -30,6 +30,8 @@
 
 /*$R+*/
 
+namespace Avalanche {
+
 typedef matrix<'\0','\377',0,15,byte> fonttype;
 
 struct markertype {
@@ -255,3 +257,5 @@ int main(int argc, const char* argv[])
  } while (!ok);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index c2a05ae..cbc8474 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 const integer picsize = 966;
 
@@ -87,3 +88,5 @@ int main(int argc, const char* argv[])
  save();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index 39087b1..f0ebccd 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -28,6 +28,7 @@
 /* Get 'em back! */
 #include "graph.h"
 
+namespace Avalanche {
 
 const integer picsize = 966;
 const integer number_of_objects = 17;
@@ -87,3 +88,5 @@ int main(int argc, const char* argv[])
  close(f); freemem(p,picsize);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 6b0f490..2c68a8c 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -45,6 +45,7 @@
 #include "trip5.h"
 #include "scrolls.h"
 
+namespace Avalanche {
 
 void dplot(integer x,integer y, string z)
 {;
@@ -251,4 +252,4 @@ void winning_pic()
  major_redraw();
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index 71af98e..2bda478 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -28,6 +28,7 @@
 #ifndef __pingo_h__
 #define __pingo_h__
 
+namespace Avalanche {
 
 void bosskey();
 
@@ -43,4 +44,6 @@ void zonk();
 
 void winning_pic();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index 799f1f1..909088c 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm; byte fv;
 matrix<1,35,0,39,byte> a;
 array<0,3,0,4,1,35,byte> b;
@@ -64,3 +66,5 @@ int main(int argc, const char* argv[])
   }
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index f76486d..8611277 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 array<0,3,palettetype> fxpal;
 
@@ -144,3 +145,5 @@ int main(int argc, const char* argv[])
  closegraph();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index b3e2eb6..22e6f3f 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -29,6 +29,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
  /* This is a stand-alone program. */
 
 /* 0, black, remains 0.
@@ -299,3 +301,5 @@ int main(int argc, const char* argv[])
  graphmode(3);
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index 2ed399d..d512838 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -31,6 +31,8 @@
 /*#include "Rodent.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 
 typedef matrix<'\0','\377',0,15,byte> fonttype;
@@ -260,3 +262,5 @@ int main(int argc, const char* argv[])
  bigo2go();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index 6d8a300..4f2a5f7 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -28,6 +28,8 @@
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 searchrec s;
 string x,y;
 longint hash_time,s_time;
@@ -92,4 +94,6 @@ int main(int argc, const char* argv[])
   findnext(s);
  }
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index 76cfc77..b55d45a 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 struct markertype {
               word length;
               longint offset;
@@ -100,4 +102,6 @@ int main(int argc, const char* argv[])
  }
  close(f);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index 7a2cbac..0458acb 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 const array<1,36,char> letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
 varying_string<30> name;
 varying_string<5> number;
@@ -112,4 +114,6 @@ int main(int argc, const char* argv[])
  negate();
  output << "Or, negated, = " << name << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index cc11935..e3369db 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -45,6 +45,8 @@
 /*$L v:MOD-obj.OBJ*/ 	        /* Link in Object file */
 /*$F+*/ 				/* force calls to be 'far'*/
 
+namespace Avalanche {
+
 extern void modvolume(integer v1,integer v2,integer v3,integer v4);  /*Can do while playing*/
 extern void moddevice(integer& device); 
 extern void modsetup(integer& status,integer device,integer mixspeed,integer pro,integer loop,string& stri); 
@@ -74,4 +76,4 @@ void sb_link()     /* At the moment, this does nothing. */
 {;
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sackb1.h b/engines/avalanche/sackb1.h
index e226946..c660c36 100644
--- a/engines/avalanche/sackb1.h
+++ b/engines/avalanche/sackb1.h
@@ -31,6 +31,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 void sb_start(string md);
 
@@ -38,4 +39,6 @@ void sb_stop();
 
 void sb_link();    /* At the moment, this does nothing. */
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/sackb3.cpp b/engines/avalanche/sackb3.cpp
index 60a259c..0abca98 100644
--- a/engines/avalanche/sackb3.cpp
+++ b/engines/avalanche/sackb3.cpp
@@ -32,6 +32,7 @@
 
 /*#include "SBVoice.h"*/
 
+namespace Avalanche {
 
 int main(int argc, const char* argv[])
 {
@@ -46,3 +47,5 @@ if (paramcount>0)  {
     output << "Usage: DEMO [d:\\path\\]filename.voc" << NL;
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sackblas.cpp b/engines/avalanche/sackblas.cpp
index e3261d7..9cec14d 100644
--- a/engines/avalanche/sackblas.cpp
+++ b/engines/avalanche/sackblas.cpp
@@ -23,5 +23,4 @@
 /*
  * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
+ */
\ No newline at end of file
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index fce157e..5385a6c 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 byte a /*absolute $A000:(15*80)*/;
 byte bit;
@@ -70,3 +72,5 @@ int main(int argc, const char* argv[])
  close(f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_1.cpp b/engines/avalanche/scr_1.cpp
index 5a9d55d..6228bf8 100644
--- a/engines/avalanche/scr_1.cpp
+++ b/engines/avalanche/scr_1.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<4> codes = " ßÜÛ";
 
@@ -111,3 +112,5 @@ int main(int argc, const char* argv[])
  save();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_2.cpp b/engines/avalanche/scr_2.cpp
index 2d5a78c..6cb6fca 100644
--- a/engines/avalanche/scr_2.cpp
+++ b/engines/avalanche/scr_2.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<4> codes = " ßÜÛ";
 
@@ -135,3 +136,5 @@ int main(int argc, const char* argv[])
  save();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_3.cpp b/engines/avalanche/scr_3.cpp
index 0e4ff0d..b71353c 100644
--- a/engines/avalanche/scr_3.cpp
+++ b/engines/avalanche/scr_3.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<4> codes = " ßÜÛ";
 
@@ -115,3 +116,5 @@ int main(int argc, const char* argv[])
  save();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_4.cpp b/engines/avalanche/scr_4.cpp
index 44099e1..7f5cb6a 100644
--- a/engines/avalanche/scr_4.cpp
+++ b/engines/avalanche/scr_4.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<4> codes = " ÞÝÛ";
 
@@ -110,4 +111,6 @@ int main(int argc, const char* argv[])
  textattr=30; centre(12,"Well done!");
  textattr=27; centre(14,"You completed the game!");
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_5.cpp b/engines/avalanche/scr_5.cpp
index 8268631..5a4aa12 100644
--- a/engines/avalanche/scr_5.cpp
+++ b/engines/avalanche/scr_5.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const varying_string<4> codes = " ßÜÛ";
 
@@ -115,3 +116,5 @@ int main(int argc, const char* argv[])
  save();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scr_9.cpp b/engines/avalanche/scr_9.cpp
index 2dac08c..1fb4942 100644
--- a/engines/avalanche/scr_9.cpp
+++ b/engines/avalanche/scr_9.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 text t;
 string x;
 byte fv;
@@ -43,3 +45,5 @@ int main(int argc, const char* argv[])
  gotoxy(1,23); clreol;
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 7bf6c6d..c109624 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -50,6 +50,7 @@
 #include "visa.h"
 #include "timeout.h"
 
+namespace Avalanche {
 
 const integer roman = 0;
 const integer italic = 1;
@@ -804,3 +805,5 @@ unit_scrolls_initialize::unit_scrolls_initialize() {
  loadfont();
  resetscrolldriver();
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/scrolls.h b/engines/avalanche/scrolls.h
index d20d361..a22cfb7 100644
--- a/engines/avalanche/scrolls.h
+++ b/engines/avalanche/scrolls.h
@@ -32,6 +32,7 @@
 #include "gyro.h"
 #include "joystick.h"
 
+namespace Avalanche {
 
 const boolean aboutscroll = false; /* Is this the about box? */
 
@@ -57,4 +58,6 @@ void okay();    /* Says "Okay!" */
 
 void musical_scroll();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 243caf4..cf1cb0a 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -43,6 +43,7 @@
 /*#include "Celer.h"*/
 /*#include "Trip5.h"*/
 
+namespace Avalanche {
 
 void then_show(byte what)
 {
@@ -115,3 +116,4 @@ void call_sequencer()
  start_to_close(); /* Make sure this proc gets called again. */
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 86d2d89..2d773ca 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -28,6 +28,7 @@
 #ifndef __sequence_h__
 #define __sequence_h__
 
+namespace Avalanche {
 
 const integer now_flip = 177;
 
@@ -56,4 +57,6 @@ void start_to_open();
 
 void call_sequencer();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/setup.cpp b/engines/avalanche/setup.cpp
index 1416a51..245a119 100644
--- a/engines/avalanche/setup.cpp
+++ b/engines/avalanche/setup.cpp
@@ -29,6 +29,7 @@
 /*#include "Tommys.h"*/
 #include "joystick.h"
 
+namespace Avalanche {
 
 const integer selected = 0x60; /* Background for selected lines of text. */
 
@@ -1290,3 +1291,5 @@ int main(int argc, const char* argv[])
  clear_up();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/seu.cpp b/engines/avalanche/seu.cpp
index 9e8f4aa..883a810 100644
--- a/engines/avalanche/seu.cpp
+++ b/engines/avalanche/seu.cpp
@@ -30,6 +30,7 @@
 /*#include "Crt.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
 
 const integer msize = 100;
 const integer flag = -20047;
@@ -999,3 +1000,5 @@ int main(int argc, const char* argv[])
  mem[storage_seg*storage_ofs]=score;
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/seu_avvy.cpp b/engines/avalanche/seu_avvy.cpp
index 206c844..479f8c1 100644
--- a/engines/avalanche/seu_avvy.cpp
+++ b/engines/avalanche/seu_avvy.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 struct adxtype {
            varying_string<12> name; /* name of character */
@@ -111,4 +112,6 @@ int main(int argc, const char* argv[])
  close(sf);
  close(outfile);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sezedit.cpp b/engines/avalanche/sezedit.cpp
index d9f0e48..4ec0bf3 100644
--- a/engines/avalanche/sezedit.cpp
+++ b/engines/avalanche/sezedit.cpp
@@ -29,6 +29,7 @@
 /*#include "Crt.h"*/
 #include "graph.h"
 
+namespace Avalanche {
 
 const char marker = '\33';
 const char game[] = "Avalot";
@@ -428,3 +429,5 @@ int main(int argc, const char* argv[])
  general();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sezunit.cpp b/engines/avalanche/sezunit.cpp
index c98e6f8..e9dda13 100644
--- a/engines/avalanche/sezunit.cpp
+++ b/engines/avalanche/sezunit.cpp
@@ -30,6 +30,7 @@
 
 #include "sezunit.h"
 
+namespace Avalanche {
 
 struct markertype {
               word length;
@@ -99,3 +100,4 @@ void getchain(longint number)
  sezerror=sezok;  /* nowt went wrong */
 }
 
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sezunit.h b/engines/avalanche/sezunit.h
index 76feb66..fa1f750 100644
--- a/engines/avalanche/sezunit.h
+++ b/engines/avalanche/sezunit.h
@@ -31,6 +31,7 @@
 
 /*#include "Gyro.h"*/
 
+namespace Avalanche {
 
 struct sezheader {
              array<1,2,char> initials;     /* should be "TT" */
@@ -65,5 +66,6 @@ void sez_setup();
 
 void getchain(longint number);
 
+} // End of namespace Avalanche.
 
-#endif
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/sezxfr.cpp b/engines/avalanche/sezxfr.cpp
index 7ae6cec..3c2cff6 100644
--- a/engines/avalanche/sezxfr.cpp
+++ b/engines/avalanche/sezxfr.cpp
@@ -27,6 +27,9 @@
 
 /*#include "Crt.h"*/
  /*$V-*/
+
+namespace Avalanche {
+
 text t;
 string x;
 matrix<1,100,1,2,string> data;
@@ -116,4 +119,6 @@ int main(int argc, const char* argv[])
 
  /* Done! */
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/shell1.cpp b/engines/avalanche/shell1.cpp
index 5d6e2c9..1618174 100644
--- a/engines/avalanche/shell1.cpp
+++ b/engines/avalanche/shell1.cpp
@@ -28,6 +28,8 @@
 /*$M $800,0,0*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 struct infotype {
             matrix<128,255,1,8,byte> chars;
             string data;
@@ -57,4 +59,6 @@ int main(int argc, const char* argv[])
  swapvectors;
  setintvec(0x1f,where);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/shell2.cpp b/engines/avalanche/shell2.cpp
index cd6fec2..1bc68df 100644
--- a/engines/avalanche/shell2.cpp
+++ b/engines/avalanche/shell2.cpp
@@ -28,6 +28,8 @@
 /*#include "Dos.h"*/
 #include "graph.h"
 
+namespace Avalanche {
+
 struct infotype {
             matrix<128,255,1,8,byte> chars;
             string data;
@@ -47,4 +49,6 @@ int main(int argc, const char* argv[])
  output << "Press Enter..." << NL;
  input >> NL; closegraph();
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/slope.cpp b/engines/avalanche/slope.cpp
index 83bb1d7..54ab3d0 100644
--- a/engines/avalanche/slope.cpp
+++ b/engines/avalanche/slope.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+namespace Avalanche {
+
 struct joysetup {
             word xmid,ymid,xmin,ymin,xmax,ymax;
             byte centre; /* Size of centre in tenths */
@@ -370,3 +372,5 @@ int main(int argc, const char* argv[])
  store_slopeline();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/spread.cpp b/engines/avalanche/spread.cpp
index 3ee7134..acc9535 100644
--- a/engines/avalanche/spread.cpp
+++ b/engines/avalanche/spread.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 struct adxtype {
            varying_string<12> name; /* name of character */
@@ -327,4 +328,6 @@ int main(int argc, const char* argv[])
   pickone();
  } while (!false);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/spread2.cpp b/engines/avalanche/spread2.cpp
index 5a42427..6fa2159 100644
--- a/engines/avalanche/spread2.cpp
+++ b/engines/avalanche/spread2.cpp
@@ -31,6 +31,8 @@
 
 /*$V-,R+*/
 
+namespace Avalanche {
+
 const integer pattern = 12; /* Pattern for transparencies. */
 const fillpatterntype grey50 = {{0xaa, 0x55, 0xaa,
  0x55, 0xaa, 0x55, 0xaa, 0x55}};
@@ -876,4 +878,6 @@ int main(int argc, const char* argv[])
   }
  } while (!false);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/squish.cpp b/engines/avalanche/squish.cpp
index d9077ed..231aae2 100644
--- a/engines/avalanche/squish.cpp
+++ b/engines/avalanche/squish.cpp
@@ -33,6 +33,8 @@
 /*                                                                          */
 /*--------------------------------------------------------------------------*/
 
+namespace Avalanche {
+
 const integer maxbuff = 8192    /* Buffer size for input and output files */;
 const integer maxtab = 4095     /* Table size - 1 ==> 2**10-1 ==> 12 bits */;
 const integer no_prev = 0x7fff  /* Special code for no previous character */;
@@ -476,3 +478,5 @@ int main(int argc, const char* argv[])
 
    return EXIT_SUCCESS;
 }     /* PibCompr */
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/ss_blank.cpp b/engines/avalanche/ss_blank.cpp
index 7e97654..907c09f 100644
--- a/engines/avalanche/ss_blank.cpp
+++ b/engines/avalanche/ss_blank.cpp
@@ -28,6 +28,8 @@
 /*#include "Dos.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 byte fv;
 boolean test;
 
@@ -59,4 +61,6 @@ int main(int argc, const char* argv[])
  output << NL;
  output << "Have fun!" << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/ss_clock.cpp b/engines/avalanche/ss_clock.cpp
index ae466bc..b735765 100644
--- a/engines/avalanche/ss_clock.cpp
+++ b/engines/avalanche/ss_clock.cpp
@@ -30,6 +30,7 @@
 #include "graph.h"
 /*#include "Drivers.h"*/
 
+namespace Avalanche {
 
 const integer width = 88;
 const integer height = 8; /* width & height of string returned by "time" */
@@ -105,4 +106,6 @@ int main(int argc, const char* argv[])
  output << NL;
  output << "Have fun!" << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/stars.cpp b/engines/avalanche/stars.cpp
index d6bc8ef..aaeada2 100644
--- a/engines/avalanche/stars.cpp
+++ b/engines/avalanche/stars.cpp
@@ -32,6 +32,8 @@
 /*#include "Rodent.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 
 typedef matrix<'\0','\377',0,15,byte> fonttype;
@@ -585,3 +587,5 @@ int main(int argc, const char* argv[])
  closegraph();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/status.cpp b/engines/avalanche/status.cpp
index c8931e6..f9c5ddb 100644
--- a/engines/avalanche/status.cpp
+++ b/engines/avalanche/status.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer gd,gm;
 
 void data(integer y, string a,string b)
@@ -55,4 +57,6 @@ int main(int argc, const char* argv[])
  data(177,"Bios/keyboard","AT (enhanced)"); /* or XT (bog standard) */
  data(187,"Display","VGA");
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sticks.cpp b/engines/avalanche/sticks.cpp
index 0e18be0..840ca27 100644
--- a/engines/avalanche/sticks.cpp
+++ b/engines/avalanche/sticks.cpp
@@ -37,6 +37,7 @@
 
 #include "sticks.h"
 
+namespace Avalanche {
 
 enum lmc {l,m,r, last_lmc}; /* Left, middle & right */
 
@@ -112,4 +113,6 @@ void joykeys()
  }
 }
 
-     /* No init code. */
\ No newline at end of file
+     /* No init code. */
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sticks.h b/engines/avalanche/sticks.h
index 24f59c4..c9235c0 100644
--- a/engines/avalanche/sticks.h
+++ b/engines/avalanche/sticks.h
@@ -34,7 +34,11 @@
 /*#include "Gyro.h"*/
      /* for solidarity */
 
+namespace Avalanche {
+
 byte joyway();
 void joykeys();
 
 #endif
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/sunrise.cpp b/engines/avalanche/sunrise.cpp
index d512892..a5c6b28 100644
--- a/engines/avalanche/sunrise.cpp
+++ b/engines/avalanche/sunrise.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 longint tskellern /*absolute $0:244*/; /* Over int $61 */
 
@@ -79,3 +81,5 @@ int main(int argc, const char* argv[])
  }
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/tempo.cpp b/engines/avalanche/tempo.cpp
index 908e762..21ee150 100644
--- a/engines/avalanche/tempo.cpp
+++ b/engines/avalanche/tempo.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 enum flavourtype {ch_ega,ch_bgi,ch_natural,ch_two,ch_one, last_flavourtype};
 
@@ -99,3 +100,5 @@ int main(int argc, const char* argv[])
  choose();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/test.cpp b/engines/avalanche/test.cpp
index ead8a37..22e49d0 100644
--- a/engines/avalanche/test.cpp
+++ b/engines/avalanche/test.cpp
@@ -28,6 +28,8 @@
 /*$M 2048,0,0*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 const array<1,22,char> signature = string("*AVALOT* v1.00 ±tt± ")+'\3'+'\0';
 pointer saveint1f;
 int main(int argc, const char* argv[])
@@ -41,3 +43,5 @@ int main(int argc, const char* argv[])
  setintvec(0x1f,saveint1f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/test2.cpp b/engines/avalanche/test2.cpp
index 0001ac0..7efe64e 100644
--- a/engines/avalanche/test2.cpp
+++ b/engines/avalanche/test2.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 const array<1,22,char> signature = string("*AVALOT* v1.00 ±tt± ")+'\3'+'\0';
 pointer getint1f;
 array<1,22,char> x;
@@ -38,4 +40,6 @@ int main(int argc, const char* argv[])
  if (x==signature) 
   output << "Signature found." << NL; else output << "Signature NOT found!" << NL;
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/testblit.cpp b/engines/avalanche/testblit.cpp
index 4154dcb..5fe1e3a 100644
--- a/engines/avalanche/testblit.cpp
+++ b/engines/avalanche/testblit.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 const integer ttp = 81920;
 const integer borland = xorput;
@@ -71,3 +72,5 @@ int main(int argc, const char* argv[])
  mblit();
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/testcard.cpp b/engines/avalanche/testcard.cpp
index 3a3fba5..f435df0 100644
--- a/engines/avalanche/testcard.cpp
+++ b/engines/avalanche/testcard.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Dos.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 string filename;
 
@@ -78,3 +80,5 @@ int main(int argc, const char* argv[])
  close(f);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/testenh.cpp b/engines/avalanche/testenh.cpp
index b304a57..86b01b5 100644
--- a/engines/avalanche/testenh.cpp
+++ b/engines/avalanche/testenh.cpp
@@ -27,6 +27,8 @@
 
 /*#include "Enhanced.h"*/
 
+namespace Avalanche {
+
 int main(int argc, const char* argv[])
 {pio_initialize(argc, argv);
 ;
@@ -39,4 +41,6 @@ int main(int argc, const char* argv[])
   }
  } while (!(inchar=='\33'));
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/timeout.cpp b/engines/avalanche/timeout.cpp
index 073d415..2c83104 100644
--- a/engines/avalanche/timeout.cpp
+++ b/engines/avalanche/timeout.cpp
@@ -47,6 +47,7 @@
 #include "Acci.h"
 #include "enid.h"
 
+namespace Avalanche {
 
 byte fv;
 
@@ -617,3 +618,5 @@ static unit_timeout_initialize timeout_constructor;
 unit_timeout_initialize::unit_timeout_initialize() {
  fillchar(times,sizeof(times),'\0');
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/timeout.h b/engines/avalanche/timeout.h
index 99090dd..ceb8c36 100644
--- a/engines/avalanche/timeout.h
+++ b/engines/avalanche/timeout.h
@@ -32,6 +32,7 @@
 #include "gyro.h"
 #include "celer.h"
 
+namespace Avalanche {
 
 /* reason_ now runs between 1 and 28. */
 
@@ -253,4 +254,6 @@ void lose_timer(byte which);
 
  void give_lute_to_geida();
 
-#endif
+ } // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/travel.cpp b/engines/avalanche/travel.cpp
index 4ce11d5..a9117c2 100644
--- a/engines/avalanche/travel.cpp
+++ b/engines/avalanche/travel.cpp
@@ -28,6 +28,8 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 
 void zoomout(integer x,integer y)
@@ -85,4 +87,6 @@ int main(int argc, const char* argv[])
  zoomin(577,124);
  zoomin(320,85);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip.cpp b/engines/avalanche/trip.cpp
index 64b8878..867ea34 100644
--- a/engines/avalanche/trip.cpp
+++ b/engines/avalanche/trip.cpp
@@ -42,6 +42,7 @@
 #include "gyro.h"
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 /*                                                                              */
 /*       EGA Graphic Primitive for Turbo Pascal 3.01A, Version 01FEB86.         */
@@ -161,4 +162,4 @@ void trippancy()
  budge();
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip.h b/engines/avalanche/trip.h
index abef803..bfb645e 100644
--- a/engines/avalanche/trip.h
+++ b/engines/avalanche/trip.h
@@ -28,6 +28,7 @@
 #ifndef __trip_h__
 #define __trip_h__
 
+namespace Avalanche {
 
  void loadtrip();
 
@@ -41,4 +42,6 @@
 
  void trippancy();
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/trip3.cpp b/engines/avalanche/trip3.cpp
index 4c04ef4..1ca78fb 100644
--- a/engines/avalanche/trip3.cpp
+++ b/engines/avalanche/trip3.cpp
@@ -36,6 +36,8 @@
 
 /*$S+*/
 
+namespace Avalanche {
+
 const integer avvy = 1;
 const integer test = 177;
 
@@ -254,3 +256,5 @@ static unit_trip3_initialize trip3_constructor;
 unit_trip3_initialize::unit_trip3_initialize() {; /* init portion of Trip3 */
  tramt=0;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip3.h b/engines/avalanche/trip3.h
index 9318726..4a5f6fb 100644
--- a/engines/avalanche/trip3.h
+++ b/engines/avalanche/trip3.h
@@ -31,6 +31,7 @@
 
 #include "gyro.h"
 
+namespace Avalanche {
 
  void loadtrip();
 
@@ -44,4 +45,6 @@
 
  void enter(byte what_handle, integer xx,integer yy,integer lx,integer ly, byte mmx,byte mmy,byte st);
 
-#endif
+ } // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/trip42.cpp b/engines/avalanche/trip42.cpp
index 2dee669..a587dc1 100644
--- a/engines/avalanche/trip42.cpp
+++ b/engines/avalanche/trip42.cpp
@@ -42,6 +42,7 @@
 /*#include "Dropdown.h"*/
 /*#include "Access.h"*/
 
+namespace Avalanche {
 
 /*procedure copier(x1,y1,x2,y2,x3,y3,x4,y4:integer);
 
@@ -473,3 +474,5 @@ static unit_trip42_initialize trip42_constructor;
 unit_trip42_initialize::unit_trip42_initialize() {;
  getsetclear();
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip42.h b/engines/avalanche/trip42.h
index 72b9499..644a721 100644
--- a/engines/avalanche/trip42.h
+++ b/engines/avalanche/trip42.h
@@ -35,6 +35,7 @@
 /*#include "Gyro.h"*/
 /*#include "Sticks.h"*/
 
+namespace Avalanche {
 
 const integer maxgetset = 10;
 
@@ -113,5 +114,6 @@ EXTERN array<0,1,getsettype> getset;
 #undef EXTERN
 #define EXTERN extern
 
+} // End of namespace Avalanche.
 
-#endif
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/trip5.cpp b/engines/avalanche/trip5.cpp
index 5742bf3..fc9429b 100644
--- a/engines/avalanche/trip5.cpp
+++ b/engines/avalanche/trip5.cpp
@@ -47,6 +47,7 @@
 /*#include "Sequence.h"*/
 /*#include "Enid.h"*/
 
+namespace Avalanche {
 
 void loadtrip()
 {
@@ -1911,3 +1912,5 @@ static unit_trip5_initialize trip5_constructor;
 unit_trip5_initialize::unit_trip5_initialize() {
  getsetclear(); mustexclaim=false;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip5.h b/engines/avalanche/trip5.h
index 3811c85..6c18232 100644
--- a/engines/avalanche/trip5.h
+++ b/engines/avalanche/trip5.h
@@ -34,6 +34,8 @@
 /*#include "Gyro.h"*/
 /*#include "Sticks.h"*/
 
+namespace Avalanche {
+
 
 const integer maxgetset = 35;
 
@@ -198,5 +200,6 @@ EXTERN boolean mustexclaim; EXTERN word saywhat;
 #undef EXTERN
 #define EXTERN extern
 
+} // End of namespace Avalanche.
 
-#endif
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/trip5tst.cpp b/engines/avalanche/trip5tst.cpp
index 5b78efa..8dbd985 100644
--- a/engines/avalanche/trip5tst.cpp
+++ b/engines/avalanche/trip5tst.cpp
@@ -30,6 +30,8 @@
 
 /*$R+*/
 
+namespace Avalanche {
+
 struct adxtype {
            varying_string<12> name; /* name of character */
            varying_string<16> comment; /* comment */
@@ -156,4 +158,6 @@ int main(int argc, const char* argv[])
  plotone(0,0);
  close(inf);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/trip5xf.cpp b/engines/avalanche/trip5xf.cpp
index 09a8eac..f83f9c7 100644
--- a/engines/avalanche/trip5xf.cpp
+++ b/engines/avalanche/trip5xf.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const string crlf = string('\15')+'\12'; const char eof_ = '\32';
 const array<1,177,char> trip5head = 
@@ -193,4 +194,6 @@ int main(int argc, const char* argv[])
  blockwrite(out,trip5foot,50);
  close(out);
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/tripoop.cpp b/engines/avalanche/tripoop.cpp
index 6ddc12c..0edd926 100644
--- a/engines/avalanche/tripoop.cpp
+++ b/engines/avalanche/tripoop.cpp
@@ -29,6 +29,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const integer up = 0;
 const integer right = 1;
@@ -312,4 +313,6 @@ int main(int argc, const char* argv[])
   } while (!keypressed());
  }
 return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/ttmenuxf.cpp b/engines/avalanche/ttmenuxf.cpp
index ad986e1..536ebcd 100644
--- a/engines/avalanche/ttmenuxf.cpp
+++ b/engines/avalanche/ttmenuxf.cpp
@@ -29,6 +29,8 @@
 /*#include "Tommys.h"*/
 /*#include "Crt.h"*/
 
+namespace Avalanche {
+
 integer gd,gm;
 word s; pointer p;
 file<byte> f;
@@ -134,3 +136,5 @@ int main(int argc, const char* argv[])
  close(f);
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/unsquish.cpp b/engines/avalanche/unsquish.cpp
index bf98aeb..e0ede8e 100644
--- a/engines/avalanche/unsquish.cpp
+++ b/engines/avalanche/unsquish.cpp
@@ -28,6 +28,7 @@
 /*$S-*/
 #include "graph.h"
 
+namespace Avalanche {
 
 typedef array<1,50000,byte> buffertype;
 
@@ -546,4 +547,4 @@ delete buffer;
 return EXIT_SUCCESS;
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/viewdocs.cpp b/engines/avalanche/viewdocs.cpp
index 52edfe4..58dc7b6 100644
--- a/engines/avalanche/viewdocs.cpp
+++ b/engines/avalanche/viewdocs.cpp
@@ -30,6 +30,7 @@
 /*#include "crt.h"*/
 /*#include "tommys.h"*/
 
+namespace Avalanche {
 
 typedef array<0,49999,byte> bigtextarray;
 struct chaptertype {
@@ -545,3 +546,5 @@ int main(int argc, const char* argv[])
  endit();
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/visa.cpp b/engines/avalanche/visa.cpp
index dea03b1..c801a74 100644
--- a/engines/avalanche/visa.cpp
+++ b/engines/avalanche/visa.cpp
@@ -44,6 +44,7 @@
 /*#include "Trip5.h"*/
 /*#include "Lucerna.h"*/
 
+namespace Avalanche {
 
 const boolean bubbling = false;
 const boolean report_dixi_errors = true;
@@ -286,4 +287,4 @@ void talkto(byte whom)
  }
 }
 
-
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/visa.h b/engines/avalanche/visa.h
index 0c695fb..474a009 100644
--- a/engines/avalanche/visa.h
+++ b/engines/avalanche/visa.h
@@ -28,9 +28,12 @@
 #ifndef __visa_h__
 #define __visa_h__
 
+namespace Avalanche {
 
 void dixi(char block, byte point);
 
 void talkto(byte whom);
 
-#endif
+} // End of namespace Avalanche.
+
+#endif
\ No newline at end of file
diff --git a/engines/avalanche/visatest.cpp b/engines/avalanche/visatest.cpp
index 5cbcf64..8544239 100644
--- a/engines/avalanche/visatest.cpp
+++ b/engines/avalanche/visatest.cpp
@@ -27,6 +27,7 @@
 
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 char block;
 word point;
@@ -105,4 +106,6 @@ int main(int argc, const char* argv[])
   display_it();
  } while (!false);
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/xf_gover.cpp b/engines/avalanche/xf_gover.cpp
index 98590e6..074c3b1 100644
--- a/engines/avalanche/xf_gover.cpp
+++ b/engines/avalanche/xf_gover.cpp
@@ -27,6 +27,7 @@
 
 #include "graph.h"
 
+namespace Avalanche {
 
 void load()
 {
@@ -117,3 +118,5 @@ int main(int argc, const char* argv[])
  dump_to_file(26,88,78,147,"gameover.avd");
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/xf_help.cpp b/engines/avalanche/xf_help.cpp
index ec7b1d1..7a99b50 100644
--- a/engines/avalanche/xf_help.cpp
+++ b/engines/avalanche/xf_help.cpp
@@ -28,6 +28,7 @@
 /*#include "Crt.h"*/
 /*#include "Tommys.h"*/
 
+namespace Avalanche {
 
 const integer max_pages = 34;
 
@@ -107,4 +108,6 @@ int main(int argc, const char* argv[])
 
  close(o);
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/xf_visa.cpp b/engines/avalanche/xf_visa.cpp
index c0b2573..4df55cd 100644
--- a/engines/avalanche/xf_visa.cpp
+++ b/engines/avalanche/xf_visa.cpp
@@ -30,6 +30,8 @@
 
 /*$R+*/
 
+namespace Avalanche {
+
 const varying_string<9> used = "DNPQSTUXZ";
 
 const varying_string<12> header = string("Avalot Sez:")+'\32';
@@ -199,4 +201,6 @@ int main(int argc, const char* argv[])
 
  write_out(); 
  return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/xfbutton.cpp b/engines/avalanche/xfbutton.cpp
index 197aa96..013a121 100644
--- a/engines/avalanche/xfbutton.cpp
+++ b/engines/avalanche/xfbutton.cpp
@@ -27,6 +27,8 @@
 
 #include "graph.h"
 
+namespace Avalanche {
+
 integer x,y;
 untyped_file f,out;
 
@@ -84,3 +86,5 @@ int main(int argc, const char* argv[])
  close(out);
  return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/xfghost.cpp b/engines/avalanche/xfghost.cpp
index 6eeec28..1c7673c 100644
--- a/engines/avalanche/xfghost.cpp
+++ b/engines/avalanche/xfghost.cpp
@@ -28,6 +28,7 @@
 #include "graph.h"
 /*#include "Crt.h"*/
 
+namespace Avalanche {
 
 const array<1,44,char> chunkheader = 
 string("Spooky file! Nearly a Chunk... (c) MT.")+'\32'+'\261'+'\x30'+'\x1'+'\x75'+'\261';
@@ -268,3 +269,5 @@ int main(int argc, const char* argv[])
 #endif
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/zapdraw.cpp b/engines/avalanche/zapdraw.cpp
index 9b13dbb..fe1619a 100644
--- a/engines/avalanche/zapdraw.cpp
+++ b/engines/avalanche/zapdraw.cpp
@@ -29,6 +29,7 @@
 /*#include "Crt.h"*/
 /*#include "Dos.h"*/
 
+namespace Avalanche {
 
 untyped_file f;
 byte bit;
@@ -60,3 +61,5 @@ int main(int argc, const char* argv[])
  rectangle(  0, 10, 27, 19);
 return EXIT_SUCCESS;
 }
+
+} // End of namespace Avalanche.
\ No newline at end of file


Commit: 38bc20a0763f0f83ea3c0a94a68a1edea0d08514
    https://github.com/scummvm/scummvm/commit/38bc20a0763f0f83ea3c0a94a68a1edea0d08514
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-18T01:23:29-07:00

Commit Message:
AVALANCHE: Use Artistic Style.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/access.h
    engines/avalanche/acci.cpp
    engines/avalanche/acci.h
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/arch.h
    engines/avalanche/avalot9.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avmenu.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bakchunk.cpp
    engines/avalanche/basher.cpp
    engines/avalanche/basher.h
    engines/avalanche/cadburys.cpp
    engines/avalanche/cadburys.h
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunker.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/edna.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/enhanced.h
    engines/avalanche/enid.cpp
    engines/avalanche/enid.h
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/fileunit.h
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helpbak.cpp
    engines/avalanche/helpbak.h
    engines/avalanche/helper.cpp
    engines/avalanche/helper.h
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/highs.h
    engines/avalanche/hiz.cpp
    engines/avalanche/incline.cpp
    engines/avalanche/incline.h
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/joystick.h
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/logger.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/menuxf.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/nimunit.cpp
    engines/avalanche/nimunit.h
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldincln.h
    engines/avalanche/oldtrip.cpp
    engines/avalanche/oldtrip.h
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/oopmenu.h
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/pingo.h
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/sackb1.h
    engines/avalanche/sackb3.cpp
    engines/avalanche/sackblas.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/scrolls.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sez.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezunit.h
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/slope.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sticks.h
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/timeout.cpp
    engines/avalanche/timeout.h
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip.h
    engines/avalanche/trip3.cpp
    engines/avalanche/trip3.h
    engines/avalanche/trip42.cpp
    engines/avalanche/trip42.h
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5.h
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/visa.cpp
    engines/avalanche/visa.h
    engines/avalanche/visatest.cpp
    engines/avalanche/waver.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xf_help.cpp
    engines/avalanche/xf_visa.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index 0f9e19b..9748605 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -30,55 +30,59 @@
 
 namespace Avalanche {
 
-matrix<1,7,1,3,byte> cols;
+matrix<1, 7, 1, 3, byte> cols;
 byte fv;
 
-void adjust()
-{
- registers r;
-;
- {;
-  ax=0x1012;
-  bx=1;
-  cx=2;
-  es=seg(cols);
-  dx=ofs(cols);
+void adjust() {
+	registers r;
+	;
+	{
+		;
+		ax = 0x1012;
+		bx = 1;
+		cx = 2;
+		es = seg(cols);
+		dx = ofs(cols);
 
- }
+	}
 
- intr(0x10,r);
+	intr(0x10, r);
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- textattr=0;
- clrscr;
-
- fillchar(cols,sizeof(cols),'\0');
- adjust();
-
- gotoxy(29,10); textattr=1; output << "Thorsoft of Letchworth";
- gotoxy(36,12); textattr=2; output << "presents";
-
- for( fv=1; fv <= 77; fv ++)
- {;
-  delay(77);
-  if (fv<64)  fillchar(cols[1],3,chr(fv));
-  if (fv>14)  fillchar(cols[2],3,chr(fv-14));
-  adjust();
- }
-
- delay(100);
-
- for( fv=63; fv >= 1; fv --)
- {;
-  fillchar(cols,sizeof(cols),chr(fv));
-  delay(37);
-  adjust();
- }
-
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	textattr = 0;
+	clrscr;
+
+	fillchar(cols, sizeof(cols), '\0');
+	adjust();
+
+	gotoxy(29, 10);
+	textattr = 1;
+	output << "Thorsoft of Letchworth";
+	gotoxy(36, 12);
+	textattr = 2;
+	output << "presents";
+
+	for (fv = 1; fv <= 77; fv ++) {
+		;
+		delay(77);
+		if (fv < 64)  fillchar(cols[1], 3, chr(fv));
+		if (fv > 14)  fillchar(cols[2], 3, chr(fv - 14));
+		adjust();
+	}
+
+	delay(100);
+
+	for (fv = 63; fv >= 1; fv --) {
+		;
+		fillchar(cols, sizeof(cols), chr(fv));
+		delay(37);
+		adjust();
+	}
+
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index 951bc1c..abc944f 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -49,148 +49,160 @@ namespace Avalanche {
 boolean int_say_went_ok;
 
 void int_say(string filename, boolean bubble)
- /* Internal use ONLY! */
+/* Internal use ONLY! */
 {
-    untyped_file f;
-;
- /*$I-*/
- assign(f,filename);
- reset(f,1);
- if (ioresult!=0) 
- {;
-  int_say_went_ok=false;
-  return;
- }
- bufsize=filesize(f);
- blockread(f,buffer,bufsize);
- if (bubble) 
- {;
-  bufsize += 1;
-  buffer[bufsize]='\2';
- }
- close(f);
- /*$I+*/
-
- calldrivers;
-
- int_say_went_ok=true;
+	untyped_file f;
+	;
+	/*$I-*/
+	assign(f, filename);
+	reset(f, 1);
+	if (ioresult != 0) {
+		;
+		int_say_went_ok = false;
+		return;
+	}
+	bufsize = filesize(f);
+	blockread(f, buffer, bufsize);
+	if (bubble) {
+		;
+		bufsize += 1;
+		buffer[bufsize] = '\2';
+	}
+	close(f);
+	/*$I+*/
+
+	calldrivers;
+
+	int_say_went_ok = true;
 }
 
-void dixi(char p, byte n)
-{; exit(153);
- int_say(string('s')+p+strf(n)+".raw",false);
+void dixi(char p, byte n) {
+	;
+	exit(153);
+	int_say(string('s') + p + strf(n) + ".raw", false);
 }
 
-void talkto(byte whom)
-{
- byte fv;
- boolean no_matches;
-; exit(153);
- if (person==pardon) 
- {;
-  person=chr(subjnumber);
-  subjnumber=0;
- }
-
- switch (chr(whom)) {
-  case pspludwick:
-
-    if ((dna.lustie_is_asleep) & (~ dna.obj[potion])) 
-    {;
-     dixi('q',68);
-     dna.obj[potion]=true;
-     objectlist; points(3); return;
-    } else
-    {;
-     if (dna.talked_to_crapulus) 
-      switch (dna.given2spludwick) { /* Spludwick - what does he need? */
-         /* 0 - let it through to use normal routine. */
-         case RANGE_2(1,2): {;
-                display(string("Can you get me ")+
-                 get_better(spludwick_order[dna.given2spludwick])+", please?"+
-                  "\232\2");
-                return;
-               }
-               break;
-         case 3: {;
-             dixi('q',30); /* need any help with the game? */
-             return;
-            }
-            break;
-       }
-     else dixi('q',42); /* Haven't talked to Crapulus. Go and talk to him. */
-    }
-    break;
-
-  case pibythneth: if (dna.givenbadgetoiby) 
-              {;
-               dixi('q',33); /* Thanks a lot! */
-               return; /* And leave the proc. */
-              }
-              break; /* Or... just continue, 'cos he hasn't got it. */
-  case pdogfood: if (dna.wonnim) 
-            {;     /* We've won the game. */
-             dixi('q',6); /* "I'm Not Playing!" */
-             return; /* Zap back. */
-            }
-            break;
-  case payles: if (~ dna.ayles_is_awake) 
-          {;
-           dixi('q',43); /* He's fast asleep! */
-           return;
-          }
-          break;
-  case pgeida: if (dna.geida_given_potion) 
-           dna.geida_follows=true; else
-          {;
-           dixi('u',17);
-           return;
-          }
-          break;
- }
-
- if (whom>149)  whom -= 149;
-
- no_matches=true;
- for( fv=1; fv <= numtr; fv ++)
-  if (tr[fv].a.accinum==whom) 
-  {;
-   display(string('\23')+chr(fv+48)+'\4');
-   no_matches=false;
-   flush();
-  }
-
- if (no_matches)  display("\23\23\4");
-
- if (subjnumber==0)   /* For the moment... later we'll parse "say". */
-  int_say(string("ss")+strf(whom)+".raw",true);
- else
- {;
-  int_say(string("ss")+strf(whom)+'-'+strf(subjnumber)+".raw",true);
-  if (! int_say_went_ok)      /* File not found! */
-   dixi('n',whom);
- }
-
- switch (chr(whom+149)) {
-  case pcrapulus:
-     {;     /* Crapulus: get the badge - first time only */
-      dna.obj[badge]=true;
-      objectlist;
-      dixi('q',1); /* Circular from Cardiff. */
-      dna.talked_to_crapulus=true;
-
-      whereis[pcrapulus]=177;  /* Crapulus walks off. */
-
-      tr[2].vanishifstill=true;
-      tr[2].walkto(4); /* Walks away. */
-
-      points(2);
-     }
-     break;
-
-  case payles: dixi('q',44); break; /* Can you get me a pen? */
-
- }
+void talkto(byte whom) {
+	byte fv;
+	boolean no_matches;
+	;
+	exit(153);
+	if (person == pardon) {
+		;
+		person = chr(subjnumber);
+		subjnumber = 0;
+	}
+
+	switch (chr(whom)) {
+	case pspludwick:
+
+		if ((dna.lustie_is_asleep) & (~ dna.obj[potion])) {
+			;
+			dixi('q', 68);
+			dna.obj[potion] = true;
+			objectlist;
+			points(3);
+			return;
+		} else {
+			;
+			if (dna.talked_to_crapulus)
+				switch (dna.given2spludwick) { /* Spludwick - what does he need? */
+					/* 0 - let it through to use normal routine. */
+				case RANGE_2(1, 2): {
+					;
+					display(string("Can you get me ") +
+					        get_better(spludwick_order[dna.given2spludwick]) + ", please?" +
+					        "\232\2");
+					return;
+				}
+				break;
+				case 3: {
+					;
+					dixi('q', 30); /* need any help with the game? */
+					return;
+				}
+				break;
+				}
+			else dixi('q', 42); /* Haven't talked to Crapulus. Go and talk to him. */
+		}
+		break;
+
+	case pibythneth:
+		if (dna.givenbadgetoiby) {
+			;
+			dixi('q', 33); /* Thanks a lot! */
+			return; /* And leave the proc. */
+		}
+		break; /* Or... just continue, 'cos he hasn't got it. */
+	case pdogfood:
+		if (dna.wonnim) {
+			;     /* We've won the game. */
+			dixi('q', 6); /* "I'm Not Playing!" */
+			return; /* Zap back. */
+		}
+		break;
+	case payles:
+		if (~ dna.ayles_is_awake) {
+			;
+			dixi('q', 43); /* He's fast asleep! */
+			return;
+		}
+		break;
+	case pgeida:
+		if (dna.geida_given_potion)
+			dna.geida_follows = true;
+		else {
+			;
+			dixi('u', 17);
+			return;
+		}
+		break;
+	}
+
+	if (whom > 149)  whom -= 149;
+
+	no_matches = true;
+	for (fv = 1; fv <= numtr; fv ++)
+		if (tr[fv].a.accinum == whom) {
+			;
+			display(string('\23') + chr(fv + 48) + '\4');
+			no_matches = false;
+			flush();
+		}
+
+	if (no_matches)  display("\23\23\4");
+
+	if (subjnumber == 0) /* For the moment... later we'll parse "say". */
+		int_say(string("ss") + strf(whom) + ".raw", true);
+	else {
+		;
+		int_say(string("ss") + strf(whom) + '-' + strf(subjnumber) + ".raw", true);
+		if (! int_say_went_ok)      /* File not found! */
+			dixi('n', whom);
+	}
+
+	switch (chr(whom + 149)) {
+	case pcrapulus: {
+		;     /* Crapulus: get the badge - first time only */
+		dna.obj[badge] = true;
+		objectlist;
+		dixi('q', 1); /* Circular from Cardiff. */
+		dna.talked_to_crapulus = true;
+
+		whereis[pcrapulus] = 177; /* Crapulus walks off. */
+
+		tr[2].vanishifstill = true;
+		tr[2].walkto(4); /* Walks away. */
+
+		points(2);
+	}
+	break;
+
+	case payles:
+		dixi('q', 44);
+		break; /* Can you get me a pen? */
+
+	}
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
index e985953..2e4a081 100644
--- a/engines/avalanche/access.h
+++ b/engines/avalanche/access.h
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index f33d7c2..adaad69 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -58,42 +58,43 @@ namespace Avalanche {
 byte fv;
 
 string wordnum(string x);
-static char whatsit; 
-static word fv; 
+static char whatsit;
+static word fv;
 static boolean gotcha;
 
-static void checkword(string& x) /* Checks word "fv". */
-{
- {
-  vocab& with = words[fv]; 
+static void checkword(string &x) { /* Checks word "fv". */
+	{
+		vocab &with = words[fv];
 
-  if ((with.w==x) || ((copy(with.w,1,length(x))==x) && ! gotcha))
-        whatsit=chr(with.n);
-  if (with.w==x)  gotcha=true;
- }
+		if ((with.w == x) || ((copy(with.w, 1, length(x)) == x) && ! gotcha))
+			whatsit = chr(with.n);
+		if (with.w == x)  gotcha = true;
+	}
 }
 
 string wordnum(string x)
 
 {
- string wordnum_result;
- if (x=="")  { wordnum_result=""; return wordnum_result; }
- whatsit=pardon; gotcha=false;
- for( fv=nowords; fv >= 1; fv --) checkword(x);
- wordnum_result=whatsit;
- return wordnum_result;
+	string wordnum_result;
+	if (x == "")  {
+		wordnum_result = "";
+		return wordnum_result;
+	}
+	whatsit = pardon;
+	gotcha = false;
+	for (fv = nowords; fv >= 1; fv --) checkword(x);
+	wordnum_result = whatsit;
+	return wordnum_result;
 }
 
-void replace(string old1,string new1)
-{
-    byte q;
-
- q=pos(old1,thats);
- while (q!=0) 
- {
-  thats=copy(thats,1,q-1)+new1+copy(thats,q+length(old1),255);
-  q=pos(old1,thats);
- }
+void replace(string old1, string new1) {
+	byte q;
+
+	q = pos(old1, thats);
+	while (q != 0) {
+		thats = copy(thats, 1, q - 1) + new1 + copy(thats, q + length(old1), 255);
+		q = pos(old1, thats);
+	}
 }
 
 /*procedure ninetydump;
@@ -112,1588 +113,1844 @@ begin
  display('Dumped.');
 end;*/
 
-string rank()
-{
-    byte fv;
-
- string rank_result;
- for( fv=1; fv <= 8; fv ++)
-  if ((dna.score>=ranks[fv].score)
-   && (dna.score<ranks[fv+1].score)) 
-   {
-    rank_result=ranks[fv].title;
-    return rank_result;
-   }
- return rank_result;
+string rank() {
+	byte fv;
+
+	string rank_result;
+	for (fv = 1; fv <= 8; fv ++)
+		if ((dna.score >= ranks[fv].score)
+		        && (dna.score < ranks[fv + 1].score)) {
+			rank_result = ranks[fv].title;
+			return rank_result;
+		}
+	return rank_result;
 }
 
-string totaltime()
-{
-      const real ticks_in_1_sec = (real)(65535)/3600;
- word h,m,s; varying_string<70> a;
-
-  /* There are 65535 clock ticks in a second,
-    1092.25 in a minute, and
-    65535 in an hour. */
- string totaltime_result;
- h=trunc(dna.total_time/ticks_in_1_sec);  /* No. of seconds. */
- m=h % 3600; h=h / 3600;
- s=m % 60;   m=m / 60;
-
- a="You've been playing for ";
-
- if (h>0)  a=a+strf(h)+" hours, ";
- if ((m>0) || (h!=0))  a=a+strf(m)+" minutes and ";
- a=a+strf(s)+" seconds.";
-
- totaltime_result=a;
- return totaltime_result;
+string totaltime() {
+	const real ticks_in_1_sec = (real)(65535) / 3600;
+	word h, m, s;
+	varying_string<70> a;
+
+	/* There are 65535 clock ticks in a second,
+	  1092.25 in a minute, and
+	  65535 in an hour. */
+	string totaltime_result;
+	h = trunc(dna.total_time / ticks_in_1_sec); /* No. of seconds. */
+	m = h % 3600;
+	h = h / 3600;
+	s = m % 60;
+	m = m / 60;
+
+	a = "You've been playing for ";
+
+	if (h > 0)  a = a + strf(h) + " hours, ";
+	if ((m > 0) || (h != 0))  a = a + strf(m) + " minutes and ";
+	a = a + strf(s) + " seconds.";
+
+	totaltime_result = a;
+	return totaltime_result;
 }
 
 void cheatparse(string codes);
-static word num; 
+static word num;
 static integer e;
 
-static void number(string& codes)
-{
- val(codes,num,e);
+static void number(string &codes) {
+	val(codes, num, e);
 }
 
-void cheatparse(string codes)
-{
-    char cmd;integer se,sx,sy;
-
- if (~ cheat) 
- {     /* put them off the scent! */
-  display("Have you gone dotty\??!");
-  return;
- }
- cmd=upcase(codes[2]); Delete(codes,1,2);  /* strip header */
- display("\6Ninety: \22\4");
- switch (cmd) {
-  case 'R': {
-        number(codes); if (e!=0)  return;
-        display(string("room swap to ")+codes+'.');
-        fliproom(num,1);
-       }
-       break;
-  case 'Z': { zonk; display("Zonk OK!"); } break;
-  case 'W': { wobble; display("Ow my head!"); } break;
-  case 'A': {
-        tr[1].done;
-        tr[1].init(1,true);
-        dna.user_moves_avvy=true;
-        alive=true;
-        display("Reincat.");
-       }
-       break;
-  case 'B': {
-        sx=tr[1].x;
-        sy=tr[1].y;
-        se=tr[1].face;
-        delavvy;
-        number(codes);
-        {
-         void& with = tr[1]; 
-
-         done;
-         init(num,true);
-         display(string("Become ")+codes+':'+"\r\r"+a.name+'\15'+a.comment);
-         appear(sx,sy,se);
-        }
-       }
-       break;
-/*  'D': ninetydump;*/
-  case 'G': play_nim; break;
-  case '±': display("\232\25"); break;
-  default: display("unknown code!");
- }
+void cheatparse(string codes) {
+	char cmd;
+	integer se, sx, sy;
+
+	if (~ cheat) {
+		/* put them off the scent! */
+		display("Have you gone dotty\??!");
+		return;
+	}
+	cmd = upcase(codes[2]);
+	Delete(codes, 1, 2); /* strip header */
+	display("\6Ninety: \22\4");
+	switch (cmd) {
+	case 'R': {
+		number(codes);
+		if (e != 0)  return;
+		display(string("room swap to ") + codes + '.');
+		fliproom(num, 1);
+	}
+	break;
+	case 'Z': {
+		zonk;
+		display("Zonk OK!");
+	}
+	break;
+	case 'W': {
+		wobble;
+		display("Ow my head!");
+	}
+	break;
+	case 'A': {
+		tr[1].done;
+		tr[1].init(1, true);
+		dna.user_moves_avvy = true;
+		alive = true;
+		display("Reincat.");
+	}
+	break;
+	case 'B': {
+		sx = tr[1].x;
+		sy = tr[1].y;
+		se = tr[1].face;
+		delavvy;
+		number(codes);
+		{
+			void &with = tr[1];
+
+			done;
+			init(num, true);
+			display(string("Become ") + codes + ':' + "\r\r" + a.name + '\15' + a.comment);
+			appear(sx, sy, se);
+		}
+	}
+	break;
+	/*  'D': ninetydump;*/
+	case 'G':
+		play_nim;
+		break;
+	case '±':
+		display("\232\25");
+		break;
+	default:
+		display("unknown code!");
+	}
 }
 
-void punctustrip(string& x)          /* Strips punctuation from x. */
-{
-      const varying_string<32> punct = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
-    byte fv,p;
-
- for( fv=1; fv <= 32; fv ++)
-  do {
-   p=pos(punct[fv-1],x);
-   if (p==0)  flush(); /* <<< The first time I've ever used it! */
-   Delete(x,p,1);
-  } while (!false);
+void punctustrip(string &x) {        /* Strips punctuation from x. */
+	const varying_string<32> punct = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
+	byte fv, p;
+
+	for (fv = 1; fv <= 32; fv ++)
+		do {
+			p = pos(punct[fv - 1], x);
+			if (p == 0)  flush(); /* <<< The first time I've ever used it! */
+			Delete(x, p, 1);
+		} while (!false);
 }
 
 boolean do_pronouns();
 static boolean ambiguous;
 
-static void displaywhat(char ch, boolean animate) /* << it's an adjective! */
-{
-    byte ff; string z;
-
- if (ch==pardon) 
- {
-  ambiguous=true;
-  if (animate)  display("Whom?"); else display("What?");
- } else
- {
-  if (animate)  display(string("{ ")+getname(ch)+" }");
-   else
-   {
-     z=get_better(ch);
-     if (z!="")  display(string("{ ")+z+" }");
-   }
- }
+static void displaywhat(char ch, boolean animate) { /* << it's an adjective! */
+	byte ff;
+	string z;
+
+	if (ch == pardon) {
+		ambiguous = true;
+		if (animate)  display("Whom?");
+		else display("What?");
+	} else {
+		if (animate)  display(string("{ ") + getname(ch) + " }");
+		else {
+			z = get_better(ch);
+			if (z != "")  display(string("{ ") + z + " }");
+		}
+	}
 }
 
-boolean do_pronouns()
-{
-    byte fv;
-
- boolean do_pronouns_result;
- ambiguous=false;
- for( fv=1; fv <= length(thats); fv ++)
-  switch (thats[fv]) {
-   case '\310': {
-          displaywhat(him,true);
-          thats[fv]=him;
-         }
-         break;
-   case '\311': {
-          displaywhat(her,true);
-          thats[fv]=her;
-         }
-         break;
-   case '\312': {
-          displaywhat(it,false);
-          thats[fv]=it;
-         }
-         break;
-  }
- do_pronouns_result=ambiguous;
- return do_pronouns_result;
+boolean do_pronouns() {
+	byte fv;
+
+	boolean do_pronouns_result;
+	ambiguous = false;
+	for (fv = 1; fv <= length(thats); fv ++)
+		switch (thats[fv]) {
+		case '\310': {
+			displaywhat(him, true);
+			thats[fv] = him;
+		}
+		break;
+		case '\311': {
+			displaywhat(her, true);
+			thats[fv] = her;
+		}
+		break;
+		case '\312': {
+			displaywhat(it, false);
+			thats[fv] = it;
+		}
+		break;
+		}
+	do_pronouns_result = ambiguous;
+	return do_pronouns_result;
 }
 
 void store_interrogation(byte interrogation);
 
 
-static void lowercase()
-{
-    byte fv;
+static void lowercase() {
+	byte fv;
 
- for( fv=1; fv <= length(current); fv ++)
-  if (set::of(range('A','Z'), eos).has(current[fv])) 
-   current[fv] += 32;
+	for (fv = 1; fv <= length(current); fv ++)
+		if (set::of(range('A', 'Z'), eos).has(current[fv]))
+			current[fv] += 32;
 }
 
 
 
-static void propernouns()
-{
-    byte fv;
+static void propernouns() {
+	byte fv;
 
- lowercase();
- for( fv=2; fv <= length(current)-1; fv ++)
-  if (current[fv]==' ') 
-   current[fv+1]=upcase(current[fv+1]);
- current[1]=upcase(current[1]);
+	lowercase();
+	for (fv = 2; fv <= length(current) - 1; fv ++)
+		if (current[fv] == ' ')
+			current[fv + 1] = upcase(current[fv + 1]);
+	current[1] = upcase(current[1]);
 }
 
 
 
-static void sayit() /* This makes Avalot say the response. */
-{
-    string x;
+static void sayit() { /* This makes Avalot say the response. */
+	string x;
 
- x=current; x[1]=upcase(x[1]);
- display(string("\231")+x+'.'+'\2'+'\23'+'2');
+	x = current;
+	x[1] = upcase(x[1]);
+	display(string("\231") + x + '.' + '\2' + '\23' + '2');
 }
 
-void store_interrogation(byte interrogation)
-{
-    byte fv;
+void store_interrogation(byte interrogation) {
+	byte fv;
 
 
- if (current=="")  return;
+	if (current == "")  return;
 
- /* Strip current: */
- while ((current[1]==' ') && (current!=""))  Delete(current,1,1);
- while ((current[length(current)]==' ') && (current!=""))  current[0] -= 1;
+	/* Strip current: */
+	while ((current[1] == ' ') && (current != ""))  Delete(current, 1, 1);
+	while ((current[length(current)] == ' ') && (current != ""))  current[0] -= 1;
 
- lose_timer(reason_cardiffsurvey); /* if you want to use any other timer,
+	lose_timer(reason_cardiffsurvey); /* if you want to use any other timer,
   put this into the case statement. */
-  switch (interrogation) {
-   case 1: {
-       lowercase(); sayit();
-       like2drink=current;
-       dna.cardiff_things=2;
-      }
-      break;
-   case 2: {
-       propernouns(); sayit();
-       favourite_song=current;
-       dna.cardiff_things=3;
-      }
-      break;
-   case 3: {
-       propernouns(); sayit();
-       worst_place_on_earth=current;
-       dna.cardiff_things=4;
-      }
-      break;
-   case 4: {
-       lowercase(); sayit();
-       fillchar(spare_evening,sizeof(spare_evening),'\261');
-       spare_evening=current;
-       dixi('z',5); /* His closing statement... */
-       tr[2].walkto(4); /* The end of the drawbridge */
-       tr[2].vanishifstill=true;  /* Then go away! */
-       magics[2].op=nix;
-       dna.cardiff_things=5;
-      }
-      break;
-
-   case 99: store_high(current); break;
-  }
- if (interrogation<4)  cardiff_survey;
+	switch (interrogation) {
+	case 1: {
+		lowercase();
+		sayit();
+		like2drink = current;
+		dna.cardiff_things = 2;
+	}
+	break;
+	case 2: {
+		propernouns();
+		sayit();
+		favourite_song = current;
+		dna.cardiff_things = 3;
+	}
+	break;
+	case 3: {
+		propernouns();
+		sayit();
+		worst_place_on_earth = current;
+		dna.cardiff_things = 4;
+	}
+	break;
+	case 4: {
+		lowercase();
+		sayit();
+		fillchar(spare_evening, sizeof(spare_evening), '\261');
+		spare_evening = current;
+		dixi('z', 5); /* His closing statement... */
+		tr[2].walkto(4); /* The end of the drawbridge */
+		tr[2].vanishifstill = true; /* Then go away! */
+		magics[2].op = nix;
+		dna.cardiff_things = 5;
+	}
+	break;
+
+	case 99:
+		store_high(current);
+		break;
+	}
+	if (interrogation < 4)  cardiff_survey;
 }
 
-void clearwords()
-{
- fillchar(realwords,sizeof(realwords),'\0');
+void clearwords() {
+	fillchar(realwords, sizeof(realwords), '\0');
 }
 
-void parse()
-{
-    byte n,fv,ff; string c,cc,thisword; varying_string<1> answer; boolean notfound;
-
- /* first parsing - word identification */
-
- thats=""; c=current+'\40'; n=1; polite=false;
- verb=pardon; thing=pardon; thing2=pardon; person=pardon;
- clearwords();
- if (current[1]=='.') 
- {     /* a cheat mode attempt */
-  cheatparse(current); thats=nowt; return;
- }    /* not our department! Otherwise... */
-
- /* Are we being interrogated right now? */
-
- if (interrogation>0) 
- {
-  store_interrogation(interrogation);
-  weirdword=true;
-  return;
- }
-
- cc=c; for( fv=1; fv <= length(c); fv ++) c[fv]=upcase(c[fv]);
- while (c!="") 
- {
-   while ((c[1]=='\40') && (c!="")) 
-     { Delete(c,1,1); Delete(cc,1,1); }
-  thisword=copy(c,1,pos("\40",c)-1);
-  realwords[n]=copy(cc,1,pos("\40",cc)-1);
-  punctustrip(c);
-
-  notfound=true;
-
-  if (thisword!="") 
-  {
-   for( ff=1; ff <= 30; ff ++)
-   {     /* Check Also, FIRST! */
-    if (pos(string(',')+thisword,also[ff][0])>0) 
-    {
-     thats=thats+chr(99+ff);
-     notfound=false;
-    }
-   }
-  }
-
-  if (notfound) 
-  {
-   answer=wordnum(thisword);
-   if (answer==pardon) 
-   {
-    notfound=true;
-    thats=thats+pardon;
-   } else
-    thats=thats+wordnum(thisword);
-   n += 1;
-  }
-  Delete(c,1,pos("\40",c)); Delete(cc,1,pos("\40",cc));
- }
-
- if (pos("\376",thats)>0)  unknown=realwords[pos("\376",thats)]; else unknown=""; replace("\377",""); /* zap noise words */
- replace(string('\15')+'\342',"\1"); /* "look at" = "examine" */
- replace(string('\15')+'\344',"\1"); /* "look in" = "examine" */
- replace(string('\4')+'\343',"\21"); /* "get up" = "stand" */
- replace(string('\4')+'\347',"\21"); /* "get down" = "stand"... well, why not? */
- replace(string('\22')+'\344',"\2"); /* "go in" = "open [door]" */
- replace(string('\34')+'\345',"\375"); /* "P' off" is a swear word */
- replace(string('\4')+'\6',"\6"); /* "Take inventory" (remember Colossal Adventure?) */
- replace(string('\50')+'\350',"\25"); /* "put on" = "don" */
- replace(string('\4')+'\345',"\24"); /* "take off" = "doff" */
-
-             /* Words that could mean more than one person */
- {
-  if (room==r__nottspub)  replace("\314","\244"); /* Barman = Port */
-   else replace("\314","\232");                   /* Barman = Malagauche */
-  switch (room) {
-   case r__aylesoffice: replace("\313","\243"); break;        /* Monk = Ayles */
-   case r__musicroom: replace("\313","\246"); break;          /* Monk = Jacques */
-   default: replace("\313","\242");                   /* Monk = Ibythneth */
-  }
- }
-
- if (do_pronouns()) 
- {
-  weirdword=true;
-  thats=nowt;
-  return;
- }
-
- /* second parsing - accidence */
-
- subject=""; subjnumber=0;   /* Find subject of conversation. */
- for( fv=1; fv <= 11; fv ++)
-  if (set::of('`','\'', eos).has(realwords[fv][1])) 
-  {
-   subjnumber=ord(thats[fv]);
-   thats[fv]=moved;
-   flush(); /* Only the second time I've used that! */
-  }
- if (subjnumber==0)   /* Still not found. */
-  for( fv=1; fv <= 10; fv ++)
-   if (thats[fv]=='\374')  /* the word is "about", or something similar */
-   {
-    subjnumber=ord(thats[fv+1]);
-    thats[fv+1]='\0';
-    flush(); /* ...Third! */
-   }
- if (subjnumber==0)   /* STILL not found! Must be the word after "say". */
-  for( fv=1; fv <= 10; fv ++)
-   if ((thats[fv]=='\7') && ! (set::of('\0',range('\341','\345'), eos).has(thats[fv+1]))) 
-   {     /* SAY not followed by a preposition */
-    subjnumber=ord(thats[fv+1]);
-    thats[fv+1]='\0';
-    flush(); /* ...Fourth! */
-   }
-
- for( fv=length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
-  switch (thats[fv]) {
-   case '\1' ... '\61':case '\375':case '\371': verb=thats[fv]; break;
-   case '\62' ... '\225': { thing2=thing; thing=thats[fv]; } break;
-   case '\226' ... '\307': person=thats[fv]; break;
-   case '\373': polite=true; break;
-  }
-
- if ((unknown!="") && !
-  (set::of(vb_exam,vb_talk,vb_save,vb_load,vb_dir, eos).has(verb))) 
- {
-  display(string("Sorry, but I have no idea what `")+unknown+
-    "\" means. Can you rephrase it?");
-  weirdword=true;
- } else weirdword=false;
- if (thats=="")  thats=nowt;
-
- if (thing!=pardon)  it=thing;
- if (person!=pardon) 
- {
-  if (person<'\257')  him=person; else her=person;
- }
+void parse() {
+	byte n, fv, ff;
+	string c, cc, thisword;
+	varying_string<1> answer;
+	boolean notfound;
+
+	/* first parsing - word identification */
+
+	thats = "";
+	c = current + '\40';
+	n = 1;
+	polite = false;
+	verb = pardon;
+	thing = pardon;
+	thing2 = pardon;
+	person = pardon;
+	clearwords();
+	if (current[1] == '.') {
+		/* a cheat mode attempt */
+		cheatparse(current);
+		thats = nowt;
+		return;
+	}    /* not our department! Otherwise... */
+
+	/* Are we being interrogated right now? */
+
+	if (interrogation > 0) {
+		store_interrogation(interrogation);
+		weirdword = true;
+		return;
+	}
+
+	cc = c;
+	for (fv = 1; fv <= length(c); fv ++) c[fv] = upcase(c[fv]);
+	while (c != "") {
+		while ((c[1] == '\40') && (c != "")) {
+			Delete(c, 1, 1);
+			Delete(cc, 1, 1);
+		}
+		thisword = copy(c, 1, pos("\40", c) - 1);
+		realwords[n] = copy(cc, 1, pos("\40", cc) - 1);
+		punctustrip(c);
+
+		notfound = true;
+
+		if (thisword != "") {
+			for (ff = 1; ff <= 30; ff ++) {
+				/* Check Also, FIRST! */
+				if (pos(string(',') + thisword, also[ff][0]) > 0) {
+					thats = thats + chr(99 + ff);
+					notfound = false;
+				}
+			}
+		}
+
+		if (notfound) {
+			answer = wordnum(thisword);
+			if (answer == pardon) {
+				notfound = true;
+				thats = thats + pardon;
+			} else
+				thats = thats + wordnum(thisword);
+			n += 1;
+		}
+		Delete(c, 1, pos("\40", c));
+		Delete(cc, 1, pos("\40", cc));
+	}
+
+	if (pos("\376", thats) > 0)  unknown = realwords[pos("\376", thats)];
+	else unknown = "";
+	replace("\377", ""); /* zap noise words */
+	replace(string('\15') + '\342', "\1"); /* "look at" = "examine" */
+	replace(string('\15') + '\344', "\1"); /* "look in" = "examine" */
+	replace(string('\4') + '\343', "\21"); /* "get up" = "stand" */
+	replace(string('\4') + '\347', "\21"); /* "get down" = "stand"... well, why not? */
+	replace(string('\22') + '\344', "\2"); /* "go in" = "open [door]" */
+	replace(string('\34') + '\345', "\375"); /* "P' off" is a swear word */
+	replace(string('\4') + '\6', "\6"); /* "Take inventory" (remember Colossal Adventure?) */
+	replace(string('\50') + '\350', "\25"); /* "put on" = "don" */
+	replace(string('\4') + '\345', "\24"); /* "take off" = "doff" */
+
+	/* Words that could mean more than one person */
+	{
+		if (room == r__nottspub)  replace("\314", "\244"); /* Barman = Port */
+		else replace("\314", "\232");                  /* Barman = Malagauche */
+		switch (room) {
+		case r__aylesoffice:
+			replace("\313", "\243");
+			break;        /* Monk = Ayles */
+		case r__musicroom:
+			replace("\313", "\246");
+			break;          /* Monk = Jacques */
+		default:
+			replace("\313", "\242");                  /* Monk = Ibythneth */
+		}
+	}
+
+	if (do_pronouns()) {
+		weirdword = true;
+		thats = nowt;
+		return;
+	}
+
+	/* second parsing - accidence */
+
+	subject = "";
+	subjnumber = 0; /* Find subject of conversation. */
+	for (fv = 1; fv <= 11; fv ++)
+		if (set::of('`', '\'', eos).has(realwords[fv][1])) {
+			subjnumber = ord(thats[fv]);
+			thats[fv] = moved;
+			flush(); /* Only the second time I've used that! */
+		}
+	if (subjnumber == 0) /* Still not found. */
+		for (fv = 1; fv <= 10; fv ++)
+			if (thats[fv] == '\374') { /* the word is "about", or something similar */
+				subjnumber = ord(thats[fv + 1]);
+				thats[fv + 1] = '\0';
+				flush(); /* ...Third! */
+			}
+	if (subjnumber == 0) /* STILL not found! Must be the word after "say". */
+		for (fv = 1; fv <= 10; fv ++)
+			if ((thats[fv] == '\7') && !(set::of('\0', range('\341', '\345'), eos).has(thats[fv + 1]))) {
+				/* SAY not followed by a preposition */
+				subjnumber = ord(thats[fv + 1]);
+				thats[fv + 1] = '\0';
+				flush(); /* ...Fourth! */
+			}
+
+	for (fv = length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
+		switch (thats[fv]) {
+		case '\1' ... '\61':
+		case '\375':
+		case '\371':
+			verb = thats[fv];
+			break;
+		case '\62' ... '\225': {
+			thing2 = thing;
+			thing = thats[fv];
+		}
+		break;
+		case '\226' ... '\307':
+			person = thats[fv];
+			break;
+		case '\373':
+			polite = true;
+			break;
+		}
+
+	if ((unknown != "") && !
+	        (set::of(vb_exam, vb_talk, vb_save, vb_load, vb_dir, eos).has(verb))) {
+		display(string("Sorry, but I have no idea what `") + unknown +
+		        "\" means. Can you rephrase it?");
+		weirdword = true;
+	} else weirdword = false;
+	if (thats == "")  thats = nowt;
+
+	if (thing != pardon)  it = thing;
+	if (person != pardon) {
+		if (person < '\257')  him = person;
+		else her = person;
+	}
 }
 
-void examobj()     /* Examine a standard object-thing */
-{
- if (thing!=thinks)  thinkabout(thing,a_thing);
-  switch (thing) {
-   case wine : switch (winestate) {
-         /* 4 is perfect wine. 0 is not holding the wine. */
-           case 1: dixi('t',1); break; /* Normal examine wine scroll */
-           case 2: dixi('d',6); break; /* Bad wine */
-           case 3: dixi('d',7); break; /* Vinegar */
-          }
-          break;
-   case onion: if (rotten_onion) 
-           dixi('q',21); /* Yucky onion. */
-          else
-           dixi('t',18);
-           break;        /* Normal onion scroll */
-  default:
-   dixi('t',ord(thing)); /* <<< Ordinarily */
-  }
+void examobj() {   /* Examine a standard object-thing */
+	if (thing != thinks)  thinkabout(thing, a_thing);
+	switch (thing) {
+	case wine :
+		switch (winestate) {
+			/* 4 is perfect wine. 0 is not holding the wine. */
+		case 1:
+			dixi('t', 1);
+			break; /* Normal examine wine scroll */
+		case 2:
+			dixi('d', 6);
+			break; /* Bad wine */
+		case 3:
+			dixi('d', 7);
+			break; /* Vinegar */
+		}
+		break;
+	case onion:
+		if (rotten_onion)
+			dixi('q', 21); /* Yucky onion. */
+		else
+			dixi('t', 18);
+		break;        /* Normal onion scroll */
+	default:
+		dixi('t', ord(thing)); /* <<< Ordinarily */
+	}
 }
 
-boolean personshere()         /* Person equivalent of "holding" */
-{
- boolean personshere_result;
- if ((person==pardon) || (person=='\0')
-   || (whereis[person]==dna.room))  personshere_result=true;
- else {
-  if (person<'\257')  display("H\4"); else display("Sh\4");
-  display("e isn't around at the moment.");
-  personshere_result=false;
- }
- return personshere_result;
+boolean personshere() {       /* Person equivalent of "holding" */
+	boolean personshere_result;
+	if ((person == pardon) || (person == '\0')
+	        || (whereis[person] == dna.room))  personshere_result = true;
+	else {
+		if (person < '\257')  display("H\4");
+		else display("Sh\4");
+		display("e isn't around at the moment.");
+		personshere_result = false;
+	}
+	return personshere_result;
 }
 
-void exampers()
-{
- if (personshere()) 
- {
-  if (thing!=thinks)  thinkabout(person,a_person);
-  person -= 149;
-   switch (person) { /* Special cases */
-    case '\13': if (wonnim) 
-         {
-          dixi('Q',8); /* "I'm Not Playing!" */
-          return;
-         }
-         break;
-    case '\11': if (lustie_is_asleep) 
-        { dixi('Q',65);     /* He's asleep. (65! Wow!) */ return; }
-        break;
-   }
-   /* Otherwise... */ dixi('p',ord(person));
- }    /* And afterwards... */
- switch (person) {
-  case '\16': if (~ dna.ayles_is_awake)  dixi('Q',13); break; /* u.f.s.? */
- }
+void exampers() {
+	if (personshere()) {
+		if (thing != thinks)  thinkabout(person, a_person);
+		person -= 149;
+		switch (person) { /* Special cases */
+		case '\13':
+			if (wonnim) {
+				dixi('Q', 8); /* "I'm Not Playing!" */
+				return;
+			}
+			break;
+		case '\11':
+			if (lustie_is_asleep) {
+				dixi('Q', 65);     /* He's asleep. (65! Wow!) */ return;
+			}
+			break;
+		}
+		/* Otherwise... */ dixi('p', ord(person));
+	}    /* And afterwards... */
+	switch (person) {
+	case '\16':
+		if (~ dna.ayles_is_awake)  dixi('Q', 13);
+		break; /* u.f.s.? */
+	}
 }
 
-boolean holding()
-{
- boolean holding_result;
- if (set::of(range('\63','\143'), eos).has(thing))  { holding_result=true; return holding_result; } /* Also */
- holding_result=false;
- if (thing>'\144')  display("Be reasonable!"); else
-  if (~ dna.obj[thing])      /* verbs that need "thing" to be in the inventory */
-   display("You're not holding it, Avvy."); else
-    holding_result=true;
- return holding_result;
+boolean holding() {
+	boolean holding_result;
+	if (set::of(range('\63', '\143'), eos).has(thing))  {
+		holding_result = true;    /* Also */
+		return holding_result;
+	}
+	holding_result = false;
+	if (thing > '\144')  display("Be reasonable!");
+	else if (~ dna.obj[thing])     /* verbs that need "thing" to be in the inventory */
+		display("You're not holding it, Avvy.");
+	else
+		holding_result = true;
+	return holding_result;
 }
 
 void examine();
 
-static void special(boolean before)
-{
- switch (dna.room) {
-  case r__yours: switch (thing) {
-             case '\66': if (before)  show_one(5); else show_one(6); break;
-            }
-            break;
- }
+static void special(boolean before) {
+	switch (dna.room) {
+	case r__yours:
+		switch (thing) {
+		case '\66':
+			if (before)  show_one(5);
+			else show_one(6);
+			break;
+		}
+		break;
+	}
 }
 
-void examine()
-{
- /* Examine. EITHER it's an object OR it's an Also OR it's a person OR
-    it's something else. */
- if ((person==pardon) && (thing!=pardon)) 
- {
-  if (holding()) 
-   switch (thing) { /* remember it's been Slipped- ie subtract 49 */
-       case '\1' ... '\61' : examobj(); break; /* Standard object */
-     case '\62' ... '\144' : {
-                  special(true);
-                  display(also[ord(thing)-50][1]); /* Also thing */
-                  special(false);
-                 }
-                 break;
-   }
- } else
-  if (person!=pardon)  exampers();
-   else display("It's just as it looks on the picture.");  /* don't know- guess */
+void examine() {
+	/* Examine. EITHER it's an object OR it's an Also OR it's a person OR
+	   it's something else. */
+	if ((person == pardon) && (thing != pardon)) {
+		if (holding())
+			switch (thing) { /* remember it's been Slipped- ie subtract 49 */
+			case '\1' ... '\61' :
+				examobj();
+				break; /* Standard object */
+			case '\62' ... '\144' : {
+				special(true);
+				display(also[ord(thing) - 50][1]); /* Also thing */
+				special(false);
+			}
+			break;
+			}
+	} else if (person != pardon)  exampers();
+	else display("It's just as it looks on the picture.");  /* don't know- guess */
 }
 
-void inv()     /* the time-honoured command... */
-{
-    char fv; byte q;
-
- q=0; display(string("You're carrying ")+'\4');
- {
-  for( fv='\1'; fv <= numobjs; fv ++)
-   if (obj[fv]) 
-   {
-    q += 1; if (q==carrying)  display(string("and ")+'\4');
-    display(get_better(fv)+'\4');
-    if (fv==wearing)  display(string(", which you're wearing")+'\4');
-     if (q<carrying)  display(string(", ")+'\4');
-   }
-  if (wearing==nowt)  display("...\r\r...and you're stark naked!"); else
-   display('.');
- }
+void inv() {   /* the time-honoured command... */
+	char fv;
+	byte q;
+
+	q = 0;
+	display(string("You're carrying ") + '\4');
+	{
+		for (fv = '\1'; fv <= numobjs; fv ++)
+			if (obj[fv]) {
+				q += 1;
+				if (q == carrying)  display(string("and ") + '\4');
+				display(get_better(fv) + '\4');
+				if (fv == wearing)  display(string(", which you're wearing") + '\4');
+				if (q < carrying)  display(string(", ") + '\4');
+			}
+		if (wearing == nowt)  display("...\r\r...and you're stark naked!");
+		else
+			display('.');
+	}
 }
 
-void swallow()     /* Eat something. */
-{
- switch (thing) {
-  case wine: switch (dna.winestate) {
-         /* 4 is perfect */
-          case 1: {
-              if (dna.teetotal)  { dixi('D',6); return; }
-              dixi('U',1); wobble; dixi('U',2);
-              dna.obj[wine]=false; objectlist;
-              have_a_drink();
-             }
-             break;
-          case 2:case 3: dixi('d',8); break; /* You can't drink it! */
-         }
-         break;
-  case potion: { background(4); dixi('U',3); gameover; background(0); } break;
-  case ink: dixi('U',4); break;
-  case chastity: dixi('U',5); break;
-  case mushroom: {
-             dixi('U',6);
-             gameover;
-            }
-            break;
-  case onion: if (dna.rotten_onion)  dixi('U',11);
-         else {
-          dixi('U',8);
-          dna.obj[onion]=false;
-          objectlist;
-         }
-         break;
-  default:
-    if (set::of(r__argentpub,r__nottspub, eos).has(dna.room)) 
-      display("Try BUYing things before you drink them!");
-    else
-      display("The taste of it makes you retch!");
-         /* Constant- leave this one */
- }
+void swallow() {   /* Eat something. */
+	switch (thing) {
+	case wine:
+		switch (dna.winestate) {
+			/* 4 is perfect */
+		case 1: {
+			if (dna.teetotal)  {
+				dixi('D', 6);
+				return;
+			}
+			dixi('U', 1);
+			wobble;
+			dixi('U', 2);
+			dna.obj[wine] = false;
+			objectlist;
+			have_a_drink();
+		}
+		break;
+		case 2:
+		case 3:
+			dixi('d', 8);
+			break; /* You can't drink it! */
+		}
+		break;
+	case potion: {
+		background(4);
+		dixi('U', 3);
+		gameover;
+		background(0);
+	}
+	break;
+	case ink:
+		dixi('U', 4);
+		break;
+	case chastity:
+		dixi('U', 5);
+		break;
+	case mushroom: {
+		dixi('U', 6);
+		gameover;
+	}
+	break;
+	case onion:
+		if (dna.rotten_onion)  dixi('U', 11);
+		else {
+			dixi('U', 8);
+			dna.obj[onion] = false;
+			objectlist;
+		}
+		break;
+	default:
+		if (set::of(r__argentpub, r__nottspub, eos).has(dna.room))
+			display("Try BUYing things before you drink them!");
+		else
+			display("The taste of it makes you retch!");
+		/* Constant- leave this one */
+	}
 }
 
 void others()
- /* This lists the other people in the room. */
+/* This lists the other people in the room. */
 {
- char fv;
- byte num_people,this_person,here;
+	char fv;
+	byte num_people, this_person, here;
 
 
- num_people=0;
- this_person=0;
- here=dna.room;
+	num_people = 0;
+	this_person = 0;
+	here = dna.room;
 
- for( fv='\227'; fv <= '\262'; fv ++) /* Start at 151 so we don't list Avvy himself! */
-  if (whereis[fv]==here) 
-   num_people += 1;
+	for (fv = '\227'; fv <= '\262'; fv ++) /* Start at 151 so we don't list Avvy himself! */
+		if (whereis[fv] == here)
+			num_people += 1;
 
- /* If nobody's here, we can cut out straight away. */
+	/* If nobody's here, we can cut out straight away. */
 
- if (num_people==0)  return; /* Leave the procedure. */
+	if (num_people == 0)  return; /* Leave the procedure. */
 
- for( fv='\227'; fv <= '\262'; fv ++)
-  if (whereis[fv]==here) 
-  {
-   this_person += 1;
-   if (this_person==1)   /* First on the list. */
-    display(getname(fv)+'\4'); else
-    if (this_person<num_people)    /* The middle... */
-     display(string(", ")+getname(fv)+'\4'); else
-      display(string(" and ")+getname(fv)+'\4'); /* The end. */
-  }
+	for (fv = '\227'; fv <= '\262'; fv ++)
+		if (whereis[fv] == here) {
+			this_person += 1;
+			if (this_person == 1) /* First on the list. */
+				display(getname(fv) + '\4');
+			else if (this_person < num_people) /* The middle... */
+				display(string(", ") + getname(fv) + '\4');
+			else
+				display(string(" and ") + getname(fv) + '\4'); /* The end. */
+		}
 
- if (num_people==1)  display(" is\4"); else display(" are\4");
+	if (num_people == 1)  display(" is\4");
+	else display(" are\4");
 
- display(" here."); /* End and display it. */
+	display(" here."); /* End and display it. */
 }
 
 void lookaround()
 /* This is called when you say "look." */
 {
- display(also[0][1]);
- switch (dna.room) {
-  case r__spludwicks: if (dna.avaricius_talk>0)  dixi('q',23); else others(); break;
-  case r__robins: {
-              if (dna.tied_up)  dixi('q',38);
-              if (dna.mushroom_growing)  dixi('q',55);
-             }
-             break;
-  case r__insidecardiffcastle: if (~ dna.taken_pen)  dixi('q',49); break;
-  case r__lustiesroom: if (dna.lustie_is_asleep)  dixi('q',65); break;
-  case r__catacombs: switch (dna.cat_y*256+dna.cat_x) {
-                 case 258 : dixi('q',80); break; /* Inside art gallery */
-                 case 514 : dixi('q',81); break; /* Outside ditto */
-                 case 260 : dixi('q',82); break; /* Outside Geida's room. */
-                }
-                break;
-  default: others();
- }
+	display(also[0][1]);
+	switch (dna.room) {
+	case r__spludwicks:
+		if (dna.avaricius_talk > 0)  dixi('q', 23);
+		else others();
+		break;
+	case r__robins: {
+		if (dna.tied_up)  dixi('q', 38);
+		if (dna.mushroom_growing)  dixi('q', 55);
+	}
+	break;
+	case r__insidecardiffcastle:
+		if (~ dna.taken_pen)  dixi('q', 49);
+		break;
+	case r__lustiesroom:
+		if (dna.lustie_is_asleep)  dixi('q', 65);
+		break;
+	case r__catacombs:
+		switch (dna.cat_y * 256 + dna.cat_x) {
+		case 258 :
+			dixi('q', 80);
+			break; /* Inside art gallery */
+		case 514 :
+			dixi('q', 81);
+			break; /* Outside ditto */
+		case 260 :
+			dixi('q', 82);
+			break; /* Outside Geida's room. */
+		}
+		break;
+	default:
+		others();
+	}
 }
 
-void opendoor()     /* so whaddya THINK this does?! */
-{
-    byte fv;
-
- switch (dna.room) {   /* Special cases. */
-   case r__yours: if (infield(2)) 
-             {     /* Opening the box. */
-              thing='\66'; /* The box. */ person=pardon;
-              examine();
-              return;
-             }
-             break;
-   case r__spludwicks: if (thing=='\75')  {
-                    dixi('q',85);
-                    return;
-                  }
-                  break;
- }
-
-
- if ((~ dna.user_moves_avvy) & (dna.room!=r__lusties))
-        return; /* No doors can open if you can't move Avvy. */
- for( fv=9; fv <= 15; fv ++)
-  if (infield(fv)) 
-  {
-   { void& with = portals[fv]; 
-    switch (op) {
-     case exclaim: { tr[1].bounce; dixi('x',data); } break;
-     case transport: fliproom(hi(data),lo(data)); break;
-     case unfinished: {
-                  tr[1].bounce;
-                  display("\7Sorry.\3\rThis place is not available yet!");
-                 }
-                 break;
-     case special: call_special(data); break;
-     case mopendoor: open_the_door(hi(data),lo(data),fv); break;
-    }}
-    return;
-   }
- if (dna.room==r__map) 
-  display(string("Avvy, you can complete the whole game without ever going ")+
-                 "to anywhere other than Argent, Birmingham, Cardiff, "+
-                 "Nottingham and Norwich.");
- else display("Door? What door?");
+void opendoor() {   /* so whaddya THINK this does?! */
+	byte fv;
+
+	switch (dna.room) {   /* Special cases. */
+	case r__yours:
+		if (infield(2)) {
+			/* Opening the box. */
+			thing = '\66'; /* The box. */ person = pardon;
+			examine();
+			return;
+		}
+		break;
+	case r__spludwicks:
+		if (thing == '\75')  {
+			dixi('q', 85);
+			return;
+		}
+		break;
+	}
+
+
+	if ((~ dna.user_moves_avvy) & (dna.room != r__lusties))
+		return; /* No doors can open if you can't move Avvy. */
+	for (fv = 9; fv <= 15; fv ++)
+		if (infield(fv)) {
+			{
+				void &with = portals[fv];
+				switch (op) {
+				case exclaim: {
+					tr[1].bounce;
+					dixi('x', data);
+				}
+				break;
+				case transport:
+					fliproom(hi(data), lo(data));
+					break;
+				case unfinished: {
+					tr[1].bounce;
+					display("\7Sorry.\3\rThis place is not available yet!");
+				}
+				break;
+				case special:
+					call_special(data);
+					break;
+				case mopendoor:
+					open_the_door(hi(data), lo(data), fv);
+					break;
+				}
+			}
+			return;
+		}
+	if (dna.room == r__map)
+		display(string("Avvy, you can complete the whole game without ever going ") +
+		        "to anywhere other than Argent, Birmingham, Cardiff, " +
+		        "Nottingham and Norwich.");
+	else display("Door? What door?");
 }
 
 void putproc();
 
 
-static void silly()
-{
- display("Don't be silly!");
+static void silly() {
+	display("Don't be silly!");
 }
 
-void putproc()     /* Called when you call vb_put. */
-{
-    char temp;
-
-
- if (! holding())  return;
- thing2 -= 49;   /* Slip the second object */
- temp=thing; thing=thing2; if (! holding())  return;
- thing=temp;
-
- /* Thing is the thing which you're putting in. Thing2 is where you're
-   putting it. */
-             /* Convenience thing. */
-  switch (thing2) {
-   case wine: if (thing==onion) 
-         {
-          if (dna.rotten_onion) 
-          display(string("That's a bit like shutting the stable door after the ")+
-                   "horse has bolted!");
-          else {     /* Put onion into wine? */
-           if (dna.winestate!=3) 
-            display("\6Oignon au vin\22 is a bit too strong for your tastes!");
-           else {     /* Put onion into vinegar! Yes! */
-            onion_in_vinegar=true;
-            points(7);
-            dixi('u',9);
-           }
-          }
-         } else silly();
-         break;
-
-    case '\66': if (room==1)  /* Put something into the box. */
-         {
-          if (box_contents!=nowt) 
-           display(string("There's something in the box already, Avvy. Try taking")+
-            " that out first.");
-          else
-           switch (thing) {
-            case money: display("You'd better keep some ready cash on you!"); break;
-            case bell: display("That's a silly place to keep a bell."); break;
-            case bodkin: display("But you might need it!"); break;
-            case onion: display("Just give it to Spludwick, Avvy!"); break;
-            default:
-            {     /* Put the object into the box... */
-             if (wearing==thing) 
-              display(string("You'd better take ")+get_better(thing)+" off first!");
-             else
-             {
-              show_one(5); /* Open box. */
-              box_contents=thing;
-              dna.obj[thing]=false;
-              objectlist;
-              display("OK, it's in the box.");
-              show_one(6); /* Shut box. */
-             }
-            }
-           }
-         } else silly();
-         break;
-
-   default: silly();
-  }
+void putproc() {   /* Called when you call vb_put. */
+	char temp;
+
+
+	if (! holding())  return;
+	thing2 -= 49;   /* Slip the second object */
+	temp = thing;
+	thing = thing2;
+	if (! holding())  return;
+	thing = temp;
+
+	/* Thing is the thing which you're putting in. Thing2 is where you're
+	  putting it. */
+	/* Convenience thing. */
+	switch (thing2) {
+	case wine:
+		if (thing == onion) {
+			if (dna.rotten_onion)
+				display(string("That's a bit like shutting the stable door after the ") +
+				        "horse has bolted!");
+			else {     /* Put onion into wine? */
+				if (dna.winestate != 3)
+					display("\6Oignon au vin\22 is a bit too strong for your tastes!");
+				else {     /* Put onion into vinegar! Yes! */
+					onion_in_vinegar = true;
+					points(7);
+					dixi('u', 9);
+				}
+			}
+		} else silly();
+		break;
+
+	case '\66':
+		if (room == 1) { /* Put something into the box. */
+			if (box_contents != nowt)
+				display(string("There's something in the box already, Avvy. Try taking") +
+				        " that out first.");
+			else
+				switch (thing) {
+				case money:
+					display("You'd better keep some ready cash on you!");
+					break;
+				case bell:
+					display("That's a silly place to keep a bell.");
+					break;
+				case bodkin:
+					display("But you might need it!");
+					break;
+				case onion:
+					display("Just give it to Spludwick, Avvy!");
+					break;
+				default: {
+					/* Put the object into the box... */
+					if (wearing == thing)
+						display(string("You'd better take ") + get_better(thing) + " off first!");
+					else {
+						show_one(5); /* Open box. */
+						box_contents = thing;
+						dna.obj[thing] = false;
+						objectlist;
+						display("OK, it's in the box.");
+						show_one(6); /* Shut box. */
+					}
+				}
+				}
+		} else silly();
+		break;
+
+	default:
+		silly();
+	}
 }
 
 boolean give2spludwick();
 
- /* The result of this fn is whether or not he says "Hey, thanks!" */
-static void not_in_order()
-{
- display(string("Sorry, I need the ingredients in the right order for this potion.")+
-  " What I need next is "+
-   get_better(spludwick_order[dna.given2spludwick])+".\232\2");
+/* The result of this fn is whether or not he says "Hey, thanks!" */
+static void not_in_order() {
+	display(string("Sorry, I need the ingredients in the right order for this potion.") +
+	        " What I need next is " +
+	        get_better(spludwick_order[dna.given2spludwick]) + ".\232\2");
 }
 
 
 
-static void go_to_cauldron()
-{
-   tr[2].call_eachstep=false;  /* Stops Geida_Procs. */
-   set_up_timer(1,procspludwick_goes_to_cauldron,reason_spludwalk);
-   tr[2].walkto(2);
+static void go_to_cauldron() {
+	tr[2].call_eachstep = false; /* Stops Geida_Procs. */
+	set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
+	tr[2].walkto(2);
 }
 
 boolean give2spludwick()
 
 {
- boolean give2spludwick_result;
- {
-
-  give2spludwick_result=false;
-
-  if (spludwick_order[given2spludwick]!=thing) 
-  {
-   not_in_order();
-   return give2spludwick_result;
-  }
-
-  switch (thing) {
-   case onion:
-    {
-     obj[onion]=false;
-     if (rotten_onion) 
-      dixi('q',22);
-     else {
-      given2spludwick += 1;
-      dixi('q',20);
-      go_to_cauldron();
-      points(3);
-     }
-     objectlist;
-    }
-    break;
-   case ink: {
-         obj[ink]=false;
-         objectlist;
-         given2spludwick += 1;
-         dixi('q',24);
-         go_to_cauldron();
-         points(3);
-        }
-        break;
-   case mushroom: {
-              obj[mushroom]=false;
-              dixi('q',25);
-              points(5);
-              given2spludwick += 1;
-              go_to_cauldron();
-              obj[potion]=true;
-              objectlist;
-             }
-             break;
-   default: give2spludwick_result=true;
-  }
- }
- return give2spludwick_result;
+	boolean give2spludwick_result;
+	{
+
+		give2spludwick_result = false;
+
+		if (spludwick_order[given2spludwick] != thing) {
+			not_in_order();
+			return give2spludwick_result;
+		}
+
+		switch (thing) {
+		case onion: {
+			obj[onion] = false;
+			if (rotten_onion)
+				dixi('q', 22);
+			else {
+				given2spludwick += 1;
+				dixi('q', 20);
+				go_to_cauldron();
+				points(3);
+			}
+			objectlist;
+		}
+		break;
+		case ink: {
+			obj[ink] = false;
+			objectlist;
+			given2spludwick += 1;
+			dixi('q', 24);
+			go_to_cauldron();
+			points(3);
+		}
+		break;
+		case mushroom: {
+			obj[mushroom] = false;
+			dixi('q', 25);
+			points(5);
+			given2spludwick += 1;
+			go_to_cauldron();
+			obj[potion] = true;
+			objectlist;
+		}
+		break;
+		default:
+			give2spludwick_result = true;
+		}
+	}
+	return give2spludwick_result;
 }
 
-void have_a_drink()
-{
- {
-  alcohol += 1;
-  if (alcohol==5) 
-  {
-   obj[key]=true;  /* Get the key. */
-   teetotal=true;
-   avvy_is_awake=false;
-   avvy_in_bed=true;
-   objectlist;
-   dusk;
-   hang_around_for_a_while;
-   fliproom(1,1);
-   background(14);
-   new_game_for_trippancy; /* Not really */
-  }
- }
+void have_a_drink() {
+	{
+		alcohol += 1;
+		if (alcohol == 5) {
+			obj[key] = true; /* Get the key. */
+			teetotal = true;
+			avvy_is_awake = false;
+			avvy_in_bed = true;
+			objectlist;
+			dusk;
+			hang_around_for_a_while;
+			fliproom(1, 1);
+			background(14);
+			new_game_for_trippancy; /* Not really */
+		}
+	}
 }
 
-void cardiff_climbing()
-{
- if (dna.standing_on_dais) 
- {     /* Clamber up. */
-  display("You climb down, back onto the floor.");
-  dna.standing_on_dais=false;
-  apped(1,3);
- } else
- {     /* Clamber down. */
-  if (infield(1)) 
-  {
-    display("You clamber up onto the dais.");
-    dna.standing_on_dais=true;
-    apped(1,2);
-  } else
-    display("Get a bit closer, Avvy.");
- }
+void cardiff_climbing() {
+	if (dna.standing_on_dais) {
+		/* Clamber up. */
+		display("You climb down, back onto the floor.");
+		dna.standing_on_dais = false;
+		apped(1, 3);
+	} else {
+		/* Clamber down. */
+		if (infield(1)) {
+			display("You clamber up onto the dais.");
+			dna.standing_on_dais = true;
+			apped(1, 2);
+		} else
+			display("Get a bit closer, Avvy.");
+	}
 }
 
 void stand_up();
 
-  /* Called when you ask Avvy to stand. */
-static void already()
-{
- display("You're already standing!");
+/* Called when you ask Avvy to stand. */
+static void already() {
+	display("You're already standing!");
 }
 
-void stand_up()
-{
-  switch (dna.room) {
-   case r__yours: /* Avvy isn't asleep. */
-              if (avvy_in_bed)    /* But he's in bed. */
-              {
-               if (teetotal) 
-               {
-                dixi('d',12);
-                background(0);
-                dixi('d',14);
-               }
-               tr[1].visible=true;
-               user_moves_avvy=true;
-               apped(1,2);
-               dna.rw=left;
-               show_one(4); /* Picture of empty pillow. */
-               points(1);
-               avvy_in_bed=false;
-               lose_timer(reason_arkata_shouts);
-              } else already();
-              break;
-
-    case r__insidecardiffcastle: cardiff_climbing(); break;
-
-    case r__nottspub: if (sitting_in_pub)  {
-                  show_one(4); /* Not sitting down. */
-                  tr[1].visible=true;  /* But standing up. */
-                  apped(1,4); /* And walking away. */
-                  sitting_in_pub=false;  /* Really not sitting down. */
-                  user_moves_avvy=true;  /* And ambulant. */
-                 } else already();
-                 break;
-   default: already();
-  }
+void stand_up() {
+	switch (dna.room) {
+	case r__yours: /* Avvy isn't asleep. */
+		if (avvy_in_bed) {  /* But he's in bed. */
+			if (teetotal) {
+				dixi('d', 12);
+				background(0);
+				dixi('d', 14);
+			}
+			tr[1].visible = true;
+			user_moves_avvy = true;
+			apped(1, 2);
+			dna.rw = left;
+			show_one(4); /* Picture of empty pillow. */
+			points(1);
+			avvy_in_bed = false;
+			lose_timer(reason_arkata_shouts);
+		} else already();
+		break;
+
+	case r__insidecardiffcastle:
+		cardiff_climbing();
+		break;
+
+	case r__nottspub:
+		if (sitting_in_pub)  {
+			show_one(4); /* Not sitting down. */
+			tr[1].visible = true; /* But standing up. */
+			apped(1, 4); /* And walking away. */
+			sitting_in_pub = false; /* Really not sitting down. */
+			user_moves_avvy = true; /* And ambulant. */
+		} else already();
+		break;
+	default:
+		already();
+	}
 }
 
-void getproc(char thing)
-{
-  switch (room) {
-   case r__yours:
-     if (infield(2)) 
-     {
-      if (box_contents==thing) 
-      {
-       show_one(5);
-       display("OK, I've got it.");
-       obj[thing]=true; objectlist;
-       box_contents=nowt;
-       show_one(6);
-      } else
-       display(string("I can't see ")+get_better(thing)+" in the box.");
-     } else dixi('q',57);
-     break;
-  case r__insidecardiffcastle:
-    switch (thing) {
-     case pen:
-     {
-      if (infield(2)) 
-      {     /* Standing on the dais. */
-
-       if (dna.taken_pen) 
-        display("It's not there, Avvy.");
-       else
-       {     /* OK: we're taking the pen, and it's there. */
-        show_one(4); /* No pen there now. */
-        call_special(3); /* Zap! */
-        dna.taken_pen=true;
-        dna.obj[pen]=true;
-        objectlist;
-        display("Taken.");
-       }
-      } else if (dna.standing_on_dais)  dixi('q',53); else dixi('q',51);
-     }
-     break;
-      case bolt: dixi('q',52); break;
-     default: dixi('q',57);
-    }
-    break;
-  case r__robins: if ((thing==mushroom) & (infield(1)) & (dna.mushroom_growing))
-                  {
-              show_one(3);
-              display("Got it!");
-              dna.mushroom_growing=false;
-              dna.taken_mushroom=true;
-              dna.obj[mushroom]=true;
-              objectlist;
-              points(3);
-             } else dixi('q',57);
-             break;
-  default: dixi('q',57);
- }
+void getproc(char thing) {
+	switch (room) {
+	case r__yours:
+		if (infield(2)) {
+			if (box_contents == thing) {
+				show_one(5);
+				display("OK, I've got it.");
+				obj[thing] = true;
+				objectlist;
+				box_contents = nowt;
+				show_one(6);
+			} else
+				display(string("I can't see ") + get_better(thing) + " in the box.");
+		} else dixi('q', 57);
+		break;
+	case r__insidecardiffcastle:
+		switch (thing) {
+		case pen: {
+			if (infield(2)) {
+				/* Standing on the dais. */
+
+				if (dna.taken_pen)
+					display("It's not there, Avvy.");
+				else {
+					/* OK: we're taking the pen, and it's there. */
+					show_one(4); /* No pen there now. */
+					call_special(3); /* Zap! */
+					dna.taken_pen = true;
+					dna.obj[pen] = true;
+					objectlist;
+					display("Taken.");
+				}
+			} else if (dna.standing_on_dais)  dixi('q', 53);
+			else dixi('q', 51);
+		}
+		break;
+		case bolt:
+			dixi('q', 52);
+			break;
+		default:
+			dixi('q', 57);
+		}
+		break;
+	case r__robins:
+		if ((thing == mushroom) & (infield(1)) & (dna.mushroom_growing)) {
+			show_one(3);
+			display("Got it!");
+			dna.mushroom_growing = false;
+			dna.taken_mushroom = true;
+			dna.obj[mushroom] = true;
+			objectlist;
+			points(3);
+		} else dixi('q', 57);
+		break;
+	default:
+		dixi('q', 57);
+	}
 }
 
-void give_geida_the_lute()
-{
- {
-  if (room!=r__lustiesroom) 
-  {
-   display("Not yet. Try later!\232\2");
-   return;
-  }
-  dna.obj[lute]=false;
-  objectlist;
-  dixi('q',64); /* She plays it. */
-
-   /* And the rest has been moved to Timeout... under give_lute_to_Geida. */
-
-  set_up_timer(1,procgive_lute_to_geida,reason_geida_sings);
-  back_to_bootstrap(4);
- }
+void give_geida_the_lute() {
+	{
+		if (room != r__lustiesroom) {
+			display("Not yet. Try later!\232\2");
+			return;
+		}
+		dna.obj[lute] = false;
+		objectlist;
+		dixi('q', 64); /* She plays it. */
+
+		/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+
+		set_up_timer(1, procgive_lute_to_geida, reason_geida_sings);
+		back_to_bootstrap(4);
+	}
 }
 
-void play_harp()
-{
- if (infield(7)) 
-  musical_scroll;
- else display("Get a bit closer to it, Avvy!");
+void play_harp() {
+	if (infield(7))
+		musical_scroll;
+	else display("Get a bit closer to it, Avvy!");
 }
 
-void winsequence()
-{
- dixi('q',78);
- first_show(7); then_show(8); then_show(9);
- start_to_close;
- set_up_timer(30,procwinning,reason_winning);
+void winsequence() {
+	dixi('q', 78);
+	first_show(7);
+	then_show(8);
+	then_show(9);
+	start_to_close;
+	set_up_timer(30, procwinning, reason_winning);
 }
 
-void person_speaks()
-{
-    boolean found; byte fv; char cfv;
-
-
-  if ((person==pardon) || (person=='\0')) 
-  {
-   if ((him==pardon) || (whereis[him]!=dna.room))  person=her;
-    else person=him;
-  }
-
-  if (whereis[person]!=dna.room) 
-  {
-   display("\231\4"); /* Avvy himself! */
-   return;
-  }
-
-  found=false;  /* The person we're looking for's code is in Person. */
-
-  for( fv=1; fv <= numtr; fv ++)
-   if (tr[fv].quick & (chr(tr[fv].a.accinum+149)==person)) 
-   {
-    display(string('\23')+chr(fv+48)+'\4');
-    found=true;
-   }
-
-  if (! found) 
-    for( fv=10; fv <= 25; fv ++)
-     { void& with = quasipeds[fv]; 
-     if ((who==person) && (room==dna.room)) 
-     {
-      display(string('\23')+chr(fv+55)+'\4');
-     }}
+void person_speaks() {
+	boolean found;
+	byte fv;
+	char cfv;
+
+
+	if ((person == pardon) || (person == '\0')) {
+		if ((him == pardon) || (whereis[him] != dna.room))  person = her;
+		else person = him;
+	}
+
+	if (whereis[person] != dna.room) {
+		display("\231\4"); /* Avvy himself! */
+		return;
+	}
+
+	found = false; /* The person we're looking for's code is in Person. */
+
+	for (fv = 1; fv <= numtr; fv ++)
+		if (tr[fv].quick & (chr(tr[fv].a.accinum + 149) == person)) {
+			display(string('\23') + chr(fv + 48) + '\4');
+			found = true;
+		}
+
+	if (! found)
+		for (fv = 10; fv <= 25; fv ++) {
+			void &with = quasipeds[fv];
+			if ((who == person) && (room == dna.room)) {
+				display(string('\23') + chr(fv + 55) + '\4');
+			}
+		}
 }
 
 void do_that();
 
-static void heythanks()
-{
-  person_speaks();
-  display("Hey, thanks!\2(But now, you've lost it!)");
-  dna.obj[thing]=false;
+static void heythanks() {
+	person_speaks();
+	display("Hey, thanks!\2(But now, you've lost it!)");
+	dna.obj[thing] = false;
 }
 
-void do_that()
-{
-      const array<'\63','\72',varying_string<6> > booze = {{"Bitter","GIED","Whisky","Cider","","","","Mead"}};
-    byte fv,ff; integer sx,sy; boolean ok;
-
-
- if (thats==nowt)  { thats=""; return; }
- if (weirdword)  return;
- if (thing<'\310')  thing -= 49;   /* "Slip" */
-
- if ((~ alive) &
-  ! (set::of(vb_load,vb_save,vb_quit,vb_info,vb_help,vb_larrypass,
-     vb_phaon,vb_boss,vb_cheat,vb_restart,vb_dir,vb_score,
-     vb_highscores,vb_smartalec, eos).has(verb)))
-       {
-        display(string("You're dead, so don't talk. What are you, a ghost ")+
-         "or something? Try restarting, or restoring a saved game!"); return;
-       }
-
- if ((~ dna.avvy_is_awake) &
-  ! (set::of(vb_load,vb_save,vb_quit,vb_info,vb_help,vb_larrypass,
-     vb_phaon,vb_boss,vb_cheat,vb_restart,vb_dir,vb_die,vb_score,
-     vb_highscores,vb_smartalec,vb_expletive,vb_wake, eos).has(verb)))
-       {
-        display("Talking in your sleep? Try waking up!"); return;
-       }
-
-
- switch (verb) {
-  case vb_exam: examine(); break;
-  case vb_open: opendoor(); break;
-  case vb_pause: display(string("Game paused.")+'\3'+'\15'+'\15'+"Press Enter, Esc, or click "+
-             "the mouse on the `O.K.\" box to continue.");
-             break;
-  case vb_get: {
-           if (thing!=pardon) 
-           {     /* Legitimate try to pick something up. */
-            if (dna.carrying>=maxobjs)  display("You can't carry any more!");
-            else getproc(thing);
-
-           } else
-           {     /* Not... ditto. */
-            if (person!=pardon) 
-             display("You can't sweep folk off their feet!"); else
-            display("I assure you, you don't need it.");
-           }
-          }
-          break;
-  case vb_drop: display(string("Two years ago you dropped a florin in the street. Three days ")+
-       "later it was gone! So now you never leave ANYTHING lying around. OK?");
-       break;
-/*       begin dna.obj[thing]:=false; objectlist; end;*/
-  case vb_inv: inv(); break;
-  case vb_talk:  if (person==pardon) 
-            {
-              if (subjnumber==99)   /* They typed "say password". */
-                display("Yes, but what \6is\22 the password?");
-              else if (set::of(range(1,49),253,249, eos).has(subjnumber)) 
-              {
-                Delete(thats,1,1);
-                move(realwords[2],realwords[1],sizeof(realwords)-sizeof(realwords[1]));
-                verb=chr(subjnumber);
-                do_that(); return;
-              } else
-              {
-                person=chr(subjnumber); subjnumber=0;
-                if (set::of(pardon,'\0', eos).has(person))  display("Talk to whom?");
-                 else if (personshere())  talkto(ord(person));
-              }
-            } else if (person==pardon)  display("Talk to whom?");
-            else if (personshere())  talkto(ord(person));
-            break;
-
-  case vb_give: if (holding()) 
-           {
-            if (person==pardon)  display("Give to whom?"); else
-            if (personshere()) 
-            {
-             switch (thing) {
-              case money : display("You can't bring yourself to give away your moneybag."); break;
-              case bodkin:case bell:case clothes:case habit :
-                    display("Don't give it away, it might be useful!");
-                    break;
-              default: switch (person) {
-                      case pcrapulus: switch (thing) {
-                                 case wine: {
-                                        display("Crapulus grabs the wine and gulps it down.");
-                                        dna.obj[wine]=false;
-                                       }
-                                       break;
-                                 default: heythanks();
-                                }
-                                break;
-                     case pcwytalot: if (set::of(crossbow,bolt, eos).has(thing)) 
-                                 display(string("You might be able to influence ")+
-                                 "Cwytalot more if you used it!");
-                                else heythanks();
-                                break;
-                     case pspludwick: if (give2spludwick())  heythanks(); break;
-                     case pibythneth: if (thing==badge) 
-                                 {
-                                  dixi('q',32); /* Thanks! Wow! */
-                                  points(3);
-                                  dna.obj[badge]=false;
-                                  dna.obj[habit]=true;
-                                  dna.givenbadgetoiby=true;
-                                  show_one(8); show_one(9);
-                                 } else heythanks();
-                                 break;
-                     case payles: if (dna.ayles_is_awake) 
-                             {
-                               if (thing==pen) 
-                               {
-                                dna.obj[pen]=false;
-                                dixi('q',54);
-                                dna.obj[ink]=true;
-                                dna.given_pen_to_ayles=true;
-                                objectlist;
-                                points(2);
-                               } else heythanks();
-                             } else
-                               display("But he's asleep!");
-                               break;
-                     case pgeida: switch (thing) {
-                              case potion : {
-                                        dna.obj[potion]=false;
-                                        dixi('u',16); /* She drinks it. */
-                                        points(2);
-                                        dna.geida_given_potion=true;
-                                        objectlist;
-                                       }
-                                       break;
-                              case lute: give_geida_the_lute(); break;
-                              default: heythanks();
-                             }
-                             break;
-                     case parkata: switch (thing) {
-                              case potion: if (dna.geida_given_potion) 
-                                       winsequence();
-                                      else dixi('q',77);
-                                      break;             /* That Geida woman! */
-                              default: heythanks();
-                             }
-                             break;
-                    default: heythanks();
-                   }
-             }
-            }
-            objectlist; /* Just in case... */
-           }
-           break;
-
-  case vb_eat:case vb_drink: if (holding())  swallow(); break;
-  case vb_load: edna_load(realwords[2]); break;
-  case vb_save: if (alive)  edna_save(realwords[2]);
-           else display("It's a bit late now to save your game!");
-           break;
-  case vb_pay: display("No money need change hands."); break;
-  case vb_look: lookaround(); break;
-  case vb_break: display("Vandalism is prohibited within this game!"); break;
-  case vb_quit: { /* quit */
-            if (demo) 
-            {
-             dixi('q',31);
-             close(demofile);
-             exit(0); /* Change this later!!! */
-            }
-        if (! polite)  display("How about a `please\", Avvy?"); else
-         if (ask("\23C\26Do you really want to quit?"))  lmo=true;
-       }
-       break;
-  case vb_go: display("Just use the arrow keys to walk there."); break;
-  case vb_info: {
-            aboutscroll=true;
-/*            display('Thorsoft of Letchworth presents:'+^c+^m+^m+
-             'The medi‘val descendant of'+^m+
-             'Denarius Avaricius Sextus'+^m+'in:'+
-             ^m+^m+'LORD AVALOT D''ARGENT'+
-             ^m+'version '+vernum+^m+^m+'Copyright ï '
-             +copyright+', Mark, Mike and Thomas Thurman.');*/
-             display(string("\r\r\r\r\r\r\r")+"LORD AVALOT D'ARGENT"+"\3\r"+
-              "The medi‘val descendant of"+'\15'+
-              "Denarius Avaricius Sextus"+
-              '\15'+'\15'+"version "+vernum+'\15'+'\15'+"Copyright ï "
-              +copyright+", Mark, Mike and Thomas Thurman."+'\23'+'Y'+'\26');
-             aboutscroll=false;
-           }
-           break;
-  case vb_undress: if (dna.wearing==nowt)  display("You're already stark naked!");
-               else
-            if (dna.avvys_in_the_cupboard) 
-            {
-             display(string("You take off ")+get_better(dna.wearing)+'.');
-             dna.wearing=nowt; objectlist;
-            } else
-            display("Hadn't you better find somewhere more private, Avvy?");
-            break;
-  case vb_wear: if (holding()) 
-       {     /* wear something */
-        switch (thing) {
-         case chastity: display("Hey, what kind of a weirdo are you\??!"); break;
-         case clothes:case habit: { /* Change this! */
-                         if (dna.wearing!=nowt) 
-                         {
-                          if (dna.wearing==thing) 
-                            display("You're already wearing that.");
-                          else
-                            display(string("You'll be rather warm wearing two ")+
-                           "sets of clothes!");
-                          return;
-                         } else
-                         dna.wearing=thing; objectlist;
-                         if (thing==habit)  fv=3; else fv=0;
-                         { void& with = tr[1]; 
-                          if (whichsprite!=fv) 
-                          {
-                           sx=tr[1].x; sy=tr[1].y;
-                           done;
-                           init(fv,true);
-                           appear(sx,sy,left);
-                           tr[1].visible=false;
-                          }}
-                        }
-                        break;
-         default: display(what);
-        }
-       }
-       break;
-  case vb_play: if (thing==pardon) 
-            switch (dna.room) { /* They just typed "play"... */
-             case r__argentpub: play_nim; break; /* ...in the pub, => play Nim. */
-             case r__musicroom: play_harp(); break;
-            }
-           else if (holding()) 
-           {
-            switch (thing) {
-             case lute : {
-                     dixi('U',7);
-                     if (whereis[pcwytalot]==dna.room)  dixi('U',10);
-                     if (whereis[pdulustie]==dna.room)  dixi('U',15);
-                    }
-                    break;
-             case '\64' : if (dna.room==r__musicroom)  play_harp();
-                    else display(what);
-                    break;
-             case '\67' : if (dna.room==r__argentpub)  play_nim;
-                    else display(what);
-                    break;
-             default: display(what);
-            }
-           }
-           break;
-  case vb_ring: if (holding()) 
-       {
-        if (thing==bell) 
-        {
-         display("Ding, dong, ding, dong, ding, dong, ding, dong...");
-         if ((dna.ringing_bells) & (flagset('B'))) 
-          display("(Are you trying to join in, Avvy\?\?!)");
-        } else display(what);
-       }
-       break;
-  case vb_help: boot_help; break;
-  case vb_larrypass: display("Wrong game!"); break;
-  case vb_phaon: display("Hello, Phaon!"); break;
-  case vb_boss: bosskey; break;
-  case vb_pee: if (flagset('P')) 
-          {
-           display("Hmm, I don't think anyone will notice...");
-           set_up_timer(4,procurinate,reason_gototoilet);
-          } else display("It would be \6VERY\22 unwise to do that here, Avvy!");
-          break;
-  case vb_cheat: {
-             display(string('\6')+"Cheat mode now enabled.");
-             cheat=true;
-            }
-            break;
-  case vb_magic: if (dna.avaricius_talk>0) 
-             dixi('q',19);
-            else {
-             if ((dna.room==12) & (infield(2))) 
-             {     /* Avaricius appears! */
-              dixi('q',17);
-              if (whereis['\227']==12) 
-               dixi('q',18);
-              else
-              {
-               tr[2].init(1,false); /* Avaricius */
-               apped(2,4);
-               tr[2].walkto(5);
-               tr[2].call_eachstep=true;
-               tr[2].eachstep=procback_and_forth;
-               dna.avaricius_talk=14;
-               set_up_timer(177,procavaricius_talks,reason_avariciustalks);
-              }
-             } else display("Nothing appears to happen...");
-            }
-            break;
-  case vb_smartalec: display("Listen, smart alec, that was just rhetoric."); break;
-  case vb_expletive: {
-         switch (swore) {
-          case 0: display(string("Avvy! Do you mind? There might be kids playing!\r\r")+
-              "(I shouldn't say it again, if I were you!)");
-              break;
-          case 1: display(string("You hear a distant rumble of thunder. Must you always ")+
-              "do things I tell you not to?\r\rDon't do it again!");
-              break;
-         default:
-          {
-           zonk;
-           display(string("A crack of lightning shoots from the sky, ")+
-            "and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
-           gameover;
-          }
-         }
-         swore += 1;
-        }
-        break;
-  case vb_listen: if ((dna.ringing_bells) & (flagset('B'))) 
-              display(string("All other noise is drowned out by the ringing of ")+
-                       "the bells.");
-             else
-              if (listen=="") 
-               display("You can't hear anything much at the moment, Avvy.");
-                else display(listen);
-                break;
-  case vb_buy: {
-           /* What are they trying to buy? */
-           switch (dna.room) {
-            case r__argentpub: if (infield(6)) 
-                {     /* We're in a pub, and near the bar. */
-                 switch (thing) {
-                  case '\63':case '\65':case '\66':case '\72': { /* Beer, whisky, cider or mead */
-                            if (dna.malagauche==177)   /* Already getting us one. */
-                              { dixi('D',15); return; }
-                            if (dna.teetotal)  { dixi('D',6); return; }
-                            if (dna.alcohol==0)  points(3);
-                            show_one(12);
-                            display(booze[thing]+", please.\231\2");
-                            dna.drinking=thing;
-
-                            show_one(10);
-                            dna.malagauche=177;
-                            set_up_timer(27,procbuydrinks,reason_drinks);
-                           }
-                           break;
-                  case '\64': examine(); break; /* We have a right one here- buy Pepsi??! */
-                  case wine: if (dna.obj[wine])  /* We've already got the wine! */
-                          dixi('D',2); /* 1 bottle's shufishent! */
-                         else {
-                          if (dna.malagauche==177)   /* Already getting us one. */
-                            { dixi('D',15); return; }
-                          if (dna.carrying>=maxobjs) 
-                             { display("Your hands are full."); return; }
-                          show_one(12); display("Wine, please.\231\2");
-                          if (dna.alcohol==0)  points(3);
-                          show_one(10);
-                          dna.malagauche=177;
-
-                          set_up_timer(27,procbuywine,reason_drinks);
-                         }
-                         break;
-                 }
-                } else dixi('D',5);
-                break;                /* Go to the bar! */
-
-            case r__outsideducks: if (infield(6)) 
-             {
-              if (thing==onion) 
-              {
-               if (dna.obj[onion]) 
-                dixi('D',10); /* not planning to juggle with the things! */
-               else
-               if (dna.carrying>=maxobjs) 
-                  display("Before you ask, you remember that your hands are full.");
-               else
-               {
-                if (dna.bought_onion) 
-                 dixi('D',11); else
-                  { dixi('D',9); points(3); }
-                pennycheck(3); /* It costs thruppence. */
-                dna.obj[onion]=true;
-                objectlist;
-                dna.bought_onion=true;
-                dna.rotten_onion=false;  /* It's OK when it leaves the stall! */
-                dna.onion_in_vinegar=false;
-               }
-              } else dixi('D',0);
-             } else dixi('D',0);
-             break;
-
-             case r__nottspub: dixi('n',15); break; /* Can't sell to southerners. */
-            default: dixi('D',0); /* Can't buy that. */
-           }
-          }
-          break;
-  case vb_attack: {
-              if ((dna.room==r__brummieroad) &&
-               ((person=='\235') || (thing==crossbow) || (thing==bolt))
-               && (whereis['\235']==dna.room)) 
-              {
-               switch (ord(dna.obj[bolt])+ord(dna.obj[crossbow])*2) {
-                /* 0 = neither, 1 = only bolt, 2 = only crossbow,
-                  3 = both. */
-                case 0: {
-                    dixi('Q',10);
-                    display("(At the very least, don't use your bare hands!)");
-                   }
-                   break;
-                case 1: display(string("Attack him with only a crossbow bolt? Are you ")+
-                    "planning on playing darts?!");
-                    break;
-                case 2: display(string("Come on, Avvy! You're not going to get very far ")+
-                     "with only a crossbow!");
-                     break;
-                case 3: {
-                    dixi('Q',11);
-                    dna.cwytalot_gone=true;
-                    dna.obj[bolt]=false; dna.obj[crossbow]=false;
-                    objectlist;
-                    magics[12].op=nix;
-                    points(7);
-                    tr[2].walkto(2);
-                    tr[2].vanishifstill=true;
-                    tr[2].call_eachstep=false;
-                    whereis['\235']=177;
-                   }
-                   break;
-                default: dixi('Q',10); /* Please try not to be so violent! */
-               }
-              } else dixi('Q',10);
-             }
-             break;
-  case vb_password: if (dna.room!=r__bridge) 
-                dixi('Q',12); else
-               {
-                ok=true;
-                for( ff=1; ff <= length(thats); ff ++)
-                 for( fv=1; fv <= length(words[dna.pass_num+first_password].w); fv ++)
-                  if (words[dna.pass_num+first_password].w[fv] !=
-                          upcase(realwords[ff][fv]))
-                        ok=false;
-                if (ok) 
-                {
-                 if (dna.drawbridge_open!=0) 
-                   display("Contrary to your expectations, the drawbridge fails to close again.");
-                 else
-                 {
-                    points(4);
-                    display("The drawbridge opens!");
-                    set_up_timer(7,procopen_drawbridge,reason_drawbridgefalls);
-                    dna.drawbridge_open=1;
-                 }
-                } else dixi('Q',12);
-               }
-               break;
-   case vb_dir: dir(realwords[2]); break;
-   case vb_die: gameover; break;
-   case vb_score: display(string("Your score is ")+strf(dna.score)+",\3\rout of a "+
-                      "possible 128.\r\rThis gives you a rank of "+rank()+
-                      ".\r\r"+totaltime());
-                      break;
-   case vb_put: putproc(); break;
-   case vb_stand: stand_up(); break;
-
-   case vb_kiss: if (person==pardon)
-                   display("Kiss whom?");
-            else if (personshere()) 
-            switch (person) {
-             case '\226' ... '\256': display("Hey, what kind of a weirdo are you??"); break;
-             case parkata: dixi('U',12); break;
-             case pgeida: dixi('U',13); break;
-             case pwisewoman: dixi('U',14); break;
-             default: dixi('U',5); /* You WHAT? */
-            }
-            break;
-
-   case vb_climb: if (dna.room==r__insidecardiffcastle)  cardiff_climbing();
-             else /* In the wrong room! */
-              display("Not with your head for heights, Avvy!");
-              break;
-
-   case vb_jump: {
-             set_up_timer(1,procjump,reason_jumping);
-             dna.user_moves_avvy=false;
-            }
-            break;
-
-   case vb_highscores: show_highs; break;
-
-   case vb_wake: if (personshere()) 
-              switch (person) {
-               case pardon:case pavalot:case '\0': if (~ avvy_is_awake) 
-                    {
-                     avvy_is_awake=true;
-                     points(1);
-                     avvy_in_bed=true;
-                     show_one(3); /* Picture of Avvy, awake in bed. */
-                     if (teetotal)  dixi('d',13);
-                    } else display("You're already awake, Avvy!");
-                    break;
-               case payles: if (~ ayles_is_awake)  display("You can't seem to wake him by yourself."); break;
-               case pjacques: display(string("Brother Jacques, Brother Jacques, are you asleep?\231\2")+
-                          "Hmmm... that doesn't seem to do any good...");
-                          break;
-               default: display("It's difficult to awaken people who aren't asleep...!");
-              }
-              break;
-
-   case vb_sit: if (dna.room==r__nottspub) 
-           {
-            if (dna.sitting_in_pub) 
-             display("You're already sitting!");
-            else
-            {
-             tr[1].walkto(4); /* Move Avvy to the place, and sit him down. */
-             set_up_timer(1,procavvy_sit_down,reason_sitting_down);
-            }
-           } else
-           {     /* Default doodah. */
-            dusk;
-            hang_around_for_a_while;
-            dawn;
-            display("A few hours later...\20nothing much has happened...");
-           }
-           break;
-
-   case vb_restart: if (ask("Restart game and lose changes?"))  {
-                dusk;
-                newgame;
-                dawn;
-               }
-               break;
-
-  case pardon: display("Hey, a verb would be helpful!"); break;
-
-  case vb_hello: { person_speaks(); display("Hello.\2"); } break;
-  case vb_thanks: { person_speaks(); display("That's OK.\2"); } break;
-  default: display(string('\7')+"Parser bug!");
- }
+void do_that() {
+	const array < '\63', '\72', varying_string<6> > booze = {{"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"}};
+	byte fv, ff;
+	integer sx, sy;
+	boolean ok;
+
+
+	if (thats == nowt)  {
+		thats = "";
+		return;
+	}
+	if (weirdword)  return;
+	if (thing < '\310')  thing -= 49; /* "Slip" */
+
+	if ((~ alive) &
+	        !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+	                  vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
+	                  vb_highscores, vb_smartalec, eos).has(verb))) {
+		display(string("You're dead, so don't talk. What are you, a ghost ") +
+		        "or something? Try restarting, or restoring a saved game!");
+		return;
+	}
+
+	if ((~ dna.avvy_is_awake) &
+	        !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+	                  vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
+	                  vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
+		display("Talking in your sleep? Try waking up!");
+		return;
+	}
+
+
+	switch (verb) {
+	case vb_exam:
+		examine();
+		break;
+	case vb_open:
+		opendoor();
+		break;
+	case vb_pause:
+		display(string("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
+		        "the mouse on the `O.K.\" box to continue.");
+		break;
+	case vb_get: {
+		if (thing != pardon) {
+			/* Legitimate try to pick something up. */
+			if (dna.carrying >= maxobjs)  display("You can't carry any more!");
+			else getproc(thing);
+
+		} else {
+			/* Not... ditto. */
+			if (person != pardon)
+				display("You can't sweep folk off their feet!");
+			else
+				display("I assure you, you don't need it.");
+		}
+	}
+	break;
+	case vb_drop:
+		display(string("Two years ago you dropped a florin in the street. Three days ") +
+		        "later it was gone! So now you never leave ANYTHING lying around. OK?");
+		break;
+		/*       begin dna.obj[thing]:=false; objectlist; end;*/
+	case vb_inv:
+		inv();
+		break;
+	case vb_talk:
+		if (person == pardon) {
+			if (subjnumber == 99) /* They typed "say password". */
+				display("Yes, but what \6is\22 the password?");
+			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
+				Delete(thats, 1, 1);
+				move(realwords[2], realwords[1], sizeof(realwords) - sizeof(realwords[1]));
+				verb = chr(subjnumber);
+				do_that();
+				return;
+			} else {
+				person = chr(subjnumber);
+				subjnumber = 0;
+				if (set::of(pardon, '\0', eos).has(person))  display("Talk to whom?");
+				else if (personshere())  talkto(ord(person));
+			}
+		} else if (person == pardon)  display("Talk to whom?");
+		else if (personshere())  talkto(ord(person));
+		break;
+
+	case vb_give:
+		if (holding()) {
+			if (person == pardon)  display("Give to whom?");
+			else if (personshere()) {
+				switch (thing) {
+				case money :
+					display("You can't bring yourself to give away your moneybag.");
+					break;
+				case bodkin:
+				case bell:
+				case clothes:
+				case habit :
+					display("Don't give it away, it might be useful!");
+					break;
+				default:
+					switch (person) {
+					case pcrapulus:
+						switch (thing) {
+						case wine: {
+							display("Crapulus grabs the wine and gulps it down.");
+							dna.obj[wine] = false;
+						}
+						break;
+						default:
+							heythanks();
+						}
+						break;
+					case pcwytalot:
+						if (set::of(crossbow, bolt, eos).has(thing))
+							display(string("You might be able to influence ") +
+							        "Cwytalot more if you used it!");
+						else heythanks();
+						break;
+					case pspludwick:
+						if (give2spludwick())  heythanks();
+						break;
+					case pibythneth:
+						if (thing == badge) {
+							dixi('q', 32); /* Thanks! Wow! */
+							points(3);
+							dna.obj[badge] = false;
+							dna.obj[habit] = true;
+							dna.givenbadgetoiby = true;
+							show_one(8);
+							show_one(9);
+						} else heythanks();
+						break;
+					case payles:
+						if (dna.ayles_is_awake) {
+							if (thing == pen) {
+								dna.obj[pen] = false;
+								dixi('q', 54);
+								dna.obj[ink] = true;
+								dna.given_pen_to_ayles = true;
+								objectlist;
+								points(2);
+							} else heythanks();
+						} else
+							display("But he's asleep!");
+						break;
+					case pgeida:
+						switch (thing) {
+						case potion : {
+							dna.obj[potion] = false;
+							dixi('u', 16); /* She drinks it. */
+							points(2);
+							dna.geida_given_potion = true;
+							objectlist;
+						}
+						break;
+						case lute:
+							give_geida_the_lute();
+							break;
+						default:
+							heythanks();
+						}
+						break;
+					case parkata:
+						switch (thing) {
+						case potion:
+							if (dna.geida_given_potion)
+								winsequence();
+							else dixi('q', 77);
+							break;             /* That Geida woman! */
+						default:
+							heythanks();
+						}
+						break;
+					default:
+						heythanks();
+					}
+				}
+			}
+			objectlist; /* Just in case... */
+		}
+		break;
+
+	case vb_eat:
+	case vb_drink:
+		if (holding())  swallow();
+		break;
+	case vb_load:
+		edna_load(realwords[2]);
+		break;
+	case vb_save:
+		if (alive)  edna_save(realwords[2]);
+		else display("It's a bit late now to save your game!");
+		break;
+	case vb_pay:
+		display("No money need change hands.");
+		break;
+	case vb_look:
+		lookaround();
+		break;
+	case vb_break:
+		display("Vandalism is prohibited within this game!");
+		break;
+	case vb_quit: { /* quit */
+		if (demo) {
+			dixi('q', 31);
+			close(demofile);
+			exit(0); /* Change this later!!! */
+		}
+		if (! polite)  display("How about a `please\", Avvy?");
+		else if (ask("\23C\26Do you really want to quit?"))  lmo = true;
+	}
+	break;
+	case vb_go:
+		display("Just use the arrow keys to walk there.");
+		break;
+	case vb_info: {
+		aboutscroll = true;
+		/*            display('Thorsoft of Letchworth presents:'+^c+^m+^m+
+		             'The medi‘val descendant of'+^m+
+		             'Denarius Avaricius Sextus'+^m+'in:'+
+		             ^m+^m+'LORD AVALOT D''ARGENT'+
+		             ^m+'version '+vernum+^m+^m+'Copyright ï '
+		             +copyright+', Mark, Mike and Thomas Thurman.');*/
+		display(string("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
+		        "The medi‘val descendant of" + '\15' +
+		        "Denarius Avaricius Sextus" +
+		        '\15' + '\15' + "version " + vernum + '\15' + '\15' + "Copyright ï "
+		        + copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
+		aboutscroll = false;
+	}
+	break;
+	case vb_undress:
+		if (dna.wearing == nowt)  display("You're already stark naked!");
+		else if (dna.avvys_in_the_cupboard) {
+			display(string("You take off ") + get_better(dna.wearing) + '.');
+			dna.wearing = nowt;
+			objectlist;
+		} else
+			display("Hadn't you better find somewhere more private, Avvy?");
+		break;
+	case vb_wear:
+		if (holding()) {
+			/* wear something */
+			switch (thing) {
+			case chastity:
+				display("Hey, what kind of a weirdo are you\??!");
+				break;
+			case clothes:
+			case habit: { /* Change this! */
+				if (dna.wearing != nowt) {
+					if (dna.wearing == thing)
+						display("You're already wearing that.");
+					else
+						display(string("You'll be rather warm wearing two ") +
+						        "sets of clothes!");
+					return;
+				} else
+					dna.wearing = thing;
+				objectlist;
+				if (thing == habit)  fv = 3;
+				else fv = 0;
+				{
+					void &with = tr[1];
+					if (whichsprite != fv) {
+						sx = tr[1].x;
+						sy = tr[1].y;
+						done;
+						init(fv, true);
+						appear(sx, sy, left);
+						tr[1].visible = false;
+					}
+				}
+			}
+			break;
+			default:
+				display(what);
+			}
+		}
+		break;
+	case vb_play:
+		if (thing == pardon)
+			switch (dna.room) { /* They just typed "play"... */
+			case r__argentpub:
+				play_nim;
+				break; /* ...in the pub, => play Nim. */
+			case r__musicroom:
+				play_harp();
+				break;
+			}
+		else if (holding()) {
+			switch (thing) {
+			case lute : {
+				dixi('U', 7);
+				if (whereis[pcwytalot] == dna.room)  dixi('U', 10);
+				if (whereis[pdulustie] == dna.room)  dixi('U', 15);
+			}
+			break;
+			case '\64' :
+				if (dna.room == r__musicroom)  play_harp();
+				else display(what);
+				break;
+			case '\67' :
+				if (dna.room == r__argentpub)  play_nim;
+				else display(what);
+				break;
+			default:
+				display(what);
+			}
+		}
+		break;
+	case vb_ring:
+		if (holding()) {
+			if (thing == bell) {
+				display("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				if ((dna.ringing_bells) & (flagset('B')))
+					display("(Are you trying to join in, Avvy\?\?!)");
+			} else display(what);
+		}
+		break;
+	case vb_help:
+		boot_help;
+		break;
+	case vb_larrypass:
+		display("Wrong game!");
+		break;
+	case vb_phaon:
+		display("Hello, Phaon!");
+		break;
+	case vb_boss:
+		bosskey;
+		break;
+	case vb_pee:
+		if (flagset('P')) {
+			display("Hmm, I don't think anyone will notice...");
+			set_up_timer(4, procurinate, reason_gototoilet);
+		} else display("It would be \6VERY\22 unwise to do that here, Avvy!");
+		break;
+	case vb_cheat: {
+		display(string('\6') + "Cheat mode now enabled.");
+		cheat = true;
+	}
+	break;
+	case vb_magic:
+		if (dna.avaricius_talk > 0)
+			dixi('q', 19);
+		else {
+			if ((dna.room == 12) & (infield(2))) {
+				/* Avaricius appears! */
+				dixi('q', 17);
+				if (whereis['\227'] == 12)
+					dixi('q', 18);
+				else {
+					tr[2].init(1, false); /* Avaricius */
+					apped(2, 4);
+					tr[2].walkto(5);
+					tr[2].call_eachstep = true;
+					tr[2].eachstep = procback_and_forth;
+					dna.avaricius_talk = 14;
+					set_up_timer(177, procavaricius_talks, reason_avariciustalks);
+				}
+			} else display("Nothing appears to happen...");
+		}
+		break;
+	case vb_smartalec:
+		display("Listen, smart alec, that was just rhetoric.");
+		break;
+	case vb_expletive: {
+		switch (swore) {
+		case 0:
+			display(string("Avvy! Do you mind? There might be kids playing!\r\r") +
+			        "(I shouldn't say it again, if I were you!)");
+			break;
+		case 1:
+			display(string("You hear a distant rumble of thunder. Must you always ") +
+			        "do things I tell you not to?\r\rDon't do it again!");
+			break;
+		default: {
+			zonk;
+			display(string("A crack of lightning shoots from the sky, ") +
+			        "and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
+			gameover;
+		}
+		}
+		swore += 1;
+	}
+	break;
+	case vb_listen:
+		if ((dna.ringing_bells) & (flagset('B')))
+			display(string("All other noise is drowned out by the ringing of ") +
+			        "the bells.");
+		else if (listen == "")
+			display("You can't hear anything much at the moment, Avvy.");
+		else display(listen);
+		break;
+	case vb_buy: {
+		/* What are they trying to buy? */
+		switch (dna.room) {
+		case r__argentpub:
+			if (infield(6)) {
+				/* We're in a pub, and near the bar. */
+				switch (thing) {
+				case '\63':
+				case '\65':
+				case '\66':
+				case '\72': { /* Beer, whisky, cider or mead */
+					if (dna.malagauche == 177) { /* Already getting us one. */
+						dixi('D', 15);
+						return;
+					}
+					if (dna.teetotal)  {
+						dixi('D', 6);
+						return;
+					}
+					if (dna.alcohol == 0)  points(3);
+					show_one(12);
+					display(booze[thing] + ", please.\231\2");
+					dna.drinking = thing;
+
+					show_one(10);
+					dna.malagauche = 177;
+					set_up_timer(27, procbuydrinks, reason_drinks);
+				}
+				break;
+				case '\64':
+					examine();
+					break; /* We have a right one here- buy Pepsi??! */
+				case wine:
+					if (dna.obj[wine])  /* We've already got the wine! */
+						dixi('D', 2); /* 1 bottle's shufishent! */
+					else {
+						if (dna.malagauche == 177) { /* Already getting us one. */
+							dixi('D', 15);
+							return;
+						}
+						if (dna.carrying >= maxobjs) {
+							display("Your hands are full.");
+							return;
+						}
+						show_one(12);
+						display("Wine, please.\231\2");
+						if (dna.alcohol == 0)  points(3);
+						show_one(10);
+						dna.malagauche = 177;
+
+						set_up_timer(27, procbuywine, reason_drinks);
+					}
+					break;
+				}
+			} else dixi('D', 5);
+			break;                /* Go to the bar! */
+
+		case r__outsideducks:
+			if (infield(6)) {
+				if (thing == onion) {
+					if (dna.obj[onion])
+						dixi('D', 10); /* not planning to juggle with the things! */
+					else if (dna.carrying >= maxobjs)
+						display("Before you ask, you remember that your hands are full.");
+					else {
+						if (dna.bought_onion)
+							dixi('D', 11);
+						else {
+							dixi('D', 9);
+							points(3);
+						}
+						pennycheck(3); /* It costs thruppence. */
+						dna.obj[onion] = true;
+						objectlist;
+						dna.bought_onion = true;
+						dna.rotten_onion = false; /* It's OK when it leaves the stall! */
+						dna.onion_in_vinegar = false;
+					}
+				} else dixi('D', 0);
+			} else dixi('D', 0);
+			break;
+
+		case r__nottspub:
+			dixi('n', 15);
+			break; /* Can't sell to southerners. */
+		default:
+			dixi('D', 0); /* Can't buy that. */
+		}
+	}
+	break;
+	case vb_attack: {
+		if ((dna.room == r__brummieroad) &&
+		        ((person == '\235') || (thing == crossbow) || (thing == bolt))
+		        && (whereis['\235'] == dna.room)) {
+			switch (ord(dna.obj[bolt]) + ord(dna.obj[crossbow]) * 2) {
+				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
+				  3 = both. */
+			case 0: {
+				dixi('Q', 10);
+				display("(At the very least, don't use your bare hands!)");
+			}
+			break;
+			case 1:
+				display(string("Attack him with only a crossbow bolt? Are you ") +
+				        "planning on playing darts?!");
+				break;
+			case 2:
+				display(string("Come on, Avvy! You're not going to get very far ") +
+				        "with only a crossbow!");
+				break;
+			case 3: {
+				dixi('Q', 11);
+				dna.cwytalot_gone = true;
+				dna.obj[bolt] = false;
+				dna.obj[crossbow] = false;
+				objectlist;
+				magics[12].op = nix;
+				points(7);
+				tr[2].walkto(2);
+				tr[2].vanishifstill = true;
+				tr[2].call_eachstep = false;
+				whereis['\235'] = 177;
+			}
+			break;
+			default:
+				dixi('Q', 10); /* Please try not to be so violent! */
+			}
+		} else dixi('Q', 10);
+	}
+	break;
+	case vb_password:
+		if (dna.room != r__bridge)
+			dixi('Q', 12);
+		else {
+			ok = true;
+			for (ff = 1; ff <= length(thats); ff ++)
+				for (fv = 1; fv <= length(words[dna.pass_num + first_password].w); fv ++)
+					if (words[dna.pass_num + first_password].w[fv] !=
+					        upcase(realwords[ff][fv]))
+						ok = false;
+			if (ok) {
+				if (dna.drawbridge_open != 0)
+					display("Contrary to your expectations, the drawbridge fails to close again.");
+				else {
+					points(4);
+					display("The drawbridge opens!");
+					set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
+					dna.drawbridge_open = 1;
+				}
+			} else dixi('Q', 12);
+		}
+		break;
+	case vb_dir:
+		dir(realwords[2]);
+		break;
+	case vb_die:
+		gameover;
+		break;
+	case vb_score:
+		display(string("Your score is ") + strf(dna.score) + ",\3\rout of a " +
+		        "possible 128.\r\rThis gives you a rank of " + rank() +
+		        ".\r\r" + totaltime());
+		break;
+	case vb_put:
+		putproc();
+		break;
+	case vb_stand:
+		stand_up();
+		break;
+
+	case vb_kiss:
+		if (person == pardon)
+			display("Kiss whom?");
+		else if (personshere())
+			switch (person) {
+			case '\226' ... '\256':
+				display("Hey, what kind of a weirdo are you??");
+				break;
+			case parkata:
+				dixi('U', 12);
+				break;
+			case pgeida:
+				dixi('U', 13);
+				break;
+			case pwisewoman:
+				dixi('U', 14);
+				break;
+			default:
+				dixi('U', 5); /* You WHAT? */
+			}
+		break;
+
+	case vb_climb:
+		if (dna.room == r__insidecardiffcastle)  cardiff_climbing();
+		else /* In the wrong room! */
+			display("Not with your head for heights, Avvy!");
+		break;
+
+	case vb_jump: {
+		set_up_timer(1, procjump, reason_jumping);
+		dna.user_moves_avvy = false;
+	}
+	break;
+
+	case vb_highscores:
+		show_highs;
+		break;
+
+	case vb_wake:
+		if (personshere())
+			switch (person) {
+			case pardon:
+			case pavalot:
+			case '\0':
+				if (~ avvy_is_awake) {
+					avvy_is_awake = true;
+					points(1);
+					avvy_in_bed = true;
+					show_one(3); /* Picture of Avvy, awake in bed. */
+					if (teetotal)  dixi('d', 13);
+				} else display("You're already awake, Avvy!");
+				break;
+			case payles:
+				if (~ ayles_is_awake)  display("You can't seem to wake him by yourself.");
+				break;
+			case pjacques:
+				display(string("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
+				        "Hmmm... that doesn't seem to do any good...");
+				break;
+			default:
+				display("It's difficult to awaken people who aren't asleep...!");
+			}
+		break;
+
+	case vb_sit:
+		if (dna.room == r__nottspub) {
+			if (dna.sitting_in_pub)
+				display("You're already sitting!");
+			else {
+				tr[1].walkto(4); /* Move Avvy to the place, and sit him down. */
+				set_up_timer(1, procavvy_sit_down, reason_sitting_down);
+			}
+		} else {
+			/* Default doodah. */
+			dusk;
+			hang_around_for_a_while;
+			dawn;
+			display("A few hours later...\20nothing much has happened...");
+		}
+		break;
+
+	case vb_restart:
+		if (ask("Restart game and lose changes?"))  {
+			dusk;
+			newgame;
+			dawn;
+		}
+		break;
+
+	case pardon:
+		display("Hey, a verb would be helpful!");
+		break;
+
+	case vb_hello: {
+		person_speaks();
+		display("Hello.\2");
+	}
+	break;
+	case vb_thanks: {
+		person_speaks();
+		display("That's OK.\2");
+	}
+	break;
+	default:
+		display(string('\7') + "Parser bug!");
+	}
 }
 
-void verbopt(char n, string& answer, char& anskey)
-{
- switch (n) {
-   case vb_exam: { answer="Examine"; anskey='x'; } break; /* the ubiqutous one */
-   /* vb_give isn't dealt with by this procedure, but by ddm__with */
-  case vb_drink: { answer="Drink";   anskey='D'; } break;
-  case vb_wear:  { answer="Wear";    anskey='W'; } break;
-  case vb_ring:  { answer="Ring";    anskey='R'; } break; /* only the bell! */
-  case vb_play:  { answer="Play";    anskey='P'; } break;
-  case vb_eat:   { answer="Eat";     anskey='E'; } break;
-  default:      { answer="? Unknown!"; anskey='?'; }      /* Bug! */
- }
+void verbopt(char n, string &answer, char &anskey) {
+	switch (n) {
+	case vb_exam: {
+		answer = "Examine";
+		anskey = 'x';
+	}
+	break; /* the ubiqutous one */
+	/* vb_give isn't dealt with by this procedure, but by ddm__with */
+	case vb_drink: {
+		answer = "Drink";
+		anskey = 'D';
+	}
+	break;
+	case vb_wear:  {
+		answer = "Wear";
+		anskey = 'W';
+	}
+	break;
+	case vb_ring:  {
+		answer = "Ring";
+		anskey = 'R';
+	}
+	break; /* only the bell! */
+	case vb_play:  {
+		answer = "Play";
+		anskey = 'P';
+	}
+	break;
+	case vb_eat:   {
+		answer = "Eat";
+		anskey = 'E';
+	}
+	break;
+	default:      {
+		answer = "? Unknown!";    /* Bug! */
+		anskey = '?';
+	}
+	}
 }
 
 class unit_acci_initialize {
-  public: unit_acci_initialize();
+public:
+	unit_acci_initialize();
 };
 static unit_acci_initialize acci_constructor;
 
 unit_acci_initialize::unit_acci_initialize() {
- weirdword=false;
+	weirdword = false;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
index 6734f66..c80f09d 100644
--- a/engines/avalanche/acci.h
+++ b/engines/avalanche/acci.h
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -31,28 +31,67 @@
 namespace Avalanche {
 
 /* verb codes */
-const char vb_exam = '\1'; const char vb_open = '\2'; const char vb_pause = '\3'; const char vb_get = '\4'; const char vb_drop = '\5';
-const char vb_inv = '\6'; const char vb_talk = '\7'; const char vb_give = '\10'; const char vb_drink = '\11'; const char vb_load = '\12';
-const char vb_save = '\13'; const char vb_pay = '\14'; const char vb_look = '\15'; const char vb_break = '\16'; const char vb_quit = '\17';
-const char vb_sit = '\20'; const char vb_stand = '\21'; const char vb_go = '\22'; const char vb_info = '\23'; const char vb_undress = '\24';
-const char vb_wear = '\25'; const char vb_play = '\26'; const char vb_ring = '\27'; const char vb_help = '\30';
-const char vb_larrypass = '\31'; const char vb_phaon = '\32'; const char vb_boss = '\33'; const char vb_pee = '\34';
-const char vb_cheat = '\35'; const char vb_magic = '\36'; const char vb_restart = '\37'; const char vb_eat = '\40';
-const char vb_listen = '\41'; const char vb_buy = '\42'; const char vb_attack = '\43'; const char vb_password = '\44';
-const char vb_dir = '\45'; const char vb_die = '\46'; const char vb_score = '\47'; const char vb_put = '\50';
-const char vb_kiss = '\51'; const char vb_climb = '\52'; const char vb_jump = '\53'; const char vb_highscores = '\54';
-const char vb_wake = '\55'; const char vb_hello = '\56'; const char vb_thanks = '\57';
-
-const char vb_smartalec = '\371'; const char vb_expletive = '\375';
+const char vb_exam = '\1';
+const char vb_open = '\2';
+const char vb_pause = '\3';
+const char vb_get = '\4';
+const char vb_drop = '\5';
+const char vb_inv = '\6';
+const char vb_talk = '\7';
+const char vb_give = '\10';
+const char vb_drink = '\11';
+const char vb_load = '\12';
+const char vb_save = '\13';
+const char vb_pay = '\14';
+const char vb_look = '\15';
+const char vb_break = '\16';
+const char vb_quit = '\17';
+const char vb_sit = '\20';
+const char vb_stand = '\21';
+const char vb_go = '\22';
+const char vb_info = '\23';
+const char vb_undress = '\24';
+const char vb_wear = '\25';
+const char vb_play = '\26';
+const char vb_ring = '\27';
+const char vb_help = '\30';
+const char vb_larrypass = '\31';
+const char vb_phaon = '\32';
+const char vb_boss = '\33';
+const char vb_pee = '\34';
+const char vb_cheat = '\35';
+const char vb_magic = '\36';
+const char vb_restart = '\37';
+const char vb_eat = '\40';
+const char vb_listen = '\41';
+const char vb_buy = '\42';
+const char vb_attack = '\43';
+const char vb_password = '\44';
+const char vb_dir = '\45';
+const char vb_die = '\46';
+const char vb_score = '\47';
+const char vb_put = '\50';
+const char vb_kiss = '\51';
+const char vb_climb = '\52';
+const char vb_jump = '\53';
+const char vb_highscores = '\54';
+const char vb_wake = '\55';
+const char vb_hello = '\56';
+const char vb_thanks = '\57';
+
+const char vb_smartalec = '\371';
+const char vb_expletive = '\375';
 
 const char pardon = '\376'; /* =didn't understand / wasn't given. */
 
 struct vocab {
-         byte n; varying_string<11> w;
+	byte n;
+	varying_string<11> w;
 };
 
 struct ranktype {
-            word score; varying_string<12> title;
+	word score;
+	varying_string<12> title;
 };
 
 
@@ -63,167 +102,171 @@ const char moved = '\0'; /* This word was moved. (Usually because it was the sub
 
 const integer first_password = 89; /* Words[first_password] should equal "TIROS". */
 
-const array<1,nowords,vocab> words = 
-
-/* Verbs, 1-49 */
-{{{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
- {2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
- {3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
- {4, "TAKE"},      {4, "GET"},       {4, "PICK"},
- {5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
- {7, "SAY"},       {7, "ASK"},
- {8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
- {9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
- {11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
- {13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
- {15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
- {17, "STAND"},
-
- {18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
- {20, "DOFF"},
- {21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
- {22, "PLAY"},
- {22, "STRUM"},     {23, "RING"},      {24, "HELP"},
- {25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
- {255,"NINET"},     /* block for NINETY */
- {28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
- {30,"ABRACADABRA"},{30, "PLUGH"},     {30, "XYZZY"},
- {30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
- {30, "WIZZY"},     {30, "PLOVER"},
- {30,"MELENKURION"},{30, "ZORTON"},    {30, "BLERBI"},
- {30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
- {30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
- {30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
- {30, "BONESCROLLS"},{30, "RADOF"},
-
- {31, "RESTART"},
- {32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
- {33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
- {34, "ORDER"},     {34, "DEMAND"},
- {35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
- {35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
- {35, "FIRE"},
-
- /* Passwords, 36: */
-
- {36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
- {36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
- {36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
- {36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
- {36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
- {36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
- {36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
- {36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
- {36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
- {36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
-
- {37, "DIR"},       {37, "LS"},        {38, "DIE"},
- {39, "SCORE"},
- {40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
- {41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
- {42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
- {44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
- {46, "HELLO"},     {46, "HI"},        {46, "YO"},
- {47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
-
-
-/* Nouns - Objects: 50-100. */
-
- {50, "WINE"},      {50, "BOOZE"},    {50,"NASTY"},
- {50, "VINEGAR"},   {51, "MONEYBAG"},
- {51, "BAG"},       {51, "CASH"},     {51,"DOSH"},
- {51, "WALLET"},
- {52, "BODKIN"},    {52, "DAGGER"},   {53,"POTION"},
- {54, "CHASTITY"},  {54, "BELT"},     {55,"BOLT"},
- {55, "ARROW"},     {55, "DART"},
- {56, "CROSSBOW"},  {56, "BOW"},      {57,"LUTE"},
- {58, "PILGRIM"},   {58, "BADGE"},    {59,"MUSHROOMS"},
- {59, "TOADSTOOLS"},{60, "KEY"},      {61,"BELL"},
- {62, "PRESCRIPT"}, {62, "SCROLL"},   {62,"MESSAGE"},
- {63, "PEN"},       {63, "QUILL"},    {64,"INK"},
- {64, "INKPOT"},    {65, "CLOTHES"},  {66,"HABIT"},
- {66, "DISGUISE"},  {67, "ONION"},
-
- {99,"PASSWORD"},
-
-/* Objects from Also are placed between 101 and 131. */
-
-/* Nouns - People - Male, 150-174 */
- {150, "AVVY"},      {150,"AVALOT"},    {150,"YOURSELF"},
- {150, "ME"},        {150,"MYSELF"},    {151,"SPLUDWICK"},
- {151, "THOMAS"},    {151,"ALCHEMIST"}, {151,"CHEMIST"},
- {152, "CRAPULUS"},  {152,"SERF"},      {152,"SLAVE"},
- {158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
- {152, "CRAPPY"},    {153,"DUCK"},      {153,"DOCTOR"},
- {154, "MALAGAUCHE"},
- {155, "FRIAR"},     {155,"TUCK"},      {156,"ROBIN"},
- {156, "HOOD"},      {157,"CWYTALOT"},  {157,"GUARD"},
- {157, "BRIDGEKEEP"},{158,"BARON"},     {158,"LUSTIE"},
- {159, "DUKE"},      {159,"GRACE"},     {160,"DOGFOOD"},
- {160, "MINSTREL"},  {161,"TRADER"},    {161,"SHOPKEEPER"},
- {161,"STALLHOLDER"},
- {162, "PILGRIM"},   {162,"IBYTHNETH"}, {163,"ABBOT"},
- {163, "AYLES"},     {164,"PORT"},      {165,"SPURGE"},
- {166, "JACQUES"},   {166,"SLEEPER"},   {166,"RINGER"},
-
-/* Nouns- People - Female: 175-199 */
- {175, "WIFE"},      {175,"ARKATA"},    {176,"GEDALODAVA"},
- {176, "GEIDA"},     {176,"PRINCESS"},  {178,"WISE"},
- {178, "WITCH"},
-
-/* Pronouns, 200-224 */
- {200, "HIM"},       {200,"MAN"},       {200,"GUY"},
- {200, "DUDE"},      {200,"CHAP"},      {200,"FELLOW"},
- {201, "HER"},       {201,"GIRL"},      {201,"WOMAN"},
- {202, "IT"},        {202,"THING"},
-
- {203,"MONK"},       {204,"BARMAN"},    {204,"BARTENDER"},
-
-/* Prepositions, 225-249 */
- {225, "TO"},        {226,"AT"},        {227,"UP"},
- {228, "INTO"},      {228,"INSIDE"},    {229,"OFF"},
- {230, "UP"},        {231,"DOWN"},      {232,"ON"},
-
-
-/* Please, 251 */
- {251, "PLEASE"},
-
-/* About, 252 */
- {252, "ABOUT"}, {252, "CONCERNING"},
-
-/* Swear words, 253 */
-       /*              I M P O R T A N T    M E S S A G E
-
-          DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
-          DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
-          GOODNESS KNOWS WHO WROTE THEM.
-          READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
-          WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
-
- {253, "SHIT"},      {28 ,"PISS"},    {28 ,"PEE"},
- {253, "FART"},      {253,"FUCK"},    {253,"BALLS"},
- {253, "BLAST"},     {253,"BUGGER"},  {253,"KNICKERS"},
- {253, "BLOODY"},    {253,"HELL"},    {253,"DAMN"},
- {253, "SMEG"},
-   /* and other even ruder words. You didn't read them, did you? Good. */
-
-/* Answer-back smart-alec words, 249 */
- {249, "YES"},       {249,"NO"},        {249,"BECAUSE"},
-
-/* Noise words, 255 */
- {255, "THE"},       {255,'A'},         {255,"NOW"},
- {255, "SOME"},      {255,"AND"},       {255,"THAT"},
- {255, "POCUS"},     {255,"HIS"},       
- {255, "THIS"},      {255,"SENTINEL"}}};        /* for "Ken SENT Me" */
+const array<1, nowords, vocab> words =
+
+    /* Verbs, 1-49 */
+{	{	{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
+		{2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
+		{3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
+		{4, "TAKE"},      {4, "GET"},       {4, "PICK"},
+		{5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
+		{7, "SAY"},       {7, "ASK"},
+		{8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
+		{9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
+		{11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
+		{13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
+		{15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
+		{17, "STAND"},
+
+		{18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
+		{20, "DOFF"},
+		{21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
+		{22, "PLAY"},
+		{22, "STRUM"},     {23, "RING"},      {24, "HELP"},
+		{25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
+		{255, "NINET"},    /* block for NINETY */
+		{28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
+		{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
+		{30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
+		{30, "WIZZY"},     {30, "PLOVER"},
+		{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
+		{30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
+		{30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
+		{30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
+		{30, "BONESCROLLS"}, {30, "RADOF"},
+
+		{31, "RESTART"},
+		{32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
+		{33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
+		{34, "ORDER"},     {34, "DEMAND"},
+		{35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
+		{35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
+		{35, "FIRE"},
+
+		/* Passwords, 36: */
+
+		{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
+		{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
+		{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
+		{36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
+		{36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
+		{36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
+		{36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
+		{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
+		{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
+		{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
+
+		{37, "DIR"},       {37, "LS"},        {38, "DIE"},
+		{39, "SCORE"},
+		{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
+		{41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
+		{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
+		{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
+		{46, "HELLO"},     {46, "HI"},        {46, "YO"},
+		{47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
+
+
+		/* Nouns - Objects: 50-100. */
+
+		{50, "WINE"},      {50, "BOOZE"},    {50, "NASTY"},
+		{50, "VINEGAR"},   {51, "MONEYBAG"},
+		{51, "BAG"},       {51, "CASH"},     {51, "DOSH"},
+		{51, "WALLET"},
+		{52, "BODKIN"},    {52, "DAGGER"},   {53, "POTION"},
+		{54, "CHASTITY"},  {54, "BELT"},     {55, "BOLT"},
+		{55, "ARROW"},     {55, "DART"},
+		{56, "CROSSBOW"},  {56, "BOW"},      {57, "LUTE"},
+		{58, "PILGRIM"},   {58, "BADGE"},    {59, "MUSHROOMS"},
+		{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
+		{62, "PRESCRIPT"}, {62, "SCROLL"},   {62, "MESSAGE"},
+		{63, "PEN"},       {63, "QUILL"},    {64, "INK"},
+		{64, "INKPOT"},    {65, "CLOTHES"},  {66, "HABIT"},
+		{66, "DISGUISE"},  {67, "ONION"},
+
+		{99, "PASSWORD"},
+
+		/* Objects from Also are placed between 101 and 131. */
+
+		/* Nouns - People - Male, 150-174 */
+		{150, "AVVY"},      {150, "AVALOT"},    {150, "YOURSELF"},
+		{150, "ME"},        {150, "MYSELF"},    {151, "SPLUDWICK"},
+		{151, "THOMAS"},    {151, "ALCHEMIST"}, {151, "CHEMIST"},
+		{152, "CRAPULUS"},  {152, "SERF"},      {152, "SLAVE"},
+		{158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
+		{152, "CRAPPY"},    {153, "DUCK"},      {153, "DOCTOR"},
+		{154, "MALAGAUCHE"},
+		{155, "FRIAR"},     {155, "TUCK"},      {156, "ROBIN"},
+		{156, "HOOD"},      {157, "CWYTALOT"},  {157, "GUARD"},
+		{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
+		{159, "DUKE"},      {159, "GRACE"},     {160, "DOGFOOD"},
+		{160, "MINSTREL"},  {161, "TRADER"},    {161, "SHOPKEEPER"},
+		{161, "STALLHOLDER"},
+		{162, "PILGRIM"},   {162, "IBYTHNETH"}, {163, "ABBOT"},
+		{163, "AYLES"},     {164, "PORT"},      {165, "SPURGE"},
+		{166, "JACQUES"},   {166, "SLEEPER"},   {166, "RINGER"},
+
+		/* Nouns- People - Female: 175-199 */
+		{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
+		{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
+		{178, "WITCH"},
+
+		/* Pronouns, 200-224 */
+		{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
+		{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
+		{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
+		{202, "IT"},        {202, "THING"},
+
+		{203, "MONK"},       {204, "BARMAN"},    {204, "BARTENDER"},
+
+		/* Prepositions, 225-249 */
+		{225, "TO"},        {226, "AT"},        {227, "UP"},
+		{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
+		{230, "UP"},        {231, "DOWN"},      {232, "ON"},
+
+
+		/* Please, 251 */
+		{251, "PLEASE"},
+
+		/* About, 252 */
+		{252, "ABOUT"}, {252, "CONCERNING"},
+
+		/* Swear words, 253 */
+		/*              I M P O R T A N T    M E S S A G E
+
+		   DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+		   DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+		   GOODNESS KNOWS WHO WROTE THEM.
+		   READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+		   WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+
+		{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
+		{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
+		{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
+		{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
+		{253, "SMEG"},
+		/* and other even ruder words. You didn't read them, did you? Good. */
+
+		/* Answer-back smart-alec words, 249 */
+		{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},
+
+		/* Noise words, 255 */
+		{255, "THE"},       {255, 'A'},         {255, "NOW"},
+		{255, "SOME"},      {255, "AND"},       {255, "THAT"},
+		{255, "POCUS"},     {255, "HIS"},
+		{255, "THIS"},      {255, "SENTINEL"}
+	}
+};        /* for "Ken SENT Me" */
 
 const char what[] = "That's not possible!";
 
-const array<1,9,ranktype> ranks = 
-{{{0, "Beginner"},    {10, "Novice"},
-{20, "Improving"},   {35, "Not bad"},
-{50, "Passable"},    {65, "Good"},
-{80, "Experienced"}, {108, "The BEST!"},
-{maxint, "copyright'93"}}};
+const array<1, 9, ranktype> ranks = {
+	{	{0, "Beginner"},    {10, "Novice"},
+		{20, "Improving"},   {35, "Not bad"},
+		{50, "Passable"},    {65, "Good"},
+		{80, "Experienced"}, {108, "The BEST!"},
+		{maxint, "copyright'93"}
+	}
+};
 
 
 #ifdef __acci_implementation__
@@ -233,8 +276,8 @@ const array<1,9,ranktype> ranks =
 
 EXTERN varying_string<11> thats;
 EXTERN varying_string<20> unknown;
-EXTERN array<1,11,varying_string<20> > realwords;
-EXTERN char verb,person,thing,thing2;
+EXTERN array<1, 11, varying_string<20> > realwords;
+EXTERN char verb, person, thing, thing2;
 EXTERN boolean polite;
 #undef EXTERN
 #define EXTERN extern
@@ -245,7 +288,7 @@ void parse();
 void lookaround();
 void opendoor();
 void do_that();
-void verbopt(char n, string& answer, char& anskey);
+void verbopt(char n, string &answer, char &anskey);
 void have_a_drink();
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index 83dce52..3f3e32a 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -33,28 +33,37 @@
 
 namespace Avalanche {
 
-typedef matrix<0,255,0,15,byte> fonttype;
+typedef matrix<0, 255, 0, 15, byte> fonttype;
 
 class fieldtype {
 public:
-             integer x1,y1,x2,y2;
+	integer x1, y1, x2, y2;
 };
 
 class linetype : public fieldtype {
 public:
-            byte col;
+	byte col;
 };
 
 struct pedtype {
-           integer x,y; byte dir;
+	integer x, y;
+	byte dir;
 };
 
 struct magictype {
-             byte op; /* one of the operations */
-             word data; /* data for them */
+	byte op; /* one of the operations */
+	word data; /* data for them */
 };
 
-const integer numlines = 50; const integer up = 0; const integer right = 1; const integer down = 2; const integer left = 3; const integer ur = 4; const integer dr = 5; const integer dl = 6; const integer ul = 7;
+const integer numlines = 50;
+const integer up = 0;
+const integer right = 1;
+const integer down = 2;
+const integer left = 3;
+const integer ur = 4;
+const integer dr = 5;
+const integer dl = 6;
+const integer ul = 7;
 const integer still = 8;
 
 const integer nay = maxint;
@@ -69,988 +78,1455 @@ const integer nay = maxint;
 /*S*/ const integer special = 5; /* special call */
 /*O*/ const integer opendoor = 6; /* slowly opening door. */
 
-integer gd,gm;
-array<1,numlines,linetype> lines;
-array<1,numlines,fieldtype> fields;
+integer gd, gm;
+array<1, numlines, linetype> lines;
+array<1, numlines, fieldtype> fields;
 boolean do1;
 byte current;
 string n;
-matrix<0,29,1,2,string> names;
+matrix<0, 29, 1, 2, string> names;
 file<fonttype> f;
 fonttype skinny;
-byte tx,ty;
-matrix<0,79,0,22,char> chars;
+byte tx, ty;
+matrix<0, 79, 0, 22, char> chars;
 byte cursorflash;
-array<1,15,pedtype> peds;
-array<1,15,magictype> magics;
-array<9,15,magictype> portals;
+array<1, 15, pedtype> peds;
+array<1, 15, magictype> magics;
+array<9, 15, magictype> portals;
 varying_string<26> flags;
 string listen;
 
-const graphcursmasktype crosshairs = 
-{ 
-    ((63551,63807,63807,63807,61727,257,897,32765,897,257,61727,63807,63807,63807,63551,65535),
-     (4368,21140,8840,53910,640,640,31868,33026,31868,640,640,53910,8840,21140,4368,0)),
-               7,
-               7};
-
-const graphcursmasktype hook = 
-{ 
-    ((32831,32831,49279,49279,57599,61695,61471,61447,63491,57089,36801,32771,49159,57375,63743,65535),
-     (0,16256,7936,7936,3584,1536,1792,2016,248,28,8220,12344,8160,1792,0,0)),
-               2,
-               9};
-
-const graphcursmasktype tthand = 
-{ 
-    ((62463,57855,57855,57855,57471,49167,32769,0,0,0,0,32768,49152,57344,61441,61443),
-     (3072,4608,4608,4608,4992,12912,21070,36937,36873,36865,32769,16385,8193,4097,2050,4092)),
-               4,
-               0};
-
-string strf(longint x)
-{
-    string q;
-string strf_result;
-;
- str(x,q); strf_result=q;
-return strf_result;
+const graphcursmasktype crosshairs = {
+	((63551, 63807, 63807, 63807, 61727, 257, 897, 32765, 897, 257, 61727, 63807, 63807, 63807, 63551, 65535),
+	(4368, 21140, 8840, 53910, 640, 640, 31868, 33026, 31868, 640, 640, 53910, 8840, 21140, 4368, 0)),
+	7,
+	7
+};
+
+const graphcursmasktype hook = {
+	((32831, 32831, 49279, 49279, 57599, 61695, 61471, 61447, 63491, 57089, 36801, 32771, 49159, 57375, 63743, 65535),
+	(0, 16256, 7936, 7936, 3584, 1536, 1792, 2016, 248, 28, 8220, 12344, 8160, 1792, 0, 0)),
+	2,
+	9
+};
+
+const graphcursmasktype tthand = {
+	((62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443),
+	(3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092)),
+	4,
+	0
+};
+
+string strf(longint x) {
+	string q;
+	string strf_result;
+	;
+	str(x, q);
+	strf_result = q;
+	return strf_result;
+}
+
+void glimpse(byte ret) {     /* glimpse of screen 3 */
+	char sink;
+	;
+	hidemousecursor;
+	setvisualpage(3);
+	setcrtpagenumber(3);
+	showmousecursor;
+	do {
+		;
+	} while (!(~ anymousekeypressed));
+	do {
+		;
+	} while (!anymousekeypressed);
+	hidemousecursor;
+	setvisualpage(ret);
+	setcrtpagenumber(ret);
+	showmousecursor;
+	while (keypressed())  sink = readkey();
 }
 
-void glimpse(byte ret)       /* glimpse of screen 3 */
-{
-    char sink;
-;
- hidemousecursor; setvisualpage(3); setcrtpagenumber(3); showmousecursor;
- do {; } while (!(~ anymousekeypressed));
- do {; } while (!anymousekeypressed);
- hidemousecursor; setvisualpage(ret); setcrtpagenumber(ret); showmousecursor;
- while (keypressed())  sink=readkey();
+void newline(byte t, integer p, integer q, integer r, integer s, byte c) {
+	;
+	{
+		linetype &with = lines[t];
+		;
+		x1 = p;
+		y1 = q;
+		x2 = r;
+		y2 = s;
+		with.col = c;
+	}
 }
 
-void newline(byte t, integer p,integer q,integer r,integer s, byte c)
-{;
- {
- linetype& with = lines[t]; 
- ;
-  x1=p; y1=q; x2=r; y2=s; with.col=c;
- }
+void newfield(byte t, integer p, integer q, integer r, integer s) {
+	;
+	{
+		fieldtype &with = fields[t];  ;
+		with.x1 = p;
+		with.y1 = q;
+		with.x2 = r;
+		with.y2 = s;
+	}
 }
 
-void newfield(byte t, integer p,integer q,integer r,integer s)
-{; {
-                         fieldtype& with = fields[t];  ; with.x1=p; with.y1=q; with.x2=r; with.y2=s; } }
-
-void drawped(byte p)
-{;
- { pedtype& with = peds[p]; 
-  if (with.dir<177) 
-  {;
-   setcolor(p); circle(with.x,with.y,5); moveto(with.x,with.y);
-   switch (with.dir) {
-    case up:   linerel(0,-5); break;  case down:  linerel(0,5); break;
-    case left: linerel(-7,0); break;  case right: linerel(7,0); break;
-    case ul:   linerel(-7,-5); break; case dl:    linerel(-7, 5); break;
-    case ur:   linerel( 7,-5); break; case dr:    linerel( 7, 5); break;
-   }
-  }}
+void drawped(byte p) {
+	;
+	{
+		pedtype &with = peds[p];
+		if (with.dir < 177) {
+			;
+			setcolor(p);
+			circle(with.x, with.y, 5);
+			moveto(with.x, with.y);
+			switch (with.dir) {
+			case up:
+				linerel(0, -5);
+				break;
+			case down:
+				linerel(0, 5);
+				break;
+			case left:
+				linerel(-7, 0);
+				break;
+			case right:
+				linerel(7, 0);
+				break;
+			case ul:
+				linerel(-7, -5);
+				break;
+			case dl:
+				linerel(-7, 5);
+				break;
+			case ur:
+				linerel(7, -5);
+				break;
+			case dr:
+				linerel(7, 5);
+				break;
+			}
+		}
+	}
 }
 
-void drawup()
-{
-    byte fv;
-;
- cleardevice();
- for( fv=1; fv <= numlines; fv ++)
-  { linetype& with = lines[fv]; 
-   if (x1!=nay) 
-   {;
-    setcolor(with.col);
-    line(x1,y1,x2,y2);
-   }}
- for( fv=1; fv <= numlines; fv ++)
-  { fieldtype& with = fields[fv]; 
-   if (with.x1!=nay) 
-   {;
-    setcolor(fv);
-    rectangle(with.x1,with.y1,with.x2,with.y2);
-   }}
- for( fv=1; fv <= 15; fv ++) drawped(fv);
+void drawup() {
+	byte fv;
+	;
+	cleardevice();
+	for (fv = 1; fv <= numlines; fv ++) {
+		linetype &with = lines[fv];
+		if (x1 != nay) {
+			;
+			setcolor(with.col);
+			line(x1, y1, x2, y2);
+		}
+	}
+	for (fv = 1; fv <= numlines; fv ++) {
+		fieldtype &with = fields[fv];
+		if (with.x1 != nay) {
+			;
+			setcolor(fv);
+			rectangle(with.x1, with.y1, with.x2, with.y2);
+		}
+	}
+	for (fv = 1; fv <= 15; fv ++) drawped(fv);
 }
 
-void addped()
-{
-    byte n,fv;
-;
- n=0; do { n += 1; } while (!((n==16) || (peds[n].dir==177)));
- setcrtpagenumber(0); setactivepage(0); setvisualpage(0);
- drawup(); setgraphicscursor(tthand); showmousecursor;
- do {
-  if (rightmousekeypressed)  return;
-  if (keypressed())  glimpse(0);
- } while (!leftmousekeypressed);
- hidemousecursor;
- {
- pedtype& with = peds[n]; 
- ;
-  with.x=mousex; with.y=mousey;
- }
- cleardevice(); setfillstyle(6,9); for( fv=1; fv <= 3; fv ++) bar(200*fv,0,200*fv,200);
- for( fv=1; fv <= 2; fv ++) bar(0,60*fv,640,60*fv);
- showmousecursor;
- do { if (rightmousekeypressed)  return; } while (!leftmousekeypressed);
- hidemousecursor;
- { pedtype& with = peds[n]; 
-  switch (((mousex / 200)*10)+(mousey / 60)) {
-   case 0: with.dir=ul; break;   case 10: with.dir=up; break;    case 20: with.dir=ur; break;
-   case 1: with.dir=left; break; case 11: with.dir=still; break; case 21: with.dir=right; break;
-   case 2: with.dir=dl; break;   case 12: with.dir=down; break;  case 22: with.dir=dr; break;
-  }}
+void addped() {
+	byte n, fv;
+	;
+	n = 0;
+	do {
+		n += 1;
+	} while (!((n == 16) || (peds[n].dir == 177)));
+	setcrtpagenumber(0);
+	setactivepage(0);
+	setvisualpage(0);
+	drawup();
+	setgraphicscursor(tthand);
+	showmousecursor;
+	do {
+		if (rightmousekeypressed)  return;
+		if (keypressed())  glimpse(0);
+	} while (!leftmousekeypressed);
+	hidemousecursor;
+	{
+		pedtype &with = peds[n];
+		;
+		with.x = mousex;
+		with.y = mousey;
+	}
+	cleardevice();
+	setfillstyle(6, 9);
+	for (fv = 1; fv <= 3; fv ++) bar(200 * fv, 0, 200 * fv, 200);
+	for (fv = 1; fv <= 2; fv ++) bar(0, 60 * fv, 640, 60 * fv);
+	showmousecursor;
+	do {
+		if (rightmousekeypressed)  return;
+	} while (!leftmousekeypressed);
+	hidemousecursor;
+	{
+		pedtype &with = peds[n];
+		switch (((mousex / 200) * 10) + (mousey / 60)) {
+		case 0:
+			with.dir = ul;
+			break;
+		case 10:
+			with.dir = up;
+			break;
+		case 20:
+			with.dir = ur;
+			break;
+		case 1:
+			with.dir = left;
+			break;
+		case 11:
+			with.dir = still;
+			break;
+		case 21:
+			with.dir = right;
+			break;
+		case 2:
+			with.dir = dl;
+			break;
+		case 12:
+			with.dir = down;
+			break;
+		case 22:
+			with.dir = dr;
+			break;
+		}
+	}
 }
 
-void addline(byte ccc)
-{
-    byte fv;
-;
- do {
-  for( fv=1; fv <= numlines; fv ++)
-   { linetype& with = lines[fv]; 
-    if (x1==nay) 
-    {;
-     x1=fv*17; x2=x1; y1=200; y2=190; with.col=ccc;
-     return; /* bad style! */
-    }}
- } while (!false);
+void addline(byte ccc) {
+	byte fv;
+	;
+	do {
+		for (fv = 1; fv <= numlines; fv ++) {
+			linetype &with = lines[fv];
+			if (x1 == nay) {
+				;
+				x1 = fv * 17;
+				x2 = x1;
+				y1 = 200;
+				y2 = 190;
+				with.col = ccc;
+				return; /* bad style! */
+			}
+		}
+	} while (!false);
 }
 
-byte colour()
-{
-    byte fv;
-byte colour_result;
-;
- setactivepage(0); setvisualpage(0); setcrtpagenumber(0);
- outtextxy(0,0,"Select a colour, please...");
- for( fv=1; fv <= 15; fv ++)
- {;
-  setfillstyle(1,fv);
-  bar(fv*40,27,39+fv*40,200);
- }
- showmousecursor;
- do {
-  if (rightmousekeypressed)  {; hidemousecursor; return colour_result; }
-  if (keypressed())  glimpse(2);
- } while (!leftmousekeypressed);
- hidemousecursor;
- colour_result=getpixel(mousex,mousey); cleardevice();
-return colour_result;
+byte colour() {
+	byte fv;
+	byte colour_result;
+	;
+	setactivepage(0);
+	setvisualpage(0);
+	setcrtpagenumber(0);
+	outtextxy(0, 0, "Select a colour, please...");
+	for (fv = 1; fv <= 15; fv ++) {
+		;
+		setfillstyle(1, fv);
+		bar(fv * 40, 27, 39 + fv * 40, 200);
+	}
+	showmousecursor;
+	do {
+		if (rightmousekeypressed)  {
+			;
+			hidemousecursor;
+			return colour_result;
+		}
+		if (keypressed())  glimpse(2);
+	} while (!leftmousekeypressed);
+	hidemousecursor;
+	colour_result = getpixel(mousex, mousey);
+	cleardevice();
+	return colour_result;
 }
 
-void addfield()
-{
-    byte fv; boolean ok;
-;
- do {
-  fv=colour();
-  ok=fields[fv].x1==nay;
-  if (! ok)  output << '\7';
- } while (!ok);
- {
- fieldtype& with = fields[fv]; 
- ;
-  with.x1=300+fv*17; with.x2=with.x1+1; with.y1=200; with.y2=177;
- }
+void addfield() {
+	byte fv;
+	boolean ok;
+	;
+	do {
+		fv = colour();
+		ok = fields[fv].x1 == nay;
+		if (! ok)  output << '\7';
+	} while (!ok);
+	{
+		fieldtype &with = fields[fv];
+		;
+		with.x1 = 300 + fv * 17;
+		with.x2 = with.x1 + 1;
+		with.y1 = 200;
+		with.y2 = 177;
+	}
 }
 
-byte checkline()
-{
-    byte fv,ans;
-byte checkline_result;
-;
- setgraphicscursor(crosshairs);
- setcrtpagenumber(0); setactivepage(0); setvisualpage(0); drawup();
- do {
-  showmousecursor;
-  do {
-   if (rightmousekeypressed)  {; checkline_result=255; return checkline_result; }
-   if (keypressed())  glimpse(0);
-  } while (!leftmousekeypressed);
-  hidemousecursor;
-  setactivepage(1); ans=177;
-  for( fv=1; fv <= numlines; fv ++) /*  */
-  {;
-   { linetype& with = lines[fv]; 
-    if (x1!=nay) 
-    {;
-     setcolor( 9); line(x1,y1,x2,y2);
-     if (getpixel(mousex,mousey)==9)  ans=fv;
-     setcolor( 0); line(x1,y1,x2,y2);
-    }}
-   { fieldtype& with = fields[fv]; 
-    if (with.x1!=nay) 
-    {;
-     setcolor( 9); rectangle(with.x1,with.y1,with.x2,with.y2);
-     if (getpixel(mousex,mousey)==9)  ans=fv+100;
-     setcolor( 0); rectangle(with.x1,with.y1,with.x2,with.y2);
-    }}
-  }
-  setactivepage(0);
- } while (!(ans!=177));
- checkline_result=ans;
-return checkline_result;
+byte checkline() {
+	byte fv, ans;
+	byte checkline_result;
+	;
+	setgraphicscursor(crosshairs);
+	setcrtpagenumber(0);
+	setactivepage(0);
+	setvisualpage(0);
+	drawup();
+	do {
+		showmousecursor;
+		do {
+			if (rightmousekeypressed)  {
+				;
+				checkline_result = 255;
+				return checkline_result;
+			}
+			if (keypressed())  glimpse(0);
+		} while (!leftmousekeypressed);
+		hidemousecursor;
+		setactivepage(1);
+		ans = 177;
+		for (fv = 1; fv <= numlines; fv ++) { /*  */
+			;
+			{
+				linetype &with = lines[fv];
+				if (x1 != nay) {
+					;
+					setcolor(9);
+					line(x1, y1, x2, y2);
+					if (getpixel(mousex, mousey) == 9)  ans = fv;
+					setcolor(0);
+					line(x1, y1, x2, y2);
+				}
+			}
+			{
+				fieldtype &with = fields[fv];
+				if (with.x1 != nay) {
+					;
+					setcolor(9);
+					rectangle(with.x1, with.y1, with.x2, with.y2);
+					if (getpixel(mousex, mousey) == 9)  ans = fv + 100;
+					setcolor(0);
+					rectangle(with.x1, with.y1, with.x2, with.y2);
+				}
+			}
+		}
+		setactivepage(0);
+	} while (!(ans != 177));
+	checkline_result = ans;
+	return checkline_result;
 }
 
 void chooseside();
-static boolean itsaline; 
-
-static void plotline()
-{;
- if (itsaline) 
-  { linetype& with = lines[gd]; 
-   if (do1)  line(mousex,mousey,x2,y2); else
-    line(x1,y1,mousex,mousey);}
- else
-  { fieldtype& with = fields[gd]; 
-   if (do1)  rectangle(mousex,mousey,with.x2,with.y2); else
-    rectangle(with.x1,with.y1,mousex,mousey);}
+static boolean itsaline;
+
+static void plotline() {
+	;
+	if (itsaline) {
+		linetype &with = lines[gd];
+		if (do1)  line(mousex, mousey, x2, y2);
+		else
+			line(x1, y1, mousex, mousey);
+	} else {
+		fieldtype &with = fields[gd];
+		if (do1)  rectangle(mousex, mousey, with.x2, with.y2);
+		else
+			rectangle(with.x1, with.y1, mousex, mousey);
+	}
 }
 
-void chooseside()
-{
-    byte clicol,savelcol;fieldtype current; integer temp;
-;
- do {
-  gd=checkline(); itsaline=gd<100;
-  if (gd==255)  {; hidemousecursor; return; }
-  if (! itsaline)  gd -= 100;
-  setactivepage(2); setvisualpage(2); cleardevice();
-  setgraphicscursor(tthand); setcrtpagenumber(2);
-  if (itsaline) 
-  {;
-   current=lines[gd];
-   savelcol=lines[gd].col;
-  } else current=fields[gd];
-  {;
-   setcolor(9);
-   if (itsaline)  line(current.x1,current.y1,current.x2,current.y2); else rectangle(current.x1,current.y1,current.x2,current.y2);
-    setcolor(9);
-    setfillstyle(1,red);   bar(current.x1-3,current.y1-3,current.x1+3,current.y1+3);
-    setfillstyle(1,green); bar(current.x2-3,current.y2-3,current.x2+3,current.y2+3);
-   do {; } while (!(~ anymousekeypressed));
-   clicol=177; showmousecursor;
-  do {
-   if (anymousekeypressed) 
-   {;
-    hidemousecursor;
-    clicol=getpixel(mousex,mousey);
-    showmousecursor;
-   }
-   if (rightmousekeypressed) 
-    {; hidemousecursor; return; }
-   if (keypressed())  glimpse(2);
-  } while (!(set::of(red,green, eos).has(clicol)));
-  do1=clicol==red; hidemousecursor;
-  setgraphicscursor(hook); setcrtpagenumber(0);
-  setactivepage(0); setvisualpage(0); setcolor(0);
-  if (itsaline) 
-  {
-                     linetype& with1 = lines[gd];  ; line(current.x1,current.y1,current.x2,current.y2); setcolor(with1.col); } else
-  {
-                     fieldtype& with1 = fields[gd];  ; rectangle(with1.x1,with1.y1,with1.x2,with1.y2); setcolor(gd); }
-  setwritemode(xorput);
-  while (~ anymousekeypressed) 
-  {;
-   plotline();
-   showmousecursor; delay(1); hidemousecursor;
-   plotline();
-   if (rightmousekeypressed)  {; hidemousecursor; return; }
-   if (keypressed())  glimpse(0);
-  }
-  /* update "current" rec */
-  if (do1)  {; current.x1=mousex; current.y1=mousey; }
-   else {; current.x2=mousex; current.y2=mousey; }
-  if (! itsaline) 
-  {;
-   if (current.x1>current.x2)  {; temp=current.x2; current.x2=current.x1; current.x1=temp; }
-   if (current.y1>current.y2)  {; temp=current.y2; current.y2=current.y1; current.y1=temp; }
-  }
-  /* copy "current" to line/field */
-  if (itsaline) 
-   {
-   linetype& with1 = lines[gd]; 
-   ;
-    current.x1=current.x1; current.x2=current.x2; current.y1=current.y1; current.y2=current.y2;
-    with1.col=savelcol;
-   } else fields[gd]=current;
- }
- setwritemode(0);
- } while (!false);
+void chooseside() {
+	byte clicol, savelcol;
+	fieldtype current;
+	integer temp;
+	;
+	do {
+		gd = checkline();
+		itsaline = gd < 100;
+		if (gd == 255)  {
+			;
+			hidemousecursor;
+			return;
+		}
+		if (! itsaline)  gd -= 100;
+		setactivepage(2);
+		setvisualpage(2);
+		cleardevice();
+		setgraphicscursor(tthand);
+		setcrtpagenumber(2);
+		if (itsaline) {
+			;
+			current = lines[gd];
+			savelcol = lines[gd].col;
+		} else current = fields[gd];
+		{
+			;
+			setcolor(9);
+			if (itsaline)  line(current.x1, current.y1, current.x2, current.y2);
+			else rectangle(current.x1, current.y1, current.x2, current.y2);
+			setcolor(9);
+			setfillstyle(1, red);
+			bar(current.x1 - 3, current.y1 - 3, current.x1 + 3, current.y1 + 3);
+			setfillstyle(1, green);
+			bar(current.x2 - 3, current.y2 - 3, current.x2 + 3, current.y2 + 3);
+			do {
+				;
+			} while (!(~ anymousekeypressed));
+			clicol = 177;
+			showmousecursor;
+			do {
+				if (anymousekeypressed) {
+					;
+					hidemousecursor;
+					clicol = getpixel(mousex, mousey);
+					showmousecursor;
+				}
+				if (rightmousekeypressed) {
+					;
+					hidemousecursor;
+					return;
+				}
+				if (keypressed())  glimpse(2);
+			} while (!(set::of(red, green, eos).has(clicol)));
+			do1 = clicol == red;
+			hidemousecursor;
+			setgraphicscursor(hook);
+			setcrtpagenumber(0);
+			setactivepage(0);
+			setvisualpage(0);
+			setcolor(0);
+			if (itsaline) {
+				linetype &with1 = lines[gd];  ;
+				line(current.x1, current.y1, current.x2, current.y2);
+				setcolor(with1.col);
+			} else {
+				fieldtype &with1 = fields[gd];  ;
+				rectangle(with1.x1, with1.y1, with1.x2, with1.y2);
+				setcolor(gd);
+			}
+			setwritemode(xorput);
+			while (~ anymousekeypressed) {
+				;
+				plotline();
+				showmousecursor;
+				delay(1);
+				hidemousecursor;
+				plotline();
+				if (rightmousekeypressed)  {
+					;
+					hidemousecursor;
+					return;
+				}
+				if (keypressed())  glimpse(0);
+			}
+			/* update "current" rec */
+			if (do1)  {
+				;
+				current.x1 = mousex;
+				current.y1 = mousey;
+			} else {
+				;
+				current.x2 = mousex;
+				current.y2 = mousey;
+			}
+			if (! itsaline) {
+				;
+				if (current.x1 > current.x2)  {
+					;
+					temp = current.x2;
+					current.x2 = current.x1;
+					current.x1 = temp;
+				}
+				if (current.y1 > current.y2)  {
+					;
+					temp = current.y2;
+					current.y2 = current.y1;
+					current.y1 = temp;
+				}
+			}
+			/* copy "current" to line/field */
+			if (itsaline) {
+				linetype &with1 = lines[gd];
+				;
+				current.x1 = current.x1;
+				current.x2 = current.x2;
+				current.y1 = current.y1;
+				current.y2 = current.y2;
+				with1.col = savelcol;
+			} else fields[gd] = current;
+		}
+		setwritemode(0);
+	} while (!false);
 }
 
-void delped()
-{;
- setcrtpagenumber(0); setactivepage(0); setvisualpage(0);
- drawup(); setgraphicscursor(tthand); showmousecursor;
- do {; } while (!leftmousekeypressed); peds[colour()].dir=177;
+void delped() {
+	;
+	setcrtpagenumber(0);
+	setactivepage(0);
+	setvisualpage(0);
+	drawup();
+	setgraphicscursor(tthand);
+	showmousecursor;
+	do {
+		;
+	} while (!leftmousekeypressed);
+	peds[colour()].dir = 177;
 }
 
 byte menu();
 
-static void say(byte y, string x)
-{;
- setfillstyle(1,y);
- bar(0,y*17,100,y*17+15); outtextxy(123,y*17,x);
+static void say(byte y, string x) {
+	;
+	setfillstyle(1, y);
+	bar(0, y * 17, 100, y * 17 + 15);
+	outtextxy(123, y * 17, x);
 }
 
-byte menu()
-{
-    byte clicol;
-byte menu_result;
-;
-  setcolor(15); settextstyle(0,0,2); clicol=0; setgraphicscursor(tthand);
-  setvisualpage(2); setactivepage(2); setcrtpagenumber(2); cleardevice();
-  say(3,"Move lines around");
-  say(4,"Add a new line");
-  say(5,"Delete a line");
-  say(6,"Add a ped");
-  say(7,"Delete a ped");
-  say(8,"Add a field");
-  say(10,"Return to Also.");
-  showmousecursor;
-  do {
-   if (leftmousekeypressed) 
-   {;
-    hidemousecursor;
-    clicol=getpixel(mousex,mousey);
-    showmousecursor;
-   }
-   if (rightmousekeypressed)  {; hidemousecursor; return menu_result; }
-   if (keypressed())  glimpse(2);
-  } while (!(clicol>0));
-  do {; } while (!(~ anymousekeypressed));
-  hidemousecursor;
-  menu_result=clicol;
-return menu_result;
+byte menu() {
+	byte clicol;
+	byte menu_result;
+	;
+	setcolor(15);
+	settextstyle(0, 0, 2);
+	clicol = 0;
+	setgraphicscursor(tthand);
+	setvisualpage(2);
+	setactivepage(2);
+	setcrtpagenumber(2);
+	cleardevice();
+	say(3, "Move lines around");
+	say(4, "Add a new line");
+	say(5, "Delete a line");
+	say(6, "Add a ped");
+	say(7, "Delete a ped");
+	say(8, "Add a field");
+	say(10, "Return to Also.");
+	showmousecursor;
+	do {
+		if (leftmousekeypressed) {
+			;
+			hidemousecursor;
+			clicol = getpixel(mousex, mousey);
+			showmousecursor;
+		}
+		if (rightmousekeypressed)  {
+			;
+			hidemousecursor;
+			return menu_result;
+		}
+		if (keypressed())  glimpse(2);
+	} while (!(clicol > 0));
+	do {
+		;
+	} while (!(~ anymousekeypressed));
+	hidemousecursor;
+	menu_result = clicol;
+	return menu_result;
 }
 
-void removeline()
-{;
- gd=checkline(); if (gd==255)  {; hidemousecursor; return; }
- if (gd>100) 
-  fields[gd-100].x1=nay;
- else lines[gd].x1=nay;  /* cancels it out */
- cleardevice(); drawup();
+void removeline() {
+	;
+	gd = checkline();
+	if (gd == 255)  {
+		;
+		hidemousecursor;
+		return;
+	}
+	if (gd > 100)
+		fields[gd - 100].x1 = nay;
+	else lines[gd].x1 = nay; /* cancels it out */
+	cleardevice();
+	drawup();
 }
 
-void lino()
-{;
- resetmouse;
- do {
-  switch (menu()) {
-   case 3: chooseside(); break;
-   case 4: addline(colour()); break;
-   case 5: removeline(); break;
-   case 6: addped(); break;
-   case 7: delped(); break;
-   case 8: addfield(); break;
-  case 10: return; break;
-  }
- } while (!false);
+void lino() {
+	;
+	resetmouse;
+	do {
+		switch (menu()) {
+		case 3:
+			chooseside();
+			break;
+		case 4:
+			addline(colour());
+			break;
+		case 5:
+			removeline();
+			break;
+		case 6:
+			addped();
+			break;
+		case 7:
+			delped();
+			break;
+		case 8:
+			addfield();
+			break;
+		case 10:
+			return;
+			break;
+		}
+	} while (!false);
 }
 
-void loadscreen()     /* load2 */
-{
- byte a /*absolute $A000:246560*/;
- byte bit;
- untyped_file f;
-;
- setactivepage(3); setvisualpage(3);
- assign(f,string("c:\\avalot\\place")+n+".avd"); reset(f,1); seek(f,177);
- for( bit=0; bit <= 3; bit ++)
- {;
-  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
-  blockread(f,a,12080);
- }
- close(f);
- setvisualpage(0);
- outtextxy(0,190,"Look carefully, and then press any key...");
- setactivepage(0);
+void loadscreen() {   /* load2 */
+	byte a /*absolute $A000:246560*/;
+	byte bit;
+	untyped_file f;
+	;
+	setactivepage(3);
+	setvisualpage(3);
+	assign(f, string("c:\\avalot\\place") + n + ".avd");
+	reset(f, 1);
+	seek(f, 177);
+	for (bit = 0; bit <= 3; bit ++) {
+		;
+		port[0x3c4] = 2;
+		port[0x3ce] = 4;
+		port[0x3c5] = 1 << bit;
+		port[0x3cf] = bit;
+		blockread(f, a, 12080);
+	}
+	close(f);
+	setvisualpage(0);
+	outtextxy(0, 190, "Look carefully, and then press any key...");
+	setactivepage(0);
 }
 
-void ctrlsout(string& x)          /* Replace real ctrls with caret codes */
-{
-    byte fv; string xx;
-;
- xx="";
- for( fv=1; fv <= length(x); fv ++)
-  if (x[fv]>'\37')  xx=xx+x[fv]; else xx=xx+'^'+chr(ord(x[fv])+64);
- x=xx;
+void ctrlsout(string &x) {        /* Replace real ctrls with caret codes */
+	byte fv;
+	string xx;
+	;
+	xx = "";
+	for (fv = 1; fv <= length(x); fv ++)
+		if (x[fv] > '\37')  xx = xx + x[fv];
+		else xx = xx + '^' + chr(ord(x[fv]) + 64);
+	x = xx;
 }
 
-void ctrlsin(string& x)          /* Opposite of ctrlsout */
-{
-    byte fv; string xx; boolean ctrlwas;
-;
- xx=""; ctrlwas=false;
- for( fv=1; fv <= length(x); fv ++)
-  if (ctrlwas)    /* last char was a caret */
-   {;
-    xx=xx+chr(ord(upcase(x[fv]))-64);
-    ctrlwas=false;
-   }
-  else
-  {;     /* last char wasn't a caret... */
-   if (x[fv]=='^')  ctrlwas=true; else  /* ...but this one is */
-    xx=xx+x[fv];  /* ...but this one isn't */
-  }
- x=xx;
+void ctrlsin(string &x) {        /* Opposite of ctrlsout */
+	byte fv;
+	string xx;
+	boolean ctrlwas;
+	;
+	xx = "";
+	ctrlwas = false;
+	for (fv = 1; fv <= length(x); fv ++)
+		if (ctrlwas) {  /* last char was a caret */
+			;
+			xx = xx + chr(ord(upcase(x[fv])) - 64);
+			ctrlwas = false;
+		} else {
+			;     /* last char wasn't a caret... */
+			if (x[fv] == '^')  ctrlwas = true;
+			else  /* ...but this one is */
+				xx = xx + x[fv]; /* ...but this one isn't */
+		}
+	x = xx;
 }
 
-void flipover()     /* temp view other screen */
-{
-    char r;
-;
- setvisualpage(3); r=readkey(); setvisualpage(0);
+void flipover() {   /* temp view other screen */
+	char r;
+	;
+	setvisualpage(3);
+	r = readkey();
+	setvisualpage(0);
 }
 
-void plotchar(byte x,byte y, char n)
-{
-    byte fv;
-;
- if (chars[x][y]==n)  return;
- for( fv=0; fv <= 15; fv ++)
-  mem[0xa000*y*1200+(fv+3)*80+x]=skinny[ord(n)][fv];
- chars[x][y]=n;
+void plotchar(byte x, byte y, char n) {
+	byte fv;
+	;
+	if (chars[x][y] == n)  return;
+	for (fv = 0; fv <= 15; fv ++)
+		mem[0xa000 * y * 1200 + (fv + 3) * 80 + x] = skinny[ord(n)][fv];
+	chars[x][y] = n;
 }
 
-void cursor()
-{
-    byte fv;
-;
- cursorflash += 1;
- switch (cursorflash) {
-  case 1:case 127: for( fv=12; fv <= 14; fv ++)
-          mem[0xa000*ty*1200+(3+fv)*80+tx]=~(mem[0xa000*ty*1200+(3+fv)*80+tx]);
-          break;
-  case 255: cursorflash=0; break;
- }
+void cursor() {
+	byte fv;
+	;
+	cursorflash += 1;
+	switch (cursorflash) {
+	case 1:
+	case 127:
+		for (fv = 12; fv <= 14; fv ++)
+			mem[0xa000 * ty * 1200 + (3 + fv) * 80 + tx] = ~(mem[0xa000 * ty * 1200 + (3 + fv) * 80 + tx]);
+		break;
+	case 255:
+		cursorflash = 0;
+		break;
+	}
 }
 
-void losecursor()
-{;
- if (cursorflash<127)  {; cursorflash=126; cursor(); }
- cursorflash=0;
+void losecursor() {
+	;
+	if (cursorflash < 127)  {
+		;
+		cursorflash = 126;
+		cursor();
+	}
+	cursorflash = 0;
 }
 
-void gwrite(string x)
-{
-    byte fv;
-;
- for( fv=1; fv <= length(x); fv ++)
- {;
-  plotchar(tx,ty,x[fv]);
-  tx += 1;
-  if (tx==80)  {; ty += 1; tx=0; }
- }
+void gwrite(string x) {
+	byte fv;
+	;
+	for (fv = 1; fv <= length(x); fv ++) {
+		;
+		plotchar(tx, ty, x[fv]);
+		tx += 1;
+		if (tx == 80)  {
+			;
+			ty += 1;
+			tx = 0;
+		}
+	}
 }
 
-string typein(string x)
-{
-      const char marker = '\2';
-    byte p; char r;
-string typein_result;
-;
- setvisualpage(0); setactivepage(0); cleardevice();
- settextstyle(0,0,1); setcolor(15);
- outtextxy( 0,  0,"Press TAB to see the room...");
- outtextxy( 0, 20,"You may use any of these Control Codes:");
- outtextxy(30, 30,"Anywhere: ^M = new line, ^P = new scroll, |1 fix to speaker 1.");
- outtextxy(90, 40,"^B = new bubble");
- outtextxy(30, 50,"At end of line: ^C = centre line, ^L = left justify.");
- outtextxy(30, 60,"At end of scroll: ^D = Don't add automatic ^P here.");
- outtextxy( 0, 80,"(Use by typing in (eg for ^P) ^ then P, not Ctrl-P.)");
- p=0; ctrlsout(x); fillchar(chars,sizeof(chars),'\40');
- do {
-  tx=0; ty=6; gwrite(x+'\4'+'\40');
-  tx=(p % 80); ty=(p / 80)+6;
-  while (! keypressed())  {; delay(1); cursor(); } losecursor();
-  r=readkey();
-  switch (r) {
-   case '\10': if (p>0)  {; x=copy(x,1,p-1)+copy(x,p+1,255); p -= 1; } break; /* backspace */
-   case '\11': flipover(); break;
-   case '\40' ... '\377': {; x=copy(x,1,p)+r+copy(x,p+1,255); p += 1; } break;
-   case '\0': switch (readkey()) { /* extd. keystroke */
-        case 'G': p=0; break; /* Home */
-        case 'K': if (p>0)  p -= 1; break; /* left */
-        case 'M': if (p<length(x))  p += 1; break; /* right */
-        case 'H': if (p>80)  p -= 80; break; /* up */
-        case 'P': if (p<length(x)-80)  p += 80; break; /* down */
-        case 'O': p=length(x); break; /* End */
-        case 'S': x=copy(x,1,p)+copy(x,p+2,255); break; /* Del */
-       }
-       break;
-  }
- } while (!(r=='\15'));
- ctrlsin(x); typein_result=x;
-return typein_result;
+string typein(string x) {
+	const char marker = '\2';
+	byte p;
+	char r;
+	string typein_result;
+	;
+	setvisualpage(0);
+	setactivepage(0);
+	cleardevice();
+	settextstyle(0, 0, 1);
+	setcolor(15);
+	outtextxy(0,  0, "Press TAB to see the room...");
+	outtextxy(0, 20, "You may use any of these Control Codes:");
+	outtextxy(30, 30, "Anywhere: ^M = new line, ^P = new scroll, |1 fix to speaker 1.");
+	outtextxy(90, 40, "^B = new bubble");
+	outtextxy(30, 50, "At end of line: ^C = centre line, ^L = left justify.");
+	outtextxy(30, 60, "At end of scroll: ^D = Don't add automatic ^P here.");
+	outtextxy(0, 80, "(Use by typing in (eg for ^P) ^ then P, not Ctrl-P.)");
+	p = 0;
+	ctrlsout(x);
+	fillchar(chars, sizeof(chars), '\40');
+	do {
+		tx = 0;
+		ty = 6;
+		gwrite(x + '\4' + '\40');
+		tx = (p % 80);
+		ty = (p / 80) + 6;
+		while (! keypressed())  {
+			;
+			delay(1);
+			cursor();
+		}
+		losecursor();
+		r = readkey();
+		switch (r) {
+		case '\10':
+			if (p > 0)  {
+				;
+				x = copy(x, 1, p - 1) + copy(x, p + 1, 255);
+				p -= 1;
+			}
+			break; /* backspace */
+		case '\11':
+			flipover();
+			break;
+		case '\40' ... '\377': {
+			;
+			x = copy(x, 1, p) + r + copy(x, p + 1, 255);
+			p += 1;
+		}
+		break;
+		case '\0':
+			switch (readkey()) { /* extd. keystroke */
+			case 'G':
+				p = 0;
+				break; /* Home */
+			case 'K':
+				if (p > 0)  p -= 1;
+				break; /* left */
+			case 'M':
+				if (p < length(x))  p += 1;
+				break; /* right */
+			case 'H':
+				if (p > 80)  p -= 80;
+				break; /* up */
+			case 'P':
+				if (p < length(x) - 80)  p += 80;
+				break; /* down */
+			case 'O':
+				p = length(x);
+				break; /* End */
+			case 'S':
+				x = copy(x, 1, p) + copy(x, p + 2, 255);
+				break; /* Del */
+			}
+			break;
+		}
+	} while (!(r == '\15'));
+	ctrlsin(x);
+	typein_result = x;
+	return typein_result;
 }
 
-byte typeno(string title)
-{
- varying_string<2> x; char r; integer e; word p;
-byte typeno_result;
-;
- cleardevice(); x="000";
- settextstyle(0,0,3); setcolor(9); outtextxy(0,0,title);
- setfillstyle(1,0); setcolor(10); fillchar(chars,sizeof(chars),'\40');
- do {
-  bar(100,100,150,125);
-  outtextxy(100,100,x);
-  do { r=readkey(); } while (!(set::of(range('0','9'),'\33','\15', eos).has(r)));
-  if (r=='\33')  {; typeno_result=255; return typeno_result; }
-  if (r!='\15')  x=string(x[2])+r;
- } while (!(r=='\15'));
- val(x,p,e); typeno_result=p;
-return typeno_result;
+byte typeno(string title) {
+	varying_string<2> x;
+	char r;
+	integer e;
+	word p;
+	byte typeno_result;
+	;
+	cleardevice();
+	x = "000";
+	settextstyle(0, 0, 3);
+	setcolor(9);
+	outtextxy(0, 0, title);
+	setfillstyle(1, 0);
+	setcolor(10);
+	fillchar(chars, sizeof(chars), '\40');
+	do {
+		bar(100, 100, 150, 125);
+		outtextxy(100, 100, x);
+		do {
+			r = readkey();
+		} while (!(set::of(range('0', '9'), '\33', '\15', eos).has(r)));
+		if (r == '\33')  {
+			;
+			typeno_result = 255;
+			return typeno_result;
+		}
+		if (r != '\15')  x = string(x[2]) + r;
+	} while (!(r == '\15'));
+	val(x, p, e);
+	typeno_result = p;
+	return typeno_result;
 }
 
-void showallnames()
-{
-    byte fv; varying_string<2> s; char r;
-;
- settextstyle(0,0,2); cleardevice(); setcolor(13); outtextxy(0,0,"Descriptions start...");
- settextstyle(0,0,1); setcolor(7);
- for( fv=1; fv <= 29; fv ++)
- {;
-  str(fv,2,s);
-  outtextxy((fv / 15)*320,((fv % 15)*10)+30,s+'='+copy(names[fv][1],0,33));
- }
- setcolor(15); outtextxy(500,190,"Press any key...");
- r=readkey();
+void showallnames() {
+	byte fv;
+	varying_string<2> s;
+	char r;
+	;
+	settextstyle(0, 0, 2);
+	cleardevice();
+	setcolor(13);
+	outtextxy(0, 0, "Descriptions start...");
+	settextstyle(0, 0, 1);
+	setcolor(7);
+	for (fv = 1; fv <= 29; fv ++) {
+		;
+		str(fv, 2, s);
+		outtextxy((fv / 15) * 320, ((fv % 15) * 10) + 30, s + '=' + copy(names[fv][1], 0, 33));
+	}
+	setcolor(15);
+	outtextxy(500, 190, "Press any key...");
+	r = readkey();
 }
 
 void showallassoc();
 
 
-static void saascreen()
-{;
- settextstyle(0,0,2); cleardevice(); setcolor(10); outtextxy(0,0,"Everything...");
- settextstyle(0,0,1); setcolor(2);
- outtextxy(17,20,"(Format: <number> : <start of names> : <start of desc.>)");
+static void saascreen() {
+	;
+	settextstyle(0, 0, 2);
+	cleardevice();
+	setcolor(10);
+	outtextxy(0, 0, "Everything...");
+	settextstyle(0, 0, 1);
+	setcolor(2);
+	outtextxy(17, 20, "(Format: <number> : <start of names> : <start of desc.>)");
 }
 
-void showallassoc()
-{
-    byte fv; varying_string<2> s; char r;
-
-;
- saascreen();
- for( fv=1; fv <= 30; fv ++)
- {;
-  str(fv-1,2,s);
-  outtextxy(0,(((fv-1) % 10)*10)+30,
-   s+':'+copy(names[fv-1][1],1,7)+':'+copy(names[fv-1][2],1,70));
-  if ((fv % 10)==0)  {; r=readkey(); saascreen(); }
- }
- setcolor(15); outtextxy(500,190,"Press any key...");
- r=readkey();
+void showallassoc() {
+	byte fv;
+	varying_string<2> s;
+	char r;
+
+	;
+	saascreen();
+	for (fv = 1; fv <= 30; fv ++) {
+		;
+		str(fv - 1, 2, s);
+		outtextxy(0, (((fv - 1) % 10) * 10) + 30,
+		          s + ':' + copy(names[fv - 1][1], 1, 7) + ':' + copy(names[fv - 1][2], 1, 70));
+		if ((fv % 10) == 0)  {
+			;
+			r = readkey();
+			saascreen();
+		}
+	}
+	setcolor(15);
+	outtextxy(500, 190, "Press any key...");
+	r = readkey();
 }
 
-void clear()
-{
-    byte fv;
-;
- fillchar(names ,sizeof(names ),  '\0');
- for( fv=1; fv <= numlines; fv ++) {; lines[fv].x1=nay; fields[fv].x1=nay; }
- fillchar(peds  ,sizeof(peds  ),'\261');
+void clear() {
+	byte fv;
+	;
+	fillchar(names , sizeof(names),  '\0');
+	for (fv = 1; fv <= numlines; fv ++) {
+		;
+		lines[fv].x1 = nay;
+		fields[fv].x1 = nay;
+	}
+	fillchar(peds  , sizeof(peds), '\261');
 }
 
 void scramble();
 
-static void scram1(string& x)
-{
-    byte fz;
-;
- for( fz=1; fz <= length(x); fz ++)
-  x[fz]=chr(ord(x[fz]) ^ 177);
+static void scram1(string &x) {
+	byte fz;
+	;
+	for (fz = 1; fz <= length(x); fz ++)
+		x[fz] = chr(ord(x[fz]) ^ 177);
 }
 
-void scramble()     /* Works both ways. */
-{
-    byte fv,ff;
-;
- for( fv=0; fv <= 29; fv ++)
-  for( ff=1; ff <= 2; ff ++)
-   scram1(names[fv][ff]);
- scram1(listen);
- scram1(flags);
+void scramble() {   /* Works both ways. */
+	byte fv, ff;
+	;
+	for (fv = 0; fv <= 29; fv ++)
+		for (ff = 1; ff <= 2; ff ++)
+			scram1(names[fv][ff]);
+	scram1(listen);
+	scram1(flags);
 }
 
-void save()
-{
-    string x; untyped_file f; byte minnames,minlines,minpeds,minfields,fv,ff;
-;
- minnames =0; for( fv=0; fv <= 29; fv ++) if (names[fv][1]!="")     minnames =fv;
- minlines =0; for( fv=1; fv <= numlines; fv ++)
-                if (lines[fv].x1!=nay)   minlines =fv;
- minpeds  =0; for( fv=1; fv <= 15; fv ++) if (peds[fv].dir<177)    minpeds  =fv;
- minfields=0; for( fv=1; fv <= 30; fv ++) if (fields[fv].x1!=nay)  minfields=fv;
- assign(f,string("c:\\avalot\\also")+n+".avd");
- rewrite(f,1);
- x=string("This is an Also .AVD file, which belongs to AVALOT.EXE. Its contents")+
- '\15'+'\12'+"are subject to copyright, so there. Have fun!"+'\32'+" *Minstrel* ";
- blockwrite(f,x[1],128);
- scramble();
- blockwrite(f,minnames,1);
- for( fv=0; fv <= minnames; fv ++)
-  for( ff=1; ff <= 2; ff ++)
-   blockwrite(f,names[fv][ff],length(names[fv][ff])+1);
- blockwrite(f,minlines,1);
- blockwrite(f,lines,sizeof(lines[1])*minlines);
- blockwrite(f,minpeds,1);
- blockwrite(f,peds,sizeof(peds[1])*minpeds);
- blockwrite(f,minfields,1);
- blockwrite(f,fields,sizeof(fields[1])*minfields);
- blockwrite(f,magics,sizeof(magics));
- blockwrite(f,portals,sizeof(portals));
- blockwrite(f,flags,sizeof(flags));
- blockwrite(f,listen[0],1);
- blockwrite(f,listen[1],length(listen));
- close(f);
- scramble();
+void save() {
+	string x;
+	untyped_file f;
+	byte minnames, minlines, minpeds, minfields, fv, ff;
+	;
+	minnames = 0;
+	for (fv = 0; fv <= 29; fv ++) if (names[fv][1] != "")     minnames = fv;
+	minlines = 0;
+	for (fv = 1; fv <= numlines; fv ++)
+		if (lines[fv].x1 != nay)   minlines = fv;
+	minpeds  = 0;
+	for (fv = 1; fv <= 15; fv ++) if (peds[fv].dir < 177)    minpeds  = fv;
+	minfields = 0;
+	for (fv = 1; fv <= 30; fv ++) if (fields[fv].x1 != nay)  minfields = fv;
+	assign(f, string("c:\\avalot\\also") + n + ".avd");
+	rewrite(f, 1);
+	x = string("This is an Also .AVD file, which belongs to AVALOT.EXE. Its contents") +
+	    '\15' + '\12' + "are subject to copyright, so there. Have fun!" + '\32' + " *Minstrel* ";
+	blockwrite(f, x[1], 128);
+	scramble();
+	blockwrite(f, minnames, 1);
+	for (fv = 0; fv <= minnames; fv ++)
+		for (ff = 1; ff <= 2; ff ++)
+			blockwrite(f, names[fv][ff], length(names[fv][ff]) + 1);
+	blockwrite(f, minlines, 1);
+	blockwrite(f, lines, sizeof(lines[1])*minlines);
+	blockwrite(f, minpeds, 1);
+	blockwrite(f, peds, sizeof(peds[1])*minpeds);
+	blockwrite(f, minfields, 1);
+	blockwrite(f, fields, sizeof(fields[1])*minfields);
+	blockwrite(f, magics, sizeof(magics));
+	blockwrite(f, portals, sizeof(portals));
+	blockwrite(f, flags, sizeof(flags));
+	blockwrite(f, listen[0], 1);
+	blockwrite(f, listen[1], length(listen));
+	close(f);
+	scramble();
 }
 
 void load();
-static untyped_file f; 
-
-
-static string nextstring()
-{
-    byte l; string x;
-string nextstring_result;
-;
- x=""; blockread(f,l,1); blockread(f,x[1],l); x[0]=chr(l); nextstring_result=x;
-return nextstring_result;
+static untyped_file f;
+
+
+static string nextstring() {
+	byte l;
+	string x;
+	string nextstring_result;
+	;
+	x = "";
+	blockread(f, l, 1);
+	blockread(f, x[1], l);
+	x[0] = chr(l);
+	nextstring_result = x;
+	return nextstring_result;
 }
 
-void load()
-{
-            byte minnames,minlines,minpeds,minfields; byte ff,fv;
-
-;
- clear();
- assign(f,string("c:\\avalot\\also")+n+".avd");
-/*$I-*/ reset(f,1); /*$I+*/ if (ioresult!=0)  return; /* no Also file */
- seek(f,128); blockread(f,minnames,1);
- for( fv=0; fv <= minnames; fv ++)
-  for( ff=1; ff <= 2; ff ++)
-   names[fv][ff]=nextstring();
- blockread(f,minlines,1);
- blockread(f,lines,sizeof(lines[1])*minlines);
- blockread(f,minpeds,1);
- blockread(f,peds,sizeof(peds[1])*minpeds);
- blockread(f,minfields,1);
- blockread(f,fields,sizeof(fields[1])*minfields);
- blockread(f,magics,sizeof(magics));
- blockread(f,portals,sizeof(portals));
- blockread(f,flags,sizeof(flags));
- blockread(f,listen[0],1);
- blockread(f,listen[1],length(listen));
- close(f);
- scramble();
+void load() {
+	byte minnames, minlines, minpeds, minfields;
+	byte ff, fv;
+
+	;
+	clear();
+	assign(f, string("c:\\avalot\\also") + n + ".avd");
+	/*$I-*/ reset(f, 1); /*$I+*/ if (ioresult != 0)  return; /* no Also file */
+	seek(f, 128);
+	blockread(f, minnames, 1);
+	for (fv = 0; fv <= minnames; fv ++)
+		for (ff = 1; ff <= 2; ff ++)
+			names[fv][ff] = nextstring();
+	blockread(f, minlines, 1);
+	blockread(f, lines, sizeof(lines[1])*minlines);
+	blockread(f, minpeds, 1);
+	blockread(f, peds, sizeof(peds[1])*minpeds);
+	blockread(f, minfields, 1);
+	blockread(f, fields, sizeof(fields[1])*minfields);
+	blockread(f, magics, sizeof(magics));
+	blockread(f, portals, sizeof(portals));
+	blockread(f, flags, sizeof(flags));
+	blockread(f, listen[0], 1);
+	blockread(f, listen[1], length(listen));
+	close(f);
+	scramble();
 }
 
 void editmagics();
-const array<1,15,char> codes = "123456789ABCDEF";
+const array<1, 15, char> codes = "123456789ABCDEF";
 
 static integer y;
 
 
-static void display()
-{
-    byte fv;
-;
- cleardevice();
- settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Magics.");
- settextstyle(0,0,1);
- for( fv=1; fv <= 15; fv ++)
- {;
-  y=23+fv*10;
-  setcolor(fv); outtextxy(100,y,string('$')+codes[fv-1]);
-  {
-  magictype& with = magics[fv]; 
-  ;
-   switch (with.op) {
-    case nix: {; setcolor(8); outtextxy(140,y,"Nix"); } break;
-    case bounce: {; setcolor(10); outtextxy(143,y,"Bounce!"); } break;
-    case exclaim: {;
-              setcolor(14); outtextxy(143,y,string("Exclaim: ")+strf(with.data));
-             }
-             break;
-    case transport: {;
-                setcolor(12);
-                outtextxy(143,y,string("Transport to ")+strf(hi(with.data))+
-                 ", ped "+strf(lo(with.data)));
-               }
-               break;
-    case unfinished: {;
-                 setcolor(15); outtextxy(143,y,"*** UNFINISHED! ***");
-                }
-                break;
-    case special: {;
-              setcolor(6); outtextxy(143,y,string("Special call no. ")+strf(with.data));
-             }
-             break;
-    case opendoor: {;
-               setcolor(11);
-               outtextxy(143,y,string("Opening door to ")+strf(hi(with.data))+
-                ", ped "+strf(lo(with.data)));
-              }
-              break;
-   }
-  }
- }
- outtextxy(177,190,"Which do you want to change\? (Esc=Exit) $");
+static void display() {
+	byte fv;
+	;
+	cleardevice();
+	settextstyle(0, 0, 2);
+	setcolor(15);
+	outtextxy(0, 0, "Magics.");
+	settextstyle(0, 0, 1);
+	for (fv = 1; fv <= 15; fv ++) {
+		;
+		y = 23 + fv * 10;
+		setcolor(fv);
+		outtextxy(100, y, string('$') + codes[fv - 1]);
+		{
+			magictype &with = magics[fv];
+			;
+			switch (with.op) {
+			case nix: {
+				;
+				setcolor(8);
+				outtextxy(140, y, "Nix");
+			}
+			break;
+			case bounce: {
+				;
+				setcolor(10);
+				outtextxy(143, y, "Bounce!");
+			}
+			break;
+			case exclaim: {
+				;
+				setcolor(14);
+				outtextxy(143, y, string("Exclaim: ") + strf(with.data));
+			}
+			break;
+			case transport: {
+				;
+				setcolor(12);
+				outtextxy(143, y, string("Transport to ") + strf(hi(with.data)) +
+				          ", ped " + strf(lo(with.data)));
+			}
+			break;
+			case unfinished: {
+				;
+				setcolor(15);
+				outtextxy(143, y, "*** UNFINISHED! ***");
+			}
+			break;
+			case special: {
+				;
+				setcolor(6);
+				outtextxy(143, y, string("Special call no. ") + strf(with.data));
+			}
+			break;
+			case opendoor: {
+				;
+				setcolor(11);
+				outtextxy(143, y, string("Opening door to ") + strf(hi(with.data)) +
+				          ", ped " + strf(lo(with.data)));
+			}
+			break;
+			}
+		}
+	}
+	outtextxy(177, 190, "Which do you want to change\? (Esc=Exit) $");
 }
 
 
 
-static word ask(string x)
-{
-    string q; word thomaswashere; integer e;
-word ask_result;
-;
- cleardevice();
- setcolor(10); settextstyle(0,0,3); outtextxy(0,100,x);
- do {
-  input >> q >> NL; val(q,thomaswashere,e);
- } while (!(e==0)); ask_result=thomaswashere;
-return ask_result;
+static word ask(string x) {
+	string q;
+	word thomaswashere;
+	integer e;
+	word ask_result;
+	;
+	cleardevice();
+	setcolor(10);
+	settextstyle(0, 0, 3);
+	outtextxy(0, 100, x);
+	do {
+		input >> q >> NL;
+		val(q, thomaswashere, e);
+	} while (!(e == 0));
+	ask_result = thomaswashere;
+	return ask_result;
 }
 
-void editmagics()
-{
- char r,rr; byte p;
-
-;
- do {
-  display();
-  do {
-   r=upcase(readkey());
-   if (r=='\33')  return;
-   p=pos(r,codes);  /* which are we editing? */
-  } while (!(p>0)); /* it must BE there... */
-  setcolor(p); cleardevice();
-  outtextxy(177,17,string("Editing magic $")+r+'.');
-  outtextxy(0,30,"New operation ( (N)ix, (B)ounce, (E)xclaim, (T)ransport, (U)nfinished),");
-  outtextxy(30,40,"(S)pecial, (O)pening Door?");
-  do { rr=upcase(readkey()); } while (!(set::of('N','B','E','T','U','S','O','\33', eos).has(rr)));
-  { magictype& with = magics[p]; 
-   switch (rr) {
-    case '\33': return; break; /* cancelling code */
-    case 'N': with.op=nix; break;
-    case 'B': with.op=bounce; break;
-    case 'E': {; with.op=exclaim; with.data=ask("Which scroll?"); } break;
-    case 'T': {; with.op=transport; with.data=ask("Ped no.?")+ask("Whither?")*256; } break;
-    case 'U': with.op=unfinished; break;
-    case 'S': {; with.op=special; with.data=ask("Which call?"); } break;
-    case 'O': {; with.op=opendoor; with.data=ask("Ped no.?")+ask("Whither?")*256; } break;
-   }}
- } while (!false);
+void editmagics() {
+	char r, rr;
+	byte p;
+
+	;
+	do {
+		display();
+		do {
+			r = upcase(readkey());
+			if (r == '\33')  return;
+			p = pos(r, codes); /* which are we editing? */
+		} while (!(p > 0)); /* it must BE there... */
+		setcolor(p);
+		cleardevice();
+		outtextxy(177, 17, string("Editing magic $") + r + '.');
+		outtextxy(0, 30, "New operation ( (N)ix, (B)ounce, (E)xclaim, (T)ransport, (U)nfinished),");
+		outtextxy(30, 40, "(S)pecial, (O)pening Door?");
+		do {
+			rr = upcase(readkey());
+		} while (!(set::of('N', 'B', 'E', 'T', 'U', 'S', 'O', '\33', eos).has(rr)));
+		{
+			magictype &with = magics[p];
+			switch (rr) {
+			case '\33':
+				return;
+				break; /* cancelling code */
+			case 'N':
+				with.op = nix;
+				break;
+			case 'B':
+				with.op = bounce;
+				break;
+			case 'E': {
+				;
+				with.op = exclaim;
+				with.data = ask("Which scroll?");
+			}
+			break;
+			case 'T': {
+				;
+				with.op = transport;
+				with.data = ask("Ped no.?") + ask("Whither?") * 256;
+			}
+			break;
+			case 'U':
+				with.op = unfinished;
+				break;
+			case 'S': {
+				;
+				with.op = special;
+				with.data = ask("Which call?");
+			}
+			break;
+			case 'O': {
+				;
+				with.op = opendoor;
+				with.data = ask("Ped no.?") + ask("Whither?") * 256;
+			}
+			break;
+			}
+		}
+	} while (!false);
 }
 
 void editportals();
-const array<9,15,char> codes1 = "9ABCDEF";
+const array<9, 15, char> codes1 = "9ABCDEF";
 
 static integer y2;
 
 
-static void display1()
-{
-    byte fv;
-;
- cleardevice();
- settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Portals.");
- settextstyle(0,0,1);
- for( fv=9; fv <= 15; fv ++)
- {;
-  y2=fv*10-53;
-  setcolor(fv); outtextxy(100,y2,string('$')+codes1[fv-1]);
-  {
-  magictype& with = portals[fv]; 
-  ;
-   switch (with.op) {
-    case nix: {; setcolor(8); outtextxy(140,y2,"Nix"); } break;
-    case exclaim: {;
-              setcolor(14); outtextxy(143,y2,string("Exclaim: ")+strf(with.data));
-             }
-             break;
-    case transport: {;
-                setcolor(12);
-                outtextxy(143,y2,string("Transport to ")+strf(hi(with.data))+
-                 ", ped "+strf(lo(with.data)));
-               }
-               break;
-    case unfinished: {;
-                 setcolor(15); outtextxy(143,y2,"*** UNFINISHED! ***");
-                }
-                break;
-    case special: {;
-              setcolor(6); outtextxy(143,y2,string("Special call no. ")+strf(with.data));
-             }
-             break;
-    case opendoor: {;
-               setcolor(11);
-               outtextxy(143,y2,string("Opening door to ")+strf(hi(with.data))+
-                ", ped "+strf(lo(with.data)));
-              }
-              break;
-   }
-  }
- }
- outtextxy(177,190,"Which do you want to change\? (Esc=Exit) $");
+static void display1() {
+	byte fv;
+	;
+	cleardevice();
+	settextstyle(0, 0, 2);
+	setcolor(15);
+	outtextxy(0, 0, "Portals.");
+	settextstyle(0, 0, 1);
+	for (fv = 9; fv <= 15; fv ++) {
+		;
+		y2 = fv * 10 - 53;
+		setcolor(fv);
+		outtextxy(100, y2, string('$') + codes1[fv - 1]);
+		{
+			magictype &with = portals[fv];
+			;
+			switch (with.op) {
+			case nix: {
+				;
+				setcolor(8);
+				outtextxy(140, y2, "Nix");
+			}
+			break;
+			case exclaim: {
+				;
+				setcolor(14);
+				outtextxy(143, y2, string("Exclaim: ") + strf(with.data));
+			}
+			break;
+			case transport: {
+				;
+				setcolor(12);
+				outtextxy(143, y2, string("Transport to ") + strf(hi(with.data)) +
+				          ", ped " + strf(lo(with.data)));
+			}
+			break;
+			case unfinished: {
+				;
+				setcolor(15);
+				outtextxy(143, y2, "*** UNFINISHED! ***");
+			}
+			break;
+			case special: {
+				;
+				setcolor(6);
+				outtextxy(143, y2, string("Special call no. ") + strf(with.data));
+			}
+			break;
+			case opendoor: {
+				;
+				setcolor(11);
+				outtextxy(143, y2, string("Opening door to ") + strf(hi(with.data)) +
+				          ", ped " + strf(lo(with.data)));
+			}
+			break;
+			}
+		}
+	}
+	outtextxy(177, 190, "Which do you want to change\? (Esc=Exit) $");
 }
 
 
 
-static word ask1(string x)
-{
-    string q; word thomaswashere; integer e;
-word ask1_result;
-;
- cleardevice();
- setcolor(10); settextstyle(0,0,3); outtextxy(0,100,x);
- do {
-  input >> q >> NL; val(q,thomaswashere,e);
- } while (!(e==0)); ask1_result=thomaswashere;
-return ask1_result;
+static word ask1(string x) {
+	string q;
+	word thomaswashere;
+	integer e;
+	word ask1_result;
+	;
+	cleardevice();
+	setcolor(10);
+	settextstyle(0, 0, 3);
+	outtextxy(0, 100, x);
+	do {
+		input >> q >> NL;
+		val(q, thomaswashere, e);
+	} while (!(e == 0));
+	ask1_result = thomaswashere;
+	return ask1_result;
 }
 
-void editportals()     /* much t'same as editmagics */
-{
- char r,rr; byte p;
-
-;
- do {
-  display1();
-  do {
-   r=upcase(readkey());
-   if (r=='\33')  return;
-   p=pos(r,codes1); /* which are we editing? */
-  } while (!(p>0)); /* it must BE there... */
-  p += 8; setcolor(p); cleardevice();
-  outtextxy(177,17,string("Editing portal $")+r+'.');
-  outtextxy(0,30,"New operation ( (N)ix, (E)xclaim, (T)ransport, (U)nfinished),");
-  outtextxy(30,40,"(S)pecial, (O)pening Door?");
-  do { rr=upcase(readkey()); } while (!(set::of('N','E','T','U','S','O','\33', eos).has(rr)));
-  { magictype& with = portals[p]; 
-   switch (rr) {
-    case '\33': return; break; /* cancelling code */
-    case 'N': with.op=nix; break;
-    case 'E': {; with.op=exclaim; with.data=ask1("Which scroll?"); } break;
-    case 'T': {; with.op=transport; with.data=ask1("Ped no.?")+ask1("Whither?")*256; } break;
-    case 'U': with.op=unfinished; break;
-    case 'S': {; with.op=special; with.data=ask1("Which call?"); } break;
-    case 'O': {; with.op=opendoor; with.data=ask1("Ped no.?")+ask1("Whither?")*256; } break;
-   }}
- } while (!false);
+void editportals() {   /* much t'same as editmagics */
+	char r, rr;
+	byte p;
+
+	;
+	do {
+		display1();
+		do {
+			r = upcase(readkey());
+			if (r == '\33')  return;
+			p = pos(r, codes1); /* which are we editing? */
+		} while (!(p > 0)); /* it must BE there... */
+		p += 8;
+		setcolor(p);
+		cleardevice();
+		outtextxy(177, 17, string("Editing portal $") + r + '.');
+		outtextxy(0, 30, "New operation ( (N)ix, (E)xclaim, (T)ransport, (U)nfinished),");
+		outtextxy(30, 40, "(S)pecial, (O)pening Door?");
+		do {
+			rr = upcase(readkey());
+		} while (!(set::of('N', 'E', 'T', 'U', 'S', 'O', '\33', eos).has(rr)));
+		{
+			magictype &with = portals[p];
+			switch (rr) {
+			case '\33':
+				return;
+				break; /* cancelling code */
+			case 'N':
+				with.op = nix;
+				break;
+			case 'E': {
+				;
+				with.op = exclaim;
+				with.data = ask1("Which scroll?");
+			}
+			break;
+			case 'T': {
+				;
+				with.op = transport;
+				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
+			}
+			break;
+			case 'U':
+				with.op = unfinished;
+				break;
+			case 'S': {
+				;
+				with.op = special;
+				with.data = ask1("Which call?");
+			}
+			break;
+			case 'O': {
+				;
+				with.op = opendoor;
+				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
+			}
+			break;
+			}
+		}
+	} while (!false);
 }
 
-void editflags()
-{
-    char r;
-;
- cleardevice();
- settextstyle(0,0,2); setcolor(15); outtextxy(0,0,"Flags.");
- settextstyle(0,0,1); setcolor(10);
- outtextxy(100,30,"Press the letter of the flag you want to toggle.");
- outtextxy(100,40,"Tab = flip screens, Esc/Enter = return to menu.");
- setcolor(14); setfillstyle(1,0);
- for( r='A'; r <= 'Z'; r ++)
-  if (pos(r,flags)>0)  outtextxy(ord(r)*20-1223,77,r);
- do {
-  do { r=upcase(readkey()); } while (!(set::of(range('A','Z'),'\33','\15','\11', eos).has(r)));
-  switch (r) {
-   case RANGE_26('A','Z'): {;
-              if (pos(r,flags)>0) 
-              {;     /* flag is on- switch it off */
-               Delete(flags,pos(r,flags),1);
-               bar(ord(r)*20-1223,77,ord(r)*20-1213,87);
-               sound(1777); delay(7); nosound;
-              } else
-              {;     /* flag is off- switch it on */
-               flags=flags+r;
-               outtextxy(ord(r)*20-1223,77,r);
-               sound(177); delay(7); nosound;
-              }
-             }
-             break;
-   case '\33':case '\15': return; break;
-   case '\11': flipover(); break;
-  }
- } while (!false);
+void editflags() {
+	char r;
+	;
+	cleardevice();
+	settextstyle(0, 0, 2);
+	setcolor(15);
+	outtextxy(0, 0, "Flags.");
+	settextstyle(0, 0, 1);
+	setcolor(10);
+	outtextxy(100, 30, "Press the letter of the flag you want to toggle.");
+	outtextxy(100, 40, "Tab = flip screens, Esc/Enter = return to menu.");
+	setcolor(14);
+	setfillstyle(1, 0);
+	for (r = 'A'; r <= 'Z'; r ++)
+		if (pos(r, flags) > 0)  outtextxy(ord(r) * 20 - 1223, 77, r);
+	do {
+		do {
+			r = upcase(readkey());
+		} while (!(set::of(range('A', 'Z'), '\33', '\15', '\11', eos).has(r)));
+		switch (r) {
+		case RANGE_26('A', 'Z'): {
+			;
+			if (pos(r, flags) > 0) {
+				;     /* flag is on- switch it off */
+				Delete(flags, pos(r, flags), 1);
+				bar(ord(r) * 20 - 1223, 77, ord(r) * 20 - 1213, 87);
+				sound(1777);
+				delay(7);
+				nosound;
+			} else {
+				;     /* flag is off- switch it on */
+				flags = flags + r;
+				outtextxy(ord(r) * 20 - 1223, 77, r);
+				sound(177);
+				delay(7);
+				nosound;
+			}
+		}
+		break;
+		case '\33':
+		case '\15':
+			return;
+			break;
+		case '\11':
+			flipover();
+			break;
+		}
+	} while (!false);
 }
 
-void alsomenu()
-{
-    char r; byte t;
-;
- do {
-  setactivepage(0); setvisualpage(0);
-  cleardevice(); setcolor(15); settextstyle(0,0,2);
-  outtextxy(0,0,"Also... Main Menu");
-  settextstyle(0,0,1); setcolor(10);
-  outtextxy(100, 40,"1) Edit the names of an object");
-  outtextxy(100, 50,"2) View all names");
-  outtextxy(100, 60,"3) Edit the description of this object");
-  outtextxy(100, 70,"4) View all associations.");
-  outtextxy(100, 80,"5) Enter Lino mode.");
-  outtextxy(100, 90,"6) Edit magics.");
-  outtextxy(100,100,"7) Edit portals.");
-  outtextxy(100,110,"8) Edit flags.");
-  outtextxy(100,120,"9) Edit listen field.");
-  outtextxy(100,160,"S) Save");
-  outtextxy(100,170,"L) Load");
-  outtextxy( 80,180,"Tab) View other screen");
-  if (current==0)  outtextxy(0,140,"< Main description of room >"); else
-   outtextxy(0,140,string('<')+names[current][1]+'>');
-  do {
-   r=upcase(readkey()); if (r=='\11')  flipover();
-  } while (!(set::of(range('1','9'),'S','L','\0', eos).has(r)));
-  switch (r) {
-   case '1': {;
-         do {
-          t=typeno("Which object\? (0-30)");
-         } while (!((t<30) || (t==255)));
-         if ((t!=255) && (t!=0))  names[t][1]=typein(names[t][1]);
-         current=t;
-        }
-        break;
-   case '2': showallnames(); break;
-   case '3': names[current][2]=typein(names[current][2]); break;
-   case '4': showallassoc(); break;
-   case '5': lino(); break;
-   case '6': editmagics(); break;
-   case '7': editportals(); break;
-   case '8': editflags(); break;
-   case '9': listen=typein(listen); break;
-   case 'S': save(); break;
-   case 'L': load(); break;
-   case '\0': if (readkey()=='\55')  return; break;
-  }
- } while (!false);
+void alsomenu() {
+	char r;
+	byte t;
+	;
+	do {
+		setactivepage(0);
+		setvisualpage(0);
+		cleardevice();
+		setcolor(15);
+		settextstyle(0, 0, 2);
+		outtextxy(0, 0, "Also... Main Menu");
+		settextstyle(0, 0, 1);
+		setcolor(10);
+		outtextxy(100, 40, "1) Edit the names of an object");
+		outtextxy(100, 50, "2) View all names");
+		outtextxy(100, 60, "3) Edit the description of this object");
+		outtextxy(100, 70, "4) View all associations.");
+		outtextxy(100, 80, "5) Enter Lino mode.");
+		outtextxy(100, 90, "6) Edit magics.");
+		outtextxy(100, 100, "7) Edit portals.");
+		outtextxy(100, 110, "8) Edit flags.");
+		outtextxy(100, 120, "9) Edit listen field.");
+		outtextxy(100, 160, "S) Save");
+		outtextxy(100, 170, "L) Load");
+		outtextxy(80, 180, "Tab) View other screen");
+		if (current == 0)  outtextxy(0, 140, "< Main description of room >");
+		else
+			outtextxy(0, 140, string('<') + names[current][1] + '>');
+		do {
+			r = upcase(readkey());
+			if (r == '\11')  flipover();
+		} while (!(set::of(range('1', '9'), 'S', 'L', '\0', eos).has(r)));
+		switch (r) {
+		case '1': {
+			;
+			do {
+				t = typeno("Which object\? (0-30)");
+			} while (!((t < 30) || (t == 255)));
+			if ((t != 255) && (t != 0))  names[t][1] = typein(names[t][1]);
+			current = t;
+		}
+		break;
+		case '2':
+			showallnames();
+			break;
+		case '3':
+			names[current][2] = typein(names[current][2]);
+			break;
+		case '4':
+			showallassoc();
+			break;
+		case '5':
+			lino();
+			break;
+		case '6':
+			editmagics();
+			break;
+		case '7':
+			editportals();
+			break;
+		case '8':
+			editflags();
+			break;
+		case '9':
+			listen = typein(listen);
+			break;
+		case 'S':
+			save();
+			break;
+		case 'L':
+			load();
+			break;
+		case '\0':
+			if (readkey() == '\55')  return;
+			break;
+		}
+	} while (!false);
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- output << "*** ALSO ***" << NL;
- output << NL;
- output << "No. of screen to edit?"; input >> n >> NL; load();
- assign(f,"v:avalot.fnt"); reset(f); f >> skinny; close(f);
- gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi"); current=0;
- loadscreen();
- alsomenu();
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	output << "*** ALSO ***" << NL;
+	output << NL;
+	output << "No. of screen to edit?";
+	input >> n >> NL;
+	load();
+	assign(f, "v:avalot.fnt");
+	reset(f);
+	f >> skinny;
+	close(f);
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "c:\\bp\\bgi");
+	current = 0;
+	loadscreen();
+	alsomenu();
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index df65411..b57585d 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -33,119 +33,128 @@ namespace Avalanche {
 const integer taboo = cyan;
 
 struct adxtype {
-           varying_string<12> name; /* name of character */
-           byte num; /* number of pictures */
-           byte xl,yl; /* x & y lengths of pictures */
-           byte seq; /* how many in one stride */
-           word size; /* the size of all the pictures */
+	varying_string<12> name; /* name of character */
+	byte num; /* number of pictures */
+	byte xl, yl; /* x & y lengths of pictures */
+	byte seq; /* how many in one stride */
+	word size; /* the size of all the pictures */
 };
 
 
-integer gd,gm;
+integer gd, gm;
 adxtype adx;
-matrix<1,24,0,1,pointer> adxpic;     /* the pictures themselves */
-untyped_file f; string x; byte n;
-
-void load(string nam)
-{
-    byte z;
- array<1,4,pointer> a;
- untyped_file f; word s;
- varying_string<40> xxx;
- string check;
-
-;
- assign(f,nam);
- reset(f,1);
- blockread(f,xxx,41);
- blockread(f,check,13);
- blockread(f,check,31);
- s=imagesize(0,0,getmaxx(),75);
- for( z=1; z <= 2; z ++)
- {;
-  getmem(a[z],s);
-  blockread(f,a[z],s);
-  putimage(0,15+(z-1)*75,a[z],0);
-  freemem(a[z],s);
- }
- close(f);
+matrix<1, 24, 0, 1, pointer> adxpic; /* the pictures themselves */
+untyped_file f;
+string x;
+byte n;
+
+void load(string nam) {
+	byte z;
+	array<1, 4, pointer> a;
+	untyped_file f;
+	word s;
+	varying_string<40> xxx;
+	string check;
+
+	;
+	assign(f, nam);
+	reset(f, 1);
+	blockread(f, xxx, 41);
+	blockread(f, check, 13);
+	blockread(f, check, 31);
+	s = imagesize(0, 0, getmaxx(), 75);
+	for (z = 1; z <= 2; z ++) {
+		;
+		getmem(a[z], s);
+		blockread(f, a[z], s);
+		putimage(0, 15 + (z - 1) * 75, a[z], 0);
+		freemem(a[z], s);
+	}
+	close(f);
 }
 
-void silhouette()
-{
-    byte x,y,c;
-;
- setvisualpage(1); setactivepage(1); setfillstyle(1,15);
- for( gm=0; gm <= 3; gm ++)
-  for( gd=1; gd <= 6; gd ++)
-  {;     /* 26,15 */
-/*   bar((gm div 2)*320+gd*40,20+(gm mod 2)*40,(gm div 2)*320+gd*40+35,(gm mod 2)*40+60); */
-   for( y=1; y <= adx.yl; y ++)
-    for( x=1; x <= adx.xl; x ++)
-    {;
-     setactivepage(0);
-     c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
-     setactivepage(1);
-/*     if c<>taboo then putpixel((gm div 2)*320+gd*40+x,20+(gm mod 2)*40+y,0); */
-     if (c==taboo)  putpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y,15);
-    }
-   getmem(adxpic[gm*6+gd][0],adx.size);
-   getimage((gm / 2)*320+gd*40+1,20+(gm % 2)*40+1,
-     (gm / 2)*320+gd*40+adx.xl,20+(gm % 2)*40+adx.yl,
-      adxpic[gm*6+gd][0]);
-  }
+void silhouette() {
+	byte x, y, c;
+	;
+	setvisualpage(1);
+	setactivepage(1);
+	setfillstyle(1, 15);
+	for (gm = 0; gm <= 3; gm ++)
+		for (gd = 1; gd <= 6; gd ++) {
+			;     /* 26,15 */
+			/*   bar((gm div 2)*320+gd*40,20+(gm mod 2)*40,(gm div 2)*320+gd*40+35,(gm mod 2)*40+60); */
+			for (y = 1; y <= adx.yl; y ++)
+				for (x = 1; x <= adx.xl; x ++) {
+					;
+					setactivepage(0);
+					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
+					setactivepage(1);
+					/*     if c<>taboo then putpixel((gm div 2)*320+gd*40+x,20+(gm mod 2)*40+y,0); */
+					if (c == taboo)  putpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y, 15);
+				}
+			getmem(adxpic[gm * 6 + gd][0], adx.size);
+			getimage((gm / 2) * 320 + gd * 40 + 1, 20 + (gm % 2) * 40 + 1,
+			         (gm / 2) * 320 + gd * 40 + adx.xl, 20 + (gm % 2) * 40 + adx.yl,
+			         adxpic[gm * 6 + gd][0]);
+		}
 }
 
-void standard()
-{
-    byte x,y,c;
-;
- setvisualpage(2); setactivepage(2);
- for( gm=0; gm <= 3; gm ++)
-  for( gd=1; gd <= 6; gd ++)
-  {;     /* 26,15 */
-   for( y=1; y <= adx.yl; y ++)
-    for( x=1; x <= adx.xl; x ++)
-    {;
-     setactivepage(0);
-     c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
-     setactivepage(2);
-     if (c!=taboo)  putpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y,c);
-    }
-   getmem(adxpic[gm*6+gd][1],adx.size);
-   getimage((gm / 2)*320+gd*40+1,20+(gm % 2)*40+1,
-     (gm / 2)*320+gd*40+adx.xl,20+(gm % 2)*40+adx.yl,
-      adxpic[gm*6+gd][1]);
-  }
+void standard() {
+	byte x, y, c;
+	;
+	setvisualpage(2);
+	setactivepage(2);
+	for (gm = 0; gm <= 3; gm ++)
+		for (gd = 1; gd <= 6; gd ++) {
+			;     /* 26,15 */
+			for (y = 1; y <= adx.yl; y ++)
+				for (x = 1; x <= adx.xl; x ++) {
+					;
+					setactivepage(0);
+					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
+					setactivepage(2);
+					if (c != taboo)  putpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y, c);
+				}
+			getmem(adxpic[gm * 6 + gd][1], adx.size);
+			getimage((gm / 2) * 320 + gd * 40 + 1, 20 + (gm % 2) * 40 + 1,
+			         (gm / 2) * 320 + gd * 40 + adx.xl, 20 + (gm % 2) * 40 + adx.yl,
+			         adxpic[gm * 6 + gd][1]);
+		}
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0; initgraph(gd,gm,""); fillchar(adxpic,sizeof(adxpic),'\261');
- load("v:avalots.avd");
-/* getmem(adxpic[1,1,1],adx.size); getimage(40,20,75,60,adxpic[1,1,1]^);
- putimage(100,100,adxpic[1,1,1]^,0); */
- {;
-  adx.name="Avalot";
-  adx.num=24; adx.seq=6;
-  adx.xl=32; adx.yl=35; /* 35,40 */
-
-  adx.size=imagesize(40,20,40+adx.xl,60+adx.yl);
- }
- silhouette();
- standard();
- x=string("Sprite file for Avvy - Trippancy IV. Subject to copyright.")+'\32';
- assign(f,"v:sprite1.avd");
- rewrite(f,1);
- blockwrite(f,x[1],59);
- blockwrite(f,adx,sizeof(adx));
- for( gd=1; gd <= adx.num; gd ++)
-  for( gm=0; gm <= 1; gm ++)
-   blockwrite(f,adxpic[gd][gm],adx.size); /* next image */
- close(f);
- closegraph();
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "");
+	fillchar(adxpic, sizeof(adxpic), '\261');
+	load("v:avalots.avd");
+	/* getmem(adxpic[1,1,1],adx.size); getimage(40,20,75,60,adxpic[1,1,1]^);
+	 putimage(100,100,adxpic[1,1,1]^,0); */
+	{
+		;
+		adx.name = "Avalot";
+		adx.num = 24;
+		adx.seq = 6;
+		adx.xl = 32;
+		adx.yl = 35; /* 35,40 */
+
+		adx.size = imagesize(40, 20, 40 + adx.xl, 60 + adx.yl);
+	}
+	silhouette();
+	standard();
+	x = string("Sprite file for Avvy - Trippancy IV. Subject to copyright.") + '\32';
+	assign(f, "v:sprite1.avd");
+	rewrite(f, 1);
+	blockwrite(f, x[1], 59);
+	blockwrite(f, adx, sizeof(adx));
+	for (gd = 1; gd <= adx.num; gd ++)
+		for (gm = 0; gm <= 1; gm ++)
+			blockwrite(f, adxpic[gd][gm], adx.size); /* next image */
+	close(f);
+	closegraph();
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index 136f719..605a185 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -33,130 +33,144 @@ namespace Avalanche {
 const integer taboo = cyan;
 
 struct adxtype {
-           varying_string<12> name; /* name of character */
-           byte num; /* number of pictures */
-           byte xl,yl; /* x & y lengths of pictures */
-           byte seq; /* how many in one stride */
-           word size; /* the size of all the pictures */
-           byte fgc,bgc; /* foreground & background bubble colours */
+	varying_string<12> name; /* name of character */
+	byte num; /* number of pictures */
+	byte xl, yl; /* x & y lengths of pictures */
+	byte seq; /* how many in one stride */
+	word size; /* the size of all the pictures */
+	byte fgc, bgc; /* foreground & background bubble colours */
 };
 
 
-integer gd,gm;
+integer gd, gm;
 adxtype adx;
-array<0,1,pointer> adxpic;     /* the pictures themselves */
-untyped_file f; string x; byte n; integer side2; word bigsize;
-
-void load(string n)
-{
-    byte z;
- array<1,4,pointer> a;
- untyped_file f; word s;
- varying_string<40> xxx;
- string check;
-
-;
- assign(f,n);
- reset(f,1);
- blockread(f,xxx,41);
- blockread(f,check,13);
- blockread(f,check,31);
- s=imagesize(0,0,getmaxx(),75);
- for( z=1; z <= 2; z ++)
- {;
-  getmem(a[z],s);
-  blockread(f,a[z],s);
-  putimage(0,15+(z-1)*75,a[z],0);
-  freemem(a[z],s);
- }
- close(f);
+array<0, 1, pointer> adxpic;   /* the pictures themselves */
+untyped_file f;
+string x;
+byte n;
+integer side2;
+word bigsize;
+
+void load(string n) {
+	byte z;
+	array<1, 4, pointer> a;
+	untyped_file f;
+	word s;
+	varying_string<40> xxx;
+	string check;
+
+	;
+	assign(f, n);
+	reset(f, 1);
+	blockread(f, xxx, 41);
+	blockread(f, check, 13);
+	blockread(f, check, 31);
+	s = imagesize(0, 0, getmaxx(), 75);
+	for (z = 1; z <= 2; z ++) {
+		;
+		getmem(a[z], s);
+		blockread(f, a[z], s);
+		putimage(0, 15 + (z - 1) * 75, a[z], 0);
+		freemem(a[z], s);
+	}
+	close(f);
 }
 
-void silhouette()
-{
-    byte x,y,c;
-;
- setvisualpage(1); setactivepage(1); setfillstyle(1,15);
- {;
-  for( gm=0; gm <= 3; gm ++)
-   for( gd=1; gd <= 6; gd ++)
-   {;     /* 26,15 */
-    side2=adx.xl*6;
-    for( y=1; y <= adx.yl; y ++)
-     for( x=1; x <= adx.xl; x ++)
-     {;
-      setactivepage(0);
-      c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
-      setactivepage(1);
-      if (c==taboo) 
-       putpixel((gm / 2)*side2+gd*adx.xl+x,20+(gm % 2)*adx.yl+y,15);
-     }
-   }
-  bigsize=imagesize(adx.xl+1,21,adx.xl*13,20+adx.yl*2);
-  getmem(adxpic[0],bigsize);
-  getimage(adx.xl+1,21,adx.xl*13,20+adx.yl*2,adxpic[0]);
-  putimage(adx.xl+1,21,adxpic[0],notput);
- }
+void silhouette() {
+	byte x, y, c;
+	;
+	setvisualpage(1);
+	setactivepage(1);
+	setfillstyle(1, 15);
+	{
+		;
+		for (gm = 0; gm <= 3; gm ++)
+			for (gd = 1; gd <= 6; gd ++) {
+				;     /* 26,15 */
+				side2 = adx.xl * 6;
+				for (y = 1; y <= adx.yl; y ++)
+					for (x = 1; x <= adx.xl; x ++) {
+						;
+						setactivepage(0);
+						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
+						setactivepage(1);
+						if (c == taboo)
+							putpixel((gm / 2)*side2 + gd * adx.xl + x, 20 + (gm % 2)*adx.yl + y, 15);
+					}
+			}
+		bigsize = imagesize(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2);
+		getmem(adxpic[0], bigsize);
+		getimage(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2, adxpic[0]);
+		putimage(adx.xl + 1, 21, adxpic[0], notput);
+	}
 }
 
-void standard()
-{
-    byte x,y,c;
-;
- setvisualpage(2); setactivepage(2);
- {;
-  for( gm=0; gm <= 3; gm ++)
-   for( gd=1; gd <= 6; gd ++)
-   {;     /* 26,15 */
-    for( y=1; y <= adx.yl; y ++)
-     for( x=1; x <= adx.xl; x ++)
-     {;
-      setactivepage(0);
-      c=getpixel((gm / 2)*320+gd*40+x,20+(gm % 2)*40+y);
-      setactivepage(2);
-      if (c!=taboo) 
-       putpixel((gm / 2)*side2+gd*adx.xl+x,20+(gm % 2)*adx.yl+y,c);
-     }
-/*    getmem(adxpic[gm*6+gd,1],adx.size);
-    getimage((gm div 2)*side2+gd*xl+x,20+(gm mod 2)*yl+y,
-       (gm div 2)*side2+gd*xl*2+x,20+(gm mod 2)*yl*2+y,
-       adxpic[gm*6+gd,1]^); */
-  }
-  getmem(adxpic[1],bigsize);
-  getimage(adx.xl+1,21,adx.xl*13,20+adx.yl*2,adxpic[1]);
-  putimage(adx.xl+1,21,adxpic[1],notput);
- }
+void standard() {
+	byte x, y, c;
+	;
+	setvisualpage(2);
+	setactivepage(2);
+	{
+		;
+		for (gm = 0; gm <= 3; gm ++)
+			for (gd = 1; gd <= 6; gd ++) {
+				;     /* 26,15 */
+				for (y = 1; y <= adx.yl; y ++)
+					for (x = 1; x <= adx.xl; x ++) {
+						;
+						setactivepage(0);
+						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
+						setactivepage(2);
+						if (c != taboo)
+							putpixel((gm / 2)*side2 + gd * adx.xl + x, 20 + (gm % 2)*adx.yl + y, c);
+					}
+				/*    getmem(adxpic[gm*6+gd,1],adx.size);
+				    getimage((gm div 2)*side2+gd*xl+x,20+(gm mod 2)*yl+y,
+				       (gm div 2)*side2+gd*xl*2+x,20+(gm mod 2)*yl*2+y,
+				       adxpic[gm*6+gd,1]^); */
+			}
+		getmem(adxpic[1], bigsize);
+		getimage(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2, adxpic[1]);
+		putimage(adx.xl + 1, 21, adxpic[1], notput);
+	}
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0; initgraph(gd,gm,""); fillchar(adxpic,sizeof(adxpic),'\261');
- load("v:avalots.avd");
- {;
-  adx.name="Avalot";
-  adx.num=24; adx.seq=6;
-  adx.xl=33; adx.yl=35; /* 35,40 */
-  adx.fgc=yellow; adx.bgc=red;
-
-  adx.size=imagesize(40,20,40+adx.xl,60+adx.yl);
- }
- silhouette();
- standard();
- x=string("Sprite file for Avvy - Trippancy IV. Subject to copyright.")+'\32';
- assign(f,"v:sprite1.avd");
- rewrite(f,1);
- blockwrite(f,x[1],59);
- blockwrite(f,adx,sizeof(adx));
- blockwrite(f,bigsize,2);
- for( gm=0; gm <= 1; gm ++)
- {;
-  putimage(0,0,adxpic[gm],0);
-  blockwrite(f,adxpic[gm],bigsize);  /* next image */
- }
- close(f);
- closegraph();
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "");
+	fillchar(adxpic, sizeof(adxpic), '\261');
+	load("v:avalots.avd");
+	{
+		;
+		adx.name = "Avalot";
+		adx.num = 24;
+		adx.seq = 6;
+		adx.xl = 33;
+		adx.yl = 35; /* 35,40 */
+		adx.fgc = yellow;
+		adx.bgc = red;
+
+		adx.size = imagesize(40, 20, 40 + adx.xl, 60 + adx.yl);
+	}
+	silhouette();
+	standard();
+	x = string("Sprite file for Avvy - Trippancy IV. Subject to copyright.") + '\32';
+	assign(f, "v:sprite1.avd");
+	rewrite(f, 1);
+	blockwrite(f, x[1], 59);
+	blockwrite(f, adx, sizeof(adx));
+	blockwrite(f, bigsize, 2);
+	for (gm = 0; gm <= 1; gm ++) {
+		;
+		putimage(0, 0, adxpic[gm], 0);
+		blockwrite(f, adxpic[gm], bigsize); /* next image */
+	}
+	close(f);
+	closegraph();
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index 2cfe410..b5e1d9a 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -29,63 +29,78 @@
 
 namespace Avalanche {
 
-typedef matrix<1,24,0,1,pointer> adxtype;
+typedef matrix<1, 24, 0, 1, pointer> adxtype;
 
-integer gd,gm;
-word s; untyped_file f; byte n,anim,cp,t;
-array<0,0,adxtype> adx;
-array<0,1,pointer> back;
+integer gd, gm;
+word s;
+untyped_file f;
+byte n, anim, cp, t;
+array<0, 0, adxtype> adx;
+array<0, 1, pointer> back;
 integer x;
-array<0,1,integer> ox;
+array<0, 1, integer> ox;
 
-void andex(integer x,integer y, byte n,byte num)
-{;
- putimage(x,y,adx[num][n][0],andput);
- putimage(x,y,adx[num][n][1],xorput);
+void andex(integer x, integer y, byte n, byte num) {
+	;
+	putimage(x, y, adx[num][n][0], andput);
+	putimage(x, y, adx[num][n][1], xorput);
 }
 
-void loadadx(byte num, string x)
-{
-    byte n;
-;
- assign(f,x);
- reset(f,1); seek(f,59);
- blockread(f,n,1); /* No. of images... */
- for( gd=1; gd <= n; gd ++)
-  for( gm=0; gm <= 1; gm ++)
-  {;
-   blockread(f,s,2); /* size of next image... */
-   getmem(adx[num][gd][gm],s);
-   blockread(f,adx[num][gd][gm],s); /* next image */
-  }
- close(f);
+void loadadx(byte num, string x) {
+	byte n;
+	;
+	assign(f, x);
+	reset(f, 1);
+	seek(f, 59);
+	blockread(f, n, 1); /* No. of images... */
+	for (gd = 1; gd <= n; gd ++)
+		for (gm = 0; gm <= 1; gm ++) {
+			;
+			blockread(f, s, 2); /* size of next image... */
+			getmem(adx[num][gd][gm], s);
+			blockread(f, adx[num][gd][gm], s); /* next image */
+		}
+	close(f);
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- loadadx(0,"d:sprite0.avd");
- loadadx(1,"d:sprite0.avd");
- gd=3; gm=0; initgraph(gd,gm,"");
- for( gd=0; gd <= 1; gd ++)
- {;
-  setactivepage(gd); setfillstyle(6,1); bar(0,0,640,200);
-  getmem(back[gd],s);
- }
- x=0; anim=1; cp=0; t=2; setactivepage(0);
- do {
-  setactivepage(cp); setvisualpage(1-cp);
-  for( gm=0; gm <= 1; gm ++)
-  {;
-   if (t>0)  t -= 1; else
-    putimage(ox[cp],77,back[cp],copyput);
-   getimage(x,77,x+31,77+35,back[cp]);
-   andex(x,177,anim+6,gm);
-   ox[gm][cp]=x; x += 5;
-  }
-  anim += 1; if (anim==7)  anim=1;cp=1-cp;
- } while (!false);
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	loadadx(0, "d:sprite0.avd");
+	loadadx(1, "d:sprite0.avd");
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "");
+	for (gd = 0; gd <= 1; gd ++) {
+		;
+		setactivepage(gd);
+		setfillstyle(6, 1);
+		bar(0, 0, 640, 200);
+		getmem(back[gd], s);
+	}
+	x = 0;
+	anim = 1;
+	cp = 0;
+	t = 2;
+	setactivepage(0);
+	do {
+		setactivepage(cp);
+		setvisualpage(1 - cp);
+		for (gm = 0; gm <= 1; gm ++) {
+			;
+			if (t > 0)  t -= 1;
+			else
+				putimage(ox[cp], 77, back[cp], copyput);
+			getimage(x, 77, x + 31, 77 + 35, back[cp]);
+			andex(x, 177, anim + 6, gm);
+			ox[gm][cp] = x;
+			x += 5;
+		}
+		anim += 1;
+		if (anim == 7)  anim = 1;
+		cp = 1 - cp;
+	} while (!false);
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index 815018d..2172a57 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -33,7 +33,7 @@
                  ENID             Edna's manager. */
 
 #define __arch_implementation__
-           /* Loads/ saves files. */
+/* Loads/ saves files. */
 
 #include "arch.h"
 
@@ -44,105 +44,105 @@
 namespace Avalanche {
 
 struct ednahead { /* Edna header */
-          /* This header starts at byte offset 177 in the .ASG file. */
-          array<1,9,char> id;     /* signature */
-          word revision; /* EDNA revision, here 2 (1=dna256) */
-          varying_string<50> game; /* Long name, eg Lord Avalot D'Argent */
-          varying_string<15> shortname; /* Short name, eg Avalot */
-          word number; /* Game's code number, here 2 */
-          word ver; /* Version number as integer (eg 1.00 = 100) */
-          varying_string<5> verstr; /* Vernum as string (eg 1.00 = "1.00" */
-          varying_string<12> filename; /* Filename, eg AVALOT.EXE */
-          byte os; /* Saving OS (here 1=DOS. See below for others.) */
-
-          /* Info on this particular game */
-
-          varying_string<8> fn; /* Filename (not extension ('cos that's .ASG)) */
-          byte d,m; /* D, M, Y are the Day, Month & Year this game was... */
-          word y;  /* ...saved on. */
-          varying_string<40> desc; /* Description of game (same as in Avaricius!) */
-          word len; /* Length of DNA (it's not going to be above 65535!) */
-
-          /* Quick reference & miscellaneous */
-
-          word saves; /* no. of times this game has been saved */
-          integer cash; /* contents of your wallet in numerical form */
-          varying_string<20> money; /* ditto in string form (eg 5/-, or 1 denarius)*/
-          word points; /* your score */
-
-          /* DNA values follow, then footer (which is ignored) */
+	/* This header starts at byte offset 177 in the .ASG file. */
+	array<1, 9, char> id;   /* signature */
+	word revision; /* EDNA revision, here 2 (1=dna256) */
+	varying_string<50> game; /* Long name, eg Lord Avalot D'Argent */
+	varying_string<15> shortname; /* Short name, eg Avalot */
+	word number; /* Game's code number, here 2 */
+	word ver; /* Version number as integer (eg 1.00 = 100) */
+	varying_string<5> verstr; /* Vernum as string (eg 1.00 = "1.00" */
+	varying_string<12> filename; /* Filename, eg AVALOT.EXE */
+	byte os; /* Saving OS (here 1=DOS. See below for others.) */
+
+	/* Info on this particular game */
+
+	varying_string<8> fn; /* Filename (not extension ('cos that's .ASG)) */
+	byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
+	word y;  /* ...saved on. */
+	varying_string<40> desc; /* Description of game (same as in Avaricius!) */
+	word len; /* Length of DNA (it's not going to be above 65535!) */
+
+	/* Quick reference & miscellaneous */
+
+	word saves; /* no. of times this game has been saved */
+	integer cash; /* contents of your wallet in numerical form */
+	varying_string<20> money; /* ditto in string form (eg 5/-, or 1 denarius)*/
+	word points; /* your score */
+
+	/* DNA values follow, then footer (which is ignored) */
 };
-  /* Possible values of edhead.os:
-     1 = DOS        4 = Mac
-     2 = Windows    5 = Amiga
-     3 = OS/2       6 = ST */
-const string crlf = string('\15')+'\12';
-
-const array<1,177,char> ednafirst = 
- string("This is an EDNA-based file, saved by a Thorsoft game. Good luck!")+crlf+
- '\32'+ /* 67 bytes... */
- crlf+crlf+ /* 71 bytes... */
- "12345678901234567890123456789012345678901234567890"+
- "12345678901234567890123456789012345678901234567890"+
- "123456";
+/* Possible values of edhead.os:
+   1 = DOS        4 = Mac
+   2 = Windows    5 = Amiga
+   3 = OS/2       6 = ST */
+const string crlf = string('\15') + '\12';
+
+const array<1, 177, char> ednafirst =
+    string("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + crlf +
+    '\32' + /* 67 bytes... */
+    crlf + crlf + /* 71 bytes... */
+    "12345678901234567890123456789012345678901234567890" +
+    "12345678901234567890123456789012345678901234567890" +
+    "123456";
 
 const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
-const string ednaid = string("TT")+'\261'+'\60'+'\1'+'\165'+'\261'+'\231'+'\261';
+const string ednaid = string("TT") + '\261' + '\60' + '\1' + '\165' + '\261' + '\231' + '\261';
 
 const integer ttage = 18;
 const char ttwashere[] = "Thomas was here ";
 
-void save(string name)
-{
- untyped_file f;
- edhead eh;
- word groi;
- string groi2;
-;
- fillchar(eh,sizeof(eh),'\261'); /* Fill up the edhead */
+void save(string name) {
+	untyped_file f;
+	edhead eh;
+	word groi;
+	string groi2;
+	;
+	fillchar(eh, sizeof(eh), '\261'); /* Fill up the edhead */
 
- dna.saves += 1; /* It's been saved one more time... */
+	dna.saves += 1; /* It's been saved one more time... */
 
- {;
+	{
+		;
 
-  /* Info about this program */
+		/* Info about this program */
 
-  id=ednaid;   /* Edna's signature */
-  revision=2;  /* Second revision of .ASG format */
-  game="Lord Avalot d'Argent";   /* Title of game */
-  shortname="Avalot";
-  number=2;  /* Second Avvy game */
-  ver=100;  /* Version 1.00 */
-  verstr="1.00";  /* ditto */
-  filename="AVALOT.EXE";  /* program's filename */
-  os=1;  /* Saved under DOS */
+		id = ednaid; /* Edna's signature */
+		revision = 2; /* Second revision of .ASG format */
+		game = "Lord Avalot d'Argent"; /* Title of game */
+		shortname = "Avalot";
+		number = 2; /* Second Avvy game */
+		ver = 100; /* Version 1.00 */
+		verstr = "1.00"; /* ditto */
+		filename = "AVALOT.EXE"; /* program's filename */
+		os = 1; /* Saved under DOS */
 
-  /* Info on this particular game */
+		/* Info on this particular game */
 
-  fsplit(name,groi2,fn,groi2); /* fn = filename of this game */
-  getdate(d,m,y,groi); /* Day, month & year when the game was saved */
-  desc=roomname;  /* Description of game (same as in Avaricius!) */
-  len=sizeof(dna);  /* Length of DNA (it's not going to be above 65535!) */
+		fsplit(name, groi2, fn, groi2); /* fn = filename of this game */
+		getdate(d, m, y, groi); /* Day, month & year when the game was saved */
+		desc = roomname; /* Description of game (same as in Avaricius!) */
+		len = sizeof(dna); /* Length of DNA (it's not going to be above 65535!) */
 
-  /* Quick reference & miscellaneous */
+		/* Quick reference & miscellaneous */
 
-  saves=dna.saves;  /* no. of times this game has been saved */
-  cash=dna.pence;  /* contents of your wallet in numerical form */
-  money=lsd(); /* ditto in string form (eg 5/-, or 1 denarius)*/
-  points=dna.score;  /* your score */
- }
+		saves = dna.saves; /* no. of times this game has been saved */
+		cash = dna.pence; /* contents of your wallet in numerical form */
+		money = lsd(); /* ditto in string form (eg 5/-, or 1 denarius)*/
+		points = dna.score; /* your score */
+	}
 
- assign(f,name);
- rewrite(f,1);
+	assign(f, name);
+	rewrite(f, 1);
 
- blockwrite(f,ednafirst,177);
- blockwrite(f,eh,sizeof(eh));
- blockwrite(f,dna,sizeof(dna));
+	blockwrite(f, ednafirst, 177);
+	blockwrite(f, eh, sizeof(eh));
+	blockwrite(f, dna, sizeof(dna));
 
- for( groi=1; groi <= ttage; groi ++)
-  blockwrite(f,ttwashere,sizeof(ttwashere));
+	for (groi = 1; groi <= ttage; groi ++)
+		blockwrite(f, ttwashere, sizeof(ttwashere));
 
- close(f);
+	close(f);
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
index 840ceb4..3bff07a 100644
--- a/engines/avalanche/arch.h
+++ b/engines/avalanche/arch.h
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
index f793fa5..7351d08 100644
--- a/engines/avalanche/avalot9.cpp
+++ b/engines/avalanche/avalot9.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -53,89 +53,120 @@
 
 namespace Avalanche {
 
-void setup()
-{
- integer gd,gm;
-
- checkbreak=false; visible=m_no; to_do=0; lmo=false; resetscroll;
- Randomize(); setup_vmc; on_virtual;
- gd=3; gm=0; initgraph(gd,gm,"");
- holdthedawn=true; dusk;
- cmp=177; mouse_init;  /*on;*/ dropsok=true; ctrl=ckey; oldjw=177;
- mousetext=""; c=999; settextjustify(0,0); ddmnow=false; load_digits;
- cheat=false; cp=0; curpos=1; 
- quote=true; ledstatus=177; defaultled=2;
-/* TSkellern:=0; { Replace with a more local variable sometime }*/
- dna.rw=stopped; enid_filename="";   /* undefined. */
- toolbar; state(2); copy03; lastscore="TJA";
-
-/* for gd:=0 to 1 do
- begin
-  setactivepage(gd); outtextxy(7,177,chr(48+gd));
- end;*/
-
- loadtrip;
-
- if ((filetoload=="") & (~ reloaded)) 
-  newgame; /* no game was requested- load the default */
- else {
-  if (~ reloaded)  avvy_background;
-  standard_bar; sprite_run;
-  if (reloaded)  edna_reload; else
-  {     /* Filename given on the command line (or loadfirst) */
-   edna_load(filetoload);
-   if (there_was_a_problem) 
-   {
-    display("So let's start from the beginning instead...");
-    holdthedawn=true; dusk; newgame;
-   }
-  }
- }
-
- if (~ reloaded) 
- {
-  soundfx=~ soundfx; fxtoggle;
-  thinkabout(money,a_thing);
- }
-
- get_back_loretta; gm=getpixel(0,0); setcolor(7);
- holdthedawn=false; dawn; cursoron=false; cursor_on; newspeed;
-
- if (~ reloaded) 
-   dixi('q',83); /* Info on the game, etc. */
+void setup() {
+	integer gd, gm;
+
+	checkbreak = false;
+	visible = m_no;
+	to_do = 0;
+	lmo = false;
+	resetscroll;
+	Randomize();
+	setup_vmc;
+	on_virtual;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "");
+	holdthedawn = true;
+	dusk;
+	cmp = 177;
+	mouse_init;  /*on;*/ dropsok = true;
+	ctrl = ckey;
+	oldjw = 177;
+	mousetext = "";
+	c = 999;
+	settextjustify(0, 0);
+	ddmnow = false;
+	load_digits;
+	cheat = false;
+	cp = 0;
+	curpos = 1;
+	quote = true;
+	ledstatus = 177;
+	defaultled = 2;
+	/* TSkellern:=0; { Replace with a more local variable sometime }*/
+	dna.rw = stopped;
+	enid_filename = ""; /* undefined. */
+	toolbar;
+	state(2);
+	copy03;
+	lastscore = "TJA";
+
+	/* for gd:=0 to 1 do
+	 begin
+	  setactivepage(gd); outtextxy(7,177,chr(48+gd));
+	 end;*/
+
+	loadtrip;
+
+	if ((filetoload == "") & (~ reloaded))
+		newgame; /* no game was requested- load the default */
+	else {
+		if (~ reloaded)  avvy_background;
+		standard_bar;
+		sprite_run;
+		if (reloaded)  edna_reload;
+		else {
+			/* Filename given on the command line (or loadfirst) */
+			edna_load(filetoload);
+			if (there_was_a_problem) {
+				display("So let's start from the beginning instead...");
+				holdthedawn = true;
+				dusk;
+				newgame;
+			}
+		}
+	}
+
+	if (~ reloaded) {
+		soundfx = ~ soundfx;
+		fxtoggle;
+		thinkabout(money, a_thing);
+	}
+
+	get_back_loretta;
+	gm = getpixel(0, 0);
+	setcolor(7);
+	holdthedawn = false;
+	dawn;
+	cursoron = false;
+	cursor_on;
+	newspeed;
+
+	if (~ reloaded)
+		dixi('q', 83); /* Info on the game, etc. */
 }
 
-int main(int argc, const char* argv[])
-{
- pio_initialize(argc, argv);
- setup();
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	setup();
 
- do {
+	do {
 
-  clock;
-  keyboard_link;
-  menu_link;
-  readstick;
-  force_numlock;
-  get_back_loretta;
-  trippancy_link;
-  pics_link;
-  checkclick;
+		clock;
+		keyboard_link;
+		menu_link;
+		readstick;
+		force_numlock;
+		get_back_loretta;
+		trippancy_link;
+		pics_link;
+		checkclick;
 
-  if (visible==m_virtual)  plot_vmc(mx,my,cp);
-  flip_page; /* <<<! */
-  slowdown;
-  if (visible==m_virtual)  wipe_vmc(cp);
+		if (visible == m_virtual)  plot_vmc(mx, my, cp);
+		flip_page; /* <<<! */
+		slowdown;
+		if (visible == m_virtual)  wipe_vmc(cp);
 
-  one_tick;
+		one_tick;
 
- } while (!lmo);
+	} while (!lmo);
 
- restorecrtmode();
- if (logging)  close(logfile);
+	restorecrtmode();
+	if (logging)  close(logfile);
 
- end_of_program;
- return EXIT_SUCCESS;
+	end_of_program;
+	return EXIT_SUCCESS;
 }
 
 /*  typein; commanded; last:=current; */
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 0ca6b72..7ab2630 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -30,88 +30,90 @@
 
 namespace Avalanche {
 
-integer gd,gm;
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
- /* Screen size: Starts at $A000:$320 (coords 0,10).
- Length: 12000 (150*80) bytes.
- If we divide it into sets of 5 lines (400 bytes) each, there are 30.
- There are 40 words on a line.
-
- Patterns:
-  4AAA = "AVVY"
-  AAAE
-  EAA4
-  A444
-
-  A4AA = "YAVV"
-  AEAA
-  4EAA
-  4A44 */
-/*
- asm
-  mov bx,$A000;
-  mov es,bx; { The segment to copy it to... }
-  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
-
-  mov cx,10;
-  mov ax,$AA4A; call @sameline; { Print "AVVY" }
-  mov ax,$AEAA; call @sameline;
-  mov ax,$A4EA; call @sameline;
-  mov ax,$44A4; call @sameline;
-
-  mov cx,9;
-  mov ax,$AAA4; call @sameline; { Print "YAVV" }
-  mov ax,$AAEA; call @sameline;
-  mov ax,$AA4E; call @sameline;
-  mov ax,$444A; call @sameline;
-
-  mov ax,$4AAA; call @sameline; { Print "VYAV" }
-  mov ax,$AAAE; call @sameline;
-  mov ax,$EAA4; call @sameline;
-  mov ax,$A444; call @sameline;
-
-  mov ax,$A4AA; call @sameline; { Print "VVYA" }
-  mov ax,$EAAA; call @sameline;
-  mov ax,$4EAA; call @sameline;
-  mov ax,$4A44; call @sameline;
-
-  jmp @the_end;
-
-  { Replicate the same line many times. }
-
-  @sameline:
-   { Requires:
-      what to copy in AX,
-      how many lines in CX, and
-      original offset in DI. }
-   push cx;
-   push di;
-
-   @samelineloop:
-
-    push cx;
-    mov cx,40; { No. of times to repeat it on one line. }
-
-    repz stosw; { Fast word-copying }
-
-    pop cx;
-
-    add di,1200; { The next one will be 16 lines down. }
-
-   loop @samelineloop;
-   pop di;
-   add di,80;
-   pop cx;
-
-   ret;
-
-  @the_end:
- end;
-*/
-return EXIT_SUCCESS;
+integer gd, gm;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "c:\\bp\\bgi");
+	/* Screen size: Starts at $A000:$320 (coords 0,10).
+	Length: 12000 (150*80) bytes.
+	If we divide it into sets of 5 lines (400 bytes) each, there are 30.
+	There are 40 words on a line.
+
+	Patterns:
+	 4AAA = "AVVY"
+	 AAAE
+	 EAA4
+	 A444
+
+	 A4AA = "YAVV"
+	 AEAA
+	 4EAA
+	 4A44 */
+	/*
+	 asm
+	  mov bx,$A000;
+	  mov es,bx; { The segment to copy it to... }
+	  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
+
+	  mov cx,10;
+	  mov ax,$AA4A; call @sameline; { Print "AVVY" }
+	  mov ax,$AEAA; call @sameline;
+	  mov ax,$A4EA; call @sameline;
+	  mov ax,$44A4; call @sameline;
+
+	  mov cx,9;
+	  mov ax,$AAA4; call @sameline; { Print "YAVV" }
+	  mov ax,$AAEA; call @sameline;
+	  mov ax,$AA4E; call @sameline;
+	  mov ax,$444A; call @sameline;
+
+	  mov ax,$4AAA; call @sameline; { Print "VYAV" }
+	  mov ax,$AAAE; call @sameline;
+	  mov ax,$EAA4; call @sameline;
+	  mov ax,$A444; call @sameline;
+
+	  mov ax,$A4AA; call @sameline; { Print "VVYA" }
+	  mov ax,$EAAA; call @sameline;
+	  mov ax,$4EAA; call @sameline;
+	  mov ax,$4A44; call @sameline;
+
+	  jmp @the_end;
+
+	  { Replicate the same line many times. }
+
+	  @sameline:
+	   { Requires:
+	      what to copy in AX,
+	      how many lines in CX, and
+	      original offset in DI. }
+	   push cx;
+	   push di;
+
+	   @samelineloop:
+
+	    push cx;
+	    mov cx,40; { No. of times to repeat it on one line. }
+
+	    repz stosw; { Fast word-copying }
+
+	    pop cx;
+
+	    add di,1200; { The next one will be 16 lines down. }
+
+	   loop @samelineloop;
+	   pop di;
+	   add di,80;
+	   pop cx;
+
+	   ret;
+
+	  @the_end:
+	 end;
+	*/
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
index 31c2692..9e956f9 100644
--- a/engines/avalanche/avmenu.cpp
+++ b/engines/avalanche/avmenu.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -31,310 +31,318 @@
 
 namespace Avalanche {
 
-typedef matrix<'\0','\377',0,15,byte> fonttype;
+typedef matrix < '\0', '\377', 0, 15, byte > fonttype;
 
 fonttype font;
-word storage_seg,storage_ofs;
+word storage_seg, storage_ofs;
 byte result;
 string registrant;
 
-void icons()
-{
- untyped_file f;
- word gd,gm; byte bit;
- byte v;
-
- assign(f,"menu.avd");
- reset(f,1);
-
- for( bit=0; bit <= 3; bit ++)
- {
-  port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
-  for( gd=70; gd <= 266; gd ++)
-   blockread(f,mem[0xa000*gd*80+6],9);
-
-  for( gd=0; gd <= 32; gd ++)
-  {
-    blockread(f,v,1);
-   for( gm=0; gm <= 5; gm ++)
-    mem[0xa000*73+((70+gd+gm*33)*80)]=v; /* 79 */
-  }
-
- }
- close(f);
-
- bit=getpixel(0,0);
-
- setfillstyle(1, 7); for( gd=0; gd <= 5; gd ++) bar(114, 73+gd*33,583, 99+gd*33);
- setfillstyle(1,15); for( gd=0; gd <= 5; gd ++) bar(114, 70+gd*33,583, 72+gd*33);
- setfillstyle(1, 8); for( gd=0; gd <= 5; gd ++) bar(114,100+gd*33,583,102+gd*33);
+void icons() {
+	untyped_file f;
+	word gd, gm;
+	byte bit;
+	byte v;
+
+	assign(f, "menu.avd");
+	reset(f, 1);
+
+	for (bit = 0; bit <= 3; bit ++) {
+		port[0x3c4] = 2;
+		port[0x3ce] = 4;
+		port[0x3c5] = 1 << bit;
+		port[0x3cf] = bit;
+		for (gd = 70; gd <= 266; gd ++)
+			blockread(f, mem[0xa000 * gd * 80 + 6], 9);
+
+		for (gd = 0; gd <= 32; gd ++) {
+			blockread(f, v, 1);
+			for (gm = 0; gm <= 5; gm ++)
+				mem[0xa000 * 73 + ((70 + gd + gm * 33) * 80)] = v; /* 79 */
+		}
+
+	}
+	close(f);
+
+	bit = getpixel(0, 0);
+
+	setfillstyle(1, 7);
+	for (gd = 0; gd <= 5; gd ++) bar(114, 73 + gd * 33, 583, 99 + gd * 33);
+	setfillstyle(1, 15);
+	for (gd = 0; gd <= 5; gd ++) bar(114, 70 + gd * 33, 583, 72 + gd * 33);
+	setfillstyle(1, 8);
+	for (gd = 0; gd <= 5; gd ++) bar(114, 100 + gd * 33, 583, 102 + gd * 33);
 
 }
 
 void load_regi_info();
 
 
-static char decode1(char c)
-{
-    byte b;
+static char decode1(char c) {
+	byte b;
 
-  char decode1_result;
-  b=ord(c)-32;
-  decode1_result=chr(( (b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
-  return decode1_result;
+	char decode1_result;
+	b = ord(c) - 32;
+	decode1_result = chr(((b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
+	return decode1_result;
 }
 
 
 
-static char decode2(char c)
-{
-  char decode2_result;
-  decode2_result=chr( ((ord(c) & 0xf) << 2) + 0x43);
-  return decode2_result;
+static char decode2(char c) {
+	char decode2_result;
+	decode2_result = chr(((ord(c) & 0xf) << 2) + 0x43);
+	return decode2_result;
 }
 
 
 
-static boolean checker(string proper,string check)
-{
-    byte fv; boolean ok;
+static boolean checker(string proper, string check) {
+	byte fv;
+	boolean ok;
 
-  boolean checker_result;
-  ok=true;
-  for( fv=1; fv <= length(proper); fv ++)
-    if ((ord(proper[fv]) & 0xf)!=((cardinal)(ord(check[fv])-0x43) >> 2))
-           ok=false;
+	boolean checker_result;
+	ok = true;
+	for (fv = 1; fv <= length(proper); fv ++)
+		if ((ord(proper[fv]) & 0xf) != ((cardinal)(ord(check[fv]) - 0x43) >> 2))
+			ok = false;
 
-  checker_result=ok;
-  return checker_result;
+	checker_result = ok;
+	return checker_result;
 }
 
-void load_regi_info()
-{
- text t;
- byte fv;
- string x;
- byte namelen,numlen;
- string namechk,numchk;
- string reginum;
+void load_regi_info() {
+	text t;
+	byte fv;
+	string x;
+	byte namelen, numlen;
+	string namechk, numchk;
+	string reginum;
 
 
-  /*$I-*/
-  assign(t,"register.dat"); reset(t);
-  /*$I+*/
+	/*$I-*/
+	assign(t, "register.dat");
+	reset(t);
+	/*$I+*/
 
-  if (ioresult!=0) 
-  {
-    registrant="(Unregistered evaluation copy.)";
-    return;
-  }
+	if (ioresult != 0) {
+		registrant = "(Unregistered evaluation copy.)";
+		return;
+	}
 
-  for( fv=1; fv <= 53; fv ++) t >> NL;
-  t >> x >> NL;
-  close(t);
+	for (fv = 1; fv <= 53; fv ++) t >> NL;
+	t >> x >> NL;
+	close(t);
 
-  namelen=107-ord(x[1]); numlen=107-ord(x[2]);
+	namelen = 107 - ord(x[1]);
+	numlen = 107 - ord(x[2]);
 
-  registrant=copy(x,3,namelen);
-  reginum=copy(x,4+namelen,numlen);
-  namechk=copy(x,4+namelen+numlen,namelen);
-  numchk=copy(x,4+namelen+numlen+namelen,numlen);
+	registrant = copy(x, 3, namelen);
+	reginum = copy(x, 4 + namelen, numlen);
+	namechk = copy(x, 4 + namelen + numlen, namelen);
+	numchk = copy(x, 4 + namelen + numlen + namelen, numlen);
 
-  for( fv=1; fv <= namelen; fv ++) registrant[fv]=decode1(registrant[fv]);
-  for( fv=1; fv <= numlen; fv ++) reginum[fv]=decode1(reginum[fv]);
+	for (fv = 1; fv <= namelen; fv ++) registrant[fv] = decode1(registrant[fv]);
+	for (fv = 1; fv <= numlen; fv ++) reginum[fv] = decode1(reginum[fv]);
 
-  if ((! checker(registrant,namechk)) || (! checker(reginum,numchk)))
-        registrant="\?\"!\? ((.)";
-  else
-   registrant=registrant+" ("+reginum+").";
+	if ((! checker(registrant, namechk)) || (! checker(reginum, numchk)))
+		registrant = "\?\"!\? ((.)";
+	else
+		registrant = registrant + " (" + reginum + ").";
 
 }
 
-void flesh_colours() {;        /* assembler;
+void flesh_colours() {
+	;        /* assembler;
 asm
   mov ax,$1012;
   mov bx,21;                 { 21 = light pink (why?) */
-  /* mov cx,1;
-  mov dx,seg    @flesh;
-  mov es,dx;
-  mov dx,offset @flesh;
-  int $10;
+	/* mov cx,1;
+	mov dx,seg    @flesh;
+	mov es,dx;
+	mov dx,offset @flesh;
+	int $10;
 
-  mov dx,seg    @darkflesh;
-  mov es,dx;
-  mov dx,offset @darkflesh;
-  mov bx,5;                 { 5 = dark pink. */
-  /*int $10;
+	mov dx,seg    @darkflesh;
+	mov es,dx;
+	mov dx,offset @darkflesh;
+	mov bx,5;                 { 5 = dark pink. */
+	/*int $10;
 
-  jmp @TheEnd;
+	jmp @TheEnd;
 
- @flesh:
-  db 56,35,35;
+	@flesh:
+	db 56,35,35;
 
- @darkflesh:
-  db 43,22,22;
+	@darkflesh:
+	db 43,22,22;
 
- @TheEnd: */
-                     }
+	@TheEnd: */
+}
 
-void setup()
-{
- integer gd,gm;
- file<fonttype> ff;
+void setup() {
+	integer gd, gm;
+	file<fonttype> ff;
 
- if (paramstr(1)!="jsb")  exit(255);
- checkbreak=false;
- val(paramstr(2),storage_seg,gd);
- val(paramstr(3),storage_ofs,gd);
+	if (paramstr(1) != "jsb")  exit(255);
+	checkbreak = false;
+	val(paramstr(2), storage_seg, gd);
+	val(paramstr(3), storage_ofs, gd);
 
- assign(ff,"avalot.fnt");
- reset(ff); ff >> font; close(ff);
+	assign(ff, "avalot.fnt");
+	reset(ff);
+	ff >> font;
+	close(ff);
 
- gd=3; gm=1; initgraph(gd,gm,"");
- setvisualpage(1); 
+	gd = 3;
+	gm = 1;
+	initgraph(gd, gm, "");
+	setvisualpage(1);
 
- icons();
+	icons();
 }
 
-void big(word x,word y, string z, boolean notted);
-static word start,image; 
+void big(word x, word y, string z, boolean notted);
+static word start, image;
 
 
-static void generate(byte from, boolean& notted)
-{
-    byte fv;
+static void generate(byte from, boolean &notted) {
+	byte fv;
 
- image=0;
- for( fv=0; fv <= 7; fv ++)
-  image += (from & (1 << fv)) << fv;
+	image = 0;
+	for (fv = 0; fv <= 7; fv ++)
+		image += (from & (1 << fv)) << fv;
 
- image += image << 1;
- image=hi(image)+lo(image)*256;
- if (notted)  image=~ image;
+	image += image << 1;
+	image = hi(image) + lo(image) * 256;
+	if (notted)  image = ~ image;
 }
 
-void big(word x,word y, string z, boolean notted)
-{
-    byte fv,ff;byte bit;
-
- start=x+y*80;
-
- for( fv=1; fv <= length(z); fv ++)
- {
-  for( ff=1; ff <= 12; ff ++)
-  {
-   generate(font[z[fv]][ff+1], notted);
-   for( bit=0; bit <= 2; bit ++)
-   {
-    port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
-    memw[0xa000*start+   ff*160]=image;
-    memw[0xa000*start+80+ff*160]=image;
-   }
-  }
-  start += 2;
- }
- bit=getpixel(0,0);
+void big(word x, word y, string z, boolean notted) {
+	byte fv, ff;
+	byte bit;
+
+	start = x + y * 80;
+
+	for (fv = 1; fv <= length(z); fv ++) {
+		for (ff = 1; ff <= 12; ff ++) {
+			generate(font[z[fv]][ff + 1], notted);
+			for (bit = 0; bit <= 2; bit ++) {
+				port[0x3c4] = 2;
+				port[0x3ce] = 4;
+				port[0x3c5] = 1 << bit;
+				port[0x3cf] = bit;
+				memw[0xa000 * start +   ff * 160] = image;
+				memw[0xa000 * start + 80 + ff * 160] = image;
+			}
+		}
+		start += 2;
+	}
+	bit = getpixel(0, 0);
 }
 
-void centre(integer y, string z)
-{
- big(40-(length(z)),y,z,false);
+void centre(integer y, string z) {
+	big(40 - (length(z)), y, z, false);
 }
 
-void option(byte which, string what)
-{
- big(16,41+which*33,string((char)(which+48))+')',true);
- big(24,41+which*33,what,true);
+void option(byte which, string what) {
+	big(16, 41 + which * 33, string((char)(which + 48)) + ')', true);
+	big(24, 41 + which * 33, what, true);
 }
 
-void invert(integer x1,integer y1,integer x2,integer y2)
-{
-    word s; pointer p;
-
- s=imagesize(x1,y1,x2,y2);
- getmem(p,s);
- getimage(x1,y1,x2,y2,p);
- putimage(x1,y1,p,4);
- sound(y1); delay(30);
- sound(600-y2); delay(20);
- nosound;  delay(200);
- putimage(x1,y1,p,0);
- delay(250);
+void invert(integer x1, integer y1, integer x2, integer y2) {
+	word s;
+	pointer p;
+
+	s = imagesize(x1, y1, x2, y2);
+	getmem(p, s);
+	getimage(x1, y1, x2, y2, p);
+	putimage(x1, y1, p, 4);
+	sound(y1);
+	delay(30);
+	sound(600 - y2);
+	delay(20);
+	nosound;
+	delay(200);
+	putimage(x1, y1, p, 0);
+	delay(250);
 }
 
-void wait()
-{
-    word x; char r; boolean pressed;
-
- x=0; pressed=false;
- do {
-  setfillstyle(6,15); bar(x  ,330,x-1,337);
-  setfillstyle(1, 0); bar(x-2,330,x-3,337);
-  delay(40); x += 1;
-
-  if (keypressed()) 
-  {
-   r=readkey();
-   if (r=='\0') 
-   {
-    r=readkey(); /* and...? */
-   } else
-   {     /* Not an extended keystroke. */
-    if (set::of(range('1','6'),cspace,cescape,creturn, eos).has(r))  pressed=true;
-   }
-  }
-
- } while (!((x==640) || pressed));
-
- if ((r==cspace) || (r==creturn))  r='1';
- if (r==cescape)  r='6';
- if (pressed) 
- {
-  result=ord(r)-48;
-  invert(48,37+result*33,114,69+result*33);
- } else result=177;
+void wait() {
+	word x;
+	char r;
+	boolean pressed;
+
+	x = 0;
+	pressed = false;
+	do {
+		setfillstyle(6, 15);
+		bar(x  , 330, x - 1, 337);
+		setfillstyle(1, 0);
+		bar(x - 2, 330, x - 3, 337);
+		delay(40);
+		x += 1;
+
+		if (keypressed()) {
+			r = readkey();
+			if (r == '\0') {
+				r = readkey(); /* and...? */
+			} else {
+				/* Not an extended keystroke. */
+				if (set::of(range('1', '6'), cspace, cescape, creturn, eos).has(r))  pressed = true;
+			}
+		}
+
+	} while (!((x == 640) || pressed));
+
+	if ((r == cspace) || (r == creturn))  r = '1';
+	if (r == cescape)  r = '6';
+	if (pressed) {
+		result = ord(r) - 48;
+		invert(48, 37 + result * 33, 114, 69 + result * 33);
+	} else result = 177;
 }
 
-void show_up()
-{
- setvisualpage(0);
+void show_up() {
+	setvisualpage(0);
 }
 
-void loadmenu()
-{
-    untyped_file f; byte bit;
-
- assign(f,"mainmenu.avd");
- reset(f,1);
- for( bit=0; bit <= 3; bit ++)
-  {
-   port[0x3c4]=2; port[0x3ce]=4; port[0x3c5]=1 << bit; port[0x3cf]=bit;
-   blockread(f,mem[0xa000*0],59*80);
-  }
- close(f);
- bit=getpixel(0,0);
+void loadmenu() {
+	untyped_file f;
+	byte bit;
+
+	assign(f, "mainmenu.avd");
+	reset(f, 1);
+	for (bit = 0; bit <= 3; bit ++) {
+		port[0x3c4] = 2;
+		port[0x3ce] = 4;
+		port[0x3c5] = 1 << bit;
+		port[0x3cf] = bit;
+		blockread(f, mem[0xa000 * 0], 59 * 80);
+	}
+	close(f);
+	bit = getpixel(0, 0);
 }
 
-int main(int argc, const char* argv[])
-{
- pio_initialize(argc, argv);
- setup();
- loadmenu();
- load_regi_info();
- option(1,"Play the game.");
- option(2,"Read the background.");
- option(3,"Preview... perhaps...");
- option(4,"View the documentation.");
- option(5,"Registration info.");
- option(6,"Exit back to DOS.");
- centre(275,registrant);
- centre(303,"Make your choice, or wait for the demo.");
-
- show_up();
- wait();
- mem[storage_seg*storage_ofs]=result;
- closegraph();
- return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	setup();
+	loadmenu();
+	load_regi_info();
+	option(1, "Play the game.");
+	option(2, "Read the background.");
+	option(3, "Preview... perhaps...");
+	option(4, "View the documentation.");
+	option(5, "Registration info.");
+	option(6, "Exit back to DOS.");
+	centre(275, registrant);
+	centre(303, "Make your choice, or wait for the demo.");
+
+	show_up();
+	wait();
+	mem[storage_seg * storage_ofs] = result;
+	closegraph();
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index fa70ca1..f91435f 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -30,83 +30,106 @@
 
 namespace Avalanche {
 
-integer gd,gm;
+integer gd, gm;
 untyped_file f;
-array<1,16000,byte> aa;
-matrix<0,27,0,35,byte> cols;
+array<1, 16000, byte> aa;
+matrix<0, 27, 0, 35, byte> cols;
 text t;
 string x;
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
- fillchar(cols,sizeof(cols),'\0');
- assign(f,"v:avvypic.ptx");
- reset(f,1);
- blockread(f,aa,filesize(f));
- close(f);
- putimage(0,0,aa,0);
- for( gd=0; gd <= 27; gd ++)
-  for( gm=0; gm <= 34; gm ++)
-   cols[gd][gm+1]=getpixel(gd,gm);
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "c:\\bp\\bgi");
+	fillchar(cols, sizeof(cols), '\0');
+	assign(f, "v:avvypic.ptx");
+	reset(f, 1);
+	blockread(f, aa, filesize(f));
+	close(f);
+	putimage(0, 0, aa, 0);
+	for (gd = 0; gd <= 27; gd ++)
+		for (gm = 0; gm <= 34; gm ++)
+			cols[gd][gm + 1] = getpixel(gd, gm);
 
- restorecrtmode();
-/*
-   asm
-      mov ax,$1003
-      mov bl,0
-      int $10
-   end;
-*/
- for( gm=0; gm <= 17; gm ++)
-  for( gd=0; gd <= 27; gd ++)
-  {;
-   gotoxy(gd+1,gm+1);
-   if (cols[gd][2*gm]==cols[gd][2*gm+1]) 
-   {;
-    textattr=cols[gd][2*gm]; output << 'Û';
-   } else
-    if ((cols[gd][2*gm]>7) && (cols[gd][2*gm+1]<8)) 
-    {;
-     textattr=cols[gd][2*gm]+cols[gd][2*gm+1]*16;
-     output << 'ß';
-    } else
-    {;
-     textattr=cols[gd][2*gm]*16+cols[gd][2*gm+1];
-     if (textattr>blink)  textattr -= blink;
-     output << 'Ü';
-    }
-  }
-  gotoxy(23,5); textattr=red; output << 'ß';
+	restorecrtmode();
+	/*
+	   asm
+	      mov ax,$1003
+	      mov bl,0
+	      int $10
+	   end;
+	*/
+	for (gm = 0; gm <= 17; gm ++)
+		for (gd = 0; gd <= 27; gd ++) {
+			;
+			gotoxy(gd + 1, gm + 1);
+			if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
+				;
+				textattr = cols[gd][2 * gm];
+				output << 'Û';
+			} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
+				;
+				textattr = cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16;
+				output << 'ß';
+			} else {
+				;
+				textattr = cols[gd][2 * gm] * 16 + cols[gd][2 * gm + 1];
+				if (textattr > blink)  textattr -= blink;
+				output << 'Ü';
+			}
+		}
+	gotoxy(23, 5);
+	textattr = red;
+	output << 'ß';
 
-  assign(t,"v:avalot.txt"); reset(t);
-  textattr=9; gm=2;
-  do {
-   gm += 1;
-   t >> x >> NL;
-   gotoxy(30,gm);
-   output << x << NL;
-  } while (!(eof(t)));
+	assign(t, "v:avalot.txt");
+	reset(t);
+	textattr = 9;
+	gm = 2;
+	do {
+		gm += 1;
+		t >> x >> NL;
+		gotoxy(30, gm);
+		output << x << NL;
+	} while (!(eof(t)));
 
-  textattr=7; gotoxy(35,2); output << "Back in good old A.D. ";
-  textattr=15; output << "1176"; textattr=7; output << "...";
-  textattr=9; gotoxy(40,4); output << "Lord";
-  gotoxy(67,9); output << "d'Argent";
-  textattr=yellow;
-  gotoxy(37,12); output << "He's back...";
-  gotoxy(47,14); output << "And this time,";
-  gotoxy(52,15); output << "he's wearing tights...";
-  textattr=4;
-  gotoxy(36,17); output << "A Thorsoft of Letchworth game. * Requires EGA";
-  gotoxy(38,18); output << "and HD. * By Mike, Mark and Thomas Thurman.";
-  gotoxy(40,19); output << "Sfx archive- ";
-  textattr=9; output << "Download ";
-  textattr=14; output << "AVLT10.EXE";
-  textattr=9; output << " now!";
-  gotoxy(1,1);
-  input >> NL;
-return EXIT_SUCCESS;
+	textattr = 7;
+	gotoxy(35, 2);
+	output << "Back in good old A.D. ";
+	textattr = 15;
+	output << "1176";
+	textattr = 7;
+	output << "...";
+	textattr = 9;
+	gotoxy(40, 4);
+	output << "Lord";
+	gotoxy(67, 9);
+	output << "d'Argent";
+	textattr = yellow;
+	gotoxy(37, 12);
+	output << "He's back...";
+	gotoxy(47, 14);
+	output << "And this time,";
+	gotoxy(52, 15);
+	output << "he's wearing tights...";
+	textattr = 4;
+	gotoxy(36, 17);
+	output << "A Thorsoft of Letchworth game. * Requires EGA";
+	gotoxy(38, 18);
+	output << "and HD. * By Mike, Mark and Thomas Thurman.";
+	gotoxy(40, 19);
+	output << "Sfx archive- ";
+	textattr = 9;
+	output << "Download ";
+	textattr = 14;
+	output << "AVLT10.EXE";
+	textattr = 9;
+	output << " now!";
+	gotoxy(1, 1);
+	input >> NL;
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index b7f96a5..a4fb34a 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -31,183 +31,227 @@
 
 namespace Avalanche {
 
-integer gd,gm;
+integer gd, gm;
 untyped_file f;
-array<1,16000,byte> aa;
-matrix<0,27,0,35,byte> cols;
+array<1, 16000, byte> aa;
+matrix<0, 27, 0, 35, byte> cols;
 text t;
 string x;
 byte n;
 byte spaces;
-byte cfg,cbg; /* Current foreground & background. */
-byte ofg,obg;  /* Old fg & bg. */
-
-void do_spaces()
-{;
- if (spaces==0)  return;
- along(spaces);
- spaces=0;
+byte cfg, cbg; /* Current foreground & background. */
+byte ofg, obg; /* Old fg & bg. */
+
+void do_spaces() {
+	;
+	if (spaces == 0)  return;
+	along(spaces);
+	spaces = 0;
 }
 
 void finishline();
-static byte wx,wy;
+static byte wx, wy;
 
-static void jumpto(byte xx)
-{;
- along(xx-wx);
+static void jumpto(byte xx) {
+	;
+	along(xx - wx);
 }
 
-void finishline()
-{;
- wx=29-spaces; wy=gm+1;
- switch (wy) {
-  case 1: {;
-      sgr(7); jumpto(35); output << "Back in good old A.D. ";
-      sgr(15); output << "1189"; sgr(7); output << "..." << NL; cfg=7;
-     }
-     break;
-  case RANGE_5(3,7): {;
-         t >> x >> NL;
-         while (x[length(x)]=='\40')  x[0] -= 1;
-         if (x!="") 
-         {;
-          jumpto(30);
-          sgr(9);
-          spaces=0;
-          while (x!="") 
-          {;
-           if (x[1]==' ') 
-            spaces += 1;
-           else
-           {;
-            do_spaces();
-            output << x[1];
-           }
-           Delete(x,1,1);
-          }
-          if (wy==7)  close(t);
-          output << NL;
-         }
-        }
-        break;
-  case 8: {;
-      jumpto(67); sgr(9); output << "d'Argent" << NL; cfg=9;
-     }
-     break;
-  case 11: {;
-       jumpto(37); sgr(14); output << "He's back..." << NL;
-      }
-      break;
-  case 13: {;
-       jumpto(47); sgr(14); output << "And this time," << NL;
-      }
-      break;
-  case 14: {;
-       jumpto(52); sgr(14); output << "he's wearing tights..." << NL;
-      }
-      break;
-  case 16: {;
-       jumpto(35); sgr(4);
-       output << "A Thorsoft of Letchworth game. * Requires EGA" << NL;
-      }
-      break;
-  case 17: {;
-       jumpto(37); sgr(4);
-       output << "and HD. * By Mike, Mark and Thomas Thurman." << NL;
-      }
-      break;
-  case 18: {;
-       jumpto(39);
-       sgr( 4); output << "Sfx archive- ";
-       sgr( 9); output << "Download ";
-       sgr(14); output << "AVLT10.EXE";
-       sgr( 9); output << " now!";
-      }
-      break;
-  default: output << NL;
- }
+void finishline() {
+	;
+	wx = 29 - spaces;
+	wy = gm + 1;
+	switch (wy) {
+	case 1: {
+		;
+		sgr(7);
+		jumpto(35);
+		output << "Back in good old A.D. ";
+		sgr(15);
+		output << "1189";
+		sgr(7);
+		output << "..." << NL;
+		cfg = 7;
+	}
+	break;
+	case RANGE_5(3, 7): {
+		;
+		t >> x >> NL;
+		while (x[length(x)] == '\40')  x[0] -= 1;
+		if (x != "") {
+			;
+			jumpto(30);
+			sgr(9);
+			spaces = 0;
+			while (x != "") {
+				;
+				if (x[1] == ' ')
+					spaces += 1;
+				else {
+					;
+					do_spaces();
+					output << x[1];
+				}
+				Delete(x, 1, 1);
+			}
+			if (wy == 7)  close(t);
+			output << NL;
+		}
+	}
+	break;
+	case 8: {
+		;
+		jumpto(67);
+		sgr(9);
+		output << "d'Argent" << NL;
+		cfg = 9;
+	}
+	break;
+	case 11: {
+		;
+		jumpto(37);
+		sgr(14);
+		output << "He's back..." << NL;
+	}
+	break;
+	case 13: {
+		;
+		jumpto(47);
+		sgr(14);
+		output << "And this time," << NL;
+	}
+	break;
+	case 14: {
+		;
+		jumpto(52);
+		sgr(14);
+		output << "he's wearing tights..." << NL;
+	}
+	break;
+	case 16: {
+		;
+		jumpto(35);
+		sgr(4);
+		output << "A Thorsoft of Letchworth game. * Requires EGA" << NL;
+	}
+	break;
+	case 17: {
+		;
+		jumpto(37);
+		sgr(4);
+		output << "and HD. * By Mike, Mark and Thomas Thurman." << NL;
+	}
+	break;
+	case 18: {
+		;
+		jumpto(39);
+		sgr(4);
+		output << "Sfx archive- ";
+		sgr(9);
+		output << "Download ";
+		sgr(14);
+		output << "AVLT10.EXE";
+		sgr(9);
+		output << " now!";
+	}
+	break;
+	default:
+		output << NL;
+	}
 }
 
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0; initgraph(gd,gm,"c:\\bp\\bgi");
- fillchar(cols,sizeof(cols),'\0');
- assign(f,"v:avvypic.ptx");
- reset(f,1);
- blockread(f,aa,filesize(f));
- close(f);
- putimage(0,0,aa,0);
- for( gd=0; gd <= 27; gd ++)
-  for( gm=0; gm <= 34; gm ++)
-   cols[gd][gm+1]=getpixel(gd,gm);
-
- restorecrtmode();
-
- assign(output,"v:avalot.ans"); rewrite(output); normal; ed;
-/* assign(output,''); rewrite(output); normal; ed;*/
- assign(t,"v:avalot.txt"); reset(t);
-
- for( gm=0; gm <= 17; gm ++)
- {;
-  spaces=0;
-  for( gd=0; gd <= 27; gd ++)
-  {;
-   if ((gd==22) && (gm==4)) 
-   {;
-    do_spaces();
-    sgr(red); output << 'ß';
-   } else
-   {;
-    if (cols[gd][2*gm]==cols[gd][2*gm+1]) 
-    {;
-     if (cols[gd][2*gm]==0) 
-      spaces += 1; /* a blank space */
-     else {;
-      do_spaces();
-
-      if (cfg==cols[gd][2*gm])  output << 'Û'; else
-       if (cbg==cols[gd][2*gm])  output << ' '; else
-       {;
-        sgr((cols[gd][2*gm])+(cbg*16));
-        cfg=cols[gd][2*gm];
-        output << 'Û';
-       }
-     }
-    } else
-     if ((cols[gd][2*gm]>7) && (cols[gd][2*gm+1]<8)) 
-     {;
-      do_spaces();
-      sgr(cols[gd][2*gm]+cols[gd][2*gm+1]*16);
-      cfg=cols[gd][2*gm]; cbg=cols[gd][2*gm+1]*16;
-      output << 'ß';
-     } else
-     {;
-      do_spaces();
-
-      ofg=cfg; obg=cbg;
-      cbg=cols[gd][2*gm]; cfg=cols[gd][2*gm+1];
-
-      if ((cbg==ofg) && (cfg==obg)) 
-      {;
-       n=cfg*16+cbg;
-       if (n>128)  n -= 128;
-       output << 'ß';
-      } else
-      {;
-       n=cbg*16+cfg;
-       if (n>128)  n -= 128;
-       if ((cfg!=ofg) || (cbg!=obg))  sgr(n);
-       output << 'Ü';
-      }
-
-     }
-    }
-   } finishline();
-  }
- output << NL;
- normal;
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "c:\\bp\\bgi");
+	fillchar(cols, sizeof(cols), '\0');
+	assign(f, "v:avvypic.ptx");
+	reset(f, 1);
+	blockread(f, aa, filesize(f));
+	close(f);
+	putimage(0, 0, aa, 0);
+	for (gd = 0; gd <= 27; gd ++)
+		for (gm = 0; gm <= 34; gm ++)
+			cols[gd][gm + 1] = getpixel(gd, gm);
+
+	restorecrtmode();
+
+	assign(output, "v:avalot.ans");
+	rewrite(output);
+	normal;
+	ed;
+	/* assign(output,''); rewrite(output); normal; ed;*/
+	assign(t, "v:avalot.txt");
+	reset(t);
+
+	for (gm = 0; gm <= 17; gm ++) {
+		;
+		spaces = 0;
+		for (gd = 0; gd <= 27; gd ++) {
+			;
+			if ((gd == 22) && (gm == 4)) {
+				;
+				do_spaces();
+				sgr(red);
+				output << 'ß';
+			} else {
+				;
+				if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
+					;
+					if (cols[gd][2 * gm] == 0)
+						spaces += 1; /* a blank space */
+					else {
+						;
+						do_spaces();
+
+						if (cfg == cols[gd][2 * gm])  output << 'Û';
+						else if (cbg == cols[gd][2 * gm])  output << ' ';
+						else {
+							;
+							sgr((cols[gd][2 * gm]) + (cbg * 16));
+							cfg = cols[gd][2 * gm];
+							output << 'Û';
+						}
+					}
+				} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
+					;
+					do_spaces();
+					sgr(cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16);
+					cfg = cols[gd][2 * gm];
+					cbg = cols[gd][2 * gm + 1] * 16;
+					output << 'ß';
+				} else {
+					;
+					do_spaces();
+
+					ofg = cfg;
+					obg = cbg;
+					cbg = cols[gd][2 * gm];
+					cfg = cols[gd][2 * gm + 1];
+
+					if ((cbg == ofg) && (cfg == obg)) {
+						;
+						n = cfg * 16 + cbg;
+						if (n > 128)  n -= 128;
+						output << 'ß';
+					} else {
+						;
+						n = cbg * 16 + cfg;
+						if (n > 128)  n -= 128;
+						if ((cfg != ofg) || (cbg != obg))  sgr(n);
+						output << 'Ü';
+					}
+
+				}
+			}
+		}
+		finishline();
+	}
+	output << NL;
+	normal;
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 25fc83e..4f150e3 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -29,72 +29,89 @@
 
 namespace Avalanche {
 
-integer gd,gm;
+integer gd, gm;
 byte z;
-array<1,4,pointer> a;
-untyped_file f; word s;
+array<1, 4, pointer> a;
+untyped_file f;
+word s;
 string check;
-integer x,y;
-void savesc()
-{
-    varying_string<40> adf; untyped_file f; byte z; array<1,2,pointer> c; word s;
-varying_string<14> nam; varying_string<30> screenname;
-;
- nam="v:avvymonk.avd";
- adf=string("aved as a stuff file, so there! TJAT.")+'\15'+'\12'+'\32';
- adf[0]='S';
- screenname="Avalot in a monk's costume";
- assign(f,nam); /* not scrambled */
- rewrite(f,1);
- blockwrite(f,adf,41);
- blockwrite(f,nam,13);
- blockwrite(f,screenname,31);
- s=imagesize(0,0,getmaxx(),75);
- for( z=1; z <= 2; z ++)
- {;
-  getmem(c[z],s);
-  getimage(0,15+(z-1)*75,getmaxx(),15+(z)*75,c[z]);
-  blockwrite(f,c[z],s);
-  freemem(c[z],s);
- }
+integer x, y;
+void savesc() {
+	varying_string<40> adf;
+	untyped_file f;
+	byte z;
+	array<1, 2, pointer> c;
+	word s;
+	varying_string<14> nam;
+	varying_string<30> screenname;
+	;
+	nam = "v:avvymonk.avd";
+	adf = string("aved as a stuff file, so there! TJAT.") + '\15' + '\12' + '\32';
+	adf[0] = 'S';
+	screenname = "Avalot in a monk's costume";
+	assign(f, nam); /* not scrambled */
+	rewrite(f, 1);
+	blockwrite(f, adf, 41);
+	blockwrite(f, nam, 13);
+	blockwrite(f, screenname, 31);
+	s = imagesize(0, 0, getmaxx(), 75);
+	for (z = 1; z <= 2; z ++) {
+		;
+		getmem(c[z], s);
+		getimage(0, 15 + (z - 1) * 75, getmaxx(), 15 + (z) * 75, c[z]);
+		blockwrite(f, c[z], s);
+		freemem(c[z], s);
+	}
 }
-void loadscreen(string nam)
-{;
- assign(f,nam);
- reset(f,1);
- blockread(f,check,41);
- blockread(f,check,13);
- blockread(f,check,31);
- s=imagesize(0,0,getmaxx(),75);
- for( z=1; z <= 2; z ++)
- {;
-  getmem(a[z],s);
-  blockread(f,a[z],s);
-  setactivepage(0);
-  putimage(0,15+(z-1)*75,a[z],0);
-  freemem(a[z],s);
- }
- close(f);
+void loadscreen(string nam) {
+	;
+	assign(f, nam);
+	reset(f, 1);
+	blockread(f, check, 41);
+	blockread(f, check, 13);
+	blockread(f, check, 31);
+	s = imagesize(0, 0, getmaxx(), 75);
+	for (z = 1; z <= 2; z ++) {
+		;
+		getmem(a[z], s);
+		blockread(f, a[z], s);
+		setactivepage(0);
+		putimage(0, 15 + (z - 1) * 75, a[z], 0);
+		freemem(a[z], s);
+	}
+	close(f);
 }
-int main(int argc, const char* argv[])
-{pio_initialize(argc, argv);
-;
- gd=3; gm=0;
- x=0; y=0;
- initgraph(gd,gm,"o:");
- loadscreen("v:legion.avd");
- while (y<100) 
- {;
-  switch (getpixel(x,y)) {
-   case 7: putpixel(x,y,0); break;
-   case 8: putpixel(x,y,0); break;
-   case 9: putpixel(x,y,15); break;
-  }
-  x += 1;
-  if (x>640)  {; y += 1; x=0; }
- }
- savesc();
-return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	;
+	gd = 3;
+	gm = 0;
+	x = 0;
+	y = 0;
+	initgraph(gd, gm, "o:");
+	loadscreen("v:legion.avd");
+	while (y < 100) {
+		;
+		switch (getpixel(x, y)) {
+		case 7:
+			putpixel(x, y, 0);
+			break;
+		case 8:
+			putpixel(x, y, 0);
+			break;
+		case 9:
+			putpixel(x, y, 15);
+			break;
+		}
+		x += 1;
+		if (x > 640)  {
+			;
+			y += 1;
+			x = 0;
+		}
+	}
+	savesc();
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
index fabda14..94e00da 100644
--- a/engines/avalanche/bakchunk.cpp
+++ b/engines/avalanche/bakchunk.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -31,26 +31,29 @@
 
 namespace Avalanche {
 
-integer gd,gm;
-int main(int argc, const char* argv[])
-{
- pio_initialize(argc, argv);
- gd=3; gm=0; initgraph(gd,gm,"");
- setvisualpage(3);
- load_chunks('1');
-
- for( gd=0; gd <= num_chunks; gd ++)
-  show_one_at(gd,0,gd*40);
-
- mblit(0,0,79,200,3,0);
-
- gd=getpixel(0,0);
- setvisualpage(0); setactivepage(0);
-
- settextstyle(0,0,4); setcolor(15);
- outtextxy(100,50,"Chunk1");
- input >> NL;
- return EXIT_SUCCESS;
+integer gd, gm;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	gd = 3;
+	gm = 0;
+	initgraph(gd, gm, "");
+	setvisualpage(3);
+	load_chunks('1');
+
+	for (gd = 0; gd <= num_chunks; gd ++)
+		show_one_at(gd, 0, gd * 40);
+
+	mblit(0, 0, 79, 200, 3, 0);
+
+	gd = getpixel(0, 0);
+	setvisualpage(0);
+	setactivepage(0);
+
+	settextstyle(0, 0, 4);
+	setcolor(15);
+	outtextxy(100, 50, "Chunk1");
+	input >> NL;
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
index b4ceeb3..dcab525 100644
--- a/engines/avalanche/basher.cpp
+++ b/engines/avalanche/basher.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -35,9 +35,9 @@
 #define __basher_implementation__
 
 
- /* Note: this unit can record keystrokes, for the demo. If you want it
-   to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
-   cause them to be played back. */
+/* Note: this unit can record keystrokes, for the demo. If you want it
+  to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
+  cause them to be played back. */
 
 #include "basher.h"
 
@@ -59,36 +59,36 @@ namespace Avalanche {
 boolean entering_filename;
 byte left_margin;
 
-void plottext()
-{
-      const array<0,2,byte> p = {{0,1,3}};
-    byte x,y,n;
-
- x=0; if (mouse_near_text())  super_off();
- cursor_off();
- for( n=0; n <= 2; n ++)
-  for( y=0; y <= 7; y ++)
-  {
-   for( x=1; x <= length(current); x ++)
-    mem[0xa000*p[n]*pagetop+12882+y*80+x]=little[current[x]][y];
-   fillchar(mem[0xa000*p[n]*pagetop+12883+y*80+x],77-x,'\0');
-  }
- cursor_on();
- super_on();
+void plottext() {
+	const array<0, 2, byte> p = {{0, 1, 3}};
+	byte x, y, n;
+
+	x = 0;
+	if (mouse_near_text())  super_off();
+	cursor_off();
+	for (n = 0; n <= 2; n ++)
+		for (y = 0; y <= 7; y ++) {
+			for (x = 1; x <= length(current); x ++)
+				mem[0xa000 * p[n]*pagetop + 12882 + y * 80 + x] = little[current[x]][y];
+			fillchar(mem[0xa000 * p[n]*pagetop + 12883 + y * 80 + x], 77 - x, '\0');
+		}
+	cursor_on();
+	super_on();
 }
 
-void wipetext()
-{
-      const array<0,2,byte> n = {{0,1,3}};
-    byte y,p;
-
- if (mouse_near_text())  super_off();
- cursor_off();
- for( y=0; y <= 7; y ++)
-  for( p=0; p <= 2; p ++)
-   fillchar(mem[0xa000*n[p]*pagetop+12883+y*80],77,'\0');
- quote=true; curpos=1; cursor_on();
- super_on();
+void wipetext() {
+	const array<0, 2, byte> n = {{0, 1, 3}};
+	byte y, p;
+
+	if (mouse_near_text())  super_off();
+	cursor_off();
+	for (y = 0; y <= 7; y ++)
+		for (p = 0; p <= 2; p ++)
+			fillchar(mem[0xa000 * n[p]*pagetop + 12883 + y * 80], 77, '\0');
+	quote = true;
+	curpos = 1;
+	cursor_on();
+	super_on();
 }
 
 /*procedure cursor;
@@ -104,49 +104,49 @@ begin
  end else dec(curflash);
 end;*/
 
-void do_cursor()
-{
- bytefield bf;
- byte fv;
-
- mem[0xac00*13442+curpos]=~ mem[0xac00*13442+curpos];
- {
-  bf.x1=curpos+1; bf.x2=curpos+2; bf.y1=168; bf.y2=168;
- }
- for( fv=0; fv <= 1; fv ++) getset[fv].remember(bf);
+void do_cursor() {
+	bytefield bf;
+	byte fv;
+
+	mem[0xac00 * 13442 + curpos] = ~ mem[0xac00 * 13442 + curpos];
+	{
+		bf.x1 = curpos + 1;
+		bf.x2 = curpos + 2;
+		bf.y1 = 168;
+		bf.y2 = 168;
+	}
+	for (fv = 0; fv <= 1; fv ++) getset[fv].remember(bf);
 }
 
-void cursor_on()
-{
- if (cursoron)  return;
- do_cursor(); cursoron=true;
+void cursor_on() {
+	if (cursoron)  return;
+	do_cursor();
+	cursoron = true;
 }
 
-void cursor_off()
-{
- if (! cursoron)  return;
- do_cursor(); cursoron=false;
+void cursor_off() {
+	if (! cursoron)  return;
+	do_cursor();
+	cursoron = false;
 }
 
 
-void get_demorec()
-{
- demofile >> demo_rec;
- inchar=demo_rec.key;
-   extd=demo_rec.extd;
-   demo_rec.delay -= 1;
+void get_demorec() {
+	demofile >> demo_rec;
+	inchar = demo_rec.key;
+	extd = demo_rec.extd;
+	demo_rec.delay -= 1;
 }
 
 #ifdef RECORD
-  void record_one()
-  {
-   demo_rec.delay=count;
-   demo_rec.key=inchar;
-   demo_rec.extd=extd;
-
-   demofile << demo_rec;
-   count=0;
-  }
+void record_one() {
+	demo_rec.delay = count;
+	demo_rec.key = inchar;
+	demo_rec.extd = extd;
+
+	demofile << demo_rec;
+	count = 0;
+}
 #endif
 /*
 procedure storeline(whatwhat:string);
@@ -178,235 +178,324 @@ end;
 */
 void typein();
 
-static char firstchar(string x) { char firstchar_result;
-                                         firstchar_result=x[1]; return firstchar_result;
-                                }
+static char firstchar(string x) {
+	char firstchar_result;
+	firstchar_result = x[1];
+	return firstchar_result;
+}
 
 
-static void try_dd() /* This asks the Parsekey proc in Dropdown if it knows it. */
-{
- parsekey(inchar,extd);
+static void try_dd() { /* This asks the Parsekey proc in Dropdown if it knows it. */
+	parsekey(inchar, extd);
 }
 
-void typein()
-{
-    byte w;
-
- inkey();
- #ifdef RECORD record_one(); #endif
-
- switch (inchar) {
-  case RANGE_15('\40','\56'):case '\60' ... '\337':case '\341' ... '\377': if (ddm_o.menunow) 
-             {
-              parsekey(inchar,extd);
-             } else
-             {
-              if (length(current)<76) 
-              {
-               if ((inchar=='"') || (inchar=='`')) 
-               {
-                if (quote)  inchar='`'; else inchar='"';
-                quote=! quote;    /* Quote- Unquote... */
-               }
-               insert(inchar,current,curpos);
-               curpos += 1;
-               plottext();
-              } else blip();
-             }
-             break;
-  case '\10': if (! ddm_o.menunow) 
-      {
-       if (curpos>left_margin) 
-       {
-        curpos -= 1;
-        if (set::of('"','`', eos).has(current[curpos]))  quote=! quote;
-        Delete(current,curpos,1);
-        plottext();
-       } else blip();
-      }
-      break;
-  case '\0':case '\340': {
-       switch (extd) {
-              /* Function keys: */
-        case cf1: callverb(vb_help); break; /* f1 - help (obviously) */
-        case cf2: fxtoggle(); break; /* f2 - sound */
-        case ccf2:case cf11: { clearwords(); callverb(vb_save); } break; /* ^f2 - save */
-        case cf3: if (length(current)<length(/*previous^[20]*/last))  /* f3 - rec last */
-             {
-              current=current+copy( /*previous^[20]*/last,length(current)+1,255);
-              curpos=length(current)+1;
-              plottext();
-             }
-             break;
-        case ccf3:case cf12: { clearwords(); callverb(vb_load); } break; /* ^f3 - load */
-        case cf4: callverb(vb_restart); break; /* f4 - restart game */
-        case cf5: {
-                person=pardon; thing=pardon;
-                callverb(firstchar(f5_does())); /* f5 - get up/ whatever */
-             }
-             break;
-        case cf6: callverb(vb_pause); break; /* f6 - pause */
-        case cf7: callverb(vb_open); break; /* f7 - open door */
-        case cf8: callverb(vb_look); break; /* f8 - look */
-        case cf9: callverb(vb_score); break; /* f9 - score */
-        case ccf7: major_redraw(); break; /* ^f7 - open door */
-        case cf10:case c_ax:case caf4: {
-                      #ifdef RECORD
-                       display("Hi. You have just finished recording. GIED.");
-                       close(demofile); exit(0);
-                      #endif
-                       callverb(vb_quit); /* f10, alt-X, alt-f4 - quit */
-                     }
-                     break;
-        case ccf5: back_to_bootstrap(2); break; /* ^f5 - Dos shell. */
-        case csf10: callverb(vb_info); break; /* sf10 - version */
-
-        case c_ab: callverb(vb_boss); break; /* alt-B */
-        case c_ad: display("Wrong game!"); break; /* alt-D */
-        case ccleft: if (curpos>left_margin) 
-              { cursor_off(); curpos -= 1; cursor_on(); }
-              break;                                         /* ^left */
-        case ccright: if (curpos<=length(current))  /* ^right */
-              { cursor_off(); curpos += 1; cursor_on(); }
-              break;
-        case cchome: { cursor_off(); curpos=1; cursor_on(); } break; /* ^home */
-        case ccend: { cursor_off(); curpos=length(current)+1; cursor_on(); } break; /* ^end */
-        case c_ar: oh=177; break; /* alt-R = repeater (re-chime) */
-        case cup:case cdown:case cleft:case cright:case cpgup:case cpgdn:case chome:case cend: if (ddm_o.menunow)  try_dd();
-              else tripkey(extd);
-              break;              /* Up/Down/Left/Right/PgUp/PgDn */
-        case cnum5: tripkey(extd); break; /* Numeric 5 */
-        case cdel: if (! ddm_o.menunow) 
-             {
-              if (curpos<=length(current)) 
-              {
-               if (set::of('"','`', eos).has(current[curpos]))  quote=! quote;
-               Delete(current,curpos,1);
-               plottext();
-              } else blip();
-             }
-             break;
-        default: try_dd();
-       }
-      }
-      break;
-  case cescape:case '/': if (ddm_o.menunow)  /* Escape */
-           { ddm_o.wipe(); } else
-            if (entering_filename) 
-              { normal_edit(); wipetext(); } else
-                ddm_m.getcertain(ddm_o.menunum);
-                break;
-  case creturn: if (ddm_o.menunow)  try_dd(); /* Return */
-       else {
-        log_command(current);
-        if (entering_filename) 
-        {
-          edna_save(copy(current,24,255));
-          normal_edit(); wipetext();
-        } else
-        {
-          if (current!="")  last=current;
-          parse(); do_that();
-          if (! entering_filename) 
-          {
-            current="";
-            wipetext();
-          }
-        }
-       }
-       break;
-  case '\11': callverb(vb_inv); break; /* Ctrl-I= inventory */
-  case '\7': errorled(); break;
-  case '\25': {
-       current="";
-       wipetext();
-      }
-      break;
-
-  case '\27': { tr[1].xs=walk; newspeed(); } break;
-  case '\22': { tr[1].xs=run;  newspeed(); } break;
-
-  case '\2': bosskey(); break;
-  case '\12': ctrl=cjoy; break; /* Joystick */
-  case '\13': ctrl=ckey; break; /* Keyboard */
-  case '\3': callverb(vb_quit); break; /* Ctrl-C= request to quit */
-
- }
- showrw();
-
- if (demo)  get_demorec();
+void typein() {
+	byte w;
+
+	inkey();
+#ifdef RECORD record_one(); #endif
+
+	switch (inchar) {
+	case RANGE_15('\40', '\56'):
+	case '\60' ... '\337':
+	case '\341' ... '\377':
+		if (ddm_o.menunow) {
+			parsekey(inchar, extd);
+		} else {
+			if (length(current) < 76) {
+				if ((inchar == '"') || (inchar == '`')) {
+					if (quote)  inchar = '`';
+					else inchar = '"';
+					quote = ! quote;  /* Quote- Unquote... */
+				}
+				insert(inchar, current, curpos);
+				curpos += 1;
+				plottext();
+			} else blip();
+		}
+		break;
+	case '\10':
+		if (! ddm_o.menunow) {
+			if (curpos > left_margin) {
+				curpos -= 1;
+				if (set::of('"', '`', eos).has(current[curpos]))  quote = ! quote;
+				Delete(current, curpos, 1);
+				plottext();
+			} else blip();
+		}
+		break;
+	case '\0':
+	case '\340': {
+		switch (extd) {
+			/* Function keys: */
+		case cf1:
+			callverb(vb_help);
+			break; /* f1 - help (obviously) */
+		case cf2:
+			fxtoggle();
+			break; /* f2 - sound */
+		case ccf2:
+		case cf11: {
+			clearwords();
+			callverb(vb_save);
+		}
+		break; /* ^f2 - save */
+		case cf3:
+			if (length(current) < length(/*previous^[20]*/last)) { /* f3 - rec last */
+				current = current + copy(/*previous^[20]*/last, length(current) + 1, 255);
+				curpos = length(current) + 1;
+				plottext();
+			}
+			break;
+		case ccf3:
+		case cf12: {
+			clearwords();
+			callverb(vb_load);
+		}
+		break; /* ^f3 - load */
+		case cf4:
+			callverb(vb_restart);
+			break; /* f4 - restart game */
+		case cf5: {
+			person = pardon;
+			thing = pardon;
+			callverb(firstchar(f5_does())); /* f5 - get up/ whatever */
+		}
+		break;
+		case cf6:
+			callverb(vb_pause);
+			break; /* f6 - pause */
+		case cf7:
+			callverb(vb_open);
+			break; /* f7 - open door */
+		case cf8:
+			callverb(vb_look);
+			break; /* f8 - look */
+		case cf9:
+			callverb(vb_score);
+			break; /* f9 - score */
+		case ccf7:
+			major_redraw();
+			break; /* ^f7 - open door */
+		case cf10:
+		case c_ax:
+		case caf4: {
+#ifdef RECORD
+			display("Hi. You have just finished recording. GIED.");
+			close(demofile);
+			exit(0);
+#endif
+			callverb(vb_quit); /* f10, alt-X, alt-f4 - quit */
+		}
+		break;
+		case ccf5:
+			back_to_bootstrap(2);
+			break; /* ^f5 - Dos shell. */
+		case csf10:
+			callverb(vb_info);
+			break; /* sf10 - version */
+
+		case c_ab:
+			callverb(vb_boss);
+			break; /* alt-B */
+		case c_ad:
+			display("Wrong game!");
+			break; /* alt-D */
+		case ccleft:
+			if (curpos > left_margin) {
+				cursor_off();
+				curpos -= 1;
+				cursor_on();
+			}
+			break;                                         /* ^left */
+		case ccright:
+			if (curpos <= length(current)) { /* ^right */
+				cursor_off();
+				curpos += 1;
+				cursor_on();
+			}
+			break;
+		case cchome: {
+			cursor_off();
+			curpos = 1;
+			cursor_on();
+		}
+		break; /* ^home */
+		case ccend: {
+			cursor_off();
+			curpos = length(current) + 1;
+			cursor_on();
+		}
+		break; /* ^end */
+		case c_ar:
+			oh = 177;
+			break; /* alt-R = repeater (re-chime) */
+		case cup:
+		case cdown:
+		case cleft:
+		case cright:
+		case cpgup:
+		case cpgdn:
+		case chome:
+		case cend:
+			if (ddm_o.menunow)  try_dd();
+			else tripkey(extd);
+			break;              /* Up/Down/Left/Right/PgUp/PgDn */
+		case cnum5:
+			tripkey(extd);
+			break; /* Numeric 5 */
+		case cdel:
+			if (! ddm_o.menunow) {
+				if (curpos <= length(current)) {
+					if (set::of('"', '`', eos).has(current[curpos]))  quote = ! quote;
+					Delete(current, curpos, 1);
+					plottext();
+				} else blip();
+			}
+			break;
+		default:
+			try_dd();
+		}
+	}
+	break;
+	case cescape:
+	case '/':
+		if (ddm_o.menunow) { /* Escape */
+			ddm_o.wipe();
+		} else if (entering_filename) {
+			normal_edit();
+			wipetext();
+		} else
+			ddm_m.getcertain(ddm_o.menunum);
+		break;
+	case creturn:
+		if (ddm_o.menunow)  try_dd(); /* Return */
+		else {
+			log_command(current);
+			if (entering_filename) {
+				edna_save(copy(current, 24, 255));
+				normal_edit();
+				wipetext();
+			} else {
+				if (current != "")  last = current;
+				parse();
+				do_that();
+				if (! entering_filename) {
+					current = "";
+					wipetext();
+				}
+			}
+		}
+		break;
+	case '\11':
+		callverb(vb_inv);
+		break; /* Ctrl-I= inventory */
+	case '\7':
+		errorled();
+		break;
+	case '\25': {
+		current = "";
+		wipetext();
+	}
+	break;
+
+	case '\27': {
+		tr[1].xs = walk;
+		newspeed();
+	}
+	break;
+	case '\22': {
+		tr[1].xs = run;
+		newspeed();
+	}
+	break;
+
+	case '\2':
+		bosskey();
+		break;
+	case '\12':
+		ctrl = cjoy;
+		break; /* Joystick */
+	case '\13':
+		ctrl = ckey;
+		break; /* Keyboard */
+	case '\3':
+		callverb(vb_quit);
+		break; /* Ctrl-C= request to quit */
+
+	}
+	showrw();
+
+	if (demo)  get_demorec();
 }
 
 /*        'x'..'z': begin setvisualpage(ord(extd)-63); write(#7); inkey; end;
         '': begin setvisualpage(0); write(#7); inkey; end;*/
 
-void keyboard_link()
-{
- state(defaultled); /* if defaultled=1 then on; { For the menus }*/
- joykeys(); /* Test joystick buttons- I know that's not keyboard. */
-
- if (demo) 
- {
-  if (keypressede())  exit(0);
-  if (demo_rec.delay>0) 
-   demo_rec.delay -= 1;
-  else typein();
-  return;
- }
-
- #ifdef RECORD count += 1;   #endif
-
- if (! keypressede())  return;
- if (keyboardclick)  click();
- typein();
+void keyboard_link() {
+	state(defaultled); /* if defaultled=1 then on; { For the menus }*/
+	joykeys(); /* Test joystick buttons- I know that's not keyboard. */
+
+	if (demo) {
+		if (keypressede())  exit(0);
+		if (demo_rec.delay > 0)
+			demo_rec.delay -= 1;
+		else typein();
+		return;
+	}
+
+#ifdef RECORD count += 1;   #endif
+
+	if (! keypressede())  return;
+	if (keyboardclick)  click();
+	typein();
 }
 
-boolean demo_ready()
-{
- boolean demo_ready_result;
- if (demo_rec.delay>0) 
- {
-  slowdown();
-  demo_rec.delay -= 1;
- }
- demo_ready_result=demo_rec.delay==0;
- return demo_ready_result;
+boolean demo_ready() {
+	boolean demo_ready_result;
+	if (demo_rec.delay > 0) {
+		slowdown();
+		demo_rec.delay -= 1;
+	}
+	demo_ready_result = demo_rec.delay == 0;
+	return demo_ready_result;
 }
 
-void filename_edit()
-{
- entering_filename=true;
- current="Filename\? (Esc=cancel):";
- left_margin=24; curpos=24;
- plottext();
+void filename_edit() {
+	entering_filename = true;
+	current = "Filename\? (Esc=cancel):";
+	left_margin = 24;
+	curpos = 24;
+	plottext();
 }
 
-void normal_edit()
-{
- entering_filename=false;
- current="";
- left_margin=1; curpos=1;
+void normal_edit() {
+	entering_filename = false;
+	current = "";
+	left_margin = 1;
+	curpos = 1;
 }
 
 class unit_basher_initialize {
-  public: unit_basher_initialize();
+public:
+	unit_basher_initialize();
 };
 static unit_basher_initialize basher_constructor;
 
 unit_basher_initialize::unit_basher_initialize() {
-/* new(previous);*/ last=""; normal_edit();
-
- if (demo) 
- {
-  assign(demofile,"demo.avd");
-  reset(demofile);
- }
-
- #ifdef RECORD
-  count=0;


Commit: f974bccbb0071c61521f072ecf803cb40910e8ab
    https://github.com/scummvm/scummvm/commit/f974bccbb0071c61521f072ecf803cb40910e8ab
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-18T02:50:18-07:00

Commit Message:
AVALANCHE: Remove empty lines with only ";" characters in them.

Changed paths:
    engines/avalanche/1stoff.cpp
    engines/avalanche/access.cpp
    engines/avalanche/also.cpp
    engines/avalanche/andexor.cpp
    engines/avalanche/andexor2.cpp
    engines/avalanche/andextst.cpp
    engines/avalanche/arch.cpp
    engines/avalanche/avbkgrnd.cpp
    engines/avalanche/avvyans.cpp
    engines/avalanche/avvyans2.cpp
    engines/avalanche/avvymonk.cpp
    engines/avalanche/bootstrp.cpp
    engines/avalanche/cadburys.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/ch_egats.cpp
    engines/avalanche/charmap.cpp
    engines/avalanche/chunkxf1.cpp
    engines/avalanche/chunkxf2.cpp
    engines/avalanche/chunkxf3.cpp
    engines/avalanche/chunkxf4.cpp
    engines/avalanche/chunkxf5.cpp
    engines/avalanche/chunkxf6.cpp
    engines/avalanche/chunkxf7.cpp
    engines/avalanche/chunkxf8.cpp
    engines/avalanche/chunkxf9.cpp
    engines/avalanche/chunkxfa.cpp
    engines/avalanche/chunkxfb.cpp
    engines/avalanche/chunkxfc.cpp
    engines/avalanche/chunkxfd.cpp
    engines/avalanche/chunkxfe.cpp
    engines/avalanche/chunkxff.cpp
    engines/avalanche/chunkxfg.cpp
    engines/avalanche/chunkxfh.cpp
    engines/avalanche/chunkxfi.cpp
    engines/avalanche/chunkxfj.cpp
    engines/avalanche/chunkxfk.cpp
    engines/avalanche/chunkxfl.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/convert.cpp
    engines/avalanche/convmous.cpp
    engines/avalanche/credits.cpp
    engines/avalanche/displtxt.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/dwidth.cpp
    engines/avalanche/edhead.cpp
    engines/avalanche/enhanced.cpp
    engines/avalanche/filer.cpp
    engines/avalanche/fileunit.cpp
    engines/avalanche/filing.cpp
    engines/avalanche/folktemp.cpp
    engines/avalanche/fontslid.cpp
    engines/avalanche/frere.cpp
    engines/avalanche/g-room.cpp
    engines/avalanche/golden.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/help.cpp
    engines/avalanche/help2.cpp
    engines/avalanche/helper.cpp
    engines/avalanche/hibits.cpp
    engines/avalanche/highs.cpp
    engines/avalanche/hiz.cpp
    engines/avalanche/initxf.cpp
    engines/avalanche/inputtes.cpp
    engines/avalanche/intro.cpp
    engines/avalanche/ints.cpp
    engines/avalanche/joysetup.cpp
    engines/avalanche/joystick.cpp
    engines/avalanche/loading.cpp
    engines/avalanche/logger.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/magic2.cpp
    engines/avalanche/magidraw.cpp
    engines/avalanche/magishuf.cpp
    engines/avalanche/make!.cpp
    engines/avalanche/makeregi.cpp
    engines/avalanche/makesez.cpp
    engines/avalanche/makevmou.cpp
    engines/avalanche/minstran.cpp
    engines/avalanche/newsprit.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/nimdraw.cpp
    engines/avalanche/oldfiler.cpp
    engines/avalanche/oldhighs.cpp
    engines/avalanche/oldincln.cpp
    engines/avalanche/oldtrip.cpp
    engines/avalanche/omtest.cpp
    engines/avalanche/oopmenu.cpp
    engines/avalanche/overlap.cpp
    engines/avalanche/overscro.cpp
    engines/avalanche/particle.cpp
    engines/avalanche/pictemp.cpp
    engines/avalanche/pictemp2.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/plottest.cpp
    engines/avalanche/preview1.cpp
    engines/avalanche/qintro.cpp
    engines/avalanche/qstars.cpp
    engines/avalanche/rawupd.cpp
    engines/avalanche/readsez.cpp
    engines/avalanche/reginam.cpp
    engines/avalanche/sackb1.cpp
    engines/avalanche/saving.cpp
    engines/avalanche/scr_1.cpp
    engines/avalanche/scr_2.cpp
    engines/avalanche/scr_3.cpp
    engines/avalanche/scr_4.cpp
    engines/avalanche/scr_5.cpp
    engines/avalanche/scr_9.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/setup.cpp
    engines/avalanche/seu.cpp
    engines/avalanche/seu_avvy.cpp
    engines/avalanche/sezedit.cpp
    engines/avalanche/sezunit.cpp
    engines/avalanche/sezxfr.cpp
    engines/avalanche/shell1.cpp
    engines/avalanche/shell2.cpp
    engines/avalanche/spread.cpp
    engines/avalanche/spread2.cpp
    engines/avalanche/squish.cpp
    engines/avalanche/ss_blank.cpp
    engines/avalanche/ss_clock.cpp
    engines/avalanche/stars.cpp
    engines/avalanche/status.cpp
    engines/avalanche/sticks.cpp
    engines/avalanche/sunrise.cpp
    engines/avalanche/tempo.cpp
    engines/avalanche/test.cpp
    engines/avalanche/test2.cpp
    engines/avalanche/testblit.cpp
    engines/avalanche/testcard.cpp
    engines/avalanche/testenh.cpp
    engines/avalanche/travel.cpp
    engines/avalanche/trip.cpp
    engines/avalanche/trip3.cpp
    engines/avalanche/trip42.cpp
    engines/avalanche/trip5.cpp
    engines/avalanche/trip5tst.cpp
    engines/avalanche/trip5xf.cpp
    engines/avalanche/tripoop.cpp
    engines/avalanche/ttmenuxf.cpp
    engines/avalanche/unsquish.cpp
    engines/avalanche/viewdocs.cpp
    engines/avalanche/xf_gover.cpp
    engines/avalanche/xfbutton.cpp
    engines/avalanche/xfghost.cpp
    engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
index 9748605..31c87a8 100644
--- a/engines/avalanche/1stoff.cpp
+++ b/engines/avalanche/1stoff.cpp
@@ -35,9 +35,7 @@ byte fv;
 
 void adjust() {
 	registers r;
-	;
 	{
-		;
 		ax = 0x1012;
 		bx = 1;
 		cx = 2;
@@ -51,7 +49,6 @@ void adjust() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	textattr = 0;
 	clrscr;
 
@@ -66,7 +63,6 @@ int main(int argc, const char *argv[]) {
 	output << "presents";
 
 	for (fv = 1; fv <= 77; fv ++) {
-		;
 		delay(77);
 		if (fv < 64)  fillchar(cols[1], 3, chr(fv));
 		if (fv > 14)  fillchar(cols[2], 3, chr(fv - 14));
@@ -76,7 +72,6 @@ int main(int argc, const char *argv[]) {
 	delay(100);
 
 	for (fv = 63; fv >= 1; fv --) {
-		;
 		fillchar(cols, sizeof(cols), chr(fv));
 		delay(37);
 		adjust();
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
index abc944f..ba87cd6 100644
--- a/engines/avalanche/access.cpp
+++ b/engines/avalanche/access.cpp
@@ -52,19 +52,16 @@ void int_say(string filename, boolean bubble)
 /* Internal use ONLY! */
 {
 	untyped_file f;
-	;
 	/*$I-*/
 	assign(f, filename);
 	reset(f, 1);
 	if (ioresult != 0) {
-		;
 		int_say_went_ok = false;
 		return;
 	}
 	bufsize = filesize(f);
 	blockread(f, buffer, bufsize);
 	if (bubble) {
-		;
 		bufsize += 1;
 		buffer[bufsize] = '\2';
 	}
@@ -77,7 +74,6 @@ void int_say(string filename, boolean bubble)
 }
 
 void dixi(char p, byte n) {
-	;
 	exit(153);
 	int_say(string('s') + p + strf(n) + ".raw", false);
 }
@@ -85,10 +81,8 @@ void dixi(char p, byte n) {
 void talkto(byte whom) {
 	byte fv;
 	boolean no_matches;
-	;
 	exit(153);
 	if (person == pardon) {
-		;
 		person = chr(subjnumber);
 		subjnumber = 0;
 	}
@@ -97,19 +91,16 @@ void talkto(byte whom) {
 	case pspludwick:
 
 		if ((dna.lustie_is_asleep) & (~ dna.obj[potion])) {
-			;
 			dixi('q', 68);
 			dna.obj[potion] = true;
 			objectlist;
 			points(3);
 			return;
 		} else {
-			;
 			if (dna.talked_to_crapulus)
 				switch (dna.given2spludwick) { /* Spludwick - what does he need? */
 					/* 0 - let it through to use normal routine. */
 				case RANGE_2(1, 2): {
-					;
 					display(string("Can you get me ") +
 					        get_better(spludwick_order[dna.given2spludwick]) + ", please?" +
 					        "\232\2");
@@ -117,7 +108,6 @@ void talkto(byte whom) {
 				}
 				break;
 				case 3: {
-					;
 					dixi('q', 30); /* need any help with the game? */
 					return;
 				}
@@ -129,7 +119,6 @@ void talkto(byte whom) {
 
 	case pibythneth:
 		if (dna.givenbadgetoiby) {
-			;
 			dixi('q', 33); /* Thanks a lot! */
 			return; /* And leave the proc. */
 		}
@@ -143,7 +132,6 @@ void talkto(byte whom) {
 		break;
 	case payles:
 		if (~ dna.ayles_is_awake) {
-			;
 			dixi('q', 43); /* He's fast asleep! */
 			return;
 		}
@@ -152,7 +140,6 @@ void talkto(byte whom) {
 		if (dna.geida_given_potion)
 			dna.geida_follows = true;
 		else {
-			;
 			dixi('u', 17);
 			return;
 		}
@@ -164,7 +151,6 @@ void talkto(byte whom) {
 	no_matches = true;
 	for (fv = 1; fv <= numtr; fv ++)
 		if (tr[fv].a.accinum == whom) {
-			;
 			display(string('\23') + chr(fv + 48) + '\4');
 			no_matches = false;
 			flush();
@@ -175,7 +161,6 @@ void talkto(byte whom) {
 	if (subjnumber == 0) /* For the moment... later we'll parse "say". */
 		int_say(string("ss") + strf(whom) + ".raw", true);
 	else {
-		;
 		int_say(string("ss") + strf(whom) + '-' + strf(subjnumber) + ".raw", true);
 		if (! int_say_went_ok)      /* File not found! */
 			dixi('n', whom);
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
index 3f3e32a..af3b6c3 100644
--- a/engines/avalanche/also.cpp
+++ b/engines/avalanche/also.cpp
@@ -120,7 +120,6 @@ const graphcursmasktype tthand = {
 string strf(longint x) {
 	string q;
 	string strf_result;
-	;
 	str(x, q);
 	strf_result = q;
 	return strf_result;
@@ -128,16 +127,13 @@ string strf(longint x) {
 
 void glimpse(byte ret) {     /* glimpse of screen 3 */
 	char sink;
-	;
 	hidemousecursor;
 	setvisualpage(3);
 	setcrtpagenumber(3);
 	showmousecursor;
 	do {
-		;
 	} while (!(~ anymousekeypressed));
 	do {
-		;
 	} while (!anymousekeypressed);
 	hidemousecursor;
 	setvisualpage(ret);
@@ -147,10 +143,8 @@ void glimpse(byte ret) {     /* glimpse of screen 3 */
 }
 
 void newline(byte t, integer p, integer q, integer r, integer s, byte c) {
-	;
 	{
 		linetype &with = lines[t];
-		;
 		x1 = p;
 		y1 = q;
 		x2 = r;
@@ -160,7 +154,6 @@ void newline(byte t, integer p, integer q, integer r, integer s, byte c) {
 }
 
 void newfield(byte t, integer p, integer q, integer r, integer s) {
-	;
 	{
 		fieldtype &with = fields[t];  ;
 		with.x1 = p;
@@ -171,11 +164,9 @@ void newfield(byte t, integer p, integer q, integer r, integer s) {
 }
 
 void drawped(byte p) {
-	;
 	{
 		pedtype &with = peds[p];
 		if (with.dir < 177) {
-			;
 			setcolor(p);
 			circle(with.x, with.y, 5);
 			moveto(with.x, with.y);
@@ -211,12 +202,10 @@ void drawped(byte p) {
 
 void drawup() {
 	byte fv;
-	;
 	cleardevice();
 	for (fv = 1; fv <= numlines; fv ++) {
 		linetype &with = lines[fv];
 		if (x1 != nay) {
-			;
 			setcolor(with.col);
 			line(x1, y1, x2, y2);
 		}
@@ -224,7 +213,6 @@ void drawup() {
 	for (fv = 1; fv <= numlines; fv ++) {
 		fieldtype &with = fields[fv];
 		if (with.x1 != nay) {
-			;
 			setcolor(fv);
 			rectangle(with.x1, with.y1, with.x2, with.y2);
 		}
@@ -234,7 +222,6 @@ void drawup() {
 
 void addped() {
 	byte n, fv;
-	;
 	n = 0;
 	do {
 		n += 1;
@@ -252,7 +239,6 @@ void addped() {
 	hidemousecursor;
 	{
 		pedtype &with = peds[n];
-		;
 		with.x = mousex;
 		with.y = mousey;
 	}
@@ -301,12 +287,10 @@ void addped() {
 
 void addline(byte ccc) {
 	byte fv;
-	;
 	do {
 		for (fv = 1; fv <= numlines; fv ++) {
 			linetype &with = lines[fv];
 			if (x1 == nay) {
-				;
 				x1 = fv * 17;
 				x2 = x1;
 				y1 = 200;
@@ -321,20 +305,17 @@ void addline(byte ccc) {
 byte colour() {
 	byte fv;
 	byte colour_result;
-	;
 	setactivepage(0);
 	setvisualpage(0);
 	setcrtpagenumber(0);
 	outtextxy(0, 0, "Select a colour, please...");
 	for (fv = 1; fv <= 15; fv ++) {
-		;
 		setfillstyle(1, fv);
 		bar(fv * 40, 27, 39 + fv * 40, 200);
 	}
 	showmousecursor;
 	do {
 		if (rightmousekeypressed)  {
-			;
 			hidemousecursor;
 			return colour_result;
 		}
@@ -349,7 +330,6 @@ byte colour() {
 void addfield() {
 	byte fv;
 	boolean ok;
-	;
 	do {
 		fv = colour();
 		ok = fields[fv].x1 == nay;
@@ -357,7 +337,6 @@ void addfield() {
 	} while (!ok);
 	{
 		fieldtype &with = fields[fv];
-		;
 		with.x1 = 300 + fv * 17;
 		with.x2 = with.x1 + 1;
 		with.y1 = 200;
@@ -368,7 +347,6 @@ void addfield() {
 byte checkline() {
 	byte fv, ans;
 	byte checkline_result;
-	;
 	setgraphicscursor(crosshairs);
 	setcrtpagenumber(0);
 	setactivepage(0);
@@ -378,7 +356,6 @@ byte checkline() {
 		showmousecursor;
 		do {
 			if (rightmousekeypressed)  {
-				;
 				checkline_result = 255;
 				return checkline_result;
 			}
@@ -388,11 +365,9 @@ byte checkline() {
 		setactivepage(1);
 		ans = 177;
 		for (fv = 1; fv <= numlines; fv ++) { /*  */
-			;
 			{
 				linetype &with = lines[fv];
 				if (x1 != nay) {
-					;
 					setcolor(9);
 					line(x1, y1, x2, y2);
 					if (getpixel(mousex, mousey) == 9)  ans = fv;
@@ -403,7 +378,6 @@ byte checkline() {
 			{
 				fieldtype &with = fields[fv];
 				if (with.x1 != nay) {
-					;
 					setcolor(9);
 					rectangle(with.x1, with.y1, with.x2, with.y2);
 					if (getpixel(mousex, mousey) == 9)  ans = fv + 100;
@@ -422,7 +396,6 @@ void chooseside();
 static boolean itsaline;
 
 static void plotline() {
-	;
 	if (itsaline) {
 		linetype &with = lines[gd];
 		if (do1)  line(mousex, mousey, x2, y2);
@@ -440,12 +413,10 @@ void chooseside() {
 	byte clicol, savelcol;
 	fieldtype current;
 	integer temp;
-	;
 	do {
 		gd = checkline();
 		itsaline = gd < 100;
 		if (gd == 255)  {
-			;
 			hidemousecursor;
 			return;
 		}
@@ -456,12 +427,10 @@ void chooseside() {
 		setgraphicscursor(tthand);
 		setcrtpagenumber(2);
 		if (itsaline) {
-			;
 			current = lines[gd];
 			savelcol = lines[gd].col;
 		} else current = fields[gd];
 		{
-			;
 			setcolor(9);
 			if (itsaline)  line(current.x1, current.y1, current.x2, current.y2);
 			else rectangle(current.x1, current.y1, current.x2, current.y2);
@@ -471,19 +440,16 @@ void chooseside() {
 			setfillstyle(1, green);
 			bar(current.x2 - 3, current.y2 - 3, current.x2 + 3, current.y2 + 3);
 			do {
-				;
 			} while (!(~ anymousekeypressed));
 			clicol = 177;
 			showmousecursor;
 			do {
 				if (anymousekeypressed) {
-					;
 					hidemousecursor;
 					clicol = getpixel(mousex, mousey);
 					showmousecursor;
 				}
 				if (rightmousekeypressed) {
-					;
 					hidemousecursor;
 					return;
 				}
@@ -507,14 +473,12 @@ void chooseside() {
 			}
 			setwritemode(xorput);
 			while (~ anymousekeypressed) {
-				;
 				plotline();
 				showmousecursor;
 				delay(1);
 				hidemousecursor;
 				plotline();
 				if (rightmousekeypressed)  {
-					;
 					hidemousecursor;
 					return;
 				}
@@ -522,24 +486,19 @@ void chooseside() {
 			}
 			/* update "current" rec */
 			if (do1)  {
-				;
 				current.x1 = mousex;
 				current.y1 = mousey;
 			} else {
-				;
 				current.x2 = mousex;
 				current.y2 = mousey;
 			}
 			if (! itsaline) {
-				;
 				if (current.x1 > current.x2)  {
-					;
 					temp = current.x2;
 					current.x2 = current.x1;
 					current.x1 = temp;
 				}
 				if (current.y1 > current.y2)  {
-					;
 					temp = current.y2;
 					current.y2 = current.y1;
 					current.y1 = temp;
@@ -548,7 +507,6 @@ void chooseside() {
 			/* copy "current" to line/field */
 			if (itsaline) {
 				linetype &with1 = lines[gd];
-				;
 				current.x1 = current.x1;
 				current.x2 = current.x2;
 				current.y1 = current.y1;
@@ -561,7 +519,6 @@ void chooseside() {
 }
 
 void delped() {
-	;
 	setcrtpagenumber(0);
 	setactivepage(0);
 	setvisualpage(0);
@@ -569,7 +526,6 @@ void delped() {
 	setgraphicscursor(tthand);
 	showmousecursor;
 	do {
-		;
 	} while (!leftmousekeypressed);
 	peds[colour()].dir = 177;
 }
@@ -577,7 +533,6 @@ void delped() {
 byte menu();
 
 static void say(byte y, string x) {
-	;
 	setfillstyle(1, y);
 	bar(0, y * 17, 100, y * 17 + 15);
 	outtextxy(123, y * 17, x);
@@ -586,7 +541,6 @@ static void say(byte y, string x) {
 byte menu() {
 	byte clicol;
 	byte menu_result;
-	;
 	setcolor(15);
 	settextstyle(0, 0, 2);
 	clicol = 0;
@@ -605,20 +559,17 @@ byte menu() {
 	showmousecursor;
 	do {
 		if (leftmousekeypressed) {
-			;
 			hidemousecursor;
 			clicol = getpixel(mousex, mousey);
 			showmousecursor;
 		}
 		if (rightmousekeypressed)  {
-			;
 			hidemousecursor;
 			return menu_result;
 		}
 		if (keypressed())  glimpse(2);
 	} while (!(clicol > 0));
 	do {
-		;
 	} while (!(~ anymousekeypressed));
 	hidemousecursor;
 	menu_result = clicol;
@@ -626,10 +577,8 @@ byte menu() {
 }
 
 void removeline() {
-	;
 	gd = checkline();
 	if (gd == 255)  {
-		;
 		hidemousecursor;
 		return;
 	}
@@ -641,7 +590,6 @@ void removeline() {
 }
 
 void lino() {
-	;
 	resetmouse;
 	do {
 		switch (menu()) {
@@ -674,14 +622,12 @@ void loadscreen() {   /* load2 */
 	byte a /*absolute $A000:246560*/;
 	byte bit;
 	untyped_file f;
-	;
 	setactivepage(3);
 	setvisualpage(3);
 	assign(f, string("c:\\avalot\\place") + n + ".avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -697,7 +643,6 @@ void loadscreen() {   /* load2 */
 void ctrlsout(string &x) {        /* Replace real ctrls with caret codes */
 	byte fv;
 	string xx;
-	;
 	xx = "";
 	for (fv = 1; fv <= length(x); fv ++)
 		if (x[fv] > '\37')  xx = xx + x[fv];
@@ -709,12 +654,10 @@ void ctrlsin(string &x) {        /* Opposite of ctrlsout */
 	byte fv;
 	string xx;
 	boolean ctrlwas;
-	;
 	xx = "";
 	ctrlwas = false;
 	for (fv = 1; fv <= length(x); fv ++)
 		if (ctrlwas) {  /* last char was a caret */
-			;
 			xx = xx + chr(ord(upcase(x[fv])) - 64);
 			ctrlwas = false;
 		} else {
@@ -728,7 +671,6 @@ void ctrlsin(string &x) {        /* Opposite of ctrlsout */
 
 void flipover() {   /* temp view other screen */
 	char r;
-	;
 	setvisualpage(3);
 	r = readkey();
 	setvisualpage(0);
@@ -736,7 +678,6 @@ void flipover() {   /* temp view other screen */
 
 void plotchar(byte x, byte y, char n) {
 	byte fv;
-	;
 	if (chars[x][y] == n)  return;
 	for (fv = 0; fv <= 15; fv ++)
 		mem[0xa000 * y * 1200 + (fv + 3) * 80 + x] = skinny[ord(n)][fv];
@@ -745,7 +686,6 @@ void plotchar(byte x, byte y, char n) {
 
 void cursor() {
 	byte fv;
-	;
 	cursorflash += 1;
 	switch (cursorflash) {
 	case 1:
@@ -760,9 +700,7 @@ void cursor() {
 }
 
 void losecursor() {
-	;
 	if (cursorflash < 127)  {
-		;
 		cursorflash = 126;
 		cursor();
 	}
@@ -771,13 +709,10 @@ void losecursor() {
 
 void gwrite(string x) {
 	byte fv;
-	;
 	for (fv = 1; fv <= length(x); fv ++) {
-		;
 		plotchar(tx, ty, x[fv]);
 		tx += 1;
 		if (tx == 80)  {
-			;
 			ty += 1;
 			tx = 0;
 		}
@@ -789,7 +724,6 @@ string typein(string x) {
 	byte p;
 	char r;
 	string typein_result;
-	;
 	setvisualpage(0);
 	setactivepage(0);
 	cleardevice();
@@ -812,7 +746,6 @@ string typein(string x) {
 		tx = (p % 80);
 		ty = (p / 80) + 6;
 		while (! keypressed())  {
-			;
 			delay(1);
 			cursor();
 		}
@@ -821,7 +754,6 @@ string typein(string x) {
 		switch (r) {
 		case '\10':
 			if (p > 0)  {
-				;
 				x = copy(x, 1, p - 1) + copy(x, p + 1, 255);
 				p -= 1;
 			}
@@ -830,7 +762,6 @@ string typein(string x) {
 			flipover();
 			break;
 		case '\40' ... '\377': {
-			;
 			x = copy(x, 1, p) + r + copy(x, p + 1, 255);
 			p += 1;
 		}
@@ -873,7 +804,6 @@ byte typeno(string title) {
 	integer e;
 	word p;
 	byte typeno_result;
-	;
 	cleardevice();
 	x = "000";
 	settextstyle(0, 0, 3);
@@ -889,7 +819,6 @@ byte typeno(string title) {
 			r = readkey();
 		} while (!(set::of(range('0', '9'), '\33', '\15', eos).has(r)));
 		if (r == '\33')  {
-			;
 			typeno_result = 255;
 			return typeno_result;
 		}
@@ -904,7 +833,6 @@ void showallnames() {
 	byte fv;
 	varying_string<2> s;
 	char r;
-	;
 	settextstyle(0, 0, 2);
 	cleardevice();
 	setcolor(13);
@@ -912,7 +840,6 @@ void showallnames() {
 	settextstyle(0, 0, 1);
 	setcolor(7);
 	for (fv = 1; fv <= 29; fv ++) {
-		;
 		str(fv, 2, s);
 		outtextxy((fv / 15) * 320, ((fv % 15) * 10) + 30, s + '=' + copy(names[fv][1], 0, 33));
 	}
@@ -925,7 +852,6 @@ void showallassoc();
 
 
 static void saascreen() {
-	;
 	settextstyle(0, 0, 2);
 	cleardevice();
 	setcolor(10);
@@ -940,15 +866,12 @@ void showallassoc() {
 	varying_string<2> s;
 	char r;
 
-	;
 	saascreen();
 	for (fv = 1; fv <= 30; fv ++) {
-		;
 		str(fv - 1, 2, s);
 		outtextxy(0, (((fv - 1) % 10) * 10) + 30,
 		          s + ':' + copy(names[fv - 1][1], 1, 7) + ':' + copy(names[fv - 1][2], 1, 70));
 		if ((fv % 10) == 0)  {
-			;
 			r = readkey();
 			saascreen();
 		}
@@ -960,10 +883,8 @@ void showallassoc() {
 
 void clear() {
 	byte fv;
-	;
 	fillchar(names , sizeof(names),  '\0');
 	for (fv = 1; fv <= numlines; fv ++) {
-		;
 		lines[fv].x1 = nay;
 		fields[fv].x1 = nay;
 	}
@@ -974,14 +895,12 @@ void scramble();
 
 static void scram1(string &x) {
 	byte fz;
-	;
 	for (fz = 1; fz <= length(x); fz ++)
 		x[fz] = chr(ord(x[fz]) ^ 177);
 }
 
 void scramble() {   /* Works both ways. */
 	byte fv, ff;
-	;
 	for (fv = 0; fv <= 29; fv ++)
 		for (ff = 1; ff <= 2; ff ++)
 			scram1(names[fv][ff]);
@@ -993,7 +912,6 @@ void save() {
 	string x;
 	untyped_file f;
 	byte minnames, minlines, minpeds, minfields, fv, ff;
-	;
 	minnames = 0;
 	for (fv = 0; fv <= 29; fv ++) if (names[fv][1] != "")     minnames = fv;
 	minlines = 0;
@@ -1036,7 +954,6 @@ static string nextstring() {
 	byte l;
 	string x;
 	string nextstring_result;
-	;
 	x = "";
 	blockread(f, l, 1);
 	blockread(f, x[1], l);
@@ -1049,7 +966,6 @@ void load() {
 	byte minnames, minlines, minpeds, minfields;
 	byte ff, fv;
 
-	;
 	clear();
 	assign(f, string("c:\\avalot\\also") + n + ".avd");
 	/*$I-*/ reset(f, 1); /*$I+*/ if (ioresult != 0)  return; /* no Also file */
@@ -1081,60 +997,50 @@ static integer y;
 
 static void display() {
 	byte fv;
-	;
 	cleardevice();
 	settextstyle(0, 0, 2);
 	setcolor(15);
 	outtextxy(0, 0, "Magics.");
 	settextstyle(0, 0, 1);
 	for (fv = 1; fv <= 15; fv ++) {
-		;
 		y = 23 + fv * 10;
 		setcolor(fv);
 		outtextxy(100, y, string('$') + codes[fv - 1]);
 		{
 			magictype &with = magics[fv];
-			;
 			switch (with.op) {
 			case nix: {
-				;
 				setcolor(8);
 				outtextxy(140, y, "Nix");
 			}
 			break;
 			case bounce: {
-				;
 				setcolor(10);
 				outtextxy(143, y, "Bounce!");
 			}
 			break;
 			case exclaim: {
-				;
 				setcolor(14);
 				outtextxy(143, y, string("Exclaim: ") + strf(with.data));
 			}
 			break;
 			case transport: {
-				;
 				setcolor(12);
 				outtextxy(143, y, string("Transport to ") + strf(hi(with.data)) +
 				          ", ped " + strf(lo(with.data)));
 			}
 			break;
 			case unfinished: {
-				;
 				setcolor(15);
 				outtextxy(143, y, "*** UNFINISHED! ***");
 			}
 			break;
 			case special: {
-				;
 				setcolor(6);
 				outtextxy(143, y, string("Special call no. ") + strf(with.data));
 			}
 			break;
 			case opendoor: {
-				;
 				setcolor(11);
 				outtextxy(143, y, string("Opening door to ") + strf(hi(with.data)) +
 				          ", ped " + strf(lo(with.data)));
@@ -1153,7 +1059,6 @@ static word ask(string x) {
 	word thomaswashere;
 	integer e;
 	word ask_result;
-	;
 	cleardevice();
 	setcolor(10);
 	settextstyle(0, 0, 3);
@@ -1170,7 +1075,6 @@ void editmagics() {
 	char r, rr;
 	byte p;
 
-	;
 	do {
 		display();
 		do {
@@ -1199,13 +1103,11 @@ void editmagics() {
 				with.op = bounce;
 				break;
 			case 'E': {
-				;
 				with.op = exclaim;
 				with.data = ask("Which scroll?");
 			}
 			break;
 			case 'T': {
-				;
 				with.op = transport;
 				with.data = ask("Ped no.?") + ask("Whither?") * 256;
 			}
@@ -1214,13 +1116,11 @@ void editmagics() {
 				with.op = unfinished;
 				break;
 			case 'S': {
-				;
 				with.op = special;
 				with.data = ask("Which call?");
 			}
 			break;
 			case 'O': {
-				;
 				with.op = opendoor;
 				with.data = ask("Ped no.?") + ask("Whither?") * 256;
 			}
@@ -1238,54 +1138,45 @@ static integer y2;
 
 static void display1() {
 	byte fv;
-	;
 	cleardevice();
 	settextstyle(0, 0, 2);
 	setcolor(15);
 	outtextxy(0, 0, "Portals.");
 	settextstyle(0, 0, 1);
 	for (fv = 9; fv <= 15; fv ++) {
-		;
 		y2 = fv * 10 - 53;
 		setcolor(fv);
 		outtextxy(100, y2, string('$') + codes1[fv - 1]);
 		{
 			magictype &with = portals[fv];
-			;
 			switch (with.op) {
 			case nix: {
-				;
 				setcolor(8);
 				outtextxy(140, y2, "Nix");
 			}
 			break;
 			case exclaim: {
-				;
 				setcolor(14);
 				outtextxy(143, y2, string("Exclaim: ") + strf(with.data));
 			}
 			break;
 			case transport: {
-				;
 				setcolor(12);
 				outtextxy(143, y2, string("Transport to ") + strf(hi(with.data)) +
 				          ", ped " + strf(lo(with.data)));
 			}
 			break;
 			case unfinished: {
-				;
 				setcolor(15);
 				outtextxy(143, y2, "*** UNFINISHED! ***");
 			}
 			break;
 			case special: {
-				;
 				setcolor(6);
 				outtextxy(143, y2, string("Special call no. ") + strf(with.data));
 			}
 			break;
 			case opendoor: {
-				;
 				setcolor(11);
 				outtextxy(143, y2, string("Opening door to ") + strf(hi(with.data)) +
 				          ", ped " + strf(lo(with.data)));
@@ -1304,7 +1195,6 @@ static word ask1(string x) {
 	word thomaswashere;
 	integer e;
 	word ask1_result;
-	;
 	cleardevice();
 	setcolor(10);
 	settextstyle(0, 0, 3);
@@ -1321,7 +1211,6 @@ void editportals() {   /* much t'same as editmagics */
 	char r, rr;
 	byte p;
 
-	;
 	do {
 		display1();
 		do {
@@ -1348,13 +1237,11 @@ void editportals() {   /* much t'same as editmagics */
 				with.op = nix;
 				break;
 			case 'E': {
-				;
 				with.op = exclaim;
 				with.data = ask1("Which scroll?");
 			}
 			break;
 			case 'T': {
-				;
 				with.op = transport;
 				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
 			}
@@ -1363,13 +1250,11 @@ void editportals() {   /* much t'same as editmagics */
 				with.op = unfinished;
 				break;
 			case 'S': {
-				;
 				with.op = special;
 				with.data = ask1("Which call?");
 			}
 			break;
 			case 'O': {
-				;
 				with.op = opendoor;
 				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
 			}
@@ -1381,7 +1266,6 @@ void editportals() {   /* much t'same as editmagics */
 
 void editflags() {
 	char r;
-	;
 	cleardevice();
 	settextstyle(0, 0, 2);
 	setcolor(15);
@@ -1400,7 +1284,6 @@ void editflags() {
 		} while (!(set::of(range('A', 'Z'), '\33', '\15', '\11', eos).has(r)));
 		switch (r) {
 		case RANGE_26('A', 'Z'): {
-			;
 			if (pos(r, flags) > 0) {
 				;     /* flag is on- switch it off */
 				Delete(flags, pos(r, flags), 1);
@@ -1432,7 +1315,6 @@ void editflags() {
 void alsomenu() {
 	char r;
 	byte t;
-	;
 	do {
 		setactivepage(0);
 		setvisualpage(0);
@@ -1463,7 +1345,6 @@ void alsomenu() {
 		} while (!(set::of(range('1', '9'), 'S', 'L', '\0', eos).has(r)));
 		switch (r) {
 		case '1': {
-			;
 			do {
 				t = typeno("Which object\? (0-30)");
 			} while (!((t < 30) || (t == 255)));
@@ -1510,7 +1391,6 @@ void alsomenu() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	output << "*** ALSO ***" << NL;
 	output << NL;
 	output << "No. of screen to edit?";
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
index b57585d..74b5967 100644
--- a/engines/avalanche/andexor.cpp
+++ b/engines/avalanche/andexor.cpp
@@ -56,7 +56,6 @@ void load(string nam) {
 	varying_string<40> xxx;
 	string check;
 
-	;
 	assign(f, nam);
 	reset(f, 1);
 	blockread(f, xxx, 41);
@@ -64,7 +63,6 @@ void load(string nam) {
 	blockread(f, check, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(a[z], s);
 		blockread(f, a[z], s);
 		putimage(0, 15 + (z - 1) * 75, a[z], 0);
@@ -75,7 +73,6 @@ void load(string nam) {
 
 void silhouette() {
 	byte x, y, c;
-	;
 	setvisualpage(1);
 	setactivepage(1);
 	setfillstyle(1, 15);
@@ -85,7 +82,6 @@ void silhouette() {
 			/*   bar((gm div 2)*320+gd*40,20+(gm mod 2)*40,(gm div 2)*320+gd*40+35,(gm mod 2)*40+60); */
 			for (y = 1; y <= adx.yl; y ++)
 				for (x = 1; x <= adx.xl; x ++) {
-					;
 					setactivepage(0);
 					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
 					setactivepage(1);
@@ -101,7 +97,6 @@ void silhouette() {
 
 void standard() {
 	byte x, y, c;
-	;
 	setvisualpage(2);
 	setactivepage(2);
 	for (gm = 0; gm <= 3; gm ++)
@@ -109,7 +104,6 @@ void standard() {
 			;     /* 26,15 */
 			for (y = 1; y <= adx.yl; y ++)
 				for (x = 1; x <= adx.xl; x ++) {
-					;
 					setactivepage(0);
 					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
 					setactivepage(2);
@@ -124,7 +118,6 @@ void standard() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -133,7 +126,6 @@ int main(int argc, const char *argv[]) {
 	/* getmem(adxpic[1,1,1],adx.size); getimage(40,20,75,60,adxpic[1,1,1]^);
 	 putimage(100,100,adxpic[1,1,1]^,0); */
 	{
-		;
 		adx.name = "Avalot";
 		adx.num = 24;
 		adx.seq = 6;
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
index 605a185..27c62cf 100644
--- a/engines/avalanche/andexor2.cpp
+++ b/engines/avalanche/andexor2.cpp
@@ -59,7 +59,6 @@ void load(string n) {
 	varying_string<40> xxx;
 	string check;
 
-	;
 	assign(f, n);
 	reset(f, 1);
 	blockread(f, xxx, 41);
@@ -67,7 +66,6 @@ void load(string n) {
 	blockread(f, check, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(a[z], s);
 		blockread(f, a[z], s);
 		putimage(0, 15 + (z - 1) * 75, a[z], 0);
@@ -78,19 +76,16 @@ void load(string n) {
 
 void silhouette() {
 	byte x, y, c;
-	;
 	setvisualpage(1);
 	setactivepage(1);
 	setfillstyle(1, 15);
 	{
-		;
 		for (gm = 0; gm <= 3; gm ++)
 			for (gd = 1; gd <= 6; gd ++) {
 				;     /* 26,15 */
 				side2 = adx.xl * 6;
 				for (y = 1; y <= adx.yl; y ++)
 					for (x = 1; x <= adx.xl; x ++) {
-						;
 						setactivepage(0);
 						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
 						setactivepage(1);
@@ -107,17 +102,14 @@ void silhouette() {
 
 void standard() {
 	byte x, y, c;
-	;
 	setvisualpage(2);
 	setactivepage(2);
 	{
-		;
 		for (gm = 0; gm <= 3; gm ++)
 			for (gd = 1; gd <= 6; gd ++) {
 				;     /* 26,15 */
 				for (y = 1; y <= adx.yl; y ++)
 					for (x = 1; x <= adx.xl; x ++) {
-						;
 						setactivepage(0);
 						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
 						setactivepage(2);
@@ -137,14 +129,12 @@ void standard() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
 	fillchar(adxpic, sizeof(adxpic), '\261');
 	load("v:avalots.avd");
 	{
-		;
 		adx.name = "Avalot";
 		adx.num = 24;
 		adx.seq = 6;
@@ -164,7 +154,6 @@ int main(int argc, const char *argv[]) {
 	blockwrite(f, adx, sizeof(adx));
 	blockwrite(f, bigsize, 2);
 	for (gm = 0; gm <= 1; gm ++) {
-		;
 		putimage(0, 0, adxpic[gm], 0);
 		blockwrite(f, adxpic[gm], bigsize); /* next image */
 	}
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
index b5e1d9a..39ba3df 100644
--- a/engines/avalanche/andextst.cpp
+++ b/engines/avalanche/andextst.cpp
@@ -41,21 +41,18 @@ integer x;
 array<0, 1, integer> ox;
 
 void andex(integer x, integer y, byte n, byte num) {
-	;
 	putimage(x, y, adx[num][n][0], andput);
 	putimage(x, y, adx[num][n][1], xorput);
 }
 
 void loadadx(byte num, string x) {
 	byte n;
-	;
 	assign(f, x);
 	reset(f, 1);
 	seek(f, 59);
 	blockread(f, n, 1); /* No. of images... */
 	for (gd = 1; gd <= n; gd ++)
 		for (gm = 0; gm <= 1; gm ++) {
-			;
 			blockread(f, s, 2); /* size of next image... */
 			getmem(adx[num][gd][gm], s);
 			blockread(f, adx[num][gd][gm], s); /* next image */
@@ -65,14 +62,12 @@ void loadadx(byte num, string x) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	loadadx(0, "d:sprite0.avd");
 	loadadx(1, "d:sprite0.avd");
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
 	for (gd = 0; gd <= 1; gd ++) {
-		;
 		setactivepage(gd);
 		setfillstyle(6, 1);
 		bar(0, 0, 640, 200);
@@ -87,7 +82,6 @@ int main(int argc, const char *argv[]) {
 		setactivepage(cp);
 		setvisualpage(1 - cp);
 		for (gm = 0; gm <= 1; gm ++) {
-			;
 			if (t > 0)  t -= 1;
 			else
 				putimage(ox[cp], 77, back[cp], copyput);
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
index 2172a57..1f0e1a4 100644
--- a/engines/avalanche/arch.cpp
+++ b/engines/avalanche/arch.cpp
@@ -97,13 +97,11 @@ void save(string name) {
 	edhead eh;
 	word groi;
 	string groi2;
-	;
 	fillchar(eh, sizeof(eh), '\261'); /* Fill up the edhead */
 
 	dna.saves += 1; /* It's been saved one more time... */
 
 	{
-		;
 
 		/* Info about this program */
 
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
index 7ab2630..2bb6288 100644
--- a/engines/avalanche/avbkgrnd.cpp
+++ b/engines/avalanche/avbkgrnd.cpp
@@ -33,7 +33,6 @@ namespace Avalanche {
 integer gd, gm;
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
index f91435f..8e08760 100644
--- a/engines/avalanche/avvyans.cpp
+++ b/engines/avalanche/avvyans.cpp
@@ -39,7 +39,6 @@ string x;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -63,18 +62,14 @@ int main(int argc, const char *argv[]) {
 	*/
 	for (gm = 0; gm <= 17; gm ++)
 		for (gd = 0; gd <= 27; gd ++) {
-			;
 			gotoxy(gd + 1, gm + 1);
 			if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
-				;
 				textattr = cols[gd][2 * gm];
 				output << 'Û';
 			} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
-				;
 				textattr = cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16;
 				output << 'ß';
 			} else {
-				;
 				textattr = cols[gd][2 * gm] * 16 + cols[gd][2 * gm + 1];
 				if (textattr > blink)  textattr -= blink;
 				output << 'Ü';
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
index a4fb34a..fe238b3 100644
--- a/engines/avalanche/avvyans2.cpp
+++ b/engines/avalanche/avvyans2.cpp
@@ -43,7 +43,6 @@ byte cfg, cbg; /* Current foreground & background. */
 byte ofg, obg; /* Old fg & bg. */
 
 void do_spaces() {
-	;
 	if (spaces == 0)  return;
 	along(spaces);
 	spaces = 0;
@@ -53,17 +52,14 @@ void finishline();
 static byte wx, wy;
 
 static void jumpto(byte xx) {
-	;
 	along(xx - wx);
 }
 
 void finishline() {
-	;
 	wx = 29 - spaces;
 	wy = gm + 1;
 	switch (wy) {
 	case 1: {
-		;
 		sgr(7);
 		jumpto(35);
 		output << "Back in good old A.D. ";
@@ -75,20 +71,16 @@ void finishline() {
 	}
 	break;
 	case RANGE_5(3, 7): {
-		;
 		t >> x >> NL;
 		while (x[length(x)] == '\40')  x[0] -= 1;
 		if (x != "") {
-			;
 			jumpto(30);
 			sgr(9);
 			spaces = 0;
 			while (x != "") {
-				;
 				if (x[1] == ' ')
 					spaces += 1;
 				else {
-					;
 					do_spaces();
 					output << x[1];
 				}
@@ -100,7 +92,6 @@ void finishline() {
 	}
 	break;
 	case 8: {
-		;
 		jumpto(67);
 		sgr(9);
 		output << "d'Argent" << NL;
@@ -108,42 +99,36 @@ void finishline() {
 	}
 	break;
 	case 11: {
-		;
 		jumpto(37);
 		sgr(14);
 		output << "He's back..." << NL;
 	}
 	break;
 	case 13: {
-		;
 		jumpto(47);
 		sgr(14);
 		output << "And this time," << NL;
 	}
 	break;
 	case 14: {
-		;
 		jumpto(52);
 		sgr(14);
 		output << "he's wearing tights..." << NL;
 	}
 	break;
 	case 16: {
-		;
 		jumpto(35);
 		sgr(4);
 		output << "A Thorsoft of Letchworth game. * Requires EGA" << NL;
 	}
 	break;
 	case 17: {
-		;
 		jumpto(37);
 		sgr(4);
 		output << "and HD. * By Mike, Mark and Thomas Thurman." << NL;
 	}
 	break;
 	case 18: {
-		;
 		jumpto(39);
 		sgr(4);
 		output << "Sfx archive- ";
@@ -162,7 +147,6 @@ void finishline() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -187,43 +171,34 @@ int main(int argc, const char *argv[]) {
 	reset(t);
 
 	for (gm = 0; gm <= 17; gm ++) {
-		;
 		spaces = 0;
 		for (gd = 0; gd <= 27; gd ++) {
-			;
 			if ((gd == 22) && (gm == 4)) {
-				;
 				do_spaces();
 				sgr(red);
 				output << 'ß';
 			} else {
-				;
 				if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
-					;
 					if (cols[gd][2 * gm] == 0)
 						spaces += 1; /* a blank space */
 					else {
-						;
 						do_spaces();
 
 						if (cfg == cols[gd][2 * gm])  output << 'Û';
 						else if (cbg == cols[gd][2 * gm])  output << ' ';
 						else {
-							;
 							sgr((cols[gd][2 * gm]) + (cbg * 16));
 							cfg = cols[gd][2 * gm];
 							output << 'Û';
 						}
 					}
 				} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
-					;
 					do_spaces();
 					sgr(cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16);
 					cfg = cols[gd][2 * gm];
 					cbg = cols[gd][2 * gm + 1] * 16;
 					output << 'ß';
 				} else {
-					;
 					do_spaces();
 
 					ofg = cfg;
@@ -232,12 +207,10 @@ int main(int argc, const char *argv[]) {
 					cfg = cols[gd][2 * gm + 1];
 
 					if ((cbg == ofg) && (cfg == obg)) {
-						;
 						n = cfg * 16 + cbg;
 						if (n > 128)  n -= 128;
 						output << 'ß';
 					} else {
-						;
 						n = cbg * 16 + cfg;
 						if (n > 128)  n -= 128;
 						if ((cfg != ofg) || (cbg != obg))  sgr(n);
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
index 4f150e3..b29072f 100644
--- a/engines/avalanche/avvymonk.cpp
+++ b/engines/avalanche/avvymonk.cpp
@@ -44,7 +44,6 @@ void savesc() {
 	word s;
 	varying_string<14> nam;
 	varying_string<30> screenname;
-	;
 	nam = "v:avvymonk.avd";
 	adf = string("aved as a stuff file, so there! TJAT.") + '\15' + '\12' + '\32';
 	adf[0] = 'S';
@@ -56,7 +55,6 @@ void savesc() {
 	blockwrite(f, screenname, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(c[z], s);
 		getimage(0, 15 + (z - 1) * 75, getmaxx(), 15 + (z) * 75, c[z]);
 		blockwrite(f, c[z], s);
@@ -64,7 +62,6 @@ void savesc() {
 	}
 }
 void loadscreen(string nam) {
-	;
 	assign(f, nam);
 	reset(f, 1);
 	blockread(f, check, 41);
@@ -72,7 +69,6 @@ void loadscreen(string nam) {
 	blockread(f, check, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(a[z], s);
 		blockread(f, a[z], s);
 		setactivepage(0);
@@ -83,7 +79,6 @@ void loadscreen(string nam) {
 }
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	x = 0;
@@ -91,7 +86,6 @@ int main(int argc, const char *argv[]) {
 	initgraph(gd, gm, "o:");
 	loadscreen("v:legion.avd");
 	while (y < 100) {
-		;
 		switch (getpixel(x, y)) {
 		case 7:
 			putpixel(x, y, 0);
@@ -105,7 +99,6 @@ int main(int argc, const char *argv[]) {
 		}
 		x += 1;
 		if (x > 640)  {
-			;
 			y += 1;
 			x = 0;
 		}
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
index 9059447..add3613 100644
--- a/engines/avalanche/bootstrp.cpp
+++ b/engines/avalanche/bootstrp.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -39,21 +39,23 @@ const integer run_dosshell = 2;
 const integer run_ghostroom = 3;
 const integer run_golden = 4;
 
-const array<false,true,varying_string<2> > runcodes = {{"et","Go"}};
+const array<false, true, varying_string<2> > runcodes = {{"et", "Go"}};
 
 const integer reset_ = 0;
 
-const boolean jsb = true;  const boolean no_jsb = false;
-const boolean bflight = true; const boolean no_bflight = false;
+const boolean jsb = true;
+const boolean no_jsb = false;
+const boolean bflight = true;
+const boolean no_bflight = false;
 
 
 struct {
-          byte operation;
-          word skellern;
-          array<1,10000,byte> contents;
+	byte operation;
+	word skellern;
+	array<1, 10000, byte> contents;
 } storage;
 
-string arguments,demo_args,args_with_no_filename;
+string arguments, demo_args, args_with_no_filename;
 
 boolean first_time;
 
@@ -64,314 +66,339 @@ string segofs;
 
 boolean zoomy;
 
-longint soundcard,speed,baseaddr,irq,dma;
+longint soundcard, speed, baseaddr, irq, dma;
 
-void cursor_off()     /*assembler; */
-{;
-/* asm
- mov ah,01; { Change cursor size. */
-/* mov cx,8224; { CH & CL are now 32. */
-/* int $10;  { Call the Bios */
+void cursor_off() {   /*assembler; */
+	;
+	/* asm
+	 mov ah,01; { Change cursor size. */
+	/* mov cx,8224; { CH & CL are now 32. */
+	/* int $10;  { Call the Bios */
 
 }    /* That's all. */
 
-void cursor_on()     /*assembler; */
-{;
-/*
-asm
- mov ah,01; { Change cursor size. */
-/* mov ch,5;  { Top line is 5. */
-/* mov cl,7;  { Bottom line is 7. */
-/* int $10;   { Call the Bios. */
+void cursor_on() {   /*assembler; */
+	;
+	/*
+	asm
+	 mov ah,01; { Change cursor size. */
+	/* mov ch,5;  { Top line is 5. */
+	/* mov cl,7;  { Bottom line is 7. */
+	/* int $10;   { Call the Bios. */
 
 }
 
-void quit()
-{
- cursor_on();
- exit(0);
+void quit() {
+	cursor_on();
+	exit(0);
 }
 
-string strf(longint x)
-{
-    string q;
-string strf_result;
-;
- str(x,q); strf_result=q;
-return strf_result;
+string strf(longint x) {
+	string q;
+	string strf_result;
+	;
+	str(x, q);
+	strf_result = q;
+	return strf_result;
 }
 
-string command_com()
-{
-    string temp;
+string command_com() {
+	string temp;
 
- string command_com_result;
- temp=getenv("comspec");
- if (temp=="") 
-  output << "avvy_bootstrap: COMSPEC not defined, => cannot run Dos shell." << NL;
- command_com_result=temp;
- return command_com_result;
+	string command_com_result;
+	temp = getenv("comspec");
+	if (temp == "")
+		output << "avvy_bootstrap: COMSPEC not defined, => cannot run Dos shell." << NL;
+	command_com_result = temp;
+	return command_com_result;
 }
 
-void explain(byte error)
-{
- output << " (";
- switch (error) {
-  case 2: output << "it's not there"; break;
-  case 8: output << "out of memory"; break;
-  default: output << "error " << error;
- }
- output << ")." << NL;
+void explain(byte error) {
+	output << " (";
+	switch (error) {
+	case 2:
+		output << "it's not there";
+		break;
+	case 8:
+		output << "out of memory";
+		break;
+	default:
+		output << "error " << error;
+	}
+	output << ")." << NL;
 }
 
 /*$F+*/
 
-void b_flight()     /*interrupt;*/
-{
- storage.skellern += 1;
+void b_flight() {   /*interrupt;*/
+	storage.skellern += 1;
 }
 
 /*$F-*/
 
-void bflight_on()
-{
- storage.skellern=reset_;
- setintvec(0x1c,&b_flight);
+void bflight_on() {
+	storage.skellern = reset_;
+	setintvec(0x1c, &b_flight);
 }
 
-void bflight_off()
-{
- setintvec(0x1c,old_1c);
+void bflight_off() {
+	setintvec(0x1c, old_1c);
 }
 
-void run(string what, boolean with_jsb,boolean with_bflight, elm how);
-
-
-static string elm2str(elm how)
-{
- string elm2str_result;
- switch (how) {
-  case normal: case musical: elm2str_result="jsb"; break;
-  case regi: elm2str_result="REGI"; break;
-  case elmpoyten: elm2str_result="ELMPOYTEN"; break;
- }
- return elm2str_result;
+void run(string what, boolean with_jsb, boolean with_bflight, elm how);
+
+
+static string elm2str(elm how) {
+	string elm2str_result;
+	switch (how) {
+	case normal:
+	case musical:
+		elm2str_result = "jsb";
+		break;
+	case regi:
+		elm2str_result = "REGI";
+		break;
+	case elmpoyten:
+		elm2str_result = "ELMPOYTEN";
+		break;
+	}
+	return elm2str_result;
 }
 
-void run(string what, boolean with_jsb,boolean with_bflight, elm how)
-{
- string which_dir,args;
- integer error;
+void run(string what, boolean with_jsb, boolean with_bflight, elm how) {
+	string which_dir, args;
+	integer error;
 
 
- if (what=="")  return;
+	if (what == "")  return;
 
- getdir(0,which_dir);
+	getdir(0, which_dir);
 
- if (with_jsb) 
- {
-   if (how==musical) 
-     args=elm2str(how)+' '+args_with_no_filename; /* FN is NOT given if musical*/
-   else
-     args=elm2str(how)+' '+arguments;
- } else args="";
+	if (with_jsb) {
+		if (how == musical)
+			args = elm2str(how) + ' ' + args_with_no_filename; /* FN is NOT given if musical*/
+		else
+			args = elm2str(how) + ' ' + arguments;
+	} else args = "";
 
- if (how==musical)  args=args+strf(soundcard)+' '+strf(speed)+' '+
-                      strf(baseaddr)+' '+strf(dma)+' '+strf(irq);
- if (with_bflight)  bflight_on();
+	if (how == musical)  args = args + strf(soundcard) + ' ' + strf(speed) + ' ' +
+		                            strf(baseaddr) + ' ' + strf(dma) + ' ' + strf(irq);
+	if (with_bflight)  bflight_on();
 
- swapvectors;
- exec(what,args);
- swapvectors;
- cursor_off();
+	swapvectors;
+	exec(what, args);
+	swapvectors;
+	cursor_off();
 
- error=doserror;
+	error = doserror;
 
- if (with_bflight)  bflight_off();
+	if (with_bflight)  bflight_off();
 
- chdir(which_dir);
+	chdir(which_dir);
 
- if (error!=0) 
- {
-  output << "avvy_bootstrap: cannot execute " << what << '!';
-  explain(error);
-  output << "Press Enter:"; input >> NL; quit();
- }
+	if (error != 0) {
+		output << "avvy_bootstrap: cannot execute " << what << '!';
+		explain(error);
+		output << "Press Enter:";
+		input >> NL;
+		quit();
+	}
 }
 
-void run_avalot()
-{
-    integer error;
+void run_avalot() {
+	integer error;
 
 
- bflight_on();
+	bflight_on();
 
- swapvectors;
- exec("avalot.avx",runcodes[first_time]+arguments);
- swapvectors;
+	swapvectors;
+	exec("avalot.avx", runcodes[first_time] + arguments);
+	swapvectors;
 
- error=doserror;
+	error = doserror;
 
- bflight_off();
+	bflight_off();
 
- if (error!=0) 
- {
-  output << "avvy_bootstrap: error in loading AVALOT.AVX!";
-  explain(error);
-  quit();
- }
+	if (error != 0) {
+		output << "avvy_bootstrap: error in loading AVALOT.AVX!";
+		explain(error);
+		quit();
+	}
 
- first_time=false;
+	first_time = false;
 }
 
-void run_the_demo()
-{
-    string args;
+void run_the_demo() {
+	string args;
 
- args=arguments;
- arguments=demo_args;  /* Force the demo. */
+	args = arguments;
+	arguments = demo_args; /* Force the demo. */
 
- run_avalot();
+	run_avalot();
 
- arguments=args;    /* Put all back to normal again. */
- first_time=true;
+	arguments = args;  /* Put all back to normal again. */
+	first_time = true;
 }
 
-void get_arguments()
-{
- byte fv;
+void get_arguments() {
+	byte fv;
 
- arguments="";
+	arguments = "";
 
- for( fv=1; fv <= paramcount; fv ++)
-  arguments=arguments+paramstr(fv)+' ';
+	for (fv = 1; fv <= paramcount; fv ++)
+		arguments = arguments + paramstr(fv) + ' ';
 
- arguments[0] -= 1; /* Get rid of the trailing space. */
+	arguments[0] -= 1; /* Get rid of the trailing space. */
 
- segofs=string(' ')+strf(seg(storage))+' '+strf(ofs(storage));
+	segofs = string(' ') + strf(seg(storage)) + ' ' + strf(ofs(storage));
 
- arguments=segofs+' '+arguments;
+	arguments = segofs + ' ' + arguments;
 }
 
-void dos_shell()
-{
-    registers r;
+void dos_shell() {
+	registers r;
 
- r.ax=original_mode; intr(0x10,r);
- output << NL;
- output << "The Avalot Dos Shell." << NL;
- output << "---------------------" << NL;
- output << NL;
- output << "Type EXIT to return to Avalot." << NL;
- output << NL;
+	r.ax = original_mode;
+	intr(0x10, r);
+	output << NL;
+	output << "The Avalot Dos Shell." << NL;
+	output << "---------------------" << NL;
+	output << NL;
+	output << "Type EXIT to return to Avalot." << NL;
+	output << NL;
 
- cursor_on();
- run(command_com(),no_jsb,no_bflight,normal);
- cursor_off();
+	cursor_on();
+	run(command_com(), no_jsb, no_bflight, normal);
+	cursor_off();
 
- output << "Please wait, restoring your game..." << NL;
+	output << "Please wait, restoring your game..." << NL;
 }
 
 boolean keypressed1() {
-                                 registers r;
+	registers r;
 
- boolean keypressed1_result;
- r.ah=0xb;
- msdos(r);
- keypressed1_result=r.al==0xff;
- return keypressed1_result;
-                      }
+	boolean keypressed1_result;
+	r.ah = 0xb;
+	msdos(r);
+	keypressed1_result = r.al == 0xff;
+	return keypressed1_result;
+}
 
 void flush_buffer() {
-                            registers r;  r.ah=7;
- while (keypressed1())  msdos(r); }
+	registers r;
+	r.ah = 7;
+	while (keypressed1())  msdos(r);
+}
 
-void demo()
-{
- run_the_demo(); if (keypressed1())  return;
- run("intro.avx",jsb,bflight,musical); if (keypressed1())  return;
- run("stars.avx",jsb,no_bflight,musical); if (keypressed1())  return;
+void demo() {
+	run_the_demo();
+	if (keypressed1())  return;
+	run("intro.avx", jsb, bflight, musical);
+	if (keypressed1())  return;
+	run("stars.avx", jsb, no_bflight, musical);
+	if (keypressed1())  return;
 
- flush_buffer();
+	flush_buffer();
 }
 
-void call_menu()
-{
- run("stars.avx",jsb,no_bflight,musical);
- flush_buffer();
- do {
-  run("avmenu.avx",jsb,no_bflight,normal);
-
-  switch (storage.operation) {
-   case 1: return; break; /* Play the game. */
-   case 2: run("intro.avx",jsb,bflight,musical); break;
-   case 3: run("preview1.avd",jsb,no_bflight,normal); break;
-   case 4: run("viewdocs.avx",jsb,bflight,elmpoyten); break;
-   case 5: run("viewdocs.avx",jsb,bflight,regi); break;
-   case 6: quit(); break;
-   case 177: demo(); break;
-  }
-
-  flush_buffer();
- } while (!false);
+void call_menu() {
+	run("stars.avx", jsb, no_bflight, musical);
+	flush_buffer();
+	do {
+		run("avmenu.avx", jsb, no_bflight, normal);
+
+		switch (storage.operation) {
+		case 1:
+			return;
+			break; /* Play the game. */
+		case 2:
+			run("intro.avx", jsb, bflight, musical);
+			break;
+		case 3:
+			run("preview1.avd", jsb, no_bflight, normal);
+			break;
+		case 4:
+			run("viewdocs.avx", jsb, bflight, elmpoyten);
+			break;
+		case 5:
+			run("viewdocs.avx", jsb, bflight, regi);
+			break;
+		case 6:
+			quit();
+			break;
+		case 177:
+			demo();
+			break;
+		}
+
+		flush_buffer();
+	} while (!false);
 }
 
-void get_slope()
-{
- run("slope.avx",jsb,no_bflight,normal);
- if (dosexitcode!=0) 
- {
-  cursor_on();
-  exit(0);
- }
-
- move(storage.contents,arguments,sizeof(arguments));
- move(storage.contents[4998],soundcard,4);
- move(storage.contents[5002],baseaddr,4);
- move(storage.contents[5006],irq,4);
- move(storage.contents[5010],dma,4);
- move(storage.contents[5014],speed,4);
-
- zoomy=(arguments[8]=='y') || (arguments[2]=='y');
- demo_args=arguments; demo_args[7]='y';
- arguments=segofs+' '+arguments;
- demo_args=segofs+' '+demo_args;
-
- args_with_no_filename=arguments;
- if (arguments[length(arguments)]!=' ') 
- {        /* Filename was given */
-   args_with_no_filename=arguments;
-   while ((args_with_no_filename!="")
-     && (args_with_no_filename[length(args_with_no_filename)]!=' ')) 
-      args_with_no_filename[0] -= 1; /* Strip off the filename. */
- }
+void get_slope() {
+	run("slope.avx", jsb, no_bflight, normal);
+	if (dosexitcode != 0) {
+		cursor_on();
+		exit(0);
+	}
+
+	move(storage.contents, arguments, sizeof(arguments));
+	move(storage.contents[4998], soundcard, 4);
+	move(storage.contents[5002], baseaddr, 4);
+	move(storage.contents[5006], irq, 4);
+	move(storage.contents[5010], dma, 4);
+	move(storage.contents[5014], speed, 4);
+
+	zoomy = (arguments[8] == 'y') || (arguments[2] == 'y');
+	demo_args = arguments;
+	demo_args[7] = 'y';
+	arguments = segofs + ' ' + arguments;
+	demo_args = segofs + ' ' + demo_args;
+
+	args_with_no_filename = arguments;
+	if (arguments[length(arguments)] != ' ') {
+		/* Filename was given */
+		args_with_no_filename = arguments;
+		while ((args_with_no_filename != "")
+		        && (args_with_no_filename[length(args_with_no_filename)] != ' '))
+			args_with_no_filename[0] -= 1; /* Strip off the filename. */
+	}
 }
 
-int main(int argc, const char* argv[])
-{
- pio_initialize(argc, argv);
- original_mode=mem[seg0040*0x49]; getintvec(0x1c,old_1c);
- first_time=true; cursor_off();
-
- get_arguments();
- get_slope();
-
- if (! zoomy)  call_menu();    /* Not run when zoomy. */
-
- do {
-  run_avalot();
-
-  if (dosexitcode!=77)  quit(); /* Didn't stop for us. */
-
-  switch (storage.operation) {
-   case run_shootemup: run("seu.avx",jsb,bflight,normal); break;
-   case run_dosshell: dos_shell(); break;
-   case run_ghostroom: run("g-room.avx",jsb,no_bflight,normal); break;
-   case run_golden: run("golden.avx",jsb,bflight,musical); break;
-  }
-
- } while (!false);
- return EXIT_SUCCESS;
+int main(int argc, const char *argv[]) {
+	pio_initialize(argc, argv);
+	original_mode = mem[seg0040 * 0x49];
+	getintvec(0x1c, old_1c);
+	first_time = true;
+	cursor_off();
+
+	get_arguments();
+	get_slope();
+
+	if (! zoomy)  call_menu();    /* Not run when zoomy. */
+
+	do {
+		run_avalot();
+
+		if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
+
+		switch (storage.operation) {
+		case run_shootemup:
+			run("seu.avx", jsb, bflight, normal);
+			break;
+		case run_dosshell:
+			dos_shell();
+			break;
+		case run_ghostroom:
+			run("g-room.avx", jsb, no_bflight, normal);
+			break;
+		case run_golden:
+			run("golden.avx", jsb, bflight, musical);
+			break;
+		}
+
+	} while (!false);
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
index f653ad8..9b12b39 100644
--- a/engines/avalanche/cadburys.cpp
+++ b/engines/avalanche/cadburys.cpp
@@ -39,9 +39,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
 		exit(0);
@@ -52,13 +50,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -74,7 +70,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -85,7 +80,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -103,11 +97,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = ((realx - ch.x * 8) + (x2 - x1) + 7) / 8;
@@ -116,7 +108,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -133,7 +124,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index d444845..62ae94d 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -432,7 +432,6 @@ asm
   pop ds;       { Get DS back again. }
 */
 {
-	;
 }
 
 void show_one(byte which);
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
index 98ea2a5..d96eb89 100644
--- a/engines/avalanche/ch_egats.cpp
+++ b/engines/avalanche/ch_egats.cpp
@@ -143,12 +143,10 @@ asm
   pop ds;       { Get DS back again. }
 */
 {
-	;
 }
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	assign(f, "chunk21.avd");
 	reset(f, 1);
 
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
index d599ef5..c970e1a 100644
--- a/engines/avalanche/charmap.cpp
+++ b/engines/avalanche/charmap.cpp
@@ -38,17 +38,13 @@ pointer where;
 byte w, fv, ff, num;
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	getintvec(0x1f, where);
 	move(where, table, 1024);
 	for (w = 128; w <= 255; w ++) {
-		;
 		output << w << NL;
 		for (fv = 1; fv <= 8; fv ++) {
-			;
 			num = table.chars[w][fv];
 			for (ff = 1; ff <= 8; ff ++) {
-				;
 				if ((num & 128) == 0)  output << "  ";
 				else output << "ÛÛ";
 				num = num << 1;
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
index ba6ab57..ed29991 100644
--- a/engines/avalanche/chunkxf1.cpp
+++ b/engines/avalanche/chunkxf1.cpp
@@ -59,12 +59,10 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, "chunkbit.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -77,7 +75,6 @@ void load() {
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -90,7 +87,6 @@ void load() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk21.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -101,7 +97,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -269,7 +264,6 @@ end;*/
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
index 781f798..d7ae8e4 100644
--- a/engines/avalanche/chunkxf2.cpp
+++ b/engines/avalanche/chunkxf2.cpp
@@ -57,13 +57,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place9.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -80,12 +78,10 @@ void load_temp(string which) {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, which);
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -97,7 +93,6 @@ void load_temp(string which) {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk9.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -108,7 +103,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -118,9 +112,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
 		exit(0);
@@ -131,13 +123,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -151,7 +141,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -162,7 +151,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		if (nat)
 			ch.flavour = ch_bgi;
 		else ch.flavour = ch_ega; /* At the moment, Celer can't handle natural ch_EGAs. */
@@ -183,7 +171,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 	freemem(p, s);
 	{
-		;
 		if (ch.flavour == ch_bgi)  s = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
 		else s = 4 * ((x2 - x1 + 7) / 8) * (y2 - y1 + 1);
 		ch.size = s;
@@ -203,7 +190,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
index b0bb232..c693fdc 100644
--- a/engines/avalanche/chunkxf3.cpp
+++ b/engines/avalanche/chunkxf3.cpp
@@ -61,7 +61,6 @@ var
 string strf(longint x) {
 	string q;
 	string strf_result;
-	;
 	str(x, q);
 	strf_result = q;
 	return strf_result;
@@ -70,7 +69,6 @@ string strf(longint x) {
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -82,7 +80,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -127,12 +124,10 @@ void loadtemp(string n) {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, n);
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -149,12 +144,10 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, "place22.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -172,7 +165,6 @@ void load() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk22.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -183,7 +175,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -280,7 +271,6 @@ end;*/
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
index 8648964..6659aa9 100644
--- a/engines/avalanche/chunkxf4.cpp
+++ b/engines/avalanche/chunkxf4.cpp
@@ -105,7 +105,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
index 72cc0c3..c4b49e7 100644
--- a/engines/avalanche/chunkxf5.cpp
+++ b/engines/avalanche/chunkxf5.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "v:place1.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -139,13 +135,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi9.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -162,7 +156,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk1.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -173,7 +166,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -183,9 +175,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -197,13 +187,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -219,7 +207,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -230,7 +217,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -248,18 +234,15 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	if (! nat)  putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 + 7) / 8) - (x1 / 8)) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl + 7) / 8;
 			mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
 		}
 	} else {
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -276,7 +259,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -287,7 +269,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
index b02a9d2..a1ce3ee 100644
--- a/engines/avalanche/chunkxf6.cpp
+++ b/engines/avalanche/chunkxf6.cpp
@@ -60,7 +60,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -72,7 +71,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -116,13 +114,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "v:place19.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -143,13 +139,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "d:temp1.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -164,7 +158,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk19.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -175,7 +168,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -185,9 +177,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -199,13 +189,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -221,7 +209,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	x1 -= x_ofs;
 	x2 -= x_ofs;
 	y1 -= y_ofs;
@@ -236,7 +223,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -254,11 +240,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -267,7 +251,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -284,7 +267,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -295,7 +277,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
index 6137bc3..4b03e3a 100644
--- a/engines/avalanche/chunkxf7.cpp
+++ b/engines/avalanche/chunkxf7.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place25.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk25.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf8.cpp b/engines/avalanche/chunkxf8.cpp
index a3a8b14..7e94b29 100644
--- a/engines/avalanche/chunkxf8.cpp
+++ b/engines/avalanche/chunkxf8.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place23.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp(string x) {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, x);
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp(string x) {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk23.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxf9.cpp b/engines/avalanche/chunkxf9.cpp
index dbd342a..f036744 100644
--- a/engines/avalanche/chunkxf9.cpp
+++ b/engines/avalanche/chunkxf9.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place42.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "a:chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk42.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfa.cpp b/engines/avalanche/chunkxfa.cpp
index 622e6be..31c68a0 100644
--- a/engines/avalanche/chunkxfa.cpp
+++ b/engines/avalanche/chunkxfa.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place7.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk7.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfb.cpp b/engines/avalanche/chunkxfb.cpp
index 820bd78..0b5beb7 100644
--- a/engines/avalanche/chunkxfb.cpp
+++ b/engines/avalanche/chunkxfb.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place71.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "d:chunkbi2.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk71.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfc.cpp b/engines/avalanche/chunkxfc.cpp
index da5ffc5..5dfc0af 100644
--- a/engines/avalanche/chunkxfc.cpp
+++ b/engines/avalanche/chunkxfc.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place2.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "d:chunkbi2.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk2.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfd.cpp b/engines/avalanche/chunkxfd.cpp
index 11aa04c..97c4084 100644
--- a/engines/avalanche/chunkxfd.cpp
+++ b/engines/avalanche/chunkxfd.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place15.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "d:chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk15.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfe.cpp b/engines/avalanche/chunkxfe.cpp
index 0b2757a..81e1477 100644
--- a/engines/avalanche/chunkxfe.cpp
+++ b/engines/avalanche/chunkxfe.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place5.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi2.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk5.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxff.cpp b/engines/avalanche/chunkxff.cpp
index 0ff578b..777e224 100644
--- a/engines/avalanche/chunkxff.cpp
+++ b/engines/avalanche/chunkxff.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place13.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk13.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfg.cpp b/engines/avalanche/chunkxfg.cpp
index ead50a6..e1357ef 100644
--- a/engines/avalanche/chunkxfg.cpp
+++ b/engines/avalanche/chunkxfg.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place16.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi3.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk16.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfh.cpp b/engines/avalanche/chunkxfh.cpp
index 6d8c0e8..bf2da8f 100644
--- a/engines/avalanche/chunkxfh.cpp
+++ b/engines/avalanche/chunkxfh.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place46.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "d:chunkbi4.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk46.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -247,11 +233,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -260,7 +244,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfi.cpp b/engines/avalanche/chunkxfi.cpp
index b28add0..7a5df66 100644
--- a/engines/avalanche/chunkxfi.cpp
+++ b/engines/avalanche/chunkxfi.cpp
@@ -57,7 +57,6 @@ array<0, arraysize, byte> aa;
 void finder() {
 	char r;
 	integer x, y;
-	;
 	setfillstyle(0, 0);
 	setcolor(14);
 	x = 320;
@@ -69,7 +68,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
@@ -113,13 +111,11 @@ void load() {
 	byte a1 /*absolute $A400:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "place47.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -140,13 +136,11 @@ void loadtemp() {
 	byte a0 /*absolute $A000:800*/;
 	byte bit;
 	untyped_file f;
-	;
 
 	assign(f, "chunkbi9.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -161,7 +155,6 @@ void loadtemp() {
 }
 
 void open_chunk() {
-	;
 	assign(f, "chunk47.avd");
 	rewrite(f, 1);
 	blockwrite(f, chunkheader, sizeof(chunkheader));
@@ -172,7 +165,6 @@ void open_chunk() {
 }
 
 void close_chunk() {
-	;
 	seek(f, 45);
 	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
 	close(f);
@@ -182,9 +174,7 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	integer yy;
 	word aapos;
 	byte length, bit;
-	;
 	if (size > arraysize) {
-		;
 		restorecrtmode();
 		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
 		output << " than " << size << '.' << NL;
@@ -196,13 +186,11 @@ void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
 	length = x2 - x1;
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		for (yy = y1; yy <= y2; yy ++) {
-			;
 			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
 			aapos += length;
 		}
@@ -218,7 +206,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	word s;
 	pointer p;
 	chunkblocktype ch;
-	;
 	/* rectangle(x1,y1,x2,y2); exit;*/
 	this_chunk += 1;
 	offsets[this_chunk] = filepos(f);
@@ -229,7 +216,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	getimage(x1, y1, x2, y2, p);
 
 	{
-		;
 		ch.flavour = flav;
 		ch.x = realx;
 		ch.y = realy;
@@ -248,11 +234,9 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	putimage(ch.x, ch.y, p, 0);
 
 	if (flav == ch_ega) {
-		;
 		freemem(p, s);
 		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
 		{
-			;
 			ch.size = s;
 			ch.x = ch.x / 8;
 			ch.xl = (ch.xl / 8) + 2;
@@ -261,7 +245,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 	} else
 		/* For BGI pictures. */
 	{
-		;
 		ch.x = ch.x / 8;
 		ch.xl = (ch.xl + 7) / 8;
 		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
@@ -277,7 +260,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 		if (! nat)  blockwrite(f, aa, s);
 		break;
 	case ch_bgi : {
-		;
 		if (! nat)  blockwrite(f, p, s);
 		freemem(p, s);
 	}
@@ -288,7 +270,6 @@ void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/chunkxfj.cpp b/engines/avalanche/chunkxfj.cpp
index 83c379d..558be2a 100644
--- a/engines/avalanche/chunkxfj.cpp
+++ b/engines/avalanche/chunkxfj.cpp
@@ -69,7 +69,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
diff --git a/engines/avalanche/chunkxfk.cpp b/engines/avalanche/chunkxfk.cpp
index 5779d27..cafd2e3 100644
--- a/engines/avalanche/chunkxfk.cpp
+++ b/engines/avalanche/chunkxfk.cpp
@@ -69,7 +69,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
diff --git a/engines/avalanche/chunkxfl.cpp b/engines/avalanche/chunkxfl.cpp
index 9352450..78ecd17 100644
--- a/engines/avalanche/chunkxfl.cpp
+++ b/engines/avalanche/chunkxfl.cpp
@@ -47,7 +47,6 @@ void finder() {
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
 		do {
-			;
 		} while (!keypressed());
 		line(x - 20, y, x + 20, y);
 		line(x, y - 20, x, y + 20);
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
index 3cec288..4f36cb7 100644
--- a/engines/avalanche/clock.cpp
+++ b/engines/avalanche/clock.cpp
@@ -39,7 +39,6 @@ char r;
 
 void hand(word ang, word length, byte colour) {
 	arccoordstype a;
-	;
 	if (ang > 900)  return;
 	setcolor(colour);
 	arc(xm, ym, 449 - ang, 450 - ang, length);
@@ -49,14 +48,11 @@ void hand(word ang, word length, byte colour) {
 
 void chime() {
 	integer gd, gm, fv;
-	;
 	if (oh > 177)  return; /* too high- must be first time around */
 	fv = h / 30;
 	if (fv == 0)  fv = 12;
 	for (gd = 1; gd <= fv; gd ++) {
-		;
 		for (gm = 1; gm <= 3; gm ++) {
-			;
 			sound(140 - gm * 30);
 			delay(50 - gm * 3);
 		}
@@ -66,7 +62,6 @@ void chime() {
 }
 
 void plothands() {
-	;
 	hand(oh, 17, brown);
 	hand(h, 17, yellow);
 	hand(om * 6, 20, brown);
@@ -75,7 +70,6 @@ void plothands() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -87,7 +81,6 @@ int main(int argc, const char *argv[]) {
 		gettime(h, m, s, s1);
 		h = (h % 12) * 30 + m / 2;
 		if (oh != h)  {
-			;
 			plothands();
 			chime();
 		}
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index ddd31fc..52a09b1 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -52,7 +52,6 @@ file<scrtype> f;
 pointer exitsave;
 
 void get_screen(byte which) {
-	;
 	closegraph();
 	textattr = 0;
 	clrscr;
@@ -65,15 +64,11 @@ void get_screen(byte which) {
 void show_screen() {
 	byte fv, ff, fq, tl, bl;
 	scrtype a /*absolute $B800:0*/;
-	;
 	for (fv = 1; fv <= 40; fv ++) {
-		;
 		if (fv > 36)  {
-			;
 			tl = 1;
 			bl = 24;
 		} else {
-			;
 			tl = 12 - fv / 3;
 			bl = 12 + fv / 3;
 		}
@@ -89,7 +84,6 @@ void show_screen() {
 }
 
 void quit_with(byte which, byte errorlev) {
-	;
 	dusk();
 	get_screen(which);
 	show_screen(); /* No changes. */
@@ -98,7 +92,6 @@ void quit_with(byte which, byte errorlev) {
 
 void put_in(string x, word where) {
 	word fv;
-	;
 	for (fv = 1; fv <= length(x); fv ++)
 		q[1 + (where + fv) * 2] = x[fv];
 }
@@ -121,7 +114,6 @@ void end_of_program()
 	};
 
 	string result;
-	;
 	nosound;
 	get_screen(scr_nagscreen);
 	result = nouns[Random(12)] + " will " + verbs[Random(12)] + " you";
@@ -132,7 +124,6 @@ void end_of_program()
 /*$F+*/
 
 void bug_handler() {
-	;
 	exitproc = exitsave;
 
 	if (erroraddr != nil) {
@@ -140,7 +131,6 @@ void bug_handler() {
 		if (exitcode == 203)
 			get_screen(scr_ramcram);
 		else {
-			;
 			get_screen(scr_bugalert);
 			put_in(strf(exitcode), 678); /* 678 = [38,8]. */
 			put_in(strf(seg(erroraddr)) + ':' + strf(ofs(erroraddr)), 758); /* 758 = [38,9]. */
@@ -159,7 +149,6 @@ public:
 static unit_closing_initialize closing_constructor;
 
 unit_closing_initialize::unit_closing_initialize() {
-	;
 	exitsave = exitproc;
 	exitproc = &bug_handler;
 }
diff --git a/engines/avalanche/convert.cpp b/engines/avalanche/convert.cpp
index f7ae1ec..8ab4b2d 100644
--- a/engines/avalanche/convert.cpp
+++ b/engines/avalanche/convert.cpp
@@ -39,7 +39,6 @@ void loadscreen(string nam) {
 	untyped_file f;
 	word s;
 	string check;
-	;
 	assign(f, nam);
 	reset(f, 1);
 	blockread(f, check, 41);
@@ -47,7 +46,6 @@ void loadscreen(string nam) {
 	blockread(f, check, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(a[z], s);
 		blockread(f, a[z], s);
 		setactivepage(0);
@@ -61,12 +59,10 @@ void load2(string name) {
 	byte a /*absolute $A000:1200*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, name);
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -83,13 +79,11 @@ void save2(string name) {
 	byte a /*absolute $A000:1200*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, name);
 	rewrite(f, 1);
 	blockwrite(f, header[1], 146); /* really 90 */
 	blockwrite(f, desc, 31);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -101,7 +95,6 @@ void save2(string name) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	output << "Filename?";
 	input >> fn1 >> NL;
 	output << "New name?";
diff --git a/engines/avalanche/convmous.cpp b/engines/avalanche/convmous.cpp
index 6316b61..0a0bbce 100644
--- a/engines/avalanche/convmous.cpp
+++ b/engines/avalanche/convmous.cpp
@@ -48,9 +48,7 @@ integer gd, gm;
 
 void recalc() {
 	byte a, b;
-	;
 	{
-		;
 		for (a = 0; a <= 1; a ++)
 			for (b = 0; b <= 15; b ++)
 				c_current.mask[a][b] = bintoword(cpc[a][b]);
@@ -63,7 +61,6 @@ void load() {
 	text t;
 	string x;
 	byte a, b;
-	;
 	assign(t, fn);
 	reset(t);
 	do {
@@ -83,32 +80,25 @@ void display() {
 	const integer o0 = ord('0');
 	const integer o1 = ord('1');
 	byte x, y, p1, p2;
-	;
 	for (y = 0; y <= 15; y ++) {
-		;
 		for (x = 1; x <= 16; x ++) {
-			;
 			switch (ord(cpc[0][y][x]) * 2 + ord(cpc[1][y][x])) {
 			case o0*2+o0: {
-				;
 				p1 = 0;
 				p2 = 0;
 			}
 			break; /* p1= silhouette, p2= real */
 			case o0*2+o1: {
-				;
 				p1 = 0;
 				p2 = 15;
 			}
 			break;
 			case o1*2+o0: {
-				;
 				p1 = 15;
 				p2 = 0;
 			}
 			break;
 			case o1*2+o1: {
-				;
 				p1 = 9;
 				p2 = 9;
 			}
@@ -123,7 +113,6 @@ void display() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 1;
 	initgraph(gd, gm, "");
diff --git a/engines/avalanche/credits.cpp b/engines/avalanche/credits.cpp
index 377c34c..adb2057 100644
--- a/engines/avalanche/credits.cpp
+++ b/engines/avalanche/credits.cpp
@@ -45,7 +45,6 @@ void do_one(byte z) {
 	byte a /*absolute $A000:0*/;
 	byte aa /*absolute $A000:80*/;
 	byte az /*absolute $A000:27921*/;
-	;
 	a = getpixel(0, 0);
 	move(l, az, z);
 
@@ -56,9 +55,7 @@ void do_one(byte z) {
 
 void background() {
 	byte y;
-	;
 	for (y = 1; y <= 15; y ++) {
-		;
 		setcolor(y);
 		outtextxy(17, y * 12, "Jesus is Lord!");
 	}
@@ -67,7 +64,6 @@ void background() {
 void scroll(string z) {
 	byte x, y, lz;
 	char c;
-	;
 	fillchar(l, 80, '\0');
 	if (z == "")
 		for (y = 1; y <= 12; y ++) do_one(0);
@@ -77,17 +73,14 @@ void scroll(string z) {
 	switch (c) {
 	case '*':
 		for (y = 0; y <= 15; y ++) {
-			;
 			for (x = 1; x <= lz; x ++)
 				l[x] = f[2][z[x]][y];
 			do_one(lz);
 		}
 		break;
 	case '>': {
-		;
 		lz += 7;
 		for (y = 0; y <= 13; y ++) {
-			;
 			for (x = 1; x <= lz; x ++)
 				l[x + 7] = f[1][z[x]][y];
 			do_one(lz);
@@ -100,7 +93,6 @@ void scroll(string z) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 1;
 	initgraph(gd, gm, "");
diff --git a/engines/avalanche/displtxt.cpp b/engines/avalanche/displtxt.cpp
index 41ebe44..a807743 100644
--- a/engines/avalanche/displtxt.cpp
+++ b/engines/avalanche/displtxt.cpp
@@ -42,7 +42,6 @@ atype a /*absolute $B800:0*/;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	textattr = 0;
 	clrscr;
 	assign(f, fn);
@@ -50,13 +49,10 @@ int main(int argc, const char *argv[]) {
 	f >> q;
 	close(f);
 	for (fv = 1; fv <= 40; fv ++) {
-		;
 		if (fv > 36)  {
-			;
 			tl = 1;
 			bl = 24;
 		} else {
-			;
 			tl = 12 - fv / 3;
 			bl = 12 + fv / 3;
 		}
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 0f3d078..c5b2c50 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -72,7 +72,6 @@ char r;
 byte fv;
 
 void find_what_you_can_do_with_it() {
-	;
 	switch (thinks) {
 	case wine:
 	case ink:
@@ -107,7 +106,6 @@ void chalk(integer x, integer y, char t, string z, boolean valid) {
 	byte fv, ff, p, bit;
 	word pageseg;
 	byte ander;
-	;
 
 	pageseg = 0xa000 + cp * 0x400;
 
@@ -117,7 +115,6 @@ void chalk(integer x, integer y, char t, string z, boolean valid) {
 	for (fv = 1; fv <= length(z); fv ++)
 		for (ff = 0; ff <= 7; ff ++)
 			for (bit = 0; bit <= 2; bit ++) {
-				;
 				port[0x3c4] = 2;
 				port[0x3ce] = 4;
 				port[0x3c5] = 1 << bit;
@@ -126,7 +123,6 @@ void chalk(integer x, integer y, char t, string z, boolean valid) {
 			}
 
 	for (ff = 0; ff <= 8; ff ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << 3;
@@ -139,7 +135,6 @@ void chalk(integer x, integer y, char t, string z, boolean valid) {
 	p -= 1;
 
 	for (bit = 0; bit <= 2; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -156,7 +151,6 @@ void hlchalk(integer x, integer y, char t, string z, boolean valid)
 	byte fv, ff, p;
 	word pageseg;
 	byte ander;
-	;
 
 	pageseg = 0xa000 + cp * 0x400;
 
@@ -183,14 +177,12 @@ begin;
 end;*/
 
 void bleep() {
-	;
 	sound(177);
 	delay(7);
 	nosound;
 }
 
 void onemenu::start_afresh() {
-	;
 	number = 0;
 	width = 0;
 	firstlix = false;
@@ -199,7 +191,6 @@ void onemenu::start_afresh() {
 }
 
 onemenu *onemenu::init() {
-	;
 	menunow = false;
 	ddmnow = false;
 	menunum = 1;
@@ -208,13 +199,11 @@ onemenu *onemenu::init() {
 
 void onemenu::opt(string n, char tr, string key, boolean val) {
 	integer l;
-	;
 	number += 1;
 	l = length(n + key) + 3;
 	if (width < l)  width = l;
 	{
 		optiontype &with = oo[number];
-		;
 		with.title = n;
 		with.trigger = tr;
 		with.shortcut = key;
@@ -224,10 +213,8 @@ void onemenu::opt(string n, char tr, string key, boolean val) {
 
 void onemenu::displayopt(byte y, boolean highlit) {
 	string data;
-	;
 	{
 		optiontype &with = oo[y];
-		;
 
 		if (highlit)
 			setfillstyle(1, 0);
@@ -255,7 +242,6 @@ void onemenu::displayopt(byte y, boolean highlit) {
 
 void onemenu::display() {
 	byte y;
-	;
 	off();
 	setactivepage(cp);
 	setvisualpage(cp);
@@ -284,7 +270,6 @@ void onemenu::display() {
 
 void onemenu::wipe() {
 	bytefield r;
-	;
 	setactivepage(cp);
 	off();
 	{
@@ -313,9 +298,7 @@ void onemenu::wipe() {
 
 void onemenu::movehighlight(shortint add) {
 	shortint hn;
-	;
 	if (add != 0) {
-		;
 		hn = highlightnum + add;
 		if ((hn < 0) || (hn >= (unsigned char)number))  return;
 		highlightnum = hn;
@@ -330,7 +313,6 @@ void onemenu::movehighlight(shortint add) {
 }
 
 void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
-	;
 	if ((mx < (cardinal)flx1 * 8) || (mx > (cardinal)flx2 * 8) || (my <= 12) || (my > (cardinal)fly - 3))  return;
 	highlightnum = (my - 13) / 10;
 	if (highlightnum == oldy)  return;
@@ -338,7 +320,6 @@ void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
 }
 
 void onemenu::select(byte n) {    /* Choose which one you want. */
-	;
 	if (! oo[n + 1].valid)  return;
 	choicenum = n;
 	wipe();
@@ -352,13 +333,11 @@ void onemenu::select(byte n) {    /* Choose which one you want. */
 void onemenu::keystroke(char c) {
 	byte fv;
 	boolean found;
-	;
 	c = upcase(c);
 	found = false;
 	for (fv = 1; fv <= number; fv ++) {
 		optiontype &with = oo[fv];
 		if ((upcase(with.trigger) == c) && with.valid) {
-			;
 			select(fv - 1);
 			found = true;
 		}
@@ -368,7 +347,6 @@ void onemenu::keystroke(char c) {
 
 headtype *headtype::init
 (char trig, char alttrig, string name, byte p, proc dw, proc dc) {
-	;
 	trigger = trig;
 	alttrigger = alttrig;
 	title = name;
@@ -381,21 +359,18 @@ headtype *headtype::init
 }
 
 void headtype::display() {
-	;
 	off(); /*MT*/
 	chalk(xpos, 1, trigger, title, true);
 	on(); /*MT*/
 }
 
 void headtype::highlight() {
-	;
 	off();
 	off_virtual();
 	nosound;
 	setactivepage(cp);
 	hlchalk(xpos, 1, trigger, title, true);
 	{
-		;
 		ddm_o.left = xpos;
 		ddm_o.menunow = true;
 		ddmnow = true;
@@ -406,9 +381,7 @@ void headtype::highlight() {
 
 boolean headtype::extdparse(char c) {
 	boolean extdparse_result;
-	;
 	if (c != alttrigger)  {
-		;
 		extdparse_result = true;
 		return extdparse_result;
 	}
@@ -417,13 +390,11 @@ boolean headtype::extdparse(char c) {
 }
 
 menuset *menuset::init() {
-	;
 	howmany = 0;
 	return this;
 }
 
 void menuset::create(char t, string n, char alttrig, proc dw, proc dc) {
-	;
 	howmany += 1;
 	ddms[howmany].init(t, alttrig, n, howmany, dw, dc);
 }
@@ -431,7 +402,6 @@ void menuset::create(char t, string n, char alttrig, proc dw, proc dc) {
 void menuset::update() {
 	const bytefield menuspace = {0, 0, 80, 9};
 	byte fv, page_, savecp;
-	;
 	setactivepage(3);
 	setfillstyle(1, menu_b);
 	bar(0, 0, 640, 9);
@@ -449,7 +419,6 @@ void menuset::update() {
 
 void menuset::extd(char c) {
 	byte fv;
-	;
 	fv = 1;
 	while ((fv <= howmany) && (ddms[fv].extdparse(c)))  fv += 1;
 	if (fv > howmany)  return;
@@ -457,13 +426,10 @@ void menuset::extd(char c) {
 }
 
 void menuset::getcertain(byte fv) {
-	;
 	{
 		headtype &with = ddms[fv];
 		{
-			;
 			if (ddm_o.menunow) {
-				;
 				wipe(); /* get rid of menu */
 				if (ddm_o.menunum == with.position)  return; /* clicked on own highlight */
 			}
@@ -475,12 +441,10 @@ void menuset::getcertain(byte fv) {
 
 void menuset::getmenu(integer x) {
 	byte fv;
-	;
 	fv = 0;
 	do {
 		fv += 1;
 		if ((x > ddms[fv].xpos * 8) && (x < ddms[fv].xright * 8)) {
-			;
 			getcertain(fv);
 			return;
 		}
@@ -488,15 +452,12 @@ void menuset::getmenu(integer x) {
 }
 
 void parsekey(char r, char re) {
-	;
 	switch (r) {
 	case '\0':
 	case '\340': {
-		;
 		switch (re) {
 		case 'K':
 			if (ddm_o.menunum > 1)  {
-				;
 				wipe();
 				ddm_m.getcertain(ddm_o.menunum - 1);
 			} else {
@@ -507,7 +468,6 @@ void parsekey(char r, char re) {
 			break;
 		case 'M':
 			if (ddm_o.menunum < ddm_m.howmany)  {
-				;
 				wipe();
 				ddm_m.getcertain(ddm_o.menunum + 1);
 			} else {
@@ -531,7 +491,6 @@ void parsekey(char r, char re) {
 		select(ddm_o.highlightnum);
 		break;
 	default: {
-		;
 		if (ddm_o.menunow)  keystroke(r);
 	}
 	}
@@ -540,9 +499,7 @@ void parsekey(char r, char re) {
 /*$F+  *** Here follow all the ddm__ and do__ procedures for the DDM system. */
 
 void ddm__game() {
-	;
 	{
-		;
 		start_afresh();
 		opt("Help...", 'H', "f1", true);
 		opt("Boss Key", 'B', "alt-B", true);
@@ -554,9 +511,7 @@ void ddm__game() {
 }
 
 void ddm__file() {
-	;
 	{
-		;
 		start_afresh();
 		opt("New game", 'N', "f4", true);
 		opt("Load...", 'L', "^f3", true);
@@ -570,11 +525,9 @@ void ddm__file() {
 
 void ddm__action() {
 	string n;
-	;
 	n = copy(f5_does(), 2, 255);
 
 	{
-		;
 		start_afresh();
 		if (n == "")
 			opt("Do something", 'D', "f5", false);
@@ -598,17 +551,14 @@ void ddm__action() {
 void ddm__people() {
 	byte here;
 	char fv;
-	;
 
 	people = "";
 	here = dna.room;
 
 	{
-		;
 		start_afresh();
 		for (fv = '\226'; fv <= '\262'; fv ++)
 			if (whereis[fv] == here) {
-				;
 				opt(getname(fv), getnamechar(fv), "", true);
 				people = people + fv;
 			}
@@ -618,9 +568,7 @@ void ddm__people() {
 
 void ddm__objects() {
 	char fv;
-	;
 	{
-		;
 		start_afresh();
 		for (fv = '\1'; fv <= numobjs; fv ++)
 			if (dna.obj[fv])
@@ -631,7 +579,6 @@ void ddm__objects() {
 
 string himher(char x) {         /* Returns "im" for boys, and "er" for girls.*/
 	string himher_result;
-	;
 	if (x < '\257')  himher_result = "im";
 	else himher_result = "er";
 	return himher_result;
@@ -642,18 +589,14 @@ void ddm__with() {
 	varying_string<7> verb;
 	char vbchar;
 	boolean n;
-	;
 	{
-		;
 		start_afresh();
 
 		if (thinkthing) {
-			;
 
 			find_what_you_can_do_with_it();
 
 			for (fv = 1; fv <= length(verbstr); fv ++) {
-				;
 				verbopt(verbstr[fv], verb, vbchar);
 				opt(verb, vbchar, "", true);
 			}
@@ -665,13 +608,11 @@ void ddm__with() {
 			if ((set::of(nowt, pavalot, eos).has(last_person)) ||
 			        (whereis[last_person] != dna.room))
 				opt("Give to...", 'G', "", false); /* Not here. */ else {
-				;
 				opt(string("Give to ") + getname(last_person), 'G', "", true);
 				verbstr = verbstr + vb_give;
 			}
 
 		} else {
-			;
 			opt("Examine", 'x', "", true);
 			opt(string("Talk to h") + himher(thinks), 'T', "", true);
 			verbstr = string(vb_exam) + vb_talk;
@@ -679,21 +620,18 @@ void ddm__with() {
 
 			case pgeida:
 			case parkata: {
-				;
 				opt("Kiss her", 'K', "", true);
 				verbstr = verbstr + vb_kiss;
 			}
 			break;
 
 			case pdogfood: {
-				;
 				opt("Play his game", 'P', "", ! dna.wonnim); /* True if you HAVEN'T won. */
 				verbstr = verbstr + vb_play;
 			}
 			break;
 
 			case pmalagauche: {
-				;
 				n = ! dna.teetotal;
 				opt("Buy some wine", 'w', "", ! dna.obj[wine]);
 				opt("Buy some beer", 'b', "", n);
@@ -705,7 +643,6 @@ void ddm__with() {
 			break;
 
 			case ptrader: {
-				;
 				opt("Buy an onion", 'o', "", ! dna.obj[onion]);
 				verbstr = verbstr + '\151';
 			}
@@ -744,7 +681,6 @@ begin;
 end;*/
 
 void do__game() {
-	;
 	switch (ddm_o.choicenum) {
 		/* Help, boss, untrash screen. */
 	case 0:
@@ -766,20 +702,17 @@ void do__game() {
 }
 
 void do__file() {
-	;
 	switch (ddm_o.choicenum) {
 		/* New game, load, save, save as, DOS shell, about, quit. */
 	case 0:
 		callverb(vb_restart);
 		break;
 	case 1: {
-		;
 		realwords[2] = "";
 		callverb(vb_load);
 	}
 	break;
 	case 2: {
-		;
 		realwords[2] = "";
 		callverb(vb_save);
 	}
@@ -798,7 +731,6 @@ void do__file() {
 
 void do__action() {
 	string n;
-	;
 	switch (ddm_o.choicenum) {
 		/* Get up/pause game/open door/look/inv/walk-run */
 	case 0: {
@@ -830,22 +762,18 @@ void do__action() {
 }
 
 void do__objects() {
-	;
 	thinkabout(objlist[ddm_o.choicenum + 1], a_thing);
 }
 
 void do__people() {
-	;
 	thinkabout(people[ddm_o.choicenum + 1], a_person);
 	last_person = people[ddm_o.choicenum + 1];
 }
 
 void do__with() {
-	;
 	thing = thinks;
 
 	if (thinkthing) {
-		;
 
 		thing += 49;
 
@@ -855,52 +783,44 @@ void do__with() {
 			person = '\376';
 
 	} else {
-		;
 		switch (verbstr[ddm_o.choicenum + 1]) {
 		case '\144': {
-			;
 			thing = '\144';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Beer */
 		case '\145': {
-			;
 			thing = '\62';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Wine */
 		case '\146': {
-			;
 			thing = '\146';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Whisky */
 		case '\147': {
-			;
 			thing = '\147';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Cider */
 		case '\150': {
-			;
 			thing = '\153';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Mead */
 		case '\151': {
-			;
 			thing = '\103';
 			callverb(vb_buy);
 			return;
 		}
 		break; /* Onion (trader) */
 		default: {
-			;
 			person = thing;
 			thing = '\376';
 		}
@@ -912,7 +832,6 @@ void do__with() {
 /*$F- That's all. Now for the ...bar procs. */
 
 void standard_bar() {   /* Standard menu bar */
-	;
 	ddm_m.init();
 	ddm_o.init();
 	{
@@ -941,11 +860,8 @@ begin;
 end;*/
 
 void checkclick() {   /* only for when the menu's displayed */
-	;
 	if (mpress > 0) {
-		;
 		if (mpy > 10) {
-			;
 			if (!((ddm_o.firstlix) &&
 			        ((mpx >= (cardinal)ddm_o.flx1 * 8) && (mpx <= (cardinal)ddm_o.flx2 * 8) &&
 			         (mpy >= 12) && (mpy <= (cardinal)ddm_o.fly)))) {
@@ -959,7 +875,6 @@ void checkclick() {   /* only for when the menu's displayed */
 	} else {
 		;     /* NOT clicked button... */
 		if (mrelease > 0) {
-			;
 			if ((ddm_o.firstlix) &&
 			        ((mrx >= (cardinal)ddm_o.flx1 * 8) && (mrx <= (cardinal)ddm_o.flx2 * 8) &&
 			         (mry >= 12) && (mry <= (cardinal)ddm_o.fly)))
@@ -969,9 +884,7 @@ void checkclick() {   /* only for when the menu's displayed */
 }
 
 void menu_link() {
-	;
 	{
-		;
 		if (! ddm_o.menunow)  return;
 
 		check(); /* find mouse coords & click information */
@@ -984,7 +897,6 @@ void menu_link() {
 			newpointer(1);
 			break;                 /* up-arrow */
 		case 11 ... 169: {
-			;
 			if ((mx >= (cardinal)ddm_o.flx1 * 8) && (mx <= (cardinal)ddm_o.flx2 * 8) && (my > 10) && (my <= (cardinal)ddm_o.fly))
 				newpointer(3); /* right-arrow */
 			else newpointer(4); /* fletch */
diff --git a/engines/avalanche/dwidth.cpp b/engines/avalanche/dwidth.cpp
index 56bf509..206ad21 100644
--- a/engines/avalanche/dwidth.cpp
+++ b/engines/avalanche/dwidth.cpp
@@ -37,7 +37,6 @@ file<fonttype> ff;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	assign(ff, "v:avalot.fnt");
 	reset(ff);
 	ff >> f;
diff --git a/engines/avalanche/edhead.cpp b/engines/avalanche/edhead.cpp
index 3aed1a3..af0eea9 100644
--- a/engines/avalanche/edhead.cpp
+++ b/engines/avalanche/edhead.cpp
@@ -72,7 +72,6 @@ edhead e;
 
 void info(string x) {     /* info on .ASG files */
 	varying_string<40> describe;
-	;
 	assign(f, x);
 	/*$I-*/ reset(f, 1);
 	seek(f, 47);
@@ -99,7 +98,6 @@ void info(string x) {     /* info on .ASG files */
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	info("tt.asg");
 
 	output << "Filename: " << x << NL;
diff --git a/engines/avalanche/enhanced.cpp b/engines/avalanche/enhanced.cpp
index bfe4274..befc4df 100644
--- a/engines/avalanche/enhanced.cpp
+++ b/engines/avalanche/enhanced.cpp
@@ -47,7 +47,6 @@ boolean isenh() {
 	boolean isenh_result;
 	isenh_result = false;
 	{
-		;
 		ah = 0x12;
 		intr(0x16, r);
 		statefrom16 = al;
@@ -55,7 +54,6 @@ boolean isenh() {
 	if (statefrom16 != shiftstate)  return isenh_result;
 	shiftstate = shiftstate ^ 0x20;
 	{
-		;
 		ah = 0x12;
 		intr(0x16, r);
 		statefrom16 = al;
@@ -76,7 +74,6 @@ void readkeye()
 {
 	registers r;
 	word fs;
-	;
 	if (atbios)
 		fs = fancystuff; /* We're using an AT */
 	else fs = notfancystuff; /* ditto, an XT */
@@ -96,7 +93,6 @@ boolean keypressede()
 {
 	registers r;
 	boolean keypressede_result;
-	;
 	if (atbios)
 		keypressede_result = fancystuff; /* ATs get the fancy stuff */
 	else keypressede_result = keypressed(); /* XTs get the usual primitive... */
@@ -110,7 +106,6 @@ public:
 static unit_enhanced_initialize enhanced_constructor;
 
 unit_enhanced_initialize::unit_enhanced_initialize() {
-	;
 	/* determine bios type */
 	atbios = isenh();
 }
diff --git a/engines/avalanche/filer.cpp b/engines/avalanche/filer.cpp
index b8e3c8b..a981617 100644
--- a/engines/avalanche/filer.cpp
+++ b/engines/avalanche/filer.cpp
@@ -108,9 +108,7 @@ boolean filefound;
 
 void shadow(integer x1, integer y1, integer x2, integer y2, byte hc, byte sc) {
 	byte fv;
-	;
 	for (fv = 0; fv <= border; fv ++) {
-		;
 		setfillstyle(1, hc);
 		bar(x1 + fv, y1 + fv, x1 + fv, y2 - fv);
 		bar(x1 + fv, y1 + fv, x2 - fv, y1 + fv);
@@ -123,7 +121,6 @@ void shadow(integer x1, integer y1, integer x2, integer y2, byte hc, byte sc) {
 
 void shbox(integer x1, integer y1, integer x2, integer y2, string t) {
 	const integer fc = 7;
-	;
 	shadow(x1, y1, x2, y2, 15, 8);
 	setfillstyle(1, fc);
 	bar(x1 + border + 1, y1 + border + 1, x2 - border - 1, y2 - border - 1);
@@ -132,7 +129,6 @@ void shbox(integer x1, integer y1, integer x2, integer y2, string t) {
 	y1 = (y2 - y1) / 2 + y1;
 	outtextxy(x1, y1, t);
 	if (length(t) > 1) {
-		;
 		fillchar(t[2], length(t) - 1, '\40');
 		t[1] = '_';
 		outtextxy(x1 - 1, y1 + 1, t);
@@ -141,7 +137,6 @@ void shbox(integer x1, integer y1, integer x2, integer y2, string t) {
 
 void show_drives() {
 	byte fv;
-	;
 	settextjustify(1, 1);
 	for (fv = 0; fv <= length(drives) - 1; fv ++)
 		shbox((fv % drlen) * 25 + 25, (fv / drlen) * 19 + 31,
@@ -151,7 +146,6 @@ void show_drives() {
 }
 
 void box(integer x1, integer y1, integer x2, integer y2, string z) {
-	;
 	rectangle(x1, y1, x2, y2);
 	outtextxy(x1 + 1, y1 - 10, z + ':');
 	outtextxy(x1, y1 - 9, "_");
@@ -160,7 +154,6 @@ void box(integer x1, integer y1, integer x2, integer y2, string z) {
 string lowstr(string x) {
 	byte fv;
 	string lowstr_result;
-	;
 	for (fv = 1; fv <= length(x); fv ++)
 		if (set::of(range('A', 'Z'), eos).has(x[fv]))  x[fv] += 32;
 	lowstr_result = x;
@@ -175,7 +168,6 @@ char lowchar(char x) {
 }
 
 void getcurrent() {
-	;
 	current = lowstr(fexpand("*.asg"));
 }
 
@@ -183,7 +175,6 @@ void setup() {
 	integer gd, gm;
 	registers r;
 	byte floppies;
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -271,12 +262,10 @@ void scandir() {
 	ednahead eh;
 	array<1, 4, char> dna_type;
 
-	;
 	nums[files] = 0;
 	findfirst("*.asg", archive + hidden + readonly, s);
 
 	while (doserror == 0) {
-		;
 		fsplit(s.name, nix, name, nix);
 		nums[files] += 1;
 		lists[files][nums[files]] = lowstr(name);
@@ -292,14 +281,12 @@ void scandir() {
 		} else {
 			;     /* EDNA-based files. */
 			if (dna_type == "EDNA") {
-				;
 				seek(f, 177);
 				blockread(f, eh, sizeof(eh));
 
 				if (eh.revision != 2)
 					descs[nums[files]] = "* Unknown EDNA type!";
 				else {
-					;
 
 					if (eh.number != 2)
 						descs[nums[files]] = string("* Saved by ") + eh.shortname + '!';
@@ -317,9 +304,7 @@ void scandir() {
 	nums[dirs] = 0;
 	findfirst("*.*", directory, s);
 	while (doserror == 0) {
-		;
 		if (((s.attr & directory) > 0) && ((length(s.name)) > 1)) {
-			;
 			nums[dirs] += 1;
 			lists[dirs][nums[dirs]] = lowstr(s.name);
 		}
@@ -339,7 +324,6 @@ void scandir() {
 
 void show_file(integer x, integer y, byte which) {
 	varying_string<58> z;
-	;
 	fillchar(z[1], 13, '\40');
 	z = lists[files][which] + ".asg";
 	z[0] = '\15';
@@ -355,11 +339,9 @@ void show_file(integer x, integer y, byte which) {
 
 void showfiles() {
 	byte fv;
-	;
 	if (loading)  setcolor(11);
 	else setcolor(3);
 	if (nums[3] == 0) {
-		;
 		outtextxy(22, 86, "(None here!)");
 		return;
 	}
@@ -370,7 +352,6 @@ void showfiles() {
 
 void showdirs() {
 	byte fv;
-	;
 	setcolor(11);
 	for (fv = 0; fv <= 8; fv ++)
 		if (where[4] + fv <= nums[4])
@@ -382,7 +363,6 @@ void show() {
 	dirstr d;
 	namestr n;
 	extstr e;
-	;
 	setfillstyle(1, 1);
 	for (fv = 1; fv <= 4; fv ++)
 		if (fv != 2) {
@@ -396,7 +376,6 @@ void show() {
 }
 
 void blip() {
-	;
 	sound(177);
 	delay(77);
 	nosound;
@@ -405,7 +384,6 @@ void blip() {
 void invert(integer x1, integer y1, integer x2, integer y2) {
 	pointer p, restore;
 	word s;
-	;
 	s = imagesize(x1, y1, x2, y2);
 	mark(restore);
 	getmem(p, s);
@@ -416,10 +394,8 @@ void invert(integer x1, integer y1, integer x2, integer y2) {
 
 void changedrive(char drive) {
 	byte fv;
-	;
 	fv = pos(drive, drives);
 	if (fv == 0)  {
-		;
 		blip();
 		return;
 	}
@@ -435,7 +411,6 @@ void changedrive(char drive) {
 }
 
 void highlight(byte win, byte line) {
-	;
 	switch (win) {
 	case 3:
 		invert(16, 75 + line * 10, 479, 85 + line * 10);
@@ -467,12 +442,9 @@ void repaint(byte whichwindow) {
 void fileblit(word xpos, word xlen, word y1, word y2, shortint dir, word ylen) {
 	word fv;
 	byte bit;
-	;
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		fv = 0;
 		while (fv < ylen) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -522,7 +494,6 @@ void pagedown(byte whichlist) {
 void subdirparse(string r);
 
 static void movehl(byte which, shortint howmuch) {
-	;
 	highlight(4, where[4] - top[4] + 1);
 	if (((where[which] + howmuch) > 0) && ((where[which] + howmuch) <= (unsigned char)nums[4]))
 		where[which] = where[which] + howmuch;
@@ -532,12 +503,10 @@ static void movehl(byte which, shortint howmuch) {
 
 
 static void change_dir() {
-	;
 	dusk();
 	/*$I-*/ chdir(lists[4][where[4]]);
 	/*$I+*/
 	if (ioresult != 0)  {
-		;
 		dawn();
 		blip();
 		return;
@@ -554,7 +523,6 @@ static void change_dir() {
 void subdirparse(string r)
 
 {
-	;
 	switch (r[1]) {
 	case creturn:
 		change_dir();
@@ -582,7 +550,6 @@ void subdirparse(string r)
 			if (where[4] - top[4] < 8) /* Down */
 				movehl(4, 1);
 			else if (top[4] + 8 < nums[4]) {
-				;
 				highlight(4, 9);
 				top[4] += 1;
 				where[4] += 1;
@@ -620,7 +587,6 @@ void fileinfo(byte which);
 
 
 static void display(integer y, string left, string right) {
-	;
 	y = 17 + y * 12;
 	settextjustify(2, 1);
 	setcolor(11);
@@ -638,7 +604,6 @@ void fileinfo(byte which)
 	varying_string<4> os;
 	char r;
 
-	;
 
 	/* Firstly, we must check whether or not it's an Avalot file. This is easily
 	  done, since the descriptions of all others always begin with a star. */
@@ -663,7 +628,6 @@ void fileinfo(byte which)
 	bar(2, 2, 637, 197); /* Interesting information coming up! */
 
 	{
-		;
 		display(2, "Saved by:", eh.game);
 		display(3, "version:", eh.verstr);
 
@@ -688,7 +652,6 @@ void filer_help()
 /* This gives general help. */
 {
 	char r;
-	;
 	outtextxy(100, 100, "Just general help here.");
 	shbox(500, 177, 650, 200, "Press any key...");
 	r = readkey();
@@ -701,7 +664,6 @@ void wipe()
 /* This allows you to delete files. */
 {
 	char r;
-	;
 	outtextxy(100, 100, "Are you sure you want to delete \"foo.bar\"?");
 	shbox(500, 177, 650, 200, "[Y/N]");
 	r = readkey();
@@ -713,7 +675,6 @@ void wipe()
 void filesparse(string r);
 
 static void movehl1(byte which, shortint howmuch) {
-	;
 	highlight(3, where[3] - top[3] + 1);
 	if (((where[which] + howmuch) > 0) && ((where[which] + howmuch) <= (unsigned char)nums[3]))
 		where[which] = where[which] + howmuch;
@@ -724,7 +685,6 @@ static void movehl1(byte which, shortint howmuch) {
 
 static boolean selected_file() {
 	boolean selected_file_result;
-	;
 	if (descs[where[file_win]][1] == '*') {
 		blip();
 		selected_file_result = false;
@@ -739,7 +699,6 @@ static boolean selected_file() {
 void filesparse(string r)
 
 {
-	;
 	switch (r[1]) {
 	case creturn:
 		if (selected_file())  return;
@@ -765,7 +724,6 @@ void filesparse(string r)
 			if (where[3] - top[3] < 8) /* Down */
 				movehl1(3, 1);
 			else if (top[3] + 8 < nums[3]) {
-				;
 				highlight(3, 9);
 				top[3] += 1;
 				where[3] += 1;
@@ -808,7 +766,6 @@ void filesparse(string r)
 string playaround();
 
 static void changewin(byte i) {
-	;
 	switch (nowwin) {
 	case 3:
 	case 4:
@@ -834,7 +791,6 @@ static void changewin(byte i) {
 string playaround() {
 	char r, r2;
 	string playaround_result;
-	;
 	filefound = false;
 	dawn();
 
@@ -850,7 +806,6 @@ string playaround() {
 			changewin(nowwin + 1);
 			break;
 		case cescape: {
-			;
 			playaround_result = "";
 			return playaround_result;
 		}
@@ -875,7 +830,6 @@ string playaround() {
 				changewin(4);
 				break;
 			case c_ac: {
-				;
 				playaround_result = "";
 				return playaround_result;
 			}
@@ -912,7 +866,6 @@ string playaround() {
 		}
 
 		if (filefound) {
-			;
 			dusk();
 			playaround_result = filename;
 			return playaround_result;
@@ -924,7 +877,6 @@ string playaround() {
 void do_filer() {
 	pathstr p;
 	void do_filer_result;
-	;
 	loading = true;
 	setup();
 	scandir();
@@ -938,7 +890,6 @@ void do_filer() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	filename = do_filer();
 	closegraph();
 	if (filename == "")
diff --git a/engines/avalanche/fileunit.cpp b/engines/avalanche/fileunit.cpp
index 6b1c9b1..11c82fa 100644
--- a/engines/avalanche/fileunit.cpp
+++ b/engines/avalanche/fileunit.cpp
@@ -804,7 +804,6 @@ void entername(char r) {
 		filefound = true;
 		break;
 	case '\40':
-		;
 		break; /* ignore spaces. */
 	default: {
 		if (length(filename) < 55)  filename = filename + r;
diff --git a/engines/avalanche/filing.cpp b/engines/avalanche/filing.cpp
index 78abec7..dce34e9 100644
--- a/engines/avalanche/filing.cpp
+++ b/engines/avalanche/filing.cpp
@@ -95,7 +95,6 @@ edhead e;
 
 void info256(string x) {     /* info on dna256 *.ASG files */
 	varying_string<40> describe;
-	;
 	assign(f, x);
 	/*$I-*/ reset(f, 1);
 	seek(f, 47);
@@ -103,7 +102,6 @@ void info256(string x) {     /* info on dna256 *.ASG files */
 	blockread(f, dna256, sizeof(dna256));
 	close(f); /*$I+*/
 	{
-		;
 		e.revision = 1;
 		e.game = "Denarius Avaricius Sextus";
 		e.shortname = "Avaricius";
@@ -128,16 +126,13 @@ void info256(string x) {     /* info on dna256 *.ASG files */
 
 string enlarge(string x) {
 	string enlarge_result;
-	;
 	switch (x[length(x)]) {
 	case '*': {
-		;
 		x[0] -= 1;
 		x = x + "uary";
 	}
 	break;
 	case '&': {
-		;
 		x[0] -= 1;
 		x = x + "ember";
 	}
@@ -150,7 +145,6 @@ string enlarge(string x) {
 string th(byte x) {
 	varying_string<4> n;
 	string th_result;
-	;
 	n = strf(x);
 	switch (x) {
 	case 1:
@@ -175,11 +169,9 @@ string th(byte x) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	info256("t:justb4.asg");
 
 	{
-		;
 		output << "DNA coding: ";
 		switch (e.revision) {
 		case 1:
diff --git a/engines/avalanche/folktemp.cpp b/engines/avalanche/folktemp.cpp
index 03da49f..c326182 100644
--- a/engines/avalanche/folktemp.cpp
+++ b/engines/avalanche/folktemp.cpp
@@ -64,12 +64,10 @@ void load() {
 	byte a0 /*absolute $A000:1200*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, "d:folk.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -81,7 +79,6 @@ void load() {
 }
 
 void get_one() {
-	;
 
 	gd = ((order[noo] % 9) * 70 + 10);
 	gm = ((order[noo] / 9) * 40 + 20);
@@ -94,7 +91,6 @@ void get_one() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/fontslid.cpp b/engines/avalanche/fontslid.cpp
index 3173c69..43dbd78 100644
--- a/engines/avalanche/fontslid.cpp
+++ b/engines/avalanche/fontslid.cpp
@@ -38,13 +38,11 @@ file<fonttype> f;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	assign(f, "v:avalot.fnt");
 	reset(f);
 	f >> font1;
 	close(f);
 	for (r = '\0'; r <= '\377'; r ++) {
-		;
 		for (fv = 0; fv <=  3; fv ++) font1[r][fv] = (cardinal)font1[r][fv] >> 1;
 		for (fv = 7; fv <=  8; fv ++) font1[r][fv] = font1[r][fv] << 1;
 		for (fv = 9; fv <= 14; fv ++) font1[r][fv] = font1[r][fv] << 2;
diff --git a/engines/avalanche/frere.cpp b/engines/avalanche/frere.cpp
index 257e2b3..fd4ffd4 100644
--- a/engines/avalanche/frere.cpp
+++ b/engines/avalanche/frere.cpp
@@ -57,7 +57,6 @@ byte value;
 tunetype played;
 
 void store_(byte what) {
-	;
 
 	move(played[2], played[1], sizeof(played) - 1);
 
@@ -68,11 +67,9 @@ void store_(byte what) {
 boolean they_match() {
 	byte fv;
 	boolean they_match_result;
-	;
 
 	for (fv = 1; fv <= sizeof(played); fv ++)
 		if (played[fv] != tune[fv]) {
-			;
 			they_match_result = false;
 			return they_match_result;
 		}
@@ -84,7 +81,6 @@ boolean they_match() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 
 	textattr = 30;
 	clrscr;
@@ -97,7 +93,6 @@ int main(int argc, const char *argv[]) {
 		value = pos(pressed, keys);
 
 		if (value > 0) {
-			;
 
 			last_one = this_one;
 			this_one = value;
@@ -117,7 +112,6 @@ int main(int argc, const char *argv[]) {
 					store_(higher);
 
 			if (they_match()) {
-				;
 				textattr = 94;
 				clrscr;
 				output << NL;
diff --git a/engines/avalanche/g-room.cpp b/engines/avalanche/g-room.cpp
index 8f84e53..2db249b 100644
--- a/engines/avalanche/g-room.cpp
+++ b/engines/avalanche/g-room.cpp
@@ -89,16 +89,13 @@ void plain_grab()
 /* Just grabs the next one and puts it where it's told to. */
 {
 	integer xx, yy, xofs;
-	;
 	blockread(f, cb, sizeof(cb));
 
 	switch (cb.flavour) {
 	case ch_one: {
-		;
 		xofs = cb.x / 8;
 		bit = 3;
 		for (yy = 0; yy <= cb.yl; yy ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -109,12 +106,10 @@ void plain_grab()
 	}
 	break;
 	case ch_ega: {
-		;
 		xofs = cb.x / 8;
 		bit = 3;
 		for (bit = 0; bit <= 3; bit ++)
 			for (yy = 0; yy <= cb.yl; yy ++) {
-				;
 				port[0x3c4] = 2;
 				port[0x3ce] = 4;
 				port[0x3c5] = 1 << bit;
@@ -128,24 +123,20 @@ void plain_grab()
 }
 
 void get_me(pointer &p) {
-	;
 	blockread(f, cb, sizeof(cb));
 	/* Take it for granted that cb.flavour = ch_BGI! */
 
 	{
-		;
 		getmem(p, cb.size);
 		blockread(f, p, cb.size);
 	}
 }
 
 void get_me_aargh(byte which) {
-	;
 	blockread(f, cb, sizeof(cb));
 	/* Take it for granted that cb.flavour = ch_BGI! */
 
 	{
-		;
 		getmem(aargh[which], cb.size);
 		blockread(f, aargh[which], cb.size);
 	}
@@ -231,7 +222,6 @@ void big_green_eyes(byte how) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	if (paramstr(1) != "jsb")  exit(255);
 	gd = 3;
 	gm = 0;
@@ -245,7 +235,6 @@ int main(int argc, const char *argv[]) {
 	mark(memlevel);
 
 	for (fv = 1; fv <= 5; fv ++) {
-		;
 		blockread(f, cb, sizeof(cb));
 		for (bit = 2; bit <= 3; bit ++)
 			for (y = 0; y <= cb.yl; y ++)
@@ -277,7 +266,6 @@ int main(int argc, const char *argv[]) {
 	glerk = new glerktype;
 
 	for (fv = 1; fv <= 6; fv ++) {
-		;
 		blockread(f, cb, sizeof(cb));
 		bit = 3;
 		for (bit = 0; bit <= 3; bit ++)
@@ -309,14 +297,11 @@ int main(int argc, const char *argv[]) {
 	bat_count = 0;
 
 	for (gd = 500; gd >= 217; gd --) {
-		;
 		if (set::of(range(22, 27), eos).has((gd % 30))) {
-			;
 			if ((gd % 30) == 27)  bar(gd, 135, gd + 16, 136);
 			putimage(gd, 136, eyes[0], 0);
 			putpixel(gd + 16, 137, 0);
 		} else {
-			;
 			if (gd % 30 == 21)  bar(gd, 137, gd + 17, 138);
 
 			putimage(gd, 135, eyes[0], 0);
@@ -325,13 +310,11 @@ int main(int argc, const char *argv[]) {
 
 		/* Plot the Glerk: */
 		if (gd % 10 == 0) {
-			;
 			glerkstage += 1;
 			if (glerkstage > 26)  flush();
 
 			for (gm = 0; gm <= 34; gm ++)
 				for (bit = 0; bit <= 3; bit ++) {
-					;
 					port[0x3c4] = 2;
 					port[0x3ce] = 4;
 					port[0x3c5] = 1 << bit;
@@ -354,7 +337,6 @@ int main(int argc, const char *argv[]) {
 	/* It descends... */
 
 	for (gm = -64; gm <= 103; gm ++) {
-		;
 		bit = getpixel(0, 0);
 
 		if (gm > 0)
@@ -363,7 +345,6 @@ int main(int argc, const char *argv[]) {
 		for (y = 0; y <= 65; y ++)
 			if ((y + gm) >= 0)
 				for (bit = 0; bit <= 3; bit ++) {
-					;
 					port[0x3c4] = 2;
 					port[0x3ce] = 4;
 					port[0x3c5] = 1 << bit;
@@ -382,7 +363,6 @@ int main(int argc, const char *argv[]) {
 
 	for (gd = 1; gd <= 4; gd ++)
 		for (fv = 1; fv <= 5; fv ++) {
-			;
 
 			y = getpixel(0, 0);
 
@@ -391,7 +371,6 @@ int main(int argc, const char *argv[]) {
 
 			for (y = 0; y <= 65; y ++)
 				for (bit = 0; bit <= 3; bit ++) {
-					;
 					port[0x3c4] = 2;
 					port[0x3ce] = 4;
 					port[0x3c5] = 1 << bit;
@@ -430,15 +409,12 @@ int main(int argc, const char *argv[]) {
 	red_greldet = false;
 
 	for (gd = 217; gd <= 479; gd ++) {
-		;
 		if (set::of(range(22, 27), eos).has((gd % 30))) {
-			;
 			if ((gd % 30) == 22)
 				bar(gd + 22, 134, gd + 38, 137);
 			putimage(gd + 23, 136, eyes[1], 0);
 			putpixel(gd + 22, 137, 0);
 		} else {
-			;
 			if (gd % 30 == 28)
 				bar(gd + 22, 135, gd + 38, 138);
 
@@ -448,7 +424,6 @@ int main(int argc, const char *argv[]) {
 
 		/* Plot the Green Eyes: */
 		if (gd % 53 == 5) {
-			;
 			big_green_eyes(glerkstage);
 			glerkstage += 1;
 		}
diff --git a/engines/avalanche/golden.cpp b/engines/avalanche/golden.cpp
index 2ea9aec..b5a6388 100644
--- a/engines/avalanche/golden.cpp
+++ b/engines/avalanche/golden.cpp
@@ -170,7 +170,6 @@ byte here() {
 void hold(word amount) {
 	*skellern = 0;
 	do {
-		;
 	} while (!(*skellern >= amount));
 }
 
@@ -408,7 +407,6 @@ int main(int argc, const char *argv[]) {
 	initgraph(gd, gm, "");
 
 	if (! nomusic)  do {
-			;
 		} while (!(ampgetrow >= 10));
 
 	setcolor(9);
@@ -440,7 +438,6 @@ int main(int argc, const char *argv[]) {
 				hold(15);
 			else
 				do {
-					;
 				} while (!(ampgetpattern > 2));
 			nexthangon = 2;
 			hangon(1);
@@ -469,7 +466,6 @@ int main(int argc, const char *argv[]) {
 		hold(25);
 	else
 		do {
-			;
 		} while (!(ampgetmodulestatus != md_playing));
 
 	setcolor(0);
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 25b2c00..bcdd4c1 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -311,7 +311,6 @@ void click() {   /* "Audio keyboard feedback" */
 void slowdown() {
 	/* repeat until TSkellern>=howlong; TSkellern:=0;*/
 	do {
-		;
 	} while (!(memw[storage_seg * skellern] >= howlong));
 	memw[storage_seg * skellern] = 0;
 }
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index d08bf86..7a7e2aa 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -348,7 +348,7 @@ const integer yw = 36; /* x width & y whatsit */
 const integer margin = 5;
 
 const array<1, 9, mp> mps = {
-	{	{
+	{   {
 			/* 1 - up-arrow */
 			{	{	{{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575}},
 					{{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}}
@@ -497,7 +497,7 @@ const integer run = 5;
 
 const array < '\226', '\262', byte > whereis =
     /* The Lads */
-{	{
+{   {
 		r__yours, /* Avvy */
 		r__spludwicks, /* Spludwick */
 		r__outsideyours, /* Crapulus */
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index 3074091..23ee068 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -57,7 +57,6 @@ boolean lmo;
 
 void hilight(integer x, integer y, byte c1, byte c2, string z) {
 	string w;
-	;
 	w = z;
 	w[1] = '\40';
 	setcolor(c1);
@@ -70,10 +69,8 @@ void hilight(integer x, integer y, byte c1, byte c2, string z) {
 }
 
 void showpage(byte x) {
-	;
 	if (x == page_)  return; /* twit */
 	if (x == 7)  {
-		;
 		lmo = true;
 		return;
 	}
@@ -81,7 +78,6 @@ void showpage(byte x) {
 	hidemousecursor;
 	settextjustify(1, 1);
 	if (page_ != 177) {
-		;
 		setfillstyle(1, 1);
 		bar(507, page_ * 25 + 2, 607, page_ * 25 + 22);
 		setfillstyle(1, 9);
@@ -228,7 +224,6 @@ void showpage(byte x) {
 
 void helpsetup() {
 	integer gd, gm;
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -246,7 +241,6 @@ void helpsetup() {
 	settextstyle(0, 0, 1);
 	settextjustify(1, 1);
 	for (gd = 2; gd <= 7; gd ++) {
-		;
 		setfillstyle(1, 1);
 		bar(507, gd * 25 + 2, 607, gd * 25 + 22);
 		setfillstyle(1, 9);
@@ -260,7 +254,6 @@ void helpsetup() {
 	lmo = false;
 	setfillstyle(1, 7);
 	for (gd = 1; gd <= 3; gd ++) {
-		;
 		bar(10 - gd * 3, 200 - gd * 3, 490 - gd * 6, 200 - gd * 3);
 		bar(490 - gd * 6, 37 - gd * 3, 491 - gd * 6, 200 - gd * 3);
 	}
@@ -268,7 +261,6 @@ void helpsetup() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	helpsetup();
 	do {
 		do {
@@ -299,7 +291,6 @@ int main(int argc, const char *argv[]) {
 		} else {
 			;     /* mouse choice */
 			if ((mousex > 400) && (mousey > 25)) {
-				;
 				showpage(mousey / 25);
 			}
 		}
diff --git a/engines/avalanche/help2.cpp b/engines/avalanche/help2.cpp
index 1ef6443..37e23ac 100644
--- a/engines/avalanche/help2.cpp
+++ b/engines/avalanche/help2.cpp
@@ -53,7 +53,6 @@ array<0, 9, byte> revpos;
 
 void loadfont() {
 	file<fonttype> fontfile;
-	;
 	assign(fontfile, "c:\\thomas\\ttsmall.fnt");
 	reset(fontfile);
 	fontfile >> font[1];
@@ -67,19 +66,16 @@ void loadfont() {
 void scribe(byte which, byte what);
 
 static void underline(byte &x) {
-	;
 	x = x | 177;
 }
 
 void scribe(byte which, byte what) {
 	byte fv, ff;
 	string x;
-	;
 	x = data[what];
 	fillchar(current, sizeof(current), '\0');
 	for (ff = 1; ff <= length(x); ff ++)
 		for (fv = 0; fv <= 7; fv ++) {
-			;
 			current[fv][ff] = font[which][x[ff]][fv];
 		}
 
@@ -93,18 +89,15 @@ void scribe(byte which, byte what) {
 }
 
 void display(word y) {
-	;
 	for (fv = 0; fv <= 7; fv ++)
 		move(current[fv], mem[0xa000 * (y + fv) * 80], 79);
 }
 
 void update_link(char which, byte whence, byte whither) {
 	byte fv;
-	;
 	for (fv = 1; fv <= numlinks; fv ++) {
 		hypertype &with = link[fv];
 		if (with.trigger == which) {
-			;
 			with.line = size;
 			with.start = whence;
 			with.finish = whither;
@@ -114,7 +107,6 @@ void update_link(char which, byte whence, byte whither) {
 
 void getlinks(string &x) {
 	byte p, q;
-	;
 	do {
 		p = pos("[", x);
 		if (p == 0)  return; /* lousy, huh? */
@@ -129,7 +121,6 @@ void loaddata(byte which) {
 	text t;
 	string x;
 	integer e;
-	;
 	revpos[9] = position;
 	fillchar(data, sizeof(data), '\0');
 	move(reverse[1], reverse[0], 9);
@@ -144,21 +135,17 @@ void loaddata(byte which) {
 	size = 0;
 	numlinks = 0;
 	while (! eof(t)) {
-		;
 		t >> x >> NL;
 		if (x[1] == ':') {
-			;
 			numlinks += 1;
 			{
 				hypertype &with = link[numlinks];
-				;
 				with.trigger = x[2];
 				Delete(x, 1, 3);
 				Delete(x, pos(" ", x), 255);
 				val(x, with.ref, e);
 			}
 		} else {
-			;
 			size += 1;
 			getlinks(x);
 			data[size] = x;
@@ -170,7 +157,6 @@ void loaddata(byte which) {
 }
 
 void screen() {
-	;
 	setbkcolor(1);
 	setfillstyle(1, 1);
 	bar(0, 0, 640, 38);
@@ -180,10 +166,8 @@ void screen() {
 
 void showscreen() {
 	byte fv;
-	;
 	if (position < 1)  position = 1;
 	for (fv = 0; fv <= 15; fv ++) {
-		;
 		scribe(1, fv + position);
 		display(41 + fv * 10);
 	}
@@ -191,11 +175,9 @@ void showscreen() {
 
 void up() {
 	byte fv;
-	;
 	position -= 1;
 	scribe(1, position);
 	for (fv = 0; fv <= 9; fv ++) {
-		;
 		move(mem[0xa000 * 3200], mem[0xa000 * 3280], 12720);
 		if (set::of(0, 9, eos).has(fv))  fillchar(mem[0xa000 * 3200], 79, '\0');
 		else
@@ -205,11 +187,9 @@ void up() {
 
 void down() {
 	byte fv;
-	;
 	position += 1;
 	scribe(1, position + 15);
 	for (fv = 0; fv <= 9; fv ++) {
-		;
 		move(mem[0xa000 * 3280], mem[0xa000 * 3200], 12720);
 		if (set::of(0, 9, eos).has(fv))  fillchar(mem[0xa000 * 15920], 79, '\0');
 		else
@@ -219,11 +199,9 @@ void down() {
 
 void newpage(char c) {
 	byte fv;
-	;
 	for (fv = 1; fv <= numlinks; fv ++) {
 		hypertype &with = link[fv];
 		if (with.trigger == c) {
-			;
 			loaddata(with.ref);
 			showscreen();
 		}
@@ -232,7 +210,6 @@ void newpage(char c) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -254,25 +231,21 @@ int main(int argc, const char *argv[]) {
 				if (position < size)  down();
 				break;
 			case 'I': {
-				;
 				position -= 16;
 				showscreen();
 			}
 			break;
 			case 'Q': {
-				;
 				position += 16;
 				showscreen();
 			}
 			break;
 			case 'G': {
-				;
 				position = 1;
 				showscreen();
 			}
 			break;
 			case 'O': {
-				;
 				position = size;
 				showscreen();
 			}
@@ -297,7 +270,6 @@ int main(int argc, const char *argv[]) {
 		}
 		break;
 		case 'H': {
-			;
 			loaddata(7); /* help on help */
 			showscreen();
 		}
diff --git a/engines/avalanche/helper.cpp b/engines/avalanche/helper.cpp
index 76948b8..622244e 100644
--- a/engines/avalanche/helper.cpp
+++ b/engines/avalanche/helper.cpp
@@ -264,7 +264,6 @@ void continue_help() {
 			if (fv > 0)
 				switch (buttons[fv].trigger) {
 				case '\0':/*null*/
-					;
 					break;
 				case '\376':
 					return;
diff --git a/engines/avalanche/hibits.cpp b/engines/avalanche/hibits.cpp
index 0131419..638f25d 100644
--- a/engines/avalanche/hibits.cpp
+++ b/engines/avalanche/hibits.cpp
@@ -33,7 +33,6 @@ string q;
 byte fv;
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	assign(inf, "v:thank.you");
 	assign(outf, "d:hibits.out");
 	reset(inf);
@@ -44,7 +43,6 @@ int main(int argc, const char *argv[]) {
 	for (fv = 1; fv <= length(q); fv ++) outf << q[fv];
 
 	while (! eof(inf)) {
-		;
 		inf >> x;
 		if (x < '\200')  x += 128;
 		outf << x;
diff --git a/engines/avalanche/highs.cpp b/engines/avalanche/highs.cpp
index 09d073d..bd8a5c3 100644
--- a/engines/avalanche/highs.cpp
+++ b/engines/avalanche/highs.cpp
@@ -53,10 +53,8 @@ highscoretype h;
 
 void get_new_highs() {
 	byte fv;
-	;
 	for (fv = 1; fv <= 12; fv ++) {
 		A1 &with = h[fv];
-		;
 		with.score = 32 - fv * 2;
 		with.rank = "...";
 	}
@@ -80,11 +78,9 @@ void show_highs()
 	byte fv;
 	varying_string<40> x;
 	varying_string<5> y;
-	;
 	display("HIGH SCORERS\3\r  Name\n\nScore   Rank\r  \"\"\"\"\n\n\"\"\"\"\"   \"\"\"\"\f\4");
 	for (fv = 1; fv <= 12; fv ++) {
 		A1 &with = h[fv];
-		;
 		display(string('\15') + with.name + '\4');
 		fillchar(x, sizeof(x), '\40');
 		y = strf(with.score);
@@ -99,7 +95,6 @@ void store_high(string who)
 /* This procedure shows the high-scores. */
 {
 	byte fv, ff;
-	;
 
 	for (fv = 1; fv <= 12; fv ++)
 		if (h[fv].score < dna.score)  flush();
@@ -110,7 +105,6 @@ void store_high(string who)
 
 	{
 		A1 &with = h[fv];
-		;
 		with.name = who;
 		with.score = dna.score;
 	}
@@ -119,7 +113,6 @@ void store_high(string who)
 
 void get_highs() {
 	file<highscoretype> f;
-	;
 	/*$I-*/
 	assign(f, "scores.avd");
 	reset(f);
@@ -142,7 +135,6 @@ public:
 static unit_highs_initialize highs_constructor;
 
 unit_highs_initialize::unit_highs_initialize() {
-	;
 	get_highs();
 }
 
diff --git a/engines/avalanche/hiz.cpp b/engines/avalanche/hiz.cpp
index 2f9e603..af924a0 100644
--- a/engines/avalanche/hiz.cpp
+++ b/engines/avalanche/hiz.cpp
@@ -46,9 +46,7 @@ byte tsr_int;
 word tsr_ax;
 
 void grab() {
-	;
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -58,9 +56,7 @@ void grab() {
 }
 
 void drop() {
-	;
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -70,14 +66,12 @@ void drop() {
 }
 
 void say(string x) {
-	;
 	grab();
 	output << string('\15') + x;
 }
 
 void pak(string x) {
 	char r;
-	;
 	say(x + " (press any key...)");
 	r = readkey();
 	drop();
@@ -87,33 +81,28 @@ string typein() {
 	char r;
 	string x;
 	string typein_result;
-	;
 	x = "";
 	do {
 		r = readkey();
 		switch (r) {
 		case '\10':
 			if (x[0] > '\0')  {
-				;
 				output << string('\10') + '\40' + '\10';
 				x[0] -= 1;
 			}
 			break;
 		case '\15': {
-			;
 			typein_result = x;
 			return typein_result;
 		}
 		break;
 		case '\33': {
-			;
 			typein_result = "";
 			return typein_result;
 		}
 		break;
 		default:
 			if (x[0] < '\62')  {
-				;
 				x = x + r;
 				output << r;
 			}
@@ -125,7 +114,6 @@ string typein() {
 void load() {
 	byte a /*absolute $A000:1200*/;
 	untyped_file f;
-	;
 	say("LOAD: filename?");
 	nam = typein();
 	drop();
@@ -133,20 +121,17 @@ void load() {
 	assign(f, nam);
 	reset(f, 1);
 	if (ioresult != 0) {
-		;
 		pak("LOAD: file not found.");
 		return;
 	}
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		blockread(f, a, 12080);
 		if (ioresult != 0) {
-			;
 			pak("LOAD: error whilst loading.");
 			close(f);
 			return;
@@ -164,14 +149,12 @@ void save() {
 	searchrec s;
 	char r;
 	byte a /*absolute $A000:1200*/;
-	;
 	say("SAVE: filename?");
 	nam = typein();
 	drop();
 	if (nam == "")  return;
 	findfirst(nam, anyfile, s);
 	if (doserror == 0) {
-		;
 		say("SAVE: That exists, are you sure\? (Y/N)");
 		do {
 			r = upcase(readkey());
@@ -185,14 +168,12 @@ void save() {
 	blockwrite(f, header[1], 146);
 	blockwrite(f, screenname, 31);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
 		port[0x3cf] = bit;
 		blockwrite(f, a, 12080);
 		if (ioresult != 0) {
-			;
 			pak("SAVE: error whilst saving.");
 			close(f);
 			return;
@@ -201,9 +182,7 @@ void save() {
 }
 
 void hedges() {
-	;
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -215,7 +194,6 @@ void hedges() {
 
 void reset_() {
 	registers regs;
-	;
 	regs.ax = 14;
 	intr(0x10, regs);
 	directvideo = false;
@@ -223,7 +201,6 @@ void reset_() {
 
 void do_pop() {
 	char r;
-	;
 	do {
 		say("HIZ: Load Save Hedges Reset eXit?");
 		r = upcase(readkey());
@@ -252,14 +229,12 @@ void do_pop() {
 
 void mypoprtn() {
 	registers r;
-	;
 	beginpop;
 	do_pop();
 	endpop;
 }
 /**********************/
 void stop_tsr() {
-	;
 	if (tsrexit)
 		output << "HIZ stopped" << NL;
 	else
@@ -273,7 +248,6 @@ void stop_tsr() {
 void tsr_intrtn(word flags, word cs, word ip, word ax, word bx, word cx, word dx, word si, word di, word ds, word es, word bp)
 /*interrupt;*/
 {
-	;
 	tsr_ax = ax;
 	cli;
 	beginint;
@@ -281,18 +255,15 @@ void tsr_intrtn(word flags, word cs, word ip, word ax, word bx, word cx, word dx
 
 	switch (tsr_ax) {
 	case 1: {
-		;
 		stop_tsr(); /* Terminate TSR, if poss.*/
 	}
 	break;
 	case 2: {
-		;
 		tsroff = true; /* Suspend TSR */
 		output << "HIZ suspended." << NL;
 	}
 	break;
 	case 3: {
-		;
 		tsroff = false;
 		output << "HIZ restarted" << NL;
 	}
@@ -310,7 +281,6 @@ boolean b;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 
 	/********************************************/
 	/* Check to see if TSR is already installed */
@@ -335,17 +305,14 @@ int main(int argc, const char *argv[]) {
 			else r.ax = 4;
 
 			if (r.ax < 4) {
-				;
 				intr(tsr_int, r);
 				return 0;
 			} else {
-				;
 				output << "HIZ: invalid parameter " << paramstr(1) << NL;
 				output << "Syntax: HIZ stop/hold/rstr" << NL;
 				return 0;
 			}
 		} else {
-			;
 			output << "HIZ already installed." << NL;
 			output << "(If you're sure it isn't, try running BLANKINT /I." << NL;
 			output << "It's in the TURBO directory.)" << NL;
diff --git a/engines/avalanche/initxf.cpp b/engines/avalanche/initxf.cpp
index 46ad0a4..ba91e79 100644
--- a/engines/avalanche/initxf.cpp
+++ b/engines/avalanche/initxf.cpp
@@ -40,14 +40,12 @@ inirex x;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	assign(i, "v:init0.dat");
 	reset(i);
 	assign(o, "v:init.avd");
 	rewrite(o);
 
 	while (! eof(i)) {
-		;
 		i >> x.a >> NL;
 		i >> x.num >> NL;
 		o << x;
diff --git a/engines/avalanche/inputtes.cpp b/engines/avalanche/inputtes.cpp
index bfb2db1..c1fbc21 100644
--- a/engines/avalanche/inputtes.cpp
+++ b/engines/avalanche/inputtes.cpp
@@ -39,9 +39,7 @@ char r;
 
 void plottext() {
 	byte x, y;
-	;
 	for (y = 0; y <= 7; y ++) {
-		;
 		for (x = 1; x <= length(current); x ++)
 			mem[0xa000 * 12880 + y * 80 + x] = font[current[x]][y];
 		fillchar(mem[0xa000 * 12881 + y * 80 + x], 79 - x, '\0');
@@ -50,7 +48,6 @@ void plottext() {
 
 void loadfont() {
 	file<fonttype> f;
-	;
 	assign(f, "c:\\thomas\\ttsmall.fnt");
 	reset(f);
 	f >> font;
@@ -59,7 +56,6 @@ void loadfont() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\turbo");
diff --git a/engines/avalanche/intro.cpp b/engines/avalanche/intro.cpp
index b23bd1c..b2583ac 100644
--- a/engines/avalanche/intro.cpp
+++ b/engines/avalanche/intro.cpp
@@ -263,7 +263,6 @@ void load_text() {
 			thisline += 1;
 			break;
 		case '\12':/*nop*/
-			;
 			break;
 		default:
 			x[thisline] = x[thisline] + *c;
@@ -631,7 +630,6 @@ int main(int argc, const char *argv[]) {
 		displaycounter += 1;
 
 		do {
-			;
 		} while (!(*skellern > 0));
 	}
 
diff --git a/engines/avalanche/ints.cpp b/engines/avalanche/ints.cpp
index f15e68b..3a9459c 100644
--- a/engines/avalanche/ints.cpp
+++ b/engines/avalanche/ints.cpp
@@ -37,18 +37,15 @@ void() old1b;
 boolean quicko;
 
 void new1b() {   /* interrupt; */
-	;
 	quicko = true;
 }
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	getintvec(0x1b, &old1b);
 	setintvec(0x1b, addr(new1b()));
 	quicko = false;
 	do {
-		;
 	} while (!quicko);
 	setintvec(0x1b, &old1b);
 	/*  r.ah:=$02; intr($16,r);
diff --git a/engines/avalanche/joysetup.cpp b/engines/avalanche/joysetup.cpp
index 7569199..1faef82 100644
--- a/engines/avalanche/joysetup.cpp
+++ b/engines/avalanche/joysetup.cpp
@@ -44,10 +44,8 @@ boolean detect() {
 	word x, y, xo, yo;
 	byte count;
 	boolean detect_result;
-	;
 	count = 0;
 	if (joystickpresent) {
-		;
 		detect_result = true;
 		return detect_result;
 	}
@@ -55,7 +53,6 @@ boolean detect() {
 	do {
 		if (count < 7)  count += 1; /* Take advantage of "flutter" */
 		if (count == 6) {
-			;
 			output << "The Bios says you don't have a joystick. However, it's often wrong" << NL;
 			output << "about such matters. So, do you? If you do, move joystick A to" << NL;
 			output << "continue. If you don't, press any key to cancel." << NL;
@@ -67,9 +64,7 @@ boolean detect() {
 }
 
 void display() {
-	;
 	{
-		;
 		gotoxy(20, 10);
 		output << "X min: " << js.xmin << "  ";
 		gotoxy(20, 11);
@@ -83,11 +78,9 @@ void display() {
 
 void getmaxmin() {
 	word x, y;
-	;
 	output << "Rotate the joystick around in a circle, as far from the centre as it" << NL;
 	output << "can get. Then click a button." << NL;
 	{
-		;
 		js.xmax = 0;
 		js.xmin = maxint;
 		js.ymax = 0;
@@ -96,7 +89,6 @@ void getmaxmin() {
 	do {
 		readjoya(x, y);
 		{
-			;
 			if (x < js.xmin)  js.xmin = x;
 			if (y < js.ymin)  js.ymin = y;
 			if (x > js.xmax)  js.xmax = x;
@@ -105,19 +97,16 @@ void getmaxmin() {
 		}
 	} while (!(buttona1 | buttona2));
 	do {
-		;
 	} while (!(~(buttona1 | buttona2)));
 	output << NL;
 	output << "Thank you. Now please centre your joystick and hit a button." << NL;
 	do {
-		;
 	} while (!(buttona1 | buttona2));
 	readjoya(js.xmid, js.ymid);
 }
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	textattr = 2;
 	clrscr;
 	output << "Avalot joystick setup routine- by TT. Thanks go to David B. Howorth." << NL;
diff --git a/engines/avalanche/joystick.cpp b/engines/avalanche/joystick.cpp
index 8b9496c..57efc18 100644
--- a/engines/avalanche/joystick.cpp
+++ b/engines/avalanche/joystick.cpp
@@ -83,7 +83,6 @@ boolean newbios() {
 /*$F+*/
 
 void oldreadjoy(byte xbit, byte ybit, word &xaxis, word &yaxis) {
-	;
 	/*
 	inline(
 	  $BA/$01/$02/    {mov  dx, 201h      ;load dx with joystick port address   }
diff --git a/engines/avalanche/loading.cpp b/engines/avalanche/loading.cpp
index 234b577..faacafc 100644
--- a/engines/avalanche/loading.cpp
+++ b/engines/avalanche/loading.cpp
@@ -36,14 +36,12 @@ untyped_file f;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
 	assign(f, "c:\\sleep\\test.ega");
 	reset(f, 1);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
diff --git a/engines/avalanche/logger.cpp b/engines/avalanche/logger.cpp
index 06c2f29..3b12251 100644
--- a/engines/avalanche/logger.cpp
+++ b/engines/avalanche/logger.cpp
@@ -79,14 +79,12 @@ byte scroll_line_length;
 
 void centre(byte size, byte x) { /* Prints req'd number of spaces. */
 	byte fv;
-	;
 	if (~ logging)  return;
 	for (fv = 1; fv <= size - (x / 2); fv ++)
 		output << logfile << ' ';
 }
 
 void log_setup(string name, boolean printing) {     /* Sets up. */
-	;
 	assign(logfile, name);
 	rewrite(logfile);
 	output << logfile << startwith;
@@ -102,10 +100,8 @@ void log_setup(string name, boolean printing) {     /* Sets up. */
 
 void log_divider() {   /* Prints the divider sign. */
 	byte fv;
-	;
 	if (~ logging)  return;
 	if (log_epson) {
-		;
 		output << logfile << string(' ') + double_width;
 		for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
 		output << logfile << string(' ') + double_off;
@@ -115,7 +111,6 @@ void log_divider() {   /* Prints the divider sign. */
 }
 
 void log_command(string x) {     /* Prints a command */
-	;
 	if (~ logging)  return;
 	if (log_epson)
 		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
@@ -124,14 +119,12 @@ void log_command(string x) {     /* Prints a command */
 }
 
 void log_addstuff(string x) {
-	;
 	if (~ logging)  return;
 	scroll_line = scroll_line + x;
 }
 
 void log_scrollchar(string x) {     /* print one character */
 	varying_string<2> z;
-	;
 	if (~ logging)  return;
 	switch (x[1]) {
 	case '`':
@@ -151,7 +144,6 @@ void log_scrollchar(string x) {     /* print one character */
 }
 
 void log_italic() {
-	;
 	if (~ logging)  return;
 	if (log_epson)
 		log_addstuff(italic);
@@ -160,7 +152,6 @@ void log_italic() {
 }
 
 void log_roman() {
-	;
 	if (~ logging)  return;
 	if (log_epson)
 		log_addstuff(italic_off);
@@ -169,20 +160,17 @@ void log_roman() {
 }
 
 void log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-	;
 	if (~ logging)  return;
 	if (log_epson)  log_addstuff(italic_off);
 }
 
 void log_scrollline() {   /* Set up a line for the scroll driver */
-	;
 	scroll_line_length = 0;
 	scroll_line = "";
 }
 
 void log_scrollendline(boolean centred) {
 	byte x, fv;
-	;
 	if (~ logging)  return;
 	x = 17;
 	if (centred)  x += (50 - scroll_line_length) / 2;
@@ -192,27 +180,22 @@ void log_scrollendline(boolean centred) {
 
 void log_bubbleline(byte linenum, byte whom, string x) {
 	byte fv;
-	;
 	if (~ logging)  return;
 	if (linenum == 1) {
-		;
 		for (fv = 1; fv <= 15; fv ++) output << logfile << ' ';
 		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
 	} else {
-		;
 		for (fv = 1; fv <= 17; fv ++) output << logfile << ' ';
 		output << logfile << x << NL;
 	}
 }
 
 void log_newline() {
-	;
 	if (logging)  output << logfile << NL;
 }
 
 void log_newroom(string where) {
 	byte fv;
-	;
 	if (~ logging)  return;
 	for (fv = 1; fv <= 20; fv ++) output << logfile << ' ';
 	if (log_epson)  output << logfile << emph_on;
@@ -224,7 +207,6 @@ void log_newroom(string where) {
 void log_aside(string what)
 /* This writes "asides" to the printer. For example, moves in Nim. */
 {
-	;
 	if (~ logging)  return;
 	output << logfile << "   (" << italic << what << italic_off << ')' << NL;
 	/* "What" is what to write. */
@@ -232,7 +214,6 @@ void log_aside(string what)
 
 void log_score(word credit, word now) {
 	byte fv;
-	;
 	if (~ logging)  return;
 	for (fv = 1; fv <= 50; fv ++) output << logfile << ' ';
 	output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 01916ce..f7afeec 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -111,7 +111,6 @@ void draw_also_lines() {
 		on_virtual();
 		break;
 	case 2 :
-		;
 		break; /* zzzz, it was off anyway */
 	case 3 :
 		on();
@@ -140,7 +139,6 @@ static void unscramble();
 
 static void scram1(string &x) {
 	byte fz;
-	;
 	for (fz = 1; fz <= length(x); fz ++)
 		x[fz] = chr(ord(x[fz]) ^ 177);
 }
@@ -1396,7 +1394,6 @@ void mblit(byte x1, byte y1, byte x2, byte y2, byte f, byte t) /* assembler; */
   pop ds; { Get it back again (or we'll be in trouble with TP!) }
 */
 {
-	;
 }
 
 void blitfix() {
@@ -1651,7 +1648,6 @@ asm
 
  @TheEnd: */
 {
-	;
 }
 
 void sprite_run()
diff --git a/engines/avalanche/magic2.cpp b/engines/avalanche/magic2.cpp
index 0845a05..c3822a3 100644
--- a/engines/avalanche/magic2.cpp
+++ b/engines/avalanche/magic2.cpp
@@ -38,7 +38,6 @@ word next, gg;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -48,12 +47,10 @@ int main(int argc, const char *argv[]) {
 	rewrite(out);
 	move(mem[0xa000 * 0], mem[0xa000 * pagetop], 16000);
 	while (! eof(magic)) {
-		;
 		magic >> next;
 		if (next != nextcode)
 			mem[0xa000 * next] = 255;
 		else {
-			;
 			for (gg = 0; gg <= 16000; gg ++)
 				if (mem[0xa000 * gg] != mem[0xa000 * gg + pagetop])
 					out << gg;
diff --git a/engines/avalanche/magidraw.cpp b/engines/avalanche/magidraw.cpp
index 0f280c2..32f8510 100644
--- a/engines/avalanche/magidraw.cpp
+++ b/engines/avalanche/magidraw.cpp
@@ -39,7 +39,6 @@ array<1, 16401, word> buffer;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -49,9 +48,8 @@ int main(int argc, const char *argv[]) {
 	close(magic);
 	/* while not eof(magic) do*/
 	for (gd = 1; gd <= 16401; gd ++) {
-		;
 		/*  read(magic,next);
-		  if next<>nextcode then*/
+		if next<>nextcode then*/
 		if (buffer[gd] != nextcode)
 			mem[0xa000 * buffer[gd]] = 255;
 		else
diff --git a/engines/avalanche/magishuf.cpp b/engines/avalanche/magishuf.cpp
index 2ef6e37..9d7edd7 100644
--- a/engines/avalanche/magishuf.cpp
+++ b/engines/avalanche/magishuf.cpp
@@ -43,20 +43,15 @@ circle c;
 file<circle> fc;
 
 void melt(byte c) {
-	;
 	for (gd = 1; gd <= 8000; gd ++) {
-		;
 		mem[0xa000 * b[gd]] = c;
 		if ((gd % 17) == 0)  delay(1);
 	}
 }
 
 void magicirc(byte cc) {
-	;
 	for (gd = 1; gd <= 16401; gd ++) {
-		;
 		if (c[gd] != nextcode) {
-			;
 			if (odd(c[gd]))  mem[0xa000 * c[gd] / 2] = cc;
 		} else
 			delay(1);
@@ -65,7 +60,6 @@ void magicirc(byte cc) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	r.ax = 13;
 	intr(0x10, r);
 	assign(f, "d:shuffle.avd");
diff --git a/engines/avalanche/make!.cpp b/engines/avalanche/make!.cpp
index a4cf278..4a4b274 100644
--- a/engines/avalanche/make!.cpp
+++ b/engines/avalanche/make!.cpp
@@ -38,14 +38,12 @@ string x;
 
 boolean subpix(integer x, integer y) {
 	boolean subpix_result;
-	;
 	subpix_result = getpixel(x, y) == 15;
 	return subpix_result;
 }
 
 byte pixel(integer x, integer y) {
 	byte pixel_result;
-	;
 	pixel_result = (byte)(
 	                   subpix(x * 4, y * 2) ||
 	                   subpix(x * 4 + 1, y * 2) ||
@@ -61,7 +59,6 @@ byte pixel(integer x, integer y) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 1;
 	initgraph(gd, gm, "o:");
@@ -76,7 +73,6 @@ int main(int argc, const char *argv[]) {
 	assign(t, "d:avalot.txt");
 	rewrite(t);
 	for (gm = 1; gm <= 36; gm ++) {
-		;
 		x = "";
 		for (gd = 1; gd <= 106; gd ++)
 			switch (getpixel(gd, gm * 2 + 181) * 2 + getpixel(gd, gm * 2 + 182)) {
diff --git a/engines/avalanche/makeregi.cpp b/engines/avalanche/makeregi.cpp
index 35b37d2..f3b5c4c 100644
--- a/engines/avalanche/makeregi.cpp
+++ b/engines/avalanche/makeregi.cpp
@@ -11,7 +11,7 @@
 
  * 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
+ * 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
@@ -29,143 +29,148 @@
 
 namespace Avalanche {
 
-const array<1,56,char> padding = 
-"For all the Etruscan armies were ranged beneath his eye";
+const array<1, 56, char> padding =
+    "For all the Etruscan armies were ranged beneath his eye";
 
-text txi,txo;
-string x,y;
+text txi, txo;
+string x, y;
 word fv;
 file<byte> f;
-byte sum,n;
-string name,number;
+byte sum, n;
+string name, number;
 
-string chkname,chknum,regname,regnum;
+string chkname, chknum, regname, regnum;
 
 
-   char decode1(char c)
-   {
-       byte b;
+char decode1(char c) {
+	byte b;
 
-     char decode1_result;
-     b=ord(c)-32;
-     decode1_result=chr(( (b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
-     return decode1_result;
-   }
+	char decode1_result;
+	b = ord(c) - 32;
+	decode1_result = chr(((b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
+	return decode1_result;
+}
 
-   char encode1(char c)
-   {
-       byte b;
+char encode1(char c) {
+	byte b;
 
-     char encode1_result;
-     b=ord(c);
-     b=( (cardinal)(b & 0x78) >> 3) + ((b & 0x7) << 4);
-     encode1_result=chr(b+32);
-     return encode1_result;
-   }
+	char encode1_result;
+	b = ord(c);
+	b = ((cardinal)(b & 0x78) >> 3) + ((b & 0x7) << 4);
+	encode1_result = chr(b + 32);
+	return encode1_result;
+}
 
-   char encode2(char c)
-   {
-     char encode2_result;
-     encode2_result=chr((((ord(c) & 0xf) << 2)+0x43));
-     return encode2_result;
-   }
+char encode2(char c) {
+	char encode2_result;
+	encode2_result = chr((((ord(c) & 0xf) << 2) + 0x43));
+	return encode2_result;
+}
 
-   string enc1(string x)
-   {
-       string y; byte fv;
+string enc1(string x) {
+	string y;
+	byte fv;
 
-     string enc1_result;
-     y=x; for( fv=1; fv <= length(y); fv ++) y[fv]=encode1(y[fv]);
-     enc1_result=y;
-     return enc1_result;
-   }
+	string enc1_result;
+	y = x;
+	for (fv = 1; fv <= length(y); fv ++) y[fv] = encode1(y[fv]);
+	enc1_result = y;
+	return enc1_result;
+}
 
-   string enc2(string x)
-   {
-       string y; byte fv;
+string enc2(string x) {
+	string y;
+	byte fv;
 
-     string enc2_result;
-     y=x; for( fv=1; fv <= length(y); fv ++) y[fv]=encode2(y[fv]);
-     enc2_result=y;
-     return enc2_result;
-   }
+	string enc2_result;
+	y = x;
+	for (fv = 1; fv <= length(y); fv ++) y[fv] = encode2(y[fv]);
+	enc2_result = y;
+	return enc2_result;
+}
 
-   boolean checker(string proper,string check)
-   {
-       byte fv; boolean ok;
+boolean checker(string proper, string check) {
+	byte fv;
+	boolean ok;
 
-     boolean checker_result;
-     ok=true;
-     for( fv=1; fv <= length(proper); fv ++)
-       if ((ord(proper[fv]) & 0xf)!=((cardinal)(ord(check[fv])-0x43) >> 2))
-              ok=false;
+	boolean checker_result;
+	ok = true;
+	for (fv = 1; fv <= length(proper); fv ++)
+		if ((ord(proper[fv]) & 0xf) != ((cardinal)(ord(check[fv]) - 0x43) >> 2))
+			ok = false;
 
-     checker_result=ok;
-     return checker_result;
-   }
+	checker_result = ok;
+	return checker_result;
+}
 
-  void unscramble()
-  {
-      byte namelen,numlen;
+void unscramble() {
+	byte namelen, numlen;
 
 
-    namelen=107-ord(x[1]); numlen=107-ord(x[2]);
+	namelen = 107 - ord(x[1]);
+	numlen = 107 - ord(x[2]);
 
-    regname=copy(x,3,namelen);
-    regnum=copy(x,4+namelen,numlen);
-    chkname=copy(x,4+namelen+numlen,namelen);
-    chknum=copy(x,4+namelen+numlen+namelen,numlen);
+	regname = copy(x, 3, namelen);
+	regnum = copy(x, 4 + namelen, numlen);
+	chkname = copy(x, 4 + namelen + numlen, namelen);
+	chknum = copy(x, 4 + namelen + numlen + namelen, numlen);
 
-    for( fv=1; fv <= namelen; fv ++) regname[fv]=decode1(regname[fv]);
-    for( fv=1; fv <= numlen; fv ++) regnum[fv]=decode1(regnum[fv]);
+	for (fv = 1; fv <= namelen; fv ++) regname[fv] = decode1(regname[fv]);
+	for (fv = 1; fv <= numlen; fv ++) regnum[fv] = decode1(regnum[fv]);
 
-    if ((! checker(regname,chkname)) || (! checker(regnum,chknum)))
-          {
-       output << "CHECK ERROR: " << regname << '/' << chkname << ';' << regnum << '/' << chknum << '.' << NL;
-       exit(0);
-     } else output << "--- Passed both checks. ---" << NL;
-  }
+	if ((! checker(regname, chkname)) || (! checker(regnum, chknum))) {
+		output << "CHECK ERROR: " << regname << '/' << chkname << ';' << regnum << '/' << chknum << '.' << NL;
+		exit(0);
+	} else output << "--- Passed both checks. ---" << NL;
+}
 
-int main(int argc, const char* argv[])
-{
+int main(int argc, const char *argv[]) {
 
- pio_initialize(argc, argv);
- output << "Name? "; input >> name >> NL;
- output << "Number? "; input >> number >> NL;
+	pio_initialize(argc, argv);
+	output << "Name? ";
+	input >> name >> NL;
+	output << "Number? ";
+	input >> number >> NL;
 
- x=string(chr(107-ord(name[0])))+chr(107-ord(number[0]));
+	x = string(chr(107 - ord(name[0]))) + chr(107 - ord(number[0]));
 
 
- x=x+enc1(name)+'J'+enc1(number)+enc2(name)+enc2(number);
+	x = x + enc1(name) + 'J' + enc1(number) + enc2(name) + enc2(number);
 
- number=""; fv=1;
- while ((length(number)+length(x))<57) 
- {
-   number=number+padding[fv-1]; fv=fv+1;
- }
- x=x+enc1(number);
+	number = "";
+	fv = 1;
+	while ((length(number) + length(x)) < 57) {
+		number = number + padding[fv - 1];
+		fv = fv + 1;
+	}
+	x = x + enc1(number);
 
 
- output << x << NL; output << NL;
- unscramble();
+	output << x << NL;
+	output << NL;
+	unscramble();
 
- assign(txi,"v:register.raw"); reset(txi);
- assign(txo,"a:register.dat"); rewrite(txo);
+	assign(txi, "v:register.raw");
+	reset(txi);
+	assign(txo, "a:register.dat");
+	rewrite(txo);
 
- for( fv=1; fv <= 53; fv ++)
- {
-  txi >> y >> NL; txo << y << NL;
- }
+	for (fv = 1; fv <= 53; fv ++) {
+		txi >> y >> NL;
+		txo << y << NL;
+	}
 
- txi >> y >> NL; txo << x << NL;
+	txi >> y >> NL;
+	txo << x << NL;
 
- while (! eof(txi)) 
- {
-  txi >> y >> NL; txo << y << NL;
- }
+	while (! eof(txi)) {
+		txi >> y >> NL;
+		txo << y << NL;
+	}
 
- close(txi); close(txo);
- return EXIT_SUCCESS;
+	close(txi);
+	close(txo);
+	return EXIT_SUCCESS;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/makesez.cpp b/engines/avalanche/makesez.cpp
index 1307f17..cba5b61 100644
--- a/engines/avalanche/makesez.cpp
+++ b/engines/avalanche/makesez.cpp
@@ -46,14 +46,12 @@ char check;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	fillchar(x, sizeof(x), '\261');
 	x = string("This is a Sez file for an Avvy game, and its contents are subject") + crlf +
 	    "to copyright. Have fun with the game!" + crlf + crlf + tabs + "tt" + crlf + crlf +
 	    "[Lord Avalot D'Argent]" + crlf + crlf + eof_ +
 	    crlf + crlf + "Thomas was here!";
 	{
-		;
 		header.initials = "TT";
 		header.gamecode = 2; /* code for Avalot */
 		header.revision = 100; /* version 1.00 */
diff --git a/engines/avalanche/makevmou.cpp b/engines/avalanche/makevmou.cpp
index 3b71276..4d3b3ba 100644
--- a/engines/avalanche/makevmou.cpp
+++ b/engines/avalanche/makevmou.cpp
@@ -46,7 +46,7 @@ struct vmctype { /* Virtual Mouse Cursor */
 };
 
 const array<1, 9, arrowtype> mps = {
-	{	{
+	{   {
 			/* 1 - up-arrow */
 			((65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575),
 			(0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0)),
@@ -135,15 +135,12 @@ integer plx, ply;
 
 word swapbits(word a) {
 	word swapbits_result;
-	;
 	swapbits_result = lo(a) * 256 + hi(a);
 	return swapbits_result;
 }
 
 void plot_vmc(integer xx, integer yy, byte page_) {
-	;
 	{
-		;
 		xx = xx + vmc.ofsx;
 		yy = yy + vmc.ofsy;
 
@@ -152,7 +149,6 @@ void plot_vmc(integer xx, integer yy, byte page_) {
 		putimage(xx, yy, vmc.xorpic, xorput);
 		{
 			pointtype &with1 = vmc.wherewas[page_];
-			;
 			with1.x = xx;
 			with1.y = yy;
 		}
@@ -160,7 +156,6 @@ void plot_vmc(integer xx, integer yy, byte page_) {
 }
 
 void wipe_vmc(byte page_) {
-	;
 	{
 		pointtype &with1 = vmc.wherewas[page_];
 		if (with1.x != maxint)
@@ -170,16 +165,13 @@ void wipe_vmc(byte page_) {
 
 void setup_vmc() {
 	byte fv;
-	;
 	/* gd:=imagesize(0,0,15,15);*/
 
 	{
-		;
 		getmem(vmc.andpic, mouse_size);
 		getmem(vmc.xorpic, mouse_size);
 
 		for (fv = 0; fv <= 1; fv ++) {
-			;
 			getmem(vmc.backpic[fv], mouse_size);
 			vmc.wherewas[fv].x = maxint;
 		}
@@ -187,13 +179,11 @@ void setup_vmc() {
 }
 
 void show_off_mouse() {
-	;
 
 	setcolor(14);
 	settextstyle(0, 0, 2);
 
 	for (gm = 0; gm <= 1; gm ++) {
-		;
 		setactivepage(gm);
 		setfillstyle(1, blue);
 		bar(0, 0, getmaxx(), getmaxy());
@@ -212,7 +202,6 @@ void show_off_mouse() {
 		wipe_vmc(gd);
 
 		if (plot > 0) {
-			;
 			putpixel(plx, ply, red);
 			plot -= 1;
 		}
@@ -220,7 +209,6 @@ void show_off_mouse() {
 		plot_vmc(mx, my, gd);
 
 		if ((mkey == left) && (plot == 0)) {
-			;
 			plot = 2;
 			plx = mx;
 			ply = my;
@@ -229,7 +217,6 @@ void show_off_mouse() {
 	} while (!(mkey == right));
 
 	for (gm = 0; gm <= 1; gm ++) {
-		;
 		setactivepage(1 - gm);
 		wipe_vmc(gm);
 	}
@@ -239,7 +226,6 @@ void show_off_mouse() {
 }
 
 void grab_cursor(byte n) {
-	;
 	getimage(32 * n - 16, 0, 32 * n - 1, 15, vmc.andpic);
 	getimage(32 * n - 16, 20, 32 * n - 1, 35, vmc.xorpic);
 }
@@ -247,14 +233,12 @@ void grab_cursor(byte n) {
 void save_mice() {
 	untyped_file f;
 	byte fv;
-	;
 	assign(f, "v:mice.avd");
 	rewrite(f, 1);
 
 	blockwrite(f, mice_header, mouse_size);
 
 	for (fv = 1; fv <= 9; fv ++) {
-		;
 		grab_cursor(fv);
 		putimage(100, 100, vmc.xorpic, 0);
 		blockwrite(f, vmc.andpic, mouse_size);
@@ -266,19 +250,16 @@ void save_mice() {
 
 void load_a_mouse(byte which) {
 	untyped_file f;
-	;
 	assign(f, "v:mice.avd");
 	reset(f, 1);
 	seek(f, mouse_size * 2 * (which - 1) + 134);
 
 	{
-		;
 		blockread(f, vmc.andpic, mouse_size);
 		blockread(f, vmc.xorpic, mouse_size);
 		close(f);
 		{
 			void &with1 = mps[which];
-			;
 			vmc.ofsx = -horzhotspot;
 			vmc.ofsy = -verthotspot;
 
@@ -290,7 +271,6 @@ void load_a_mouse(byte which) {
 }
 
 void draw_mouse_cursors() {
-	;
 	for (fv = 1; fv <= 9; fv ++)
 		for (gm = 0; gm <= 1; gm ++)
 			for (gd = 0; gd <= 15; gd ++)
@@ -299,7 +279,6 @@ void draw_mouse_cursors() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
diff --git a/engines/avalanche/minstran.cpp b/engines/avalanche/minstran.cpp
index 3a88863..b607964 100644
--- a/engines/avalanche/minstran.cpp
+++ b/engines/avalanche/minstran.cpp
@@ -37,14 +37,11 @@ void mblit(integer x1, integer y1, integer x2, integer y2) { /* Minstrel Blitter
 	integer yy, len, pp;
 	byte bit;
 	const integer offset = 16384;
-	;
 	x1 = x1 / 8;
 	len = ((x2 / 8) - x1) + 1;
 	for (yy = y1; yy <= y2; yy ++) {
-		;
 		pp = yy * 80 + x1;
 		for (bit = 0; bit <= 3; bit ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -61,7 +58,6 @@ const integer fy2 = 145;
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
diff --git a/engines/avalanche/newsprit.cpp b/engines/avalanche/newsprit.cpp
index e5c4774..579799a 100644
--- a/engines/avalanche/newsprit.cpp
+++ b/engines/avalanche/newsprit.cpp
@@ -73,9 +73,7 @@ untyped_file out;
 integer bigsize;
 
 void copyaoa() {
-	;
 	{
-		;
 		a.name = oa.name;
 		a.comment = "Transferred";
 		a.num = oa.num;
@@ -90,7 +88,6 @@ void copyaoa() {
 
 void setup() {
 	integer gd, gm;
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -99,7 +96,6 @@ void setup() {
 string strf(longint x) {
 	string q;
 	string strf_result;
-	;
 	str(x, q);
 	strf_result = q;
 	return strf_result;
@@ -112,10 +108,8 @@ void save() {
 	byte xw;
 	byte nxl, nyl;
 	word soa;
-	;
 	cleardevice();
 	{
-		;
 		a.xl = 45;
 		a.yl = 10;
 		a.num = 1;
@@ -136,7 +130,6 @@ void save() {
 		if ((nxl % 8) > 0)  xw += 1;
 
 		for (n = 1; n <= a.num; n ++) {
-			;
 			getimage(0, 0, a.xl, a.yl, aa);
 			for (fv = 0; fv <= nyl; fv ++)
 				blockwrite(out, aa[5 + fv * xw * 4], xw);
@@ -149,7 +142,6 @@ void save() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	setup();
 	save();
 
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 238908c..9c1f2c6 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -50,20 +50,17 @@ shortint mnum, mrow;
 registers r;
 
 void resetmouse() {
-	;
 	r.ax = 0;
 	intr(0x33, r);
 	squeak = r.ax > 0;
 }
 
 void show() {
-	;
 	r.ax = 1;
 	intr(0x33, r);
 }
 
 void hide() {
-	;
 	r.ax = 2;
 	intr(0x33, r);
 }
@@ -71,9 +68,7 @@ void hide() {
 void chalk(integer x, integer y, string z) {
 	const array<0, 3, byte> greys = {{0, 8, 7, 15}};
 	byte fv;
-	;
 	for (fv = 0; fv <= 3; fv ++) {
-		;
 		setcolor(greys[fv]);
 		outtextxy(x - fv, y, z);
 		sound(fv * 100 * length(z));
@@ -87,7 +82,6 @@ void setup() {
 	untyped_file f;
 	integer gd, gm;
 	byte bit;
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -97,7 +91,6 @@ void setup() {
 	seek(f, 41);
 	for (gm = 0; gm <= 22; gm ++)
 		for (bit = 0; bit <= 3; bit ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -107,7 +100,6 @@ void setup() {
 	for (gd = 1; gd <= 3; gd ++)
 		for (gm = 0; gm <= 22; gm ++)
 			for (bit = 0; bit <= 3; bit ++) {
-				;
 				port[0x3c4] = 2;
 				port[0x3ce] = 4;
 				port[0x3c5] = 1 << bit;
@@ -116,7 +108,6 @@ void setup() {
 			}
 	for (gm = 0; gm <= 36; gm ++)
 		for (bit = 0; bit <= 3; bit ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -161,11 +152,9 @@ void setup() {
 void plotstone(byte x, byte y) {
 	byte fv, bit;
 	word ofs;
-	;
 	ofs = 3200 + y * 2800 + x * 8;
 	for (fv = 0; fv <= 22; fv ++)
 		for (bit = 0; bit <= 3; bit ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -176,7 +165,6 @@ void plotstone(byte x, byte y) {
 
 void board() {
 	byte fv, ff;
-	;
 	for (fv = 1; fv <= 3; fv ++)
 		for (ff = 1; ff <= stones[fv]; ff ++)
 			plotstone(ff, fv);
@@ -185,7 +173,6 @@ void board() {
 void startmove() {
 	varying_string<2> tstr;
 	integer ypos;
-	;
 	turns += 1;
 	str(turns, 2, tstr);
 	ypos = 63 + turns * 10;
@@ -197,7 +184,6 @@ void startmove() {
 
 void show_changes() {
 	byte fv, ff, fq;
-	;
 	chalk(573, 63 + turns * 10, string(chr(64 + row)) + chr(48 + number));
 	for (fv = 1; fv <= 3; fv ++)
 		if (old[fv] > stones[fv])
@@ -209,7 +195,6 @@ void show_changes() {
 void checkmouse();
 
 static void blip() {
-	;
 	sound(1771);
 	delay(3);
 	nosound;
@@ -217,9 +202,7 @@ static void blip() {
 }
 
 void checkmouse() {
-	;
 	{
-		;
 		ax = 5;
 		bx = 0;
 	}
@@ -237,20 +220,17 @@ void checkmouse() {
 void takesome();
 
 static void less() {
-	;
 	if (number > 1)  number -= 1;
 }
 
 void takesome() {
 	char r;
 	byte sr;
-	;
 	number = 1;
 	do {
 		do {
 			sr = stones[row];
 			if (sr == 0)  {
-				;
 				row = row % 3 + 1;
 				number = 1;
 			}
@@ -270,12 +250,10 @@ void takesome() {
 		rectangle(63 + (sr - number) * 64, 38 + 35 * row, 54 + sr * 64, 63 + 35 * row);
 
 		if (clicked) {
-			;
 			number = mnum;
 			row = mrow;
 			return;
 		} else {
-			;
 			switch (r) {
 			case '\0':
 				switch (readkey()) {
@@ -327,7 +305,6 @@ void takesome() {
 
 void endofgame() {
 	char rr;
-	;
 	chalk(595, 63 + turns * 10, "Wins!");
 	outtextxy(100, 190, "- - -   Press any key...  - - -");
 	while (keypressed())  rr = readkey();
@@ -360,10 +337,8 @@ static boolean find(byte x)
 	boolean q;
 	byte p;
 	boolean find_result;
-	;
 	q = false;
 	for (p = 1; p <= 3; p ++) if (stones[p] == x)  {
-			;
 			q = true;
 			inap[p] = true;
 		}
@@ -375,7 +350,6 @@ static boolean find(byte x)
 
 static void find_ap(byte start, byte stepsize) {
 	byte ff;
-	;
 	matches = 0;
 	fillchar(inap, sizeof(inap), '\0'); /* blank 'em all */
 	for (ff = 0; ff <= 2; ff ++) if (find(start + ff * stepsize))  matches += 1;
@@ -388,7 +362,6 @@ static void find_ap(byte start, byte stepsize) {
 
 	switch (matches) {
 	case 2: {
-		;
 		for (ff = 1; ff <= 3; ff ++) /* find which one didn't fit the A.P. */
 			if (! inap[ff])  ooo = ff;
 		if (stones[ooo] > (start + thisone * stepsize)) { /* check it's possible! */
@@ -416,13 +389,10 @@ void dogfood() {
 	boolean sorted;
 	byte temp;
 
-	;
 	live = 0;
 	lmo = false;
 	for (fv = 1; fv <= 3; fv ++) {
-		;
 		if (stones[fv] > 0) {
-			;
 			live += 1;
 			r[live] = fv;
 			sr[live] = stones[fv];
@@ -430,22 +400,18 @@ void dogfood() {
 	}
 	switch (live) {
 	case 1: { /* Only one is free- so take 'em all */
-		;
 		row = r[1];
 		number = stones[r[1]];
 		return;
 	}
 	break;
 	case 2: { /* Two are free- make them equal */
-		;
 		if (sr[1] > sr[2]) {
-			;
 			row = r[1];
 			number = sr[1] - sr[2];
 			return;
 		} else       /* T > b */
 			if (sr[1] < sr[2]) {
-				;
 				row = r[2];
 				number = sr[2] - sr[1];
 				return;
@@ -458,15 +424,13 @@ void dogfood() {
 	}
 	break;
 	case 3: { /* Ho hum... this'll be difficult! */
-		;
 		/* There are three possible courses of action when we have 3 lines left:
-		    1) Look for 2 equal lines, then take the odd one out.
-		    2) Look for A.P.s, and capitalise on them.
-		    3) Go any old where. */
+		1) Look for 2 equal lines, then take the odd one out.
+		2) Look for A.P.s, and capitalise on them.
+		3) Go any old where. */
 
 		for (fv = 1; fv <= 3; fv ++) /* Look for 2 equal lines */
 			if (stones[other[fv][1]] == stones[other[fv][2]]) {
-				;
 				row = fv;  /* this row */ number = stones[fv]; /* all of 'em */ return;
 			}
 
@@ -474,7 +438,6 @@ void dogfood() {
 			sorted = true;
 			for (fv = 1; fv <= 2; fv ++)
 				if (sr[fv] > sr[fv + 1]) {
-					;
 					temp = sr[fv + 1];
 					sr[fv + 1] = sr[fv];
 					sr[fv] = temp;
@@ -486,7 +449,6 @@ void dogfood() {
 		} while (!sorted);
 		/* Now we look for A.P.s ... */
 		for (fv = 1; fv <= 3; fv ++) {
-			;
 			find_ap(fv, 1); /* there are 3 "1"s */
 			if (lmo)  return; /* cut-out */
 		}
@@ -504,7 +466,6 @@ void dogfood() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	setup();
 	board();
 	do {
diff --git a/engines/avalanche/nimdraw.cpp b/engines/avalanche/nimdraw.cpp
index 9464d64..7a40e93 100644
--- a/engines/avalanche/nimdraw.cpp
+++ b/engines/avalanche/nimdraw.cpp
@@ -36,7 +36,6 @@ untyped_file f;
 byte bit;
 
 void plot(char ch, byte x) {
-	;
 	setcolor(blue);
 	outtextxy(x * 80 + 4, 0, ch);
 	outtextxy(x * 80 + 10, 0, ch);
@@ -56,7 +55,6 @@ void load() {
 	varying_string<12> check;
 	untyped_file f;
 	word s;
-	;
 	assign(f, "c:\\avalot\\nimstone.avd");
 	reset(f, 1);
 	seek(f, 85);
@@ -71,7 +69,6 @@ void load() {
 
 void spludge(integer x, integer y, string z) {
 	shortint dx, dy;
-	;
 	setcolor(15);
 	for (dx = -1; dx <= 1; dx ++)
 		for (dy = -1; dy <= 1; dy ++)
@@ -82,7 +79,6 @@ void spludge(integer x, integer y, string z) {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -123,7 +119,6 @@ int main(int argc, const char *argv[]) {
 	for (gd = 0; gd <= 3; gd ++)
 		for (gm = 7; gm <= 29; gm ++)
 			for (bit = 0; bit <= 3; bit ++) {
-				;
 				port[0x3c4] = 2;
 				port[0x3ce] = 4;
 				port[0x3c5] = 1 << bit;
@@ -132,7 +127,6 @@ int main(int argc, const char *argv[]) {
 			}
 	for (gm = 99; gm <= 135; gm ++)
 		for (bit = 0; bit <= 3; bit ++) {
-			;
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
diff --git a/engines/avalanche/oldfiler.cpp b/engines/avalanche/oldfiler.cpp
index 581f68a..e38ec30 100644
--- a/engines/avalanche/oldfiler.cpp
+++ b/engines/avalanche/oldfiler.cpp
@@ -57,10 +57,8 @@ string answer;
 
 void split(string x) {
 	byte fv;
-	;
 	x = copy(x, 4, 255);
 	if (x == "")  {
-		;
 		blank[0] = true;
 		return;
 	}
@@ -68,7 +66,6 @@ void split(string x) {
 	possible[0][1] = "b\\";
 	fv = 2;
 	while (pos("\\", x) != 0) {
-		;
 		possible[0][fv] = string('b') + copy(x, 1, pos("\\", x) - 1);
 		fv += 1;
 		x = copy(x, pos("\\", x) + 1, 255);
@@ -77,7 +74,6 @@ void split(string x) {
 }
 
 void block(integer x1, integer y1, integer x2, integer y2, string x) {
-	;
 	bar(x1, y1, x2, y2);
 	setcolor(9);
 	outtextxy(x1 + (x2 - x1) / 2 - 1, y1 + 5, x);
@@ -86,12 +82,10 @@ void block(integer x1, integer y1, integer x2, integer y2, string x) {
 }
 
 void message(string x) {
-	;
 	block(5, 189, 640, 200, x);
 }
 
 void bigbar(byte x) {
-	;
 	bar(15 + 210 * x, 36, 210 + 210 * x, 187);
 }
 
@@ -101,11 +95,9 @@ void getem();
 static void sub_getem(char prefix, string spec, byte attrib, byte infonum) {
 	searchrec s;
 	byte fv;
-	;
 	fv = 0;
 	findfirst(spec, attrib, s);
 	while ((doserror == 0) && (fv < 100)) {
-		;
 		if (((s.attr & attrib) > 0) && (s.name[1] != '.')) {
 			;     /* circumvent inclusive searching! */
 			fv += 1;
@@ -119,7 +111,6 @@ static void sub_getem(char prefix, string spec, byte attrib, byte infonum) {
 void getem()
 
 {
-	;
 	message("Please wait... scanning directory...");
 	sub_getem('a', "*.asg", archive + hidden, 1); /* Scan for .ASG files */
 	sub_getem('f', "*.*", directory, 2); /* Scan for sub-directories */
@@ -127,16 +118,13 @@ void getem()
 
 void minisc(string &x) {        /* Converts to lower-case */
 	byte fv;
-	;
 	for (fv = 1; fv <= length(x); fv ++)
 		if ((x[fv] >= 'A') && (x[fv] <= 'Z'))  x[fv] += 32;
 }
 
 void showall() {
 	byte fv, ff;
-	;
 	for (fv = 0; fv <= 2; fv ++) {
-		;
 		bigbar(fv); /* blank out anything else */
 		if (blank[fv]) {
 			;     /* nothing here at all */
@@ -151,7 +139,6 @@ void showall() {
 			;     /* something here- what? */
 			setcolor(11);
 			for (ff = 0; ff <= 15; ff ++) {
-				;
 				info[fv][ff + 2] = possible[fv][page_[fv] * 15 + ff + 1];
 				minisc(info[fv][ff + 2]);
 			}
@@ -161,7 +148,6 @@ void showall() {
 				info[fv][18] = down;
 			else info[fv][18] = "";
 			for (ff = 1; ff <= 18; ff ++) {
-				;
 				outtextxy(113 + 210 * fv, 35 + ff * 8, copy(info[fv][ff], 2, 255));
 			}
 		}
@@ -170,7 +156,6 @@ void showall() {
 }
 
 void changedir(string x) {
-	;
 
 	chdir(x);
 	getdir(0, cdir);
@@ -178,7 +163,6 @@ void changedir(string x) {
 
 void drawup() {
 	integer gd;
-	;
 	block(15, 0, 630, 10, "Choose an .ASG file to load or save.");
 	block(15, 24, 210, 34, "Looking back:");
 	block(225, 24, 420, 34, "Here:");
@@ -188,7 +172,6 @@ void drawup() {
 }
 
 void setup() {
-	;
 	settextjustify(1, 1);
 	setfillstyle(1, 1);
 	fillchar(blank, sizeof(blank), '\0');
@@ -202,7 +185,6 @@ void setup() {
 
 void setup1() {
 	integer gd, gm;
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -224,7 +206,6 @@ void clickwait() {
 		}
 	};
 	byte oldcht; /* Click Here To... code */
-	;
 	showmousecursor;
 	oldcht = 177;
 	do {
@@ -241,7 +222,6 @@ void clickwait() {
 				chtcode = 4;
 			}
 		if (oldcht != chtcode) {
-			;
 			hidemousecursor;
 			message(string("Click here to ") + msg[chtcode]);
 			showmousecursor;
@@ -253,7 +233,6 @@ void clickwait() {
 }
 
 void blip() {
-	;
 	sound(32);
 	delay(3);
 	nosound;
@@ -263,7 +242,6 @@ void do_cht() {
 	char r;
 	byte fv;
 	string x;
-	;
 	if (chtcode == 1) {
 		;     /* change drives */
 		message("Enter the drive letter (e.g. A)...");
@@ -271,7 +249,6 @@ void do_cht() {
 		changedir(string(r) + ':');
 		setup();
 	} else {
-		;
 		x = info[chtcode - 2][where];
 		r = x[1];
 		x = copy(x, 2, 255);
@@ -312,7 +289,6 @@ void do_cht() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	setup1();
 	do {
 		clickwait();
diff --git a/engines/avalanche/oldhighs.cpp b/engines/avalanche/oldhighs.cpp
index b53768f..c95b9a2 100644
--- a/engines/avalanche/oldhighs.cpp
+++ b/engines/avalanche/oldhighs.cpp
@@ -64,10 +64,8 @@ tabletype table;
 byte ratingname(word x) {
 	byte fv;
 	byte ratingname_result;
-	;
 	for (fv = 9; fv >= 1; fv --)
 		if (x >= ratings[fv].lowest) {
-			;
 			ratingname_result = fv;
 			return ratingname_result;
 		}    /* bad style */
@@ -82,10 +80,8 @@ const string message = "A v a l o t  :  H i g h - S c o r e s";
 static void sayfast(integer x, integer y) {
 	integer anchor;
 	byte fv;
-	;
 	anchor = -296;
 	for (fv = 1; fv <= length(message); fv ++) {
-		;
 		if (message[fv - 1] != '\40')  outtextxy(x + anchor, y - 8, message[fv - 1]);
 		anchor += 16;
 	}
@@ -97,15 +93,12 @@ void title() {
 	byte x;
 	integer len;
 
-	;
 	settextstyle(0, 0, 2); /*settextjustify(1,1);*/
 	len = textheight(message);
 	for (x = 6; x >= 0; x --) {
-		;
 		setcolor(shades[x]);
 		sayfast(320 - x * 2, 20 - x);
 		if (x > 0) {
-			;
 			sayfast(320 + x * 2, 20 - x);
 			sayfast(320 + x * 2, 20 + x);
 			sayfast(320 - x * 2, 20 + x);
@@ -121,11 +114,9 @@ void newtable() {
 		}
 	};
 	byte fv;
-	;
 	fillchar(table, sizeof(table), '\261');
 	for (fv = 1; fv <= 12; fv ++) {
 		scoretype &with = table.a[fv];
-		;
 		with.name = names[fv];
 		with.score = 193 - fv * 16;
 	}
@@ -135,14 +126,12 @@ void newtable() {
 string strf(longint x) {         /* From Gyro. Delete when integrated. */
 	string q;
 	string strf_result;
-	;
 	str(x, q);
 	strf_result = q;
 	return strf_result;
 }
 
 void sparkle(integer x, integer y, string z) {
-	;
 	setcolor(cyan);
 	outtextxy(x - 1, y - 1, z);
 	setcolor(blue);
@@ -153,7 +142,6 @@ void sparkle(integer x, integer y, string z) {
 
 void drawtable() {
 	byte fv, last, now;
-	;
 	setfillstyle(1, 8);
 	bar(0, 40, 105, 58);
 	bar(110, 40, 400, 58);
@@ -175,7 +163,6 @@ void drawtable() {
 	last = 177;
 	for (fv = 1; fv <= 12; fv ++) {
 		scoretype &with = table.a[fv];
-		;
 		settextjustify(righttext, bottomtext);
 		sparkle(100, 60 + fv * 10, strf(fv) + '.');
 		sparkle(455, 60 + fv * 10, strf(with.score));
@@ -193,7 +180,6 @@ void drawtable() {
 }
 
 void message1(string x) {
-	;
 	setfillstyle(1, 8);
 	bar(0, 190, 640, 200);
 	settextjustify(1, 1);
@@ -204,12 +190,10 @@ void sorthst() {
 	byte fv;
 	boolean ok;
 	scoretype temp;
-	;
 	do {
 		ok = true;
 		for (fv = 1; fv <= 11; fv ++)
 			if (table.a[fv].score < table.a[fv + 1].score) {
-				;
 				temp = table.a[fv];
 				table.a[fv] = table.a[fv + 1];
 				table.a[fv + 1] = temp; /* swap 'em */
@@ -224,7 +208,6 @@ static integer x, y;
 
 
 static void cursor(byte col) {
-	;
 	setcolor(col);
 	outtextxy(x, y, "?");
 }
@@ -235,7 +218,6 @@ void entername() {
 	integer counter;
 	byte flash;
 
-	;
 	y = 60 + table.light * 10;
 	i = "";
 	settextjustify(2, 0);
@@ -246,7 +228,6 @@ void entername() {
 		do {
 			counter += 1;
 			if (counter == 1000) {
-				;
 				cursor(4 + flash * 10);
 				flash = 1 - flash;
 				counter = 0;
@@ -258,17 +239,13 @@ void entername() {
 		r = readkey();
 		nosound;
 		if (r == '\10')  {
-			;
 			if (i[0] > '\0')  {
-				;
 				bar(x - 17, y - 10, x - 8, y);
 				i[0] -= 1;
 				sparkle(x - 16, y, i[length(i)]);
 			}
 		} else {
-			;
 			if ((i[0] < '\42') && (r != '\15'))  {
-				;
 				sparkle(x, y, r);
 				i = i + r;
 			}
@@ -278,11 +255,9 @@ void entername() {
 }
 
 void newscore(word sc) {
-	;
 	{
 		scoretype &with = table.a[12];
 		if (sc > with.score) {
-			;
 			with.name = "";
 			with.score = sc;
 			table.light = 10;
@@ -294,13 +269,11 @@ void newscore(word sc) {
 	} /* too low for score */
 	message1("Press Space to continue...");
 	do {
-		;
 	} while (!(keypressed() && (readkey() == '\40')));
 }
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
diff --git a/engines/avalanche/oldincln.cpp b/engines/avalanche/oldincln.cpp
index 89bc907..b9b5826 100644
--- a/engines/avalanche/oldincln.cpp
+++ b/engines/avalanche/oldincln.cpp
@@ -60,7 +60,6 @@ string inihead, initail; /* For reading the .INI file. */
 
 
 void linebug(byte which) {
-	;
 	output << "AVALOT : ";
 	switch (which) {
 	case bug_twonames :
@@ -84,7 +83,6 @@ void linebug(byte which) {
 }
 
 void syntax() {
-	;
 	assign(output, "");
 	rewrite(output);
 	output << NL;
@@ -106,13 +104,11 @@ void syntax() {
 
 void upstr(string &x) {
 	byte fv;
-	;
 	for (fv = 1; fv <= length(x); fv ++) x[fv] = upcase(x[fv]);
 }
 
 boolean yesno() {
 	boolean yesno_result;
-	;
 	if (initail == "YES")  yesno_result = true;
 	else if (initail == "NO")  yesno_result = false;
 	else
@@ -121,7 +117,6 @@ boolean yesno() {
 }
 
 void ini_parse() {
-	;
 	upstr(inihead);
 	upstr(initail);
 
@@ -135,7 +130,6 @@ void ini_parse() {
 
 void strip_ini() {
 	byte fv;
-	;
 	if (inihead == "")  return;
 
 	/* Firstly, delete any comments. */
@@ -165,12 +159,10 @@ void strip_ini() {
 
 void load_ini() {
 	text ini;
-	;
 	assign(ini, "AVALOT.INI");
 	reset(ini);
 
 	while (! eof(ini)) {
-		;
 		ini >> inihead >> NL;
 		strip_ini();
 		if (inihead != "")  ini_parse();
@@ -184,7 +176,6 @@ static string arg;
 
 static string getarg(string otherwis) {
 	string getarg_result;
-	;
 	if (arg == "")  getarg_result = otherwis;
 	else getarg_result = "";
 	return getarg_result;
@@ -193,11 +184,9 @@ static string getarg(string otherwis) {
 void parse(string x)
 
 {
-	;
 	switch (x[1]) {
 	case '/':
 	case '-': {
-		;
 		arg = copy(x, 3, 255);
 		switch (upcase(x[2])) {
 		case '?':
@@ -208,22 +197,18 @@ void parse(string x)
 			break;
 		case 'L':
 			if (! usingp) {
-				;
 				log_setup(getarg("avvy.log"), false);
 				usingl = true;
 			} else {
-				;
 				close(logfile);
 				linebug(bug_pandl);
 			}
 			break;
 		case 'P':
 			if (! usingl) {
-				;
 				log_setup(getarg("prn"), true);
 				usingp = true;
 			} else {
-				;
 				close(logfile);
 				linebug(bug_pandl);
 			}
@@ -241,7 +226,6 @@ void parse(string x)
 			demo = true;
 			break;
 		default: {
-			;
 			bugline = x;
 			linebug(bug_weirdswitch);
 		}
@@ -249,7 +233,6 @@ void parse(string x)
 	}
 	break;
 	case '*': {
-		;
 		inihead = copy(x, 2, 255);
 		strip_ini();
 		if (inihead != "")  ini_parse();
@@ -288,7 +271,6 @@ public:
 static unit_incline_initialize incline_constructor;
 
 unit_incline_initialize::unit_incline_initialize() {
-	;
 	filetoload = "";
 	usingl = false;
 	usingp = false;
diff --git a/engines/avalanche/oldtrip.cpp b/engines/avalanche/oldtrip.cpp
index 0c06651..721a3f5 100644
--- a/engines/avalanche/oldtrip.cpp
+++ b/engines/avalanche/oldtrip.cpp
@@ -51,7 +51,6 @@ static boolean dropin(integer xc, integer yc, integer x1, integer y1, integer x2
 /* Dropin returns True if the point xc,yc falls within the 1-2 rectangle. */
 {
 	boolean dropin_result;
-	;
 	dropin_result = ((xc >= x1) && (xc <= x2) && (yc >= y1) && (yc <= y2));
 	return dropin_result;
 }
@@ -60,7 +59,6 @@ static boolean dropin(integer xc, integer yc, integer x1, integer y1, integer x2
 
 static integer lesser(integer a, integer b) {
 	integer lesser_result;
-	;
 	if (a < b)  lesser_result = a;
 	else lesser_result = b;
 	return lesser_result;
@@ -70,7 +68,6 @@ static integer lesser(integer a, integer b) {
 
 static integer greater(integer a, integer b) {
 	integer greater_result;
-	;
 	if (a > b)  greater_result = a;
 	else greater_result = b;
 	return greater_result;
@@ -79,7 +76,6 @@ static integer greater(integer a, integer b) {
 void copier(integer x1, integer y1, integer x2, integer y2, integer x3, integer y3, integer x4, integer y4)
 
 {
-	;
 	if (dropin(x3, y3, x1, y1, x2, y2)
 	        || dropin(x3, y4, x1, y1, x2, y2)
 	        || dropin(x4, y3, x1, y1, x2, y2)
@@ -95,7 +91,6 @@ void copier(integer x1, integer y1, integer x2, integer y2, integer x3, integer
 
 void loadtrip() {
 	byte gm;
-	;
 	for (gm = 1; gm <= numtr; gm ++) tr[gm].original();
 	tr[1].init(0);
 }
@@ -104,7 +99,6 @@ byte checkfeet(integer x1, integer x2, integer oy, integer y, byte yl) {
 	byte a, c;
 	integer fv, ff;
 	byte checkfeet_result;
-	;
 	a = 0;
 	setactivepage(2);
 	if (x1 < 0)  x1 = 0;
@@ -112,14 +106,12 @@ byte checkfeet(integer x1, integer x2, integer oy, integer y, byte yl) {
 	if (oy < y)
 		for (fv = x1; fv <= x2; fv ++)
 			for (ff = oy + yl; ff <= y + yl; ff ++) {
-				;
 				c = getpixel(fv, ff);
 				if (c > a)  a = c;
 			}
 	else
 		for (fv = x1; fv <= x2; fv ++)
 			for (ff = y + yl; ff <= oy + yl; ff ++) {
-				;
 				c = getpixel(fv, ff);
 				if (c > a)  a = c;
 			}
@@ -132,13 +124,11 @@ void touchcol(byte tc);
 static boolean bug;
 
 static void fr(byte a, byte b) {
-	;
 	fliproom(a, b);
 	bug = false;
 }
 
 void touchcol(byte tc) {
-	;
 	bug = true; /* j.i.c. */
 	switch (dna.room) {
 	case 1:
@@ -173,7 +163,6 @@ void touchcol(byte tc) {
 		break;
 	}
 	if (bug) {
-		;
 		setactivepage(0);
 		display(string('\7') + "Unknown touchcolour (" + strf(tc) + ')' + " in " + strf(dna.room)
 		        + '.');
@@ -190,7 +179,6 @@ triptype *triptype::init(byte spritenum) {
 	byte sort, n;
 	word bigsize;
 	pointer p, q;
-	;
 	str(spritenum, xx);
 	assign(f, string("c:\\avalot\\sprite") + xx + ".avd");
 	reset(f, 1);
@@ -199,7 +187,6 @@ triptype *triptype::init(byte spritenum) {
 	blockread(f, bigsize, 2);
 	setactivepage(3);
 	for (sort = 0; sort <= 1; sort ++) {
-		;
 		mark(q);
 		getmem(p, bigsize);
 		blockread(f, p, bigsize);
@@ -211,7 +198,6 @@ triptype *triptype::init(byte spritenum) {
 			adxtype &with = a;
 			for (gm = 0; gm <= (with.num / with.seq) - 1; gm ++) /* directions */
 				for (gd = 0; gd <= with.seq - 1; gd ++) { /* steps */
-					;
 					getmem(pic[n][sort], a.size); /* grab the memory */
 					getimage((gm / 2) * (with.xl * 6) + gd * with.xl, (gm % 2)*with.yl,
 					         (gm / 2) * (with.xl * 6) + gd * with.xl + with.xl - 1, (gm % 2)*with.yl + with.yl - 1,
@@ -238,12 +224,10 @@ triptype *triptype::init(byte spritenum) {
 }
 
 void triptype::original() {
-	;
 	quick = false;
 }
 
 void triptype::getback() {
-	;
 	tax = x;
 	tay = y;
 	off; /*getimage(x,y,x+a.xl,y+a.yl,behind^);*/
@@ -253,7 +237,6 @@ void triptype::getback() {
 
 void triptype::andexor() {
 	byte picnum; /* Picnum, Picnic, what ye heck */
-	;
 	picnum = face * a.seq + step + 1;
 	off;
 	putimage(x, y, pic[picnum][0], andput);
@@ -262,12 +245,10 @@ void triptype::andexor() {
 }
 
 void triptype::turn(byte whichway) {
-	;
 	face = whichway;
 }
 
 void triptype::appear(integer wx, integer wy, byte wf) {
-	;
 	x = (wx / 8) * 8;
 	y = wy;
 	ox = wx;
@@ -280,7 +261,6 @@ void triptype::appear(integer wx, integer wy, byte wf) {
 
 void triptype::walk() {
 	byte tc;
-	;
 	ox = x;
 	oy = y;
 	if ((ix == 0) && (iy == 0))  return;
@@ -288,7 +268,6 @@ void triptype::walk() {
 	x = x + ix;
 	y = y + iy;
 	if (check_me)  {
-		;
 		tc = checkfeet(x, x + a.xl, oy, y, a.yl);
 		{
 			void &with = magics[tc];
@@ -313,7 +292,6 @@ void triptype::walk() {
 }
 
 void triptype::bounce() {
-	;
 	setactivepage(1);
 	putback();
 	x = ox;
@@ -323,9 +301,7 @@ void triptype::bounce() {
 }
 
 void triptype::do_it() {
-	;
 	if (((ix != 0) || (iy != 0)) & (~ ddm_o.menunow)) {
-		;
 		off;
 		copier(ox, oy, ox + a.xl, oy + a.yl, x, y, x + a.xl, y + a.yl);
 		putback();
@@ -334,12 +310,10 @@ void triptype::do_it() {
 }
 
 void triptype::putback() {
-	;
 	/* putimage(tax,tay,behind^,0);*/ mblit(tax, tay, tax + a.xl, tay + a.yl, 3, 1);
 }
 
 void triptype::walkto(integer xx, integer yy) {
-	;
 	speed(xx - x, yy - y);
 	hx = xx;
 	hy = yy;
@@ -347,13 +321,11 @@ void triptype::walkto(integer xx, integer yy) {
 }
 
 void triptype::stophoming() {
-	;
 	homing = false;
 }
 
 void triptype::homestep() {
 	integer temp;
-	;
 	if ((hx == x) && (hy == y)) {
 		;     /* touching the target */
 		homing = false;
@@ -362,14 +334,12 @@ void triptype::homestep() {
 	ix = 0;
 	iy = 0;
 	if (hy != y) {
-		;
 		temp = hy - y;
 		if (temp > 4)  iy = 4;
 		else if (temp < -4)  iy = -4;
 		else iy = temp;
 	}
 	if (hx != x) {
-		;
 		temp = hx - x;
 		if (temp > 4)  ix = 4;
 		else if (temp < -4)  ix = -4;
@@ -378,7 +348,6 @@ void triptype::homestep() {
 }
 
 void triptype::speed(shortint xx, shortint yy) {
-	;
 	ix = xx;
 	iy = yy;
 	if ((ix == 0) && (iy == 0))  return; /* no movement */
@@ -387,21 +356,18 @@ void triptype::speed(shortint xx, shortint yy) {
 		if (iy < 0)  turn(up);
 		else turn(down);
 	} else {
-		;
 		if (ix < 0)  turn(left);
 		else turn(right);
 	}
 }
 
 void triptype::stopwalk() {
-	;
 	ix = 0;
 	iy = 0;
 	homing = false;
 }
 
 void triptype::chatter() {
-	;
 	talkx = x + a.xl / 2;
 	talky = y;
 	talkf = a.fgc;
@@ -410,20 +376,17 @@ void triptype::chatter() {
 
 
 getsettype *getsettype::init() {
-	;
 	numleft = 0; /* initialise array pointer */
 	return this;
 }
 
 void remember(fieldtype r) {
-	;
 	numleft += 1;
 	gs[numleft] = r;
 }
 
 void recall() {
 	void recall_result;
-	;
 	recall_result = gs[numleft];
 	numleft -= 1;
 	return recall_result;
@@ -432,7 +395,6 @@ void recall() {
 void rwsp(byte t, byte r) {
 	const integer xs = 4;
 	const integer ys = 2;
-	;
 	{
 		triptype &with = tr[t];
 		switch (r) {
@@ -465,10 +427,8 @@ void rwsp(byte t, byte r) {
 }
 
 void apped(byte trn, byte np) {
-	;
 	{
 		triptype &with = tr[trn];
-		;
 		{
 			void &with1 = peds[np];
 			appear(with.x - with.a.xl / 2, with.y - with.a.yl, dir);
@@ -483,7 +443,6 @@ static boolean allstill() {
 	boolean xxx;
 	byte fv;
 	boolean allstill_result;
-	;
 	xxx = true;
 	for (fv = 1; fv <= numtr; fv ++) {
 		triptype &with = tr[fv];
@@ -495,13 +454,11 @@ static boolean allstill() {
 
 void trippancy() {
 	byte fv;
-	;
 	if ((ddm_o.menunow) | ontoolbar | seescroll | allstill())  return;
 	setactivepage(1);
 	for (fv = 1; fv <= numtr; fv ++) {
 		triptype &with = tr[fv];
 		if (with.quick) {
-			;
 			walk();
 			if (with.visible && ((with.ix != 0) || (with.iy != 0)))  andexor();
 			do_it();
@@ -513,70 +470,59 @@ void trippancy() {
 void tripkey(char dir);
 
 static void stopwalking() {
-	;
 	tr[1].stopwalk();
 	dna.rw = stopped;
 }
 
 void tripkey(char dir) {
-	;
 	{
 		triptype &with = tr[1];
 		{
-			;
 			switch (dir) {
 			case 'H':
 				if (rw != up) {
-					;
 					rw = up;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'P':
 				if (rw != down) {
-					;
 					rw = down;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'K':
 				if (rw != left) {
-					;
 					rw = left;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'M':
 				if (rw != right) {
-					;
 					rw = right;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'I':
 				if (rw != ur) {
-					;
 					rw = ur;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'Q':
 				if (rw != dr) {
-					;
 					rw = dr;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'O':
 				if (rw != dl) {
-					;
 					rw = dl;
 					rwsp(1, rw);
 				} else stopwalking();
 				break;
 			case 'G':
 				if (rw != ul) {
-					;
 					rw = ul;
 					rwsp(1, rw);
 				} else stopwalking();
@@ -590,7 +536,6 @@ void tripkey(char dir) {
 }
 
 void fliproom(byte room, byte ped) {
-	;
 	dusk;
 	tr[1].putback();
 	dna.room = room;
@@ -605,16 +550,13 @@ void fliproom(byte room, byte ped) {
 boolean infield(byte x) {         /* returns True if you're within field "x" */
 	integer ux, uy;
 	boolean infield_result;
-	;
 	{
 		triptype &with = tr[1];
-		;
 		ux = with.x;
 		uy = with.y + with.a.yl;
 	}
 	{
 		void &with = fields[x];
-		;
 		infield_result = (ux >= x1) && (ux <= x2) && (uy >= y1) && (uy <= y2);
 	}
 	return infield_result;
@@ -625,7 +567,6 @@ boolean neardoor() {       /* returns True if you're near a door! */
 	byte fv;
 	boolean nd;
 	boolean neardoor_result;
-	;
 	if (numfields < 9) {
 		;     /* there ARE no doors here! */
 		neardoor_result = false;
@@ -633,14 +574,12 @@ boolean neardoor() {       /* returns True if you're near a door! */
 	}
 	{
 		triptype &with = tr[1];
-		;
 		ux = with.x;
 		uy = with.y + with.a.yl;
 	}
 	nd = false;
 	for (fv = 9; fv <= numfields; fv ++) {
 		void &with = fields[fv];
-		;
 		if ((ux >= x1) && (ux <= x2) && (uy >= y1) && (uy <= y2))  nd = true;
 	}
 	neardoor_result = nd;
diff --git a/engines/avalanche/omtest.cpp b/engines/avalanche/omtest.cpp
index 9cab879..f373c50 100644
--- a/engines/avalanche/omtest.cpp
+++ b/engines/avalanche/omtest.cpp
@@ -46,9 +46,7 @@ void graphics() {
 /*$F+ ... All ddm__procs and do__procs must be compiled in Far-Call state. */
 
 void ddm__file() {
-	;
 	{
-		;
 		start_afresh;
 		opt("Load...", 'L', "f3", true);
 		opt("Save...", 'S', "f2", false);
@@ -60,9 +58,7 @@ void ddm__file() {
 }
 
 void ddm__heart() {
-	;
 	{
-		;
 		start_afresh;
 		opt("About...", 'A', "shift-f10", true);
 		opt("Boss Key", 'B', "alt-B", true);
@@ -74,9 +70,7 @@ void ddm__heart() {
 }
 
 void ddm__action() {
-	;
 	{
-		;
 		start_afresh;
 		opt("Get up", 'G', "", true);
 		opt("Open door", 'O', "", true);
@@ -89,9 +83,7 @@ void ddm__action() {
 }
 
 void ddm__objects() {
-	;
 	{
-		;
 		start_afresh;
 		opt("Bell", 'B', "", true);
 		opt("Wine", 'W', "", true);
@@ -104,9 +96,7 @@ void ddm__objects() {
 }
 
 void ddm__people() {
-	;
 	{
-		;
 		start_afresh;
 		opt("Avalot", 'A', "", true);
 		opt("Spludwick", 'S', "", true);
@@ -118,9 +108,7 @@ void ddm__people() {
 }
 
 void ddm__use() {
-	;
 	{
-		;
 		start_afresh;
 		opt("Drink", 'D', "", true);
 		opt("Wear", 'W', "", true);
@@ -131,7 +119,6 @@ void ddm__use() {
 
 void do__stuff() {
 	varying_string<2> st;
-	;
 	str(o.choicenum + 1, st);
 	setfillstyle(1, 6);
 	setcolor(14);
@@ -140,7 +127,6 @@ void do__stuff() {
 }
 
 void do__heart() {
-	;
 	switch (o.choicenum) {
 	case 0:
 		outtextxy(100, 100, "A really funny game!");
@@ -164,7 +150,6 @@ void do__heart() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	graphics();
 	setfillstyle(6, 6);
 	bar(0, 0, 639, 199);
@@ -172,7 +157,6 @@ int main(int argc, const char *argv[]) {
 	m.init;
 	o.init;
 	{
-		;
 		create('H', '\3', '#', ddm__heart(), do__heart());
 		create('F', "File", '!', ddm__file(), do__stuff());
 		create('A', "Action", '\36', ddm__action(), do__stuff());
@@ -191,9 +175,7 @@ int main(int argc, const char *argv[]) {
 		} while (!((buttonpresscount > 0) || (buttonreleasecount > 0) | keypressede));
 		hidemousecursor;
 		if (buttonpresscount > 0) {
-			;
 			if (mousey > 10) {
-				;
 				if (!((o.firstlix) &
 				        ((mousex >= flx1) && (mousex <= flx2) &&
 				         (mousey >= 12) && (mousey <= fly)))) {
@@ -211,7 +193,6 @@ int main(int argc, const char *argv[]) {
 		} else {
 			;     /* NOT clicked button... */
 			if (buttonreleasecount > 0) {
-				;
 				if ((firstlix) &
 				        ((mousex >= flx1) && (mousex <= flx2) &&
 				         (mousey >= 12) && (mousey <= fly)))
diff --git a/engines/avalanche/oopmenu.cpp b/engines/avalanche/oopmenu.cpp
index 94b3b0d..9c47d18 100644
--- a/engines/avalanche/oopmenu.cpp
+++ b/engines/avalanche/oopmenu.cpp
@@ -62,7 +62,6 @@ byte fv;
 
 void chalk(integer x, integer y, char t, string z) {
 	byte p;
-	;
 	outtextxy(x, y, z);
 	p = pos(t, z);
 	if (p == 0)  return;
@@ -71,7 +70,6 @@ void chalk(integer x, integer y, char t, string z) {
 }
 
 void say(integer x, integer y, char t, string z, byte f, byte b) {
-	;
 	settextjustify(0, 2);
 	setfillstyle(1, b);
 	setcolor(f);
@@ -82,7 +80,6 @@ void say(integer x, integer y, char t, string z, byte f, byte b) {
 void mblit(integer x1, integer y1, integer x2, integer y2, byte f, byte t) { /* NOT The Minstrel Blitter */
 	pointer p, q;
 	word s;
-	;
 	mark(q);
 	s = imagesize(x1, y1, x2, y2);
 	getmem(p, s);
@@ -95,7 +92,6 @@ void mblit(integer x1, integer y1, integer x2, integer y2, byte f, byte t) { /*
 }
 
 void onemenu::start_afresh() {
-	;
 	number = 0;
 	width = 0;
 	firstlix = false;
@@ -104,20 +100,17 @@ void onemenu::start_afresh() {
 }
 
 onemenu *onemenu::init() {
-	;
 	menunow = false;
 	return this;
 }
 
 void onemenu::opt(string n, char tr, string key, boolean val) {
 	integer l;
-	;
 	number += 1;
 	l = textwidth(n + key) + 30;
 	if (width < l)  width = l;
 	{
 		optiontype &with = oo[number];
-		;
 		with.title = n;
 		with.trigger = tr;
 		with.shortcut = key;
@@ -126,14 +119,11 @@ void onemenu::opt(string n, char tr, string key, boolean val) {
 }
 
 void onemenu::displayopt(byte y, byte b, byte f, byte d) {
-	;
 	{
 		optiontype &with = oo[y];
-		;
 		if (with.valid)  setcolor(f);
 		else setcolor(d);
 		if (b != 177) {
-			;
 			setfillstyle(1, b);
 			bar(flx1, 3 + y * 10, flx2, 12 + y * 10);
 		}
@@ -146,7 +136,6 @@ void onemenu::displayopt(byte y, byte b, byte f, byte d) {
 
 void onemenu::display() {
 	byte y;
-	;
 	setfillstyle(1, menu_b);
 	setcolor(menu_border);
 	firstlix = true;
@@ -169,7 +158,6 @@ void onemenu::display() {
 }
 
 void onemenu::wipe() {
-	;
 	{
 		headtype &with = m.ddms[o.menunum];
 		say(flx1 + 2, 1, with.trigger, with.title, menu_f, menu_b);
@@ -181,9 +169,7 @@ void onemenu::wipe() {
 
 void onemenu::movehighlight(shortint add) {
 	shortint hn;
-	;
 	if (add != 0) {
-		;
 		hn = highlightnum + add;
 		if ((hn < 0) || (hn >= (unsigned char)number))  return;
 		highlightnum = hn;
@@ -196,7 +182,6 @@ void onemenu::movehighlight(shortint add) {
 }
 
 void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
-	;
 	if ((mousex < flx1) || (mousex > flx2)
 	        || (mousey <= 12) || (mousey > fly - 3))  return;
 	highlightnum = (mousey - 12) / 10;
@@ -205,7 +190,6 @@ void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
 }
 
 void onemenu::select(byte n) {    /* Choose which one you want. */
-	;
 	if (! oo[n + 1].valid)  return;
 	choicenum = n;
 	m.ddms[menunum].do_choose();
@@ -214,14 +198,12 @@ void onemenu::select(byte n) {    /* Choose which one you want. */
 
 void onemenu::keystroke(char c) {
 	byte fv;
-	;
 	c = upcase(c);
 	for (fv = 1; fv <= number; fv ++)
 		if (upcase(oo[fv].trigger) == c)  select(fv - 1);
 }
 
 void bleep() {
-	;
 	sound(177);
 	delay(7);
 	nosound;
@@ -229,7 +211,6 @@ void bleep() {
 
 headtype *headtype::init
 (char trig, char alttrig, string name, byte p, proc dw, proc dc) {
-	;
 	trigger = trig;
 	alttrigger = alttrig;
 	title = name;
@@ -242,15 +223,12 @@ headtype *headtype::init
 }
 
 void headtype::display() {
-	;
 	say(xpos, 1, trigger, title, menu_f, menu_b);
 }
 
 void headtype::highlight() {
-	;
 	say(xpos, 1, trigger, title, highlight_f, highlight_b);
 	{
-		;
 		o.left = xpos;
 		o.menunow = true;
 		o.menunum = position;
@@ -259,9 +237,7 @@ void headtype::highlight() {
 
 boolean headtype::extdparse(char c) {
 	boolean extdparse_result;
-	;
 	if (c != alttrigger)  {
-		;
 		extdparse_result = true;
 		return extdparse_result;
 	}
@@ -270,20 +246,17 @@ boolean headtype::extdparse(char c) {
 }
 
 menuset *menuset::init() {
-	;
 	howmany = 0;
 	return this;
 }
 
 void menuset::create(char t, string n, char alttrig, proc dw, proc dc) {
-	;
 	howmany += 1;
 	ddms[howmany].init(t, alttrig, n, howmany, dw, dc);
 }
 
 void menuset::update() {
 	byte fv;
-	;
 	setfillstyle(1, menu_b);
 	bar(0, 0, 640, 10);
 	for (fv = 1; fv <= howmany; fv ++) ddms[fv].display();
@@ -291,7 +264,6 @@ void menuset::update() {
 
 void menuset::extd(char c) {
 	byte fv;
-	;
 	fv = 1;
 	while ((fv <= howmany) && (ddms[fv].extdparse(c)))  fv += 1;
 	if (fv > howmany)  return;
@@ -300,16 +272,13 @@ void menuset::extd(char c) {
 
 void menuset::getmenu(integer x) {
 	byte fv;
-	;
 	fv = 0;
 	do {
 		fv += 1;
 		if ((x > ddms[fv].xpos - 3) && (x < ddms[fv].xright)) {
 			headtype &with = ddms[fv];
 			{
-				;
 				if (o.menunow) {
-					;
 					wipe(); /* get rid of menu */
 					if (o.menunum == with.position)  return; /* click on own highlight */
 				}
@@ -322,19 +291,15 @@ void menuset::getmenu(integer x) {
 }
 
 void parsekey(char r, char re) {
-	;
 	switch (r) {
 	case '\0': {
-		;
 		switch (re) {
 		case 'K': {
-			;
 			wipe();
 			m.getmenu((o.menunum - 2)*spacing + indent);
 		}
 		break;
 		case 'M': {
-			;
 			wipe();
 			m.getmenu((o.menunum * spacing + indent));
 		}
@@ -357,7 +322,6 @@ void parsekey(char r, char re) {
 		select(o.highlightnum);
 		break;
 	default: {
-		;
 		if (o.menunow)  keystroke(r);
 		else
 			kbuffer = kbuffer + r + re;
diff --git a/engines/avalanche/overlap.cpp b/engines/avalanche/overlap.cpp
index 3c72e11..4b498fd 100644
--- a/engines/avalanche/overlap.cpp
+++ b/engines/avalanche/overlap.cpp
@@ -33,7 +33,6 @@ namespace Avalanche {
 integer gd, gm;
 
 void flash(integer x1, integer y1, integer x2, integer y2) {
-	;
 	setcolor(14);
 	rectangle(x1, y1, x2, y2);
 	sound(x1 + x2);
@@ -49,13 +48,11 @@ boolean dropin(integer xc, integer yc, integer x1, integer y1, integer x2, integ
 /* Dropin returns True if the point xc,yc falls within the 1-2 rectangle. */
 {
 	boolean dropin_result;
-	;
 	dropin_result = ((xc >= x1) && (xc <= x2) && (yc >= y1) && (yc <= y2));
 	return dropin_result;
 }
 
 void test(integer x1, integer y1, integer x2, integer y2, integer x3, integer y3, integer x4, integer y4) {
-	;
 	cleardevice();
 	rectangle(x1, y1, x2, y2);
 	rectangle(x3, y3, x4, y4);
@@ -77,7 +74,6 @@ void test(integer x1, integer y1, integer x2, integer y2, integer x3, integer y3
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 1;
 	initgraph(gd, gm, "");
diff --git a/engines/avalanche/overscro.cpp b/engines/avalanche/overscro.cpp
index 58ab270..bf0825c 100644
--- a/engines/avalanche/overscro.cpp
+++ b/engines/avalanche/overscro.cpp
@@ -32,7 +32,6 @@ namespace Avalanche {
 integer gd, gm;
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -52,7 +51,6 @@ int main(int argc, const char *argv[]) {
 	setactivepage(0);
 	gm = 0;
 	for (gd = 0; gd <= 640; gd ++) {
-		;
 		gm += 1;
 		if (gm == 8)  gm = 1;
 		setcolor(gm);
@@ -66,7 +64,6 @@ int main(int argc, const char *argv[]) {
 	/* setfillstyle(1,6); bar(100,100,500,100);*/ gd = getpixel(0, 0);
 	for (gm = 8; gm <= 15; gm ++) setpalette(gm, egayellow);
 	for (gd = 0; gd <= 199; gd ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3cf] = 4;
 		port[0x3c5] = 8;
diff --git a/engines/avalanche/particle.cpp b/engines/avalanche/particle.cpp
index b6b8305..74f9dbb 100644
--- a/engines/avalanche/particle.cpp
+++ b/engines/avalanche/particle.cpp
@@ -52,22 +52,18 @@ const char marker = '\33';
 
 void cursor() {
 	byte fv;
-	;
 	for (fv = 12; fv <= 15; fv ++)
 		mem[0xa000 * cpos + fv * 80] = ~(mem[0xa000 * cpos + fv * 80]);
 }
 
 void xy() {
-	;
 	cpos = (bufpos / 80) * 1280 + (bufpos % 80);
 }
 
 void show() {
 	word fv, orig, y;
-	;
 	for (fv = 0; fv <= 1999; fv ++)
 		if (buffer[fv] != was[fv]) {
-			;
 			orig = (fv / 80) * 1280 + (fv % 80);
 			for (y = 0; y <= 15; y ++)
 				mem[0xa000 * orig + y * 80] = (byte)(font[buffer[fv]][y]);
@@ -77,7 +73,6 @@ void show() {
 }
 
 void sizeup() {
-	;
 	do {
 		switch (buffer[bufsize]) {
 		case marker:
@@ -95,7 +90,6 @@ void sizeup() {
 void graphics() {
 	integer gd, gm;
 	file<fonttype> fontfile;
-	;
 	gd = 3;
 	gm = 1;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -110,7 +104,6 @@ void helpscreen();
 static byte l, fv;
 
 static void addon(char b, string st) {
-	;
 	buffer[3 + 80 * l] = b;
 	b -= 64;
 	buffer[5 + 80 * l] = b;
@@ -121,7 +114,6 @@ static void addon(char b, string st) {
 void helpscreen() {
 	array<0, 1999, char> temp;
 	char r;
-	;
 	l = 0;
 	move(buffer, temp, 2000);
 	fillchar(buffer, sizeof(buffer), '\0');
@@ -163,7 +155,6 @@ static void legit(char r) {
 
 void edit_it() {
 	byte fv;
-	;
 	bufpos = 0;
 	fillchar(was, sizeof(was), '\0');
 	show();
@@ -176,54 +167,46 @@ void edit_it() {
 			switch (readkey()) { /* extd keystrokes */
 			case 'K':
 				if (bufpos > 0)     {
-					;
 					bufpos -= 1;
 					xy();
 				}
 				break; /* Left */
 			case 'M':
 				if (bufpos < bufsize)  {
-					;
 					bufpos += 1;
 					xy();
 				}
 				break; /* Right */
 			case 'H':
 				if (bufpos > 80)    {
-					;
 					bufpos -= 80;
 					xy();
 				}
 				break; /* Up */
 			case 'P':
 				if (bufpos < (cardinal)bufsize - 79)  {
-					;
 					bufpos += 80;
 					xy();
 				}
 				break; /* Down */
 			case 's':
 				if (bufpos > 10)  {
-					;
 					bufpos -= 10;
 					xy();
 				}
 				break;
 			case 't':
 				if (bufpos < (cardinal)bufsize - 10)  {
-					;
 					bufpos += 10;
 					xy();
 				}
 				break;
 			case 'G': {
-				;
 				bufpos = 0;
 				xy();
 			}
 			break; /* Home */
 			case 'O': {
-				;
 				bufpos = bufsize;
 				xy();
 			}
@@ -258,7 +241,6 @@ void edit_it() {
 			}
 			break;
 		case '\33': {
-			;
 			restorecrtmode();
 			return;
 		}
@@ -272,14 +254,12 @@ void edit_it() {
 
 void loadit() {
 	untyped_file f;
-	;
 	if (pos(".", rawname) == 0)  rawname = rawname + ".raw";
 	fillchar(buffer, sizeof(buffer), '\0');
 	/*$I-*/
 	assign(f, rawname);
 	reset(f, 1);
 	if (ioresult != 0) {
-		;
 		output << string('\7') + "New file!" + '\7' << NL;
 		buffer[0] = marker;
 		return;
@@ -297,7 +277,6 @@ void loadit() {
 
 void saveit() {
 	untyped_file f;
-	;
 	output << "Saving " << rawname << ", " << bufsize << " bytes..." << NL;
 	assign(f, rawname);
 	rewrite(f, 1);
@@ -307,7 +286,6 @@ void saveit() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	output << "Filename of .RAW file?";
 	input >> rawname >> NL;
 	loadit();
@@ -335,7 +313,6 @@ int main(int argc, const char *argv[]) {
 			ok = true;
 			break;
 		case 'S': {
-			;
 			saveit();
 			exit(0);
 		}
diff --git a/engines/avalanche/pictemp.cpp b/engines/avalanche/pictemp.cpp
index 261e592..e41c395 100644
--- a/engines/avalanche/pictemp.cpp
+++ b/engines/avalanche/pictemp.cpp
@@ -46,7 +46,6 @@ void save() {
 	    "copyright." + '\15' + '\12' + '\15' + '\12' + "Have fun!" + '\32';
 	byte a /*absolute $A000:1200i*/;
 	byte bit;
-	;
 	nam = "d:thingtmp.avd";
 	screenname = "Temp.";
 	assign(f, nam);
@@ -56,7 +55,6 @@ void save() {
 	blockwrite(f, header[1], 146);
 	blockwrite(f, screenname, 31);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -68,7 +66,6 @@ void save() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -81,14 +78,12 @@ int main(int argc, const char *argv[]) {
 	gm = 20;
 
 	while (gm < 120) {
-		;
 		if (! eof(f))
 			blockread(f, p, picsize);
 		putimage(gd, gm, p, 0);
 		gd += 70;
 
 		if (gd == 640) {
-			;
 			gd = 10;
 			gm += 40;
 		}
diff --git a/engines/avalanche/pictemp2.cpp b/engines/avalanche/pictemp2.cpp
index 8d5cdfe..656987f 100644
--- a/engines/avalanche/pictemp2.cpp
+++ b/engines/avalanche/pictemp2.cpp
@@ -45,12 +45,10 @@ void load() {
 	byte a0 /*absolute $A000:1200*/;
 	byte bit;
 	untyped_file f;
-	;
 	assign(f, "d:thingtmp.avd");
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -63,7 +61,6 @@ void load() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "c:\\bp\\bgi");
@@ -79,14 +76,12 @@ int main(int argc, const char *argv[]) {
 	gm = 20;
 
 	while (noo <= number_of_objects) {
-		;
 		getimage(gd, gm, gd + 59, gm + 29, p);
 		putimage(gd, gm, p, notput);
 		blockwrite(f, p, picsize);
 		gd += 70;
 
 		if (gd == 640) {
-			;
 			gd = 10;
 			gm += 40;
 		}
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index df50cb0..f9d3571 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -48,7 +48,6 @@
 namespace Avalanche {
 
 void dplot(integer x, integer y, string z) {
-	;
 	setcolor(9);
 	outtextxy(x, y  , z);
 	setcolor(11);
@@ -88,11 +87,9 @@ begin;
  copy02;*/
 {
 	byte fv;
-	;
 	dusk();
 	off_virtual();
 	for (fv = 0; fv <= 1; fv ++) {
-		;
 		setactivepage(fv);
 		cleardevice();
 	}
@@ -123,10 +120,8 @@ void copy02() {   /* taken from Wobble (below) */
 	byte a0 /*absolute $A000:0*/;
 	byte a2/*absolute $A800:0*/;
 	byte bit;
-	;
 	off();
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -159,7 +154,6 @@ void copy03() {   /* taken from Wobble (below) */
 	}
 
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -172,7 +166,6 @@ void copy03() {   /* taken from Wobble (below) */
 		on_virtual();
 		break;
 	case 2 :
-		;
 		break; /* zzzz, it was off anyway */
 	case 3 :
 		on();
@@ -183,10 +176,8 @@ void copy03() {   /* taken from Wobble (below) */
 
 void copypage(byte frp, byte top) { /* taken from Copy02 (above) */
 	byte bit;
-	;
 	off();
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -199,13 +190,11 @@ void copypage(byte frp, byte top) { /* taken from Copy02 (above) */
 void wobble() {
 	byte bit;
 	byte a2 /*absolute $A800:80i*/;
-	;
 	off();
 	setactivepage(2);
 	bit = getpixel(0, 0);
 	cleardevice();
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
@@ -213,7 +202,6 @@ void wobble() {
 		move(mem[0xa000 * cp * pagetop], a2, 16000);
 	}
 	for (bit = 0; bit <= 25; bit ++) {
-		;
 		setvisualpage(2);
 		delay(bit * 7);
 		setvisualpage(cp);
@@ -228,7 +216,6 @@ void wobble() {
 void zonk();
 
 static void zl(integer x1, integer y1, integer x2, integer y2) {
-	;
 	setlinestyle(0, 0, 3);
 	setcolor(1);
 	line(x1, y1, x2, y2);
@@ -240,12 +227,10 @@ static void zl(integer x1, integer y1, integer x2, integer y2) {
 void zonk() {
 	integer xx, yy;
 	/* a0:byte absolute $A000:0; a3:byte absolute $A000:245760;*/ byte bit, fv;
-	;
 	off();
 	copypage(3, 1 - cp);
 	{
 		triptype &with = tr[1];
-		;
 		xx = with.x + with.a.xl / 2;
 		yy = with.y;
 	}
@@ -266,7 +251,6 @@ void zonk() {
 	setbkcolor(yellow);
 
 	for (bit = 0; bit <= 255; bit ++) {
-		;
 		note(270 - bit);
 		setvisualpage(3);
 		note(2700 - 10 * bit);
diff --git a/engines/avalanche/plottest.cpp b/engines/avalanche/plottest.cpp
index 9a03718..8ff0c36 100644
--- a/engines/avalanche/plottest.cpp
+++ b/engines/avalanche/plottest.cpp
@@ -35,7 +35,6 @@ matrix<1, 35, 0, 39, byte> a;
 array<0, 3, 0, 4, 1, 35, byte> b;
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	gd = 3;
 	gm = 0;
 	initgraph(gd, gm, "");
@@ -49,9 +48,7 @@ int main(int argc, const char *argv[]) {
 	fillchar(b, sizeof(b), '\0');
 	for (gm = 1; gm <= 35; gm ++)
 		for (gd = 0; gd <= 39; gd ++) {
-			;
 			for (fv = 0; fv <= 3; fv ++) {
-				;
 				b[fv][gd / 8][gm] = (b[fv][gd / 8][gm] << 1);
 				b[fv][gd / 8][gm] += ((cardinal)(a[gm][gd] & (1 << fv)) >> fv);
 			}
@@ -59,9 +56,7 @@ int main(int argc, const char *argv[]) {
 
 	for (gd = 1; gd <= 35; gd ++)
 		for (gm = 0; gm <= 4; gm ++) {
-			;
 			for (fv = 0; fv <= 3; fv ++) {
-				;
 				port[0x3c4] = 2;
 				port[0x3ce] = 4;
 				port[0x3c5] = 1 << fv;
diff --git a/engines/avalanche/preview1.cpp b/engines/avalanche/preview1.cpp
index da5b71d..bdb5f40 100644
--- a/engines/avalanche/preview1.cpp
+++ b/engines/avalanche/preview1.cpp
@@ -42,7 +42,6 @@ void load() {
 	reset(f, 1);
 	seek(f, 177);
 	for (bit = 0; bit <= 3; bit ++) {
-		;
 		port[0x3c4] = 2;
 		port[0x3ce] = 4;
 		port[0x3c5] = 1 << bit;
diff --git a/engines/avalanche/qintro.cpp b/engines/avalanche/qintro.cpp
index 0d15a9d..695dda4 100644
--- a/engines/avalanche/qintro.cpp
+++ b/engines/avalanche/qintro.cpp
@@ -254,7 +254,6 @@ void load_text() {
 			thisline += 1;
 			break;
 		case '\12':/*nop*/
-			;
 			break;
 		default:
 			x[thisline] = x[thisline] + *c;
@@ -311,7 +310,6 @@ int main(int argc, const char *argv[]) {
 		displaycounter += 1;
 
 		do {
-			;
 		} while (!(*skellern > 0));
 	}
 
diff --git a/engines/avalanche/qstars.cpp b/engines/avalanche/qstars.cpp
index 69920ef..553aee4 100644
--- a/engines/avalanche/qstars.cpp
+++ b/engines/avalanche/qstars.cpp
@@ -182,7 +182,6 @@ void do_stuff() {
 void setcol(byte which, byte what)
 /*var dummy:byte;*/
 {
-	;
 	/* setpalette(which,what);
 	 asm
 	(*  mov dx,$3DA;
diff --git a/engines/avalanche/rawupd.cpp b/engines/avalanche/rawupd.cpp
index 8c2c367..e3ed388 100644
--- a/engines/avalanche/rawupd.cpp
+++ b/engines/avalanche/rawupd.cpp
@@ -37,7 +37,6 @@ boolean s_exists;
 
 void find_out_about_s(string name) {
 	searchrec ss;
-	;
 	findfirst(name, anyfile, ss);
 	s_exists = doserror == 0;
 
diff --git a/engines/avalanche/readsez.cpp b/engines/avalanche/readsez.cpp
index bdf3a7e..cd4cd62 100644
--- a/engines/avalanche/readsez.cpp
+++ b/engines/avalanche/readsez.cpp
@@ -53,10 +53,8 @@ byte sumup() {
 	word fv;
 	byte total;
 	byte sumup_result;
-	;
 	total = 0;
 	for (fv = 0; fv <= marker.length; fv ++) {
-		;
 		total += ord(x[fv]);
 	}
 	sumup_result = total;
@@ -65,7 +63,6 @@ byte sumup() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	output << "READ-SEZ by TT." << NL;
 	output << NL;
 	assign(f, "avalot.sez");
@@ -73,9 +70,7 @@ int main(int argc, const char *argv[]) {
 	seek(f, 255);
 	blockread(f, sezhead, sizeof(sezhead));
 	{
-		;
 		if (sezhead.initials != "TT") {
-			;
 			output << "Not a valid Sez file!" << NL;
 			exit(0);
 		}
@@ -88,7 +83,6 @@ int main(int argc, const char *argv[]) {
 	seek(f, longint(262) + number * longint(7));
 	blockread(f, marker, 7);
 	{
-		;
 		output << "Scrollchain no. " << number << NL;
 		output << "Length: " << marker.length << NL;
 		output << "Offset: " << marker.offset << NL;
@@ -103,7 +97,6 @@ int main(int argc, const char *argv[]) {
 		output << "Checksum in file: " << marker.checksum << ". Actual value: " << sum << '.' << NL;
 		output << NL;
 		if (sum != marker.checksum) {
-			;
 			output << "Bleargh! Checksum failed!" << NL;
 			exit(0);
 		}
diff --git a/engines/avalanche/reginam.cpp b/engines/avalanche/reginam.cpp
index 441a35a..2ed33be 100644
--- a/engines/avalanche/reginam.cpp
+++ b/engines/avalanche/reginam.cpp
@@ -39,7 +39,6 @@ static byte p;
 
 
 static void replace(char what, char whatwith) {
-	;
 	p = pos(what, z);
 	if (p > 0)  z[p] = whatwith;
 }
@@ -47,7 +46,6 @@ static void replace(char what, char whatwith) {
 void alphanum() {
 	byte fv;
 
-	;
 	z = "";
 	for (fv = 1; fv <= length(name); fv ++)
 		if (set::of(range('A', 'Z'), eos).has(name[fv]))
@@ -71,9 +69,7 @@ void alphanum() {
 
 void scramble() {
 	byte fv, what;
-	;
 	for (fv = 1; fv <= length(name); fv ++) {
-		;
 		what = pos(name[fv], letters);
 		what += 177;
 		what += (fv + 1) * 3;
@@ -83,7 +79,6 @@ void scramble() {
 
 void checks() {
 	byte fv, total;
-	;
 	total = 177;
 	for (fv = 1; fv <= length(name); fv ++)
 		total += ord(name[fv]);
@@ -92,7 +87,6 @@ void checks() {
 
 void negate() {
 	byte fv;
-	;
 	name[1] = 'N';
 	for (fv = 2; fv <= length(name); fv ++)
 		name[fv] = letters[37 - pos(name[fv], letters) - 1];
@@ -100,7 +94,6 @@ void negate() {
 
 int main(int argc, const char *argv[]) {
 	pio_initialize(argc, argv);
-	;
 	output << "Registrant's name?";
 	input >> name >> NL;
 	output << "And number (eg, A1)?";
diff --git a/engines/avalanche/sackb1.cpp b/engines/avalanche/sackb1.cpp
index 54d860c..b197977 100644
--- a/engines/avalanche/sackb1.cpp
+++ b/engines/avalanche/sackb1.cpp
@@ -67,12 +67,10 @@ void sb_start(string md) {
 }
 
 void sb_stop() {
-	;
 	modstop();
 }
 
 void sb_link() {   /* At the moment, this does nothing. */
-	;
 }
 
 } // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/saving.cpp b/engines/avalanche/saving.cpp
index 8075225..8d52e76 100644
--- a/engines/avalanche/saving.cpp
+++ b/engines/avalanche/saving.cpp
@@ -40,7 +40,6 @@ void load(string nam) {
 	untyped_file f;
 	word s;
 	string check;
-	;
 	assign(f, nam);
 	reset(f, 1);
 	blockread(f, check, 41);
@@ -48,7 +47,6 @@ void load(string nam) {
 	blockread(f, check, 31);
 	s = imagesize(0, 0, getmaxx(), 75);
 	for (z = 1; z <= 2; z ++) {
-		;
 		getmem(a[z], s);
 		blockread(f, a[z], s);


Commit: 2c0e16d6e4a410164e5ce70d739006a479a3724e
    https://github.com/scummvm/scummvm/commit/2c0e16d6e4a410164e5ce70d739006a479a3724e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-18T03:51:07-07:00

Commit Message:
AVALANCHE: Hook the engine into ScummVM.

Changed paths:
  A engines/avalanche/module.mk
    engines/configure.engines
    engines/engines.mk
    engines/plugins_table.h



diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
new file mode 100644
index 0000000..1240051
--- /dev/null
+++ b/engines/avalanche/module.mk
@@ -0,0 +1,182 @@
+MODULE := engines/avalanche
+
+MODULE_OBJS = \
+	1stoff.o \
+	access.o \
+	acci.o \
+	also.o \
+	andexor.o \
+	andexor2.o \
+	andextst.o \
+	arch.o \
+	avalot9.o \
+	avbkgrnd.o \
+	avmenu.o \
+	avvyans.o \
+	avvyans2.o \
+	avvymonk.o \
+	bakchunk.o \
+	basher.o \
+	bootstrp.o \
+	cadburys.o \
+	celer.o \
+	ch_egats.o \
+	charmap.o \
+	chunker.o \
+	chunkxf1.o \
+	chunkxf2.o \
+	chunkxf3.o \
+	chunkxf4.o \
+	chunkxf5.o \
+	chunkxf6.o \
+	chunkxf7.o \
+	chunkxf8.o \
+	chunkxf9.o \
+	chunkxfa.o \
+	chunkxfb.o \
+	chunkxfc.o \
+	chunkxfd.o \
+	chunkxfe.o \
+	chunkxff.o \
+	chunkxfg.o \
+	chunkxfh.o \
+	chunkxfi.o \
+	chunkxfj.o \
+	chunkxfk.o \
+	chunkxfl.o \
+	clock.o \
+	closing.o \ 
+	convert.o \
+	convmous.o \
+	credits.o \
+	displtxt.o \
+	dropdown.o \
+	dwidth.o \
+	edhead.o \
+	edna.o \
+	enhanced.o \
+	enid.o \
+	filer.o \
+	fileunit.o \
+	filing.o \
+	folktemp.o \
+	fontslid.o \
+	frere.o \
+	golden.o \
+	g-room.o \
+	gyro.o \
+	help.o \
+	help2.o \
+	helpbak.o \
+	helper.o \
+	hibits.o \
+	highs.o \
+	hiz.o \
+	incline.o \
+	initxf.o \
+	inputtes.o \
+	intro.o \
+	ints.o \
+	joysetup.o \
+	joystick.o \
+	loading.o \
+	logger.o \
+	lucerna.o \
+	magic2.o \
+	magidraw.o \ 
+	magishuf.o \
+	make!.o \
+	makeregi.o \
+	makesez.o \
+	makevmou.o \
+	menuxf.o \
+	minstran.o \ 
+	newsprit.o \
+	nim.o \
+	nimdraw.o \
+	nimunit.o \
+	oldfiler.o \
+	oldhighs.o \
+	oldincln.o \
+	oldtrip.o \
+	omtest.o \
+	oopmenu.o \
+	overlap.o \
+	overscro.o \
+	particle.o \
+	pictemp.o \
+	pictemp2.o \
+	pingo.o \
+	plottest.o \
+	preview1.o \
+	qintro.o \
+	qstars.o \
+	rawupd.o \
+	readsez.o \
+	reginam.o \
+	sackb1.o \
+	sackb3.o \
+	sackblas.o \ 
+	saving.o \
+	scr_1.o \
+	scr_2.o \
+	scr_3.o \
+	scr_4.o \
+	scr_5.o \
+	scr_9.o \
+	scrolls.o \ 
+	sequence.o \
+	setup.o \
+	seu.o \
+	seu_avvy.o \
+	sez.o \
+	sezedit.o \
+	sezunit.o \
+	sezxfr.o \
+	shell1.o \
+	shell2.o \
+	slope.o \
+	spread.o \
+	spread2.o \
+	squish.o \
+	ss_blank.o \ 
+	ss_clock.o \
+	stars.o \
+	status.o \
+	sticks.o \
+	sunrise.o \
+	tempo.o \
+	test.o \
+	test2.o \
+	testblit.o \
+	testcard.o \
+	testenh.o \
+	timeout.o \
+	travel.o \
+	trip.o \
+	trip3.o \
+	trip42.o \
+	trip5.o \
+	trip5tst.o \
+	trip5xf.o \
+	tripoop.o \
+	ttmenuxf.o \
+	unsquish.o \
+	viewdocs.o \
+	visa.o \
+	visatest.o \
+	waver.o \
+	xf_gover.o \
+	xf_help.o \
+	xf_visa.o \
+	xfbutton.o \
+	xfghost.o \
+	zapdraw.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/configure.engines b/engines/configure.engines
index 15aa11d..0f059e6 100644
--- a/engines/configure.engines
+++ b/engines/configure.engines
@@ -6,6 +6,7 @@ add_engine he "HE71+ games" yes
 add_engine agi "AGI" yes
 add_engine agos "AGOS" yes "agos2" "AGOS 1 games"
 add_engine agos2 "AGOS 2 games" yes
+add_engine avalanche "Lord Avalot d'Argent" no
 add_engine cge "CGE" yes
 add_engine cine "Cinematique evo 1" yes
 add_engine composer "Magic Composer" yes
diff --git a/engines/engines.mk b/engines/engines.mk
index b905a28..4f38629 100644
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@ -26,6 +26,11 @@ DEFINES += -DENABLE_AGOS2
 endif
 endif
 
+ifdef ENABLE_AVALANCHE
+DEFINES += -DENABLE_AVALANCHE=$(ENABLE_AVALANCHE)
+MODULES += engines/avalanche
+endif
+
 ifdef ENABLE_CGE
 DEFINES += -DENABLE_CGE=$(ENABLE_CGE)
 MODULES += engines/cge
diff --git a/engines/plugins_table.h b/engines/plugins_table.h
index 4497945..6d623e5 100644
--- a/engines/plugins_table.h
+++ b/engines/plugins_table.h
@@ -8,6 +8,9 @@ LINK_PLUGIN(AGI)
 #if PLUGIN_ENABLED_STATIC(AGOS)
 LINK_PLUGIN(AGOS)
 #endif
+#if PLUGIN_ENABLED_STATIC(AVALANCHE)
+LINK_PLUGIN(AVALANCHE)
+#endif
 #if PLUGIN_ENABLED_STATIC(CGE)
 LINK_PLUGIN(CGE)
 #endif


Commit: d53f5d9885b99e0b109489585e13acf95e832837
    https://github.com/scummvm/scummvm/commit/d53f5d9885b99e0b109489585e13acf95e832837
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-18T08:52:25-07:00

Commit Message:
AVALANCHE: Add skeleton.

Changed paths:
  A engines/avalanche/avalanche.cpp
  A engines/avalanche/avalanche.h
  A engines/avalanche/console.cpp
  A engines/avalanche/console.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
new file mode 100644
index 0000000..d9599b7
--- /dev/null
+++ b/engines/avalanche/avalanche.cpp
@@ -0,0 +1,101 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "common/system.h"
+#include "common/random.h"
+#include "common/error.h"
+#include "common/events.h"
+#include "common/debug-channels.h"
+#include "common/config-manager.h"
+#include "common/textconsole.h"
+
+#include "avalanche/avalanche.h"
+
+#include "engines/util.h"
+
+namespace Avalanche {
+
+	AvalancheEngine *AvalancheEngine::s_Engine = 0;
+
+	AvalancheEngine::AvalancheEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst), _gameDescription(gd) {
+		_system = syst;
+		_console = new AvalancheConsole(this);
+		_rnd = 0;
+	}
+
+	AvalancheEngine::~AvalancheEngine() {
+		delete _console;
+		delete _rnd;
+	}
+
+	GUI::Debugger *AvalancheEngine::getDebugger() {
+		return _console;
+	}
+
+	Common::Platform AvalancheEngine::getPlatform() const {
+		return _platform;
+	}
+
+	bool AvalancheEngine::hasFeature(EngineFeature f) const {
+		return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime);
+	}
+
+	const char *AvalancheEngine::getCopyrightString() const {
+		return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
+	}
+
+	Common::String AvalancheEngine::getSavegameFilename(int slot) {
+		return _targetName + Common::String::format("-%02d.SAV", slot);
+	}
+
+	void AvalancheEngine::syncSoundSettings() {
+		Engine::syncSoundSettings();
+
+		//	_sound->syncVolume();
+	}
+
+	Common::Error AvalancheEngine::run() {
+		s_Engine = this;
+		initGraphics(320, 200, false);
+		_console = new AvalancheConsole(this);
+
+		//	_mouse = new MouseHandler(this);
+
+		// Setup mixer
+		syncSoundSettings();
+
+		return Common::kNoError;
+	}
+
+	void AvalancheEngine::initialize() {
+		//debugC(1, kDebugEngine, "initialize");
+
+		_rnd = new Common::RandomSource("avalanche");
+		_rnd->setSeed(42);                              // Kick random number generator
+	}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
new file mode 100644
index 0000000..13d20d0
--- /dev/null
+++ b/engines/avalanche/avalanche.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef AVALANCHE_H
+#define AVALANCHE_H
+
+#include "engines/engine.h"
+#include "avalanche/console.h"
+#include "engines/advancedDetector.h"
+
+namespace Common {
+class RandomSource;
+}
+
+namespace Avalanche {
+
+static const int kSavegameVersion = 1;
+
+class AvalancheEngine : public Engine {
+public:
+	AvalancheEngine(OSystem *syst, const ADGameDescription *gd);
+	~AvalancheEngine();
+
+	OSystem *_system;
+
+	GUI::Debugger *getDebugger();
+
+	Common::RandomSource *_rnd;
+	
+	const ADGameDescription *_gameDescription;
+	uint32 getFeatures() const;
+	const char *getGameId() const;
+
+	void initGame(const ADGameDescription *gd);
+
+	Common::Platform getPlatform() const;
+
+	bool hasFeature(EngineFeature f) const;
+	const char *getCopyrightString() const;
+
+	Common::String getSavegameFilename(int slot);
+	void syncSoundSettings();
+
+protected:
+	// Engine APIs
+	Common::Error run();
+
+private:
+	static AvalancheEngine *s_Engine;
+
+	AvalancheConsole *_console;
+	Common::Platform _platform;
+
+	void initialize();
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_H
diff --git a/engines/avalanche/console.cpp b/engines/avalanche/console.cpp
new file mode 100644
index 0000000..03f198f
--- /dev/null
+++ b/engines/avalanche/console.cpp
@@ -0,0 +1,39 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/console.h"
+#include "avalanche/avalanche.h"
+
+namespace Avalanche {
+
+	AvalancheConsole::AvalancheConsole(AvalancheEngine *vm) : GUI::Debugger(), _vm(vm) {
+	}
+
+	AvalancheConsole::~AvalancheConsole() {
+	}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/console.h b/engines/avalanche/console.h
new file mode 100644
index 0000000..91b77d4
--- /dev/null
+++ b/engines/avalanche/console.h
@@ -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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef AVALANCHE_CONSOLE_H
+#define AVALANCHE_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Avalanche {
+
+	class AvalancheEngine;
+
+	class AvalancheConsole : public GUI::Debugger {
+	public:
+		AvalancheConsole(AvalancheEngine *vm);
+		virtual ~AvalancheConsole(void);
+
+	private:
+		AvalancheEngine *_vm;
+		bool Cmd_listScreens(int argc, const char **argv);
+		bool Cmd_listObjects(int argc, const char **argv);
+		bool Cmd_getObject(int argc, const char **argv);
+		bool Cmd_getAllObjects(int argc, const char **argv);
+		bool Cmd_gotoScreen(int argc, const char **argv);
+		bool Cmd_boundaries(int argc, const char **argv);
+	};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_CONSOLE_H
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 1240051..cd14820 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS = \
 	andexor2.o \
 	andextst.o \
 	arch.o \
+	avalanche.o \
 	avalot9.o \
 	avbkgrnd.o \
 	avmenu.o \
@@ -46,6 +47,7 @@ MODULE_OBJS = \
 	chunkxfl.o \
 	clock.o \
 	closing.o \ 
+	console.o \
 	convert.o \
 	convmous.o \
 	credits.o \


Commit: d2009c014f17f11472432eb7a160aacfb7eaae80
    https://github.com/scummvm/scummvm/commit/d2009c014f17f11472432eb7a160aacfb7eaae80
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-18T11:32:43-07:00

Commit Message:
AVALANCHE: Add detection. Some fix in console.h.

Changed paths:
  A engines/avalanche/detection.cpp
    engines/avalanche/console.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/console.h b/engines/avalanche/console.h
index 91b77d4..138c3db 100644
--- a/engines/avalanche/console.h
+++ b/engines/avalanche/console.h
@@ -41,12 +41,6 @@ namespace Avalanche {
 
 	private:
 		AvalancheEngine *_vm;
-		bool Cmd_listScreens(int argc, const char **argv);
-		bool Cmd_listObjects(int argc, const char **argv);
-		bool Cmd_getObject(int argc, const char **argv);
-		bool Cmd_getAllObjects(int argc, const char **argv);
-		bool Cmd_gotoScreen(int argc, const char **argv);
-		bool Cmd_boundaries(int argc, const char **argv);
 	};
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
new file mode 100644
index 0000000..7ab4101
--- /dev/null
+++ b/engines/avalanche/detection.cpp
@@ -0,0 +1,223 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "engines/advancedDetector.h"
+#include "common/system.h"
+#include "common/savefile.h"
+#include "graphics/thumbnail.h"
+
+#include "avalanche/avalanche.h"
+
+namespace Avalanche {
+
+uint32 AvalancheEngine::getFeatures() const {
+	return _gameDescription->flags;
+}
+
+const char *AvalancheEngine::getGameId() const {
+	return _gameDescription->gameid;
+}
+
+static const ADGameDescription gameDescriptions[] = {
+	// Avalanche English
+	{
+		"Avalanche", 0,
+		{
+			{"avalot.sez", 0, "de10eb353228013da3d3297784f81ff9", 48763},
+			{"mainmenu.avd", 0, "89f31211af579a872045b175cc264298", 18880},
+			AD_LISTEND
+		},
+		Common::EN_ANY,
+		Common::kPlatformPCEngine,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+
+	AD_TABLE_END_MARKER
+};
+
+class AvalancheMetaEngine : public AdvancedMetaEngine {
+public:
+	AvalancheMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), 0) {
+	}
+
+	const char *getName() const {
+		return "Avalanche";
+	}
+
+	const char *getOriginalCopyright() const {
+		return "Avalanche Engine Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
+	}
+
+	bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
+	bool hasFeature(MetaEngineFeature f) const;
+
+	int getMaximumSaveSlot() const;
+	SaveStateList listSaves(const char *target) const;
+	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+	void removeSaveState(const char *target, int slot) const;
+};
+
+bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
+	if (gd) {
+		*engine = new AvalancheEngine(syst, (const ADGameDescription *)gd);
+		((AvalancheEngine *)*engine)->initGame((const ADGameDescription *)gd);
+	}
+	return gd != 0;
+}
+
+bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return
+	    (f == kSupportsListSaves) ||
+	    (f == kSupportsLoadingDuringStartup) ||
+	    (f == kSupportsDeleteSave) ||
+	    (f == kSavesSupportMetaInfo) ||
+	    (f == kSavesSupportThumbnail) ||
+	    (f == kSavesSupportCreationDate);
+}
+
+int AvalancheMetaEngine::getMaximumSaveSlot() const { return 99; }
+
+SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringArray filenames;
+	Common::String pattern = target;
+	pattern += "-??.SAV";
+
+	filenames = saveFileMan->listSavefiles(pattern);
+	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
+
+	SaveStateList saveList;
+	char slot[3];
+	int slotNum = 0;
+	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
+		slot[0] = filename->c_str()[filename->size() - 6];
+		slot[1] = filename->c_str()[filename->size() - 5];
+		slot[2] = '\0';
+		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
+		slotNum = atoi(slot);
+		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
+			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+			if (file) {
+				int saveVersion = file->readByte();
+
+				if (saveVersion != kSavegameVersion) {
+					warning("Savegame of incompatible version");
+					delete file;
+					continue;
+				}
+
+				// read name
+				uint16 nameSize = file->readUint16BE();
+				if (nameSize >= 255) {
+					delete file;
+					continue;
+				}
+				char name[256];
+				file->read(name, nameSize);
+				name[nameSize] = 0;
+
+				saveList.push_back(SaveStateDescriptor(slotNum, name));
+				delete file;
+			}
+		}
+	}
+
+	return saveList;
+}
+
+SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
+
+	if (file) {
+		int saveVersion = file->readByte();
+
+		if (saveVersion != kSavegameVersion) {
+			warning("Savegame of incompatible version");
+			delete file;
+			return SaveStateDescriptor();
+		}
+
+		uint32 saveNameLength = file->readUint16BE();
+		char saveName[256];
+		file->read(saveName, saveNameLength);
+		saveName[saveNameLength] = 0;
+
+		SaveStateDescriptor desc(slot, saveName);
+
+		Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*file);
+		desc.setThumbnail(thumbnail);
+
+		desc.setDeletableFlag(true);
+		desc.setWriteProtectedFlag(false);
+
+		uint32 saveDate = file->readUint32BE();
+		uint16 saveTime = file->readUint16BE();
+
+		int day = (saveDate >> 24) & 0xFF;
+		int month = (saveDate >> 16) & 0xFF;
+		int year = saveDate & 0xFFFF;
+
+		desc.setSaveDate(year, month, day);
+
+		int hour = (saveTime >> 8) & 0xFF;
+		int minutes = saveTime & 0xFF;
+
+		desc.setSaveTime(hour, minutes);
+
+		// Slot 0 is used for the 'restart game' save in all Avalanche games, thus
+		// we prevent it from being deleted.
+		desc.setDeletableFlag(slot != 0);
+		desc.setWriteProtectedFlag(slot == 0);
+
+		delete file;
+		return desc;
+	}
+	return SaveStateDescriptor();
+}
+
+void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	g_system->getSavefileManager()->removeSavefile(fileName);
+}
+
+} // End of namespace Avalanche
+
+#if PLUGIN_ENABLED_DYNAMIC(AVALANCHE)
+REGISTER_PLUGIN_DYNAMIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
+#else
+REGISTER_PLUGIN_STATIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
+#endif
+
+namespace Avalanche {
+
+void AvalancheEngine::initGame(const ADGameDescription *gd) {
+	_platform = gd->platform;
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index cd14820..9a919e6 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -51,6 +51,7 @@ MODULE_OBJS = \
 	convert.o \
 	convmous.o \
 	credits.o \
+	detection.o \
 	displtxt.o \
 	dropdown.o \
 	dwidth.o \


Commit: 17ee13f2c1d12f16d77a6f287c4fd1bf14010d9e
    https://github.com/scummvm/scummvm/commit/17ee13f2c1d12f16d77a6f287c4fd1bf14010d9e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-19T07:59:12-07:00

Commit Message:
AVALANCHE: Start stubbing with bootstrp.cpp.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d9599b7..d1a19b8 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -78,11 +78,162 @@ namespace Avalanche {
 		//	_sound->syncVolume();
 	}
 
+	void AvalancheEngine::initialize() {
+		//debugC(1, kDebugEngine, "initialize");
+
+		_rnd = new Common::RandomSource("avalanche");
+		_rnd->setSeed(42);                              // Kick random number generator
+	}
+
+
+
+	// From Bootstrp:
+
+	void AvalancheEngine::cursor_off() {
+		warning("STUB: cursor_off()");
+	}
+
+	void AvalancheEngine::cursor_on() {
+		warning("STUB: cursor_on()");
+	}
+
+	void AvalancheEngine::quit() {
+		cursor_on();
+	}
+
+	Common::String AvalancheEngine::strf(int32 x) {
+		Common::String q = Common::String::format("%d", x);
+		return q;
+	}
+
+	Common::String AvalancheEngine::command_com() {
+		warning("STUB: command_com()");
+		return ("STUB: command_com()");
+	}
+
+	void AvalancheEngine::explain(byte error) {
+		warning("STUB: explain()");
+	}
+
+	void AvalancheEngine::b_flight() {   /*interrupt;*/
+		_storage.skellern++;
+	}
+
+	void AvalancheEngine::bflight_on() {
+		_storage.skellern = _reset_;
+		warning("STUB: bflight_on()");
+		// setintvec(0x1c, &b_flight);
+	}
+
+	void AvalancheEngine::bflight_off() {
+		warning("STUB: bflight_off()");
+		// setintvec(0x1c, old_1c);
+	}
+
+	Common::String AvalancheEngine::elm2str(elm how) {
+		Common::String elm2str_result;
+		switch (how) {
+		case Normal:
+		case Musical:
+			elm2str_result = "jsb";
+			break;
+		case Regi:
+			elm2str_result = "REGI";
+			break;
+		case Elmpoyten:
+			elm2str_result = "ELMPOYTEN";
+			break;
+		}
+		return elm2str_result;
+	}
+
+	void AvalancheEngine::run(Common::String what, bool with_jsb, bool with_bflight, elm how) {
+		warning("STUB: run()"); 
+		// Probably there'll be no need of this function, as all *.AVX-es will become classes.
+	}
+
+	void AvalancheEngine::run_avalot() {
+		warning("STUB: run_avalot()");
+	}
+
+	void AvalancheEngine::run_the_demo() {
+		warning("STUB: run_the_demo()");
+	}
+
+	void AvalancheEngine::get_arguments() {
+		warning("STUB: get_arguments()");
+	}
+
+	void AvalancheEngine::dos_shell() {
+		warning("STUB: dos_shell()");
+	}
+
+	bool AvalancheEngine::keypressed1() {
+		warning("STUB: keypressed1()");
+		return false;
+	}
+
+	void AvalancheEngine::flush_buffer() {
+		warning("STUB: flush_buffer()");
+	}
+
+	void AvalancheEngine::demo() {
+		warning("STUB: demo()");
+	}
+
+	void AvalancheEngine::call_menu() {
+		warning("STUB: call_menu()");
+	}
+
+	void AvalancheEngine::get_slope() {
+		warning("STUB: get_slope()");
+	}
+
+
+
 	Common::Error AvalancheEngine::run() {
 		s_Engine = this;
 		initGraphics(320, 200, false);
 		_console = new AvalancheConsole(this);
 
+
+
+		// From bootstrp:
+
+		/*original_mode = mem[seg0040 * 0x49];
+		getintvec(0x1c, old_1c);*/
+
+		first_time = true;
+
+		get_arguments();
+		get_slope();
+
+		if (! zoomy)  call_menu();    /* Not run when zoomy. */
+
+		do {
+			run_avalot();
+
+			//if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
+
+			switch (_storage.operation) {
+			case _runShootemup:
+				run("seu.avx", _jsb, _bflight, Normal);
+				break;
+			case _runDosshell:
+				dos_shell();
+				break;
+			case _runGhostroom:
+				run("g-room.avx", _jsb, _no_bflight, Normal);
+				break;
+			case _runGolden:
+				run("golden.avx", _jsb, _bflight, Musical);
+				break;
+			}
+
+		} while (true);
+
+
+
 		//	_mouse = new MouseHandler(this);
 
 		// Setup mixer
@@ -91,11 +242,6 @@ namespace Avalanche {
 		return Common::kNoError;
 	}
 
-	void AvalancheEngine::initialize() {
-		//debugC(1, kDebugEngine, "initialize");
-
-		_rnd = new Common::RandomSource("avalanche");
-		_rnd->setSeed(42);                              // Kick random number generator
-	}
+	
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 13d20d0..b0b42ac 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -76,6 +76,76 @@ private:
 	Common::Platform _platform;
 
 	void initialize();
+
+	// From bootstrp:
+
+	enum elm {Normal, Musical, Elmpoyten, Regi};
+
+	static const int16 _runShootemup = 1, _runDosshell = 2, _runGhostroom = 3, _runGolden = 4;
+
+	static const int16 _reset_ = 0;
+
+	static const bool _jsb = true, _no_jsb = false, _bflight = true, _no_bflight = false;
+
+	struct {
+		byte operation;
+		uint16 skellern;
+		byte contents[1000];
+	} _storage;
+
+	Common::String arguments, demo_args, args_with_no_filename;
+
+	bool first_time;
+
+	byte original_mode;
+	void *old_1c;
+
+	Common::String segofs;
+
+	bool zoomy;
+
+	int32 soundcard, speed, baseaddr, irq, dma;
+
+	void cursor_off();
+
+	void cursor_on();
+
+	void quit();
+
+	Common::String strf(int32 x);
+
+	Common::String command_com();
+
+	void explain(byte error);
+
+	void b_flight();
+
+	void bflight_on();
+
+	void bflight_off();
+
+	Common::String elm2str(elm how);
+
+	void run(Common::String what, bool with_jsb, bool with_bflight, elm how);
+
+	void run_avalot();
+
+	void run_the_demo();
+
+	void get_arguments();
+
+	void dos_shell();
+
+	bool keypressed1();
+
+	void flush_buffer();
+
+	void demo();
+
+	void call_menu();
+
+	void get_slope();
+
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 9a919e6..bd79833 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -18,7 +18,6 @@ MODULE_OBJS = \
 	avvymonk.o \
 	bakchunk.o \
 	basher.o \
-	bootstrp.o \
 	cadburys.o \
 	celer.o \
 	ch_egats.o \


Commit: cf8057379942eaba99bd4b98f2986910e90b6e86
    https://github.com/scummvm/scummvm/commit/cf8057379942eaba99bd4b98f2986910e90b6e86
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-19T12:37:06-07:00

Commit Message:
AVALANCHE: Fix compilation

Changed paths:
    engines/avalanche/module.mk



diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index bd79833..4db7160 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -1,179 +1,9 @@
 MODULE := engines/avalanche
 
 MODULE_OBJS = \
-	1stoff.o \
-	access.o \
-	acci.o \
-	also.o \
-	andexor.o \
-	andexor2.o \
-	andextst.o \
-	arch.o \
 	avalanche.o \
-	avalot9.o \
-	avbkgrnd.o \
-	avmenu.o \
-	avvyans.o \
-	avvyans2.o \
-	avvymonk.o \
-	bakchunk.o \
-	basher.o \
-	cadburys.o \
-	celer.o \
-	ch_egats.o \
-	charmap.o \
-	chunker.o \
-	chunkxf1.o \
-	chunkxf2.o \
-	chunkxf3.o \
-	chunkxf4.o \
-	chunkxf5.o \
-	chunkxf6.o \
-	chunkxf7.o \
-	chunkxf8.o \
-	chunkxf9.o \
-	chunkxfa.o \
-	chunkxfb.o \
-	chunkxfc.o \
-	chunkxfd.o \
-	chunkxfe.o \
-	chunkxff.o \
-	chunkxfg.o \
-	chunkxfh.o \
-	chunkxfi.o \
-	chunkxfj.o \
-	chunkxfk.o \
-	chunkxfl.o \
-	clock.o \
-	closing.o \ 
 	console.o \
-	convert.o \
-	convmous.o \
-	credits.o \
-	detection.o \
-	displtxt.o \
-	dropdown.o \
-	dwidth.o \
-	edhead.o \
-	edna.o \
-	enhanced.o \
-	enid.o \
-	filer.o \
-	fileunit.o \
-	filing.o \
-	folktemp.o \
-	fontslid.o \
-	frere.o \
-	golden.o \
-	g-room.o \
-	gyro.o \
-	help.o \
-	help2.o \
-	helpbak.o \
-	helper.o \
-	hibits.o \
-	highs.o \
-	hiz.o \
-	incline.o \
-	initxf.o \
-	inputtes.o \
-	intro.o \
-	ints.o \
-	joysetup.o \
-	joystick.o \
-	loading.o \
-	logger.o \
-	lucerna.o \
-	magic2.o \
-	magidraw.o \ 
-	magishuf.o \
-	make!.o \
-	makeregi.o \
-	makesez.o \
-	makevmou.o \
-	menuxf.o \
-	minstran.o \ 
-	newsprit.o \
-	nim.o \
-	nimdraw.o \
-	nimunit.o \
-	oldfiler.o \
-	oldhighs.o \
-	oldincln.o \
-	oldtrip.o \
-	omtest.o \
-	oopmenu.o \
-	overlap.o \
-	overscro.o \
-	particle.o \
-	pictemp.o \
-	pictemp2.o \
-	pingo.o \
-	plottest.o \
-	preview1.o \
-	qintro.o \
-	qstars.o \
-	rawupd.o \
-	readsez.o \
-	reginam.o \
-	sackb1.o \
-	sackb3.o \
-	sackblas.o \ 
-	saving.o \
-	scr_1.o \
-	scr_2.o \
-	scr_3.o \
-	scr_4.o \
-	scr_5.o \
-	scr_9.o \
-	scrolls.o \ 
-	sequence.o \
-	setup.o \
-	seu.o \
-	seu_avvy.o \
-	sez.o \
-	sezedit.o \
-	sezunit.o \
-	sezxfr.o \
-	shell1.o \
-	shell2.o \
-	slope.o \
-	spread.o \
-	spread2.o \
-	squish.o \
-	ss_blank.o \ 
-	ss_clock.o \
-	stars.o \
-	status.o \
-	sticks.o \
-	sunrise.o \
-	tempo.o \
-	test.o \
-	test2.o \
-	testblit.o \
-	testcard.o \
-	testenh.o \
-	timeout.o \
-	travel.o \
-	trip.o \
-	trip3.o \
-	trip42.o \
-	trip5.o \
-	trip5tst.o \
-	trip5xf.o \
-	tripoop.o \
-	ttmenuxf.o \
-	unsquish.o \
-	viewdocs.o \
-	visa.o \
-	visatest.o \
-	waver.o \
-	xf_gover.o \
-	xf_help.o \
-	xf_visa.o \
-	xfbutton.o \
-	xfghost.o \
-	zapdraw.o
+	detection.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)


Commit: b916ab6f0247a0e9da36442d8dd6fd6834cd0ee4
    https://github.com/scummvm/scummvm/commit/b916ab6f0247a0e9da36442d8dd6fd6834cd0ee4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-19T23:32:58-07:00

Commit Message:
AVALANCHE: Messing around with GameDescription.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d1a19b8..f66e293 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -41,7 +41,7 @@ namespace Avalanche {
 
 	AvalancheEngine *AvalancheEngine::s_Engine = 0;
 
-	AvalancheEngine::AvalancheEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst), _gameDescription(gd) {
+	AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
 		_system = syst;
 		_console = new AvalancheConsole(this);
 		_rnd = 0;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index b0b42ac..6837ea5 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -38,11 +38,13 @@ class RandomSource;
 
 namespace Avalanche {
 
+struct AvalancheGameDescription;
+
 static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
-	AvalancheEngine(OSystem *syst, const ADGameDescription *gd);
+	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 
 	OSystem *_system;
@@ -51,11 +53,11 @@ public:
 
 	Common::RandomSource *_rnd;
 	
-	const ADGameDescription *_gameDescription;
+	const AvalancheGameDescription *_gameDescription;
 	uint32 getFeatures() const;
 	const char *getGameId() const;
 
-	void initGame(const ADGameDescription *gd);
+	void initGame(const AvalancheGameDescription *gd);
 
 	Common::Platform getPlatform() const;
 
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 7ab4101..10d23bb 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -34,16 +34,24 @@
 
 namespace Avalanche {
 
+struct AvalancheGameDescription {
+	ADGameDescription desc;
+};
+
 uint32 AvalancheEngine::getFeatures() const {
-	return _gameDescription->flags;
+	return _gameDescription->desc.flags;
 }
 
 const char *AvalancheEngine::getGameId() const {
-	return _gameDescription->gameid;
+	return _gameDescription->desc.gameid;
 }
 
+static const PlainGameDescriptor avalancheGames[] = {
+	{"avalot", "Lord Avalot d'Argent"},
+	{0, 0}
+};
+
 static const ADGameDescription gameDescriptions[] = {
-	// Avalanche English
 	{
 		"Avalanche", 0,
 		{
@@ -52,7 +60,7 @@ static const ADGameDescription gameDescriptions[] = {
 			AD_LISTEND
 		},
 		Common::EN_ANY,
-		Common::kPlatformPCEngine,
+		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
@@ -62,7 +70,7 @@ static const ADGameDescription gameDescriptions[] = {
 
 class AvalancheMetaEngine : public AdvancedMetaEngine {
 public:
-	AvalancheMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), 0) {
+	AvalancheMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(AvalancheGameDescription), avalancheGames) {
 	}
 
 	const char *getName() const {
@@ -76,135 +84,135 @@ public:
 	bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
 	bool hasFeature(MetaEngineFeature f) const;
 
-	int getMaximumSaveSlot() const;
+	/*int getMaximumSaveSlot() const;
 	SaveStateList listSaves(const char *target) const;
 	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
-	void removeSaveState(const char *target, int slot) const;
+	void removeSaveState(const char *target, int slot) const;*/
 };
 
 bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
-	if (gd) {
-		*engine = new AvalancheEngine(syst, (const ADGameDescription *)gd);
-		((AvalancheEngine *)*engine)->initGame((const ADGameDescription *)gd);
-	}
+	if (gd) /*{*/
+		*engine = new AvalancheEngine(syst, (const AvalancheGameDescription *)gd);
+		/*	((AvalancheEngine *)*engine)->initGame((const ADGameDescription *)gd);
+		}*/
 	return gd != 0;
 }
 
 bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return
-	    (f == kSupportsListSaves) ||
-	    (f == kSupportsLoadingDuringStartup) ||
-	    (f == kSupportsDeleteSave) ||
-	    (f == kSavesSupportMetaInfo) ||
-	    (f == kSavesSupportThumbnail) ||
-	    (f == kSavesSupportCreationDate);
-}
-
-int AvalancheMetaEngine::getMaximumSaveSlot() const { return 99; }
-
-SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
-	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
-	Common::StringArray filenames;
-	Common::String pattern = target;
-	pattern += "-??.SAV";
-
-	filenames = saveFileMan->listSavefiles(pattern);
-	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
-
-	SaveStateList saveList;
-	char slot[3];
-	int slotNum = 0;
-	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
-		slot[0] = filename->c_str()[filename->size() - 6];
-		slot[1] = filename->c_str()[filename->size() - 5];
-		slot[2] = '\0';
-		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
-		slotNum = atoi(slot);
-		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
-			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
-			if (file) {
-				int saveVersion = file->readByte();
-
-				if (saveVersion != kSavegameVersion) {
-					warning("Savegame of incompatible version");
-					delete file;
-					continue;
-				}
-
-				// read name
-				uint16 nameSize = file->readUint16BE();
-				if (nameSize >= 255) {
-					delete file;
-					continue;
-				}
-				char name[256];
-				file->read(name, nameSize);
-				name[nameSize] = 0;
-
-				saveList.push_back(SaveStateDescriptor(slotNum, name));
-				delete file;
-			}
-		}
-	}
-
-	return saveList;
+	return false;
+		/*(f == kSupportsListSaves) ||
+		 (f == kSupportsLoadingDuringStartup) ||
+		 (f == kSupportsDeleteSave) ||
+		 (f == kSavesSupportMetaInfo) ||
+		 (f == kSavesSupportThumbnail) ||
+		 (f == kSavesSupportCreationDate);*/
 }
 
-SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
-	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
-	Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
-
-	if (file) {
-		int saveVersion = file->readByte();
-
-		if (saveVersion != kSavegameVersion) {
-			warning("Savegame of incompatible version");
-			delete file;
-			return SaveStateDescriptor();
-		}
-
-		uint32 saveNameLength = file->readUint16BE();
-		char saveName[256];
-		file->read(saveName, saveNameLength);
-		saveName[saveNameLength] = 0;
-
-		SaveStateDescriptor desc(slot, saveName);
-
-		Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*file);
-		desc.setThumbnail(thumbnail);
-
-		desc.setDeletableFlag(true);
-		desc.setWriteProtectedFlag(false);
-
-		uint32 saveDate = file->readUint32BE();
-		uint16 saveTime = file->readUint16BE();
-
-		int day = (saveDate >> 24) & 0xFF;
-		int month = (saveDate >> 16) & 0xFF;
-		int year = saveDate & 0xFFFF;
-
-		desc.setSaveDate(year, month, day);
-
-		int hour = (saveTime >> 8) & 0xFF;
-		int minutes = saveTime & 0xFF;
-
-		desc.setSaveTime(hour, minutes);
-
-		// Slot 0 is used for the 'restart game' save in all Avalanche games, thus
-		// we prevent it from being deleted.
-		desc.setDeletableFlag(slot != 0);
-		desc.setWriteProtectedFlag(slot == 0);
-
-		delete file;
-		return desc;
-	}
-	return SaveStateDescriptor();
-}
-
-void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
-	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
-	g_system->getSavefileManager()->removeSavefile(fileName);
-}
+//int AvalancheMetaEngine::getMaximumSaveSlot() const { return 99; }
+//
+//SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
+//	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+//	Common::StringArray filenames;
+//	Common::String pattern = target;
+//	pattern += "-??.SAV";
+//
+//	filenames = saveFileMan->listSavefiles(pattern);
+//	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
+//
+//	SaveStateList saveList;
+//	char slot[3];
+//	int slotNum = 0;
+//	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
+//		slot[0] = filename->c_str()[filename->size() - 6];
+//		slot[1] = filename->c_str()[filename->size() - 5];
+//		slot[2] = '\0';
+//		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
+//		slotNum = atoi(slot);
+//		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
+//			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+//			if (file) {
+//				int saveVersion = file->readByte();
+//
+//				if (saveVersion != kSavegameVersion) {
+//					warning("Savegame of incompatible version");
+//					delete file;
+//					continue;
+//				}
+//
+//				// read name
+//				uint16 nameSize = file->readUint16BE();
+//				if (nameSize >= 255) {
+//					delete file;
+//					continue;
+//				}
+//				char name[256];
+//				file->read(name, nameSize);
+//				name[nameSize] = 0;
+//
+//				saveList.push_back(SaveStateDescriptor(slotNum, name));
+//				delete file;
+//			}
+//		}
+//	}
+//
+//	return saveList;
+//}
+//
+//SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+//	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+//	Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
+//
+//	if (file) {
+//		int saveVersion = file->readByte();
+//
+//		if (saveVersion != kSavegameVersion) {
+//			warning("Savegame of incompatible version");
+//			delete file;
+//			return SaveStateDescriptor();
+//		}
+//
+//		uint32 saveNameLength = file->readUint16BE();
+//		char saveName[256];
+//		file->read(saveName, saveNameLength);
+//		saveName[saveNameLength] = 0;
+//
+//		SaveStateDescriptor desc(slot, saveName);
+//
+//		Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*file);
+//		desc.setThumbnail(thumbnail);
+//
+//		desc.setDeletableFlag(true);
+//		desc.setWriteProtectedFlag(false);
+//
+//		uint32 saveDate = file->readUint32BE();
+//		uint16 saveTime = file->readUint16BE();
+//
+//		int day = (saveDate >> 24) & 0xFF;
+//		int month = (saveDate >> 16) & 0xFF;
+//		int year = saveDate & 0xFFFF;
+//
+//		desc.setSaveDate(year, month, day);
+//
+//		int hour = (saveTime >> 8) & 0xFF;
+//		int minutes = saveTime & 0xFF;
+//
+//		desc.setSaveTime(hour, minutes);
+//
+//		// Slot 0 is used for the 'restart game' save in all Avalanche games, thus
+//		// we prevent it from being deleted.
+//		desc.setDeletableFlag(slot != 0);
+//		desc.setWriteProtectedFlag(slot == 0);
+//
+//		delete file;
+//		return desc;
+//	}
+//	return SaveStateDescriptor();
+//}
+//
+//void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
+//	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+//	g_system->getSavefileManager()->removeSavefile(fileName);
+//}
 
 } // End of namespace Avalanche
 
@@ -214,10 +222,10 @@ REGISTER_PLUGIN_DYNAMIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaE
 REGISTER_PLUGIN_STATIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
 #endif
 
-namespace Avalanche {
-
-void AvalancheEngine::initGame(const ADGameDescription *gd) {
-	_platform = gd->platform;
-}
-
-} // End of namespace Avalanche
+//namespace Avalanche {
+//
+//void AvalancheEngine::initGame(const ADGameDescription *gd) {
+//	_platform = gd->platform;
+//}
+//
+//} // End of namespace Avalanche


Commit: b2f62278b6652b86d187942cfd8f5cccc36b225b
    https://github.com/scummvm/scummvm/commit/b2f62278b6652b86d187942cfd8f5cccc36b225b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-19T23:34:48-07:00

Commit Message:
AVALANCHE: Remove some functions from detection.

Changed paths:
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 10d23bb..1fc13bc 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -83,137 +83,18 @@ public:
 
 	bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
 	bool hasFeature(MetaEngineFeature f) const;
-
-	/*int getMaximumSaveSlot() const;
-	SaveStateList listSaves(const char *target) const;
-	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
-	void removeSaveState(const char *target, int slot) const;*/
 };
 
 bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
-	if (gd) /*{*/
+	if (gd)
 		*engine = new AvalancheEngine(syst, (const AvalancheGameDescription *)gd);
-		/*	((AvalancheEngine *)*engine)->initGame((const ADGameDescription *)gd);
-		}*/
 	return gd != 0;
 }
 
 bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return false;
-		/*(f == kSupportsListSaves) ||
-		 (f == kSupportsLoadingDuringStartup) ||
-		 (f == kSupportsDeleteSave) ||
-		 (f == kSavesSupportMetaInfo) ||
-		 (f == kSavesSupportThumbnail) ||
-		 (f == kSavesSupportCreationDate);*/
 }
 
-//int AvalancheMetaEngine::getMaximumSaveSlot() const { return 99; }
-//
-//SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
-//	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
-//	Common::StringArray filenames;
-//	Common::String pattern = target;
-//	pattern += "-??.SAV";
-//
-//	filenames = saveFileMan->listSavefiles(pattern);
-//	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
-//
-//	SaveStateList saveList;
-//	char slot[3];
-//	int slotNum = 0;
-//	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
-//		slot[0] = filename->c_str()[filename->size() - 6];
-//		slot[1] = filename->c_str()[filename->size() - 5];
-//		slot[2] = '\0';
-//		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
-//		slotNum = atoi(slot);
-//		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
-//			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
-//			if (file) {
-//				int saveVersion = file->readByte();
-//
-//				if (saveVersion != kSavegameVersion) {
-//					warning("Savegame of incompatible version");
-//					delete file;
-//					continue;
-//				}
-//
-//				// read name
-//				uint16 nameSize = file->readUint16BE();
-//				if (nameSize >= 255) {
-//					delete file;
-//					continue;
-//				}
-//				char name[256];
-//				file->read(name, nameSize);
-//				name[nameSize] = 0;
-//
-//				saveList.push_back(SaveStateDescriptor(slotNum, name));
-//				delete file;
-//			}
-//		}
-//	}
-//
-//	return saveList;
-//}
-//
-//SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
-//	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
-//	Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
-//
-//	if (file) {
-//		int saveVersion = file->readByte();
-//
-//		if (saveVersion != kSavegameVersion) {
-//			warning("Savegame of incompatible version");
-//			delete file;
-//			return SaveStateDescriptor();
-//		}
-//
-//		uint32 saveNameLength = file->readUint16BE();
-//		char saveName[256];
-//		file->read(saveName, saveNameLength);
-//		saveName[saveNameLength] = 0;
-//
-//		SaveStateDescriptor desc(slot, saveName);
-//
-//		Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*file);
-//		desc.setThumbnail(thumbnail);
-//
-//		desc.setDeletableFlag(true);
-//		desc.setWriteProtectedFlag(false);
-//
-//		uint32 saveDate = file->readUint32BE();
-//		uint16 saveTime = file->readUint16BE();
-//
-//		int day = (saveDate >> 24) & 0xFF;
-//		int month = (saveDate >> 16) & 0xFF;
-//		int year = saveDate & 0xFFFF;
-//
-//		desc.setSaveDate(year, month, day);
-//
-//		int hour = (saveTime >> 8) & 0xFF;
-//		int minutes = saveTime & 0xFF;
-//
-//		desc.setSaveTime(hour, minutes);
-//
-//		// Slot 0 is used for the 'restart game' save in all Avalanche games, thus
-//		// we prevent it from being deleted.
-//		desc.setDeletableFlag(slot != 0);
-//		desc.setWriteProtectedFlag(slot == 0);
-//
-//		delete file;
-//		return desc;
-//	}
-//	return SaveStateDescriptor();
-//}
-//
-//void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
-//	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
-//	g_system->getSavefileManager()->removeSavefile(fileName);
-//}
-
 } // End of namespace Avalanche
 
 #if PLUGIN_ENABLED_DYNAMIC(AVALANCHE)
@@ -221,11 +102,3 @@ REGISTER_PLUGIN_DYNAMIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaE
 #else
 REGISTER_PLUGIN_STATIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
 #endif
-
-//namespace Avalanche {
-//
-//void AvalancheEngine::initGame(const ADGameDescription *gd) {
-//	_platform = gd->platform;
-//}
-//
-//} // End of namespace Avalanche


Commit: 1453413d24c344a6c55a5d5d324e200ccb68b6d2
    https://github.com/scummvm/scummvm/commit/1453413d24c344a6c55a5d5d324e200ccb68b6d2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-20T00:40:25-07:00

Commit Message:
AVALANCHE: Fix detection.

Changed paths:
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 1fc13bc..701f12b 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -47,13 +47,13 @@ const char *AvalancheEngine::getGameId() const {
 }
 
 static const PlainGameDescriptor avalancheGames[] = {
-	{"avalot", "Lord Avalot d'Argent"},
+	{"avalanche", "Lord Avalot d'Argent"},
 	{0, 0}
 };
 
 static const ADGameDescription gameDescriptions[] = {
 	{
-		"Avalanche", 0,
+		"avalanche", 0,
 		{
 			{"avalot.sez", 0, "de10eb353228013da3d3297784f81ff9", 48763},
 			{"mainmenu.avd", 0, "89f31211af579a872045b175cc264298", 18880},


Commit: a33797b2728bed7a381bbecc55dd2f45710ea36d
    https://github.com/scummvm/scummvm/commit/a33797b2728bed7a381bbecc55dd2f45710ea36d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-20T01:58:39-07:00

Commit Message:
AVALANCHE: Partially implement run_avalot().

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f66e293..80c2ffc 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -39,6 +39,13 @@
 
 namespace Avalanche {
 
+	void avalot(bool firstTime, Common::String arguments) {
+		warning("STUB: avalot()"); // That will be a class made from avalot9.cpp !!! - or something like that
+	}
+
+
+
+
 	AvalancheEngine *AvalancheEngine::s_Engine = 0;
 
 	AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
@@ -115,21 +122,25 @@ namespace Avalanche {
 		warning("STUB: explain()");
 	}
 
+
+
+	//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
+
 	void AvalancheEngine::b_flight() {   /*interrupt;*/
 		_storage.skellern++;
 	}
 
 	void AvalancheEngine::bflight_on() {
 		_storage.skellern = _reset_;
-		warning("STUB: bflight_on()");
 		// setintvec(0x1c, &b_flight);
 	}
 
 	void AvalancheEngine::bflight_off() {
-		warning("STUB: bflight_off()");
 		// setintvec(0x1c, old_1c);
 	}
 
+
+
 	Common::String AvalancheEngine::elm2str(elm how) {
 		Common::String elm2str_result;
 		switch (how) {
@@ -153,7 +164,11 @@ namespace Avalanche {
 	}
 
 	void AvalancheEngine::run_avalot() {
-		warning("STUB: run_avalot()");
+		bflight_on();
+
+		avalot(first_time, arguments);  // TODO: Check if parameteres are ever use and eventually remove them
+		// If there's an error initalizing avalot, i'll handle it in there, not here
+		first_time = false;
 	}
 
 	void AvalancheEngine::run_the_demo() {


Commit: fa10b10ec75b4916a96b0f82c6927befbc6c0f38
    https://github.com/scummvm/scummvm/commit/fa10b10ec75b4916a96b0f82c6927befbc6c0f38
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-20T03:47:44-07:00

Commit Message:
AVALANCHE: Keep the functions connected to command line arguments and the main menu for later. Minimal cosmetic modifications in the order of the functions.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 80c2ffc..d8a43ba 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -39,7 +39,7 @@
 
 namespace Avalanche {
 
-	void avalot(bool firstTime, Common::String arguments) {
+	void avalot(Common::String arg) {
 		warning("STUB: avalot()"); // That will be a class made from avalot9.cpp !!! - or something like that
 	}
 
@@ -96,6 +96,8 @@ namespace Avalanche {
 
 	// From Bootstrp:
 
+	const char AvalancheEngine::runcodes[2][3] = {"et", "Go"};
+
 	void AvalancheEngine::cursor_off() {
 		warning("STUB: cursor_off()");
 	}
@@ -163,10 +165,25 @@ namespace Avalanche {
 		// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 	}
 
+	void AvalancheEngine::get_arguments() {
+		// This function should mess around with command line arguments,
+		// but I am not sure if there'll be use of these arguments at all...
+		warning("STUB: get_arguments()"); 
+	}
+
+	void AvalancheEngine::get_slope() {
+		// Same as get_arguments()
+		warning("STUB: get_slope()");
+	}
+
+	void AvalancheEngine::call_menu() {
+		warning("STUB: call_menu()");
+	}
+
 	void AvalancheEngine::run_avalot() {
 		bflight_on();
 
-		avalot(first_time, arguments);  // TODO: Check if parameteres are ever use and eventually remove them
+		avalot(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
 		// If there's an error initalizing avalot, i'll handle it in there, not here
 		first_time = false;
 	}
@@ -175,10 +192,6 @@ namespace Avalanche {
 		warning("STUB: run_the_demo()");
 	}
 
-	void AvalancheEngine::get_arguments() {
-		warning("STUB: get_arguments()");
-	}
-
 	void AvalancheEngine::dos_shell() {
 		warning("STUB: dos_shell()");
 	}
@@ -196,13 +209,9 @@ namespace Avalanche {
 		warning("STUB: demo()");
 	}
 
-	void AvalancheEngine::call_menu() {
-		warning("STUB: call_menu()");
-	}
+	
+
 
-	void AvalancheEngine::get_slope() {
-		warning("STUB: get_slope()");
-	}
 
 
 
@@ -223,6 +232,9 @@ namespace Avalanche {
 		get_arguments();
 		get_slope();
 
+		zoomy = false; 
+		// Call the menu by default. Might be modified later, if get_slope() gets implemented,
+		// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
 		if (! zoomy)  call_menu();    /* Not run when zoomy. */
 
 		do {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 6837ea5..e6148be 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -85,6 +85,8 @@ private:
 
 	static const int16 _runShootemup = 1, _runDosshell = 2, _runGhostroom = 3, _runGolden = 4;
 
+	static const char runcodes[2][3];
+
 	static const int16 _reset_ = 0;
 
 	static const bool _jsb = true, _no_jsb = false, _bflight = true, _no_bflight = false;
@@ -130,12 +132,16 @@ private:
 
 	void run(Common::String what, bool with_jsb, bool with_bflight, elm how);
 
+	void get_arguments();
+
+	void get_slope();
+
+	void call_menu();
+
 	void run_avalot();
 
 	void run_the_demo();
 
-	void get_arguments();
-
 	void dos_shell();
 
 	bool keypressed1();
@@ -143,11 +149,6 @@ private:
 	void flush_buffer();
 
 	void demo();
-
-	void call_menu();
-
-	void get_slope();
-
 };
 
 } // End of namespace Avalanche


Commit: 3946d0ed929069de3740c03180274e2db0555422
    https://github.com/scummvm/scummvm/commit/3946d0ed929069de3740c03180274e2db0555422
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-20T05:08:58-07:00

Commit Message:
AVALANCHE: Add class Avalot. Cosmetic modifications.

Changed paths:
  A engines/avalanche/avalot.cpp
  A engines/avalanche/avalot.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d8a43ba..6e57663 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -25,6 +25,9 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+#include "avalanche/avalanche.h"
+#include "avalanche/avalot.h"
+
 #include "common/system.h"
 #include "common/random.h"
 #include "common/error.h"
@@ -33,19 +36,10 @@
 #include "common/config-manager.h"
 #include "common/textconsole.h"
 
-#include "avalanche/avalanche.h"
-
 #include "engines/util.h"
 
 namespace Avalanche {
 
-	void avalot(Common::String arg) {
-		warning("STUB: avalot()"); // That will be a class made from avalot9.cpp !!! - or something like that
-	}
-
-
-
-
 	AvalancheEngine *AvalancheEngine::s_Engine = 0;
 
 	AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
@@ -98,6 +92,10 @@ namespace Avalanche {
 
 	const char AvalancheEngine::runcodes[2][3] = {"et", "Go"};
 
+
+
+	// The original ones were all commented out, so porbably there's no need
+	// of these two cursor functions at all. TODO: Remove later.
 	void AvalancheEngine::cursor_off() {
 		warning("STUB: cursor_off()");
 	}
@@ -106,6 +104,7 @@ namespace Avalanche {
 		warning("STUB: cursor_on()");
 	}
 
+	// Needed later.
 	void AvalancheEngine::quit() {
 		cursor_on();
 	}
@@ -115,11 +114,13 @@ namespace Avalanche {
 		return q;
 	}
 
+	// Needed in dos_shell(). TODO: Remove later.
 	Common::String AvalancheEngine::command_com() {
 		warning("STUB: command_com()");
 		return ("STUB: command_com()");
 	}
 
+	// Needed for run_avalot()'s errors. TODO: Remove later.
 	void AvalancheEngine::explain(byte error) {
 		warning("STUB: explain()");
 	}
@@ -180,14 +181,6 @@ namespace Avalanche {
 		warning("STUB: call_menu()");
 	}
 
-	void AvalancheEngine::run_avalot() {
-		bflight_on();
-
-		avalot(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
-		// If there's an error initalizing avalot, i'll handle it in there, not here
-		first_time = false;
-	}
-
 	void AvalancheEngine::run_the_demo() {
 		warning("STUB: run_the_demo()");
 	}
@@ -196,22 +189,33 @@ namespace Avalanche {
 		warning("STUB: dos_shell()");
 	}
 
-	bool AvalancheEngine::keypressed1() {
+	// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
+	bool AvalancheEngine::keypressed1() {	
 		warning("STUB: keypressed1()");
 		return false;
 	}
 
+	// Same as keypressed1().
 	void AvalancheEngine::flush_buffer() {
 		warning("STUB: flush_buffer()");
 	}
 
+	// Same as keypressed1().
 	void AvalancheEngine::demo() {
 		warning("STUB: demo()");
 	}
 
-	
 
 
+	
+	void AvalancheEngine::run_avalot() {
+		bflight_on();
+
+		Avalot ava;
+		ava.run(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
+		// If there's an error initalizing avalot, i'll handle it in there, not here
+		first_time = false;
+	}
 
 
 
@@ -224,9 +228,6 @@ namespace Avalanche {
 
 		// From bootstrp:
 
-		/*original_mode = mem[seg0040 * 0x49];
-		getintvec(0x1c, old_1c);*/
-
 		first_time = true;
 
 		get_arguments();
@@ -261,11 +262,6 @@ namespace Avalanche {
 
 
 
-		//	_mouse = new MouseHandler(this);
-
-		// Setup mixer
-		syncSoundSettings();
-
 		return Common::kNoError;
 	}
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e6148be..fa87d8b 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -28,8 +28,9 @@
 #ifndef AVALANCHE_H
 #define AVALANCHE_H
 
-#include "engines/engine.h"
 #include "avalanche/console.h"
+
+#include "engines/engine.h"
 #include "engines/advancedDetector.h"
 
 namespace Common {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
new file mode 100644
index 0000000..e89fbe1
--- /dev/null
+++ b/engines/avalanche/avalot.cpp
@@ -0,0 +1,41 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "common/str.h"
+#include "common/textconsole.h"
+
+#include "avalanche/avalot.h"
+
+namespace Avalanche {
+
+	Avalot::Avalot() {}
+
+	void Avalot::run(Common::String arg) {
+		warning("STUB: Avalot::run()");
+	}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
new file mode 100644
index 0000000..84c96b4
--- /dev/null
+++ b/engines/avalanche/avalot.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef AVALOT_H
+#define AVALOT_H
+
+#include "common/str.h"
+
+namespace Avalanche {
+
+class Avalot {
+private:
+
+public:
+	Avalot();
+
+	void run(Common::String arg);
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALOT_H
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 4db7160..8a83129 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/avalanche
 
 MODULE_OBJS = \
 	avalanche.o \
+	avalot.o \
 	console.o \
 	detection.o
 


Commit: 6d35a794cdb3466fb230ec5d0d87a86773978262
    https://github.com/scummvm/scummvm/commit/6d35a794cdb3466fb230ec5d0d87a86773978262
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-21T02:23:11-07:00

Commit Message:
AVALANCHE: Getting GYRO to compile.

Changed paths:
  A engines/avalanche/gyro2.cpp
  A engines/avalanche/gyro2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6e57663..c644b30 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -236,7 +236,8 @@ namespace Avalanche {
 		zoomy = false; 
 		// Call the menu by default. Might be modified later, if get_slope() gets implemented,
 		// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
-		if (! zoomy)  call_menu();    /* Not run when zoomy. */
+		if (! zoomy)
+			call_menu();    /* Not run when zoomy. */
 
 		do {
 			run_avalot();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e89fbe1..337f896 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -35,6 +35,9 @@ namespace Avalanche {
 	Avalot::Avalot() {}
 
 	void Avalot::run(Common::String arg) {
+
+
+
 		warning("STUB: Avalot::run()");
 	}
 
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 84c96b4..596fc02 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -28,7 +28,7 @@
 #ifndef AVALOT_H
 #define AVALOT_H
 
-#include "common/str.h"
+#include "common/system.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
new file mode 100644
index 0000000..b44cbee
--- /dev/null
+++ b/engines/avalanche/gyro2.cpp
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/gyro2.h"
+
+namespace Avalanche {
+
+	namespace Gyro {
+
+
+
+	} // End of namespace Gyro
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
new file mode 100644
index 0000000..b9f46f5
--- /dev/null
+++ b/engines/avalanche/gyro2.h
@@ -0,0 +1,841 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef GYRO2_H
+#define GYRO2_H
+
+#include "common/system.h"
+#include "common/str.h"
+#include "common/scummsys.h"
+
+namespace Avalanche {
+
+	namespace Gyro {
+
+	///////////////////////////// CONSTANTS ///////////////////////////// 
+
+	const char numobjs = 18; /* always preface with a # */
+	const int16 maxobjs = 12;  /* carry limit */
+	const byte howlong = 1/*8*/; /* 18 ticks. */
+
+	const bool oncandopageswap = true; 
+	/* Variable constant for overriding the ability of On to switch pages.
+	 * You may know better than On which page to switch to. */
+
+	const int16 num = 32;  /* Code for Num Lock */
+
+	const int16 mouse_size = 134;
+
+
+
+	///////////////////////////// TYPEDEFS ///////////////////////////// 
+
+	typedef void(*proc)();
+
+	struct postype {
+		uint16 x, y, datapos;
+		byte length;
+	};
+
+	struct mp { /* mouse-void **/
+		uint16 mask[2][16];
+		int16 horzhotspot, verthotspot;
+	};
+
+	struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
+		byte rw; /* Realway- just for convenience! */
+		byte carrying; /* how many objects you're carrying... */
+		bool obj[numobjs]; /* ...and which ones they are. */
+		int16 score; /* your score, of course */
+		int32 pence; /* your current amount of dosh */
+		byte room; /* your current room */
+		char wearing; /* what you're wearing */
+		byte swore; /* number of times you've sworn */
+		byte saves; /* number of times this game has been saved */
+		byte rooms[100];     /* Add one to each every time
+												you enter a room */
+		byte alcohol; /* Your blood alcohol level. */
+		byte playednim; /* How many times you've played Nim. */
+		bool wonnim; /* Have you *won* Nim? (That's harder.) */
+		byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/
+		bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/
+
+		byte pass_num; /* Number of the passuint16 for this game. */
+		bool ayles_is_awake; /* pretty obvious! */
+		byte drawbridge_open; /* Between 0 (shut) and 4 (open). */
+		byte avaricius_talk; /* How much Avaricius has said to you. */
+		bool bought_onion; /* Have you bought an onion yet? */
+		bool rotten_onion; /* And has it rotted? */
+		bool onion_in_vinegar; /* Is the onion in the vinegar? */
+
+		byte given2spludwick; /* 0 = nothing given, 1 = onion... */
+		byte brummie_stairs; /* Progression through the stairs trick. */
+		byte cardiff_things; /* Things you get asked in Cardiff. */
+
+		bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/
+
+		bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */
+		bool avvy_in_bed; /* True if Avvy's in bed, but awake. */
+
+		bool user_moves_avvy; /* If this is false, the user has no
+											control over Avvy's movements. */
+
+		byte dogfoodpos; /* Which way Dogfood's looking in the pub. */
+
+		bool givenbadgetoiby; /* Have you given the badge to Iby yet? */
+
+		bool friar_will_tie_you_up; /* If you're going to get tied up. */
+		bool tied_up; /* You ARE tied up! */
+
+		char box_contents; /* 0 = money (sixpence), 254 = empty, any
+				 other number implies the contents of the box. */
+
+		bool talked_to_crapulus; /* Pretty self-explanatory. */
+
+		byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */
+
+		bool ringing_bells; /* Is Jacques ringing the bells? */
+
+		bool standing_on_dais; /* In room 71, inside Cardiff Castle. */
+		bool taken_pen; /* Have you taken the pen (in Cardiff?) */
+		bool arrow_triggered; /* And has the arrow been triggered? */
+		bool arrow_in_the_door;  /* Did the arrow hit the wall? */
+
+		Common::String like2drink,
+					   favourite_song,
+					   worst_place_on_earth,
+					   spare_evening;            /* Personalisation str's */
+
+		int32 total_time; /* Your total time playing this game, in ticks.*/
+
+		byte jumpstatus; /* Fixes how high you're jumping. */
+
+		bool mushroom_growing; /* Is the mushroom growing in 42? */
+
+		bool spludwicks_here; /* Is Spludwick at home? */
+
+		byte last_room;
+		byte last_room_not_map;
+
+		bool crapulus_will_tell; /* Will Crapulus tell you about
+							Spludwick being away? */
+
+		bool enter_catacombs_from_lusties_room;
+		bool teetotal; /* Are we touching any more drinks? */
+		byte malagauche; /* Position of Malagauche. See Celer for more info. */
+		char drinking; /* What's he getting you? */
+
+		bool entered_lusties_room_as_monk;
+
+		byte cat_x, cat_y;   /* XY coords in the catacombs. */
+
+		bool avvys_in_the_cupboard; /* On screen 22. */
+
+		bool geida_follows; /* Is Geida following you? */
+
+		byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */
+
+		byte nextbell; /* For the ringing. */
+
+		bool geida_given_potion; /* Does Geida have the potion? */
+		bool lustie_is_asleep; /* Is BDL asleep? */
+
+		byte flip_to_where, flip_to_ped; /* For the sequencer. */
+
+		bool been_tied_up; /* In r__Robins. */
+
+		bool sitting_in_pub; /* Are you sitting down in the pub? */
+		byte spurge_talk; /* Count for talking to Spurge. */
+
+		bool met_avaroid;
+
+		bool taken_mushroom,
+				given_pen_to_ayles,
+				asked_dogfood_about_nim;
+	};
+
+	struct pedtype {
+		int16 x, y;
+		byte dir;
+	};
+
+	struct magictype {
+		byte op; /* one of the operations */
+		uint16 data; /* data for them */
+	};
+
+	class fieldtype {
+	public:
+		int16 x1, y1, x2, y2;
+	};
+
+	struct bytefield {
+		byte x1, y1, x2, y2;
+	};
+
+	class linetype : public fieldtype {
+	public:
+		byte col;
+	};
+
+	struct adxtype {
+		Common::String name; /* name of character */
+		byte num; /* number of pictures */
+		byte xl, yl; /* x & y lengths of pictures */
+		byte seq; /* how many in one stride */
+		uint16 size; /* the size of one picture */
+		byte fgc, bgc; /* foreground & background bubble colours */
+	};
+
+	typedef byte raw[256][16]; /* raw_font_type */
+
+	enum controllers {cjoy, ckey};
+
+	typedef Common::String previoustype[20];
+
+	struct corridor_type { /* Decarations for the corridors. */
+		uint16 doors; /* Door styles are calc'ed from this uint16.
+					   Assign a different number to each one! */
+	};
+
+	struct demo_type {
+		uint16 delay;
+		char key, extd;
+	};
+
+	struct quasiped_type {
+		byte whichped, fgc, room, bgc;
+		char who;
+	};
+	/* A quasiped defines how people who aren't sprites talk. For example,
+	   quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
+	   that to context. */
+
+	typedef byte tunetype[31];
+
+	struct vmctype { /* Virtual Mouse Cursor */
+		void *andpic, *xorpic;
+		void *backpic[2];
+		void* wherewas[2];
+		byte picnumber;
+		int8 ofsx, ofsy;
+	};
+
+	struct sundry {
+		/* Things which must be saved over a backtobootstrap,
+						   outside DNA. */
+		Common::String qenid_filename;
+		bool qsoundfx;
+		char qthinks;
+		bool qthinkthing;
+	};
+
+	struct joysetup {
+		uint16 xmid, ymid, xmin, ymin, xmax, ymax;
+		byte centre; /* Size of centre in tenths */
+	};
+
+	struct ednahead { /* Edna header */
+		/* This header starts at byte offset 177 in the .ASG file. */
+		char id[9];   /* signature */
+		uint16 revision; /* EDNA revision, here 2 (1=dna256) */
+		Common::String game; /* Long name, eg Lord Avalot D'Argent */
+		Common::String shortname; /* Short name, eg Avalot */
+		uint16 number; /* Game's code number, here 2 */
+		uint16 ver; /* Version number as int16 (eg 1.00 = 100) */
+		Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */
+		Common::String filename; /* Filename, eg AVALOT.EXE */
+		byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/
+		Common::String os; /* Saving OS in text format. */
+
+		/* Info on this particular game */
+
+		Common::String fn; /* Filename (not extension ('cos that's .ASG)) */
+		byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
+		uint16 y;  /* ...saved on. */
+		Common::String desc; /* Description of game (same as in Avaricius!) */
+		uint16 len; /* Length of DNA (it's not going to be above 65535!) */
+
+		/* Quick reference & miscellaneous */
+
+		uint16 saves; /* no. of times this game has been saved */
+		int16 cash; /* contents of your wallet in numerical form */
+		Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/
+		uint16 points; /* your score */
+
+		/* DNA values follow, then footer (which is ignored) */
+	};
+
+	/* Possible values of edhead.os:
+	   1 = DOS        4 = Mac
+	   2 = Windows    5 = Amiga
+	   3 = OS/2       6 = ST
+	   7 = Archimedes */
+
+
+
+	///////////////////////////// CONSTANTS ///////////////////////////// 
+
+	const char vernum[] = "1.30";
+	const char copyright[] = "1995";
+	const int16 thisvercode = 130;
+	/* as "vernum", but numerically & without the ".". */
+	const int16 thisgamecode = 2; /* Avalot's code number */
+
+	/* Objects you can hold: */
+	const char wine = 1;
+	const char money = 2;
+	const char bodkin = 3;
+	const char potion = 4;
+	const char chastity = 5;
+	const char bolt = 6;
+	const char crossbow = 7;
+	const char lute = 10;
+	const char badge = 11;
+	const char mushroom = 12;
+	const char key = 13;
+	const char bell = 14;
+	const char prescription = 15;
+	const char pen = 16;
+	const char ink = 17;
+	const char clothes = 20;
+	const char habit = 21;
+	const char onion = 22;
+
+	/* People who hang around this game. */
+
+	/* Boys: */
+	const uint16 pavalot = 226;
+	const uint16 pspludwick = 227;
+	const uint16 pcrapulus = 230;
+	const uint16 pdrduck = 231;
+	const uint16 pmalagauche = 232;
+	const uint16 pfriartuck = 233;
+	const uint16 probinhood = 234;
+	const uint16 pcwytalot = 235;
+	const uint16 pdulustie = 236;
+	const uint16 pduke = 237;
+	const uint16 pdogfood = 240;
+	const uint16 ptrader = 241;
+	const uint16 pibythneth = 242;
+	const uint16 payles = 243;
+	const uint16 pport = 244;
+	const uint16 pspurge = 245;
+	const uint16 pjacques = 246;
+
+	/* Girls: */
+	const uint16 parkata = 257;
+	const uint16 pgeida = 260;
+	const uint16 pwisewoman = 262;
+
+	const int16 xw = 30;
+	const int16 yw = 36; /* x width & y whatsit */
+
+	const int16 margin = 5;
+
+	const mp mps[9] = {
+		   {
+				/* 1 - up-arrow */
+				{	{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575},
+					{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}
+				},	
+				8,
+				0
+			},
+
+			{
+				/* 2 - screwdriver */
+				{	{8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523},
+					{0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0}
+					
+				},
+				0,
+				0
+			},
+
+			{
+				/* 3 - right-arrow */
+				{	{65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535},
+					{0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0}	
+				},
+				15,
+				6
+			},
+
+			{
+				/* 4 - fletch */
+				{	{255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511},
+					{0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0}
+				},
+				0,
+				0
+			},
+
+			{
+				/* 5 - hourglass */
+				{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
+					{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
+				},
+				8,
+				7
+			},
+
+			{
+				/* 6 - TTHand */
+				{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
+					{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
+				},
+				4,
+				0
+			},
+
+			{
+				/* 7- Mark's crosshairs */
+				{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
+					{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
+				},
+				8,
+				5
+			},
+
+			{
+				/* 8- I-beam. */
+				{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
+					{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
+				},
+				8,
+				7
+			},
+
+			{
+				/* 9- Question mark. */
+				{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
+					{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
+				},
+				0,
+				0
+			}
+		
+	};
+
+	const Common::String lads[17] = {
+			"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
+			"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
+			"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+	};
+
+	const Common::String lasses[4] =
+	{"Arkata", "Geida", "±", "the Wise Woman"};
+
+	const char ladchar[] = "ASCDMTRwLfgeIyPu";
+
+	const char lasschar[] = "kG±o";
+
+	const int16 numtr = 2; /* current max no. of sprites */
+
+	const bool a_thing = true;
+	const bool a_person = false; /* for Thinkabout */
+
+	/* Magic/portal commands are */
+
+	/*N*/ const int16 nix = 0; /* ignore it if this line is touched */
+	/*B*/ const int16 bounces = 1; /* bounce off this line. Not valid for portals. */
+	/*E*/ const int16 exclaim = 2; /* put up a chain of scrolls */
+	/*T*/ const int16 transport = 3; /* enter new room */
+	/*U*/ const int16 unfinished = 4; /* unfinished connection */
+	/*S*/ const int16 special = 5; /* special function. */
+	/*O*/ const int16 mopendoor = 6; /* opening door. */
+
+	/* These following constants should be included in CFG when it's written. */
+
+	const bool slow_computer = false; /* stops walking when mouse touches toolbar */
+
+	/* --- */
+
+	const int16 border = 1; /* size of border on shadowboxes */
+
+	const int32 pagetop = 81920;
+
+	const int16 up = 0;
+	const int16 right = 1;
+	const int16 down = 2;
+	const int16 left = 3;
+	const int16 ur = 4;
+	const int16 dr = 5;
+	const int16 dl = 6;
+	const int16 ul = 7;
+	const int16 stopped = 8;
+
+	const int16 walk = 3;
+	const int16 run = 5;
+
+
+	//	Deal with it later !!!!!!!
+	// 
+	///*$I ROOMNUMS.INC - Room number constants (r__xxx) */
+
+	//const byte whereis[29] =
+	//	/* The Lads */
+	//{   {
+	//		r__yours, /* Avvy */
+	//		r__spludwicks, /* Spludwick */
+	//		r__outsideyours, /* Crapulus */
+	//		r__ducks, /* Duck - r__DucksRoom's not defined yet. */
+	//		r__argentpub, /* Malagauche */
+	//		r__robins, /* Friar Tuck. */
+	//		177, /* Robin Hood - can't meet him at the start. */
+	//		r__brummieroad, /* Cwytalot */
+	//		r__lustiesroom, /* Baron du Lustie. */
+	//		r__outsidecardiffcastle, /* The Duke of Cardiff. */
+	//		r__argentpub, /* Dogfood */
+	//		r__outsideducks, /* Trader */
+	//		r__argentpub, /* Ibythneth */
+	//		r__aylesoffice, /* Ayles */
+	//		r__nottspub, /* Port */
+	//		r__nottspub, /* Spurge */
+	//		r__musicroom, /* Jacques */
+	//		0, 0, 0, 0, 0, 0, 0, 0,
+	//		/* The Lasses */
+	//		r__yours, /* Arkata */
+	//		r__geidas, /* Geida */
+	//		177, /* nobody allocated here! */
+	//		r__wisewomans
+	//	}
+	//}; /* The Wise Woman. */
+
+	/* Art gallery at 2,1; notice about this at 2,2. */
+
+	const int32 catamap[8][8] = {
+		/* Geida's room */
+			/*  1     2			3   | 4     5		6		7     8*/
+			{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
+			{0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
+			{0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
+			{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */
+			{0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
+			{0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
+			{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */
+			{0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
+	};
+	/* vv Stairs trap. */
+
+	/* Explanation: $NSEW.
+	   Nibble N: North.
+		0     = no connection,
+		2     = (left,) middle(, right) door with left-hand handle,
+		5     = (left,) middle(, right) door with right-hand handle,
+		7     = arch,
+		8     = arch and 1 north of it,
+		9     = arch and 2 north of it,
+		D     = no connection + WINDOW,
+		E     = no connection + TORCH,
+		F     = recessed door (to Geida's room.)
+
+	   Nibble S: South.
+		0     = no connection,
+		1,2,3 = left, middle, right door.
+
+	   Nibble E: East.
+		0     = no connection (wall),
+		1     = no connection (wall + window),
+		2     = wall with door,
+		3     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor.
+
+	   Nibble W: West.
+		0     = no connection (wall),
+		1     = no connection (wall + shield),
+		2     = wall with door,
+		3     = wall with door and shield,
+		4     = no connection (window),
+		5     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor. */
+
+	const byte interrogation = 0;
+	/* If this is greater than zero, the next line you type is stored in
+	   the DNA in a position dictated by the value. If a scroll comes up,
+	   or you leave the room, it's automatically set to zero. */
+
+	const bool demo = false; /* If this is true, we're in a demo of the game. */
+
+	const char spludwick_order[3] = {onion, ink, mushroom};
+
+
+	//I need color constants here, like in CRT unit.
+	// 
+	//const quasiped_type quasipeds[16] = {
+	//	{	{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
+	//		{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
+	//		{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
+	//		{3, black,     23, red, '\261'},                         /* D: Hawk (screen 23). */
+	//		{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
+	//		{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
+	//		{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
+	//		{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
+	//		{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
+	//		{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
+	//		{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
+	//		{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
+	//		{3, white,     27, red, '\261'},                         /* M: Avaroid (screen 27). */
+	//		{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
+	//		{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
+	//		{2, lightgreen, 51, darkgray, pdrduck}
+	//	}
+	//};                         /*P: Duck (screen 51). */
+
+	const int16 lower = 0;
+	const int16 same = 1;
+	const int16 higher = 2;
+
+	const char keys[] = "QWERTYUIOP[]";
+	const uint16 notes[12] =
+	{196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+
+	const tunetype tune = {
+			higher, higher, lower, same, higher, higher, lower, higher, higher, higher,
+			lower, higher, higher,
+			same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower,
+			lower, same, lower, higher, same, lower, higher
+	};
+
+	/* special run-time errors */
+
+	const int16 runerr_getset_overflow = 50;
+
+
+	///////////////////////////// VARIABLES ///////////////////////////// 
+
+	Common::String current;
+	byte curpos;
+	bool cursoron;
+	/* previous:^previoustype;*/
+	Common::String last;
+	dnatype dna;
+	linetype lines[50]; /* For Also. */
+	int16 c;
+	//registers r; // http://www.freepascal.org/docs-html/rtl/dos/registers.html
+	enum { m_no , m_yes , m_virtual } visible;
+	bool dropsok, screturn, soundfx, cheat;
+	uint16 mx, my; /* mouse x & y now */
+	uint16 mpx, mpy; /* mouse x & y when pressed */
+	uint16 mrx, mry; /* mouse x & y when released */
+	byte mpress, mrelease; /* times left mouse button has been pressed/released */
+	byte keystatus; /* Mouse key status */
+	Common::String un[10];
+	byte unn;
+	Common::String mousetext;
+	/* which:array[0..5] of byte;*/
+	void *p;
+	bool weirduint16;
+	byte to_do;
+	bool lmo, mousemade;
+	Common::String scroll[15];
+	byte scrolln, score, whichwas;
+	char thinks;
+	bool thinkthing;
+
+	/* pp:array[1..1000] of postype;
+	bb:array[1..9000] of byte;*/
+	uint16 pptr, bptr;
+	int16 ppos[1][2];
+	uint16 pozzes[24];
+	byte anim;
+	void *copier;
+	int16 talkx, talky;
+	byte talkb, talkf;
+	byte scrollbells; /* no. of times to ring the bell */
+	bool ontoolbar, seescroll;
+
+	char objlist[10];
+	void * digit[10];
+	void *rwlite[9];
+	byte oldrw;
+	Common::String lastscore;
+	byte cmp; /* current mouse-void **/
+	Common::String verbstr; /* what you can do with your object. :-) */
+
+	Common::String * also[31][2];
+	pedtype peds[15];
+	magictype magics[15];
+	magictype portals[7];
+	fieldtype fields[30];
+	byte numfields;
+	Common::String flags;
+	Common::String listen;
+
+	uint16 oh, onh, om, h, m, s, s1;
+
+	Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
+
+	byte cp, ledstatus, defaultled;
+	raw little;
+	bool quote; /* 66 or 99 next? */
+	bool alive;
+	char buffer[2000];
+	uint16 bufsize;
+
+	byte oldjw; /* Old joystick-way */
+	controllers ctrl;
+
+	int16 underscroll; /* Y-coord of just under the scroll text. */
+
+	/* TSkellern is only temporary, and I'll replace it
+	with a local version when it's all fixed up. */
+
+	/* tskellern:int32 absolute $0:244; { Over int $61 }*/
+
+	bool ddmnow; /* Kludge so we don't have to keep referring to Dropdown */
+	Common::String roomname; /* Name of this room */
+
+	//text logfile; // http://wiki.freepascal.org/Text
+	bool logging, log_epson;
+
+	bool cl_override;
+
+	byte locks; /*ABSOLUTE $40:$17;*/
+
+	Common::String subject; /* What you're talking to them about. */
+	byte subjnumber; /* The same thing. */
+
+	bool keyboardclick; /* Is a keyboard click noise wanted? */
+
+	char him, her, it;
+	int32 roomtime; /* Set to 0 when you enter a room, added to in every loop.*/
+
+	bool after_the_scroll;
+
+	/* For the demo: */
+	demo_type demo_rec;
+	//file<demo_type> demofile; // http://www.freepascal.org/docs-html/ref/refsu21.html#x45-520003.3.4
+
+	char last_person; /* Last person to have been selected using the People
+						menu. */
+
+	bool doing_sprite_run; /* Only set to True if we're doing a sprite_run
+	at this moment. This stops the trippancy system from moving any of the
+	sprites. */
+
+	vmctype vmc;
+	Common::String filetoload;
+
+	bool holdthedawn; /* If this is true, calling Dawn will do nothing.
+	It's used, for example, at the start, to stop Load from dawning. */
+
+	uint16 storage_seg, storage_ofs; /* Seg and ofs of the Storage area. */
+	uint16 skellern; /* Offset of the timer variable - 1 more than storage_OFS */
+	bool reloaded; /* Is this NOT the primary loading? */
+
+	bool super_was_virtual, super_was_off; /* Used by Super_Off and Super_On */
+
+	Common::String enid_filename;
+
+	joysetup js;
+	uint16 cxmin, cxmax, cymin, cymax;
+	bool use_joy_a;
+
+
+	void newpointer(byte m);
+
+	void wait();    /* makes hourglass */
+
+	void on();
+
+	void off();
+
+	void on_virtual();
+
+	void off_virtual();
+
+	void xycheck();
+
+	void hopto(int16 x, int16 y); /* Moves mouse void *to x,y */
+
+	void check();
+
+	void note(uint16 hertz);
+
+	void blip();
+
+	Common::String strf(int32 x);
+
+	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
+
+	void newgame();
+
+	void click();
+
+	void slowdown();
+
+	bool flagset(char x);
+
+	void force_numlock();
+
+	bool pennycheck(uint16 howmuchby);
+
+	Common::String getname(char whose);
+
+	char getnamechar(char whose);
+
+	Common::String get_thing(char which);
+
+	char get_thingchar(char which);
+
+	Common::String get_better(char which);
+
+	Common::String f5_does();
+
+	void plot_vmc(int16 xx, int16 yy, byte page_);
+
+	void wipe_vmc(byte page_);
+
+	void setup_vmc();
+
+	void clear_vmc();
+
+	void load_a_mouse(byte which);
+
+	void background(byte x);
+
+	void hang_around_for_a_while();
+
+	void super_off();
+
+	void super_on();
+
+	bool mouse_near_text();
+
+
+
+	} // End of namespace Gyro
+
+} // End of namespace Avalanche
+
+#endif // GYRO2_H
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 8a83129..5f65d01 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -4,7 +4,8 @@ MODULE_OBJS = \
 	avalanche.o \
 	avalot.o \
 	console.o \
-	detection.o
+	detection.o \
+	gyro2.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)


Commit: 6317297b39b0632370fdffbdd257c0fc3d7b3ea6
    https://github.com/scummvm/scummvm/commit/6317297b39b0632370fdffbdd257c0fc3d7b3ea6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-21T02:53:10-07:00

Commit Message:
AVALANCHE: Implement ROOMNUMS.INC.

Changed paths:
  A engines/avalanche/roomnums.h
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index b9f46f5..93b7880 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -31,6 +31,7 @@
 #include "common/system.h"
 #include "common/str.h"
 #include "common/scummsys.h"
+#include "avalanche/roomnums.h"
 
 namespace Avalanche {
 
@@ -493,39 +494,32 @@ namespace Avalanche {
 	const int16 walk = 3;
 	const int16 run = 5;
 
-
-	//	Deal with it later !!!!!!!
-	// 
-	///*$I ROOMNUMS.INC - Room number constants (r__xxx) */
-
-	//const byte whereis[29] =
-	//	/* The Lads */
-	//{   {
-	//		r__yours, /* Avvy */
-	//		r__spludwicks, /* Spludwick */
-	//		r__outsideyours, /* Crapulus */
-	//		r__ducks, /* Duck - r__DucksRoom's not defined yet. */
-	//		r__argentpub, /* Malagauche */
-	//		r__robins, /* Friar Tuck. */
-	//		177, /* Robin Hood - can't meet him at the start. */
-	//		r__brummieroad, /* Cwytalot */
-	//		r__lustiesroom, /* Baron du Lustie. */
-	//		r__outsidecardiffcastle, /* The Duke of Cardiff. */
-	//		r__argentpub, /* Dogfood */
-	//		r__outsideducks, /* Trader */
-	//		r__argentpub, /* Ibythneth */
-	//		r__aylesoffice, /* Ayles */
-	//		r__nottspub, /* Port */
-	//		r__nottspub, /* Spurge */
-	//		r__musicroom, /* Jacques */
-	//		0, 0, 0, 0, 0, 0, 0, 0,
-	//		/* The Lasses */
-	//		r__yours, /* Arkata */
-	//		r__geidas, /* Geida */
-	//		177, /* nobody allocated here! */
-	//		r__wisewomans
-	//	}
-	//}; /* The Wise Woman. */
+	const byte whereis[29] = {
+		/* The Lads */
+			r__yours, /* Avvy */
+			r__spludwicks, /* Spludwick */
+			r__outsideyours, /* Crapulus */
+			r__ducks, /* Duck - r__DucksRoom's not defined yet. */
+			r__argentpub, /* Malagauche */
+			r__robins, /* Friar Tuck. */
+			177, /* Robin Hood - can't meet him at the start. */
+			r__brummieroad, /* Cwytalot */
+			r__lustiesroom, /* Baron du Lustie. */
+			r__outsidecardiffcastle, /* The Duke of Cardiff. */
+			r__argentpub, /* Dogfood */
+			r__outsideducks, /* Trader */
+			r__argentpub, /* Ibythneth */
+			r__aylesoffice, /* Ayles */
+			r__nottspub, /* Port */
+			r__nottspub, /* Spurge */
+			r__musicroom, /* Jacques */
+			0, 0, 0, 0, 0, 0, 0, 0,
+			/* The Lasses */
+			r__yours, /* Arkata */
+			r__geidas, /* Geida */
+			177, /* nobody allocated here! */
+			r__wisewomans
+	}; /* The Wise Woman. */
 
 	/* Art gallery at 2,1; notice about this at 2,2. */
 
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
new file mode 100644
index 0000000..c16fd05
--- /dev/null
+++ b/engines/avalanche/roomnums.h
@@ -0,0 +1,92 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef ROOMNUMS_H
+#define ROOMNUMS_H
+
+#include "common/system.h"
+
+namespace Avalanche {
+
+	namespace Gyro {
+
+	const byte r__nowhere = 0;
+	const byte r__yours = 1;
+	const byte r__outsideyours = 2;
+	/*{ a corridor in your castle. = 3 }
+	{ outside your castle = 5; }*/
+	const byte r__musicroom = 7;
+	const byte r__outsideargentpub = 9;
+	const byte r__argentroad = 10;
+	const byte r__wisewomans = 11;
+	const byte r__spludwicks = 12;
+	const byte r__insideabbey = 13;
+	const byte r__outsideabbey = 14; /*{ assumed }*/
+	const byte r__avvysgarden = 15;
+	const byte r__aylesoffice = 16;
+	const byte r__argentpub = 19;
+	const byte r__brummieroad = 20;
+	const byte r__lusties = 21; /*{ ? not sure }*/
+	const byte r__entrancehall = 22;
+	const byte r__lustiesroom = 23;
+	const byte r__westhall = 25;
+	const byte r__easthall = 26;
+	const byte r__oubliette = 27;
+	const byte r__geidas = 28;
+	const byte r__catacombs = 29;
+
+	//{ -------------- }
+
+	const byte r__bridge = 40;
+	const byte r__robins = 42;
+	const byte r__outsidenottspub = 46;
+	const byte r__nottspub = 47;
+
+	//{ -------------- }
+
+	const byte r__outsideducks = 50;
+	const byte r__ducks = 51;
+
+	//{ -------------- }
+
+	const byte r__outsidecardiffcastle = 70;
+	const byte r__insidecardiffcastle = 71;
+
+	//{ -------------- }
+
+	/*{ place80 appears to be bogus }*/
+
+	//{ -------------- }
+
+	const byte r__bosskey = 98; /*{ assumed }*/
+	const byte r__map = 99;
+
+	} // End of namespace Gyro
+
+} // End of namespace Avalanche
+
+#endif // ROOMNUMS_H


Commit: 1ce5e3bc3ff9082e057475bb5cfbc15a212f43eb
    https://github.com/scummvm/scummvm/commit/1ce5e3bc3ff9082e057475bb5cfbc15a212f43eb
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-21T04:12:22-07:00

Commit Message:
AVALANCHE: Add color.h to replace the color constants from the CRT unit of Pascal.

Changed paths:
  A engines/avalanche/color.h
    engines/avalanche/gyro2.h
    engines/avalanche/roomnums.h



diff --git a/engines/avalanche/color.h b/engines/avalanche/color.h
new file mode 100644
index 0000000..1a8e69d
--- /dev/null
+++ b/engines/avalanche/color.h
@@ -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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+// Color constants replacing the colors from the CRT unit of Pascal
+
+#ifndef COLOR_H
+#define COLOR_H
+
+#include "common/system.h"
+
+namespace Avalanche {
+
+const byte black = 0;
+const byte blue = 1;
+const byte green = 2;
+const byte cyan = 3;
+const byte red = 4;
+const byte magenta = 5;
+const byte brown = 6;
+const byte lightgray = 7;
+const byte darkgray = 8;
+const byte lightblue = 9;
+const byte lightgreen = 10;
+const byte lightcyan = 11;
+const byte lightred = 12;
+const byte lightmagenta = 13;
+const byte yellow = 14;
+const byte white = 15;
+
+} // End of namespace Avalanche
+
+#endif // COLOR_H
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 93b7880..db02bc2 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -32,6 +32,7 @@
 #include "common/str.h"
 #include "common/scummsys.h"
 #include "avalanche/roomnums.h"
+#include "avalanche/color.h"
 
 namespace Avalanche {
 
@@ -230,7 +231,7 @@ namespace Avalanche {
 
 	struct quasiped_type {
 		byte whichped, fgc, room, bgc;
-		char who;
+		uint16 who;
 	};
 	/* A quasiped defines how people who aren't sprites talk. For example,
 	   quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
@@ -581,29 +582,25 @@ namespace Avalanche {
 	const bool demo = false; /* If this is true, we're in a demo of the game. */
 
 	const char spludwick_order[3] = {onion, ink, mushroom};
-
-
-	//I need color constants here, like in CRT unit.
-	// 
-	//const quasiped_type quasipeds[16] = {
-	//	{	{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
-	//		{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
-	//		{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
-	//		{3, black,     23, red, '\261'},                         /* D: Hawk (screen 23). */
-	//		{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
-	//		{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
-	//		{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
-	//		{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
-	//		{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
-	//		{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
-	//		{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
-	//		{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
-	//		{3, white,     27, red, '\261'},                         /* M: Avaroid (screen 27). */
-	//		{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
-	//		{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
-	//		{2, lightgreen, 51, darkgray, pdrduck}
-	//	}
-	//};                         /*P: Duck (screen 51). */
+	 
+	const quasiped_type quasipeds[16] = {
+		{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
+		{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
+		{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
+		{3, black,     23, red, 177},                         /* D: Hawk (screen 23). */
+		{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
+		{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
+		{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
+		{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
+		{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
+		{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
+		{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
+		{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
+		{3, white,     27, red, 177},                         /* M: Avaroid (screen 27). */
+		{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
+		{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
+		{2, lightgreen, 51, darkgray, pdrduck}
+	};                         /*P: Duck (screen 51). */
 
 	const int16 lower = 0;
 	const int16 same = 1;
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index c16fd05..3c5ee49 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -32,60 +32,56 @@
 
 namespace Avalanche {
 
-	namespace Gyro {
-
-	const byte r__nowhere = 0;
-	const byte r__yours = 1;
-	const byte r__outsideyours = 2;
-	/*{ a corridor in your castle. = 3 }
-	{ outside your castle = 5; }*/
-	const byte r__musicroom = 7;
-	const byte r__outsideargentpub = 9;
-	const byte r__argentroad = 10;
-	const byte r__wisewomans = 11;
-	const byte r__spludwicks = 12;
-	const byte r__insideabbey = 13;
-	const byte r__outsideabbey = 14; /*{ assumed }*/
-	const byte r__avvysgarden = 15;
-	const byte r__aylesoffice = 16;
-	const byte r__argentpub = 19;
-	const byte r__brummieroad = 20;
-	const byte r__lusties = 21; /*{ ? not sure }*/
-	const byte r__entrancehall = 22;
-	const byte r__lustiesroom = 23;
-	const byte r__westhall = 25;
-	const byte r__easthall = 26;
-	const byte r__oubliette = 27;
-	const byte r__geidas = 28;
-	const byte r__catacombs = 29;
-
-	//{ -------------- }
-
-	const byte r__bridge = 40;
-	const byte r__robins = 42;
-	const byte r__outsidenottspub = 46;
-	const byte r__nottspub = 47;
-
-	//{ -------------- }
-
-	const byte r__outsideducks = 50;
-	const byte r__ducks = 51;
-
-	//{ -------------- }
-
-	const byte r__outsidecardiffcastle = 70;
-	const byte r__insidecardiffcastle = 71;
-
-	//{ -------------- }
-
-	/*{ place80 appears to be bogus }*/
-
-	//{ -------------- }
-
-	const byte r__bosskey = 98; /*{ assumed }*/
-	const byte r__map = 99;
-
-	} // End of namespace Gyro
+const byte r__nowhere = 0;
+const byte r__yours = 1;
+const byte r__outsideyours = 2;
+/*{ a corridor in your castle. = 3 }
+{ outside your castle = 5; }*/
+const byte r__musicroom = 7;
+const byte r__outsideargentpub = 9;
+const byte r__argentroad = 10;
+const byte r__wisewomans = 11;
+const byte r__spludwicks = 12;
+const byte r__insideabbey = 13;
+const byte r__outsideabbey = 14; /*{ assumed }*/
+const byte r__avvysgarden = 15;
+const byte r__aylesoffice = 16;
+const byte r__argentpub = 19;
+const byte r__brummieroad = 20;
+const byte r__lusties = 21; /*{ ? not sure }*/
+const byte r__entrancehall = 22;
+const byte r__lustiesroom = 23;
+const byte r__westhall = 25;
+const byte r__easthall = 26;
+const byte r__oubliette = 27;
+const byte r__geidas = 28;
+const byte r__catacombs = 29;
+
+//{ -------------- }
+
+const byte r__bridge = 40;
+const byte r__robins = 42;
+const byte r__outsidenottspub = 46;
+const byte r__nottspub = 47;
+
+//{ -------------- }
+
+const byte r__outsideducks = 50;
+const byte r__ducks = 51;
+
+//{ -------------- }
+
+const byte r__outsidecardiffcastle = 70;
+const byte r__insidecardiffcastle = 71;
+
+//{ -------------- }
+
+/*{ place80 appears to be bogus }*/
+
+//{ -------------- }
+
+const byte r__bosskey = 98; /*{ assumed }*/
+const byte r__map = 99;
 
 } // End of namespace Avalanche
 


Commit: aeff42074ade0ab29e8130a6b92ffe73f94070b7
    https://github.com/scummvm/scummvm/commit/aeff42074ade0ab29e8130a6b92ffe73f94070b7
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-21T05:08:10-07:00

Commit Message:
AVALANCHE: Reorganise source files.

Changed paths:
  R engines/avalanche/1stoff.cpp
  R engines/avalanche/access.cpp
  R engines/avalanche/access.h
  R engines/avalanche/acci.cpp
  R engines/avalanche/acci.h
  R engines/avalanche/also.cpp
  R engines/avalanche/andexor.cpp
  R engines/avalanche/andexor2.cpp
  R engines/avalanche/andextst.cpp
  R engines/avalanche/arch.cpp
  R engines/avalanche/arch.h
  R engines/avalanche/avalot9.cpp
  R engines/avalanche/avbkgrnd.cpp
  R engines/avalanche/avmenu.cpp
  R engines/avalanche/avvyans.cpp
  R engines/avalanche/avvyans2.cpp
  R engines/avalanche/avvymonk.cpp
  R engines/avalanche/bakchunk.cpp
  R engines/avalanche/basher.cpp
  R engines/avalanche/basher.h
  R engines/avalanche/bootstrp.cpp
  R engines/avalanche/cadburys.cpp
  R engines/avalanche/cadburys.h
  R engines/avalanche/celer.cpp
  R engines/avalanche/celer.h
  R engines/avalanche/ch_egats.cpp
  R engines/avalanche/charmap.cpp
  R engines/avalanche/chunker.cpp
  R engines/avalanche/chunkxf1.cpp
  R engines/avalanche/chunkxf2.cpp
  R engines/avalanche/chunkxf3.cpp
  R engines/avalanche/chunkxf4.cpp
  R engines/avalanche/chunkxf5.cpp
  R engines/avalanche/chunkxf6.cpp
  R engines/avalanche/chunkxf7.cpp
  R engines/avalanche/chunkxf8.cpp
  R engines/avalanche/chunkxf9.cpp
  R engines/avalanche/chunkxfa.cpp
  R engines/avalanche/chunkxfb.cpp
  R engines/avalanche/chunkxfc.cpp
  R engines/avalanche/chunkxfd.cpp
  R engines/avalanche/chunkxfe.cpp
  R engines/avalanche/chunkxff.cpp
  R engines/avalanche/chunkxfg.cpp
  R engines/avalanche/chunkxfh.cpp
  R engines/avalanche/chunkxfi.cpp
  R engines/avalanche/chunkxfj.cpp
  R engines/avalanche/chunkxfk.cpp
  R engines/avalanche/chunkxfl.cpp
  R engines/avalanche/clock.cpp
  R engines/avalanche/closing.cpp
  R engines/avalanche/closing.h
  R engines/avalanche/convert.cpp
  R engines/avalanche/convmous.cpp
  R engines/avalanche/credits.cpp
  R engines/avalanche/displtxt.cpp
  R engines/avalanche/dropdown.cpp
  R engines/avalanche/dropdown.h
  R engines/avalanche/dwidth.cpp
  R engines/avalanche/edhead.cpp
  R engines/avalanche/edna.cpp
  R engines/avalanche/enhanced.cpp
  R engines/avalanche/enhanced.h
  R engines/avalanche/enid.cpp
  R engines/avalanche/enid.h
  R engines/avalanche/filer.cpp
  R engines/avalanche/fileunit.cpp
  R engines/avalanche/fileunit.h
  R engines/avalanche/filing.cpp
  R engines/avalanche/folktemp.cpp
  R engines/avalanche/fontslid.cpp
  R engines/avalanche/frere.cpp
  R engines/avalanche/g-room.cpp
  R engines/avalanche/golden.cpp
  R engines/avalanche/gyro.cpp
  R engines/avalanche/gyro.h
  R engines/avalanche/help.cpp
  R engines/avalanche/help2.cpp
  R engines/avalanche/helpbak.cpp
  R engines/avalanche/helpbak.h
  R engines/avalanche/helper.cpp
  R engines/avalanche/helper.h
  R engines/avalanche/hibits.cpp
  R engines/avalanche/highs.cpp
  R engines/avalanche/highs.h
  R engines/avalanche/hiz.cpp
  R engines/avalanche/incline.cpp
  R engines/avalanche/incline.h
  R engines/avalanche/initxf.cpp
  R engines/avalanche/inputtes.cpp
  R engines/avalanche/intro.cpp
  R engines/avalanche/ints.cpp
  R engines/avalanche/joysetup.cpp
  R engines/avalanche/joystick.cpp
  R engines/avalanche/joystick.h
  R engines/avalanche/loading.cpp
  R engines/avalanche/logger.cpp
  R engines/avalanche/logger.h
  R engines/avalanche/lucerna.cpp
  R engines/avalanche/lucerna.h
  R engines/avalanche/magic2.cpp
  R engines/avalanche/magidraw.cpp
  R engines/avalanche/magishuf.cpp
  R engines/avalanche/make!.cpp
  R engines/avalanche/makeregi.cpp
  R engines/avalanche/makesez.cpp
  R engines/avalanche/makevmou.cpp
  R engines/avalanche/menuxf.cpp
  R engines/avalanche/minstran.cpp
  R engines/avalanche/newsprit.cpp
  R engines/avalanche/nim.cpp
  R engines/avalanche/nimdraw.cpp
  R engines/avalanche/nimunit.cpp
  R engines/avalanche/nimunit.h
  R engines/avalanche/oldfiler.cpp
  R engines/avalanche/oldhighs.cpp
  R engines/avalanche/oldincln.cpp
  R engines/avalanche/oldincln.h
  R engines/avalanche/oldtrip.cpp
  R engines/avalanche/oldtrip.h
  R engines/avalanche/omtest.cpp
  R engines/avalanche/oopmenu.cpp
  R engines/avalanche/oopmenu.h
  R engines/avalanche/overlap.cpp
  R engines/avalanche/overscro.cpp
  R engines/avalanche/particle.cpp
  R engines/avalanche/pictemp.cpp
  R engines/avalanche/pictemp2.cpp
  R engines/avalanche/pingo.cpp
  R engines/avalanche/pingo.h
  R engines/avalanche/plottest.cpp
  R engines/avalanche/preview1.cpp
  R engines/avalanche/qintro.cpp
  R engines/avalanche/qstars.cpp
  R engines/avalanche/rawupd.cpp
  R engines/avalanche/readsez.cpp
  R engines/avalanche/reginam.cpp
  R engines/avalanche/sackb1.cpp
  R engines/avalanche/sackb1.h
  R engines/avalanche/sackb3.cpp
  R engines/avalanche/sackblas.cpp
  R engines/avalanche/saving.cpp
  R engines/avalanche/scr_1.cpp
  R engines/avalanche/scr_2.cpp
  R engines/avalanche/scr_3.cpp
  R engines/avalanche/scr_4.cpp
  R engines/avalanche/scr_5.cpp
  R engines/avalanche/scr_9.cpp
  R engines/avalanche/scrolls.cpp
  R engines/avalanche/scrolls.h
  R engines/avalanche/sequence.cpp
  R engines/avalanche/sequence.h
  R engines/avalanche/setup.cpp
  R engines/avalanche/seu.cpp
  R engines/avalanche/seu_avvy.cpp
  R engines/avalanche/sez.cpp
  R engines/avalanche/sezedit.cpp
  R engines/avalanche/sezunit.cpp
  R engines/avalanche/sezunit.h
  R engines/avalanche/sezxfr.cpp
  R engines/avalanche/shell1.cpp
  R engines/avalanche/shell2.cpp
  R engines/avalanche/slope.cpp
  R engines/avalanche/spread.cpp
  R engines/avalanche/spread2.cpp
  R engines/avalanche/squish.cpp
  R engines/avalanche/ss_blank.cpp
  R engines/avalanche/ss_clock.cpp
  R engines/avalanche/stars.cpp
  R engines/avalanche/status.cpp
  R engines/avalanche/sticks.cpp
  R engines/avalanche/sticks.h
  R engines/avalanche/sunrise.cpp
  R engines/avalanche/tempo.cpp
  R engines/avalanche/test.cpp
  R engines/avalanche/test2.cpp
  R engines/avalanche/testblit.cpp
  R engines/avalanche/testcard.cpp
  R engines/avalanche/testenh.cpp
  R engines/avalanche/timeout.cpp
  R engines/avalanche/timeout.h
  R engines/avalanche/travel.cpp
  R engines/avalanche/trip.cpp
  R engines/avalanche/trip.h
  R engines/avalanche/trip3.cpp
  R engines/avalanche/trip3.h
  R engines/avalanche/trip42.cpp
  R engines/avalanche/trip42.h
  R engines/avalanche/trip5.cpp
  R engines/avalanche/trip5.h
  R engines/avalanche/trip5tst.cpp
  R engines/avalanche/trip5xf.cpp
  R engines/avalanche/tripoop.cpp
  R engines/avalanche/ttmenuxf.cpp
  R engines/avalanche/unsquish.cpp
  R engines/avalanche/viewdocs.cpp
  R engines/avalanche/visa.cpp
  R engines/avalanche/visa.h
  R engines/avalanche/visatest.cpp
  R engines/avalanche/waver.cpp
  R engines/avalanche/xf_gover.cpp
  R engines/avalanche/xf_help.cpp
  R engines/avalanche/xf_visa.cpp
  R engines/avalanche/xfbutton.cpp
  R engines/avalanche/xfghost.cpp
  R engines/avalanche/zapdraw.cpp



diff --git a/engines/avalanche/1stoff.cpp b/engines/avalanche/1stoff.cpp
deleted file mode 100644
index 31c87a8..0000000
--- a/engines/avalanche/1stoff.cpp
+++ /dev/null
@@ -1,83 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*#include "Crt.h"*/
-/*#include "Dos.h"*/
-
-namespace Avalanche {
-
-matrix<1, 7, 1, 3, byte> cols;
-byte fv;
-
-void adjust() {
-	registers r;
-	{
-		ax = 0x1012;
-		bx = 1;
-		cx = 2;
-		es = seg(cols);
-		dx = ofs(cols);
-
-	}
-
-	intr(0x10, r);
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	textattr = 0;
-	clrscr;
-
-	fillchar(cols, sizeof(cols), '\0');
-	adjust();
-
-	gotoxy(29, 10);
-	textattr = 1;
-	output << "Thorsoft of Letchworth";
-	gotoxy(36, 12);
-	textattr = 2;
-	output << "presents";
-
-	for (fv = 1; fv <= 77; fv ++) {
-		delay(77);
-		if (fv < 64)  fillchar(cols[1], 3, chr(fv));
-		if (fv > 14)  fillchar(cols[2], 3, chr(fv - 14));
-		adjust();
-	}
-
-	delay(100);
-
-	for (fv = 63; fv >= 1; fv --) {
-		fillchar(cols, sizeof(cols), chr(fv));
-		delay(37);
-		adjust();
-	}
-
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.cpp b/engines/avalanche/access.cpp
deleted file mode 100644
index ba87cd6..0000000
--- a/engines/avalanche/access.cpp
+++ /dev/null
@@ -1,193 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 ACCESS           The temporary Sez handler. */
-
-#define __access_implementation__
-
-
-#include "access.h"
-
-
-/*#include "Gyro.h"*/
-/*#include "Scrolls.h"*/
-/*#include "Acci.h"*/
-/*#include "Trip5.h"*/
-/*#include "Lucerna.h"*/
-
-namespace Avalanche {
-
-boolean int_say_went_ok;
-
-void int_say(string filename, boolean bubble)
-/* Internal use ONLY! */
-{
-	untyped_file f;
-	/*$I-*/
-	assign(f, filename);
-	reset(f, 1);
-	if (ioresult != 0) {
-		int_say_went_ok = false;
-		return;
-	}
-	bufsize = filesize(f);
-	blockread(f, buffer, bufsize);
-	if (bubble) {
-		bufsize += 1;
-		buffer[bufsize] = '\2';
-	}
-	close(f);
-	/*$I+*/
-
-	calldrivers;
-
-	int_say_went_ok = true;
-}
-
-void dixi(char p, byte n) {
-	exit(153);
-	int_say(string('s') + p + strf(n) + ".raw", false);
-}
-
-void talkto(byte whom) {
-	byte fv;
-	boolean no_matches;
-	exit(153);
-	if (person == pardon) {
-		person = chr(subjnumber);
-		subjnumber = 0;
-	}
-
-	switch (chr(whom)) {
-	case pspludwick:
-
-		if ((dna.lustie_is_asleep) & (~ dna.obj[potion])) {
-			dixi('q', 68);
-			dna.obj[potion] = true;
-			objectlist;
-			points(3);
-			return;
-		} else {
-			if (dna.talked_to_crapulus)
-				switch (dna.given2spludwick) { /* Spludwick - what does he need? */
-					/* 0 - let it through to use normal routine. */
-				case RANGE_2(1, 2): {
-					display(string("Can you get me ") +
-					        get_better(spludwick_order[dna.given2spludwick]) + ", please?" +
-					        "\232\2");
-					return;
-				}
-				break;
-				case 3: {
-					dixi('q', 30); /* need any help with the game? */
-					return;
-				}
-				break;
-				}
-			else dixi('q', 42); /* Haven't talked to Crapulus. Go and talk to him. */
-		}
-		break;
-
-	case pibythneth:
-		if (dna.givenbadgetoiby) {
-			dixi('q', 33); /* Thanks a lot! */
-			return; /* And leave the proc. */
-		}
-		break; /* Or... just continue, 'cos he hasn't got it. */
-	case pdogfood:
-		if (dna.wonnim) {
-			;     /* We've won the game. */
-			dixi('q', 6); /* "I'm Not Playing!" */
-			return; /* Zap back. */
-		}
-		break;
-	case payles:
-		if (~ dna.ayles_is_awake) {
-			dixi('q', 43); /* He's fast asleep! */
-			return;
-		}
-		break;
-	case pgeida:
-		if (dna.geida_given_potion)
-			dna.geida_follows = true;
-		else {
-			dixi('u', 17);
-			return;
-		}
-		break;
-	}
-
-	if (whom > 149)  whom -= 149;
-
-	no_matches = true;
-	for (fv = 1; fv <= numtr; fv ++)
-		if (tr[fv].a.accinum == whom) {
-			display(string('\23') + chr(fv + 48) + '\4');
-			no_matches = false;
-			flush();
-		}
-
-	if (no_matches)  display("\23\23\4");
-
-	if (subjnumber == 0) /* For the moment... later we'll parse "say". */
-		int_say(string("ss") + strf(whom) + ".raw", true);
-	else {
-		int_say(string("ss") + strf(whom) + '-' + strf(subjnumber) + ".raw", true);
-		if (! int_say_went_ok)      /* File not found! */
-			dixi('n', whom);
-	}
-
-	switch (chr(whom + 149)) {
-	case pcrapulus: {
-		;     /* Crapulus: get the badge - first time only */
-		dna.obj[badge] = true;
-		objectlist;
-		dixi('q', 1); /* Circular from Cardiff. */
-		dna.talked_to_crapulus = true;
-
-		whereis[pcrapulus] = 177; /* Crapulus walks off. */
-
-		tr[2].vanishifstill = true;
-		tr[2].walkto(4); /* Walks away. */
-
-		points(2);
-	}
-	break;
-
-	case payles:
-		dixi('q', 44);
-		break; /* Can you get me a pen? */
-
-	}
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/access.h b/engines/avalanche/access.h
deleted file mode 100644
index 2e4a081..0000000
--- a/engines/avalanche/access.h
+++ /dev/null
@@ -1,39 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __access_h__
-#define __access_h__
-
-namespace Avalanche {
-
-void dixi(char p, byte n);
-
-void talkto(byte whom);
-
-} // End of namespace Avalanche.
-
-#endif
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
deleted file mode 100644
index adaad69..0000000
--- a/engines/avalanche/acci.cpp
+++ /dev/null
@@ -1,1956 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*  $D-*/
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 ACCIDENCE II     The parser. */
-#define __acci_implementation__
-
-
-/*$V-*/
-
-#include "acci.h"
-
-/*#include "Gyro.h"*/
-/*#include "Lucerna.h"*/
-/*#include "Scrolls.h"*/
-/*#include "Pingo.h"*/
-/*#include "Trip5.h"*/
-/*#include "Visa.h"*/
-/*#include "Enid.h"*/
-/*#include "NimUnit.h"*/
-/*#include "Timeout.h"*/
-/*#include "Celer.h"*/
-/*#include "Highs.h"*/
-/*#include "Helper.h"*/
-/*#include "Sequence.h"*/
-
-namespace Avalanche {
-
-byte fv;
-
-string wordnum(string x);
-static char whatsit;
-static word fv;
-static boolean gotcha;
-
-static void checkword(string &x) { /* Checks word "fv". */
-	{
-		vocab &with = words[fv];
-
-		if ((with.w == x) || ((copy(with.w, 1, length(x)) == x) && ! gotcha))
-			whatsit = chr(with.n);
-		if (with.w == x)  gotcha = true;
-	}
-}
-
-string wordnum(string x)
-
-{
-	string wordnum_result;
-	if (x == "")  {
-		wordnum_result = "";
-		return wordnum_result;
-	}
-	whatsit = pardon;
-	gotcha = false;
-	for (fv = nowords; fv >= 1; fv --) checkword(x);
-	wordnum_result = whatsit;
-	return wordnum_result;
-}
-
-void replace(string old1, string new1) {
-	byte q;
-
-	q = pos(old1, thats);
-	while (q != 0) {
-		thats = copy(thats, 1, q - 1) + new1 + copy(thats, q + length(old1), 255);
-		q = pos(old1, thats);
-	}
-}
-
-/*procedure ninetydump;
-var f:file; y:integer; bit:byte; a:byte absolute $A000:800;
-begin
- off;
- assign(f,'avvydump.avd');
- rewrite(f,1);
- blockwrite(f,dna,177); { just anything }
- for bit:=0 to 3 do
- begin
-  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
-  blockwrite(f,a,12080);
- end;
- close(f); on;
- display('Dumped.');
-end;*/
-
-string rank() {
-	byte fv;
-
-	string rank_result;
-	for (fv = 1; fv <= 8; fv ++)
-		if ((dna.score >= ranks[fv].score)
-		        && (dna.score < ranks[fv + 1].score)) {
-			rank_result = ranks[fv].title;
-			return rank_result;
-		}
-	return rank_result;
-}
-
-string totaltime() {
-	const real ticks_in_1_sec = (real)(65535) / 3600;
-	word h, m, s;
-	varying_string<70> a;
-
-	/* There are 65535 clock ticks in a second,
-	  1092.25 in a minute, and
-	  65535 in an hour. */
-	string totaltime_result;
-	h = trunc(dna.total_time / ticks_in_1_sec); /* No. of seconds. */
-	m = h % 3600;
-	h = h / 3600;
-	s = m % 60;
-	m = m / 60;
-
-	a = "You've been playing for ";
-
-	if (h > 0)  a = a + strf(h) + " hours, ";
-	if ((m > 0) || (h != 0))  a = a + strf(m) + " minutes and ";
-	a = a + strf(s) + " seconds.";
-
-	totaltime_result = a;
-	return totaltime_result;
-}
-
-void cheatparse(string codes);
-static word num;
-static integer e;
-
-static void number(string &codes) {
-	val(codes, num, e);
-}
-
-void cheatparse(string codes) {
-	char cmd;
-	integer se, sx, sy;
-
-	if (~ cheat) {
-		/* put them off the scent! */
-		display("Have you gone dotty\??!");
-		return;
-	}
-	cmd = upcase(codes[2]);
-	Delete(codes, 1, 2); /* strip header */
-	display("\6Ninety: \22\4");
-	switch (cmd) {
-	case 'R': {
-		number(codes);
-		if (e != 0)  return;
-		display(string("room swap to ") + codes + '.');
-		fliproom(num, 1);
-	}
-	break;
-	case 'Z': {
-		zonk;
-		display("Zonk OK!");
-	}
-	break;
-	case 'W': {
-		wobble;
-		display("Ow my head!");
-	}
-	break;
-	case 'A': {
-		tr[1].done;
-		tr[1].init(1, true);
-		dna.user_moves_avvy = true;
-		alive = true;
-		display("Reincat.");
-	}
-	break;
-	case 'B': {
-		sx = tr[1].x;
-		sy = tr[1].y;
-		se = tr[1].face;
-		delavvy;
-		number(codes);
-		{
-			void &with = tr[1];
-
-			done;
-			init(num, true);
-			display(string("Become ") + codes + ':' + "\r\r" + a.name + '\15' + a.comment);
-			appear(sx, sy, se);
-		}
-	}
-	break;
-	/*  'D': ninetydump;*/
-	case 'G':
-		play_nim;
-		break;
-	case '±':
-		display("\232\25");
-		break;
-	default:
-		display("unknown code!");
-	}
-}
-
-void punctustrip(string &x) {        /* Strips punctuation from x. */
-	const varying_string<32> punct = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
-	byte fv, p;
-
-	for (fv = 1; fv <= 32; fv ++)
-		do {
-			p = pos(punct[fv - 1], x);
-			if (p == 0)  flush(); /* <<< The first time I've ever used it! */
-			Delete(x, p, 1);
-		} while (!false);
-}
-
-boolean do_pronouns();
-static boolean ambiguous;
-
-static void displaywhat(char ch, boolean animate) { /* << it's an adjective! */
-	byte ff;
-	string z;
-
-	if (ch == pardon) {
-		ambiguous = true;
-		if (animate)  display("Whom?");
-		else display("What?");
-	} else {
-		if (animate)  display(string("{ ") + getname(ch) + " }");
-		else {
-			z = get_better(ch);
-			if (z != "")  display(string("{ ") + z + " }");
-		}
-	}
-}
-
-boolean do_pronouns() {
-	byte fv;
-
-	boolean do_pronouns_result;
-	ambiguous = false;
-	for (fv = 1; fv <= length(thats); fv ++)
-		switch (thats[fv]) {
-		case '\310': {
-			displaywhat(him, true);
-			thats[fv] = him;
-		}
-		break;
-		case '\311': {
-			displaywhat(her, true);
-			thats[fv] = her;
-		}
-		break;
-		case '\312': {
-			displaywhat(it, false);
-			thats[fv] = it;
-		}
-		break;
-		}
-	do_pronouns_result = ambiguous;
-	return do_pronouns_result;
-}
-
-void store_interrogation(byte interrogation);
-
-
-static void lowercase() {
-	byte fv;
-
-	for (fv = 1; fv <= length(current); fv ++)
-		if (set::of(range('A', 'Z'), eos).has(current[fv]))
-			current[fv] += 32;
-}
-
-
-
-static void propernouns() {
-	byte fv;
-
-	lowercase();
-	for (fv = 2; fv <= length(current) - 1; fv ++)
-		if (current[fv] == ' ')
-			current[fv + 1] = upcase(current[fv + 1]);
-	current[1] = upcase(current[1]);
-}
-
-
-
-static void sayit() { /* This makes Avalot say the response. */
-	string x;
-
-	x = current;
-	x[1] = upcase(x[1]);
-	display(string("\231") + x + '.' + '\2' + '\23' + '2');
-}
-
-void store_interrogation(byte interrogation) {
-	byte fv;
-
-
-	if (current == "")  return;
-
-	/* Strip current: */
-	while ((current[1] == ' ') && (current != ""))  Delete(current, 1, 1);
-	while ((current[length(current)] == ' ') && (current != ""))  current[0] -= 1;
-
-	lose_timer(reason_cardiffsurvey); /* if you want to use any other timer,
-  put this into the case statement. */
-	switch (interrogation) {
-	case 1: {
-		lowercase();
-		sayit();
-		like2drink = current;
-		dna.cardiff_things = 2;
-	}
-	break;
-	case 2: {
-		propernouns();
-		sayit();
-		favourite_song = current;
-		dna.cardiff_things = 3;
-	}
-	break;
-	case 3: {
-		propernouns();
-		sayit();
-		worst_place_on_earth = current;
-		dna.cardiff_things = 4;
-	}
-	break;
-	case 4: {
-		lowercase();
-		sayit();
-		fillchar(spare_evening, sizeof(spare_evening), '\261');
-		spare_evening = current;
-		dixi('z', 5); /* His closing statement... */
-		tr[2].walkto(4); /* The end of the drawbridge */
-		tr[2].vanishifstill = true; /* Then go away! */
-		magics[2].op = nix;
-		dna.cardiff_things = 5;
-	}
-	break;
-
-	case 99:
-		store_high(current);
-		break;
-	}
-	if (interrogation < 4)  cardiff_survey;
-}
-
-void clearwords() {
-	fillchar(realwords, sizeof(realwords), '\0');
-}
-
-void parse() {
-	byte n, fv, ff;
-	string c, cc, thisword;
-	varying_string<1> answer;
-	boolean notfound;
-
-	/* first parsing - word identification */
-
-	thats = "";
-	c = current + '\40';
-	n = 1;
-	polite = false;
-	verb = pardon;
-	thing = pardon;
-	thing2 = pardon;
-	person = pardon;
-	clearwords();
-	if (current[1] == '.') {
-		/* a cheat mode attempt */
-		cheatparse(current);
-		thats = nowt;
-		return;
-	}    /* not our department! Otherwise... */
-
-	/* Are we being interrogated right now? */
-
-	if (interrogation > 0) {
-		store_interrogation(interrogation);
-		weirdword = true;
-		return;
-	}
-
-	cc = c;
-	for (fv = 1; fv <= length(c); fv ++) c[fv] = upcase(c[fv]);
-	while (c != "") {
-		while ((c[1] == '\40') && (c != "")) {
-			Delete(c, 1, 1);
-			Delete(cc, 1, 1);
-		}
-		thisword = copy(c, 1, pos("\40", c) - 1);
-		realwords[n] = copy(cc, 1, pos("\40", cc) - 1);
-		punctustrip(c);
-
-		notfound = true;
-
-		if (thisword != "") {
-			for (ff = 1; ff <= 30; ff ++) {
-				/* Check Also, FIRST! */
-				if (pos(string(',') + thisword, also[ff][0]) > 0) {
-					thats = thats + chr(99 + ff);
-					notfound = false;
-				}
-			}
-		}
-
-		if (notfound) {
-			answer = wordnum(thisword);
-			if (answer == pardon) {
-				notfound = true;
-				thats = thats + pardon;
-			} else
-				thats = thats + wordnum(thisword);
-			n += 1;
-		}
-		Delete(c, 1, pos("\40", c));
-		Delete(cc, 1, pos("\40", cc));
-	}
-
-	if (pos("\376", thats) > 0)  unknown = realwords[pos("\376", thats)];
-	else unknown = "";
-	replace("\377", ""); /* zap noise words */
-	replace(string('\15') + '\342', "\1"); /* "look at" = "examine" */
-	replace(string('\15') + '\344', "\1"); /* "look in" = "examine" */
-	replace(string('\4') + '\343', "\21"); /* "get up" = "stand" */
-	replace(string('\4') + '\347', "\21"); /* "get down" = "stand"... well, why not? */
-	replace(string('\22') + '\344', "\2"); /* "go in" = "open [door]" */
-	replace(string('\34') + '\345', "\375"); /* "P' off" is a swear word */
-	replace(string('\4') + '\6', "\6"); /* "Take inventory" (remember Colossal Adventure?) */
-	replace(string('\50') + '\350', "\25"); /* "put on" = "don" */
-	replace(string('\4') + '\345', "\24"); /* "take off" = "doff" */
-
-	/* Words that could mean more than one person */
-	{
-		if (room == r__nottspub)  replace("\314", "\244"); /* Barman = Port */
-		else replace("\314", "\232");                  /* Barman = Malagauche */
-		switch (room) {
-		case r__aylesoffice:
-			replace("\313", "\243");
-			break;        /* Monk = Ayles */
-		case r__musicroom:
-			replace("\313", "\246");
-			break;          /* Monk = Jacques */
-		default:
-			replace("\313", "\242");                  /* Monk = Ibythneth */
-		}
-	}
-
-	if (do_pronouns()) {
-		weirdword = true;
-		thats = nowt;
-		return;
-	}
-
-	/* second parsing - accidence */
-
-	subject = "";
-	subjnumber = 0; /* Find subject of conversation. */
-	for (fv = 1; fv <= 11; fv ++)
-		if (set::of('`', '\'', eos).has(realwords[fv][1])) {
-			subjnumber = ord(thats[fv]);
-			thats[fv] = moved;
-			flush(); /* Only the second time I've used that! */
-		}
-	if (subjnumber == 0) /* Still not found. */
-		for (fv = 1; fv <= 10; fv ++)
-			if (thats[fv] == '\374') { /* the word is "about", or something similar */
-				subjnumber = ord(thats[fv + 1]);
-				thats[fv + 1] = '\0';
-				flush(); /* ...Third! */
-			}
-	if (subjnumber == 0) /* STILL not found! Must be the word after "say". */
-		for (fv = 1; fv <= 10; fv ++)
-			if ((thats[fv] == '\7') && !(set::of('\0', range('\341', '\345'), eos).has(thats[fv + 1]))) {
-				/* SAY not followed by a preposition */
-				subjnumber = ord(thats[fv + 1]);
-				thats[fv + 1] = '\0';
-				flush(); /* ...Fourth! */
-			}
-
-	for (fv = length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
-		switch (thats[fv]) {
-		case '\1' ... '\61':
-		case '\375':
-		case '\371':
-			verb = thats[fv];
-			break;
-		case '\62' ... '\225': {
-			thing2 = thing;
-			thing = thats[fv];
-		}
-		break;
-		case '\226' ... '\307':
-			person = thats[fv];
-			break;
-		case '\373':
-			polite = true;
-			break;
-		}
-
-	if ((unknown != "") && !
-	        (set::of(vb_exam, vb_talk, vb_save, vb_load, vb_dir, eos).has(verb))) {
-		display(string("Sorry, but I have no idea what `") + unknown +
-		        "\" means. Can you rephrase it?");
-		weirdword = true;
-	} else weirdword = false;
-	if (thats == "")  thats = nowt;
-
-	if (thing != pardon)  it = thing;
-	if (person != pardon) {
-		if (person < '\257')  him = person;
-		else her = person;
-	}
-}
-
-void examobj() {   /* Examine a standard object-thing */
-	if (thing != thinks)  thinkabout(thing, a_thing);
-	switch (thing) {
-	case wine :
-		switch (winestate) {
-			/* 4 is perfect wine. 0 is not holding the wine. */
-		case 1:
-			dixi('t', 1);
-			break; /* Normal examine wine scroll */
-		case 2:
-			dixi('d', 6);
-			break; /* Bad wine */
-		case 3:
-			dixi('d', 7);
-			break; /* Vinegar */
-		}
-		break;
-	case onion:
-		if (rotten_onion)
-			dixi('q', 21); /* Yucky onion. */
-		else
-			dixi('t', 18);
-		break;        /* Normal onion scroll */
-	default:
-		dixi('t', ord(thing)); /* <<< Ordinarily */
-	}
-}
-
-boolean personshere() {       /* Person equivalent of "holding" */
-	boolean personshere_result;
-	if ((person == pardon) || (person == '\0')
-	        || (whereis[person] == dna.room))  personshere_result = true;
-	else {
-		if (person < '\257')  display("H\4");
-		else display("Sh\4");
-		display("e isn't around at the moment.");
-		personshere_result = false;
-	}
-	return personshere_result;
-}
-
-void exampers() {
-	if (personshere()) {
-		if (thing != thinks)  thinkabout(person, a_person);
-		person -= 149;
-		switch (person) { /* Special cases */
-		case '\13':
-			if (wonnim) {
-				dixi('Q', 8); /* "I'm Not Playing!" */
-				return;
-			}
-			break;
-		case '\11':
-			if (lustie_is_asleep) {
-				dixi('Q', 65);     /* He's asleep. (65! Wow!) */ return;
-			}
-			break;
-		}
-		/* Otherwise... */ dixi('p', ord(person));
-	}    /* And afterwards... */
-	switch (person) {
-	case '\16':
-		if (~ dna.ayles_is_awake)  dixi('Q', 13);
-		break; /* u.f.s.? */
-	}
-}
-
-boolean holding() {
-	boolean holding_result;
-	if (set::of(range('\63', '\143'), eos).has(thing))  {
-		holding_result = true;    /* Also */
-		return holding_result;
-	}
-	holding_result = false;
-	if (thing > '\144')  display("Be reasonable!");
-	else if (~ dna.obj[thing])     /* verbs that need "thing" to be in the inventory */
-		display("You're not holding it, Avvy.");
-	else
-		holding_result = true;
-	return holding_result;
-}
-
-void examine();
-
-static void special(boolean before) {
-	switch (dna.room) {
-	case r__yours:
-		switch (thing) {
-		case '\66':
-			if (before)  show_one(5);
-			else show_one(6);
-			break;
-		}
-		break;
-	}
-}
-
-void examine() {
-	/* Examine. EITHER it's an object OR it's an Also OR it's a person OR
-	   it's something else. */
-	if ((person == pardon) && (thing != pardon)) {
-		if (holding())
-			switch (thing) { /* remember it's been Slipped- ie subtract 49 */
-			case '\1' ... '\61' :
-				examobj();
-				break; /* Standard object */
-			case '\62' ... '\144' : {
-				special(true);
-				display(also[ord(thing) - 50][1]); /* Also thing */
-				special(false);
-			}
-			break;
-			}
-	} else if (person != pardon)  exampers();
-	else display("It's just as it looks on the picture.");  /* don't know- guess */
-}
-
-void inv() {   /* the time-honoured command... */
-	char fv;
-	byte q;
-
-	q = 0;
-	display(string("You're carrying ") + '\4');
-	{
-		for (fv = '\1'; fv <= numobjs; fv ++)
-			if (obj[fv]) {
-				q += 1;
-				if (q == carrying)  display(string("and ") + '\4');
-				display(get_better(fv) + '\4');
-				if (fv == wearing)  display(string(", which you're wearing") + '\4');
-				if (q < carrying)  display(string(", ") + '\4');
-			}
-		if (wearing == nowt)  display("...\r\r...and you're stark naked!");
-		else
-			display('.');
-	}
-}
-
-void swallow() {   /* Eat something. */
-	switch (thing) {
-	case wine:
-		switch (dna.winestate) {
-			/* 4 is perfect */
-		case 1: {
-			if (dna.teetotal)  {
-				dixi('D', 6);
-				return;
-			}
-			dixi('U', 1);
-			wobble;
-			dixi('U', 2);
-			dna.obj[wine] = false;
-			objectlist;
-			have_a_drink();
-		}
-		break;
-		case 2:
-		case 3:
-			dixi('d', 8);
-			break; /* You can't drink it! */
-		}
-		break;
-	case potion: {
-		background(4);
-		dixi('U', 3);
-		gameover;
-		background(0);
-	}
-	break;
-	case ink:
-		dixi('U', 4);
-		break;
-	case chastity:
-		dixi('U', 5);
-		break;
-	case mushroom: {
-		dixi('U', 6);
-		gameover;
-	}
-	break;
-	case onion:
-		if (dna.rotten_onion)  dixi('U', 11);
-		else {
-			dixi('U', 8);
-			dna.obj[onion] = false;
-			objectlist;
-		}
-		break;
-	default:
-		if (set::of(r__argentpub, r__nottspub, eos).has(dna.room))
-			display("Try BUYing things before you drink them!");
-		else
-			display("The taste of it makes you retch!");
-		/* Constant- leave this one */
-	}
-}
-
-void others()
-/* This lists the other people in the room. */
-{
-	char fv;
-	byte num_people, this_person, here;
-
-
-	num_people = 0;
-	this_person = 0;
-	here = dna.room;
-
-	for (fv = '\227'; fv <= '\262'; fv ++) /* Start at 151 so we don't list Avvy himself! */
-		if (whereis[fv] == here)
-			num_people += 1;
-
-	/* If nobody's here, we can cut out straight away. */
-
-	if (num_people == 0)  return; /* Leave the procedure. */
-
-	for (fv = '\227'; fv <= '\262'; fv ++)
-		if (whereis[fv] == here) {
-			this_person += 1;
-			if (this_person == 1) /* First on the list. */
-				display(getname(fv) + '\4');
-			else if (this_person < num_people) /* The middle... */
-				display(string(", ") + getname(fv) + '\4');
-			else
-				display(string(" and ") + getname(fv) + '\4'); /* The end. */
-		}
-
-	if (num_people == 1)  display(" is\4");
-	else display(" are\4");
-
-	display(" here."); /* End and display it. */
-}
-
-void lookaround()
-/* This is called when you say "look." */
-{
-	display(also[0][1]);
-	switch (dna.room) {
-	case r__spludwicks:
-		if (dna.avaricius_talk > 0)  dixi('q', 23);
-		else others();
-		break;
-	case r__robins: {
-		if (dna.tied_up)  dixi('q', 38);
-		if (dna.mushroom_growing)  dixi('q', 55);
-	}
-	break;
-	case r__insidecardiffcastle:
-		if (~ dna.taken_pen)  dixi('q', 49);
-		break;
-	case r__lustiesroom:
-		if (dna.lustie_is_asleep)  dixi('q', 65);
-		break;
-	case r__catacombs:
-		switch (dna.cat_y * 256 + dna.cat_x) {
-		case 258 :
-			dixi('q', 80);
-			break; /* Inside art gallery */
-		case 514 :
-			dixi('q', 81);
-			break; /* Outside ditto */
-		case 260 :
-			dixi('q', 82);
-			break; /* Outside Geida's room. */
-		}
-		break;
-	default:
-		others();
-	}
-}
-
-void opendoor() {   /* so whaddya THINK this does?! */
-	byte fv;
-
-	switch (dna.room) {   /* Special cases. */
-	case r__yours:
-		if (infield(2)) {
-			/* Opening the box. */
-			thing = '\66'; /* The box. */ person = pardon;
-			examine();
-			return;
-		}
-		break;
-	case r__spludwicks:
-		if (thing == '\75')  {
-			dixi('q', 85);
-			return;
-		}
-		break;
-	}
-
-
-	if ((~ dna.user_moves_avvy) & (dna.room != r__lusties))
-		return; /* No doors can open if you can't move Avvy. */
-	for (fv = 9; fv <= 15; fv ++)
-		if (infield(fv)) {
-			{
-				void &with = portals[fv];
-				switch (op) {
-				case exclaim: {
-					tr[1].bounce;
-					dixi('x', data);
-				}
-				break;
-				case transport:
-					fliproom(hi(data), lo(data));
-					break;
-				case unfinished: {
-					tr[1].bounce;
-					display("\7Sorry.\3\rThis place is not available yet!");
-				}
-				break;
-				case special:
-					call_special(data);
-					break;
-				case mopendoor:
-					open_the_door(hi(data), lo(data), fv);
-					break;
-				}
-			}
-			return;
-		}
-	if (dna.room == r__map)
-		display(string("Avvy, you can complete the whole game without ever going ") +
-		        "to anywhere other than Argent, Birmingham, Cardiff, " +
-		        "Nottingham and Norwich.");
-	else display("Door? What door?");
-}
-
-void putproc();
-
-
-static void silly() {
-	display("Don't be silly!");
-}
-
-void putproc() {   /* Called when you call vb_put. */
-	char temp;
-
-
-	if (! holding())  return;
-	thing2 -= 49;   /* Slip the second object */
-	temp = thing;
-	thing = thing2;
-	if (! holding())  return;
-	thing = temp;
-
-	/* Thing is the thing which you're putting in. Thing2 is where you're
-	  putting it. */
-	/* Convenience thing. */
-	switch (thing2) {
-	case wine:
-		if (thing == onion) {
-			if (dna.rotten_onion)
-				display(string("That's a bit like shutting the stable door after the ") +
-				        "horse has bolted!");
-			else {     /* Put onion into wine? */
-				if (dna.winestate != 3)
-					display("\6Oignon au vin\22 is a bit too strong for your tastes!");
-				else {     /* Put onion into vinegar! Yes! */
-					onion_in_vinegar = true;
-					points(7);
-					dixi('u', 9);
-				}
-			}
-		} else silly();
-		break;
-
-	case '\66':
-		if (room == 1) { /* Put something into the box. */
-			if (box_contents != nowt)
-				display(string("There's something in the box already, Avvy. Try taking") +
-				        " that out first.");
-			else
-				switch (thing) {
-				case money:
-					display("You'd better keep some ready cash on you!");
-					break;
-				case bell:
-					display("That's a silly place to keep a bell.");
-					break;
-				case bodkin:
-					display("But you might need it!");
-					break;
-				case onion:
-					display("Just give it to Spludwick, Avvy!");
-					break;
-				default: {
-					/* Put the object into the box... */
-					if (wearing == thing)
-						display(string("You'd better take ") + get_better(thing) + " off first!");
-					else {
-						show_one(5); /* Open box. */
-						box_contents = thing;
-						dna.obj[thing] = false;
-						objectlist;
-						display("OK, it's in the box.");
-						show_one(6); /* Shut box. */
-					}
-				}
-				}
-		} else silly();
-		break;
-
-	default:
-		silly();
-	}
-}
-
-boolean give2spludwick();
-
-/* The result of this fn is whether or not he says "Hey, thanks!" */
-static void not_in_order() {
-	display(string("Sorry, I need the ingredients in the right order for this potion.") +
-	        " What I need next is " +
-	        get_better(spludwick_order[dna.given2spludwick]) + ".\232\2");
-}
-
-
-
-static void go_to_cauldron() {
-	tr[2].call_eachstep = false; /* Stops Geida_Procs. */
-	set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
-	tr[2].walkto(2);
-}
-
-boolean give2spludwick()
-
-{
-	boolean give2spludwick_result;
-	{
-
-		give2spludwick_result = false;
-
-		if (spludwick_order[given2spludwick] != thing) {
-			not_in_order();
-			return give2spludwick_result;
-		}
-
-		switch (thing) {
-		case onion: {
-			obj[onion] = false;
-			if (rotten_onion)
-				dixi('q', 22);
-			else {
-				given2spludwick += 1;
-				dixi('q', 20);
-				go_to_cauldron();
-				points(3);
-			}
-			objectlist;
-		}
-		break;
-		case ink: {
-			obj[ink] = false;
-			objectlist;
-			given2spludwick += 1;
-			dixi('q', 24);
-			go_to_cauldron();
-			points(3);
-		}
-		break;
-		case mushroom: {
-			obj[mushroom] = false;
-			dixi('q', 25);
-			points(5);
-			given2spludwick += 1;
-			go_to_cauldron();
-			obj[potion] = true;
-			objectlist;
-		}
-		break;
-		default:
-			give2spludwick_result = true;
-		}
-	}
-	return give2spludwick_result;
-}
-
-void have_a_drink() {
-	{
-		alcohol += 1;
-		if (alcohol == 5) {
-			obj[key] = true; /* Get the key. */
-			teetotal = true;
-			avvy_is_awake = false;
-			avvy_in_bed = true;
-			objectlist;
-			dusk;
-			hang_around_for_a_while;
-			fliproom(1, 1);
-			background(14);
-			new_game_for_trippancy; /* Not really */
-		}
-	}
-}
-
-void cardiff_climbing() {
-	if (dna.standing_on_dais) {
-		/* Clamber up. */
-		display("You climb down, back onto the floor.");
-		dna.standing_on_dais = false;
-		apped(1, 3);
-	} else {
-		/* Clamber down. */
-		if (infield(1)) {
-			display("You clamber up onto the dais.");
-			dna.standing_on_dais = true;
-			apped(1, 2);
-		} else
-			display("Get a bit closer, Avvy.");
-	}
-}
-
-void stand_up();
-
-/* Called when you ask Avvy to stand. */
-static void already() {
-	display("You're already standing!");
-}
-
-void stand_up() {
-	switch (dna.room) {
-	case r__yours: /* Avvy isn't asleep. */
-		if (avvy_in_bed) {  /* But he's in bed. */
-			if (teetotal) {
-				dixi('d', 12);
-				background(0);
-				dixi('d', 14);
-			}
-			tr[1].visible = true;
-			user_moves_avvy = true;
-			apped(1, 2);
-			dna.rw = left;
-			show_one(4); /* Picture of empty pillow. */
-			points(1);
-			avvy_in_bed = false;
-			lose_timer(reason_arkata_shouts);
-		} else already();
-		break;
-
-	case r__insidecardiffcastle:
-		cardiff_climbing();
-		break;
-
-	case r__nottspub:
-		if (sitting_in_pub)  {
-			show_one(4); /* Not sitting down. */
-			tr[1].visible = true; /* But standing up. */
-			apped(1, 4); /* And walking away. */
-			sitting_in_pub = false; /* Really not sitting down. */
-			user_moves_avvy = true; /* And ambulant. */
-		} else already();
-		break;
-	default:
-		already();
-	}
-}
-
-void getproc(char thing) {
-	switch (room) {
-	case r__yours:
-		if (infield(2)) {
-			if (box_contents == thing) {
-				show_one(5);
-				display("OK, I've got it.");
-				obj[thing] = true;
-				objectlist;
-				box_contents = nowt;
-				show_one(6);
-			} else
-				display(string("I can't see ") + get_better(thing) + " in the box.");
-		} else dixi('q', 57);
-		break;
-	case r__insidecardiffcastle:
-		switch (thing) {
-		case pen: {
-			if (infield(2)) {
-				/* Standing on the dais. */
-
-				if (dna.taken_pen)
-					display("It's not there, Avvy.");
-				else {
-					/* OK: we're taking the pen, and it's there. */
-					show_one(4); /* No pen there now. */
-					call_special(3); /* Zap! */
-					dna.taken_pen = true;
-					dna.obj[pen] = true;
-					objectlist;
-					display("Taken.");
-				}
-			} else if (dna.standing_on_dais)  dixi('q', 53);
-			else dixi('q', 51);
-		}
-		break;
-		case bolt:
-			dixi('q', 52);
-			break;
-		default:
-			dixi('q', 57);
-		}
-		break;
-	case r__robins:
-		if ((thing == mushroom) & (infield(1)) & (dna.mushroom_growing)) {
-			show_one(3);
-			display("Got it!");
-			dna.mushroom_growing = false;
-			dna.taken_mushroom = true;
-			dna.obj[mushroom] = true;
-			objectlist;
-			points(3);
-		} else dixi('q', 57);
-		break;
-	default:
-		dixi('q', 57);
-	}
-}
-
-void give_geida_the_lute() {
-	{
-		if (room != r__lustiesroom) {
-			display("Not yet. Try later!\232\2");
-			return;
-		}
-		dna.obj[lute] = false;
-		objectlist;
-		dixi('q', 64); /* She plays it. */
-
-		/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
-
-		set_up_timer(1, procgive_lute_to_geida, reason_geida_sings);
-		back_to_bootstrap(4);
-	}
-}
-
-void play_harp() {
-	if (infield(7))
-		musical_scroll;
-	else display("Get a bit closer to it, Avvy!");
-}
-
-void winsequence() {
-	dixi('q', 78);
-	first_show(7);
-	then_show(8);
-	then_show(9);
-	start_to_close;
-	set_up_timer(30, procwinning, reason_winning);
-}
-
-void person_speaks() {
-	boolean found;
-	byte fv;
-	char cfv;
-
-
-	if ((person == pardon) || (person == '\0')) {
-		if ((him == pardon) || (whereis[him] != dna.room))  person = her;
-		else person = him;
-	}
-
-	if (whereis[person] != dna.room) {
-		display("\231\4"); /* Avvy himself! */
-		return;
-	}
-
-	found = false; /* The person we're looking for's code is in Person. */
-
-	for (fv = 1; fv <= numtr; fv ++)
-		if (tr[fv].quick & (chr(tr[fv].a.accinum + 149) == person)) {
-			display(string('\23') + chr(fv + 48) + '\4');
-			found = true;
-		}
-
-	if (! found)
-		for (fv = 10; fv <= 25; fv ++) {
-			void &with = quasipeds[fv];
-			if ((who == person) && (room == dna.room)) {
-				display(string('\23') + chr(fv + 55) + '\4');
-			}
-		}
-}
-
-void do_that();
-
-static void heythanks() {
-	person_speaks();
-	display("Hey, thanks!\2(But now, you've lost it!)");
-	dna.obj[thing] = false;
-}
-
-void do_that() {
-	const array < '\63', '\72', varying_string<6> > booze = {{"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"}};
-	byte fv, ff;
-	integer sx, sy;
-	boolean ok;
-
-
-	if (thats == nowt)  {
-		thats = "";
-		return;
-	}
-	if (weirdword)  return;
-	if (thing < '\310')  thing -= 49; /* "Slip" */
-
-	if ((~ alive) &
-	        !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-	                  vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
-	                  vb_highscores, vb_smartalec, eos).has(verb))) {
-		display(string("You're dead, so don't talk. What are you, a ghost ") +
-		        "or something? Try restarting, or restoring a saved game!");
-		return;
-	}
-
-	if ((~ dna.avvy_is_awake) &
-	        !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-	                  vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
-	                  vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
-		display("Talking in your sleep? Try waking up!");
-		return;
-	}
-
-
-	switch (verb) {
-	case vb_exam:
-		examine();
-		break;
-	case vb_open:
-		opendoor();
-		break;
-	case vb_pause:
-		display(string("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
-		        "the mouse on the `O.K.\" box to continue.");
-		break;
-	case vb_get: {
-		if (thing != pardon) {
-			/* Legitimate try to pick something up. */
-			if (dna.carrying >= maxobjs)  display("You can't carry any more!");
-			else getproc(thing);
-
-		} else {
-			/* Not... ditto. */
-			if (person != pardon)
-				display("You can't sweep folk off their feet!");
-			else
-				display("I assure you, you don't need it.");
-		}
-	}
-	break;
-	case vb_drop:
-		display(string("Two years ago you dropped a florin in the street. Three days ") +
-		        "later it was gone! So now you never leave ANYTHING lying around. OK?");
-		break;
-		/*       begin dna.obj[thing]:=false; objectlist; end;*/
-	case vb_inv:
-		inv();
-		break;
-	case vb_talk:
-		if (person == pardon) {
-			if (subjnumber == 99) /* They typed "say password". */
-				display("Yes, but what \6is\22 the password?");
-			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
-				Delete(thats, 1, 1);
-				move(realwords[2], realwords[1], sizeof(realwords) - sizeof(realwords[1]));
-				verb = chr(subjnumber);
-				do_that();
-				return;
-			} else {
-				person = chr(subjnumber);
-				subjnumber = 0;
-				if (set::of(pardon, '\0', eos).has(person))  display("Talk to whom?");
-				else if (personshere())  talkto(ord(person));
-			}
-		} else if (person == pardon)  display("Talk to whom?");
-		else if (personshere())  talkto(ord(person));
-		break;
-
-	case vb_give:
-		if (holding()) {
-			if (person == pardon)  display("Give to whom?");
-			else if (personshere()) {
-				switch (thing) {
-				case money :
-					display("You can't bring yourself to give away your moneybag.");
-					break;
-				case bodkin:
-				case bell:
-				case clothes:
-				case habit :
-					display("Don't give it away, it might be useful!");
-					break;
-				default:
-					switch (person) {
-					case pcrapulus:
-						switch (thing) {
-						case wine: {
-							display("Crapulus grabs the wine and gulps it down.");
-							dna.obj[wine] = false;
-						}
-						break;
-						default:
-							heythanks();
-						}
-						break;
-					case pcwytalot:
-						if (set::of(crossbow, bolt, eos).has(thing))
-							display(string("You might be able to influence ") +
-							        "Cwytalot more if you used it!");
-						else heythanks();
-						break;
-					case pspludwick:
-						if (give2spludwick())  heythanks();
-						break;
-					case pibythneth:
-						if (thing == badge) {
-							dixi('q', 32); /* Thanks! Wow! */
-							points(3);
-							dna.obj[badge] = false;
-							dna.obj[habit] = true;
-							dna.givenbadgetoiby = true;
-							show_one(8);
-							show_one(9);
-						} else heythanks();
-						break;
-					case payles:
-						if (dna.ayles_is_awake) {
-							if (thing == pen) {
-								dna.obj[pen] = false;
-								dixi('q', 54);
-								dna.obj[ink] = true;
-								dna.given_pen_to_ayles = true;
-								objectlist;
-								points(2);
-							} else heythanks();
-						} else
-							display("But he's asleep!");
-						break;
-					case pgeida:
-						switch (thing) {
-						case potion : {
-							dna.obj[potion] = false;
-							dixi('u', 16); /* She drinks it. */
-							points(2);
-							dna.geida_given_potion = true;
-							objectlist;
-						}
-						break;
-						case lute:
-							give_geida_the_lute();
-							break;
-						default:
-							heythanks();
-						}
-						break;
-					case parkata:
-						switch (thing) {
-						case potion:
-							if (dna.geida_given_potion)
-								winsequence();
-							else dixi('q', 77);
-							break;             /* That Geida woman! */
-						default:
-							heythanks();
-						}
-						break;
-					default:
-						heythanks();
-					}
-				}
-			}
-			objectlist; /* Just in case... */
-		}
-		break;
-
-	case vb_eat:
-	case vb_drink:
-		if (holding())  swallow();
-		break;
-	case vb_load:
-		edna_load(realwords[2]);
-		break;
-	case vb_save:
-		if (alive)  edna_save(realwords[2]);
-		else display("It's a bit late now to save your game!");
-		break;
-	case vb_pay:
-		display("No money need change hands.");
-		break;
-	case vb_look:
-		lookaround();
-		break;
-	case vb_break:
-		display("Vandalism is prohibited within this game!");
-		break;
-	case vb_quit: { /* quit */
-		if (demo) {
-			dixi('q', 31);
-			close(demofile);
-			exit(0); /* Change this later!!! */
-		}
-		if (! polite)  display("How about a `please\", Avvy?");
-		else if (ask("\23C\26Do you really want to quit?"))  lmo = true;
-	}
-	break;
-	case vb_go:
-		display("Just use the arrow keys to walk there.");
-		break;
-	case vb_info: {
-		aboutscroll = true;
-		/*            display('Thorsoft of Letchworth presents:'+^c+^m+^m+
-		             'The medi‘val descendant of'+^m+
-		             'Denarius Avaricius Sextus'+^m+'in:'+
-		             ^m+^m+'LORD AVALOT D''ARGENT'+
-		             ^m+'version '+vernum+^m+^m+'Copyright ï '
-		             +copyright+', Mark, Mike and Thomas Thurman.');*/
-		display(string("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
-		        "The medi‘val descendant of" + '\15' +
-		        "Denarius Avaricius Sextus" +
-		        '\15' + '\15' + "version " + vernum + '\15' + '\15' + "Copyright ï "
-		        + copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
-		aboutscroll = false;
-	}
-	break;
-	case vb_undress:
-		if (dna.wearing == nowt)  display("You're already stark naked!");
-		else if (dna.avvys_in_the_cupboard) {
-			display(string("You take off ") + get_better(dna.wearing) + '.');
-			dna.wearing = nowt;
-			objectlist;
-		} else
-			display("Hadn't you better find somewhere more private, Avvy?");
-		break;
-	case vb_wear:
-		if (holding()) {
-			/* wear something */
-			switch (thing) {
-			case chastity:
-				display("Hey, what kind of a weirdo are you\??!");
-				break;
-			case clothes:
-			case habit: { /* Change this! */
-				if (dna.wearing != nowt) {
-					if (dna.wearing == thing)
-						display("You're already wearing that.");
-					else
-						display(string("You'll be rather warm wearing two ") +
-						        "sets of clothes!");
-					return;
-				} else
-					dna.wearing = thing;
-				objectlist;
-				if (thing == habit)  fv = 3;
-				else fv = 0;
-				{
-					void &with = tr[1];
-					if (whichsprite != fv) {
-						sx = tr[1].x;
-						sy = tr[1].y;
-						done;
-						init(fv, true);
-						appear(sx, sy, left);
-						tr[1].visible = false;
-					}
-				}
-			}
-			break;
-			default:
-				display(what);
-			}
-		}
-		break;
-	case vb_play:
-		if (thing == pardon)
-			switch (dna.room) { /* They just typed "play"... */
-			case r__argentpub:
-				play_nim;
-				break; /* ...in the pub, => play Nim. */
-			case r__musicroom:
-				play_harp();
-				break;
-			}
-		else if (holding()) {
-			switch (thing) {
-			case lute : {
-				dixi('U', 7);
-				if (whereis[pcwytalot] == dna.room)  dixi('U', 10);
-				if (whereis[pdulustie] == dna.room)  dixi('U', 15);
-			}
-			break;
-			case '\64' :
-				if (dna.room == r__musicroom)  play_harp();
-				else display(what);
-				break;
-			case '\67' :
-				if (dna.room == r__argentpub)  play_nim;
-				else display(what);
-				break;
-			default:
-				display(what);
-			}
-		}
-		break;
-	case vb_ring:
-		if (holding()) {
-			if (thing == bell) {
-				display("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((dna.ringing_bells) & (flagset('B')))
-					display("(Are you trying to join in, Avvy\?\?!)");
-			} else display(what);
-		}
-		break;
-	case vb_help:
-		boot_help;
-		break;
-	case vb_larrypass:
-		display("Wrong game!");
-		break;
-	case vb_phaon:
-		display("Hello, Phaon!");
-		break;
-	case vb_boss:
-		bosskey;
-		break;
-	case vb_pee:
-		if (flagset('P')) {
-			display("Hmm, I don't think anyone will notice...");
-			set_up_timer(4, procurinate, reason_gototoilet);
-		} else display("It would be \6VERY\22 unwise to do that here, Avvy!");
-		break;
-	case vb_cheat: {
-		display(string('\6') + "Cheat mode now enabled.");
-		cheat = true;
-	}
-	break;
-	case vb_magic:
-		if (dna.avaricius_talk > 0)
-			dixi('q', 19);
-		else {
-			if ((dna.room == 12) & (infield(2))) {
-				/* Avaricius appears! */
-				dixi('q', 17);
-				if (whereis['\227'] == 12)
-					dixi('q', 18);
-				else {
-					tr[2].init(1, false); /* Avaricius */
-					apped(2, 4);
-					tr[2].walkto(5);
-					tr[2].call_eachstep = true;
-					tr[2].eachstep = procback_and_forth;
-					dna.avaricius_talk = 14;
-					set_up_timer(177, procavaricius_talks, reason_avariciustalks);
-				}
-			} else display("Nothing appears to happen...");
-		}
-		break;
-	case vb_smartalec:
-		display("Listen, smart alec, that was just rhetoric.");
-		break;
-	case vb_expletive: {
-		switch (swore) {
-		case 0:
-			display(string("Avvy! Do you mind? There might be kids playing!\r\r") +
-			        "(I shouldn't say it again, if I were you!)");
-			break;
-		case 1:
-			display(string("You hear a distant rumble of thunder. Must you always ") +
-			        "do things I tell you not to?\r\rDon't do it again!");
-			break;
-		default: {
-			zonk;
-			display(string("A crack of lightning shoots from the sky, ") +
-			        "and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
-			gameover;
-		}
-		}
-		swore += 1;
-	}
-	break;
-	case vb_listen:
-		if ((dna.ringing_bells) & (flagset('B')))
-			display(string("All other noise is drowned out by the ringing of ") +
-			        "the bells.");
-		else if (listen == "")
-			display("You can't hear anything much at the moment, Avvy.");
-		else display(listen);
-		break;
-	case vb_buy: {
-		/* What are they trying to buy? */
-		switch (dna.room) {
-		case r__argentpub:
-			if (infield(6)) {
-				/* We're in a pub, and near the bar. */
-				switch (thing) {
-				case '\63':
-				case '\65':
-				case '\66':
-				case '\72': { /* Beer, whisky, cider or mead */
-					if (dna.malagauche == 177) { /* Already getting us one. */
-						dixi('D', 15);
-						return;
-					}
-					if (dna.teetotal)  {
-						dixi('D', 6);
-						return;
-					}
-					if (dna.alcohol == 0)  points(3);
-					show_one(12);
-					display(booze[thing] + ", please.\231\2");
-					dna.drinking = thing;
-
-					show_one(10);
-					dna.malagauche = 177;
-					set_up_timer(27, procbuydrinks, reason_drinks);
-				}
-				break;
-				case '\64':
-					examine();
-					break; /* We have a right one here- buy Pepsi??! */
-				case wine:
-					if (dna.obj[wine])  /* We've already got the wine! */
-						dixi('D', 2); /* 1 bottle's shufishent! */
-					else {
-						if (dna.malagauche == 177) { /* Already getting us one. */
-							dixi('D', 15);
-							return;
-						}
-						if (dna.carrying >= maxobjs) {
-							display("Your hands are full.");
-							return;
-						}
-						show_one(12);
-						display("Wine, please.\231\2");
-						if (dna.alcohol == 0)  points(3);
-						show_one(10);
-						dna.malagauche = 177;
-
-						set_up_timer(27, procbuywine, reason_drinks);
-					}
-					break;
-				}
-			} else dixi('D', 5);
-			break;                /* Go to the bar! */
-
-		case r__outsideducks:
-			if (infield(6)) {
-				if (thing == onion) {
-					if (dna.obj[onion])
-						dixi('D', 10); /* not planning to juggle with the things! */
-					else if (dna.carrying >= maxobjs)
-						display("Before you ask, you remember that your hands are full.");
-					else {
-						if (dna.bought_onion)
-							dixi('D', 11);
-						else {
-							dixi('D', 9);
-							points(3);
-						}
-						pennycheck(3); /* It costs thruppence. */
-						dna.obj[onion] = true;
-						objectlist;
-						dna.bought_onion = true;
-						dna.rotten_onion = false; /* It's OK when it leaves the stall! */
-						dna.onion_in_vinegar = false;
-					}
-				} else dixi('D', 0);
-			} else dixi('D', 0);
-			break;
-
-		case r__nottspub:
-			dixi('n', 15);
-			break; /* Can't sell to southerners. */
-		default:
-			dixi('D', 0); /* Can't buy that. */
-		}
-	}
-	break;
-	case vb_attack: {
-		if ((dna.room == r__brummieroad) &&
-		        ((person == '\235') || (thing == crossbow) || (thing == bolt))
-		        && (whereis['\235'] == dna.room)) {
-			switch (ord(dna.obj[bolt]) + ord(dna.obj[crossbow]) * 2) {
-				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
-				  3 = both. */
-			case 0: {
-				dixi('Q', 10);
-				display("(At the very least, don't use your bare hands!)");
-			}
-			break;
-			case 1:
-				display(string("Attack him with only a crossbow bolt? Are you ") +
-				        "planning on playing darts?!");
-				break;
-			case 2:
-				display(string("Come on, Avvy! You're not going to get very far ") +
-				        "with only a crossbow!");
-				break;
-			case 3: {
-				dixi('Q', 11);
-				dna.cwytalot_gone = true;
-				dna.obj[bolt] = false;
-				dna.obj[crossbow] = false;
-				objectlist;
-				magics[12].op = nix;
-				points(7);
-				tr[2].walkto(2);
-				tr[2].vanishifstill = true;
-				tr[2].call_eachstep = false;
-				whereis['\235'] = 177;
-			}
-			break;
-			default:
-				dixi('Q', 10); /* Please try not to be so violent! */
-			}
-		} else dixi('Q', 10);
-	}
-	break;
-	case vb_password:
-		if (dna.room != r__bridge)
-			dixi('Q', 12);
-		else {
-			ok = true;
-			for (ff = 1; ff <= length(thats); ff ++)
-				for (fv = 1; fv <= length(words[dna.pass_num + first_password].w); fv ++)
-					if (words[dna.pass_num + first_password].w[fv] !=
-					        upcase(realwords[ff][fv]))
-						ok = false;
-			if (ok) {
-				if (dna.drawbridge_open != 0)
-					display("Contrary to your expectations, the drawbridge fails to close again.");
-				else {
-					points(4);
-					display("The drawbridge opens!");
-					set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
-					dna.drawbridge_open = 1;
-				}
-			} else dixi('Q', 12);
-		}
-		break;
-	case vb_dir:
-		dir(realwords[2]);
-		break;
-	case vb_die:
-		gameover;
-		break;
-	case vb_score:
-		display(string("Your score is ") + strf(dna.score) + ",\3\rout of a " +
-		        "possible 128.\r\rThis gives you a rank of " + rank() +
-		        ".\r\r" + totaltime());
-		break;
-	case vb_put:
-		putproc();
-		break;
-	case vb_stand:
-		stand_up();
-		break;
-
-	case vb_kiss:
-		if (person == pardon)
-			display("Kiss whom?");
-		else if (personshere())
-			switch (person) {
-			case '\226' ... '\256':
-				display("Hey, what kind of a weirdo are you??");
-				break;
-			case parkata:
-				dixi('U', 12);
-				break;
-			case pgeida:
-				dixi('U', 13);
-				break;
-			case pwisewoman:
-				dixi('U', 14);
-				break;
-			default:
-				dixi('U', 5); /* You WHAT? */
-			}
-		break;
-
-	case vb_climb:
-		if (dna.room == r__insidecardiffcastle)  cardiff_climbing();
-		else /* In the wrong room! */
-			display("Not with your head for heights, Avvy!");
-		break;
-
-	case vb_jump: {
-		set_up_timer(1, procjump, reason_jumping);
-		dna.user_moves_avvy = false;
-	}
-	break;
-
-	case vb_highscores:
-		show_highs;
-		break;
-
-	case vb_wake:
-		if (personshere())
-			switch (person) {
-			case pardon:
-			case pavalot:
-			case '\0':
-				if (~ avvy_is_awake) {
-					avvy_is_awake = true;
-					points(1);
-					avvy_in_bed = true;
-					show_one(3); /* Picture of Avvy, awake in bed. */
-					if (teetotal)  dixi('d', 13);
-				} else display("You're already awake, Avvy!");
-				break;
-			case payles:
-				if (~ ayles_is_awake)  display("You can't seem to wake him by yourself.");
-				break;
-			case pjacques:
-				display(string("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
-				        "Hmmm... that doesn't seem to do any good...");
-				break;
-			default:
-				display("It's difficult to awaken people who aren't asleep...!");
-			}
-		break;
-
-	case vb_sit:
-		if (dna.room == r__nottspub) {
-			if (dna.sitting_in_pub)
-				display("You're already sitting!");
-			else {
-				tr[1].walkto(4); /* Move Avvy to the place, and sit him down. */
-				set_up_timer(1, procavvy_sit_down, reason_sitting_down);
-			}
-		} else {
-			/* Default doodah. */
-			dusk;
-			hang_around_for_a_while;
-			dawn;
-			display("A few hours later...\20nothing much has happened...");
-		}
-		break;
-
-	case vb_restart:
-		if (ask("Restart game and lose changes?"))  {
-			dusk;
-			newgame;
-			dawn;
-		}
-		break;
-
-	case pardon:
-		display("Hey, a verb would be helpful!");
-		break;
-
-	case vb_hello: {
-		person_speaks();
-		display("Hello.\2");
-	}
-	break;
-	case vb_thanks: {
-		person_speaks();
-		display("That's OK.\2");
-	}
-	break;
-	default:
-		display(string('\7') + "Parser bug!");
-	}
-}
-
-void verbopt(char n, string &answer, char &anskey) {
-	switch (n) {
-	case vb_exam: {
-		answer = "Examine";
-		anskey = 'x';
-	}
-	break; /* the ubiqutous one */
-	/* vb_give isn't dealt with by this procedure, but by ddm__with */
-	case vb_drink: {
-		answer = "Drink";
-		anskey = 'D';
-	}
-	break;
-	case vb_wear:  {
-		answer = "Wear";
-		anskey = 'W';
-	}
-	break;
-	case vb_ring:  {
-		answer = "Ring";
-		anskey = 'R';
-	}
-	break; /* only the bell! */
-	case vb_play:  {
-		answer = "Play";
-		anskey = 'P';
-	}
-	break;
-	case vb_eat:   {
-		answer = "Eat";
-		anskey = 'E';
-	}
-	break;
-	default:      {
-		answer = "? Unknown!";    /* Bug! */
-		anskey = '?';
-	}
-	}
-}
-
-class unit_acci_initialize {
-public:
-	unit_acci_initialize();
-};
-static unit_acci_initialize acci_constructor;
-
-unit_acci_initialize::unit_acci_initialize() {
-	weirdword = false;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
deleted file mode 100644
index c80f09d..0000000
--- a/engines/avalanche/acci.h
+++ /dev/null
@@ -1,296 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __acci_h__
-#define __acci_h__
-
-namespace Avalanche {
-
-/* verb codes */
-const char vb_exam = '\1';
-const char vb_open = '\2';
-const char vb_pause = '\3';
-const char vb_get = '\4';
-const char vb_drop = '\5';
-const char vb_inv = '\6';
-const char vb_talk = '\7';
-const char vb_give = '\10';
-const char vb_drink = '\11';
-const char vb_load = '\12';
-const char vb_save = '\13';
-const char vb_pay = '\14';
-const char vb_look = '\15';
-const char vb_break = '\16';
-const char vb_quit = '\17';
-const char vb_sit = '\20';
-const char vb_stand = '\21';
-const char vb_go = '\22';
-const char vb_info = '\23';
-const char vb_undress = '\24';
-const char vb_wear = '\25';
-const char vb_play = '\26';
-const char vb_ring = '\27';
-const char vb_help = '\30';
-const char vb_larrypass = '\31';
-const char vb_phaon = '\32';
-const char vb_boss = '\33';
-const char vb_pee = '\34';
-const char vb_cheat = '\35';
-const char vb_magic = '\36';
-const char vb_restart = '\37';
-const char vb_eat = '\40';
-const char vb_listen = '\41';
-const char vb_buy = '\42';
-const char vb_attack = '\43';
-const char vb_password = '\44';
-const char vb_dir = '\45';
-const char vb_die = '\46';
-const char vb_score = '\47';
-const char vb_put = '\50';
-const char vb_kiss = '\51';
-const char vb_climb = '\52';
-const char vb_jump = '\53';
-const char vb_highscores = '\54';
-const char vb_wake = '\55';
-const char vb_hello = '\56';
-const char vb_thanks = '\57';
-
-const char vb_smartalec = '\371';
-const char vb_expletive = '\375';
-
-const char pardon = '\376'; /* =didn't understand / wasn't given. */
-
-struct vocab {
-	byte n;
-	varying_string<11> w;
-};
-
-struct ranktype {
-	word score;
-	varying_string<12> title;
-};
-
-
-const integer nowords = 277; /* how many words does the parser know? */
-const char nowt = '\372';
-const char moved = '\0'; /* This word was moved. (Usually because it was the subject of
-  conversation.) */
-
-const integer first_password = 89; /* Words[first_password] should equal "TIROS". */
-
-const array<1, nowords, vocab> words =
-
-    /* Verbs, 1-49 */
-{	{	{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
-		{2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
-		{3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
-		{4, "TAKE"},      {4, "GET"},       {4, "PICK"},
-		{5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
-		{7, "SAY"},       {7, "ASK"},
-		{8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
-		{9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
-		{11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
-		{13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
-		{15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
-		{17, "STAND"},
-
-		{18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
-		{20, "DOFF"},
-		{21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
-		{22, "PLAY"},
-		{22, "STRUM"},     {23, "RING"},      {24, "HELP"},
-		{25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
-		{255, "NINET"},    /* block for NINETY */
-		{28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
-		{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
-		{30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
-		{30, "WIZZY"},     {30, "PLOVER"},
-		{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
-		{30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
-		{30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
-		{30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
-		{30, "BONESCROLLS"}, {30, "RADOF"},
-
-		{31, "RESTART"},
-		{32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
-		{33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
-		{34, "ORDER"},     {34, "DEMAND"},
-		{35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
-		{35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
-		{35, "FIRE"},
-
-		/* Passwords, 36: */
-
-		{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
-		{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
-		{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
-		{36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
-		{36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
-		{36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
-		{36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
-		{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
-		{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
-		{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
-
-		{37, "DIR"},       {37, "LS"},        {38, "DIE"},
-		{39, "SCORE"},
-		{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
-		{41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
-		{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
-		{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
-		{46, "HELLO"},     {46, "HI"},        {46, "YO"},
-		{47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
-
-
-		/* Nouns - Objects: 50-100. */
-
-		{50, "WINE"},      {50, "BOOZE"},    {50, "NASTY"},
-		{50, "VINEGAR"},   {51, "MONEYBAG"},
-		{51, "BAG"},       {51, "CASH"},     {51, "DOSH"},
-		{51, "WALLET"},
-		{52, "BODKIN"},    {52, "DAGGER"},   {53, "POTION"},
-		{54, "CHASTITY"},  {54, "BELT"},     {55, "BOLT"},
-		{55, "ARROW"},     {55, "DART"},
-		{56, "CROSSBOW"},  {56, "BOW"},      {57, "LUTE"},
-		{58, "PILGRIM"},   {58, "BADGE"},    {59, "MUSHROOMS"},
-		{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
-		{62, "PRESCRIPT"}, {62, "SCROLL"},   {62, "MESSAGE"},
-		{63, "PEN"},       {63, "QUILL"},    {64, "INK"},
-		{64, "INKPOT"},    {65, "CLOTHES"},  {66, "HABIT"},
-		{66, "DISGUISE"},  {67, "ONION"},
-
-		{99, "PASSWORD"},
-
-		/* Objects from Also are placed between 101 and 131. */
-
-		/* Nouns - People - Male, 150-174 */
-		{150, "AVVY"},      {150, "AVALOT"},    {150, "YOURSELF"},
-		{150, "ME"},        {150, "MYSELF"},    {151, "SPLUDWICK"},
-		{151, "THOMAS"},    {151, "ALCHEMIST"}, {151, "CHEMIST"},
-		{152, "CRAPULUS"},  {152, "SERF"},      {152, "SLAVE"},
-		{158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
-		{152, "CRAPPY"},    {153, "DUCK"},      {153, "DOCTOR"},
-		{154, "MALAGAUCHE"},
-		{155, "FRIAR"},     {155, "TUCK"},      {156, "ROBIN"},
-		{156, "HOOD"},      {157, "CWYTALOT"},  {157, "GUARD"},
-		{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
-		{159, "DUKE"},      {159, "GRACE"},     {160, "DOGFOOD"},
-		{160, "MINSTREL"},  {161, "TRADER"},    {161, "SHOPKEEPER"},
-		{161, "STALLHOLDER"},
-		{162, "PILGRIM"},   {162, "IBYTHNETH"}, {163, "ABBOT"},
-		{163, "AYLES"},     {164, "PORT"},      {165, "SPURGE"},
-		{166, "JACQUES"},   {166, "SLEEPER"},   {166, "RINGER"},
-
-		/* Nouns- People - Female: 175-199 */
-		{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
-		{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
-		{178, "WITCH"},
-
-		/* Pronouns, 200-224 */
-		{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
-		{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
-		{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
-		{202, "IT"},        {202, "THING"},
-
-		{203, "MONK"},       {204, "BARMAN"},    {204, "BARTENDER"},
-
-		/* Prepositions, 225-249 */
-		{225, "TO"},        {226, "AT"},        {227, "UP"},
-		{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
-		{230, "UP"},        {231, "DOWN"},      {232, "ON"},
-
-
-		/* Please, 251 */
-		{251, "PLEASE"},
-
-		/* About, 252 */
-		{252, "ABOUT"}, {252, "CONCERNING"},
-
-		/* Swear words, 253 */
-		/*              I M P O R T A N T    M E S S A G E
-
-		   DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
-		   DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
-		   GOODNESS KNOWS WHO WROTE THEM.
-		   READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
-		   WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
-
-		{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
-		{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
-		{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
-		{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
-		{253, "SMEG"},
-		/* and other even ruder words. You didn't read them, did you? Good. */
-
-		/* Answer-back smart-alec words, 249 */
-		{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},
-
-		/* Noise words, 255 */
-		{255, "THE"},       {255, 'A'},         {255, "NOW"},
-		{255, "SOME"},      {255, "AND"},       {255, "THAT"},
-		{255, "POCUS"},     {255, "HIS"},
-		{255, "THIS"},      {255, "SENTINEL"}
-	}
-};        /* for "Ken SENT Me" */
-
-const char what[] = "That's not possible!";
-
-const array<1, 9, ranktype> ranks = {
-	{	{0, "Beginner"},    {10, "Novice"},
-		{20, "Improving"},   {35, "Not bad"},
-		{50, "Passable"},    {65, "Good"},
-		{80, "Experienced"}, {108, "The BEST!"},
-		{maxint, "copyright'93"}
-	}
-};
-
-
-#ifdef __acci_implementation__
-#undef EXTERN
-#define EXTERN
-#endif
-
-EXTERN varying_string<11> thats;
-EXTERN varying_string<20> unknown;
-EXTERN array<1, 11, varying_string<20> > realwords;
-EXTERN char verb, person, thing, thing2;
-EXTERN boolean polite;
-#undef EXTERN
-#define EXTERN extern
-
-
-void clearwords();
-void parse();
-void lookaround();
-void opendoor();
-void do_that();
-void verbopt(char n, string &answer, char &anskey);
-void have_a_drink();
-
-} // End of namespace Avalanche.
-
-#endif
\ No newline at end of file
diff --git a/engines/avalanche/also.cpp b/engines/avalanche/also.cpp
deleted file mode 100644
index af3b6c3..0000000
--- a/engines/avalanche/also.cpp
+++ /dev/null
@@ -1,1412 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Rodent.h"*/
-/*#include "Crt.h"*/
-
-/*$R+,V-*/
-
-namespace Avalanche {
-
-typedef matrix<0, 255, 0, 15, byte> fonttype;
-
-class fieldtype {
-public:
-	integer x1, y1, x2, y2;
-};
-
-class linetype : public fieldtype {
-public:
-	byte col;
-};
-
-struct pedtype {
-	integer x, y;
-	byte dir;
-};
-
-struct magictype {
-	byte op; /* one of the operations */
-	word data; /* data for them */
-};
-
-const integer numlines = 50;
-const integer up = 0;
-const integer right = 1;
-const integer down = 2;
-const integer left = 3;
-const integer ur = 4;
-const integer dr = 5;
-const integer dl = 6;
-const integer ul = 7;
-const integer still = 8;
-
-const integer nay = maxint;
-
-/* Magic commands are */
-
-/*N*/ const integer nix = 0; /* ignore it if this line is touched */
-/*B*/ const integer bounce = 1; /* bounce off this line */
-/*E*/ const integer exclaim = 2; /* put up a chain of scrolls */
-/*T*/ const integer transport = 3; /* enter new room */
-/*U*/ const integer unfinished = 4; /* unfinished connection */
-/*S*/ const integer special = 5; /* special call */
-/*O*/ const integer opendoor = 6; /* slowly opening door. */
-
-integer gd, gm;
-array<1, numlines, linetype> lines;
-array<1, numlines, fieldtype> fields;
-boolean do1;
-byte current;
-string n;
-matrix<0, 29, 1, 2, string> names;
-file<fonttype> f;
-fonttype skinny;
-byte tx, ty;
-matrix<0, 79, 0, 22, char> chars;
-byte cursorflash;
-array<1, 15, pedtype> peds;
-array<1, 15, magictype> magics;
-array<9, 15, magictype> portals;
-varying_string<26> flags;
-string listen;
-
-const graphcursmasktype crosshairs = {
-	((63551, 63807, 63807, 63807, 61727, 257, 897, 32765, 897, 257, 61727, 63807, 63807, 63807, 63551, 65535),
-	(4368, 21140, 8840, 53910, 640, 640, 31868, 33026, 31868, 640, 640, 53910, 8840, 21140, 4368, 0)),
-	7,
-	7
-};
-
-const graphcursmasktype hook = {
-	((32831, 32831, 49279, 49279, 57599, 61695, 61471, 61447, 63491, 57089, 36801, 32771, 49159, 57375, 63743, 65535),
-	(0, 16256, 7936, 7936, 3584, 1536, 1792, 2016, 248, 28, 8220, 12344, 8160, 1792, 0, 0)),
-	2,
-	9
-};
-
-const graphcursmasktype tthand = {
-	((62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443),
-	(3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092)),
-	4,
-	0
-};
-
-string strf(longint x) {
-	string q;
-	string strf_result;
-	str(x, q);
-	strf_result = q;
-	return strf_result;
-}
-
-void glimpse(byte ret) {     /* glimpse of screen 3 */
-	char sink;
-	hidemousecursor;
-	setvisualpage(3);
-	setcrtpagenumber(3);
-	showmousecursor;
-	do {
-	} while (!(~ anymousekeypressed));
-	do {
-	} while (!anymousekeypressed);
-	hidemousecursor;
-	setvisualpage(ret);
-	setcrtpagenumber(ret);
-	showmousecursor;
-	while (keypressed())  sink = readkey();
-}
-
-void newline(byte t, integer p, integer q, integer r, integer s, byte c) {
-	{
-		linetype &with = lines[t];
-		x1 = p;
-		y1 = q;
-		x2 = r;
-		y2 = s;
-		with.col = c;
-	}
-}
-
-void newfield(byte t, integer p, integer q, integer r, integer s) {
-	{
-		fieldtype &with = fields[t];  ;
-		with.x1 = p;
-		with.y1 = q;
-		with.x2 = r;
-		with.y2 = s;
-	}
-}
-
-void drawped(byte p) {
-	{
-		pedtype &with = peds[p];
-		if (with.dir < 177) {
-			setcolor(p);
-			circle(with.x, with.y, 5);
-			moveto(with.x, with.y);
-			switch (with.dir) {
-			case up:
-				linerel(0, -5);
-				break;
-			case down:
-				linerel(0, 5);
-				break;
-			case left:
-				linerel(-7, 0);
-				break;
-			case right:
-				linerel(7, 0);
-				break;
-			case ul:
-				linerel(-7, -5);
-				break;
-			case dl:
-				linerel(-7, 5);
-				break;
-			case ur:
-				linerel(7, -5);
-				break;
-			case dr:
-				linerel(7, 5);
-				break;
-			}
-		}
-	}
-}
-
-void drawup() {
-	byte fv;
-	cleardevice();
-	for (fv = 1; fv <= numlines; fv ++) {
-		linetype &with = lines[fv];
-		if (x1 != nay) {
-			setcolor(with.col);
-			line(x1, y1, x2, y2);
-		}
-	}
-	for (fv = 1; fv <= numlines; fv ++) {
-		fieldtype &with = fields[fv];
-		if (with.x1 != nay) {
-			setcolor(fv);
-			rectangle(with.x1, with.y1, with.x2, with.y2);
-		}
-	}
-	for (fv = 1; fv <= 15; fv ++) drawped(fv);
-}
-
-void addped() {
-	byte n, fv;
-	n = 0;
-	do {
-		n += 1;
-	} while (!((n == 16) || (peds[n].dir == 177)));
-	setcrtpagenumber(0);
-	setactivepage(0);
-	setvisualpage(0);
-	drawup();
-	setgraphicscursor(tthand);
-	showmousecursor;
-	do {
-		if (rightmousekeypressed)  return;
-		if (keypressed())  glimpse(0);
-	} while (!leftmousekeypressed);
-	hidemousecursor;
-	{
-		pedtype &with = peds[n];
-		with.x = mousex;
-		with.y = mousey;
-	}
-	cleardevice();
-	setfillstyle(6, 9);
-	for (fv = 1; fv <= 3; fv ++) bar(200 * fv, 0, 200 * fv, 200);
-	for (fv = 1; fv <= 2; fv ++) bar(0, 60 * fv, 640, 60 * fv);
-	showmousecursor;
-	do {
-		if (rightmousekeypressed)  return;
-	} while (!leftmousekeypressed);
-	hidemousecursor;
-	{
-		pedtype &with = peds[n];
-		switch (((mousex / 200) * 10) + (mousey / 60)) {
-		case 0:
-			with.dir = ul;
-			break;
-		case 10:
-			with.dir = up;
-			break;
-		case 20:
-			with.dir = ur;
-			break;
-		case 1:
-			with.dir = left;
-			break;
-		case 11:
-			with.dir = still;
-			break;
-		case 21:
-			with.dir = right;
-			break;
-		case 2:
-			with.dir = dl;
-			break;
-		case 12:
-			with.dir = down;
-			break;
-		case 22:
-			with.dir = dr;
-			break;
-		}
-	}
-}
-
-void addline(byte ccc) {
-	byte fv;
-	do {
-		for (fv = 1; fv <= numlines; fv ++) {
-			linetype &with = lines[fv];
-			if (x1 == nay) {
-				x1 = fv * 17;
-				x2 = x1;
-				y1 = 200;
-				y2 = 190;
-				with.col = ccc;
-				return; /* bad style! */
-			}
-		}
-	} while (!false);
-}
-
-byte colour() {
-	byte fv;
-	byte colour_result;
-	setactivepage(0);
-	setvisualpage(0);
-	setcrtpagenumber(0);
-	outtextxy(0, 0, "Select a colour, please...");
-	for (fv = 1; fv <= 15; fv ++) {
-		setfillstyle(1, fv);
-		bar(fv * 40, 27, 39 + fv * 40, 200);
-	}
-	showmousecursor;
-	do {
-		if (rightmousekeypressed)  {
-			hidemousecursor;
-			return colour_result;
-		}
-		if (keypressed())  glimpse(2);
-	} while (!leftmousekeypressed);
-	hidemousecursor;
-	colour_result = getpixel(mousex, mousey);
-	cleardevice();
-	return colour_result;
-}
-
-void addfield() {
-	byte fv;
-	boolean ok;
-	do {
-		fv = colour();
-		ok = fields[fv].x1 == nay;
-		if (! ok)  output << '\7';
-	} while (!ok);
-	{
-		fieldtype &with = fields[fv];
-		with.x1 = 300 + fv * 17;
-		with.x2 = with.x1 + 1;
-		with.y1 = 200;
-		with.y2 = 177;
-	}
-}
-
-byte checkline() {
-	byte fv, ans;
-	byte checkline_result;
-	setgraphicscursor(crosshairs);
-	setcrtpagenumber(0);
-	setactivepage(0);
-	setvisualpage(0);
-	drawup();
-	do {
-		showmousecursor;
-		do {
-			if (rightmousekeypressed)  {
-				checkline_result = 255;
-				return checkline_result;
-			}
-			if (keypressed())  glimpse(0);
-		} while (!leftmousekeypressed);
-		hidemousecursor;
-		setactivepage(1);
-		ans = 177;
-		for (fv = 1; fv <= numlines; fv ++) { /*  */
-			{
-				linetype &with = lines[fv];
-				if (x1 != nay) {
-					setcolor(9);
-					line(x1, y1, x2, y2);
-					if (getpixel(mousex, mousey) == 9)  ans = fv;
-					setcolor(0);
-					line(x1, y1, x2, y2);
-				}
-			}
-			{
-				fieldtype &with = fields[fv];
-				if (with.x1 != nay) {
-					setcolor(9);
-					rectangle(with.x1, with.y1, with.x2, with.y2);
-					if (getpixel(mousex, mousey) == 9)  ans = fv + 100;
-					setcolor(0);
-					rectangle(with.x1, with.y1, with.x2, with.y2);
-				}
-			}
-		}
-		setactivepage(0);
-	} while (!(ans != 177));
-	checkline_result = ans;
-	return checkline_result;
-}
-
-void chooseside();
-static boolean itsaline;
-
-static void plotline() {
-	if (itsaline) {
-		linetype &with = lines[gd];
-		if (do1)  line(mousex, mousey, x2, y2);
-		else
-			line(x1, y1, mousex, mousey);
-	} else {
-		fieldtype &with = fields[gd];
-		if (do1)  rectangle(mousex, mousey, with.x2, with.y2);
-		else
-			rectangle(with.x1, with.y1, mousex, mousey);
-	}
-}
-
-void chooseside() {
-	byte clicol, savelcol;
-	fieldtype current;
-	integer temp;
-	do {
-		gd = checkline();
-		itsaline = gd < 100;
-		if (gd == 255)  {
-			hidemousecursor;
-			return;
-		}
-		if (! itsaline)  gd -= 100;
-		setactivepage(2);
-		setvisualpage(2);
-		cleardevice();
-		setgraphicscursor(tthand);
-		setcrtpagenumber(2);
-		if (itsaline) {
-			current = lines[gd];
-			savelcol = lines[gd].col;
-		} else current = fields[gd];
-		{
-			setcolor(9);
-			if (itsaline)  line(current.x1, current.y1, current.x2, current.y2);
-			else rectangle(current.x1, current.y1, current.x2, current.y2);
-			setcolor(9);
-			setfillstyle(1, red);
-			bar(current.x1 - 3, current.y1 - 3, current.x1 + 3, current.y1 + 3);
-			setfillstyle(1, green);
-			bar(current.x2 - 3, current.y2 - 3, current.x2 + 3, current.y2 + 3);
-			do {
-			} while (!(~ anymousekeypressed));
-			clicol = 177;
-			showmousecursor;
-			do {
-				if (anymousekeypressed) {
-					hidemousecursor;
-					clicol = getpixel(mousex, mousey);
-					showmousecursor;
-				}
-				if (rightmousekeypressed) {
-					hidemousecursor;
-					return;
-				}
-				if (keypressed())  glimpse(2);
-			} while (!(set::of(red, green, eos).has(clicol)));
-			do1 = clicol == red;
-			hidemousecursor;
-			setgraphicscursor(hook);
-			setcrtpagenumber(0);
-			setactivepage(0);
-			setvisualpage(0);
-			setcolor(0);
-			if (itsaline) {
-				linetype &with1 = lines[gd];  ;
-				line(current.x1, current.y1, current.x2, current.y2);
-				setcolor(with1.col);
-			} else {
-				fieldtype &with1 = fields[gd];  ;
-				rectangle(with1.x1, with1.y1, with1.x2, with1.y2);
-				setcolor(gd);
-			}
-			setwritemode(xorput);
-			while (~ anymousekeypressed) {
-				plotline();
-				showmousecursor;
-				delay(1);
-				hidemousecursor;
-				plotline();
-				if (rightmousekeypressed)  {
-					hidemousecursor;
-					return;
-				}
-				if (keypressed())  glimpse(0);
-			}
-			/* update "current" rec */
-			if (do1)  {
-				current.x1 = mousex;
-				current.y1 = mousey;
-			} else {
-				current.x2 = mousex;
-				current.y2 = mousey;
-			}
-			if (! itsaline) {
-				if (current.x1 > current.x2)  {
-					temp = current.x2;
-					current.x2 = current.x1;
-					current.x1 = temp;
-				}
-				if (current.y1 > current.y2)  {
-					temp = current.y2;
-					current.y2 = current.y1;
-					current.y1 = temp;
-				}
-			}
-			/* copy "current" to line/field */
-			if (itsaline) {
-				linetype &with1 = lines[gd];
-				current.x1 = current.x1;
-				current.x2 = current.x2;
-				current.y1 = current.y1;
-				current.y2 = current.y2;
-				with1.col = savelcol;
-			} else fields[gd] = current;
-		}
-		setwritemode(0);
-	} while (!false);
-}
-
-void delped() {
-	setcrtpagenumber(0);
-	setactivepage(0);
-	setvisualpage(0);
-	drawup();
-	setgraphicscursor(tthand);
-	showmousecursor;
-	do {
-	} while (!leftmousekeypressed);
-	peds[colour()].dir = 177;
-}
-
-byte menu();
-
-static void say(byte y, string x) {
-	setfillstyle(1, y);
-	bar(0, y * 17, 100, y * 17 + 15);
-	outtextxy(123, y * 17, x);
-}
-
-byte menu() {
-	byte clicol;
-	byte menu_result;
-	setcolor(15);
-	settextstyle(0, 0, 2);
-	clicol = 0;
-	setgraphicscursor(tthand);
-	setvisualpage(2);
-	setactivepage(2);
-	setcrtpagenumber(2);
-	cleardevice();
-	say(3, "Move lines around");
-	say(4, "Add a new line");
-	say(5, "Delete a line");
-	say(6, "Add a ped");
-	say(7, "Delete a ped");
-	say(8, "Add a field");
-	say(10, "Return to Also.");
-	showmousecursor;
-	do {
-		if (leftmousekeypressed) {
-			hidemousecursor;
-			clicol = getpixel(mousex, mousey);
-			showmousecursor;
-		}
-		if (rightmousekeypressed)  {
-			hidemousecursor;
-			return menu_result;
-		}
-		if (keypressed())  glimpse(2);
-	} while (!(clicol > 0));
-	do {
-	} while (!(~ anymousekeypressed));
-	hidemousecursor;
-	menu_result = clicol;
-	return menu_result;
-}
-
-void removeline() {
-	gd = checkline();
-	if (gd == 255)  {
-		hidemousecursor;
-		return;
-	}
-	if (gd > 100)
-		fields[gd - 100].x1 = nay;
-	else lines[gd].x1 = nay; /* cancels it out */
-	cleardevice();
-	drawup();
-}
-
-void lino() {
-	resetmouse;
-	do {
-		switch (menu()) {
-		case 3:
-			chooseside();
-			break;
-		case 4:
-			addline(colour());
-			break;
-		case 5:
-			removeline();
-			break;
-		case 6:
-			addped();
-			break;
-		case 7:
-			delped();
-			break;
-		case 8:
-			addfield();
-			break;
-		case 10:
-			return;
-			break;
-		}
-	} while (!false);
-}
-
-void loadscreen() {   /* load2 */
-	byte a /*absolute $A000:246560*/;
-	byte bit;
-	untyped_file f;
-	setactivepage(3);
-	setvisualpage(3);
-	assign(f, string("c:\\avalot\\place") + n + ".avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a, 12080);
-	}
-	close(f);
-	setvisualpage(0);
-	outtextxy(0, 190, "Look carefully, and then press any key...");
-	setactivepage(0);
-}
-
-void ctrlsout(string &x) {        /* Replace real ctrls with caret codes */
-	byte fv;
-	string xx;
-	xx = "";
-	for (fv = 1; fv <= length(x); fv ++)
-		if (x[fv] > '\37')  xx = xx + x[fv];
-		else xx = xx + '^' + chr(ord(x[fv]) + 64);
-	x = xx;
-}
-
-void ctrlsin(string &x) {        /* Opposite of ctrlsout */
-	byte fv;
-	string xx;
-	boolean ctrlwas;
-	xx = "";
-	ctrlwas = false;
-	for (fv = 1; fv <= length(x); fv ++)
-		if (ctrlwas) {  /* last char was a caret */
-			xx = xx + chr(ord(upcase(x[fv])) - 64);
-			ctrlwas = false;
-		} else {
-			;     /* last char wasn't a caret... */
-			if (x[fv] == '^')  ctrlwas = true;
-			else  /* ...but this one is */
-				xx = xx + x[fv]; /* ...but this one isn't */
-		}
-	x = xx;
-}
-
-void flipover() {   /* temp view other screen */
-	char r;
-	setvisualpage(3);
-	r = readkey();
-	setvisualpage(0);
-}
-
-void plotchar(byte x, byte y, char n) {
-	byte fv;
-	if (chars[x][y] == n)  return;
-	for (fv = 0; fv <= 15; fv ++)
-		mem[0xa000 * y * 1200 + (fv + 3) * 80 + x] = skinny[ord(n)][fv];
-	chars[x][y] = n;
-}
-
-void cursor() {
-	byte fv;
-	cursorflash += 1;
-	switch (cursorflash) {
-	case 1:
-	case 127:
-		for (fv = 12; fv <= 14; fv ++)
-			mem[0xa000 * ty * 1200 + (3 + fv) * 80 + tx] = ~(mem[0xa000 * ty * 1200 + (3 + fv) * 80 + tx]);
-		break;
-	case 255:
-		cursorflash = 0;
-		break;
-	}
-}
-
-void losecursor() {
-	if (cursorflash < 127)  {
-		cursorflash = 126;
-		cursor();
-	}
-	cursorflash = 0;
-}
-
-void gwrite(string x) {
-	byte fv;
-	for (fv = 1; fv <= length(x); fv ++) {
-		plotchar(tx, ty, x[fv]);
-		tx += 1;
-		if (tx == 80)  {
-			ty += 1;
-			tx = 0;
-		}
-	}
-}
-
-string typein(string x) {
-	const char marker = '\2';
-	byte p;
-	char r;
-	string typein_result;
-	setvisualpage(0);
-	setactivepage(0);
-	cleardevice();
-	settextstyle(0, 0, 1);
-	setcolor(15);
-	outtextxy(0,  0, "Press TAB to see the room...");
-	outtextxy(0, 20, "You may use any of these Control Codes:");
-	outtextxy(30, 30, "Anywhere: ^M = new line, ^P = new scroll, |1 fix to speaker 1.");
-	outtextxy(90, 40, "^B = new bubble");
-	outtextxy(30, 50, "At end of line: ^C = centre line, ^L = left justify.");
-	outtextxy(30, 60, "At end of scroll: ^D = Don't add automatic ^P here.");
-	outtextxy(0, 80, "(Use by typing in (eg for ^P) ^ then P, not Ctrl-P.)");
-	p = 0;
-	ctrlsout(x);
-	fillchar(chars, sizeof(chars), '\40');
-	do {
-		tx = 0;
-		ty = 6;
-		gwrite(x + '\4' + '\40');
-		tx = (p % 80);
-		ty = (p / 80) + 6;
-		while (! keypressed())  {
-			delay(1);
-			cursor();
-		}
-		losecursor();
-		r = readkey();
-		switch (r) {
-		case '\10':
-			if (p > 0)  {
-				x = copy(x, 1, p - 1) + copy(x, p + 1, 255);
-				p -= 1;
-			}
-			break; /* backspace */
-		case '\11':
-			flipover();
-			break;
-		case '\40' ... '\377': {
-			x = copy(x, 1, p) + r + copy(x, p + 1, 255);
-			p += 1;
-		}
-		break;
-		case '\0':
-			switch (readkey()) { /* extd. keystroke */
-			case 'G':
-				p = 0;
-				break; /* Home */
-			case 'K':
-				if (p > 0)  p -= 1;
-				break; /* left */
-			case 'M':
-				if (p < length(x))  p += 1;
-				break; /* right */
-			case 'H':
-				if (p > 80)  p -= 80;
-				break; /* up */
-			case 'P':
-				if (p < length(x) - 80)  p += 80;
-				break; /* down */
-			case 'O':
-				p = length(x);
-				break; /* End */
-			case 'S':
-				x = copy(x, 1, p) + copy(x, p + 2, 255);
-				break; /* Del */
-			}
-			break;
-		}
-	} while (!(r == '\15'));
-	ctrlsin(x);
-	typein_result = x;
-	return typein_result;
-}
-
-byte typeno(string title) {
-	varying_string<2> x;
-	char r;
-	integer e;
-	word p;
-	byte typeno_result;
-	cleardevice();
-	x = "000";
-	settextstyle(0, 0, 3);
-	setcolor(9);
-	outtextxy(0, 0, title);
-	setfillstyle(1, 0);
-	setcolor(10);
-	fillchar(chars, sizeof(chars), '\40');
-	do {
-		bar(100, 100, 150, 125);
-		outtextxy(100, 100, x);
-		do {
-			r = readkey();
-		} while (!(set::of(range('0', '9'), '\33', '\15', eos).has(r)));
-		if (r == '\33')  {
-			typeno_result = 255;
-			return typeno_result;
-		}
-		if (r != '\15')  x = string(x[2]) + r;
-	} while (!(r == '\15'));
-	val(x, p, e);
-	typeno_result = p;
-	return typeno_result;
-}
-
-void showallnames() {
-	byte fv;
-	varying_string<2> s;
-	char r;
-	settextstyle(0, 0, 2);
-	cleardevice();
-	setcolor(13);
-	outtextxy(0, 0, "Descriptions start...");
-	settextstyle(0, 0, 1);
-	setcolor(7);
-	for (fv = 1; fv <= 29; fv ++) {
-		str(fv, 2, s);
-		outtextxy((fv / 15) * 320, ((fv % 15) * 10) + 30, s + '=' + copy(names[fv][1], 0, 33));
-	}
-	setcolor(15);
-	outtextxy(500, 190, "Press any key...");
-	r = readkey();
-}
-
-void showallassoc();
-
-
-static void saascreen() {
-	settextstyle(0, 0, 2);
-	cleardevice();
-	setcolor(10);
-	outtextxy(0, 0, "Everything...");
-	settextstyle(0, 0, 1);
-	setcolor(2);
-	outtextxy(17, 20, "(Format: <number> : <start of names> : <start of desc.>)");
-}
-
-void showallassoc() {
-	byte fv;
-	varying_string<2> s;
-	char r;
-
-	saascreen();
-	for (fv = 1; fv <= 30; fv ++) {
-		str(fv - 1, 2, s);
-		outtextxy(0, (((fv - 1) % 10) * 10) + 30,
-		          s + ':' + copy(names[fv - 1][1], 1, 7) + ':' + copy(names[fv - 1][2], 1, 70));
-		if ((fv % 10) == 0)  {
-			r = readkey();
-			saascreen();
-		}
-	}
-	setcolor(15);
-	outtextxy(500, 190, "Press any key...");
-	r = readkey();
-}
-
-void clear() {
-	byte fv;
-	fillchar(names , sizeof(names),  '\0');
-	for (fv = 1; fv <= numlines; fv ++) {
-		lines[fv].x1 = nay;
-		fields[fv].x1 = nay;
-	}
-	fillchar(peds  , sizeof(peds), '\261');
-}
-
-void scramble();
-
-static void scram1(string &x) {
-	byte fz;
-	for (fz = 1; fz <= length(x); fz ++)
-		x[fz] = chr(ord(x[fz]) ^ 177);
-}
-
-void scramble() {   /* Works both ways. */
-	byte fv, ff;
-	for (fv = 0; fv <= 29; fv ++)
-		for (ff = 1; ff <= 2; ff ++)
-			scram1(names[fv][ff]);
-	scram1(listen);
-	scram1(flags);
-}
-
-void save() {
-	string x;
-	untyped_file f;
-	byte minnames, minlines, minpeds, minfields, fv, ff;
-	minnames = 0;
-	for (fv = 0; fv <= 29; fv ++) if (names[fv][1] != "")     minnames = fv;
-	minlines = 0;
-	for (fv = 1; fv <= numlines; fv ++)
-		if (lines[fv].x1 != nay)   minlines = fv;
-	minpeds  = 0;
-	for (fv = 1; fv <= 15; fv ++) if (peds[fv].dir < 177)    minpeds  = fv;
-	minfields = 0;
-	for (fv = 1; fv <= 30; fv ++) if (fields[fv].x1 != nay)  minfields = fv;
-	assign(f, string("c:\\avalot\\also") + n + ".avd");
-	rewrite(f, 1);
-	x = string("This is an Also .AVD file, which belongs to AVALOT.EXE. Its contents") +
-	    '\15' + '\12' + "are subject to copyright, so there. Have fun!" + '\32' + " *Minstrel* ";
-	blockwrite(f, x[1], 128);
-	scramble();
-	blockwrite(f, minnames, 1);
-	for (fv = 0; fv <= minnames; fv ++)
-		for (ff = 1; ff <= 2; ff ++)
-			blockwrite(f, names[fv][ff], length(names[fv][ff]) + 1);
-	blockwrite(f, minlines, 1);
-	blockwrite(f, lines, sizeof(lines[1])*minlines);
-	blockwrite(f, minpeds, 1);
-	blockwrite(f, peds, sizeof(peds[1])*minpeds);
-	blockwrite(f, minfields, 1);
-	blockwrite(f, fields, sizeof(fields[1])*minfields);
-	blockwrite(f, magics, sizeof(magics));
-	blockwrite(f, portals, sizeof(portals));
-	blockwrite(f, flags, sizeof(flags));
-	blockwrite(f, listen[0], 1);
-	blockwrite(f, listen[1], length(listen));
-	close(f);
-	scramble();
-}
-
-void load();
-static untyped_file f;
-
-
-static string nextstring() {
-	byte l;
-	string x;
-	string nextstring_result;
-	x = "";
-	blockread(f, l, 1);
-	blockread(f, x[1], l);
-	x[0] = chr(l);
-	nextstring_result = x;
-	return nextstring_result;
-}
-
-void load() {
-	byte minnames, minlines, minpeds, minfields;
-	byte ff, fv;
-
-	clear();
-	assign(f, string("c:\\avalot\\also") + n + ".avd");
-	/*$I-*/ reset(f, 1); /*$I+*/ if (ioresult != 0)  return; /* no Also file */
-	seek(f, 128);
-	blockread(f, minnames, 1);
-	for (fv = 0; fv <= minnames; fv ++)
-		for (ff = 1; ff <= 2; ff ++)
-			names[fv][ff] = nextstring();
-	blockread(f, minlines, 1);
-	blockread(f, lines, sizeof(lines[1])*minlines);
-	blockread(f, minpeds, 1);
-	blockread(f, peds, sizeof(peds[1])*minpeds);
-	blockread(f, minfields, 1);
-	blockread(f, fields, sizeof(fields[1])*minfields);
-	blockread(f, magics, sizeof(magics));
-	blockread(f, portals, sizeof(portals));
-	blockread(f, flags, sizeof(flags));
-	blockread(f, listen[0], 1);
-	blockread(f, listen[1], length(listen));
-	close(f);
-	scramble();
-}
-
-void editmagics();
-const array<1, 15, char> codes = "123456789ABCDEF";
-
-static integer y;
-
-
-static void display() {
-	byte fv;
-	cleardevice();
-	settextstyle(0, 0, 2);
-	setcolor(15);
-	outtextxy(0, 0, "Magics.");
-	settextstyle(0, 0, 1);
-	for (fv = 1; fv <= 15; fv ++) {
-		y = 23 + fv * 10;
-		setcolor(fv);
-		outtextxy(100, y, string('$') + codes[fv - 1]);
-		{
-			magictype &with = magics[fv];
-			switch (with.op) {
-			case nix: {
-				setcolor(8);
-				outtextxy(140, y, "Nix");
-			}
-			break;
-			case bounce: {
-				setcolor(10);
-				outtextxy(143, y, "Bounce!");
-			}
-			break;
-			case exclaim: {
-				setcolor(14);
-				outtextxy(143, y, string("Exclaim: ") + strf(with.data));
-			}
-			break;
-			case transport: {
-				setcolor(12);
-				outtextxy(143, y, string("Transport to ") + strf(hi(with.data)) +
-				          ", ped " + strf(lo(with.data)));
-			}
-			break;
-			case unfinished: {
-				setcolor(15);
-				outtextxy(143, y, "*** UNFINISHED! ***");
-			}
-			break;
-			case special: {
-				setcolor(6);
-				outtextxy(143, y, string("Special call no. ") + strf(with.data));
-			}
-			break;
-			case opendoor: {
-				setcolor(11);
-				outtextxy(143, y, string("Opening door to ") + strf(hi(with.data)) +
-				          ", ped " + strf(lo(with.data)));
-			}
-			break;
-			}
-		}
-	}
-	outtextxy(177, 190, "Which do you want to change\? (Esc=Exit) $");
-}
-
-
-
-static word ask(string x) {
-	string q;
-	word thomaswashere;
-	integer e;
-	word ask_result;
-	cleardevice();
-	setcolor(10);
-	settextstyle(0, 0, 3);
-	outtextxy(0, 100, x);
-	do {
-		input >> q >> NL;
-		val(q, thomaswashere, e);
-	} while (!(e == 0));
-	ask_result = thomaswashere;
-	return ask_result;
-}
-
-void editmagics() {
-	char r, rr;
-	byte p;
-
-	do {
-		display();
-		do {
-			r = upcase(readkey());
-			if (r == '\33')  return;
-			p = pos(r, codes); /* which are we editing? */
-		} while (!(p > 0)); /* it must BE there... */
-		setcolor(p);
-		cleardevice();
-		outtextxy(177, 17, string("Editing magic $") + r + '.');
-		outtextxy(0, 30, "New operation ( (N)ix, (B)ounce, (E)xclaim, (T)ransport, (U)nfinished),");
-		outtextxy(30, 40, "(S)pecial, (O)pening Door?");
-		do {
-			rr = upcase(readkey());
-		} while (!(set::of('N', 'B', 'E', 'T', 'U', 'S', 'O', '\33', eos).has(rr)));
-		{
-			magictype &with = magics[p];
-			switch (rr) {
-			case '\33':
-				return;
-				break; /* cancelling code */
-			case 'N':
-				with.op = nix;
-				break;
-			case 'B':
-				with.op = bounce;
-				break;
-			case 'E': {
-				with.op = exclaim;
-				with.data = ask("Which scroll?");
-			}
-			break;
-			case 'T': {
-				with.op = transport;
-				with.data = ask("Ped no.?") + ask("Whither?") * 256;
-			}
-			break;
-			case 'U':
-				with.op = unfinished;
-				break;
-			case 'S': {
-				with.op = special;
-				with.data = ask("Which call?");
-			}
-			break;
-			case 'O': {
-				with.op = opendoor;
-				with.data = ask("Ped no.?") + ask("Whither?") * 256;
-			}
-			break;
-			}
-		}
-	} while (!false);
-}
-
-void editportals();
-const array<9, 15, char> codes1 = "9ABCDEF";
-
-static integer y2;
-
-
-static void display1() {
-	byte fv;
-	cleardevice();
-	settextstyle(0, 0, 2);
-	setcolor(15);
-	outtextxy(0, 0, "Portals.");
-	settextstyle(0, 0, 1);
-	for (fv = 9; fv <= 15; fv ++) {
-		y2 = fv * 10 - 53;
-		setcolor(fv);
-		outtextxy(100, y2, string('$') + codes1[fv - 1]);
-		{
-			magictype &with = portals[fv];
-			switch (with.op) {
-			case nix: {
-				setcolor(8);
-				outtextxy(140, y2, "Nix");
-			}
-			break;
-			case exclaim: {
-				setcolor(14);
-				outtextxy(143, y2, string("Exclaim: ") + strf(with.data));
-			}
-			break;
-			case transport: {
-				setcolor(12);
-				outtextxy(143, y2, string("Transport to ") + strf(hi(with.data)) +
-				          ", ped " + strf(lo(with.data)));
-			}
-			break;
-			case unfinished: {
-				setcolor(15);
-				outtextxy(143, y2, "*** UNFINISHED! ***");
-			}
-			break;
-			case special: {
-				setcolor(6);
-				outtextxy(143, y2, string("Special call no. ") + strf(with.data));
-			}
-			break;
-			case opendoor: {
-				setcolor(11);
-				outtextxy(143, y2, string("Opening door to ") + strf(hi(with.data)) +
-				          ", ped " + strf(lo(with.data)));
-			}
-			break;
-			}
-		}
-	}
-	outtextxy(177, 190, "Which do you want to change\? (Esc=Exit) $");
-}
-
-
-
-static word ask1(string x) {
-	string q;
-	word thomaswashere;
-	integer e;
-	word ask1_result;
-	cleardevice();
-	setcolor(10);
-	settextstyle(0, 0, 3);
-	outtextxy(0, 100, x);
-	do {
-		input >> q >> NL;
-		val(q, thomaswashere, e);
-	} while (!(e == 0));
-	ask1_result = thomaswashere;
-	return ask1_result;
-}
-
-void editportals() {   /* much t'same as editmagics */
-	char r, rr;
-	byte p;
-
-	do {
-		display1();
-		do {
-			r = upcase(readkey());
-			if (r == '\33')  return;
-			p = pos(r, codes1); /* which are we editing? */
-		} while (!(p > 0)); /* it must BE there... */
-		p += 8;
-		setcolor(p);
-		cleardevice();
-		outtextxy(177, 17, string("Editing portal $") + r + '.');
-		outtextxy(0, 30, "New operation ( (N)ix, (E)xclaim, (T)ransport, (U)nfinished),");
-		outtextxy(30, 40, "(S)pecial, (O)pening Door?");
-		do {
-			rr = upcase(readkey());
-		} while (!(set::of('N', 'E', 'T', 'U', 'S', 'O', '\33', eos).has(rr)));
-		{
-			magictype &with = portals[p];
-			switch (rr) {
-			case '\33':
-				return;
-				break; /* cancelling code */
-			case 'N':
-				with.op = nix;
-				break;
-			case 'E': {
-				with.op = exclaim;
-				with.data = ask1("Which scroll?");
-			}
-			break;
-			case 'T': {
-				with.op = transport;
-				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
-			}
-			break;
-			case 'U':
-				with.op = unfinished;
-				break;
-			case 'S': {
-				with.op = special;
-				with.data = ask1("Which call?");
-			}
-			break;
-			case 'O': {
-				with.op = opendoor;
-				with.data = ask1("Ped no.?") + ask1("Whither?") * 256;
-			}
-			break;
-			}
-		}
-	} while (!false);
-}
-
-void editflags() {
-	char r;
-	cleardevice();
-	settextstyle(0, 0, 2);
-	setcolor(15);
-	outtextxy(0, 0, "Flags.");
-	settextstyle(0, 0, 1);
-	setcolor(10);
-	outtextxy(100, 30, "Press the letter of the flag you want to toggle.");
-	outtextxy(100, 40, "Tab = flip screens, Esc/Enter = return to menu.");
-	setcolor(14);
-	setfillstyle(1, 0);
-	for (r = 'A'; r <= 'Z'; r ++)
-		if (pos(r, flags) > 0)  outtextxy(ord(r) * 20 - 1223, 77, r);
-	do {
-		do {
-			r = upcase(readkey());
-		} while (!(set::of(range('A', 'Z'), '\33', '\15', '\11', eos).has(r)));
-		switch (r) {
-		case RANGE_26('A', 'Z'): {
-			if (pos(r, flags) > 0) {
-				;     /* flag is on- switch it off */
-				Delete(flags, pos(r, flags), 1);
-				bar(ord(r) * 20 - 1223, 77, ord(r) * 20 - 1213, 87);
-				sound(1777);
-				delay(7);
-				nosound;
-			} else {
-				;     /* flag is off- switch it on */
-				flags = flags + r;
-				outtextxy(ord(r) * 20 - 1223, 77, r);
-				sound(177);
-				delay(7);
-				nosound;
-			}
-		}
-		break;
-		case '\33':
-		case '\15':
-			return;
-			break;
-		case '\11':
-			flipover();
-			break;
-		}
-	} while (!false);
-}
-
-void alsomenu() {
-	char r;
-	byte t;
-	do {
-		setactivepage(0);
-		setvisualpage(0);
-		cleardevice();
-		setcolor(15);
-		settextstyle(0, 0, 2);
-		outtextxy(0, 0, "Also... Main Menu");
-		settextstyle(0, 0, 1);
-		setcolor(10);
-		outtextxy(100, 40, "1) Edit the names of an object");
-		outtextxy(100, 50, "2) View all names");
-		outtextxy(100, 60, "3) Edit the description of this object");
-		outtextxy(100, 70, "4) View all associations.");
-		outtextxy(100, 80, "5) Enter Lino mode.");
-		outtextxy(100, 90, "6) Edit magics.");
-		outtextxy(100, 100, "7) Edit portals.");
-		outtextxy(100, 110, "8) Edit flags.");
-		outtextxy(100, 120, "9) Edit listen field.");
-		outtextxy(100, 160, "S) Save");
-		outtextxy(100, 170, "L) Load");
-		outtextxy(80, 180, "Tab) View other screen");
-		if (current == 0)  outtextxy(0, 140, "< Main description of room >");
-		else
-			outtextxy(0, 140, string('<') + names[current][1] + '>');
-		do {
-			r = upcase(readkey());
-			if (r == '\11')  flipover();
-		} while (!(set::of(range('1', '9'), 'S', 'L', '\0', eos).has(r)));
-		switch (r) {
-		case '1': {
-			do {
-				t = typeno("Which object\? (0-30)");
-			} while (!((t < 30) || (t == 255)));
-			if ((t != 255) && (t != 0))  names[t][1] = typein(names[t][1]);
-			current = t;
-		}
-		break;
-		case '2':
-			showallnames();
-			break;
-		case '3':
-			names[current][2] = typein(names[current][2]);
-			break;
-		case '4':
-			showallassoc();
-			break;
-		case '5':
-			lino();
-			break;
-		case '6':
-			editmagics();
-			break;
-		case '7':
-			editportals();
-			break;
-		case '8':
-			editflags();
-			break;
-		case '9':
-			listen = typein(listen);
-			break;
-		case 'S':
-			save();
-			break;
-		case 'L':
-			load();
-			break;
-		case '\0':
-			if (readkey() == '\55')  return;
-			break;
-		}
-	} while (!false);
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	output << "*** ALSO ***" << NL;
-	output << NL;
-	output << "No. of screen to edit?";
-	input >> n >> NL;
-	load();
-	assign(f, "v:avalot.fnt");
-	reset(f);
-	f >> skinny;
-	close(f);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	current = 0;
-	loadscreen();
-	alsomenu();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor.cpp b/engines/avalanche/andexor.cpp
deleted file mode 100644
index 74b5967..0000000
--- a/engines/avalanche/andexor.cpp
+++ /dev/null
@@ -1,152 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* Trippancy IV - original file */
-#include "graph.h"
-
-namespace Avalanche {
-
-const integer taboo = cyan;
-
-struct adxtype {
-	varying_string<12> name; /* name of character */
-	byte num; /* number of pictures */
-	byte xl, yl; /* x & y lengths of pictures */
-	byte seq; /* how many in one stride */
-	word size; /* the size of all the pictures */
-};
-
-
-integer gd, gm;
-adxtype adx;
-matrix<1, 24, 0, 1, pointer> adxpic; /* the pictures themselves */
-untyped_file f;
-string x;
-byte n;
-
-void load(string nam) {
-	byte z;
-	array<1, 4, pointer> a;
-	untyped_file f;
-	word s;
-	varying_string<40> xxx;
-	string check;
-
-	assign(f, nam);
-	reset(f, 1);
-	blockread(f, xxx, 41);
-	blockread(f, check, 13);
-	blockread(f, check, 31);
-	s = imagesize(0, 0, getmaxx(), 75);
-	for (z = 1; z <= 2; z ++) {
-		getmem(a[z], s);
-		blockread(f, a[z], s);
-		putimage(0, 15 + (z - 1) * 75, a[z], 0);
-		freemem(a[z], s);
-	}
-	close(f);
-}
-
-void silhouette() {
-	byte x, y, c;
-	setvisualpage(1);
-	setactivepage(1);
-	setfillstyle(1, 15);
-	for (gm = 0; gm <= 3; gm ++)
-		for (gd = 1; gd <= 6; gd ++) {
-			;     /* 26,15 */
-			/*   bar((gm div 2)*320+gd*40,20+(gm mod 2)*40,(gm div 2)*320+gd*40+35,(gm mod 2)*40+60); */
-			for (y = 1; y <= adx.yl; y ++)
-				for (x = 1; x <= adx.xl; x ++) {
-					setactivepage(0);
-					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
-					setactivepage(1);
-					/*     if c<>taboo then putpixel((gm div 2)*320+gd*40+x,20+(gm mod 2)*40+y,0); */
-					if (c == taboo)  putpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y, 15);
-				}
-			getmem(adxpic[gm * 6 + gd][0], adx.size);
-			getimage((gm / 2) * 320 + gd * 40 + 1, 20 + (gm % 2) * 40 + 1,
-			         (gm / 2) * 320 + gd * 40 + adx.xl, 20 + (gm % 2) * 40 + adx.yl,
-			         adxpic[gm * 6 + gd][0]);
-		}
-}
-
-void standard() {
-	byte x, y, c;
-	setvisualpage(2);
-	setactivepage(2);
-	for (gm = 0; gm <= 3; gm ++)
-		for (gd = 1; gd <= 6; gd ++) {
-			;     /* 26,15 */
-			for (y = 1; y <= adx.yl; y ++)
-				for (x = 1; x <= adx.xl; x ++) {
-					setactivepage(0);
-					c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
-					setactivepage(2);
-					if (c != taboo)  putpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y, c);
-				}
-			getmem(adxpic[gm * 6 + gd][1], adx.size);
-			getimage((gm / 2) * 320 + gd * 40 + 1, 20 + (gm % 2) * 40 + 1,
-			         (gm / 2) * 320 + gd * 40 + adx.xl, 20 + (gm % 2) * 40 + adx.yl,
-			         adxpic[gm * 6 + gd][1]);
-		}
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "");
-	fillchar(adxpic, sizeof(adxpic), '\261');
-	load("v:avalots.avd");
-	/* getmem(adxpic[1,1,1],adx.size); getimage(40,20,75,60,adxpic[1,1,1]^);
-	 putimage(100,100,adxpic[1,1,1]^,0); */
-	{
-		adx.name = "Avalot";
-		adx.num = 24;
-		adx.seq = 6;
-		adx.xl = 32;
-		adx.yl = 35; /* 35,40 */
-
-		adx.size = imagesize(40, 20, 40 + adx.xl, 60 + adx.yl);
-	}
-	silhouette();
-	standard();
-	x = string("Sprite file for Avvy - Trippancy IV. Subject to copyright.") + '\32';
-	assign(f, "v:sprite1.avd");
-	rewrite(f, 1);
-	blockwrite(f, x[1], 59);
-	blockwrite(f, adx, sizeof(adx));
-	for (gd = 1; gd <= adx.num; gd ++)
-		for (gm = 0; gm <= 1; gm ++)
-			blockwrite(f, adxpic[gd][gm], adx.size); /* next image */
-	close(f);
-	closegraph();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andexor2.cpp b/engines/avalanche/andexor2.cpp
deleted file mode 100644
index 27c62cf..0000000
--- a/engines/avalanche/andexor2.cpp
+++ /dev/null
@@ -1,165 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* Trippancy IV - original file */
-#include "graph.h"
-
-namespace Avalanche {
-
-const integer taboo = cyan;
-
-struct adxtype {
-	varying_string<12> name; /* name of character */
-	byte num; /* number of pictures */
-	byte xl, yl; /* x & y lengths of pictures */
-	byte seq; /* how many in one stride */
-	word size; /* the size of all the pictures */
-	byte fgc, bgc; /* foreground & background bubble colours */
-};
-
-
-integer gd, gm;
-adxtype adx;
-array<0, 1, pointer> adxpic;   /* the pictures themselves */
-untyped_file f;
-string x;
-byte n;
-integer side2;
-word bigsize;
-
-void load(string n) {
-	byte z;
-	array<1, 4, pointer> a;
-	untyped_file f;
-	word s;
-	varying_string<40> xxx;
-	string check;
-
-	assign(f, n);
-	reset(f, 1);
-	blockread(f, xxx, 41);
-	blockread(f, check, 13);
-	blockread(f, check, 31);
-	s = imagesize(0, 0, getmaxx(), 75);
-	for (z = 1; z <= 2; z ++) {
-		getmem(a[z], s);
-		blockread(f, a[z], s);
-		putimage(0, 15 + (z - 1) * 75, a[z], 0);
-		freemem(a[z], s);
-	}
-	close(f);
-}
-
-void silhouette() {
-	byte x, y, c;
-	setvisualpage(1);
-	setactivepage(1);
-	setfillstyle(1, 15);
-	{
-		for (gm = 0; gm <= 3; gm ++)
-			for (gd = 1; gd <= 6; gd ++) {
-				;     /* 26,15 */
-				side2 = adx.xl * 6;
-				for (y = 1; y <= adx.yl; y ++)
-					for (x = 1; x <= adx.xl; x ++) {
-						setactivepage(0);
-						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
-						setactivepage(1);
-						if (c == taboo)
-							putpixel((gm / 2)*side2 + gd * adx.xl + x, 20 + (gm % 2)*adx.yl + y, 15);
-					}
-			}
-		bigsize = imagesize(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2);
-		getmem(adxpic[0], bigsize);
-		getimage(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2, adxpic[0]);
-		putimage(adx.xl + 1, 21, adxpic[0], notput);
-	}
-}
-
-void standard() {
-	byte x, y, c;
-	setvisualpage(2);
-	setactivepage(2);
-	{
-		for (gm = 0; gm <= 3; gm ++)
-			for (gd = 1; gd <= 6; gd ++) {
-				;     /* 26,15 */
-				for (y = 1; y <= adx.yl; y ++)
-					for (x = 1; x <= adx.xl; x ++) {
-						setactivepage(0);
-						c = getpixel((gm / 2) * 320 + gd * 40 + x, 20 + (gm % 2) * 40 + y);
-						setactivepage(2);
-						if (c != taboo)
-							putpixel((gm / 2)*side2 + gd * adx.xl + x, 20 + (gm % 2)*adx.yl + y, c);
-					}
-				/*    getmem(adxpic[gm*6+gd,1],adx.size);
-				    getimage((gm div 2)*side2+gd*xl+x,20+(gm mod 2)*yl+y,
-				       (gm div 2)*side2+gd*xl*2+x,20+(gm mod 2)*yl*2+y,
-				       adxpic[gm*6+gd,1]^); */
-			}
-		getmem(adxpic[1], bigsize);
-		getimage(adx.xl + 1, 21, adx.xl * 13, 20 + adx.yl * 2, adxpic[1]);
-		putimage(adx.xl + 1, 21, adxpic[1], notput);
-	}
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "");
-	fillchar(adxpic, sizeof(adxpic), '\261');
-	load("v:avalots.avd");
-	{
-		adx.name = "Avalot";
-		adx.num = 24;
-		adx.seq = 6;
-		adx.xl = 33;
-		adx.yl = 35; /* 35,40 */
-		adx.fgc = yellow;
-		adx.bgc = red;
-
-		adx.size = imagesize(40, 20, 40 + adx.xl, 60 + adx.yl);
-	}
-	silhouette();
-	standard();
-	x = string("Sprite file for Avvy - Trippancy IV. Subject to copyright.") + '\32';
-	assign(f, "v:sprite1.avd");
-	rewrite(f, 1);
-	blockwrite(f, x[1], 59);
-	blockwrite(f, adx, sizeof(adx));
-	blockwrite(f, bigsize, 2);
-	for (gm = 0; gm <= 1; gm ++) {
-		putimage(0, 0, adxpic[gm], 0);
-		blockwrite(f, adxpic[gm], bigsize); /* next image */
-	}
-	close(f);
-	closegraph();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/andextst.cpp b/engines/avalanche/andextst.cpp
deleted file mode 100644
index 39ba3df..0000000
--- a/engines/avalanche/andextst.cpp
+++ /dev/null
@@ -1,100 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-
-namespace Avalanche {
-
-typedef matrix<1, 24, 0, 1, pointer> adxtype;
-
-integer gd, gm;
-word s;
-untyped_file f;
-byte n, anim, cp, t;
-array<0, 0, adxtype> adx;
-array<0, 1, pointer> back;
-integer x;
-array<0, 1, integer> ox;
-
-void andex(integer x, integer y, byte n, byte num) {
-	putimage(x, y, adx[num][n][0], andput);
-	putimage(x, y, adx[num][n][1], xorput);
-}
-
-void loadadx(byte num, string x) {
-	byte n;
-	assign(f, x);
-	reset(f, 1);
-	seek(f, 59);
-	blockread(f, n, 1); /* No. of images... */
-	for (gd = 1; gd <= n; gd ++)
-		for (gm = 0; gm <= 1; gm ++) {
-			blockread(f, s, 2); /* size of next image... */
-			getmem(adx[num][gd][gm], s);
-			blockread(f, adx[num][gd][gm], s); /* next image */
-		}
-	close(f);
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	loadadx(0, "d:sprite0.avd");
-	loadadx(1, "d:sprite0.avd");
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "");
-	for (gd = 0; gd <= 1; gd ++) {
-		setactivepage(gd);
-		setfillstyle(6, 1);
-		bar(0, 0, 640, 200);
-		getmem(back[gd], s);
-	}
-	x = 0;
-	anim = 1;
-	cp = 0;
-	t = 2;
-	setactivepage(0);
-	do {
-		setactivepage(cp);
-		setvisualpage(1 - cp);
-		for (gm = 0; gm <= 1; gm ++) {
-			if (t > 0)  t -= 1;
-			else
-				putimage(ox[cp], 77, back[cp], copyput);
-			getimage(x, 77, x + 31, 77 + 35, back[cp]);
-			andex(x, 177, anim + 6, gm);
-			ox[gm][cp] = x;
-			x += 5;
-		}
-		anim += 1;
-		if (anim == 7)  anim = 1;
-		cp = 1 - cp;
-	} while (!false);
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.cpp b/engines/avalanche/arch.cpp
deleted file mode 100644
index 1f0e1a4..0000000
--- a/engines/avalanche/arch.cpp
+++ /dev/null
@@ -1,146 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 ENID             Edna's manager. */
-
-#define __arch_implementation__
-/* Loads/ saves files. */
-
-#include "arch.h"
-
-
-/*#include "Dos.h"*/
-#include "scrolls.h"
-
-namespace Avalanche {
-
-struct ednahead { /* Edna header */
-	/* This header starts at byte offset 177 in the .ASG file. */
-	array<1, 9, char> id;   /* signature */
-	word revision; /* EDNA revision, here 2 (1=dna256) */
-	varying_string<50> game; /* Long name, eg Lord Avalot D'Argent */
-	varying_string<15> shortname; /* Short name, eg Avalot */
-	word number; /* Game's code number, here 2 */
-	word ver; /* Version number as integer (eg 1.00 = 100) */
-	varying_string<5> verstr; /* Vernum as string (eg 1.00 = "1.00" */
-	varying_string<12> filename; /* Filename, eg AVALOT.EXE */
-	byte os; /* Saving OS (here 1=DOS. See below for others.) */
-
-	/* Info on this particular game */
-
-	varying_string<8> fn; /* Filename (not extension ('cos that's .ASG)) */
-	byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
-	word y;  /* ...saved on. */
-	varying_string<40> desc; /* Description of game (same as in Avaricius!) */
-	word len; /* Length of DNA (it's not going to be above 65535!) */
-
-	/* Quick reference & miscellaneous */
-
-	word saves; /* no. of times this game has been saved */
-	integer cash; /* contents of your wallet in numerical form */
-	varying_string<20> money; /* ditto in string form (eg 5/-, or 1 denarius)*/
-	word points; /* your score */
-
-	/* DNA values follow, then footer (which is ignored) */
-};
-/* Possible values of edhead.os:
-   1 = DOS        4 = Mac
-   2 = Windows    5 = Amiga
-   3 = OS/2       6 = ST */
-const string crlf = string('\15') + '\12';
-
-const array<1, 177, char> ednafirst =
-    string("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + crlf +
-    '\32' + /* 67 bytes... */
-    crlf + crlf + /* 71 bytes... */
-    "12345678901234567890123456789012345678901234567890" +
-    "12345678901234567890123456789012345678901234567890" +
-    "123456";
-
-const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
-const string ednaid = string("TT") + '\261' + '\60' + '\1' + '\165' + '\261' + '\231' + '\261';
-
-const integer ttage = 18;
-const char ttwashere[] = "Thomas was here ";
-
-void save(string name) {
-	untyped_file f;
-	edhead eh;
-	word groi;
-	string groi2;
-	fillchar(eh, sizeof(eh), '\261'); /* Fill up the edhead */
-
-	dna.saves += 1; /* It's been saved one more time... */
-
-	{
-
-		/* Info about this program */
-
-		id = ednaid; /* Edna's signature */
-		revision = 2; /* Second revision of .ASG format */
-		game = "Lord Avalot d'Argent"; /* Title of game */
-		shortname = "Avalot";
-		number = 2; /* Second Avvy game */
-		ver = 100; /* Version 1.00 */
-		verstr = "1.00"; /* ditto */
-		filename = "AVALOT.EXE"; /* program's filename */
-		os = 1; /* Saved under DOS */
-
-		/* Info on this particular game */
-
-		fsplit(name, groi2, fn, groi2); /* fn = filename of this game */
-		getdate(d, m, y, groi); /* Day, month & year when the game was saved */
-		desc = roomname; /* Description of game (same as in Avaricius!) */
-		len = sizeof(dna); /* Length of DNA (it's not going to be above 65535!) */
-
-		/* Quick reference & miscellaneous */
-
-		saves = dna.saves; /* no. of times this game has been saved */
-		cash = dna.pence; /* contents of your wallet in numerical form */
-		money = lsd(); /* ditto in string form (eg 5/-, or 1 denarius)*/
-		points = dna.score; /* your score */
-	}
-
-	assign(f, name);
-	rewrite(f, 1);
-
-	blockwrite(f, ednafirst, 177);
-	blockwrite(f, eh, sizeof(eh));
-	blockwrite(f, dna, sizeof(dna));
-
-	for (groi = 1; groi <= ttage; groi ++)
-		blockwrite(f, ttwashere, sizeof(ttwashere));
-
-	close(f);
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/arch.h b/engines/avalanche/arch.h
deleted file mode 100644
index 3bff07a..0000000
--- a/engines/avalanche/arch.h
+++ /dev/null
@@ -1,40 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __arch_h__
-#define __arch_h__
-
-
-#include "gyro.h"
-
-namespace Avalanche {
-
-void save(string name);
-
-} // End of namespace Avalanche.
-
-#endif
diff --git a/engines/avalanche/avalot9.cpp b/engines/avalanche/avalot9.cpp
deleted file mode 100644
index 7351d08..0000000
--- a/engines/avalanche/avalot9.cpp
+++ /dev/null
@@ -1,174 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 AVALOT           The kernel of the program. */
-
-
-#include "graph.h"
-/*#include "Crt.h"*/
-/*#include "Trip5.h"*/
-/*#include "Gyro.h"*/
-/*#include "Lucerna.h"*/
-/*#include "Scrolls.h"*/
-/*#include "Basher.h"*/
-/*#include "Dropdown.h"*/
-/*#include "Pingo.h"*/
-/*#include "Logger.h"*/
-/*#include "Timeout.h"*/
-/*#include "Celer.h"*/
-/*#include "Enid.h"*/
-/*#include "Incline.h"*/
-/*#include "Closing.h"*/
-/*#include "Visa.h"*/
-
-
-namespace Avalanche {
-
-void setup() {
-	integer gd, gm;
-
-	checkbreak = false;
-	visible = m_no;
-	to_do = 0;
-	lmo = false;
-	resetscroll;
-	Randomize();
-	setup_vmc;
-	on_virtual;
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "");
-	holdthedawn = true;
-	dusk;
-	cmp = 177;
-	mouse_init;  /*on;*/ dropsok = true;
-	ctrl = ckey;
-	oldjw = 177;
-	mousetext = "";
-	c = 999;
-	settextjustify(0, 0);
-	ddmnow = false;
-	load_digits;
-	cheat = false;
-	cp = 0;
-	curpos = 1;
-	quote = true;
-	ledstatus = 177;
-	defaultled = 2;
-	/* TSkellern:=0; { Replace with a more local variable sometime }*/
-	dna.rw = stopped;
-	enid_filename = ""; /* undefined. */
-	toolbar;
-	state(2);
-	copy03;
-	lastscore = "TJA";
-
-	/* for gd:=0 to 1 do
-	 begin
-	  setactivepage(gd); outtextxy(7,177,chr(48+gd));
-	 end;*/
-
-	loadtrip;
-
-	if ((filetoload == "") & (~ reloaded))
-		newgame; /* no game was requested- load the default */
-	else {
-		if (~ reloaded)  avvy_background;
-		standard_bar;
-		sprite_run;
-		if (reloaded)  edna_reload;
-		else {
-			/* Filename given on the command line (or loadfirst) */
-			edna_load(filetoload);
-			if (there_was_a_problem) {
-				display("So let's start from the beginning instead...");
-				holdthedawn = true;
-				dusk;
-				newgame;
-			}
-		}
-	}
-
-	if (~ reloaded) {
-		soundfx = ~ soundfx;
-		fxtoggle;
-		thinkabout(money, a_thing);
-	}
-
-	get_back_loretta;
-	gm = getpixel(0, 0);
-	setcolor(7);
-	holdthedawn = false;
-	dawn;
-	cursoron = false;
-	cursor_on;
-	newspeed;
-
-	if (~ reloaded)
-		dixi('q', 83); /* Info on the game, etc. */
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	setup();
-
-	do {
-
-		clock;
-		keyboard_link;
-		menu_link;
-		readstick;
-		force_numlock;
-		get_back_loretta;
-		trippancy_link;
-		pics_link;
-		checkclick;
-
-		if (visible == m_virtual)  plot_vmc(mx, my, cp);
-		flip_page; /* <<<! */
-		slowdown;
-		if (visible == m_virtual)  wipe_vmc(cp);
-
-		one_tick;
-
-	} while (!lmo);
-
-	restorecrtmode();
-	if (logging)  close(logfile);
-
-	end_of_program;
-	return EXIT_SUCCESS;
-}
-
-/*  typein; commanded; last:=current; */
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avbkgrnd.cpp b/engines/avalanche/avbkgrnd.cpp
deleted file mode 100644
index 2bb6288..0000000
--- a/engines/avalanche/avbkgrnd.cpp
+++ /dev/null
@@ -1,118 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-
-
-namespace Avalanche {
-
-integer gd, gm;
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	/* Screen size: Starts at $A000:$320 (coords 0,10).
-	Length: 12000 (150*80) bytes.
-	If we divide it into sets of 5 lines (400 bytes) each, there are 30.
-	There are 40 words on a line.
-
-	Patterns:
-	 4AAA = "AVVY"
-	 AAAE
-	 EAA4
-	 A444
-
-	 A4AA = "YAVV"
-	 AEAA
-	 4EAA
-	 4A44 */
-	/*
-	 asm
-	  mov bx,$A000;
-	  mov es,bx; { The segment to copy it to... }
-	  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
-
-	  mov cx,10;
-	  mov ax,$AA4A; call @sameline; { Print "AVVY" }
-	  mov ax,$AEAA; call @sameline;
-	  mov ax,$A4EA; call @sameline;
-	  mov ax,$44A4; call @sameline;
-
-	  mov cx,9;
-	  mov ax,$AAA4; call @sameline; { Print "YAVV" }
-	  mov ax,$AAEA; call @sameline;
-	  mov ax,$AA4E; call @sameline;
-	  mov ax,$444A; call @sameline;
-
-	  mov ax,$4AAA; call @sameline; { Print "VYAV" }
-	  mov ax,$AAAE; call @sameline;
-	  mov ax,$EAA4; call @sameline;
-	  mov ax,$A444; call @sameline;
-
-	  mov ax,$A4AA; call @sameline; { Print "VVYA" }
-	  mov ax,$EAAA; call @sameline;
-	  mov ax,$4EAA; call @sameline;
-	  mov ax,$4A44; call @sameline;
-
-	  jmp @the_end;
-
-	  { Replicate the same line many times. }
-
-	  @sameline:
-	   { Requires:
-	      what to copy in AX,
-	      how many lines in CX, and
-	      original offset in DI. }
-	   push cx;
-	   push di;
-
-	   @samelineloop:
-
-	    push cx;
-	    mov cx,40; { No. of times to repeat it on one line. }
-
-	    repz stosw; { Fast word-copying }
-
-	    pop cx;
-
-	    add di,1200; { The next one will be 16 lines down. }
-
-	   loop @samelineloop;
-	   pop di;
-	   add di,80;
-	   pop cx;
-
-	   ret;
-
-	  @the_end:
-	 end;
-	*/
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avmenu.cpp b/engines/avalanche/avmenu.cpp
deleted file mode 100644
index 9e956f9..0000000
--- a/engines/avalanche/avmenu.cpp
+++ /dev/null
@@ -1,348 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Crt.h"*/
-/*#include "Tommys.h"*/
-
-namespace Avalanche {
-
-typedef matrix < '\0', '\377', 0, 15, byte > fonttype;
-
-fonttype font;
-word storage_seg, storage_ofs;
-byte result;
-string registrant;
-
-void icons() {
-	untyped_file f;
-	word gd, gm;
-	byte bit;
-	byte v;
-
-	assign(f, "menu.avd");
-	reset(f, 1);
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (gd = 70; gd <= 266; gd ++)
-			blockread(f, mem[0xa000 * gd * 80 + 6], 9);
-
-		for (gd = 0; gd <= 32; gd ++) {
-			blockread(f, v, 1);
-			for (gm = 0; gm <= 5; gm ++)
-				mem[0xa000 * 73 + ((70 + gd + gm * 33) * 80)] = v; /* 79 */
-		}
-
-	}
-	close(f);
-
-	bit = getpixel(0, 0);
-
-	setfillstyle(1, 7);
-	for (gd = 0; gd <= 5; gd ++) bar(114, 73 + gd * 33, 583, 99 + gd * 33);
-	setfillstyle(1, 15);
-	for (gd = 0; gd <= 5; gd ++) bar(114, 70 + gd * 33, 583, 72 + gd * 33);
-	setfillstyle(1, 8);
-	for (gd = 0; gd <= 5; gd ++) bar(114, 100 + gd * 33, 583, 102 + gd * 33);
-
-}
-
-void load_regi_info();
-
-
-static char decode1(char c) {
-	byte b;
-
-	char decode1_result;
-	b = ord(c) - 32;
-	decode1_result = chr(((b & 0xf) << 3) + ((cardinal)(b & 0x70) >> 4));
-	return decode1_result;
-}
-
-
-
-static char decode2(char c) {
-	char decode2_result;
-	decode2_result = chr(((ord(c) & 0xf) << 2) + 0x43);
-	return decode2_result;
-}
-
-
-
-static boolean checker(string proper, string check) {
-	byte fv;
-	boolean ok;
-
-	boolean checker_result;
-	ok = true;
-	for (fv = 1; fv <= length(proper); fv ++)
-		if ((ord(proper[fv]) & 0xf) != ((cardinal)(ord(check[fv]) - 0x43) >> 2))
-			ok = false;
-
-	checker_result = ok;
-	return checker_result;
-}
-
-void load_regi_info() {
-	text t;
-	byte fv;
-	string x;
-	byte namelen, numlen;
-	string namechk, numchk;
-	string reginum;
-
-
-	/*$I-*/
-	assign(t, "register.dat");
-	reset(t);
-	/*$I+*/
-
-	if (ioresult != 0) {
-		registrant = "(Unregistered evaluation copy.)";
-		return;
-	}
-
-	for (fv = 1; fv <= 53; fv ++) t >> NL;
-	t >> x >> NL;
-	close(t);
-
-	namelen = 107 - ord(x[1]);
-	numlen = 107 - ord(x[2]);
-
-	registrant = copy(x, 3, namelen);
-	reginum = copy(x, 4 + namelen, numlen);
-	namechk = copy(x, 4 + namelen + numlen, namelen);
-	numchk = copy(x, 4 + namelen + numlen + namelen, numlen);
-
-	for (fv = 1; fv <= namelen; fv ++) registrant[fv] = decode1(registrant[fv]);
-	for (fv = 1; fv <= numlen; fv ++) reginum[fv] = decode1(reginum[fv]);
-
-	if ((! checker(registrant, namechk)) || (! checker(reginum, numchk)))
-		registrant = "\?\"!\? ((.)";
-	else
-		registrant = registrant + " (" + reginum + ").";
-
-}
-
-void flesh_colours() {
-	;        /* assembler;
-asm
-  mov ax,$1012;
-  mov bx,21;                 { 21 = light pink (why?) */
-	/* mov cx,1;
-	mov dx,seg    @flesh;
-	mov es,dx;
-	mov dx,offset @flesh;
-	int $10;
-
-	mov dx,seg    @darkflesh;
-	mov es,dx;
-	mov dx,offset @darkflesh;
-	mov bx,5;                 { 5 = dark pink. */
-	/*int $10;
-
-	jmp @TheEnd;
-
-	@flesh:
-	db 56,35,35;
-
-	@darkflesh:
-	db 43,22,22;
-
-	@TheEnd: */
-}
-
-void setup() {
-	integer gd, gm;
-	file<fonttype> ff;
-
-	if (paramstr(1) != "jsb")  exit(255);
-	checkbreak = false;
-	val(paramstr(2), storage_seg, gd);
-	val(paramstr(3), storage_ofs, gd);
-
-	assign(ff, "avalot.fnt");
-	reset(ff);
-	ff >> font;
-	close(ff);
-
-	gd = 3;
-	gm = 1;
-	initgraph(gd, gm, "");
-	setvisualpage(1);
-
-	icons();
-}
-
-void big(word x, word y, string z, boolean notted);
-static word start, image;
-
-
-static void generate(byte from, boolean &notted) {
-	byte fv;
-
-	image = 0;
-	for (fv = 0; fv <= 7; fv ++)
-		image += (from & (1 << fv)) << fv;
-
-	image += image << 1;
-	image = hi(image) + lo(image) * 256;
-	if (notted)  image = ~ image;
-}
-
-void big(word x, word y, string z, boolean notted) {
-	byte fv, ff;
-	byte bit;
-
-	start = x + y * 80;
-
-	for (fv = 1; fv <= length(z); fv ++) {
-		for (ff = 1; ff <= 12; ff ++) {
-			generate(font[z[fv]][ff + 1], notted);
-			for (bit = 0; bit <= 2; bit ++) {
-				port[0x3c4] = 2;
-				port[0x3ce] = 4;
-				port[0x3c5] = 1 << bit;
-				port[0x3cf] = bit;
-				memw[0xa000 * start +   ff * 160] = image;
-				memw[0xa000 * start + 80 + ff * 160] = image;
-			}
-		}
-		start += 2;
-	}
-	bit = getpixel(0, 0);
-}
-
-void centre(integer y, string z) {
-	big(40 - (length(z)), y, z, false);
-}
-
-void option(byte which, string what) {
-	big(16, 41 + which * 33, string((char)(which + 48)) + ')', true);
-	big(24, 41 + which * 33, what, true);
-}
-
-void invert(integer x1, integer y1, integer x2, integer y2) {
-	word s;
-	pointer p;
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-	putimage(x1, y1, p, 4);
-	sound(y1);
-	delay(30);
-	sound(600 - y2);
-	delay(20);
-	nosound;
-	delay(200);
-	putimage(x1, y1, p, 0);
-	delay(250);
-}
-
-void wait() {
-	word x;
-	char r;
-	boolean pressed;
-
-	x = 0;
-	pressed = false;
-	do {
-		setfillstyle(6, 15);
-		bar(x  , 330, x - 1, 337);
-		setfillstyle(1, 0);
-		bar(x - 2, 330, x - 3, 337);
-		delay(40);
-		x += 1;
-
-		if (keypressed()) {
-			r = readkey();
-			if (r == '\0') {
-				r = readkey(); /* and...? */
-			} else {
-				/* Not an extended keystroke. */
-				if (set::of(range('1', '6'), cspace, cescape, creturn, eos).has(r))  pressed = true;
-			}
-		}
-
-	} while (!((x == 640) || pressed));
-
-	if ((r == cspace) || (r == creturn))  r = '1';
-	if (r == cescape)  r = '6';
-	if (pressed) {
-		result = ord(r) - 48;
-		invert(48, 37 + result * 33, 114, 69 + result * 33);
-	} else result = 177;
-}
-
-void show_up() {
-	setvisualpage(0);
-}
-
-void loadmenu() {
-	untyped_file f;
-	byte bit;
-
-	assign(f, "mainmenu.avd");
-	reset(f, 1);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, mem[0xa000 * 0], 59 * 80);
-	}
-	close(f);
-	bit = getpixel(0, 0);
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	setup();
-	loadmenu();
-	load_regi_info();
-	option(1, "Play the game.");
-	option(2, "Read the background.");
-	option(3, "Preview... perhaps...");
-	option(4, "View the documentation.");
-	option(5, "Registration info.");
-	option(6, "Exit back to DOS.");
-	centre(275, registrant);
-	centre(303, "Make your choice, or wait for the demo.");
-
-	show_up();
-	wait();
-	mem[storage_seg * storage_ofs] = result;
-	closegraph();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans.cpp b/engines/avalanche/avvyans.cpp
deleted file mode 100644
index 8e08760..0000000
--- a/engines/avalanche/avvyans.cpp
+++ /dev/null
@@ -1,130 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-integer gd, gm;
-untyped_file f;
-array<1, 16000, byte> aa;
-matrix<0, 27, 0, 35, byte> cols;
-text t;
-string x;
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	fillchar(cols, sizeof(cols), '\0');
-	assign(f, "v:avvypic.ptx");
-	reset(f, 1);
-	blockread(f, aa, filesize(f));
-	close(f);
-	putimage(0, 0, aa, 0);
-	for (gd = 0; gd <= 27; gd ++)
-		for (gm = 0; gm <= 34; gm ++)
-			cols[gd][gm + 1] = getpixel(gd, gm);
-
-	restorecrtmode();
-	/*
-	   asm
-	      mov ax,$1003
-	      mov bl,0
-	      int $10
-	   end;
-	*/
-	for (gm = 0; gm <= 17; gm ++)
-		for (gd = 0; gd <= 27; gd ++) {
-			gotoxy(gd + 1, gm + 1);
-			if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
-				textattr = cols[gd][2 * gm];
-				output << 'Û';
-			} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
-				textattr = cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16;
-				output << 'ß';
-			} else {
-				textattr = cols[gd][2 * gm] * 16 + cols[gd][2 * gm + 1];
-				if (textattr > blink)  textattr -= blink;
-				output << 'Ü';
-			}
-		}
-	gotoxy(23, 5);
-	textattr = red;
-	output << 'ß';
-
-	assign(t, "v:avalot.txt");
-	reset(t);
-	textattr = 9;
-	gm = 2;
-	do {
-		gm += 1;
-		t >> x >> NL;
-		gotoxy(30, gm);
-		output << x << NL;
-	} while (!(eof(t)));
-
-	textattr = 7;
-	gotoxy(35, 2);
-	output << "Back in good old A.D. ";
-	textattr = 15;
-	output << "1176";
-	textattr = 7;
-	output << "...";
-	textattr = 9;
-	gotoxy(40, 4);
-	output << "Lord";
-	gotoxy(67, 9);
-	output << "d'Argent";
-	textattr = yellow;
-	gotoxy(37, 12);
-	output << "He's back...";
-	gotoxy(47, 14);
-	output << "And this time,";
-	gotoxy(52, 15);
-	output << "he's wearing tights...";
-	textattr = 4;
-	gotoxy(36, 17);
-	output << "A Thorsoft of Letchworth game. * Requires EGA";
-	gotoxy(38, 18);
-	output << "and HD. * By Mike, Mark and Thomas Thurman.";
-	gotoxy(40, 19);
-	output << "Sfx archive- ";
-	textattr = 9;
-	output << "Download ";
-	textattr = 14;
-	output << "AVLT10.EXE";
-	textattr = 9;
-	output << " now!";
-	gotoxy(1, 1);
-	input >> NL;
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvyans2.cpp b/engines/avalanche/avvyans2.cpp
deleted file mode 100644
index fe238b3..0000000
--- a/engines/avalanche/avvyans2.cpp
+++ /dev/null
@@ -1,230 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Crt.h"*/
-/*#include "Ansi.h"*/
-
-namespace Avalanche {
-
-integer gd, gm;
-untyped_file f;
-array<1, 16000, byte> aa;
-matrix<0, 27, 0, 35, byte> cols;
-text t;
-string x;
-byte n;
-byte spaces;
-byte cfg, cbg; /* Current foreground & background. */
-byte ofg, obg; /* Old fg & bg. */
-
-void do_spaces() {
-	if (spaces == 0)  return;
-	along(spaces);
-	spaces = 0;
-}
-
-void finishline();
-static byte wx, wy;
-
-static void jumpto(byte xx) {
-	along(xx - wx);
-}
-
-void finishline() {
-	wx = 29 - spaces;
-	wy = gm + 1;
-	switch (wy) {
-	case 1: {
-		sgr(7);
-		jumpto(35);
-		output << "Back in good old A.D. ";
-		sgr(15);
-		output << "1189";
-		sgr(7);
-		output << "..." << NL;
-		cfg = 7;
-	}
-	break;
-	case RANGE_5(3, 7): {
-		t >> x >> NL;
-		while (x[length(x)] == '\40')  x[0] -= 1;
-		if (x != "") {
-			jumpto(30);
-			sgr(9);
-			spaces = 0;
-			while (x != "") {
-				if (x[1] == ' ')
-					spaces += 1;
-				else {
-					do_spaces();
-					output << x[1];
-				}
-				Delete(x, 1, 1);
-			}
-			if (wy == 7)  close(t);
-			output << NL;
-		}
-	}
-	break;
-	case 8: {
-		jumpto(67);
-		sgr(9);
-		output << "d'Argent" << NL;
-		cfg = 9;
-	}
-	break;
-	case 11: {
-		jumpto(37);
-		sgr(14);
-		output << "He's back..." << NL;
-	}
-	break;
-	case 13: {
-		jumpto(47);
-		sgr(14);
-		output << "And this time," << NL;
-	}
-	break;
-	case 14: {
-		jumpto(52);
-		sgr(14);
-		output << "he's wearing tights..." << NL;
-	}
-	break;
-	case 16: {
-		jumpto(35);
-		sgr(4);
-		output << "A Thorsoft of Letchworth game. * Requires EGA" << NL;
-	}
-	break;
-	case 17: {
-		jumpto(37);
-		sgr(4);
-		output << "and HD. * By Mike, Mark and Thomas Thurman." << NL;
-	}
-	break;
-	case 18: {
-		jumpto(39);
-		sgr(4);
-		output << "Sfx archive- ";
-		sgr(9);
-		output << "Download ";
-		sgr(14);
-		output << "AVLT10.EXE";
-		sgr(9);
-		output << " now!";
-	}
-	break;
-	default:
-		output << NL;
-	}
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	fillchar(cols, sizeof(cols), '\0');
-	assign(f, "v:avvypic.ptx");
-	reset(f, 1);
-	blockread(f, aa, filesize(f));
-	close(f);
-	putimage(0, 0, aa, 0);
-	for (gd = 0; gd <= 27; gd ++)
-		for (gm = 0; gm <= 34; gm ++)
-			cols[gd][gm + 1] = getpixel(gd, gm);
-
-	restorecrtmode();
-
-	assign(output, "v:avalot.ans");
-	rewrite(output);
-	normal;
-	ed;
-	/* assign(output,''); rewrite(output); normal; ed;*/
-	assign(t, "v:avalot.txt");
-	reset(t);
-
-	for (gm = 0; gm <= 17; gm ++) {
-		spaces = 0;
-		for (gd = 0; gd <= 27; gd ++) {
-			if ((gd == 22) && (gm == 4)) {
-				do_spaces();
-				sgr(red);
-				output << 'ß';
-			} else {
-				if (cols[gd][2 * gm] == cols[gd][2 * gm + 1]) {
-					if (cols[gd][2 * gm] == 0)
-						spaces += 1; /* a blank space */
-					else {
-						do_spaces();
-
-						if (cfg == cols[gd][2 * gm])  output << 'Û';
-						else if (cbg == cols[gd][2 * gm])  output << ' ';
-						else {
-							sgr((cols[gd][2 * gm]) + (cbg * 16));
-							cfg = cols[gd][2 * gm];
-							output << 'Û';
-						}
-					}
-				} else if ((cols[gd][2 * gm] > 7) && (cols[gd][2 * gm + 1] < 8)) {
-					do_spaces();
-					sgr(cols[gd][2 * gm] + cols[gd][2 * gm + 1] * 16);
-					cfg = cols[gd][2 * gm];
-					cbg = cols[gd][2 * gm + 1] * 16;
-					output << 'ß';
-				} else {
-					do_spaces();
-
-					ofg = cfg;
-					obg = cbg;
-					cbg = cols[gd][2 * gm];
-					cfg = cols[gd][2 * gm + 1];
-
-					if ((cbg == ofg) && (cfg == obg)) {
-						n = cfg * 16 + cbg;
-						if (n > 128)  n -= 128;
-						output << 'ß';
-					} else {
-						n = cbg * 16 + cfg;
-						if (n > 128)  n -= 128;
-						if ((cfg != ofg) || (cbg != obg))  sgr(n);
-						output << 'Ü';
-					}
-
-				}
-			}
-		}
-		finishline();
-	}
-	output << NL;
-	normal;
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/avvymonk.cpp b/engines/avalanche/avvymonk.cpp
deleted file mode 100644
index b29072f..0000000
--- a/engines/avalanche/avvymonk.cpp
+++ /dev/null
@@ -1,110 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-
-namespace Avalanche {
-
-integer gd, gm;
-byte z;
-array<1, 4, pointer> a;
-untyped_file f;
-word s;
-string check;
-integer x, y;
-void savesc() {
-	varying_string<40> adf;
-	untyped_file f;
-	byte z;
-	array<1, 2, pointer> c;
-	word s;
-	varying_string<14> nam;
-	varying_string<30> screenname;
-	nam = "v:avvymonk.avd";
-	adf = string("aved as a stuff file, so there! TJAT.") + '\15' + '\12' + '\32';
-	adf[0] = 'S';
-	screenname = "Avalot in a monk's costume";
-	assign(f, nam); /* not scrambled */
-	rewrite(f, 1);
-	blockwrite(f, adf, 41);
-	blockwrite(f, nam, 13);
-	blockwrite(f, screenname, 31);
-	s = imagesize(0, 0, getmaxx(), 75);
-	for (z = 1; z <= 2; z ++) {
-		getmem(c[z], s);
-		getimage(0, 15 + (z - 1) * 75, getmaxx(), 15 + (z) * 75, c[z]);
-		blockwrite(f, c[z], s);
-		freemem(c[z], s);
-	}
-}
-void loadscreen(string nam) {
-	assign(f, nam);
-	reset(f, 1);
-	blockread(f, check, 41);
-	blockread(f, check, 13);
-	blockread(f, check, 31);
-	s = imagesize(0, 0, getmaxx(), 75);
-	for (z = 1; z <= 2; z ++) {
-		getmem(a[z], s);
-		blockread(f, a[z], s);
-		setactivepage(0);
-		putimage(0, 15 + (z - 1) * 75, a[z], 0);
-		freemem(a[z], s);
-	}
-	close(f);
-}
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	x = 0;
-	y = 0;
-	initgraph(gd, gm, "o:");
-	loadscreen("v:legion.avd");
-	while (y < 100) {
-		switch (getpixel(x, y)) {
-		case 7:
-			putpixel(x, y, 0);
-			break;
-		case 8:
-			putpixel(x, y, 0);
-			break;
-		case 9:
-			putpixel(x, y, 15);
-			break;
-		}
-		x += 1;
-		if (x > 640)  {
-			y += 1;
-			x = 0;
-		}
-	}
-	savesc();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/bakchunk.cpp b/engines/avalanche/bakchunk.cpp
deleted file mode 100644
index 94e00da..0000000
--- a/engines/avalanche/bakchunk.cpp
+++ /dev/null
@@ -1,59 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Celer.h"*/
-/*#include "Lucerna.h"*/
-
-namespace Avalanche {
-
-integer gd, gm;
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "");
-	setvisualpage(3);
-	load_chunks('1');
-
-	for (gd = 0; gd <= num_chunks; gd ++)
-		show_one_at(gd, 0, gd * 40);
-
-	mblit(0, 0, 79, 200, 3, 0);
-
-	gd = getpixel(0, 0);
-	setvisualpage(0);
-	setactivepage(0);
-
-	settextstyle(0, 0, 4);
-	setcolor(15);
-	outtextxy(100, 50, "Chunk1");
-	input >> NL;
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/basher.cpp b/engines/avalanche/basher.cpp
deleted file mode 100644
index dcab525..0000000
--- a/engines/avalanche/basher.cpp
+++ /dev/null
@@ -1,502 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 BASHER           Handles the keyboard. */
-
-#define __basher_implementation__
-
-
-/* Note: this unit can record keystrokes, for the demo. If you want it
-  to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
-  cause them to be played back. */
-
-#include "basher.h"
-
-
-#include "enhanced.h"
-#include "lucerna.h"
-#include "Graph.h"
-#include "scrolls.h"
-#include "acci.h"
-#include "trip5.h"
-#include "pingo.h"
-#include "dropdown.h"
-#include "logger.h"
-#include "Sticks.h"
-#include "enid.h"
-
-namespace Avalanche {
-
-boolean entering_filename;
-byte left_margin;
-
-void plottext() {
-	const array<0, 2, byte> p = {{0, 1, 3}};
-	byte x, y, n;
-
-	x = 0;
-	if (mouse_near_text())  super_off();
-	cursor_off();
-	for (n = 0; n <= 2; n ++)
-		for (y = 0; y <= 7; y ++) {
-			for (x = 1; x <= length(current); x ++)
-				mem[0xa000 * p[n]*pagetop + 12882 + y * 80 + x] = little[current[x]][y];
-			fillchar(mem[0xa000 * p[n]*pagetop + 12883 + y * 80 + x], 77 - x, '\0');
-		}
-	cursor_on();
-	super_on();
-}
-
-void wipetext() {
-	const array<0, 2, byte> n = {{0, 1, 3}};
-	byte y, p;
-
-	if (mouse_near_text())  super_off();
-	cursor_off();
-	for (y = 0; y <= 7; y ++)
-		for (p = 0; p <= 2; p ++)
-			fillchar(mem[0xa000 * n[p]*pagetop + 12883 + y * 80], 77, '\0');
-	quote = true;
-	curpos = 1;
-	cursor_on();
-	super_on();
-}
-
-/*procedure cursor;
-begin
- if curflash=0 then
- begin
-  if mouse_near_text then Super_Off;
-  cursoron:=not cursoron;
-  mem[$A000*13442+curpos]:=not mem[$A000*13442+curpos];
-  mem[$A000*pagetop+13442+curpos]:=not mem[$A000*pagetop+13442+curpos];
-  curflash:=17;
-  Super_On;
- end else dec(curflash);
-end;*/
-
-void do_cursor() {
-	bytefield bf;
-	byte fv;
-
-	mem[0xac00 * 13442 + curpos] = ~ mem[0xac00 * 13442 + curpos];
-	{
-		bf.x1 = curpos + 1;
-		bf.x2 = curpos + 2;
-		bf.y1 = 168;
-		bf.y2 = 168;
-	}
-	for (fv = 0; fv <= 1; fv ++) getset[fv].remember(bf);
-}
-
-void cursor_on() {
-	if (cursoron)  return;
-	do_cursor();
-	cursoron = true;
-}
-
-void cursor_off() {
-	if (! cursoron)  return;
-	do_cursor();
-	cursoron = false;
-}
-
-
-void get_demorec() {
-	demofile >> demo_rec;
-	inchar = demo_rec.key;
-	extd = demo_rec.extd;
-	demo_rec.delay -= 1;
-}
-
-#ifdef RECORD
-void record_one() {
-	demo_rec.delay = count;
-	demo_rec.key = inchar;
-	demo_rec.extd = extd;
-
-	demofile << demo_rec;
-	count = 0;
-}
-#endif
-/*
-procedure storeline(whatwhat:string);
-var
- fv:byte;
- what:string[77];
- ok:boolean;
-
-  function upline(x:string):string;
-  var fv:byte; n:string[77];
-  begin
-   for fv:=1 to length(x) do n[fv]:=upcase(x[fv]);
-   n[0]:=x[0]; upline:=n;
-  end;
-begin
-
- what:=upline(whatwhat); ok:=false;
- for fv:=1 to 20 do
-  if what=upline(previous^[fv]) then
-  begin { it already exists, in string "fv" }
-   move(previous^[fv+1],previous^[fv],(20-fv)*78);
-   previous^[20]:=whatwhat; ok:=true;
-  end;
- if ok then exit;
- { it's not on the list, so add it }
- move(previous^[2],previous^[1],1482); { shove up }
- previous^[20]:=whatwhat;
-end;
-*/
-void typein();
-
-static char firstchar(string x) {
-	char firstchar_result;
-	firstchar_result = x[1];
-	return firstchar_result;
-}
-
-
-static void try_dd() { /* This asks the Parsekey proc in Dropdown if it knows it. */
-	parsekey(inchar, extd);
-}
-
-void typein() {
-	byte w;
-
-	inkey();
-#ifdef RECORD record_one(); #endif
-
-	switch (inchar) {
-	case RANGE_15('\40', '\56'):
-	case '\60' ... '\337':
-	case '\341' ... '\377':
-		if (ddm_o.menunow) {
-			parsekey(inchar, extd);
-		} else {
-			if (length(current) < 76) {
-				if ((inchar == '"') || (inchar == '`')) {
-					if (quote)  inchar = '`';
-					else inchar = '"';
-					quote = ! quote;  /* Quote- Unquote... */
-				}
-				insert(inchar, current, curpos);
-				curpos += 1;
-				plottext();
-			} else blip();
-		}
-		break;
-	case '\10':
-		if (! ddm_o.menunow) {
-			if (curpos > left_margin) {
-				curpos -= 1;
-				if (set::of('"', '`', eos).has(current[curpos]))  quote = ! quote;
-				Delete(current, curpos, 1);
-				plottext();
-			} else blip();
-		}
-		break;
-	case '\0':
-	case '\340': {
-		switch (extd) {
-			/* Function keys: */
-		case cf1:
-			callverb(vb_help);
-			break; /* f1 - help (obviously) */
-		case cf2:
-			fxtoggle();
-			break; /* f2 - sound */
-		case ccf2:
-		case cf11: {
-			clearwords();
-			callverb(vb_save);
-		}
-		break; /* ^f2 - save */
-		case cf3:
-			if (length(current) < length(/*previous^[20]*/last)) { /* f3 - rec last */
-				current = current + copy(/*previous^[20]*/last, length(current) + 1, 255);
-				curpos = length(current) + 1;
-				plottext();
-			}
-			break;
-		case ccf3:
-		case cf12: {
-			clearwords();
-			callverb(vb_load);
-		}
-		break; /* ^f3 - load */
-		case cf4:
-			callverb(vb_restart);
-			break; /* f4 - restart game */
-		case cf5: {
-			person = pardon;
-			thing = pardon;
-			callverb(firstchar(f5_does())); /* f5 - get up/ whatever */
-		}
-		break;
-		case cf6:
-			callverb(vb_pause);
-			break; /* f6 - pause */
-		case cf7:
-			callverb(vb_open);
-			break; /* f7 - open door */
-		case cf8:
-			callverb(vb_look);
-			break; /* f8 - look */
-		case cf9:
-			callverb(vb_score);
-			break; /* f9 - score */
-		case ccf7:
-			major_redraw();
-			break; /* ^f7 - open door */
-		case cf10:
-		case c_ax:
-		case caf4: {
-#ifdef RECORD
-			display("Hi. You have just finished recording. GIED.");
-			close(demofile);
-			exit(0);
-#endif
-			callverb(vb_quit); /* f10, alt-X, alt-f4 - quit */
-		}
-		break;
-		case ccf5:
-			back_to_bootstrap(2);
-			break; /* ^f5 - Dos shell. */
-		case csf10:
-			callverb(vb_info);
-			break; /* sf10 - version */
-
-		case c_ab:
-			callverb(vb_boss);
-			break; /* alt-B */
-		case c_ad:
-			display("Wrong game!");
-			break; /* alt-D */
-		case ccleft:
-			if (curpos > left_margin) {
-				cursor_off();
-				curpos -= 1;
-				cursor_on();
-			}
-			break;                                         /* ^left */
-		case ccright:
-			if (curpos <= length(current)) { /* ^right */
-				cursor_off();
-				curpos += 1;
-				cursor_on();
-			}
-			break;
-		case cchome: {
-			cursor_off();
-			curpos = 1;
-			cursor_on();
-		}
-		break; /* ^home */
-		case ccend: {
-			cursor_off();
-			curpos = length(current) + 1;
-			cursor_on();
-		}
-		break; /* ^end */
-		case c_ar:
-			oh = 177;
-			break; /* alt-R = repeater (re-chime) */
-		case cup:
-		case cdown:
-		case cleft:
-		case cright:
-		case cpgup:
-		case cpgdn:
-		case chome:
-		case cend:
-			if (ddm_o.menunow)  try_dd();
-			else tripkey(extd);
-			break;              /* Up/Down/Left/Right/PgUp/PgDn */
-		case cnum5:
-			tripkey(extd);
-			break; /* Numeric 5 */
-		case cdel:
-			if (! ddm_o.menunow) {
-				if (curpos <= length(current)) {
-					if (set::of('"', '`', eos).has(current[curpos]))  quote = ! quote;
-					Delete(current, curpos, 1);
-					plottext();
-				} else blip();
-			}
-			break;
-		default:
-			try_dd();
-		}
-	}
-	break;
-	case cescape:
-	case '/':
-		if (ddm_o.menunow) { /* Escape */
-			ddm_o.wipe();
-		} else if (entering_filename) {
-			normal_edit();
-			wipetext();
-		} else
-			ddm_m.getcertain(ddm_o.menunum);
-		break;
-	case creturn:
-		if (ddm_o.menunow)  try_dd(); /* Return */
-		else {
-			log_command(current);
-			if (entering_filename) {
-				edna_save(copy(current, 24, 255));
-				normal_edit();
-				wipetext();
-			} else {
-				if (current != "")  last = current;
-				parse();
-				do_that();
-				if (! entering_filename) {
-					current = "";
-					wipetext();
-				}
-			}
-		}
-		break;
-	case '\11':
-		callverb(vb_inv);
-		break; /* Ctrl-I= inventory */
-	case '\7':
-		errorled();
-		break;
-	case '\25': {
-		current = "";
-		wipetext();
-	}
-	break;
-
-	case '\27': {
-		tr[1].xs = walk;
-		newspeed();
-	}
-	break;
-	case '\22': {
-		tr[1].xs = run;
-		newspeed();
-	}
-	break;
-
-	case '\2':
-		bosskey();
-		break;
-	case '\12':
-		ctrl = cjoy;
-		break; /* Joystick */
-	case '\13':
-		ctrl = ckey;
-		break; /* Keyboard */
-	case '\3':
-		callverb(vb_quit);
-		break; /* Ctrl-C= request to quit */
-
-	}
-	showrw();
-
-	if (demo)  get_demorec();
-}
-
-/*        'x'..'z': begin setvisualpage(ord(extd)-63); write(#7); inkey; end;
-        '': begin setvisualpage(0); write(#7); inkey; end;*/
-
-void keyboard_link() {
-	state(defaultled); /* if defaultled=1 then on; { For the menus }*/
-	joykeys(); /* Test joystick buttons- I know that's not keyboard. */
-
-	if (demo) {
-		if (keypressede())  exit(0);
-		if (demo_rec.delay > 0)
-			demo_rec.delay -= 1;
-		else typein();
-		return;
-	}
-
-#ifdef RECORD count += 1;   #endif
-
-	if (! keypressede())  return;
-	if (keyboardclick)  click();
-	typein();
-}
-
-boolean demo_ready() {
-	boolean demo_ready_result;
-	if (demo_rec.delay > 0) {
-		slowdown();
-		demo_rec.delay -= 1;
-	}
-	demo_ready_result = demo_rec.delay == 0;
-	return demo_ready_result;
-}
-
-void filename_edit() {
-	entering_filename = true;
-	current = "Filename\? (Esc=cancel):";
-	left_margin = 24;
-	curpos = 24;
-	plottext();
-}
-
-void normal_edit() {
-	entering_filename = false;
-	current = "";
-	left_margin = 1;
-	curpos = 1;
-}
-
-class unit_basher_initialize {
-public:
-	unit_basher_initialize();
-};
-static unit_basher_initialize basher_constructor;
-
-unit_basher_initialize::unit_basher_initialize() {
-	/* new(previous);*/ last = "";
-	normal_edit();
-
-	if (demo) {
-		assign(demofile, "demo.avd");
-		reset(demofile);
-	}
-
-#ifdef RECORD
-	count = 0;
-	assign(demofile, "demo.avd");
-	rewrite(demofile);
-#endif
-
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/basher.h b/engines/avalanche/basher.h
deleted file mode 100644
index 1cc42b5..0000000
--- a/engines/avalanche/basher.h
+++ /dev/null
@@ -1,70 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __basher_h__
-#define __basher_h__
-
-
-#include "gyro.h"
-/*#include "Tommys.h"*/
-
-namespace Avalanche {
-
-#ifdef RECORD
-
-#ifdef __basher_implementation__
-#undef EXTERN
-#define EXTERN
-#endif
-
-EXTERN word count;
-#undef EXTERN
-#define EXTERN extern
-
-#endif
-
-void plottext();
-
-void keyboard_link();
-
-void cursor_on();
-
-void get_demorec();
-
-boolean demo_ready();
-
-void cursor_off();
-
-void filename_edit();
-void normal_edit();
-#ifdef RECORD
-void record_one();
-#endif
-
-} // End of namespace Avalanche.
-
-#endif
\ No newline at end of file
diff --git a/engines/avalanche/bootstrp.cpp b/engines/avalanche/bootstrp.cpp
deleted file mode 100644
index add3613..0000000
--- a/engines/avalanche/bootstrp.cpp
+++ /dev/null
@@ -1,404 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*#include "Dos.h"*/
-
-
-/*$M 8192,0,$6000, S-*/
-
-namespace Avalanche {
-
-enum elm {normal, musical, elmpoyten, regi, last_elm};
-
-const integer run_shootemup = 1;
-const integer run_dosshell = 2;
-const integer run_ghostroom = 3;
-const integer run_golden = 4;
-
-const array<false, true, varying_string<2> > runcodes = {{"et", "Go"}};
-
-const integer reset_ = 0;
-
-const boolean jsb = true;
-const boolean no_jsb = false;
-const boolean bflight = true;
-const boolean no_bflight = false;
-
-
-struct {
-	byte operation;
-	word skellern;
-	array<1, 10000, byte> contents;
-} storage;
-
-string arguments, demo_args, args_with_no_filename;
-
-boolean first_time;
-
-byte original_mode;
-pointer old_1c;
-
-string segofs;
-
-boolean zoomy;
-
-longint soundcard, speed, baseaddr, irq, dma;
-
-void cursor_off() {   /*assembler; */
-	;
-	/* asm
-	 mov ah,01; { Change cursor size. */
-	/* mov cx,8224; { CH & CL are now 32. */
-	/* int $10;  { Call the Bios */
-
-}    /* That's all. */
-
-void cursor_on() {   /*assembler; */
-	;
-	/*
-	asm
-	 mov ah,01; { Change cursor size. */
-	/* mov ch,5;  { Top line is 5. */
-	/* mov cl,7;  { Bottom line is 7. */
-	/* int $10;   { Call the Bios. */
-
-}
-
-void quit() {
-	cursor_on();
-	exit(0);
-}
-
-string strf(longint x) {
-	string q;
-	string strf_result;
-	;
-	str(x, q);
-	strf_result = q;
-	return strf_result;
-}
-
-string command_com() {
-	string temp;
-
-	string command_com_result;
-	temp = getenv("comspec");
-	if (temp == "")
-		output << "avvy_bootstrap: COMSPEC not defined, => cannot run Dos shell." << NL;
-	command_com_result = temp;
-	return command_com_result;
-}
-
-void explain(byte error) {
-	output << " (";
-	switch (error) {
-	case 2:
-		output << "it's not there";
-		break;
-	case 8:
-		output << "out of memory";
-		break;
-	default:
-		output << "error " << error;
-	}
-	output << ")." << NL;
-}
-
-/*$F+*/
-
-void b_flight() {   /*interrupt;*/
-	storage.skellern += 1;
-}
-
-/*$F-*/
-
-void bflight_on() {
-	storage.skellern = reset_;
-	setintvec(0x1c, &b_flight);
-}
-
-void bflight_off() {
-	setintvec(0x1c, old_1c);
-}
-
-void run(string what, boolean with_jsb, boolean with_bflight, elm how);
-
-
-static string elm2str(elm how) {
-	string elm2str_result;
-	switch (how) {
-	case normal:
-	case musical:
-		elm2str_result = "jsb";
-		break;
-	case regi:
-		elm2str_result = "REGI";
-		break;
-	case elmpoyten:
-		elm2str_result = "ELMPOYTEN";
-		break;
-	}
-	return elm2str_result;
-}
-
-void run(string what, boolean with_jsb, boolean with_bflight, elm how) {
-	string which_dir, args;
-	integer error;
-
-
-	if (what == "")  return;
-
-	getdir(0, which_dir);
-
-	if (with_jsb) {
-		if (how == musical)
-			args = elm2str(how) + ' ' + args_with_no_filename; /* FN is NOT given if musical*/
-		else
-			args = elm2str(how) + ' ' + arguments;
-	} else args = "";
-
-	if (how == musical)  args = args + strf(soundcard) + ' ' + strf(speed) + ' ' +
-		                            strf(baseaddr) + ' ' + strf(dma) + ' ' + strf(irq);
-	if (with_bflight)  bflight_on();
-
-	swapvectors;
-	exec(what, args);
-	swapvectors;
-	cursor_off();
-
-	error = doserror;
-
-	if (with_bflight)  bflight_off();
-
-	chdir(which_dir);
-
-	if (error != 0) {
-		output << "avvy_bootstrap: cannot execute " << what << '!';
-		explain(error);
-		output << "Press Enter:";
-		input >> NL;
-		quit();
-	}
-}
-
-void run_avalot() {
-	integer error;
-
-
-	bflight_on();
-
-	swapvectors;
-	exec("avalot.avx", runcodes[first_time] + arguments);
-	swapvectors;
-
-	error = doserror;
-
-	bflight_off();
-
-	if (error != 0) {
-		output << "avvy_bootstrap: error in loading AVALOT.AVX!";
-		explain(error);
-		quit();
-	}
-
-	first_time = false;
-}
-
-void run_the_demo() {
-	string args;
-
-	args = arguments;
-	arguments = demo_args; /* Force the demo. */
-
-	run_avalot();
-
-	arguments = args;  /* Put all back to normal again. */
-	first_time = true;
-}
-
-void get_arguments() {
-	byte fv;
-
-	arguments = "";
-
-	for (fv = 1; fv <= paramcount; fv ++)
-		arguments = arguments + paramstr(fv) + ' ';
-
-	arguments[0] -= 1; /* Get rid of the trailing space. */
-
-	segofs = string(' ') + strf(seg(storage)) + ' ' + strf(ofs(storage));
-
-	arguments = segofs + ' ' + arguments;
-}
-
-void dos_shell() {
-	registers r;
-
-	r.ax = original_mode;
-	intr(0x10, r);
-	output << NL;
-	output << "The Avalot Dos Shell." << NL;
-	output << "---------------------" << NL;
-	output << NL;
-	output << "Type EXIT to return to Avalot." << NL;
-	output << NL;
-
-	cursor_on();
-	run(command_com(), no_jsb, no_bflight, normal);
-	cursor_off();
-
-	output << "Please wait, restoring your game..." << NL;
-}
-
-boolean keypressed1() {
-	registers r;
-
-	boolean keypressed1_result;
-	r.ah = 0xb;
-	msdos(r);
-	keypressed1_result = r.al == 0xff;
-	return keypressed1_result;
-}
-
-void flush_buffer() {
-	registers r;
-	r.ah = 7;
-	while (keypressed1())  msdos(r);
-}
-
-void demo() {
-	run_the_demo();
-	if (keypressed1())  return;
-	run("intro.avx", jsb, bflight, musical);
-	if (keypressed1())  return;
-	run("stars.avx", jsb, no_bflight, musical);
-	if (keypressed1())  return;
-
-	flush_buffer();
-}
-
-void call_menu() {
-	run("stars.avx", jsb, no_bflight, musical);
-	flush_buffer();
-	do {
-		run("avmenu.avx", jsb, no_bflight, normal);
-
-		switch (storage.operation) {
-		case 1:
-			return;
-			break; /* Play the game. */
-		case 2:
-			run("intro.avx", jsb, bflight, musical);
-			break;
-		case 3:
-			run("preview1.avd", jsb, no_bflight, normal);
-			break;
-		case 4:
-			run("viewdocs.avx", jsb, bflight, elmpoyten);
-			break;
-		case 5:
-			run("viewdocs.avx", jsb, bflight, regi);
-			break;
-		case 6:
-			quit();
-			break;
-		case 177:
-			demo();
-			break;
-		}
-
-		flush_buffer();
-	} while (!false);
-}
-
-void get_slope() {
-	run("slope.avx", jsb, no_bflight, normal);
-	if (dosexitcode != 0) {
-		cursor_on();
-		exit(0);
-	}
-
-	move(storage.contents, arguments, sizeof(arguments));
-	move(storage.contents[4998], soundcard, 4);
-	move(storage.contents[5002], baseaddr, 4);
-	move(storage.contents[5006], irq, 4);
-	move(storage.contents[5010], dma, 4);
-	move(storage.contents[5014], speed, 4);
-
-	zoomy = (arguments[8] == 'y') || (arguments[2] == 'y');
-	demo_args = arguments;
-	demo_args[7] = 'y';
-	arguments = segofs + ' ' + arguments;
-	demo_args = segofs + ' ' + demo_args;
-
-	args_with_no_filename = arguments;
-	if (arguments[length(arguments)] != ' ') {
-		/* Filename was given */
-		args_with_no_filename = arguments;
-		while ((args_with_no_filename != "")
-		        && (args_with_no_filename[length(args_with_no_filename)] != ' '))
-			args_with_no_filename[0] -= 1; /* Strip off the filename. */
-	}
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	original_mode = mem[seg0040 * 0x49];
-	getintvec(0x1c, old_1c);
-	first_time = true;
-	cursor_off();
-
-	get_arguments();
-	get_slope();
-
-	if (! zoomy)  call_menu();    /* Not run when zoomy. */
-
-	do {
-		run_avalot();
-
-		if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
-
-		switch (storage.operation) {
-		case run_shootemup:
-			run("seu.avx", jsb, bflight, normal);
-			break;
-		case run_dosshell:
-			dos_shell();
-			break;
-		case run_ghostroom:
-			run("g-room.avx", jsb, no_bflight, normal);
-			break;
-		case run_golden:
-			run("golden.avx", jsb, bflight, musical);
-			break;
-		}
-
-	} while (!false);
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/cadburys.cpp b/engines/avalanche/cadburys.cpp
deleted file mode 100644
index 9b12b39..0000000
--- a/engines/avalanche/cadburys.cpp
+++ /dev/null
@@ -1,135 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#define __cadburys_implementation__
-
-
-#include "cadburys.h"
-
-
-#include "graph.h"
-
-namespace Avalanche {
-
-void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
-	integer yy;
-	word aapos;
-	byte length, bit;
-	if (size > arraysize) {
-		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
-		output << " than " << size << '.' << NL;
-		exit(0);
-	}
-
-	aapos = 0;
-
-	length = x2 - x1;
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (yy = y1; yy <= y2; yy ++) {
-			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
-			aapos += length;
-		}
-	}
-	bit = getpixel(0, 0);
-
-}
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, flavourtype flav,
-          boolean mem, boolean nat)
-/* yes, I *do* know how to spell "really"! */
-{
-	word s;
-	pointer p;
-	chunkblocktype ch;
-	/* rectangle(x1,y1,x2,y2); exit;*/
-	this_chunk += 1;
-	offsets[this_chunk] = filepos(f);
-
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-
-	{
-		ch.flavour = flav;
-		ch.x = realx;
-		ch.y = realy;
-
-		ch.xl = x2 - x1;
-		ch.yl = y2 - y1;
-		ch.size = s;
-		ch.memorise = mem;
-		ch.natural = nat;
-	}
-
-	setvisualpage(1);
-	setactivepage(1);
-	input >> NL;
-	putimage(ch.x, ch.y, p, 0);
-
-	if (flav == ch_ega) {
-		freemem(p, s);
-		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
-		{
-			ch.size = s;
-			ch.x = ch.x / 8;
-			ch.xl = ((realx - ch.x * 8) + (x2 - x1) + 7) / 8;
-			mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
-		}
-	} else
-		/* For BGI pictures. */
-	{
-		ch.x = ch.x / 8;
-		ch.xl = (ch.xl + 7) / 8;
-		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
-	}
-
-	input >> NL;
-	setvisualpage(0);
-	setactivepage(0);
-
-	blockwrite(f, ch, sizeof(ch));
-
-	switch (flav) {
-	case ch_ega :
-		if (! nat)  blockwrite(f, aa, s);
-		break;
-	case ch_bgi : {
-		if (! nat)  blockwrite(f, p, s);
-		freemem(p, s);
-	}
-	break;
-	}
-	/* rectangle(x1,y1,x2,y2);*/
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/cadburys.h b/engines/avalanche/cadburys.h
deleted file mode 100644
index 6afb453..0000000
--- a/engines/avalanche/cadburys.h
+++ /dev/null
@@ -1,71 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __cadburys_h__
-#define __cadburys_h__
-
-namespace Avalanche {
-
-const integer arraysize = 12000;
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-
-#ifdef __cadburys_implementation__
-#undef EXTERN
-#define EXTERN
-#endif
-
-EXTERN array<0, arraysize, byte> aa;
-EXTERN byte num_chunks, this_chunk;
-EXTERN integer gd, gm;
-EXTERN array<1, 30, longint> offsets;
-EXTERN untyped_file f;
-#undef EXTERN
-#define EXTERN extern
-
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, flavourtype flav,
-          boolean mem, boolean nat);
-
-} // End of namespace Avalanche.
-
-#endif
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
deleted file mode 100644
index 62ae94d..0000000
--- a/engines/avalanche/celer.cpp
+++ /dev/null
@@ -1,578 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*
-  ÛßÜ ÛßÜ ÜßßÜ  ßÛß Ûßß  Üß ßÛß      ÜßÛßÜ  ßÛß ÛÜ  Û ÜÛßß  ßÛß ÛßÜ Ûßß Û
-  Ûß  ÛÛ  Û  Û Ü Û  Ûßß ßÜ   Û      Û  Û  Û  Û  Û ÛÜÛ  ßßßÜ  Û  ÛÛ  Ûßß Û
-  ß   ß ß  ßß   ßß  ßßß   ß  ß      ß  ß  ß ßßß ß  ßß  ßßß   ß  ß ß ßßß ßßß
-
-                 CELER            The unit for updating the screen pics. */
-
-#define __celer_implementation__
-
-#include "celer.h"
-
-
-#include "Graph.h"
-#include "trip5.h"
-#include "lucerna.h"
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-untyped_file f; /* Private variable- not accessible from elsewhere. */
-
-const integer on_disk = -1; /* Value of memos[fv].x when it's not in memory. */
-
-void pics_link() {
-	byte xx;
-
-	if (ddmnow)  return; /* No animation when the menus are up. */
-
-	{
-		dnatype &with = dna;
-		switch (with.room) {
-
-		case r__outsideargentpub: {
-			if ((roomtime % longint(12)) == 0)
-				show_one(longint(1) + (roomtime / longint(12)) % longint(4));
-		}
-		break;
-
-		case r__brummieroad:
-			if ((roomtime % longint(2)) == 0)
-				show_one(longint(1) + (roomtime / longint(2)) % longint(4));
-			break;
-
-		case r__bridge:
-			if ((roomtime % longint(2)) == 0)
-				show_one(longint(4) + (roomtime / longint(2)) % longint(4));
-			break;
-
-		case r__yours:
-			if ((! with.avvy_is_awake) && ((roomtime % longint(4)) == 0))
-				show_one(longint(1) + (roomtime / longint(12)) % longint(2));
-			break;
-
-		case r__argentpub: {
-			if (((roomtime % longint(7)) == 1) && (dna.malagauche != 177)) {
-				/* Malagauche cycle */
-				dna.malagauche += 1;
-				switch (dna.malagauche) {
-				case 1:
-				case 11:
-				case 21:
-					show_one(12);
-					break; /* Looks forwards. */
-				case 8:
-				case 18:
-				case 28:
-				case 32:
-					show_one(11);
-					break; /* Looks at you. */
-				case 30:
-					show_one(13);
-					break; /* Winks. */
-				case 33:
-					dna.malagauche = 0;
-					break;
-				}
-			}
-
-			switch (roomtime % longint(200)) {
-			case 179:
-			case 197:
-				show_one(5);
-				break; /* Dogfood's drinking cycle */
-			case 182:
-			case 194:
-				show_one(6);
-				break;
-			case 185:
-				show_one(7);
-				break;
-			case 199:
-				dna.dogfoodpos = 177;
-				break; /* Impossible value for this. */
-			case 0 ... 178: { /* Normally. */
-				switch (bearing(2)) {/* Bearing of Avvy from Dogfood. */
-				case 1 ... 90:
-				case RANGE_3(358, 360):
-					xx = 3;
-					break;
-				case 293 ... 357:
-					xx = 2;
-					break;
-				case 271 ... 292:
-					xx = 4;
-					break;
-				}
-				if (xx != dna.dogfoodpos) { /* Only if it's changed.*/
-					show_one(xx);
-					dna.dogfoodpos = xx;
-				}
-			}
-			break;
-			}
-		}
-		break;
-
-		case r__westhall:
-			if ((roomtime % longint(3)) == 0)
-				switch ((roomtime / longint(3)) % longint(6)) {
-				case 4:
-					show_one(1);
-					break;
-				case 1:
-				case 3:
-				case 5:
-					show_one(2);
-					break;
-				case 0:
-				case 2:
-					show_one(3);
-					break;
-				}
-			break;
-		case r__lustiesroom:
-			if (!(dna.lustie_is_asleep))  {
-				if ((roomtime % longint(45)) > 42)  xx = 4; /* du Lustie blinks */
-				else
-					switch (bearing(2)) {/* Bearing of Avvy from du Lustie. */
-					case 0 ... 45:
-					case 315 ... 360:
-						xx = 1;
-						break; /* Middle. */
-					case 45 ... 180:
-						xx = 2;
-						break; /* Left. */
-					case 181 ... 314:
-						xx = 3;
-						break; /* Right. */
-					}
-				if (xx != dna.dogfoodpos) { /* Only if it's changed.*/
-					show_one(xx);
-					dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-				}
-			}
-			break;
-
-		case r__aylesoffice:
-			if ((! dna.ayles_is_awake) && (roomtime % longint(14) == 0)) {
-				switch ((roomtime / longint(14)) % longint(2)) {
-				case 0:
-					show_one(1);
-					break; /* Frame 2: EGA. */
-				case 1:
-					show_one(3);
-					break; /* Frame 1: Natural. */
-				}
-			}
-			break;
-
-		case r__robins:
-			if (dna.tied_up)
-				switch (roomtime % longint(54)) {
-				case 20:
-					show_one(4);
-					break; /* Frame 4: Avalot blinks. */
-				case 23:
-					show_one(2);
-					break; /* Frame 1: Back to normal. */
-				}
-			break;
-
-		case r__nottspub: {
-			switch (bearing(5)) { /* Bearing of Avvy from Port. */
-			case 0 ... 45:
-			case 315 ... 360:
-				xx = 2;
-				break; /* Middle. */
-			case 45 ... 180:
-				xx = 6;
-				break; /* Left. */
-			case 181 ... 314:
-				xx = 8;
-				break; /* Right. */
-			}
-
-			if ((roomtime % longint(60)) > 57)  xx -= 1; /* Blinks */
-
-			if (xx != dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(xx);
-				dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-			}
-
-			switch (roomtime % longint(50)) {
-			case 45 :
-				show_one(9);
-				break; /* Spurge blinks */
-			case 49 :
-				show_one(10);
-				break;
-			}
-		}
-		break;
-
-		case r__ducks: {
-			if ((roomtime % longint(3)) == 0) /* The fire flickers */
-				show_one(longint(1) + (roomtime / longint(3)) % longint(3));
-
-			switch (bearing(2)) {/* Bearing of Avvy from Duck. */
-			case 0 ... 45:
-			case 315 ... 360:
-				xx = 4;
-				break; /* Middle. */
-			case 45 ... 180:
-				xx = 6;
-				break; /* Left. */
-			case 181 ... 314:
-				xx = 8;
-				break; /* Right. */
-			}
-
-			if ((roomtime % longint(45)) > 42)  xx += 1; /* Duck blinks */
-
-			if (xx != dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(xx);
-				dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-			}
-		}
-		break;
-
-		}
-	}
-
-	if ((dna.ringing_bells) && (flagset('B')))
-		/* They're ringing the bells. */
-		switch (roomtime % longint(4)) {
-		case 1: {
-			dnatype &with = dna;
-
-			if (with.nextbell < 5)  with.nextbell = 12;
-			with.nextbell -= 1;
-			note(notes[with.nextbell]);
-		}
-		break;
-		case 2:
-			nosound;
-			break;
-		}
-
-}
-
-void load_chunks(string xx) {
-	chunkblocktype ch;
-	byte fv;
-
-	/*$I-*/
-	assign(f, string("chunk") + xx + ".avd"); /* strf is done for us by Lucerna. */
-	reset(f, 1);
-	if (ioresult != 0)  return; /* no Chunk file. */
-	seek(f, 44);
-	blockread(f, num_chunks, 1);
-	blockread(f, offsets, num_chunks * 4);
-
-	for (fv = 1; fv <= num_chunks; fv ++) {
-		seek(f, offsets[fv]);
-		blockread(f, ch, sizeof(ch));
-		{
-			if (ch.memorise) {
-
-				{
-					memotype &with1 = memos[fv];
-
-					with1.x = ch.x;
-					with1.xl = ch.xl;
-					with1.y = ch.y;
-					with1.yl = ch.yl;
-					with1.flavour = ch.flavour;
-					with1.size = ch.size;
-				}
-
-				getmem(memory[fv], ch.size);
-
-				if (ch.natural) {
-					getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
-				} else
-					blockread(f, memory[fv], ch.size);
-			} else memos[fv].x = on_disk;
-		}
-	}
-
-	close(f);
-	/*$I+*/
-}
-
-void forget_chunks() {
-	byte fv;
-
-	for (fv = 1; fv <= num_chunks; fv ++)
-		if (memos[fv].x > on_disk)
-			freemem(memory[fv], memos[fv].size);
-	fillchar(memos, sizeof(memos), '\377'); /* x=-1, => on disk. */
-}
-
-void mdrop(integer x, integer y, integer xl, integer yl, pointer p) /* assembler;
-asm
-  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
-  push bp;      { Nor BP! }
-
-
-  { DI holds the offset on this page. It starts at the top left-hand corner. }
-  { (It should equal ch.y*80+ch.x. }
-
-  mov ax,y;
-  mov dl,80;
-  mul dl; { Line offset now calculated. }
-  mov di,ax; { Move it into DI. }
-  mov ax,x;
-  add di,ax; { Full offset now calculated. }
-
-  mov bx,yl; { No. of times to repeat lineloop. }
-  inc bx;        { "loop" doesn't execute the zeroth time. }
-  mov bh,bl;     { Put it into BH. }
-
-  { BP holds the length of the string to copy. It's equal to ch.xl.}
-
-  mov ax,word(p);   { Data is held at DS:SI. }
-  mov si,ax;
-  mov ax,word(p+2); { This will be moved over into ds in just a tick... }
-
-  mov bp,xl;
-
-  mov ds,ax;
-
-
-  cld;          { We're allowed to hack around with the flags! }
-
-  mov ax,$AC00; { Top of the first EGA page. }
-  mov es,ax;    { Offset on this page is calculated below... }
-
-
-{    port[$3c4]:=2; port[$3ce]:=4; }
-
-  mov dx,$3c4;
-  mov al,2;
-  out dx,al;
-  mov dx,$3ce;
-  mov al,4;
-  out dx,al;
-
-  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
-  mov bl,0;
-
-
- @mainloop:
-
-    push di;
-    push cx;
-
-{    port[$3C5]:=1 shl bit; }
-    mov dx,$3C5;
-    mov al,1;
-    mov cl,bl; { BL = bit. }
-    shl al,cl;
-    out dx,al;
-{     port[$3CF]:=bit; }
-    mov dx,$3CF;
-    mov al,bl; { BL = bit. }
-    out dx,al;
-
-    xor ch,ch;
-    mov cl,bh; { BH = ch.yl. }
-
-   @lineloop:
-
-     push cx;
-
-     mov cx,bp;
-
-     repz movsb; { Copy the data. }
-
-     sub di,bp;
-     add di,80;
-
-     pop cx;
-
-   loop @lineloop;
-
-    inc bl; { One more on BL. }
-
-    pop cx;
-    pop di;
-
- loop @mainloop;
-
-  pop bp;
-  pop ds;       { Get DS back again. }
-*/
-{
-}
-
-void show_one(byte which);
-
-static bytefield r;
-
-static void display_it(integer x, integer y, integer xl, integer yl, flavourtype flavour, pointer p) {
-	{
-		switch (flavour) {
-		case ch_bgi : {
-			putimage(x * 8, y, p, 0);
-			r.x1 = x;
-			r.y1 = y;
-			r.x2 = x + xl + 1;
-			r.y2 = y + yl;
-		}
-		break;
-		case ch_ega : {
-			mdrop(x, y, xl, yl, p);
-			blitfix();
-			r.x1 = x;
-			r.y1 = y;
-			r.x2 = x + xl;
-			r.y2 = y + yl;
-		}
-		break;
-		}
-	}
-}
-
-void show_one(byte which) {
-	chunkblocktype ch;
-	pointer p;
-	byte fv;
-
-
-	setactivepage(3);
-
-	{
-		memotype &with = memos[which];
-
-		if (with.x > on_disk) {
-			display_it(with.x, with.y, with.xl, with.yl, with.flavour, memory[which]);
-		} else {
-			reset(f, 1);
-			seek(f, offsets[which]);
-			blockread(f, ch, sizeof(ch));
-
-			{
-				getmem(p, ch.size);
-				blockread(f, p, ch.size);
-
-				display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p);
-				freemem(p, ch.size);
-
-				close(f);
-			}
-
-		}
-
-		setactivepage(1 - cp);
-
-		for (fv = 0; fv <= 1; fv ++)
-			getset[fv].remember(r);
-	}
-
-}
-
-void show_one_at(byte which, integer xxx, integer yyy);
-
-static bytefield r1;
-
-static void display_it1(integer xl, integer yl, flavourtype flavour, pointer p, integer &xxx, integer &yyy) {
-	{
-		switch (flavour) {
-		case ch_bgi : {
-			putimage(xxx, yyy, p, 0);
-			r1.x1 = xxx;
-			r1.y1 = yyy;
-			r1.x2 = xxx + xl + 1;
-			r1.y2 = yyy + yl;
-		}
-		break;
-		case ch_ega : {
-			mdrop(xxx / 8, yyy, xl, yl, p);
-			blitfix();
-			r1.x1 = xxx / 8;
-			r1.y1 = yyy;
-			r1.x2 = (xxx / 8) + xl;
-			r1.y2 = yyy + yl;
-		}
-		break;
-		}
-	}
-}
-
-void show_one_at(byte which, integer xxx, integer yyy) {
-	chunkblocktype ch;
-	pointer p;
-	byte fv;
-
-
-	setactivepage(3);
-
-	{
-		memotype &with = memos[which];
-
-		if (with.x > on_disk) {
-			display_it1(with.xl, with.yl, with.flavour, memory[which], xxx, yyy);
-		} else {
-			reset(f, 1);
-			seek(f, offsets[which]);
-			blockread(f, ch, sizeof(ch));
-
-			{
-				getmem(p, ch.size);
-				blockread(f, p, ch.size);
-
-				display_it1(ch.xl, ch.yl, ch.flavour, p, xxx, yyy);
-				freemem(p, ch.size);
-
-				close(f);
-			}
-
-		}
-
-		setactivepage(1 - cp);
-
-		for (fv = 0; fv <= 1; fv ++)
-			getset[fv].remember(r1);
-	}
-}
-
-class unit_celer_initialize {
-public:
-	unit_celer_initialize();
-};
-static unit_celer_initialize celer_constructor;
-
-unit_celer_initialize::unit_celer_initialize() {
-	num_chunks = 0;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
deleted file mode 100644
index 9db53b5..0000000
--- a/engines/avalanche/celer.h
+++ /dev/null
@@ -1,83 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef __celer_h__
-#define __celer_h__
-
-
-#include "closing.h"
-#include "incline.h"
-#include "gyro.h"
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-struct memotype {
-	integer x, y;
-	integer xl, yl;
-	flavourtype flavour;
-	word size;
-};
-
-
-#ifdef __celer_implementation__
-#undef EXTERN
-#define EXTERN
-#endif
-
-EXTERN array<1, 40, longint> offsets;
-EXTERN byte num_chunks;
-EXTERN array<1, 40, memotype> memos;
-EXTERN array<1, 40, pointer> memory;
-#undef EXTERN
-#define EXTERN extern
-
-
-void pics_link();
-
-void load_chunks(string xx);
-
-void forget_chunks();
-
-void show_one(byte which);
-
-void show_one_at(byte which, integer xxx, integer yyy);
-
-} // End of namespace Avalanche.
-
-#endif
diff --git a/engines/avalanche/ch_egats.cpp b/engines/avalanche/ch_egats.cpp
deleted file mode 100644
index d96eb89..0000000
--- a/engines/avalanche/ch_egats.cpp
+++ /dev/null
@@ -1,183 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-untyped_file f;
-longint offset;
-chunkblocktype ch;
-integer gd, gm;
-byte bit;
-pointer p;
-
-void mdrop(integer x, integer y, integer xl, integer yl, pointer p) /* assembler;
-asm
-  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
-  push bp;      { Nor BP! }
-
-
-  { DI holds the offset on this page. It starts at the top left-hand corner. }
-  { (It should equal ch.y*80+ch.x. }
-
-  mov ax,y;
-  mov dl,80;
-  mul dl; { Line offset now calculated. }
-  mov di,ax; { Move it into DI. }
-  mov ax,x;
-  add di,ax; { Full offset now calculated. }
-
-  mov bx,yl; { No. of times to repeat lineloop. }
-  inc bx;        { "loop" doesn't execute the zeroth time. }
-  mov bh,bl;     { Put it into BH. }
-
-  { BP holds the length of the string to copy. It's equal to ch.xl.}
-
-  mov ax,word(p);   { Data is held at DS:SI. }
-  mov si,ax;
-  mov ax,word(p+2); { This will be moved over into ds in just a tick... }
-
-  mov bp,xl;
-
-  mov ds,ax;
-
-
-  cld;          { We're allowed to hack around with the flags! }
-
-  mov ax,$A000; { Top of the first EGA page. }
-  mov es,ax;    { Offset on this page is calculated below... }
-
-
-{    port[$3c4]:=2; port[$3ce]:=4; }
-
-  mov dx,$3c4;
-  mov al,2;
-  out dx,al;
-  mov dx,$3ce;
-  mov al,4;
-  out dx,al;
-
-  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
-  mov bl,0;
-
-
- @mainloop:
-
-    push di;
-    push cx;
-
-{    port[$3C5]:=1 shl bit; }
-    mov dx,$3C5;
-    mov al,1;
-    mov cl,bl; { BL = bit. }
-    shl al,cl;
-    out dx,al;
-{     port[$3CF]:=bit; }
-    mov dx,$3CF;
-    mov al,bl; { BL = bit. }
-    out dx,al;
-
-    xor ch,ch;
-    mov cl,bh; { BH = ch.yl. }
-
-   @lineloop:
-
-     push cx;
-
-     mov cx,bp;
-
-     repz movsb; { Copy the data. }
-
-     sub di,bp;
-     add di,80;
-
-     pop cx;
-
-   loop @lineloop;
-
-    inc bl; { One more on BL. }
-
-    pop cx;
-    pop di;
-
- loop @mainloop;
-
-  pop bp;
-  pop ds;       { Get DS back again. }
-*/
-{
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	assign(f, "chunk21.avd");
-	reset(f, 1);
-
-	seek(f, 49);
-	blockread(f, offset, 4);
-
-	seek(f, offset);
-
-	blockread(f, ch, sizeof(ch));
-
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-
-	getmem(p, ch.size);
-	blockread(f, p, ch.size);
-	/* putimage(0,0,p^,0);*/
-
-
-	/* with ch do
-	  for bit:=0 to 3 do
-	  begin;
-	   port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
-	   for gm:=0 to yl do
-	    blockread(f,mem[$A000*gm*80],(ch.xl+7) div 8);
-	  end;*/
-
-	mdrop(ch.x, ch.y, ch.xl, ch.yl, p);
-
-	close(f);
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/charmap.cpp b/engines/avalanche/charmap.cpp
deleted file mode 100644
index c970e1a..0000000
--- a/engines/avalanche/charmap.cpp
+++ /dev/null
@@ -1,58 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/*#include "Dos.h"*/
-
-namespace Avalanche {
-
-struct infotype {
-	matrix<128, 255, 1, 8, byte> chars;
-	string data;
-};
-infotype table;
-pointer where;
-byte w, fv, ff, num;
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	getintvec(0x1f, where);
-	move(where, table, 1024);
-	for (w = 128; w <= 255; w ++) {
-		output << w << NL;
-		for (fv = 1; fv <= 8; fv ++) {
-			num = table.chars[w][fv];
-			for (ff = 1; ff <= 8; ff ++) {
-				if ((num & 128) == 0)  output << "  ";
-				else output << "ÛÛ";
-				num = num << 1;
-			}
-			output << NL;
-		}
-	}
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunker.cpp b/engines/avalanche/chunker.cpp
deleted file mode 100644
index 68d269d..0000000
--- a/engines/avalanche/chunker.cpp
+++ /dev/null
@@ -1,110 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-untyped_file f;
-string fn;
-byte num_chunks, fv;
-longint offset;
-chunkblocktype ch;
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	output << NL;
-	output << "CHUNKER 12/3/1995 TT" << NL;
-	output << NL;
-
-	if (paramcount != 1) {
-		output << "which chunk file?" << NL;
-		exit(0);
-	}
-
-	fn = paramstr(1);
-	assign(f, fn);
-	reset(f, 1);
-	output << "----- In chunk file " << fn << ", there are: -----" << NL;
-
-	seek(f, 44);
-	blockread(f, num_chunks, 1);
-	output << format(num_chunks, 4) << " chunks:" << NL;
-
-	output << "  No  Hdr    Offset  Flvr  Mem Nat      X      Y  Width Height Size of image" << NL;
-
-	for (fv = 1; fv <= num_chunks; fv ++) {
-
-		output << "Ch" << format(fv, 2) << ':';
-
-		seek(f, 41 + fv * 4);
-
-		output << format(41 + fv * 4, 4);
-		blockread(f, offset, 4);
-		output << format(offset, 10);
-
-		seek(f, offset);
-		blockread(f, ch, sizeof(ch));
-		{
-			if (ch.flavour == ch_bgi)
-				output << " ch_BGI";
-			else
-				output << " ch_EGA";
-
-			if (ch.memorise)
-				output << " yes";
-			else
-				output << " no ";
-
-			if (ch.natural)
-				output << " yes";
-			else
-				output << " no ";
-
-			output << format(ch.x, 7) << format(ch.y, 7) << format(ch.xl, 7) << format(ch.yl, 7) << format(ch.size, 10);
-		}
-
-		output << NL;
-	}
-
-	output << "---ENDS---" << NL;
-
-	close(f);
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf1.cpp b/engines/avalanche/chunkxf1.cpp
deleted file mode 100644
index ed29991..0000000
--- a/engines/avalanche/chunkxf1.cpp
+++ /dev/null
@@ -1,289 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-#include "cadburys.h"
-
-namespace Avalanche {
-
-/*type
- flavourtype = (ch_EGA,ch_BGI);
-
- chunkblocktype = record
-                   flavour:flavourtype;
-                   x,y:integer;
-                   xl,yl:integer;
-                   size:longint;
-                   natural:boolean;
-
-                   memorise:boolean; { Hold it in memory? }
-                  end;*/
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-/* arraysize = 12000;*/
-
-/* offsets:array[1..30] of longint;*/
-byte num_chunks/*,this_chunk*/;
-integer gd, gm;
-/* f:file;*/
-/* aa:array[0..arraysize] of byte;*/
-
-void load() {
-	byte a0 /*absolute $A000:800*/;
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-	assign(f, "chunkbit.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-
-	assign(f, "place21.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-}
-
-void open_chunk() {
-	assign(f, "chunk21.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-/*
-procedure mgrab(x1,y1,x2,y2:integer; size:word);
-var yy:integer; aapos:word; length,bit:byte;
-begin;
- if size>arraysize then
- begin;
-  writeln('*** SORRY! *** Increase the arraysize constant to be greater');
-  writeln(' than ',size,'.');
-  halt;
- end;
-
- aapos:=0;
-
- length:=x2-x1;
-
- for bit:=0 to 3 do
- begin;
-  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
-  for yy:=y1 to y2 do
-  begin;
-   move(mem[$A400*yy*80+x1],aa[aapos],length);
-   move(aa[aapos],mem[$A400*yy*80],length);
-(*   fillchar(mem[$A400:yy*80+x1],length,#177);*)
-   inc(aapos,length);
-  end;
- end;
- bit:=getpixel(0,0);
-
-end;
-*/
-/*procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
- mem,nat:boolean);
- { yes, I *do* know how to spell "really"! }
-var
- s:word;
- p:pointer;
- ch:chunkblocktype;
-begin;
- inc(this_chunk);
- offsets[this_chunk]:=filepos(f);
-
-
- s:=imagesize(x1,y1,x2,y2);
- getmem(p,s);
- getimage(x1,y1,x2,y2,p^);
-
- with ch do
- begin;
-  flavour:=flav;
-  x:=realx; y:=realy;
-
-  xl:=x2-x1;
-  yl:=y2-y1;
-  size:=s;
-  memorise:=mem;
-  natural:=nat;
- end;
-
- setvisualpage(1);
- setactivepage(1);
- readln;
- putimage(ch.x,ch.y,p^,0);
-
- if flav=ch_EGA then
- begin;
-  freemem(p,s);
-  s:=4*((x2-x1+7) div 8)*(y2-y1+1);
-  with ch do
-  begin;
-   size:=s;
-   x:=x div 8;
-   xl:=(xl+7) div 8;
-   mgrab(x,y,x+xl,y+yl,s);
-  end;
- end;
-
- readln;
- setvisualpage(0);
- setactivepage(0);
-
- blockwrite(f,ch,sizeof(ch));
-
- case flav of
-  ch_EGA : if not nat then blockwrite(f,aa,s);
-  ch_BGI : begin;
-            if not nat then blockwrite(f,p^,s);
-            freemem(p,s);
-           end;
- end;
-{ rectangle(x1,y1,x2,y2);}
-end;*/
-
-/*procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
- mem,nat:boolean);*/
-/* yes, I *do* know how to spell "really"! */
-/*var
- s:word;
- p:pointer;
- ch:chunkblocktype;
-begin;
-(* rectangle(x1,y1,x2,y2); exit;*)
- inc(this_chunk);
- offsets[this_chunk]:=filepos(f);
-
-
- s:=imagesize(x1,y1,x2,y2);
- getmem(p,s);
- getimage(x1,y1,x2,y2,p^);
-
- with ch do
- begin;
-  flavour:=flav;
-  x:=realx; y:=realy;
-
-  xl:=x2-x1;
-  yl:=y2-y1;
-  size:=s;
-  memorise:=mem;
-  natural:=nat;
- end;
-
- setvisualpage(1);
- setactivepage(1);
- readln;
- putimage(ch.x,ch.y,p^,0);
-
- if flav=ch_EGA then
- begin;
-  freemem(p,s);
-  s:=4*(((x2 div 8)-(x1 div 8))+2)*(y2-y1+1);
-  with ch do
-  begin;
-   size:=s;
-   x:=x div 8;
-   xl:=(xl div 8)+2;
-   mgrab(x,y,x+xl,y+yl,s);
-  end;
- end else
-  with ch do { For BGI pictures. *//*
-  begin;
-   x:=x div 8;
-   xl:=(xl+7) div 8;
-   size:=imagesize(x*8,y,(x+xl)*8,y+yl);
-  end;
-
- readln;
- setvisualpage(0);
- setactivepage(0);
-
- blockwrite(f,ch,sizeof(ch));
-
- case flav of
-  ch_EGA : if not nat then blockwrite(f,aa,s);
-  ch_BGI : begin;
-            if not nat then blockwrite(f,p^,s);
-            freemem(p,s);
-           end;
- end;
-(* rectangle(x1,y1,x2,y2);*)
-end;*/
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	load();
-	setwritemode(xorput);
-
-	num_chunks = 7;
-
-	open_chunk();
-
-	grab(98, 10, 181, 41, 247, 82, ch_ega, false, false); /* Drawbridge... */
-	grab(223, 10, 320, 41, 233, 82, ch_ega, false, false);
-	grab(361, 10, 458, 64, 233, 82, ch_ega, false, false);
-
-	grab(11, 10, 39, 22, 172, 17, ch_bgi, true, true);
-	grab(11, 38, 39, 50, 172, 17, ch_ega, true, false); /* Flag. */
-	grab(11, 24, 39, 36, 172, 17, ch_ega, true, false);
-	grab(11, 10, 39, 22, 172, 17, ch_ega, true, false);
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf2.cpp b/engines/avalanche/chunkxf2.cpp
deleted file mode 100644
index d7ae8e4..0000000
--- a/engines/avalanche/chunkxf2.cpp
+++ /dev/null
@@ -1,219 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-const integer arraysize = 32000;
-
-array<1, 30, longint> offsets;
-byte num_chunks, this_chunk;
-integer gd, gm;
-untyped_file f;
-array<0, arraysize, byte> aa;
-
-void load() {
-	byte a0 /*absolute $A000:800*/;
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-
-	assign(f, "place9.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-}
-
-void load_temp(string which) {
-	byte a0 /*absolute $A000:800*/;
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-	assign(f, which);
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-	bit = getpixel(0, 0);
-}
-
-void open_chunk() {
-	assign(f, "chunk9.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-
-void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
-	integer yy;
-	word aapos;
-	byte length, bit;
-	if (size > arraysize) {
-		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
-		output << " than " << size << '.' << NL;
-		exit(0);
-	}
-
-	aapos = 0;
-
-	length = x2 - x1;
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (yy = y1; yy <= y2; yy ++) {
-			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
-			aapos += length;
-		}
-	}
-	bit = getpixel(0, 0);
-}
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, boolean mem, boolean nat)
-/* yes, I *do* know how to spell "really"! */
-{
-	word s;
-	pointer p;
-	chunkblocktype ch;
-	/* rectangle(x1,y1,x2,y2); exit;*/
-	this_chunk += 1;
-	offsets[this_chunk] = filepos(f);
-
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-
-	{
-		if (nat)
-			ch.flavour = ch_bgi;
-		else ch.flavour = ch_ega; /* At the moment, Celer can't handle natural ch_EGAs. */
-		ch.x = realx;
-		ch.y = realy;
-
-		ch.xl = x2 - x1;
-		ch.yl = y2 - y1;
-		ch.size = s;
-		ch.memorise = mem;
-		ch.natural = nat;
-	}
-
-	setvisualpage(1);
-	setactivepage(1);
-	input >> NL;
-	putimage(ch.x, ch.y, p, 0);
-
-	freemem(p, s);
-	{
-		if (ch.flavour == ch_bgi)  s = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
-		else s = 4 * ((x2 - x1 + 7) / 8) * (y2 - y1 + 1);
-		ch.size = s;
-		ch.x = ch.x / 8;
-		ch.xl = (ch.xl + 7) / 8;
-		mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
-	}
-
-	input >> NL;
-	setvisualpage(0);
-	setactivepage(0);
-
-	blockwrite(f, ch, sizeof(ch));
-
-	if (! nat)  blockwrite(f, aa, s);
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	load();
-	load_temp("d:chunkbit.avd");
-	setwritemode(xorput);
-
-	num_chunks = 7;
-
-	open_chunk();
-
-	grab(78, 78, 232, 102, 212, 10, true, false); /* 154 across */
-	grab(235, 78, 389, 102, 212, 10, true, false);
-	grab(392, 78, 546, 102, 212, 10, true, false);
-	grab(392, 78, 546, 102, 212, 10, true, true);
-
-	load_temp("d:chunkbi3.avd");
-
-	grab(437, 51, 475, 78, 147, 120, false, false); /* 5 = door half-open. */
-	grab(397, 51, 435, 78, 147, 120, false, false); /* 6 = door open. */
-	grab(397, 51, 435, 78, 147, 120, true, true); /* 7 = door shut. */
-
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf3.cpp b/engines/avalanche/chunkxf3.cpp
deleted file mode 100644
index c693fdc..0000000
--- a/engines/avalanche/chunkxf3.cpp
+++ /dev/null
@@ -1,305 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Tommys.h"*/
-/*#include "Crt.h"*/
-#include "cadburys.h"
-
-namespace Avalanche {
-
-/*type
- flavourtype = (ch_EGA,ch_BGI);
-
- chunkblocktype = record
-                   flavour:flavourtype;
-                   x,y:integer;
-                   xl,yl:integer;
-                   size:longint;
-                   natural:boolean;
-
-                   memorise:boolean; { Hold it in memory? }
-                  end;
-
-const
- chunkheader : array[1..44] of char =
- 'Chunk-type AVD file, for an Avvy game.'+#26+#177+#$30+#$01+#$75+#177;
-
- arraysize = 12000;
-
-var
- offsets:array[1..30] of longint;
- num_chunks,this_chunk:byte;
- gd,gm:integer;
- f:file;
- aa:array[0..arraysize] of byte;*/
-
-string strf(longint x) {
-	string q;
-	string strf_result;
-	str(x, q);
-	strf_result = q;
-	return strf_result;
-}
-
-void finder() {
-	char r;
-	integer x, y;
-	setfillstyle(0, 0);
-	setcolor(14);
-	x = 320;
-	y = 100;
-	setwritemode(xorput);
-	do {
-		bar(0, 0, 200, 10);
-		outtextxy(0, 0, strf(x) + ',' + strf(y));
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		do {
-		} while (!keypressed());
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		switch (readkey()) {
-		case '\15':
-			return;
-			break;
-		case '8':
-			y -= 10;
-			break;
-		case '4':
-			x -= 10;
-			break;
-		case '6':
-			x += 10;
-			break;
-		case '2':
-			y += 10;
-			break;
-		case '\0':
-			switch (readkey()) {
-			case cup:
-				y -= 1;
-				break;
-			case cdown:
-				y += 1;
-				break;
-			case cleft:
-				x -= 1;
-				break;
-			case cright:
-				x += 1;
-				break;
-			}
-			break;
-		}
-	} while (!false);
-}
-
-void loadtemp(string n) {
-	byte a0 /*absolute $A000:800*/;
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-	assign(f, n);
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-	bit = getpixel(0, 0);
-	finder();
-}
-
-void load() {
-	byte a0 /*absolute $A000:800*/;
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-	assign(f, "place22.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-	setactivepage(1);
-	setvisualpage(1);
-	finder();
-	setactivepage(0);
-	setvisualpage(0);
-}
-
-void open_chunk() {
-	assign(f, "chunk22.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-
-/*procedure mgrab(x1,y1,x2,y2:integer; size:word);
-var yy:integer; aapos:word; length,bit:byte;
-begin;
- if size>arraysize then
- begin;
-  writeln('*** SORRY! *** Increase the arraysize constant to be greater');
-  writeln(' than ',size,'.');
-  halt;
- end;
-
- aapos:=0;
-
- length:=x2-x1;
-
- for bit:=0 to 3 do
- begin;
-  port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
-  for yy:=y1 to y2 do
-  begin;
-   move(mem[$A400*yy*80+x1],aa[aapos],length);
-   inc(aapos,length);
-  end;
- end;
- bit:=getpixel(0,0);
-
-end;
-
-procedure grab(x1,y1,x2,y2,realx,realy:integer; flav:flavourtype;
- mem,nat:boolean);
- { yes, I *do* know how to spell "really"! }
-var
- s:word;
- p:pointer;
- ch:chunkblocktype;
-begin;
- inc(this_chunk);
- offsets[this_chunk]:=filepos(f);
-
-
- s:=imagesize(x1,y1,x2,y2);
- getmem(p,s);
- getimage(x1,y1,x2,y2,p^);
-
- with ch do
- begin;
-  flavour:=flav;
-  x:=realx; y:=realy;
-
-  xl:=x2-x1;
-  yl:=y2-y1;
-  size:=s;
-  memorise:=mem;
-  natural:=nat;
- end;
-
- setvisualpage(1);
- setactivepage(1);
- readln;
- putimage(ch.x,ch.y,p^,0);
-
- if flav=ch_EGA then
- begin;
-  freemem(p,s);
-  s:=4*((x2-x1+7) div 8)*(y2-y1+1);
-  with ch do
-  begin;
-   size:=s;
-   x:=x div 8;
-   xl:=(xl+7) div 8;
-   mgrab(x,y,x+xl,y+yl,s);
-  end;
- end;
-
- readln;
- setvisualpage(0);
- setactivepage(0);
-
- blockwrite(f,ch,sizeof(ch));
-
- case flav of
-  ch_EGA : if not nat then blockwrite(f,aa,s);
-  ch_BGI : begin;
-            if not nat then blockwrite(f,p^,s);
-            freemem(p,s);
-           end;
- end;
-{ rectangle(x1,y1,x2,y2);}
-end;*/
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	loadtemp("chunkbit.avd");
-	load();
-	setwritemode(xorput);
-
-	num_chunks = 9;
-
-	open_chunk();
-
-	grab(0, 103, 169, 159, 72, 86, ch_ega, false, false); /* Stairs... */
-	grab(172, 103, 341, 159, 72, 86, ch_ega, false, false);
-
-	loadtemp("chunkbi3.avd");
-
-	grab(0, 130, 79, 157, 341, 94, ch_bgi, true , true);
-	grab(0, 130, 79, 157, 341, 94, ch_ega, false, false);
-	grab(0, 102, 79, 129, 341, 94, ch_ega, false, false);
-	grab(0, 74, 79, 101, 341, 94, ch_ega, false, false); /* Far door. */
-
-	loadtemp("chunkbi2.avd");
-
-	grab(393, 92, 451, 137, 512, 98, ch_bgi, true , true); /* Right-hand door. */
-	grab(393, 92, 451, 137, 512, 98, ch_ega, false, false);
-	grab(453, 92, 511, 137, 512, 98, ch_ega, false, false);
-
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf4.cpp b/engines/avalanche/chunkxf4.cpp
deleted file mode 100644
index 6659aa9..0000000
--- a/engines/avalanche/chunkxf4.cpp
+++ /dev/null
@@ -1,344 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Tommys.h"*/
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-enum kind {walled, unwalled, last_kind};
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-const integer arraysize = 12000;
-
-const kind w = walled;
-const kind uw = unwalled;
-
-array<1, 50, longint> offsets;
-byte num_chunks, this_chunk;
-integer gd, gm;
-untyped_file f;
-array<0, arraysize, byte> aa;
-
-void rdln() {
-	char r;
-	return;
-	do {
-		r = readkey();
-	} while (!(! keypressed()));
-}
-
-void load(kind k) {
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-
-
-	if (k == unwalled)  assign(f, "place29.avd");
-	else assign(f, "walled.avd");
-
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-}
-
-void finder() {
-	char r;
-	integer x, y;
-	return;
-	setfillstyle(0, 0);
-	setcolor(14);
-	x = 320;
-	y = 100;
-	setwritemode(xorput);
-	do {
-		bar(0, 0, 200, 10);
-		outtextxy(0, 0, strf(x) + ',' + strf(y));
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		do {
-		} while (!keypressed());
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		switch (readkey()) {
-		case '\15':
-			return;
-			break;
-		case '8':
-			y -= 10;
-			break;
-		case '4':
-			x -= 10;
-			break;
-		case '6':
-			x += 10;
-			break;
-		case '2':
-			y += 10;
-			break;
-		case '\0':
-			switch (readkey()) {
-			case cup:
-				y -= 1;
-				break;
-			case cdown:
-				y += 1;
-				break;
-			case cleft:
-				x -= 1;
-				break;
-			case cright:
-				x += 1;
-				break;
-			}
-			break;
-		}
-	} while (!false);
-}
-
-void loadtemp(string which) {
-	byte a0 /*absolute $A000:800*/;
-	byte bit;
-	untyped_file f;
-
-
-	assign(f, string("corr") + which + "tmp.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-
-	bit = getpixel(0, 0);
-
-	finder();
-}
-
-void open_chunk() {
-	assign(f, "chunk29.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-
-void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
-	integer yy;
-	word aapos;
-	byte length, bit;
-
-	if (size > arraysize) {
-		restorecrtmode();
-		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
-		output << " than " << size << '.' << NL;
-		exit(0);
-	}
-
-	aapos = 0;
-
-	length = x2 - x1;
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (yy = y1; yy <= y2; yy ++) {
-			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
-			aapos += length;
-		}
-	}
-	bit = getpixel(0, 0);
-
-}
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, flavourtype flav,
-          boolean mem, boolean nat, kind k)
-/* yes, I *do* know how to spell "really"! */
-{
-	word s;
-	pointer p;
-	chunkblocktype ch;
-
-	/* rectangle(x1,y1,x2,y2); exit;*/
-	this_chunk += 1;
-	offsets[this_chunk] = filepos(f);
-
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-
-	{
-		ch.flavour = flav;
-		ch.x = realx;
-		ch.y = realy;
-
-		ch.xl = x2 - x1;
-		ch.yl = y2 - y1;
-		ch.size = s;
-		ch.memorise = mem;
-		ch.natural = nat;
-	}
-
-	load(k);
-
-	setvisualpage(1);
-	setactivepage(1);
-	rdln();
-	putimage(ch.x, ch.y, p, 0);
-
-	if (flav == ch_ega) {
-		freemem(p, s);
-		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
-		{
-			ch.size = s;
-			ch.x = ch.x / 8;
-			ch.xl = ((realx - ch.x * 8) + (x2 - x1) + 7) / 8;
-			mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
-		}
-	} else
-		/* For BGI pictures. */
-	{
-		ch.x = ch.x / 8;
-		ch.xl = (ch.xl + 7) / 8;
-		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
-	}
-
-	rdln();
-	setvisualpage(0);
-	setactivepage(0);
-
-	blockwrite(f, ch, sizeof(ch));
-
-	switch (flav) {
-	case ch_ega :
-		if (! nat)  blockwrite(f, aa, s);
-		break;
-	case ch_bgi : {
-		if (! nat)  blockwrite(f, p, s);
-		freemem(p, s);
-	}
-	break;
-	}
-	/* rectangle(x1,y1,x2,y2);*/
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	setwritemode(xorput);
-
-	loadtemp("2");
-
-	num_chunks = 32;
-
-	open_chunk();
-
-	grab(0, 11, 100, 104, 260, 41, ch_ega, false, false, uw); /*1 Geida's door. */
-	grab(103, 12, 203, 55, 207, 61, ch_ega, false, false, uw); /*2 "Ite mingite" sign. */
-	grab(123, 59, 185, 103, 254, 90, ch_ega, false, false, uw); /*3 Normal N door (rt handle)*/
-	grab(227, 10, 289, 56, 254, 88, ch_ega, false, false, uw); /*4 Normal N door (lt handle)*/
-	grab(207, 63, 294, 105,  9, 47, ch_ega, false, false, w); /*5 Window in left wall. */
-	grab(312, 10, 416, 56, 233, 88, ch_ega, false, false, uw); /*6 North archway */
-	grab(331, 78, 384, 101, 32, 64, ch_ega, false, false, w); /*7 2 torches, L wall. */
-	grab(607, 142, 621, 157, 233, 88, ch_ega, false, false, uw); /*8 1 torch, N wall. */
-	grab(417, 11, 577, 59, 311, 61, ch_ega, false, false, uw); /*9 "The Wrong Way!" sign. */
-
-	loadtemp("3");
-
-	grab(0, 11, 62, 63, 557, 108, ch_ega, false, false, w); /*10 Near right candle */
-	grab(64, 11, 120, 63, 18, 108, ch_ega, false, false, w); /*11 Near left candle */
-	grab(122, 11, 169, 55, 93, 100, ch_ega, false, false, w); /*12 Far left candle */
-	grab(171, 11, 222, 52, 500, 100, ch_ega, false, false, w); /*13 Far right candle */
-	grab(32, 68, 84, 104, 285, 70, ch_ega, false, false, uw); /*14 Far window */
-	grab(138, 65, 190, 92, 233, 88, ch_ega, false, false, uw); /*15 Baron du Lustie pic 1 */
-	grab(244, 65, 296, 92, 103, 51, ch_ega, false, false, uw); /*16 Baron du Lustie pic 2 */
-	grab(172, 54, 280, 63, 233, 88, ch_ega, false, false, uw); /*17 "Art Gallery" sign */
-	grab(341, 18, 402, 47, 563, 48, ch_ega, false, false, w); /*18 Right wall torches */
-	grab(528, 10, 639, 160, 528, 10, ch_ega, false, false, uw); /*19 Right wall */
-	grab(430, 50, 526, 88, 543, 50, ch_ega, false, false, w); /*20 Window in right wall */
-	grab(451, 91, 494, 152, 566, 91, ch_ega, false, false, w); /*21 Door in right wall */
-	grab(238, 10, 307, 14, 484, 156, ch_ega, false, false, w); /*22 Near wall door: right */
-	grab(239, 16, 300, 20, 300, 156, ch_ega, false, false, w); /*23 Near wall door: middle */
-	grab(234, 22, 306, 26, 100, 156, ch_ega, false, false, w); /*24 Near wall door: left */
-	grab(25, 113, 87, 156, 254, 90, ch_ega, false, false, w); /*25 Far door opening stage 1 */
-	grab(131, 113, 193, 156, 254, 90, ch_ega, false, false, w); /*26 Far door opening stage 2 */
-	grab(237, 113, 299, 156, 254, 90, ch_ega, false, false, w); /*27 Far door opening stage 3 */
-
-	loadtemp("4");
-
-	grab(0, 11, 112, 160,  0, 11, ch_ega, false, false, uw); /*28 Left wall */
-	grab(144, 44, 197, 76, 30, 44, ch_ega, false, false, w); /*29 Shield on L wall. */
-	grab(149, 90, 192, 152, 35, 90, ch_ega, false, false, w); /*30 Door in L wall. */
-	grab(463, 28, 527, 43, 252, 100, ch_ega, false, false, w); /*31 Archway x 2 */
-	grab(463, 79, 527, 94, 252, 100, ch_ega, false, false, w); /*32 Archway x 3 */
-
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf5.cpp b/engines/avalanche/chunkxf5.cpp
deleted file mode 100644
index c4b49e7..0000000
--- a/engines/avalanche/chunkxf5.cpp
+++ /dev/null
@@ -1,298 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Tommys.h"*/
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-const integer arraysize = 12000;
-
-array<1, 30, longint> offsets;
-byte num_chunks, this_chunk;
-integer gd, gm;
-untyped_file f;
-array<0, arraysize, byte> aa;
-
-void finder() {
-	char r;
-	integer x, y;
-	setfillstyle(0, 0);
-	setcolor(14);
-	x = 320;
-	y = 100;
-	setwritemode(xorput);
-	do {
-		bar(0, 0, 200, 10);
-		outtextxy(0, 0, strf(x) + ',' + strf(y));
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		do {
-		} while (!keypressed());
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		switch (readkey()) {
-		case '\15':
-			return;
-			break;
-		case '8':
-			y -= 10;
-			break;
-		case '4':
-			x -= 10;
-			break;
-		case '6':
-			x += 10;
-			break;
-		case '2':
-			y += 10;
-			break;
-		case '\0':
-			switch (readkey()) {
-			case cup:
-				y -= 1;
-				break;
-			case cdown:
-				y += 1;
-				break;
-			case cleft:
-				x -= 1;
-				break;
-			case cright:
-				x += 1;
-				break;
-			}
-			break;
-		}
-	} while (!false);
-}
-
-void load() {
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-
-	assign(f, "v:place1.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-
-	setvisualpage(1);
-	setactivepage(1);
-	finder();
-}
-
-void loadtemp() {
-	byte a0 /*absolute $A000:800*/;
-	byte bit;
-	untyped_file f;
-
-	assign(f, "chunkbi9.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-
-	bit = getpixel(0, 0);
-
-	setvisualpage(0);
-	setactivepage(0);
-	finder();
-}
-
-void open_chunk() {
-	assign(f, "chunk1.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-
-void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
-	integer yy;
-	word aapos;
-	byte length, bit;
-	if (size > arraysize) {
-		restorecrtmode();
-		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
-		output << " than " << size << '.' << NL;
-		exit(0);
-	}
-
-	aapos = 0;
-
-	length = x2 - x1;
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (yy = y1; yy <= y2; yy ++) {
-			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
-			aapos += length;
-		}
-	}
-	bit = getpixel(0, 0);
-
-}
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, flavourtype flav,
-          boolean mem, boolean nat)
-/* yes, I *do* know how to spell "really"! */
-{
-	word s;
-	pointer p;
-	chunkblocktype ch;
-	/* rectangle(x1,y1,x2,y2); exit;*/
-	this_chunk += 1;
-	offsets[this_chunk] = filepos(f);
-
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-
-	{
-		ch.flavour = flav;
-		ch.x = realx;
-		ch.y = realy;
-
-		ch.xl = x2 - x1;
-		ch.yl = y2 - y1;
-		ch.size = s;
-		ch.memorise = mem;
-		ch.natural = nat;
-	}
-
-	setvisualpage(1);
-	setactivepage(1);
-	input >> NL;
-	if (! nat)  putimage(ch.x, ch.y, p, 0);
-
-	if (flav == ch_ega) {
-		freemem(p, s);
-		s = 4 * (((x2 + 7) / 8) - (x1 / 8)) * (y2 - y1 + 1);
-		{
-			ch.size = s;
-			ch.x = ch.x / 8;
-			ch.xl = (ch.xl + 7) / 8;
-			mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
-		}
-	} else {
-		ch.x = ch.x / 8;
-		ch.xl = (ch.xl + 7) / 8;
-		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
-	}
-
-	input >> NL;
-	setvisualpage(0);
-	setactivepage(0);
-
-	blockwrite(f, ch, sizeof(ch));
-
-	switch (flav) {
-	case ch_ega :
-		if (! nat)  blockwrite(f, aa, s);
-		break;
-	case ch_bgi : {
-		if (! nat)  blockwrite(f, p, s);
-		freemem(p, s);
-	}
-	break;
-	}
-	/* rectangle(x1,y1,x2,y2);*/
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	load();
-	loadtemp();
-	setwritemode(xorput);
-
-	num_chunks = 9;
-
-	open_chunk();
-
-	grab(48, 42, 94, 66, 400, 105, ch_ega, true, false); /*1 Avvy asleep. */
-	grab(100, 42, 146, 66, 400, 105, ch_ega, true, false); /*2 Avvy asleep again. */
-	grab(152, 42, 198, 66, 400, 105, ch_ega, false, false); /*3 Avvy awake in bed. */
-	grab(106, 113, 152, 137, 400, 105, ch_bgi, true , true); /*4 No Avvy in bed. */
-
-	grab(206, 42, 279, 75, 150, 91, ch_ega, false, false); /*5 Open trunk. */
-	grab(206, 42, 287, 75, 150, 91, ch_bgi, true,  true); /*6 Shut trunk. */
-
-	grab(69, 70, 102, 88, 431, 100, ch_ega, false, false); /*7 Arkata 1. */
-	grab(118, 70, 151, 88, 431, 100, ch_ega, false, false); /*8 Arkata 2. */
-	grab(167, 70, 200, 88, 431, 100, ch_ega, false, false); /*9 Arkata 3. */
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf6.cpp b/engines/avalanche/chunkxf6.cpp
deleted file mode 100644
index a1ce3ee..0000000
--- a/engines/avalanche/chunkxf6.cpp
+++ /dev/null
@@ -1,309 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Tommys.h"*/
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-const integer arraysize = 12000;
-
-const integer x_ofs = 165;
-const integer y_ofs = 58;
-
-array<1, 30, longint> offsets;
-byte num_chunks, this_chunk;
-integer gd, gm;
-untyped_file f;
-array<0, arraysize, byte> aa;
-
-void finder() {
-	char r;
-	integer x, y;
-	setfillstyle(0, 0);
-	setcolor(14);
-	x = 320;
-	y = 100;
-	setwritemode(xorput);
-	do {
-		bar(0, 0, 200, 10);
-		outtextxy(0, 0, strf(x) + ',' + strf(y));
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		do {
-		} while (!keypressed());
-		line(x - 20, y, x + 20, y);
-		line(x, y - 20, x, y + 20);
-		switch (readkey()) {
-		case '\15':
-			return;
-			break;
-		case '8':
-			y -= 10;
-			break;
-		case '4':
-			x -= 10;
-			break;
-		case '6':
-			x += 10;
-			break;
-		case '2':
-			y += 10;
-			break;
-		case '\0':
-			switch (readkey()) {
-			case cup:
-				y -= 1;
-				break;
-			case cdown:
-				y += 1;
-				break;
-			case cleft:
-				x -= 1;
-				break;
-			case cright:
-				x += 1;
-				break;
-			}
-			break;
-		}
-	} while (!false);
-}
-
-void load() {
-	byte a1 /*absolute $A400:800*/;
-	byte bit;
-	untyped_file f;
-
-	assign(f, "v:place19.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a1, 12080);
-	}
-
-	close(f);
-	bit = getpixel(0, 0);
-	setvisualpage(1);
-	setactivepage(1);
-	finder();
-	setvisualpage(0);
-	setactivepage(0);
-}
-
-void loadtemp() {
-	byte a0 /*absolute $A000:800*/;
-	byte bit;
-	untyped_file f;
-
-	assign(f, "d:temp1.avd");
-	reset(f, 1);
-	seek(f, 177);
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-	}
-	close(f);
-
-	bit = getpixel(0, 0);
-
-	/* finder;*/
-}
-
-void open_chunk() {
-	assign(f, "chunk19.avd");
-	rewrite(f, 1);
-	blockwrite(f, chunkheader, sizeof(chunkheader));
-	blockwrite(f, num_chunks, 1);
-	blockwrite(f, offsets, num_chunks * 4);
-
-	this_chunk = 0;
-}
-
-void close_chunk() {
-	seek(f, 45);
-	blockwrite(f, offsets, num_chunks * 4); /* make sure they're right! */
-	close(f);
-}
-
-void mgrab(integer x1, integer y1, integer x2, integer y2, word size) {
-	integer yy;
-	word aapos;
-	byte length, bit;
-	if (size > arraysize) {
-		restorecrtmode();
-		output << "*** SORRY! *** Increase the arraysize constant to be greater" << NL;
-		output << " than " << size << '.' << NL;
-		exit(0);
-	}
-
-	aapos = 0;
-
-	length = x2 - x1;
-
-	for (bit = 0; bit <= 3; bit ++) {
-		port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		for (yy = y1; yy <= y2; yy ++) {
-			move(mem[0xa400 * yy * 80 + x1], aa[aapos], length);
-			aapos += length;
-		}
-	}
-	bit = getpixel(0, 0);
-
-}
-
-void grab(integer x1, integer y1, integer x2, integer y2, integer realx, integer realy, flavourtype flav,
-          boolean mem, boolean nat)
-/* yes, I *do* know how to spell "really"! */
-{
-	word s;
-	pointer p;
-	chunkblocktype ch;
-	x1 -= x_ofs;
-	x2 -= x_ofs;
-	y1 -= y_ofs;
-	y2 -= y_ofs;
-	/* rectangle(x1,y1,x2,y2); exit;*/
-	this_chunk += 1;
-	offsets[this_chunk] = filepos(f);
-
-
-	s = imagesize(x1, y1, x2, y2);
-	getmem(p, s);
-	getimage(x1, y1, x2, y2, p);
-
-	{
-		ch.flavour = flav;
-		ch.x = realx;
-		ch.y = realy;
-
-		ch.xl = x2 - x1;
-		ch.yl = y2 - y1;
-		ch.size = s;
-		ch.memorise = mem;
-		ch.natural = nat;
-	}
-
-	setvisualpage(1);
-	setactivepage(1);
-	/* readln;*/
-	putimage(ch.x, ch.y, p, 0);
-
-	if (flav == ch_ega) {
-		freemem(p, s);
-		s = 4 * (((x2 / 8) - (x1 / 8)) + 2) * (y2 - y1 + 1);
-		{
-			ch.size = s;
-			ch.x = ch.x / 8;
-			ch.xl = (ch.xl / 8) + 2;
-			mgrab(ch.x, ch.y, ch.x + ch.xl, ch.y + ch.yl, s);
-		}
-	} else
-		/* For BGI pictures. */
-	{
-		ch.x = ch.x / 8;
-		ch.xl = (ch.xl + 7) / 8;
-		ch.size = imagesize(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl);
-	}
-
-	/* readln;*/
-	setvisualpage(0);
-	setactivepage(0);
-
-	blockwrite(f, ch, sizeof(ch));
-
-	switch (flav) {
-	case ch_ega :
-		if (! nat)  blockwrite(f, aa, s);
-		break;
-	case ch_bgi : {
-		if (! nat)  blockwrite(f, p, s);
-		freemem(p, s);
-	}
-	break;
-	}
-	/* rectangle(x1,y1,x2,y2);*/
-}
-
-int main(int argc, const char *argv[]) {
-	pio_initialize(argc, argv);
-	gd = 3;
-	gm = 0;
-	initgraph(gd, gm, "c:\\bp\\bgi");
-	load();
-	loadtemp();
-	setwritemode(xorput);
-
-	num_chunks = 13;
-
-	open_chunk();
-
-	grab(165, 68, 207, 87, 127, 105, ch_ega, false, false); /*1 The settle with no lute*/
-	grab(209, 68, 255, 96, 159, 84, ch_bgi, true, true); /*2 Dogfood looks right. */
-	grab(209, 68, 255, 96, 159, 84, ch_ega, true, false); /*3 Dogfood- straight ahead. */
-	grab(257, 68, 303, 96, 159, 84, ch_ega, true, false); /*4 Dogfood- left. */
-	grab(305, 68, 351, 96, 159, 84, ch_ega, true, false); /*5 DF drinks: stage 1. */
-	grab(353, 68, 399, 96, 159, 84, ch_ega, true, false); /*6 DF drinks: stage 2. */
-	grab(401, 68, 447, 96, 159, 84, ch_ega, true, false); /*7 DF drinks: stage 3. */
-	grab(449, 84, 465, 94, 392, 87, ch_ega, true, false); /*8 Ibythneth smiles. */
-	grab(449, 75, 488, 82, 341, 123, ch_ega, true, false); /*9 No habit under the settle. */
-	grab(508, 68, 580, 106, 485, 105, ch_ega, true, false); /*10 M gets your drink. */
-	grab(508, 68, 580, 106, 485, 105, ch_bgi, true, true); /*11 M gets up again. */
-	grab(470, 84, 486, 91, 510, 108, ch_ega, true, false); /*12 M looks right. */
-	grab(488, 84, 504, 91, 510, 108, ch_ega, true, false); /*13 M winks. */
-	close_chunk();
-	return EXIT_SUCCESS;
-}
-
-
-} // End of namespace Avalanche.
\ No newline at end of file
diff --git a/engines/avalanche/chunkxf7.cpp b/engines/avalanche/chunkxf7.cpp
deleted file mode 100644
index 4b03e3a..0000000
--- a/engines/avalanche/chunkxf7.cpp
+++ /dev/null
@@ -1,291 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "graph.h"
-/*#include "Tommys.h"*/
-/*#include "Crt.h"*/
-
-namespace Avalanche {
-
-enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
-
-struct chunkblocktype {
-	flavourtype flavour;
-	integer x, y;
-	integer xl, yl;
-	longint size;
-	boolean natural;
-
-	boolean memorise; /* Hold it in memory? */
-};
-
-const array<1, 44, char> chunkheader =
-    string("Chunk-type AVD file, for an Avvy game.") + '\32' + '\261' + '\x30' + '\x1' + '\x75' + '\261';
-
-const integer arraysize = 12000;
-


Commit: 178386f1c48d04f07b2552a253a6b8151dc481b9
    https://github.com/scummvm/scummvm/commit/178386f1c48d04f07b2552a253a6b8151dc481b9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-21T06:22:50-07:00

Commit Message:
AVALANCHE: Stub gyro2.cpp. Fix readmes.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index b44cbee..6c77279 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -26,11 +26,304 @@
  */
 
 #include "avalanche/gyro2.h"
+#include "common/textconsole.h"
+
+//#include "pingo.h"
+//#include "scrolls.h"
+//#include "lucerna.h"
+//#include "visa.h"
+//#include "acci.h"
+//#include "trip5.h"
+//#include "dropdown.h"
+//#include "basher.h"
+
+
 
 namespace Avalanche {
 
 	namespace Gyro {
 
+	const Common::String things[numobjs] = {
+		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+	};
+
+	const char thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */
+
+	const Common::String better[numobjs] = {
+		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
+		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
+		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
+		"an onion"
+	};
+
+	const char betterchar[] = "WMBParCLguKeSnIohn";
+
+	void newpointer(byte m) {
+		warning("STUB: Gyro::newpointer()");
+	}
+
+	void wait() {   /* makes hourglass */
+		newpointer(5);
+	}
+
+	void on() {
+		warning("STUB: Gyro::on()");
+	}
+
+	void on_virtual() {
+		switch (visible) {
+		case m_virtual:
+			return;
+			break;
+		case m_yes:
+			off();
+			break;
+		}
+
+		visible = m_virtual;
+	}
+
+	void off() {
+		warning("STUB: Gyro::off()");
+	}
+
+	void off_virtual() {
+		warning("STUB: Gyro::off_virtual()");
+	}
+
+	void xycheck() {   /* only updates mx & my, not all other mouse vars */
+		warning("STUB: Gyro::xycheck()");
+	}
+
+	void hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */
+		warning("STUB: Gyro::hopto()");
+	}
+
+	void check() {
+		warning("STUB: Gyro::check()");
+	}
+
+	void note(uint16 hertz) {
+		warning("STUB: Gyro::note()");
+	}
+
+	void blip() {
+		warning("STUB: Gyro::blip()");
+	}
+
+	Common::String strf(int32 x) {
+		Common::String q = Common::String::format("%d", x);
+		return q;
+	}
+
+	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
+		warning("STUB: Gyro::shadow()");
+	}
+
+	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+		warning("STUB: Gyro::shbox()");
+	}
+
+	void newgame() {   /* This sets up the DNA for a completely new game. */
+		warning("STUB: Gyro::newgame()");
+	}
+
+	void click() {   /* "Audio keyboard feedback" */
+		warning("STUB: Gyro::click()");
+	}
+
+	void slowdown() {
+		warning("STUB: Gyro::slowdown()");
+	}
+
+	bool flagset(char x) {
+		for (uint16 i = 0; i < flags.size(); i++)
+			if (flags[i] == x)
+				return true;
+		return false;
+	}
+
+	void force_numlock() {
+		if ((locks & num) > 0)  locks -= num;
+	}
+
+	bool pennycheck(uint16 howmuchby) {
+		warning("STUB: Gyro::pennycheck()");
+		return true;
+	}
+
+	// There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
+	// Keep an eye open!
+	Common::String getname(byte whose) { 
+		Common::String getname_result;
+		if (whose < 17)
+			getname_result = lads[whose];
+		else
+			getname_result = lasses[whose-17];
+		return getname_result;
+	}
+
+	// Keep an eye open! ^
+	char getnamechar(byte whose) {
+		char getnamechar_result;
+		if (whose < 16) 
+			getnamechar_result = ladchar[whose];
+		else
+			getnamechar_result = lasschar[whose-16];
+		return getnamechar_result;
+	}
+
+	// Keep an eye open! ^^
+	Common::String get_thing(byte which) {
+		Common::String get_thing_result;
+		switch (which) {
+		case wine:
+			switch (dna.winestate) {
+			case 1:
+			case 4:
+				get_thing_result = things[which];
+				break;
+			case 3:
+				get_thing_result = "Vinegar";
+				break;
+			}
+			break;
+		case onion:
+			if (dna.rotten_onion)
+				get_thing_result = "rotten onion";
+			else get_thing_result = things[which];
+			break;
+		default:
+			get_thing_result = things[which];
+		}
+		return get_thing_result;
+	}
+
+	// Keep an eye open! ^^^
+	char get_thingchar(byte which) {
+		char get_thingchar_result;
+		switch (which) {
+		case wine:
+			if (dna.winestate == 3)
+				get_thingchar_result = 'V'; /* Vinegar */
+			else
+				get_thingchar_result = thingchar[which];
+			break;
+		default:
+			get_thingchar_result = thingchar[which];
+		}
+		return get_thingchar_result;
+	}
+
+	// Keep an eye open! ^^^^
+	Common::String get_better(byte which) {
+		Common::String get_better_result;
+		if (which > 150)  which -= 149;
+		switch (which) {
+		case wine:
+			switch (dna.winestate) {
+			case 0:
+			case 1:
+			case 4:
+				get_better_result = better[which];
+				break;
+			case 3:
+				get_better_result = "some vinegar";
+				break;
+			}
+			break;
+		case onion:
+			if (dna.rotten_onion)
+				get_better_result = "a rotten onion";
+			else if (dna.onion_in_vinegar)
+				get_better_result = "a pickled onion (in the vinegar)";
+			else get_better_result = better[which];
+			break;
+		default:
+			if ((which < numobjs) && (which > '\0'))
+				get_better_result = better[which];
+			else
+				get_better_result = "";
+		}
+		return get_better_result;
+	}
+
+	// Get back here after finished with acci.pas, where vb_-s are resided.
+	Common::String f5_does()
+	/* This procedure determines what f5 does. */
+	{
+		warning("STUB: Gyro::f5_does()");
+		return "STUB: Gyro::f5_does()";
+	}
+
+	// Pobably vmc functions will deal with the mouse cursor.
+	void plot_vmc(int16 xx, int16 yy, byte page_) {
+		warning("STUB: Gyro::plot_vmc()");
+	}
+
+	void wipe_vmc(byte page_) {
+		warning("STUB: Gyro::wipe_vmc()");
+	}
+
+	void setup_vmc() {
+		warning("STUB: Gyro::setup_vmc()");
+	}
+
+	void clear_vmc() {
+		warning("STUB: Gyro::clear_vmc()");
+	}
+
+	void setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */
+		warning("STUB: Gyro::setminmaxhorzcurspos()");
+	}
+
+	void setminmaxvertcurspos(uint16 min, uint16 max) {
+		warning("STUB: Gyro::setminmaxvertcurspos()");
+	}
+
+	void load_a_mouse(byte which) {
+		warning("STUB: Gyro::load_a_mouse()");
+	}
+
+	void background(byte x) {
+		warning("STUB: Gyro::background()");
+	}
+
+	void hang_around_for_a_while() {
+		byte fv;
+
+		for (fv = 1; fv <= 28; fv ++) slowdown();
+	}
+
+	bool mouse_near_text() {
+		bool mouse_near_text_result;
+		mouse_near_text_result = (my > 144) && (my < 188);
+		return mouse_near_text_result;
+	}
+
+	/* Super_Off and Super_On are two very useful procedures. Super_Off switches
+	  the mouse cursor off, WHATEVER it's like. Super_On restores it again
+	  afterwards. */
+
+	void super_off() {
+		super_was_off = visible == m_no;
+		if (super_was_off)  return;
+
+		super_was_virtual = visible == m_virtual;
+
+		if (visible == m_virtual)  off_virtual();
+		else off();
+	}
+
+	void super_on() {
+		if ((visible != m_no) || (super_was_off))  return;
+
+		if (super_was_virtual)  on_virtual();
+		else on();
+	}
+
 
 
 	} // End of namespace Gyro
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index db02bc2..c9d8669 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -753,6 +753,9 @@ namespace Avalanche {
 	bool use_joy_a;
 
 
+
+	///////////////////////////// FUNCTIONS ///////////////////////////// 
+
 	void newpointer(byte m);
 
 	void wait();    /* makes hourglass */
@@ -767,7 +770,7 @@ namespace Avalanche {
 
 	void xycheck();
 
-	void hopto(int16 x, int16 y); /* Moves mouse void *to x,y */
+	void hopto(int16 x, int16 y); /* Moves mouse pointer to x,y */
 
 	void check();
 
@@ -791,15 +794,15 @@ namespace Avalanche {
 
 	bool pennycheck(uint16 howmuchby);
 
-	Common::String getname(char whose);
+	Common::String getname(byte whose);
 
-	char getnamechar(char whose);
+	char getnamechar(byte whose);
 
-	Common::String get_thing(char which);
+	Common::String get_thing(byte which);
 
-	char get_thingchar(char which);
+	char get_thingchar(byte which);
 
-	Common::String get_better(char which);
+	Common::String get_better(byte which);
 
 	Common::String f5_does();
 


Commit: 57504102797b2c356a83a0b3d2af382e8c8eb58e
    https://github.com/scummvm/scummvm/commit/57504102797b2c356a83a0b3d2af382e8c8eb58e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-21T09:04:59-07:00

Commit Message:
AVALANCHE: Add some detail in debug strings

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c644b30..b9b1b0f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -162,7 +162,7 @@ namespace Avalanche {
 	}
 
 	void AvalancheEngine::run(Common::String what, bool with_jsb, bool with_bflight, elm how) {
-		warning("STUB: run()"); 
+		warning("STUB: run(%s)", what.c_str()); 
 		// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 	}
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 337f896..de21881 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -35,10 +35,7 @@ namespace Avalanche {
 	Avalot::Avalot() {}
 
 	void Avalot::run(Common::String arg) {
-
-
-
-		warning("STUB: Avalot::run()");
+		warning("STUB: Avalot::run(%s)", arg.c_str());
 	}
 
 } // End of namespace Avalanche


Commit: 46849fcc42721129b4e23ab1c047c0515e44ec17
    https://github.com/scummvm/scummvm/commit/46849fcc42721129b4e23ab1c047c0515e44ec17
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-23T12:11:15-07:00

Commit Message:
AVALANCHE: Start continuously adding parts to Avalot as I proceed with the conversion of the necessary Pascal units.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index de21881..09c3ddb 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -29,10 +29,22 @@
 #include "common/textconsole.h"
 
 #include "avalanche/avalot.h"
+#include "avalanche/gyro2.h"
 
 namespace Avalanche {
 
-	Avalot::Avalot() {}
+	Avalot::Avalot() {
+		int16 gd, gm;
+
+		checkbreak = false;
+		Gyro::visible = Gyro::m_no;
+		Gyro::to_do = 0;
+		Gyro::lmo = false;
+		// resetscroll(); Needs scrolls "unit" to make it work.
+
+
+
+	}
 
 	void Avalot::run(Common::String arg) {
 		warning("STUB: Avalot::run(%s)", arg.c_str());
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 596fc02..5f10933 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -32,6 +32,8 @@
 
 namespace Avalanche {
 
+bool checkbreak; // Originally located in avalot9.map
+
 class Avalot {
 private:
 


Commit: c79387608b27856338c3a2f3099eea28829574f6
    https://github.com/scummvm/scummvm/commit/c79387608b27856338c3a2f3099eea28829574f6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-24T01:15:42-07:00

Commit Message:
AVALANCHE: Add Scrolls2. Logger is needed to proceed.

Changed paths:
  A engines/avalanche/scrolls2.cpp
  A engines/avalanche/scrolls2.h
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 09c3ddb..341efca 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -42,6 +42,7 @@ namespace Avalanche {
 		Gyro::lmo = false;
 		// resetscroll(); Needs scrolls "unit" to make it work.
 
+		warning("STUB: Avalot::Avalot()");
 
 
 	}
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index c9d8669..4c29b1f 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -56,7 +56,7 @@ namespace Avalanche {
 
 	///////////////////////////// TYPEDEFS ///////////////////////////// 
 
-	typedef void(*proc)();
+	typedef void (*proc)();
 
 	struct postype {
 		uint16 x, y, datapos;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
new file mode 100644
index 0000000..f265276
--- /dev/null
+++ b/engines/avalanche/scrolls2.cpp
@@ -0,0 +1,135 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/scrolls2.h"
+#include "avalanche/gyro2.h"
+//#include "lucerna.h"
+//#include "trip5.h"
+//#include "enhanced.h"
+//#include "logger.h"
+//#include "Acci.h"
+//#include "basher.h"
+//#include "visa.h"
+//#include "timeout.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+	namespace Scrolls {
+
+	const int16 roman = 0;
+	const int16 italic = 1;
+
+	const int16 halficonwidth = 19; /* Half the width of an icon. */
+
+	int16 dix, diy;
+	Gyro::raw ch[2];
+	byte cfont; /* Current font */
+
+	int16 dodgex, dodgey;
+	byte param; /* For using arguments code */
+
+	byte use_icon;
+
+	void state(byte x) {     /* Sets "Ready" light to whatever */
+		byte page_;
+
+		if (Gyro::ledstatus == x)  return; /* Already like that! */
+
+		warning("STUB: Scrolls::state(). Calls of Pascal units need to be removed.");
+		//switch (x) {
+		//case 0:
+		//	setfillstyle(1, black);
+		//	break; /* Off */
+		//case 1:
+		//	setfillstyle(9, green);
+		//	break; /* Half-on (menus) */
+		//case 2:
+		//	setfillstyle(1, green);
+		//	break; /* On (kbd) */
+		//case 3:
+		//	setfillstyle(6, green);
+		//	break; /* Hit a key */
+		//}
+
+		Gyro::super_off();
+
+		/*	for (page_ = 0; page_ <= 1; page_ ++) {
+		setactivepage(page_);
+		bar(419, 195, 438, 197);
+		}*/
+
+		Gyro::super_on();
+		Gyro::ledstatus = x;
+	}
+
+	void easteregg() {
+		uint16 fv, ff;
+
+		warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
+
+		/*	background(15);
+		for (fv = 4; fv <= 100; fv ++)
+		for (ff = 0; ff <= 70; ff ++) {
+		sound(fv * 100 + ff * 10);
+		delay(1);
+		}
+		nosound;
+		setcolor(10);
+		settextstyle(0, 0, 3);
+		settextjustify(1, 1);
+		outtextxy(320, 100, "GIED");
+		settextstyle(0, 0, 1);
+		settextjustify(0, 2);*/
+
+		Gyro::background(0);
+	}
+
+	void say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
+		const int16 locol = 2;
+		byte xx, yy, ox, bit, lz, t;
+		int16 yp;
+		bool offset;
+		byte itw[12][80];
+
+		offset = x % 8 == 4;
+		x = x / 8;
+		lz = z.size();
+		ox = 0;
+		// log_scrollline(); Needs Logger to work.
+
+		warning("STUB: Scrolls::say().");
+
+	}
+
+
+	
+
+	} // End of namespace Scrolls
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
new file mode 100644
index 0000000..0703833
--- /dev/null
+++ b/engines/avalanche/scrolls2.h
@@ -0,0 +1,72 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef SCROLLS2_H
+#define SCROLLS2_H
+
+#include "common/system.h"
+
+#include "avalanche/gyro2.h"
+// #include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
+
+namespace Avalanche {
+
+	namespace Scrolls {
+
+	// Call it where Scrolls are first used.
+	// Procuded to replace the initizalization part of the original Pascal unit.
+	void initialize_scrolls();
+
+	const bool aboutscroll = false; /* Is this the about box? */
+
+	void state(byte x);      /* Sets "Ready" light to whatever */
+
+	void drawscroll(Gyro::proc gotoit);      /* This is one of the oldest procs in the game. */
+
+	void bubble(Gyro::proc gotoit);
+
+	void resetscroll();
+
+	void calldrivers();
+
+	void display(Common::String z);
+
+	bool ask(Common::String question);
+
+	void natural();
+
+	Common::String lsd();
+
+	void okay();    /* Says "Okay!" */
+
+	void musical_scroll();
+
+	} // End of namespace Scrolls
+
+} // End of namespace Avalanche
+
+#endif // SCROLLS2_H


Commit: dc05ec1964e74a77ab3b1936b38794b5c158dd06
    https://github.com/scummvm/scummvm/commit/dc05ec1964e74a77ab3b1936b38794b5c158dd06
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-24T02:52:16-07:00

Commit Message:
AVALANCHE: Relocate used sources. (Should have happened sooner.)

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index f265276..a7c7a07 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -56,6 +56,11 @@ namespace Avalanche {
 
 	byte use_icon;
 
+
+	void initialize_scrolls() {
+		warning("STUB: Scrolls::initialize_scrolls()");
+	}
+
 	void state(byte x) {     /* Sets "Ready" light to whatever */
 		byte page_;
 
@@ -123,7 +128,7 @@ namespace Avalanche {
 		ox = 0;
 		// log_scrollline(); Needs Logger to work.
 
-		warning("STUB: Scrolls::say().");
+		warning("STUB: Scrolls::say()");
 
 	}
 


Commit: a267dc30251ea51acee6f6f3e1d1c5ea53ca5668
    https://github.com/scummvm/scummvm/commit/a267dc30251ea51acee6f6f3e1d1c5ea53ca5668
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-24T02:53:16-07:00

Commit Message:
AVALANCHE: Add Logger.

Changed paths:
  A engines/avalanche/logger2.cpp
  A engines/avalanche/logger2.h



diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
new file mode 100644
index 0000000..24582a4
--- /dev/null
+++ b/engines/avalanche/logger2.cpp
@@ -0,0 +1,259 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/logger2.h"
+#include "avalanche/gyro2.h"
+//#include "avalanche/trip6.h"
+
+#include "common/system.h"
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+	namespace Logger {
+
+	const char divide[] = "--- oOo ---";
+
+	/* Epson codes:
+
+	 startwith='';
+	 endwith='';
+	 double_width = #14; { shift out (SO) }
+	 double_off = #20; { device control 4 (DC4) }
+	 italic = #27+'4'; { switches italics on... }
+	 italic_off = #27+'5'; { and off. }
+	 emph_on = #27+#69;
+	 emph_off = #27+#70;
+	 divide_indent = 15;
+
+	*/
+
+	/* L'jet codes: */
+
+	//// Not sure if these will be needed at all...
+	//
+	//const Common::String startwith = Common::String('\33') + '\50' + "10J" + '\130';
+	//const Common::String endwith = Common::String('\33') + '\105';
+	//const Common::String italic = Common::String('\33') + '\50' + '\163' + '\61' + '\123'; /* switches italics on... */
+	//const Common::String italic_off = Common::String('\33') + '\50' + '\163' + '\60' + '\123'; /* and off. */
+	//const Common::String emph_on = Common::String('\33') + '\50' + '\163' + '\63' + '\102';
+	//const Common::String emph_off = Common::String('\33') + '\50' + '\163' + '\60' + '\102';
+	//
+	//const Common::String double_width = emph_on; /* There IS no double-width. */
+	//const Common::String double_off = emph_off; /* So we'll have to use bold. */
+
+
+	const Common::String quote = "ª";
+	const Common::String unquote = "º";
+	const Common::String copyright = "(c)";
+	const int16 divide_indent = 30;
+
+	Common::String scroll_line;
+	byte scroll_line_length;
+
+	void centre(byte size, byte x) { /* Prints req'd number of spaces. */
+		byte fv;
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::centre()");
+		/*for (fv = 1; fv <= size - (x / 2); fv ++)
+		output << logfile << ' ';*/
+	}
+
+	void log_setup(Common::String name, bool printing) {     /* Sets up. */
+
+		warning("STUB: Logger::log_setup()");
+
+		/*	assign(logfile, name);
+		rewrite(logfile);
+		output << logfile << startwith;
+		log_epson = printing;
+		logging = true;
+
+		if (! printing)  {
+		quote = '"';
+		unquote = '"';
+		copyright = "(c)";
+		}*/
+	}
+
+	void log_divider() {   /* Prints the divider sign. */
+		byte fv;
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_divider()");
+
+		/*if (Gyro::log_epson) {
+		output << logfile << Common::String(' ') + double_width;
+		for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
+		output << logfile << Common::String(' ') + double_off;
+		} else
+		for (fv = 1; fv <= 36; fv ++) output << logfile << ' ';
+		output << logfile << divide << NL;*/
+	}
+
+	void log_command(Common::String x) {     /* Prints a command */
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_command()");
+
+		/*if (Gyro::log_epson)
+		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
+		else
+		output << logfile << Common::String("> ") + x << NL;*/
+	}
+
+	void log_addstuff(Common::String x) {
+		if (! Gyro::logging)  return;
+		scroll_line += x;
+	}
+
+	void log_scrollchar(Common::String x) {     /* print one character */
+		Common::String z;
+		if (! Gyro::logging)  return;
+		switch (x[1]) {
+		case '`':
+			z = quote;
+			break; /* Open quotes: "66" */
+		case '"':
+			z = unquote;
+			break; /* Close quotes: "99" */
+		case '\357':
+			z = copyright;
+			break; /* Copyright sign. */
+		default:
+			z = x;
+		}
+		log_addstuff(z);
+		scroll_line_length += z.size();
+	}
+
+	void log_italic() {
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_italic()");
+
+		/*if (Gyro::log_epson)
+		log_addstuff(italic);
+		else
+		log_addstuff("*");*/
+	}
+
+	void log_roman() {
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_roman()");
+
+		/*	if (Gyro::log_epson)
+		log_addstuff(italic_off);
+		else
+		log_addstuff("*");*/
+	}
+
+	void log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_epsonroman()");
+
+		//if (Gyro::log_epson)  log_addstuff(italic_off);
+	}
+
+	void log_scrollline() {   /* Set up a line for the scroll driver */
+		scroll_line_length = 0;
+		scroll_line = "";
+	}
+
+	void log_scrollendline(bool centred) {
+		byte x, fv;
+		if (! Gyro::logging)  return;
+		x = 17;
+		if (centred)  x += (50 - scroll_line_length) / 2;
+
+		warning("STUB: Logger::log_scrollendline()");
+
+		/*for (fv = 1; fv <= x; fv ++) output << logfile << ' ';
+		output << logfile << scroll_line << NL;*/
+	}
+
+	void log_bubbleline(byte linenum, byte whom, Common::String x) {
+		byte fv;
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_bubbleline()");
+
+		/*if (linenum == 1) {
+		for (fv = 1; fv <= 15; fv ++) output << logfile << ' ';
+		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
+		} else {
+		for (fv = 1; fv <= 17; fv ++) output << logfile << ' ';
+		output << logfile << x << NL;
+		}*/
+	}
+
+	void log_newline() {
+		warning("STUB: Logger::log_newline()");
+
+		//if (Gyro::logging)  output << logfile << NL;
+	}
+
+	void log_newroom(Common::String where) {
+		byte fv;
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_newroom()");
+
+		/*for (fv = 1; fv <= 20; fv ++) output << logfile << ' ';
+		if (Gyro::log_epson)  output << logfile << emph_on;
+		output << logfile << Common::String('(') + where + ')';
+		if (Gyro::log_epson)  output << logfile << emph_off;
+		output << logfile << NL;*/
+	}
+
+	void log_aside(Common::String what)
+	/* This writes "asides" to the printer. For example, moves in Nim. */
+	{
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_aside()");
+
+		//output << logfile << "   (" << italic << what << italic_off << ')' << NL;
+		/* "What" is what to write. */
+	}
+
+	void log_score(uint16 credit, uint16 now) {
+		byte fv;
+		if (! Gyro::logging)  return;
+
+		warning("STUB: Logger::log_score()");
+
+		/*for (fv = 1; fv <= 50; fv ++) output << logfile << ' ';
+		output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
+	}
+
+	} // End of namespace Logger
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h
new file mode 100644
index 0000000..a1b7882
--- /dev/null
+++ b/engines/avalanche/logger2.h
@@ -0,0 +1,69 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef LOGGER2_H
+#define LOGGER2_H
+
+#include "common/system.h"
+
+namespace Avalanche {
+
+	namespace Logger {
+
+	void log_setup(Common::String name, bool printing);
+
+	void log_divider();    /* Prints the divider sign. */
+
+	void log_command(Common::String x);      /* Prints a command */
+
+	void log_scrollchar(Common::String x);      /* print one character */
+
+	void log_italic();
+
+	void log_roman();
+
+	void log_epsonroman();
+
+	void log_scrollline();    /* Set up a line for the scroll driver */
+
+	void log_scrollendline(bool centred);
+
+	void log_bubbleline(byte linenum, byte whom, Common::String x);
+
+	void log_newline();
+
+	void log_newroom(Common::String where);
+
+	void log_aside(Common::String what);
+
+	void log_score(uint16 credit, uint16 now);
+
+	} // End of namespace Logger
+
+} // End of namespace Avalanche
+
+#endif // LOGGER2_H


Commit: 11efe29da865deb8ccefcb289a557b618ebf7e29
    https://github.com/scummvm/scummvm/commit/11efe29da865deb8ccefcb289a557b618ebf7e29
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-25T04:05:04-07:00

Commit Message:
AVALANCHE: Add Enhanced.

Changed paths:
  A engines/avalanche/enhanced2.cpp
  A engines/avalanche/enhanced2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
new file mode 100644
index 0000000..c5b0388
--- /dev/null
+++ b/engines/avalanche/enhanced2.cpp
@@ -0,0 +1,59 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/enhanced2.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+	namespace Enhanced {
+
+	bool isenh() {
+		warning("STUB: Enhanced::isenh()");
+	}
+
+	void readkeye() {
+		warning("STUB: Enhanced::readkeye()");
+	}
+
+	bool keypressede() {
+	/*
+	 function fancystuff:boolean;
+	  inline( $B4/ $11/  { MOV AH,11 }
+			  $CD/ $16/  { INT 16 }
+			  $B8/ $00/ $00/ { MOV AX, 0000 }
+			  $74/ $01/  { JZ 0112 (or wherever- the next byte after $40, anyway) }
+			  $40);      { INC AX }
+	*/
+	
+		warning("STUB: Enhanced::keypressede()");
+	}
+
+	} // End of namespace Enhanced
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
new file mode 100644
index 0000000..d696c32
--- /dev/null
+++ b/engines/avalanche/enhanced2.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+
+
+// Not sure if this unit will be used at all in the end...
+
+#ifndef ENHANCED2_H
+#define ENHANCED2_H
+
+#include "common/system.h"
+
+namespace Avalanche {
+
+	namespace Enhanced {
+
+	byte shiftstate;	/*ABSOLUTE $40:$17;*/
+	bool atbios;
+	char inchar, extd;
+
+	void readkeye();
+
+	bool keypressede();
+
+	} // End of namespace Enhanced
+
+} // End of namespace Avalanche
+
+#endif // ENHANCED2_H
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 6c77279..fba155a 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -324,8 +324,6 @@ namespace Avalanche {
 		else on();
 	}
 
-
-
 	} // End of namespace Gyro
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index a7c7a07..cbbd2e1 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -27,10 +27,10 @@
 
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
+#include "avalanche/logger2.h"
 //#include "lucerna.h"
 //#include "trip5.h"
 //#include "enhanced.h"
-//#include "logger.h"
 //#include "Acci.h"
 //#include "basher.h"
 //#include "visa.h"
@@ -126,12 +126,130 @@ namespace Avalanche {
 		x = x / 8;
 		lz = z.size();
 		ox = 0;
-		// log_scrollline(); Needs Logger to work.
+		Logger::log_scrollline();
+
+		for (xx = 1; xx <= lz; xx ++) {
+			switch (z[xx]) {
+			case '\22': {
+				cfont = roman;
+				Logger::log_roman();
+						}
+						break;
+			case '\6': {
+				cfont = italic;
+				Logger::log_italic();
+					   }
+					   break;
+			default: {
+				ox += 1;
+				for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
+				Logger::log_scrollchar(z[xx]);
+					 }
+			}
+		}
+
+		lz = ox;
+		if (offset) {
+			/* offsetting routine */
+			lz += 1;
+			for (yy = 1; yy <= 12; yy ++) {
+				bit = 240;
+				itw[yy][lz] = 255;
+				for (xx = 1; xx <= lz; xx ++) {
+					t = itw[yy][xx];
+					itw[yy][xx] = bit + t / 16;
+					bit = t << 4;
+				}
+			}
+		}
+		yp = x + y * 80 + (1 - Gyro::cp) * Gyro::pagetop;
+		for (yy = 1; yy <= 12; yy ++) {
+			yp += 80;
+			for (bit = 0; bit <= locol; bit ++) {
+				/*port[0x3c4] = 2;
+				port[0x3ce] = 4;
+				port[0x3c5] = 1 << bit;
+				port[0x3cf] = bit;
+				move(itw[yy], mem[0xa000 * yp], lz);
+				
+				Some old Pascal-ish. To be removed. */
+
+				warning("STUB: Scrolls::say()");
+			}
+		}
+
+	}
+
+	/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
+
+	void normscroll() {
+		warning("STUB: Scrolls::normscroll()");
+	}
+
+	void dialogue() {
+		warning("STUB: Scrolls::dialogue()");
+	}
+
+	void music_scroll();
+
+
+	static void store_(byte what, Gyro::tunetype &played) {
+		memcpy(played, played+1, sizeof(played) - 1);
+		played[30] = what;
+	}
+
+
+
+	static bool they_match(Gyro::tunetype &played) {
+		byte fv, mistakes;
+
+		bool they_match_result;
+		mistakes = 0;
 
-		warning("STUB: Scrolls::say()");
+		for (fv = 1; fv <= sizeof(played); fv ++)
+			if (played[fv] != Gyro::tune[fv]) {
+				mistakes++;
+			}
 
+			they_match_result = mistakes < 5;
+			return they_match_result;
 	}
 
+	void music_scroll() {
+		char r;
+		byte value;
+
+		byte last_one, this_one;
+
+		Gyro::tunetype played;
+
+
+		state(3);
+		Gyro::seescroll = true;
+		Gyro::on();
+		Gyro::newpointer(4);
+		//do {
+		//	do {
+		//		Gyro::check(); /* was "checkclick;" */
+		//		if (keypressede())  break;
+		//	} while (!(mpress > 0) || buttona1() || buttonb1());
+		//	
+		//	Needs Enhanced (conatins keypressede()) to proceed.
+
+
+
+	}
+
+
+
+
+
+
+
+
+
+
+
 
 	
 


Commit: c39434f37ee24b44c354dc765ad18309471d394a
    https://github.com/scummvm/scummvm/commit/c39434f37ee24b44c354dc765ad18309471d394a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-25T09:03:46-07:00

Commit Message:
AVALANCHE: Add Lucerna.

Changed paths:
  A engines/avalanche/lucerna2.cpp
  A engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
new file mode 100644
index 0000000..88db23e
--- /dev/null
+++ b/engines/avalanche/lucerna2.cpp
@@ -0,0 +1,81 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "common/system.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/logger2.h"
+#include "avalanche/enhanced2.h"
+
+//#include "Graph.h"
+///*#include "Dos.h"*/
+///*#include "Crt.h"*/
+//#include "trip5.h"
+//#include "Acci.h"
+//#include "pingo.h"
+//#include "dropdown.h"
+//#include "visa.h"
+//#include "celer.h"
+//#include "timeout.h"
+//#include "basher.h"
+//#include "sequence.h"
+
+namespace Avalanche {
+
+	namespace Lucerna {
+
+	bool fxhidden;
+
+	struct rgbrec {
+		int16 red;
+		int16 green;
+		int16 blue;
+	};
+
+	struct palettetype {
+		int32 size;
+		rgbrec colors[256];
+	};
+
+	palettetype fxpal[4];
+
+	void callverb(char n) {
+		/*if (n == pardon)
+		Scrolls::display(
+		"The f5 key lets you do a particular action in certain "
+		"situations. However, at the moment there is nothing "
+		"assigned to it. You may press alt-A to see what the "
+		"current setting of this key is.");*/
+
+		// Needs const char pardon located in Acci.
+
+	}
+
+	} // End of namespace Lucerna
+
+} // End of namespace Avalanche
\ No newline at end of file
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
new file mode 100644
index 0000000..bee9c10
--- /dev/null
+++ b/engines/avalanche/lucerna2.h
@@ -0,0 +1,114 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef LUCERNA2_H
+#define LUCERNA2_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+
+	namespace Lucerna {
+
+	// Call it where Lucerna is first used.
+	// Procuded to replace the initizalization part of the original Pascal unit.
+	void initialize_lucerna();
+
+	void callverb(char n);
+
+	void draw_also_lines();
+
+	void mouse_init();
+
+	void mousepage(uint16 page_);
+
+	void load(byte n);
+
+	void exitroom(byte x);
+
+	void enterroom(byte x, byte ped);
+
+	void thinkabout(char z, bool th);      /* Hey!!! Get it and put it!!! */
+
+	void load_digits();    /* Load the scoring digits & rwlites */
+
+	void toolbar();
+
+	void showscore();
+
+	void points(byte num);      /* Add on no. of points */
+
+	void mouseway();
+
+	void inkey();
+
+	void posxy();
+
+	void fxtoggle();
+
+	void objectlist();
+
+	void checkclick();
+
+	void errorled();
+
+	void dusk();
+
+	void dawn();
+
+	void showrw();
+
+	void mblit(byte x1, byte y1, byte x2, byte y2, byte f, byte t); /* The Minstrel Blitter */
+
+	void blitfix();
+
+	void clock_lucerna();
+
+	void flip_page();
+
+	void delavvy();
+
+	void gameover();
+
+	void minor_redraw();
+
+	void major_redraw();
+
+	uint16 bearing(byte whichped);
+
+	void flesh_colours();
+
+	void sprite_run();
+
+	void fix_flashers();
+
+	} // End of namespace Lucerna
+
+} // End of namespace Avalanche
+
+
+#endif // LUCERNA2_H


Commit: 7f1a322de484a8958db46dc34ab134285fc9c886
    https://github.com/scummvm/scummvm/commit/7f1a322de484a8958db46dc34ab134285fc9c886
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-25T09:04:52-07:00

Commit Message:
AVALANCHE: Repair compilation.

Changed paths:
    engines/avalanche/avalot.h
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 5f10933..073b073 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -32,10 +32,9 @@
 
 namespace Avalanche {
 
-bool checkbreak; // Originally located in avalot9.map
-
 class Avalot {
 private:
+	bool checkbreak; // Originally located in avalot9.map
 
 public:
 	Avalot();
diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
index c5b0388..7a9a58f 100644
--- a/engines/avalanche/enhanced2.cpp
+++ b/engines/avalanche/enhanced2.cpp
@@ -35,6 +35,7 @@ namespace Avalanche {
 
 	bool isenh() {
 		warning("STUB: Enhanced::isenh()");
+		return true;
 	}
 
 	void readkeye() {
@@ -52,6 +53,7 @@ namespace Avalanche {
 	*/
 	
 		warning("STUB: Enhanced::keypressede()");
+		return true;
 	}
 
 	} // End of namespace Enhanced
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index d696c32..98ef781 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -39,7 +39,7 @@ namespace Avalanche {
 	namespace Enhanced {
 
 	byte shiftstate;	/*ABSOLUTE $40:$17;*/
-	bool atbios;
+	bool atbios; // BIOS type
 	char inchar, extd;
 
 	void readkeye();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index cbbd2e1..57c15a2 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -28,9 +28,10 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/logger2.h"
+#include "avalanche/enhanced2.h"
+
 //#include "lucerna.h"
 //#include "trip5.h"
-//#include "enhanced.h"
 //#include "Acci.h"
 //#include "basher.h"
 //#include "visa.h"
@@ -143,7 +144,7 @@ namespace Avalanche {
 			default: {
 				ox += 1;
 				for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
-				Logger::log_scrollchar(z[xx]);
+				Logger::log_scrollchar(Common::String(z[xx]));
 					 }
 			}
 		}
@@ -229,15 +230,19 @@ namespace Avalanche {
 		Gyro::on();
 		Gyro::newpointer(4);
 		//do {
-		//	do {
-		//		Gyro::check(); /* was "checkclick;" */
-		//		if (keypressede())  break;
-		//	} while (!(mpress > 0) || buttona1() || buttonb1());
-		//	
-		//	Needs Enhanced (conatins keypressede()) to proceed.
-
-
-
+			//do {
+			//	Gyro::check(); /* was "checkclick;" */
+			//	if (Enhanced::keypressede())  break;
+			//} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
+			//
+			// Needs joystick - not sure it will be implemented.
+			
+			//if (Gyro::mpress == 0) {
+			//	inkey(); Needs Lucerna to proceed.
+			//	
+			//}
+		//}
+	
 	}
 
 
@@ -250,7 +255,6 @@ namespace Avalanche {
 
 
 
-
 	
 
 	} // End of namespace Scrolls


Commit: ca807d74bf33d062516093aac27921853f658b77
    https://github.com/scummvm/scummvm/commit/ca807d74bf33d062516093aac27921853f658b77
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-26T02:04:29-07:00

Commit Message:
AVALANCHE: Add Visa.

Changed paths:
  A engines/avalanche/visa2.cpp
  A engines/avalanche/visa2.h



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
new file mode 100644
index 0000000..ee1f761
--- /dev/null
+++ b/engines/avalanche/visa2.cpp
@@ -0,0 +1,76 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/visa2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/scrolls2.h"
+//#include "avalanche/acci2.h"
+#include "avalanche/lucerna2.h"
+
+#include "common/textconsole.h"
+
+/*#include "Trip5.h"*/
+
+namespace Avalanche {
+
+	namespace Visa {
+
+	const bool bubbling = false;
+	const bool report_dixi_errors = true;
+
+	bool went_ok;
+
+	void unskrimble() {
+		for (uint16  fv = 0; fv < Gyro::bufsize; fv++) 
+			Gyro::buffer[fv] = (char)((!(Gyro::buffer[fv]) - fv) % 256);
+	}
+
+	void do_the_bubble() {
+		Gyro::bufsize++;
+		Gyro::buffer[Gyro::bufsize] = 2;
+	}
+
+	// File handling.
+	void dixi(char block, byte point) {
+		warning("STUB: Visa::dixi()");
+	}
+
+	// File handling.
+	void speech(byte who, byte subject) {
+		warning("STUB: Visa::speech()");
+	}
+
+	void talkto(byte whom) {
+		byte fv;
+		bool no_matches;
+
+		warning("STUB: Visa::talkto()");
+	}
+
+	} // End of namespace Visa.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
new file mode 100644
index 0000000..feda7b6
--- /dev/null
+++ b/engines/avalanche/visa2.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef VISA2_H
+#define VISA2_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+
+	namespace Visa {
+
+	void dixi(char block, byte point);
+
+	void talkto(byte whom);
+
+	} // End of namespace Visa.
+
+} // End of namespace Avalanche.
+
+#endif // VISA2_H


Commit: 3e48a4e18725f2b3b6b1f1a3476b848a93af2f42
    https://github.com/scummvm/scummvm/commit/3e48a4e18725f2b3b6b1f1a3476b848a93af2f42
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-26T05:14:01-07:00

Commit Message:
AVALANCHE:  Add Celer.

Changed paths:
  A engines/avalanche/celer2.cpp
  A engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
new file mode 100644
index 0000000..6efabea
--- /dev/null
+++ b/engines/avalanche/celer2.cpp
@@ -0,0 +1,397 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#include "avalanche/celer2.h"
+#include "common/textconsole.h"
+//#include "avalanche/trip6.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/roomnums.h"
+
+namespace Avalanche {
+
+	namespace Celer {
+
+	//untyped_file f; /* Private variable- not accessible from elsewhere. */
+
+	const int16 on_disk = -1; /* Value of memos[fv].x when it's not in memory. */
+
+	void pics_link() {
+		byte xx;
+
+		if (Gyro::ddmnow)  return; /* No animation when the menus are up. */
+
+		{
+			Gyro::dnatype &with = Gyro::dna;
+			switch (with.room) {
+
+			case r__outsideargentpub: {
+				if ((Gyro::roomtime % int32(12)) == 0)
+					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(4));
+			}
+			break;
+
+			case r__brummieroad:
+				if ((Gyro::roomtime % int32(2)) == 0)
+					show_one(int32(1) + (Gyro::roomtime / int32(2)) % int32(4));
+				break;
+
+			case r__bridge:
+				if ((Gyro::roomtime % int32(2)) == 0)
+					show_one(int32(4) + (Gyro::roomtime / int32(2)) % int32(4));
+				break;
+
+			case r__yours:
+				if ((! with.avvy_is_awake) && ((Gyro::roomtime % int32(4)) == 0))
+					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(2));
+				break;
+
+			case r__argentpub: {
+				if (((Gyro::roomtime % int32(7)) == 1) && (Gyro::dna.malagauche != 177)) {
+					/* Malagauche cycle */
+					Gyro::dna.malagauche += 1;
+					switch (Gyro::dna.malagauche) {
+					case 1:
+					case 11:
+					case 21:
+						show_one(12);
+						break; /* Looks forwards. */
+					case 8:
+					case 18:
+					case 28:
+					case 32:
+						show_one(11);
+						break; /* Looks at you. */
+					case 30:
+						show_one(13);
+						break; /* Winks. */
+					case 33:
+						Gyro::dna.malagauche = 0;
+						break;
+					}
+				}
+
+				switch (Gyro::roomtime % 200) {
+				case 179:
+				case 197:
+					show_one(5);
+					break; /* Dogfood's drinking cycle */
+				case 182:
+				case 194:
+					show_one(6);
+					break;
+				case 185:
+					show_one(7);
+					break;
+				case 199:
+					Gyro::dna.dogfoodpos = 177;
+					break; /* Impossible value for this. */
+				}
+
+				if ((Gyro::roomtime % 200 >= 0) && (Gyro::roomtime % 200 <= 178)) { /* Normally. */
+					if (((Lucerna::bearing(2) >= 1) && (Lucerna::bearing(2) <= 90)) || ((Lucerna::bearing(2) >= 358) && (Lucerna::bearing(2) <= 360)))
+						xx = 3;
+					else if ((Lucerna::bearing(2) >= 293) && (Lucerna::bearing(2) <= 357))
+						xx = 2;
+					else if ((Lucerna::bearing(2) >= 271) && (Lucerna::bearing(2) <= 292))
+						xx = 4;
+
+					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
+						show_one(xx);
+						Gyro::dna.dogfoodpos = xx;
+					}
+				}
+				
+			}
+			break;
+
+			case r__westhall:
+				if ((Gyro::roomtime % int32(3)) == 0)
+					switch ((Gyro::roomtime / int32(3)) % int32(6)) {
+					case 4:
+						show_one(1);
+						break;
+					case 1:
+					case 3:
+					case 5:
+						show_one(2);
+						break;
+					case 0:
+					case 2:
+						show_one(3);
+						break;
+					}
+				break;
+
+			case r__lustiesroom:
+				if (!(Gyro::dna.lustie_is_asleep))  {
+					if ((Gyro::roomtime % int32(45)) > 42)
+						xx = 4; /* du Lustie blinks */
+
+					/* Bearing of Avvy from du Lustie. */
+					else if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360)))
+							xx = 1; /* Middle. */
+					else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180))
+							xx = 2; /* Left. */
+					else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314))
+						xx = 3; /* Right. */
+
+					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
+						show_one(xx);
+						Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+					}
+				}
+				break;
+
+			case r__aylesoffice:
+				if ((! Gyro::dna.ayles_is_awake) && (Gyro::roomtime % int32(14) == 0)) {
+					switch ((Gyro::roomtime / int32(14)) % int32(2)) {
+					case 0:
+						show_one(1);
+						break; /* Frame 2: EGA. */
+					case 1:
+						show_one(3);
+						break; /* Frame 1: Natural. */
+					}
+				}
+				break;
+
+			case r__robins:
+				if (Gyro::dna.tied_up)
+					switch (Gyro::roomtime % int32(54)) {
+					case 20:
+						show_one(4);
+						break; /* Frame 4: Avalot blinks. */
+					case 23:
+						show_one(2);
+						break; /* Frame 1: Back to normal. */
+					}
+				break;
+
+			case r__nottspub: {
+				/* Bearing of Avvy from Port. */
+				if (((Lucerna::bearing(5) >= 0) && (Lucerna::bearing(5) <= 45)) || ((Lucerna::bearing(5) >= 315) && (Lucerna::bearing(5) <= 360)))
+					xx = 2; /* Middle. */
+				else if ((Lucerna::bearing(5) >= 45) && (Lucerna::bearing(5) <= 180))
+					xx = 6; /* Left. */
+				else if ((Lucerna::bearing(5) >= 181) && (Lucerna::bearing(5) <= 314))
+					xx = 8; /* Right. */
+
+				if ((Gyro::roomtime % int32(60)) > 57)  xx--; /* Blinks */
+
+				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
+					show_one(xx);
+					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+				}
+
+				switch (Gyro::roomtime % 50) {
+				case 45 :
+					show_one(9);
+					break; /* Spurge blinks */
+				case 49 :
+					show_one(10);
+					break;
+				}
+			}
+			break;
+
+			case r__ducks: {
+				if ((Gyro::roomtime % 3) == 0) /* The fire flickers */
+					show_one(1 + (Gyro::roomtime / 3) % 3);
+
+				{/* Lucerna::bearing of Avvy from Duck. */
+				if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360)))
+					xx = 4; /* Middle. */
+				else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180))
+					xx = 6; /* Left. */
+				else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314))
+					xx = 8; /* Right. */
+
+				if ((Gyro::roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */
+
+				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
+					show_one(xx);
+					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+				}
+			}
+			break;
+
+			}
+		}
+
+		if ((Gyro::dna.ringing_bells) && (Gyro::flagset('B')))
+			/* They're ringing the bells. */
+			switch (Gyro::roomtime % int32(4)) {
+			case 1: {
+				Gyro::dnatype &with = Gyro::dna;
+
+				if (with.nextbell < 5)  with.nextbell = 12;
+				with.nextbell -= 1;
+				Gyro::note(Gyro::notes[with.nextbell]);
+			}
+			break;
+			case 2:
+				//nosound;
+				warning("STUB: Celer::pics_link()");
+				break;
+			}
+		}
+	}
+
+	void load_chunks(Common::String xx) {
+		warning("STUB: Celer::load_chunks()");
+	}
+
+	void forget_chunks() {
+		warning("STUB: Celer::forget_chunks()");
+	}
+
+	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) /* assembler;
+	asm
+	  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
+	  push bp;      { Nor BP! }
+
+
+	  { DI holds the offset on this page. It starts at the top left-hand corner. }
+	  { (It should equal ch.y*80+ch.x. }
+
+	  mov ax,y;
+	  mov dl,80;
+	  mul dl; { Line offset now calculated. }
+	  mov di,ax; { Move it into DI. }
+	  mov ax,x;
+	  add di,ax; { Full offset now calculated. }
+
+	  mov bx,yl; { No. of times to repeat lineloop. }
+	  inc bx;        { "loop" doesn't execute the zeroth time. }
+	  mov bh,bl;     { Put it into BH. }
+
+	  { BP holds the length of the Common::String to copy. It's equal to ch.xl.}
+
+	  mov ax,uint16(p);   { Data is held at DS:SI. }
+	  mov si,ax;
+	  mov ax,uint16(p+2); { This will be moved over into ds in just a tick... }
+
+	  mov bp,xl;
+
+	  mov ds,ax;
+
+
+	  cld;          { We're allowed to hack around with the flags! }
+
+	  mov ax,$AC00; { Top of the first EGA page. }
+	  mov es,ax;    { Offset on this page is calculated below... }
+
+
+	{    port[$3c4]:=2; port[$3ce]:=4; }
+
+	  mov dx,$3c4;
+	  mov al,2;
+	  out dx,al;
+	  mov dx,$3ce;
+	  mov al,4;
+	  out dx,al;
+
+	  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
+	  mov bl,0;
+
+
+	 @mainloop:
+
+		push di;
+		push cx;
+
+	{    port[$3C5]:=1 shl bit; }
+		mov dx,$3C5;
+		mov al,1;
+		mov cl,bl; { BL = bit. }
+		shl al,cl;
+		out dx,al;
+	{     port[$3CF]:=bit; }
+		mov dx,$3CF;
+		mov al,bl; { BL = bit. }
+		out dx,al;
+
+		xor ch,ch;
+		mov cl,bh; { BH = ch.yl. }
+
+	   @lineloop:
+
+		 push cx;
+
+		 mov cx,bp;
+
+		 repz movsb; { Copy the data. }
+
+		 sub di,bp;
+		 add di,80;
+
+		 pop cx;
+
+	   loop @lineloop;
+
+		inc bl; { One more on BL. }
+
+		pop cx;
+		pop di;
+
+	 loop @mainloop;
+
+	  pop bp;
+	  pop ds;       { Get DS back again. }
+	*/
+	{
+	}
+
+	void show_one(byte which);
+
+	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) {
+		warning("STUB: Celer::display_it()");
+	}
+
+	void show_one(byte which) {
+		warning("STUB: Celer::show_one()");
+	}
+
+
+
+	void show_one_at(byte which, int16 xxx, int16 yyy);
+
+	static void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
+		warning("STUB: Celer::display_it1()");
+	}
+
+	void show_one_at(byte which, int16 xxx, int16 yyy) {
+		warning("STUB: Celer::show_one_at()");
+	}
+
+
+	} // End of namespace Celer.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
new file mode 100644
index 0000000..466ed8d
--- /dev/null
+++ b/engines/avalanche/celer2.h
@@ -0,0 +1,80 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#ifndef CELER2_H
+#define CELER2_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+
+	namespace Celer {
+
+		enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
+
+		struct chunkblocktype {
+			flavourtype flavour;
+			int16 x, y;
+			int16 xl, yl;
+			int32 size;
+			bool natural;
+
+			bool memorise; /* Hold it in memory? */
+		};
+
+		struct memotype {
+			int16 x, y;
+			int16 xl, yl;
+			flavourtype flavour;
+			uint16 size;
+		};
+
+		int32 offsets[40];
+		byte num_chunks = 0;
+		memotype memos[40];
+		void *memory[40];
+
+
+
+		void pics_link();
+
+		void load_chunks(Common::String xx);
+
+		void forget_chunks();
+
+		void show_one(byte which);
+
+		void show_one_at(byte which, int16 xxx, int16 yyy);
+
+	} // End of namespace Celer.
+
+} // End of namespace Avalanche.
+
+#endif // CELER2_H


Commit: b8073372827401f1e3e271666490696a4bd9f9f4
    https://github.com/scummvm/scummvm/commit/b8073372827401f1e3e271666490696a4bd9f9f4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-26T06:42:05-07:00

Commit Message:
AVALANCHE: Add Sequence.

Changed paths:
  A engines/avalanche/sequence2.cpp
  A engines/avalanche/sequence2.h



diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
new file mode 100644
index 0000000..851dcb1
--- /dev/null
+++ b/engines/avalanche/sequence2.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* SEQUENCE		The sequencer. */
+
+#include "avalanche/sequence2.h"
+#include "common/scummsys.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/trip6.h"
+
+namespace Avalanche {
+
+	namespace Sequence {
+
+	void then_show(byte what) {
+		byte fv;
+		for (fv = 1; fv <= seq_length; fv ++)
+			if (seq[fv] == 0) {
+				seq[fv] = what;
+				return;
+			}
+	}
+
+	void first_show(byte what) {
+		/* First, we need to blank out the entire array. */
+		for (int i = 0; i < sizeof(seq); i++)
+			seq[i] = 0;
+
+		/* Then it's just the same as then_show. */
+		then_show(what);
+
+	}
+
+	void then_flip(byte where, byte ped) {
+		then_show(now_flip);
+
+		Gyro::dna.flip_to_where = where;
+		Gyro::dna.flip_to_ped = ped;
+	}
+
+	void start_to_close() {
+		Timeout::lose_timer(Timeout::reason_sequencer);
+		Timeout::set_up_timer(7, Timeout::PROCsequence, Timeout::reason_sequencer);
+	}
+
+	void start_to_open() {
+		Gyro::dna.user_moves_avvy = false; /* They can't move. */
+		Trip::stopwalking(); /* And they're not moving now. */
+		start_to_close(); /* Apart from that, it's the same thing. */
+	}
+
+	void call_sequencer();
+
+	/* This PROC is called by Timeout when it's time to do another frame. */
+	static void shove_left() {
+		memcpy(seq, seq+1, seq_length - 1); /* Shift everything to the left. */
+	}
+
+	void call_sequencer() {
+		switch (seq[0]) {
+		case 0:
+			return;
+			break; /* No more routines. */
+		case 177: {
+			Gyro::dna.user_moves_avvy = true;
+			Trip::fliproom(Gyro::dna.flip_to_where, Gyro::dna.flip_to_ped); /* 177 = Flip room. */
+			if (seq[0] == 177)  shove_left();
+			}
+			break;
+		}
+
+		if ((seq[0] >= 1) && (seq[0] <= 176)) {
+			/* Show a frame. */
+			Celer::show_one(seq[1]);
+			shove_left();
+		}
+	
+		start_to_close(); /* Make sure this PROC gets called again. */
+	}
+
+	} // End of namespace Sequence .
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
new file mode 100644
index 0000000..0e53ccf
--- /dev/null
+++ b/engines/avalanche/sequence2.h
@@ -0,0 +1,65 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* SEQUENCE		The sequencer. */
+
+#ifndef SEQUENCE2_H
+#define SEQUENCE2_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+
+	namespace Sequence {
+
+		const int16 now_flip = 177;
+
+		const int16 seq_length = 10;
+
+
+
+		byte seq[seq_length];
+
+
+
+		void first_show(byte what);
+
+		void then_show(byte what);
+
+		void then_flip(byte where, byte ped);
+
+		void start_to_close();
+
+		void start_to_open();
+
+		void call_sequencer();
+
+	} // End of namespace Sequence .
+
+} // End of namespace Avalanche.
+
+#endif // SEQUENCE2_H


Commit: f558eb2e5689ed343bfd64502e45787e61a17ce4
    https://github.com/scummvm/scummvm/commit/f558eb2e5689ed343bfd64502e45787e61a17ce4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-26T23:35:21-07:00

Commit Message:
AVALANCHE: Add Enid.

Changed paths:
  A engines/avalanche/enid2.cpp
  A engines/avalanche/enid2.h



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
new file mode 100644
index 0000000..9c7d64a
--- /dev/null
+++ b/engines/avalanche/enid2.cpp
@@ -0,0 +1,327 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ENID		Edna's manager. */
+
+#include "common/scummsys.h"
+#include "common/textconsole.h"
+
+#include "avalanche/enid2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/sequence2.h"
+//#include "fileunit.h"
+//#include "basher.h"
+
+
+namespace Avalanche {
+
+	namespace Enid {
+
+	const Common::String crlf = Common::String(char(15)) + Common::String(char(12));
+	const char tab = '\t';
+	const char eof_ = '\n';
+
+	const Common::String ednafirst =
+		Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + /*64*/
+		crlf + eof_ + crlf + crlf + /*7*/
+		tab + "Glory to God in the highest," + crlf + /*31*/
+		tab + "and on earth peace, goodwill toward men." + /*42*/
+		crlf + tab + tab + tab + tab + /*6*/
+		"Luke 2:14." + /*10*/
+		crlf + crlf + crlf + /* 6 */
+		"1234567890" +crlf; /*11*/
+
+	const Common::String ednaid = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
+
+	const int16 ttage = 18;
+	const Common::String ttwashere = "Thomas was here ";
+
+	bool bug;
+
+
+
+	Common::String expanddate(byte d, byte m, uint16 y);
+ 
+	static Common::String month;
+
+	static Common::String day;
+
+	static void addon(Common::String x) {
+		//month[0]--;
+		month = month + x;
+	}
+
+	Common::String expanddate(byte d, byte m, uint16 y) {
+		const Common::String months[12] = {
+			"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
+			"Septem*", "Octo*", "Novem*", "Decem*"		
+		};
+
+		Common::String expanddate_result;
+		month = months[m];
+		switch (month[month.size()]) {
+		case '#':
+			addon("uary");
+			break;
+		case '*':
+			addon("ber");
+			break;
+		}
+
+		day = Gyro::strf(d);
+
+		if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31)))
+			switch (d % 10) {
+			case 1:
+				day = day + "st";
+				break;
+			case 2:
+				day = day + "nd";
+				break;
+			case 3:
+				day = day + "rd";
+				break;
+			default:
+				day = day + "th";
+			}
+
+		expanddate_result = day + ' ' + month + ' ' + Gyro::strf(y);
+		return expanddate_result;
+	}
+
+
+
+	void edna_save(Common::String name);
+
+	static void show_bug(char icon, Common::String strn) {
+		Scrolls::display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
+	}
+
+	static bool test_bug(byte what) {
+		bool test_bug_result;
+		if (what == 0)  {
+			test_bug_result = false;
+			return test_bug_result;
+		}
+		switch (what) {
+		case 2:
+			show_bug('7', "Error in filename!");
+			break;
+		case 101:
+			show_bug('6', "Disk full!");
+			break;
+		case 150:
+			show_bug('4', "Disk is write-protected!");
+			break;
+		default:
+			show_bug('B', "Saving error!");
+		}
+		test_bug_result = true;
+		return test_bug_result;
+	}
+
+	void edna_save(Common::String name) {
+		warning("STUB: Enid::edna_save()");
+	}
+
+	void loaderror(Common::String x, char icon) {
+		if (Gyro::holdthedawn) {
+			Gyro::holdthedawn = false;
+			Lucerna::dawn();
+		}
+		Scrolls::display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
+		bug = true;
+	}
+
+
+
+	typedef char fourtype[5];
+
+
+
+	const fourtype avaricius_file = "Avvy";
+
+	void edna_load(Common::String name) {
+		warning("STUB: Enid::edna_load()");
+	}
+
+
+
+	void dir(Common::String where);
+
+	static Common::String path, groi;
+
+	static void showheader() {
+		Scrolls::display(Common::String("Dir: ") + path + "\r\r\4");
+	}
+
+	void dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
+		warning("STUB: Enid::dir()");
+	}
+
+	void avvy_background() {    /* Not really a filing procedure,
+	 but it's only called just before edna_load, so I thought I'd put it
+	 in Enid instead of, say, Lucerna. */
+	
+		/* port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }*/
+		/*
+		 asm
+		  mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
+		  mov dx,$3ce; mov al,4; out dx,al; { register. }
+		  mov dx,$3c5; mov al,1; out dx,al;
+		  mov dx,$3cf;           out dx,al;
+
+		  mov bx,$A000; call far ptr @drawup;
+		  mov bx,$A400; call far ptr @drawup;
+
+		  jmp @the_end;
+
+		 @drawup:
+
+		  mov es,bx; { The segment to copy it to... }
+		  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
+
+		  mov cx,10;
+		  mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
+		  mov ax,$AEAA; call far ptr @sameline;
+		  mov ax,$A4EA; call far ptr @sameline;
+		  mov ax,$44A4; call far ptr @sameline;
+
+		  mov cx,9;
+		  mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
+		  mov ax,$AAEA; call far ptr @sameline;
+		  mov ax,$AA4E; call far ptr @sameline;
+		  mov ax,$444A; call far ptr @sameline;
+
+		  mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
+		  mov ax,$AAAE; call far ptr @sameline;
+		  mov ax,$EAA4; call far ptr @sameline;
+		  mov ax,$A444; call far ptr @sameline;
+
+		  mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
+		  mov ax,$EAAA; call far ptr @sameline;
+		  mov ax,$4EAA; call far ptr @sameline;
+		  mov ax,$4A44; call far ptr @sameline;
+
+		  ret;
+
+
+		  { Replicate the same line many times. }
+
+		  @sameline:
+		   { Requires:
+			  what to copy in AX,
+			  how many lines in CX, and
+			  original offset in DI. }
+		   push cx;
+		   push di;
+
+		   @samelineloop:
+
+			push cx;
+			mov cx,40; { No. of times to repeat it on one line. }
+
+			repz stosw; { Fast uint16-copying }
+
+			pop cx;
+
+			add di,1200; { The next one will be 16 lines down. }
+
+		   loop @samelineloop;
+		   pop di;
+		   add di,80;
+		   pop cx;
+
+		   ret;
+
+		  @the_end:
+		 end;
+		*/
+		Lucerna::blitfix();
+	}
+
+	void to_sundry(Gyro::sundry &sund) {
+		{
+			sund.qenid_filename = Gyro::enid_filename;
+			sund.qsoundfx = Gyro::soundfx;
+			sund.qthinks = Gyro::thinks;
+			sund.qthinkthing = Gyro::thinkthing;
+		}
+	}
+
+	void from_sundry(Gyro::sundry sund) {
+		{
+			Gyro::enid_filename = sund.qenid_filename;
+			Gyro::soundfx = sund.qsoundfx;
+			Gyro::thinks = sund.qthinks;
+			Gyro::thinkthing = sund.qthinkthing;
+		}
+	}
+
+	void restore_dna() {
+		uint16 here, fv;
+		Gyro::sundry sund;
+
+		warning("STUB: Enid::restore_dna()");
+	}
+
+	void edna_reload() {
+
+		restore_dna();
+
+		Gyro::seescroll = true;  /* This prevents display of the new sprites before the
+	  new picture is loaded. */
+
+		Lucerna::major_redraw();
+
+		Gyro::whereis[Gyro::pavalot] = Gyro::dna.room;
+
+		Gyro::alive = true;
+
+		Lucerna::objectlist();
+
+		if (Gyro::holdthedawn) {
+			Gyro::holdthedawn = false;
+			Lucerna::dawn();
+		}
+	}
+
+	void back_to_bootstrap(byte what) {
+		warning("STUB: Enid::back_to_bootstrap()");
+	}
+
+	bool there_was_a_problem() {
+		return bug;
+	}
+
+	} // End of namespace Enid.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
new file mode 100644
index 0000000..0b4671a
--- /dev/null
+++ b/engines/avalanche/enid2.h
@@ -0,0 +1,59 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ENID		Edna's manager. */
+
+#ifndef ENID2_H
+#define ENID2_H
+
+#include "common/scummsys.h"
+
+#include "avalanche/gyro2.h"
+
+namespace Avalanche {
+
+	namespace Enid {
+
+	void edna_save(Common::String name);
+
+	void edna_load(Common::String name);
+
+	void edna_reload();    /* From Bootstrap's storage. */
+
+	void dir(Common::String where);
+
+	void avvy_background();
+
+	void back_to_bootstrap(byte what);
+
+	bool there_was_a_problem();
+
+	} // End of namespace Enid.
+
+} // End of namespace Avalanche.
+
+#endif // ENID2_H


Commit: 1d950021b818cb1bc6348d0bdac615493b2c4260
    https://github.com/scummvm/scummvm/commit/1d950021b818cb1bc6348d0bdac615493b2c4260
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T00:06:46-07:00

Commit Message:
AVALANCHE: Add Pingo.

Changed paths:
  A engines/avalanche/pingo2.cpp
  A engines/avalanche/pingo2.h



diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
new file mode 100644
index 0000000..1311c65
--- /dev/null
+++ b/engines/avalanche/pingo2.cpp
@@ -0,0 +1,114 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* PINGO	Full-screen sub-parts of the game. */
+
+#include "avalanche/pingo2.h"
+
+#include "avalanche/gyro2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/scrolls2.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+	namespace Pingo {
+
+	void dplot(int16 x, int16 y, Common::String z) {
+		warning("STUB: Pingo::dplot()");
+	}
+
+	void bosskey() {
+	/*const
+	 months : array[0..11] of char = 'JFMAMJJASOND';
+	 title = 'Net Profits';
+	 fish = #224; { à }
+	var fv:byte; gd,gm:int16; r:char;
+	begin;
+	 dusk; delavvy;
+	 setactivepage(3); mousepage(3); setvisualpage(3); off;
+	 cleardevice; setfillstyle(xhatchfill,11);
+	 settextstyle(1,0,4); settextjustify(1,1);
+	 dplot(320,10,title);
+	 settextstyle(1,0,0); setusercharsize(4,3,7,12);
+	 for fv:=0 to 11 do
+	 begin;
+	  dplot(26+fv*52,187,months[fv]);
+	  bar(fv*52,177-fv*14,51+fv*52,180);
+	  rectangle(fv*52,177-fv*14,51+fv*52,180);
+	 end;
+	 settextstyle(0,0,1);
+	 for fv:=1 to 177 do
+	 begin;
+	  gd:=random(630); gm:=random(160)+30;
+	  setcolor(lightred); outtextxy(gd  ,gm  ,fish);
+	  setcolor(yellow);   outtextxy(gd+1,gm-1,fish);
+	 end;
+	 newpointer(6); { TTHand }
+	 dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
+	 while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
+	 dusk; setvisualpage(0); setactivepage(0); mousepage(0); dawn;
+	 copy02;*/
+
+		warning("STUB: Pingo::bosskey()");
+	}
+
+	void copy02() {   /* taken from Wobble (below) */
+		warning("STUB: Pingo::copy02()");
+	}
+
+	void copy03() {   /* taken from Wobble (below) */
+		warning("STUB: Pingo::copy03()");
+	}
+
+	void copypage(byte frp, byte top) { /* taken from Copy02 (above) */
+		warning("STUB: Pingo::copypage()");
+	}
+
+	void wobble() {
+		warning("STUB: Pingo::wobble()");
+	}
+
+	void zonk();
+
+	static void zl(int16 x1, int16 y1, int16 x2, int16 y2) {
+		warning("STUB: Pingo::zl()");
+	}
+
+	void zonk() {
+		warning("STUB: Pingo::zonk()");
+	}
+
+	void winning_pic() {
+		warning("STUB: Pingo::winning_pic()");
+	}
+
+	} // End of namespace Pingo.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
new file mode 100644
index 0000000..10b9511
--- /dev/null
+++ b/engines/avalanche/pingo2.h
@@ -0,0 +1,58 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* PINGO	Full-screen sub-parts of the game. */
+
+#ifndef PINGO2_H
+#define PINGO2_H
+
+#include "common/scummsys.h"
+
+
+namespace Avalanche {
+
+	namespace Pingo {
+
+	void bosskey();
+
+	void copy02();
+
+	void copy03();
+
+	void copypage(byte frp, byte top);
+
+	void wobble();
+
+	void zonk();
+
+	void winning_pic();
+
+	} // End of namespace Pingo.
+
+} // End of namespace Avalanche.
+
+#endif // PINGO2_H


Commit: 49e411f557a42e353e60e155da47c6600554c057
    https://github.com/scummvm/scummvm/commit/49e411f557a42e353e60e155da47c6600554c057
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T00:21:41-07:00

Commit Message:
AVALANCHE: Add Timeout.

Changed paths:
  A engines/avalanche/timeout2.cpp
  A engines/avalanche/timeout2.h



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
new file mode 100644
index 0000000..3ab2bcd
--- /dev/null
+++ b/engines/avalanche/timeout2.cpp
@@ -0,0 +1,676 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* TIMEOUT	The scheduling unit. */
+
+#include "common/textconsole.h"
+
+#include "avalanche/timeout2.h"
+
+#include "avalanche/visa2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/acci2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/enid2.h"
+#include "avalanche/pingo2.h"
+
+namespace Avalanche {
+
+	namespace Timeout {
+
+	byte fv;
+
+	void set_up_timer(int32 howlong, byte whither, byte why) {
+		fv = 1;
+		while ((fv < 8) && (times[fv].time_left != 0))  fv += 1;
+		if (fv == 8)  return; /* Oh dear... */
+
+		{
+			timetype &with = times[fv];  /* Everything's OK here! */
+
+			with.time_left = howlong;
+			with.then_where = whither;
+			with.what_for = why;
+		}
+	}
+
+	void one_tick() {
+
+		if (Gyro::ddmnow)  return;
+
+		for (fv = 1; fv <= 7; fv ++) {
+			timetype &with = times[fv];
+			if (with.time_left > 0) {
+				with.time_left -= 1;
+
+				if (with.time_left == 0)
+					switch (with.then_where) {
+					case procopen_drawbridge :
+						open_drawbridge();
+						break;
+					case procavaricius_talks :
+						avaricius_talks();
+						break;
+					case procurinate :
+						urinate();
+						break;
+					case proctoilet2 :
+						toilet2();
+						break;
+					case procbang:
+						bang();
+						break;
+					case procbang2:
+						bang2();
+						break;
+					case procstairs:
+						stairs();
+						break;
+					case proccardiffsurvey:
+						cardiff_survey();
+						break;
+					case proccardiff_return:
+						cardiff_return();
+						break;
+					case proc_cwytalot_in_herts:
+						cwytalot_in_herts();
+						break;
+					case procget_tied_up:
+						get_tied_up();
+						break;
+					case procget_tied_up2:
+						get_tied_up2();
+						break;
+					case prochang_around:
+						hang_around();
+						break;
+					case prochang_around2:
+						hang_around2();
+						break;
+					case procafter_the_shootemup:
+						after_the_shootemup();
+						break;
+					case procjacques_wakes_up:
+						jacques_wakes_up();
+						break;
+					case procnaughty_duke:
+						naughty_duke();
+						break;
+					case procnaughty_duke2:
+						naughty_duke2();
+						break;
+					case procnaughty_duke3:
+						naughty_duke3();
+						break;
+					case procjump:
+						jump();
+						break;
+					case procsequence:
+						Sequence::call_sequencer();
+						break;
+					case proccrapulus_splud_out:
+						crapulus_says_splud_out();
+						break;
+					case procdawn_delay:
+						Lucerna::dawn();
+						break;
+					case procbuydrinks:
+						buydrinks();
+						break;
+					case procbuywine:
+						buywine();
+						break;
+					case proccallsguards:
+						callsguards();
+						break;
+					case procgreetsmonk:
+						greetsmonk();
+						break;
+					case procfall_down_oubliette:
+						fall_down_oubliette();
+						break;
+					case procmeet_avaroid:
+						meet_avaroid();
+						break;
+					case procrise_up_oubliette:
+						rise_up_oubliette();
+						break;
+					case procrobin_hood_and_geida:
+						robin_hood_and_geida();
+						break;
+					case procrobin_hood_and_geida_talk:
+						robin_hood_and_geida_talk();
+						break;
+					case procavalot_returns:
+						avalot_returns();
+						break;
+					case procavvy_sit_down:
+						avvy_sit_down();
+						break;
+					case procghost_room_phew:
+						ghost_room_phew();
+						break;
+					case procarkata_shouts:
+						arkata_shouts();
+						break;
+					case procwinning:
+						winning();
+						break;
+					case procavalot_falls:
+						avalot_falls();
+						break;
+					case procspludwick_goes_to_cauldron:
+						spludwick_goes_to_cauldron();
+						break;
+					case procspludwick_leaves_cauldron:
+						spludwick_leaves_cauldron();
+						break;
+					case procgive_lute_to_geida:
+						give_lute_to_geida();
+						break;
+					}
+			}
+		}
+		Gyro::roomtime += 1; /* Cycles since you've been in this room. */
+		Gyro::dna.total_time += 1; /* Total amount of time for this game. */
+	}
+
+	void lose_timer(byte which) {
+		byte fv;
+
+		for (fv = 1; fv <= 7; fv ++) {
+			timetype &with = times[fv];
+			if (with.what_for == which)
+				with.time_left = 0;
+		} /* Cancel this one! */
+	}
+
+	/*function timer_is_on(which:byte):boolean;
+	var fv:byte;
+	begin
+	 for fv:=1 to 7 do
+	  with times[fv] do
+	   if (what_for=which) and (time_left>0) then
+	   begin
+		timer_is_on:=true;
+		exit;
+	   end;
+	 timer_is_on:=false;
+	end;*/
+
+	/* Timeout procedures: */
+
+	void open_drawbridge() {
+		{
+			Gyro::dna.drawbridge_open ++;
+			Celer::show_one(Gyro::dna.drawbridge_open - 1);
+
+			if (Gyro::dna.drawbridge_open == 4)
+				Gyro::magics[2].op = Gyro::nix; /* You may enter the drawbridge. */
+			else set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
+		}
+	}
+
+	/* --- */
+
+	void avaricius_talks() {
+		{
+			Visa::dixi('q', Gyro::dna.avaricius_talk);
+			Gyro::dna.avaricius_talk ++;
+
+			if (Gyro::dna.avaricius_talk < 17)
+				set_up_timer(177, procavaricius_talks, reason_avariciustalks);
+			else Lucerna::points(3);
+
+		}
+	}
+
+	void urinate() {
+		Trip::tr[1].turn(Trip::up);
+		Trip::stopwalking();
+		Lucerna::showrw();
+		set_up_timer(14, proctoilet2, reason_gototoilet);
+	}
+
+	void toilet2() {
+		Scrolls::display("That's better!");
+	}
+
+	void bang() {
+		Scrolls::display("\6< BANG! >");
+		set_up_timer(30, procbang2, reason_explosion);
+	}
+
+	void bang2() {
+		Scrolls::display("Hmm... sounds like Spludwick's up to something...");
+	}
+
+	void stairs() {
+		Gyro::blip();
+		Trip::tr[0].walkto(4);
+		Celer::show_one(2);
+		Gyro::dna.brummie_stairs = 2;
+		Gyro::magics[11].op = Gyro::special;
+		Gyro::magics[11].data = 2; /* Reached the bottom of the stairs. */
+		Gyro::magics[4].op = Gyro::nix; /* Stop them hitting the sides (or the game will hang.) */
+	}
+
+	void cardiff_survey() {
+		{
+			switch (Gyro::dna.cardiff_things) {
+			case 0: {
+				Gyro::dna.cardiff_things += 1;
+				Visa::dixi('q', 27);
+			}
+			break;
+			}
+			Visa::dixi('z', Gyro::dna.cardiff_things);
+		}
+		Gyro::interrogation = Gyro::dna.cardiff_things;
+		set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
+	}
+
+	void cardiff_return() {
+		Visa::dixi('q', 28);
+		cardiff_survey(); /* add end of question. */
+	}
+
+	void cwytalot_in_herts() {
+		Visa::dixi('q', 29);
+	}
+
+	void get_tied_up() {
+		Visa::dixi('q', 34); /* ...Trouble! */
+		Gyro::dna.user_moves_avvy = false;
+		Gyro::dna.been_tied_up = true;
+		Trip::stopwalking();
+		Trip::tr[2].stopwalk();
+		Trip::tr[2].stophoming();
+		Trip::tr[2].call_eachstep = true;
+		Trip::tr[2].eachstep = Trip::procgrab_avvy;
+		set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
+	}
+
+	void get_tied_up2() {
+		Trip::tr[1].walkto(4);
+		Trip::tr[2].walkto(5);
+		Gyro::magics[4].op = Gyro::nix; /* No effect when you touch the boundaries. */
+		Gyro::dna.friar_will_tie_you_up = true;
+	}
+
+	void hang_around() {
+		Trip::tr[2].check_me = false;
+		Trip::tr[1].init(7, true); /* Robin Hood */
+		Gyro::whereis[Gyro::probinhood] = r__robins;
+		Trip::apped(1, 2);
+		Visa::dixi('q', 39);
+		Trip::tr[1].walkto(7);
+		set_up_timer(55, prochang_around2, reason_hanging_around);
+	}
+
+	void hang_around2() {
+		Visa::dixi('q', 40);
+		Trip::tr[2].vanishifstill = false;
+		Trip::tr[2].walkto(4);
+		Gyro::whereis[Gyro::pfriartuck] = r__robins;
+		Visa::dixi('q', 41);
+		Trip::tr[1].done();
+		Trip::tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+
+		set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
+		/* Immediately call the following proc (when you have a chance). */
+
+		Gyro::dna.tied_up = false;
+
+		Enid::back_to_bootstrap(1); /* Call the shoot-'em-up. */
+	}
+
+	void after_the_shootemup() {
+		warning("STUB: Timeout::after_the_shootemup()");
+	}
+
+	void jacques_wakes_up() {
+		Gyro::dna.jacques_awake += 1;
+
+		switch (Gyro::dna.jacques_awake) { /* Additional pictures. */
+		case 1 : {
+			Celer::show_one(1); /* Eyes open. */
+			Visa::dixi('Q', 45);
+		}
+		break;
+		case 2 : { /* Going through the door. */
+			Celer::show_one(2); /* Not on the floor. */
+			Celer::show_one(3); /* But going through the door. */
+			Gyro::magics[6].op = Gyro::nix; /* You can't wake him up now. */
+		}
+		break;
+		case 3 : { /* Gone through the door. */
+			Celer::show_one(2); /* Not on the floor, either. */
+			Celer::show_one(4); /* He's gone... so the door's open. */
+			Gyro::whereis[Gyro::pjacques] = 0; /* Gone! */
+		}
+		break;
+		}
+
+
+		if (Gyro::dna.jacques_awake == 5) {
+			Gyro::dna.ringing_bells = true;
+			Gyro::dna.ayles_is_awake = true;
+			Lucerna::points(2);
+		}
+
+		switch (Gyro::dna.jacques_awake) {
+		case 1:
+		case 2:
+		case 3:
+			set_up_timer(12, procjacques_wakes_up, reason_jacques_waking_up);
+			break;
+		case 4:
+			set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
+			break;
+		}
+
+	}
+
+	void naughty_duke()
+	/* This is when the Duke comes in and takes your money. */
+	{
+		Trip::tr[2].init(9, false); /* Here comes the Duke. */
+		Trip::apped(2, 1); /* He starts at the door... */
+		Trip::tr[2].walkto(3); /* He walks over to you. */
+
+		/* Let's get the door opening. */
+		Celer::show_one(1);
+		Sequence::first_show(2);
+		Sequence::start_to_close();
+
+		set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
+	}
+
+	void naughty_duke2() {
+		Visa::dixi('q', 48); /* Ha ha, it worked again! */
+		Trip::tr[2].walkto(1); /* Walk to the door. */
+		Trip::tr[2].vanishifstill = true; /* Then go away! */
+		set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
+	}
+
+	void naughty_duke3() {
+		Celer::show_one(1);
+		Sequence::first_show(2);
+		Sequence::start_to_close();
+	}
+
+	void jump() {
+		{
+			Gyro::dnatype &with = Gyro::dna;
+
+			with.jumpstatus += 1;
+
+			{
+				Trip::triptype &with1 = Trip::tr[1];
+				switch (with.jumpstatus) {
+				case 1:
+				case 2:
+				case 3:
+				case 5:
+				case 7:
+				case 9:
+					with1.y -= 1;
+					break;
+				case 12:
+				case 13:
+				case 14:
+				case 16:
+				case 18:
+				case 19:
+					with1.y += 1;
+					break;
+				}
+			}
+
+			if (with.jumpstatus == 20) {
+				/* End of jump. */
+				Gyro::dna.user_moves_avvy = true;
+				Gyro::dna.jumpstatus = 0;
+			} else {
+				/* Still jumping. */
+				set_up_timer(1, procjump, reason_jumping);
+			}
+
+			if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
+					&& (Gyro::dna.room == r__insidecardiffcastle)
+					&& (Gyro::dna.arrow_in_the_door == true)
+					&& (Trip::infield(3))) { /* beside the wall*/
+				/* Grab the arrow! */
+				if (Gyro::dna.carrying >= Gyro::maxobjs)
+					Scrolls::display("You fail to grab it, because your hands are full.");
+				else {
+					Celer::show_one(2);
+					Gyro::dna.arrow_in_the_door = false; /* You've got it. */
+					Gyro::dna.obj[Gyro::bolt] = true;
+					Lucerna::objectlist();
+					Visa::dixi('q', 50);
+					Lucerna::points(3);
+				}
+			}
+		}
+	}
+
+	void crapulus_says_splud_out() {
+		Visa::dixi('q', 56);
+		Gyro::dna.crapulus_will_tell = false;
+	}
+
+	void buydrinks() {
+		Celer::show_one(11); /* Malagauche gets up again. */
+		Gyro::dna.malagauche = 0;
+
+		Visa::dixi('D', Gyro::dna.drinking); /* Scrolls::display message about it. */
+		Pingo::wobble(); /* Do the special effects. */
+		Visa::dixi('D', 1); /* That'll be thruppence. */
+		if (Gyro::pennycheck(3)) /* Pay 3d. */
+			Visa::dixi('D', 3); /* Tell 'em you paid up. */
+		Acci::have_a_drink();
+	}
+
+	void buywine() {
+		Celer::show_one(11); /* Malagauche gets up again. */
+		Gyro::dna.malagauche = 0;
+
+		Visa::dixi('D', 50); /* You buy the wine. */
+		Visa::dixi('D', 1); /* It'll be thruppence. */
+		if (Gyro::pennycheck(3)) {
+			Visa::dixi('D', 4); /* You paid up. */
+			Gyro::dna.obj[Gyro::wine] = true;
+			Lucerna::objectlist();
+			Gyro::dna.winestate = 1; /* OK Wine */
+		}
+	}
+
+	void callsguards() {
+		Visa::dixi('Q', 58); /* GUARDS!!! */
+		Lucerna::gameover();
+	}
+
+	void greetsmonk() {
+		Visa::dixi('Q', 59);
+		Gyro::dna.entered_lusties_room_as_monk = true;
+	}
+
+	void fall_down_oubliette() {
+		Gyro::magics[9].op = Gyro::nix;
+		Trip::tr[1].iy += 1; /* increments dx/dy! */
+		Trip::tr[1].y += Trip::tr[1].iy;   /* Dowwwn we go... */
+		set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
+	}
+
+	void meet_avaroid() {
+		if (Gyro::dna.met_avaroid) {
+			Scrolls::display("You can't expect to be \6that\22 lucky twice in a row!");
+			Lucerna::gameover();
+		} else {
+			Visa::dixi('Q', 60);
+			Gyro::dna.met_avaroid = true;
+			set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
+			{
+				Trip::triptype &with = Trip::tr[1];
+				with.face = Trip::left;
+				with.x = 151;
+				with.ix = -3;
+				with.iy = -5;
+			}
+			Gyro::background(2);
+		}
+	}
+
+	void rise_up_oubliette() {
+		{
+			Trip::triptype &with = Trip::tr[1];
+
+			with.visible = true;
+			with.iy += 1; /* decrements dx/dy! */
+			with.y -= with.iy; /* Uuuupppp we go... */
+			if (with.iy > 0)
+				set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
+			else
+				Gyro::dna.user_moves_avvy = true;
+		}
+	}
+
+	void robin_hood_and_geida() {
+		Trip::tr[1].init(7, true);
+		Trip::apped(1, 7);
+		Trip::tr[1].walkto(6);
+		Trip::tr[2].stopwalk();
+		Trip::tr[2].face = Trip::left;
+		set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
+		Gyro::dna.geida_follows = false;
+	}
+
+	void robin_hood_and_geida_talk() {
+		Visa::dixi('q', 66);
+		Trip::tr[1].walkto(2);
+		Trip::tr[2].walkto(2);
+		Trip::tr[1].vanishifstill = true;
+		Trip::tr[2].vanishifstill = true;
+		set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
+	}
+
+	void avalot_returns() {
+		Trip::tr[1].done();
+		Trip::tr[2].done();
+		Trip::tr[1].init(0, true);
+		Trip::apped(1, 1);
+		Visa::dixi('q', 67);
+		Gyro::dna.user_moves_avvy = true;
+	}
+
+	void avvy_sit_down()
+	/* This is used when you sit down in the pub in Notts. It loops around so
+	  that it will happen when Avvy stops walking. */
+	{
+		if (Trip::tr[1].homing)    /* Still walking */
+			set_up_timer(1, procavvy_sit_down, reason_sitting_down);
+		else {
+			Celer::show_one(3);
+			Gyro::dna.sitting_in_pub = true;
+			Gyro::dna.user_moves_avvy = false;
+			Trip::tr[1].visible = false;
+		}
+	}
+
+	void ghost_room_phew() {
+		Scrolls::display("\6PHEW!\22 You're glad to get out of \6there!");
+	}
+
+	void arkata_shouts() {
+		if (Gyro::dna.teetotal)  return;
+		Visa::dixi('q', 76);
+		set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
+	}
+
+	void winning() {
+		Visa::dixi('q', 79);
+		Pingo::winning_pic();
+		do {
+			Lucerna::checkclick();
+		} while (!(Gyro::mrelease == 0));
+		Lucerna::callverb(Acci::vb_score);
+		Scrolls::display(" T H E    E N D ");
+		Gyro::lmo = true;
+	}
+
+	void avalot_falls() {
+		if (Trip::tr[1].step < 5) {
+			Trip::tr[1].step += 1;
+			set_up_timer(3, procavalot_falls, reason_falling_over);
+		} else
+			Scrolls::display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+	}
+
+	void spludwick_goes_to_cauldron() {
+		if (Trip::tr[2].homing)
+			set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
+		else
+			set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
+	}
+
+	void spludwick_leaves_cauldron() {
+		Trip::tr[2].call_eachstep = true; /* So that normal procs will continue. */
+	}
+
+	void give_lute_to_geida() {   /* Moved here from Acci. */
+		Visa::dixi('Q', 86);
+		Lucerna::points(4);
+		Gyro::dna.lustie_is_asleep = true;
+		Sequence::first_show(5);
+		Sequence::then_show(6); /* He falls asleep... */
+		Sequence::start_to_close(); /* Not really closing, but we're using the same procedure. */
+	}
+
+	/* "This is all!" */
+
+	class unit_timeout_initialize {
+	public:
+		unit_timeout_initialize();
+	};
+	static unit_timeout_initialize timeout_constructor;
+
+	unit_timeout_initialize::unit_timeout_initialize() {
+		for (int i = 0; i < sizeof(times); i++) {
+			times[i].time_left = 0;
+			times[i].then_where = 0;
+			times[i].what_for = 0;
+		}
+	}
+
+
+	} // End of namespace Timeout.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
new file mode 100644
index 0000000..5130c92
--- /dev/null
+++ b/engines/avalanche/timeout2.h
@@ -0,0 +1,259 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* TIMEOUT	The scheduling unit. */
+
+#ifndef TIMEOUT2_H
+#define TIMEOUT2_H
+
+#include "common/scummsys.h"
+
+#include "avalanche/gyro2.h"
+#include "avalanche/celer2.h"
+
+namespace Avalanche {
+
+	namespace Timeout {
+
+	/* reason_ now runs between 1 and 28. */
+
+	const int16 reason_drawbridgefalls = 2;
+	const int16 reason_avariciustalks = 3;
+	const int16 reason_gototoilet = 4;
+	const int16 reason_explosion = 5;
+	const int16 reason_brummiestairs = 6;
+	const int16 reason_cardiffsurvey = 7;
+	const int16 reason_cwytalot_in_herts = 8;
+	const int16 reason_getting_tied_up = 9;
+	const int16 reason_hanging_around = 10; /* Tied to the tree in Nottingham. */
+	const int16 reason_jacques_waking_up = 11;
+	const int16 reason_naughty_duke = 12;
+	const int16 reason_jumping = 13;
+	const int16 reason_sequencer = 14;
+	const int16 reason_crapulus_says_spludwick_out = 15;
+	const int16 reason_dawndelay = 16;
+	const int16 reason_drinks = 17;
+	const int16 reason_du_lustie_talks = 18;
+	const int16 reason_falling_down_oubliette = 19;
+	const int16 reason_meeting_avaroid = 20;
+	const int16 reason_rising_up_oubliette = 21;
+	const int16 reason_robin_hood_and_geida = 22;
+	const int16 reason_sitting_down = 23;
+	const int16 reason_ghost_room_phew = 1;
+	const int16 reason_arkata_shouts = 24;
+	const int16 reason_winning = 25;
+	const int16 reason_falling_over = 26;
+	const int16 reason_spludwalk = 27;
+	const int16 reason_geida_sings = 28;
+
+	/* procx now runs between 1 and 41. */
+
+	const int16 procopen_drawbridge = 3;
+
+	const int16 procavaricius_talks = 4;
+
+	const int16 procurinate = 5;
+
+	const int16 proctoilet2 = 6;
+
+	const int16 procbang = 7;
+
+	const int16 procbang2 = 8;
+
+	const int16 procstairs = 9;
+
+	const int16 proccardiffsurvey = 10;
+
+	const int16 proccardiff_return = 11;
+
+	const int16 proc_cwytalot_in_herts = 12;
+
+	const int16 procget_tied_up = 13;
+
+	const int16 procget_tied_up2 = 1;
+
+	const int16 prochang_around = 14;
+
+	const int16 prochang_around2 = 15;
+
+	const int16 procafter_the_shootemup = 32;
+
+	const int16 procjacques_wakes_up = 16;
+
+	const int16 procnaughty_duke = 17;
+
+	const int16 procnaughty_duke2 = 18;
+
+	const int16 procnaughty_duke3 = 38;
+
+	const int16 procjump = 19;
+
+	const int16 procsequence = 20;
+
+	const int16 proccrapulus_splud_out = 21;
+
+	const int16 procdawn_delay = 22;
+
+	const int16 procbuydrinks = 23;
+
+	const int16 procbuywine = 24;
+
+	const int16 proccallsguards = 25;
+
+	const int16 procgreetsmonk = 26;
+
+	const int16 procfall_down_oubliette = 27;
+
+	const int16 procmeet_avaroid = 28;
+
+	const int16 procrise_up_oubliette = 29;
+
+	const int16 procrobin_hood_and_geida = 2;
+
+	const int16 procrobin_hood_and_geida_talk = 30;
+
+	const int16 procavalot_returns = 31;
+
+	const int16 procavvy_sit_down = 33; /* In Nottingham. */
+
+	const int16 procghost_room_phew = 34;
+
+	const int16 procarkata_shouts = 35;
+
+	const int16 procwinning = 36;
+
+	const int16 procavalot_falls = 37;
+
+	const int16 procspludwick_goes_to_cauldron = 39;
+
+	const int16 procspludwick_leaves_cauldron = 40;
+
+	const int16 procgive_lute_to_geida = 41;
+
+	struct timetype {
+		int32 time_left;
+		byte then_where;
+		byte what_for;
+	};
+
+	timetype times[7] = {{0,0,0}};
+
+
+
+	void set_up_timer(int32 howlong, byte whither, byte why);
+
+	void one_tick();
+
+	void lose_timer(byte which);
+
+	/*function timer_is_on(which:byte):boolean;*/
+
+	/* procedures to do things at the end of amounts of time: */
+
+	void open_drawbridge();
+
+	void avaricius_talks();
+
+	void urinate();
+
+	void toilet2();
+
+	void bang();
+
+	void bang2();
+
+	void stairs();
+
+	void cardiff_survey();
+
+	void cardiff_return();
+
+	void cwytalot_in_herts();
+
+	void get_tied_up();
+
+	void get_tied_up2();
+
+	void hang_around();
+
+	void hang_around2();
+
+	void after_the_shootemup();
+
+	void jacques_wakes_up();
+
+	void naughty_duke();
+
+	void naughty_duke2();
+
+	void naughty_duke3();
+
+	void jump();
+
+	void crapulus_says_splud_out();
+
+	void buydrinks();
+
+	void buywine();
+
+	void callsguards();
+
+	void greetsmonk();
+
+	void fall_down_oubliette();
+
+	void meet_avaroid();
+
+	void rise_up_oubliette();
+
+	void robin_hood_and_geida();
+
+	void robin_hood_and_geida_talk();
+
+	void avalot_returns();
+
+	void avvy_sit_down();
+
+	void ghost_room_phew();
+
+	void arkata_shouts();
+
+	void winning();
+
+	void avalot_falls();
+
+	void spludwick_goes_to_cauldron();
+
+	void spludwick_leaves_cauldron();
+
+	void give_lute_to_geida();
+
+	} // End of namespace Timeout.
+
+} // End of namespace Avalanche.
+
+#endif // TIMEOUT2_H


Commit: ee5fb07c91e79abc956024028aa617c72a65384e
    https://github.com/scummvm/scummvm/commit/ee5fb07c91e79abc956024028aa617c72a65384e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T00:23:10-07:00

Commit Message:
AVALANCHE: Gyro: Change constants to variables with initial values to be equal to the Pascal code.

Changed paths:
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 4c29b1f..cd5644e 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -495,33 +495,6 @@ namespace Avalanche {
 	const int16 walk = 3;
 	const int16 run = 5;
 
-	const byte whereis[29] = {
-		/* The Lads */
-			r__yours, /* Avvy */
-			r__spludwicks, /* Spludwick */
-			r__outsideyours, /* Crapulus */
-			r__ducks, /* Duck - r__DucksRoom's not defined yet. */
-			r__argentpub, /* Malagauche */
-			r__robins, /* Friar Tuck. */
-			177, /* Robin Hood - can't meet him at the start. */
-			r__brummieroad, /* Cwytalot */
-			r__lustiesroom, /* Baron du Lustie. */
-			r__outsidecardiffcastle, /* The Duke of Cardiff. */
-			r__argentpub, /* Dogfood */
-			r__outsideducks, /* Trader */
-			r__argentpub, /* Ibythneth */
-			r__aylesoffice, /* Ayles */
-			r__nottspub, /* Port */
-			r__nottspub, /* Spurge */
-			r__musicroom, /* Jacques */
-			0, 0, 0, 0, 0, 0, 0, 0,
-			/* The Lasses */
-			r__yours, /* Arkata */
-			r__geidas, /* Geida */
-			177, /* nobody allocated here! */
-			r__wisewomans
-	}; /* The Wise Woman. */
-
 	/* Art gallery at 2,1; notice about this at 2,2. */
 
 	const int32 catamap[8][8] = {
@@ -574,11 +547,6 @@ namespace Avalanche {
 		7     = wall with door and candles,
 		F     = straight-through corridor. */
 
-	const byte interrogation = 0;
-	/* If this is greater than zero, the next line you type is stored in
-	   the DNA in a position dictated by the value. If a scroll comes up,
-	   or you leave the room, it's automatically set to zero. */
-
 	const bool demo = false; /* If this is true, we're in a demo of the game. */
 
 	const char spludwick_order[3] = {onion, ink, mushroom};
@@ -624,6 +592,40 @@ namespace Avalanche {
 
 	///////////////////////////// VARIABLES ///////////////////////////// 
 
+	byte interrogation = 0;
+	/* If this is greater than zero, the next line you type is stored in
+	   the DNA in a position dictated by the value. If a scroll comes up,
+	   or you leave the room, it's automatically set to zero. */
+
+	byte whereis[29] = {
+		/* The Lads */
+		r__yours, /* Avvy */
+		r__spludwicks, /* Spludwick */
+		r__outsideyours, /* Crapulus */
+		r__ducks, /* Duck - r__DucksRoom's not defined yet. */
+		r__argentpub, /* Malagauche */
+		r__robins, /* Friar Tuck. */
+		177, /* Robin Hood - can't meet him at the start. */
+		r__brummieroad, /* Cwytalot */
+		r__lustiesroom, /* Baron du Lustie. */
+		r__outsidecardiffcastle, /* The Duke of Cardiff. */
+		r__argentpub, /* Dogfood */
+		r__outsideducks, /* Trader */
+		r__argentpub, /* Ibythneth */
+		r__aylesoffice, /* Ayles */
+		r__nottspub, /* Port */
+		r__nottspub, /* Spurge */
+		r__musicroom, /* Jacques */
+		0, 0, 0, 0, 0, 0, 0, 0,
+		/* The Lasses */
+		r__yours, /* Arkata */
+		r__geidas, /* Geida */
+		177, /* nobody allocated here! */
+		r__wisewomans
+	}; /* The Wise Woman. */
+
+
+
 	Common::String current;
 	byte curpos;
 	bool cursoron;


Commit: 1d88f5c2f9311dd446f57a3896c21cee408e45c5
    https://github.com/scummvm/scummvm/commit/1d88f5c2f9311dd446f57a3896c21cee408e45c5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T02:48:48-07:00

Commit Message:
AVALANCHE: Add a little self-warning.

Changed paths:
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 3ab2bcd..6c0099b 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -27,6 +27,8 @@
 
 /* TIMEOUT	The scheduling unit. */
 
+// DON'T FORGET ABOUT THE ARRAY INDEXES, THEY MAY'LL CAUSE TROUBLES!!!
+
 #include "common/textconsole.h"
 
 #include "avalanche/timeout2.h"


Commit: 0a355ea3687b27d7330cfd0b3d32abba743dacbc
    https://github.com/scummvm/scummvm/commit/0a355ea3687b27d7330cfd0b3d32abba743dacbc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T03:13:00-07:00

Commit Message:
AVALANCHE: Add Trippancy.

Changed paths:
  A engines/avalanche/trip6.cpp
  A engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
new file mode 100644
index 0000000..ac0e8d0
--- /dev/null
+++ b/engines/avalanche/trip6.cpp
@@ -0,0 +1,1491 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* TRIP5	Trippancy V */
+
+#include "avalanche/trip6.h"
+#include "common/scummsys.h"
+#include "common/textconsole.h"
+
+#include "avalanche/scrolls2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/visa2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/enid2.h"
+
+/*#include "Dropdown.h"*/
+
+
+namespace Avalanche {
+
+	namespace Trip {
+
+	void loadtrip() {
+		byte gm;
+
+		for (gm = 1; gm <= numtr; gm ++) tr[gm].original();
+		for (int i = 0; i < sizeof(aa); aa[i] = 0);
+	}
+
+	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
+		byte a, c;
+		int16 fv, ff;
+
+		/* if not alive then begin checkfeet:=0; exit; end;*/
+		byte checkfeet_result;
+		a = 0;
+
+		warning("STUB: Trip::checkfeet()");
+		
+		checkfeet_result = a;
+		return checkfeet_result;
+	}
+
+	byte geida_ped(byte which) {
+		byte geida_ped_result;
+		switch (which) {
+		case 1:
+			geida_ped_result = 7;
+			break;
+		case 2:
+		case 6:
+			geida_ped_result = 8;
+			break;
+		case 3:
+		case 5:
+			geida_ped_result = 9;
+			break;
+		case 4:
+			geida_ped_result = 10;
+			break;
+		}
+		return geida_ped_result;
+	}
+
+	void catamove(byte ped)
+	/* When you enter a new position in the catacombs, this procedure should
+	  be called. It changes the Also codes so that they may match the picture
+	  on the screen. (Coming soon: It draws up the screen, too.) */
+	{
+
+		warning("Repair array indexes in Trip::catamove()");
+
+		int32 here;
+		uint16 xy_uint16;
+		byte fv, ff;
+
+		/* XY_uint16 is cat_x+cat_y*256. Thus, every room in the
+		  catacombs has a different number for it. */
+
+
+		
+		xy_uint16 = Gyro::dna.cat_x + Gyro::dna.cat_y * 256;
+		Gyro::dna.geida_spin = 0;
+		
+		switch (xy_uint16) {
+		case 1801: { /* Exit catacombs */
+			fliproom(r__lustiesroom, 4);
+			Scrolls::display("Phew! Nice to be out of there!");
+			return;
+		}
+		break;
+		case 1033: { /* Oubliette */
+			fliproom(r__oubliette, 1);
+			Scrolls::display("Oh, NO!\231\2");
+			return;
+		}
+		break;
+		case 4: {
+			fliproom(r__geidas, 1);
+			return;
+		}
+		break;
+		case 2307: {
+			fliproom(r__lusties, 5);
+			Scrolls::display("Oh no... here we go again...");
+			Gyro::dna.user_moves_avvy = false;
+			tr[1].iy = 1;
+			tr[1].ix = 0;
+			return;
+		}
+		break;
+		}
+
+		if (! Gyro::dna.enter_catacombs_from_lusties_room) Lucerna::load(29);
+		here = Gyro::catamap[Gyro::dna.cat_y][Gyro::dna.cat_x];
+
+		switch (here & 0xf) { /* West. */
+		case 0: { /* no connection (wall) */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::nix; /* Door. */
+			Celer::show_one(28);
+		}
+		break;
+		case 0x1: { /* no connection (wall + shield), */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::nix; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(29); /* ...shield. */
+		}
+		break;
+		case 0x2: { /* wall with door */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::special; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(30); /* ...door. */
+		}
+		break;
+		case 0x3: { /* wall with door and shield */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::special; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(30); /* ...door, and... */
+			Celer::show_one(29); /* ...shield. */
+		}
+		break;
+		case 0x4: { /* no connection (wall + window), */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::nix; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(5);  /* ...window. */
+		}
+		break;
+		case 0x5: { /* wall with door and window */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::special; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(30); /* ...door, and... */
+			Celer::show_one(5); /* ...window. */
+		}
+		break;
+		case 0x6: { /* no connection (wall + torches), */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::nix; /* No door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(7); /* ...torches. */
+		}
+		break;
+		case 0x7: { /* wall with door and torches */
+			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[13].op = Gyro::special; /* Door. */
+			Celer::show_one(28); /* Wall, plus... */
+			Celer::show_one(30); /* ...door, and... */
+			Celer::show_one(7); /* ...torches. */
+		}
+		break;
+		case 0xf: { /* straight-through corridor. */
+			Gyro::magics[2].op = Gyro::nix; /* Sloping wall. */
+			Gyro::magics[3].op = Gyro::special; /* Straight wall. */
+		}
+		break;
+		}
+
+		/*  ---- */
+
+		switch ((here & 0xf0) >> 4) { /* East */
+		case 0: { /* no connection (wall) */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::nix; /* Door. */
+			Celer::show_one(19);
+		}
+		break;
+		case 0x1: { /* no connection (wall + window), */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::nix; /* Door. */
+			Celer::show_one(19); /* Wall, plus... */
+			Celer::show_one(20); /* ...window. */
+		}
+		break;
+		case 0x2: { /* wall with door */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::special; /* Door. */
+			Celer::show_one(19); /* Wall, plus... */
+			Celer::show_one(21); /* ...door. */
+		}
+		break;
+		case 0x3: { /* wall with door and window */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::special; /* Door. */
+			Celer::show_one(19); /* Wall, plus... */
+			Celer::show_one(20); /* ...door, and... */
+			Celer::show_one(21); /* ...window. */
+		}
+		break;
+		case 0x6: { /* no connection (wall + torches), */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::nix; /* No door. */
+			Celer::show_one(19); /* Wall, plus... */
+			Celer::show_one(18); /* ...torches. */
+		}
+		break;
+		case 0x7: { /* wall with door and torches */
+			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::special; /* Door. */
+			Celer::show_one(19); /* Wall, plus... */
+			Celer::show_one(21); /* ...door, and... */
+			Celer::show_one(18); /* ...torches. */
+		}
+		break;
+		case 0xf: { /* straight-through corridor. */
+			Gyro::magics[5].op = Gyro::nix; /* Sloping wall. */
+			Gyro::magics[6].op = Gyro::special; /* Straight wall. */
+			Gyro::portals[15].op = Gyro::nix; /* Door. */
+		}
+		break;
+		}
+
+		/*  ---- */
+
+		switch ((here & 0xf00) >> 8) { /* South */
+		case 0: { /* No connection. */
+			Gyro::magics[7].op = Gyro::bounces;
+			Gyro::magics[12].op = Gyro::bounces;
+			Gyro::magics[13].op = Gyro::bounces;
+		}
+		break;
+		case 0x1: {
+			Celer::show_one(22);
+			
+			if ((xy_uint16 == 2051) & (Gyro::dna.geida_follows))
+				Gyro::magics[13].op = Gyro::exclaim;
+			else Gyro::magics[13].op = Gyro::special; /* Right exit south. */
+
+			Gyro::magics[7].op = Gyro::bounces;
+			Gyro::magics[12].op = Gyro::bounces;
+		}
+		break;
+		case 0x2: {
+			Celer::show_one(23);
+			Gyro::magics[7].op = Gyro::special; /* Middle exit south. */
+			Gyro::magics[12].op = Gyro::bounces;
+			Gyro::magics[13].op = Gyro::bounces;
+		}
+		break;
+		case 0x3: {
+			Celer::show_one(24);
+			Gyro::magics[12].op = Gyro::special; /* Left exit south. */
+			Gyro::magics[7].op = Gyro::bounces;
+			Gyro::magics[13].op = Gyro::bounces;
+		}
+		break;
+		}
+
+		switch ((here & 0xf000) >> 12) { /* North */
+		case 0: { /* No connection */
+			Gyro::magics[1].op = Gyro::bounces;
+			Gyro::portals[12].op = Gyro::nix; /* Door. */
+		}
+		break;
+		/* LEFT handles: */
+		/*  $1: begin
+			  Celer::show_one(4);
+			  Gyro::magics[1].op:=Gyro::bounces; { Left exit north. } { Change magic number! }
+			  Gyro::portals[12].op:=Gyro::special; { Door. }
+			 end;*/
+		case 0x2: {
+			Celer::show_one(4);
+			Gyro::magics[1].op = Gyro::bounces; /* Middle exit north. */
+			Gyro::portals[12].op = Gyro::special; /* Door. */
+		}
+		break;
+		/*  $3: begin
+			  Celer::show_one(4);
+			  Gyro::magics[1].op:=Gyro::bounces; { Right exit north. } { Change magic number! }
+			  Gyro::portals[12].op:=Gyro::special; { Door. }
+			 end;
+		  { RIGHT handles: }
+		  $4: begin
+			  Celer::show_one(3);
+			  Gyro::magics[1].op:=Gyro::bounces; { Left exit north. } { Change magic number! }
+			  Gyro::portals[12].op:=Gyro::special; { Door. }
+			 end;*/
+		case 0x5: {
+			Celer::show_one(3);
+			Gyro::magics[1].op = Gyro::bounces; /* Middle exit north. */
+			Gyro::portals[12].op = Gyro::special; /* Door. */
+		}
+		break;
+		/*  $6: begin
+			  Celer::show_one(3);
+			  Gyro::magics[1].op:=Gyro::bounces; { Right exit north. }
+			  Gyro::portals[12].op:=Gyro::special; { Door. }
+			 end;*/
+		/* ARCHWAYS: */
+		case 0x7:
+		case 0x8:
+		case 0x9: {
+			Celer::show_one(6);
+
+			if (((here & 0xf000) >> 12) > 0x7)  Celer::show_one(31);
+			if (((here & 0xf000) >> 12) == 0x9)  Celer::show_one(32);
+
+			Gyro::magics[1].op = Gyro::special; /* Middle arch north. */
+			Gyro::portals[12].op = Gyro::nix; /* Door. */
+		}
+		break;
+		/* DECORATIONS: */
+		case 0xd: { /* No connection + WINDOW */
+			Gyro::magics[1].op = Gyro::bounces;
+			Gyro::portals[12].op = Gyro::nix; /* Door. */
+			Celer::show_one(14);
+		}
+		break;
+		case 0xe: { /* No connection + TORCH */
+			Gyro::magics[1].op = Gyro::bounces;
+			Gyro::portals[12].op = Gyro::nix; /* Door. */
+			Celer::show_one(8);
+		}
+		break;
+		/* Recessed door: */
+		case 0xf: {
+			Gyro::magics[1].op = Gyro::nix; /* Door to Geida's room. */
+			Celer::show_one(1);
+			Gyro::portals[12].op = Gyro::special; /* Door. */
+		}
+		break;
+		}
+
+		switch (xy_uint16) {
+		case 514:
+			Celer::show_one(17);
+			break;     /* [2,2] : "Art Gallery" sign over door. */
+		case 264:
+			Celer::show_one(9);
+			break;      /* [8,1] : "The Wrong Way!" sign. */
+		case 1797:
+			Celer::show_one(2);
+			break;      /* [5,7] : "Ite Mingite" sign. */
+		case 258:
+			for (fv = 0; fv <= 2; fv ++) { /* [2,1] : Art gallery - pictures */
+				Celer::show_one_at(15, 130 + fv * 120, 70);
+				Celer::show_one_at(16, 184 + fv * 120, 78);
+			}
+			break;
+		case 1287:
+			for (fv = 10; fv <= 13; fv ++) Celer::show_one(fv);
+			break; /* [7,5] : 4 candles. */
+		case 776:
+			Celer::show_one(10);
+			break;     /* [8,3] : 1 candle. */
+		case 2049:
+			Celer::show_one(11);
+			break;     /* [1,8] : another candle. */
+		case 257: {
+			Celer::show_one(12);
+			Celer::show_one(13);
+		}
+		break; /* [1,1] : the other two. */
+		}
+
+		if ((Gyro::dna.geida_follows) & (ped > 0)) {
+			triptype &with = tr[2];
+
+			if (! with.quick)  /* If we don't already have her... */
+				tr[2].init(5, true); /* ...Load Geida. */
+			apped(2, geida_ped(ped));
+			tr[2].call_eachstep = true;
+			tr[2].eachstep = procgeida_procs;
+		}
+	}
+
+	void call_special(uint16 which);
+
+	/* This proc gets called whenever you touch a line defined as Gyro::special. */
+	static void dawndelay() {
+		Timeout::set_up_timer(2, Timeout::procdawn_delay, Timeout::reason_dawndelay);
+	}
+
+	void call_special(uint16 which) {
+		switch (which) {
+		case 1: { /* Gyro::special 1: Room 22: top of stairs. */
+			Celer::show_one(1);
+			Gyro::dna.brummie_stairs = 1;
+			Gyro::magics[10].op = Gyro::nix;
+			Timeout::set_up_timer(10, Timeout::procstairs, Timeout::reason_brummiestairs);
+			stopwalking();
+			Gyro::dna.user_moves_avvy = false;
+		}
+		break;
+		case 2: { /* Gyro::special 2: Room 22: bottom of stairs. */
+			Gyro::dna.brummie_stairs = 3;
+			Gyro::magics[11].op = Gyro::nix;
+			Gyro::magics[12].op = Gyro::exclaim;
+			Gyro::magics[12].data = 5;
+			Gyro::magics[4].op = Gyro::bounces; /* Now works as planned! */
+			stopwalking();
+			Visa::dixi('q', 26);
+			Gyro::dna.user_moves_avvy = true;
+		}
+		break;
+		case 3: { /* Gyro::special 3: Room 71: triggers dart. */
+			tr[1].bounce(); /* Must include that. */
+
+			if (! Gyro::dna.arrow_triggered) {
+				Gyro::dna.arrow_triggered = true;
+				apped(2, 4); /* The dart starts at ped 4, and... */
+				tr[2].walkto(5); /* flies to ped 5. */
+				tr[2].face = 0; /* Only face. */
+				/* Should call some kind of Eachstep procedure which will deallocate
+				  the sprite when it hits the wall, and replace it with the chunk
+				  graphic of the arrow buried in the plaster. */
+				/* OK! */
+				tr[2].call_eachstep = true;
+				tr[2].eachstep = procarrow_procs;
+			}
+		}
+		break;
+
+		case 4: { /* This is the ghost room link. */
+			Lucerna::dusk();
+			tr[1].turn(right); /* you'll see this after we get back from bootstrap */
+			Timeout::set_up_timer(1, Timeout::procghost_room_phew, Timeout::reason_ghost_room_phew);
+			Enid::back_to_bootstrap(3);
+		}
+		break;
+
+		case 5:
+			if (Gyro::dna.friar_will_tie_you_up) {
+				/* Gyro::special 5: Room 42: touched tree, and get tied up. */
+				Gyro::magics[4].op = Gyro::bounces; /* Boundary effect is now working again. */
+				Visa::dixi('q', 35);
+				tr[1].done();
+				/*tr[1].vanishifstill:=true;*/
+				Celer::show_one(2);
+				Visa::dixi('q', 36);
+				Gyro::dna.tied_up = true;
+				Gyro::dna.friar_will_tie_you_up = false;
+				tr[2].walkto(3);
+				tr[2].vanishifstill = true;
+				tr[2].check_me = true; /* One of them must have Check_Me switched on. */
+				Gyro::whereis[Gyro::pfriartuck] = 177; /* Not here, then. */
+				Timeout::set_up_timer(364, Timeout::prochang_around, Timeout::reason_hanging_around);
+			}
+			break;
+
+		case 6: { /* Gyro::special 6: fall down oubliette. */
+			Gyro::dna.user_moves_avvy = false;
+			tr[1].ix = 3;
+			tr[1].iy = 0;
+			tr[1].face = right;
+			Timeout::set_up_timer(1, Timeout::procfall_down_oubliette, Timeout::reason_falling_down_oubliette);
+		}
+		break;
+
+		case 7: { /* Gyro::special 7: stop falling down oubliette. */
+			tr[1].visible = false;
+			Gyro::magics[10].op = Gyro::nix;
+			stopwalking();
+			Timeout::lose_timer(Timeout::reason_falling_down_oubliette);
+			Lucerna::mblit(12, 80, 38, 160, 3, 0);
+			Lucerna::mblit(12, 80, 38, 160, 3, 1);
+			Scrolls::display("Oh dear, you seem to be down the bottom of an oubliette.");
+			Timeout::set_up_timer(200, Timeout::procmeet_avaroid, Timeout::reason_meeting_avaroid);
+		}
+		break;
+
+		case 8:        /* Gyro::special 8: leave du Lustie's room. */
+			if ((Gyro::dna.geida_follows) && (! Gyro::dna.lustie_is_asleep)) {
+				Visa::dixi('q', 63);
+				tr[2].turn(down);
+				tr[2].stopwalk();
+				tr[2].call_eachstep = false; /* Geida */
+				Lucerna::gameover();
+			}
+			break;
+
+		case 9: { /* Gyro::special 9: lose Geida to Robin Hood... */
+			if (! Gyro::dna.geida_follows)  return;   /* DOESN'T COUNT: no Geida. */
+			tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
+			tr[2].walkto(4); /* She walks to somewhere... */
+			tr[1].done();     /* Lose Avvy. */
+			Gyro::dna.user_moves_avvy = false;
+			Timeout::set_up_timer(40, Timeout::procrobin_hood_and_geida, Timeout::reason_robin_hood_and_geida);
+		}
+		break;
+
+		case 10: { /* Gyro::special 10: transfer north in catacombs. */
+			if ((Gyro::dna.cat_x == 4) && (Gyro::dna.cat_y == 1)) {
+				/* Into Geida's room. */
+				if (Gyro::dna.obj[Gyro::key])  Visa::dixi('q', 62);
+				else {
+					Visa::dixi('q', 61);
+					return;
+				}
+			}
+			Lucerna::dusk();
+			Gyro::dna.cat_y -= 1;
+			catamove(4);
+			if (Gyro::dna.room != r__catacombs)  return;
+			Lucerna::delavvy();
+			switch ((Gyro::catamap[Gyro::dna.cat_y][Gyro::dna.cat_x] & 0xf00) >> 8) {
+			case 0x1:
+				apped(1, 12);
+				break;
+			case 0x3:
+				apped(1, 11);
+				break;
+			default:
+				apped(1, 4);
+			}
+			getback();
+			dawndelay();
+		}
+		break;
+		case 11: { /* Gyro::special 11: transfer east in catacombs. */
+			Lucerna::dusk();
+			Gyro::dna.cat_x += 1;
+			catamove(1);
+			if (Gyro::dna.room != r__catacombs)  return;
+			Lucerna::delavvy();
+			apped(1, 1);
+			getback();
+			dawndelay();
+		}
+		break;
+		case 12: { /* Gyro::special 12: transfer south in catacombs. */
+			Lucerna::dusk();
+			Gyro::dna.cat_y += 1;
+			catamove(2);
+			if (Gyro::dna.room != r__catacombs)  return;
+			Lucerna::delavvy();
+			apped(1, 2);
+			getback();
+			dawndelay();
+		}
+		break;
+		case 13: { /* Gyro::special 13: transfer west in catacombs. */
+			Lucerna::dusk();
+			Gyro::dna.cat_x -= 1;
+			catamove(3);
+			if (Gyro::dna.room != r__catacombs)  return;
+			Lucerna::delavvy();
+			apped(1, 3);
+			getback();
+			dawndelay();
+		}
+		break;
+		}
+	}
+
+	void hide_in_the_cupboard();
+
+	void open_the_door(byte whither, byte ped, byte magicnum)
+	/* This slides the door open. (The data really ought to be saved in
+	  the Also file, and will be next time. However, for now, they're
+	  here.) */
+	{
+		switch (Gyro::dna.room) {
+		case r__outsideyours:
+		case r__outsidenottspub:
+		case r__outsideducks: {
+			Sequence::first_show(1);
+			Sequence::then_show(2);
+			Sequence::then_show(3);
+		}
+		break;
+		case r__insidecardiffcastle: {
+			Sequence::first_show(1);
+			Sequence::then_show(5);
+		}
+		break;
+		case r__avvysgarden:
+		case r__entrancehall:
+		case r__insideabbey: {
+			Sequence::first_show(1);
+			Sequence::then_show(2);
+		}
+		break;
+		case r__musicroom:
+		case r__outsideargentpub: {
+			Sequence::first_show(5);
+			Sequence::then_show(6);
+		}
+		break;
+		case r__lusties:
+			switch (magicnum) {
+			case 14:
+				if (Gyro::dna.avvys_in_the_cupboard) {
+					hide_in_the_cupboard();
+					Sequence::first_show(8);
+					Sequence::then_show(7);
+					Sequence::start_to_close();
+					return;
+				} else {
+					apped(1, 6);
+					tr[1].face = right; /* added by TT 12/3/1995 */
+					Sequence::first_show(8);
+					Sequence::then_show(9);
+				}
+				break;
+			case 12: {
+				Sequence::first_show(4);
+				Sequence::then_show(5);
+				Sequence::then_show(6);
+			}
+			break;
+			}
+			break;
+		}
+
+		Sequence::then_flip(whither, ped);
+		Sequence::start_to_open();
+	}
+
+	void newspeed() {
+	/* Given that you've just changed the speed in triptype.xs, this adjusts
+	  ix. */
+		warning("STUB: Trip::newspeed()");
+	}
+
+	triptype *triptype::init(byte spritenum, bool do_check) {
+		warning("STUB: Trip::init()");
+		return this;
+	}
+
+	void triptype::original() {
+		quick = false;
+		whichsprite = 177;
+	}
+
+	void triptype::andexor() {
+		warning("STUB: Trip::andexor()");
+	}
+
+	void triptype::turn(byte whichway) {
+		if (whichway == 8)  face = 0;
+		else face = whichway;
+	}
+
+	void triptype::appear(int16 wx, int16 wy, byte wf) {
+		x = (wx / 8) * 8;
+		y = wy;
+		ox[Gyro::cp] = wx;
+		oy[Gyro::cp] = wy;
+		turn(wf);
+		visible = true;
+		ix = 0;
+		iy = 0;
+	}
+
+
+
+
+	bool triptype::collision_check() {
+		byte fv;
+
+		bool collision_check_result;
+		for (fv = 1; fv <= numtr; fv ++)
+			if (tr[fv].quick && (tr[fv].whichsprite != whichsprite) &&
+					((x + a.xl) > tr[fv].x) &&
+					(x < (tr[fv].x + tr[fv].a.xl)) &&
+					(tr[fv].y == y)) {
+				collision_check_result = true;
+				return collision_check_result;
+			}
+		collision_check_result = false;
+		return collision_check_result;
+	}
+
+	void triptype::walk() {
+		warning("STUB: Trip::walk()");
+	}
+
+	void triptype::bounce() {
+		x = ox[Gyro::cp];
+		y = oy[Gyro::cp];
+		if (check_me)  stopwalking();
+		else stopwalk();
+		Gyro::oncandopageswap = false;
+		Lucerna::showrw();
+		Gyro::oncandopageswap = true;
+	}
+
+	int8 sgn(int16 x) {
+		int8 sgn_result;
+		if (x > 0)  sgn_result = 1;
+		else if (x < 0)  sgn_result = -1;
+		else
+			sgn_result = 0; /* x=0 */
+		return sgn_result;
+	}
+
+	void triptype::walkto(byte pednum) {
+		speed(sgn(Gyro::peds[pednum].x - x) * 4, sgn(Gyro::peds[pednum].y - y));
+		hx = Gyro::peds[pednum].x - a.xl / 2;
+		hy = Gyro::peds[pednum].y - a.yl;
+		homing = true;
+	}
+
+	void triptype::stophoming() {
+		homing = false;
+	}
+
+	void triptype::homestep() {
+		int16 temp;
+
+		if ((hx == x) && (hy == y)) {
+			/* touching the target */
+			stopwalk();
+			return;
+		}
+		ix = 0;
+		iy = 0;
+		if (hy != y) {
+			temp = hy - y;
+			if (temp > 4)  iy = 4;
+			else if (temp < -4)  iy = -4;
+			else iy = temp;
+		}
+		if (hx != x) {
+			temp = hx - x;
+			if (temp > 4)  ix = 4;
+			else if (temp < -4)  ix = -4;
+			else ix = temp;
+		}
+	}
+
+	void triptype::speed(int8 xx, int8 yy) {
+		ix = xx;
+		iy = yy;
+		if ((ix == 0) && (iy == 0))  return; /* no movement */
+		if (ix == 0) {
+			/* No horz movement */
+			if (iy < 0)  turn(up);
+			else turn(down);
+		} else {
+			if (ix < 0)  turn(left);
+			else turn(right);
+		}
+	}
+
+	void triptype::stopwalk() {
+		ix = 0;
+		iy = 0;
+		homing = false;
+	}
+
+	void triptype::chatter() {
+		Gyro::talkx = x + a.xl / 2;
+		Gyro::talky = y;
+		Gyro::talkf = a.fgc;
+		Gyro::talkb = a.bgc;
+	}
+
+	void triptype::set_up_saver(trip_saver_type &v) {
+		v.whichsprite = whichsprite;
+		v.face = face;
+		v.step = step;
+		v.x = x;
+		v.y = y;
+		v.ix = ix;
+		v.iy = iy;
+		v.visible = visible;
+		v.homing = homing;
+		v.check_me = check_me;
+		v.count = count;
+		v.xw = xw;
+		v.xs = xs;
+		v.ys = ys;
+		v.totalnum = totalnum;
+		v.hx = hx;
+		v.hy = hy;
+		v.call_eachstep = call_eachstep;
+		v.eachstep = eachstep;
+		v.vanishifstill = vanishifstill;
+	}
+
+	void triptype::unload_saver(trip_saver_type v) {
+		whichsprite = v.whichsprite;
+		face = v.face;
+		step = v.step;
+		x = v.x;
+		y = v.y;
+		ix = v.ix;
+		iy = v.iy;
+		visible = v.visible;
+		homing = v.homing;
+		check_me = v.check_me;
+		count = v.count;
+		xw = v.xw;
+		xs = v.xs;
+		ys = v.ys;
+		totalnum = v.totalnum;
+		hx = v.hx;
+		hy = v.hy;
+		call_eachstep = v.call_eachstep;
+		eachstep = v.eachstep;
+		vanishifstill = v.vanishifstill;
+	}
+
+	void triptype::savedata(/*untyped_file &f*/) {
+		warning("STUB: Timeout::savedata()");
+	}
+
+	void triptype::loaddata(/*untyped_file &f*/) {
+		warning("STUB: Timeout::loaddata()");
+	}
+
+	triptype *triptype::done() {
+		int16 gd, gm;
+		Common::String xx;
+		byte fv/*,nds*/;
+		byte aa, bb;
+		int32 id;
+		uint16 soa;
+
+		{
+			adxtype &with = a;
+
+			/*  nds:=num div seq;*/
+			xw = with.xl / 8;
+			if ((with.xl % 8) > 0)  xw += 1;
+			for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
+				totalnum --;
+				free(mani[totalnum]);
+				free(sil[totalnum]); /* <<- Width of a siltype. */
+			}
+		}
+
+		quick = false;
+		whichsprite = 177;
+		return this;
+	}
+
+	getsettype *getsettype::init() {
+		numleft = 0; /* initialise array pointer */
+		return this;
+	}
+
+	void getsettype::remember(Gyro::bytefield r) {
+		numleft ++;
+		warning("STUB: Timeout::getsettype::remember()");
+		gs[numleft] = r;
+	}
+
+	void getsettype::recall(Gyro::bytefield &r) {
+		r = gs[numleft];
+		numleft --;
+	}
+
+	void rwsp(byte t, byte r) {
+		{
+			switch (r) {
+			case up:
+				tr[t].speed(0, -tr[t].ys);
+				break;
+			case down:
+				tr[t].speed(0, tr[t].ys);
+				break;
+			case left:
+				tr[t].speed(-tr[t].xs,  0);
+				break;
+			case right:
+				tr[t].speed(tr[t].xs,  0);
+				break;
+			case ul:
+				tr[t].speed(-tr[t].xs, -tr[t].ys);
+				break;
+			case ur:
+				tr[t].speed(tr[t].xs, -tr[t].ys);
+				break;
+			case dl:
+				tr[t].speed(-tr[t].xs, tr[t].ys);
+				break;
+			case dr:
+				tr[t].speed(tr[t].xs, tr[t].ys);
+				break;
+			}
+		}
+	}
+
+	void apped(byte trn, byte np) {
+		tr[trn].appear(tr[trn].x - tr[trn].a.xl / 2, tr[trn].y - tr[trn].a.yl, Gyro::peds[np].dir);
+		rwsp(trn, Gyro::peds[np].dir);
+	}
+
+
+
+	void getback();
+
+	static Gyro::bytefield r;
+
+	/*   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
+	   begin { By De Morgan's law: }
+		overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
+	   end;*/
+	/* x1,x2 - as Gyro::bytefield, but *8. y1,y2 - as Gyro::bytefield.
+	  x3,y3 = mx,my. x4,y4 = mx+16,my+16. */
+	static bool overlaps_with_mouse() {
+		bool overlaps_with_mouse_result;
+		overlaps_with_mouse_result =
+			(r.x2 * 8 >= Gyro::mx) && (Gyro::mx + 16 >= r.x1 * 8) && (r.y2 >= Gyro::my) && (Gyro::my + 16 >= r.y1);
+		return overlaps_with_mouse_result;
+	}
+
+	void getback() {
+		byte fv;
+		bool endangered;
+
+
+		endangered = false;
+		/* Super_Off;*/
+
+		{
+			while (getset[1 - Gyro::cp].numleft > 0) {
+				getset[1 - Gyro::cp].recall(r);
+
+				/*    if overlaps_with_mouse and not endangered then
+					begin
+					 endangered:=true;
+					 blitfix;
+					 Super_Off;
+					end;*/
+
+				Lucerna::mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - Gyro::cp);
+			}
+		}
+
+		Lucerna::blitfix();
+		/*if endangered then*/ /*Super_On;*/
+	}
+
+	/* Eachstep procedures: */
+	void follow_avvy_y(byte tripnum) {
+		if (tr[1].face == left)
+			return;
+		if (tr[tripnum].homing)
+			tr[tripnum].hy = tr[1].y;
+		else {
+			if (tr[tripnum].y < tr[1].y)
+				tr[tripnum].y += 1;
+			else if (tr[tripnum].y > tr[1].y)
+				tr[tripnum].y -= 1;
+			else
+				return;
+			if (tr[tripnum].ix == 0)  {
+				tr[tripnum].step += 1;
+				if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+				tr[tripnum].count = 0;
+			}
+		}
+	}
+
+	void back_and_forth(byte tripnum) {
+		if (! tr[tripnum].homing) {
+			if (tr[tripnum].face == right)
+				tr[tripnum].walkto(4);
+			else
+				tr[tripnum].walkto(5);
+		}
+	}
+
+	void face_avvy(byte tripnum) {
+		if (! tr[tripnum].homing) {
+			if (tr[1].x >= tr[tripnum].x)  tr[tripnum].face = right;
+			else tr[tripnum].face = left;
+		}
+	}
+
+	void arrow_procs(byte tripnum) {
+		byte fv;
+			
+		if (tr[tripnum].homing) {
+			/* Arrow is still in flight. */
+			/* We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
+				This is so if: a) the bottom of the arrow is below Avvy's head,
+				b) the left of the arrow is left of the right of Avvy's head, and
+				c) the right of the arrow is right of the left of Avvy's head. */
+			if (((tr[tripnum].y + tr[tripnum].a.yl) >= tr[1].y) /* A */
+					&& (tr[tripnum].x <= (tr[1].x + tr[1].a.xl)) /* B */
+					&& ((tr[tripnum].x + tr[tripnum].a.xl) >= tr[1].x)) { /* C */
+				/* OK, it's hit him... what now? */
+
+				tr[2].call_eachstep = false; /* prevent recursion. */
+				Visa::dixi('Q', 47); /* Complaint! */
+				tr[tripnum].done(); /* Deallocate the arrow. */
+				/*     tr[1].done; { Deallocate normal pic of Avvy. }
+
+						off;
+						for fv:=0 to 1 do
+						begin
+						cp:=1-cp;
+						getback;
+						end;
+						on;*/
+
+				Lucerna::gameover();
+
+				Gyro::dna.user_moves_avvy = false; /* Stop the user from moving him. */
+				Timeout::set_up_timer(55, Timeout::procnaughty_duke, Timeout::reason_naughty_duke);
+			}
+		} else { /* Arrow has hit the wall! */
+			tr[tripnum].done(); /* Deallocate the arrow. */
+			Celer::show_one(3); /* Show pic of arrow stuck into the door. */
+			Gyro::dna.arrow_in_the_door = true; /* So that we can pick it up. */
+		}
+		
+	}
+
+	/*procedure Spludwick_procs(tripnum:byte);
+	var fv:byte;
+	begin
+	 with tr[tripnum] do
+	  if not homing then { We only need to do anything if Spludwick *stops*
+						   walking. }
+	  with Gyro::dna do
+	   begin
+		inc(DogfoodPos);
+		if DogfoodPos=8 then DogfoodPos:=1;
+		walkto(DogfoodPos);
+	   end;
+	end;*/
+
+	void grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
+		byte fv;
+		int16 tox, toy;
+			
+		tox = tr[1].x + 17;
+		toy = tr[1].y - 1;
+		if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
+			tr[tripnum].call_eachstep = false;
+			tr[tripnum].face = left;
+			tr[tripnum].stopwalk();
+			/* ... whatever ... */
+		} else {
+			/* Still some way to go. */
+			if (tr[tripnum].x < tox) {
+				tr[tripnum].x += 5;
+				if (tr[tripnum].x > tox)  tr[tripnum].x = tox;
+			}
+			if (tr[tripnum].y < toy)  tr[tripnum].y += 1;
+			tr[tripnum].step += 1;
+			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+		}
+	}
+
+
+
+	void geida_procs(byte tripnum);
+
+	static void take_a_step(byte &tripnum) {
+		if (tr[tripnum].ix == 0) {
+			tr[tripnum].step += 1;
+			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+			tr[tripnum].count = 0;
+		}
+	}
+
+	static void spin(byte whichway, byte &tripnum) {
+		if (tr[tripnum].face != whichway) {
+			tr[tripnum].face = whichway;
+			if (tr[tripnum].whichsprite == 2)  return; /* Not for Spludwick */
+
+			Gyro::dna.geida_spin += 1;
+			Gyro::dna.geida_time = 20;
+			if (Gyro::dna.geida_spin == 5) {
+				Scrolls::display("Steady on, Avvy, you'll make the poor girl dizzy!");
+				Gyro::dna.geida_spin = 0;
+				Gyro::dna.geida_time = 0; /* knock out records */
+			}
+		}
+	}
+
+	void geida_procs(byte tripnum) {
+		if (Gyro::dna.geida_time > 0) {
+			Gyro::dna.geida_time -= 1;
+			if (Gyro::dna.geida_time == 0)  Gyro::dna.geida_spin = 0;
+		}
+
+		if (tr[tripnum].y < (tr[1].y - 2)) {
+			/* Geida is further from the screen than Avvy. */
+			spin(down, tripnum);
+			tr[tripnum].iy = 1;
+			tr[tripnum].ix = 0;
+			take_a_step(tripnum);
+			return;
+		} else if (tr[tripnum].y > (tr[1].y + 2)) {
+			/* Avvy is further from the screen than Geida. */
+			spin(up, tripnum);
+			tr[tripnum].iy = -1;
+			tr[tripnum].ix = 0;
+			take_a_step(tripnum);
+			return;
+		}
+
+		tr[tripnum].iy = 0;
+		if (tr[tripnum].x < tr[1].x - tr[1].xs * 8) {
+			tr[tripnum].ix = tr[1].xs;
+			spin(right, tripnum);
+			take_a_step(tripnum);
+		} else if (tr[tripnum].x > tr[1].x + tr[1].xs * 8) {
+			tr[tripnum].ix = -tr[1].xs;
+			spin(left, tripnum);
+			take_a_step(tripnum);
+		} else tr[tripnum].ix = 0;
+	}
+
+	/* That's all... */
+
+	void call_andexors() {
+		byte order[5];
+		byte fv, temp;
+		bool ok;
+
+		for (int i = 0; i < 5; i++)
+			order[i] = 0;
+
+		for (fv = 1; fv <= numtr; fv ++) {
+			if (tr[fv].quick && tr[fv].visible)
+				order[fv] = fv;
+		}
+
+		do {
+			ok = true;
+			for (fv = 1; fv <= 4; fv ++)
+				if (((order[fv] != 0) && (order[fv + 1] != 0))
+						&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
+					/* Swap them! */
+					temp = order[fv];
+					order[fv] = order[fv + 1];
+					order[fv + 1] = temp;
+					ok = false;
+				}
+		} while (!ok);
+
+		for (fv = 1; fv <= 5; fv ++)
+			if (order[fv] > 0)
+				tr[order[fv]].andexor();
+	}
+
+	void trippancy_link() {
+		byte fv;
+
+		if (Gyro::ddmnow | Gyro::ontoolbar | Gyro::seescroll)  return;
+		for (fv = 1; fv <= numtr; fv ++) {
+			if (tr[fv].quick)
+				tr[fv].walk();
+		}
+
+		call_andexors();
+		for (fv = 1; fv <= numtr; fv ++) {
+			triptype &with = tr[fv];
+			if (with.quick && with.call_eachstep) {
+				switch (tr[fv].eachstep) {
+				case procfollow_avvy_y :
+					follow_avvy_y(fv);
+					break;
+				case procback_and_forth :
+					back_and_forth(fv);
+					break;
+				case procface_avvy :
+					face_avvy(fv);
+					break;
+				case procarrow_procs :
+					arrow_procs(fv);
+					break;
+					/*    PROCSpludwick_procs : spludwick_procs(fv);*/
+				case procgrab_avvy :
+					grab_avvy(fv);
+					break;
+				case procgeida_procs :
+					geida_procs(fv);
+					break;
+				}
+			}
+		}
+		if (mustexclaim) {
+			mustexclaim = false;
+			Visa::dixi('x', saywhat);
+		}
+	}
+
+	void get_back_loretta() {
+		byte fv;
+
+		/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
+		for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
+				getback();
+				return;
+			}
+		/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
+	}
+
+	void stopwalking() {
+		tr[1].stopwalk();
+		Gyro::dna.rw = stopped;
+		if (Gyro::alive)
+			tr[1].step = 1;
+	}
+
+	void tripkey(char dir) {
+		if ((Gyro::ctrl == Gyro::cjoy) | (! Gyro::dna.user_moves_avvy))
+			return;
+
+		{
+			triptype &with = tr[1];
+			{
+				switch (dir) {
+				case 'H':
+					if (Gyro::dna.rw != up) {
+						Gyro::dna.rw = up;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'P':
+					if (Gyro::dna.rw != down) {
+						Gyro::dna.rw = down;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'K':
+					if (Gyro::dna.rw != left) {
+						Gyro::dna.rw = left;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'M':
+					if (Gyro::dna.rw != right) {
+						Gyro::dna.rw = right;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'I':
+					if (Gyro::dna.rw != ur) {
+						Gyro::dna.rw = ur;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'Q':
+					if (Gyro::dna.rw != dr) {
+						Gyro::dna.rw = dr;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'O':
+					if (Gyro::dna.rw != dl) {
+						Gyro::dna.rw = dl;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'G':
+					if (Gyro::dna.rw != ul) {
+						Gyro::dna.rw = ul;
+						rwsp(1, Gyro::dna.rw);
+					} else stopwalking();
+					break;
+				case 'L':
+					stopwalking();
+					break;
+				}
+			}
+		}
+	}
+
+	void readstick() {
+		warning("STUB: Trip::readstick()");
+	}
+
+	void getsetclear() {
+		byte fv;
+
+		for (fv = 0; fv <= 1; fv ++)
+			getset[fv].init();
+	}
+
+	void hide_in_the_cupboard() {
+		const char nowt = 250; /* As in Acci. */
+
+		if (Gyro::dna.avvys_in_the_cupboard) {
+			if (Gyro::dna.wearing == nowt)
+				Scrolls::display("\6AVVY!\22 Get dressed first!");
+			else {
+				tr[1].visible = true;
+				Gyro::dna.user_moves_avvy = true;
+				apped(1, 3); /* Walk out of the cupboard. */
+				Scrolls::display("You leave the cupboard. Nice to be out of there!");
+				Gyro::dna.avvys_in_the_cupboard = false;
+				Sequence::first_show(8);
+				Sequence::then_show(7);
+				Sequence::start_to_close;
+			}
+		} else {
+			/* Not hiding in the cupboard */
+			tr[1].visible = false;
+			Gyro::dna.user_moves_avvy = false;
+			Scrolls::display(Common::String("You walk into the room...\20It seems to be an empty, ") +
+					"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
+					"avoid suffocation.");
+			Gyro::dna.avvys_in_the_cupboard = true;
+			Celer::show_one(8);
+		}
+	}
+
+
+
+	void fliproom(byte room, byte ped);
+
+	static int16 beforex, beforey;
+
+	static void tidy_after_mouse();
+
+	static void tidy_up(int16 a, int16 b, int16 c, int16 d) {
+		warning("STUB: Trip::tidy_up()");
+	}
+
+
+
+	static void tidy_after_mouse() {
+		tidy_up(beforex, beforey, beforex + 15, beforey + 15);
+		Gyro::xycheck();
+		tidy_up(Gyro::mx, Gyro::my, Gyro::mx + 15, Gyro::my + 15);
+	}
+
+	void fliproom(byte room, byte ped) {
+		byte fv;
+
+
+		if (! Gyro::alive) {
+			/* You can't leave the room if you're dead. */
+			tr[1].ix = 0;
+			tr[1].iy = 0; /* Stop him from moving. */
+			return;
+		}
+
+		if ((ped == 177) && (Gyro::dna.room == r__lusties)) {
+			hide_in_the_cupboard();
+			return;
+		}
+
+		if ((Gyro::dna.jumpstatus > 0) && (Gyro::dna.room == r__insidecardiffcastle)) {
+			/* You can't *jump* out of Cardiff Castle! */
+			tr[1].ix = 0;
+			return;
+		}
+
+		Gyro::xycheck();
+		beforex = Gyro::mx;
+		beforey = Gyro::my;
+
+		Lucerna::exitroom(Gyro::dna.room);
+		Lucerna::dusk();
+		getsetclear();
+
+
+		for (fv = 2; fv <= numtr; fv ++) {
+			if (tr[fv].quick)
+				tr[fv].done();
+		} /* Deallocate sprite */
+
+		if (Gyro::dna.room == r__lustiesroom)
+			Gyro::dna.enter_catacombs_from_lusties_room = true;
+
+		Lucerna::enterroom(room, ped);
+		apped(1, ped);
+		Gyro::dna.enter_catacombs_from_lusties_room = false;
+		Gyro::oldrw = Gyro::dna.rw;
+		Gyro::dna.rw = tr[1].face;
+		Lucerna::showrw;
+
+		for (fv = 0; fv <= 1; fv ++) {
+			Gyro::cp = 1 - Gyro::cp;
+			getback();
+		}
+		Lucerna::dawn;
+
+		/* Tidy up after mouse. I know it's a kludge... */
+		/*  tidy_after_mouse;*/
+	}
+
+	bool infield(byte which) {
+	/* returns True if you're within field "which" */
+		int16 yy;
+		
+		yy = tr[1].y + tr[1].a.yl;
+
+		return (tr[1].x >= Gyro::fields[which].x1) && (tr[1].x <= Gyro::fields[which].x2)
+			&& (yy >= Gyro::fields[which].y1) && (yy <= Gyro::fields[which].y2);
+
+	}
+
+	bool neardoor() {       /* returns True if you're near a door! */
+		int16 ux, uy;
+		byte fv;
+		bool nd;
+
+		bool neardoor_result;
+		if (Gyro::numfields < 9) {
+			/* there ARE no doors here! */
+			neardoor_result = false;
+			return neardoor_result;
+		}
+		
+		ux = tr[1].x;
+		uy = tr[1].y + tr[1].a.yl;
+		
+		nd = false;
+		for (fv = 9; fv <= Gyro::numfields; fv ++) {
+			Gyro::fields[fv];
+
+			if ((ux >= Gyro::fields[fv].x1) && (ux <= Gyro::fields[fv].x2)
+				&& (uy >= Gyro::fields[fv].y1) && (uy <= Gyro::fields[fv].y2)) 
+					nd = true;
+		}
+		return nd;
+	}
+
+	void new_game_for_trippancy() {   /* Called by gyro.newgame */
+		tr[1].visible = false;
+	}
+
+	void triptype::save_data_to_mem(uint16 &where) {
+		warning("STUB: Trip::save_data_to_mem()");
+	}
+
+	void triptype::load_data_from_mem(uint16 &where) {
+		warning("STUB: Trip::load_data_from_mem()");
+	}
+
+	} // End of namespace Trip.
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
new file mode 100644
index 0000000..0227bab
--- /dev/null
+++ b/engines/avalanche/trip6.h
@@ -0,0 +1,227 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* TRIP5	Trippancy V */
+
+
+#ifndef TRIP6_H
+#define TRIP6_H
+
+
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+#include "avalanche/gyro2.h"
+
+namespace Avalanche {
+
+	namespace Trip {
+
+	// Call it where Trip is first used.
+	// Procuded to replace the initizalization part of the original Pascal unit.
+	void initialize_trip();
+
+	const int16 maxgetset = 35;
+
+	typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
+	// Be aware!!!
+
+	typedef byte siltype[51][11]; /* 35, 4 */
+
+	struct adxtype { /* Second revision of ADX type */
+		Common::String name; /* name of character */
+		Common::String comment; /* comment */
+		byte num; /* number of pictures */
+		byte xl, yl; /* x & y lengths of pictures */
+		byte seq; /* how many in one stride */
+		uint16 size; /* the size of one picture */
+		byte fgc, bgc; /* foreground & background bubble colours */
+		byte accinum; /* the number according to Acci (1=Avvy, etc.) */
+	};
+
+	struct trip_saver_type {
+		byte whichsprite;
+		byte face;
+		byte step;
+		int16 x;
+		int16 y;
+		int8 ix;
+		int8 iy;
+		bool visible;
+		bool homing;
+		bool check_me;
+		byte count;
+		byte xw, xs, ys;
+		byte totalnum;
+		int16 hx;
+		int16 hy;
+		bool call_eachstep;
+		byte eachstep;
+		bool vanishifstill;
+	};
+
+	class triptype {
+	public:
+		adxtype a; /* vital statistics */
+		byte face, step;
+		int16 x, y; /* current xy coords */
+		int16 ox[2], oy[2];  /* last xy coords */
+		int8 ix, iy; /* amount to move sprite by, each step */
+		manitype *mani[24];
+		siltype *sil[24];
+		byte whichsprite;
+		bool quick, visible, homing, check_me;
+		int16 hx, hy; /* homing x & y coords */
+		byte count; /* counts before changing step */
+		byte xw; /* x-width in bytes */
+		byte xs, ys; /* x & y speed */
+		byte totalnum; /* total number of sprites */
+		bool vanishifstill; /* Do we show this sprite if it's still? */
+
+		bool call_eachstep; /* Do we call the eachstep procedure? */
+		byte eachstep;
+
+		triptype *init(byte spritenum, bool do_check);
+		/* loads & sets up the sprite */
+		void original();    /* just sets Quick to false */
+		void andexor();    /* drops sprite onto screen */
+		void turn(byte whichway);      /* turns him round */
+		void appear(int16 wx, int16 wy, byte wf); /* switches him on */
+		void bounce();    /* bounces off walls. */
+		void walk();    /* prepares for andexor, etc. */
+		void walkto(byte pednum);      /* home in on a point */
+		void stophoming();    /* self-explanatory */
+		void homestep();    /* calculates ix & iy for one homing step */
+		void speed(int8 xx, int8 yy); /* sets ix & iy, non-homing, etc */
+		void stopwalk();    /* Stops the sprite from moving */
+		void chatter();    /* Sets up talk vars */
+		void set_up_saver(trip_saver_type &v);
+		void unload_saver(trip_saver_type v);
+
+		void savedata(/*untyped_file &f*/); /* Self-explanatory, */
+		void loaddata(/*untyped_file &f*/);  /* really. */
+		
+	
+
+
+		void save_data_to_mem(uint16 &where);
+		void load_data_from_mem(uint16 &where);
+		triptype *done();
+
+	private:
+		bool collision_check();
+	};
+
+	class getsettype {
+	public:
+		Gyro::bytefield gs[maxgetset];
+		byte numleft;
+
+		getsettype *init();
+		void remember(Gyro::bytefield r);
+		void recall(Gyro::bytefield &r);
+	};
+
+
+	const int16 up = 0;
+	const int16 right = 1;
+	const int16 down = 2;
+	const int16 left = 3;
+	const int16 ur = 4;
+	const int16 dr = 5;
+	const int16 dl = 6;
+	const int16 ul = 7;
+	const int16 stopped = 8;
+
+	const int16 numtr = 5; /* current max no. of sprites */
+
+
+
+	const int16 procfollow_avvy_y = 1;
+
+	const int16 procback_and_forth = 2;
+
+	const int16 procface_avvy = 3;
+
+	const int16 procarrow_procs = 4;
+
+	const int16 procspludwick_procs = 5;
+
+	const int16 procgrab_avvy = 6;
+
+	const int16 procgeida_procs = 7;
+
+
+	void trippancy_link();
+
+	void get_back_loretta();
+
+	void loadtrip();
+
+	void call_special(uint16 which);
+
+	void open_the_door(byte whither, byte ped, byte magicnum); /* Handles slidey-open doors. */
+
+	void catamove(byte ped);
+
+	void stopwalking();
+
+	void tripkey(char dir);
+
+	void rwsp(byte t, byte r);
+
+	void apped(byte trn, byte np);
+
+	void getback();
+
+	void fliproom(byte room, byte ped);
+
+	bool infield(byte which);          /* returns True if you're within field "which" */
+
+	bool neardoor();        /* returns True if you're near a door! */
+
+	void readstick();
+
+	void newspeed();
+
+	void new_game_for_trippancy();
+
+
+
+	triptype tr[numtr];
+	getsettype getset[2];
+	byte aa[1600];
+
+	bool mustexclaim;
+	uint16 saywhat;
+
+	} // End of namespace Trip.
+
+} // End of namespace Avalanche.
+
+#endif // TRIP6_H


Commit: 784a6aa821cebf39f44a60e419aa500dc946c943
    https://github.com/scummvm/scummvm/commit/784a6aa821cebf39f44a60e419aa500dc946c943
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-27T03:34:32-07:00

Commit Message:
AVALANCHE: Change constant into initialized variable according to the Pascal sources.

Changed paths:
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index cd5644e..0836dfb 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -44,10 +44,6 @@ namespace Avalanche {
 	const int16 maxobjs = 12;  /* carry limit */
 	const byte howlong = 1/*8*/; /* 18 ticks. */
 
-	const bool oncandopageswap = true; 
-	/* Variable constant for overriding the ability of On to switch pages.
-	 * You may know better than On which page to switch to. */
-
 	const int16 num = 32;  /* Code for Num Lock */
 
 	const int16 mouse_size = 134;
@@ -624,6 +620,12 @@ namespace Avalanche {
 		r__wisewomans
 	}; /* The Wise Woman. */
 
+	bool oncandopageswap = true; 
+	/* Variable constant for overriding the ability of On to switch pages.
+	 * You may know better than On which page to switch to. */
+
+
+
 
 
 	Common::String current;


Commit: a9cc1f78b4aad2f2cc22647d22bc478f5d545b75
    https://github.com/scummvm/scummvm/commit/a9cc1f78b4aad2f2cc22647d22bc478f5d545b75
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T02:35:19-07:00

Commit Message:
AVALANCHE: Gyro: Replace namespace with class.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index fba155a..a96249d 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* GYRO		It all revolves around this bit! */
+
 #include "avalanche/gyro2.h"
 #include "common/textconsole.h"
 
@@ -41,289 +43,476 @@
 
 namespace Avalanche {
 
-	namespace Gyro {
-
-	const Common::String things[numobjs] = {
-		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
-		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
-		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
-	};
+const char *Gyro::vernum = "1.30";
 
-	const char thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */
+const char *Gyro::copyright = "1995";
 
-	const Common::String better[numobjs] = {
-		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
-		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
-		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
-		"an onion"
-	};
 
-	const char betterchar[] = "WMBParCLguKeSnIohn";
+const mp Gyro::mps[9] = {
+	{
+		/* 1 - up-arrow */
+		{	{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575},
+		{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}
+		},	
+			8,
+			0
+	},
 
-	void newpointer(byte m) {
-		warning("STUB: Gyro::newpointer()");
-	}
+	{
+		/* 2 - screwdriver */
+		{	{8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523},
+		{0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0}
 
-	void wait() {   /* makes hourglass */
-		newpointer(5);
-	}
+		},
+			0,
+			0
+	},
 
-	void on() {
-		warning("STUB: Gyro::on()");
-	}
+	{
+		/* 3 - right-arrow */
+		{	{65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535},
+		{0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0}	
+		},
+			15,
+			6
+	},
 
-	void on_virtual() {
-		switch (visible) {
-		case m_virtual:
-			return;
-			break;
-		case m_yes:
-			off();
-			break;
+	{
+		/* 4 - fletch */
+		{	{255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511},
+		{0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0}
+		},
+			0,
+			0
+		},
+
+		{
+			/* 5 - hourglass */
+			{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
+			{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
+			},
+				8,
+				7
+		},
+
+		{
+			/* 6 - TTHand */
+			{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
+			{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
+			},
+				4,
+				0
+		},
+
+		{
+			/* 7- Mark's crosshairs */
+			{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
+			{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
+			},
+				8,
+				5
+		},
+
+		{
+			/* 8- I-beam. */
+			{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
+			{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
+			},
+				8,
+				7
+		},
+
+		{
+			/* 9- Question mark. */
+			{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
+			{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
+			},
+				0,
+				0
 		}
-
-		visible = m_virtual;
-	}
-
-	void off() {
-		warning("STUB: Gyro::off()");
-	}
-
-	void off_virtual() {
-		warning("STUB: Gyro::off_virtual()");
-	}
-
-	void xycheck() {   /* only updates mx & my, not all other mouse vars */
-		warning("STUB: Gyro::xycheck()");
-	}
-
-	void hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */
-		warning("STUB: Gyro::hopto()");
-	}
-
-	void check() {
-		warning("STUB: Gyro::check()");
-	}
-
-	void note(uint16 hertz) {
-		warning("STUB: Gyro::note()");
-	}
-
-	void blip() {
-		warning("STUB: Gyro::blip()");
-	}
-
-	Common::String strf(int32 x) {
-		Common::String q = Common::String::format("%d", x);
-		return q;
-	}
-
-	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
-		warning("STUB: Gyro::shadow()");
-	}
-
-	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
-		warning("STUB: Gyro::shbox()");
-	}
-
-	void newgame() {   /* This sets up the DNA for a completely new game. */
-		warning("STUB: Gyro::newgame()");
-	}
-
-	void click() {   /* "Audio keyboard feedback" */
-		warning("STUB: Gyro::click()");
-	}
-
-	void slowdown() {
-		warning("STUB: Gyro::slowdown()");
-	}
-
-	bool flagset(char x) {
-		for (uint16 i = 0; i < flags.size(); i++)
-			if (flags[i] == x)
-				return true;
-		return false;
-	}
-
-	void force_numlock() {
-		if ((locks & num) > 0)  locks -= num;
-	}
-
-	bool pennycheck(uint16 howmuchby) {
-		warning("STUB: Gyro::pennycheck()");
-		return true;
-	}
-
-	// There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
-	// Keep an eye open!
-	Common::String getname(byte whose) { 
-		Common::String getname_result;
-		if (whose < 17)
-			getname_result = lads[whose];
-		else
-			getname_result = lasses[whose-17];
-		return getname_result;
-	}
-
-	// Keep an eye open! ^
-	char getnamechar(byte whose) {
-		char getnamechar_result;
-		if (whose < 16) 
-			getnamechar_result = ladchar[whose];
-		else
-			getnamechar_result = lasschar[whose-16];
-		return getnamechar_result;
-	}
-
-	// Keep an eye open! ^^
-	Common::String get_thing(byte which) {
-		Common::String get_thing_result;
-		switch (which) {
-		case wine:
-			switch (dna.winestate) {
-			case 1:
-			case 4:
-				get_thing_result = things[which];
-				break;
-			case 3:
-				get_thing_result = "Vinegar";
-				break;
-			}
+};
+
+const Common::String Gyro::lads[17] = {
+	"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
+	"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
+	"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+};
+
+const Common::String Gyro::lasses[4] =
+{"Arkata", "Geida", "±", "the Wise Woman"};
+
+const char Gyro::ladchar[] = "ASCDMTRwLfgeIyPu";
+
+const char Gyro::lasschar[] = "kG±o";
+
+const int32 Gyro::catamap[8][8] = {
+	/* Geida's room */
+	/*  1     2			3   | 4     5		6		7     8*/
+	{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
+	{0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
+	{0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
+	{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */
+	{0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
+	{0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
+	{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */
+	{0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
+};
+/* vv Stairs trap. */
+
+const char Gyro::spludwick_order[3] = {onion, ink, mushroom};
+
+const quasiped_type Gyro::quasipeds[16] = {
+	{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
+	{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
+	{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
+	{3, black,     23, red, 177},                         /* D: Hawk (screen 23). */
+	{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
+	{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
+	{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
+	{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
+	{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
+	{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
+	{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
+	{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
+	{3, white,     27, red, 177},                         /* M: Avaroid (screen 27). */
+	{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
+	{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
+	{2, lightgreen, 51, darkgray, pdrduck}
+};                         /*P: Duck (screen 51). */
+
+const char Gyro::keys[] = "QWERTYUIOP[]";
+
+const uint16 Gyro::notes[12] =
+{196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+
+const tunetype Gyro::tune = {
+	higher, higher, lower, same, higher, higher, lower, higher, higher, higher,
+	lower, higher, higher,
+	same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower,
+	lower, same, lower, higher, same, lower, higher
+};
+
+const byte Gyro::static_const_whereis[29] = {
+	/* The Lads */
+	r__yours, /* Avvy */
+	r__spludwicks, /* Spludwick */
+	r__outsideyours, /* Crapulus */
+	r__ducks, /* Duck - r__DucksRoom's not defined yet. */
+	r__argentpub, /* Malagauche */
+	r__robins, /* Friar Tuck. */
+	177, /* Robin Hood - can't meet him at the start. */
+	r__brummieroad, /* Cwytalot */
+	r__lustiesroom, /* Baron du Lustie. */
+	r__outsidecardiffcastle, /* The Duke of Cardiff. */
+	r__argentpub, /* Dogfood */
+	r__outsideducks, /* Trader */
+	r__argentpub, /* Ibythneth */
+	r__aylesoffice, /* Ayles */
+	r__nottspub, /* Port */
+	r__nottspub, /* Spurge */
+	r__musicroom, /* Jacques */
+	0, 0, 0, 0, 0, 0, 0, 0,
+	/* The Lasses */
+	r__yours, /* Arkata */
+	r__geidas, /* Geida */
+	177, /* nobody allocated here! */
+	r__wisewomans  /* The Wise Woman. */
+};
+
+
+
+
+
+const Common::String Gyro::things[numobjs] = {
+	"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+	"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+	"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+};
+
+const char Gyro::thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */
+
+const Common::String Gyro::better[numobjs] = {
+	"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
+	"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
+	"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
+	"an onion"
+};
+
+const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
+
+
+
+Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
+	for (int i = 0; i < 29; i++)
+		whereis[i] = static_const_whereis[i];
+}
+
+void Gyro::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Gyro::newpointer(byte m) {
+	warning("STUB: Gyro::newpointer()");
+}
+
+void Gyro::wait() {   /* makes hourglass */
+	newpointer(5);
+}
+
+void Gyro::on() {
+	warning("STUB: Gyro::on()");
+}
+
+void Gyro::on_virtual() {
+	switch (visible) {
+	case m_virtual:
+		return;
+		break;
+	case m_yes:
+		off();
+		break;
+	}
+
+	visible = m_virtual;
+}
+
+void Gyro::off() {
+	warning("STUB: Gyro::off()");
+}
+
+void Gyro::off_virtual() {
+	warning("STUB: Gyro::off_virtual()");
+}
+
+void Gyro::xycheck() {   /* only updates mx & my, not all other mouse vars */
+	warning("STUB: Gyro::xycheck()");
+}
+
+void Gyro::hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */
+	warning("STUB: Gyro::hopto()");
+}
+
+void Gyro::check() {
+	warning("STUB: Gyro::check()");
+}
+
+void Gyro::note(uint16 hertz) {
+	warning("STUB: Gyro::note()");
+}
+
+void Gyro::blip() {
+	warning("STUB: Gyro::blip()");
+}
+
+Common::String Gyro::strf(int32 x) {
+	Common::String q = Common::String::format("%d", x);
+	return q;
+}
+
+void Gyro::shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
+	warning("STUB: Gyro::shadow()");
+}
+
+void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+	warning("STUB: Gyro::shbox()");
+}
+
+void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
+	warning("STUB: Gyro::newgame()");
+}
+
+void Gyro::click() {   /* "Audio keyboard feedback" */
+	warning("STUB: Gyro::click()");
+}
+
+void Gyro::slowdown() {
+	warning("STUB: Gyro::slowdown()");
+}
+
+bool Gyro::flagset(char x) {
+	for (uint16 i = 0; i < flags.size(); i++)
+		if (flags[i] == x)
+			return true;
+	return false;
+}
+
+void Gyro::force_numlock() {
+	if ((locks & num) > 0)  locks -= num;
+}
+
+bool Gyro::pennycheck(uint16 howmuchby) {
+	warning("STUB: Gyro::pennycheck()");
+	return true;
+}
+
+// There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
+// Keep an eye open!
+Common::String Gyro::getname(byte whose) { 
+	Common::String getname_result;
+	if (whose < 17)
+		getname_result = lads[whose];
+	else
+		getname_result = lasses[whose-17];
+	return getname_result;
+}
+
+// Keep an eye open! ^
+char Gyro::getnamechar(byte whose) {
+	char getnamechar_result;
+	if (whose < 16) 
+		getnamechar_result = ladchar[whose];
+	else
+		getnamechar_result = lasschar[whose-16];
+	return getnamechar_result;
+}
+
+// Keep an eye open! ^^
+Common::String Gyro::get_thing(byte which) {
+	Common::String get_thing_result;
+	switch (which) {
+	case wine:
+		switch (dna.winestate) {
+		case 1:
+		case 4:
+			get_thing_result = things[which];
 			break;
-		case onion:
-			if (dna.rotten_onion)
-				get_thing_result = "rotten onion";
-			else get_thing_result = things[which];
+		case 3:
+			get_thing_result = "Vinegar";
 			break;
-		default:
-			get_thing_result = things[which];
 		}
-		return get_thing_result;
-	}
-
-	// Keep an eye open! ^^^
-	char get_thingchar(byte which) {
-		char get_thingchar_result;
-		switch (which) {
-		case wine:
-			if (dna.winestate == 3)
-				get_thingchar_result = 'V'; /* Vinegar */
-			else
-				get_thingchar_result = thingchar[which];
-			break;
-		default:
+		break;
+	case onion:
+		if (dna.rotten_onion)
+			get_thing_result = "rotten onion";
+		else get_thing_result = things[which];
+		break;
+	default:
+		get_thing_result = things[which];
+	}
+	return get_thing_result;
+}
+
+// Keep an eye open! ^^^
+char Gyro::get_thingchar(byte which) {
+	char get_thingchar_result;
+	switch (which) {
+	case wine:
+		if (dna.winestate == 3)
+			get_thingchar_result = 'V'; /* Vinegar */
+		else
 			get_thingchar_result = thingchar[which];
-		}
-		return get_thingchar_result;
-	}
-
-	// Keep an eye open! ^^^^
-	Common::String get_better(byte which) {
-		Common::String get_better_result;
-		if (which > 150)  which -= 149;
-		switch (which) {
-		case wine:
-			switch (dna.winestate) {
-			case 0:
-			case 1:
-			case 4:
-				get_better_result = better[which];
-				break;
-			case 3:
-				get_better_result = "some vinegar";
-				break;
-			}
+		break;
+	default:
+		get_thingchar_result = thingchar[which];
+	}
+	return get_thingchar_result;
+}
+
+// Keep an eye open! ^^^^
+Common::String Gyro::get_better(byte which) {
+	Common::String get_better_result;
+	if (which > 150)  which -= 149;
+	switch (which) {
+	case wine:
+		switch (dna.winestate) {
+		case 0:
+		case 1:
+		case 4:
+			get_better_result = better[which];
 			break;
-		case onion:
-			if (dna.rotten_onion)
-				get_better_result = "a rotten onion";
-			else if (dna.onion_in_vinegar)
-				get_better_result = "a pickled onion (in the vinegar)";
-			else get_better_result = better[which];
+		case 3:
+			get_better_result = "some vinegar";
 			break;
-		default:
-			if ((which < numobjs) && (which > '\0'))
-				get_better_result = better[which];
-			else
-				get_better_result = "";
 		}
-		return get_better_result;
+		break;
+	case onion:
+		if (dna.rotten_onion)
+			get_better_result = "a rotten onion";
+		else if (dna.onion_in_vinegar)
+			get_better_result = "a pickled onion (in the vinegar)";
+		else get_better_result = better[which];
+		break;
+	default:
+		if ((which < numobjs) && (which > '\0'))
+			get_better_result = better[which];
+		else
+			get_better_result = "";
 	}
+	return get_better_result;
+}
 
-	// Get back here after finished with acci.pas, where vb_-s are resided.
-	Common::String f5_does()
-	/* This procedure determines what f5 does. */
-	{
-		warning("STUB: Gyro::f5_does()");
-		return "STUB: Gyro::f5_does()";
-	}
+// Get back here after finished with acci.pas, where vb_-s are resided.
+Common::String Gyro::f5_does()
+/* This procedure determines what f5 does. */
+{
+	warning("STUB: Gyro::f5_does()");
+	return "STUB: Gyro::f5_does()";
+}
 
-	// Pobably vmc functions will deal with the mouse cursor.
-	void plot_vmc(int16 xx, int16 yy, byte page_) {
-		warning("STUB: Gyro::plot_vmc()");
-	}
+// Pobably vmc functions will deal with the mouse cursor.
+void Gyro::plot_vmc(int16 xx, int16 yy, byte page_) {
+	warning("STUB: Gyro::plot_vmc()");
+}
 
-	void wipe_vmc(byte page_) {
-		warning("STUB: Gyro::wipe_vmc()");
-	}
+void Gyro::wipe_vmc(byte page_) {
+	warning("STUB: Gyro::wipe_vmc()");
+}
 
-	void setup_vmc() {
-		warning("STUB: Gyro::setup_vmc()");
-	}
+void Gyro::setup_vmc() {
+	warning("STUB: Gyro::setup_vmc()");
+}
 
-	void clear_vmc() {
-		warning("STUB: Gyro::clear_vmc()");
-	}
+void Gyro::clear_vmc() {
+	warning("STUB: Gyro::clear_vmc()");
+}
 
-	void setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */
-		warning("STUB: Gyro::setminmaxhorzcurspos()");
-	}
+void Gyro::setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */
+	warning("STUB: Gyro::setminmaxhorzcurspos()");
+}
 
-	void setminmaxvertcurspos(uint16 min, uint16 max) {
-		warning("STUB: Gyro::setminmaxvertcurspos()");
-	}
+void Gyro::setminmaxvertcurspos(uint16 min, uint16 max) {
+	warning("STUB: Gyro::setminmaxvertcurspos()");
+}
 
-	void load_a_mouse(byte which) {
-		warning("STUB: Gyro::load_a_mouse()");
-	}
+void Gyro::load_a_mouse(byte which) {
+	warning("STUB: Gyro::load_a_mouse()");
+}
 
-	void background(byte x) {
-		warning("STUB: Gyro::background()");
-	}
+void Gyro::background(byte x) {
+	warning("STUB: Gyro::background()");
+}
 
-	void hang_around_for_a_while() {
-		byte fv;
+void Gyro::hang_around_for_a_while() {
+	byte fv;
 
-		for (fv = 1; fv <= 28; fv ++) slowdown();
-	}
+	for (fv = 1; fv <= 28; fv ++) slowdown();
+}
 
-	bool mouse_near_text() {
-		bool mouse_near_text_result;
-		mouse_near_text_result = (my > 144) && (my < 188);
-		return mouse_near_text_result;
-	}
-
-	/* Super_Off and Super_On are two very useful procedures. Super_Off switches
-	  the mouse cursor off, WHATEVER it's like. Super_On restores it again
-	  afterwards. */
+/* Super_Off and Super_On are two very useful procedures. Super_Off switches
+	the mouse cursor off, WHATEVER it's like. Super_On restores it again
+	afterwards. */
 
-	void super_off() {
-		super_was_off = visible == m_no;
-		if (super_was_off)  return;
+void Gyro::super_off() {
+	super_was_off = visible == m_no;
+	if (super_was_off)  return;
 
-		super_was_virtual = visible == m_virtual;
+	super_was_virtual = visible == m_virtual;
 
-		if (visible == m_virtual)  off_virtual();
-		else off();
-	}
+	if (visible == m_virtual)  off_virtual();
+	else off();
+}
 
-	void super_on() {
-		if ((visible != m_no) || (super_was_off))  return;
+void Gyro::super_on() {
+	if ((visible != m_no) || (super_was_off))  return;
 
-		if (super_was_virtual)  on_virtual();
-		else on();
-	}
+	if (super_was_virtual)  on_virtual();
+	else on();
+}
 
-	} // End of namespace Gyro
+bool Gyro::mouse_near_text() {
+	bool mouse_near_text_result;
+	mouse_near_text_result = (my > 144) && (my < 188);
+	return mouse_near_text_result;
+}
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 0836dfb..ecea597 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -25,490 +25,392 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* GYRO		It all revolves around this bit! */
+
 #ifndef GYRO2_H
 #define GYRO2_H
 
 #include "common/system.h"
 #include "common/str.h"
 #include "common/scummsys.h"
+#include "avalanche/avalanche.h"
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"
 
 namespace Avalanche {
 
-	namespace Gyro {
-
-	///////////////////////////// CONSTANTS ///////////////////////////// 
+static const char numobjs = 18; /* always preface with a # */
+static const int16 maxobjs = 12;  /* carry limit */
+static const byte howlong = 1/*8*/; /* 18 ticks. */
 
-	const char numobjs = 18; /* always preface with a # */
-	const int16 maxobjs = 12;  /* carry limit */
-	const byte howlong = 1/*8*/; /* 18 ticks. */
+static const int16 num = 32;  /* Code for Num Lock */
 
-	const int16 num = 32;  /* Code for Num Lock */
+static const int16 mouse_size = 134;
 
-	const int16 mouse_size = 134;
 
 
+typedef void (*proc)();
 
-	///////////////////////////// TYPEDEFS ///////////////////////////// 
+struct postype {
+	uint16 x, y, datapos;
+	byte length;
+};
 
-	typedef void (*proc)();
+struct mp { /* mouse-void **/
+	uint16 mask[2][16];
+	int16 horzhotspot, verthotspot;
+};
 
-	struct postype {
-		uint16 x, y, datapos;
-		byte length;
-	};
+struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
+	byte rw; /* Realway- just for convenience! */
+	byte carrying; /* how many objects you're carrying... */
+	bool obj[numobjs]; /* ...and which ones they are. */
+	int16 score; /* your score, of course */
+	int32 pence; /* your current amount of dosh */
+	byte room; /* your current room */
+	char wearing; /* what you're wearing */
+	byte swore; /* number of times you've sworn */
+	byte saves; /* number of times this game has been saved */
+	byte rooms[100];     /* Add one to each every time
+											you enter a room */
+	byte alcohol; /* Your blood alcohol level. */
+	byte playednim; /* How many times you've played Nim. */
+	bool wonnim; /* Have you *won* Nim? (That's harder.) */
+	byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/
+	bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/
 
-	struct mp { /* mouse-void **/
-		uint16 mask[2][16];
-		int16 horzhotspot, verthotspot;
-	};
+	byte pass_num; /* Number of the passuint16 for this game. */
+	bool ayles_is_awake; /* pretty obvious! */
+	byte drawbridge_open; /* Between 0 (shut) and 4 (open). */
+	byte avaricius_talk; /* How much Avaricius has said to you. */
+	bool bought_onion; /* Have you bought an onion yet? */
+	bool rotten_onion; /* And has it rotted? */
+	bool onion_in_vinegar; /* Is the onion in the vinegar? */
 
-	struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
-		byte rw; /* Realway- just for convenience! */
-		byte carrying; /* how many objects you're carrying... */
-		bool obj[numobjs]; /* ...and which ones they are. */
-		int16 score; /* your score, of course */
-		int32 pence; /* your current amount of dosh */
-		byte room; /* your current room */
-		char wearing; /* what you're wearing */
-		byte swore; /* number of times you've sworn */
-		byte saves; /* number of times this game has been saved */
-		byte rooms[100];     /* Add one to each every time
-												you enter a room */
-		byte alcohol; /* Your blood alcohol level. */
-		byte playednim; /* How many times you've played Nim. */
-		bool wonnim; /* Have you *won* Nim? (That's harder.) */
-		byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/
-		bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/
+	byte given2spludwick; /* 0 = nothing given, 1 = onion... */
+	byte brummie_stairs; /* Progression through the stairs trick. */
+	byte cardiff_things; /* Things you get asked in Cardiff. */
 
-		byte pass_num; /* Number of the passuint16 for this game. */
-		bool ayles_is_awake; /* pretty obvious! */
-		byte drawbridge_open; /* Between 0 (shut) and 4 (open). */
-		byte avaricius_talk; /* How much Avaricius has said to you. */
-		bool bought_onion; /* Have you bought an onion yet? */
-		bool rotten_onion; /* And has it rotted? */
-		bool onion_in_vinegar; /* Is the onion in the vinegar? */
+	bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/
 
-		byte given2spludwick; /* 0 = nothing given, 1 = onion... */
-		byte brummie_stairs; /* Progression through the stairs trick. */
-		byte cardiff_things; /* Things you get asked in Cardiff. */
+	bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */
+	bool avvy_in_bed; /* True if Avvy's in bed, but awake. */
 
-		bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/
+	bool user_moves_avvy; /* If this is false, the user has no
+										control over Avvy's movements. */
 
-		bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */
-		bool avvy_in_bed; /* True if Avvy's in bed, but awake. */
+	byte dogfoodpos; /* Which way Dogfood's looking in the pub. */
 
-		bool user_moves_avvy; /* If this is false, the user has no
-											control over Avvy's movements. */
+	bool givenbadgetoiby; /* Have you given the badge to Iby yet? */
 
-		byte dogfoodpos; /* Which way Dogfood's looking in the pub. */
+	bool friar_will_tie_you_up; /* If you're going to get tied up. */
+	bool tied_up; /* You ARE tied up! */
 
-		bool givenbadgetoiby; /* Have you given the badge to Iby yet? */
+	char box_contents; /* 0 = money (sixpence), 254 = empty, any
+				other number implies the contents of the box. */
 
-		bool friar_will_tie_you_up; /* If you're going to get tied up. */
-		bool tied_up; /* You ARE tied up! */
+	bool talked_to_crapulus; /* Pretty self-explanatory. */
 
-		char box_contents; /* 0 = money (sixpence), 254 = empty, any
-				 other number implies the contents of the box. */
+	byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */
 
-		bool talked_to_crapulus; /* Pretty self-explanatory. */
+	bool ringing_bells; /* Is Jacques ringing the bells? */
 
-		byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */
+	bool standing_on_dais; /* In room 71, inside Cardiff Castle. */
+	bool taken_pen; /* Have you taken the pen (in Cardiff?) */
+	bool arrow_triggered; /* And has the arrow been triggered? */
+	bool arrow_in_the_door;  /* Did the arrow hit the wall? */
 
-		bool ringing_bells; /* Is Jacques ringing the bells? */
+	Common::String like2drink,
+					favourite_song,
+					worst_place_on_earth,
+					spare_evening;            /* Personalisation str's */
 
-		bool standing_on_dais; /* In room 71, inside Cardiff Castle. */
-		bool taken_pen; /* Have you taken the pen (in Cardiff?) */
-		bool arrow_triggered; /* And has the arrow been triggered? */
-		bool arrow_in_the_door;  /* Did the arrow hit the wall? */
+	int32 total_time; /* Your total time playing this game, in ticks.*/
 
-		Common::String like2drink,
-					   favourite_song,
-					   worst_place_on_earth,
-					   spare_evening;            /* Personalisation str's */
+	byte jumpstatus; /* Fixes how high you're jumping. */
 
-		int32 total_time; /* Your total time playing this game, in ticks.*/
+	bool mushroom_growing; /* Is the mushroom growing in 42? */
 
-		byte jumpstatus; /* Fixes how high you're jumping. */
+	bool spludwicks_here; /* Is Spludwick at home? */
 
-		bool mushroom_growing; /* Is the mushroom growing in 42? */
+	byte last_room;
+	byte last_room_not_map;
 
-		bool spludwicks_here; /* Is Spludwick at home? */
+	bool crapulus_will_tell; /* Will Crapulus tell you about
+						Spludwick being away? */
 
-		byte last_room;
-		byte last_room_not_map;
+	bool enter_catacombs_from_lusties_room;
+	bool teetotal; /* Are we touching any more drinks? */
+	byte malagauche; /* Position of Malagauche. See Celer for more info. */
+	char drinking; /* What's he getting you? */
 
-		bool crapulus_will_tell; /* Will Crapulus tell you about
-							Spludwick being away? */
+	bool entered_lusties_room_as_monk;
 
-		bool enter_catacombs_from_lusties_room;
-		bool teetotal; /* Are we touching any more drinks? */
-		byte malagauche; /* Position of Malagauche. See Celer for more info. */
-		char drinking; /* What's he getting you? */
+	byte cat_x, cat_y;   /* XY coords in the catacombs. */
 
-		bool entered_lusties_room_as_monk;
+	bool avvys_in_the_cupboard; /* On screen 22. */
 
-		byte cat_x, cat_y;   /* XY coords in the catacombs. */
+	bool geida_follows; /* Is Geida following you? */
 
-		bool avvys_in_the_cupboard; /* On screen 22. */
+	byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */
 
-		bool geida_follows; /* Is Geida following you? */
+	byte nextbell; /* For the ringing. */
 
-		byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */
+	bool geida_given_potion; /* Does Geida have the potion? */
+	bool lustie_is_asleep; /* Is BDL asleep? */
 
-		byte nextbell; /* For the ringing. */
+	byte flip_to_where, flip_to_ped; /* For the sequencer. */
 
-		bool geida_given_potion; /* Does Geida have the potion? */
-		bool lustie_is_asleep; /* Is BDL asleep? */
+	bool been_tied_up; /* In r__Robins. */
 
-		byte flip_to_where, flip_to_ped; /* For the sequencer. */
+	bool sitting_in_pub; /* Are you sitting down in the pub? */
+	byte spurge_talk; /* Count for talking to Spurge. */
 
-		bool been_tied_up; /* In r__Robins. */
+	bool met_avaroid;
 
-		bool sitting_in_pub; /* Are you sitting down in the pub? */
-		byte spurge_talk; /* Count for talking to Spurge. */
+	bool taken_mushroom,
+			given_pen_to_ayles,
+			asked_dogfood_about_nim;
+};
 
-		bool met_avaroid;
+struct pedtype {
+	int16 x, y;
+	byte dir;
+};
 
-		bool taken_mushroom,
-				given_pen_to_ayles,
-				asked_dogfood_about_nim;
-	};
+struct magictype {
+	byte op; /* one of the operations */
+	uint16 data; /* data for them */
+};
 
-	struct pedtype {
-		int16 x, y;
-		byte dir;
-	};
+class fieldtype {
+public:
+	int16 x1, y1, x2, y2;
+};
 
-	struct magictype {
-		byte op; /* one of the operations */
-		uint16 data; /* data for them */
-	};
+struct bytefield {
+	byte x1, y1, x2, y2;
+};
 
-	class fieldtype {
-	public:
-		int16 x1, y1, x2, y2;
-	};
+class linetype : public fieldtype {
+public:
+	byte col;
+};
 
-	struct bytefield {
-		byte x1, y1, x2, y2;
-	};
+struct adxtype {
+	Common::String name; /* name of character */
+	byte num; /* number of pictures */
+	byte xl, yl; /* x & y lengths of pictures */
+	byte seq; /* how many in one stride */
+	uint16 size; /* the size of one picture */
+	byte fgc, bgc; /* foreground & background bubble colours */
+};
 
-	class linetype : public fieldtype {
-	public:
-		byte col;
-	};
+typedef byte raw[256][16]; /* raw_font_type */
 
-	struct adxtype {
-		Common::String name; /* name of character */
-		byte num; /* number of pictures */
-		byte xl, yl; /* x & y lengths of pictures */
-		byte seq; /* how many in one stride */
-		uint16 size; /* the size of one picture */
-		byte fgc, bgc; /* foreground & background bubble colours */
-	};
+enum controllers {cjoy, ckey};
 
-	typedef byte raw[256][16]; /* raw_font_type */
+typedef Common::String previoustype[20];
 
-	enum controllers {cjoy, ckey};
+struct corridor_type { /* Decarations for the corridors. */
+	uint16 doors; /* Door styles are calc'ed from this uint16.
+					Assign a different number to each one! */
+};
 
-	typedef Common::String previoustype[20];
+struct demo_type {
+	uint16 delay;
+	char key, extd;
+};
 
-	struct corridor_type { /* Decarations for the corridors. */
-		uint16 doors; /* Door styles are calc'ed from this uint16.
-					   Assign a different number to each one! */
-	};
+struct quasiped_type {
+	byte whichped, fgc, room, bgc;
+	uint16 who;
+};
+/* A quasiped defines how people who aren't sprites talk. For example,
+	quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
+	that to context. */
 
-	struct demo_type {
-		uint16 delay;
-		char key, extd;
-	};
+typedef byte tunetype[31];
 
-	struct quasiped_type {
-		byte whichped, fgc, room, bgc;
-		uint16 who;
-	};
-	/* A quasiped defines how people who aren't sprites talk. For example,
-	   quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
-	   that to context. */
+struct vmctype { /* Virtual Mouse Cursor */
+	void *andpic, *xorpic;
+	void *backpic[2];
+	void* wherewas[2];
+	byte picnumber;
+	int8 ofsx, ofsy;
+};
 
-	typedef byte tunetype[31];
+struct sundry {
+	/* Things which must be saved over a backtobootstrap,
+						outside DNA. */
+	Common::String qenid_filename;
+	bool qsoundfx;
+	char qthinks;
+	bool qthinkthing;
+};
 
-	struct vmctype { /* Virtual Mouse Cursor */
-		void *andpic, *xorpic;
-		void *backpic[2];
-		void* wherewas[2];
-		byte picnumber;
-		int8 ofsx, ofsy;
-	};
+struct joysetup {
+	uint16 xmid, ymid, xmin, ymin, xmax, ymax;
+	byte centre; /* Size of centre in tenths */
+};
 
-	struct sundry {
-		/* Things which must be saved over a backtobootstrap,
-						   outside DNA. */
-		Common::String qenid_filename;
-		bool qsoundfx;
-		char qthinks;
-		bool qthinkthing;
-	};
-
-	struct joysetup {
-		uint16 xmid, ymid, xmin, ymin, xmax, ymax;
-		byte centre; /* Size of centre in tenths */
-	};
-
-	struct ednahead { /* Edna header */
-		/* This header starts at byte offset 177 in the .ASG file. */
-		char id[9];   /* signature */
-		uint16 revision; /* EDNA revision, here 2 (1=dna256) */
-		Common::String game; /* Long name, eg Lord Avalot D'Argent */
-		Common::String shortname; /* Short name, eg Avalot */
-		uint16 number; /* Game's code number, here 2 */
-		uint16 ver; /* Version number as int16 (eg 1.00 = 100) */
-		Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */
-		Common::String filename; /* Filename, eg AVALOT.EXE */
-		byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/
-		Common::String os; /* Saving OS in text format. */
-
-		/* Info on this particular game */
-
-		Common::String fn; /* Filename (not extension ('cos that's .ASG)) */
-		byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
-		uint16 y;  /* ...saved on. */
-		Common::String desc; /* Description of game (same as in Avaricius!) */
-		uint16 len; /* Length of DNA (it's not going to be above 65535!) */
-
-		/* Quick reference & miscellaneous */
-
-		uint16 saves; /* no. of times this game has been saved */
-		int16 cash; /* contents of your wallet in numerical form */
-		Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/
-		uint16 points; /* your score */
-
-		/* DNA values follow, then footer (which is ignored) */
-	};
-
-	/* Possible values of edhead.os:
-	   1 = DOS        4 = Mac
-	   2 = Windows    5 = Amiga
-	   3 = OS/2       6 = ST
-	   7 = Archimedes */
-
-
-
-	///////////////////////////// CONSTANTS ///////////////////////////// 
-
-	const char vernum[] = "1.30";
-	const char copyright[] = "1995";
-	const int16 thisvercode = 130;
+struct ednahead { /* Edna header */
+	/* This header starts at byte offset 177 in the .ASG file. */
+	char id[9];   /* signature */
+	uint16 revision; /* EDNA revision, here 2 (1=dna256) */
+	Common::String game; /* Long name, eg Lord Avalot D'Argent */
+	Common::String shortname; /* Short name, eg Avalot */
+	uint16 number; /* Game's code number, here 2 */
+	uint16 ver; /* Version number as int16 (eg 1.00 = 100) */
+	Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */
+	Common::String filename; /* Filename, eg AVALOT.EXE */
+	byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/
+	Common::String os; /* Saving OS in text format. */
+
+	/* Info on this particular game */
+
+	Common::String fn; /* Filename (not extension ('cos that's .ASG)) */
+	byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
+	uint16 y;  /* ...saved on. */
+	Common::String desc; /* Description of game (same as in Avaricius!) */
+	uint16 len; /* Length of DNA (it's not going to be above 65535!) */
+
+	/* Quick reference & miscellaneous */
+
+	uint16 saves; /* no. of times this game has been saved */
+	int16 cash; /* contents of your wallet in numerical form */
+	Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/
+	uint16 points; /* your score */
+
+	/* DNA values follow, then footer (which is ignored) */
+};
+
+/* Possible values of edhead.os:
+	1 = DOS        4 = Mac
+	2 = Windows    5 = Amiga
+	3 = OS/2       6 = ST
+	7 = Archimedes */
+
+
+
+
+
+
+class Gyro {
+
+public:
+
+	static const char *vernum;
+	static const char *copyright;
+	static const int16 thisvercode = 130;
 	/* as "vernum", but numerically & without the ".". */
-	const int16 thisgamecode = 2; /* Avalot's code number */
+	static const int16 thisgamecode = 2; /* Avalot's code number */
 
 	/* Objects you can hold: */
-	const char wine = 1;
-	const char money = 2;
-	const char bodkin = 3;
-	const char potion = 4;
-	const char chastity = 5;
-	const char bolt = 6;
-	const char crossbow = 7;
-	const char lute = 10;
-	const char badge = 11;
-	const char mushroom = 12;
-	const char key = 13;
-	const char bell = 14;
-	const char prescription = 15;
-	const char pen = 16;
-	const char ink = 17;
-	const char clothes = 20;
-	const char habit = 21;
-	const char onion = 22;
+	static const char wine = 1;
+	static const char money = 2;
+	static const char bodkin = 3;
+	static const char potion = 4;
+	static const char chastity = 5;
+	static const char bolt = 6;
+	static const char crossbow = 7;
+	static const char lute = 10;
+	static const char badge = 11;
+	static const char mushroom = 12;
+	static const char key = 13;
+	static const char bell = 14;
+	static const char prescription = 15;
+	static const char pen = 16;
+	static const char ink = 17;
+	static const char clothes = 20;
+	static const char habit = 21;
+	static const char onion = 22;
 
 	/* People who hang around this game. */
 
 	/* Boys: */
-	const uint16 pavalot = 226;
-	const uint16 pspludwick = 227;
-	const uint16 pcrapulus = 230;
-	const uint16 pdrduck = 231;
-	const uint16 pmalagauche = 232;
-	const uint16 pfriartuck = 233;
-	const uint16 probinhood = 234;
-	const uint16 pcwytalot = 235;
-	const uint16 pdulustie = 236;
-	const uint16 pduke = 237;
-	const uint16 pdogfood = 240;
-	const uint16 ptrader = 241;
-	const uint16 pibythneth = 242;
-	const uint16 payles = 243;
-	const uint16 pport = 244;
-	const uint16 pspurge = 245;
-	const uint16 pjacques = 246;
+	static const uint16 pavalot = 226;
+	static const uint16 pspludwick = 227;
+	static const uint16 pcrapulus = 230;
+	static const uint16 pdrduck = 231;
+	static const uint16 pmalagauche = 232;
+	static const uint16 pfriartuck = 233;
+	static const uint16 probinhood = 234;
+	static const uint16 pcwytalot = 235;
+	static const uint16 pdulustie = 236;
+	static const uint16 pduke = 237;
+	static const uint16 pdogfood = 240;
+	static const uint16 ptrader = 241;
+	static const uint16 pibythneth = 242;
+	static const uint16 payles = 243;
+	static const uint16 pport = 244;
+	static const uint16 pspurge = 245;
+	static const uint16 pjacques = 246;
 
 	/* Girls: */
-	const uint16 parkata = 257;
-	const uint16 pgeida = 260;
-	const uint16 pwisewoman = 262;
-
-	const int16 xw = 30;
-	const int16 yw = 36; /* x width & y whatsit */
-
-	const int16 margin = 5;
-
-	const mp mps[9] = {
-		   {
-				/* 1 - up-arrow */
-				{	{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575},
-					{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}
-				},	
-				8,
-				0
-			},
-
-			{
-				/* 2 - screwdriver */
-				{	{8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523},
-					{0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0}
-					
-				},
-				0,
-				0
-			},
-
-			{
-				/* 3 - right-arrow */
-				{	{65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535},
-					{0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0}	
-				},
-				15,
-				6
-			},
-
-			{
-				/* 4 - fletch */
-				{	{255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511},
-					{0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0}
-				},
-				0,
-				0
-			},
-
-			{
-				/* 5 - hourglass */
-				{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
-					{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
-				},
-				8,
-				7
-			},
-
-			{
-				/* 6 - TTHand */
-				{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
-					{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
-				},
-				4,
-				0
-			},
-
-			{
-				/* 7- Mark's crosshairs */
-				{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
-					{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
-				},
-				8,
-				5
-			},
-
-			{
-				/* 8- I-beam. */
-				{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
-					{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
-				},
-				8,
-				7
-			},
-
-			{
-				/* 9- Question mark. */
-				{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
-					{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
-				},
-				0,
-				0
-			}
-		
-	};
-
-	const Common::String lads[17] = {
-			"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
-			"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
-			"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
-	};
-
-	const Common::String lasses[4] =
-	{"Arkata", "Geida", "±", "the Wise Woman"};
-
-	const char ladchar[] = "ASCDMTRwLfgeIyPu";
-
-	const char lasschar[] = "kG±o";
-
-	const int16 numtr = 2; /* current max no. of sprites */
-
-	const bool a_thing = true;
-	const bool a_person = false; /* for Thinkabout */
+	static const uint16 parkata = 257;
+	static const uint16 pgeida = 260;
+	static const uint16 pwisewoman = 262;
+
+	static const int16 xw = 30;
+	static const int16 yw = 36; /* x width & y whatsit */
+
+	static const int16 margin = 5;
+
+	static const mp mps[9];
+
+	static const Common::String lads[17];
+
+	static const Common::String lasses[4];
+
+	static const char ladchar[];
+
+	static const char lasschar[];
+
+	static const int16 numtr = 2; /* current max no. of sprites */
+
+	static const bool a_thing = true;
+	static const bool a_person = false; /* for Thinkabout */
 
 	/* Magic/portal commands are */
 
-	/*N*/ const int16 nix = 0; /* ignore it if this line is touched */
-	/*B*/ const int16 bounces = 1; /* bounce off this line. Not valid for portals. */
-	/*E*/ const int16 exclaim = 2; /* put up a chain of scrolls */
-	/*T*/ const int16 transport = 3; /* enter new room */
-	/*U*/ const int16 unfinished = 4; /* unfinished connection */
-	/*S*/ const int16 special = 5; /* special function. */
-	/*O*/ const int16 mopendoor = 6; /* opening door. */
+	/*N*/ static const int16 nix = 0; /* ignore it if this line is touched */
+	/*B*/ static const int16 bounces = 1; /* bounce off this line. Not valid for portals. */
+	/*E*/ static const int16 exclaim = 2; /* put up a chain of scrolls */
+	/*T*/ static const int16 transport = 3; /* enter new room */
+	/*U*/ static const int16 unfinished = 4; /* unfinished connection */
+	/*S*/ static const int16 special = 5; /* special function. */
+	/*O*/ static const int16 mopendoor = 6; /* opening door. */
 
-	/* These following constants should be included in CFG when it's written. */
+	/* These following static constants should be included in CFG when it's written. */
 
-	const bool slow_computer = false; /* stops walking when mouse touches toolbar */
+	static const bool slow_computer = false; /* stops walking when mouse touches toolbar */
 
 	/* --- */
 
-	const int16 border = 1; /* size of border on shadowboxes */
+	static const int16 border = 1; /* size of border on shadowboxes */
 
-	const int32 pagetop = 81920;
+	static const int32 pagetop = 81920;
 
-	const int16 up = 0;
-	const int16 right = 1;
-	const int16 down = 2;
-	const int16 left = 3;
-	const int16 ur = 4;
-	const int16 dr = 5;
-	const int16 dl = 6;
-	const int16 ul = 7;
-	const int16 stopped = 8;
+	static const int16 up = 0;
+	static const int16 right = 1;
+	static const int16 down = 2;
+	static const int16 left = 3;
+	static const int16 ur = 4;
+	static const int16 dr = 5;
+	static const int16 dl = 6;
+	static const int16 ul = 7;
+	static const int16 stopped = 8;
 
-	const int16 walk = 3;
-	const int16 run = 5;
+	static const int16 walk = 3;
+	static const int16 run = 5;
 
 	/* Art gallery at 2,1; notice about this at 2,2. */
 
-	const int32 catamap[8][8] = {
-		/* Geida's room */
-			/*  1     2			3   | 4     5		6		7     8*/
-			{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
-			{0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
-			{0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
-			{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */
-			{0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
-			{0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
-			{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */
-			{0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
-	};
-	/* vv Stairs trap. */
+	static const int32 catamap[8][8];
 
 	/* Explanation: $NSEW.
-	   Nibble N: North.
+		Nibble N: North.
 		0     = no connection,
 		2     = (left,) middle(, right) door with left-hand handle,
 		5     = (left,) middle(, right) door with right-hand handle,
@@ -519,11 +421,11 @@ namespace Avalanche {
 		E     = no connection + TORCH,
 		F     = recessed door (to Geida's room.)
 
-	   Nibble S: South.
+		Nibble S: South.
 		0     = no connection,
 		1,2,3 = left, middle, right door.
 
-	   Nibble E: East.
+		Nibble E: East.
 		0     = no connection (wall),
 		1     = no connection (wall + window),
 		2     = wall with door,
@@ -532,7 +434,7 @@ namespace Avalanche {
 		7     = wall with door and candles,
 		F     = straight-through corridor.
 
-	   Nibble W: West.
+		Nibble W: West.
 		0     = no connection (wall),
 		1     = no connection (wall + shield),
 		2     = wall with door,
@@ -543,86 +445,42 @@ namespace Avalanche {
 		7     = wall with door and candles,
 		F     = straight-through corridor. */
 
-	const bool demo = false; /* If this is true, we're in a demo of the game. */
+	static const bool demo = false; /* If this is true, we're in a demo of the game. */
 
-	const char spludwick_order[3] = {onion, ink, mushroom};
+	static const char spludwick_order[3];
 	 
-	const quasiped_type quasipeds[16] = {
-		{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
-		{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
-		{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
-		{3, black,     23, red, 177},                         /* D: Hawk (screen 23). */
-		{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
-		{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
-		{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
-		{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
-		{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
-		{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
-		{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
-		{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
-		{3, white,     27, red, 177},                         /* M: Avaroid (screen 27). */
-		{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
-		{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
-		{2, lightgreen, 51, darkgray, pdrduck}
-	};                         /*P: Duck (screen 51). */
-
-	const int16 lower = 0;
-	const int16 same = 1;
-	const int16 higher = 2;
-
-	const char keys[] = "QWERTYUIOP[]";
-	const uint16 notes[12] =
-	{196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
-
-	const tunetype tune = {
-			higher, higher, lower, same, higher, higher, lower, higher, higher, higher,
-			lower, higher, higher,
-			same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower,
-			lower, same, lower, higher, same, lower, higher
-	};
+	static const quasiped_type quasipeds[16];
+
+	static const int16 lower = 0;
+	static const int16 same = 1;
+	static const int16 higher = 2;
+
+	static const char keys[];
+	static const uint16 notes[12];
+
+	static const tunetype tune;
 
 	/* special run-time errors */
 
-	const int16 runerr_getset_overflow = 50;
+	static const int16 runerr_getset_overflow = 50;
+
+	static const byte static_const_whereis[29];
+
 
 
-	///////////////////////////// VARIABLES ///////////////////////////// 
 
-	byte interrogation = 0;
+
+
+	byte interrogation;
 	/* If this is greater than zero, the next line you type is stored in
-	   the DNA in a position dictated by the value. If a scroll comes up,
-	   or you leave the room, it's automatically set to zero. */
-
-	byte whereis[29] = {
-		/* The Lads */
-		r__yours, /* Avvy */
-		r__spludwicks, /* Spludwick */
-		r__outsideyours, /* Crapulus */
-		r__ducks, /* Duck - r__DucksRoom's not defined yet. */
-		r__argentpub, /* Malagauche */
-		r__robins, /* Friar Tuck. */
-		177, /* Robin Hood - can't meet him at the start. */
-		r__brummieroad, /* Cwytalot */
-		r__lustiesroom, /* Baron du Lustie. */
-		r__outsidecardiffcastle, /* The Duke of Cardiff. */
-		r__argentpub, /* Dogfood */
-		r__outsideducks, /* Trader */
-		r__argentpub, /* Ibythneth */
-		r__aylesoffice, /* Ayles */
-		r__nottspub, /* Port */
-		r__nottspub, /* Spurge */
-		r__musicroom, /* Jacques */
-		0, 0, 0, 0, 0, 0, 0, 0,
-		/* The Lasses */
-		r__yours, /* Arkata */
-		r__geidas, /* Geida */
-		177, /* nobody allocated here! */
-		r__wisewomans
-	}; /* The Wise Woman. */
-
-	bool oncandopageswap = true; 
-	/* Variable constant for overriding the ability of On to switch pages.
-	 * You may know better than On which page to switch to. */
+		the DNA in a position dictated by the value. If a scroll comes up,
+		or you leave the room, it's automatically set to zero. */
+
+	byte whereis[29];
+
+	bool oncandopageswap; 
+	/* Variable static constant for overriding the ability of On to switch pages.
+		* You may know better than On which page to switch to. */
 
 
 
@@ -757,8 +615,9 @@ namespace Avalanche {
 	bool use_joy_a;
 
 
+	Gyro();
 
-	///////////////////////////// FUNCTIONS ///////////////////////////// 
+	void Gyro::setParent(AvalancheEngine *vm);
 
 	void newpointer(byte m);
 
@@ -830,9 +689,24 @@ namespace Avalanche {
 
 	bool mouse_near_text();
 
+private:
+	AvalancheEngine *_vm;
+	
+	static const Common::String things[numobjs];
+
+	static const char thingchar[];
+
+	static const Common::String better[numobjs];
+
+	static const char betterchar[];
+
+	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
+
+	void setminmaxhorzcurspos(uint16 min, uint16 max);
 
+	void setminmaxvertcurspos(uint16 min, uint16 max);
 
-	} // End of namespace Gyro
+};
 
 } // End of namespace Avalanche
 


Commit: c2d3c5fcf80ea88693e7090ab7b5644bd3690a83
    https://github.com/scummvm/scummvm/commit/c2d3c5fcf80ea88693e7090ab7b5644bd3690a83
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T03:12:27-07:00

Commit Message:
AVALANCHE: Enhanced: Replace namespace with class.

Changed paths:
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h



diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
index 7a9a58f..2ee3f3d 100644
--- a/engines/avalanche/enhanced2.cpp
+++ b/engines/avalanche/enhanced2.cpp
@@ -31,31 +31,27 @@
 
 namespace Avalanche {
 
-	namespace Enhanced {
-
-	bool isenh() {
-		warning("STUB: Enhanced::isenh()");
-		return true;
-	}
-
-	void readkeye() {
-		warning("STUB: Enhanced::readkeye()");
-	}
-
-	bool keypressede() {
-	/*
-	 function fancystuff:boolean;
-	  inline( $B4/ $11/  { MOV AH,11 }
-			  $CD/ $16/  { INT 16 }
-			  $B8/ $00/ $00/ { MOV AX, 0000 }
-			  $74/ $01/  { JZ 0112 (or wherever- the next byte after $40, anyway) }
-			  $40);      { INC AX }
-	*/
-	
-		warning("STUB: Enhanced::keypressede()");
-		return true;
-	}
+bool Enhanced::isenh() {
+	warning("STUB: Enhanced::isenh()");
+	return true;
+}
+
+void Enhanced::readkeye() {
+	warning("STUB: Enhanced::readkeye()");
+}
 
-	} // End of namespace Enhanced
+bool Enhanced::keypressede() {
+/*
+	function fancystuff:boolean;
+	inline( $B4/ $11/  { MOV AH,11 }
+			$CD/ $16/  { INT 16 }
+			$B8/ $00/ $00/ { MOV AX, 0000 }
+			$74/ $01/  { JZ 0112 (or wherever- the next byte after $40, anyway) }
+			$40);      { INC AX }
+*/
+	
+	warning("STUB: Enhanced::keypressede()");
+	return true;
+}
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index 98ef781..2ba42e0 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -36,8 +36,8 @@
 
 namespace Avalanche {
 
-	namespace Enhanced {
-
+class Enhanced {
+public:
 	byte shiftstate;	/*ABSOLUTE $40:$17;*/
 	bool atbios; // BIOS type
 	char inchar, extd;
@@ -45,8 +45,10 @@ namespace Avalanche {
 	void readkeye();
 
 	bool keypressede();
+private:
+	bool isenh();
 
-	} // End of namespace Enhanced
+};
 
 } // End of namespace Avalanche
 


Commit: 83982503871a042aa113102449f7a6cc8d77aa6c
    https://github.com/scummvm/scummvm/commit/83982503871a042aa113102449f7a6cc8d77aa6c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T03:26:01-07:00

Commit Message:
AVALANCHE: Repair Enhanced and Gyro.

Changed paths:
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
index 2ee3f3d..99ddfb4 100644
--- a/engines/avalanche/enhanced2.cpp
+++ b/engines/avalanche/enhanced2.cpp
@@ -31,6 +31,11 @@
 
 namespace Avalanche {
 
+void Enhanced::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+
 bool Enhanced::isenh() {
 	warning("STUB: Enhanced::isenh()");
 	return true;
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index 2ba42e0..8dd88a6 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -35,13 +35,18 @@
 #include "common/system.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
 class Enhanced {
 public:
+	AvalancheEngine *_vm;
+
 	byte shiftstate;	/*ABSOLUTE $40:$17;*/
 	bool atbios; // BIOS type
 	char inchar, extd;
 
+	void setParent(AvalancheEngine *vm);
+
 	void readkeye();
 
 	bool keypressede();
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index ecea597..c2f6fd7 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -33,11 +33,13 @@
 #include "common/system.h"
 #include "common/str.h"
 #include "common/scummsys.h"
-#include "avalanche/avalanche.h"
+
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"
 
 namespace Avalanche {
+class AvalancheEngine;
+
 
 static const char numobjs = 18; /* always preface with a # */
 static const int16 maxobjs = 12;  /* carry limit */
@@ -617,7 +619,7 @@ public:
 
 	Gyro();
 
-	void Gyro::setParent(AvalancheEngine *vm);
+	void setParent(AvalancheEngine *vm);
 
 	void newpointer(byte m);
 


Commit: dd40c1896b72e5ed337afbb143184028cc287dda
    https://github.com/scummvm/scummvm/commit/dd40c1896b72e5ed337afbb143184028cc287dda
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T03:27:14-07:00

Commit Message:
AVALANCHE: Instantiate finished classes in the engine.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b9b1b0f..a230cf0 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -46,6 +46,9 @@ namespace Avalanche {
 		_system = syst;
 		_console = new AvalancheConsole(this);
 		_rnd = 0;
+
+		_gyro.setParent(this);
+		_enhanced.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index fa87d8b..190849e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -29,6 +29,8 @@
 #define AVALANCHE_H
 
 #include "avalanche/console.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/enhanced2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -45,6 +47,10 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
+	Gyro _gyro;
+	Enhanced _enhanced;
+
+
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 


Commit: b7ef84983e2b645ee04aed3079c577295d339631
    https://github.com/scummvm/scummvm/commit/b7ef84983e2b645ee04aed3079c577295d339631
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:22:04-07:00

Commit Message:
AVALANCHE: Pingo: replace namespace with class.

Changed paths:
    engines/avalanche/pingo2.cpp
    engines/avalanche/pingo2.h



diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 1311c65..fa2e96f 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -27,88 +27,86 @@
 
 /* PINGO	Full-screen sub-parts of the game. */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/pingo2.h"
 
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
-#include "avalanche/scrolls2.h"
+//#include "avalanche/scrolls2.h"
 
-#include "common/textconsole.h"
 
-namespace Avalanche {
 
-	namespace Pingo {
+#include "common/textconsole.h"
 
-	void dplot(int16 x, int16 y, Common::String z) {
-		warning("STUB: Pingo::dplot()");
-	}
+namespace Avalanche {
 
-	void bosskey() {
-	/*const
-	 months : array[0..11] of char = 'JFMAMJJASOND';
-	 title = 'Net Profits';
-	 fish = #224; { à }
-	var fv:byte; gd,gm:int16; r:char;
+void Pingo::dplot(int16 x, int16 y, Common::String z) {
+	warning("STUB: Pingo::dplot()");
+}
+
+void Pingo::bosskey() {
+/*const
+	months : array[0..11] of char = 'JFMAMJJASOND';
+	title = 'Net Profits';
+	fish = #224; { à }
+var fv:byte; gd,gm:int16; r:char;
+begin;
+	dusk; delavvy;
+	setactivepage(3); mousepage(3); setvisualpage(3); off;
+	cleardevice; setfillstyle(xhatchfill,11);
+	settextstyle(1,0,4); settextjustify(1,1);
+	dplot(320,10,title);
+	settextstyle(1,0,0); setusercharsize(4,3,7,12);
+	for fv:=0 to 11 do
+	begin;
+	dplot(26+fv*52,187,months[fv]);
+	bar(fv*52,177-fv*14,51+fv*52,180);
+	rectangle(fv*52,177-fv*14,51+fv*52,180);
+	end;
+	settextstyle(0,0,1);
+	for fv:=1 to 177 do
 	begin;
-	 dusk; delavvy;
-	 setactivepage(3); mousepage(3); setvisualpage(3); off;
-	 cleardevice; setfillstyle(xhatchfill,11);
-	 settextstyle(1,0,4); settextjustify(1,1);
-	 dplot(320,10,title);
-	 settextstyle(1,0,0); setusercharsize(4,3,7,12);
-	 for fv:=0 to 11 do
-	 begin;
-	  dplot(26+fv*52,187,months[fv]);
-	  bar(fv*52,177-fv*14,51+fv*52,180);
-	  rectangle(fv*52,177-fv*14,51+fv*52,180);
-	 end;
-	 settextstyle(0,0,1);
-	 for fv:=1 to 177 do
-	 begin;
-	  gd:=random(630); gm:=random(160)+30;
-	  setcolor(lightred); outtextxy(gd  ,gm  ,fish);
-	  setcolor(yellow);   outtextxy(gd+1,gm-1,fish);
-	 end;
-	 newpointer(6); { TTHand }
-	 dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
-	 while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
-	 dusk; setvisualpage(0); setactivepage(0); mousepage(0); dawn;
-	 copy02;*/
-
-		warning("STUB: Pingo::bosskey()");
-	}
-
-	void copy02() {   /* taken from Wobble (below) */
-		warning("STUB: Pingo::copy02()");
-	}
-
-	void copy03() {   /* taken from Wobble (below) */
-		warning("STUB: Pingo::copy03()");
-	}
-
-	void copypage(byte frp, byte top) { /* taken from Copy02 (above) */
-		warning("STUB: Pingo::copypage()");
-	}
-
-	void wobble() {
-		warning("STUB: Pingo::wobble()");
-	}
-
-	void zonk();
-
-	static void zl(int16 x1, int16 y1, int16 x2, int16 y2) {
-		warning("STUB: Pingo::zl()");
-	}
-
-	void zonk() {
-		warning("STUB: Pingo::zonk()");
-	}
-
-	void winning_pic() {
-		warning("STUB: Pingo::winning_pic()");
-	}
-
-	} // End of namespace Pingo.
+	gd:=random(630); gm:=random(160)+30;
+	setcolor(lightred); outtextxy(gd  ,gm  ,fish);
+	setcolor(yellow);   outtextxy(gd+1,gm-1,fish);
+	end;
+	newpointer(6); { TTHand }
+	dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
+	while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
+	dusk; setvisualpage(0); setactivepage(0); mousepage(0); dawn;
+	copy02;*/
+
+	warning("STUB: Pingo::bosskey()");
+}
+
+void Pingo::copy02() {   /* taken from Wobble (below) */
+	warning("STUB: Pingo::copy02()");
+}
+
+void Pingo::copy03() {   /* taken from Wobble (below) */
+	warning("STUB: Pingo::copy03()");
+}
+
+void Pingo::copypage(byte frp, byte top) { /* taken from Copy02 (above) */
+	warning("STUB: Pingo::copypage()");
+}
+
+void Pingo::wobble() {
+	warning("STUB: Pingo::wobble()");
+}
+
+void Pingo::zl(int16 x1, int16 y1, int16 x2, int16 y2) {
+	warning("STUB: Pingo::zl()");
+}
+
+void Pingo::zonk() {
+	warning("STUB: Pingo::zonk()");
+}
+
+void Pingo::winning_pic() {
+	warning("STUB: Pingo::winning_pic()");
+}
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index 10b9511..135bb10 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -31,11 +31,17 @@
 #define PINGO2_H
 
 #include "common/scummsys.h"
+#include "common/str.h"
+
+
 
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Pingo {
+class Pingo {
+public:
+	void setParent(AvalancheEngine *vm);
 
 	void bosskey();
 
@@ -51,7 +57,13 @@ namespace Avalanche {
 
 	void winning_pic();
 
-	} // End of namespace Pingo.
+private:
+	AvalancheEngine *_vm;
+
+	void dplot(int16 x, int16 y, Common::String z);
+
+	void zl(int16 x1, int16 y1, int16 x2, int16 y2);
+};
 
 } // End of namespace Avalanche.
 


Commit: e4c8d82f9d13709f81fa865d62a2386c82760bbc
    https://github.com/scummvm/scummvm/commit/e4c8d82f9d13709f81fa865d62a2386c82760bbc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:41:02-07:00

Commit Message:
AVALANCHE: Scrolls: replace namespace with class.

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 57c15a2..a577483 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/logger2.h"
@@ -41,211 +43,203 @@
 
 namespace Avalanche {
 
-	namespace Scrolls {
+const int16 Scrolls::roman = 0;
+const int16 Scrolls::italic = 1;
 
-	const int16 roman = 0;
-	const int16 italic = 1;
+const int16 Scrolls::halficonwidth = 19; /* Half the width of an icon. */
 
-	const int16 halficonwidth = 19; /* Half the width of an icon. */
 
-	int16 dix, diy;
-	Gyro::raw ch[2];
-	byte cfont; /* Current font */
 
-	int16 dodgex, dodgey;
-	byte param; /* For using arguments code */
+Scrolls::Scrolls() : aboutscroll(false)  {
+}
 
-	byte use_icon;
+void Scrolls::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
 
 
-	void initialize_scrolls() {
-		warning("STUB: Scrolls::initialize_scrolls()");
-	}
+void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
+	byte page_;
 
-	void state(byte x) {     /* Sets "Ready" light to whatever */
-		byte page_;
-
-		if (Gyro::ledstatus == x)  return; /* Already like that! */
-
-		warning("STUB: Scrolls::state(). Calls of Pascal units need to be removed.");
-		//switch (x) {
-		//case 0:
-		//	setfillstyle(1, black);
-		//	break; /* Off */
-		//case 1:
-		//	setfillstyle(9, green);
-		//	break; /* Half-on (menus) */
-		//case 2:
-		//	setfillstyle(1, green);
-		//	break; /* On (kbd) */
-		//case 3:
-		//	setfillstyle(6, green);
-		//	break; /* Hit a key */
-		//}
-
-		Gyro::super_off();
-
-		/*	for (page_ = 0; page_ <= 1; page_ ++) {
-		setactivepage(page_);
-		bar(419, 195, 438, 197);
-		}*/
-
-		Gyro::super_on();
-		Gyro::ledstatus = x;
-	}
+	if (_vm->_gyro.ledstatus == x)  return; /* Already like that! */
 
-	void easteregg() {
-		uint16 fv, ff;
+	warning("STUB: Scrolls::state(). Calls of Pascal units need to be removed.");
+	//switch (x) {
+	//case 0:
+	//	setfillstyle(1, black);
+	//	break; /* Off */
+	//case 1:
+	//	setfillstyle(9, green);
+	//	break; /* Half-on (menus) */
+	//case 2:
+	//	setfillstyle(1, green);
+	//	break; /* On (kbd) */
+	//case 3:
+	//	setfillstyle(6, green);
+	//	break; /* Hit a key */
+	//}
 
-		warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
+	_vm->_gyro.super_off();
 
-		/*	background(15);
-		for (fv = 4; fv <= 100; fv ++)
-		for (ff = 0; ff <= 70; ff ++) {
-		sound(fv * 100 + ff * 10);
-		delay(1);
-		}
-		nosound;
-		setcolor(10);
-		settextstyle(0, 0, 3);
-		settextjustify(1, 1);
-		outtextxy(320, 100, "GIED");
-		settextstyle(0, 0, 1);
-		settextjustify(0, 2);*/
-
-		Gyro::background(0);
-	}
+	/*	for (page_ = 0; page_ <= 1; page_ ++) {
+	setactivepage(page_);
+	bar(419, 195, 438, 197);
+	}*/
 
-	void say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-		const int16 locol = 2;
-		byte xx, yy, ox, bit, lz, t;
-		int16 yp;
-		bool offset;
-		byte itw[12][80];
-
-		offset = x % 8 == 4;
-		x = x / 8;
-		lz = z.size();
-		ox = 0;
-		Logger::log_scrollline();
-
-		for (xx = 1; xx <= lz; xx ++) {
-			switch (z[xx]) {
-			case '\22': {
-				cfont = roman;
-				Logger::log_roman();
-						}
-						break;
-			case '\6': {
-				cfont = italic;
-				Logger::log_italic();
-					   }
-					   break;
-			default: {
-				ox += 1;
-				for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
-				Logger::log_scrollchar(Common::String(z[xx]));
-					 }
-			}
+	_vm->_gyro.super_on();
+	_vm->_gyro.ledstatus = x;
+}
+
+void Scrolls::easteregg() {
+	uint16 fv, ff;
+
+	warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
+
+	/*	background(15);
+	for (fv = 4; fv <= 100; fv ++)
+	for (ff = 0; ff <= 70; ff ++) {
+	sound(fv * 100 + ff * 10);
+	delay(1);
+	}
+	nosound;
+	setcolor(10);
+	settextstyle(0, 0, 3);
+	settextjustify(1, 1);
+	outtextxy(320, 100, "GIED");
+	settextstyle(0, 0, 1);
+	settextjustify(0, 2);*/
+
+	_vm->_gyro.background(0);
+}
+
+void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
+	const int16 locol = 2;
+	byte xx, yy, ox, bit, lz, t;
+	int16 yp;
+	bool offset;
+	byte itw[12][80];
+
+	offset = x % 8 == 4;
+	x = x / 8;
+	lz = z.size();
+	ox = 0;
+	_vm->_logger.log_scrollline();
+
+	for (xx = 1; xx <= lz; xx ++) {
+		switch (z[xx]) {
+		case '\22': {
+			cfont = roman;
+			_vm->_logger.log_roman();
+					}
+					break;
+		case '\6': {
+			cfont = italic;
+			_vm->_logger.log_italic();
+					}
+					break;
+		default: {
+			ox += 1;
+			for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
+			_vm->_logger.log_scrollchar(Common::String(z[xx]));
+					}
 		}
+	}
 
-		lz = ox;
-		if (offset) {
-			/* offsetting routine */
-			lz += 1;
-			for (yy = 1; yy <= 12; yy ++) {
-				bit = 240;
-				itw[yy][lz] = 255;
-				for (xx = 1; xx <= lz; xx ++) {
-					t = itw[yy][xx];
-					itw[yy][xx] = bit + t / 16;
-					bit = t << 4;
-				}
+	lz = ox;
+	if (offset) {
+		/* offsetting routine */
+		lz += 1;
+		for (yy = 1; yy <= 12; yy ++) {
+			bit = 240;
+			itw[yy][lz] = 255;
+			for (xx = 1; xx <= lz; xx ++) {
+				t = itw[yy][xx];
+				itw[yy][xx] = bit + t / 16;
+				bit = t << 4;
 			}
 		}
-		yp = x + y * 80 + (1 - Gyro::cp) * Gyro::pagetop;
-		for (yy = 1; yy <= 12; yy ++) {
-			yp += 80;
-			for (bit = 0; bit <= locol; bit ++) {
-				/*port[0x3c4] = 2;
-				port[0x3ce] = 4;
-				port[0x3c5] = 1 << bit;
-				port[0x3cf] = bit;
-				move(itw[yy], mem[0xa000 * yp], lz);
+	}
+	yp = x + y * 80 + (1 - _vm->_gyro.cp) * _vm->_gyro.pagetop;
+	for (yy = 1; yy <= 12; yy ++) {
+		yp += 80;
+		for (bit = 0; bit <= locol; bit ++) {
+			/*port[0x3c4] = 2;
+			port[0x3ce] = 4;
+			port[0x3c5] = 1 << bit;
+			port[0x3cf] = bit;
+			move(itw[yy], mem[0xa000 * yp], lz);
 				
-				Some old Pascal-ish. To be removed. */
+			Some old Pascal-ish. To be removed. */
 
-				warning("STUB: Scrolls::say()");
-			}
+			warning("STUB: Scrolls::say()");
 		}
-
 	}
 
-	/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
+}
 
-	void normscroll() {
-		warning("STUB: Scrolls::normscroll()");
-	}
+/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
 
-	void dialogue() {
-		warning("STUB: Scrolls::dialogue()");
-	}
+void Scrolls::normscroll() {
+	warning("STUB: Scrolls::normscroll()");
+}
 
-	void music_scroll();
+void Scrolls::dialogue() {
+	warning("STUB: Scrolls::dialogue()");
+}
 
 
-	static void store_(byte what, Gyro::tunetype &played) {
-		memcpy(played, played+1, sizeof(played) - 1);
-		played[30] = what;
-	}
 
 
+void Scrolls::store_(byte what, tunetype &played) {
+	memcpy(played, played+1, sizeof(played) - 1);
+	played[30] = what;
+}
 
-	static bool they_match(Gyro::tunetype &played) {
-		byte fv, mistakes;
 
-		bool they_match_result;
-		mistakes = 0;
 
-		for (fv = 1; fv <= sizeof(played); fv ++)
-			if (played[fv] != Gyro::tune[fv]) {
-				mistakes++;
-			}
+bool Scrolls::they_match(tunetype &played) {
+	byte fv, mistakes;
 
-			they_match_result = mistakes < 5;
-			return they_match_result;
-	}
+	bool they_match_result;
+	mistakes = 0;
 
-	void music_scroll() {
-		char r;
-		byte value;
-
-		byte last_one, this_one;
-
-		Gyro::tunetype played;
-
-
-		state(3);
-		Gyro::seescroll = true;
-		Gyro::on();
-		Gyro::newpointer(4);
-		//do {
-			//do {
-			//	Gyro::check(); /* was "checkclick;" */
-			//	if (Enhanced::keypressede())  break;
-			//} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
-			//
-			// Needs joystick - not sure it will be implemented.
-			
-			//if (Gyro::mpress == 0) {
-			//	inkey(); Needs Lucerna to proceed.
-			//	
-			//}
-		//}
-	
-	}
+	for (fv = 1; fv <= sizeof(played); fv ++)
+		if (played[fv] != Gyro::tune[fv]) {
+			mistakes++;
+		}
+
+		they_match_result = mistakes < 5;
+		return they_match_result;
+}
+
+void Scrolls::music_scroll() {
+	char r;
+	byte value;
+
+	byte last_one, this_one;
+
+	tunetype played;
+
+
+	state(3);
+	_vm->_gyro.seescroll = true;
+	_vm->_gyro.on();
+	_vm->_gyro.newpointer(4);
+	//do {
+	//do {
+	//	Gyro::check(); /* was "checkclick;" */
+	//	if (Enhanced::keypressede())  break;
+	//} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
+	//
+	// Needs joystick - not sure it will be implemented.
 
+	//if (Gyro::mpress == 0) {
+	//	inkey(); Needs Lucerna to proceed.
+	//	
+	//}
+	//}
 
+}
 
 
 
@@ -255,8 +249,6 @@ namespace Avalanche {
 
 
 
-	
 
-	} // End of namespace Scrolls
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 0703833..914e463 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -34,20 +34,23 @@
 // #include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Scrolls {
+class Scrolls {
+public:
+	bool aboutscroll; /* Is this the about box? */
 
-	// Call it where Scrolls are first used.
-	// Procuded to replace the initizalization part of the original Pascal unit.
-	void initialize_scrolls();
 
-	const bool aboutscroll = false; /* Is this the about box? */
+
+	Scrolls();
+
+	void setParent(AvalancheEngine *vm);
 
 	void state(byte x);      /* Sets "Ready" light to whatever */
 
-	void drawscroll(Gyro::proc gotoit);      /* This is one of the oldest procs in the game. */
+	void drawscroll(proc gotoit);      /* This is one of the oldest procs in the game. */
 
-	void bubble(Gyro::proc gotoit);
+	void bubble(proc gotoit);
 
 	void resetscroll();
 
@@ -65,7 +68,39 @@ namespace Avalanche {
 
 	void musical_scroll();
 
-	} // End of namespace Scrolls
+private:
+	AvalancheEngine *_vm;
+
+	static const int16 roman;
+	static const int16 italic;
+
+	static const int16 halficonwidth; /* Half the width of an icon. */
+
+	int16 dix, diy;
+	raw ch[2];
+	byte cfont; /* Current font */
+
+	int16 dodgex, dodgey;
+	byte param; /* For using arguments code */
+
+	byte use_icon;
+
+	void easteregg();
+
+	void say(int16 x, int16 y, Common::String z);
+
+	void normscroll();
+
+	void dialogue();
+
+	void store_(byte what, tunetype &played);
+
+	bool they_match(tunetype &played);
+
+	void music_scroll();
+
+
+};
 
 } // End of namespace Avalanche
 


Commit: 140e20522711d414bf09898fe533c704c41c4442
    https://github.com/scummvm/scummvm/commit/140e20522711d414bf09898fe533c704c41c4442
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:42:30-07:00

Commit Message:
AVALANCHE: Update the main class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a230cf0..6179ae4 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -49,6 +49,9 @@ namespace Avalanche {
 
 		_gyro.setParent(this);
 		_enhanced.setParent(this);
+		_logger.setParent(this);
+		_pingo.setParent(this);
+		_scrolls.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 190849e..59dd009 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -31,6 +31,9 @@
 #include "avalanche/console.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/enhanced2.h"
+#include "avalanche/logger2.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/scrolls2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -49,6 +52,9 @@ class AvalancheEngine : public Engine {
 public:
 	Gyro _gyro;
 	Enhanced _enhanced;
+	Logger _logger;
+	Pingo _pingo;
+	Scrolls _scrolls;
 
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);


Commit: 612582f016f84efb9835d4ff31e0d2d51ba581ca
    https://github.com/scummvm/scummvm/commit/612582f016f84efb9835d4ff31e0d2d51ba581ca
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:43:31-07:00

Commit Message:
AVALANCHE: Repair Pingo.

Changed paths:
    engines/avalanche/pingo2.cpp



diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index fa2e96f..b2f8e83 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -36,12 +36,14 @@
 #include "avalanche/trip6.h"
 //#include "avalanche/scrolls2.h"
 
-
-
 #include "common/textconsole.h"
 
 namespace Avalanche {
 
+void Pingo::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
 void Pingo::dplot(int16 x, int16 y, Common::String z) {
 	warning("STUB: Pingo::dplot()");
 }


Commit: 44a9dd20832b50ba8a9a3e2f2099977a5c8de325
    https://github.com/scummvm/scummvm/commit/44a9dd20832b50ba8a9a3e2f2099977a5c8de325
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:53:15-07:00

Commit Message:
AVALANCHE: Visa: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6179ae4..f72c12c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -52,6 +52,7 @@ namespace Avalanche {
 		_logger.setParent(this);
 		_pingo.setParent(this);
 		_scrolls.setParent(this);
+		_visa.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 59dd009..14d2f4e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -34,6 +34,7 @@
 #include "avalanche/logger2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
+#include "avalanche/visa2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -55,6 +56,7 @@ public:
 	Logger _logger;
 	Pingo _pingo;
 	Scrolls _scrolls;
+	Visa _visa;
 
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index ee1f761..a14367a 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -25,6 +25,10 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* VISA		The new Sez handler. (Replaces Access.) */
+
+#include "avalanche/avalanche.h"
+
 #include "avalanche/visa2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
@@ -37,40 +41,38 @@
 
 namespace Avalanche {
 
-	namespace Visa {
-
-	const bool bubbling = false;
-	const bool report_dixi_errors = true;
+	void Visa::setParent(AvalancheEngine *vm) {
+		_vm = vm;
+	}
 
-	bool went_ok;
+	const bool Visa::bubbling = false;
+	const bool Visa::report_dixi_errors = true;
 
-	void unskrimble() {
-		for (uint16  fv = 0; fv < Gyro::bufsize; fv++) 
-			Gyro::buffer[fv] = (char)((!(Gyro::buffer[fv]) - fv) % 256);
+	void Visa::unskrimble() {
+		for (uint16  fv = 0; fv < _vm->_gyro.bufsize; fv++) 
+			_vm->_gyro.buffer[fv] = (char)((!(_vm->_gyro.buffer[fv]) - fv) % 256);
 	}
 
-	void do_the_bubble() {
-		Gyro::bufsize++;
-		Gyro::buffer[Gyro::bufsize] = 2;
+	void Visa::do_the_bubble() {
+		_vm->_gyro.bufsize++;
+		_vm->_gyro.buffer[_vm->_gyro.bufsize] = 2;
 	}
 
 	// File handling.
-	void dixi(char block, byte point) {
+	void Visa::dixi(char block, byte point) {
 		warning("STUB: Visa::dixi()");
 	}
 
 	// File handling.
-	void speech(byte who, byte subject) {
+	void Visa::speech(byte who, byte subject) {
 		warning("STUB: Visa::speech()");
 	}
 
-	void talkto(byte whom) {
+	void Visa::talkto(byte whom) {
 		byte fv;
 		bool no_matches;
 
 		warning("STUB: Visa::talkto()");
 	}
 
-	} // End of namespace Visa.
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index feda7b6..6749a1d 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -25,20 +25,38 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* VISA		The new Sez handler. (Replaces Access.) */
+
 #ifndef VISA2_H
 #define VISA2_H
 
 #include "common/scummsys.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Visa {
+class Visa {
+public:
+	void Visa::setParent(AvalancheEngine *vm);
 
 	void dixi(char block, byte point);
 
 	void talkto(byte whom);
 
-	} // End of namespace Visa.
+private:
+	AvalancheEngine *_vm;
+
+	static const bool bubbling;
+	static const bool report_dixi_errors;
+
+	bool went_ok;
+
+	void unskrimble();
+
+	void do_the_bubble();
+
+	void speech(byte who, byte subject);
+};
 
 } // End of namespace Avalanche.
 


Commit: 7623ea79fe1db5c505e03459977e8ea38ffbc03c
    https://github.com/scummvm/scummvm/commit/7623ea79fe1db5c505e03459977e8ea38ffbc03c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T08:58:22-07:00

Commit Message:
AVALANCHE: Celer: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f72c12c..e17f1ee 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -53,6 +53,7 @@ namespace Avalanche {
 		_pingo.setParent(this);
 		_scrolls.setParent(this);
 		_visa.setParent(this);
+		_lucerna.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 14d2f4e..e0f544c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -35,6 +35,7 @@
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
+#include "avalanche/lucerna2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -57,6 +58,7 @@ public:
 	Pingo _pingo;
 	Scrolls _scrolls;
 	Visa _visa;
+	Lucerna _lucerna;
 
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 6efabea..2e6ce5a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -29,369 +29,368 @@
 
 #include "avalanche/celer2.h"
 #include "common/textconsole.h"
-//#include "avalanche/trip6.h"
+#include "avalanche/trip6.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/roomnums.h"
+#include "avalanche/avalanche.h"
 
 namespace Avalanche {
 
-	namespace Celer {
+const int16 Celer::on_disk = -1;
 
-	//untyped_file f; /* Private variable- not accessible from elsewhere. */
 
-	const int16 on_disk = -1; /* Value of memos[fv].x when it's not in memory. */
+Celer::Celer() {
+	num_chunks = 0;
+}
 
-	void pics_link() {
-		byte xx;
+void Celer::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
 
-		if (Gyro::ddmnow)  return; /* No animation when the menus are up. */
+void Celer::pics_link() {
+	byte xx;
 
-		{
-			Gyro::dnatype &with = Gyro::dna;
-			switch (with.room) {
+	if (_vm->_gyro.ddmnow)  return; /* No animation when the menus are up. */
 
-			case r__outsideargentpub: {
-				if ((Gyro::roomtime % int32(12)) == 0)
-					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(4));
-			}
-			break;
+	{
+		switch (_vm->_gyro.dna.room) {
 
-			case r__brummieroad:
-				if ((Gyro::roomtime % int32(2)) == 0)
-					show_one(int32(1) + (Gyro::roomtime / int32(2)) % int32(4));
-				break;
+		case r__outsideargentpub: {
+			if ((_vm->_gyro.roomtime % int32(12)) == 0)
+				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
+		}
+		break;
 
-			case r__bridge:
-				if ((Gyro::roomtime % int32(2)) == 0)
-					show_one(int32(4) + (Gyro::roomtime / int32(2)) % int32(4));
-				break;
+		case r__brummieroad:
+			if ((_vm->_gyro.roomtime % int32(2)) == 0)
+				show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
+			break;
 
-			case r__yours:
-				if ((! with.avvy_is_awake) && ((Gyro::roomtime % int32(4)) == 0))
-					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(2));
-				break;
+		case r__bridge:
+			if ((_vm->_gyro.roomtime % int32(2)) == 0)
+				show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
+			break;
 
-			case r__argentpub: {
-				if (((Gyro::roomtime % int32(7)) == 1) && (Gyro::dna.malagauche != 177)) {
-					/* Malagauche cycle */
-					Gyro::dna.malagauche += 1;
-					switch (Gyro::dna.malagauche) {
-					case 1:
-					case 11:
-					case 21:
-						show_one(12);
-						break; /* Looks forwards. */
-					case 8:
-					case 18:
-					case 28:
-					case 32:
-						show_one(11);
-						break; /* Looks at you. */
-					case 30:
-						show_one(13);
-						break; /* Winks. */
-					case 33:
-						Gyro::dna.malagauche = 0;
-						break;
-					}
-				}
+		case r__yours:
+			if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
+				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
+			break;
 
-				switch (Gyro::roomtime % 200) {
-				case 179:
-				case 197:
-					show_one(5);
-					break; /* Dogfood's drinking cycle */
-				case 182:
-				case 194:
-					show_one(6);
-					break;
-				case 185:
-					show_one(7);
+		case r__argentpub: {
+			if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) {
+				/* Malagauche cycle */
+				_vm->_gyro.dna.malagauche += 1;
+				switch (_vm->_gyro.dna.malagauche) {
+				case 1:
+				case 11:
+				case 21:
+					show_one(12);
+					break; /* Looks forwards. */
+				case 8:
+				case 18:
+				case 28:
+				case 32:
+					show_one(11);
+					break; /* Looks at you. */
+				case 30:
+					show_one(13);
+					break; /* Winks. */
+				case 33:
+					_vm->_gyro.dna.malagauche = 0;
 					break;
-				case 199:
-					Gyro::dna.dogfoodpos = 177;
-					break; /* Impossible value for this. */
 				}
-
-				if ((Gyro::roomtime % 200 >= 0) && (Gyro::roomtime % 200 <= 178)) { /* Normally. */
-					if (((Lucerna::bearing(2) >= 1) && (Lucerna::bearing(2) <= 90)) || ((Lucerna::bearing(2) >= 358) && (Lucerna::bearing(2) <= 360)))
-						xx = 3;
-					else if ((Lucerna::bearing(2) >= 293) && (Lucerna::bearing(2) <= 357))
-						xx = 2;
-					else if ((Lucerna::bearing(2) >= 271) && (Lucerna::bearing(2) <= 292))
-						xx = 4;
-
-					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
-						show_one(xx);
-						Gyro::dna.dogfoodpos = xx;
-					}
-				}
-				
 			}
-			break;
 
-			case r__westhall:
-				if ((Gyro::roomtime % int32(3)) == 0)
-					switch ((Gyro::roomtime / int32(3)) % int32(6)) {
-					case 4:
-						show_one(1);
-						break;
-					case 1:
-					case 3:
-					case 5:
-						show_one(2);
-						break;
-					case 0:
-					case 2:
-						show_one(3);
-						break;
-					}
+			switch (_vm->_gyro.roomtime % 200) {
+			case 179:
+			case 197:
+				show_one(5);
+				break; /* Dogfood's drinking cycle */
+			case 182:
+			case 194:
+				show_one(6);
 				break;
-
-			case r__lustiesroom:
-				if (!(Gyro::dna.lustie_is_asleep))  {
-					if ((Gyro::roomtime % int32(45)) > 42)
-						xx = 4; /* du Lustie blinks */
-
-					/* Bearing of Avvy from du Lustie. */
-					else if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360)))
-							xx = 1; /* Middle. */
-					else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180))
-							xx = 2; /* Left. */
-					else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314))
-						xx = 3; /* Right. */
-
-					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
-						show_one(xx);
-						Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-					}
-				}
+			case 185:
+				show_one(7);
 				break;
+			case 199:
+				_vm->_gyro.dna.dogfoodpos = 177;
+				break; /* Impossible value for this. */
+			}
+
+			if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */
+				if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
+					xx = 3;
+				else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
+					xx = 2;
+				else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
+					xx = 4;
 
-			case r__aylesoffice:
-				if ((! Gyro::dna.ayles_is_awake) && (Gyro::roomtime % int32(14) == 0)) {
-					switch ((Gyro::roomtime / int32(14)) % int32(2)) {
-					case 0:
-						show_one(1);
-						break; /* Frame 2: EGA. */
-					case 1:
-						show_one(3);
-						break; /* Frame 1: Natural. */
-					}
+				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+					show_one(xx);
+					_vm->_gyro.dna.dogfoodpos = xx;
 				}
-				break;
+			}
+				
+		}
+		break;
 
-			case r__robins:
-				if (Gyro::dna.tied_up)
-					switch (Gyro::roomtime % int32(54)) {
-					case 20:
-						show_one(4);
-						break; /* Frame 4: Avalot blinks. */
-					case 23:
-						show_one(2);
-						break; /* Frame 1: Back to normal. */
-					}
-				break;
+		case r__westhall:
+			if ((_vm->_gyro.roomtime % int32(3)) == 0)
+				switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) {
+				case 4:
+					show_one(1);
+					break;
+				case 1:
+				case 3:
+				case 5:
+					show_one(2);
+					break;
+				case 0:
+				case 2:
+					show_one(3);
+					break;
+				}
+			break;
 
-			case r__nottspub: {
-				/* Bearing of Avvy from Port. */
-				if (((Lucerna::bearing(5) >= 0) && (Lucerna::bearing(5) <= 45)) || ((Lucerna::bearing(5) >= 315) && (Lucerna::bearing(5) <= 360)))
-					xx = 2; /* Middle. */
-				else if ((Lucerna::bearing(5) >= 45) && (Lucerna::bearing(5) <= 180))
-					xx = 6; /* Left. */
-				else if ((Lucerna::bearing(5) >= 181) && (Lucerna::bearing(5) <= 314))
-					xx = 8; /* Right. */
+		case r__lustiesroom:
+			if (!(_vm->_gyro.dna.lustie_is_asleep))  {
+				if ((_vm->_gyro.roomtime % int32(45)) > 42)
+					xx = 4; /* du Lustie blinks */
 
-				if ((Gyro::roomtime % int32(60)) > 57)  xx--; /* Blinks */
+				/* Bearing of Avvy from du Lustie. */
+				else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+						xx = 1; /* Middle. */
+				else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
+						xx = 2; /* Left. */
+				else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
+					xx = 3; /* Right. */
 
-				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
+				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
 					show_one(xx);
-					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+					_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 				}
+			}
+			break;
 
-				switch (Gyro::roomtime % 50) {
-				case 45 :
-					show_one(9);
-					break; /* Spurge blinks */
-				case 49 :
-					show_one(10);
-					break;
+		case r__aylesoffice:
+			if ((! _vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) {
+				switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) {
+				case 0:
+					show_one(1);
+					break; /* Frame 2: EGA. */
+				case 1:
+					show_one(3);
+					break; /* Frame 1: Natural. */
 				}
 			}
 			break;
 
-			case r__ducks: {
-				if ((Gyro::roomtime % 3) == 0) /* The fire flickers */
-					show_one(1 + (Gyro::roomtime / 3) % 3);
+		case r__robins:
+			if (_vm->_gyro.dna.tied_up)
+				switch (_vm->_gyro.roomtime % int32(54)) {
+				case 20:
+					show_one(4);
+					break; /* Frame 4: Avalot blinks. */
+				case 23:
+					show_one(2);
+					break; /* Frame 1: Back to normal. */
+				}
+			break;
 
-				{/* Lucerna::bearing of Avvy from Duck. */
-				if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360)))
-					xx = 4; /* Middle. */
-				else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180))
-					xx = 6; /* Left. */
-				else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314))
-					xx = 8; /* Right. */
+		case r__nottspub: {
+			/* Bearing of Avvy from Port. */
+			if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360)))
+				xx = 2; /* Middle. */
+			else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180))
+				xx = 6; /* Left. */
+			else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
+				xx = 8; /* Right. */
 
-				if ((Gyro::roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */
+			if ((_vm->_gyro.roomtime % int32(60)) > 57)  xx--; /* Blinks */
 
-				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/
-					show_one(xx);
-					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-				}
+			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+				show_one(xx);
+				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 			}
-			break;
 
+			switch (_vm->_gyro.roomtime % 50) {
+			case 45 :
+				show_one(9);
+				break; /* Spurge blinks */
+			case 49 :
+				show_one(10);
+				break;
 			}
 		}
+		break;
 
-		if ((Gyro::dna.ringing_bells) && (Gyro::flagset('B')))
-			/* They're ringing the bells. */
-			switch (Gyro::roomtime % int32(4)) {
-			case 1: {
-				Gyro::dnatype &with = Gyro::dna;
+		case r__ducks: {
+			if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */
+				show_one(1 + (_vm->_gyro.roomtime / 3) % 3);
 
-				if (with.nextbell < 5)  with.nextbell = 12;
-				with.nextbell -= 1;
-				Gyro::note(Gyro::notes[with.nextbell]);
-			}
-			break;
-			case 2:
-				//nosound;
-				warning("STUB: Celer::pics_link()");
-				break;
+			{/* _vm->_lucerna.bearing of Avvy from Duck. */
+			if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+				xx = 4; /* Middle. */
+			else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
+				xx = 6; /* Left. */
+			else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
+				xx = 8; /* Right. */
+
+			if ((_vm->_gyro.roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */
+
+			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+				show_one(xx);
+				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 			}
 		}
-	}
+		break;
 
-	void load_chunks(Common::String xx) {
-		warning("STUB: Celer::load_chunks()");
+		}
 	}
 
-	void forget_chunks() {
-		warning("STUB: Celer::forget_chunks()");
+	if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B')))
+		/* They're ringing the bells. */
+		switch (_vm->_gyro.roomtime % int32(4)) {
+		case 1: {
+			if (_vm->_gyro.dna.nextbell < 5)  _vm->_gyro.dna.nextbell = 12;
+			_vm->_gyro.dna.nextbell -= 1;
+			_vm->_gyro.note(_vm->_gyro.notes[_vm->_gyro.dna.nextbell]);
+		}
+		break;
+		case 2:
+			//nosound;
+			warning("STUB: Celer::pics_link()");
+			break;
+		}
 	}
+}
 
-	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) /* assembler;
-	asm
-	  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
-	  push bp;      { Nor BP! }
-
+void Celer::load_chunks(Common::String xx) {
+	warning("STUB: Celer::load_chunks()");
+}
 
-	  { DI holds the offset on this page. It starts at the top left-hand corner. }
-	  { (It should equal ch.y*80+ch.x. }
+void Celer::forget_chunks() {
+	warning("STUB: Celer::forget_chunks()");
+}
 
-	  mov ax,y;
-	  mov dl,80;
-	  mul dl; { Line offset now calculated. }
-	  mov di,ax; { Move it into DI. }
-	  mov ax,x;
-	  add di,ax; { Full offset now calculated. }
+void Celer::mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) { /* assembler;
+asm
+	push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
+	push bp;      { Nor BP! }
 
-	  mov bx,yl; { No. of times to repeat lineloop. }
-	  inc bx;        { "loop" doesn't execute the zeroth time. }
-	  mov bh,bl;     { Put it into BH. }
 
-	  { BP holds the length of the Common::String to copy. It's equal to ch.xl.}
+	{ DI holds the offset on this page. It starts at the top left-hand corner. }
+	{ (It should equal ch.y*80+ch.x. }
 
-	  mov ax,uint16(p);   { Data is held at DS:SI. }
-	  mov si,ax;
-	  mov ax,uint16(p+2); { This will be moved over into ds in just a tick... }
+	mov ax,y;
+	mov dl,80;
+	mul dl; { Line offset now calculated. }
+	mov di,ax; { Move it into DI. }
+	mov ax,x;
+	add di,ax; { Full offset now calculated. }
 
-	  mov bp,xl;
+	mov bx,yl; { No. of times to repeat lineloop. }
+	inc bx;        { "loop" doesn't execute the zeroth time. }
+	mov bh,bl;     { Put it into BH. }
 
-	  mov ds,ax;
+	{ BP holds the length of the Common::String to copy. It's equal to ch.xl.}
 
+	mov ax,uint16(p);   { Data is held at DS:SI. }
+	mov si,ax;
+	mov ax,uint16(p+2); { This will be moved over into ds in just a tick... }
 
-	  cld;          { We're allowed to hack around with the flags! }
+	mov bp,xl;
 
-	  mov ax,$AC00; { Top of the first EGA page. }
-	  mov es,ax;    { Offset on this page is calculated below... }
+	mov ds,ax;
 
 
-	{    port[$3c4]:=2; port[$3ce]:=4; }
+	cld;          { We're allowed to hack around with the flags! }
 
-	  mov dx,$3c4;
-	  mov al,2;
-	  out dx,al;
-	  mov dx,$3ce;
-	  mov al,4;
-	  out dx,al;
+	mov ax,$AC00; { Top of the first EGA page. }
+	mov es,ax;    { Offset on this page is calculated below... }
 
-	  mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
-	  mov bl,0;
 
+{    port[$3c4]:=2; port[$3ce]:=4; }
 
-	 @mainloop:
+	mov dx,$3c4;
+	mov al,2;
+	out dx,al;
+	mov dx,$3ce;
+	mov al,4;
+	out dx,al;
 
-		push di;
-		push cx;
+	mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
+	mov bl,0;
 
-	{    port[$3C5]:=1 shl bit; }
-		mov dx,$3C5;
-		mov al,1;
-		mov cl,bl; { BL = bit. }
-		shl al,cl;
-		out dx,al;
-	{     port[$3CF]:=bit; }
-		mov dx,$3CF;
-		mov al,bl; { BL = bit. }
-		out dx,al;
 
-		xor ch,ch;
-		mov cl,bh; { BH = ch.yl. }
+	@mainloop:
 
-	   @lineloop:
+	push di;
+	push cx;
 
-		 push cx;
+{    port[$3C5]:=1 shl bit; }
+	mov dx,$3C5;
+	mov al,1;
+	mov cl,bl; { BL = bit. }
+	shl al,cl;
+	out dx,al;
+{     port[$3CF]:=bit; }
+	mov dx,$3CF;
+	mov al,bl; { BL = bit. }
+	out dx,al;
 
-		 mov cx,bp;
+	xor ch,ch;
+	mov cl,bh; { BH = ch.yl. }
 
-		 repz movsb; { Copy the data. }
+	@lineloop:
 
-		 sub di,bp;
-		 add di,80;
+		push cx;
 
-		 pop cx;
+		mov cx,bp;
 
-	   loop @lineloop;
+		repz movsb; { Copy the data. }
 
-		inc bl; { One more on BL. }
+		sub di,bp;
+		add di,80;
 
 		pop cx;
-		pop di;
 
-	 loop @mainloop;
+	loop @lineloop;
 
-	  pop bp;
-	  pop ds;       { Get DS back again. }
-	*/
-	{
-	}
+	inc bl; { One more on BL. }
 
-	void show_one(byte which);
+	pop cx;
+	pop di;
 
-	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) {
-		warning("STUB: Celer::display_it()");
-	}
+	loop @mainloop;
 
-	void show_one(byte which) {
-		warning("STUB: Celer::show_one()");
-	}
+	pop bp;
+	pop ds;       { Get DS back again. }
+*/
+}
 
 
 
-	void show_one_at(byte which, int16 xxx, int16 yyy);
+void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) {
+	warning("STUB: Celer::display_it()");
+}
 
-	static void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
-		warning("STUB: Celer::display_it1()");
-	}
+void Celer::show_one(byte which) {
+	warning("STUB: Celer::show_one()");
+}
 
-	void show_one_at(byte which, int16 xxx, int16 yyy) {
-		warning("STUB: Celer::show_one_at()");
-	}
 
 
-	} // End of namespace Celer.
+void Celer::display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
+	warning("STUB: Celer::display_it1()");
+}
+
+void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
+	warning("STUB: Celer::show_one_at()");
+}
+
+
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 466ed8d..263d717 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -30,50 +30,68 @@
 #ifndef CELER2_H
 #define CELER2_H
 
+
+
 #include "common/scummsys.h"
 #include "common/str.h"
 
 namespace Avalanche {
+class AvalancheEngine;
+
+class Celer {
+public:
+	enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
+
+	struct chunkblocktype {
+		flavourtype flavour;
+		int16 x, y;
+		int16 xl, yl;
+		int32 size;
+		bool natural;
+
+		bool memorise; /* Hold it in memory? */
+	};
+
+	struct memotype {
+		int16 x, y;
+		int16 xl, yl;
+		flavourtype flavour;
+		uint16 size;
+	};
+
+	int32 offsets[40];
+	byte num_chunks;
+	memotype memos[40];
+	void *memory[40];
 
-	namespace Celer {
 
-		enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
+	Celer();
 
-		struct chunkblocktype {
-			flavourtype flavour;
-			int16 x, y;
-			int16 xl, yl;
-			int32 size;
-			bool natural;
+	void setParent(AvalancheEngine *vm);
 
-			bool memorise; /* Hold it in memory? */
-		};
+	void pics_link();
 
-		struct memotype {
-			int16 x, y;
-			int16 xl, yl;
-			flavourtype flavour;
-			uint16 size;
-		};
+	void load_chunks(Common::String xx);
 
-		int32 offsets[40];
-		byte num_chunks = 0;
-		memotype memos[40];
-		void *memory[40];
+	void forget_chunks();
 
+	void show_one(byte which);
 
+	void show_one_at(byte which, int16 xxx, int16 yyy);
 
-		void pics_link();
+private:
+	AvalancheEngine *_vm;
 
-		void load_chunks(Common::String xx);
+	//untyped_file f; /* Private variable- not accessible from elsewhere. */
 
-		void forget_chunks();
+	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
 
-		void show_one(byte which);
+	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p);
 
-		void show_one_at(byte which, int16 xxx, int16 yyy);
+	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p);
 
-	} // End of namespace Celer.
+	void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);
+};
 
 } // End of namespace Avalanche.
 


Commit: 3c413c7ccb7925fce6d80f8b158747b0bb39d326
    https://github.com/scummvm/scummvm/commit/3c413c7ccb7925fce6d80f8b158747b0bb39d326
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T09:23:04-07:00

Commit Message:
AVALANCHE: Enid: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index e17f1ee..c682171 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -54,6 +54,7 @@ namespace Avalanche {
 		_scrolls.setParent(this);
 		_visa.setParent(this);
 		_lucerna.setParent(this);
+		_enid.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e0f544c..643b97c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -36,6 +36,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
+#include "avalanche/enid2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -59,6 +60,7 @@ public:
 	Scrolls _scrolls;
 	Visa _visa;
 	Lucerna _lucerna;
+	Enid _enid;
 
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 9c7d64a..3ca6daa 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -30,6 +30,8 @@
 #include "common/scummsys.h"
 #include "common/textconsole.h"
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/enid2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
@@ -43,285 +45,273 @@
 
 namespace Avalanche {
 
-	namespace Enid {
-
-	const Common::String crlf = Common::String(char(15)) + Common::String(char(12));
-	const char tab = '\t';
-	const char eof_ = '\n';
-
-	const Common::String ednafirst =
-		Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + /*64*/
-		crlf + eof_ + crlf + crlf + /*7*/
-		tab + "Glory to God in the highest," + crlf + /*31*/
-		tab + "and on earth peace, goodwill toward men." + /*42*/
-		crlf + tab + tab + tab + tab + /*6*/
-		"Luke 2:14." + /*10*/
-		crlf + crlf + crlf + /* 6 */
-		"1234567890" +crlf; /*11*/
-
-	const Common::String ednaid = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
-
-	const int16 ttage = 18;
-	const Common::String ttwashere = "Thomas was here ";
-
-	bool bug;
-
-
-
-	Common::String expanddate(byte d, byte m, uint16 y);
- 
-	static Common::String month;
-
-	static Common::String day;
-
-	static void addon(Common::String x) {
-		//month[0]--;
-		month = month + x;
+void Enid::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+const Common::String Enid::crlf = Common::String(char(15)) + Common::String(char(12));
+const char Enid::tab = '\t';
+const char Enid::eof_ = '\n';
+
+const Common::String Enid::ednafirst =
+	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + /*64*/
+	crlf + eof_ + crlf + crlf + /*7*/
+	tab + "Glory to God in the highest," + crlf + /*31*/
+	tab + "and on earth peace, goodwill toward men." + /*42*/
+	crlf + tab + tab + tab + tab + /*6*/
+	"Luke 2:14." + /*10*/
+	crlf + crlf + crlf + /* 6 */
+	"1234567890" +crlf; /*11*/
+
+const Common::String Enid::ednaid = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
+
+const int16 Enid::ttage = 18;
+const Common::String Enid::ttwashere = "Thomas was here ";
+
+const Enid::fourtype Enid::avaricius_file = "Avvy";
+
+
+
+void Enid::addon(Common::String x) {
+	//month[0]--;
+	month = month + x;
+}
+
+Common::String Enid::expanddate(byte d, byte m, uint16 y) {
+	const Common::String months[12] = {
+		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
+		"Septem*", "Octo*", "Novem*", "Decem*"		
+	};
+
+	Common::String expanddate_result;
+	month = months[m];
+	switch (month[month.size()]) {
+	case '#':
+		addon("uary");
+		break;
+	case '*':
+		addon("ber");
+		break;
 	}
 
-	Common::String expanddate(byte d, byte m, uint16 y) {
-		const Common::String months[12] = {
-			"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
-			"Septem*", "Octo*", "Novem*", "Decem*"		
-		};
-
-		Common::String expanddate_result;
-		month = months[m];
-		switch (month[month.size()]) {
-		case '#':
-			addon("uary");
+	day = _vm->_gyro.strf(d);
+
+	if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31)))
+		switch (d % 10) {
+		case 1:
+			day = day + "st";
+			break;
+		case 2:
+			day = day + "nd";
 			break;
-		case '*':
-			addon("ber");
+		case 3:
+			day = day + "rd";
 			break;
+		default:
+			day = day + "th";
 		}
 
-		day = Gyro::strf(d);
-
-		if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31)))
-			switch (d % 10) {
-			case 1:
-				day = day + "st";
-				break;
-			case 2:
-				day = day + "nd";
-				break;
-			case 3:
-				day = day + "rd";
-				break;
-			default:
-				day = day + "th";
-			}
-
-		expanddate_result = day + ' ' + month + ' ' + Gyro::strf(y);
-		return expanddate_result;
-	}
+	expanddate_result = day + ' ' + month + ' ' + _vm->_gyro.strf(y);
+	return expanddate_result;
+}
 
 
 
-	void edna_save(Common::String name);
 
-	static void show_bug(char icon, Common::String strn) {
-		Scrolls::display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
-	}
 
-	static bool test_bug(byte what) {
-		bool test_bug_result;
-		if (what == 0)  {
-			test_bug_result = false;
-			return test_bug_result;
-		}
-		switch (what) {
-		case 2:
-			show_bug('7', "Error in filename!");
-			break;
-		case 101:
-			show_bug('6', "Disk full!");
-			break;
-		case 150:
-			show_bug('4', "Disk is write-protected!");
-			break;
-		default:
-			show_bug('B', "Saving error!");
-		}
-		test_bug_result = true;
+void Enid::show_bug(char icon, Common::String strn) {
+	_vm->_scrolls.display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
+}
+
+bool Enid::test_bug(byte what) {
+	bool test_bug_result;
+	if (what == 0)  {
+		test_bug_result = false;
 		return test_bug_result;
 	}
-
-	void edna_save(Common::String name) {
-		warning("STUB: Enid::edna_save()");
+	switch (what) {
+	case 2:
+		show_bug('7', "Error in filename!");
+		break;
+	case 101:
+		show_bug('6', "Disk full!");
+		break;
+	case 150:
+		show_bug('4', "Disk is write-protected!");
+		break;
+	default:
+		show_bug('B', "Saving error!");
 	}
-
-	void loaderror(Common::String x, char icon) {
-		if (Gyro::holdthedawn) {
-			Gyro::holdthedawn = false;
-			Lucerna::dawn();
-		}
-		Scrolls::display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
-		bug = true;
+	test_bug_result = true;
+	return test_bug_result;
+}
+
+void Enid::edna_save(Common::String name) {
+	warning("STUB: Enid::edna_save()");
+}
+
+void Enid::loaderror(Common::String x, char icon) {
+	if (_vm->_gyro.holdthedawn) {
+		_vm->_gyro.holdthedawn = false;
+		_vm->_lucerna.dawn();
 	}
+	_vm->_scrolls.display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
+	bug = true;
+}
 
 
 
-	typedef char fourtype[5];
-
 
+void Enid::edna_load(Common::String name) {
+	warning("STUB: Enid::edna_load()");
+}
 
-	const fourtype avaricius_file = "Avvy";
 
-	void edna_load(Common::String name) {
-		warning("STUB: Enid::edna_load()");
-	}
 
 
 
-	void dir(Common::String where);
+void Enid::showheader() {
+	_vm->_scrolls.display(Common::String("Dir: ") + path + "\r\r\4");
+}
 
-	static Common::String path, groi;
-
-	static void showheader() {
-		Scrolls::display(Common::String("Dir: ") + path + "\r\r\4");
-	}
+void Enid::dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
+	warning("STUB: Enid::dir()");
+}
 
-	void dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
-		warning("STUB: Enid::dir()");
-	}
-
-	void avvy_background() {    /* Not really a filing procedure,
-	 but it's only called just before edna_load, so I thought I'd put it
-	 in Enid instead of, say, Lucerna. */
+void Enid::avvy_background() {    /* Not really a filing procedure,
+	but it's only called just before edna_load, so I thought I'd put it
+	in Enid instead of, say, Lucerna. */
 	
-		/* port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }*/
-		/*
-		 asm
-		  mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
-		  mov dx,$3ce; mov al,4; out dx,al; { register. }
-		  mov dx,$3c5; mov al,1; out dx,al;
-		  mov dx,$3cf;           out dx,al;
+	/* port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }*/
+	/*
+		asm
+		mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
+		mov dx,$3ce; mov al,4; out dx,al; { register. }
+		mov dx,$3c5; mov al,1; out dx,al;
+		mov dx,$3cf;           out dx,al;
 
-		  mov bx,$A000; call far ptr @drawup;
-		  mov bx,$A400; call far ptr @drawup;
+		mov bx,$A000; call far ptr @drawup;
+		mov bx,$A400; call far ptr @drawup;
 
-		  jmp @the_end;
+		jmp @the_end;
 
-		 @drawup:
+		@drawup:
 
-		  mov es,bx; { The segment to copy it to... }
-		  mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
+		mov es,bx; { The segment to copy it to... }
+		mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
 
-		  mov cx,10;
-		  mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
-		  mov ax,$AEAA; call far ptr @sameline;
-		  mov ax,$A4EA; call far ptr @sameline;
-		  mov ax,$44A4; call far ptr @sameline;
+		mov cx,10;
+		mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
+		mov ax,$AEAA; call far ptr @sameline;
+		mov ax,$A4EA; call far ptr @sameline;
+		mov ax,$44A4; call far ptr @sameline;
 
-		  mov cx,9;
-		  mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
-		  mov ax,$AAEA; call far ptr @sameline;
-		  mov ax,$AA4E; call far ptr @sameline;
-		  mov ax,$444A; call far ptr @sameline;
+		mov cx,9;
+		mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
+		mov ax,$AAEA; call far ptr @sameline;
+		mov ax,$AA4E; call far ptr @sameline;
+		mov ax,$444A; call far ptr @sameline;
 
-		  mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
-		  mov ax,$AAAE; call far ptr @sameline;
-		  mov ax,$EAA4; call far ptr @sameline;
-		  mov ax,$A444; call far ptr @sameline;
+		mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
+		mov ax,$AAAE; call far ptr @sameline;
+		mov ax,$EAA4; call far ptr @sameline;
+		mov ax,$A444; call far ptr @sameline;
 
-		  mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
-		  mov ax,$EAAA; call far ptr @sameline;
-		  mov ax,$4EAA; call far ptr @sameline;
-		  mov ax,$4A44; call far ptr @sameline;
+		mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
+		mov ax,$EAAA; call far ptr @sameline;
+		mov ax,$4EAA; call far ptr @sameline;
+		mov ax,$4A44; call far ptr @sameline;
 
-		  ret;
+		ret;
 
 
-		  { Replicate the same line many times. }
+		{ Replicate the same line many times. }
 
-		  @sameline:
-		   { Requires:
-			  what to copy in AX,
-			  how many lines in CX, and
-			  original offset in DI. }
-		   push cx;
-		   push di;
+		@sameline:
+		{ Requires:
+			what to copy in AX,
+			how many lines in CX, and
+			original offset in DI. }
+		push cx;
+		push di;
 
-		   @samelineloop:
+		@samelineloop:
 
-			push cx;
-			mov cx,40; { No. of times to repeat it on one line. }
+		push cx;
+		mov cx,40; { No. of times to repeat it on one line. }
 
-			repz stosw; { Fast uint16-copying }
+		repz stosw; { Fast uint16-copying }
 
-			pop cx;
+		pop cx;
 
-			add di,1200; { The next one will be 16 lines down. }
+		add di,1200; { The next one will be 16 lines down. }
 
-		   loop @samelineloop;
-		   pop di;
-		   add di,80;
-		   pop cx;
+		loop @samelineloop;
+		pop di;
+		add di,80;
+		pop cx;
 
-		   ret;
+		ret;
 
-		  @the_end:
-		 end;
-		*/
-		Lucerna::blitfix();
-	}
+		@the_end:
+		end;
+	*/
+	_vm->_lucerna.blitfix();
+}
 
-	void to_sundry(Gyro::sundry &sund) {
-		{
-			sund.qenid_filename = Gyro::enid_filename;
-			sund.qsoundfx = Gyro::soundfx;
-			sund.qthinks = Gyro::thinks;
-			sund.qthinkthing = Gyro::thinkthing;
-		}
+void Enid::to_sundry(sundry &sund) {
+	{
+		sund.qenid_filename = _vm->_gyro.enid_filename;
+		sund.qsoundfx = _vm->_gyro.soundfx;
+		sund.qthinks = _vm->_gyro.thinks;
+		sund.qthinkthing = _vm->_gyro.thinkthing;
 	}
-
-	void from_sundry(Gyro::sundry sund) {
-		{
-			Gyro::enid_filename = sund.qenid_filename;
-			Gyro::soundfx = sund.qsoundfx;
-			Gyro::thinks = sund.qthinks;
-			Gyro::thinkthing = sund.qthinkthing;
-		}
+}
+
+void Enid::from_sundry(sundry sund) {
+	{
+		_vm->_gyro.enid_filename = sund.qenid_filename;
+		_vm->_gyro.soundfx = sund.qsoundfx;
+		_vm->_gyro.thinks = sund.qthinks;
+		_vm->_gyro.thinkthing = sund.qthinkthing;
 	}
+}
 
-	void restore_dna() {
-		uint16 here, fv;
-		Gyro::sundry sund;
+void Enid::restore_dna() {
+	uint16 here, fv;
+	sundry sund;
 
-		warning("STUB: Enid::restore_dna()");
-	}
+	warning("STUB: Enid::restore_dna()");
+}
 
-	void edna_reload() {
+void Enid::edna_reload() {
 
-		restore_dna();
+	restore_dna();
 
-		Gyro::seescroll = true;  /* This prevents display of the new sprites before the
-	  new picture is loaded. */
+	_vm->_gyro.seescroll = true;  /* This prevents display of the new sprites before the
+	new picture is loaded. */
 
-		Lucerna::major_redraw();
+	_vm->_lucerna.major_redraw();
 
-		Gyro::whereis[Gyro::pavalot] = Gyro::dna.room;
+	_vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room;
 
-		Gyro::alive = true;
+	_vm->_gyro.alive = true;
 
-		Lucerna::objectlist();
+	_vm->_lucerna.objectlist();
 
-		if (Gyro::holdthedawn) {
-			Gyro::holdthedawn = false;
-			Lucerna::dawn();
-		}
+	if (_vm->_gyro.holdthedawn) {
+		_vm->_gyro.holdthedawn = false;
+		_vm->_lucerna.dawn();
 	}
+}
 
-	void back_to_bootstrap(byte what) {
-		warning("STUB: Enid::back_to_bootstrap()");
-	}
+void Enid::back_to_bootstrap(byte what) {
+	warning("STUB: Enid::back_to_bootstrap()");
+}
 
-	bool there_was_a_problem() {
-		return bug;
-	}
+bool Enid::there_was_a_problem() {
+	return bug;
+}
 
-	} // End of namespace Enid.
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 0b4671a..4351354 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -35,8 +35,11 @@
 #include "avalanche/gyro2.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Enid {
+class Enid {
+public:
+	void setParent(AvalancheEngine *vm);
 
 	void edna_save(Common::String name);
 
@@ -52,7 +55,51 @@ namespace Avalanche {
 
 	bool there_was_a_problem();
 
-	} // End of namespace Enid.
+private:
+	AvalancheEngine *_vm;
+
+	static const Common::String crlf;
+	static const char tab;
+	static const char eof_;
+
+	static const Common::String ednafirst;
+
+	static const Common::String ednaid;
+
+	static const int16 ttage;
+	static const Common::String ttwashere;
+
+	typedef char fourtype[5];
+	static const fourtype avaricius_file;
+
+
+
+	bool bug;
+
+	Common::String path, groi;
+
+	Common::String month;
+	Common::String day;
+
+
+
+	void addon(Common::String x);
+	Common::String expanddate(byte d, byte m, uint16 y);
+
+	void show_bug(char icon, Common::String strn);
+	bool test_bug(byte what);
+
+	void loaderror(Common::String x, char icon);
+
+	void showheader();
+
+	void to_sundry(sundry &sund);
+	void from_sundry(sundry sund);
+
+	void restore_dna();
+
+	
+};
 
 } // End of namespace Avalanche.
 


Commit: 5ce7e689b4986675a30c0336b4edb3cef69e0ce6
    https://github.com/scummvm/scummvm/commit/5ce7e689b4986675a30c0336b4edb3cef69e0ce6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T09:24:31-07:00

Commit Message:
AVALANCHE: Repair Enhanced, cosmetics in Gyro.

Changed paths:
    engines/avalanche/enhanced2.h
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index 8dd88a6..d780f11 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -39,8 +39,6 @@ class AvalancheEngine;
 
 class Enhanced {
 public:
-	AvalancheEngine *_vm;
-
 	byte shiftstate;	/*ABSOLUTE $40:$17;*/
 	bool atbios; // BIOS type
 	char inchar, extd;
@@ -51,6 +49,8 @@ public:
 
 	bool keypressede();
 private:
+	AvalancheEngine *_vm;
+
 	bool isenh();
 
 };
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index c2f6fd7..6c596d2 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -299,9 +299,7 @@ struct ednahead { /* Edna header */
 
 
 class Gyro {
-
 public:
-
 	static const char *vernum;
 	static const char *copyright;
 	static const int16 thisvercode = 130;


Commit: edaba46087a5d5adf8623ecd9b3cfa16b0ea0de5
    https://github.com/scummvm/scummvm/commit/edaba46087a5d5adf8623ecd9b3cfa16b0ea0de5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T09:25:28-07:00

Commit Message:
AVALANCHE: Logger: replace namespace with class.

Changed paths:
    engines/avalanche/logger2.cpp
    engines/avalanche/logger2.h



diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 24582a4..09643f7 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -25,235 +25,238 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* LOGGER	Handles the logging. */
+
 #include "avalanche/logger2.h"
 #include "avalanche/gyro2.h"
+#include "avalanche/avalanche.h"
 //#include "avalanche/trip6.h"
 
 #include "common/system.h"
 #include "common/textconsole.h"
 
 namespace Avalanche {
+const char Logger::divide[] = "--- oOo ---";
 
-	namespace Logger {
-
-	const char divide[] = "--- oOo ---";
-
-	/* Epson codes:
-
-	 startwith='';
-	 endwith='';
-	 double_width = #14; { shift out (SO) }
-	 double_off = #20; { device control 4 (DC4) }
-	 italic = #27+'4'; { switches italics on... }
-	 italic_off = #27+'5'; { and off. }
-	 emph_on = #27+#69;
-	 emph_off = #27+#70;
-	 divide_indent = 15;
-
-	*/
-
-	/* L'jet codes: */
-
-	//// Not sure if these will be needed at all...
-	//
-	//const Common::String startwith = Common::String('\33') + '\50' + "10J" + '\130';
-	//const Common::String endwith = Common::String('\33') + '\105';
-	//const Common::String italic = Common::String('\33') + '\50' + '\163' + '\61' + '\123'; /* switches italics on... */
-	//const Common::String italic_off = Common::String('\33') + '\50' + '\163' + '\60' + '\123'; /* and off. */
-	//const Common::String emph_on = Common::String('\33') + '\50' + '\163' + '\63' + '\102';
-	//const Common::String emph_off = Common::String('\33') + '\50' + '\163' + '\60' + '\102';
-	//
-	//const Common::String double_width = emph_on; /* There IS no double-width. */
-	//const Common::String double_off = emph_off; /* So we'll have to use bold. */
-
-
-	const Common::String quote = "ª";
-	const Common::String unquote = "º";
-	const Common::String copyright = "(c)";
-	const int16 divide_indent = 30;
-
-	Common::String scroll_line;
-	byte scroll_line_length;
-
-	void centre(byte size, byte x) { /* Prints req'd number of spaces. */
-		byte fv;
-		if (! Gyro::logging)  return;
-
-		warning("STUB: Logger::centre()");
-		/*for (fv = 1; fv <= size - (x / 2); fv ++)
-		output << logfile << ' ';*/
-	}
-
-	void log_setup(Common::String name, bool printing) {     /* Sets up. */
-
-		warning("STUB: Logger::log_setup()");
-
-		/*	assign(logfile, name);
-		rewrite(logfile);
-		output << logfile << startwith;
-		log_epson = printing;
-		logging = true;
-
-		if (! printing)  {
-		quote = '"';
-		unquote = '"';
-		copyright = "(c)";
-		}*/
-	}
-
-	void log_divider() {   /* Prints the divider sign. */
-		byte fv;
-		if (! Gyro::logging)  return;
-
-		warning("STUB: Logger::log_divider()");
-
-		/*if (Gyro::log_epson) {
-		output << logfile << Common::String(' ') + double_width;
-		for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
-		output << logfile << Common::String(' ') + double_off;
-		} else
-		for (fv = 1; fv <= 36; fv ++) output << logfile << ' ';
-		output << logfile << divide << NL;*/
-	}
-
-	void log_command(Common::String x) {     /* Prints a command */
-		if (! Gyro::logging)  return;
-
-		warning("STUB: Logger::log_command()");
-
-		/*if (Gyro::log_epson)
-		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
-		else
-		output << logfile << Common::String("> ") + x << NL;*/
+/* Epson codes:
+
+	startwith='';
+	endwith='';
+	double_width = #14; { shift out (SO) }
+	double_off = #20; { device control 4 (DC4) }
+	italic = #27+'4'; { switches italics on... }
+	italic_off = #27+'5'; { and off. }
+	emph_on = #27+#69;
+	emph_off = #27+#70;
+	divide_indent = 15;
+
+*/
+
+/* L'jet codes: */
+
+//// Not sure if these will be needed at all...
+//
+//const Common::String startwith = Common::String('\33') + '\50' + "10J" + '\130';
+//const Common::String endwith = Common::String('\33') + '\105';
+//const Common::String italic = Common::String('\33') + '\50' + '\163' + '\61' + '\123'; /* switches italics on... */
+//const Common::String italic_off = Common::String('\33') + '\50' + '\163' + '\60' + '\123'; /* and off. */
+//const Common::String emph_on = Common::String('\33') + '\50' + '\163' + '\63' + '\102';
+//const Common::String emph_off = Common::String('\33') + '\50' + '\163' + '\60' + '\102';
+//
+//const Common::String double_width = emph_on; /* There IS no double-width. */
+//const Common::String double_off = emph_off; /* So we'll have to use bold. */
+
+
+
+const Common::String Logger::quote = "ª";
+const Common::String Logger::unquote = "º";
+const Common::String Logger::copyright = "(c)";
+const int16 Logger::divide_indent = 30;
+
+
+
+void Logger::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
+	byte fv;
+	
+	if (! _vm->_gyro.logging)  return;
+
+	warning("STUB: Logger::centre()");
+	/*for (fv = 1; fv <= size - (x / 2); fv ++)
+	output << logfile << ' ';*/
+}
+
+void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
+
+	warning("STUB: Logger::log_setup()");
+
+	/*	assign(logfile, name);
+	rewrite(logfile);
+	output << logfile << startwith;
+	log_epson = printing;
+	logging = true;
+
+	if (! printing)  {
+	quote = '"';
+	unquote = '"';
+	copyright = "(c)";
+	}*/
+}
+
+void Logger::log_divider() {   /* Prints the divider sign. */
+	byte fv;
+	if (! _vm->_gyro.logging)  return;
+
+	warning("STUB: Logger::log_divider()");
+
+	/*if (_vm->_gyro.log_epson) {
+	output << logfile << Common::String(' ') + double_width;
+	for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
+	output << logfile << Common::String(' ') + double_off;
+	} else
+	for (fv = 1; fv <= 36; fv ++) output << logfile << ' ';
+	output << logfile << divide << NL;*/
+}
+
+void Logger::log_command(Common::String x) {     /* Prints a command */
+	if (! _vm->_gyro.logging)  return;
+
+	warning("STUB: Logger::log_command()");
+
+	/*if (_vm->_gyro.log_epson)
+	output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
+	else
+	output << logfile << Common::String("> ") + x << NL;*/
+}
+
+void Logger::log_addstuff(Common::String x) {
+	if (! _vm->_gyro.logging)  return;
+	scroll_line += x;
+}
+
+void Logger::log_scrollchar(Common::String x) {     /* print one character */
+	Common::String z;
+	if (! _vm->_gyro.logging)  return;
+	switch (x[1]) {
+	case '`':
+		z = quote;
+		break; /* Open quotes: "66" */
+	case '"':
+		z = unquote;
+		break; /* Close quotes: "99" */
+	case '\357':
+		z = copyright;
+		break; /* Copyright sign. */
+	default:
+		z = x;
 	}
+	log_addstuff(z);
+	scroll_line_length += z.size();
+}
 
-	void log_addstuff(Common::String x) {
-		if (! Gyro::logging)  return;
-		scroll_line += x;
-	}
-
-	void log_scrollchar(Common::String x) {     /* print one character */
-		Common::String z;
-		if (! Gyro::logging)  return;
-		switch (x[1]) {
-		case '`':
-			z = quote;
-			break; /* Open quotes: "66" */
-		case '"':
-			z = unquote;
-			break; /* Close quotes: "99" */
-		case '\357':
-			z = copyright;
-			break; /* Copyright sign. */
-		default:
-			z = x;
-		}
-		log_addstuff(z);
-		scroll_line_length += z.size();
-	}
-
-	void log_italic() {
-		if (! Gyro::logging)  return;
-
-		warning("STUB: Logger::log_italic()");
+void Logger::log_italic() {
+	if (! _vm->_gyro.logging)  return;
 
-		/*if (Gyro::log_epson)
-		log_addstuff(italic);
-		else
-		log_addstuff("*");*/
-	}
+	warning("STUB: Logger::log_italic()");
 
-	void log_roman() {
-		if (! Gyro::logging)  return;
+	/*if (_vm->_gyro.log_epson)
+	log_addstuff(italic);
+	else
+	log_addstuff("*");*/
+}
 
-		warning("STUB: Logger::log_roman()");
+void Logger::log_roman() {
+	if (! _vm->_gyro.logging)  return;
 
-		/*	if (Gyro::log_epson)
-		log_addstuff(italic_off);
-		else
-		log_addstuff("*");*/
-	}
+	warning("STUB: Logger::log_roman()");
 
-	void log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-		if (! Gyro::logging)  return;
+	/*	if (_vm->_gyro.log_epson)
+	log_addstuff(italic_off);
+	else
+	log_addstuff("*");*/
+}
 
-		warning("STUB: Logger::log_epsonroman()");
+void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
+	if (! _vm->_gyro.logging)  return;
 
-		//if (Gyro::log_epson)  log_addstuff(italic_off);
-	}
+	warning("STUB: Logger::log_epsonroman()");
 
-	void log_scrollline() {   /* Set up a line for the scroll driver */
-		scroll_line_length = 0;
-		scroll_line = "";
-	}
+	//if (_vm->_gyro.log_epson)  log_addstuff(italic_off);
+}
 
-	void log_scrollendline(bool centred) {
-		byte x, fv;
-		if (! Gyro::logging)  return;
-		x = 17;
-		if (centred)  x += (50 - scroll_line_length) / 2;
+void Logger::log_scrollline() {   /* Set up a line for the scroll driver */
+	scroll_line_length = 0;
+	scroll_line = "";
+}
 
-		warning("STUB: Logger::log_scrollendline()");
+void Logger::log_scrollendline(bool centred) {
+	byte x, fv;
+	if (! _vm->_gyro.logging)  return;
+	x = 17;
+	if (centred)  x += (50 - scroll_line_length) / 2;
 
-		/*for (fv = 1; fv <= x; fv ++) output << logfile << ' ';
-		output << logfile << scroll_line << NL;*/
-	}
+	warning("STUB: Logger::log_scrollendline()");
 
-	void log_bubbleline(byte linenum, byte whom, Common::String x) {
-		byte fv;
-		if (! Gyro::logging)  return;
+	/*for (fv = 1; fv <= x; fv ++) output << logfile << ' ';
+	output << logfile << scroll_line << NL;*/
+}
 
-		warning("STUB: Logger::log_bubbleline()");
+void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
+	byte fv;
+	if (! _vm->_gyro.logging)  return;
 
-		/*if (linenum == 1) {
-		for (fv = 1; fv <= 15; fv ++) output << logfile << ' ';
-		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
-		} else {
-		for (fv = 1; fv <= 17; fv ++) output << logfile << ' ';
-		output << logfile << x << NL;
-		}*/
-	}
+	warning("STUB: Logger::log_bubbleline()");
 
-	void log_newline() {
-		warning("STUB: Logger::log_newline()");
+	/*if (linenum == 1) {
+	for (fv = 1; fv <= 15; fv ++) output << logfile << ' ';
+	output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
+	} else {
+	for (fv = 1; fv <= 17; fv ++) output << logfile << ' ';
+	output << logfile << x << NL;
+	}*/
+}
 
-		//if (Gyro::logging)  output << logfile << NL;
-	}
+void Logger::log_newline() {
+	warning("STUB: Logger::log_newline()");
 
-	void log_newroom(Common::String where) {
-		byte fv;
-		if (! Gyro::logging)  return;
+	//if (_vm->_gyro.logging)  output << logfile << NL;
+}
 
-		warning("STUB: Logger::log_newroom()");
+void Logger::log_newroom(Common::String where) {
+	byte fv;
+	if (! _vm->_gyro.logging)  return;
 
-		/*for (fv = 1; fv <= 20; fv ++) output << logfile << ' ';
-		if (Gyro::log_epson)  output << logfile << emph_on;
-		output << logfile << Common::String('(') + where + ')';
-		if (Gyro::log_epson)  output << logfile << emph_off;
-		output << logfile << NL;*/
-	}
+	warning("STUB: Logger::log_newroom()");
 
-	void log_aside(Common::String what)
-	/* This writes "asides" to the printer. For example, moves in Nim. */
-	{
-		if (! Gyro::logging)  return;
+	/*for (fv = 1; fv <= 20; fv ++) output << logfile << ' ';
+	if (_vm->_gyro.log_epson)  output << logfile << emph_on;
+	output << logfile << Common::String('(') + where + ')';
+	if (_vm->_gyro.log_epson)  output << logfile << emph_off;
+	output << logfile << NL;*/
+}
 
-		warning("STUB: Logger::log_aside()");
+void Logger::log_aside(Common::String what)
+/* This writes "asides" to the printer. For example, moves in Nim. */
+{
+	if (! _vm->_gyro.logging)  return;
 
-		//output << logfile << "   (" << italic << what << italic_off << ')' << NL;
-		/* "What" is what to write. */
-	}
+	warning("STUB: Logger::log_aside()");
 
-	void log_score(uint16 credit, uint16 now) {
-		byte fv;
-		if (! Gyro::logging)  return;
+	//output << logfile << "   (" << italic << what << italic_off << ')' << NL;
+	/* "What" is what to write. */
+}
 
-		warning("STUB: Logger::log_score()");
+void Logger::log_score(uint16 credit, uint16 now) {
+	byte fv;
+	if (! _vm->_gyro.logging)  return;
 
-		/*for (fv = 1; fv <= 50; fv ++) output << logfile << ' ';
-		output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
-	}
+	warning("STUB: Logger::log_score()");
 
-	} // End of namespace Logger
+	/*for (fv = 1; fv <= 50; fv ++) output << logfile << ' ';
+	output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
+}
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h
index a1b7882..bd54823 100644
--- a/engines/avalanche/logger2.h
+++ b/engines/avalanche/logger2.h
@@ -25,14 +25,21 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* LOGGER	Handles the logging. */
+
 #ifndef LOGGER2_H
 #define LOGGER2_H
 
-#include "common/system.h"
+#include "common/scummsys.h"
+#include "common/str.h"
+
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Logger {
+class Logger {
+public:
+	void setParent(AvalancheEngine *vm);
 
 	void log_setup(Common::String name, bool printing);
 
@@ -62,7 +69,24 @@ namespace Avalanche {
 
 	void log_score(uint16 credit, uint16 now);
 
-	} // End of namespace Logger
+private:
+	AvalancheEngine *_vm;
+
+	static const char divide[];
+
+	static const Common::String quote;
+	static const Common::String unquote;
+	static const Common::String copyright;
+	static const int16 divide_indent;
+
+	Common::String scroll_line;
+	byte scroll_line_length;
+
+	void centre(byte size, byte x);
+
+	void log_addstuff(Common::String x);
+
+};
 
 } // End of namespace Avalanche
 


Commit: 7c43ab471fb051ecd6c3e77d37419f2d9304fcfe
    https://github.com/scummvm/scummvm/commit/7c43ab471fb051ecd6c3e77d37419f2d9304fcfe
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T09:29:59-07:00

Commit Message:
AVALANCHE: Lucerna: replace namespace with class.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 88db23e..3c1d59c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -25,6 +25,10 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* LUCERNA		The screen, [keyboard] and mouse handler.*/
+
+#include "avalanche/avalanche.h"
+
 #include "common/system.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
@@ -32,50 +36,43 @@
 #include "avalanche/logger2.h"
 #include "avalanche/enhanced2.h"
 
-//#include "Graph.h"
-///*#include "Dos.h"*/
-///*#include "Crt.h"*/
-//#include "trip5.h"
-//#include "Acci.h"
-//#include "pingo.h"
-//#include "dropdown.h"
-//#include "visa.h"
-//#include "celer.h"
-//#include "timeout.h"
-//#include "basher.h"
-//#include "sequence.h"
 
-namespace Avalanche {
+#include "avalanche/visa2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/enid2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/acci2.h"
 
-	namespace Lucerna {
 
-	bool fxhidden;
+//#include "dropdown.h"
+//#include "basher.h"
 
-	struct rgbrec {
-		int16 red;
-		int16 green;
-		int16 blue;
-	};
 
-	struct palettetype {
-		int32 size;
-		rgbrec colors[256];
-	};
+namespace Avalanche {
+
+Lucerna::Lucerna() {
+	// Will be needed.
+}
 
-	palettetype fxpal[4];
+void Lucerna::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+	
+void Lucerna::callverb(char n) {
+	/*if (n == pardon)
+	Scrolls::display(
+	"The f5 key lets you do a particular action in certain "
+	"situations. However, at the moment there is nothing "
+	"assigned to it. You may press alt-A to see what the "
+	"current setting of this key is.");*/
 
-	void callverb(char n) {
-		/*if (n == pardon)
-		Scrolls::display(
-		"The f5 key lets you do a particular action in certain "
-		"situations. However, at the moment there is nothing "
-		"assigned to it. You may press alt-A to see what the "
-		"current setting of this key is.");*/
+	// Needs const char pardon located in Acci.
 
-		// Needs const char pardon located in Acci.
+}
 
-	}
 
-	} // End of namespace Lucerna
 
-} // End of namespace Avalanche
\ No newline at end of file
+} // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index bee9c10..259b639 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -25,18 +25,23 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* LUCERNA		The screen, [keyboard] and mouse handler.*/
+
 #ifndef LUCERNA2_H
 #define LUCERNA2_H
 
 #include "common/scummsys.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Lucerna {
-
+class Lucerna {
+public:
 	// Call it where Lucerna is first used.
 	// Procuded to replace the initizalization part of the original Pascal unit.
-	void initialize_lucerna();
+	Lucerna();
+
+	void setParent(AvalancheEngine *vm);
 
 	void callverb(char n);
 
@@ -106,7 +111,24 @@ namespace Avalanche {
 
 	void fix_flashers();
 
-	} // End of namespace Lucerna
+private:
+	AvalancheEngine *_vm;
+
+	bool fxhidden;
+
+	struct rgbrec {
+		int16 red;
+		int16 green;
+		int16 blue;
+	};
+
+	struct palettetype {
+		int32 size;
+		rgbrec colors[256];
+	};
+
+	palettetype fxpal[4];
+};
 
 } // End of namespace Avalanche
 


Commit: e28d3263dc39f54d2bbadc026f4bf7989b7a3701
    https://github.com/scummvm/scummvm/commit/e28d3263dc39f54d2bbadc026f4bf7989b7a3701
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T09:41:04-07:00

Commit Message:
AVALANCHE: Sequence: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c682171..7465ac6 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -55,6 +55,7 @@ namespace Avalanche {
 		_visa.setParent(this);
 		_lucerna.setParent(this);
 		_enid.setParent(this);
+		_celer.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 643b97c..6a3187c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -37,6 +37,7 @@
 #include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/enid2.h"
+#include "avalanche/celer2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -61,6 +62,7 @@ public:
 	Visa _visa;
 	Lucerna _lucerna;
 	Enid _enid;
+	Celer _celer;
 
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 851dcb1..79c3e04 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -27,6 +27,8 @@
 
 /* SEQUENCE		The sequencer. */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/sequence2.h"
 #include "common/scummsys.h"
 #include "avalanche/gyro2.h"
@@ -36,74 +38,74 @@
 
 namespace Avalanche {
 
-	namespace Sequence {
-
-	void then_show(byte what) {
-		byte fv;
-		for (fv = 1; fv <= seq_length; fv ++)
-			if (seq[fv] == 0) {
-				seq[fv] = what;
-				return;
-			}
-	}
-
-	void first_show(byte what) {
-		/* First, we need to blank out the entire array. */
-		for (int i = 0; i < sizeof(seq); i++)
-			seq[i] = 0;
-
-		/* Then it's just the same as then_show. */
-		then_show(what);
-
-	}
-
-	void then_flip(byte where, byte ped) {
-		then_show(now_flip);
-
-		Gyro::dna.flip_to_where = where;
-		Gyro::dna.flip_to_ped = ped;
-	}
+void Sequence::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
 
-	void start_to_close() {
-		Timeout::lose_timer(Timeout::reason_sequencer);
-		Timeout::set_up_timer(7, Timeout::PROCsequence, Timeout::reason_sequencer);
-	}
+void Sequence::first_show(byte what) {
+	/* First, we need to blank out the entire array. */
+	for (int i = 0; i < sizeof(seq); i++)
+		seq[i] = 0;
 
-	void start_to_open() {
-		Gyro::dna.user_moves_avvy = false; /* They can't move. */
-		Trip::stopwalking(); /* And they're not moving now. */
-		start_to_close(); /* Apart from that, it's the same thing. */
-	}
+	/* Then it's just the same as then_show. */
+	then_show(what);
 
-	void call_sequencer();
-
-	/* This PROC is called by Timeout when it's time to do another frame. */
-	static void shove_left() {
-		memcpy(seq, seq+1, seq_length - 1); /* Shift everything to the left. */
-	}
+}
 
-	void call_sequencer() {
-		switch (seq[0]) {
-		case 0:
+void Sequence::then_show(byte what) {
+	byte fv;
+	for (fv = 1; fv <= seq_length; fv ++)
+		if (seq[fv] == 0) {
+			seq[fv] = what;
 			return;
-			break; /* No more routines. */
-		case 177: {
-			Gyro::dna.user_moves_avvy = true;
-			Trip::fliproom(Gyro::dna.flip_to_where, Gyro::dna.flip_to_ped); /* 177 = Flip room. */
-			if (seq[0] == 177)  shove_left();
-			}
-			break;
 		}
-
-		if ((seq[0] >= 1) && (seq[0] <= 176)) {
-			/* Show a frame. */
-			Celer::show_one(seq[1]);
-			shove_left();
+}
+
+void Sequence::then_flip(byte where, byte ped) {
+	then_show(now_flip);
+
+	_vm->_gyro.dna.flip_to_where = where;
+	_vm->_gyro.dna.flip_to_ped = ped;
+}
+
+void Sequence::start_to_close() {
+	Timeout::lose_timer(Timeout::reason_sequencer);
+	Timeout::set_up_timer(7, Timeout::procsequence, Timeout::reason_sequencer);
+}
+
+void Sequence::start_to_open() {
+	_vm->_gyro.dna.user_moves_avvy = false; /* They can't move. */
+	Trip::stopwalking(); /* And they're not moving now. */
+	start_to_close(); /* Apart from that, it's the same thing. */
+}
+
+
+
+/* This PROC is called by Timeout when it's time to do another frame. */
+void Sequence::shove_left() {
+	memcpy(seq, seq+1, seq_length - 1); /* Shift everything to the left. */
+}
+
+void Sequence::call_sequencer() {
+	switch (seq[0]) {
+	case 0:
+		return;
+		break; /* No more routines. */
+	case 177: {
+		_vm->_gyro.dna.user_moves_avvy = true;
+		Trip::fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */
+		if (seq[0] == 177)  shove_left();
 		}
-	
-		start_to_close(); /* Make sure this PROC gets called again. */
+		break;
 	}
 
-	} // End of namespace Sequence .
+	if ((seq[0] >= 1) && (seq[0] <= 176)) {
+		/* Show a frame. */
+		_vm->_celer.show_one(seq[1]);
+		shove_left();
+	}
+	
+	start_to_close(); /* Make sure this PROC gets called again. */
+}
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
index 0e53ccf..7bd79bc 100644
--- a/engines/avalanche/sequence2.h
+++ b/engines/avalanche/sequence2.h
@@ -33,32 +33,38 @@
 #include "common/scummsys.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Sequence {
+class Sequence {
+public:
+	static const int16 now_flip = 177;
 
-		const int16 now_flip = 177;
+	static const int16 seq_length = 10;
 
-		const int16 seq_length = 10;
 
 
+	byte seq[seq_length];
 
-		byte seq[seq_length];
 
+	void setParent(AvalancheEngine *vm);
 
+	void first_show(byte what);
 
-		void first_show(byte what);
+	void then_show(byte what);
 
-		void then_show(byte what);
+	void then_flip(byte where, byte ped);
 
-		void then_flip(byte where, byte ped);
+	void start_to_close();
 
-		void start_to_close();
+	void start_to_open();
 
-		void start_to_open();
+	void call_sequencer();
 
-		void call_sequencer();
+private:
+	AvalancheEngine *_vm;
 
-	} // End of namespace Sequence .
+	void shove_left();
+};
 
 } // End of namespace Avalanche.
 


Commit: adf4a357ce604baee75d45a99752f0931b5ef46d
    https://github.com/scummvm/scummvm/commit/adf4a357ce604baee75d45a99752f0931b5ef46d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-28T11:01:47-07:00

Commit Message:
AVALANCHE: Timeout: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7465ac6..d9a3729 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -56,6 +56,8 @@ namespace Avalanche {
 		_lucerna.setParent(this);
 		_enid.setParent(this);
 		_celer.setParent(this);
+		_sequence.setParent(this);
+		_timeout.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 6a3187c..8200a50 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -38,6 +38,8 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/timeout2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -63,7 +65,8 @@ public:
 	Lucerna _lucerna;
 	Enid _enid;
 	Celer _celer;
-
+	Sequence _sequence;
+	Timeout _timeout;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 6c0099b..a202aaf 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -33,6 +33,8 @@
 
 #include "avalanche/timeout2.h"
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
@@ -44,635 +46,626 @@
 
 namespace Avalanche {
 
-	namespace Timeout {
-
-	byte fv;
-
-	void set_up_timer(int32 howlong, byte whither, byte why) {
-		fv = 1;
-		while ((fv < 8) && (times[fv].time_left != 0))  fv += 1;
-		if (fv == 8)  return; /* Oh dear... */
-
-		{
-			timetype &with = times[fv];  /* Everything's OK here! */
-
-			with.time_left = howlong;
-			with.then_where = whither;
-			with.what_for = why;
-		}
-	}
-
-	void one_tick() {
-
-		if (Gyro::ddmnow)  return;
-
-		for (fv = 1; fv <= 7; fv ++) {
-			timetype &with = times[fv];
-			if (with.time_left > 0) {
-				with.time_left -= 1;
-
-				if (with.time_left == 0)
-					switch (with.then_where) {
-					case procopen_drawbridge :
-						open_drawbridge();
-						break;
-					case procavaricius_talks :
-						avaricius_talks();
-						break;
-					case procurinate :
-						urinate();
-						break;
-					case proctoilet2 :
-						toilet2();
-						break;
-					case procbang:
-						bang();
-						break;
-					case procbang2:
-						bang2();
-						break;
-					case procstairs:
-						stairs();
-						break;
-					case proccardiffsurvey:
-						cardiff_survey();
-						break;
-					case proccardiff_return:
-						cardiff_return();
-						break;
-					case proc_cwytalot_in_herts:
-						cwytalot_in_herts();
-						break;
-					case procget_tied_up:
-						get_tied_up();
-						break;
-					case procget_tied_up2:
-						get_tied_up2();
-						break;
-					case prochang_around:
-						hang_around();
-						break;
-					case prochang_around2:
-						hang_around2();
-						break;
-					case procafter_the_shootemup:
-						after_the_shootemup();
-						break;
-					case procjacques_wakes_up:
-						jacques_wakes_up();
-						break;
-					case procnaughty_duke:
-						naughty_duke();
-						break;
-					case procnaughty_duke2:
-						naughty_duke2();
-						break;
-					case procnaughty_duke3:
-						naughty_duke3();
-						break;
-					case procjump:
-						jump();
-						break;
-					case procsequence:
-						Sequence::call_sequencer();
-						break;
-					case proccrapulus_splud_out:
-						crapulus_says_splud_out();
-						break;
-					case procdawn_delay:
-						Lucerna::dawn();
-						break;
-					case procbuydrinks:
-						buydrinks();
-						break;
-					case procbuywine:
-						buywine();
-						break;
-					case proccallsguards:
-						callsguards();
-						break;
-					case procgreetsmonk:
-						greetsmonk();
-						break;
-					case procfall_down_oubliette:
-						fall_down_oubliette();
-						break;
-					case procmeet_avaroid:
-						meet_avaroid();
-						break;
-					case procrise_up_oubliette:
-						rise_up_oubliette();
-						break;
-					case procrobin_hood_and_geida:
-						robin_hood_and_geida();
-						break;
-					case procrobin_hood_and_geida_talk:
-						robin_hood_and_geida_talk();
-						break;
-					case procavalot_returns:
-						avalot_returns();
-						break;
-					case procavvy_sit_down:
-						avvy_sit_down();
-						break;
-					case procghost_room_phew:
-						ghost_room_phew();
-						break;
-					case procarkata_shouts:
-						arkata_shouts();
-						break;
-					case procwinning:
-						winning();
-						break;
-					case procavalot_falls:
-						avalot_falls();
-						break;
-					case procspludwick_goes_to_cauldron:
-						spludwick_goes_to_cauldron();
-						break;
-					case procspludwick_leaves_cauldron:
-						spludwick_leaves_cauldron();
-						break;
-					case procgive_lute_to_geida:
-						give_lute_to_geida();
-						break;
-					}
-			}
-		}
-		Gyro::roomtime += 1; /* Cycles since you've been in this room. */
-		Gyro::dna.total_time += 1; /* Total amount of time for this game. */
-	}
-
-	void lose_timer(byte which) {
-		byte fv;
-
-		for (fv = 1; fv <= 7; fv ++) {
-			timetype &with = times[fv];
-			if (with.what_for == which)
-				with.time_left = 0;
-		} /* Cancel this one! */
+Timeout::Timeout() {
+	for (int i = 0; i < sizeof(times); i++) {
+		times[i].time_left = 0;
+		times[i].then_where = 0;
+		times[i].what_for = 0;
 	}
+}
 
-	/*function timer_is_on(which:byte):boolean;
-	var fv:byte;
-	begin
-	 for fv:=1 to 7 do
-	  with times[fv] do
-	   if (what_for=which) and (time_left>0) then
-	   begin
-		timer_is_on:=true;
-		exit;
-	   end;
-	 timer_is_on:=false;
-	end;*/
-
-	/* Timeout procedures: */
-
-	void open_drawbridge() {
-		{
-			Gyro::dna.drawbridge_open ++;
-			Celer::show_one(Gyro::dna.drawbridge_open - 1);
-
-			if (Gyro::dna.drawbridge_open == 4)
-				Gyro::magics[2].op = Gyro::nix; /* You may enter the drawbridge. */
-			else set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
-		}
-	}
+void Timeout::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
 
-	/* --- */
+void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
+	fv = 1;
+	while ((fv < 8) && (times[fv].time_left != 0))  fv += 1;
+	if (fv == 8)  return; /* Oh dear... */
 
-	void avaricius_talks() {
-		{
-			Visa::dixi('q', Gyro::dna.avaricius_talk);
-			Gyro::dna.avaricius_talk ++;
-
-			if (Gyro::dna.avaricius_talk < 17)
-				set_up_timer(177, procavaricius_talks, reason_avariciustalks);
-			else Lucerna::points(3);
-
-		}
-	}
+	{
+		timetype &with = times[fv];  /* Everything's OK here! */
 
-	void urinate() {
-		Trip::tr[1].turn(Trip::up);
-		Trip::stopwalking();
-		Lucerna::showrw();
-		set_up_timer(14, proctoilet2, reason_gototoilet);
+		with.time_left = howlong;
+		with.then_where = whither;
+		with.what_for = why;
 	}
+}
 
-	void toilet2() {
-		Scrolls::display("That's better!");
-	}
+void Timeout::one_tick() {
+	if (_vm->_gyro.ddmnow)  return;
 
-	void bang() {
-		Scrolls::display("\6< BANG! >");
-		set_up_timer(30, procbang2, reason_explosion);
-	}
-
-	void bang2() {
-		Scrolls::display("Hmm... sounds like Spludwick's up to something...");
-	}
+	for (fv = 1; fv <= 7; fv ++) {
+		timetype &with = times[fv];
+		if (with.time_left > 0) {
+			with.time_left -= 1;
 
-	void stairs() {
-		Gyro::blip();
-		Trip::tr[0].walkto(4);
-		Celer::show_one(2);
-		Gyro::dna.brummie_stairs = 2;
-		Gyro::magics[11].op = Gyro::special;
-		Gyro::magics[11].data = 2; /* Reached the bottom of the stairs. */
-		Gyro::magics[4].op = Gyro::nix; /* Stop them hitting the sides (or the game will hang.) */
-	}
-
-	void cardiff_survey() {
-		{
-			switch (Gyro::dna.cardiff_things) {
-			case 0: {
-				Gyro::dna.cardiff_things += 1;
-				Visa::dixi('q', 27);
-			}
-			break;
-			}
-			Visa::dixi('z', Gyro::dna.cardiff_things);
+			if (with.time_left == 0)
+				switch (with.then_where) {
+				case procopen_drawbridge :
+					open_drawbridge();
+					break;
+				case procavaricius_talks :
+					avaricius_talks();
+					break;
+				case procurinate :
+					urinate();
+					break;
+				case proctoilet2 :
+					toilet2();
+					break;
+				case procbang:
+					bang();
+					break;
+				case procbang2:
+					bang2();
+					break;
+				case procstairs:
+					stairs();
+					break;
+				case proccardiffsurvey:
+					cardiff_survey();
+					break;
+				case proccardiff_return:
+					cardiff_return();
+					break;
+				case proc_cwytalot_in_herts:
+					cwytalot_in_herts();
+					break;
+				case procget_tied_up:
+					get_tied_up();
+					break;
+				case procget_tied_up2:
+					get_tied_up2();
+					break;
+				case prochang_around:
+					hang_around();
+					break;
+				case prochang_around2:
+					hang_around2();
+					break;
+				case procafter_the_shootemup:
+					after_the_shootemup();
+					break;
+				case procjacques_wakes_up:
+					jacques_wakes_up();
+					break;
+				case procnaughty_duke:
+					naughty_duke();
+					break;
+				case procnaughty_duke2:
+					naughty_duke2();
+					break;
+				case procnaughty_duke3:
+					naughty_duke3();
+					break;
+				case procjump:
+					jump();
+					break;
+				case procsequence:
+					_vm->_sequence.call_sequencer();
+					break;
+				case proccrapulus_splud_out:
+					crapulus_says_splud_out();
+					break;
+				case procdawn_delay:
+					_vm->_lucerna.dawn();
+					break;
+				case procbuydrinks:
+					buydrinks();
+					break;
+				case procbuywine:
+					buywine();
+					break;
+				case proccallsguards:
+					callsguards();
+					break;
+				case procgreetsmonk:
+					greetsmonk();
+					break;
+				case procfall_down_oubliette:
+					fall_down_oubliette();
+					break;
+				case procmeet_avaroid:
+					meet_avaroid();
+					break;
+				case procrise_up_oubliette:
+					rise_up_oubliette();
+					break;
+				case procrobin_hood_and_geida:
+					robin_hood_and_geida();
+					break;
+				case procrobin_hood_and_geida_talk:
+					robin_hood_and_geida_talk();
+					break;
+				case procavalot_returns:
+					avalot_returns();
+					break;
+				case procavvy_sit_down:
+					avvy_sit_down();
+					break;
+				case procghost_room_phew:
+					ghost_room_phew();
+					break;
+				case procarkata_shouts:
+					arkata_shouts();
+					break;
+				case procwinning:
+					winning();
+					break;
+				case procavalot_falls:
+					avalot_falls();
+					break;
+				case procspludwick_goes_to_cauldron:
+					spludwick_goes_to_cauldron();
+					break;
+				case procspludwick_leaves_cauldron:
+					spludwick_leaves_cauldron();
+					break;
+				case procgive_lute_to_geida:
+					give_lute_to_geida();
+					break;
+				}
 		}
-		Gyro::interrogation = Gyro::dna.cardiff_things;
-		set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
-	}
-
-	void cardiff_return() {
-		Visa::dixi('q', 28);
-		cardiff_survey(); /* add end of question. */
-	}
-
-	void cwytalot_in_herts() {
-		Visa::dixi('q', 29);
-	}
-
-	void get_tied_up() {
-		Visa::dixi('q', 34); /* ...Trouble! */
-		Gyro::dna.user_moves_avvy = false;
-		Gyro::dna.been_tied_up = true;
-		Trip::stopwalking();
-		Trip::tr[2].stopwalk();
-		Trip::tr[2].stophoming();
-		Trip::tr[2].call_eachstep = true;
-		Trip::tr[2].eachstep = Trip::procgrab_avvy;
-		set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 	}
+	_vm->_gyro.roomtime += 1; /* Cycles since you've been in this room. */
+	_vm->_gyro.dna.total_time += 1; /* Total amount of time for this game. */
+}
 
-	void get_tied_up2() {
-		Trip::tr[1].walkto(4);
-		Trip::tr[2].walkto(5);
-		Gyro::magics[4].op = Gyro::nix; /* No effect when you touch the boundaries. */
-		Gyro::dna.friar_will_tie_you_up = true;
-	}
-
-	void hang_around() {
-		Trip::tr[2].check_me = false;
-		Trip::tr[1].init(7, true); /* Robin Hood */
-		Gyro::whereis[Gyro::probinhood] = r__robins;
-		Trip::apped(1, 2);
-		Visa::dixi('q', 39);
-		Trip::tr[1].walkto(7);
-		set_up_timer(55, prochang_around2, reason_hanging_around);
-	}
-
-	void hang_around2() {
-		Visa::dixi('q', 40);
-		Trip::tr[2].vanishifstill = false;
-		Trip::tr[2].walkto(4);
-		Gyro::whereis[Gyro::pfriartuck] = r__robins;
-		Visa::dixi('q', 41);
-		Trip::tr[1].done();
-		Trip::tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+void Timeout::lose_timer(byte which) {
+	byte fv;
 
-		set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
-		/* Immediately call the following proc (when you have a chance). */
+	for (fv = 1; fv <= 7; fv ++) {
+		timetype &with = times[fv];
+		if (with.what_for == which)
+			with.time_left = 0;
+	} /* Cancel this one! */
+}
+
+/*function timer_is_on(which:byte):boolean;
+var fv:byte;
+begin
+	for fv:=1 to 7 do
+	with times[fv] do
+	if (what_for=which) and (time_left>0) then
+	begin
+	timer_is_on:=true;
+	exit;
+	end;
+	timer_is_on:=false;
+end;*/
 
-		Gyro::dna.tied_up = false;
+/* Timeout procedures: */
 
-		Enid::back_to_bootstrap(1); /* Call the shoot-'em-up. */
-	}
+void Timeout::open_drawbridge() {
+	{
+		_vm->_gyro.dna.drawbridge_open ++;
+		_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
 
-	void after_the_shootemup() {
-		warning("STUB: Timeout::after_the_shootemup()");
+		if (_vm->_gyro.dna.drawbridge_open == 4)
+			_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
+		else set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 	}
+}
 
-	void jacques_wakes_up() {
-		Gyro::dna.jacques_awake += 1;
+/* --- */
 
-		switch (Gyro::dna.jacques_awake) { /* Additional pictures. */
-		case 1 : {
-			Celer::show_one(1); /* Eyes open. */
-			Visa::dixi('Q', 45);
+void Timeout::avaricius_talks() {
+	{
+		_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
+		_vm->_gyro.dna.avaricius_talk ++;
+
+		if (_vm->_gyro.dna.avaricius_talk < 17)
+			set_up_timer(177, procavaricius_talks, reason_avariciustalks);
+		else _vm->_lucerna.points(3);
+
+	}
+}
+
+void Timeout::urinate() {
+	Trip::tr[1].turn(Trip::up);
+	Trip::stopwalking();
+	_vm->_lucerna.showrw();
+	set_up_timer(14, proctoilet2, reason_gototoilet);
+}
+
+void Timeout::toilet2() {
+	_vm->_scrolls.display("That's better!");
+}
+
+void Timeout::bang() {
+	_vm->_scrolls.display("\6< BANG! >");
+	set_up_timer(30, procbang2, reason_explosion);
+}
+
+void Timeout::bang2() {
+	_vm->_scrolls.display("Hmm... sounds like Spludwick's up to something...");
+}
+
+void Timeout::stairs() {
+	_vm->_gyro.blip();
+	Trip::tr[0].walkto(4);
+	_vm->_celer.show_one(2);
+	_vm->_gyro.dna.brummie_stairs = 2;
+	_vm->_gyro.magics[11].op = _vm->_gyro.special;
+	_vm->_gyro.magics[11].data = 2; /* Reached the bottom of the stairs. */
+	_vm->_gyro.magics[4].op = _vm->_gyro.nix; /* Stop them hitting the sides (or the game will hang.) */
+}
+
+void Timeout::cardiff_survey() {
+	{
+		switch (_vm->_gyro.dna.cardiff_things) {
+		case 0: {
+			_vm->_gyro.dna.cardiff_things += 1;
+			_vm->_visa.dixi('q', 27);
 		}
 		break;
-		case 2 : { /* Going through the door. */
-			Celer::show_one(2); /* Not on the floor. */
-			Celer::show_one(3); /* But going through the door. */
-			Gyro::magics[6].op = Gyro::nix; /* You can't wake him up now. */
 		}
+		_vm->_visa.dixi('z', _vm->_gyro.dna.cardiff_things);
+	}
+	_vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things;
+	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
+}
+
+void Timeout::cardiff_return() {
+	_vm->_visa.dixi('q', 28);
+	cardiff_survey(); /* add end of question. */
+}
+
+void Timeout::cwytalot_in_herts() {
+	_vm->_visa.dixi('q', 29);
+}
+
+void Timeout::get_tied_up() {
+	_vm->_visa.dixi('q', 34); /* ...Trouble! */
+	_vm->_gyro.dna.user_moves_avvy = false;
+	_vm->_gyro.dna.been_tied_up = true;
+	Trip::stopwalking();
+	Trip::tr[2].stopwalk();
+	Trip::tr[2].stophoming();
+	Trip::tr[2].call_eachstep = true;
+	Trip::tr[2].eachstep = Trip::procgrab_avvy;
+	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
+}
+
+void Timeout::get_tied_up2() {
+	Trip::tr[1].walkto(4);
+	Trip::tr[2].walkto(5);
+	_vm->_gyro.magics[4].op = _vm->_gyro.nix; /* No effect when you touch the boundaries. */
+	_vm->_gyro.dna.friar_will_tie_you_up = true;
+}
+
+void Timeout::hang_around() {
+	Trip::tr[2].check_me = false;
+	Trip::tr[1].init(7, true); /* Robin Hood */
+	_vm->_gyro.whereis[_vm->_gyro.probinhood] = r__robins;
+	Trip::apped(1, 2);
+	_vm->_visa.dixi('q', 39);
+	Trip::tr[1].walkto(7);
+	set_up_timer(55, prochang_around2, reason_hanging_around);
+}
+
+void Timeout::hang_around2() {
+	_vm->_visa.dixi('q', 40);
+	Trip::tr[2].vanishifstill = false;
+	Trip::tr[2].walkto(4);
+	_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = r__robins;
+	_vm->_visa.dixi('q', 41);
+	Trip::tr[1].done();
+	Trip::tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+
+	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
+	/* Immediately call the following proc (when you have a chance). */
+
+	_vm->_gyro.dna.tied_up = false;
+
+	_vm->_enid.back_to_bootstrap(1); /* Call the shoot-'em-up. */
+}
+
+void Timeout::after_the_shootemup() {
+	warning("STUB: Timeout::after_the_shootemup()");
+}
+
+void Timeout::jacques_wakes_up() {
+	_vm->_gyro.dna.jacques_awake += 1;
+
+	switch (_vm->_gyro.dna.jacques_awake) { /* Additional pictures. */
+	case 1 : {
+		_vm->_celer.show_one(1); /* Eyes open. */
+		_vm->_visa.dixi('Q', 45);
+	}
+	break;
+	case 2 : { /* Going through the door. */
+		_vm->_celer.show_one(2); /* Not on the floor. */
+		_vm->_celer.show_one(3); /* But going through the door. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* You can't wake him up now. */
+	}
+	break;
+	case 3 : { /* Gone through the door. */
+		_vm->_celer.show_one(2); /* Not on the floor, either. */
+		_vm->_celer.show_one(4); /* He's gone... so the door's open. */
+		_vm->_gyro.whereis[_vm->_gyro.pjacques] = 0; /* Gone! */
+	}
+	break;
+	}
+
+
+	if (_vm->_gyro.dna.jacques_awake == 5) {
+		_vm->_gyro.dna.ringing_bells = true;
+		_vm->_gyro.dna.ayles_is_awake = true;
+		_vm->_lucerna.points(2);
+	}
+
+	switch (_vm->_gyro.dna.jacques_awake) {
+	case 1:
+	case 2:
+	case 3:
+		set_up_timer(12, procjacques_wakes_up, reason_jacques_waking_up);
 		break;
-		case 3 : { /* Gone through the door. */
-			Celer::show_one(2); /* Not on the floor, either. */
-			Celer::show_one(4); /* He's gone... so the door's open. */
-			Gyro::whereis[Gyro::pjacques] = 0; /* Gone! */
-		}
+	case 4:
+		set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
 		break;
-		}
+	}
 
+}
 
-		if (Gyro::dna.jacques_awake == 5) {
-			Gyro::dna.ringing_bells = true;
-			Gyro::dna.ayles_is_awake = true;
-			Lucerna::points(2);
-		}
+void Timeout::naughty_duke()
+/* This is when the Duke comes in and takes your money. */
+{
+	Trip::tr[2].init(9, false); /* Here comes the Duke. */
+	Trip::apped(2, 1); /* He starts at the door... */
+	Trip::tr[2].walkto(3); /* He walks over to you. */
 
-		switch (Gyro::dna.jacques_awake) {
-		case 1:
-		case 2:
-		case 3:
-			set_up_timer(12, procjacques_wakes_up, reason_jacques_waking_up);
-			break;
-		case 4:
-			set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
-			break;
-		}
+	/* Let's get the door opening. */
+	_vm->_celer.show_one(1);
+	_vm->_sequence.first_show(2);
+	_vm->_sequence.start_to_close();
 
-	}
+	set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
+}
 
-	void naughty_duke()
-	/* This is when the Duke comes in and takes your money. */
-	{
-		Trip::tr[2].init(9, false); /* Here comes the Duke. */
-		Trip::apped(2, 1); /* He starts at the door... */
-		Trip::tr[2].walkto(3); /* He walks over to you. */
+void Timeout::naughty_duke2() {
+	_vm->_visa.dixi('q', 48); /* Ha ha, it worked again! */
+	Trip::tr[2].walkto(1); /* Walk to the door. */
+	Trip::tr[2].vanishifstill = true; /* Then go away! */
+	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
+}
 
-		/* Let's get the door opening. */
-		Celer::show_one(1);
-		Sequence::first_show(2);
-		Sequence::start_to_close();
+void Timeout::naughty_duke3() {
+	_vm->_celer.show_one(1);
+	_vm->_sequence.first_show(2);
+	_vm->_sequence.start_to_close();
+}
 
-		set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
-	}
-
-	void naughty_duke2() {
-		Visa::dixi('q', 48); /* Ha ha, it worked again! */
-		Trip::tr[2].walkto(1); /* Walk to the door. */
-		Trip::tr[2].vanishifstill = true; /* Then go away! */
-		set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
-	}
+void Timeout::jump() {
+	{
+		dnatype &with = _vm->_gyro.dna;
 
-	void naughty_duke3() {
-		Celer::show_one(1);
-		Sequence::first_show(2);
-		Sequence::start_to_close();
-	}
+		with.jumpstatus += 1;
 
-	void jump() {
 		{
-			Gyro::dnatype &with = Gyro::dna;
-
-			with.jumpstatus += 1;
-
-			{
-				Trip::triptype &with1 = Trip::tr[1];
-				switch (with.jumpstatus) {
-				case 1:
-				case 2:
-				case 3:
-				case 5:
-				case 7:
-				case 9:
-					with1.y -= 1;
-					break;
-				case 12:
-				case 13:
-				case 14:
-				case 16:
-				case 18:
-				case 19:
-					with1.y += 1;
-					break;
-				}
-			}
-
-			if (with.jumpstatus == 20) {
-				/* End of jump. */
-				Gyro::dna.user_moves_avvy = true;
-				Gyro::dna.jumpstatus = 0;
-			} else {
-				/* Still jumping. */
-				set_up_timer(1, procjump, reason_jumping);
-			}
-
-			if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
-					&& (Gyro::dna.room == r__insidecardiffcastle)
-					&& (Gyro::dna.arrow_in_the_door == true)
-					&& (Trip::infield(3))) { /* beside the wall*/
-				/* Grab the arrow! */
-				if (Gyro::dna.carrying >= Gyro::maxobjs)
-					Scrolls::display("You fail to grab it, because your hands are full.");
-				else {
-					Celer::show_one(2);
-					Gyro::dna.arrow_in_the_door = false; /* You've got it. */
-					Gyro::dna.obj[Gyro::bolt] = true;
-					Lucerna::objectlist();
-					Visa::dixi('q', 50);
-					Lucerna::points(3);
-				}
+			Trip::triptype &with1 = Trip::tr[1];
+			switch (with.jumpstatus) {
+			case 1:
+			case 2:
+			case 3:
+			case 5:
+			case 7:
+			case 9:
+				with1.y -= 1;
+				break;
+			case 12:
+			case 13:
+			case 14:
+			case 16:
+			case 18:
+			case 19:
+				with1.y += 1;
+				break;
 			}
 		}
-	}
-
-	void crapulus_says_splud_out() {
-		Visa::dixi('q', 56);
-		Gyro::dna.crapulus_will_tell = false;
-	}
-
-	void buydrinks() {
-		Celer::show_one(11); /* Malagauche gets up again. */
-		Gyro::dna.malagauche = 0;
-
-		Visa::dixi('D', Gyro::dna.drinking); /* Scrolls::display message about it. */
-		Pingo::wobble(); /* Do the special effects. */
-		Visa::dixi('D', 1); /* That'll be thruppence. */
-		if (Gyro::pennycheck(3)) /* Pay 3d. */
-			Visa::dixi('D', 3); /* Tell 'em you paid up. */
-		Acci::have_a_drink();
-	}
 
-	void buywine() {
-		Celer::show_one(11); /* Malagauche gets up again. */
-		Gyro::dna.malagauche = 0;
-
-		Visa::dixi('D', 50); /* You buy the wine. */
-		Visa::dixi('D', 1); /* It'll be thruppence. */
-		if (Gyro::pennycheck(3)) {
-			Visa::dixi('D', 4); /* You paid up. */
-			Gyro::dna.obj[Gyro::wine] = true;
-			Lucerna::objectlist();
-			Gyro::dna.winestate = 1; /* OK Wine */
+		if (with.jumpstatus == 20) {
+			/* End of jump. */
+			_vm->_gyro.dna.user_moves_avvy = true;
+			_vm->_gyro.dna.jumpstatus = 0;
+		} else {
+			/* Still jumping. */
+			set_up_timer(1, procjump, reason_jumping);
 		}
-	}
-
-	void callsguards() {
-		Visa::dixi('Q', 58); /* GUARDS!!! */
-		Lucerna::gameover();
-	}
 
-	void greetsmonk() {
-		Visa::dixi('Q', 59);
-		Gyro::dna.entered_lusties_room_as_monk = true;
-	}
-
-	void fall_down_oubliette() {
-		Gyro::magics[9].op = Gyro::nix;
-		Trip::tr[1].iy += 1; /* increments dx/dy! */
-		Trip::tr[1].y += Trip::tr[1].iy;   /* Dowwwn we go... */
-		set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
-	}
-
-	void meet_avaroid() {
-		if (Gyro::dna.met_avaroid) {
-			Scrolls::display("You can't expect to be \6that\22 lucky twice in a row!");
-			Lucerna::gameover();
-		} else {
-			Visa::dixi('Q', 60);
-			Gyro::dna.met_avaroid = true;
-			set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
-			{
-				Trip::triptype &with = Trip::tr[1];
-				with.face = Trip::left;
-				with.x = 151;
-				with.ix = -3;
-				with.iy = -5;
+		if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
+				&& (_vm->_gyro.dna.room == r__insidecardiffcastle)
+				&& (_vm->_gyro.dna.arrow_in_the_door == true)
+				&& (Trip::infield(3))) { /* beside the wall*/
+			/* Grab the arrow! */
+			if (_vm->_gyro.dna.carrying >= maxobjs)
+				_vm->_scrolls.display("You fail to grab it, because your hands are full.");
+			else {
+				_vm->_celer.show_one(2);
+				_vm->_gyro.dna.arrow_in_the_door = false; /* You've got it. */
+				_vm->_gyro.dna.obj[_vm->_gyro.bolt] = true;
+				_vm->_lucerna.objectlist();
+				_vm->_visa.dixi('q', 50);
+				_vm->_lucerna.points(3);
 			}
-			Gyro::background(2);
 		}
 	}
-
-	void rise_up_oubliette() {
+}
+
+void Timeout::crapulus_says_splud_out() {
+	_vm->_visa.dixi('q', 56);
+	_vm->_gyro.dna.crapulus_will_tell = false;
+}
+
+void Timeout::buydrinks() {
+	_vm->_celer.show_one(11); /* Malagauche gets up again. */
+	_vm->_gyro.dna.malagauche = 0;
+
+	_vm->_visa.dixi('D', _vm->_gyro.dna.drinking); /* _vm->_scrolls.display message about it. */
+	_vm->_pingo.wobble(); /* Do the special effects. */
+	_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
+	if (_vm->_gyro.pennycheck(3)) /* Pay 3d. */
+		_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
+	Acci::have_a_drink();
+}
+
+void Timeout::buywine() {
+	_vm->_celer.show_one(11); /* Malagauche gets up again. */
+	_vm->_gyro.dna.malagauche = 0;
+
+	_vm->_visa.dixi('D', 50); /* You buy the wine. */
+	_vm->_visa.dixi('D', 1); /* It'll be thruppence. */
+	if (_vm->_gyro.pennycheck(3)) {
+		_vm->_visa.dixi('D', 4); /* You paid up. */
+		_vm->_gyro.dna.obj[_vm->_gyro.wine] = true;
+		_vm->_lucerna.objectlist();
+		_vm->_gyro.dna.winestate = 1; /* OK Wine */
+	}
+}
+
+void Timeout::callsguards() {
+	_vm->_visa.dixi('Q', 58); /* GUARDS!!! */
+	_vm->_lucerna.gameover();
+}
+
+void Timeout::greetsmonk() {
+	_vm->_visa.dixi('Q', 59);
+	_vm->_gyro.dna.entered_lusties_room_as_monk = true;
+}
+
+void Timeout::fall_down_oubliette() {
+	_vm->_gyro.magics[9].op = _vm->_gyro.nix;
+	Trip::tr[1].iy += 1; /* increments dx/dy! */
+	Trip::tr[1].y += Trip::tr[1].iy;   /* Dowwwn we go... */
+	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
+}
+
+void Timeout::meet_avaroid() {
+	if (_vm->_gyro.dna.met_avaroid) {
+		_vm->_scrolls.display("You can't expect to be \6that\22 lucky twice in a row!");
+		_vm->_lucerna.gameover();
+	} else {
+		_vm->_visa.dixi('Q', 60);
+		_vm->_gyro.dna.met_avaroid = true;
+		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 		{
 			Trip::triptype &with = Trip::tr[1];
-
-			with.visible = true;
-			with.iy += 1; /* decrements dx/dy! */
-			with.y -= with.iy; /* Uuuupppp we go... */
-			if (with.iy > 0)
-				set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
-			else
-				Gyro::dna.user_moves_avvy = true;
+			with.face = Trip::left;
+			with.x = 151;
+			with.ix = -3;
+			with.iy = -5;
 		}
+		_vm->_gyro.background(2);
 	}
+}
 
-	void robin_hood_and_geida() {
-		Trip::tr[1].init(7, true);
-		Trip::apped(1, 7);
-		Trip::tr[1].walkto(6);
-		Trip::tr[2].stopwalk();
-		Trip::tr[2].face = Trip::left;
-		set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
-		Gyro::dna.geida_follows = false;
-	}
-
-	void robin_hood_and_geida_talk() {
-		Visa::dixi('q', 66);
-		Trip::tr[1].walkto(2);
-		Trip::tr[2].walkto(2);
-		Trip::tr[1].vanishifstill = true;
-		Trip::tr[2].vanishifstill = true;
-		set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
-	}
-
-	void avalot_returns() {
-		Trip::tr[1].done();
-		Trip::tr[2].done();
-		Trip::tr[1].init(0, true);
-		Trip::apped(1, 1);
-		Visa::dixi('q', 67);
-		Gyro::dna.user_moves_avvy = true;
-	}
-
-	void avvy_sit_down()
-	/* This is used when you sit down in the pub in Notts. It loops around so
-	  that it will happen when Avvy stops walking. */
+void Timeout::rise_up_oubliette() {
 	{
-		if (Trip::tr[1].homing)    /* Still walking */
-			set_up_timer(1, procavvy_sit_down, reason_sitting_down);
-		else {
-			Celer::show_one(3);
-			Gyro::dna.sitting_in_pub = true;
-			Gyro::dna.user_moves_avvy = false;
-			Trip::tr[1].visible = false;
-		}
-	}
+		Trip::triptype &with = Trip::tr[1];
 
-	void ghost_room_phew() {
-		Scrolls::display("\6PHEW!\22 You're glad to get out of \6there!");
-	}
-
-	void arkata_shouts() {
-		if (Gyro::dna.teetotal)  return;
-		Visa::dixi('q', 76);
-		set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
-	}
-
-	void winning() {
-		Visa::dixi('q', 79);
-		Pingo::winning_pic();
-		do {
-			Lucerna::checkclick();
-		} while (!(Gyro::mrelease == 0));
-		Lucerna::callverb(Acci::vb_score);
-		Scrolls::display(" T H E    E N D ");
-		Gyro::lmo = true;
-	}
-
-	void avalot_falls() {
-		if (Trip::tr[1].step < 5) {
-			Trip::tr[1].step += 1;
-			set_up_timer(3, procavalot_falls, reason_falling_over);
-		} else
-			Scrolls::display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
-	}
-
-	void spludwick_goes_to_cauldron() {
-		if (Trip::tr[2].homing)
-			set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
+		with.visible = true;
+		with.iy += 1; /* decrements dx/dy! */
+		with.y -= with.iy; /* Uuuupppp we go... */
+		if (with.iy > 0)
+			set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 		else
-			set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
-	}
-
-	void spludwick_leaves_cauldron() {
-		Trip::tr[2].call_eachstep = true; /* So that normal procs will continue. */
-	}
-
-	void give_lute_to_geida() {   /* Moved here from Acci. */
-		Visa::dixi('Q', 86);
-		Lucerna::points(4);
-		Gyro::dna.lustie_is_asleep = true;
-		Sequence::first_show(5);
-		Sequence::then_show(6); /* He falls asleep... */
-		Sequence::start_to_close(); /* Not really closing, but we're using the same procedure. */
-	}
-
-	/* "This is all!" */
-
-	class unit_timeout_initialize {
-	public:
-		unit_timeout_initialize();
-	};
-	static unit_timeout_initialize timeout_constructor;
-
-	unit_timeout_initialize::unit_timeout_initialize() {
-		for (int i = 0; i < sizeof(times); i++) {
-			times[i].time_left = 0;
-			times[i].then_where = 0;
-			times[i].what_for = 0;
-		}
-	}
-
+			_vm->_gyro.dna.user_moves_avvy = true;
+	}
+}
+
+void Timeout::robin_hood_and_geida() {
+	Trip::tr[1].init(7, true);
+	Trip::apped(1, 7);
+	Trip::tr[1].walkto(6);
+	Trip::tr[2].stopwalk();
+	Trip::tr[2].face = Trip::left;
+	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
+	_vm->_gyro.dna.geida_follows = false;
+}
+
+void Timeout::robin_hood_and_geida_talk() {
+	_vm->_visa.dixi('q', 66);
+	Trip::tr[1].walkto(2);
+	Trip::tr[2].walkto(2);
+	Trip::tr[1].vanishifstill = true;
+	Trip::tr[2].vanishifstill = true;
+	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
+}
+
+void Timeout::avalot_returns() {
+	Trip::tr[1].done();
+	Trip::tr[2].done();
+	Trip::tr[1].init(0, true);
+	Trip::apped(1, 1);
+	_vm->_visa.dixi('q', 67);
+	_vm->_gyro.dna.user_moves_avvy = true;
+}
+
+void Timeout::avvy_sit_down()
+/* This is used when you sit down in the pub in Notts. It loops around so
+	that it will happen when Avvy stops walking. */
+{
+	if (Trip::tr[1].homing)    /* Still walking */
+		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
+	else {
+		_vm->_celer.show_one(3);
+		_vm->_gyro.dna.sitting_in_pub = true;
+		_vm->_gyro.dna.user_moves_avvy = false;
+		Trip::tr[1].visible = false;
+	}
+}
+
+void Timeout::ghost_room_phew() {
+	_vm->_scrolls.display("\6PHEW!\22 You're glad to get out of \6there!");
+}
+
+void Timeout::arkata_shouts() {
+	if (_vm->_gyro.dna.teetotal)  return;
+	_vm->_visa.dixi('q', 76);
+	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
+}
+
+void Timeout::winning() {
+	_vm->_visa.dixi('q', 79);
+	_vm->_pingo.winning_pic();
+	do {
+		_vm->_lucerna.checkclick();
+	} while (!(_vm->_gyro.mrelease == 0));
+	_vm->_lucerna.callverb(Acci::vb_score);
+	_vm->_scrolls.display(" T H E    E N D ");
+	_vm->_gyro.lmo = true;
+}
+
+void Timeout::avalot_falls() {
+	if (Trip::tr[1].step < 5) {
+		Trip::tr[1].step += 1;
+		set_up_timer(3, procavalot_falls, reason_falling_over);
+	} else
+		_vm->_scrolls.display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+}
+
+void Timeout::spludwick_goes_to_cauldron() {
+	if (Trip::tr[2].homing)
+		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
+	else
+		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
+}
+
+void Timeout::spludwick_leaves_cauldron() {
+	Trip::tr[2].call_eachstep = true; /* So that normal procs will continue. */
+}
+
+void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */
+	_vm->_visa.dixi('Q', 86);
+	_vm->_lucerna.points(4);
+	_vm->_gyro.dna.lustie_is_asleep = true;
+	_vm->_sequence.first_show(5);
+	_vm->_sequence.then_show(6); /* He falls asleep... */
+	_vm->_sequence.start_to_close(); /* Not really closing, but we're using the same procedure. */
+}
+
+/* "This is all!" */
 
-	} // End of namespace Timeout.
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 5130c92..f7e984e 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -36,123 +36,124 @@
 #include "avalanche/celer2.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
-	namespace Timeout {
-
+class Timeout {
+public:
 	/* reason_ now runs between 1 and 28. */
 
-	const int16 reason_drawbridgefalls = 2;
-	const int16 reason_avariciustalks = 3;
-	const int16 reason_gototoilet = 4;
-	const int16 reason_explosion = 5;
-	const int16 reason_brummiestairs = 6;
-	const int16 reason_cardiffsurvey = 7;
-	const int16 reason_cwytalot_in_herts = 8;
-	const int16 reason_getting_tied_up = 9;
-	const int16 reason_hanging_around = 10; /* Tied to the tree in Nottingham. */
-	const int16 reason_jacques_waking_up = 11;
-	const int16 reason_naughty_duke = 12;
-	const int16 reason_jumping = 13;
-	const int16 reason_sequencer = 14;
-	const int16 reason_crapulus_says_spludwick_out = 15;
-	const int16 reason_dawndelay = 16;
-	const int16 reason_drinks = 17;
-	const int16 reason_du_lustie_talks = 18;
-	const int16 reason_falling_down_oubliette = 19;
-	const int16 reason_meeting_avaroid = 20;
-	const int16 reason_rising_up_oubliette = 21;
-	const int16 reason_robin_hood_and_geida = 22;
-	const int16 reason_sitting_down = 23;
-	const int16 reason_ghost_room_phew = 1;
-	const int16 reason_arkata_shouts = 24;
-	const int16 reason_winning = 25;
-	const int16 reason_falling_over = 26;
-	const int16 reason_spludwalk = 27;
-	const int16 reason_geida_sings = 28;
+	static const int16 reason_drawbridgefalls = 2;
+	static const int16 reason_avariciustalks = 3;
+	static const int16 reason_gototoilet = 4;
+	static const int16 reason_explosion = 5;
+	static const int16 reason_brummiestairs = 6;
+	static const int16 reason_cardiffsurvey = 7;
+	static const int16 reason_cwytalot_in_herts = 8;
+	static const int16 reason_getting_tied_up = 9;
+	static const int16 reason_hanging_around = 10; /* Tied to the tree in Nottingham. */
+	static const int16 reason_jacques_waking_up = 11;
+	static const int16 reason_naughty_duke = 12;
+	static const int16 reason_jumping = 13;
+	static const int16 reason_sequencer = 14;
+	static const int16 reason_crapulus_says_spludwick_out = 15;
+	static const int16 reason_dawndelay = 16;
+	static const int16 reason_drinks = 17;
+	static const int16 reason_du_lustie_talks = 18;
+	static const int16 reason_falling_down_oubliette = 19;
+	static const int16 reason_meeting_avaroid = 20;
+	static const int16 reason_rising_up_oubliette = 21;
+	static const int16 reason_robin_hood_and_geida = 22;
+	static const int16 reason_sitting_down = 23;
+	static const int16 reason_ghost_room_phew = 1;
+	static const int16 reason_arkata_shouts = 24;
+	static const int16 reason_winning = 25;
+	static const int16 reason_falling_over = 26;
+	static const int16 reason_spludwalk = 27;
+	static const int16 reason_geida_sings = 28;
 
 	/* procx now runs between 1 and 41. */
 
-	const int16 procopen_drawbridge = 3;
+	static const int16 procopen_drawbridge = 3;
 
-	const int16 procavaricius_talks = 4;
+	static const int16 procavaricius_talks = 4;
 
-	const int16 procurinate = 5;
+	static const int16 procurinate = 5;
 
-	const int16 proctoilet2 = 6;
+	static const int16 proctoilet2 = 6;
 
-	const int16 procbang = 7;
+	static const int16 procbang = 7;
 
-	const int16 procbang2 = 8;
+	static const int16 procbang2 = 8;
 
-	const int16 procstairs = 9;
+	static const int16 procstairs = 9;
 
-	const int16 proccardiffsurvey = 10;
+	static const int16 proccardiffsurvey = 10;
 
-	const int16 proccardiff_return = 11;
+	static const int16 proccardiff_return = 11;
 
-	const int16 proc_cwytalot_in_herts = 12;
+	static const int16 proc_cwytalot_in_herts = 12;
 
-	const int16 procget_tied_up = 13;
+	static const int16 procget_tied_up = 13;
 
-	const int16 procget_tied_up2 = 1;
+	static const int16 procget_tied_up2 = 1;
 
-	const int16 prochang_around = 14;
+	static const int16 prochang_around = 14;
 
-	const int16 prochang_around2 = 15;
+	static const int16 prochang_around2 = 15;
 
-	const int16 procafter_the_shootemup = 32;
+	static const int16 procafter_the_shootemup = 32;
 
-	const int16 procjacques_wakes_up = 16;
+	static const int16 procjacques_wakes_up = 16;
 
-	const int16 procnaughty_duke = 17;
+	static const int16 procnaughty_duke = 17;
 
-	const int16 procnaughty_duke2 = 18;
+	static const int16 procnaughty_duke2 = 18;
 
-	const int16 procnaughty_duke3 = 38;
+	static const int16 procnaughty_duke3 = 38;
 
-	const int16 procjump = 19;
+	static const int16 procjump = 19;
 
-	const int16 procsequence = 20;
+	static const int16 procsequence = 20;
 
-	const int16 proccrapulus_splud_out = 21;
+	static const int16 proccrapulus_splud_out = 21;
 
-	const int16 procdawn_delay = 22;
+	static const int16 procdawn_delay = 22;
 
-	const int16 procbuydrinks = 23;
+	static const int16 procbuydrinks = 23;
 
-	const int16 procbuywine = 24;
+	static const int16 procbuywine = 24;
 
-	const int16 proccallsguards = 25;
+	static const int16 proccallsguards = 25;
 
-	const int16 procgreetsmonk = 26;
+	static const int16 procgreetsmonk = 26;
 
-	const int16 procfall_down_oubliette = 27;
+	static const int16 procfall_down_oubliette = 27;
 
-	const int16 procmeet_avaroid = 28;
+	static const int16 procmeet_avaroid = 28;
 
-	const int16 procrise_up_oubliette = 29;
+	static const int16 procrise_up_oubliette = 29;
 
-	const int16 procrobin_hood_and_geida = 2;
+	static const int16 procrobin_hood_and_geida = 2;
 
-	const int16 procrobin_hood_and_geida_talk = 30;
+	static const int16 procrobin_hood_and_geida_talk = 30;
 
-	const int16 procavalot_returns = 31;
+	static const int16 procavalot_returns = 31;
 
-	const int16 procavvy_sit_down = 33; /* In Nottingham. */
+	static const int16 procavvy_sit_down = 33; /* In Nottingham. */
 
-	const int16 procghost_room_phew = 34;
+	static const int16 procghost_room_phew = 34;
 
-	const int16 procarkata_shouts = 35;
+	static const int16 procarkata_shouts = 35;
 
-	const int16 procwinning = 36;
+	static const int16 procwinning = 36;
 
-	const int16 procavalot_falls = 37;
+	static const int16 procavalot_falls = 37;
 
-	const int16 procspludwick_goes_to_cauldron = 39;
+	static const int16 procspludwick_goes_to_cauldron = 39;
 
-	const int16 procspludwick_leaves_cauldron = 40;
+	static const int16 procspludwick_leaves_cauldron = 40;
 
-	const int16 procgive_lute_to_geida = 41;
+	static const int16 procgive_lute_to_geida = 41;
 
 	struct timetype {
 		int32 time_left;
@@ -160,9 +161,15 @@ namespace Avalanche {
 		byte what_for;
 	};
 
-	timetype times[7] = {{0,0,0}};
 
 
+	timetype times[7];
+	
+
+	
+	Timeout();
+
+	void setParent(AvalancheEngine *vm);
 
 	void set_up_timer(int32 howlong, byte whither, byte why);
 
@@ -252,7 +259,11 @@ namespace Avalanche {
 
 	void give_lute_to_geida();
 
-	} // End of namespace Timeout.
+private:
+	AvalancheEngine *_vm;
+
+	byte fv;
+};
 
 } // End of namespace Avalanche.
 


Commit: c9baa8f456813222f386614d56d6bda95e7719e4
    https://github.com/scummvm/scummvm/commit/c9baa8f456813222f386614d56d6bda95e7719e4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T01:13:02-07:00

Commit Message:
AVALANCHE: Trip: replace namespace with class.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d9a3729..f8dee8e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -58,6 +58,7 @@ namespace Avalanche {
 		_celer.setParent(this);
 		_sequence.setParent(this);
 		_timeout.setParent(this);
+		_trip.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 8200a50..4252301 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -40,6 +40,7 @@
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
 #include "avalanche/timeout2.h"
+#include "avalanche/trip6.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -67,6 +68,7 @@ public:
 	Celer _celer;
 	Sequence _sequence;
 	Timeout _timeout;
+	Trip _trip;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ac0e8d0..f0d2abc 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -31,6 +31,8 @@
 #include "common/scummsys.h"
 #include "common/textconsole.h"
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/visa2.h"
@@ -45,1447 +47,1458 @@
 
 namespace Avalanche {
 
-	namespace Trip {
-
-	void loadtrip() {
-		byte gm;
-
-		for (gm = 1; gm <= numtr; gm ++) tr[gm].original();
-		for (int i = 0; i < sizeof(aa); aa[i] = 0);
+	
+triptype *triptype::init(byte spritenum, bool do_check, Trip *tr) {
+	warning("STUB: Trip::init()");	
+	_tr = tr;
+	return this;
+}
+
+void triptype::original() {
+	quick = false;
+	whichsprite = 177;
+}
+
+void triptype::andexor() {
+	warning("STUB: Trip::andexor()");
+}
+
+void triptype::turn(byte whichway) {
+	if (whichway == 8)  face = 0;
+	else face = whichway;
+}
+
+void triptype::appear(int16 wx, int16 wy, byte wf) {
+	x = (wx / 8) * 8;
+	y = wy;
+	ox[_tr->_vm->_gyro.cp] = wx;
+	oy[_tr->_vm->_gyro.cp] = wy;
+	turn(wf);
+	visible = true;
+	ix = 0;
+	iy = 0;
+}
+
+bool triptype::collision_check() {
+	byte fv;
+
+	bool collision_check_result;
+	for (fv = 1; fv <= _tr->numtr; fv ++)
+		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
+			((x + a.xl) > _tr->tr[fv].x) &&
+			(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
+			(_tr->tr[fv].y == y)) {
+				collision_check_result = true;
+				return collision_check_result;
+		}
+		collision_check_result = false;
+		return collision_check_result;
+}
+
+void triptype::walk() {
+	warning("STUB: Trip::walk()");
+}
+
+void triptype::bounce() {
+	x = ox[_tr->_vm->_gyro.cp];
+	y = oy[_tr->_vm->_gyro.cp];
+	if (check_me)  _tr->stopwalking();
+	else stopwalk();
+	_tr->_vm->_gyro.oncandopageswap = false;
+	_tr->_vm->_lucerna.showrw();
+	_tr->_vm->_gyro.oncandopageswap = true;
+}
+
+int8 triptype::sgn(int16 x) {
+	int8 sgn_result;
+	if (x > 0)  sgn_result = 1;
+	else if (x < 0)  sgn_result = -1;
+	else
+		sgn_result = 0; /* x=0 */
+	return sgn_result;
+}
+
+void triptype::walkto(byte pednum) {
+	speed(sgn(_tr->_vm->_gyro.peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro.peds[pednum].y - y));
+	hx = _tr->_vm->_gyro.peds[pednum].x - a.xl / 2;
+	hy = _tr->_vm->_gyro.peds[pednum].y - a.yl;
+	homing = true;
+}
+
+void triptype::stophoming() {
+	homing = false;
+}
+
+void triptype::homestep() {
+	int16 temp;
+
+	if ((hx == x) && (hy == y)) {
+		/* touching the target */
+		stopwalk();
+		return;
 	}
-
-	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-		byte a, c;
-		int16 fv, ff;
-
-		/* if not alive then begin checkfeet:=0; exit; end;*/
-		byte checkfeet_result;
-		a = 0;
-
-		warning("STUB: Trip::checkfeet()");
-		
-		checkfeet_result = a;
-		return checkfeet_result;
+	ix = 0;
+	iy = 0;
+	if (hy != y) {
+		temp = hy - y;
+		if (temp > 4)  iy = 4;
+		else if (temp < -4)  iy = -4;
+		else iy = temp;
 	}
+	if (hx != x) {
+		temp = hx - x;
+		if (temp > 4)  ix = 4;
+		else if (temp < -4)  ix = -4;
+		else ix = temp;
+	}
+}
+
+void triptype::speed(int8 xx, int8 yy) {
+	ix = xx;
+	iy = yy;
+	if ((ix == 0) && (iy == 0))  return; /* no movement */
+	if (ix == 0) {
+		/* No horz movement */
+		if (iy < 0)  turn(_tr->up);
+		else turn(_tr->down);
+	} else {
+		if (ix < 0)  turn(_tr->left);
+		else turn(_tr->right);
+	}
+}
+
+void triptype::stopwalk() {
+	ix = 0;
+	iy = 0;
+	homing = false;
+}
+
+void triptype::chatter() {
+	_tr->_vm->_gyro.talkx = x + a.xl / 2;
+	_tr->_vm->_gyro.talky = y;
+	_tr->_vm->_gyro.talkf = a.fgc;
+	_tr->_vm->_gyro.talkb = a.bgc;
+}
+
+void triptype::set_up_saver(trip_saver_type &v) {
+	v.whichsprite = whichsprite;
+	v.face = face;
+	v.step = step;
+	v.x = x;
+	v.y = y;
+	v.ix = ix;
+	v.iy = iy;
+	v.visible = visible;
+	v.homing = homing;
+	v.check_me = check_me;
+	v.count = count;
+	v.xw = xw;
+	v.xs = xs;
+	v.ys = ys;
+	v.totalnum = totalnum;
+	v.hx = hx;
+	v.hy = hy;
+	v.call_eachstep = call_eachstep;
+	v.eachstep = eachstep;
+	v.vanishifstill = vanishifstill;
+}
+
+void triptype::unload_saver(trip_saver_type v) {
+	whichsprite = v.whichsprite;
+	face = v.face;
+	step = v.step;
+	x = v.x;
+	y = v.y;
+	ix = v.ix;
+	iy = v.iy;
+	visible = v.visible;
+	homing = v.homing;
+	check_me = v.check_me;
+	count = v.count;
+	xw = v.xw;
+	xs = v.xs;
+	ys = v.ys;
+	totalnum = v.totalnum;
+	hx = v.hx;
+	hy = v.hy;
+	call_eachstep = v.call_eachstep;
+	eachstep = v.eachstep;
+	vanishifstill = v.vanishifstill;
+}
+
+void triptype::savedata(/*untyped_file &f*/) {
+	warning("STUB: _vm->_timeout.savedata()");
+}
+
+void triptype::loaddata(/*untyped_file &f*/) {
+	warning("STUB: _vm->_timeout.loaddata()");
+}
+
+void triptype::save_data_to_mem(uint16 &where) {
+	warning("STUB: save_data_to_mem()");
+}
+
+void triptype::load_data_from_mem(uint16 &where) {
+	warning("STUB: load_data_from_mem()");
+}
+
+triptype *triptype::done() {
+	int16 gd, gm;
+	Common::String xx;
+	byte fv/*,nds*/;
+	byte aa, bb;
+	int32 id;
+	uint16 soa;
 
-	byte geida_ped(byte which) {
-		byte geida_ped_result;
-		switch (which) {
-		case 1:
-			geida_ped_result = 7;
-			break;
-		case 2:
-		case 6:
-			geida_ped_result = 8;
-			break;
-		case 3:
-		case 5:
-			geida_ped_result = 9;
-			break;
-		case 4:
-			geida_ped_result = 10;
-			break;
+	{
+		adxtype &with = a;
+
+		/*  nds:=num div seq;*/
+		xw = with.xl / 8;
+		if ((with.xl % 8) > 0)  xw += 1;
+		for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
+			totalnum --;
+			free(mani[totalnum]);
+			free(sil[totalnum]); /* <<- Width of a siltype. */
 		}
-		return geida_ped_result;
 	}
 
-	void catamove(byte ped)
-	/* When you enter a new position in the catacombs, this procedure should
-	  be called. It changes the Also codes so that they may match the picture
-	  on the screen. (Coming soon: It draws up the screen, too.) */
-	{
+	quick = false;
+	whichsprite = 177;
+	return this;
+}
 
-		warning("Repair array indexes in Trip::catamove()");
 
-		int32 here;
-		uint16 xy_uint16;
-		byte fv, ff;
 
-		/* XY_uint16 is cat_x+cat_y*256. Thus, every room in the
-		  catacombs has a different number for it. */
 
 
-		
-		xy_uint16 = Gyro::dna.cat_x + Gyro::dna.cat_y * 256;
-		Gyro::dna.geida_spin = 0;
-		
-		switch (xy_uint16) {
-		case 1801: { /* Exit catacombs */
-			fliproom(r__lustiesroom, 4);
-			Scrolls::display("Phew! Nice to be out of there!");
-			return;
-		}
-		break;
-		case 1033: { /* Oubliette */
-			fliproom(r__oubliette, 1);
-			Scrolls::display("Oh, NO!\231\2");
-			return;
-		}
-		break;
-		case 4: {
-			fliproom(r__geidas, 1);
-			return;
-		}
-		break;
-		case 2307: {
-			fliproom(r__lusties, 5);
-			Scrolls::display("Oh no... here we go again...");
-			Gyro::dna.user_moves_avvy = false;
-			tr[1].iy = 1;
-			tr[1].ix = 0;
-			return;
-		}
-		break;
-		}
 
-		if (! Gyro::dna.enter_catacombs_from_lusties_room) Lucerna::load(29);
-		here = Gyro::catamap[Gyro::dna.cat_y][Gyro::dna.cat_x];
+getsettype *getsettype::init() {
+	numleft = 0; /* initialise array pointer */
+	return this;
+}
 
-		switch (here & 0xf) { /* West. */
-		case 0: { /* no connection (wall) */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::nix; /* Door. */
-			Celer::show_one(28);
-		}
-		break;
-		case 0x1: { /* no connection (wall + shield), */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::nix; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(29); /* ...shield. */
-		}
-		break;
-		case 0x2: { /* wall with door */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::special; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(30); /* ...door. */
-		}
-		break;
-		case 0x3: { /* wall with door and shield */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::special; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(30); /* ...door, and... */
-			Celer::show_one(29); /* ...shield. */
-		}
-		break;
-		case 0x4: { /* no connection (wall + window), */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::nix; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(5);  /* ...window. */
-		}
-		break;
-		case 0x5: { /* wall with door and window */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::special; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(30); /* ...door, and... */
-			Celer::show_one(5); /* ...window. */
-		}
-		break;
-		case 0x6: { /* no connection (wall + torches), */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::nix; /* No door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(7); /* ...torches. */
-		}
-		break;
-		case 0x7: { /* wall with door and torches */
-			Gyro::magics[2].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[13].op = Gyro::special; /* Door. */
-			Celer::show_one(28); /* Wall, plus... */
-			Celer::show_one(30); /* ...door, and... */
-			Celer::show_one(7); /* ...torches. */
-		}
-		break;
-		case 0xf: { /* straight-through corridor. */
-			Gyro::magics[2].op = Gyro::nix; /* Sloping wall. */
-			Gyro::magics[3].op = Gyro::special; /* Straight wall. */
-		}
-		break;
-		}
+void getsettype::remember(bytefield r) {
+	numleft ++;
+	warning("STUB: _vm->_timeout.getsettype::remember()");
+	gs[numleft] = r;
+}
 
-		/*  ---- */
+void getsettype::recall(bytefield &r) {
+	r = gs[numleft];
+	numleft --;
+}
 
-		switch ((here & 0xf0) >> 4) { /* East */
-		case 0: { /* no connection (wall) */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::nix; /* Door. */
-			Celer::show_one(19);
-		}
-		break;
-		case 0x1: { /* no connection (wall + window), */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::nix; /* Door. */
-			Celer::show_one(19); /* Wall, plus... */
-			Celer::show_one(20); /* ...window. */
-		}
-		break;
-		case 0x2: { /* wall with door */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::special; /* Door. */
-			Celer::show_one(19); /* Wall, plus... */
-			Celer::show_one(21); /* ...door. */
-		}
-		break;
-		case 0x3: { /* wall with door and window */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::special; /* Door. */
-			Celer::show_one(19); /* Wall, plus... */
-			Celer::show_one(20); /* ...door, and... */
-			Celer::show_one(21); /* ...window. */
-		}
-		break;
-		case 0x6: { /* no connection (wall + torches), */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::nix; /* No door. */
-			Celer::show_one(19); /* Wall, plus... */
-			Celer::show_one(18); /* ...torches. */
-		}
-		break;
-		case 0x7: { /* wall with door and torches */
-			Gyro::magics[5].op = Gyro::bounces; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::nix; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::special; /* Door. */
-			Celer::show_one(19); /* Wall, plus... */
-			Celer::show_one(21); /* ...door, and... */
-			Celer::show_one(18); /* ...torches. */
-		}
-		break;
-		case 0xf: { /* straight-through corridor. */
-			Gyro::magics[5].op = Gyro::nix; /* Sloping wall. */
-			Gyro::magics[6].op = Gyro::special; /* Straight wall. */
-			Gyro::portals[15].op = Gyro::nix; /* Door. */
-		}
-		break;
-		}
 
-		/*  ---- */
 
-		switch ((here & 0xf00) >> 8) { /* South */
-		case 0: { /* No connection. */
-			Gyro::magics[7].op = Gyro::bounces;
-			Gyro::magics[12].op = Gyro::bounces;
-			Gyro::magics[13].op = Gyro::bounces;
-		}
-		break;
-		case 0x1: {
-			Celer::show_one(22);
-			
-			if ((xy_uint16 == 2051) & (Gyro::dna.geida_follows))
-				Gyro::magics[13].op = Gyro::exclaim;
-			else Gyro::magics[13].op = Gyro::special; /* Right exit south. */
 
-			Gyro::magics[7].op = Gyro::bounces;
-			Gyro::magics[12].op = Gyro::bounces;
-		}
-		break;
-		case 0x2: {
-			Celer::show_one(23);
-			Gyro::magics[7].op = Gyro::special; /* Middle exit south. */
-			Gyro::magics[12].op = Gyro::bounces;
-			Gyro::magics[13].op = Gyro::bounces;
-		}
-		break;
-		case 0x3: {
-			Celer::show_one(24);
-			Gyro::magics[12].op = Gyro::special; /* Left exit south. */
-			Gyro::magics[7].op = Gyro::bounces;
-			Gyro::magics[13].op = Gyro::bounces;
-		}
-		break;
-		}
 
-		switch ((here & 0xf000) >> 12) { /* North */
-		case 0: { /* No connection */
-			Gyro::magics[1].op = Gyro::bounces;
-			Gyro::portals[12].op = Gyro::nix; /* Door. */
-		}
-		break;
-		/* LEFT handles: */
-		/*  $1: begin
-			  Celer::show_one(4);
-			  Gyro::magics[1].op:=Gyro::bounces; { Left exit north. } { Change magic number! }
-			  Gyro::portals[12].op:=Gyro::special; { Door. }
-			 end;*/
-		case 0x2: {
-			Celer::show_one(4);
-			Gyro::magics[1].op = Gyro::bounces; /* Middle exit north. */
-			Gyro::portals[12].op = Gyro::special; /* Door. */
-		}
-		break;
-		/*  $3: begin
-			  Celer::show_one(4);
-			  Gyro::magics[1].op:=Gyro::bounces; { Right exit north. } { Change magic number! }
-			  Gyro::portals[12].op:=Gyro::special; { Door. }
-			 end;
-		  { RIGHT handles: }
-		  $4: begin
-			  Celer::show_one(3);
-			  Gyro::magics[1].op:=Gyro::bounces; { Left exit north. } { Change magic number! }
-			  Gyro::portals[12].op:=Gyro::special; { Door. }
-			 end;*/
-		case 0x5: {
-			Celer::show_one(3);
-			Gyro::magics[1].op = Gyro::bounces; /* Middle exit north. */
-			Gyro::portals[12].op = Gyro::special; /* Door. */
-		}
-		break;
-		/*  $6: begin
-			  Celer::show_one(3);
-			  Gyro::magics[1].op:=Gyro::bounces; { Right exit north. }
-			  Gyro::portals[12].op:=Gyro::special; { Door. }
-			 end;*/
-		/* ARCHWAYS: */
-		case 0x7:
-		case 0x8:
-		case 0x9: {
-			Celer::show_one(6);
-
-			if (((here & 0xf000) >> 12) > 0x7)  Celer::show_one(31);
-			if (((here & 0xf000) >> 12) == 0x9)  Celer::show_one(32);
-
-			Gyro::magics[1].op = Gyro::special; /* Middle arch north. */
-			Gyro::portals[12].op = Gyro::nix; /* Door. */
-		}
-		break;
-		/* DECORATIONS: */
-		case 0xd: { /* No connection + WINDOW */
-			Gyro::magics[1].op = Gyro::bounces;
-			Gyro::portals[12].op = Gyro::nix; /* Door. */
-			Celer::show_one(14);
-		}
-		break;
-		case 0xe: { /* No connection + TORCH */
-			Gyro::magics[1].op = Gyro::bounces;
-			Gyro::portals[12].op = Gyro::nix; /* Door. */
-			Celer::show_one(8);
-		}
-		break;
-		/* Recessed door: */
-		case 0xf: {
-			Gyro::magics[1].op = Gyro::nix; /* Door to Geida's room. */
-			Celer::show_one(1);
-			Gyro::portals[12].op = Gyro::special; /* Door. */
-		}
-		break;
-		}
 
-		switch (xy_uint16) {
-		case 514:
-			Celer::show_one(17);
-			break;     /* [2,2] : "Art Gallery" sign over door. */
-		case 264:
-			Celer::show_one(9);
-			break;      /* [8,1] : "The Wrong Way!" sign. */
-		case 1797:
-			Celer::show_one(2);
-			break;      /* [5,7] : "Ite Mingite" sign. */
-		case 258:
-			for (fv = 0; fv <= 2; fv ++) { /* [2,1] : Art gallery - pictures */
-				Celer::show_one_at(15, 130 + fv * 120, 70);
-				Celer::show_one_at(16, 184 + fv * 120, 78);
-			}
-			break;
-		case 1287:
-			for (fv = 10; fv <= 13; fv ++) Celer::show_one(fv);
-			break; /* [7,5] : 4 candles. */
-		case 776:
-			Celer::show_one(10);
-			break;     /* [8,3] : 1 candle. */
-		case 2049:
-			Celer::show_one(11);
-			break;     /* [1,8] : another candle. */
-		case 257: {
-			Celer::show_one(12);
-			Celer::show_one(13);
-		}
-		break; /* [1,1] : the other two. */
-		}
+Trip::Trip() {
+	getsetclear();
+	mustexclaim = false;
+}
 
-		if ((Gyro::dna.geida_follows) & (ped > 0)) {
-			triptype &with = tr[2];
+void Trip::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
 
-			if (! with.quick)  /* If we don't already have her... */
-				tr[2].init(5, true); /* ...Load Geida. */
-			apped(2, geida_ped(ped));
-			tr[2].call_eachstep = true;
-			tr[2].eachstep = procgeida_procs;
-		}
-	}
 
-	void call_special(uint16 which);
+void Trip::loadtrip() {
+	byte gm;
 
-	/* This proc gets called whenever you touch a line defined as Gyro::special. */
-	static void dawndelay() {
-		Timeout::set_up_timer(2, Timeout::procdawn_delay, Timeout::reason_dawndelay);
-	}
+	for (gm = 1; gm <= numtr; gm ++) tr[gm].original();
+	for (int i = 0; i < sizeof(aa); aa[i] = 0);
+}
 
-	void call_special(uint16 which) {
-		switch (which) {
-		case 1: { /* Gyro::special 1: Room 22: top of stairs. */
-			Celer::show_one(1);
-			Gyro::dna.brummie_stairs = 1;
-			Gyro::magics[10].op = Gyro::nix;
-			Timeout::set_up_timer(10, Timeout::procstairs, Timeout::reason_brummiestairs);
-			stopwalking();
-			Gyro::dna.user_moves_avvy = false;
-		}
+byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
+	byte a, c;
+	int16 fv, ff;
+
+	/* if not alive then begin checkfeet:=0; exit; end;*/
+	byte checkfeet_result;
+	a = 0;
+
+	warning("STUB: Trip::checkfeet()");
+		
+	checkfeet_result = a;
+	return checkfeet_result;
+}
+
+byte Trip::geida_ped(byte which) {
+	byte geida_ped_result;
+	switch (which) {
+	case 1:
+		geida_ped_result = 7;
 		break;
-		case 2: { /* Gyro::special 2: Room 22: bottom of stairs. */
-			Gyro::dna.brummie_stairs = 3;
-			Gyro::magics[11].op = Gyro::nix;
-			Gyro::magics[12].op = Gyro::exclaim;
-			Gyro::magics[12].data = 5;
-			Gyro::magics[4].op = Gyro::bounces; /* Now works as planned! */
-			stopwalking();
-			Visa::dixi('q', 26);
-			Gyro::dna.user_moves_avvy = true;
-		}
+	case 2:
+	case 6:
+		geida_ped_result = 8;
 		break;
-		case 3: { /* Gyro::special 3: Room 71: triggers dart. */
-			tr[1].bounce(); /* Must include that. */
-
-			if (! Gyro::dna.arrow_triggered) {
-				Gyro::dna.arrow_triggered = true;
-				apped(2, 4); /* The dart starts at ped 4, and... */
-				tr[2].walkto(5); /* flies to ped 5. */
-				tr[2].face = 0; /* Only face. */
-				/* Should call some kind of Eachstep procedure which will deallocate
-				  the sprite when it hits the wall, and replace it with the chunk
-				  graphic of the arrow buried in the plaster. */
-				/* OK! */
-				tr[2].call_eachstep = true;
-				tr[2].eachstep = procarrow_procs;
-			}
-		}
+	case 3:
+	case 5:
+		geida_ped_result = 9;
 		break;
-
-		case 4: { /* This is the ghost room link. */
-			Lucerna::dusk();
-			tr[1].turn(right); /* you'll see this after we get back from bootstrap */
-			Timeout::set_up_timer(1, Timeout::procghost_room_phew, Timeout::reason_ghost_room_phew);
-			Enid::back_to_bootstrap(3);
-		}
+	case 4:
+		geida_ped_result = 10;
 		break;
+	}
+	return geida_ped_result;
+}
 
-		case 5:
-			if (Gyro::dna.friar_will_tie_you_up) {
-				/* Gyro::special 5: Room 42: touched tree, and get tied up. */
-				Gyro::magics[4].op = Gyro::bounces; /* Boundary effect is now working again. */
-				Visa::dixi('q', 35);
-				tr[1].done();
-				/*tr[1].vanishifstill:=true;*/
-				Celer::show_one(2);
-				Visa::dixi('q', 36);
-				Gyro::dna.tied_up = true;
-				Gyro::dna.friar_will_tie_you_up = false;
-				tr[2].walkto(3);
-				tr[2].vanishifstill = true;
-				tr[2].check_me = true; /* One of them must have Check_Me switched on. */
-				Gyro::whereis[Gyro::pfriartuck] = 177; /* Not here, then. */
-				Timeout::set_up_timer(364, Timeout::prochang_around, Timeout::reason_hanging_around);
-			}
-			break;
+void Trip::catamove(byte ped)
+/* When you enter a new position in the catacombs, this procedure should
+	be called. It changes the Also codes so that they may match the picture
+	on the screen. (Coming soon: It draws up the screen, too.) */
+{
 
-		case 6: { /* Gyro::special 6: fall down oubliette. */
-			Gyro::dna.user_moves_avvy = false;
-			tr[1].ix = 3;
-			tr[1].iy = 0;
-			tr[1].face = right;
-			Timeout::set_up_timer(1, Timeout::procfall_down_oubliette, Timeout::reason_falling_down_oubliette);
-		}
-		break;
+	warning("Repair array indexes in Trip::catamove()");
 
-		case 7: { /* Gyro::special 7: stop falling down oubliette. */
-			tr[1].visible = false;
-			Gyro::magics[10].op = Gyro::nix;
-			stopwalking();
-			Timeout::lose_timer(Timeout::reason_falling_down_oubliette);
-			Lucerna::mblit(12, 80, 38, 160, 3, 0);
-			Lucerna::mblit(12, 80, 38, 160, 3, 1);
-			Scrolls::display("Oh dear, you seem to be down the bottom of an oubliette.");
-			Timeout::set_up_timer(200, Timeout::procmeet_avaroid, Timeout::reason_meeting_avaroid);
-		}
-		break;
+	int32 here;
+	uint16 xy_uint16;
+	byte fv, ff;
 
-		case 8:        /* Gyro::special 8: leave du Lustie's room. */
-			if ((Gyro::dna.geida_follows) && (! Gyro::dna.lustie_is_asleep)) {
-				Visa::dixi('q', 63);
-				tr[2].turn(down);
-				tr[2].stopwalk();
-				tr[2].call_eachstep = false; /* Geida */
-				Lucerna::gameover();
-			}
-			break;
+	/* XY_uint16 is cat_x+cat_y*256. Thus, every room in the
+		catacombs has a different number for it. */
 
-		case 9: { /* Gyro::special 9: lose Geida to Robin Hood... */
-			if (! Gyro::dna.geida_follows)  return;   /* DOESN'T COUNT: no Geida. */
-			tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
-			tr[2].walkto(4); /* She walks to somewhere... */
-			tr[1].done();     /* Lose Avvy. */
-			Gyro::dna.user_moves_avvy = false;
-			Timeout::set_up_timer(40, Timeout::procrobin_hood_and_geida, Timeout::reason_robin_hood_and_geida);
-		}
-		break;
 
-		case 10: { /* Gyro::special 10: transfer north in catacombs. */
-			if ((Gyro::dna.cat_x == 4) && (Gyro::dna.cat_y == 1)) {
-				/* Into Geida's room. */
-				if (Gyro::dna.obj[Gyro::key])  Visa::dixi('q', 62);
-				else {
-					Visa::dixi('q', 61);
-					return;
-				}
-			}
-			Lucerna::dusk();
-			Gyro::dna.cat_y -= 1;
-			catamove(4);
-			if (Gyro::dna.room != r__catacombs)  return;
-			Lucerna::delavvy();
-			switch ((Gyro::catamap[Gyro::dna.cat_y][Gyro::dna.cat_x] & 0xf00) >> 8) {
-			case 0x1:
-				apped(1, 12);
-				break;
-			case 0x3:
-				apped(1, 11);
-				break;
-			default:
-				apped(1, 4);
-			}
-			getback();
-			dawndelay();
-		}
-		break;
-		case 11: { /* Gyro::special 11: transfer east in catacombs. */
-			Lucerna::dusk();
-			Gyro::dna.cat_x += 1;
-			catamove(1);
-			if (Gyro::dna.room != r__catacombs)  return;
-			Lucerna::delavvy();
-			apped(1, 1);
-			getback();
-			dawndelay();
-		}
-		break;
-		case 12: { /* Gyro::special 12: transfer south in catacombs. */
-			Lucerna::dusk();
-			Gyro::dna.cat_y += 1;
-			catamove(2);
-			if (Gyro::dna.room != r__catacombs)  return;
-			Lucerna::delavvy();
-			apped(1, 2);
-			getback();
-			dawndelay();
-		}
-		break;
-		case 13: { /* Gyro::special 13: transfer west in catacombs. */
-			Lucerna::dusk();
-			Gyro::dna.cat_x -= 1;
-			catamove(3);
-			if (Gyro::dna.room != r__catacombs)  return;
-			Lucerna::delavvy();
-			apped(1, 3);
-			getback();
-			dawndelay();
-		}
-		break;
-		}
+		
+	xy_uint16 = _vm->_gyro.dna.cat_x + _vm->_gyro.dna.cat_y * 256;
+	_vm->_gyro.dna.geida_spin = 0;
+		
+	switch (xy_uint16) {
+	case 1801: { /* Exit catacombs */
+		fliproom(r__lustiesroom, 4);
+		_vm->_scrolls.display("Phew! Nice to be out of there!");
+		return;
+	}
+	break;
+	case 1033: { /* Oubliette */
+		fliproom(r__oubliette, 1);
+		_vm->_scrolls.display("Oh, NO!\231\2");
+		return;
+	}
+	break;
+	case 4: {
+		fliproom(r__geidas, 1);
+		return;
+	}
+	break;
+	case 2307: {
+		fliproom(r__lusties, 5);
+		_vm->_scrolls.display("Oh no... here we go again...");
+		_vm->_gyro.dna.user_moves_avvy = false;
+		tr[1].iy = 1;
+		tr[1].ix = 0;
+		return;
+	}
+	break;
 	}
 
-	void hide_in_the_cupboard();
+	if (! _vm->_gyro.dna.enter_catacombs_from_lusties_room) _vm->_lucerna.load(29);
+	here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x];
 
-	void open_the_door(byte whither, byte ped, byte magicnum)
-	/* This slides the door open. (The data really ought to be saved in
-	  the Also file, and will be next time. However, for now, they're
-	  here.) */
-	{
-		switch (Gyro::dna.room) {
-		case r__outsideyours:
-		case r__outsidenottspub:
-		case r__outsideducks: {
-			Sequence::first_show(1);
-			Sequence::then_show(2);
-			Sequence::then_show(3);
-		}
-		break;
-		case r__insidecardiffcastle: {
-			Sequence::first_show(1);
-			Sequence::then_show(5);
-		}
-		break;
-		case r__avvysgarden:
-		case r__entrancehall:
-		case r__insideabbey: {
-			Sequence::first_show(1);
-			Sequence::then_show(2);
-		}
-		break;
-		case r__musicroom:
-		case r__outsideargentpub: {
-			Sequence::first_show(5);
-			Sequence::then_show(6);
-		}
-		break;
-		case r__lusties:
-			switch (magicnum) {
-			case 14:
-				if (Gyro::dna.avvys_in_the_cupboard) {
-					hide_in_the_cupboard();
-					Sequence::first_show(8);
-					Sequence::then_show(7);
-					Sequence::start_to_close();
-					return;
-				} else {
-					apped(1, 6);
-					tr[1].face = right; /* added by TT 12/3/1995 */
-					Sequence::first_show(8);
-					Sequence::then_show(9);
-				}
-				break;
-			case 12: {
-				Sequence::first_show(4);
-				Sequence::then_show(5);
-				Sequence::then_show(6);
-			}
-			break;
-			}
-			break;
-		}
-
-		Sequence::then_flip(whither, ped);
-		Sequence::start_to_open();
+	switch (here & 0xf) { /* West. */
+	case 0: { /* no connection (wall) */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(28);
 	}
-
-	void newspeed() {
-	/* Given that you've just changed the speed in triptype.xs, this adjusts
-	  ix. */
-		warning("STUB: Trip::newspeed()");
+	break;
+	case 0x1: { /* no connection (wall + shield), */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(29); /* ...shield. */
 	}
-
-	triptype *triptype::init(byte spritenum, bool do_check) {
-		warning("STUB: Trip::init()");
-		return this;
+	break;
+	case 0x2: { /* wall with door */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(30); /* ...door. */
 	}
-
-	void triptype::original() {
-		quick = false;
-		whichsprite = 177;
+	break;
+	case 0x3: { /* wall with door and shield */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(30); /* ...door, and... */
+		_vm->_celer.show_one(29); /* ...shield. */
 	}
-
-	void triptype::andexor() {
-		warning("STUB: Trip::andexor()");
+	break;
+	case 0x4: { /* no connection (wall + window), */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(5);  /* ...window. */
 	}
-
-	void triptype::turn(byte whichway) {
-		if (whichway == 8)  face = 0;
-		else face = whichway;
+	break;
+	case 0x5: { /* wall with door and window */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(30); /* ...door, and... */
+		_vm->_celer.show_one(5); /* ...window. */
 	}
-
-	void triptype::appear(int16 wx, int16 wy, byte wf) {
-		x = (wx / 8) * 8;
-		y = wy;
-		ox[Gyro::cp] = wx;
-		oy[Gyro::cp] = wy;
-		turn(wf);
-		visible = true;
-		ix = 0;
-		iy = 0;
+	break;
+	case 0x6: { /* no connection (wall + torches), */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* No door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(7); /* ...torches. */
+	}
+	break;
+	case 0x7: { /* wall with door and torches */
+		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(28); /* Wall, plus... */
+		_vm->_celer.show_one(30); /* ...door, and... */
+		_vm->_celer.show_one(7); /* ...torches. */
+	}
+	break;
+	case 0xf: { /* straight-through corridor. */
+		_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* Sloping wall. */
+		_vm->_gyro.magics[3].op = _vm->_gyro.special; /* Straight wall. */
+	}
+	break;
 	}
 
+	/*  ---- */
 
+	switch ((here & 0xf0) >> 4) { /* East */
+	case 0: { /* no connection (wall) */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(19);
+	}
+	break;
+	case 0x1: { /* no connection (wall + window), */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(19); /* Wall, plus... */
+		_vm->_celer.show_one(20); /* ...window. */
+	}
+	break;
+	case 0x2: { /* wall with door */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(19); /* Wall, plus... */
+		_vm->_celer.show_one(21); /* ...door. */
+	}
+	break;
+	case 0x3: { /* wall with door and window */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(19); /* Wall, plus... */
+		_vm->_celer.show_one(20); /* ...door, and... */
+		_vm->_celer.show_one(21); /* ...window. */
+	}
+	break;
+	case 0x6: { /* no connection (wall + torches), */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* No door. */
+		_vm->_celer.show_one(19); /* Wall, plus... */
+		_vm->_celer.show_one(18); /* ...torches. */
+	}
+	break;
+	case 0x7: { /* wall with door and torches */
+		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_celer.show_one(19); /* Wall, plus... */
+		_vm->_celer.show_one(21); /* ...door, and... */
+		_vm->_celer.show_one(18); /* ...torches. */
+	}
+	break;
+	case 0xf: { /* straight-through corridor. */
+		_vm->_gyro.magics[5].op = _vm->_gyro.nix; /* Sloping wall. */
+		_vm->_gyro.magics[6].op = _vm->_gyro.special; /* Straight wall. */
+		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+	}
+	break;
+	}
 
+	/*  ---- */
 
-	bool triptype::collision_check() {
-		byte fv;
-
-		bool collision_check_result;
-		for (fv = 1; fv <= numtr; fv ++)
-			if (tr[fv].quick && (tr[fv].whichsprite != whichsprite) &&
-					((x + a.xl) > tr[fv].x) &&
-					(x < (tr[fv].x + tr[fv].a.xl)) &&
-					(tr[fv].y == y)) {
-				collision_check_result = true;
-				return collision_check_result;
-			}
-		collision_check_result = false;
-		return collision_check_result;
+	switch ((here & 0xf00) >> 8) { /* South */
+	case 0: { /* No connection. */
+		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
+		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
+		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
 	}
+	break;
+	case 0x1: {
+		_vm->_celer.show_one(22);
+			
+		if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows))
+			_vm->_gyro.magics[13].op = _vm->_gyro.exclaim;
+		else _vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
 
-	void triptype::walk() {
-		warning("STUB: Trip::walk()");
+		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
+		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
 	}
-
-	void triptype::bounce() {
-		x = ox[Gyro::cp];
-		y = oy[Gyro::cp];
-		if (check_me)  stopwalking();
-		else stopwalk();
-		Gyro::oncandopageswap = false;
-		Lucerna::showrw();
-		Gyro::oncandopageswap = true;
+	break;
+	case 0x2: {
+		_vm->_celer.show_one(23);
+		_vm->_gyro.magics[7].op = _vm->_gyro.special; /* Middle exit south. */
+		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
+		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
 	}
-
-	int8 sgn(int16 x) {
-		int8 sgn_result;
-		if (x > 0)  sgn_result = 1;
-		else if (x < 0)  sgn_result = -1;
-		else
-			sgn_result = 0; /* x=0 */
-		return sgn_result;
+	break;
+	case 0x3: {
+		_vm->_celer.show_one(24);
+		_vm->_gyro.magics[12].op = _vm->_gyro.special; /* Left exit south. */
+		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
+		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
+	}
+	break;
 	}
 
-	void triptype::walkto(byte pednum) {
-		speed(sgn(Gyro::peds[pednum].x - x) * 4, sgn(Gyro::peds[pednum].y - y));
-		hx = Gyro::peds[pednum].x - a.xl / 2;
-		hy = Gyro::peds[pednum].y - a.yl;
-		homing = true;
+	switch ((here & 0xf000) >> 12) { /* North */
+	case 0: { /* No connection */
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
+		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+	}
+	break;
+	/* LEFT handles: */
+	/*  $1: begin
+			_vm->_celer.show_one(4);
+			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Left exit north. } { Change magic number! }
+			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
+			end;*/
+	case 0x2: {
+		_vm->_celer.show_one(4);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
+	}
+	break;
+	/*  $3: begin
+			_vm->_celer.show_one(4);
+			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Right exit north. } { Change magic number! }
+			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
+			end;
+		{ RIGHT handles: }
+		$4: begin
+			_vm->_celer.show_one(3);
+			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Left exit north. } { Change magic number! }
+			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
+			end;*/
+	case 0x5: {
+		_vm->_celer.show_one(3);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
+	}
+	break;
+	/*  $6: begin
+			_vm->_celer.show_one(3);
+			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Right exit north. }
+			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
+			end;*/
+	/* ARCHWAYS: */
+	case 0x7:
+	case 0x8:
+	case 0x9: {
+		_vm->_celer.show_one(6);
+
+		if (((here & 0xf000) >> 12) > 0x7)  _vm->_celer.show_one(31);
+		if (((here & 0xf000) >> 12) == 0x9)  _vm->_celer.show_one(32);
+
+		_vm->_gyro.magics[1].op = _vm->_gyro.special; /* Middle arch north. */
+		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+	}
+	break;
+	/* DECORATIONS: */
+	case 0xd: { /* No connection + WINDOW */
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
+		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(14);
+	}
+	break;
+	case 0xe: { /* No connection + TORCH */
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
+		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_celer.show_one(8);
+	}
+	break;
+	/* Recessed door: */
+	case 0xf: {
+		_vm->_gyro.magics[1].op = _vm->_gyro.nix; /* Door to Geida's room. */
+		_vm->_celer.show_one(1);
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
+	}
+	break;
 	}
 
-	void triptype::stophoming() {
-		homing = false;
+	switch (xy_uint16) {
+	case 514:
+		_vm->_celer.show_one(17);
+		break;     /* [2,2] : "Art Gallery" sign over door. */
+	case 264:
+		_vm->_celer.show_one(9);
+		break;      /* [8,1] : "The Wrong Way!" sign. */
+	case 1797:
+		_vm->_celer.show_one(2);
+		break;      /* [5,7] : "Ite Mingite" sign. */
+	case 258:
+		for (fv = 0; fv <= 2; fv ++) { /* [2,1] : Art gallery - pictures */
+			_vm->_celer.show_one_at(15, 130 + fv * 120, 70);
+			_vm->_celer.show_one_at(16, 184 + fv * 120, 78);
+		}
+		break;
+	case 1287:
+		for (fv = 10; fv <= 13; fv ++) _vm->_celer.show_one(fv);
+		break; /* [7,5] : 4 candles. */
+	case 776:
+		_vm->_celer.show_one(10);
+		break;     /* [8,3] : 1 candle. */
+	case 2049:
+		_vm->_celer.show_one(11);
+		break;     /* [1,8] : another candle. */
+	case 257: {
+		_vm->_celer.show_one(12);
+		_vm->_celer.show_one(13);
+	}
+	break; /* [1,1] : the other two. */
 	}
 
-	void triptype::homestep() {
-		int16 temp;
+	if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) {
+		triptype &with = tr[2];
 
-		if ((hx == x) && (hy == y)) {
-			/* touching the target */
-			stopwalk();
-			return;
-		}
-		ix = 0;
-		iy = 0;
-		if (hy != y) {
-			temp = hy - y;
-			if (temp > 4)  iy = 4;
-			else if (temp < -4)  iy = -4;
-			else iy = temp;
-		}
-		if (hx != x) {
-			temp = hx - x;
-			if (temp > 4)  ix = 4;
-			else if (temp < -4)  ix = -4;
-			else ix = temp;
+		if (! with.quick)  /* If we don't already have her... */
+			tr[2].init(5, true, this); /* ...Load Geida. */
+		apped(2, geida_ped(ped));
+		tr[2].call_eachstep = true;
+		tr[2].eachstep = procgeida_procs;
+	}
+}
+
+	
+
+/* This proc gets called whenever you touch a line defined as _vm->_gyro.special. */
+void Trip::dawndelay() {
+	_vm->_timeout.set_up_timer(2, _vm->_timeout.procdawn_delay, _vm->_timeout.reason_dawndelay);
+}
+
+void Trip::call_special(uint16 which) {
+	switch (which) {
+	case 1: { /* _vm->_gyro.special 1: Room 22: top of stairs. */
+		_vm->_celer.show_one(1);
+		_vm->_gyro.dna.brummie_stairs = 1;
+		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
+		_vm->_timeout.set_up_timer(10, _vm->_timeout.procstairs, _vm->_timeout.reason_brummiestairs);
+		stopwalking();
+		_vm->_gyro.dna.user_moves_avvy = false;
+	}
+	break;
+	case 2: { /* _vm->_gyro.special 2: Room 22: bottom of stairs. */
+		_vm->_gyro.dna.brummie_stairs = 3;
+		_vm->_gyro.magics[11].op = _vm->_gyro.nix;
+		_vm->_gyro.magics[12].op = _vm->_gyro.exclaim;
+		_vm->_gyro.magics[12].data = 5;
+		_vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Now works as planned! */
+		stopwalking();
+		_vm->_visa.dixi('q', 26);
+		_vm->_gyro.dna.user_moves_avvy = true;
+	}
+	break;
+	case 3: { /* _vm->_gyro.special 3: Room 71: triggers dart. */
+		tr[1].bounce(); /* Must include that. */
+
+		if (! _vm->_gyro.dna.arrow_triggered) {
+			_vm->_gyro.dna.arrow_triggered = true;
+			apped(2, 4); /* The dart starts at ped 4, and... */
+			tr[2].walkto(5); /* flies to ped 5. */
+			tr[2].face = 0; /* Only face. */
+			/* Should call some kind of Eachstep procedure which will deallocate
+				the sprite when it hits the wall, and replace it with the chunk
+				graphic of the arrow buried in the plaster. */
+			/* OK! */
+			tr[2].call_eachstep = true;
+			tr[2].eachstep = procarrow_procs;
 		}
 	}
+	break;
 
-	void triptype::speed(int8 xx, int8 yy) {
-		ix = xx;
-		iy = yy;
-		if ((ix == 0) && (iy == 0))  return; /* no movement */
-		if (ix == 0) {
-			/* No horz movement */
-			if (iy < 0)  turn(up);
-			else turn(down);
-		} else {
-			if (ix < 0)  turn(left);
-			else turn(right);
+	case 4: { /* This is the ghost room link. */
+		_vm->_lucerna.dusk();
+		tr[1].turn(right); /* you'll see this after we get back from bootstrap */
+		_vm->_timeout.set_up_timer(1, _vm->_timeout.procghost_room_phew, _vm->_timeout.reason_ghost_room_phew);
+		_vm->_enid.back_to_bootstrap(3);
+	}
+	break;
+
+	case 5:
+		if (_vm->_gyro.dna.friar_will_tie_you_up) {
+			/* _vm->_gyro.special 5: Room 42: touched tree, and get tied up. */
+			_vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Boundary effect is now working again. */
+			_vm->_visa.dixi('q', 35);
+			tr[1].done();
+			/*tr[1].vanishifstill:=true;*/
+			_vm->_celer.show_one(2);
+			_vm->_visa.dixi('q', 36);
+			_vm->_gyro.dna.tied_up = true;
+			_vm->_gyro.dna.friar_will_tie_you_up = false;
+			tr[2].walkto(3);
+			tr[2].vanishifstill = true;
+			tr[2].check_me = true; /* One of them must have Check_Me switched on. */
+			_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 177; /* Not here, then. */
+			_vm->_timeout.set_up_timer(364, _vm->_timeout.prochang_around, _vm->_timeout.reason_hanging_around);
 		}
+		break;
+
+	case 6: { /* _vm->_gyro.special 6: fall down oubliette. */
+		_vm->_gyro.dna.user_moves_avvy = false;
+		tr[1].ix = 3;
+		tr[1].iy = 0;
+		tr[1].face = right;
+		_vm->_timeout.set_up_timer(1, _vm->_timeout.procfall_down_oubliette, _vm->_timeout.reason_falling_down_oubliette);
 	}
+	break;
 
-	void triptype::stopwalk() {
-		ix = 0;
-		iy = 0;
-		homing = false;
-	}
-
-	void triptype::chatter() {
-		Gyro::talkx = x + a.xl / 2;
-		Gyro::talky = y;
-		Gyro::talkf = a.fgc;
-		Gyro::talkb = a.bgc;
-	}
-
-	void triptype::set_up_saver(trip_saver_type &v) {
-		v.whichsprite = whichsprite;
-		v.face = face;
-		v.step = step;
-		v.x = x;
-		v.y = y;
-		v.ix = ix;
-		v.iy = iy;
-		v.visible = visible;
-		v.homing = homing;
-		v.check_me = check_me;
-		v.count = count;
-		v.xw = xw;
-		v.xs = xs;
-		v.ys = ys;
-		v.totalnum = totalnum;
-		v.hx = hx;
-		v.hy = hy;
-		v.call_eachstep = call_eachstep;
-		v.eachstep = eachstep;
-		v.vanishifstill = vanishifstill;
-	}
-
-	void triptype::unload_saver(trip_saver_type v) {
-		whichsprite = v.whichsprite;
-		face = v.face;
-		step = v.step;
-		x = v.x;
-		y = v.y;
-		ix = v.ix;
-		iy = v.iy;
-		visible = v.visible;
-		homing = v.homing;
-		check_me = v.check_me;
-		count = v.count;
-		xw = v.xw;
-		xs = v.xs;
-		ys = v.ys;
-		totalnum = v.totalnum;
-		hx = v.hx;
-		hy = v.hy;
-		call_eachstep = v.call_eachstep;
-		eachstep = v.eachstep;
-		vanishifstill = v.vanishifstill;
-	}
-
-	void triptype::savedata(/*untyped_file &f*/) {
-		warning("STUB: Timeout::savedata()");
-	}
-
-	void triptype::loaddata(/*untyped_file &f*/) {
-		warning("STUB: Timeout::loaddata()");
-	}
-
-	triptype *triptype::done() {
-		int16 gd, gm;
-		Common::String xx;
-		byte fv/*,nds*/;
-		byte aa, bb;
-		int32 id;
-		uint16 soa;
+	case 7: { /* _vm->_gyro.special 7: stop falling down oubliette. */
+		tr[1].visible = false;
+		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
+		stopwalking();
+		_vm->_timeout.lose_timer(_vm->_timeout.reason_falling_down_oubliette);
+		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 0);
+		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 1);
+		_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
+		_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
+	}
+	break;
 
-		{
-			adxtype &with = a;
-
-			/*  nds:=num div seq;*/
-			xw = with.xl / 8;
-			if ((with.xl % 8) > 0)  xw += 1;
-			for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
-				totalnum --;
-				free(mani[totalnum]);
-				free(sil[totalnum]); /* <<- Width of a siltype. */
-			}
+	case 8:        /* _vm->_gyro.special 8: leave du Lustie's room. */
+		if ((_vm->_gyro.dna.geida_follows) && (! _vm->_gyro.dna.lustie_is_asleep)) {
+			_vm->_visa.dixi('q', 63);
+			tr[2].turn(down);
+			tr[2].stopwalk();
+			tr[2].call_eachstep = false; /* Geida */
+			_vm->_lucerna.gameover();
 		}
+		break;
 
-		quick = false;
-		whichsprite = 177;
-		return this;
+	case 9: { /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
+		if (! _vm->_gyro.dna.geida_follows)  return;   /* DOESN'T COUNT: no Geida. */
+		tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
+		tr[2].walkto(4); /* She walks to somewhere... */
+		tr[1].done();     /* Lose Avvy. */
+		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_timeout.set_up_timer(40, _vm->_timeout.procrobin_hood_and_geida, _vm->_timeout.reason_robin_hood_and_geida);
 	}
+	break;
 
-	getsettype *getsettype::init() {
-		numleft = 0; /* initialise array pointer */
-		return this;
+	case 10: { /* _vm->_gyro.special 10: transfer north in catacombs. */
+		if ((_vm->_gyro.dna.cat_x == 4) && (_vm->_gyro.dna.cat_y == 1)) {
+			/* Into Geida's room. */
+			if (_vm->_gyro.dna.obj[_vm->_gyro.key])  _vm->_visa.dixi('q', 62);
+			else {
+				_vm->_visa.dixi('q', 61);
+				return;
+			}
+		}
+		_vm->_lucerna.dusk();
+		_vm->_gyro.dna.cat_y -= 1;
+		catamove(4);
+		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		_vm->_lucerna.delavvy();
+		switch ((_vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x] & 0xf00) >> 8) {
+		case 0x1:
+			apped(1, 12);
+			break;
+		case 0x3:
+			apped(1, 11);
+			break;
+		default:
+			apped(1, 4);
+		}
+		getback();
+		dawndelay();
 	}
-
-	void getsettype::remember(Gyro::bytefield r) {
-		numleft ++;
-		warning("STUB: Timeout::getsettype::remember()");
-		gs[numleft] = r;
+	break;
+	case 11: { /* _vm->_gyro.special 11: transfer east in catacombs. */
+		_vm->_lucerna.dusk();
+		_vm->_gyro.dna.cat_x += 1;
+		catamove(1);
+		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		_vm->_lucerna.delavvy();
+		apped(1, 1);
+		getback();
+		dawndelay();
 	}
-
-	void getsettype::recall(Gyro::bytefield &r) {
-		r = gs[numleft];
-		numleft --;
+	break;
+	case 12: { /* _vm->_gyro.special 12: transfer south in catacombs. */
+		_vm->_lucerna.dusk();
+		_vm->_gyro.dna.cat_y += 1;
+		catamove(2);
+		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		_vm->_lucerna.delavvy();
+		apped(1, 2);
+		getback();
+		dawndelay();
 	}
-
-	void rwsp(byte t, byte r) {
-		{
-			switch (r) {
-			case up:
-				tr[t].speed(0, -tr[t].ys);
-				break;
-			case down:
-				tr[t].speed(0, tr[t].ys);
-				break;
-			case left:
-				tr[t].speed(-tr[t].xs,  0);
-				break;
-			case right:
-				tr[t].speed(tr[t].xs,  0);
-				break;
-			case ul:
-				tr[t].speed(-tr[t].xs, -tr[t].ys);
-				break;
-			case ur:
-				tr[t].speed(tr[t].xs, -tr[t].ys);
-				break;
-			case dl:
-				tr[t].speed(-tr[t].xs, tr[t].ys);
-				break;
-			case dr:
-				tr[t].speed(tr[t].xs, tr[t].ys);
-				break;
+	break;
+	case 13: { /* _vm->_gyro.special 13: transfer west in catacombs. */
+		_vm->_lucerna.dusk();
+		_vm->_gyro.dna.cat_x -= 1;
+		catamove(3);
+		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		_vm->_lucerna.delavvy();
+		apped(1, 3);
+		getback();
+		dawndelay();
+	}
+	break;
+	}
+}
+
+	
+
+void Trip::open_the_door(byte whither, byte ped, byte magicnum)
+/* This slides the door open. (The data really ought to be saved in
+	the Also file, and will be next time. However, for now, they're
+	here.) */
+{
+	switch (_vm->_gyro.dna.room) {
+	case r__outsideyours:
+	case r__outsidenottspub:
+	case r__outsideducks: {
+		_vm->_sequence.first_show(1);
+		_vm->_sequence.then_show(2);
+		_vm->_sequence.then_show(3);
+	}
+	break;
+	case r__insidecardiffcastle: {
+		_vm->_sequence.first_show(1);
+		_vm->_sequence.then_show(5);
+	}
+	break;
+	case r__avvysgarden:
+	case r__entrancehall:
+	case r__insideabbey: {
+		_vm->_sequence.first_show(1);
+		_vm->_sequence.then_show(2);
+	}
+	break;
+	case r__musicroom:
+	case r__outsideargentpub: {
+		_vm->_sequence.first_show(5);
+		_vm->_sequence.then_show(6);
+	}
+	break;
+	case r__lusties:
+		switch (magicnum) {
+		case 14:
+			if (_vm->_gyro.dna.avvys_in_the_cupboard) {
+				hide_in_the_cupboard();
+				_vm->_sequence.first_show(8);
+				_vm->_sequence.then_show(7);
+				_vm->_sequence.start_to_close();
+				return;
+			} else {
+				apped(1, 6);
+				tr[1].face = right; /* added by TT 12/3/1995 */
+				_vm->_sequence.first_show(8);
+				_vm->_sequence.then_show(9);
 			}
+			break;
+		case 12: {
+			_vm->_sequence.first_show(4);
+			_vm->_sequence.then_show(5);
+			_vm->_sequence.then_show(6);
+		}
+		break;
 		}
+		break;
 	}
 
-	void apped(byte trn, byte np) {
-		tr[trn].appear(tr[trn].x - tr[trn].a.xl / 2, tr[trn].y - tr[trn].a.yl, Gyro::peds[np].dir);
-		rwsp(trn, Gyro::peds[np].dir);
-	}
+	_vm->_sequence.then_flip(whither, ped);
+	_vm->_sequence.start_to_open();
+}
 
+void Trip::newspeed() {
+/* Given that you've just changed the speed in triptype.xs, this adjusts
+	ix. */
+	warning("STUB: Trip::newspeed()");
+}
 
+void Trip::rwsp(byte t, byte r) {
+	{
+		switch (r) {
+		case up:
+			tr[t].speed(0, -tr[t].ys);
+			break;
+		case down:
+			tr[t].speed(0, tr[t].ys);
+			break;
+		case left:
+			tr[t].speed(-tr[t].xs,  0);
+			break;
+		case right:
+			tr[t].speed(tr[t].xs,  0);
+			break;
+		case ul:
+			tr[t].speed(-tr[t].xs, -tr[t].ys);
+			break;
+		case ur:
+			tr[t].speed(tr[t].xs, -tr[t].ys);
+			break;
+		case dl:
+			tr[t].speed(-tr[t].xs, tr[t].ys);
+			break;
+		case dr:
+			tr[t].speed(tr[t].xs, tr[t].ys);
+			break;
+		}
+	}
+}
 
-	void getback();
+void Trip::apped(byte trn, byte np) {
+	tr[trn].appear(tr[trn].x - tr[trn].a.xl / 2, tr[trn].y - tr[trn].a.yl, _vm->_gyro.peds[np].dir);
+	rwsp(trn, _vm->_gyro.peds[np].dir);
+}
 
-	static Gyro::bytefield r;
 
-	/*   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
-	   begin { By De Morgan's law: }
-		overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
-	   end;*/
-	/* x1,x2 - as Gyro::bytefield, but *8. y1,y2 - as Gyro::bytefield.
-	  x3,y3 = mx,my. x4,y4 = mx+16,my+16. */
-	static bool overlaps_with_mouse() {
-		bool overlaps_with_mouse_result;
-		overlaps_with_mouse_result =
-			(r.x2 * 8 >= Gyro::mx) && (Gyro::mx + 16 >= r.x1 * 8) && (r.y2 >= Gyro::my) && (Gyro::my + 16 >= r.y1);
-		return overlaps_with_mouse_result;
-	}
 
-	void getback() {
-		byte fv;
-		bool endangered;
+/*   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
+	begin { By De Morgan's law: }
+	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
+	end;*/
+/* x1,x2 - as _vm->_gyro.bytefield, but *8. y1,y2 - as _vm->_gyro.bytefield.
+	x3,y3 = mx,my. x4,y4 = mx+16,my+16. */
+bool Trip::overlaps_with_mouse() {
+	bool overlaps_with_mouse_result;
+	overlaps_with_mouse_result =
+		(r.x2 * 8 >= _vm->_gyro.mx) && (_vm->_gyro.mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro.my) && (_vm->_gyro.my + 16 >= r.y1);
+	return overlaps_with_mouse_result;
+}
 
+void Trip::getback() {
+	byte fv;
+	bool endangered;
 
-		endangered = false;
-		/* Super_Off;*/
 
-		{
-			while (getset[1 - Gyro::cp].numleft > 0) {
-				getset[1 - Gyro::cp].recall(r);
+	endangered = false;
+	/* Super_Off;*/
 
-				/*    if overlaps_with_mouse and not endangered then
-					begin
-					 endangered:=true;
-					 blitfix;
-					 Super_Off;
-					end;*/
+	{
+		while (getset[1 - _vm->_gyro.cp].numleft > 0) {
+			getset[1 - _vm->_gyro.cp].recall(r);
 
-				Lucerna::mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - Gyro::cp);
-			}
-		}
+			/*    if overlaps_with_mouse and not endangered then
+				begin
+					endangered:=true;
+					blitfix;
+					Super_Off;
+				end;*/
 
-		Lucerna::blitfix();
-		/*if endangered then*/ /*Super_On;*/
+			_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
+		}
 	}
 
-	/* Eachstep procedures: */
-	void follow_avvy_y(byte tripnum) {
-		if (tr[1].face == left)
+	_vm->_lucerna.blitfix();
+	/*if endangered then*/ /*Super_On;*/
+}
+
+/* Eachstep procedures: */
+void Trip::follow_avvy_y(byte tripnum) {
+	if (tr[1].face == left)
+		return;
+	if (tr[tripnum].homing)
+		tr[tripnum].hy = tr[1].y;
+	else {
+		if (tr[tripnum].y < tr[1].y)
+			tr[tripnum].y += 1;
+		else if (tr[tripnum].y > tr[1].y)
+			tr[tripnum].y -= 1;
+		else
 			return;
-		if (tr[tripnum].homing)
-			tr[tripnum].hy = tr[1].y;
-		else {
-			if (tr[tripnum].y < tr[1].y)
-				tr[tripnum].y += 1;
-			else if (tr[tripnum].y > tr[1].y)
-				tr[tripnum].y -= 1;
-			else
-				return;
-			if (tr[tripnum].ix == 0)  {
-				tr[tripnum].step += 1;
-				if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
-				tr[tripnum].count = 0;
-			}
+		if (tr[tripnum].ix == 0)  {
+			tr[tripnum].step += 1;
+			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+			tr[tripnum].count = 0;
 		}
 	}
+}
 
-	void back_and_forth(byte tripnum) {
-		if (! tr[tripnum].homing) {
-			if (tr[tripnum].face == right)
-				tr[tripnum].walkto(4);
-			else
-				tr[tripnum].walkto(5);
-		}
+void Trip::back_and_forth(byte tripnum) {
+	if (! tr[tripnum].homing) {
+		if (tr[tripnum].face == right)
+			tr[tripnum].walkto(4);
+		else
+			tr[tripnum].walkto(5);
 	}
+}
 
-	void face_avvy(byte tripnum) {
-		if (! tr[tripnum].homing) {
-			if (tr[1].x >= tr[tripnum].x)  tr[tripnum].face = right;
-			else tr[tripnum].face = left;
-		}
+void Trip::face_avvy(byte tripnum) {
+	if (! tr[tripnum].homing) {
+		if (tr[1].x >= tr[tripnum].x)  tr[tripnum].face = right;
+		else tr[tripnum].face = left;
 	}
+}
 
-	void arrow_procs(byte tripnum) {
-		byte fv;
+void Trip::arrow_procs(byte tripnum) {
+	byte fv;
 			
-		if (tr[tripnum].homing) {
-			/* Arrow is still in flight. */
-			/* We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
-				This is so if: a) the bottom of the arrow is below Avvy's head,
-				b) the left of the arrow is left of the right of Avvy's head, and
-				c) the right of the arrow is right of the left of Avvy's head. */
-			if (((tr[tripnum].y + tr[tripnum].a.yl) >= tr[1].y) /* A */
-					&& (tr[tripnum].x <= (tr[1].x + tr[1].a.xl)) /* B */
-					&& ((tr[tripnum].x + tr[tripnum].a.xl) >= tr[1].x)) { /* C */
-				/* OK, it's hit him... what now? */
-
-				tr[2].call_eachstep = false; /* prevent recursion. */
-				Visa::dixi('Q', 47); /* Complaint! */
-				tr[tripnum].done(); /* Deallocate the arrow. */
-				/*     tr[1].done; { Deallocate normal pic of Avvy. }
-
-						off;
-						for fv:=0 to 1 do
-						begin
-						cp:=1-cp;
-						getback;
-						end;
-						on;*/
-
-				Lucerna::gameover();
-
-				Gyro::dna.user_moves_avvy = false; /* Stop the user from moving him. */
-				Timeout::set_up_timer(55, Timeout::procnaughty_duke, Timeout::reason_naughty_duke);
-			}
-		} else { /* Arrow has hit the wall! */
+	if (tr[tripnum].homing) {
+		/* Arrow is still in flight. */
+		/* We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
+			This is so if: a) the bottom of the arrow is below Avvy's head,
+			b) the left of the arrow is left of the right of Avvy's head, and
+			c) the right of the arrow is right of the left of Avvy's head. */
+		if (((tr[tripnum].y + tr[tripnum].a.yl) >= tr[1].y) /* A */
+				&& (tr[tripnum].x <= (tr[1].x + tr[1].a.xl)) /* B */
+				&& ((tr[tripnum].x + tr[tripnum].a.xl) >= tr[1].x)) { /* C */
+			/* OK, it's hit him... what now? */
+
+			tr[2].call_eachstep = false; /* prevent recursion. */
+			_vm->_visa.dixi('Q', 47); /* Complaint! */
 			tr[tripnum].done(); /* Deallocate the arrow. */
-			Celer::show_one(3); /* Show pic of arrow stuck into the door. */
-			Gyro::dna.arrow_in_the_door = true; /* So that we can pick it up. */
+			/*     tr[1].done; { Deallocate normal pic of Avvy. }
+
+					off;
+					for fv:=0 to 1 do
+					begin
+					cp:=1-cp;
+					getback;
+					end;
+					on;*/
+
+			_vm->_lucerna.gameover();
+
+			_vm->_gyro.dna.user_moves_avvy = false; /* Stop the user from moving him. */
+			_vm->_timeout.set_up_timer(55, _vm->_timeout.procnaughty_duke, _vm->_timeout.reason_naughty_duke);
 		}
-		
+	} else { /* Arrow has hit the wall! */
+		tr[tripnum].done(); /* Deallocate the arrow. */
+		_vm->_celer.show_one(3); /* Show pic of arrow stuck into the door. */
+		_vm->_gyro.dna.arrow_in_the_door = true; /* So that we can pick it up. */
 	}
-
-	/*procedure Spludwick_procs(tripnum:byte);
-	var fv:byte;
+		
+}
+
+/*procedure Spludwick_procs(tripnum:byte);
+var fv:byte;
+begin
+	with tr[tripnum] do
+	if not homing then { We only need to do anything if Spludwick *stops*
+						walking. }
+	with _vm->_gyro.dna do
 	begin
-	 with tr[tripnum] do
-	  if not homing then { We only need to do anything if Spludwick *stops*
-						   walking. }
-	  with Gyro::dna do
-	   begin
-		inc(DogfoodPos);
-		if DogfoodPos=8 then DogfoodPos:=1;
-		walkto(DogfoodPos);
-	   end;
-	end;*/
-
-	void grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
-		byte fv;
-		int16 tox, toy;
+	inc(DogfoodPos);
+	if DogfoodPos=8 then DogfoodPos:=1;
+	walkto(DogfoodPos);
+	end;
+end;*/
+
+void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
+	byte fv;
+	int16 tox, toy;
 			
-		tox = tr[1].x + 17;
-		toy = tr[1].y - 1;
-		if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
-			tr[tripnum].call_eachstep = false;
-			tr[tripnum].face = left;
-			tr[tripnum].stopwalk();
-			/* ... whatever ... */
-		} else {
-			/* Still some way to go. */
-			if (tr[tripnum].x < tox) {
-				tr[tripnum].x += 5;
-				if (tr[tripnum].x > tox)  tr[tripnum].x = tox;
-			}
-			if (tr[tripnum].y < toy)  tr[tripnum].y += 1;
-			tr[tripnum].step += 1;
-			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
-		}
+	tox = tr[1].x + 17;
+	toy = tr[1].y - 1;
+	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
+		tr[tripnum].call_eachstep = false;
+		tr[tripnum].face = left;
+		tr[tripnum].stopwalk();
+		/* ... whatever ... */
+	} else {
+		/* Still some way to go. */
+		if (tr[tripnum].x < tox) {
+			tr[tripnum].x += 5;
+			if (tr[tripnum].x > tox)  tr[tripnum].x = tox;
+		}
+		if (tr[tripnum].y < toy)  tr[tripnum].y += 1;
+		tr[tripnum].step += 1;
+		if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
 	}
+}
 
 
 
-	void geida_procs(byte tripnum);
 
-	static void take_a_step(byte &tripnum) {
-		if (tr[tripnum].ix == 0) {
-			tr[tripnum].step += 1;
-			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
-			tr[tripnum].count = 0;
-		}
+
+void Trip::take_a_step(byte &tripnum) {
+	if (tr[tripnum].ix == 0) {
+		tr[tripnum].step += 1;
+		if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+		tr[tripnum].count = 0;
 	}
+}
 
-	static void spin(byte whichway, byte &tripnum) {
-		if (tr[tripnum].face != whichway) {
-			tr[tripnum].face = whichway;
-			if (tr[tripnum].whichsprite == 2)  return; /* Not for Spludwick */
+void Trip::spin(byte whichway, byte &tripnum) {
+	if (tr[tripnum].face != whichway) {
+		tr[tripnum].face = whichway;
+		if (tr[tripnum].whichsprite == 2)  return; /* Not for Spludwick */
 
-			Gyro::dna.geida_spin += 1;
-			Gyro::dna.geida_time = 20;
-			if (Gyro::dna.geida_spin == 5) {
-				Scrolls::display("Steady on, Avvy, you'll make the poor girl dizzy!");
-				Gyro::dna.geida_spin = 0;
-				Gyro::dna.geida_time = 0; /* knock out records */
-			}
+		_vm->_gyro.dna.geida_spin += 1;
+		_vm->_gyro.dna.geida_time = 20;
+		if (_vm->_gyro.dna.geida_spin == 5) {
+			_vm->_scrolls.display("Steady on, Avvy, you'll make the poor girl dizzy!");
+			_vm->_gyro.dna.geida_spin = 0;
+			_vm->_gyro.dna.geida_time = 0; /* knock out records */
 		}
 	}
+}
 
-	void geida_procs(byte tripnum) {
-		if (Gyro::dna.geida_time > 0) {
-			Gyro::dna.geida_time -= 1;
-			if (Gyro::dna.geida_time == 0)  Gyro::dna.geida_spin = 0;
-		}
-
-		if (tr[tripnum].y < (tr[1].y - 2)) {
-			/* Geida is further from the screen than Avvy. */
-			spin(down, tripnum);
-			tr[tripnum].iy = 1;
-			tr[tripnum].ix = 0;
-			take_a_step(tripnum);
-			return;
-		} else if (tr[tripnum].y > (tr[1].y + 2)) {
-			/* Avvy is further from the screen than Geida. */
-			spin(up, tripnum);
-			tr[tripnum].iy = -1;
-			tr[tripnum].ix = 0;
-			take_a_step(tripnum);
-			return;
-		}
+void Trip::geida_procs(byte tripnum) {
+	if (_vm->_gyro.dna.geida_time > 0) {
+		_vm->_gyro.dna.geida_time -= 1;
+		if (_vm->_gyro.dna.geida_time == 0)  _vm->_gyro.dna.geida_spin = 0;
+	}
 
-		tr[tripnum].iy = 0;
-		if (tr[tripnum].x < tr[1].x - tr[1].xs * 8) {
-			tr[tripnum].ix = tr[1].xs;
-			spin(right, tripnum);
-			take_a_step(tripnum);
-		} else if (tr[tripnum].x > tr[1].x + tr[1].xs * 8) {
-			tr[tripnum].ix = -tr[1].xs;
-			spin(left, tripnum);
-			take_a_step(tripnum);
-		} else tr[tripnum].ix = 0;
+	if (tr[tripnum].y < (tr[1].y - 2)) {
+		/* Geida is further from the screen than Avvy. */
+		spin(down, tripnum);
+		tr[tripnum].iy = 1;
+		tr[tripnum].ix = 0;
+		take_a_step(tripnum);
+		return;
+	} else if (tr[tripnum].y > (tr[1].y + 2)) {
+		/* Avvy is further from the screen than Geida. */
+		spin(up, tripnum);
+		tr[tripnum].iy = -1;
+		tr[tripnum].ix = 0;
+		take_a_step(tripnum);
+		return;
 	}
 
-	/* That's all... */
+	tr[tripnum].iy = 0;
+	if (tr[tripnum].x < tr[1].x - tr[1].xs * 8) {
+		tr[tripnum].ix = tr[1].xs;
+		spin(right, tripnum);
+		take_a_step(tripnum);
+	} else if (tr[tripnum].x > tr[1].x + tr[1].xs * 8) {
+		tr[tripnum].ix = -tr[1].xs;
+		spin(left, tripnum);
+		take_a_step(tripnum);
+	} else tr[tripnum].ix = 0;
+}
+
+/* That's all... */
+
+void Trip::call_andexors() {
+	byte order[5];
+	byte fv, temp;
+	bool ok;
+
+	for (int i = 0; i < 5; i++)
+		order[i] = 0;
+
+	for (fv = 1; fv <= numtr; fv ++) {
+		if (tr[fv].quick && tr[fv].visible)
+			order[fv] = fv;
+	}
 
-	void call_andexors() {
-		byte order[5];
-		byte fv, temp;
-		bool ok;
+	do {
+		ok = true;
+		for (fv = 1; fv <= 4; fv ++)
+			if (((order[fv] != 0) && (order[fv + 1] != 0))
+					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
+				/* Swap them! */
+				temp = order[fv];
+				order[fv] = order[fv + 1];
+				order[fv + 1] = temp;
+				ok = false;
+			}
+	} while (!ok);
 
-		for (int i = 0; i < 5; i++)
-			order[i] = 0;
+	for (fv = 1; fv <= 5; fv ++)
+		if (order[fv] > 0)
+			tr[order[fv]].andexor();
+}
 
-		for (fv = 1; fv <= numtr; fv ++) {
-			if (tr[fv].quick && tr[fv].visible)
-				order[fv] = fv;
-		}
+void Trip::trippancy_link() {
+	byte fv;
 
-		do {
-			ok = true;
-			for (fv = 1; fv <= 4; fv ++)
-				if (((order[fv] != 0) && (order[fv + 1] != 0))
-						&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
-					/* Swap them! */
-					temp = order[fv];
-					order[fv] = order[fv + 1];
-					order[fv + 1] = temp;
-					ok = false;
-				}
-		} while (!ok);
-
-		for (fv = 1; fv <= 5; fv ++)
-			if (order[fv] > 0)
-				tr[order[fv]].andexor();
-	}
-
-	void trippancy_link() {
-		byte fv;
-
-		if (Gyro::ddmnow | Gyro::ontoolbar | Gyro::seescroll)  return;
-		for (fv = 1; fv <= numtr; fv ++) {
-			if (tr[fv].quick)
-				tr[fv].walk();
-		}
+	if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)  return;
+	for (fv = 1; fv <= numtr; fv ++) {
+		if (tr[fv].quick)
+			tr[fv].walk();
+	}
 
-		call_andexors();
-		for (fv = 1; fv <= numtr; fv ++) {
-			triptype &with = tr[fv];
-			if (with.quick && with.call_eachstep) {
-				switch (tr[fv].eachstep) {
-				case procfollow_avvy_y :
-					follow_avvy_y(fv);
-					break;
-				case procback_and_forth :
-					back_and_forth(fv);
-					break;
-				case procface_avvy :
-					face_avvy(fv);
-					break;
-				case procarrow_procs :
-					arrow_procs(fv);
-					break;
-					/*    PROCSpludwick_procs : spludwick_procs(fv);*/
-				case procgrab_avvy :
-					grab_avvy(fv);
-					break;
-				case procgeida_procs :
-					geida_procs(fv);
-					break;
-				}
+	call_andexors();
+	for (fv = 1; fv <= numtr; fv ++) {
+		triptype &with = tr[fv];
+		if (with.quick && with.call_eachstep) {
+			switch (tr[fv].eachstep) {
+			case procfollow_avvy_y :
+				follow_avvy_y(fv);
+				break;
+			case procback_and_forth :
+				back_and_forth(fv);
+				break;
+			case procface_avvy :
+				face_avvy(fv);
+				break;
+			case procarrow_procs :
+				arrow_procs(fv);
+				break;
+				/*    PROCSpludwick_procs : spludwick_procs(fv);*/
+			case procgrab_avvy :
+				grab_avvy(fv);
+				break;
+			case procgeida_procs :
+				geida_procs(fv);
+				break;
 			}
 		}
-		if (mustexclaim) {
-			mustexclaim = false;
-			Visa::dixi('x', saywhat);
-		}
 	}
-
-	void get_back_loretta() {
-		byte fv;
-
-		/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
-		for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
-				getback();
-				return;
-			}
-		/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
+	if (mustexclaim) {
+		mustexclaim = false;
+		_vm->_visa.dixi('x', saywhat);
 	}
+}
 
-	void stopwalking() {
-		tr[1].stopwalk();
-		Gyro::dna.rw = stopped;
-		if (Gyro::alive)
-			tr[1].step = 1;
-	}
+void Trip::get_back_loretta() {
+	byte fv;
 
-	void tripkey(char dir) {
-		if ((Gyro::ctrl == Gyro::cjoy) | (! Gyro::dna.user_moves_avvy))
+	/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
+	for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
+			getback();
 			return;
+		}
+	/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
+}
+
+void Trip::stopwalking() {
+	tr[1].stopwalk();
+	_vm->_gyro.dna.rw = stopped;
+	if (_vm->_gyro.alive)
+		tr[1].step = 1;
+}
+
+void Trip::tripkey(char dir) {
+	if ((_vm->_gyro.ctrl == cjoy) | (! _vm->_gyro.dna.user_moves_avvy))
+		return;
 
+	{
+		triptype &with = tr[1];
 		{
-			triptype &with = tr[1];
-			{
-				switch (dir) {
-				case 'H':
-					if (Gyro::dna.rw != up) {
-						Gyro::dna.rw = up;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'P':
-					if (Gyro::dna.rw != down) {
-						Gyro::dna.rw = down;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'K':
-					if (Gyro::dna.rw != left) {
-						Gyro::dna.rw = left;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'M':
-					if (Gyro::dna.rw != right) {
-						Gyro::dna.rw = right;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'I':
-					if (Gyro::dna.rw != ur) {
-						Gyro::dna.rw = ur;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'Q':
-					if (Gyro::dna.rw != dr) {
-						Gyro::dna.rw = dr;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'O':
-					if (Gyro::dna.rw != dl) {
-						Gyro::dna.rw = dl;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'G':
-					if (Gyro::dna.rw != ul) {
-						Gyro::dna.rw = ul;
-						rwsp(1, Gyro::dna.rw);
-					} else stopwalking();
-					break;
-				case 'L':
-					stopwalking();
-					break;
-				}
+			switch (dir) {
+			case 'H':
+				if (_vm->_gyro.dna.rw != up) {
+					_vm->_gyro.dna.rw = up;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'P':
+				if (_vm->_gyro.dna.rw != down) {
+					_vm->_gyro.dna.rw = down;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'K':
+				if (_vm->_gyro.dna.rw != left) {
+					_vm->_gyro.dna.rw = left;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'M':
+				if (_vm->_gyro.dna.rw != right) {
+					_vm->_gyro.dna.rw = right;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'I':
+				if (_vm->_gyro.dna.rw != ur) {
+					_vm->_gyro.dna.rw = ur;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'Q':
+				if (_vm->_gyro.dna.rw != dr) {
+					_vm->_gyro.dna.rw = dr;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'O':
+				if (_vm->_gyro.dna.rw != dl) {
+					_vm->_gyro.dna.rw = dl;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'G':
+				if (_vm->_gyro.dna.rw != ul) {
+					_vm->_gyro.dna.rw = ul;
+					rwsp(1, _vm->_gyro.dna.rw);
+				} else stopwalking();
+				break;
+			case 'L':
+				stopwalking();
+				break;
 			}
 		}
 	}
+}
 
-	void readstick() {
-		warning("STUB: Trip::readstick()");
-	}
+void Trip::readstick() {
+	warning("STUB: Trip::readstick()");
+}
 
-	void getsetclear() {
-		byte fv;
+void Trip::getsetclear() {
+	byte fv;
 
-		for (fv = 0; fv <= 1; fv ++)
-			getset[fv].init();
-	}
+	for (fv = 0; fv <= 1; fv ++)
+		getset[fv].init();
+}
 
-	void hide_in_the_cupboard() {
-		const char nowt = 250; /* As in Acci. */
+void Trip::hide_in_the_cupboard() {
+	const char nowt = 250; /* As in Acci. */
 
-		if (Gyro::dna.avvys_in_the_cupboard) {
-			if (Gyro::dna.wearing == nowt)
-				Scrolls::display("\6AVVY!\22 Get dressed first!");
-			else {
-				tr[1].visible = true;
-				Gyro::dna.user_moves_avvy = true;
-				apped(1, 3); /* Walk out of the cupboard. */
-				Scrolls::display("You leave the cupboard. Nice to be out of there!");
-				Gyro::dna.avvys_in_the_cupboard = false;
-				Sequence::first_show(8);
-				Sequence::then_show(7);
-				Sequence::start_to_close;
-			}
-		} else {
-			/* Not hiding in the cupboard */
-			tr[1].visible = false;
-			Gyro::dna.user_moves_avvy = false;
-			Scrolls::display(Common::String("You walk into the room...\20It seems to be an empty, ") +
-					"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
-					"avoid suffocation.");
-			Gyro::dna.avvys_in_the_cupboard = true;
-			Celer::show_one(8);
-		}
+	if (_vm->_gyro.dna.avvys_in_the_cupboard) {
+		if (_vm->_gyro.dna.wearing == nowt)
+			_vm->_scrolls.display("\6AVVY!\22 Get dressed first!");
+		else {
+			tr[1].visible = true;
+			_vm->_gyro.dna.user_moves_avvy = true;
+			apped(1, 3); /* Walk out of the cupboard. */
+			_vm->_scrolls.display("You leave the cupboard. Nice to be out of there!");
+			_vm->_gyro.dna.avvys_in_the_cupboard = false;
+			_vm->_sequence.first_show(8);
+			_vm->_sequence.then_show(7);
+			_vm->_sequence.start_to_close();
+		}
+	} else {
+		/* Not hiding in the cupboard */
+		tr[1].visible = false;
+		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_scrolls.display(Common::String("You walk into the room...\20It seems to be an empty, ") +
+				"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
+				"avoid suffocation.");
+		_vm->_gyro.dna.avvys_in_the_cupboard = true;
+		_vm->_celer.show_one(8);
 	}
+}
 
 
 
-	void fliproom(byte room, byte ped);
 
-	static int16 beforex, beforey;
 
-	static void tidy_after_mouse();
 
-	static void tidy_up(int16 a, int16 b, int16 c, int16 d) {
-		warning("STUB: Trip::tidy_up()");
-	}
 
 
 
-	static void tidy_after_mouse() {
-		tidy_up(beforex, beforey, beforex + 15, beforey + 15);
-		Gyro::xycheck();
-		tidy_up(Gyro::mx, Gyro::my, Gyro::mx + 15, Gyro::my + 15);
-	}
+void Trip::tidy_up(int16 a, int16 b, int16 c, int16 d) {
+	warning("STUB: Trip::tidy_up()");
+}
 
-	void fliproom(byte room, byte ped) {
-		byte fv;
 
 
-		if (! Gyro::alive) {
-			/* You can't leave the room if you're dead. */
-			tr[1].ix = 0;
-			tr[1].iy = 0; /* Stop him from moving. */
-			return;
-		}
-
-		if ((ped == 177) && (Gyro::dna.room == r__lusties)) {
-			hide_in_the_cupboard();
-			return;
-		}
+void Trip::tidy_after_mouse() {
+	tidy_up(beforex, beforey, beforex + 15, beforey + 15);
+	_vm->_gyro.xycheck();
+	tidy_up(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.mx + 15, _vm->_gyro.my + 15);
+}
 
-		if ((Gyro::dna.jumpstatus > 0) && (Gyro::dna.room == r__insidecardiffcastle)) {
-			/* You can't *jump* out of Cardiff Castle! */
-			tr[1].ix = 0;
-			return;
-		}
+void Trip::fliproom(byte room, byte ped) {
+	byte fv;
 
-		Gyro::xycheck();
-		beforex = Gyro::mx;
-		beforey = Gyro::my;
 
-		Lucerna::exitroom(Gyro::dna.room);
-		Lucerna::dusk();
-		getsetclear();
+	if (! _vm->_gyro.alive) {
+		/* You can't leave the room if you're dead. */
+		tr[1].ix = 0;
+		tr[1].iy = 0; /* Stop him from moving. */
+		return;
+	}
 
+	if ((ped == 177) && (_vm->_gyro.dna.room == r__lusties)) {
+		hide_in_the_cupboard();
+		return;
+	}
 
-		for (fv = 2; fv <= numtr; fv ++) {
-			if (tr[fv].quick)
-				tr[fv].done();
-		} /* Deallocate sprite */
+	if ((_vm->_gyro.dna.jumpstatus > 0) && (_vm->_gyro.dna.room == r__insidecardiffcastle)) {
+		/* You can't *jump* out of Cardiff Castle! */
+		tr[1].ix = 0;
+		return;
+	}
 
-		if (Gyro::dna.room == r__lustiesroom)
-			Gyro::dna.enter_catacombs_from_lusties_room = true;
+	_vm->_gyro.xycheck();
+	beforex = _vm->_gyro.mx;
+	beforey = _vm->_gyro.my;
 
-		Lucerna::enterroom(room, ped);
-		apped(1, ped);
-		Gyro::dna.enter_catacombs_from_lusties_room = false;
-		Gyro::oldrw = Gyro::dna.rw;
-		Gyro::dna.rw = tr[1].face;
-		Lucerna::showrw;
+	_vm->_lucerna.exitroom(_vm->_gyro.dna.room);
+	_vm->_lucerna.dusk();
+	getsetclear();
 
-		for (fv = 0; fv <= 1; fv ++) {
-			Gyro::cp = 1 - Gyro::cp;
-			getback();
-		}
-		Lucerna::dawn;
 
-		/* Tidy up after mouse. I know it's a kludge... */
-		/*  tidy_after_mouse;*/
-	}
+	for (fv = 2; fv <= numtr; fv ++) {
+		if (tr[fv].quick)
+			tr[fv].done();
+	} /* Deallocate sprite */
 
-	bool infield(byte which) {
-	/* returns True if you're within field "which" */
-		int16 yy;
-		
-		yy = tr[1].y + tr[1].a.yl;
+	if (_vm->_gyro.dna.room == r__lustiesroom)
+		_vm->_gyro.dna.enter_catacombs_from_lusties_room = true;
 
-		return (tr[1].x >= Gyro::fields[which].x1) && (tr[1].x <= Gyro::fields[which].x2)
-			&& (yy >= Gyro::fields[which].y1) && (yy <= Gyro::fields[which].y2);
+	_vm->_lucerna.enterroom(room, ped);
+	apped(1, ped);
+	_vm->_gyro.dna.enter_catacombs_from_lusties_room = false;
+	_vm->_gyro.oldrw = _vm->_gyro.dna.rw;
+	_vm->_gyro.dna.rw = tr[1].face;
+	_vm->_lucerna.showrw();
 
+	for (fv = 0; fv <= 1; fv ++) {
+		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
+		getback();
 	}
+	_vm->_lucerna.dawn();
 
-	bool neardoor() {       /* returns True if you're near a door! */
-		int16 ux, uy;
-		byte fv;
-		bool nd;
+	/* Tidy up after mouse. I know it's a kludge... */
+	/*  tidy_after_mouse;*/
+}
 
-		bool neardoor_result;
-		if (Gyro::numfields < 9) {
-			/* there ARE no doors here! */
-			neardoor_result = false;
-			return neardoor_result;
-		}
+bool Trip::infield(byte which) {
+/* returns True if you're within field "which" */
+	int16 yy;
 		
-		ux = tr[1].x;
-		uy = tr[1].y + tr[1].a.yl;
-		
-		nd = false;
-		for (fv = 9; fv <= Gyro::numfields; fv ++) {
-			Gyro::fields[fv];
+	yy = tr[1].y + tr[1].a.yl;
 
-			if ((ux >= Gyro::fields[fv].x1) && (ux <= Gyro::fields[fv].x2)
-				&& (uy >= Gyro::fields[fv].y1) && (uy <= Gyro::fields[fv].y2)) 
-					nd = true;
-		}
-		return nd;
-	}
+	return (tr[1].x >= _vm->_gyro.fields[which].x1) && (tr[1].x <= _vm->_gyro.fields[which].x2)
+		&& (yy >= _vm->_gyro.fields[which].y1) && (yy <= _vm->_gyro.fields[which].y2);
 
-	void new_game_for_trippancy() {   /* Called by gyro.newgame */
-		tr[1].visible = false;
-	}
+}
+
+bool Trip::neardoor() {       /* returns True if you're near a door! */
+	int16 ux, uy;
+	byte fv;
+	bool nd;
 
-	void triptype::save_data_to_mem(uint16 &where) {
-		warning("STUB: Trip::save_data_to_mem()");
+	bool neardoor_result;
+	if (_vm->_gyro.numfields < 9) {
+		/* there ARE no doors here! */
+		neardoor_result = false;
+		return neardoor_result;
 	}
+		
+	ux = tr[1].x;
+	uy = tr[1].y + tr[1].a.yl;
+		
+	nd = false;
+	for (fv = 9; fv <= _vm->_gyro.numfields; fv ++) {
+		_vm->_gyro.fields[fv];
 
-	void triptype::load_data_from_mem(uint16 &where) {
-		warning("STUB: Trip::load_data_from_mem()");
+		if ((ux >= _vm->_gyro.fields[fv].x1) && (ux <= _vm->_gyro.fields[fv].x2)
+			&& (uy >= _vm->_gyro.fields[fv].y1) && (uy <= _vm->_gyro.fields[fv].y2)) 
+				nd = true;
 	}
+	return nd;
+}
 
-	} // End of namespace Trip.
+void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
+	tr[1].visible = false;
+}
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 0227bab..be805fb 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -39,142 +39,170 @@
 #include "avalanche/gyro2.h"
 
 namespace Avalanche {
+class AvalancheEngine;
+
+
+typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
+// Be aware!!!
+
+typedef byte siltype[51][11]; /* 35, 4 */
+
+struct adxtype { /* Second revision of ADX type */
+	Common::String name; /* name of character */
+	Common::String comment; /* comment */
+	byte num; /* number of pictures */
+	byte xl, yl; /* x & y lengths of pictures */
+	byte seq; /* how many in one stride */
+	uint16 size; /* the size of one picture */
+	byte fgc, bgc; /* foreground & background bubble colours */
+	byte accinum; /* the number according to Acci (1=Avvy, etc.) */
+};
+
+struct trip_saver_type {
+	byte whichsprite;
+	byte face;
+	byte step;
+	int16 x;
+	int16 y;
+	int8 ix;
+	int8 iy;
+	bool visible;
+	bool homing;
+	bool check_me;
+	byte count;
+	byte xw, xs, ys;
+	byte totalnum;
+	int16 hx;
+	int16 hy;
+	bool call_eachstep;
+	byte eachstep;
+	bool vanishifstill;
+};
+
+
+class Trip;
+
+class triptype {
+public:
+	adxtype a; /* vital statistics */
+	byte face, step;
+	int16 x, y; /* current xy coords */
+	int16 ox[2], oy[2];  /* last xy coords */
+	int8 ix, iy; /* amount to move sprite by, each step */
+	manitype *mani[24];
+	siltype *sil[24];
+	byte whichsprite;
+	bool quick, visible, homing, check_me;
+	int16 hx, hy; /* homing x & y coords */
+	byte count; /* counts before changing step */
+	byte xw; /* x-width in bytes */
+	byte xs, ys; /* x & y speed */
+	byte totalnum; /* total number of sprites */
+	bool vanishifstill; /* Do we show this sprite if it's still? */
+
+	bool call_eachstep; /* Do we call the eachstep procedure? */
+	byte eachstep;
+
+	triptype *init(byte spritenum, bool do_check, Trip *tr);
+	/* loads & sets up the sprite */
+	void original();    /* just sets Quick to false */
+	void andexor();    /* drops sprite onto screen */
+	void turn(byte whichway);      /* turns him round */
+	void appear(int16 wx, int16 wy, byte wf); /* switches him on */
+	void bounce();    /* bounces off walls. */
+	void walk();    /* prepares for andexor, etc. */
+	void walkto(byte pednum);      /* home in on a point */
+	void stophoming();    /* self-explanatory */
+	void homestep();    /* calculates ix & iy for one homing step */
+	void speed(int8 xx, int8 yy); /* sets ix & iy, non-homing, etc */
+	void stopwalk();    /* Stops the sprite from moving */
+	void chatter();    /* Sets up talk vars */
+	void set_up_saver(trip_saver_type &v);
+	void unload_saver(trip_saver_type v);
+
+	void savedata(/*untyped_file &f*/); /* Self-explanatory, */
+	void loaddata(/*untyped_file &f*/);  /* really. */
+
+	void save_data_to_mem(uint16 &where);
+	void load_data_from_mem(uint16 &where);
+	triptype *done();
+
+private:
+	Trip *_tr;
+
+	bool collision_check();
+
+	int8 sgn(int16 x);
+};
+
+
+
+const int16 maxgetset = 35;
+
+class getsettype {
+public:
+	bytefield gs[maxgetset];
+	byte numleft;
+
+	getsettype *init();
+	void remember(bytefield r);
+	void recall(bytefield &r);
+};
+
+
+
+
+
+
+
+
+
+
+
+
+class Trip {
+public:
+	friend triptype;
+	friend getsettype;
 
-	namespace Trip {
-
-	// Call it where Trip is first used.
-	// Procuded to replace the initizalization part of the original Pascal unit.
-	void initialize_trip();
-
-	const int16 maxgetset = 35;
-
-	typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
-	// Be aware!!!
-
-	typedef byte siltype[51][11]; /* 35, 4 */
-
-	struct adxtype { /* Second revision of ADX type */
-		Common::String name; /* name of character */
-		Common::String comment; /* comment */
-		byte num; /* number of pictures */
-		byte xl, yl; /* x & y lengths of pictures */
-		byte seq; /* how many in one stride */
-		uint16 size; /* the size of one picture */
-		byte fgc, bgc; /* foreground & background bubble colours */
-		byte accinum; /* the number according to Acci (1=Avvy, etc.) */
-	};
-
-	struct trip_saver_type {
-		byte whichsprite;
-		byte face;
-		byte step;
-		int16 x;
-		int16 y;
-		int8 ix;
-		int8 iy;
-		bool visible;
-		bool homing;
-		bool check_me;
-		byte count;
-		byte xw, xs, ys;
-		byte totalnum;
-		int16 hx;
-		int16 hy;
-		bool call_eachstep;
-		byte eachstep;
-		bool vanishifstill;
-	};
-
-	class triptype {
-	public:
-		adxtype a; /* vital statistics */
-		byte face, step;
-		int16 x, y; /* current xy coords */
-		int16 ox[2], oy[2];  /* last xy coords */
-		int8 ix, iy; /* amount to move sprite by, each step */
-		manitype *mani[24];
-		siltype *sil[24];
-		byte whichsprite;
-		bool quick, visible, homing, check_me;
-		int16 hx, hy; /* homing x & y coords */
-		byte count; /* counts before changing step */
-		byte xw; /* x-width in bytes */
-		byte xs, ys; /* x & y speed */
-		byte totalnum; /* total number of sprites */
-		bool vanishifstill; /* Do we show this sprite if it's still? */
-
-		bool call_eachstep; /* Do we call the eachstep procedure? */
-		byte eachstep;
-
-		triptype *init(byte spritenum, bool do_check);
-		/* loads & sets up the sprite */
-		void original();    /* just sets Quick to false */
-		void andexor();    /* drops sprite onto screen */
-		void turn(byte whichway);      /* turns him round */
-		void appear(int16 wx, int16 wy, byte wf); /* switches him on */
-		void bounce();    /* bounces off walls. */
-		void walk();    /* prepares for andexor, etc. */
-		void walkto(byte pednum);      /* home in on a point */
-		void stophoming();    /* self-explanatory */
-		void homestep();    /* calculates ix & iy for one homing step */
-		void speed(int8 xx, int8 yy); /* sets ix & iy, non-homing, etc */
-		void stopwalk();    /* Stops the sprite from moving */
-		void chatter();    /* Sets up talk vars */
-		void set_up_saver(trip_saver_type &v);
-		void unload_saver(trip_saver_type v);
-
-		void savedata(/*untyped_file &f*/); /* Self-explanatory, */
-		void loaddata(/*untyped_file &f*/);  /* really. */
-		
 	
 
 
-		void save_data_to_mem(uint16 &where);
-		void load_data_from_mem(uint16 &where);
-		triptype *done();
 
-	private:
-		bool collision_check();
-	};
 
-	class getsettype {
-	public:
-		Gyro::bytefield gs[maxgetset];
-		byte numleft;
 
-		getsettype *init();
-		void remember(Gyro::bytefield r);
-		void recall(Gyro::bytefield &r);
-	};
 
+	Trip();
+
+	void setParent(AvalancheEngine *vm);
 
-	const int16 up = 0;
-	const int16 right = 1;
-	const int16 down = 2;
-	const int16 left = 3;
-	const int16 ur = 4;
-	const int16 dr = 5;
-	const int16 dl = 6;
-	const int16 ul = 7;
-	const int16 stopped = 8;
+	static const int16 up = 0;
+	static const int16 right = 1;
+	static const int16 down = 2;
+	static const int16 left = 3;
+	static const int16 ur = 4;
+	static const int16 dr = 5;
+	static const int16 dl = 6;
+	static const int16 ul = 7;
+	static const int16 stopped = 8;
 
-	const int16 numtr = 5; /* current max no. of sprites */
+	static const int16 numtr = 5; /* current max no. of sprites */
 
 
 
-	const int16 procfollow_avvy_y = 1;
+	static const int16 procfollow_avvy_y = 1;
 
-	const int16 procback_and_forth = 2;
+	static const int16 procback_and_forth = 2;
 
-	const int16 procface_avvy = 3;
+	static const int16 procface_avvy = 3;
 
-	const int16 procarrow_procs = 4;
+	static const int16 procarrow_procs = 4;
 
-	const int16 procspludwick_procs = 5;
+	static const int16 procspludwick_procs = 5;
 
-	const int16 procgrab_avvy = 6;
+	static const int16 procgrab_avvy = 6;
 
-	const int16 procgeida_procs = 7;
+	static const int16 procgeida_procs = 7;
 
 
 	void trippancy_link();
@@ -211,7 +239,7 @@ namespace Avalanche {
 
 	void new_game_for_trippancy();
 
-
+	void take_a_step(byte &tripnum);
 
 	triptype tr[numtr];
 	getsettype getset[2];
@@ -220,7 +248,45 @@ namespace Avalanche {
 	bool mustexclaim;
 	uint16 saywhat;
 
-	} // End of namespace Trip.
+private:
+	AvalancheEngine *_vm;
+
+	bytefield r;
+
+	int16 beforex, beforey;
+
+	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
+
+	byte geida_ped(byte which);
+
+	void dawndelay();
+
+	void hide_in_the_cupboard();
+
+	bool overlaps_with_mouse();
+
+	void follow_avvy_y(byte tripnum);
+
+	void back_and_forth(byte tripnum);
+
+	void face_avvy(byte tripnum);
+
+	void arrow_procs(byte tripnum);
+
+	void grab_avvy(byte tripnum);
+
+	void spin(byte whichway, byte &tripnum);
+
+	void geida_procs(byte tripnum);
+
+	void call_andexors();
+
+	void getsetclear();
+
+	void tidy_up(int16 a, int16 b, int16 c, int16 d);
+
+	void tidy_after_mouse();
+};
 
 } // End of namespace Avalanche.
 


Commit: 17fe756073b922cbfae0bcbcbe3f1a54de4d62f6
    https://github.com/scummvm/scummvm/commit/17fe756073b922cbfae0bcbcbe3f1a54de4d62f6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T01:20:22-07:00

Commit Message:
AVALANCHE: Repair class Avalot.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f8dee8e..d090f8a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -47,6 +47,7 @@ namespace Avalanche {
 		_console = new AvalancheConsole(this);
 		_rnd = 0;
 
+		_avalot.setParent(this);
 		_gyro.setParent(this);
 		_enhanced.setParent(this);
 		_logger.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 4252301..f7f5b5b 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -29,6 +29,8 @@
 #define AVALANCHE_H
 
 #include "avalanche/console.h"
+
+#include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/enhanced2.h"
 #include "avalanche/logger2.h"
@@ -57,6 +59,7 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
+	Avalot _avalot;
 	Gyro _gyro;
 	Enhanced _enhanced;
 	Logger _logger;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 341efca..11186d0 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -28,6 +28,7 @@
 #include "common/str.h"
 #include "common/textconsole.h"
 
+#include "avalanche/avalanche.h"
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 
@@ -37,9 +38,9 @@ namespace Avalanche {
 		int16 gd, gm;
 
 		checkbreak = false;
-		Gyro::visible = Gyro::m_no;
-		Gyro::to_do = 0;
-		Gyro::lmo = false;
+		_vm->_gyro.visible = _vm->_gyro.m_no;
+		_vm->_gyro.to_do = 0;
+		_vm->_gyro.lmo = false;
 		// resetscroll(); Needs scrolls "unit" to make it work.
 
 		warning("STUB: Avalot::Avalot()");
@@ -47,6 +48,11 @@ namespace Avalanche {
 
 	}
 
+	void Avalot::setParent(AvalancheEngine *vm) {
+		_vm = vm;
+	}
+
+
 	void Avalot::run(Common::String arg) {
 		warning("STUB: Avalot::run(%s)", arg.c_str());
 	}
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 073b073..4c428b6 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -31,15 +31,21 @@
 #include "common/system.h"
 
 namespace Avalanche {
+class AvalancheEngine;
 
 class Avalot {
-private:
-	bool checkbreak; // Originally located in avalot9.map
-
 public:
 	Avalot();
 
+	void setParent(AvalancheEngine *vm);
+
 	void run(Common::String arg);
+
+private:
+	AvalancheEngine *_vm;
+
+	bool checkbreak; // Originally located in avalot9.map
+
 };
 
 } // End of namespace Avalanche


Commit: 90bc42f5c296ebfe6794772cc879c50944808821
    https://github.com/scummvm/scummvm/commit/90bc42f5c296ebfe6794772cc879c50944808821
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T01:23:21-07:00

Commit Message:
AVALANCHE: Repair compilation.

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 6c596d2..3d022fb 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -199,15 +199,6 @@ public:
 	byte col;
 };
 
-struct adxtype {
-	Common::String name; /* name of character */
-	byte num; /* number of pictures */
-	byte xl, yl; /* x & y lengths of pictures */
-	byte seq; /* how many in one stride */
-	uint16 size; /* the size of one picture */
-	byte fgc, bgc; /* foreground & background bubble colours */
-};
-
 typedef byte raw[256][16]; /* raw_font_type */
 
 enum controllers {cjoy, ckey};
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 79c3e04..2d9bd25 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -69,13 +69,13 @@ void Sequence::then_flip(byte where, byte ped) {
 }
 
 void Sequence::start_to_close() {
-	Timeout::lose_timer(Timeout::reason_sequencer);
-	Timeout::set_up_timer(7, Timeout::procsequence, Timeout::reason_sequencer);
+	_vm->_timeout.lose_timer(_vm->_timeout.reason_sequencer);
+	_vm->_timeout.set_up_timer(7, _vm->_timeout.procsequence, _vm->_timeout.reason_sequencer);
 }
 
 void Sequence::start_to_open() {
 	_vm->_gyro.dna.user_moves_avvy = false; /* They can't move. */
-	Trip::stopwalking(); /* And they're not moving now. */
+	_vm->_trip.stopwalking(); /* And they're not moving now. */
 	start_to_close(); /* Apart from that, it's the same thing. */
 }
 
@@ -93,7 +93,7 @@ void Sequence::call_sequencer() {
 		break; /* No more routines. */
 	case 177: {
 		_vm->_gyro.dna.user_moves_avvy = true;
-		Trip::fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */
+		_vm->_trip.fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */
 		if (seq[0] == 177)  shove_left();
 		}
 		break;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index a202aaf..fe5e5d9 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -263,8 +263,8 @@ void Timeout::avaricius_talks() {
 }
 
 void Timeout::urinate() {
-	Trip::tr[1].turn(Trip::up);
-	Trip::stopwalking();
+	_vm->_trip.tr[1].turn(_vm->_trip.up);
+	_vm->_trip.stopwalking();
 	_vm->_lucerna.showrw();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
 }
@@ -284,7 +284,7 @@ void Timeout::bang2() {
 
 void Timeout::stairs() {
 	_vm->_gyro.blip();
-	Trip::tr[0].walkto(4);
+	_vm->_trip.tr[0].walkto(4);
 	_vm->_celer.show_one(2);
 	_vm->_gyro.dna.brummie_stairs = 2;
 	_vm->_gyro.magics[11].op = _vm->_gyro.special;
@@ -320,39 +320,39 @@ void Timeout::get_tied_up() {
 	_vm->_visa.dixi('q', 34); /* ...Trouble! */
 	_vm->_gyro.dna.user_moves_avvy = false;
 	_vm->_gyro.dna.been_tied_up = true;
-	Trip::stopwalking();
-	Trip::tr[2].stopwalk();
-	Trip::tr[2].stophoming();
-	Trip::tr[2].call_eachstep = true;
-	Trip::tr[2].eachstep = Trip::procgrab_avvy;
+	_vm->_trip.stopwalking();
+	_vm->_trip.tr[2].stopwalk();
+	_vm->_trip.tr[2].stophoming();
+	_vm->_trip.tr[2].call_eachstep = true;
+	_vm->_trip.tr[2].eachstep = _vm->_trip.procgrab_avvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 
 void Timeout::get_tied_up2() {
-	Trip::tr[1].walkto(4);
-	Trip::tr[2].walkto(5);
+	_vm->_trip.tr[1].walkto(4);
+	_vm->_trip.tr[2].walkto(5);
 	_vm->_gyro.magics[4].op = _vm->_gyro.nix; /* No effect when you touch the boundaries. */
 	_vm->_gyro.dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
-	Trip::tr[2].check_me = false;
-	Trip::tr[1].init(7, true); /* Robin Hood */
+	_vm->_trip.tr[2].check_me = false;
+	_vm->_trip.tr[1].init(7, true, &_vm->_trip); /* Robin Hood */
 	_vm->_gyro.whereis[_vm->_gyro.probinhood] = r__robins;
-	Trip::apped(1, 2);
+	_vm->_trip.apped(1, 2);
 	_vm->_visa.dixi('q', 39);
-	Trip::tr[1].walkto(7);
+	_vm->_trip.tr[1].walkto(7);
 	set_up_timer(55, prochang_around2, reason_hanging_around);
 }
 
 void Timeout::hang_around2() {
 	_vm->_visa.dixi('q', 40);
-	Trip::tr[2].vanishifstill = false;
-	Trip::tr[2].walkto(4);
+	_vm->_trip.tr[2].vanishifstill = false;
+	_vm->_trip.tr[2].walkto(4);
 	_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = r__robins;
 	_vm->_visa.dixi('q', 41);
-	Trip::tr[1].done();
-	Trip::tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+	_vm->_trip.tr[1].done();
+	_vm->_trip.tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
 
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
 	/* Immediately call the following proc (when you have a chance). */
@@ -412,9 +412,9 @@ void Timeout::jacques_wakes_up() {
 void Timeout::naughty_duke()
 /* This is when the Duke comes in and takes your money. */
 {
-	Trip::tr[2].init(9, false); /* Here comes the Duke. */
-	Trip::apped(2, 1); /* He starts at the door... */
-	Trip::tr[2].walkto(3); /* He walks over to you. */
+	_vm->_trip.tr[2].init(9, false, &_vm->_trip); /* Here comes the Duke. */
+	_vm->_trip.apped(2, 1); /* He starts at the door... */
+	_vm->_trip.tr[2].walkto(3); /* He walks over to you. */
 
 	/* Let's get the door opening. */
 	_vm->_celer.show_one(1);
@@ -426,8 +426,8 @@ void Timeout::naughty_duke()
 
 void Timeout::naughty_duke2() {
 	_vm->_visa.dixi('q', 48); /* Ha ha, it worked again! */
-	Trip::tr[2].walkto(1); /* Walk to the door. */
-	Trip::tr[2].vanishifstill = true; /* Then go away! */
+	_vm->_trip.tr[2].walkto(1); /* Walk to the door. */
+	_vm->_trip.tr[2].vanishifstill = true; /* Then go away! */
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
@@ -444,7 +444,7 @@ void Timeout::jump() {
 		with.jumpstatus += 1;
 
 		{
-			Trip::triptype &with1 = Trip::tr[1];
+			triptype &with1 = _vm->_trip.tr[1];
 			switch (with.jumpstatus) {
 			case 1:
 			case 2:
@@ -477,7 +477,7 @@ void Timeout::jump() {
 		if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
 				&& (_vm->_gyro.dna.room == r__insidecardiffcastle)
 				&& (_vm->_gyro.dna.arrow_in_the_door == true)
-				&& (Trip::infield(3))) { /* beside the wall*/
+				&& (_vm->_trip.infield(3))) { /* beside the wall*/
 			/* Grab the arrow! */
 			if (_vm->_gyro.dna.carrying >= maxobjs)
 				_vm->_scrolls.display("You fail to grab it, because your hands are full.");
@@ -536,8 +536,8 @@ void Timeout::greetsmonk() {
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro.magics[9].op = _vm->_gyro.nix;
-	Trip::tr[1].iy += 1; /* increments dx/dy! */
-	Trip::tr[1].y += Trip::tr[1].iy;   /* Dowwwn we go... */
+	_vm->_trip.tr[1].iy += 1; /* increments dx/dy! */
+	_vm->_trip.tr[1].y += _vm->_trip.tr[1].iy;   /* Dowwwn we go... */
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
@@ -550,8 +550,8 @@ void Timeout::meet_avaroid() {
 		_vm->_gyro.dna.met_avaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 		{
-			Trip::triptype &with = Trip::tr[1];
-			with.face = Trip::left;
+			triptype &with = _vm->_trip.tr[1];
+			with.face = _vm->_trip.left;
 			with.x = 151;
 			with.ix = -3;
 			with.iy = -5;
@@ -562,7 +562,7 @@ void Timeout::meet_avaroid() {
 
 void Timeout::rise_up_oubliette() {
 	{
-		Trip::triptype &with = Trip::tr[1];
+		triptype &with = _vm->_trip.tr[1];
 
 		with.visible = true;
 		with.iy += 1; /* decrements dx/dy! */
@@ -575,29 +575,29 @@ void Timeout::rise_up_oubliette() {
 }
 
 void Timeout::robin_hood_and_geida() {
-	Trip::tr[1].init(7, true);
-	Trip::apped(1, 7);
-	Trip::tr[1].walkto(6);
-	Trip::tr[2].stopwalk();
-	Trip::tr[2].face = Trip::left;
+	_vm->_trip.tr[1].init(7, true, &_vm->_trip);
+	_vm->_trip.apped(1, 7);
+	_vm->_trip.tr[1].walkto(6);
+	_vm->_trip.tr[2].stopwalk();
+	_vm->_trip.tr[2].face = _vm->_trip.left;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro.dna.geida_follows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
 	_vm->_visa.dixi('q', 66);
-	Trip::tr[1].walkto(2);
-	Trip::tr[2].walkto(2);
-	Trip::tr[1].vanishifstill = true;
-	Trip::tr[2].vanishifstill = true;
+	_vm->_trip.tr[1].walkto(2);
+	_vm->_trip.tr[2].walkto(2);
+	_vm->_trip.tr[1].vanishifstill = true;
+	_vm->_trip.tr[2].vanishifstill = true;
 	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
 }
 
 void Timeout::avalot_returns() {
-	Trip::tr[1].done();
-	Trip::tr[2].done();
-	Trip::tr[1].init(0, true);
-	Trip::apped(1, 1);
+	_vm->_trip.tr[1].done();
+	_vm->_trip.tr[2].done();
+	_vm->_trip.tr[1].init(0, true, &_vm->_trip);
+	_vm->_trip.apped(1, 1);
 	_vm->_visa.dixi('q', 67);
 	_vm->_gyro.dna.user_moves_avvy = true;
 }
@@ -606,13 +606,13 @@ void Timeout::avvy_sit_down()
 /* This is used when you sit down in the pub in Notts. It loops around so
 	that it will happen when Avvy stops walking. */
 {
-	if (Trip::tr[1].homing)    /* Still walking */
+	if (_vm->_trip.tr[1].homing)    /* Still walking */
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer.show_one(3);
 		_vm->_gyro.dna.sitting_in_pub = true;
 		_vm->_gyro.dna.user_moves_avvy = false;
-		Trip::tr[1].visible = false;
+		_vm->_trip.tr[1].visible = false;
 	}
 }
 
@@ -638,22 +638,22 @@ void Timeout::winning() {
 }
 
 void Timeout::avalot_falls() {
-	if (Trip::tr[1].step < 5) {
-		Trip::tr[1].step += 1;
+	if (_vm->_trip.tr[1].step < 5) {
+		_vm->_trip.tr[1].step += 1;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
 	} else
 		_vm->_scrolls.display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
-	if (Trip::tr[2].homing)
+	if (_vm->_trip.tr[2].homing)
 		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
 	else
 		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	Trip::tr[2].call_eachstep = true; /* So that normal procs will continue. */
+	_vm->_trip.tr[2].call_eachstep = true; /* So that normal procs will continue. */
 }
 
 void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */


Commit: 8ba4050b1fd2c26486c23807bcc06fc68ba478ea
    https://github.com/scummvm/scummvm/commit/8ba4050b1fd2c26486c23807bcc06fc68ba478ea
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T06:56:08-07:00

Commit Message:
AVALANCHE: Add Acci.

Changed paths:
  A engines/avalanche/acci2.cpp
  A engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
new file mode 100644
index 0000000..6ecb769
--- /dev/null
+++ b/engines/avalanche/acci2.cpp
@@ -0,0 +1,1626 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ACCIDENCE II		The parser. */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/acci2.h"
+
+#include "common/textconsole.h"
+#include "common/scummsys.h"
+
+#include "avalanche/gyro2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/visa2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/enid2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/sequence2.h"
+
+
+/*#include "NimUnit.h"*/
+/*#include "Highs.h"*/
+/*#include "Helper.h"*/
+
+namespace Avalanche {
+
+const Acci::vocab Acci::words[nowords] = {
+		/* Verbs, 1-49 */
+	{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
+	{2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
+	{3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
+	{4, "TAKE"},      {4, "GET"},       {4, "PICK"},
+	{5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
+	{7, "SAY"},       {7, "ASK"},
+	{8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
+	{9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
+	{11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
+	{13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
+	{15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
+	{17, "STAND"},
+
+	{18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
+	{20, "DOFF"},
+	{21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
+	{22, "PLAY"},
+	{22, "STRUM"},     {23, "RING"},      {24, "HELP"},
+	{25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
+	{255, "NINET"},    /* block for NINETY */
+	{28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
+	{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
+	{30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
+	{30, "WIZZY"},     {30, "PLOVER"},
+	{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
+	{30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
+	{30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
+	{30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
+	{30, "BONESCROLLS"}, {30, "RADOF"},
+
+	{31, "RESTART"},
+	{32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
+	{33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
+	{34, "ORDER"},     {34, "DEMAND"},
+	{35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
+	{35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
+	{35, "FIRE"},
+
+	/* Passwords, 36: */
+
+	{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
+	{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
+	{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
+	{36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
+	{36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
+	{36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
+	{36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
+	{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
+	{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
+	{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
+
+	{37, "DIR"},       {37, "LS"},        {38, "DIE"},
+	{39, "SCORE"},
+	{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
+	{41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
+	{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
+	{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
+	{46, "HELLO"},     {46, "HI"},        {46, "YO"},
+	{47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
+
+
+	/* Nouns - Objects: 50-100. */
+
+	{50, "WINE"},      {50, "BOOZE"},    {50, "NASTY"},
+	{50, "VINEGAR"},   {51, "MONEYBAG"},
+	{51, "BAG"},       {51, "CASH"},     {51, "DOSH"},
+	{51, "WALLET"},
+	{52, "BODKIN"},    {52, "DAGGER"},   {53, "POTION"},
+	{54, "CHASTITY"},  {54, "BELT"},     {55, "BOLT"},
+	{55, "ARROW"},     {55, "DART"},
+	{56, "CROSSBOW"},  {56, "BOW"},      {57, "LUTE"},
+	{58, "PILGRIM"},   {58, "BADGE"},    {59, "MUSHROOMS"},
+	{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
+	{62, "PRESCRIPT"}, {62, "SCROLL"},   {62, "MESSAGE"},
+	{63, "PEN"},       {63, "QUILL"},    {64, "INK"},
+	{64, "INKPOT"},    {65, "CLOTHES"},  {66, "HABIT"},
+	{66, "DISGUISE"},  {67, "ONION"},
+
+	{99, "PASSWORD"},
+
+	/* Objects from Also are placed between 101 and 131. */
+
+	/* Nouns - People - Male, 150-174 */
+	{150, "AVVY"},      {150, "AVALOT"},    {150, "YOURSELF"},
+	{150, "ME"},        {150, "MYSELF"},    {151, "SPLUDWICK"},
+	{151, "THOMAS"},    {151, "ALCHEMIST"}, {151, "CHEMIST"},
+	{152, "CRAPULUS"},  {152, "SERF"},      {152, "SLAVE"},
+	{158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
+	{152, "CRAPPY"},    {153, "DUCK"},      {153, "DOCTOR"},
+	{154, "MALAGAUCHE"},
+	{155, "FRIAR"},     {155, "TUCK"},      {156, "ROBIN"},
+	{156, "HOOD"},      {157, "CWYTALOT"},  {157, "GUARD"},
+	{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
+	{159, "DUKE"},      {159, "GRACE"},     {160, "DOGFOOD"},
+	{160, "MINSTREL"},  {161, "TRADER"},    {161, "SHOPKEEPER"},
+	{161, "STALLHOLDER"},
+	{162, "PILGRIM"},   {162, "IBYTHNETH"}, {163, "ABBOT"},
+	{163, "AYLES"},     {164, "PORT"},      {165, "SPURGE"},
+	{166, "JACQUES"},   {166, "SLEEPER"},   {166, "RINGER"},
+
+	/* Nouns- People - Female: 175-199 */
+	{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
+	{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
+	{178, "WITCH"},
+
+	/* Pronouns, 200-224 */
+	{200, "_vm->_gyro.him"},       {200, "MAN"},       {200, "GUY"},
+	{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
+	{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
+	{202, "IT"},        {202, "THING"},
+
+	{203, "MONK"},       {204, "BARMAN"},    {204, "BARTENDER"},
+
+	/* Prepositions, 225-249 */
+	{225, "TO"},        {226, "AT"},        {227, "UP"},
+	{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
+	{230, "UP"},        {231, "DOWN"},      {232, "ON"},
+
+
+	/* Please, 251 */
+	{251, "PLEASE"},
+
+	/* About, 252 */
+	{252, "ABOUT"}, {252, "CONCERNING"},
+
+	/* Swear words, 253 */
+	/*              I M P O R T A N T    M E S S A G E
+
+		DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+		DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+		GOODNESS KNOWS WHO WROTE THEM.
+		READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+		WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+
+	{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
+	{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
+	{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
+	{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
+	{253, "SMEG"},
+	/* and other even ruder words. You didn't read them, did you? Good. */
+
+	/* Answer-back smart-alec words, 249 */
+	{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},
+
+	/* Noise words, 255 */
+	{255, "THE"},       {255, "A"},         {255, "NOW"},
+	{255, "SOME"},      {255, "AND"},       {255, "THAT"},
+	{255, "POCUS"},     {255, "HIS"},
+	{255, "THIS"},      {255, "SENTINEL"}
+	
+};        /* for "Ken SENT Me" */
+
+
+const char Acci::what[] = "That's not possible!";
+
+const Acci::ranktype Acci::ranks[9] = {
+	{0, "Beginner"},    {10, "Novice"},
+	{20, "Improving"},   {35, "Not bad"},
+	{50, "Passable"},    {65, "Good"},
+	{80, "Experienced"}, {108, "The BEST!"},
+	{32767, "copyright'93"}
+};
+
+
+
+
+
+
+void Acci::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Acci::init() {
+	_vm->_gyro.weirdword = false;
+}
+
+void Acci::checkword(Common::String &x) { /* Checks uint16 "fv". */
+	warning("STUB: Acci::checkuint16()");
+}
+
+Common::String Acci::wordnum(Common::String x)
+{
+	char whatsit;
+	uint16 fv;
+	bool gotcha;
+
+	Common::String wordnum_result;
+	if (x == "")  {
+		wordnum_result = "";
+		return wordnum_result;
+	}
+	whatsit = pardon;
+	gotcha = false;
+	for (fv = nowords; fv >= 1; fv --) checkword(x);
+	wordnum_result = whatsit;
+	return wordnum_result;
+}
+
+void Acci::replace(Common::String old1, Common::String new1) {
+	warning("STUB: Acci::replace()");
+}
+
+/*procedure ninetydump;
+var f:file; y:int16; bit:byte; a:byte absolute $A000:800;
+begin
+	off;
+	assign(f,'avvydump.avd');
+	rewrite(f,1);
+	blockwrite(f,_vm->_gyro.dna,177); { just anything }
+	for bit:=0 to 3 do
+	begin
+	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
+	blockwrite(f,a,12080);
+	end;
+	close(f); on;
+	_vm->_scrolls.display('Dumped.');
+end;*/
+
+Common::String Acci::rank() {
+	byte fv;
+
+	Common::String rank_result;
+	for (fv = 1; fv <= 8; fv ++)
+		if ((_vm->_gyro.dna.score >= ranks[fv].score) && (_vm->_gyro.dna.score < ranks[fv + 1].score)) {
+			rank_result = ranks[fv].title;
+			return rank_result;
+		}
+
+	return rank_result;
+}
+
+Common::String Acci::totaltime() {
+	const double ticks_in_1_sec = double(65535) / 3600;
+	uint16 h, m, s;
+	Common::String a;
+
+	/* There are 65535 clock ticks in a second,
+		1092.25 in a minute, and
+		65535 in an hour. */
+	Common::String totaltime_result;
+		
+	warning("STUB: Acci::totaltime()");
+
+	totaltime_result = a;
+	return totaltime_result;
+}
+
+
+
+void Acci::number(Common::String &codes) {
+	warning("STUB: Acci::number()");
+}
+
+void Acci::cheatparse(Common::String codes) {
+	uint16 num;
+	int16 e;
+
+	char cmd;
+	int16 se, sx, sy;
+
+	warning("STUB: Acci::cheatparse()");
+}
+
+void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x. */
+	warning("STUB: Acci::punctustrip()");
+}
+
+
+
+void Acci::displaywhat(char ch, bool animate, bool &ambigous) { /* << it's an adjective! */
+	byte ff;
+	Common::String z;
+
+	warning("STUB: Acci::_vm->_scrolls.displaywhat()");
+}
+
+bool Acci::do_pronouns() {
+	bool ambiguous;
+	byte fv;
+
+	bool do_pronouns_result;
+	ambiguous = false;
+		
+	warning("STUB: Acci::do_pronouns()");
+
+	do_pronouns_result = ambiguous;
+	return do_pronouns_result;
+}
+
+
+
+
+
+
+void Acci::lowercase() {
+	byte fv;
+
+	warning("STUB: Acci::lowercase()");
+}
+
+void Acci::propernouns() {
+	byte fv;
+
+	lowercase();
+	warning("STUB: Acci::propernouns()");
+}
+
+void Acci::sayit() { /* This makes Avalot say the response. */
+	Common::String x;
+
+	warning("STUB: Acci::sayit()");
+}
+
+void Acci::store_interrogation(byte interrogation) {
+	byte fv;
+
+	warning("STUB: Acci::store_interrogation()");
+}
+
+
+
+void Acci::clearuint16s() {
+	warning("STUB: Acci::clearuint16s()");
+}
+
+void Acci::parse() {
+	byte n, fv, ff;
+	Common::String c, cc, thisuint16;
+	Common::String answer;
+	bool notfound;
+
+	/* first parsing - uint16 identification */
+	warning("STUB: Acci::parse()");
+}
+
+void Acci::examobj() {   /* Examine a standard object-thing */
+	warning("STUB: Acci::examobj()");
+}
+
+bool Acci::personshere() {       /* Person equivalent of "holding" */
+	warning("STUB: Acci::personshere()");
+	return true;
+}
+
+void Acci::exampers() {
+	warning("STUB: Acci::exampers()");
+}
+
+bool Acci::holding() {
+	warning("STUB: Acci::holding()");
+	return true;
+}
+
+
+
+void Acci::special(bool before) {
+	warning("STUB: Acci::special()");
+}
+
+void Acci::examine() {
+	/* Examine. EITHER it's an object OR it's an Also OR it's a person OR
+		it's something else. */
+	warning("STUB: Acci::examine()");
+}
+
+
+
+void Acci::inv() {   /* the time-honoured command... */
+	char fv;
+	byte q;
+
+	q = 0;
+
+	warning("STUB: Acci::inv()");
+}
+
+void Acci::swallow() {   /* Eat something. */
+	warning("STUB: Acci::swallow()");
+}
+
+void Acci::others() {
+/* This lists the other people in the room. */
+	warning("STUB: Acci::others()");
+}
+
+void Acci::lookaround() {
+/* This is called when you say "look." */
+	_vm->_scrolls.display(*_vm->_gyro.also[0][1]);
+	switch (_vm->_gyro.dna.room) {
+	case r__spludwicks:
+		if (_vm->_gyro.dna.avaricius_talk > 0)  _vm->_visa.dixi('q', 23);
+		else others();
+		break;
+	case r__robins: {
+		if (_vm->_gyro.dna.tied_up)  _vm->_visa.dixi('q', 38);
+		if (_vm->_gyro.dna.mushroom_growing)  _vm->_visa.dixi('q', 55);
+	}
+	break;
+	case r__insidecardiffcastle:
+		if (! _vm->_gyro.dna.taken_pen)  _vm->_visa.dixi('q', 49);
+		break;
+	case r__lustiesroom:
+		if (_vm->_gyro.dna.lustie_is_asleep)  _vm->_visa.dixi('q', 65);
+		break;
+	case r__catacombs:
+		switch (_vm->_gyro.dna.cat_y * 256 + _vm->_gyro.dna.cat_x) {
+		case 258 :
+			_vm->_visa.dixi('q', 80);
+			break; /* Inside art gallery */
+		case 514 :
+			_vm->_visa.dixi('q', 81);
+			break; /* Outside ditto */
+		case 260 :
+			_vm->_visa.dixi('q', 82);
+			break; /* Outside Geida's room. */
+		}
+		break;
+	default:
+		others();
+	}
+}
+
+void Acci::opendoor() {   /* so whaddya THINK this does?! */
+	byte fv;
+
+	switch (_vm->_gyro.dna.room) {   /* Special cases. */
+	case r__yours:
+		if (_vm->_trip.infield(2)) {
+			/* Opening the box. */
+			thing = 54; /* The box. */ person = pardon;
+			examine();
+			return;
+		}
+		break;
+	case r__spludwicks:
+		if (thing == 61)  {
+			_vm->_visa.dixi('q', 85);
+			return;
+		}
+		break;
+	}
+
+
+	if ((! _vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
+		return; /* No doors can open if you can't move Avvy. */
+	for (fv = 9; fv <= 15; fv ++)
+		if (_vm->_trip.infield(fv)) {
+			{
+				_vm->_gyro.portals[fv];
+				switch (_vm->_gyro.portals[fv].op) {
+				case _vm->_gyro.exclaim: {
+					_vm->_trip.tr[1].bounce();
+					_vm->_visa.dixi('x', _vm->_gyro.portals[fv].data);
+				}
+				break;
+				case _vm->_gyro.transport:
+					_vm->_trip.fliproom((_vm->_gyro.portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro.portals[fv].data) & 0x0F /*Low byte*/);
+					break;
+				case _vm->_gyro.unfinished: {
+					_vm->_trip.tr[1].bounce();
+					_vm->_scrolls.display("Sorry. This place is not available yet!");
+				}
+				break;
+				case _vm->_gyro.special:
+					_vm->_trip.call_special(_vm->_gyro.portals[fv].data);
+					break;
+				case _vm->_gyro.mopendoor:
+					_vm->_trip.open_the_door((_vm->_gyro.portals[fv].data) >> 8, (_vm->_gyro.portals[fv].data) & 0x0F, fv);
+					break;
+				}
+			}
+			return;
+		}
+	if (_vm->_gyro.dna.room == r__map)
+		_vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going "
+				"to anywhere other than Argent, Birmingham, Cardiff, "
+				"Nottingham and Norwich."));
+	else
+		_vm->_scrolls.display("Door? What door?");
+}
+
+
+
+
+void Acci::silly() {
+	_vm->_scrolls.display("Don't be silly!");
+}
+
+void Acci::putproc() {   /* Called when you call vb_put. */
+	char temp;
+
+
+	if (! holding())  return;
+	thing2 -= 49;   /* Slip the second object */
+	temp = thing;
+	thing = thing2;
+	if (! holding())  return;
+	thing = temp;
+
+	/* Thing is the thing which you're putting in. Thing2 is where you're
+		putting it. */
+	/* Convenience thing. */
+	switch (thing2) {
+	case _vm->_gyro.wine:
+		if (thing == _vm->_gyro.onion) {
+			if (_vm->_gyro.dna.rotten_onion)
+				_vm->_scrolls.display(Common::String("That's a bit like shutting the stable door after the "
+						"horse has bolted!"));
+			else {     /* Put onion into wine? */
+				if (_vm->_gyro.dna.winestate != 3)
+					_vm->_scrolls.display("\6Oignon au vin\22 is a bit too strong for your tastes!");
+				else {     /* Put onion into vinegar! Yes! */
+					_vm->_gyro.dna.onion_in_vinegar = true;
+					_vm->_lucerna.points(7);
+					_vm->_visa.dixi('u', 9);
+				}
+			}
+		} else silly();
+		break;
+
+	case 54:
+		if (_vm->_gyro.dna.room == 1) { /* Put something into the box. */
+			if (_vm->_gyro.dna.box_contents != nowt)
+				_vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking"
+						" that out first."));
+			else
+				switch (thing) {
+				case _vm->_gyro.money:
+					_vm->_scrolls.display("You'd better keep some ready cash on you!");
+					break;
+				case _vm->_gyro.bell:
+					_vm->_scrolls.display("That's a silly place to keep a bell.");
+					break;
+				case _vm->_gyro.bodkin:
+					_vm->_scrolls.display("But you might need it!");
+					break;
+				case _vm->_gyro.onion:
+					_vm->_scrolls.display("Just give it to Spludwick, Avvy!");
+					break;
+				default: {
+					/* Put the object into the box... */
+					if (_vm->_gyro.dna.wearing == thing)
+						_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro.get_better(thing) + " off first!");
+					else {
+						_vm->_celer.show_one(5); /* Open box. */
+						_vm->_gyro.dna.box_contents = thing;
+						_vm->_gyro.dna.obj[thing] = false;
+						_vm->_lucerna.objectlist();
+						_vm->_scrolls.display("OK, it's in the box.");
+						_vm->_celer.show_one(6); /* Shut box. */
+					}
+				}
+				}
+		} else silly();
+		break;
+
+	default:
+		silly();
+	}
+}
+
+
+
+
+
+/* The result of this fn is whether or not he says "Hey, thanks!" */
+void Acci::not_in_order() {
+	_vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
+			" What I need next is " +
+			_vm->_gyro.get_better(_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick]) + ".\232\2");
+}
+
+void Acci::go_to_cauldron() {
+	_vm->_trip.tr[2].call_eachstep = false; /* Stops Geida_Procs. */
+	_vm->_timeout.set_up_timer(1, _vm->_timeout.procspludwick_goes_to_cauldron, _vm->_timeout.reason_spludwalk);
+	_vm->_trip.tr[2].walkto(2);
+}
+
+bool Acci::give2spludwick() {
+	bool give2spludwick_result;
+	{
+		give2spludwick_result = false;
+
+		if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
+			not_in_order();
+			return give2spludwick_result;
+		}
+
+		switch (thing) {
+		case _vm->_gyro.onion: {
+			_vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
+			if (_vm->_gyro.dna.rotten_onion)
+				_vm->_visa.dixi('q', 22);
+			else {
+				_vm->_gyro.dna.given2spludwick += 1;
+				_vm->_visa.dixi('q', 20);
+				go_to_cauldron();
+				_vm->_lucerna.points(3);
+			}
+			_vm->_lucerna.objectlist();
+		}
+		break;
+		case _vm->_gyro.ink: {
+			_vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
+			_vm->_lucerna.objectlist();
+			_vm->_gyro.dna.given2spludwick += 1;
+			_vm->_visa.dixi('q', 24);
+			go_to_cauldron();
+			_vm->_lucerna.points(3);
+		}
+		break;
+		case _vm->_gyro.mushroom: {
+			_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
+			_vm->_visa.dixi('q', 25);
+			_vm->_lucerna.points(5);
+			_vm->_gyro.dna.given2spludwick += 1;
+			go_to_cauldron();
+			_vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
+			_vm->_lucerna.objectlist();
+		}
+		break;
+		default:
+			give2spludwick_result = true;
+		}
+	}
+	return give2spludwick_result;
+}
+
+
+
+void Acci::have_a_drink() {
+	{
+		_vm->_gyro.dna.alcohol += 1;
+		if (_vm->_gyro.dna.alcohol == 5) {
+			_vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
+			_vm->_gyro.dna.teetotal = true;
+			_vm->_gyro.dna.avvy_is_awake = false;
+			_vm->_gyro.dna.avvy_in_bed = true;
+			_vm->_lucerna.objectlist();
+			_vm->_lucerna.dusk();
+			_vm->_gyro.hang_around_for_a_while();
+			_vm->_trip.fliproom(1, 1);
+			_vm->_gyro.background(14);
+			_vm->_trip.new_game_for_trippancy(); /* Not really */
+		}
+	}
+}
+
+void Acci::cardiff_climbing() {
+	if (_vm->_gyro.dna.standing_on_dais) {
+		/* Clamber up. */
+		_vm->_scrolls.display("You climb down, back onto the floor.");
+		_vm->_gyro.dna.standing_on_dais = false;
+		_vm->_trip.apped(1, 3);
+	} else {
+		/* Clamber down. */
+		if (_vm->_trip.infield(1)) {
+			_vm->_scrolls.display("You clamber up onto the dais.");
+			_vm->_gyro.dna.standing_on_dais = true;
+			_vm->_trip.apped(1, 2);
+		} else
+			_vm->_scrolls.display("Get a bit closer, Avvy.");
+	}
+}
+
+
+
+
+/* Called when you ask Avvy to stand. */
+void Acci::already() {
+	_vm->_scrolls.display("You're already standing!");
+}
+
+void Acci::stand_up() {
+	switch (_vm->_gyro.dna.room) {
+	case r__yours: /* Avvy isn't asleep. */
+		if (_vm->_gyro.dna.avvy_in_bed) {  /* But he's in bed. */
+			if (_vm->_gyro.dna.teetotal) {
+				_vm->_visa.dixi('d', 12);
+				_vm->_gyro.background(0);
+				_vm->_visa.dixi('d', 14);
+			}
+			_vm->_trip.tr[1].visible = true;
+			_vm->_gyro.dna.user_moves_avvy = true;
+			_vm->_trip.apped(1, 2);
+			_vm->_gyro.dna.rw = _vm->_gyro.left;
+			_vm->_celer.show_one(4); /* Picture of empty pillow. */
+			_vm->_lucerna.points(1);
+			_vm->_gyro.dna.avvy_in_bed = false;
+			_vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts);
+		} else already();
+		break;
+
+	case r__insidecardiffcastle:
+		cardiff_climbing();
+		break;
+
+	case r__nottspub:
+		if (_vm->_gyro.dna.sitting_in_pub)  {
+			_vm->_celer.show_one(4); /* Not sitting down. */
+			_vm->_trip.tr[1].visible = true; /* But standing up. */
+			_vm->_trip.apped(1, 4); /* And walking away. */
+			_vm->_gyro.dna.sitting_in_pub = false; /* Really not sitting down. */
+			_vm->_gyro.dna.user_moves_avvy = true; /* And ambulant. */
+		} else already();
+		break;
+	default:
+		already();
+	}
+}
+
+
+
+
+void Acci::getproc(char thing) {
+	switch (_vm->_gyro.dna.room) {
+	case r__yours:
+		if (_vm->_trip.infield(2)) {
+			if (_vm->_gyro.dna.box_contents == thing) {
+				_vm->_celer.show_one(5);
+				_vm->_scrolls.display("OK, I've got it.");
+				_vm->_gyro.dna.obj[thing] = true;
+				_vm->_lucerna.objectlist();
+				_vm->_gyro.dna.box_contents = nowt;
+				_vm->_celer.show_one(6);
+			} else
+				_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro.get_better(thing) + " in the box.");
+		} else _vm->_visa.dixi('q', 57);
+		break;
+	case r__insidecardiffcastle:
+		switch (thing) {
+		case _vm->_gyro.pen: {
+			if (_vm->_trip.infield(2)) {
+				/* Standing on the dais. */
+
+				if (_vm->_gyro.dna.taken_pen)
+					_vm->_scrolls.display("It's not there, Avvy.");
+				else {
+					/* OK: we're taking the pen, and it's there. */
+					_vm->_celer.show_one(4); /* No pen there now. */
+					_vm->_trip.call_special(3); /* Zap! */
+					_vm->_gyro.dna.taken_pen = true;
+					_vm->_gyro.dna.obj[_vm->_gyro.pen] = true;
+					_vm->_lucerna.objectlist();
+					_vm->_scrolls.display("Taken.");
+				}
+			} else if (_vm->_gyro.dna.standing_on_dais)  _vm->_visa.dixi('q', 53);
+			else _vm->_visa.dixi('q', 51);
+		}
+		break;
+		case _vm->_gyro.bolt:
+			_vm->_visa.dixi('q', 52);
+			break;
+		default:
+			_vm->_visa.dixi('q', 57);
+		}
+		break;
+	case r__robins:
+		if ((thing == _vm->_gyro.mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro.dna.mushroom_growing)) {
+			_vm->_celer.show_one(3);
+			_vm->_scrolls.display("Got it!");
+			_vm->_gyro.dna.mushroom_growing = false;
+			_vm->_gyro.dna.taken_mushroom = true;
+			_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = true;
+			_vm->_lucerna.objectlist();
+			_vm->_lucerna.points(3);
+		} else _vm->_visa.dixi('q', 57);
+		break;
+	default:
+		_vm->_visa.dixi('q', 57);
+	}
+}
+
+void Acci::give_geida_the_lute() {
+	{
+		if (_vm->_gyro.dna.room != r__lustiesroom) {
+			_vm->_scrolls.display("Not yet. Try later!\232\2");
+			return;
+		}
+		_vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
+		_vm->_lucerna.objectlist();
+		_vm->_visa.dixi('q', 64); /* She plays it. */
+
+		/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+
+		_vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
+		_vm->_enid.back_to_bootstrap(4);
+	}
+}
+
+void Acci::play_harp() {
+	if (_vm->_trip.infield(7))
+		_vm->_scrolls.musical_scroll();
+	else _vm->_scrolls.display("Get a bit closer to it, Avvy!");
+}
+
+void Acci::winsequence() {
+	_vm->_visa.dixi('q', 78);
+	_vm->_sequence.first_show(7);
+	_vm->_sequence.then_show(8);
+	_vm->_sequence.then_show(9);
+	_vm->_sequence.start_to_close();
+	_vm->_timeout.set_up_timer(30, _vm->_timeout.procwinning, _vm->_timeout.reason_winning);
+}
+
+void Acci::person_speaks() {
+	bool found;
+	byte fv;
+	char cfv;
+
+
+	if ((person == pardon) || (person == '\0')) {
+		if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room))  person = _vm->_gyro.her;
+		else person = _vm->_gyro.him;
+	}
+
+	if (_vm->_gyro.whereis[person] != _vm->_gyro.dna.room) {
+		_vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro.himself! */
+		return;
+	}
+
+	found = false; /* The person we're looking for's code is in Person. */
+
+	for (fv = 1; fv <= _vm->_trip.numtr; fv ++)
+		if (_vm->_trip.tr[fv].quick && ((_vm->_trip.tr[fv].a.accinum + 149) == person)) {
+			_vm->_scrolls.display(Common::String('\23') + char(fv + 48) + '\4');
+			found = true;
+		}
+
+	if (! found)
+		for (fv = 10; fv <= 25; fv ++) {
+			_vm->_gyro.quasipeds[fv];
+			if ((_vm->_gyro.quasipeds[fv].who == person) && (_vm->_gyro.quasipeds[fv].room == _vm->_gyro.dna.room)) {
+				_vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4');
+			}
+		}
+}
+
+
+
+
+void Acci::heythanks() {
+	person_speaks();
+	_vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)");
+	_vm->_gyro.dna.obj[thing] = false;
+}
+
+void Acci::do_that() {
+	const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	byte fv, ff;
+	int16 sx, sy;
+	bool ok;
+
+
+	if (thats == Common::String(nowt))  {
+		thats = "";
+		return;
+	}
+	if (_vm->_gyro.weirdword)  return;
+	if (thing < '\310')  thing -= 49; /* "Slip" */
+
+	/*if ((! _vm->_gyro.alive) &
+	!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+	vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
+	vb_highscores, vb_smartalec, eos).has(verb))) {
+	_vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
+	"or something? Try restarting, or restoring a saved game!");
+	return;
+	}
+
+	if ((~ _vm->_gyro.dna.avvy_is_awake) &
+	!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+	vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
+	vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
+	_vm->_scrolls.display("Talking in your sleep? Try waking up!");
+	return;
+	}*/
+
+
+	switch (verb) {
+	case vb_exam:
+		examine();
+		break;
+	case vb_open:
+		opendoor();
+		break;
+	case vb_pause:
+		_vm->_scrolls.display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
+				"the mouse on the `O.K.\" box to continue.");
+		break;
+	case vb_get: {
+		if (thing != pardon) {
+			/* Legitimate try to pick something up. */
+			if (_vm->_gyro.dna.carrying >= maxobjs)  _vm->_scrolls.display("You can't carry any more!");
+			else getproc(thing);
+
+		} else {
+			/* Not... ditto. */
+			if (person != pardon)
+				_vm->_scrolls.display("You can't sweep folk off their feet!");
+			else
+				_vm->_scrolls.display("I assure you, you don't need it.");
+		}
+	}
+	break;
+	case vb_drop:
+		_vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
+				"later it was gone! So now you never leave ANYTHING lying around. OK?");
+		break;
+		/*       begin _vm->_gyro.dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/
+	case vb_inv:
+		inv();
+		break;
+	case vb_talk:
+		if (person == pardon) {
+			if (_vm->_gyro.subjnumber == 99) /* They typed "say passuint16". */
+				_vm->_scrolls.display("Yes, but what \6is\22 the passuint16?");
+			/*else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
+			Delete(thats, 1, 1);
+			move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
+			verb = chr(subjnumber);
+			do_that();
+			return;
+			} else {
+			person = _vm->_gyro.subjnumber;
+			subjnumber = 0;
+			if (set::of(pardon, '\0', eos).has(person))  _vm->_scrolls.display("Talk to whom?");
+			else if (personshere())  talkto(ord(person));
+			}
+			}*/ else if (person == pardon)  _vm->_scrolls.display("Talk to whom?");
+		else if (personshere())  _vm->_visa.talkto(person);
+		break;
+
+	case vb_give:
+		if (holding()) {
+			if (person == pardon)  _vm->_scrolls.display("Give to whom?");
+			else if (personshere()) {
+				switch (thing) {
+				case _vm->_gyro.money :
+					_vm->_scrolls.display("You can't bring yourself to give away your moneybag.");
+					break;
+				case _vm->_gyro.bodkin:
+				case _vm->_gyro.bell:
+				case _vm->_gyro.clothes:
+				case _vm->_gyro.habit :
+					_vm->_scrolls.display("Don't give it away, it might be useful!");
+					break;
+				default:
+					switch (person) {
+					case _vm->_gyro.pcrapulus:
+						switch (thing) {
+						case _vm->_gyro.wine: {
+							_vm->_scrolls.display("Crapulus grabs the wine and gulps it down.");
+							_vm->_gyro.dna.obj[_vm->_gyro.wine] = false;
+						}
+						break;
+						default:
+							heythanks();
+						}
+						break;
+					case _vm->_gyro.pcwytalot:
+						/*if (set::of(crossbow, bolt, eos).has(thing))
+							_vm->_scrolls.display(Common::String("You might be able to influence ") +
+									"Cwytalot more if you used it!");
+						else */heythanks();
+						break;
+					case _vm->_gyro.pspludwick:
+						if (give2spludwick())  heythanks();
+						break;
+					case _vm->_gyro.pibythneth:
+						if (thing == _vm->_gyro.badge) {
+							_vm->_visa.dixi('q', 32); /* Thanks! Wow! */
+							_vm->_lucerna.points(3);
+							_vm->_gyro.dna.obj[_vm->_gyro.badge] = false;
+							_vm->_gyro.dna.obj[_vm->_gyro.habit] = true;
+							_vm->_gyro.dna.givenbadgetoiby = true;
+							_vm->_celer.show_one(8);
+							_vm->_celer.show_one(9);
+						} else heythanks();
+						break;
+					case _vm->_gyro.payles:
+						if (_vm->_gyro.dna.ayles_is_awake) {
+							if (thing == _vm->_gyro.pen) {
+								_vm->_gyro.dna.obj[_vm->_gyro.pen] = false;
+								_vm->_visa.dixi('q', 54);
+								_vm->_gyro.dna.obj[_vm->_gyro.ink] = true;
+								_vm->_gyro.dna.given_pen_to_ayles = true;
+								_vm->_lucerna.objectlist();
+								_vm->_lucerna.points(2);
+							} else heythanks();
+						} else
+							_vm->_scrolls.display("But he's asleep!");
+						break;
+					case _vm->_gyro.pgeida:
+						switch (thing) {
+						case _vm->_gyro.potion : {
+							_vm->_gyro.dna.obj[_vm->_gyro.potion] = false;
+							_vm->_visa.dixi('u', 16); /* She drinks it. */
+							_vm->_lucerna.points(2);
+							_vm->_gyro.dna.geida_given_potion = true;
+							_vm->_lucerna.objectlist();
+						}
+						break;
+						case _vm->_gyro.lute:
+							give_geida_the_lute();
+							break;
+						default:
+							heythanks();
+						}
+						break;
+					case _vm->_gyro.parkata:
+						switch (thing) {
+						case _vm->_gyro.potion:
+							if (_vm->_gyro.dna.geida_given_potion)
+								winsequence();
+							else _vm->_visa.dixi('q', 77);
+							break;             /* That Geida woman! */
+						default:
+							heythanks();
+						}
+						break;
+					default:
+						heythanks();
+					}
+				}
+			}
+			_vm->_lucerna.objectlist(); /* Just in case... */
+		}
+		break;
+
+	case vb_eat:
+	case vb_drink:
+		if (holding())  swallow();
+		break;
+	case vb_load:
+		_vm->_enid.edna_load(realwords[2]);
+		break;
+	case vb_save:
+		if (_vm->_gyro.alive)
+			_vm->_enid.edna_save(realwords[2]);
+		else
+			_vm->_scrolls.display("It's a bit late now to save your game!");
+		break;
+	case vb_pay:
+		_vm->_scrolls.display("No money need change hands.");
+		break;
+	case vb_look:
+		lookaround();
+		break;
+	case vb_break:
+		_vm->_scrolls.display("Vandalism is prohibited within this game!");
+		break;
+	case vb_quit: { /* quit */
+		//if (_vm->_gyro.demo) {
+		//	_vm->_visa.dixi('q', 31);
+		//	close(demofile);
+		//	exit(0); /* Change this later!!! */
+		//}
+		if (! polite)  _vm->_scrolls.display("How about a `please\", Avvy?");
+		else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))  _vm->_gyro.lmo = true;
+	}
+	break;
+	case vb_go:
+		_vm->_scrolls.display("Just use the arrow keys to walk there.");
+		break;
+	case vb_info: {
+		_vm->_scrolls.aboutscroll = true;
+		/*            _vm->_scrolls.display('Thorsoft of Letchworth presents:'+^c+^m+^m+
+						'The medi‘val descendant of'+^m+
+						'Denarius Avaricius Sextus'+^m+'in:'+
+						^m+^m+'LORD AVALOT D''ARGENT'+
+						^m+'version '+vernum+^m+^m+'Copyright ï '
+						+copyright+', Mark, Mike and Thomas Thurman.');*/
+		_vm->_scrolls.display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
+				"The medi‘val descendant of" + '\15' +
+				"Denarius Avaricius Sextus" +
+				'\15' + '\15' + "version " + _vm->_gyro.vernum + '\15' + '\15' + "Copyright ï "
+				+ _vm->_gyro.copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
+		_vm->_scrolls.aboutscroll = false;
+	}
+	break;
+	case vb_undress:
+		if (_vm->_gyro.dna.wearing == nowt)  _vm->_scrolls.display("You're already stark naked!");
+		else if (_vm->_gyro.dna.avvys_in_the_cupboard) {
+			_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro.get_better(_vm->_gyro.dna.wearing) + '.');
+			_vm->_gyro.dna.wearing = nowt;
+			_vm->_lucerna.objectlist();
+		} else
+			_vm->_scrolls.display("Hadn't you better find somewhere more private, Avvy?");
+		break;
+	case vb_wear:
+		if (holding()) {
+			/* wear something */
+			switch (thing) {
+			case _vm->_gyro.chastity:
+				_vm->_scrolls.display("Hey, what kind of a weirdo are you\??!");
+				break;
+			case _vm->_gyro.clothes:
+			case _vm->_gyro.habit: { /* Change this! */
+				if (_vm->_gyro.dna.wearing != nowt) {
+					if (_vm->_gyro.dna.wearing == thing)
+						_vm->_scrolls.display("You're already wearing that.");
+					else
+						_vm->_scrolls.display(Common::String("You'll be rather warm wearing two ") +
+								"sets of clothes!");
+					return;
+				} else
+					_vm->_gyro.dna.wearing = thing;
+				_vm->_lucerna.objectlist();
+				if (thing == _vm->_gyro.habit)  fv = 3;
+				else fv = 0;
+				{
+					if (_vm->_trip.tr[1].whichsprite != fv) {
+						sx = _vm->_trip.tr[1].x;
+						sy = _vm->_trip.tr[1].y;
+						_vm->_trip.tr[1].done();
+						_vm->_trip.tr[1].init(fv, true, &_vm->_trip);
+						_vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
+						_vm->_trip.tr[1].visible = false;
+					}
+				}
+			}
+			break;
+			default:
+				_vm->_scrolls.display(what);
+			}
+		}
+		break;
+	case vb_play:
+		if (thing == pardon)
+			switch (_vm->_gyro.dna.room) { /* They just typed "play"... */
+			case r__argentpub:
+				// play_nim();
+				// I just don't plan to implement Nim yet.
+				break; /* ...in the pub, => play Nim. */
+			case r__musicroom:
+				play_harp();
+				break;
+			}
+		else if (holding()) {
+			switch (thing) {
+			case _vm->_gyro.lute : {
+				_vm->_visa.dixi('U', 7);
+				if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room)  _vm->_visa.dixi('U', 10);
+				if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room)  _vm->_visa.dixi('U', 15);
+			}
+			break;
+			case 52 :
+				if (_vm->_gyro.dna.room == r__musicroom)  play_harp();
+				else _vm->_scrolls.display(what);
+				break;
+			case 55 :
+				if (_vm->_gyro.dna.room == r__argentpub) ;  /*play_nim(); - Don't implement yet.*/
+				else _vm->_scrolls.display(what);
+				break;
+			default:
+				_vm->_scrolls.display(what);
+			}
+		}
+		break;
+	case vb_ring:
+		if (holding()) {
+			if (thing == _vm->_gyro.bell) {
+				_vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
+					_vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)");
+			} else _vm->_scrolls.display(what);
+		}
+		break;
+	case vb_help:
+		// boot_help();
+		// I don't want to implement help yet.
+		break;
+	case vb_larrypass:
+		_vm->_scrolls.display("Wrong game!");
+		break;
+	case vb_phaon:
+		_vm->_scrolls.display("Hello, Phaon!");
+		break;
+	case vb_boss:
+		// bosskey();
+		// I don't want to implement bosskey yet.
+		break;
+	case vb_pee:
+		if (_vm->_gyro.flagset('P')) {
+			_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
+			_vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet);
+		} else _vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
+		break;
+	case vb_cheat: {
+		_vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled.");
+		_vm->_gyro.cheat = true;
+	}
+	break;
+	case vb_magic:
+		if (_vm->_gyro.dna.avaricius_talk > 0)
+			_vm->_visa.dixi('q', 19);
+		else {
+			if ((_vm->_gyro.dna.room == 12) & (_vm->_trip.infield(2))) {
+				/* Avaricius appears! */
+				_vm->_visa.dixi('q', 17);
+				if (_vm->_gyro.whereis['\227'] == 12)
+					_vm->_visa.dixi('q', 18);
+				else {
+					_vm->_trip.tr[2].init(1, false, &_vm->_trip); /* Avaricius */
+					_vm->_trip.apped(2, 4);
+					_vm->_trip.tr[2].walkto(5);
+					_vm->_trip.tr[2].call_eachstep = true;
+					_vm->_trip.tr[2].eachstep = _vm->_trip.procback_and_forth;
+					_vm->_gyro.dna.avaricius_talk = 14;
+					_vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks);
+				}
+			} else _vm->_scrolls.display("Nothing appears to happen...");
+		}
+		break;
+	case vb_smartalec:
+		_vm->_scrolls.display("Listen, smart alec, that was just rhetoric.");
+		break;
+	case vb_expletive: {
+		switch ( _vm->_gyro.dna.swore) {
+		case 0:
+			_vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
+					"(I shouldn't say it again, if I were you!)");
+			break;
+		case 1:
+			_vm->_scrolls.display(Common::String("You hear a distant rumble of thunder. Must you always ") +
+					"do things I tell you not to?\r\rDon't do it again!");
+			break;
+		default: {
+			_vm->_pingo.zonk();
+			_vm->_scrolls.display(Common::String("A crack of lightning shoots from the sky, ") +
+					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
+			_vm->_lucerna.gameover();
+		}
+		}
+		_vm->_gyro.dna.swore ++;
+	}
+	break;
+	case vb_listen:
+		if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
+			_vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") +
+					"the bells.");
+		else if (_vm->_gyro.listen == "")
+			_vm->_scrolls.display("You can't hear anything much at the moment, Avvy.");
+		else _vm->_scrolls.display(_vm->_gyro.listen);
+		break;
+	case vb_buy: {
+		/* What are they trying to buy? */
+		switch (_vm->_gyro.dna.room) {
+		case r__argentpub:
+			if (_vm->_trip.infield(6)) {
+				/* We're in a pub, and near the bar. */
+				switch (thing) {
+				case '\63':
+				case '\65':
+				case '\66':
+				case '\72': { /* Beer, whisky, cider or mead */
+					if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
+						_vm->_visa.dixi('D', 15);
+						return;
+					}
+					if (_vm->_gyro.dna.teetotal)  {
+						_vm->_visa.dixi('D', 6);
+						return;
+					}
+					if (_vm->_gyro.dna.alcohol == 0)  _vm->_lucerna.points(3);
+					_vm->_celer.show_one(12);
+					_vm->_scrolls.display(booze[thing] + ", please.\231\2");
+					_vm->_gyro.dna.drinking = thing;
+
+					_vm->_celer.show_one(10);
+					_vm->_gyro.dna.malagauche = 177;
+					_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks);
+				}
+				break;
+				case '\64':
+					examine();
+					break; /* We have a right one here- buy Pepsi??! */
+				case _vm->_gyro.wine:
+					if (_vm->_gyro.dna.obj[_vm->_gyro.wine])  /* We've already got the wine! */
+						_vm->_visa.dixi('D', 2); /* 1 bottle's shufishent! */
+					else {
+						if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
+							_vm->_visa.dixi('D', 15);
+							return;
+						}
+						if (_vm->_gyro.dna.carrying >= maxobjs) {
+							_vm->_scrolls.display("Your hands are full.");
+							return;
+						}
+						_vm->_celer.show_one(12);
+						_vm->_scrolls.display("Wine, please.\231\2");
+						if (_vm->_gyro.dna.alcohol == 0)  _vm->_lucerna.points(3);
+						_vm->_celer.show_one(10);
+						_vm->_gyro.dna.malagauche = 177;
+
+						_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuywine, _vm->_timeout.reason_drinks);
+					}
+					break;
+				}
+			} else _vm->_visa.dixi('D', 5);
+			break;                /* Go to the bar! */
+
+		case r__outsideducks:
+			if (_vm->_trip.infield(6)) {
+				if (thing == _vm->_gyro.onion) {
+					if (_vm->_gyro.dna.obj[_vm->_gyro.onion])
+						_vm->_visa.dixi('D', 10); /* not planning to juggle with the things! */
+					else if (_vm->_gyro.dna.carrying >= maxobjs)
+						_vm->_scrolls.display("Before you ask, you remember that your hands are full.");
+					else {
+						if (_vm->_gyro.dna.bought_onion)
+							_vm->_visa.dixi('D', 11);
+						else {
+							_vm->_visa.dixi('D', 9);
+							_vm->_lucerna.points(3);
+						}
+						_vm->_gyro.pennycheck(3); /* It costs thruppence. */
+						_vm->_gyro.dna.obj[_vm->_gyro.onion] = true;
+						_vm->_lucerna.objectlist();
+						_vm->_gyro.dna.bought_onion = true;
+						_vm->_gyro.dna.rotten_onion = false; /* It's OK when it leaves the stall! */
+						_vm->_gyro.dna.onion_in_vinegar = false;
+					}
+				} else _vm->_visa.dixi('D', 0);
+			} else _vm->_visa.dixi('D', 0);
+			break;
+
+		case r__nottspub:
+			_vm->_visa.dixi('n', 15);
+			break; /* Can't sell to southerners. */
+		default:
+			_vm->_visa.dixi('D', 0); /* Can't buy that. */
+		}
+	}
+	break;
+	case vb_attack: {
+		if ((_vm->_gyro.dna.room == r__brummieroad) &&
+				((person == '\235') || (thing == _vm->_gyro.crossbow) || (thing == _vm->_gyro.bolt))
+				&& (_vm->_gyro.whereis['\235'] == _vm->_gyro.dna.room)) {
+			switch (_vm->_gyro.dna.obj[_vm->_gyro.bolt] + _vm->_gyro.dna.obj[_vm->_gyro.crossbow] * 2) {
+				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
+					3 = both. */
+			case 0: {
+				_vm->_visa.dixi('Q', 10);
+				_vm->_scrolls.display("(At the very least, don't use your bare hands!)");
+			}
+			break;
+			case 1:
+				_vm->_scrolls.display(Common::String("Attack _vm->_gyro.him with only a crossbow bolt? Are you ") +
+						"planning on playing darts?!");
+				break;
+			case 2:
+				_vm->_scrolls.display(Common::String("Come on, Avvy! You're not going to get very far ") +
+						"with only a crossbow!");
+				break;
+			case 3: {
+				_vm->_visa.dixi('Q', 11);
+				_vm->_gyro.dna.cwytalot_gone = true;
+				_vm->_gyro.dna.obj[_vm->_gyro.bolt] = false;
+				_vm->_gyro.dna.obj[_vm->_gyro.crossbow] = false;
+				_vm->_lucerna.objectlist();
+				_vm->_gyro.magics[12].op = _vm->_gyro.nix;
+				_vm->_lucerna.points(7);
+				_vm->_trip.tr[2].walkto(2);
+				_vm->_trip.tr[2].vanishifstill = true;
+				_vm->_trip.tr[2].call_eachstep = false;
+				_vm->_gyro.whereis['\235'] = 177;
+			}
+			break;
+			default:
+				_vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */
+			}
+		} else _vm->_visa.dixi('Q', 10);
+	}
+	break;
+	case vb_password:
+		if (_vm->_gyro.dna.room != r__bridge)
+			_vm->_visa.dixi('Q', 12);
+		else {
+			ok = true;
+			for (ff = 1; ff <= thats.size(); ff ++)
+				for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv ++) {
+					Common::String temp = realwords[ff];
+					temp.toUppercase();
+					if (words[_vm->_gyro.dna.pass_num + first_password].w[fv] != temp[fv])
+						ok = false;
+				}
+			if (ok) {
+				if (_vm->_gyro.dna.drawbridge_open != 0)
+					_vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again.");
+				else {
+					_vm->_lucerna.points(4);
+					_vm->_scrolls.display("The drawbridge opens!");
+					_vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls);
+					_vm->_gyro.dna.drawbridge_open = 1;
+				}
+			} else _vm->_visa.dixi('Q', 12);
+		}
+		break;
+	case vb_dir:
+		_vm->_enid.dir(realwords[2]);
+		break;
+	case vb_die:
+		_vm->_lucerna.gameover();
+		break;
+	case vb_score:
+		_vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro.strf(_vm->_gyro.dna.score) + ",\3\rout of a " +
+				"possible 128.\r\rThis gives you a rank of " + rank() +
+				".\r\r" + totaltime());
+		break;
+	case vb_put:
+		putproc();
+		break;
+	case vb_stand:
+		stand_up();
+		break;
+
+	case vb_kiss:
+		if (person == pardon)
+			_vm->_scrolls.display("Kiss whom?");
+		else if (personshere())
+			switch (person) {
+			case _vm->_gyro.parkata:
+				_vm->_visa.dixi('U', 12);
+				break;
+			case _vm->_gyro.pgeida:
+				_vm->_visa.dixi('U', 13);
+				break;
+			case _vm->_gyro.pwisewoman:
+				_vm->_visa.dixi('U', 14);
+				break;
+			default:
+				_vm->_visa.dixi('U', 5); /* You WHAT? */
+			}
+		else if ((150 <= person) && (person <= 174))
+			_vm->_scrolls.display("Hey, what kind of a weirdo are you??");
+
+		break;
+
+	case vb_climb:
+		if (_vm->_gyro.dna.room == r__insidecardiffcastle)  cardiff_climbing();
+		else /* In the wrong room! */
+			_vm->_scrolls.display("Not with your head for heights, Avvy!");
+		break;
+
+	case vb_jump: {
+		_vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping);
+		_vm->_gyro.dna.user_moves_avvy = false;
+	}
+	break;
+
+	case vb_highscores:
+		//	show_highs();
+		// to be implemented later...
+		break;
+
+	case vb_wake:
+		if (personshere())
+			switch (person) {
+			case pardon:
+			case _vm->_gyro.pavalot:
+			case '\0':
+				if (! _vm->_gyro.dna.avvy_is_awake) {
+					_vm->_gyro.dna.avvy_is_awake = true;
+					_vm->_lucerna.points(1);
+					_vm->_gyro.dna.avvy_in_bed = true;
+					_vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */
+					if (_vm->_gyro.dna.teetotal)  _vm->_visa.dixi('d', 13);
+				} else _vm->_scrolls.display("You're already awake, Avvy!");
+				break;
+			case _vm->_gyro.payles:
+				if (! _vm->_gyro.dna.ayles_is_awake)  _vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
+				break;
+			case _vm->_gyro.pjacques:
+				_vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
+					"Hmmm... that doesn't seem to do any good...");
+				break;
+			default:
+				_vm->_scrolls.display("It's difficult to awaken people who aren't asleep...!");
+		}
+		break;
+
+	case vb_sit:
+		if (_vm->_gyro.dna.room == r__nottspub) {
+			if (_vm->_gyro.dna.sitting_in_pub)
+				_vm->_scrolls.display("You're already sitting!");
+			else {
+				_vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro.him down. */
+				_vm->_timeout.set_up_timer(1, _vm->_timeout.procavvy_sit_down, _vm->_timeout.reason_sitting_down);
+			}
+		} else {
+			/* Default doodah. */
+			_vm->_lucerna.dusk();
+			_vm->_gyro.hang_around_for_a_while();
+			_vm->_lucerna.dawn();
+			_vm->_scrolls.display("A few hours later...\20nothing much has happened...");
+		}
+		break;
+
+	case vb_restart:
+		if (_vm->_scrolls.ask("Restart game and lose changes?"))  {
+			_vm->_lucerna.dusk();
+			_vm->_gyro.newgame();
+			_vm->_lucerna.dawn();
+		}
+		break;
+
+	case pardon:
+		_vm->_scrolls.display("Hey, a verb would be helpful!");
+		break;
+
+	case vb_hello: {
+		person_speaks();
+		_vm->_scrolls.display("Hello.\2");
+	}
+	break;
+	case vb_thanks: {
+		person_speaks();
+		_vm->_scrolls.display("That's OK.\2");
+	}
+	break;
+	default:
+		_vm->_scrolls.display(Common::String('\7') + "Parser bug!");
+	}
+	}
+}
+
+void Acci::verbopt(char n, Common::String &answer, char &anskey) {
+	switch (n) {
+	case vb_exam: {
+		answer = "Examine";
+		anskey = 'x';
+				  }
+				  break; /* the ubiqutous one */
+				  /* vb_give isn't dealt with by this procedure, but by ddm__with */
+	case vb_drink: {
+		answer = "Drink";
+		anskey = 'D';
+				   }
+				   break;
+	case vb_wear:  {
+		answer = "Wear";
+		anskey = 'W';
+				   }
+				   break;
+	case vb_ring:  {
+		answer = "Ring";
+		anskey = 'R';
+				   }
+				   break; /* only the bell! */
+	case vb_play:  {
+		answer = "Play";
+		anskey = 'P';
+				   }
+				   break;
+	case vb_eat:   {
+		answer = "Eat";
+		anskey = 'E';
+				   }
+				   break;
+	default:      {
+		answer = "? Unknown!";    /* Bug! */
+		anskey = '?';
+				  }
+	}
+}
+
+
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
new file mode 100644
index 0000000..5650146
--- /dev/null
+++ b/engines/avalanche/acci2.h
@@ -0,0 +1,219 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ACCIDENCE II		The parser. */
+
+#ifndef ACCI2_H
+#define ACCI2_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Acci {
+public:
+		/* verb codes */
+	static const char vb_exam = 1;
+	static const char vb_open = 2;
+	static const char vb_pause = 3;
+	static const char vb_get = 4;
+	static const char vb_drop = 5;
+	static const char vb_inv = 6;
+	static const char vb_talk = 7;
+	static const char vb_give = 8;
+	static const char vb_drink = 9;
+	static const char vb_load = 10;
+	static const char vb_save = 11;
+	static const char vb_pay = 12;
+	static const char vb_look = 13;
+	static const char vb_break = 14;
+	static const char vb_quit = 15;
+	static const char vb_sit = 16;
+	static const char vb_stand = 17;
+	static const char vb_go = 18;
+	static const char vb_info = 19;
+	static const char vb_undress = 20;
+	static const char vb_wear = 21;
+	static const char vb_play = 22;
+	static const char vb_ring = 23;
+	static const char vb_help = 24;
+	static const char vb_larrypass = 25;
+	static const char vb_phaon = 26;
+	static const char vb_boss = 27;
+	static const char vb_pee = 28;
+	static const char vb_cheat = 29;
+	static const char vb_magic = 30;
+	static const char vb_restart = 31;
+	static const char vb_eat = 32;
+	static const char vb_listen = 33;
+	static const char vb_buy = 34;
+	static const char vb_attack = 35;
+	static const char vb_password = 36;
+	static const char vb_dir = 37;
+	static const char vb_die = 38;
+	static const char vb_score = 39;
+	static const char vb_put = 40;
+	static const char vb_kiss = 41;
+	static const char vb_climb = 42;
+	static const char vb_jump = 43;
+	static const char vb_highscores = 44;
+	static const char vb_wake = 45;
+	static const char vb_hello = 46;
+	static const char vb_thanks = 47;
+
+	static const char vb_smartalec = 249;
+	static const char vb_expletive = 253;
+
+	static const char pardon = 254; /* =didn't understand / wasn't given. */
+
+	static const int16 nowords = 277; /* how many words does the parser know? */
+	static const char nowt = 372;
+	static const char moved = 0; /* This word was moved. (Usually because it was the subject of
+	  conversation.) */
+
+	static const int16 first_password = 89; /* Words[first_password] should equal "TIROS". */
+
+
+
+	struct vocab {
+		byte n;
+		Common::String w;
+	};
+
+	static const vocab words[nowords];
+
+	static const char what[];
+
+
+
+	struct ranktype {
+		uint16 score;
+		Common::String title;
+	};
+
+	static const ranktype ranks[9];
+
+
+
+	Common::String thats;
+	Common::String unknown;
+	Common::String realwords[11];
+	char verb, person, thing, thing2;
+	bool polite;
+
+
+
+
+	void setParent(AvalancheEngine *vm);
+
+	void init();
+
+	void clearwords();
+	void parse();
+	void lookaround();
+	void opendoor();
+	void do_that();
+	void verbopt(char n, Common::String &answer, char &anskey);
+	void have_a_drink();
+
+private:
+	AvalancheEngine *_vm;
+
+	byte fv;
+
+	void checkword(Common::String &x);
+	Common::String wordnum(Common::String x);
+
+	void replace(Common::String old1, Common::String new1);
+
+	Common::String rank();
+
+	Common::String totaltime();
+
+	void number(Common::String &codes);
+	void cheatparse(Common::String codes);
+
+	void punctustrip(Common::String &x);
+
+	void displaywhat(char ch, bool animate, bool &ambigous);
+	bool do_pronouns();
+
+	void lowercase();
+	void propernouns();
+	void sayit();
+	void store_interrogation(byte interrogation);
+
+	void clearuint16s();
+
+	void examobj();
+
+	bool personshere();
+
+	void exampers();
+
+	bool holding();
+
+	void special(bool before);
+	void examine();
+
+	void inv();
+
+	void swallow();
+
+	void others();
+
+	void silly();
+	void putproc();
+
+	void not_in_order();
+	void go_to_cauldron();
+	bool give2spludwick();
+
+	void cardiff_climbing();
+
+	void already();
+	void stand_up();
+
+	void getproc(char thing);
+
+	void give_geida_the_lute();
+
+	void play_harp();
+
+	void winsequence();
+
+	void person_speaks();
+
+	void heythanks();
+
+};
+
+} // End of namespace Avalanche.
+
+#endif // ACCI2_H
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d090f8a..240c7b6 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -60,6 +60,7 @@ namespace Avalanche {
 		_sequence.setParent(this);
 		_timeout.setParent(this);
 		_trip.setParent(this);
+		_acci.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f7f5b5b..5fa0fa9 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -43,6 +43,7 @@
 #include "avalanche/sequence2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/trip6.h"
+#include "avalanche/acci2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -72,6 +73,7 @@ public:
 	Sequence _sequence;
 	Timeout _timeout;
 	Trip _trip;
+	Acci _acci;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();


Commit: cb9ec866ac50f7959ed1336af5a62c8e309736cf
    https://github.com/scummvm/scummvm/commit/cb9ec866ac50f7959ed1336af5a62c8e309736cf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T06:57:37-07:00

Commit Message:
AVALANCHE: Repair compilation, minor modifications.

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 3d022fb..23aa40b 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -498,7 +498,7 @@ public:
 	Common::String mousetext;
 	/* which:array[0..5] of byte;*/
 	void *p;
-	bool weirduint16;
+	bool weirdword;
 	byte to_do;
 	bool lmo, mousemade;
 	Common::String scroll[15];
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3c1d59c..22ae5b5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -44,7 +44,7 @@
 #include "avalanche/celer2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/sequence2.h"
-#include "avalanche/acci2.h"
+//#include "avalanche/acci2.h"
 
 
 //#include "dropdown.h"
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 259b639..d4e729a 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -37,8 +37,6 @@ class AvalancheEngine;
 
 class Lucerna {
 public:
-	// Call it where Lucerna is first used.
-	// Procuded to replace the initizalization part of the original Pascal unit.
 	Lucerna();
 
 	void setParent(AvalancheEngine *vm);
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index fe5e5d9..b4955f6 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -507,7 +507,7 @@ void Timeout::buydrinks() {
 	_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
 	if (_vm->_gyro.pennycheck(3)) /* Pay 3d. */
 		_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
-	Acci::have_a_drink();
+	_vm->_acci.have_a_drink();
 }
 
 void Timeout::buywine() {
@@ -632,7 +632,7 @@ void Timeout::winning() {
 	do {
 		_vm->_lucerna.checkclick();
 	} while (!(_vm->_gyro.mrelease == 0));
-	_vm->_lucerna.callverb(Acci::vb_score);
+	_vm->_lucerna.callverb(_vm->_acci.vb_score);
 	_vm->_scrolls.display(" T H E    E N D ");
 	_vm->_gyro.lmo = true;
 }
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f0d2abc..5baa73d 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -64,7 +64,8 @@ void triptype::andexor() {
 }
 
 void triptype::turn(byte whichway) {
-	if (whichway == 8)  face = 0;
+	if (whichway == 8) 
+		face = 0;
 	else face = whichway;
 }
 
@@ -346,11 +347,10 @@ byte Trip::geida_ped(byte which) {
 	return geida_ped_result;
 }
 
-void Trip::catamove(byte ped)
+void Trip::catamove(byte ped) {
 /* When you enter a new position in the catacombs, this procedure should
 	be called. It changes the Also codes so that they may match the picture
 	on the screen. (Coming soon: It draws up the screen, too.) */
-{
 
 	warning("Repair array indexes in Trip::catamove()");
 


Commit: 1d11268eb486a28bf471c277a407954ccfcda212
    https://github.com/scummvm/scummvm/commit/1d11268eb486a28bf471c277a407954ccfcda212
Author: uruk (koppirnyo at gmail.com)
Date: 2013-06-29T07:36:40-07:00

Commit Message:
AVALANCHE: Reorganise includes.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/logger2.cpp
    engines/avalanche/logger2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/pingo2.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 6ecb769..2a86732 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -28,11 +28,8 @@
 /* ACCIDENCE II		The parser. */
 
 #include "avalanche/avalanche.h"
-#include "avalanche/acci2.h"
-
-#include "common/textconsole.h"
-#include "common/scummsys.h"
 
+#include "avalanche/acci2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/scrolls2.h"
@@ -44,6 +41,8 @@
 #include "avalanche/pingo2.h"
 #include "avalanche/sequence2.h"
 
+#include "common/textconsole.h"
+
 
 /*#include "NimUnit.h"*/
 /*#include "Highs.h"*/
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 2e6ce5a..cec2923 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -27,13 +27,15 @@
 
 /* CELER	The unit for updating the screen pics. */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/celer2.h"
-#include "common/textconsole.h"
 #include "avalanche/trip6.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/roomnums.h"
-#include "avalanche/avalanche.h"
+
+#include "common/textconsole.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 263d717..e71dec5 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -30,8 +30,6 @@
 #ifndef CELER2_H
 #define CELER2_H
 
-
-
 #include "common/scummsys.h"
 #include "common/str.h"
 
diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
index 99ddfb4..f664d82 100644
--- a/engines/avalanche/enhanced2.cpp
+++ b/engines/avalanche/enhanced2.cpp
@@ -25,8 +25,10 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/enhanced2.h"
-#include "common/system.h"
+
 #include "common/textconsole.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index d780f11..917ed3c 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -32,7 +32,7 @@
 #ifndef ENHANCED2_H
 #define ENHANCED2_H
 
-#include "common/system.h"
+#include "common/scummsys.h"
 
 namespace Avalanche {
 class AvalancheEngine;
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 3ca6daa..3abb3ba 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -27,9 +27,6 @@
 
 /* ENID		Edna's manager. */
 
-#include "common/scummsys.h"
-#include "common/textconsole.h"
-
 #include "avalanche/avalanche.h"
 
 #include "avalanche/enid2.h"
@@ -39,6 +36,9 @@
 #include "avalanche/timeout2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
+
+#include "common/textconsole.h"
+
 //#include "fileunit.h"
 //#include "basher.h"
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 4351354..8c02ef1 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -32,7 +32,6 @@
 
 #include "common/scummsys.h"
 
-#include "avalanche/gyro2.h"
 
 namespace Avalanche {
 class AvalancheEngine;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index a96249d..fd86390 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -27,20 +27,21 @@
 
 /* GYRO		It all revolves around this bit! */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/gyro2.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/visa2.h"
+#include "avalanche/acci2.h"
+#include "avalanche/trip6.h"
+
 #include "common/textconsole.h"
 
-//#include "pingo.h"
-//#include "scrolls.h"
-//#include "lucerna.h"
-//#include "visa.h"
-//#include "acci.h"
-//#include "trip5.h"
 //#include "dropdown.h"
 //#include "basher.h"
 
-
-
 namespace Avalanche {
 
 const char *Gyro::vernum = "1.30";
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 23aa40b..4246350 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -30,7 +30,6 @@
 #ifndef GYRO2_H
 #define GYRO2_H
 
-#include "common/system.h"
 #include "common/str.h"
 #include "common/scummsys.h"
 
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 09643f7..e4061da 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -27,12 +27,12 @@
 
 /* LOGGER	Handles the logging. */
 
+#include "avalanche/avalanche.h"
+
 #include "avalanche/logger2.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/avalanche.h"
-//#include "avalanche/trip6.h"
+#include "avalanche/trip6.h"
 
-#include "common/system.h"
 #include "common/textconsole.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h
index bd54823..05a96d0 100644
--- a/engines/avalanche/logger2.h
+++ b/engines/avalanche/logger2.h
@@ -33,7 +33,6 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 22ae5b5..344c273 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -29,14 +29,11 @@
 
 #include "avalanche/avalanche.h"
 
-#include "common/system.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/logger2.h"
 #include "avalanche/enhanced2.h"
-
-
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/trip6.h"
@@ -44,8 +41,9 @@
 #include "avalanche/celer2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/sequence2.h"
-//#include "avalanche/acci2.h"
+#include "avalanche/acci2.h"
 
+#include "common/system.h"
 
 //#include "dropdown.h"
 //#include "basher.h"
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index b2f8e83..92c22e6 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -30,11 +30,10 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/pingo2.h"
-
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
-//#include "avalanche/scrolls2.h"
+#include "avalanche/scrolls2.h"
 
 #include "common/textconsole.h"
 
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index 135bb10..28f140f 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -33,9 +33,6 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
-
-
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index a577483..4008414 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -31,16 +31,17 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/logger2.h"
 #include "avalanche/enhanced2.h"
-
-//#include "lucerna.h"
-//#include "trip5.h"
-//#include "Acci.h"
-//#include "basher.h"
-//#include "visa.h"
-//#include "timeout.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/acci2.h"
+#include "avalanche/visa2.h"
+#include "avalanche/timeout2.h"
 
 #include "common/textconsole.h"
 
+//#include "basher.h"
+//#include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
+
 namespace Avalanche {
 
 const int16 Scrolls::roman = 0;
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 914e463..fa52a55 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -30,9 +30,6 @@
 
 #include "common/system.h"
 
-#include "avalanche/gyro2.h"
-// #include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 2d9bd25..afa74d6 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -30,12 +30,13 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/sequence2.h"
-#include "common/scummsys.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/trip6.h"
 
+#include "common/scummsys.h"
+
 namespace Avalanche {
 
 void Sequence::setParent(AvalancheEngine *vm) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index b4955f6..343e896 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -29,12 +29,10 @@
 
 // DON'T FORGET ABOUT THE ARRAY INDEXES, THEY MAY'LL CAUSE TROUBLES!!!
 
-#include "common/textconsole.h"
-
-#include "avalanche/timeout2.h"
 
 #include "avalanche/avalanche.h"
 
+#include "avalanche/timeout2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
@@ -44,6 +42,8 @@
 #include "avalanche/enid2.h"
 #include "avalanche/pingo2.h"
 
+#include "common/textconsole.h"
+
 namespace Avalanche {
 
 Timeout::Timeout() {
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index f7e984e..07a48d6 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -32,9 +32,6 @@
 
 #include "common/scummsys.h"
 
-#include "avalanche/gyro2.h"
-#include "avalanche/celer2.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 5baa73d..039c769 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -27,12 +27,9 @@
 
 /* TRIP5	Trippancy V */
 
-#include "avalanche/trip6.h"
-#include "common/scummsys.h"
-#include "common/textconsole.h"
-
 #include "avalanche/avalanche.h"
 
+#include "avalanche/trip6.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/visa2.h"
@@ -42,6 +39,9 @@
 #include "avalanche/timeout2.h"
 #include "avalanche/enid2.h"
 
+#include "common/scummsys.h"
+#include "common/textconsole.h"
+
 /*#include "Dropdown.h"*/
 
 
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index be805fb..d7b5637 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -31,13 +31,9 @@
 #ifndef TRIP6_H
 #define TRIP6_H
 
-
-
 #include "common/scummsys.h"
 #include "common/str.h"
 
-#include "avalanche/gyro2.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index a14367a..e53f55a 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -32,12 +32,12 @@
 #include "avalanche/visa2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
-//#include "avalanche/acci2.h"
+#include "avalanche/acci2.h"
 #include "avalanche/lucerna2.h"
+#include "avalanche/trip6.h"
 
 #include "common/textconsole.h"
 
-/*#include "Trip5.h"*/
 
 namespace Avalanche {
 


Commit: 7c147c920fb9e780a78a452cbe123ed0cd94a190
    https://github.com/scummvm/scummvm/commit/7c147c920fb9e780a78a452cbe123ed0cd94a190
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T05:10:33-07:00

Commit Message:
AVALANCHE: Fix code formatting

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/logger2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 2e6ce5a..d9af28a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -51,194 +51,119 @@ void Celer::setParent(AvalancheEngine *vm) {
 void Celer::pics_link() {
 	byte xx;
 
-	if (_vm->_gyro.ddmnow)  return; /* No animation when the menus are up. */
-
-	{
-		switch (_vm->_gyro.dna.room) {
+	if (_vm->_gyro.ddmnow)
+		return; /* No animation when the menus are up. */
+
+	
+	switch (_vm->_gyro.dna.room) {
+	case r__outsideargentpub:
+		if ((_vm->_gyro.roomtime % int32(12)) == 0)
+			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
+				break;
 
-		case r__outsideargentpub: {
-			if ((_vm->_gyro.roomtime % int32(12)) == 0)
-				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
-		}
+	case r__brummieroad:
+		if ((_vm->_gyro.roomtime % int32(2)) == 0)
+			show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
 		break;
 
-		case r__brummieroad:
-			if ((_vm->_gyro.roomtime % int32(2)) == 0)
-				show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
-			break;
-
-		case r__bridge:
-			if ((_vm->_gyro.roomtime % int32(2)) == 0)
-				show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
-			break;
-
-		case r__yours:
-			if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
-				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
-			break;
+	case r__bridge:
+		if ((_vm->_gyro.roomtime % int32(2)) == 0)
+			show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
+		break;
 
-		case r__argentpub: {
-			if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) {
-				/* Malagauche cycle */
-				_vm->_gyro.dna.malagauche += 1;
-				switch (_vm->_gyro.dna.malagauche) {
-				case 1:
-				case 11:
-				case 21:
-					show_one(12);
-					break; /* Looks forwards. */
-				case 8:
-				case 18:
-				case 28:
-				case 32:
-					show_one(11);
-					break; /* Looks at you. */
-				case 30:
-					show_one(13);
-					break; /* Winks. */
-				case 33:
-					_vm->_gyro.dna.malagauche = 0;
-					break;
-				}
-			}
+	case r__yours:
+		if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
+			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
+		break;
 
-			switch (_vm->_gyro.roomtime % 200) {
-			case 179:
-			case 197:
-				show_one(5);
-				break; /* Dogfood's drinking cycle */
-			case 182:
-			case 194:
-				show_one(6);
+	case r__argentpub:
+		if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) {
+			/* Malagauche cycle */
+			_vm->_gyro.dna.malagauche += 1;
+			switch (_vm->_gyro.dna.malagauche) {
+			case 1:
+			case 11:
+			case 21:
+				show_one(12);
+				break; /* Looks forwards. */
+			case 8:
+			case 18:
+			case 28:
+			case 32:
+				show_one(11);
+				break; /* Looks at you. */
+			case 30:
+				show_one(13);
+				break; /* Winks. */
+			case 33:
+				_vm->_gyro.dna.malagauche = 0;
 				break;
-			case 185:
-				show_one(7);
-				break;
-			case 199:
-				_vm->_gyro.dna.dogfoodpos = 177;
-				break; /* Impossible value for this. */
-			}
-
-			if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */
-				if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
-					xx = 3;
-				else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
-					xx = 2;
-				else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
-					xx = 4;
-
-				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
-					show_one(xx);
-					_vm->_gyro.dna.dogfoodpos = xx;
-				}
 			}
-				
 		}
-		break;
 
-		case r__westhall:
-			if ((_vm->_gyro.roomtime % int32(3)) == 0)
-				switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) {
-				case 4:
-					show_one(1);
-					break;
-				case 1:
-				case 3:
-				case 5:
-					show_one(2);
-					break;
-				case 0:
-				case 2:
-					show_one(3);
-					break;
-				}
+		switch (_vm->_gyro.roomtime % 200) {
+		case 179:
+		case 197:
+			show_one(5);
+			break; /* Dogfood's drinking cycle */
+		case 182:
+		case 194:
+			show_one(6);
 			break;
-
-		case r__lustiesroom:
-			if (!(_vm->_gyro.dna.lustie_is_asleep))  {
-				if ((_vm->_gyro.roomtime % int32(45)) > 42)
-					xx = 4; /* du Lustie blinks */
-
-				/* Bearing of Avvy from du Lustie. */
-				else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
-						xx = 1; /* Middle. */
-				else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
-						xx = 2; /* Left. */
-				else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
-					xx = 3; /* Right. */
-
-				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
-					show_one(xx);
-					_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-				}
-			}
+		case 185:
+			show_one(7);
 			break;
+		case 199:
+			_vm->_gyro.dna.dogfoodpos = 177;
+			break; /* Impossible value for this. */
+		}
 
-		case r__aylesoffice:
-			if ((! _vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) {
-				switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) {
-				case 0:
-					show_one(1);
-					break; /* Frame 2: EGA. */
-				case 1:
-					show_one(3);
-					break; /* Frame 1: Natural. */
-				}
-			}
-			break;
-
-		case r__robins:
-			if (_vm->_gyro.dna.tied_up)
-				switch (_vm->_gyro.roomtime % int32(54)) {
-				case 20:
-					show_one(4);
-					break; /* Frame 4: Avalot blinks. */
-				case 23:
-					show_one(2);
-					break; /* Frame 1: Back to normal. */
-				}
-			break;
-
-		case r__nottspub: {
-			/* Bearing of Avvy from Port. */
-			if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360)))
-				xx = 2; /* Middle. */
-			else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180))
-				xx = 6; /* Left. */
-			else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
-				xx = 8; /* Right. */
-
-			if ((_vm->_gyro.roomtime % int32(60)) > 57)  xx--; /* Blinks */
+		if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */
+			if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
+				xx = 3;
+			else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
+				xx = 2;
+			else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
+				xx = 4;
 
 			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
 				show_one(xx);
-				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+				_vm->_gyro.dna.dogfoodpos = xx;
 			}
+		}
+		break;
 
-			switch (_vm->_gyro.roomtime % 50) {
-			case 45 :
-				show_one(9);
-				break; /* Spurge blinks */
-			case 49 :
-				show_one(10);
+	case r__westhall:
+		if ((_vm->_gyro.roomtime % int32(3)) == 0) {
+			switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) {
+			case 4:
+				show_one(1);
+				break;
+			case 1:
+			case 3:
+			case 5:
+				show_one(2);
+				break;
+			case 0:
+			case 2:
+				show_one(3);
 				break;
 			}
 		}
 		break;
 
-		case r__ducks: {
-			if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */
-				show_one(1 + (_vm->_gyro.roomtime / 3) % 3);
+	case r__lustiesroom:
+		if (!(_vm->_gyro.dna.lustie_is_asleep)) {
+			if ((_vm->_gyro.roomtime % int32(45)) > 42)
+				xx = 4; /* du Lustie blinks */
 
-			{/* _vm->_lucerna.bearing of Avvy from Duck. */
-			if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
-				xx = 4; /* Middle. */
+			/* Bearing of Avvy from du Lustie. */
+			else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+					xx = 1; /* Middle. */
 			else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
-				xx = 6; /* Left. */
+					xx = 2; /* Left. */
 			else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
-				xx = 8; /* Right. */
-
-			if ((_vm->_gyro.roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */
+				xx = 3; /* Right. */
 
 			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
 				show_one(xx);
@@ -247,18 +172,92 @@ void Celer::pics_link() {
 		}
 		break;
 
+	case r__aylesoffice:
+		if ((!_vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) {
+			switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) {
+			case 0:
+				show_one(1);
+				break; /* Frame 2: EGA. */
+			case 1:
+				show_one(3);
+				break; /* Frame 1: Natural. */
+			}
+		}
+		break;
+
+	case r__robins:
+		if (_vm->_gyro.dna.tied_up) {
+			switch (_vm->_gyro.roomtime % int32(54)) {
+			case 20:
+				show_one(4);
+				break; /* Frame 4: Avalot blinks. */
+			case 23:
+				show_one(2);
+				break; /* Frame 1: Back to normal. */
+			}
+		}
+		break;
+
+	case r__nottspub:
+		/* Bearing of Avvy from Port. */
+		if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360)))
+			xx = 2; /* Middle. */
+		else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180))
+			xx = 6; /* Left. */
+		else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
+			xx = 8; /* Right. */
+
+		if ((_vm->_gyro.roomtime % int32(60)) > 57)
+			xx--; /* Blinks */
+
+		if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+			show_one(xx);
+			_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+		}
+
+		switch (_vm->_gyro.roomtime % 50) {
+		case 45 :
+			show_one(9);
+			break; /* Spurge blinks */
+		case 49 :
+			show_one(10);
+			break;
+		}
+		break;
+
+	case r__ducks:
+		if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */
+			show_one(1 + (_vm->_gyro.roomtime / 3) % 3);
+
+		{/* _vm->_lucerna.bearing of Avvy from Duck. */
+		if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+			xx = 4; /* Middle. */
+		else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
+			xx = 6; /* Left. */
+		else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
+			xx = 8; /* Right. */
+
+		if ((_vm->_gyro.roomtime % int32(45)) > 42)
+			xx += 1; /* Duck blinks */
+
+		if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+			show_one(xx);
+			_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 		}
+		break;
+
 	}
+}
 
-	if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B')))
+	if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B'))) {
 		/* They're ringing the bells. */
 		switch (_vm->_gyro.roomtime % int32(4)) {
-		case 1: {
-			if (_vm->_gyro.dna.nextbell < 5)  _vm->_gyro.dna.nextbell = 12;
+		case 1:
+			if (_vm->_gyro.dna.nextbell < 5)
+				_vm->_gyro.dna.nextbell = 12;
 			_vm->_gyro.dna.nextbell -= 1;
 			_vm->_gyro.note(_vm->_gyro.notes[_vm->_gyro.dna.nextbell]);
-		}
-		break;
+			break;
 		case 2:
 			//nosound;
 			warning("STUB: Celer::pics_link()");
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 3ca6daa..628c05d 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -96,7 +96,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 
 	day = _vm->_gyro.strf(d);
 
-	if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31)))
+	if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31))) {
 		switch (d % 10) {
 		case 1:
 			day = day + "st";
@@ -110,15 +110,12 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 		default:
 			day = day + "th";
 		}
+	}
 
 	expanddate_result = day + ' ' + month + ' ' + _vm->_gyro.strf(y);
 	return expanddate_result;
 }
 
-
-
-
-
 void Enid::show_bug(char icon, Common::String strn) {
 	_vm->_scrolls.display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
 }
@@ -159,17 +156,10 @@ void Enid::loaderror(Common::String x, char icon) {
 	bug = true;
 }
 
-
-
-
 void Enid::edna_load(Common::String name) {
 	warning("STUB: Enid::edna_load()");
 }
 
-
-
-
-
 void Enid::showheader() {
 	_vm->_scrolls.display(Common::String("Dir: ") + path + "\r\r\4");
 }
@@ -260,21 +250,17 @@ void Enid::avvy_background() {    /* Not really a filing procedure,
 }
 
 void Enid::to_sundry(sundry &sund) {
-	{
-		sund.qenid_filename = _vm->_gyro.enid_filename;
-		sund.qsoundfx = _vm->_gyro.soundfx;
-		sund.qthinks = _vm->_gyro.thinks;
-		sund.qthinkthing = _vm->_gyro.thinkthing;
-	}
+	sund.qenid_filename = _vm->_gyro.enid_filename;
+	sund.qsoundfx = _vm->_gyro.soundfx;
+	sund.qthinks = _vm->_gyro.thinks;
+	sund.qthinkthing = _vm->_gyro.thinkthing;
 }
 
 void Enid::from_sundry(sundry sund) {
-	{
-		_vm->_gyro.enid_filename = sund.qenid_filename;
-		_vm->_gyro.soundfx = sund.qsoundfx;
-		_vm->_gyro.thinks = sund.qthinks;
-		_vm->_gyro.thinkthing = sund.qthinkthing;
-	}
+	_vm->_gyro.enid_filename = sund.qenid_filename;
+	_vm->_gyro.soundfx = sund.qsoundfx;
+	_vm->_gyro.thinks = sund.qthinks;
+	_vm->_gyro.thinkthing = sund.qthinkthing;
 }
 
 void Enid::restore_dna() {
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index a96249d..a0676f4 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -330,14 +330,17 @@ void Gyro::slowdown() {
 }
 
 bool Gyro::flagset(char x) {
-	for (uint16 i = 0; i < flags.size(); i++)
+	for (uint16 i = 0; i < flags.size(); i++) {
 		if (flags[i] == x)
 			return true;
+	}
+
 	return false;
 }
 
 void Gyro::force_numlock() {
-	if ((locks & num) > 0)  locks -= num;
+	if ((locks & num) > 0)
+		locks -= num;
 }
 
 bool Gyro::pennycheck(uint16 howmuchby) {
@@ -384,7 +387,8 @@ Common::String Gyro::get_thing(byte which) {
 	case onion:
 		if (dna.rotten_onion)
 			get_thing_result = "rotten onion";
-		else get_thing_result = things[which];
+		else
+			get_thing_result = things[which];
 		break;
 	default:
 		get_thing_result = things[which];
@@ -411,7 +415,9 @@ char Gyro::get_thingchar(byte which) {
 // Keep an eye open! ^^^^
 Common::String Gyro::get_better(byte which) {
 	Common::String get_better_result;
-	if (which > 150)  which -= 149;
+	if (which > 150)
+		which -= 149;
+
 	switch (which) {
 	case wine:
 		switch (dna.winestate) {
@@ -430,7 +436,8 @@ Common::String Gyro::get_better(byte which) {
 			get_better_result = "a rotten onion";
 		else if (dna.onion_in_vinegar)
 			get_better_result = "a pickled onion (in the vinegar)";
-		else get_better_result = better[which];
+		else
+			get_better_result = better[which];
 		break;
 	default:
 		if ((which < numobjs) && (which > '\0'))
@@ -485,7 +492,8 @@ void Gyro::background(byte x) {
 void Gyro::hang_around_for_a_while() {
 	byte fv;
 
-	for (fv = 1; fv <= 28; fv ++) slowdown();
+	for (fv = 1; fv <= 28; fv ++)
+		slowdown();
 }
 
 /* Super_Off and Super_On are two very useful procedures. Super_Off switches
@@ -494,19 +502,25 @@ void Gyro::hang_around_for_a_while() {
 
 void Gyro::super_off() {
 	super_was_off = visible == m_no;
-	if (super_was_off)  return;
+	if (super_was_off)
+		return;
 
 	super_was_virtual = visible == m_virtual;
 
-	if (visible == m_virtual)  off_virtual();
-	else off();
+	if (visible == m_virtual)
+		off_virtual();
+	else
+		off();
 }
 
 void Gyro::super_on() {
-	if ((visible != m_no) || (super_was_off))  return;
+	if ((visible != m_no) || (super_was_off))
+		return;
 
-	if (super_was_virtual)  on_virtual();
-	else on();
+	if (super_was_virtual)
+		on_virtual();
+	else
+		on();
 }
 
 bool Gyro::mouse_near_text() {
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 09643f7..b9452e3 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -82,10 +82,12 @@ void Logger::setParent(AvalancheEngine *vm) {
 void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
 	byte fv;
 	
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::centre()");
-	/*for (fv = 1; fv <= size - (x / 2); fv ++)
+	/*for (fv = 1; fv <= size - (x / 2);
+		fv ++)
 	output << logfile << ' ';*/
 }
 
@@ -108,7 +110,8 @@ void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
 
 void Logger::log_divider() {   /* Prints the divider sign. */
 	byte fv;
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_divider()");
 
@@ -122,7 +125,8 @@ void Logger::log_divider() {   /* Prints the divider sign. */
 }
 
 void Logger::log_command(Common::String x) {     /* Prints a command */
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_command()");
 
@@ -133,13 +137,17 @@ void Logger::log_command(Common::String x) {     /* Prints a command */
 }
 
 void Logger::log_addstuff(Common::String x) {
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
+
 	scroll_line += x;
 }
 
 void Logger::log_scrollchar(Common::String x) {     /* print one character */
 	Common::String z;
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
+
 	switch (x[1]) {
 	case '`':
 		z = quote;
@@ -158,33 +166,37 @@ void Logger::log_scrollchar(Common::String x) {     /* print one character */
 }
 
 void Logger::log_italic() {
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_italic()");
 
 	/*if (_vm->_gyro.log_epson)
-	log_addstuff(italic);
+		log_addstuff(italic);
 	else
-	log_addstuff("*");*/
+		log_addstuff("*");*/
 }
 
 void Logger::log_roman() {
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_roman()");
 
-	/*	if (_vm->_gyro.log_epson)
-	log_addstuff(italic_off);
+	/* if (_vm->_gyro.log_epson)
+		log_addstuff(italic_off);
 	else
-	log_addstuff("*");*/
+		log_addstuff("*");*/
 }
 
 void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_epsonroman()");
 
-	//if (_vm->_gyro.log_epson)  log_addstuff(italic_off);
+	//if (_vm->_gyro.log_epson)
+	//	log_addstuff(italic_off);
 }
 
 void Logger::log_scrollline() {   /* Set up a line for the scroll driver */
@@ -200,7 +212,8 @@ void Logger::log_scrollendline(bool centred) {
 
 	warning("STUB: Logger::log_scrollendline()");
 
-	/*for (fv = 1; fv <= x; fv ++) output << logfile << ' ';
+	/*for (fv = 1; fv <= x; fv ++)
+		output << logfile << ' ';
 	output << logfile << scroll_line << NL;*/
 }
 
@@ -211,18 +224,21 @@ void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
 	warning("STUB: Logger::log_bubbleline()");
 
 	/*if (linenum == 1) {
-	for (fv = 1; fv <= 15; fv ++) output << logfile << ' ';
-	output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
+		for (fv = 1; fv <= 15; fv ++)
+			output << logfile << ' ';
+		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
 	} else {
-	for (fv = 1; fv <= 17; fv ++) output << logfile << ' ';
-	output << logfile << x << NL;
+		for (fv = 1; fv <= 17; fv ++)
+			output << logfile << ' ';
+		output << logfile << x << NL;
 	}*/
 }
 
 void Logger::log_newline() {
 	warning("STUB: Logger::log_newline()");
 
-	//if (_vm->_gyro.logging)  output << logfile << NL;
+	//if (_vm->_gyro.logging)
+	//	output << logfile << NL;
 }
 
 void Logger::log_newroom(Common::String where) {
@@ -231,17 +247,20 @@ void Logger::log_newroom(Common::String where) {
 
 	warning("STUB: Logger::log_newroom()");
 
-	/*for (fv = 1; fv <= 20; fv ++) output << logfile << ' ';
-	if (_vm->_gyro.log_epson)  output << logfile << emph_on;
+	/*for (fv = 1; fv <= 20; fv ++)
+		output << logfile << ' ';
+	if (_vm->_gyro.log_epson)
+		output << logfile << emph_on;
 	output << logfile << Common::String('(') + where + ')';
-	if (_vm->_gyro.log_epson)  output << logfile << emph_off;
+	if (_vm->_gyro.log_epson)
+		output << logfile << emph_off;
 	output << logfile << NL;*/
 }
 
-void Logger::log_aside(Common::String what)
+void Logger::log_aside(Common::String what) {
 /* This writes "asides" to the printer. For example, moves in Nim. */
-{
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_aside()");
 
@@ -251,11 +270,13 @@ void Logger::log_aside(Common::String what)
 
 void Logger::log_score(uint16 credit, uint16 now) {
 	byte fv;
-	if (! _vm->_gyro.logging)  return;
+	if (! _vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_score()");
 
-	/*for (fv = 1; fv <= 50; fv ++) output << logfile << ' ';
+	/*for (fv = 1; fv <= 50; fv ++)
+		output << logfile << ' ';
 	output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index a577483..a46f584 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -61,7 +61,8 @@ void Scrolls::setParent(AvalancheEngine *vm) {
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	byte page_;
 
-	if (_vm->_gyro.ledstatus == x)  return; /* Already like that! */
+	if (_vm->_gyro.ledstatus == x)
+		return; /* Already like that! */
 
 	warning("STUB: Scrolls::state(). Calls of Pascal units need to be removed.");
 	//switch (x) {
@@ -82,8 +83,8 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	_vm->_gyro.super_off();
 
 	/*	for (page_ = 0; page_ <= 1; page_ ++) {
-	setactivepage(page_);
-	bar(419, 195, 438, 197);
+		setactivepage(page_);
+		bar(419, 195, 438, 197);
 	}*/
 
 	_vm->_gyro.super_on();
@@ -96,10 +97,11 @@ void Scrolls::easteregg() {
 	warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
 
 	/*	background(15);
-	for (fv = 4; fv <= 100; fv ++)
-	for (ff = 0; ff <= 70; ff ++) {
-	sound(fv * 100 + ff * 10);
-	delay(1);
+	for (fv = 4; fv <= 100; fv ++) {
+		for (ff = 0; ff <= 70; ff ++) {
+			sound(fv * 100 + ff * 10);
+			delay(1);
+		}
 	}
 	nosound;
 	setcolor(10);
@@ -204,9 +206,8 @@ bool Scrolls::they_match(tunetype &played) {
 	mistakes = 0;
 
 	for (fv = 1; fv <= sizeof(played); fv ++)
-		if (played[fv] != Gyro::tune[fv]) {
+		if (played[fv] != Gyro::tune[fv])
 			mistakes++;
-		}
 
 		they_match_result = mistakes < 5;
 		return they_match_result;
@@ -226,17 +227,16 @@ void Scrolls::music_scroll() {
 	_vm->_gyro.on();
 	_vm->_gyro.newpointer(4);
 	//do {
-	//do {
-	//	Gyro::check(); /* was "checkclick;" */
-	//	if (Enhanced::keypressede())  break;
-	//} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
+	//	do {
+	//		Gyro::check(); /* was "checkclick;" */
+	//		if (Enhanced::keypressede())
+	//			break;
+	//	} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
 	//
 	// Needs joystick - not sure it will be implemented.
 
-	//if (Gyro::mpress == 0) {
-	//	inkey(); Needs Lucerna to proceed.
-	//	
-	//}
+	//	if (Gyro::mpress == 0)
+	//		inkey(); Needs Lucerna to proceed.
 	//}
 
 }
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 2d9bd25..1eb97a8 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -91,11 +91,11 @@ void Sequence::call_sequencer() {
 	case 0:
 		return;
 		break; /* No more routines. */
-	case 177: {
+	case 177:
 		_vm->_gyro.dna.user_moves_avvy = true;
 		_vm->_trip.fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */
-		if (seq[0] == 177)  shove_left();
-		}
+		if (seq[0] == 177)
+			shove_left();
 		break;
 	}
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index fe5e5d9..864276f 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -60,27 +60,28 @@ void Timeout::setParent(AvalancheEngine *vm) {
 
 void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
 	fv = 1;
-	while ((fv < 8) && (times[fv].time_left != 0))  fv += 1;
-	if (fv == 8)  return; /* Oh dear... */
+	while ((fv < 8) && (times[fv].time_left != 0))
+		fv += 1;
 
-	{
-		timetype &with = times[fv];  /* Everything's OK here! */
+	if (fv == 8)
+		return; /* Oh dear... */
 
-		with.time_left = howlong;
-		with.then_where = whither;
-		with.what_for = why;
-	}
+	timetype &with = times[fv];  /* Everything's OK here! */
+	with.time_left = howlong;
+	with.then_where = whither;
+	with.what_for = why;
 }
 
 void Timeout::one_tick() {
-	if (_vm->_gyro.ddmnow)  return;
+	if (_vm->_gyro.ddmnow)
+		return;
 
 	for (fv = 1; fv <= 7; fv ++) {
 		timetype &with = times[fv];
 		if (with.time_left > 0) {
 			with.time_left -= 1;
 
-			if (with.time_left == 0)
+			if (with.time_left == 0) {
 				switch (with.then_where) {
 				case procopen_drawbridge :
 					open_drawbridge();
@@ -206,6 +207,7 @@ void Timeout::one_tick() {
 					give_lute_to_geida();
 					break;
 				}
+			}
 		}
 	}
 	_vm->_gyro.roomtime += 1; /* Cycles since you've been in this room. */
@@ -238,28 +240,25 @@ end;*/
 /* Timeout procedures: */
 
 void Timeout::open_drawbridge() {
-	{
-		_vm->_gyro.dna.drawbridge_open ++;
-		_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
+	_vm->_gyro.dna.drawbridge_open ++;
+	_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
 
-		if (_vm->_gyro.dna.drawbridge_open == 4)
-			_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
-		else set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
-	}
+	if (_vm->_gyro.dna.drawbridge_open == 4)
+		_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
+	else
+		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
 
 /* --- */
 
 void Timeout::avaricius_talks() {
-	{
-		_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
-		_vm->_gyro.dna.avaricius_talk ++;
-
-		if (_vm->_gyro.dna.avaricius_talk < 17)
-			set_up_timer(177, procavaricius_talks, reason_avariciustalks);
-		else _vm->_lucerna.points(3);
+	_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
+	_vm->_gyro.dna.avaricius_talk ++;
 
-	}
+	if (_vm->_gyro.dna.avaricius_talk < 17)
+		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
+	else
+		_vm->_lucerna.points(3);
 }
 
 void Timeout::urinate() {
@@ -293,16 +292,14 @@ void Timeout::stairs() {
 }
 
 void Timeout::cardiff_survey() {
-	{
-		switch (_vm->_gyro.dna.cardiff_things) {
-		case 0: {
-			_vm->_gyro.dna.cardiff_things += 1;
-			_vm->_visa.dixi('q', 27);
-		}
+	switch (_vm->_gyro.dna.cardiff_things) {
+	case 0:
+		_vm->_gyro.dna.cardiff_things += 1;
+		_vm->_visa.dixi('q', 27);
 		break;
-		}
-		_vm->_visa.dixi('z', _vm->_gyro.dna.cardiff_things);
 	}
+	_vm->_visa.dixi('z', _vm->_gyro.dna.cardiff_things);
+
 	_vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things;
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
@@ -370,23 +367,20 @@ void Timeout::jacques_wakes_up() {
 	_vm->_gyro.dna.jacques_awake += 1;
 
 	switch (_vm->_gyro.dna.jacques_awake) { /* Additional pictures. */
-	case 1 : {
+	case 1 :
 		_vm->_celer.show_one(1); /* Eyes open. */
 		_vm->_visa.dixi('Q', 45);
-	}
-	break;
-	case 2 : { /* Going through the door. */
+		break;
+	case 2 : /* Going through the door. */
 		_vm->_celer.show_one(2); /* Not on the floor. */
 		_vm->_celer.show_one(3); /* But going through the door. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* You can't wake him up now. */
-	}
-	break;
-	case 3 : { /* Gone through the door. */
+		break;
+	case 3 :  /* Gone through the door. */
 		_vm->_celer.show_one(2); /* Not on the floor, either. */
 		_vm->_celer.show_one(4); /* He's gone... so the door's open. */
 		_vm->_gyro.whereis[_vm->_gyro.pjacques] = 0; /* Gone! */
-	}
-	break;
+		break;
 	}
 
 
@@ -409,9 +403,8 @@ void Timeout::jacques_wakes_up() {
 
 }
 
-void Timeout::naughty_duke()
+void Timeout::naughty_duke() {
 /* This is when the Duke comes in and takes your money. */
-{
 	_vm->_trip.tr[2].init(9, false, &_vm->_trip); /* Here comes the Duke. */
 	_vm->_trip.apped(2, 1); /* He starts at the door... */
 	_vm->_trip.tr[2].walkto(3); /* He walks over to you. */
@@ -438,57 +431,53 @@ void Timeout::naughty_duke3() {
 }
 
 void Timeout::jump() {
-	{
-		dnatype &with = _vm->_gyro.dna;
-
-		with.jumpstatus += 1;
-
-		{
-			triptype &with1 = _vm->_trip.tr[1];
-			switch (with.jumpstatus) {
-			case 1:
-			case 2:
-			case 3:
-			case 5:
-			case 7:
-			case 9:
-				with1.y -= 1;
-				break;
-			case 12:
-			case 13:
-			case 14:
-			case 16:
-			case 18:
-			case 19:
-				with1.y += 1;
-				break;
-			}
-		}
+	dnatype &with = _vm->_gyro.dna;
 
-		if (with.jumpstatus == 20) {
-			/* End of jump. */
-			_vm->_gyro.dna.user_moves_avvy = true;
-			_vm->_gyro.dna.jumpstatus = 0;
-		} else {
-			/* Still jumping. */
-			set_up_timer(1, procjump, reason_jumping);
-		}
+	with.jumpstatus += 1;
 
-		if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
-				&& (_vm->_gyro.dna.room == r__insidecardiffcastle)
-				&& (_vm->_gyro.dna.arrow_in_the_door == true)
-				&& (_vm->_trip.infield(3))) { /* beside the wall*/
-			/* Grab the arrow! */
-			if (_vm->_gyro.dna.carrying >= maxobjs)
-				_vm->_scrolls.display("You fail to grab it, because your hands are full.");
-			else {
-				_vm->_celer.show_one(2);
-				_vm->_gyro.dna.arrow_in_the_door = false; /* You've got it. */
-				_vm->_gyro.dna.obj[_vm->_gyro.bolt] = true;
-				_vm->_lucerna.objectlist();
-				_vm->_visa.dixi('q', 50);
-				_vm->_lucerna.points(3);
-			}
+	triptype &with1 = _vm->_trip.tr[1];
+	switch (with.jumpstatus) {
+	case 1:
+	case 2:
+	case 3:
+	case 5:
+	case 7:
+	case 9:
+		with1.y -= 1;
+		break;
+	case 12:
+	case 13:
+	case 14:
+	case 16:
+	case 18:
+	case 19:
+		with1.y += 1;
+		break;
+	}
+
+	if (with.jumpstatus == 20) {
+		/* End of jump. */
+		_vm->_gyro.dna.user_moves_avvy = true;
+		_vm->_gyro.dna.jumpstatus = 0;
+	} else {
+		/* Still jumping. */
+		set_up_timer(1, procjump, reason_jumping);
+	}
+
+	if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
+			&& (_vm->_gyro.dna.room == r__insidecardiffcastle)
+			&& (_vm->_gyro.dna.arrow_in_the_door == true)
+			&& (_vm->_trip.infield(3))) { /* beside the wall*/
+		/* Grab the arrow! */
+		if (_vm->_gyro.dna.carrying >= maxobjs)
+			_vm->_scrolls.display("You fail to grab it, because your hands are full.");
+		else {
+			_vm->_celer.show_one(2);
+			_vm->_gyro.dna.arrow_in_the_door = false; /* You've got it. */
+			_vm->_gyro.dna.obj[_vm->_gyro.bolt] = true;
+			_vm->_lucerna.objectlist();
+			_vm->_visa.dixi('q', 50);
+			_vm->_lucerna.points(3);
 		}
 	}
 }
@@ -549,29 +538,27 @@ void Timeout::meet_avaroid() {
 		_vm->_visa.dixi('Q', 60);
 		_vm->_gyro.dna.met_avaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
-		{
-			triptype &with = _vm->_trip.tr[1];
-			with.face = _vm->_trip.left;
-			with.x = 151;
-			with.ix = -3;
-			with.iy = -5;
-		}
+
+		triptype &with = _vm->_trip.tr[1];
+		with.face = _vm->_trip.left;
+		with.x = 151;
+		with.ix = -3;
+		with.iy = -5;
+
 		_vm->_gyro.background(2);
 	}
 }
 
 void Timeout::rise_up_oubliette() {
-	{
-		triptype &with = _vm->_trip.tr[1];
+	triptype &with = _vm->_trip.tr[1];
 
-		with.visible = true;
-		with.iy += 1; /* decrements dx/dy! */
-		with.y -= with.iy; /* Uuuupppp we go... */
-		if (with.iy > 0)
-			set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
-		else
-			_vm->_gyro.dna.user_moves_avvy = true;
-	}
+	with.visible = true;
+	with.iy += 1; /* decrements dx/dy! */
+	with.y -= with.iy; /* Uuuupppp we go... */
+	if (with.iy > 0)
+		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
+	else
+		_vm->_gyro.dna.user_moves_avvy = true;
 }
 
 void Timeout::robin_hood_and_geida() {
@@ -602,10 +589,9 @@ void Timeout::avalot_returns() {
 	_vm->_gyro.dna.user_moves_avvy = true;
 }
 
-void Timeout::avvy_sit_down()
+void Timeout::avvy_sit_down() {
 /* This is used when you sit down in the pub in Notts. It loops around so
 	that it will happen when Avvy stops walking. */
-{
 	if (_vm->_trip.tr[1].homing)    /* Still walking */
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
@@ -621,7 +607,9 @@ void Timeout::ghost_room_phew() {
 }
 
 void Timeout::arkata_shouts() {
-	if (_vm->_gyro.dna.teetotal)  return;
+	if (_vm->_gyro.dna.teetotal)
+		return;
+
 	_vm->_visa.dixi('q', 76);
 	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
 }
@@ -629,9 +617,11 @@ void Timeout::arkata_shouts() {
 void Timeout::winning() {
 	_vm->_visa.dixi('q', 79);
 	_vm->_pingo.winning_pic();
+
 	do {
 		_vm->_lucerna.checkclick();
 	} while (!(_vm->_gyro.mrelease == 0));
+
 	_vm->_lucerna.callverb(Acci::vb_score);
 	_vm->_scrolls.display(" T H E    E N D ");
 	_vm->_gyro.lmo = true;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f0d2abc..ac37efe 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -64,8 +64,10 @@ void triptype::andexor() {
 }
 
 void triptype::turn(byte whichway) {
-	if (whichway == 8)  face = 0;
-	else face = whichway;
+	if (whichway == 8)
+		face = 0;
+	else
+		face = whichway;
 }
 
 void triptype::appear(int16 wx, int16 wy, byte wf) {
@@ -82,17 +84,20 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 bool triptype::collision_check() {
 	byte fv;
 
-	bool collision_check_result;
-	for (fv = 1; fv <= _tr->numtr; fv ++)
+	bool collision_check_result = false;
+	for (fv = 1; fv <= _tr->numtr; fv ++) {
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + a.xl) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
 			(_tr->tr[fv].y == y)) {
-				collision_check_result = true;
-				return collision_check_result;
+			collision_check_result = true;
+			break;
 		}
+		// CHECKME: Only checks the first element of the for() statement
 		collision_check_result = false;
 		return collision_check_result;
+	}
+	return collision_check_result;
 }
 
 void triptype::walk() {
@@ -102,8 +107,10 @@ void triptype::walk() {
 void triptype::bounce() {
 	x = ox[_tr->_vm->_gyro.cp];
 	y = oy[_tr->_vm->_gyro.cp];
-	if (check_me)  _tr->stopwalking();
-	else stopwalk();
+	if (check_me)
+		_tr->stopwalking();
+	else
+		stopwalk();
 	_tr->_vm->_gyro.oncandopageswap = false;
 	_tr->_vm->_lucerna.showrw();
 	_tr->_vm->_gyro.oncandopageswap = true;
@@ -111,8 +118,10 @@ void triptype::bounce() {
 
 int8 triptype::sgn(int16 x) {
 	int8 sgn_result;
-	if (x > 0)  sgn_result = 1;
-	else if (x < 0)  sgn_result = -1;
+	if (x > 0)
+		sgn_result = 1;
+	else if (x < 0)
+		sgn_result = -1;
 	else
 		sgn_result = 0; /* x=0 */
 	return sgn_result;
@@ -141,29 +150,40 @@ void triptype::homestep() {
 	iy = 0;
 	if (hy != y) {
 		temp = hy - y;
-		if (temp > 4)  iy = 4;
-		else if (temp < -4)  iy = -4;
-		else iy = temp;
+		if (temp > 4)
+			iy = 4;
+		else if (temp < -4)
+			iy = -4;
+		else
+			iy = temp;
 	}
 	if (hx != x) {
 		temp = hx - x;
-		if (temp > 4)  ix = 4;
-		else if (temp < -4)  ix = -4;
-		else ix = temp;
+		if (temp > 4)
+			ix = 4;
+		else if (temp < -4)
+			ix = -4;
+		else
+			ix = temp;
 	}
 }
 
 void triptype::speed(int8 xx, int8 yy) {
 	ix = xx;
 	iy = yy;
-	if ((ix == 0) && (iy == 0))  return; /* no movement */
+	if ((ix == 0) && (iy == 0))
+		return; /* no movement */
 	if (ix == 0) {
 		/* No horz movement */
-		if (iy < 0)  turn(_tr->up);
-		else turn(_tr->down);
+		if (iy < 0)
+			turn(_tr->up);
+		else
+			turn(_tr->down);
 	} else {
-		if (ix < 0)  turn(_tr->left);
-		else turn(_tr->right);
+		if (ix < 0)
+			turn(_tr->left);
+		else
+			turn(_tr->right);
 	}
 }
 
@@ -250,17 +270,16 @@ triptype *triptype::done() {
 	int32 id;
 	uint16 soa;
 
-	{
-		adxtype &with = a;
+	adxtype &with = a;
 
-		/*  nds:=num div seq;*/
-		xw = with.xl / 8;
-		if ((with.xl % 8) > 0)  xw += 1;
-		for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
-			totalnum --;
-			free(mani[totalnum]);
-			free(sil[totalnum]); /* <<- Width of a siltype. */
-		}
+	/*  nds:=num div seq;*/
+	xw = with.xl / 8;
+	if ((with.xl % 8) > 0)
+		xw += 1;
+	for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
+		totalnum --;
+		free(mani[totalnum]);
+		free(sil[totalnum]); /* <<- Width of a siltype. */
 	}
 
 	quick = false;
@@ -268,11 +287,6 @@ triptype *triptype::done() {
 	return this;
 }
 
-
-
-
-
-
 getsettype *getsettype::init() {
 	numleft = 0; /* initialise array pointer */
 	return this;
@@ -289,11 +303,6 @@ void getsettype::recall(bytefield &r) {
 	numleft --;
 }
 
-
-
-
-
-
 Trip::Trip() {
 	getsetclear();
 	mustexclaim = false;
@@ -303,11 +312,12 @@ void Trip::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-
 void Trip::loadtrip() {
 	byte gm;
 
-	for (gm = 1; gm <= numtr; gm ++) tr[gm].original();
+	for (gm = 1; gm <= numtr; gm++)
+		tr[gm].original();
+	// CHECKME: A 'i++' is missing somewhere, obviously!
 	for (int i = 0; i < sizeof(aa); aa[i] = 0);
 }
 
@@ -367,24 +377,18 @@ void Trip::catamove(byte ped)
 	_vm->_gyro.dna.geida_spin = 0;
 		
 	switch (xy_uint16) {
-	case 1801: { /* Exit catacombs */
+	case 1801: /* Exit catacombs */
 		fliproom(r__lustiesroom, 4);
 		_vm->_scrolls.display("Phew! Nice to be out of there!");
 		return;
-	}
-	break;
-	case 1033: { /* Oubliette */
+	case 1033: /* Oubliette */
 		fliproom(r__oubliette, 1);
 		_vm->_scrolls.display("Oh, NO!\231\2");
 		return;
-	}
-	break;
-	case 4: {
+	case 4:
 		fliproom(r__geidas, 1);
 		return;
-	}
-	break;
-	case 2307: {
+	case 2307:
 		fliproom(r__lusties, 5);
 		_vm->_scrolls.display("Oh no... here we go again...");
 		_vm->_gyro.dna.user_moves_avvy = false;
@@ -392,156 +396,138 @@ void Trip::catamove(byte ped)
 		tr[1].ix = 0;
 		return;
 	}
-	break;
-	}
 
-	if (! _vm->_gyro.dna.enter_catacombs_from_lusties_room) _vm->_lucerna.load(29);
+	if (! _vm->_gyro.dna.enter_catacombs_from_lusties_room)
+		_vm->_lucerna.load(29);
 	here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x];
 
 	switch (here & 0xf) { /* West. */
-	case 0: { /* no connection (wall) */
+	case 0: /* no connection (wall) */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(28);
-	}
-	break;
-	case 0x1: { /* no connection (wall + shield), */
+		break;
+	case 0x1: /* no connection (wall + shield), */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(29); /* ...shield. */
-	}
-	break;
-	case 0x2: { /* wall with door */
+		break;
+	case 0x2: /* wall with door */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door. */
-	}
-	break;
-	case 0x3: { /* wall with door and shield */
+		break;
+	case 0x3: /* wall with door and shield */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(29); /* ...shield. */
-	}
-	break;
-	case 0x4: { /* no connection (wall + window), */
+		break;
+	case 0x4: /* no connection (wall + window), */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(5);  /* ...window. */
-	}
-	break;
-	case 0x5: { /* wall with door and window */
+		break;
+	case 0x5: /* wall with door and window */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(5); /* ...window. */
-	}
-	break;
-	case 0x6: { /* no connection (wall + torches), */
+		break;
+	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* No door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(7); /* ...torches. */
-	}
-	break;
-	case 0x7: { /* wall with door and torches */
+		break;
+	case 0x7: /* wall with door and torches */
 		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(7); /* ...torches. */
-	}
-	break;
-	case 0xf: { /* straight-through corridor. */
+		break;
+	case 0xf: /* straight-through corridor. */
 		_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* Sloping wall. */
 		_vm->_gyro.magics[3].op = _vm->_gyro.special; /* Straight wall. */
-	}
-	break;
+		break;
 	}
 
 	/*  ---- */
 
 	switch ((here & 0xf0) >> 4) { /* East */
-	case 0: { /* no connection (wall) */
+	case 0: /* no connection (wall) */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(19);
-	}
-	break;
-	case 0x1: { /* no connection (wall + window), */
+		break;
+	case 0x1: /* no connection (wall + window), */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(20); /* ...window. */
-	}
-	break;
-	case 0x2: { /* wall with door */
+		break;
+	case 0x2: /* wall with door */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(21); /* ...door. */
-	}
-	break;
-	case 0x3: { /* wall with door and window */
+		break;
+	case 0x3: /* wall with door and window */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(20); /* ...door, and... */
 		_vm->_celer.show_one(21); /* ...window. */
-	}
-	break;
-	case 0x6: { /* no connection (wall + torches), */
+		break;
+	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* No door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(18); /* ...torches. */
-	}
-	break;
-	case 0x7: { /* wall with door and torches */
+		break;
+	case 0x7: /* wall with door and torches */
 		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(21); /* ...door, and... */
 		_vm->_celer.show_one(18); /* ...torches. */
-	}
-	break;
-	case 0xf: { /* straight-through corridor. */
+		break;
+	case 0xf: /* straight-through corridor. */
 		_vm->_gyro.magics[5].op = _vm->_gyro.nix; /* Sloping wall. */
 		_vm->_gyro.magics[6].op = _vm->_gyro.special; /* Straight wall. */
 		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
-	}
-	break;
+		break;
 	}
 
 	/*  ---- */
 
 	switch ((here & 0xf00) >> 8) { /* South */
-	case 0: { /* No connection. */
+	case 0: /* No connection. */
 		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
-	}
-	break;
-	case 0x1: {
+		break;
+	case 0x1:
 		_vm->_celer.show_one(22);
 			
 		if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows))
@@ -550,97 +536,95 @@ void Trip::catamove(byte ped)
 
 		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
-	}
-	break;
-	case 0x2: {
+		break;
+	case 0x2:
 		_vm->_celer.show_one(23);
 		_vm->_gyro.magics[7].op = _vm->_gyro.special; /* Middle exit south. */
 		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
-	}
-	break;
-	case 0x3: {
+		break;
+	case 0x3:
 		_vm->_celer.show_one(24);
 		_vm->_gyro.magics[12].op = _vm->_gyro.special; /* Left exit south. */
 		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
-	}
-	break;
+		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { /* North */
-	case 0: { /* No connection */
+	case 0: /* No connection */
 		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
 		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
-	}
-	break;
-	/* LEFT handles: */
-	/*  $1: begin
-			_vm->_celer.show_one(4);
-			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Left exit north. } { Change magic number! }
-			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
-			end;*/
-	case 0x2: {
+		break;
+	// LEFT handles: 
+/*
+	case 0x1:
 		_vm->_celer.show_one(4);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
-	}
-	break;
-	/*  $3: begin
-			_vm->_celer.show_one(4);
-			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Right exit north. } { Change magic number! }
-			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
-			end;
-		{ RIGHT handles: }
-		$4: begin
-			_vm->_celer.show_one(3);
-			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Left exit north. } { Change magic number! }
-			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
-			end;*/
-	case 0x5: {
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		break;
+*/
+	case 0x2:
+		_vm->_celer.show_one(4);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // Middle exit north.
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; // Door.
+		break;
+/*	case 0x3:
+		_vm->_celer.show_one(4);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. } { Change magic number! }
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		break;
+	// RIGHT handles:
+	case 0x4:
+		_vm->_celer.show_one(3);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		break;
+*/
+	case 0x5:
 		_vm->_celer.show_one(3);
 		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */
 		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
-	}
-	break;
-	/*  $6: begin
-			_vm->_celer.show_one(3);
-			_vm->_gyro.magics[1].op:=_vm->_gyro.bounces; { Right exit north. }
-			_vm->_gyro.portals[12].op:=_vm->_gyro.special; { Door. }
-			end;*/
-	/* ARCHWAYS: */
+		break;
+/*
+	case 0x6:
+		_vm->_celer.show_one(3);
+		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. }
+		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		break;
+*/
+	// ARCHWAYS:
 	case 0x7:
 	case 0x8:
 	case 0x9: {
 		_vm->_celer.show_one(6);
 
-		if (((here & 0xf000) >> 12) > 0x7)  _vm->_celer.show_one(31);
-		if (((here & 0xf000) >> 12) == 0x9)  _vm->_celer.show_one(32);
+		if (((here & 0xf000) >> 12) > 0x7)
+			_vm->_celer.show_one(31);
+		if (((here & 0xf000) >> 12) == 0x9)
+			_vm->_celer.show_one(32);
 
 		_vm->_gyro.magics[1].op = _vm->_gyro.special; /* Middle arch north. */
 		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
 	}
 	break;
 	/* DECORATIONS: */
-	case 0xd: { /* No connection + WINDOW */
+	case 0xd: /* No connection + WINDOW */
 		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
 		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(14);
-	}
-	break;
-	case 0xe: { /* No connection + TORCH */
+		break;
+	case 0xe: /* No connection + TORCH */
 		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
 		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
 		_vm->_celer.show_one(8);
-	}
-	break;
+		break;
 	/* Recessed door: */
-	case 0xf: {
+	case 0xf:
 		_vm->_gyro.magics[1].op = _vm->_gyro.nix; /* Door to Geida's room. */
 		_vm->_celer.show_one(1);
 		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
-	}
-	break;
+		break;
 	}
 
 	switch (xy_uint16) {
@@ -660,7 +644,8 @@ void Trip::catamove(byte ped)
 		}
 		break;
 	case 1287:
-		for (fv = 10; fv <= 13; fv ++) _vm->_celer.show_one(fv);
+		for (fv = 10; fv <= 13; fv ++)
+			_vm->_celer.show_one(fv);
 		break; /* [7,5] : 4 candles. */
 	case 776:
 		_vm->_celer.show_one(10);
@@ -668,11 +653,10 @@ void Trip::catamove(byte ped)
 	case 2049:
 		_vm->_celer.show_one(11);
 		break;     /* [1,8] : another candle. */
-	case 257: {
+	case 257:
 		_vm->_celer.show_one(12);
 		_vm->_celer.show_one(13);
-	}
-	break; /* [1,1] : the other two. */
+		break; /* [1,1] : the other two. */
 	}
 
 	if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) {
@@ -695,16 +679,15 @@ void Trip::dawndelay() {
 
 void Trip::call_special(uint16 which) {
 	switch (which) {
-	case 1: { /* _vm->_gyro.special 1: Room 22: top of stairs. */
+	case 1: /* _vm->_gyro.special 1: Room 22: top of stairs. */
 		_vm->_celer.show_one(1);
 		_vm->_gyro.dna.brummie_stairs = 1;
 		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
 		_vm->_timeout.set_up_timer(10, _vm->_timeout.procstairs, _vm->_timeout.reason_brummiestairs);
 		stopwalking();
 		_vm->_gyro.dna.user_moves_avvy = false;
-	}
-	break;
-	case 2: { /* _vm->_gyro.special 2: Room 22: bottom of stairs. */
+		break;
+	case 2: /* _vm->_gyro.special 2: Room 22: bottom of stairs. */
 		_vm->_gyro.dna.brummie_stairs = 3;
 		_vm->_gyro.magics[11].op = _vm->_gyro.nix;
 		_vm->_gyro.magics[12].op = _vm->_gyro.exclaim;
@@ -713,9 +696,8 @@ void Trip::call_special(uint16 which) {
 		stopwalking();
 		_vm->_visa.dixi('q', 26);
 		_vm->_gyro.dna.user_moves_avvy = true;
-	}
-	break;
-	case 3: { /* _vm->_gyro.special 3: Room 71: triggers dart. */
+		break;
+	case 3: /* _vm->_gyro.special 3: Room 71: triggers dart. */
 		tr[1].bounce(); /* Must include that. */
 
 		if (! _vm->_gyro.dna.arrow_triggered) {
@@ -730,17 +712,13 @@ void Trip::call_special(uint16 which) {
 			tr[2].call_eachstep = true;
 			tr[2].eachstep = procarrow_procs;
 		}
-	}
-	break;
-
-	case 4: { /* This is the ghost room link. */
+		break;
+	case 4: /* This is the ghost room link. */
 		_vm->_lucerna.dusk();
 		tr[1].turn(right); /* you'll see this after we get back from bootstrap */
 		_vm->_timeout.set_up_timer(1, _vm->_timeout.procghost_room_phew, _vm->_timeout.reason_ghost_room_phew);
 		_vm->_enid.back_to_bootstrap(3);
-	}
-	break;
-
+		break;
 	case 5:
 		if (_vm->_gyro.dna.friar_will_tie_you_up) {
 			/* _vm->_gyro.special 5: Room 42: touched tree, and get tied up. */
@@ -759,17 +737,14 @@ void Trip::call_special(uint16 which) {
 			_vm->_timeout.set_up_timer(364, _vm->_timeout.prochang_around, _vm->_timeout.reason_hanging_around);
 		}
 		break;
-
-	case 6: { /* _vm->_gyro.special 6: fall down oubliette. */
+	case 6: /* _vm->_gyro.special 6: fall down oubliette. */
 		_vm->_gyro.dna.user_moves_avvy = false;
 		tr[1].ix = 3;
 		tr[1].iy = 0;
 		tr[1].face = right;
 		_vm->_timeout.set_up_timer(1, _vm->_timeout.procfall_down_oubliette, _vm->_timeout.reason_falling_down_oubliette);
-	}
-	break;
-
-	case 7: { /* _vm->_gyro.special 7: stop falling down oubliette. */
+		break;
+	case 7: /* _vm->_gyro.special 7: stop falling down oubliette. */
 		tr[1].visible = false;
 		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
 		stopwalking();
@@ -778,9 +753,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
-	}
-	break;
-
+		break;
 	case 8:        /* _vm->_gyro.special 8: leave du Lustie's room. */
 		if ((_vm->_gyro.dna.geida_follows) && (! _vm->_gyro.dna.lustie_is_asleep)) {
 			_vm->_visa.dixi('q', 63);
@@ -790,21 +763,20 @@ void Trip::call_special(uint16 which) {
 			_vm->_lucerna.gameover();
 		}
 		break;
-
-	case 9: { /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
-		if (! _vm->_gyro.dna.geida_follows)  return;   /* DOESN'T COUNT: no Geida. */
+	case 9: /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
+		if (! _vm->_gyro.dna.geida_follows)
+			return;   /* DOESN'T COUNT: no Geida. */
 		tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
 		tr[2].walkto(4); /* She walks to somewhere... */
 		tr[1].done();     /* Lose Avvy. */
 		_vm->_gyro.dna.user_moves_avvy = false;
 		_vm->_timeout.set_up_timer(40, _vm->_timeout.procrobin_hood_and_geida, _vm->_timeout.reason_robin_hood_and_geida);
-	}
-	break;
-
-	case 10: { /* _vm->_gyro.special 10: transfer north in catacombs. */
+		break;
+	case 10: /* _vm->_gyro.special 10: transfer north in catacombs. */
 		if ((_vm->_gyro.dna.cat_x == 4) && (_vm->_gyro.dna.cat_y == 1)) {
 			/* Into Geida's room. */
-			if (_vm->_gyro.dna.obj[_vm->_gyro.key])  _vm->_visa.dixi('q', 62);
+			if (_vm->_gyro.dna.obj[_vm->_gyro.key])
+				_vm->_visa.dixi('q', 62);
 			else {
 				_vm->_visa.dixi('q', 61);
 				return;
@@ -813,7 +785,8 @@ void Trip::call_special(uint16 which) {
 		_vm->_lucerna.dusk();
 		_vm->_gyro.dna.cat_y -= 1;
 		catamove(4);
-		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		if (_vm->_gyro.dna.room != r__catacombs)
+			return;
 		_vm->_lucerna.delavvy();
 		switch ((_vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x] & 0xf00) >> 8) {
 		case 0x1:
@@ -827,78 +800,72 @@ void Trip::call_special(uint16 which) {
 		}
 		getback();
 		dawndelay();
-	}
-	break;
-	case 11: { /* _vm->_gyro.special 11: transfer east in catacombs. */
+		break;
+	case 11: /* _vm->_gyro.special 11: transfer east in catacombs. */
 		_vm->_lucerna.dusk();
 		_vm->_gyro.dna.cat_x += 1;
 		catamove(1);
-		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		if (_vm->_gyro.dna.room != r__catacombs)
+			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 1);
 		getback();
 		dawndelay();
-	}
-	break;
-	case 12: { /* _vm->_gyro.special 12: transfer south in catacombs. */
+		break;
+	case 12: /* _vm->_gyro.special 12: transfer south in catacombs. */
 		_vm->_lucerna.dusk();
 		_vm->_gyro.dna.cat_y += 1;
 		catamove(2);
-		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		if (_vm->_gyro.dna.room != r__catacombs)
+			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 2);
 		getback();
 		dawndelay();
-	}
-	break;
-	case 13: { /* _vm->_gyro.special 13: transfer west in catacombs. */
+		break;
+	case 13: /* _vm->_gyro.special 13: transfer west in catacombs. */
 		_vm->_lucerna.dusk();
 		_vm->_gyro.dna.cat_x -= 1;
 		catamove(3);
-		if (_vm->_gyro.dna.room != r__catacombs)  return;
+		if (_vm->_gyro.dna.room != r__catacombs)
+			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 3);
 		getback();
 		dawndelay();
-	}
-	break;
+		break;
 	}
 }
 
 	
 
-void Trip::open_the_door(byte whither, byte ped, byte magicnum)
+void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 /* This slides the door open. (The data really ought to be saved in
 	the Also file, and will be next time. However, for now, they're
 	here.) */
-{
 	switch (_vm->_gyro.dna.room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
-	case r__outsideducks: {
+	case r__outsideducks:
 		_vm->_sequence.first_show(1);
 		_vm->_sequence.then_show(2);
 		_vm->_sequence.then_show(3);
-	}
-	break;
-	case r__insidecardiffcastle: {
+		break;
+	case r__insidecardiffcastle:
 		_vm->_sequence.first_show(1);
 		_vm->_sequence.then_show(5);
-	}
-	break;
+		break;
 	case r__avvysgarden:
 	case r__entrancehall:
-	case r__insideabbey: {
+	case r__insideabbey:
 		_vm->_sequence.first_show(1);
 		_vm->_sequence.then_show(2);
-	}
-	break;
+		break;
 	case r__musicroom:
-	case r__outsideargentpub: {
+	case r__outsideargentpub:
 		_vm->_sequence.first_show(5);
 		_vm->_sequence.then_show(6);
-	}
-	break;
+		break;
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
@@ -915,12 +882,11 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum)
 				_vm->_sequence.then_show(9);
 			}
 			break;
-		case 12: {
+		case 12:
 			_vm->_sequence.first_show(4);
 			_vm->_sequence.then_show(5);
 			_vm->_sequence.then_show(6);
-		}
-		break;
+			break;
 		}
 		break;
 	}
@@ -936,33 +902,31 @@ void Trip::newspeed() {
 }
 
 void Trip::rwsp(byte t, byte r) {
-	{
-		switch (r) {
-		case up:
-			tr[t].speed(0, -tr[t].ys);
-			break;
-		case down:
-			tr[t].speed(0, tr[t].ys);
-			break;
-		case left:
-			tr[t].speed(-tr[t].xs,  0);
-			break;
-		case right:
-			tr[t].speed(tr[t].xs,  0);
-			break;
-		case ul:
-			tr[t].speed(-tr[t].xs, -tr[t].ys);
-			break;
-		case ur:
-			tr[t].speed(tr[t].xs, -tr[t].ys);
-			break;
-		case dl:
-			tr[t].speed(-tr[t].xs, tr[t].ys);
-			break;
-		case dr:
-			tr[t].speed(tr[t].xs, tr[t].ys);
-			break;
-		}
+	switch (r) {
+	case up:
+		tr[t].speed(0, -tr[t].ys);
+		break;
+	case down:
+		tr[t].speed(0, tr[t].ys);
+		break;
+	case left:
+		tr[t].speed(-tr[t].xs,  0);
+		break;
+	case right:
+		tr[t].speed(tr[t].xs,  0);
+		break;
+	case ul:
+		tr[t].speed(-tr[t].xs, -tr[t].ys);
+		break;
+	case ur:
+		tr[t].speed(tr[t].xs, -tr[t].ys);
+		break;
+	case dl:
+		tr[t].speed(-tr[t].xs, tr[t].ys);
+		break;
+	case dr:
+		tr[t].speed(tr[t].xs, tr[t].ys);
+		break;
 	}
 }
 
@@ -994,19 +958,17 @@ void Trip::getback() {
 	endangered = false;
 	/* Super_Off;*/
 
-	{
-		while (getset[1 - _vm->_gyro.cp].numleft > 0) {
-			getset[1 - _vm->_gyro.cp].recall(r);
+	while (getset[1 - _vm->_gyro.cp].numleft > 0) {
+		getset[1 - _vm->_gyro.cp].recall(r);
 
-			/*    if overlaps_with_mouse and not endangered then
-				begin
-					endangered:=true;
-					blitfix;
-					Super_Off;
-				end;*/
+		/*    if overlaps_with_mouse and not endangered then
+			begin
+				endangered:=true;
+				blitfix;
+				Super_Off;
+			end;*/
 
-			_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
-		}
+		_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
 	}
 
 	_vm->_lucerna.blitfix();
@@ -1028,7 +990,8 @@ void Trip::follow_avvy_y(byte tripnum) {
 			return;
 		if (tr[tripnum].ix == 0)  {
 			tr[tripnum].step += 1;
-			if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+			if (tr[tripnum].step == tr[tripnum].a.seq)
+				tr[tripnum].step = 0;
 			tr[tripnum].count = 0;
 		}
 	}
@@ -1045,8 +1008,10 @@ void Trip::back_and_forth(byte tripnum) {
 
 void Trip::face_avvy(byte tripnum) {
 	if (! tr[tripnum].homing) {
-		if (tr[1].x >= tr[tripnum].x)  tr[tripnum].face = right;
-		else tr[tripnum].face = left;
+		if (tr[1].x >= tr[tripnum].x)
+			tr[tripnum].face = right;
+		else
+			tr[tripnum].face = left;
 	}
 }
 
@@ -1119,22 +1084,22 @@ void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
 		/* Still some way to go. */
 		if (tr[tripnum].x < tox) {
 			tr[tripnum].x += 5;
-			if (tr[tripnum].x > tox)  tr[tripnum].x = tox;
+			if (tr[tripnum].x > tox)
+				tr[tripnum].x = tox;
 		}
-		if (tr[tripnum].y < toy)  tr[tripnum].y += 1;
+		if (tr[tripnum].y < toy)
+			tr[tripnum].y += 1;
 		tr[tripnum].step += 1;
-		if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+		if (tr[tripnum].step == tr[tripnum].a.seq)
+			tr[tripnum].step = 0;
 	}
 }
 
-
-
-
-
 void Trip::take_a_step(byte &tripnum) {
 	if (tr[tripnum].ix == 0) {
 		tr[tripnum].step += 1;
-		if (tr[tripnum].step == tr[tripnum].a.seq)  tr[tripnum].step = 0;
+		if (tr[tripnum].step == tr[tripnum].a.seq)
+			tr[tripnum].step = 0;
 		tr[tripnum].count = 0;
 	}
 }
@@ -1142,7 +1107,8 @@ void Trip::take_a_step(byte &tripnum) {
 void Trip::spin(byte whichway, byte &tripnum) {
 	if (tr[tripnum].face != whichway) {
 		tr[tripnum].face = whichway;
-		if (tr[tripnum].whichsprite == 2)  return; /* Not for Spludwick */
+		if (tr[tripnum].whichsprite == 2)
+			return; /* Not for Spludwick */
 
 		_vm->_gyro.dna.geida_spin += 1;
 		_vm->_gyro.dna.geida_time = 20;
@@ -1157,7 +1123,8 @@ void Trip::spin(byte whichway, byte &tripnum) {
 void Trip::geida_procs(byte tripnum) {
 	if (_vm->_gyro.dna.geida_time > 0) {
 		_vm->_gyro.dna.geida_time -= 1;
-		if (_vm->_gyro.dna.geida_time == 0)  _vm->_gyro.dna.geida_spin = 0;
+		if (_vm->_gyro.dna.geida_time == 0)
+			_vm->_gyro.dna.geida_spin = 0;
 	}
 
 	if (tr[tripnum].y < (tr[1].y - 2)) {
@@ -1185,7 +1152,8 @@ void Trip::geida_procs(byte tripnum) {
 		tr[tripnum].ix = -tr[1].xs;
 		spin(left, tripnum);
 		take_a_step(tripnum);
-	} else tr[tripnum].ix = 0;
+	} else
+		tr[tripnum].ix = 0;
 }
 
 /* That's all... */
@@ -1205,7 +1173,7 @@ void Trip::call_andexors() {
 
 	do {
 		ok = true;
-		for (fv = 1; fv <= 4; fv ++)
+		for (fv = 1; fv <= 4; fv ++) {
 			if (((order[fv] != 0) && (order[fv + 1] != 0))
 					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
 				/* Swap them! */
@@ -1214,17 +1182,20 @@ void Trip::call_andexors() {
 				order[fv + 1] = temp;
 				ok = false;
 			}
+		}
 	} while (!ok);
 
-	for (fv = 1; fv <= 5; fv ++)
+	for (fv = 1; fv <= 5; fv ++) {
 		if (order[fv] > 0)
 			tr[order[fv]].andexor();
+	}
 }
 
 void Trip::trippancy_link() {
 	byte fv;
 
-	if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)  return;
+	if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)
+		return;
 	for (fv = 1; fv <= numtr; fv ++) {
 		if (tr[fv].quick)
 			tr[fv].walk();
@@ -1268,9 +1239,9 @@ void Trip::get_back_loretta() {
 
 	/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
 	for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
-			getback();
-			return;
-		}
+		getback();
+		return;
+	}
 	/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
 }
 
@@ -1285,63 +1256,68 @@ void Trip::tripkey(char dir) {
 	if ((_vm->_gyro.ctrl == cjoy) | (! _vm->_gyro.dna.user_moves_avvy))
 		return;
 
-	{
-		triptype &with = tr[1];
-		{
-			switch (dir) {
-			case 'H':
-				if (_vm->_gyro.dna.rw != up) {
-					_vm->_gyro.dna.rw = up;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'P':
-				if (_vm->_gyro.dna.rw != down) {
-					_vm->_gyro.dna.rw = down;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'K':
-				if (_vm->_gyro.dna.rw != left) {
-					_vm->_gyro.dna.rw = left;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'M':
-				if (_vm->_gyro.dna.rw != right) {
-					_vm->_gyro.dna.rw = right;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'I':
-				if (_vm->_gyro.dna.rw != ur) {
-					_vm->_gyro.dna.rw = ur;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'Q':
-				if (_vm->_gyro.dna.rw != dr) {
-					_vm->_gyro.dna.rw = dr;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'O':
-				if (_vm->_gyro.dna.rw != dl) {
-					_vm->_gyro.dna.rw = dl;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'G':
-				if (_vm->_gyro.dna.rw != ul) {
-					_vm->_gyro.dna.rw = ul;
-					rwsp(1, _vm->_gyro.dna.rw);
-				} else stopwalking();
-				break;
-			case 'L':
-				stopwalking();
-				break;
-			}
-		}
+	triptype &with = tr[1];
+
+	switch (dir) {
+	case 'H':
+		if (_vm->_gyro.dna.rw != up) {
+			_vm->_gyro.dna.rw = up;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'P':
+		if (_vm->_gyro.dna.rw != down) {
+			_vm->_gyro.dna.rw = down;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'K':
+		if (_vm->_gyro.dna.rw != left) {
+			_vm->_gyro.dna.rw = left;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'M':
+		if (_vm->_gyro.dna.rw != right) {
+			_vm->_gyro.dna.rw = right;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'I':
+		if (_vm->_gyro.dna.rw != ur) {
+			_vm->_gyro.dna.rw = ur;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'Q':
+		if (_vm->_gyro.dna.rw != dr) {
+			_vm->_gyro.dna.rw = dr;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'O':
+		if (_vm->_gyro.dna.rw != dl) {
+			_vm->_gyro.dna.rw = dl;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'G':
+		if (_vm->_gyro.dna.rw != ul) {
+			_vm->_gyro.dna.rw = ul;
+			rwsp(1, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case 'L':
+		stopwalking();
+		break;
 	}
 }
 
@@ -1350,9 +1326,7 @@ void Trip::readstick() {
 }
 
 void Trip::getsetclear() {
-	byte fv;
-
-	for (fv = 0; fv <= 1; fv ++)
+	for (byte fv = 0; fv <= 1; fv ++)
 		getset[fv].init();
 }
 
@@ -1384,20 +1358,10 @@ void Trip::hide_in_the_cupboard() {
 	}
 }
 
-
-
-
-
-
-
-
-
 void Trip::tidy_up(int16 a, int16 b, int16 c, int16 d) {
 	warning("STUB: Trip::tidy_up()");
 }
 
-
-
 void Trip::tidy_after_mouse() {
 	tidy_up(beforex, beforey, beforex + 15, beforey + 15);
 	_vm->_gyro.xycheck();
@@ -1407,7 +1371,6 @@ void Trip::tidy_after_mouse() {
 void Trip::fliproom(byte room, byte ped) {
 	byte fv;
 
-
 	if (! _vm->_gyro.alive) {
 		/* You can't leave the room if you're dead. */
 		tr[1].ix = 0;
@@ -1462,9 +1425,7 @@ void Trip::fliproom(byte room, byte ped) {
 
 bool Trip::infield(byte which) {
 /* returns True if you're within field "which" */
-	int16 yy;
-		
-	yy = tr[1].y + tr[1].a.yl;
+	int16 yy = tr[1].y + tr[1].a.yl;
 
 	return (tr[1].x >= _vm->_gyro.fields[which].x1) && (tr[1].x <= _vm->_gyro.fields[which].x2)
 		&& (yy >= _vm->_gyro.fields[which].y1) && (yy <= _vm->_gyro.fields[which].y2);
@@ -1492,7 +1453,7 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 
 		if ((ux >= _vm->_gyro.fields[fv].x1) && (ux <= _vm->_gyro.fields[fv].x2)
 			&& (uy >= _vm->_gyro.fields[fv].y1) && (uy <= _vm->_gyro.fields[fv].y2)) 
-				nd = true;
+			nd = true;
 	}
 	return nd;
 }


Commit: 63737c3878a4e6c22d7dc4d67cfbd59310e46c67
    https://github.com/scummvm/scummvm/commit/63737c3878a4e6c22d7dc4d67cfbd59310e46c67
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T05:14:31-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/timeout2.cpp
	engines/avalanche/trip6.cpp

Changed paths:
  A engines/avalanche/acci2.cpp
  A engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/logger2.cpp
    engines/avalanche/logger2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/pingo2.cpp
    engines/avalanche/pingo2.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp





Commit: 539ce5612406edae9c3c226ed506602b8d197120
    https://github.com/scummvm/scummvm/commit/539ce5612406edae9c3c226ed506602b8d197120
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T13:01:05-07:00

Commit Message:
AVALANCHE: Fix some more code formatting

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/logger2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2a86732..d16c8c6 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+ /* 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
@@ -216,10 +216,6 @@ const Acci::ranktype Acci::ranks[9] = {
 };
 
 
-
-
-
-
 void Acci::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
@@ -239,13 +235,14 @@ Common::String Acci::wordnum(Common::String x)
 	bool gotcha;
 
 	Common::String wordnum_result;
-	if (x == "")  {
+	if (x == "") {
 		wordnum_result = "";
 		return wordnum_result;
 	}
 	whatsit = pardon;
 	gotcha = false;
-	for (fv = nowords; fv >= 1; fv --) checkword(x);
+	for (fv = nowords; fv >= 1; fv--)
+		checkword(x);
 	wordnum_result = whatsit;
 	return wordnum_result;
 }
@@ -273,13 +270,14 @@ end;*/
 Common::String Acci::rank() {
 	byte fv;
 
-	Common::String rank_result;
-	for (fv = 1; fv <= 8; fv ++)
+	Common::String rank_result = "";
+	for (fv = 1; fv <= 8; fv++) {
 		if ((_vm->_gyro.dna.score >= ranks[fv].score) && (_vm->_gyro.dna.score < ranks[fv + 1].score)) {
 			rank_result = ranks[fv].title;
 			return rank_result;
 		}
-
+	}
+	
 	return rank_result;
 }
 
@@ -341,11 +339,6 @@ bool Acci::do_pronouns() {
 	return do_pronouns_result;
 }
 
-
-
-
-
-
 void Acci::lowercase() {
 	byte fv;
 
@@ -421,9 +414,7 @@ void Acci::examine() {
 
 void Acci::inv() {   /* the time-honoured command... */
 	char fv;
-	byte q;
-
-	q = 0;
+	byte q = 0;
 
 	warning("STUB: Acci::inv()");
 }
@@ -442,19 +433,24 @@ void Acci::lookaround() {
 	_vm->_scrolls.display(*_vm->_gyro.also[0][1]);
 	switch (_vm->_gyro.dna.room) {
 	case r__spludwicks:
-		if (_vm->_gyro.dna.avaricius_talk > 0)  _vm->_visa.dixi('q', 23);
-		else others();
+		if (_vm->_gyro.dna.avaricius_talk > 0)
+			_vm->_visa.dixi('q', 23);
+		else
+			others();
+		break;
+	case r__robins:
+		if (_vm->_gyro.dna.tied_up)
+			_vm->_visa.dixi('q', 38);
+		if (_vm->_gyro.dna.mushroom_growing)
+			_vm->_visa.dixi('q', 55);
 		break;
-	case r__robins: {
-		if (_vm->_gyro.dna.tied_up)  _vm->_visa.dixi('q', 38);
-		if (_vm->_gyro.dna.mushroom_growing)  _vm->_visa.dixi('q', 55);
-	}
-	break;
 	case r__insidecardiffcastle:
-		if (! _vm->_gyro.dna.taken_pen)  _vm->_visa.dixi('q', 49);
+		if (!_vm->_gyro.dna.taken_pen)
+			_vm->_visa.dixi('q', 49);
 		break;
 	case r__lustiesroom:
-		if (_vm->_gyro.dna.lustie_is_asleep)  _vm->_visa.dixi('q', 65);
+		if (_vm->_gyro.dna.lustie_is_asleep)
+			_vm->_visa.dixi('q', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro.dna.cat_y * 256 + _vm->_gyro.dna.cat_x) {
@@ -487,7 +483,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 		}
 		break;
 	case r__spludwicks:
-		if (thing == 61)  {
+		if (thing == 61) {
 			_vm->_visa.dixi('q', 85);
 			return;
 		}
@@ -495,26 +491,25 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	}
 
 
-	if ((! _vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
+	if ((!_vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
 		return; /* No doors can open if you can't move Avvy. */
-	for (fv = 9; fv <= 15; fv ++)
+
+	for (fv = 9; fv <= 15; fv++) {
 		if (_vm->_trip.infield(fv)) {
 			{
 				_vm->_gyro.portals[fv];
 				switch (_vm->_gyro.portals[fv].op) {
-				case _vm->_gyro.exclaim: {
+				case _vm->_gyro.exclaim:
 					_vm->_trip.tr[1].bounce();
 					_vm->_visa.dixi('x', _vm->_gyro.portals[fv].data);
-				}
-				break;
+					break;
 				case _vm->_gyro.transport:
 					_vm->_trip.fliproom((_vm->_gyro.portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro.portals[fv].data) & 0x0F /*Low byte*/);
 					break;
-				case _vm->_gyro.unfinished: {
+				case _vm->_gyro.unfinished:
 					_vm->_trip.tr[1].bounce();
 					_vm->_scrolls.display("Sorry. This place is not available yet!");
-				}
-				break;
+					break;
 				case _vm->_gyro.special:
 					_vm->_trip.call_special(_vm->_gyro.portals[fv].data);
 					break;
@@ -525,6 +520,8 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 			}
 			return;
 		}
+	}
+
 	if (_vm->_gyro.dna.room == r__map)
 		_vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going "
 				"to anywhere other than Argent, Birmingham, Cardiff, "
@@ -541,14 +538,14 @@ void Acci::silly() {
 }
 
 void Acci::putproc() {   /* Called when you call vb_put. */
-	char temp;
-
+	if (!holding())
+		return;
 
-	if (! holding())  return;
 	thing2 -= 49;   /* Slip the second object */
-	temp = thing;
+	char temp = thing;
 	thing = thing2;
-	if (! holding())  return;
+	if (!holding())
+		return;
 	thing = temp;
 
 	/* Thing is the thing which you're putting in. Thing2 is where you're
@@ -569,7 +566,8 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 					_vm->_visa.dixi('u', 9);
 				}
 			}
-		} else silly();
+		} else
+			silly();
 		break;
 
 	case 54:
@@ -577,7 +575,7 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 			if (_vm->_gyro.dna.box_contents != nowt)
 				_vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking"
 						" that out first."));
-			else
+			else {
 				switch (thing) {
 				case _vm->_gyro.money:
 					_vm->_scrolls.display("You'd better keep some ready cash on you!");
@@ -591,7 +589,7 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 				case _vm->_gyro.onion:
 					_vm->_scrolls.display("Just give it to Spludwick, Avvy!");
 					break;
-				default: {
+				default:
 					/* Put the object into the box... */
 					if (_vm->_gyro.dna.wearing == thing)
 						_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro.get_better(thing) + " off first!");
@@ -604,8 +602,9 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 						_vm->_celer.show_one(6); /* Shut box. */
 					}
 				}
-				}
-		} else silly();
+			}
+		} else
+			silly();
 		break;
 
 	default:
@@ -614,9 +613,6 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 }
 
 
-
-
-
 /* The result of this fn is whether or not he says "Hey, thanks!" */
 void Acci::not_in_order() {
 	_vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
@@ -631,72 +627,63 @@ void Acci::go_to_cauldron() {
 }
 
 bool Acci::give2spludwick() {
-	bool give2spludwick_result;
-	{
-		give2spludwick_result = false;
+	bool give2spludwick_result = false;
 
-		if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
-			not_in_order();
-			return give2spludwick_result;
-		}
+	if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
+		not_in_order();
+		return give2spludwick_result;
+	}
 
-		switch (thing) {
-		case _vm->_gyro.onion: {
-			_vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
-			if (_vm->_gyro.dna.rotten_onion)
-				_vm->_visa.dixi('q', 22);
-			else {
-				_vm->_gyro.dna.given2spludwick += 1;
-				_vm->_visa.dixi('q', 20);
-				go_to_cauldron();
-				_vm->_lucerna.points(3);
-			}
-			_vm->_lucerna.objectlist();
-		}
-		break;
-		case _vm->_gyro.ink: {
-			_vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
-			_vm->_lucerna.objectlist();
+	switch (thing) {
+	case _vm->_gyro.onion:
+		_vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
+		if (_vm->_gyro.dna.rotten_onion)
+			_vm->_visa.dixi('q', 22);
+		else {
 			_vm->_gyro.dna.given2spludwick += 1;
-			_vm->_visa.dixi('q', 24);
+			_vm->_visa.dixi('q', 20);
 			go_to_cauldron();
 			_vm->_lucerna.points(3);
 		}
+		_vm->_lucerna.objectlist();
 		break;
-		case _vm->_gyro.mushroom: {
-			_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
-			_vm->_visa.dixi('q', 25);
-			_vm->_lucerna.points(5);
-			_vm->_gyro.dna.given2spludwick += 1;
-			go_to_cauldron();
-			_vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
-			_vm->_lucerna.objectlist();
-		}
+	case _vm->_gyro.ink:
+		_vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
+		_vm->_lucerna.objectlist();
+		_vm->_gyro.dna.given2spludwick += 1;
+		_vm->_visa.dixi('q', 24);
+		go_to_cauldron();
+		_vm->_lucerna.points(3);
 		break;
-		default:
-			give2spludwick_result = true;
-		}
+	case _vm->_gyro.mushroom:
+		_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
+		_vm->_visa.dixi('q', 25);
+		_vm->_lucerna.points(5);
+		_vm->_gyro.dna.given2spludwick += 1;
+		go_to_cauldron();
+		_vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
+		_vm->_lucerna.objectlist();
+		break;
+	default:
+		give2spludwick_result = true;
 	}
+
 	return give2spludwick_result;
 }
 
-
-
 void Acci::have_a_drink() {
-	{
-		_vm->_gyro.dna.alcohol += 1;
-		if (_vm->_gyro.dna.alcohol == 5) {
-			_vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
-			_vm->_gyro.dna.teetotal = true;
-			_vm->_gyro.dna.avvy_is_awake = false;
-			_vm->_gyro.dna.avvy_in_bed = true;
-			_vm->_lucerna.objectlist();
-			_vm->_lucerna.dusk();
-			_vm->_gyro.hang_around_for_a_while();
-			_vm->_trip.fliproom(1, 1);
-			_vm->_gyro.background(14);
-			_vm->_trip.new_game_for_trippancy(); /* Not really */
-		}
+	_vm->_gyro.dna.alcohol += 1;
+	if (_vm->_gyro.dna.alcohol == 5) {
+		_vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
+		_vm->_gyro.dna.teetotal = true;
+		_vm->_gyro.dna.avvy_is_awake = false;
+		_vm->_gyro.dna.avvy_in_bed = true;
+		_vm->_lucerna.objectlist();
+		_vm->_lucerna.dusk();
+		_vm->_gyro.hang_around_for_a_while();
+		_vm->_trip.fliproom(1, 1);
+		_vm->_gyro.background(14);
+		_vm->_trip.new_game_for_trippancy(); /* Not really */
 	}
 }
 
@@ -718,8 +705,6 @@ void Acci::cardiff_climbing() {
 }
 
 
-
-
 /* Called when you ask Avvy to stand. */
 void Acci::already() {
 	_vm->_scrolls.display("You're already standing!");
@@ -742,7 +727,8 @@ void Acci::stand_up() {
 			_vm->_lucerna.points(1);
 			_vm->_gyro.dna.avvy_in_bed = false;
 			_vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts);
-		} else already();
+		} else
+			already();
 		break;
 
 	case r__insidecardiffcastle:
@@ -756,7 +742,8 @@ void Acci::stand_up() {
 			_vm->_trip.apped(1, 4); /* And walking away. */
 			_vm->_gyro.dna.sitting_in_pub = false; /* Really not sitting down. */
 			_vm->_gyro.dna.user_moves_avvy = true; /* And ambulant. */
-		} else already();
+		} else
+			already();
 		break;
 	default:
 		already();
@@ -764,8 +751,6 @@ void Acci::stand_up() {
 }
 
 
-
-
 void Acci::getproc(char thing) {
 	switch (_vm->_gyro.dna.room) {
 	case r__yours:
@@ -779,11 +764,12 @@ void Acci::getproc(char thing) {
 				_vm->_celer.show_one(6);
 			} else
 				_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro.get_better(thing) + " in the box.");
-		} else _vm->_visa.dixi('q', 57);
+		} else
+			_vm->_visa.dixi('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
-		case _vm->_gyro.pen: {
+		case _vm->_gyro.pen:
 			if (_vm->_trip.infield(2)) {
 				/* Standing on the dais. */
 
@@ -798,10 +784,11 @@ void Acci::getproc(char thing) {
 					_vm->_lucerna.objectlist();
 					_vm->_scrolls.display("Taken.");
 				}
-			} else if (_vm->_gyro.dna.standing_on_dais)  _vm->_visa.dixi('q', 53);
-			else _vm->_visa.dixi('q', 51);
-		}
-		break;
+			} else if (_vm->_gyro.dna.standing_on_dais)
+				_vm->_visa.dixi('q', 53);
+			else
+				_vm->_visa.dixi('q', 51);
+			break;
 		case _vm->_gyro.bolt:
 			_vm->_visa.dixi('q', 52);
 			break;
@@ -818,7 +805,8 @@ void Acci::getproc(char thing) {
 			_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = true;
 			_vm->_lucerna.objectlist();
 			_vm->_lucerna.points(3);
-		} else _vm->_visa.dixi('q', 57);
+		} else
+			_vm->_visa.dixi('q', 57);
 		break;
 	default:
 		_vm->_visa.dixi('q', 57);
@@ -826,26 +814,25 @@ void Acci::getproc(char thing) {
 }
 
 void Acci::give_geida_the_lute() {
-	{
-		if (_vm->_gyro.dna.room != r__lustiesroom) {
-			_vm->_scrolls.display("Not yet. Try later!\232\2");
-			return;
-		}
-		_vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
-		_vm->_lucerna.objectlist();
-		_vm->_visa.dixi('q', 64); /* She plays it. */
+	if (_vm->_gyro.dna.room != r__lustiesroom) {
+		_vm->_scrolls.display("Not yet. Try later!\232\2");
+		return;
+	}
+	_vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
+	_vm->_lucerna.objectlist();
+	_vm->_visa.dixi('q', 64); /* She plays it. */
 
-		/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+	/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
 
-		_vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
-		_vm->_enid.back_to_bootstrap(4);
-	}
+	_vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
+	_vm->_enid.back_to_bootstrap(4);
 }
 
 void Acci::play_harp() {
 	if (_vm->_trip.infield(7))
 		_vm->_scrolls.musical_scroll();
-	else _vm->_scrolls.display("Get a bit closer to it, Avvy!");
+	else
+		_vm->_scrolls.display("Get a bit closer to it, Avvy!");
 }
 
 void Acci::winsequence() {
@@ -864,8 +851,10 @@ void Acci::person_speaks() {
 
 
 	if ((person == pardon) || (person == '\0')) {
-		if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room))  person = _vm->_gyro.her;
-		else person = _vm->_gyro.him;
+		if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room))
+			person = _vm->_gyro.her;
+		else
+			person = _vm->_gyro.him;
 	}
 
 	if (_vm->_gyro.whereis[person] != _vm->_gyro.dna.room) {
@@ -875,24 +864,23 @@ void Acci::person_speaks() {
 
 	found = false; /* The person we're looking for's code is in Person. */
 
-	for (fv = 1; fv <= _vm->_trip.numtr; fv ++)
+	for (fv = 1; fv <= _vm->_trip.numtr; fv++) {
 		if (_vm->_trip.tr[fv].quick && ((_vm->_trip.tr[fv].a.accinum + 149) == person)) {
 			_vm->_scrolls.display(Common::String('\23') + char(fv + 48) + '\4');
 			found = true;
 		}
+	}
 
-	if (! found)
-		for (fv = 10; fv <= 25; fv ++) {
+	if (!found) {
+		for (fv = 10; fv <= 25; fv++) {
 			_vm->_gyro.quasipeds[fv];
 			if ((_vm->_gyro.quasipeds[fv].who == person) && (_vm->_gyro.quasipeds[fv].room == _vm->_gyro.dna.room)) {
 				_vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4');
 			}
 		}
+	}
 }
 
-
-
-
 void Acci::heythanks() {
 	person_speaks();
 	_vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)");
@@ -910,25 +898,29 @@ void Acci::do_that() {
 		thats = "";
 		return;
 	}
-	if (_vm->_gyro.weirdword)  return;
-	if (thing < '\310')  thing -= 49; /* "Slip" */
-
-	/*if ((! _vm->_gyro.alive) &
-	!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-	vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
-	vb_highscores, vb_smartalec, eos).has(verb))) {
-	_vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
-	"or something? Try restarting, or restoring a saved game!");
-	return;
+	if (_vm->_gyro.weirdword)
+		return;
+	if (thing < '\310')
+		thing -= 49; /* "Slip" */
+
+	/*
+	if ((!_vm->_gyro.alive) &
+		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
+		vb_highscores, vb_smartalec, eos).has(verb))) {
+		_vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
+		"or something? Try restarting, or restoring a saved game!");
+		return;
 	}
 
 	if ((~ _vm->_gyro.dna.avvy_is_awake) &
-	!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-	vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
-	vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
-	_vm->_scrolls.display("Talking in your sleep? Try waking up!");
-	return;
-	}*/
+		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
+		vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
+		_vm->_scrolls.display("Talking in your sleep? Try waking up!");
+		return;
+	}
+	*/
 
 
 	switch (verb) {
@@ -942,11 +934,13 @@ void Acci::do_that() {
 		_vm->_scrolls.display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
 				"the mouse on the `O.K.\" box to continue.");
 		break;
-	case vb_get: {
+	case vb_get:
 		if (thing != pardon) {
 			/* Legitimate try to pick something up. */
-			if (_vm->_gyro.dna.carrying >= maxobjs)  _vm->_scrolls.display("You can't carry any more!");
-			else getproc(thing);
+			if (_vm->_gyro.dna.carrying >= maxobjs)
+				_vm->_scrolls.display("You can't carry any more!");
+			else
+				getproc(thing);
 
 		} else {
 			/* Not... ditto. */
@@ -955,8 +949,7 @@ void Acci::do_that() {
 			else
 				_vm->_scrolls.display("I assure you, you don't need it.");
 		}
-	}
-	break;
+		break;
 	case vb_drop:
 		_vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
@@ -969,25 +962,32 @@ void Acci::do_that() {
 		if (person == pardon) {
 			if (_vm->_gyro.subjnumber == 99) /* They typed "say passuint16". */
 				_vm->_scrolls.display("Yes, but what \6is\22 the passuint16?");
-			/*else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
-			Delete(thats, 1, 1);
-			move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
-			verb = chr(subjnumber);
-			do_that();
-			return;
+			/*
+			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
+				Delete(thats, 1, 1);
+				move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
+				verb = chr(subjnumber);
+				do_that();
+				return;
 			} else {
-			person = _vm->_gyro.subjnumber;
-			subjnumber = 0;
-			if (set::of(pardon, '\0', eos).has(person))  _vm->_scrolls.display("Talk to whom?");
-			else if (personshere())  talkto(ord(person));
+				person = _vm->_gyro.subjnumber;
+				subjnumber = 0;
+				if (set::of(pardon, '\0', eos).has(person))
+					_vm->_scrolls.display("Talk to whom?");
+				else if (personshere())
+					talkto(ord(person));
 			}
-			}*/ else if (person == pardon)  _vm->_scrolls.display("Talk to whom?");
-		else if (personshere())  _vm->_visa.talkto(person);
+			*/
+			else if (person == pardon)
+				_vm->_scrolls.display("Talk to whom?");
+		} else if (personshere())
+			_vm->_visa.talkto(person);
 		break;
 
 	case vb_give:
 		if (holding()) {
-			if (person == pardon)  _vm->_scrolls.display("Give to whom?");
+			if (person == pardon)
+				_vm->_scrolls.display("Give to whom?");
 			else if (personshere()) {
 				switch (thing) {
 				case _vm->_gyro.money :
@@ -1003,11 +1003,10 @@ void Acci::do_that() {
 					switch (person) {
 					case _vm->_gyro.pcrapulus:
 						switch (thing) {
-						case _vm->_gyro.wine: {
+						case _vm->_gyro.wine:
 							_vm->_scrolls.display("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro.dna.obj[_vm->_gyro.wine] = false;
-						}
-						break;
+							break;
 						default:
 							heythanks();
 						}
@@ -1019,7 +1018,8 @@ void Acci::do_that() {
 						else */heythanks();
 						break;
 					case _vm->_gyro.pspludwick:
-						if (give2spludwick())  heythanks();
+						if (give2spludwick())
+							heythanks();
 						break;
 					case _vm->_gyro.pibythneth:
 						if (thing == _vm->_gyro.badge) {
@@ -1030,7 +1030,8 @@ void Acci::do_that() {
 							_vm->_gyro.dna.givenbadgetoiby = true;
 							_vm->_celer.show_one(8);
 							_vm->_celer.show_one(9);
-						} else heythanks();
+						} else
+							heythanks();
 						break;
 					case _vm->_gyro.payles:
 						if (_vm->_gyro.dna.ayles_is_awake) {
@@ -1041,20 +1042,20 @@ void Acci::do_that() {
 								_vm->_gyro.dna.given_pen_to_ayles = true;
 								_vm->_lucerna.objectlist();
 								_vm->_lucerna.points(2);
-							} else heythanks();
+							} else
+								heythanks();
 						} else
 							_vm->_scrolls.display("But he's asleep!");
 						break;
 					case _vm->_gyro.pgeida:
 						switch (thing) {
-						case _vm->_gyro.potion : {
+						case _vm->_gyro.potion:
 							_vm->_gyro.dna.obj[_vm->_gyro.potion] = false;
 							_vm->_visa.dixi('u', 16); /* She drinks it. */
 							_vm->_lucerna.points(2);
 							_vm->_gyro.dna.geida_given_potion = true;
 							_vm->_lucerna.objectlist();
-						}
-						break;
+							break;
 						case _vm->_gyro.lute:
 							give_geida_the_lute();
 							break;
@@ -1067,7 +1068,8 @@ void Acci::do_that() {
 						case _vm->_gyro.potion:
 							if (_vm->_gyro.dna.geida_given_potion)
 								winsequence();
-							else _vm->_visa.dixi('q', 77);
+							else
+								_vm->_visa.dixi('q', 77);
 							break;             /* That Geida woman! */
 						default:
 							heythanks();
@@ -1084,7 +1086,8 @@ void Acci::do_that() {
 
 	case vb_eat:
 	case vb_drink:
-		if (holding())  swallow();
+		if (holding())
+			swallow();
 		break;
 	case vb_load:
 		_vm->_enid.edna_load(realwords[2]);
@@ -1104,20 +1107,21 @@ void Acci::do_that() {
 	case vb_break:
 		_vm->_scrolls.display("Vandalism is prohibited within this game!");
 		break;
-	case vb_quit: { /* quit */
+	case vb_quit: /* quit */
 		//if (_vm->_gyro.demo) {
 		//	_vm->_visa.dixi('q', 31);
 		//	close(demofile);
 		//	exit(0); /* Change this later!!! */
 		//}
-		if (! polite)  _vm->_scrolls.display("How about a `please\", Avvy?");
-		else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))  _vm->_gyro.lmo = true;
-	}
-	break;
+		if (!polite)
+			_vm->_scrolls.display("How about a `please\", Avvy?");
+		else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))
+			_vm->_gyro.lmo = true;
+		break;
 	case vb_go:
 		_vm->_scrolls.display("Just use the arrow keys to walk there.");
 		break;
-	case vb_info: {
+	case vb_info:
 		_vm->_scrolls.aboutscroll = true;
 		/*            _vm->_scrolls.display('Thorsoft of Letchworth presents:'+^c+^m+^m+
 						'The medi‘val descendant of'+^m+
@@ -1131,10 +1135,10 @@ void Acci::do_that() {
 				'\15' + '\15' + "version " + _vm->_gyro.vernum + '\15' + '\15' + "Copyright ï "
 				+ _vm->_gyro.copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
 		_vm->_scrolls.aboutscroll = false;
-	}
-	break;
+		break;
 	case vb_undress:
-		if (_vm->_gyro.dna.wearing == nowt)  _vm->_scrolls.display("You're already stark naked!");
+		if (_vm->_gyro.dna.wearing == nowt)
+			_vm->_scrolls.display("You're already stark naked!");
 		else if (_vm->_gyro.dna.avvys_in_the_cupboard) {
 			_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro.get_better(_vm->_gyro.dna.wearing) + '.');
 			_vm->_gyro.dna.wearing = nowt;
@@ -1150,7 +1154,7 @@ void Acci::do_that() {
 				_vm->_scrolls.display("Hey, what kind of a weirdo are you\??!");
 				break;
 			case _vm->_gyro.clothes:
-			case _vm->_gyro.habit: { /* Change this! */
+			case _vm->_gyro.habit: /* Change this! */
 				if (_vm->_gyro.dna.wearing != nowt) {
 					if (_vm->_gyro.dna.wearing == thing)
 						_vm->_scrolls.display("You're already wearing that.");
@@ -1161,19 +1165,20 @@ void Acci::do_that() {
 				} else
 					_vm->_gyro.dna.wearing = thing;
 				_vm->_lucerna.objectlist();
-				if (thing == _vm->_gyro.habit)  fv = 3;
-				else fv = 0;
-				{
-					if (_vm->_trip.tr[1].whichsprite != fv) {
-						sx = _vm->_trip.tr[1].x;
-						sy = _vm->_trip.tr[1].y;
-						_vm->_trip.tr[1].done();
-						_vm->_trip.tr[1].init(fv, true, &_vm->_trip);
-						_vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
-						_vm->_trip.tr[1].visible = false;
-					}
+
+				if (thing == _vm->_gyro.habit)
+					fv = 3;
+				else
+					fv = 0;
+
+				if (_vm->_trip.tr[1].whichsprite != fv) {
+					sx = _vm->_trip.tr[1].x;
+					sy = _vm->_trip.tr[1].y;
+					_vm->_trip.tr[1].done();
+					_vm->_trip.tr[1].init(fv, true, &_vm->_trip);
+					_vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
+					_vm->_trip.tr[1].visible = false;
 				}
-			}
 			break;
 			default:
 				_vm->_scrolls.display(what);
@@ -1181,7 +1186,7 @@ void Acci::do_that() {
 		}
 		break;
 	case vb_play:
-		if (thing == pardon)
+		if (thing == pardon) {
 			switch (_vm->_gyro.dna.room) { /* They just typed "play"... */
 			case r__argentpub:
 				// play_nim();
@@ -1191,21 +1196,27 @@ void Acci::do_that() {
 				play_harp();
 				break;
 			}
-		else if (holding()) {
+		} else if (holding()) {
 			switch (thing) {
-			case _vm->_gyro.lute : {
+			case _vm->_gyro.lute :
 				_vm->_visa.dixi('U', 7);
-				if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room)  _vm->_visa.dixi('U', 10);
-				if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room)  _vm->_visa.dixi('U', 15);
-			}
-			break;
-			case 52 :
-				if (_vm->_gyro.dna.room == r__musicroom)  play_harp();
-				else _vm->_scrolls.display(what);
+				if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room)
+					_vm->_visa.dixi('U', 10);
+
+				if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room)
+					_vm->_visa.dixi('U', 15);
 				break;
-			case 55 :
-				if (_vm->_gyro.dna.room == r__argentpub) ;  /*play_nim(); - Don't implement yet.*/
-				else _vm->_scrolls.display(what);
+			case 52:
+				if (_vm->_gyro.dna.room == r__musicroom)
+					play_harp();
+				else
+					_vm->_scrolls.display(what);
+				break;
+			case 55:
+				if (_vm->_gyro.dna.room == r__argentpub)
+					;  /*play_nim(); - Don't implement yet.*/
+				else
+					_vm->_scrolls.display(what);
 				break;
 			default:
 				_vm->_scrolls.display(what);
@@ -1218,7 +1229,8 @@ void Acci::do_that() {
 				_vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
 					_vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)");
-			} else _vm->_scrolls.display(what);
+			} else
+				_vm->_scrolls.display(what);
 		}
 		break;
 	case vb_help:
@@ -1239,13 +1251,13 @@ void Acci::do_that() {
 		if (_vm->_gyro.flagset('P')) {
 			_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet);
-		} else _vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
+		} else
+			_vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
 		break;
-	case vb_cheat: {
+	case vb_cheat:
 		_vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled.");
 		_vm->_gyro.cheat = true;
-	}
-	break;
+		break;
 	case vb_magic:
 		if (_vm->_gyro.dna.avaricius_talk > 0)
 			_vm->_visa.dixi('q', 19);
@@ -1264,14 +1276,15 @@ void Acci::do_that() {
 					_vm->_gyro.dna.avaricius_talk = 14;
 					_vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks);
 				}
-			} else _vm->_scrolls.display("Nothing appears to happen...");
+			} else
+				_vm->_scrolls.display("Nothing appears to happen...");
 		}
 		break;
 	case vb_smartalec:
 		_vm->_scrolls.display("Listen, smart alec, that was just rhetoric.");
 		break;
-	case vb_expletive: {
-		switch ( _vm->_gyro.dna.swore) {
+	case vb_expletive:
+		switch (_vm->_gyro.dna.swore) {
 		case 0:
 			_vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
 					"(I shouldn't say it again, if I were you!)");
@@ -1280,25 +1293,24 @@ void Acci::do_that() {
 			_vm->_scrolls.display(Common::String("You hear a distant rumble of thunder. Must you always ") +
 					"do things I tell you not to?\r\rDon't do it again!");
 			break;
-		default: {
+		default:
 			_vm->_pingo.zonk();
 			_vm->_scrolls.display(Common::String("A crack of lightning shoots from the sky, ") +
 					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna.gameover();
 		}
-		}
-		_vm->_gyro.dna.swore ++;
-	}
-	break;
+		_vm->_gyro.dna.swore++;
+		break;
 	case vb_listen:
 		if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
 			_vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") +
 					"the bells.");
 		else if (_vm->_gyro.listen == "")
 			_vm->_scrolls.display("You can't hear anything much at the moment, Avvy.");
-		else _vm->_scrolls.display(_vm->_gyro.listen);
+		else
+			_vm->_scrolls.display(_vm->_gyro.listen);
 		break;
-	case vb_buy: {
+	case vb_buy:
 		/* What are they trying to buy? */
 		switch (_vm->_gyro.dna.room) {
 		case r__argentpub:
@@ -1308,16 +1320,19 @@ void Acci::do_that() {
 				case '\63':
 				case '\65':
 				case '\66':
-				case '\72': { /* Beer, whisky, cider or mead */
+				case '\72': /* Beer, whisky, cider or mead */
 					if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
 						_vm->_visa.dixi('D', 15);
 						return;
 					}
+
 					if (_vm->_gyro.dna.teetotal)  {
 						_vm->_visa.dixi('D', 6);
 						return;
 					}
-					if (_vm->_gyro.dna.alcohol == 0)  _vm->_lucerna.points(3);
+
+					if (_vm->_gyro.dna.alcohol == 0)
+						_vm->_lucerna.points(3);
 					_vm->_celer.show_one(12);
 					_vm->_scrolls.display(booze[thing] + ", please.\231\2");
 					_vm->_gyro.dna.drinking = thing;
@@ -1325,8 +1340,7 @@ void Acci::do_that() {
 					_vm->_celer.show_one(10);
 					_vm->_gyro.dna.malagauche = 177;
 					_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks);
-				}
-				break;
+					break;
 				case '\64':
 					examine();
 					break; /* We have a right one here- buy Pepsi??! */
@@ -1338,13 +1352,16 @@ void Acci::do_that() {
 							_vm->_visa.dixi('D', 15);
 							return;
 						}
+
 						if (_vm->_gyro.dna.carrying >= maxobjs) {
 							_vm->_scrolls.display("Your hands are full.");
 							return;
 						}
+
 						_vm->_celer.show_one(12);
 						_vm->_scrolls.display("Wine, please.\231\2");
-						if (_vm->_gyro.dna.alcohol == 0)  _vm->_lucerna.points(3);
+						if (_vm->_gyro.dna.alcohol == 0)
+							_vm->_lucerna.points(3);
 						_vm->_celer.show_one(10);
 						_vm->_gyro.dna.malagauche = 177;
 
@@ -1352,7 +1369,8 @@ void Acci::do_that() {
 					}
 					break;
 				}
-			} else _vm->_visa.dixi('D', 5);
+			} else
+				_vm->_visa.dixi('D', 5);
 			break;                /* Go to the bar! */
 
 		case r__outsideducks:
@@ -1376,8 +1394,10 @@ void Acci::do_that() {
 						_vm->_gyro.dna.rotten_onion = false; /* It's OK when it leaves the stall! */
 						_vm->_gyro.dna.onion_in_vinegar = false;
 					}
-				} else _vm->_visa.dixi('D', 0);
-			} else _vm->_visa.dixi('D', 0);
+				} else
+					_vm->_visa.dixi('D', 0);
+			} else
+				_vm->_visa.dixi('D', 0);
 			break;
 
 		case r__nottspub:
@@ -1386,20 +1406,18 @@ void Acci::do_that() {
 		default:
 			_vm->_visa.dixi('D', 0); /* Can't buy that. */
 		}
-	}
-	break;
-	case vb_attack: {
+		break;
+	case vb_attack:
 		if ((_vm->_gyro.dna.room == r__brummieroad) &&
 				((person == '\235') || (thing == _vm->_gyro.crossbow) || (thing == _vm->_gyro.bolt))
 				&& (_vm->_gyro.whereis['\235'] == _vm->_gyro.dna.room)) {
 			switch (_vm->_gyro.dna.obj[_vm->_gyro.bolt] + _vm->_gyro.dna.obj[_vm->_gyro.crossbow] * 2) {
 				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
 					3 = both. */
-			case 0: {
+			case 0:
 				_vm->_visa.dixi('Q', 10);
 				_vm->_scrolls.display("(At the very least, don't use your bare hands!)");
-			}
-			break;
+				break;
 			case 1:
 				_vm->_scrolls.display(Common::String("Attack _vm->_gyro.him with only a crossbow bolt? Are you ") +
 						"planning on playing darts?!");
@@ -1408,7 +1426,7 @@ void Acci::do_that() {
 				_vm->_scrolls.display(Common::String("Come on, Avvy! You're not going to get very far ") +
 						"with only a crossbow!");
 				break;
-			case 3: {
+			case 3:
 				_vm->_visa.dixi('Q', 11);
 				_vm->_gyro.dna.cwytalot_gone = true;
 				_vm->_gyro.dna.obj[_vm->_gyro.bolt] = false;
@@ -1420,26 +1438,27 @@ void Acci::do_that() {
 				_vm->_trip.tr[2].vanishifstill = true;
 				_vm->_trip.tr[2].call_eachstep = false;
 				_vm->_gyro.whereis['\235'] = 177;
-			}
-			break;
+				break;
 			default:
 				_vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */
 			}
-		} else _vm->_visa.dixi('Q', 10);
-	}
-	break;
+		} else
+			_vm->_visa.dixi('Q', 10);
+		break;
 	case vb_password:
 		if (_vm->_gyro.dna.room != r__bridge)
 			_vm->_visa.dixi('Q', 12);
 		else {
 			ok = true;
-			for (ff = 1; ff <= thats.size(); ff ++)
-				for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv ++) {
+			for (ff = 1; ff <= thats.size(); ff++) {
+				for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv++) {
 					Common::String temp = realwords[ff];
 					temp.toUppercase();
 					if (words[_vm->_gyro.dna.pass_num + first_password].w[fv] != temp[fv])
 						ok = false;
 				}
+			}
+
 			if (ok) {
 				if (_vm->_gyro.dna.drawbridge_open != 0)
 					_vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again.");
@@ -1449,7 +1468,8 @@ void Acci::do_that() {
 					_vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls);
 					_vm->_gyro.dna.drawbridge_open = 1;
 				}
-			} else _vm->_visa.dixi('Q', 12);
+			} else
+				_vm->_visa.dixi('Q', 12);
 		}
 		break;
 	case vb_dir:
@@ -1473,7 +1493,7 @@ void Acci::do_that() {
 	case vb_kiss:
 		if (person == pardon)
 			_vm->_scrolls.display("Kiss whom?");
-		else if (personshere())
+		else if (personshere()) {
 			switch (person) {
 			case _vm->_gyro.parkata:
 				_vm->_visa.dixi('U', 12);
@@ -1487,22 +1507,22 @@ void Acci::do_that() {
 			default:
 				_vm->_visa.dixi('U', 5); /* You WHAT? */
 			}
-		else if ((150 <= person) && (person <= 174))
+		} else if ((150 <= person) && (person <= 174))
 			_vm->_scrolls.display("Hey, what kind of a weirdo are you??");
 
 		break;
 
 	case vb_climb:
-		if (_vm->_gyro.dna.room == r__insidecardiffcastle)  cardiff_climbing();
+		if (_vm->_gyro.dna.room == r__insidecardiffcastle)
+			cardiff_climbing();
 		else /* In the wrong room! */
 			_vm->_scrolls.display("Not with your head for heights, Avvy!");
 		break;
 
-	case vb_jump: {
+	case vb_jump:
 		_vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping);
 		_vm->_gyro.dna.user_moves_avvy = false;
-	}
-	break;
+		break;
 
 	case vb_highscores:
 		//	show_highs();
@@ -1515,16 +1535,19 @@ void Acci::do_that() {
 			case pardon:
 			case _vm->_gyro.pavalot:
 			case '\0':
-				if (! _vm->_gyro.dna.avvy_is_awake) {
+				if (!_vm->_gyro.dna.avvy_is_awake) {
 					_vm->_gyro.dna.avvy_is_awake = true;
 					_vm->_lucerna.points(1);
 					_vm->_gyro.dna.avvy_in_bed = true;
 					_vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */
-					if (_vm->_gyro.dna.teetotal)  _vm->_visa.dixi('d', 13);
-				} else _vm->_scrolls.display("You're already awake, Avvy!");
+					if (_vm->_gyro.dna.teetotal)
+						_vm->_visa.dixi('d', 13);
+				} else
+					_vm->_scrolls.display("You're already awake, Avvy!");
 				break;
 			case _vm->_gyro.payles:
-				if (! _vm->_gyro.dna.ayles_is_awake)  _vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
+				if (!_vm->_gyro.dna.ayles_is_awake)
+					_vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
 				break;
 			case _vm->_gyro.pjacques:
 				_vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
@@ -1564,59 +1587,49 @@ void Acci::do_that() {
 		_vm->_scrolls.display("Hey, a verb would be helpful!");
 		break;
 
-	case vb_hello: {
+	case vb_hello:
 		person_speaks();
 		_vm->_scrolls.display("Hello.\2");
-	}
-	break;
-	case vb_thanks: {
+		break;
+	case vb_thanks:
 		person_speaks();
 		_vm->_scrolls.display("That's OK.\2");
-	}
-	break;
+		break;
 	default:
 		_vm->_scrolls.display(Common::String('\7') + "Parser bug!");
 	}
-	}
 }
 
 void Acci::verbopt(char n, Common::String &answer, char &anskey) {
 	switch (n) {
-	case vb_exam: {
+	case vb_exam:
 		answer = "Examine";
 		anskey = 'x';
-				  }
-				  break; /* the ubiqutous one */
-				  /* vb_give isn't dealt with by this procedure, but by ddm__with */
-	case vb_drink: {
+		break; /* the ubiqutous one */
+	/* vb_give isn't dealt with by this procedure, but by ddm__with */
+	case vb_drink:
 		answer = "Drink";
 		anskey = 'D';
-				   }
-				   break;
-	case vb_wear:  {
+		break;
+	case vb_wear:
 		answer = "Wear";
 		anskey = 'W';
-				   }
-				   break;
-	case vb_ring:  {
+		break;
+	case vb_ring:
 		answer = "Ring";
 		anskey = 'R';
-				   }
-				   break; /* only the bell! */
-	case vb_play:  {
+		break; /* only the bell! */
+	case vb_play:
 		answer = "Play";
 		anskey = 'P';
-				   }
-				   break;
-	case vb_eat:   {
+		break;
+	case vb_eat:
 		answer = "Eat";
 		anskey = 'E';
-				   }
-				   break;
-	default:      {
+		break;
+	default:
 		answer = "? Unknown!";    /* Bug! */
 		anskey = '?';
-				  }
 	}
 }
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 240c7b6..62cb5fb 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -251,7 +251,7 @@ namespace Avalanche {
 		zoomy = false; 
 		// Call the menu by default. Might be modified later, if get_slope() gets implemented,
 		// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
-		if (! zoomy)
+		if (!zoomy)
 			call_menu();    /* Not run when zoomy. */
 
 		do {
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 4296f36..c02a82f 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -61,7 +61,7 @@ void Celer::pics_link() {
 	case r__outsideargentpub:
 		if ((_vm->_gyro.roomtime % int32(12)) == 0)
 			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
-				break;
+		break;
 
 	case r__brummieroad:
 		if ((_vm->_gyro.roomtime % int32(2)) == 0)
@@ -74,7 +74,7 @@ void Celer::pics_link() {
 		break;
 
 	case r__yours:
-		if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
+		if ((!_vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
 			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
 		break;
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c247012..c86660e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -493,7 +493,7 @@ void Gyro::background(byte x) {
 void Gyro::hang_around_for_a_while() {
 	byte fv;
 
-	for (fv = 1; fv <= 28; fv ++)
+	for (fv = 1; fv <= 28; fv++)
 		slowdown();
 }
 
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 08981f5..c709e68 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -82,13 +82,12 @@ void Logger::setParent(AvalancheEngine *vm) {
 void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
 	byte fv;
 	
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::centre()");
-	/*for (fv = 1; fv <= size - (x / 2);
-		fv ++)
-	output << logfile << ' ';*/
+	/*for (fv = 1; fv <= size - (x / 2); fv++)
+		output << logfile << ' ';*/
 }
 
 void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
@@ -101,43 +100,48 @@ void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
 	log_epson = printing;
 	logging = true;
 
-	if (! printing)  {
-	quote = '"';
-	unquote = '"';
-	copyright = "(c)";
+	if (!printing)  {
+		quote = '"';
+		unquote = '"';
+		copyright = "(c)";
 	}*/
 }
 
 void Logger::log_divider() {   /* Prints the divider sign. */
 	byte fv;
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_divider()");
 
-	/*if (_vm->_gyro.log_epson) {
-	output << logfile << Common::String(' ') + double_width;
-	for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
-	output << logfile << Common::String(' ') + double_off;
-	} else
-	for (fv = 1; fv <= 36; fv ++) output << logfile << ' ';
-	output << logfile << divide << NL;*/
+	/*
+	if (_vm->_gyro.log_epson) {
+		output << logfile << Common::String(' ') + double_width;
+		for (fv = 1; fv <= divide_indent; fv++)
+			output << logfile << ' ';
+		output << logfile << Common::String(' ') + double_off;
+	} else {
+		for (fv = 1; fv <= 36; fv++)
+			output << logfile << ' ';
+	}
+	output << logfile << divide << NL;
+	*/
 }
 
 void Logger::log_command(Common::String x) {     /* Prints a command */
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_command()");
 
 	/*if (_vm->_gyro.log_epson)
-	output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
+		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
 	else
-	output << logfile << Common::String("> ") + x << NL;*/
+		output << logfile << Common::String("> ") + x << NL;*/
 }
 
 void Logger::log_addstuff(Common::String x) {
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	scroll_line += x;
@@ -145,7 +149,7 @@ void Logger::log_addstuff(Common::String x) {
 
 void Logger::log_scrollchar(Common::String x) {     /* print one character */
 	Common::String z;
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	switch (x[1]) {
@@ -166,7 +170,7 @@ void Logger::log_scrollchar(Common::String x) {     /* print one character */
 }
 
 void Logger::log_italic() {
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_italic()");
@@ -178,7 +182,7 @@ void Logger::log_italic() {
 }
 
 void Logger::log_roman() {
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_roman()");
@@ -190,7 +194,7 @@ void Logger::log_roman() {
 }
 
 void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_epsonroman()");
@@ -206,29 +210,32 @@ void Logger::log_scrollline() {   /* Set up a line for the scroll driver */
 
 void Logger::log_scrollendline(bool centred) {
 	byte x, fv;
-	if (! _vm->_gyro.logging)  return;
+	if (!_vm->_gyro.logging)
+		return;
 	x = 17;
-	if (centred)  x += (50 - scroll_line_length) / 2;
+	if (centred)
+		x += (50 - scroll_line_length) / 2;
 
 	warning("STUB: Logger::log_scrollendline()");
 
-	/*for (fv = 1; fv <= x; fv ++)
+	/*for (fv = 1; fv <= x; fv++)
 		output << logfile << ' ';
 	output << logfile << scroll_line << NL;*/
 }
 
 void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
 	byte fv;
-	if (! _vm->_gyro.logging)  return;
+	if (!_vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_bubbleline()");
 
 	/*if (linenum == 1) {
-		for (fv = 1; fv <= 15; fv ++)
+		for (fv = 1; fv <= 15; fv++)
 			output << logfile << ' ';
 		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
 	} else {
-		for (fv = 1; fv <= 17; fv ++)
+		for (fv = 1; fv <= 17; fv++)
 			output << logfile << ' ';
 		output << logfile << x << NL;
 	}*/
@@ -243,11 +250,12 @@ void Logger::log_newline() {
 
 void Logger::log_newroom(Common::String where) {
 	byte fv;
-	if (! _vm->_gyro.logging)  return;
+	if (!_vm->_gyro.logging)
+		return;
 
 	warning("STUB: Logger::log_newroom()");
 
-	/*for (fv = 1; fv <= 20; fv ++)
+	/*for (fv = 1; fv <= 20; fv++)
 		output << logfile << ' ';
 	if (_vm->_gyro.log_epson)
 		output << logfile << emph_on;
@@ -259,7 +267,7 @@ void Logger::log_newroom(Common::String where) {
 
 void Logger::log_aside(Common::String what) {
 /* This writes "asides" to the printer. For example, moves in Nim. */
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_aside()");
@@ -270,12 +278,12 @@ void Logger::log_aside(Common::String what) {
 
 void Logger::log_score(uint16 credit, uint16 now) {
 	byte fv;
-	if (! _vm->_gyro.logging)
+	if (!_vm->_gyro.logging)
 		return;
 
 	warning("STUB: Logger::log_score()");
 
-	/*for (fv = 1; fv <= 50; fv ++)
+	/*for (fv = 1; fv <= 50; fv++)
 		output << logfile << ' ';
 	output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
 }
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index aeb952c..74b7158 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -83,7 +83,7 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 
 	_vm->_gyro.super_off();
 
-	/*	for (page_ = 0; page_ <= 1; page_ ++) {
+	/*	for (page_ = 0; page_ <= 1; page_++) {
 		setactivepage(page_);
 		bar(419, 195, 438, 197);
 	}*/
@@ -98,8 +98,8 @@ void Scrolls::easteregg() {
 	warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
 
 	/*	background(15);
-	for (fv = 4; fv <= 100; fv ++) {
-		for (ff = 0; ff <= 70; ff ++) {
+	for (fv = 4; fv <= 100; fv++) {
+		for (ff = 0; ff <= 70; ff++) {
 			sound(fv * 100 + ff * 10);
 			delay(1);
 		}
@@ -128,23 +128,22 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	ox = 0;
 	_vm->_logger.log_scrollline();
 
-	for (xx = 1; xx <= lz; xx ++) {
+	for (xx = 1; xx <= lz; xx++) {
 		switch (z[xx]) {
-		case '\22': {
+		case '\22':
 			cfont = roman;
 			_vm->_logger.log_roman();
-					}
-					break;
-		case '\6': {
+			break;
+		case '\6':
 			cfont = italic;
 			_vm->_logger.log_italic();
-					}
-					break;
-		default: {
+			break;
+		default:
 			ox += 1;
-			for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
+			for (yy = 1; yy <= 12; yy++)
+				itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
 			_vm->_logger.log_scrollchar(Common::String(z[xx]));
-					}
+			break;
 		}
 	}
 
@@ -152,10 +151,10 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	if (offset) {
 		/* offsetting routine */
 		lz += 1;
-		for (yy = 1; yy <= 12; yy ++) {
+		for (yy = 1; yy <= 12; yy++) {
 			bit = 240;
 			itw[yy][lz] = 255;
-			for (xx = 1; xx <= lz; xx ++) {
+			for (xx = 1; xx <= lz; xx++) {
 				t = itw[yy][xx];
 				itw[yy][xx] = bit + t / 16;
 				bit = t << 4;
@@ -163,9 +162,9 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 		}
 	}
 	yp = x + y * 80 + (1 - _vm->_gyro.cp) * _vm->_gyro.pagetop;
-	for (yy = 1; yy <= 12; yy ++) {
+	for (yy = 1; yy <= 12; yy++) {
 		yp += 80;
-		for (bit = 0; bit <= locol; bit ++) {
+		for (bit = 0; bit <= locol; bit++) {
 			/*port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -190,23 +189,18 @@ void Scrolls::dialogue() {
 	warning("STUB: Scrolls::dialogue()");
 }
 
-
-
-
 void Scrolls::store_(byte what, tunetype &played) {
 	memcpy(played, played+1, sizeof(played) - 1);
 	played[30] = what;
 }
 
-
-
 bool Scrolls::they_match(tunetype &played) {
 	byte fv, mistakes;
 
 	bool they_match_result;
 	mistakes = 0;
 
-	for (fv = 1; fv <= sizeof(played); fv ++)
+	for (fv = 1; fv <= sizeof(played); fv++)
 		if (played[fv] != Gyro::tune[fv])
 			mistakes++;
 
@@ -243,13 +237,4 @@ void Scrolls::music_scroll() {
 }
 
 
-
-
-
-
-
-
-
-
-
 } // End of namespace Avalanche
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 38d46d8..f3ba72a 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -55,11 +55,12 @@ void Sequence::first_show(byte what) {
 
 void Sequence::then_show(byte what) {
 	byte fv;
-	for (fv = 1; fv <= seq_length; fv ++)
+	for (fv = 1; fv <= seq_length; fv++) {
 		if (seq[fv] == 0) {
 			seq[fv] = what;
 			return;
 		}
+	}
 }
 
 void Sequence::then_flip(byte where, byte ped) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 6bdfcde..623bb75 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -76,7 +76,7 @@ void Timeout::one_tick() {
 	if (_vm->_gyro.ddmnow)
 		return;
 
-	for (fv = 1; fv <= 7; fv ++) {
+	for (fv = 1; fv <= 7; fv++) {
 		timetype &with = times[fv];
 		if (with.time_left > 0) {
 			with.time_left -= 1;
@@ -217,7 +217,7 @@ void Timeout::one_tick() {
 void Timeout::lose_timer(byte which) {
 	byte fv;
 
-	for (fv = 1; fv <= 7; fv ++) {
+	for (fv = 1; fv <= 7; fv++) {
 		timetype &with = times[fv];
 		if (with.what_for == which)
 			with.time_left = 0;
@@ -240,7 +240,7 @@ end;*/
 /* Timeout procedures: */
 
 void Timeout::open_drawbridge() {
-	_vm->_gyro.dna.drawbridge_open ++;
+	_vm->_gyro.dna.drawbridge_open++;
 	_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
 
 	if (_vm->_gyro.dna.drawbridge_open == 4)
@@ -253,7 +253,7 @@ void Timeout::open_drawbridge() {
 
 void Timeout::avaricius_talks() {
 	_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
-	_vm->_gyro.dna.avaricius_talk ++;
+	_vm->_gyro.dna.avaricius_talk++;
 
 	if (_vm->_gyro.dna.avaricius_talk < 17)
 		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7591c5c..151e93f 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -85,7 +85,7 @@ bool triptype::collision_check() {
 	byte fv;
 
 	bool collision_check_result = false;
-	for (fv = 1; fv <= _tr->numtr; fv ++) {
+	for (fv = 1; fv <= _tr->numtr; fv++) {
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + a.xl) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
@@ -93,7 +93,8 @@ bool triptype::collision_check() {
 			collision_check_result = true;
 			break;
 		}
-		// CHECKME: Only checks the first element of the for() statement
+		// CHECKME: Only checks the first element of the for() statement.
+		// Both lines should certainly be removed
 		collision_check_result = false;
 		return collision_check_result;
 	}
@@ -276,8 +277,8 @@ triptype *triptype::done() {
 	xw = with.xl / 8;
 	if ((with.xl % 8) > 0)
 		xw += 1;
-	for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
-		totalnum --;
+	for (aa = 1; aa <= /*nds*seq*/ with.num; aa++) {
+		totalnum--;
 		free(mani[totalnum]);
 		free(sil[totalnum]); /* <<- Width of a siltype. */
 	}
@@ -293,14 +294,14 @@ getsettype *getsettype::init() {
 }
 
 void getsettype::remember(bytefield r) {
-	numleft ++;
+	numleft++;
 	warning("STUB: _vm->_timeout.getsettype::remember()");
 	gs[numleft] = r;
 }
 
 void getsettype::recall(bytefield &r) {
 	r = gs[numleft];
-	numleft --;
+	numleft--;
 }
 
 Trip::Trip() {
@@ -396,7 +397,7 @@ void Trip::catamove(byte ped) {
 		return;
 	}
 
-	if (! _vm->_gyro.dna.enter_catacombs_from_lusties_room)
+	if (!_vm->_gyro.dna.enter_catacombs_from_lusties_room)
 		_vm->_lucerna.load(29);
 	here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x];
 
@@ -531,7 +532,8 @@ void Trip::catamove(byte ped) {
 			
 		if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows))
 			_vm->_gyro.magics[13].op = _vm->_gyro.exclaim;
-		else _vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
+		else
+			_vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
 
 		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
 		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
@@ -637,13 +639,13 @@ void Trip::catamove(byte ped) {
 		_vm->_celer.show_one(2);
 		break;      /* [5,7] : "Ite Mingite" sign. */
 	case 258:
-		for (fv = 0; fv <= 2; fv ++) { /* [2,1] : Art gallery - pictures */
+		for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
 			_vm->_celer.show_one_at(15, 130 + fv * 120, 70);
 			_vm->_celer.show_one_at(16, 184 + fv * 120, 78);
 		}
 		break;
 	case 1287:
-		for (fv = 10; fv <= 13; fv ++)
+		for (fv = 10; fv <= 13; fv++)
 			_vm->_celer.show_one(fv);
 		break; /* [7,5] : 4 candles. */
 	case 776:
@@ -661,7 +663,7 @@ void Trip::catamove(byte ped) {
 	if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) {
 		triptype &with = tr[2];
 
-		if (! with.quick)  /* If we don't already have her... */
+		if (!with.quick)  /* If we don't already have her... */
 			tr[2].init(5, true, this); /* ...Load Geida. */
 		apped(2, geida_ped(ped));
 		tr[2].call_eachstep = true;
@@ -699,7 +701,7 @@ void Trip::call_special(uint16 which) {
 	case 3: /* _vm->_gyro.special 3: Room 71: triggers dart. */
 		tr[1].bounce(); /* Must include that. */
 
-		if (! _vm->_gyro.dna.arrow_triggered) {
+		if (!_vm->_gyro.dna.arrow_triggered) {
 			_vm->_gyro.dna.arrow_triggered = true;
 			apped(2, 4); /* The dart starts at ped 4, and... */
 			tr[2].walkto(5); /* flies to ped 5. */
@@ -754,7 +756,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
 		break;
 	case 8:        /* _vm->_gyro.special 8: leave du Lustie's room. */
-		if ((_vm->_gyro.dna.geida_follows) && (! _vm->_gyro.dna.lustie_is_asleep)) {
+		if ((_vm->_gyro.dna.geida_follows) && (!_vm->_gyro.dna.lustie_is_asleep)) {
 			_vm->_visa.dixi('q', 63);
 			tr[2].turn(down);
 			tr[2].stopwalk();
@@ -763,7 +765,7 @@ void Trip::call_special(uint16 which) {
 		}
 		break;
 	case 9: /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
-		if (! _vm->_gyro.dna.geida_follows)
+		if (!_vm->_gyro.dna.geida_follows)
 			return;   /* DOESN'T COUNT: no Geida. */
 		tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
 		tr[2].walkto(4); /* She walks to somewhere... */
@@ -960,18 +962,24 @@ void Trip::getback() {
 	while (getset[1 - _vm->_gyro.cp].numleft > 0) {
 		getset[1 - _vm->_gyro.cp].recall(r);
 
-		/*    if overlaps_with_mouse and not endangered then
+		/*
+		if overlaps_with_mouse and not endangered then
 			begin
 				endangered:=true;
 				blitfix;
 				Super_Off;
-			end;*/
+			end;
+		*/
 
 		_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
 	}
 
 	_vm->_lucerna.blitfix();
-	/*if endangered then*/ /*Super_On;*/
+
+	/*
+	if endangered then
+		Super_On;
+	*/
 }
 
 /* Eachstep procedures: */
@@ -997,7 +1005,7 @@ void Trip::follow_avvy_y(byte tripnum) {
 }
 
 void Trip::back_and_forth(byte tripnum) {
-	if (! tr[tripnum].homing) {
+	if (!tr[tripnum].homing) {
 		if (tr[tripnum].face == right)
 			tr[tripnum].walkto(4);
 		else
@@ -1006,7 +1014,7 @@ void Trip::back_and_forth(byte tripnum) {
 }
 
 void Trip::face_avvy(byte tripnum) {
-	if (! tr[tripnum].homing) {
+	if (!tr[tripnum].homing) {
 		if (tr[1].x >= tr[tripnum].x)
 			tr[tripnum].face = right;
 		else
@@ -1165,14 +1173,14 @@ void Trip::call_andexors() {
 	for (int i = 0; i < 5; i++)
 		order[i] = 0;
 
-	for (fv = 1; fv <= numtr; fv ++) {
+	for (fv = 1; fv <= numtr; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
 			order[fv] = fv;
 	}
 
 	do {
 		ok = true;
-		for (fv = 1; fv <= 4; fv ++) {
+		for (fv = 1; fv <= 4; fv++) {
 			if (((order[fv] != 0) && (order[fv + 1] != 0))
 					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
 				/* Swap them! */
@@ -1184,7 +1192,7 @@ void Trip::call_andexors() {
 		}
 	} while (!ok);
 
-	for (fv = 1; fv <= 5; fv ++) {
+	for (fv = 1; fv <= 5; fv++) {
 		if (order[fv] > 0)
 			tr[order[fv]].andexor();
 	}
@@ -1195,13 +1203,13 @@ void Trip::trippancy_link() {
 
 	if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)
 		return;
-	for (fv = 1; fv <= numtr; fv ++) {
+	for (fv = 1; fv <= numtr; fv++) {
 		if (tr[fv].quick)
 			tr[fv].walk();
 	}
 
 	call_andexors();
-	for (fv = 1; fv <= numtr; fv ++) {
+	for (fv = 1; fv <= numtr; fv++) {
 		triptype &with = tr[fv];
 		if (with.quick && with.call_eachstep) {
 			switch (tr[fv].eachstep) {
@@ -1237,9 +1245,11 @@ void Trip::get_back_loretta() {
 	byte fv;
 
 	/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
-	for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
-		getback();
-		return;
+	for (fv = 1; fv <= numtr; fv++) {
+		if (tr[fv].quick) {
+			getback();
+			return;
+		}
 	}
 	/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
 }
@@ -1252,7 +1262,7 @@ void Trip::stopwalking() {
 }
 
 void Trip::tripkey(char dir) {
-	if ((_vm->_gyro.ctrl == cjoy) | (! _vm->_gyro.dna.user_moves_avvy))
+	if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
 		return;
 
 	triptype &with = tr[1];
@@ -1325,7 +1335,7 @@ void Trip::readstick() {
 }
 
 void Trip::getsetclear() {
-	for (byte fv = 0; fv <= 1; fv ++)
+	for (byte fv = 0; fv <= 1; fv++)
 		getset[fv].init();
 }
 
@@ -1370,7 +1380,7 @@ void Trip::tidy_after_mouse() {
 void Trip::fliproom(byte room, byte ped) {
 	byte fv;
 
-	if (! _vm->_gyro.alive) {
+	if (!_vm->_gyro.alive) {
 		/* You can't leave the room if you're dead. */
 		tr[1].ix = 0;
 		tr[1].iy = 0; /* Stop him from moving. */
@@ -1397,7 +1407,7 @@ void Trip::fliproom(byte room, byte ped) {
 	getsetclear();
 
 
-	for (fv = 2; fv <= numtr; fv ++) {
+	for (fv = 2; fv <= numtr; fv++) {
 		if (tr[fv].quick)
 			tr[fv].done();
 	} /* Deallocate sprite */
@@ -1412,7 +1422,7 @@ void Trip::fliproom(byte room, byte ped) {
 	_vm->_gyro.dna.rw = tr[1].face;
 	_vm->_lucerna.showrw();
 
-	for (fv = 0; fv <= 1; fv ++) {
+	for (fv = 0; fv <= 1; fv++) {
 		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
 		getback();
 	}
@@ -1447,7 +1457,7 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 	uy = tr[1].y + tr[1].a.yl;
 		
 	nd = false;
-	for (fv = 9; fv <= _vm->_gyro.numfields; fv ++) {
+	for (fv = 9; fv <= _vm->_gyro.numfields; fv++) {
 		_vm->_gyro.fields[fv];
 
 		if ((ux >= _vm->_gyro.fields[fv].x1) && (ux <= _vm->_gyro.fields[fv].x2)


Commit: 5e2ec5102524c87afdd7030e02db31b13be08acf
    https://github.com/scummvm/scummvm/commit/5e2ec5102524c87afdd7030e02db31b13be08acf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-01T06:21:51-07:00

Commit Message:
AVALANCHE: Add Basher.

Changed paths:
  A engines/avalanche/basher2.cpp
  A engines/avalanche/basher2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 62cb5fb..fcf2f54 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -54,13 +54,14 @@ namespace Avalanche {
 		_pingo.setParent(this);
 		_scrolls.setParent(this);
 		_visa.setParent(this);
-		_lucerna.setParent(this);
+		_lucerna.setParent(this); _lucerna.init();
 		_enid.setParent(this);
 		_celer.setParent(this);
 		_sequence.setParent(this);
 		_timeout.setParent(this);
 		_trip.setParent(this);
-		_acci.setParent(this);
+		_acci.setParent(this); _acci.init();
+		_basher.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 5fa0fa9..2364832 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -44,6 +44,7 @@
 #include "avalanche/timeout2.h"
 #include "avalanche/trip6.h"
 #include "avalanche/acci2.h"
+#include "avalanche/basher2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -74,6 +75,7 @@ public:
 	Timeout _timeout;
 	Trip _trip;
 	Acci _acci;
+	Basher _basher;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
new file mode 100644
index 0000000..61ad226
--- /dev/null
+++ b/engines/avalanche/basher2.cpp
@@ -0,0 +1,167 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* BASHER		Handles the keyboard. */
+
+// Note: this unit can record keystrokes, for the demo. If you want it
+// to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
+// cause them to be played back. 
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/basher2.h"
+#include "avalanche/enhanced2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/acci2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/dropdown2.h"
+#include "avalanche/logger2.h"
+#include "avalanche/enid2.h"
+//#include "Sticks.h" - Responsible for the joystick
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+	
+Basher::Basher() {
+	warning("STUB: Basher::Basher()");
+}
+
+void Basher::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Basher::plottext() {
+	warning("STUB: Basher::plottext()");
+}
+
+void Basher::wipetext() {
+	warning("STUB: Basher::wipetext()");
+}
+
+/*procedure cursor;
+begin
+ if curflash=0 then
+ begin
+  if mouse_near_text then Super_Off;
+  cursoron:=not cursoron;
+  mem[$A000*13442+curpos]:=not mem[$A000*13442+curpos];
+  mem[$A000*pagetop+13442+curpos]:=not mem[$A000*pagetop+13442+curpos];
+  curflash:=17;
+  Super_On;
+ end else dec(curflash);
+end;*/
+
+void Basher::do_cursor() {
+	warning("STUB: Basher::do_cursor()");
+}
+
+void Basher::cursor_on() {
+	warning("STUB: Basher::cursor_on()");
+}
+
+void Basher::cursor_off() {
+	warning("STUB: Basher::cursor_off()");
+}
+
+
+void Basher::get_demorec() {
+	warning("STUB: Basher::get_demorec()");
+}
+
+#ifdef RECORD
+void Basher::record_one() {
+	warning("STUB: Basher::record_one()");
+}
+#endif
+/*
+procedure storeline(whatwhat:string);
+var
+ fv:byte;
+ what:string[77];
+ ok:boolean;
+
+  function upline(x:string):string;
+  var fv:byte; n:string[77];
+  begin
+   for fv:=1 to length(x) do n[fv]:=upcase(x[fv]);
+   n[0]:=x[0]; upline:=n;
+  end;
+begin
+
+ what:=upline(whatwhat); ok:=false;
+ for fv:=1 to 20 do
+  if what=upline(previous^[fv]) then
+  begin { it already exists, in string "fv" }
+   move(previous^[fv+1],previous^[fv],(20-fv)*78);
+   previous^[20]:=whatwhat; ok:=true;
+  end;
+ if ok then exit;
+ { it's not on the list, so add it }
+ move(previous^[2],previous^[1],1482); { shove up }
+ previous^[20]:=whatwhat;
+end;
+*/
+
+
+char Basher::firstchar(Common::String x) {
+	warning("STUB: Basher::firstchar()");
+	return 'S';
+}
+
+
+void Basher::try_dd() { /* This asks the Parsekey proc in Dropdown if it knows it. */
+	warning("STUB: Basher::try_dd()");
+}
+
+void Basher::typein() {
+	warning("STUB: Basher::typein()");
+}
+
+/*        'x'..'z': begin setvisualpage(ord(extd)-63); write(#7); inkey; end;
+        '': begin setvisualpage(0); write(#7); inkey; end;*/
+
+void Basher::keyboard_link() {
+	warning("STUB: Basher::keyboard_link()");
+}
+
+bool Basher::demo_ready() {
+	warning("STUB: Basher::demo_ready()");
+	return true;
+}
+
+void Basher::filename_edit() {
+	warning("STUB: Basher::filename_edit()");
+}
+
+void Basher::normal_edit() {
+	warning("STUB: Basher::normal_edit()");
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
new file mode 100644
index 0000000..326ea93
--- /dev/null
+++ b/engines/avalanche/basher2.h
@@ -0,0 +1,91 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* BASHER		Handles the keyboard. */
+
+// Note: this unit can record keystrokes, for the demo. If you want it
+// to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
+// cause them to be played back. 
+
+#ifndef BASHER2_H
+#define BASHER2_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Basher {
+public:
+	uint16 count;
+
+
+
+	Basher();
+
+	void setParent(AvalancheEngine *vm);
+
+	void plottext();
+
+	void keyboard_link();
+
+	void cursor_on();
+
+	void get_demorec();
+
+	bool demo_ready();
+
+	void cursor_off();
+
+	void filename_edit();
+
+	void normal_edit();
+
+#ifdef RECORD
+	void record_one();
+#endif
+
+private:
+	AvalancheEngine *_vm;
+
+	bool entering_filename;
+	byte left_margin;
+
+	void wipetext();
+
+	void do_cursor();
+
+	char firstchar(Common::String x);
+
+	void try_dd();
+
+	void typein();
+};
+
+} // End of namespace Avalanche.
+
+#endif // BASHER2_H


Commit: 8aa251722f97dab34b3d5fd0133f63403d6baa1a
    https://github.com/scummvm/scummvm/commit/8aa251722f97dab34b3d5fd0133f63403d6baa1a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-01T09:14:48-07:00

Commit Message:
AVALANCHE: Add Dropdown.

Changed paths:
  A engines/avalanche/dropdown2.cpp
  A engines/avalanche/dropdown2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index fcf2f54..eade42b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -62,6 +62,7 @@ namespace Avalanche {
 		_trip.setParent(this);
 		_acci.setParent(this); _acci.init();
 		_basher.setParent(this);
+		_dropdown.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 2364832..46ceeba 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -45,6 +45,7 @@
 #include "avalanche/trip6.h"
 #include "avalanche/acci2.h"
 #include "avalanche/basher2.h"
+#include "avalanche/dropdown2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -76,6 +77,7 @@ public:
 	Trip _trip;
 	Acci _acci;
 	Basher _basher;
+	Dropdown _dropdown;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
new file mode 100644
index 0000000..d0d9005
--- /dev/null
+++ b/engines/avalanche/dropdown2.cpp
@@ -0,0 +1,689 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+ /* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/dropdown2.h"
+
+#include "avalanche/lucerna2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/acci2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/enid2.h"
+#include "avalanche/basher2.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, func dw, func dc, Dropdown *dr) {
+	_dr = dr;
+
+	trigger = trig;
+	alttrigger = alttrig;
+	title = name;
+	position = p;
+	xpos = (position - 1) * _dr->spacing + _dr->indent;
+	xright = position * _dr->spacing + _dr->indent;
+	do_setup = dw;
+	do_choose = dc;
+
+	return this;
+}
+
+void headtype::display() {
+	_dr->_vm->_gyro.off(); /*MT*/
+	_dr->chalk(xpos, 1, trigger, title, true);
+	_dr->_vm->_gyro.on(); /*MT*/
+}
+
+void headtype::highlight() {
+	_dr->_vm->_gyro.off();
+	_dr->_vm->_gyro.off_virtual();
+
+	//nosound();
+	//setactivepage(cp);
+	warning("STUB: Dropdown::headytpe::highlight()");
+
+	_dr->hlchalk(xpos, 1, trigger, title, true);
+	{
+		_dr->ddm_o.left = xpos;
+		_dr->ddm_o.menunow = true;
+		_dr->_vm->_gyro.ddmnow = true;
+		_dr->ddm_o.menunum = position;
+	}
+	_dr->_vm->_gyro.cmp = 177; /* Force redraw of cursor. */
+}
+
+bool headtype::extdparse(char c) {
+	if (c != alttrigger)  
+		return true;
+	return false;
+}
+
+
+
+
+
+
+onemenu *onemenu::init(Dropdown *dr) {
+	_dr = dr;
+	menunow = false;
+	_dr->_vm->_gyro.ddmnow = false;
+	menunum = 1;
+	return this;
+}
+
+void onemenu::start_afresh() {
+	number = 0;
+	width = 0;
+	firstlix = false;
+	oldy = 0;
+	highlightnum = 0;
+}
+
+void onemenu::opt(Common::String n, char tr, Common::String key, bool val) {
+	int16 l;
+	number += 1;
+	l = (n + key).size() + 3;
+	if (width < l)  width = l;
+	{
+		optiontype &with = oo[number];
+		with.title = n;
+		with.trigger = tr;
+		with.shortcut = key;
+		with.valid = val;
+	}
+}
+
+void onemenu::displayopt(byte y, bool highlit) {
+	warning("STUB: Dropdown::onemenu::displayopt()");
+}
+
+void onemenu::display() {
+	warning("STUB: Dropdown::onemenu::display()");
+}
+
+void onemenu::wipe() {
+	warning("STUB: Dropdown::onemenu::wipe()");
+}
+
+void onemenu::movehighlight(int8 add) {
+	warning("STUB: Dropdown::onemenu::movehighlight()");
+}
+
+void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
+	if ((_dr->_vm->_gyro.mx < flx1 * 8) || (_dr->_vm->_gyro.mx > flx2 * 8) ||
+		(_dr->_vm->_gyro.my <= 12) || (_dr->_vm->_gyro.my > fly - 3))
+			return;
+	highlightnum = (_dr->_vm->_gyro.my - 13) / 10;
+	if (highlightnum == oldy)  return;
+	movehighlight(0);
+	
+}
+
+void onemenu::select(byte n) {    /* Choose which one you want. */
+	if (! oo[n + 1].valid)  return;
+	choicenum = n;
+	wipe();
+
+	if (choicenum == number)  choicenum -= 1; /* Off the bottom. */
+	if (choicenum > number)  choicenum = 0; /* Off the top, I suppose. */
+
+	_dr->ddm_m.ddms[menunum].do_choose;
+}
+
+void onemenu::keystroke(char c) {
+	byte fv;
+	bool found;
+	c = toupper(c);
+	found = false;
+	for (fv = 1; fv <= number; fv ++) {
+		if ((toupper(oo[fv].trigger) == c) && oo[fv].valid) {
+			select(fv - 1);
+			found = true;
+		}
+	}
+	if (! found)
+		_dr->_vm->_gyro.blip();
+}
+
+
+
+
+
+menuset *menuset::init(Dropdown *dr) {
+	_dr = dr;
+	howmany = 0;
+	return this;
+}
+
+void menuset::create(char t, Common::String n, char alttrig, func dw, func dc) {
+	howmany ++;
+	ddms[howmany].init(t, alttrig, n, howmany, dw, dc, _dr);
+}
+
+void menuset::update() {
+	warning("STUB: Dropdown::menuset::update()");
+}
+
+void menuset::extd(char c) {
+	byte fv;
+	fv = 1;
+	while ((fv <= howmany) && (ddms[fv].extdparse(c)))  fv += 1;
+	if (fv > howmany)  return;
+	getcertain(fv);
+}
+
+void menuset::getcertain(byte fv) {
+	{
+		if (_dr->ddm_o.menunow) {
+			_dr->ddm_o.wipe(); /* get rid of menu */
+			if (_dr->ddm_o.menunum == ddms[fv].position)  return; /* clicked on own highlight */
+		}
+		ddms[fv].highlight();
+		ddms[fv].do_setup;
+	}
+}
+
+void menuset::getmenu(int16 x) {
+	byte fv;
+	fv = 0;
+	do {
+		fv += 1;
+		if ((x > ddms[fv].xpos * 8) && (x < ddms[fv].xright * 8)) {
+			getcertain(fv);
+			return;
+		}
+	} while (!(fv > howmany));
+}
+
+
+
+
+
+void Dropdown::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Dropdown::find_what_you_can_do_with_it() {
+	switch (_vm->_gyro.thinks) {
+	case _vm->_gyro.wine:
+	case _vm->_gyro.potion:
+	case _vm->_gyro.ink:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink;
+		break;
+	case _vm->_gyro.bell:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring;
+		break;
+	case _vm->_gyro.chastity:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+		break;
+	case _vm->_gyro.lute:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play;
+		break;
+	case _vm->_gyro.mushroom:
+	case _vm->_gyro.onion:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat;
+		break;
+	case _vm->_gyro.clothes:
+		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+		break;
+	default:
+		_vm->_gyro.verbstr = _vm->_acci.vb_exam; /* anything else */
+	}
+}
+
+void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
+	byte fv, ff, p, bit;
+	uint16 pageseg;
+	byte ander;
+
+	warning("STUB: Dropdown::chalk()");
+}
+
+void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
+/* Highlighted. */
+	byte fv, ff, p;
+	uint16 pageseg;
+	byte ander;
+
+	warning("STUB: Dropdown::hlchalk()");
+}
+
+/*funcedure say(x,y:int16; t:char; z:Common::String; f,b:byte);
+begin;
+ settextjustify(0,2); setfillstyle(1,b); setcolor(f);
+ bar(x-3,y-1,x+textwidth(z)+3,y+textheight(z));
+ chalk(x,y,t,z);
+end;*/
+
+void Dropdown::bleep() {
+	warning("STUB: Dropdown::bleep()");
+}
+
+void Dropdown::parsekey(char r, char re) {
+	switch (r) {
+	case 0:
+	case 224: {
+		switch (re) {
+		case 'K':
+			if (ddm_o.menunum > 1)  {
+				ddm_o.wipe();
+				ddm_m.getcertain(ddm_o.menunum - 1);
+			} else {
+				;     /* Get menu on the left-hand side */
+				ddm_o.wipe();
+				ddm_m.getmenu((ddm_m.howmany - 1)*spacing + indent);
+			}
+			break;
+		case 'M':
+			if (ddm_o.menunum < ddm_m.howmany)  {
+				ddm_o.wipe();
+				ddm_m.getcertain(ddm_o.menunum + 1);
+			} else {
+				;     /* Get menu on the far right-hand side */
+				ddm_o.wipe();
+				ddm_m.getmenu(indent);
+			}
+			break;
+		case 'H':
+			ddm_o.movehighlight(-1);
+			break;
+		case 'P':
+			ddm_o.movehighlight(1);
+			break;
+		default:
+			ddm_m.extd(re);
+		}
+	}
+	break;
+	case 13:
+		ddm_o.select(ddm_o.highlightnum);
+		break;
+	default: {
+		if (ddm_o.menunow)
+			ddm_o.keystroke(r);
+	}
+	}
+}
+
+/*$F+  *** Here follow all the ddm__ and do__ funcedures for the DDM system. */
+
+void Dropdown::ddm__game() {
+	{
+		ddm_o.start_afresh();
+		ddm_o.opt("Help...", 'H', "f1", true);
+		ddm_o.opt("Boss Key", 'B', "alt-B", true);
+		ddm_o.opt("Untrash screen", 'U', "ctrl-f7", true);
+		ddm_o.opt("Score and rank", 'S', "f9", true);
+		ddm_o.opt("About Avvy...", 'A', "shift-f10", true);
+		ddm_o.display();
+	}
+}
+
+void Dropdown::ddm__file() {
+	{
+		ddm_o.start_afresh();
+		ddm_o.opt("New game", 'N', "f4", true);
+		ddm_o.opt("Load...", 'L', "^f3", true);
+		ddm_o.opt("Save", 'S', "^f2", _vm->_gyro.alive);
+		ddm_o.opt("Save As...", 'v', "", _vm->_gyro.alive);
+		ddm_o.opt("DOS Shell", 'D', _vm->_gyro.atkey + '1', true);
+		ddm_o.opt("Quit", 'Q', "alt-X", true);
+		ddm_o.display();
+	}
+}
+
+void Dropdown::ddm__action() {
+	Common::String n;
+	n = Common::String(_vm->_gyro.f5_does().c_str() + 2, 253);
+
+	{
+		ddm_o.start_afresh();
+		if (n == "")
+			ddm_o.opt("Do something", 'D', "f5", false);
+		else
+			ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
+		ddm_o.opt("Pause game", 'P', "f6", true);
+		if (_vm->_gyro.dna.room == 99)
+			ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip.neardoor());
+		else
+			ddm_o.opt("Open the door", 'O', "f7", _vm->_trip.neardoor());
+		ddm_o.opt("Look around", 'L', "f8", true);
+		ddm_o.opt("Inventory", 'I', "Tab", true);
+		if (_vm->_trip.tr[1].xs == _vm->_gyro.walk)
+			ddm_o.opt("Run fast", 'R', "^R", true);
+		else
+			ddm_o.opt("Walk slowly", 'W', "^W", true);
+		ddm_o.display();
+	}
+}
+
+void Dropdown::ddm__people() {
+	byte here;
+	char fv;
+
+	people = "";
+	here = _vm->_gyro.dna.room;
+
+	{
+		ddm_o.start_afresh();
+		for (fv = '\226'; fv <= '\262'; fv ++)
+			if (_vm->_gyro.whereis[fv] == here) {
+				ddm_o.opt(_vm->_gyro.getname(fv), _vm->_gyro.getnamechar(fv), "", true);
+				people = people + fv;
+			}
+		ddm_o.display();
+	}
+}
+
+void Dropdown::ddm__objects() {
+	char fv;
+	{
+		ddm_o.start_afresh();
+		for (fv = '\1'; fv <= numobjs; fv ++)
+			if (_vm->_gyro.dna.obj[fv])
+				ddm_o.opt(_vm->_gyro.get_thing(fv), _vm->_gyro.get_thingchar(fv), "", true);
+		ddm_o.display();
+	}
+}
+
+Common::String Dropdown::himher(char x) {         /* Returns "im" for boys, and "er" for girls.*/
+	if (x < 175)
+		return "im";
+	else
+		return "er";
+}
+
+void Dropdown::ddm__with() {
+	warning("STUB: Dropdown::ddm__with()");
+}
+
+/*funcedure ddm__map;
+begin;
+ with ddm_o do
+ begin;
+  ddm_o.start_afresh;
+  opt('Cancel map','G','f5',true);
+  opt('Pause game','P','f6',true);
+  opt('Journey thither','J','f7',neardoor);
+  opt('Explanation','L','f8',true);
+  display;
+ end;
+end;
+
+funcedure ddm__town;
+begin;
+ with ddm_o do
+ begin;
+  ddm_o.start_afresh;
+  opt('Argent','A','',true);
+  opt('Birmingham','B','',true);
+  opt('Nottingham','N','',true);
+  opt('Cardiff','C','',true);
+  display;
+ end;
+end;*/
+
+void Dropdown::do__game() {
+	switch (ddm_o.choicenum) {
+		/* Help, boss, untrash screen. */
+	case 0:
+		_vm->_lucerna.callverb(_vm->_acci.vb_help);
+		break;
+	case 1:
+		_vm->_lucerna.callverb(_vm->_acci.vb_boss);
+		break;
+	case 2:
+		_vm->_lucerna.major_redraw();
+		break;
+	case 3:
+		_vm->_lucerna.callverb(_vm->_acci.vb_score);
+		break;
+	case 4:
+		_vm->_lucerna.callverb(_vm->_acci.vb_info);
+		break;
+	}
+}
+
+void Dropdown::do__file() {
+	switch (ddm_o.choicenum) {
+		/* New game, load, save, save as, DOS shell, about, quit. */
+	case 0:
+		_vm->_lucerna.callverb(_vm->_acci.vb_restart);
+		break;
+	case 1: {
+		_vm->_acci.realwords[2] = "";
+		_vm->_lucerna.callverb(_vm->_acci.vb_load);
+	}
+	break;
+	case 2: {
+		_vm->_acci.realwords[2] = "";
+		_vm->_lucerna.callverb(_vm->_acci.vb_save);
+	}
+	break;
+	case 3:
+		_vm->_basher.filename_edit();
+		break;
+	case 4:
+		_vm->_enid.back_to_bootstrap(2);
+		break;
+	case 5:
+		_vm->_lucerna.callverb(_vm->_acci.vb_quit);
+		break;
+	}
+}
+
+void Dropdown::do__action() {
+	Common::String n;
+	switch (ddm_o.choicenum) {
+		/* Get up/pause game/open door/look/inv/walk-run */
+	case 0: {
+		_vm->_acci.person = _vm->_acci.pardon;
+		_vm->_acci.thing = _vm->_acci.pardon;
+		n = _vm->_gyro.f5_does();
+		_vm->_lucerna.callverb(n[1]);
+	}
+	break;
+	case 1:
+		_vm->_lucerna.callverb(_vm->_acci.vb_pause);
+		break;
+	case 2:
+		_vm->_lucerna.callverb(_vm->_acci.vb_open);
+		break;
+	case 3:
+		_vm->_lucerna.callverb(_vm->_acci.vb_look);
+		break;
+	case 4:
+		_vm->_lucerna.callverb(_vm->_acci.vb_inv);
+		break;
+	case 5: {
+		if (_vm->_trip.tr[1].xs == _vm->_gyro.walk)  _vm->_trip.tr[1].xs = _vm->_gyro.run;
+		else _vm->_trip.tr[1].xs = _vm->_gyro.walk;
+		_vm->_trip.newspeed();
+	}
+	break;
+	}
+}
+
+void Dropdown::do__objects() {
+	_vm->_lucerna.thinkabout(_vm->_gyro.objlist[ddm_o.choicenum + 1], _vm->_gyro.a_thing);
+}
+
+void Dropdown::do__people() {
+	_vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro.a_person);
+	_vm->_gyro.last_person = people[ddm_o.choicenum + 1];
+}
+
+void Dropdown::do__with() {
+	_vm->_acci.thing = _vm->_gyro.thinks;
+
+	if (_vm->_gyro.thinkthing) {
+
+		_vm->_acci.thing += 49;
+
+		if (_vm->_gyro.verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give)
+			_vm->_acci.person = _vm->_gyro.last_person;
+		else
+			_vm->_acci.person = '\376';
+
+	} else {
+		switch (_vm->_gyro.verbstr[ddm_o.choicenum + 1]) {
+		case '\144': {
+			_vm->_acci.thing = '\144';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Beer */
+		case '\145': {
+			_vm->_acci.thing = '\62';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Wine */
+		case '\146': {
+			_vm->_acci.thing = '\146';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Whisky */
+		case '\147': {
+			_vm->_acci.thing = '\147';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Cider */
+		case '\150': {
+			_vm->_acci.thing = '\153';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Mead */
+		case '\151': {
+			_vm->_acci.thing = '\103';
+			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			return;
+		}
+		break; /* Onion (trader) */
+		default: {
+			_vm->_acci.person = _vm->_acci.thing;
+			_vm->_acci.thing = '\376';
+		}
+		}
+	}
+	_vm->_lucerna.callverb(_vm->_gyro.verbstr[ddm_o.choicenum + 1]);
+}
+
+/*$F- That's all. Now for the ...bar funcs. */
+
+
+void Dropdown::standard_bar() {   /* Standard menu bar */
+	ddm_m.init(this);
+	ddm_o.init(this);
+	/* Set up menus */
+
+	ddm_m.create('F', "File", '!', &Avalanche::Dropdown::ddm__file, &Avalanche::Dropdown::do__file); /* same ones in map_bar, below, */
+	ddm_m.create('G', "Game", '\42', &Avalanche::Dropdown::ddm__game, &Avalanche::Dropdown::do__game); /* Don't forget to change the */
+	ddm_m.create('A', "Action", '\36', &Avalanche::Dropdown::ddm__action, &Avalanche::Dropdown::do__action); /* if you change them */
+	ddm_m.create('O', "Objects", '\30', &Avalanche::Dropdown::ddm__objects, &Avalanche::Dropdown::do__objects); /* here... */
+	ddm_m.create('P', "People", '\31', &Avalanche::Dropdown::ddm__people, &Avalanche::Dropdown::do__people);
+	ddm_m.create('W', "With", '\21', &Avalanche::Dropdown::ddm__with, &Avalanche::Dropdown::do__with);
+	ddm_m.update();
+
+}
+
+
+
+/*funcedure map_bar; { Special menu bar for the map (screen 99) }
+begin;
+ ddm_m.init; ddm_o.init;
+ with ddm_m do
+ begin; { Set up menus }
+  create('G','Game','#',ddm__game,do__game);
+  create('F','File','!',ddm__file,do__test);
+  create('M','Map','2',ddm__map,do__test);
+  create('T','Town',#20,ddm__town,do__test);
+  update;
+ end;
+end;*/
+
+void Dropdown::checkclick() {   /* only for when the menu's displayed */
+	if (_vm->_gyro.mpress > 0) {
+		if (_vm->_gyro.mpy > 10) {
+			if (!((ddm_o.firstlix) &&
+			   ((_vm->_gyro.mpx >= ddm_o.flx1 * 8) && (_vm->_gyro.mpx <= ddm_o.flx2 * 8) &&
+			   (_vm->_gyro.mpy >= 12) && (_vm->_gyro.mpy <= ddm_o.fly)))) {
+			     /* Clicked OUTSIDE the menu. */
+				if (ddm_o.menunow)
+					ddm_o.wipe();
+			}    /* No "else"- clicking on menu has no effect (only releasing) */
+		} else {
+			 /* Clicked on menu bar */
+			ddm_m.getmenu(_vm->_gyro.mpx);
+		}
+	} else {
+		;     /* NOT clicked button... */
+		if (_vm->_gyro.mrelease > 0) {
+			if ((ddm_o.firstlix) &&
+			   ((_vm->_gyro.mrx >= ddm_o.flx1 * 8) && (_vm->_gyro.mrx <= ddm_o.flx2 * 8) &&
+			   (_vm->_gyro.mry >= 12) && (_vm->_gyro.mry <= ddm_o.fly)))
+					ddm_o.select((_vm->_gyro.mry - 13) / 10);
+		}
+	}
+}
+
+void Dropdown::menu_link() {
+	if (! ddm_o.menunow)  return;
+
+	_vm->_gyro.check(); /* find mouse coords & click information */
+	checkclick(); /* work out click codes */
+
+	/* Change arrow... */
+
+		
+	if ((_vm->_gyro.my >= 0) && (_vm->_gyro.my <= 10))
+		_vm->_gyro.newpointer(1); /* up-arrow */
+	else if ((_vm->_gyro.my >= 11) && (_vm->_gyro.my <= 169)) {
+		if ((_vm->_gyro.mx >= ddm_o.flx1 * 8) && (_vm->_gyro.mx <= ddm_o.flx2 * 8)
+			&& (_vm->_gyro.my > 10) && (_vm->_gyro.my <= ddm_o.fly))
+			_vm->_gyro.newpointer(3); /* right-arrow */
+		else
+			_vm->_gyro.newpointer(4); /* fletch */
+	} else if ((_vm->_gyro.my >= 169) && (_vm->_gyro.my <= 200))
+		_vm->_gyro.newpointer(2); /* screwdriver */
+
+	if (! ddm_o.menunow)
+		return;
+
+	ddm_o.lightup();
+}
+
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
new file mode 100644
index 0000000..abcc81b
--- /dev/null
+++ b/engines/avalanche/dropdown2.h
@@ -0,0 +1,205 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#ifndef DROPDOWN2_H
+#define DROPDOWN2_H
+
+#include "avalanche/color.h"
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Dropdown;
+
+typedef void (Dropdown::*func)();
+
+class headtype {
+public:
+	Common::String title;
+	char trigger, alttrigger;
+	byte position;
+	int16 xpos, xright;
+	func do_setup, do_choose;
+
+	headtype *init(char trig, char alttrig, Common::String name, byte p, func dw, func dc, Dropdown *dr);
+	void display();
+	void highlight();
+	bool extdparse(char c);
+
+private:
+	Dropdown *_dr;
+};
+
+
+
+struct optiontype {
+	Common::String title;
+	char trigger;
+	Common::String shortcut;
+	bool valid;
+};
+
+class onemenu {
+public:
+	optiontype oo[12];
+	byte number;
+	int16 width, left;
+	bool firstlix;
+	int16 flx1, flx2, fly;
+	byte oldy; /* used by Lightup */
+	bool menunow; /* Is there a menu now? */
+	byte menunum; /* And if so, which is it? */
+	byte choicenum; /* Your choice? */
+	byte highlightnum;
+
+	onemenu *init(Dropdown *dr);
+	void start_afresh();
+	void opt(Common::String n, char tr, Common::String key, bool val);
+	void display();
+	void wipe();
+	void lightup();
+	void displayopt(byte y, bool highlit);
+	void movehighlight(int8 add);
+	void select(byte n);
+	void keystroke(char c);
+
+private:
+	Dropdown *_dr;
+};
+
+
+
+class menuset {
+public:
+	headtype ddms[8];
+	byte howmany;
+
+	menuset *menuset::init(Dropdown *dr);
+	void create(char t, Common::String n, char alttrig, func dw, func dc);
+	void update();
+	void extd(char c);
+	void getcertain(byte fv);
+	void getmenu(int16 x);
+
+private:
+	Dropdown *_dr;
+};
+
+
+
+class Dropdown {
+public:
+	friend headtype;
+	friend onemenu;
+	friend menuset;
+
+	void setParent(AvalancheEngine *vm);
+
+	onemenu ddm_o;
+	menuset ddm_m;
+
+	Common::String people;
+
+
+
+	void find_what_you_can_do_with_it();
+
+	void parsekey(char r, char re);
+
+	void menu_link(); /* DDM menu-bar funcs */
+
+	void standard_bar();
+
+private:
+	
+
+	
+
+
+
+	AvalancheEngine *_vm;
+
+	static const int16 indent = 5;
+	static const int16 spacing = 10;
+
+	/* menu_b = blue; { Morpheus }
+	 menu_f = yellow;
+	 menu_border = black;
+	 highlight_b = lightblue;
+	 highlight_f = yellow;
+	 disabled = lightgray; */
+
+	static const int16 menu_b = lightgray; /* Windowsy */
+	static const int16 menu_f = black;
+	static const int16 menu_border = black;
+	static const int16 highlight_b = black;
+	static const int16 highlight_f = white;
+	static const int16 disabled = darkgray;
+
+
+
+	char r;
+	byte fv;
+
+
+
+	void chalk(int16 x, int16 y, char t, Common::String z, bool valid);
+
+	void hlchalk(int16 x, int16 y, char t, Common::String z, bool valid);
+
+	void bleep();
+
+
+	
+
+	void ddm__game();
+	void ddm__file();
+	void ddm__action();
+	void ddm__people();
+	void ddm__objects();
+	void ddm__with();
+
+	Common::String himher(char x);
+
+	void do__game();
+	void do__file();
+	void do__action();
+	void do__objects();
+	void do__people();
+	void do__with();
+
+	void checkclick();
+};
+
+} // End of namespace Avalanche.
+
+#endif // DROPDOWN2_H


Commit: 3fd8a182461155fce18d6f7ab781959ec465a89c
    https://github.com/scummvm/scummvm/commit/3fd8a182461155fce18d6f7ab781959ec465a89c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-01T14:57:56-07:00

Commit Message:
AVALANCHE: Finish stubbing of Lucerna. Cosmetic change in Trip.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 344c273..d343923 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -42,6 +42,7 @@
 #include "avalanche/pingo2.h"
 #include "avalanche/sequence2.h"
 #include "avalanche/acci2.h"
+#include "avalanche/roomnums.h"
 
 #include "common/system.h"
 
@@ -51,26 +52,1011 @@
 
 namespace Avalanche {
 
-Lucerna::Lucerna() {
-	// Will be needed.
-}
+Lucerna::Lucerna() : fxhidden(false) {}
 
 void Lucerna::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
+
+void Lucerna::init() {
+	_vm->_gyro.oh = 17717;
+	_vm->_gyro.om = 17717;
+	if (_vm->_enhanced.atbios)  _vm->_gyro.atkey = "f1";
+	else _vm->_gyro.atkey = "alt-";
+}
 	
 void Lucerna::callverb(char n) {
-	/*if (n == pardon)
-	Scrolls::display(
-	"The f5 key lets you do a particular action in certain "
-	"situations. However, at the moment there is nothing "
-	"assigned to it. You may press alt-A to see what the "
-	"current setting of this key is.");*/
+	if (n == _vm->_acci.pardon) {
+		_vm->_scrolls.display(Common::String("The f5 key lets you do a particular action in certain ") +
+			"situations. However, at the moment there is nothing " +
+			"assigned to it. You may press alt-A to see what the " +
+			"current setting of this key is.");
+	} else {
+		_vm->_gyro.weirdword = false;
+		_vm->_acci.polite = true;
+		_vm->_acci.verb = n;
+		_vm->_acci.do_that();
+	}
+}
+
+void Lucerna::draw_also_lines() {
+	byte ff;
+	byte squeaky_code;
+
+	warning("STUB: Lucerna::draw_also_lines()");
+}
+
+
+
+
+Common::String Lucerna::nextstring() {
+	byte l;
+	Common::String x;
+
+	
+	warning("STUB: Lucerna::nextstring()");
+
+	return "STUB: Lucerna::nextstring()";
+}
+
+void Lucerna::scram1(Common::String &x) {
+	byte fz;
+	for (fz = 1; fz <= x.size(); fz ++)
+		x.setChar(x[fz] ^ 177, fz);
+}
+
+void Lucerna::unscramble() {
+	byte fv, ff;
+
+	for (fv = 0; fv <= 30; fv ++)
+		for (ff = 0; ff <= 1; ff ++)
+			if (_vm->_gyro.also[fv][ff] != 0)
+				scram1(*_vm->_gyro.also[fv][ff]);
+	scram1(_vm->_gyro.listen);
+	scram1(_vm->_gyro.flags);
+	/*     for fz:=1 to length(_vm->_gyro.also[fv,ff]^) do
+	      _vm->_gyro.also[fv,ff]^[fz]:=chr(ord(_vm->_gyro.also[fv,ff]^[fz]) xor 177);*/
+}
+
+void Lucerna::load_also(Common::String n) {
+	byte minnames;
+	byte ff, fv;
+
+
+	for (fv = 0; fv <= 30; fv ++)
+		for (ff = 0; ff <= 1; ff ++)
+			if (_vm->_gyro.also[fv][ff] != 0)  {
+				delete _vm->_gyro.also[fv][ff];
+				_vm->_gyro.also[fv][ff] = 0;
+			}
+
+	warning("STUB: Lucerna::load_also()");
+}
+
+void Lucerna::load(byte n) {     /* Load2, actually */
+	byte a0;  /*absolute $A000:800;*/
+	byte a1;  /*absolute $A000:17184;*/
+	byte bit;
+
+	warning("STUB: Lucerna::load()");
+}
+
+
+
+void Lucerna::zoomout(int16 x, int16 y) {
+	int16 x1, y1, x2, y2;
+	byte fv;
+
+	warning("STUB: Lucerna::zoomout()");
+}
+
+void Lucerna::find_people(byte room) {
+	char fv;
+
+	for (fv = 151; fv <= 178; fv ++)
+		if (_vm->_gyro.whereis[fv] == room) {
+			if (fv < 175)  _vm->_gyro.him = fv;
+			else _vm->_gyro.her = fv;
+		}
+}
+
+void Lucerna::exitroom(byte x) {
+	//nosound();
+	_vm->_celer.forget_chunks();
+	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the
+  length of this procedure. */
+
+	{
+		dnatype &with = _vm->_gyro.dna;
+		switch (x) {
+		case r__spludwicks: {
+			_vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks);
+			/* He doesn't HAVE to be talking for this to work. It just deletes it IF it
+			exists. */        with.avaricius_talk = 0;
+		}
+		break;
+		case r__bridge:
+			if (with.drawbridge_open > 0) {
+				with.drawbridge_open = 4; /* Fully open. */
+				_vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls);
+			}
+			break;
+		case r__outsidecardiffcastle:
+			_vm->_timeout.lose_timer(_vm->_timeout.reason_cardiffsurvey);
+			break;
+
+		case r__robins:
+			_vm->_timeout.lose_timer(_vm->_timeout.reason_getting_tied_up);
+			break;
+		}
+	}
+
+	_vm->_gyro.interrogation = 0; /* Leaving the room cancels all the questions automatically. */
+
+	_vm->_gyro.seescroll = false; /* Now it can work again! */
+
+	_vm->_gyro.dna.last_room = _vm->_gyro.dna.room;
+	if (_vm->_gyro.dna.room != r__map)
+		_vm->_gyro.dna.last_room_not_map = _vm->_gyro.dna.room;
+}
+
+void Lucerna::new_town() {   /* You've just entered a town from the map. */
+	_vm->_dropdown.standard_bar();
+
+	switch (_vm->_gyro.dna.room) {
+	case r__outsidenottspub: /* Entry into Nottingham. */
+		if ((_vm->_gyro.dna.rooms[r__robins] > 0) && (_vm->_gyro.dna.been_tied_up) &&
+		        (! _vm->_gyro.dna.taken_mushroom))
+			_vm->_gyro.dna.mushroom_growing = true;
+		break;
+	case r__wisewomans: { /* Entry into Argent. */
+		if (_vm->_gyro.dna.talked_to_crapulus && (! _vm->_gyro.dna.lustie_is_asleep)) {
+			_vm->_gyro.dna.spludwicks_here = !((_vm->_gyro.dna.rooms[r__wisewomans] % 3) == 1);
+			_vm->_gyro.dna.crapulus_will_tell = ! _vm->_gyro.dna.spludwicks_here;
+		} else {
+			_vm->_gyro.dna.spludwicks_here = true;
+			_vm->_gyro.dna.crapulus_will_tell = false;
+		}
+		if (_vm->_gyro.dna.box_contents == _vm->_gyro.wine)  _vm->_gyro.dna.winestate = 3; /* Vinegar */
+	}
+	break;
+	}
+
+	if (_vm->_gyro.dna.room != r__outsideducks) {
+		if ((_vm->_gyro.dna.obj[_vm->_gyro.onion]) && !(_vm->_gyro.dna.onion_in_vinegar))
+			_vm->_gyro.dna.rotten_onion = true; /* You're holding the onion */
+	}
+}
+
+
+
+void Lucerna::put_geida_at(byte whichped, byte &ped) {
+	if (ped == 0)  return;
+	_vm->_trip.tr[2].init(5, false, &_vm->_trip); /* load Geida */
+	_vm->_trip.apped(2, whichped);
+	_vm->_trip.tr[2].call_eachstep = true;
+	_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
+}
+
+void Lucerna::enterroom(byte x, byte ped) {
+	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
+
+	find_people(x);
+	_vm->_gyro.dna.room = x;
+	if (ped != 0)  _vm->_gyro.dna.rooms[x] += 1;
+
+	load(x);
+
+	if ((_vm->_gyro.dna.rooms[x] == 0) && (! _vm->_gyro.flagset('S')))
+		points(1);
+
+	_vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room;
+
+	if (_vm->_gyro.dna.geida_follows)
+		_vm->_gyro.whereis[_vm->_gyro.pgeida] = x;
+
+	_vm->_gyro.roomtime = 0;
+
+	{
+		dnatype &with = _vm->_gyro.dna;
+		if ((with.last_room == r__map) && (with.last_room_not_map != with.room))
+			new_town();
+	}
+
+	switch (x) {
+	case r__yours:
+		if (_vm->_gyro.dna.avvy_in_bed) {
+			_vm->_celer.show_one(3);
+			_vm->_timeout.set_up_timer(100, _vm->_timeout.procarkata_shouts, _vm->_timeout.reason_arkata_shouts);
+		}
+		break;
+
+	case r__outsideyours:
+		if (ped > 0) {
+			if (! _vm->_gyro.dna.talked_to_crapulus) {
+
+				_vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__outsideyours;
+				_vm->_trip.tr[2].init(8, false, &_vm->_trip); /* load Crapulus */
+
+				if (_vm->_gyro.dna.rooms[r__outsideyours] == 1) {
+					_vm->_trip.apped(2, 4); /* Start on the right-hand side of the screen. */
+					_vm->_trip.tr[2].walkto(5); /* Walks up to greet you. */
+				} else {
+					_vm->_trip.apped(2, 5); /* Starts where he was before. */
+					_vm->_trip.tr[2].face = 3;
+				}
+
+				_vm->_trip.tr[2].call_eachstep = true;
+				_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* He always faces Avvy. */
+
+			} else _vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__nowhere;
+
+			if (_vm->_gyro.dna.crapulus_will_tell) {
+				_vm->_trip.tr[2].init(8, false, &_vm->_trip);
+				_vm->_trip.apped(2, 2);
+				_vm->_trip.tr[2].walkto(4);
+				_vm->_timeout.set_up_timer(20, _vm->_timeout.proccrapulus_splud_out, _vm->_timeout.reason_crapulus_says_spludwick_out);
+				_vm->_gyro.dna.crapulus_will_tell = false;
+			}
+		}
+		break;
+
+	/* Need to find out which room is this!
+	 
+	 case r__outsidespludwicks:
+		if ((_vm->_gyro.dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
+			_vm->_timeout.set_up_timer(20, _vm->_timeout.procbang, _vm->_timeout.reason_explosion);
+			_vm->_gyro.dna.spludwicks_here = true;
+		}
+		break;*/
+
+	case r__spludwicks:
+		if (_vm->_gyro.dna.spludwicks_here) {
+			if (ped > 0) {
+				_vm->_trip.tr[2].init(2, false, &_vm->_trip); /* load Spludwick */
+				_vm->_trip.apped(2, 2);
+				_vm->_gyro.whereis['\227'] = r__spludwicks;
+			}
+
+			_vm->_gyro.dna.dogfoodpos = 0;  /* _vm->_gyro.also Spludwick pos. */
+
+			_vm->_trip.tr[2].call_eachstep = true;
+			_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
+		} else _vm->_gyro.whereis['\227'] = r__nowhere;
+		break;
+
+	case r__brummieroad: {
+		if (_vm->_gyro.dna.geida_follows)  put_geida_at(5, ped);
+		if (_vm->_gyro.dna.cwytalot_gone) {
+			_vm->_gyro.magics[lightred].op = _vm->_gyro.nix;
+			_vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__nowhere;
+		} else {
+			if (ped > 0) {
+				_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot*/
+				_vm->_trip.tr[2].call_eachstep = true;
+				_vm->_trip.tr[2].eachstep = _vm->_trip.procfollow_avvy_y;
+				_vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__brummieroad;
+
+				if (_vm->_gyro.dna.rooms[r__brummieroad] == 1) { /* First time here... */
+					_vm->_trip.apped(2, 2); /* He appears on the right of the screen... */
+					_vm->_trip.tr[2].walkto(4); /* ...and he walks up... */
+				} else {
+					/* You've been here before. */
+					_vm->_trip.apped(2, 4); /* He's standing in your way straight away... */
+					_vm->_trip.tr[2].face = _vm->_trip.left;
+				}
+			}
+		}
+	}
+	break;
+
+	case r__argentroad: {
+		dnatype &with = _vm->_gyro.dna;
+		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
+		        (_vm->_gyro.dna.rooms[r__argentroad] > 3)) {
+			_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot again*/
+			_vm->_trip.apped(2, 1);
+			_vm->_trip.tr[2].walkto(2);
+			_vm->_trip.tr[2].vanishifstill = true;
+			with.cwytalot_in_herts = true;
+			/*_vm->_gyro.whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
+			_vm->_timeout.set_up_timer(20, _vm->_timeout.proc_cwytalot_in_herts, _vm->_timeout.reason_cwytalot_in_herts);
+		}
+	}
+	break;
+
+	case r__bridge: {
+		if (_vm->_gyro.dna.drawbridge_open == 4) { /*open*/
+			_vm->_celer.show_one(3); /* Position of drawbridge */
+			_vm->_gyro.magics[green].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
+		}
+		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 3, ped); /* load Geida */
+	}
+	break;
+
+	case r__robins: {
+		if (ped > 0) {
+			if (! _vm->_gyro.dna.been_tied_up) {
+				/* A welcome party... or maybe not... */
+				_vm->_trip.tr[2].init(6, false, &_vm->_trip);
+				_vm->_trip.apped(2, 2);
+				_vm->_trip.tr[2].walkto(3);
+				_vm->_timeout.set_up_timer(36, _vm->_timeout.procget_tied_up, _vm->_timeout.reason_getting_tied_up);
+			}
+		}
+
+		if (_vm->_gyro.dna.been_tied_up) {
+			_vm->_gyro.whereis[_vm->_gyro.probinhood] = 0;
+			_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 0;
+		}
+
+		if (_vm->_gyro.dna.tied_up)
+			_vm->_celer.show_one(2);
+
+		if (! _vm->_gyro.dna.mushroom_growing) 
+			_vm->_celer.show_one(3);
+	}
+	break;
+
+	case r__outsidecardiffcastle: {
+		if (ped > 0)
+			switch (_vm->_gyro.dna.cardiff_things) {
+			case 0 : { /* You've answered NONE of his questions. */
+				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
+				_vm->_trip.apped(2, 2);
+				_vm->_trip.tr[2].walkto(3);
+				_vm->_timeout.set_up_timer(47, _vm->_timeout.proccardiffsurvey, _vm->_timeout.reason_cardiffsurvey);
+			}
+			break;
+			case 5 :
+				_vm->_gyro.magics[2].op = _vm->_gyro.nix;
+				break; /* You've answered ALL his questions. => nothing happens. */
+			default: { /* You've answered SOME of his questions. */
+				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
+				_vm->_trip.apped(2, 3);
+				_vm->_trip.tr[2].face = _vm->_trip.right;
+				_vm->_timeout.set_up_timer(3, _vm->_timeout.proccardiff_return, _vm->_timeout.reason_cardiffsurvey);
+			}
+			}
+		if (_vm->_gyro.dna.cardiff_things < 5)
+			_vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things;
+		else _vm->_gyro.interrogation = 0;
+	}
+	break;
+
+	case r__map: {
+		warning("STUB: Lucerna::enterroom() - case: r__map");
+	}
+	break;
+
+	case r__catacombs: {
+		warning("STUB: Lucerna::enterroom() - case: r__catacombs");
+	}
+	break;
+
+	case r__argentpub: {
+		if (_vm->_gyro.dna.wonnim)  _vm->_celer.show_one(1);   /* No lute by the settle. */
+		_vm->_gyro.dna.malagauche = 0; /* Ready to boot Malagauche */
+		if (_vm->_gyro.dna.givenbadgetoiby) {
+			_vm->_celer.show_one(8);
+			_vm->_celer.show_one(9);
+		}
+	}
+	break;
+
+	case r__lustiesroom: {
+		_vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
+		if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */
+			_vm->_timeout.set_up_timer(3, _vm->_timeout.proccallsguards, _vm->_timeout.reason_du_lustie_talks);
+		else if (! _vm->_gyro.dna.entered_lusties_room_as_monk) /*already*/
+			/* Presumably, Avvy dressed as a monk. */
+			_vm->_timeout.set_up_timer(3, _vm->_timeout.procgreetsmonk, _vm->_timeout.reason_du_lustie_talks);
+
+		if (_vm->_gyro.dna.geida_follows) {
+			put_geida_at(5, ped);
+			if (_vm->_gyro.dna.lustie_is_asleep)  _vm->_celer.show_one(5);
+		}
+	}
+	break;
+
+	case r__musicroom: {
+		if (_vm->_gyro.dna.jacques_awake > 0) {
+			_vm->_gyro.dna.jacques_awake = 5;
+			_vm->_celer.show_one(2);
+			_vm->_celer.show_one(4);
+			_vm->_gyro.magics[brown].op = _vm->_gyro.nix;
+			_vm->_gyro.whereis[_vm->_gyro.pjacques] = 0;
+		}
+		if (ped != 0) {
+			_vm->_celer.show_one(6);
+			_vm->_sequence.first_show(5);
+			_vm->_sequence.then_show(7);
+			_vm->_sequence.start_to_close();
+		}
+	}
+	break;
+
+	case r__outsidenottspub:
+		if (ped == 2) {
+			_vm->_celer.show_one(3);
+			_vm->_sequence.first_show(2);
+			_vm->_sequence.then_show(1);
+			_vm->_sequence.then_show(4);
+			_vm->_sequence.start_to_close();
+		}
+		break;
+
+	case r__outsideargentpub:
+		if (ped == 2)  {
+			_vm->_celer.show_one(6);
+			_vm->_sequence.first_show(5);
+			_vm->_sequence.then_show(7);
+			_vm->_sequence.start_to_close();
+		}
+		break;
+
+	case r__wisewomans: {
+		_vm->_trip.tr[2].init(11, false, &_vm->_trip);
+		if ((_vm->_gyro.dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
+			_vm->_trip.apped(2, 2); /* Start on the right-hand side of the screen. */
+			_vm->_trip.tr[2].walkto(4); /* Walks up to greet you. */
+		} else {
+			_vm->_trip.apped(2, 4); /* Starts where she was before. */
+			_vm->_trip.tr[2].face = 3;
+		}
+
+		_vm->_trip.tr[2].call_eachstep = true;
+		_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* She always faces Avvy. */
+	}
+	break;
+
+	case r__insidecardiffcastle:
+		if (ped > 0) {
+			_vm->_trip.tr[2].init(10, false, &_vm->_trip); /* Define the dart. */
+			_vm->_sequence.first_show(1);
+			if (_vm->_gyro.dna.arrow_in_the_door)
+				_vm->_sequence.then_show(3);
+			else
+				_vm->_sequence.then_show(2);
+
+			if (_vm->_gyro.dna.taken_pen)
+				_vm->_celer.show_one(4);
+
+			_vm->_sequence.start_to_close();
+		} else {
+			_vm->_celer.show_one(1);
+			if (_vm->_gyro.dna.arrow_in_the_door)  _vm->_celer.show_one(3);
+			else _vm->_celer.show_one(2);
+		}
+		break;
+
+	case r__avvysgarden:
+		if (ped == 1)  {
+			_vm->_celer.show_one(2);
+			_vm->_sequence.first_show(1);
+			_vm->_sequence.then_show(3);
+			_vm->_sequence.start_to_close();
+		}
+		break;
+
+	case r__entrancehall:
+	case r__insideabbey:
+		if (ped == 2)  {
+			_vm->_celer.show_one(2);
+			_vm->_sequence.first_show(1);
+			_vm->_sequence.then_show(3);
+			_vm->_sequence.start_to_close();
+		}
+		break;
+
+	case r__aylesoffice:
+		if (_vm->_gyro.dna.ayles_is_awake)  _vm->_celer.show_one(2);
+		break; /* Ayles awake. */
+
+	case r__geidas:
+		put_geida_at(2, ped);
+		break; /* load Geida */
+
+	case r__easthall:
+	case r__westhall:
+		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 2, ped);
+		break;
+
+	case r__lusties:
+		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 6, ped);
+		break;
+
+	case r__nottspub: {
+		if (_vm->_gyro.dna.sitting_in_pub)  _vm->_celer.show_one(3);
+		_vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
+	}
+	break;
+
+	case r__outsideducks:
+		if (ped == 2) {
+			/* Shut the door */
+			_vm->_celer.show_one(3);
+			_vm->_sequence.first_show(2);
+			_vm->_sequence.then_show(1);
+			_vm->_sequence.then_show(4);
+			_vm->_sequence.start_to_close();
+		}
+		break;
+	case r__ducks:
+		_vm->_gyro.dna.dogfoodpos = 1;
+		break; /* Actually, Duck pos. */
+
+	}
+
+	_vm->_gyro.seescroll = false; /* Now it can work again! */
+
+}
+
+void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! */
+	warning("STUB: Lucerna::thinkabout()");
+}
+
+void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
+	warning("STUB: Lucerna::load_digits()");
+}
+
+void Lucerna::toolbar() {
+	warning("STUB: Lucerna::toolbar()");
+}
+
+void Lucerna::showscore() {
+	warning("STUB: Lucerna::showscore()");
+}
+
+void Lucerna::points(byte num) {     /* Add on no. of points */
+	warning("STUB: Lucerna::points()");
+}
+
+void Lucerna::topcheck() {
+	/* Menuset */
+	_vm->_dropdown.ddm_m.getmenu(_vm->_gyro.mpx);
+	/* Do this one */
+}
+
+void Lucerna::mouseway() {
+	warning("STUB: Lucerna::mouseway()");
+}
+
+void Lucerna::inkey() {
+	char r;
+
+
+	if (_vm->_gyro.demo)
+		return; /* Demo handles this itself. */
+
+	if (_vm->_gyro.mousetext == "") {
+		/* read keyboard */
+		_vm->_enhanced.readkeye();
+		if ((_vm->_enhanced.inchar == ' ') && ((_vm->_enhanced.shiftstate & 8) > 0)) {
+			_vm->_enhanced.inchar = '\0';
+			_vm->_enhanced.extd = '#'; /* alt-spacebar = alt-H */
+		}
+	} else {
+		if (_vm->_gyro.mousetext[1] == '`')
+			_vm->_gyro.mousetext.setChar(13,1); /* Backquote = return in a macro */
+		_vm->_enhanced.inchar = _vm->_gyro.mousetext[1];
+		_vm->_gyro.mousetext = Common::String(_vm->_gyro.mousetext.c_str() + 2, 253);
+	}
+}
+
+void Lucerna::posxy() {
+	warning("STUB: Lucerna::posxy()");
+}
+
+void Lucerna::fxtoggle() {
+	warning("STUB: Lucerna::fxtoggle()");
+}
 
-	// Needs const char pardon located in Acci.
+void Lucerna::objectlist() {
+	char fv;
 
+	_vm->_gyro.dna.carrying = 0;
+	if (_vm->_gyro.thinkthing && ! _vm->_gyro.dna.obj[_vm->_gyro.thinks])
+		thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing); /* you always have money */
+	for (fv = '\1'; fv <= numobjs; fv ++)
+		if (_vm->_gyro.dna.obj[fv]) {
+			_vm->_gyro.dna.carrying += 1;
+			_vm->_gyro.objlist[_vm->_gyro.dna.carrying] = fv;
+		}
 }
 
+void Lucerna::verte() {
+	byte what;
 
+	if (! _vm->_gyro.dna.user_moves_avvy)  return;
+	{
+		triptype &with = _vm->_trip.tr[1];  /* that's the only one we're interested in here */
+
+
+		if (_vm->_gyro.mx < with.x)  what = 1;
+		else if (_vm->_gyro.mx > (unsigned char)(with.x + with.a.xl))  what = 2;
+		else
+			what = 0; /* On top */
+
+		if (_vm->_gyro.my < with.y)  what += 3;
+		else if (_vm->_gyro.my > (unsigned char)(with.y + with.a.yl))  what += 6;
+
+		switch (what) {
+		case 0:
+			_vm->_trip.stopwalking();
+			break; /* Clicked on Avvy- no movement */
+		case 1:
+			_vm->_trip.rwsp(1, _vm->_trip.left);
+			break;
+		case 2:
+			_vm->_trip.rwsp(1, _vm->_trip.right);
+			break;
+		case 3:
+			_vm->_trip.rwsp(1, _vm->_trip.up);
+			break;
+		case 4:
+			_vm->_trip.rwsp(1, _vm->_trip.ul);
+			break;
+		case 5:
+			_vm->_trip.rwsp(1, _vm->_trip.ur);
+			break;
+		case 6:
+			_vm->_trip.rwsp(1, _vm->_trip.down);
+			break;
+		case 7:
+			_vm->_trip.rwsp(1, _vm->_trip.dl);
+			break;
+		case 8:
+			_vm->_trip.rwsp(1, _vm->_trip.dr);
+			break;
+		}    /* no other values are possible... */
+
+		showrw();
+
+	}
+}
+
+void Lucerna::checkclick() {
+	warning("STUB: Lucerna::checkclick()");
+}
+
+void Lucerna::mouse_init() {
+	warning("STUB: Lucerna::mouse_init()");
+}
+
+void Lucerna::mousepage(uint16 page_) {
+	warning("STUB: Lucerna::mousepage()");
+}
+
+void Lucerna::errorled() {
+	warning("STUB: Lucerna::errorled()");
+}
+
+int8 Lucerna::fades(int8 x) {
+	byte r, g, b;
+
+	int8 fades_result;
+	r = x / 16;
+	x = x % 16;
+	g = x / 4;
+	b = x % 4;
+	if (r > 0)  r -= 1;
+	if (g > 0)  g -= 1;
+	if (b > 0)  b -= 1;
+	fades_result = (16 * r + 4 * g + b);
+	/* fades:=x-1;*/
+	return fades_result;
+}
+
+
+
+
+void Lucerna::fadeout(byte n) {
+	warning("STUB: Lucerna::fadeout()");
+}
+
+void Lucerna::dusk() {
+	warning("STUB: Lucerna::dusk()");
+}
+
+
+
+
+void Lucerna::fadein(byte n) {
+	warning("STUB: Lucerna::fadein()");
+}
+
+void Lucerna::dawn() {
+	warning("STUB: Lucerna::dawn()");
+}
+
+
+
+void Lucerna::showrw() {
+	warning("STUB: Lucerna::showrw()");
+}
+
+void Lucerna::mblit(byte x1, byte y1, byte x2, byte y2, byte f, byte t) /* assembler; */
+/* The Minstrel Blitter */
+/* asm
+{  ofsfr:=f*$4000+x1+y1*80;
+   ofsto:=t*$4000+x1+y1*80;}
+
+  mov bx,80; { We're multiplying by 80. }
+  mov al,y1;
+  mul bl;    { AX now contains y1*80. }
+  xor cx,cx; { Zero CX. }
+  mov cl,x1; { CX now equals x1 }
+  add ax,cx; { AX now contains x1+y1*80. }
+  mov si,ax;
+  mov di,ax;
+
+  mov ax,$4000;
+  mov bl,f;
+  mul bx; { Note that this is a *uint16*! }
+  add si,ax;
+
+  mov ax,$4000;
+  mov bl,t;
+  mul bx; { Note that this is a *uint16*! }
+  add di,ax;
+
+  push ds; { *** <<<< *** WE MUST PRESERVE THIS! }
+  cld;  { Clear Direction flag - we're going forwards! }
+
+  mov ax,$A000; { The screen memory. }
+  mov ds,ax;
+  mov es,ax; { The same. }
+
+  { AH stores the number of bytes to copy. }
+  { len:=(x2-x1)+1; }
+
+  mov ah,x2;
+  sub ah,x1;
+  inc ah;
+
+  { Firstly, let's decide how many times we're going round. }
+
+  mov cl,y2; { How many numbers between y1 and y2? }
+  sub cl,y1;
+  inc cl; { Inclusive reckoning (for example, from 3 to 5 is 5-3+1=3 turns. }
+
+  { We'll use SI and DI to be Ofsfr and Ofsto. }
+
+  @Y_axis_loop:
+   push cx;
+
+
+   { OK... We've changed this loop from a for-next loop. "Bit" is
+     represented by CX. }
+
+{     port[$3c4]:=2; port[$3ce]:=4; }
+   mov dx,$3c4;
+   mov al,2;
+   out dx,al;
+   mov dx,$3ce;
+   mov al,4;
+   out dx,al;
+
+   mov cx,4; { We have to copy planes 3, 2, 1 and Zero. We'll add 1 to the
+    number, because at zero it stops. }
+
+   mov bx,3; { This has a similar function to that of CX. }
+
+   @start_of_loop:
+
+    push cx;
+
+{     port[$3C5]:=1 shl bit; }
+    mov dx,$3C5;
+    mov al,1;
+    mov cl,bl; { BL = bit. }
+    shl al,cl;
+    out dx,al;
+{     port[$3CF]:=bit; }
+    mov dx,$3CF;
+    mov al,bl; { BL = bit. }
+    out dx,al;
+
+{   move(mem[$A000:ofsfr],mem[$A000:ofsto],len); }
+
+    xor ch,ch; { Clear CH. }
+    mov cl,ah;
+
+    repz movsb; { That's all we need to say! }
+
+    mov cl,ah;
+    sub si,cx; { This is MUCH, MUCH faster than pushing and popping them! }
+    sub di,cx;
+
+    pop cx; { Get the loop count back again. }
+    dec bx; { One less... }
+   loop @start_of_loop; { Until cx=0. }
+
+   add si,80; { Do the next line... }
+   add di,80;
+
+   pop cx;
+  loop @Y_axis_loop;
+
+  pop ds; { Get it back again (or we'll be in trouble with TP!) }
+*/
+{
+}
+
+void Lucerna::blitfix() {
+	warning("STUB: Lucerna::blitfix()");
+}
+
+
+
+
+
+
+void Lucerna::calchand(uint16 ang, uint16 length, /*arccoordstype &a,*/ byte c) {
+	warning("STUB: Lucerna::calchand()");
+}
+
+void Lucerna::hand(/*arccoordstype a,*/ byte c) {
+	warning("STUB: Lucerna::hand()");
+}
+
+void Lucerna::chime() {
+	warning("STUB: Lucerna::chime()");
+}
+
+void Lucerna::plothands() {
+	warning("STUB: Lucerna::plothands()");
+}
+
+void Lucerna::clock_lucerna() {
+	warning("STUB: Lucerna::clock_lucerna()");
+}
+
+
+
+
+void Lucerna::flip_page() {
+	warning("STUB: Lucerna::flip_page()");
+}
+
+void Lucerna::delavvy() {
+	byte page_;
+
+	_vm->_gyro.off();
+	{
+		triptype &with = _vm->_trip.tr[1];
+		for (page_ = 0; page_ <= 1; page_ ++)
+			mblit(with.x / 8, with.y, (with.x + with.a.xl) / 8 + 1, with.y + with.a.yl, 3, page_);
+	}
+	blitfix();
+	_vm->_gyro.on();
+}
+
+void Lucerna::gameover() {
+	byte fv;
+	int16 sx, sy;
+
+	_vm->_gyro.dna.user_moves_avvy = false;
+
+	sx = _vm->_trip.tr[1].x;
+	sy = _vm->_trip.tr[1].y;
+	
+	_vm->_trip.tr[1].done();
+	_vm->_trip.tr[1].init(12, true, &_vm->_trip);       /* 12 = Avalot falls */
+	_vm->_trip.tr[1].step = 0;
+	_vm->_trip.tr[1].appear(sx, sy, 0);
+	
+	_vm->_timeout.set_up_timer(3, _vm->_timeout.procavalot_falls, _vm->_timeout.reason_falling_over);
+	/* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
+	_vm->_gyro.alive = false;
+}
+
+/* OK. There are two kinds of redraw: Major and Minor. Minor is what happens
+  when you load a game, etc. Major redraws EVERYTHING. */
+
+void Lucerna::minor_redraw() {
+	byte fv;
+
+	dusk();
+	enterroom(_vm->_gyro.dna.room, 0); /* Ped unknown or non-existant. */
+
+	for (fv = 0; fv <= 1; fv ++) {
+		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
+		_vm->_trip.getback();
+	}
+
+	{
+		dnatype &with = _vm->_gyro.dna;
+
+		_vm->_gyro.lastscore = "TJA"; /* impossible digits */
+		showscore();
+	}
+
+	dawn();
+}
+
+void Lucerna::major_redraw() {
+	warning("STUB: Lucerna::major_redraw()");
+}
+
+uint16 Lucerna::bearing(byte whichped) {
+/* Returns the bearing from ped Whichped to Avvy, in degrees. */
+	const double rad2deg = 180 / 3.14/*Pi*/;
+
+	uint16 bearing_result; 
+	{
+		pedtype &with = _vm->_gyro.peds[whichped];
+		if (_vm->_trip.tr[1].x == with.x)
+			bearing_result = 0; /* This would cause a division by zero if we let it through. */
+		else
+			/*
+			 bearing:=trunc(((arctan((_vm->_trip.tr[1].y-y)/(_vm->_trip.tr[1].x-x)))*rad2deg)+90) mod 360*/
+		{
+			if (_vm->_trip.tr[1].x < with.x)
+				bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 90;
+			else
+				bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 270;
+		}
+	}
+	return bearing_result;
+}
+
+void Lucerna::flesh_colours()     /* assembler;
+asm
+  mov ax,$1012;
+  mov bx,21;                 { 21 = light pink (why?) }
+  mov cx,1;
+  mov dx,seg    @flesh;
+  mov es,dx;
+  mov dx,offset @flesh;
+  int $10;
+
+  mov dx,seg    @darkflesh;
+  mov es,dx;
+  mov dx,offset @darkflesh;
+  mov bx,5;                 { 5 = dark pink. }
+  int $10;
+
+  jmp @TheEnd;
+
+ @flesh:
+  db 56,35,35;
+
+ @darkflesh:
+  db 43,22,22;
+
+ @TheEnd: */
+{
+}
+
+void Lucerna::sprite_run()
+/* A sprite run is performed before _vm->_scrolls.displaying a scroll, if not all the
+  sprites are still. It performs two fast cycles, only using a few of
+  the links usually used, and without any extra animation. This should
+  make the sprites the same on both pages. */
+{
+	byte fv;
+
+
+	_vm->_gyro.doing_sprite_run = true;
+
+	for (fv = 0; fv <= 1; fv ++) {
+		_vm->_trip.get_back_loretta();
+		_vm->_trip.trippancy_link();
+
+		flip_page();
+	}
+
+	_vm->_gyro.doing_sprite_run = false;
+
+}
+
+void Lucerna::fix_flashers() {
+	_vm->_gyro.ledstatus = 177;
+	_vm->_gyro.oldrw = 177;
+	_vm->_scrolls.state(2);
+	showrw();
+}
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index d4e729a..69888ac 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -41,6 +41,8 @@ public:
 
 	void setParent(AvalancheEngine *vm);
 
+	void init();
+
 	void callverb(char n);
 
 	void draw_also_lines();
@@ -126,6 +128,45 @@ private:
 	};
 
 	palettetype fxpal[4];
+
+	//Clock
+	static const int16 xm = 510;
+	static const int16 ym = 183;
+	//arccoordstype ah, am; http://www.freepascal.org/docs-html/rtl/graph/arccoordstype.html
+	uint16 nh;
+
+
+	//untyped_file f;
+	Common::String nextstring();
+	void scram1(Common::String &x);
+	void unscramble();
+	void load_also(Common::String n);
+
+	void zoomout(int16 x, int16 y);
+
+	void find_people(byte room);
+
+	void new_town();
+
+	void put_geida_at(byte whichped, byte &ped);
+
+	void topcheck();
+
+	void verte();
+
+	int8 fades(int8 x);
+
+	void fadeout(byte n);
+
+	void fadein(byte n);
+
+	// clock_lucerna
+	void calchand(uint16 ang, uint16 length,/* arccoordstype &a,*/ byte c);
+	void hand(/*arccoordstype a,*/ byte c);
+	void chime();
+	void refresh_hands();
+	void plothands();
+
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index d7b5637..954b870 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -150,24 +150,11 @@ public:
 
 
 
-
-
-
-
-
-
 class Trip {
 public:
 	friend triptype;
 	friend getsettype;
 
-	
-
-
-
-
-
-
 	Trip();
 
 	void setParent(AvalancheEngine *vm);


Commit: 712ccac0b21c71aaec74b166006e8187d5692c6a
    https://github.com/scummvm/scummvm/commit/712ccac0b21c71aaec74b166006e8187d5692c6a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-01T16:10:45-07:00

Commit Message:
AVALANCHE: Finish stubbing of Scrolls.

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 74b7158..a9c94b5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -36,150 +36,37 @@
 #include "avalanche/acci2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
+#include "avalanche/basher2.h"
 
 #include "common/textconsole.h"
 
-//#include "basher.h"
 //#include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
 
 namespace Avalanche {
 
-const int16 Scrolls::roman = 0;
-const int16 Scrolls::italic = 1;
+Scrolls::Scrolls() {
+	loadfont();
+	resetscrolldriver();
 
-const int16 Scrolls::halficonwidth = 19; /* Half the width of an icon. */
-
-
-
-Scrolls::Scrolls() : aboutscroll(false)  {
 }
 
 void Scrolls::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
-	byte page_;
-
-	if (_vm->_gyro.ledstatus == x)
-		return; /* Already like that! */
-
-	warning("STUB: Scrolls::state(). Calls of Pascal units need to be removed.");
-	//switch (x) {
-	//case 0:
-	//	setfillstyle(1, black);
-	//	break; /* Off */
-	//case 1:
-	//	setfillstyle(9, green);
-	//	break; /* Half-on (menus) */
-	//case 2:
-	//	setfillstyle(1, green);
-	//	break; /* On (kbd) */
-	//case 3:
-	//	setfillstyle(6, green);
-	//	break; /* Hit a key */
-	//}
-
-	_vm->_gyro.super_off();
-
-	/*	for (page_ = 0; page_ <= 1; page_++) {
-		setactivepage(page_);
-		bar(419, 195, 438, 197);
-	}*/
-
-	_vm->_gyro.super_on();
-	_vm->_gyro.ledstatus = x;
+	warning("STUB: Scrolls::state()");
 }
 
 void Scrolls::easteregg() {
-	uint16 fv, ff;
-
-	warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
-
-	/*	background(15);
-	for (fv = 4; fv <= 100; fv++) {
-		for (ff = 0; ff <= 70; ff++) {
-			sound(fv * 100 + ff * 10);
-			delay(1);
-		}
-	}
-	nosound;
-	setcolor(10);
-	settextstyle(0, 0, 3);
-	settextjustify(1, 1);
-	outtextxy(320, 100, "GIED");
-	settextstyle(0, 0, 1);
-	settextjustify(0, 2);*/
-
-	_vm->_gyro.background(0);
+	warning("STUB: Scrolls::easteregg()");
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-	const int16 locol = 2;
-	byte xx, yy, ox, bit, lz, t;
-	int16 yp;
-	bool offset;
-	byte itw[12][80];
-
-	offset = x % 8 == 4;
-	x = x / 8;
-	lz = z.size();
-	ox = 0;
-	_vm->_logger.log_scrollline();
-
-	for (xx = 1; xx <= lz; xx++) {
-		switch (z[xx]) {
-		case '\22':
-			cfont = roman;
-			_vm->_logger.log_roman();
-			break;
-		case '\6':
-			cfont = italic;
-			_vm->_logger.log_italic();
-			break;
-		default:
-			ox += 1;
-			for (yy = 1; yy <= 12; yy++)
-				itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
-			_vm->_logger.log_scrollchar(Common::String(z[xx]));
-			break;
-		}
-	}
-
-	lz = ox;
-	if (offset) {
-		/* offsetting routine */
-		lz += 1;
-		for (yy = 1; yy <= 12; yy++) {
-			bit = 240;
-			itw[yy][lz] = 255;
-			for (xx = 1; xx <= lz; xx++) {
-				t = itw[yy][xx];
-				itw[yy][xx] = bit + t / 16;
-				bit = t << 4;
-			}
-		}
-	}
-	yp = x + y * 80 + (1 - _vm->_gyro.cp) * _vm->_gyro.pagetop;
-	for (yy = 1; yy <= 12; yy++) {
-		yp += 80;
-		for (bit = 0; bit <= locol; bit++) {
-			/*port[0x3c4] = 2;
-			port[0x3ce] = 4;
-			port[0x3c5] = 1 << bit;
-			port[0x3cf] = bit;
-			move(itw[yy], mem[0xa000 * yp], lz);
-				
-			Some old Pascal-ish. To be removed. */
-
-			warning("STUB: Scrolls::say()");
-		}
-	}
-
+	warning("STUB: Scrolls::say()");
 }
 
-/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
+/* Here are the func2edures that Scroll calls */ /* So they must be... */ /*$F+*/
 
 void Scrolls::normscroll() {
 	warning("STUB: Scrolls::normscroll()");
@@ -189,51 +76,164 @@ void Scrolls::dialogue() {
 	warning("STUB: Scrolls::dialogue()");
 }
 
+
+
+
 void Scrolls::store_(byte what, tunetype &played) {
-	memcpy(played, played+1, sizeof(played) - 1);
-	played[30] = what;
+	memcpy(played+1, played+2, sizeof(played) - 1);
+	played[31] = what;
 }
 
 bool Scrolls::they_match(tunetype &played) {
 	byte fv, mistakes;
 
-	bool they_match_result;
 	mistakes = 0;
 
-	for (fv = 1; fv <= sizeof(played); fv++)
-		if (played[fv] != Gyro::tune[fv])
-			mistakes++;
+	for (fv = 1; fv <= sizeof(played); fv ++)
+		if (played[fv] != _vm->_gyro.tune[fv]) {
+			mistakes += 1;
+		}
 
-		they_match_result = mistakes < 5;
-		return they_match_result;
+	return mistakes < 5;
 }
 
 void Scrolls::music_scroll() {
-	char r;
-	byte value;
+	warning("STUB: Scrolls::music_scroll()");
+}
+
+/* ThatsAll, so put us back to */ /*$F-*/
+
+void Scrolls::resetscrolldriver() {   /* phew */
+	_vm->_gyro.scrollbells = 0;
+	cfont = roman;
+	_vm->_logger.log_epsonroman();
+	use_icon = 0;
+	_vm->_gyro.interrogation = 0; /* always reset after a scroll comes up. */
+}
+
+void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little... */
+	byte fv;
+
+	for (fv = 1; fv <= _vm->_gyro.scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */
+}
+
+void Scrolls::dodgem() {     /* This moves the mouse pointer off the scroll so that you can read it. */
+	_vm->_gyro.xycheck(); /* Mx & my now contain xy pos of mouse */
+	dodgex = _vm->_gyro.mx;
+	dodgey = _vm->_gyro.my; /* Store 'em */
+	_vm->_gyro.hopto(dodgex, _vm->_gyro.underscroll); /* Move the pointer off the scroll. */
+}
+
+void Scrolls::undodgem() {   /* This is the opposite of Dodgem. It moves the
+ mouse pointer back, IF you haven't moved it in the meantime. */
+	_vm->_gyro.xycheck();
+	if ((_vm->_gyro.mx == dodgex) && (_vm->_gyro.my == _vm->_gyro.underscroll))
+		/* No change, so restore the pointer's original position. */
+		_vm->_gyro.hopto(dodgex, dodgey);
+}
+
+void Scrolls::geticon(int16 x, int16 y, byte which) {
+	warning("STUB: Scrolls::geticon()");
+}
+
+void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
+	warning("STUB: Scrolls::block_drop()");
+}
+
+void Scrolls::drawscroll(func2 gotoit) {     /* This is one of the oldest func2s in the game. */
+	warning("STUB: Scrolls::drawscroll()");
+}
+
+void Scrolls::bubble(func2 gotoit) {
+	warning("STUB: Scrolls::bubble()");
+}
+
+bool Scrolls::ask(Common::String question) {
+	warning("STUB: Scrolls::ask()");
+	return true;
+}
+
+void Scrolls::resetscroll() {
+	_vm->_gyro.scrolln = 1;
+	for (int j = 0; j < 15; j ++)
+		for (int i = 0; i < sizeof(_vm->_gyro.scroll); i++)
+			_vm->_gyro.scroll[j].setChar(0, i);
+}
+
+void Scrolls::natural() {   /* Natural state of bubbles */
+	_vm->_gyro.talkx = 320;
+	_vm->_gyro.talky = 200;
+	_vm->_gyro.talkb = 8;
+	_vm->_gyro.talkf = 15;
+}
+
+Common::String Scrolls::lsd() {
+	Common::String x;
+
+	Common::String lsd_result;
+	if (_vm->_gyro.dna.pence < 12) {
+		/* just pence */
+		x = _vm->_gyro.strf(_vm->_gyro.dna.pence) + 'd';
+	} else if (_vm->_gyro.dna.pence < 240) {
+		/* shillings & pence */
+		x = _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(12)) + '/';
+		if ((_vm->_gyro.dna.pence % int32(12)) == 0)  x = x + '-';
+		else x = x + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12));
+	} else   /* L, s & d */
+		x = Common::String('œ') + _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(240)) + '.' + _vm->_gyro.strf((_vm->_gyro.dna.pence / int32(12)) % int32(20))
+			+ '.' + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12));
+	if (_vm->_gyro.dna.pence > 12)  x = x + " (that's " + _vm->_gyro.strf(_vm->_gyro.dna.pence) + "d)";
+	lsd_result = x;
+	return lsd_result;
+}
+
+
+
+
+void Scrolls::strip(Common::String &q) {
+	warning("STUB: Scrolls::strip()");
+}
+
+void Scrolls::solidify(byte n) {
+	warning("STUB: Scrolls::solidify()");
+}
+
+void Scrolls::calldrivers() {
+	warning("STUB: Scrolls::calldrivers()");
+}
+
+void Scrolls::display(Common::String z) {
+	_vm->_gyro.bufsize = z.size();
+	memcpy(_vm->_gyro.buffer, z.c_str() + 1, _vm->_gyro.bufsize);
+	calldrivers();
+}
+
+void Scrolls::loadfont() {
+	warning("STUB: Scrolls::loadfont()");
+}
+
+void Scrolls::okay() {
+	display("Okay!");
+}
+
+void Scrolls::musical_scroll() {
+	bool was_virtual;
 
-	byte last_one, this_one;
+	display(Common::String("To play the harp...\r\rUse these keys:\r\n") +
+	        "Q W E R T Y U I O P [ ]\r\rOr press Enter to stop playing.\4");
 
-	tunetype played;
+	_vm->_lucerna.sprite_run();
 
+	was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual;
 
-	state(3);
-	_vm->_gyro.seescroll = true;
-	_vm->_gyro.on();
-	_vm->_gyro.newpointer(4);
-	//do {
-	//	do {
-	//		Gyro::check(); /* was "checkclick;" */
-	//		if (Enhanced::keypressede())
-	//			break;
-	//	} while (!(Gyro::mpress > 0) || buttona1() || buttonb1());
-	//
-	// Needs joystick - not sure it will be implemented.
+	if (was_virtual)
+		_vm->_gyro.off_virtual();
 
-	//	if (Gyro::mpress == 0)
-	//		inkey(); Needs Lucerna to proceed.
-	//}
+	drawscroll(&Avalanche::Scrolls::music_scroll);
 
+	if (was_virtual)
+		_vm->_gyro.on_virtual();
+	resetscroll();
 }
 
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index fa52a55..530c06f 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -33,6 +33,10 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+class Scrolls;
+
+typedef void (Scrolls::*func2)();
+
 class Scrolls {
 public:
 	bool aboutscroll; /* Is this the about box? */
@@ -45,9 +49,9 @@ public:
 
 	void state(byte x);      /* Sets "Ready" light to whatever */
 
-	void drawscroll(proc gotoit);      /* This is one of the oldest procs in the game. */
+	void drawscroll(func2 gotoit);      /* This is one of the oldest funcs in the game. */
 
-	void bubble(proc gotoit);
+	void bubble(func2 gotoit);
 
 	void resetscroll();
 
@@ -96,7 +100,23 @@ private:
 
 	void music_scroll();
 
+	void resetscrolldriver();
+
+	void dingdongbell();
+
+	void dodgem();
+
+	void undodgem();
+
+	void geticon(int16 x, int16 y, byte which);
+
+	void block_drop(Common::String fn, int16 xl, int16 yl, int16 y);
+
+	void strip(Common::String &q);
+
+	void solidify(byte n);
 
+	void loadfont();
 };
 
 } // End of namespace Avalanche


Commit: 7526af940cbf338c05a40875571da75b762eb956
    https://github.com/scummvm/scummvm/commit/7526af940cbf338c05a40875571da75b762eb956
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-01T16:32:30-07:00

Commit Message:
AVALANCHE: Scrolls: Repair compilation.

Changed paths:
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 530c06f..f946b8f 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -72,10 +72,10 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	static const int16 roman;
-	static const int16 italic;
+	static const int16 roman = 0;
+	static const int16 italic = 1;
 
-	static const int16 halficonwidth; /* Half the width of an icon. */
+	static const int16 halficonwidth = 19; /* Half the width of an icon. */
 
 	int16 dix, diy;
 	raw ch[2];


Commit: 76423aa712006363ef02be0cddd592e9cba4f710
    https://github.com/scummvm/scummvm/commit/76423aa712006363ef02be0cddd592e9cba4f710
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T04:20:23-07:00

Commit Message:
AVALANCHE: Add Closing.

Changed paths:
  A engines/avalanche/closing2.cpp
  A engines/avalanche/closing2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index eade42b..a55ab3e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -63,6 +63,7 @@ namespace Avalanche {
 		_acci.setParent(this); _acci.init();
 		_basher.setParent(this);
 		_dropdown.setParent(this);
+		_closing.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 46ceeba..51081a0 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -46,6 +46,7 @@
 #include "avalanche/acci2.h"
 #include "avalanche/basher2.h"
 #include "avalanche/dropdown2.h"
+#include "avalanche/closing2.h"
 
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
@@ -78,6 +79,7 @@ public:
 	Acci _acci;
 	Basher _basher;
 	Dropdown _dropdown;
+	Closing _closing;
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
diff --git a/engines/avalanche/closing2.cpp b/engines/avalanche/closing2.cpp
new file mode 100644
index 0000000..3336a5f
--- /dev/null
+++ b/engines/avalanche/closing2.cpp
@@ -0,0 +1,91 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CLOSING		The closing screen and error handler. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/closing2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/lucerna2.h"
+
+#include "common/textconsole.h"
+#include "common/random.h"
+
+namespace Avalanche {
+
+Closing::Closing() {
+	warning("STUB: Closing::Closing()");
+}
+
+void Closing::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Closing::get_screen(byte which) {
+	warning("STUB: Closing::get_screen()");
+}
+
+void Closing::show_screen() {
+	warning("STUB: Closing::show_screen()");
+}
+
+void Closing::quit_with(byte which, byte errorlev) {
+	warning("STUB: Closing::quit_with()");
+}
+
+void Closing::put_in(Common::String x, uint16 where) {
+	warning("STUB: Closing::put_in()");
+}
+
+void Closing::end_of_program() {
+	const Common::String nouns[12] = {
+		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
+		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
+	};
+
+	const Common::String verbs[12] = {
+		"haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
+		"ignore", "stare at", "shriek at", "frighten", "quieten"
+	};
+
+	Common::String result;
+
+	//nosound;
+	warning("STUB: Closing::end_of_program()");
+
+	get_screen(scr_nagscreen);
+	result = nouns[_vm->_rnd->getRandomNumber(12)] + " will " + verbs[_vm->_rnd->getRandomNumber(12)] + " you";
+	put_in(result, 1628);
+	show_screen(); /* No halt- it's already set up. */
+}
+
+void Closing::bug_handler() {
+	warning("STUB: Closing::bug_handler()");
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
new file mode 100644
index 0000000..122a8e2
--- /dev/null
+++ b/engines/avalanche/closing2.h
@@ -0,0 +1,74 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CLOSING		The closing screen and error handler. */
+
+#ifndef CLOSING2_H
+#define CLOSING2_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Closing {
+public:
+	static const int16 scr_bugalert = 1;
+	static const int16 scr_ramcram = 2;
+	static const int16 scr_nagscreen = 3;
+	static const int16 scr_twocopies = 5;
+
+	Closing();
+
+	void setParent(AvalancheEngine *vm);
+
+	void quit_with(byte which, byte errorlev);
+
+	void end_of_program();
+
+private:
+	AvalancheEngine *_vm;
+
+	typedef Common::String scrtype;
+
+	scrtype q /*absolute $B8FA:0*/; /* Nobody's using the graphics memory now. */
+	//file<scrtype> f;
+	void *exitsave;
+
+	void get_screen(byte which);
+
+	void show_screen();
+
+	void put_in(Common::String x, uint16 where);
+
+	void bug_handler();
+};
+
+} // End of namespace Avalanche.
+
+#endif // CLOSING2_H


Commit: e4e3574b9178aefaf05744810a401bcfc7e9f9e9
    https://github.com/scummvm/scummvm/commit/e4e3574b9178aefaf05744810a401bcfc7e9f9e9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T04:21:41-07:00

Commit Message:
AVALANCHE: Finish stubbing of Avalot.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 11186d0..34b69bf 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -25,36 +25,152 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#include "common/str.h"
-#include "common/textconsole.h"
-
 #include "avalanche/avalanche.h"
+
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
+#include "avalanche/trip6.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/basher2.h"
+#include "avalanche/dropdown2.h"
+#include "avalanche/pingo2.h"
+#include "avalanche/logger2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/enid2.h"
+#include "avalanche/visa2.h"
+
+/*#include "Incline.h"*/
+/*#include "Closing.h"*/
+
+#include "common/str.h"
+#include "common/textconsole.h"
 
 namespace Avalanche {
 
-	Avalot::Avalot() {
-		int16 gd, gm;
+Avalot::Avalot() {
+	int16 gd, gm;
 
-		checkbreak = false;
-		_vm->_gyro.visible = _vm->_gyro.m_no;
-		_vm->_gyro.to_do = 0;
-		_vm->_gyro.lmo = false;
-		// resetscroll(); Needs scrolls "unit" to make it work.
+	checkbreak = false;
+	_vm->_gyro.visible = _vm->_gyro.m_no;
+	_vm->_gyro.to_do = 0;
+	_vm->_gyro.lmo = false;
+	_vm->_scrolls.resetscroll();
+	_vm->_gyro.setup_vmc();
+	_vm->_gyro.on_virtual();
+	gd = 3;
+	gm = 0;
+	//initgraph(gd, gm, "");
+	_vm->_gyro.holdthedawn = true;
+	_vm->_lucerna.dusk();
+	_vm->_gyro.cmp = 177;
+	_vm->_lucerna.mouse_init();  /*on;*/
+	_vm->_gyro.dropsok = true;
+	_vm->_gyro.ctrl = ckey;
+	_vm->_gyro.oldjw = 177;
+	_vm->_gyro.mousetext = "";
+	_vm->_gyro.c = 999;
+	//settextjustify(0, 0);
+	_vm->_gyro.ddmnow = false;
+	_vm->_lucerna.load_digits();
+	_vm->_gyro.cheat = false;
+	_vm->_gyro.cp = 0;
+	_vm->_gyro.curpos = 1;
+	_vm->_gyro.quote = true;
+	_vm->_gyro.ledstatus = 177;
+	_vm->_gyro.defaultled = 2;
+	/* TSkellern:=0; { Replace with a more local variable sometime }*/
+	_vm->_gyro.dna.rw = _vm->_gyro.stopped;
+	_vm->_gyro.enid_filename = ""; /* undefined. */
+	_vm->_lucerna.toolbar();
+	_vm->_scrolls.state(2);
+	_vm->_pingo.copy03();
+	_vm->_gyro.lastscore = "TJA";
 
-		warning("STUB: Avalot::Avalot()");
+	/* for gd:=0 to 1 do
+	 begin
+	  setactivepage(gd); outtextxy(7,177,chr(48+gd));
+	 end;*/
 
+	_vm->_trip.loadtrip();
 
+	if ((_vm->_gyro.filetoload == "") && (! _vm->_gyro.reloaded))
+		_vm->_gyro.newgame(); /* no game was requested- load the default */
+	else {
+		if (! _vm->_gyro.reloaded)
+			_vm->_enid.avvy_background();
+		_vm->_dropdown.standard_bar();
+		_vm->_lucerna.sprite_run();
+		if (_vm->_gyro.reloaded)
+			_vm->_enid.edna_reload();
+		else {
+			/* Filename given on the command line (or loadfirst) */
+			_vm->_enid.edna_load(_vm->_gyro.filetoload);
+			if (_vm->_enid.there_was_a_problem()) {
+				_vm->_scrolls.display("So let's start from the beginning instead...");
+				_vm->_gyro.holdthedawn = true;
+				_vm->_lucerna.dusk();
+				_vm->_gyro.newgame();
+			}
+		}
 	}
 
-	void Avalot::setParent(AvalancheEngine *vm) {
-		_vm = vm;
+	if (! _vm->_gyro.reloaded) {
+		_vm->_gyro.soundfx = ! _vm->_gyro.soundfx;
+		_vm->_lucerna.fxtoggle();
+		_vm->_lucerna.thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing);
 	}
 
+	_vm->_trip.get_back_loretta();
+	//gm = getpixel(0, 0);
+	//setcolor(7);
+	_vm->_gyro.holdthedawn = false;
+	_vm->_lucerna.dawn();
+	_vm->_gyro.cursoron = false;
+	_vm->_basher.cursor_on();
+	_vm->_trip.newspeed();
 
-	void Avalot::run(Common::String arg) {
-		warning("STUB: Avalot::run(%s)", arg.c_str());
-	}
+	if (! _vm->_gyro.reloaded)
+		_vm->_visa.dixi('q', 83); /* Info on the game, etc. */
+}
+
+void Avalot::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+
+void Avalot::run(Common::String arg) {
+	warning("STUB: Avalot::run(%s)", arg.c_str());
+
+	do {
+		_vm->_lucerna.clock_lucerna();
+		_vm->_basher.keyboard_link();
+		_vm->_dropdown.menu_link();
+		_vm->_trip.readstick();
+		_vm->_gyro.force_numlock();
+		_vm->_trip.get_back_loretta();
+		_vm->_trip.trippancy_link();
+		_vm->_celer.pics_link();
+		_vm->_lucerna.checkclick();
+
+		if (_vm->_gyro.visible == _vm->_gyro.m_virtual)
+			_vm->_gyro.plot_vmc(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.cp);
+		_vm->_lucerna.flip_page(); /* <<<! */
+		_vm->_gyro.slowdown();
+		if (_vm->_gyro.visible == _vm->_gyro.m_virtual) 
+			_vm->_gyro.wipe_vmc(_vm->_gyro.cp);
+
+		_vm->_timeout.one_tick();
+
+	} while (! _vm->_gyro.lmo);
+
+	//restorecrtmode();
+	//if (logging)
+	//	close(logfile);
+
+	_vm->_closing.end_of_program();
+}
 
 } // End of namespace Avalanche


Commit: ef1f254b030010a2ba5c70d3f6648189b9dad164
    https://github.com/scummvm/scummvm/commit/ef1f254b030010a2ba5c70d3f6648189b9dad164
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T04:22:23-07:00

Commit Message:
AVALANCHE: Finish stubbing Avalot vol. 2.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 34b69bf..b4214c2 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -142,8 +142,6 @@ void Avalot::setParent(AvalancheEngine *vm) {
 
 
 void Avalot::run(Common::String arg) {
-	warning("STUB: Avalot::run(%s)", arg.c_str());
-
 	do {
 		_vm->_lucerna.clock_lucerna();
 		_vm->_basher.keyboard_link();


Commit: ae1f189370883a6fdda01876b7679f2758b84e63
    https://github.com/scummvm/scummvm/commit/ae1f189370883a6fdda01876b7679f2758b84e63
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T06:10:16-07:00

Commit Message:
AVALANCHE: Change constructor of Scrolls, repair string handling in Lucerna and Scrolls.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a55ab3e..6c559d8 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -47,12 +47,11 @@ namespace Avalanche {
 		_console = new AvalancheConsole(this);
 		_rnd = 0;
 
-		_avalot.setParent(this);
 		_gyro.setParent(this);
 		_enhanced.setParent(this);
 		_logger.setParent(this);
 		_pingo.setParent(this);
-		_scrolls.setParent(this);
+		_scrolls.setParent(this); _scrolls.init();
 		_visa.setParent(this);
 		_lucerna.setParent(this); _lucerna.init();
 		_enid.setParent(this);
@@ -64,6 +63,7 @@ namespace Avalanche {
 		_basher.setParent(this);
 		_dropdown.setParent(this);
 		_closing.setParent(this);
+		_avalot.setParent(this); _avalot.init();
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
@@ -229,8 +229,7 @@ namespace Avalanche {
 	void AvalancheEngine::run_avalot() {
 		bflight_on();
 
-		Avalot ava;
-		ava.run(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
+		_avalot.run(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
 		// If there's an error initalizing avalot, i'll handle it in there, not here
 		first_time = false;
 	}
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index b4214c2..5172e30 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -50,7 +50,7 @@
 
 namespace Avalanche {
 
-Avalot::Avalot() {
+void Avalot::init() {
 	int16 gd, gm;
 
 	checkbreak = false;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 4c428b6..5881108 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -35,10 +35,10 @@ class AvalancheEngine;
 
 class Avalot {
 public:
-	Avalot();
-
 	void setParent(AvalancheEngine *vm);
 
+	void init();
+
 	void run(Common::String arg);
 
 private:
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d343923..48ccd3a 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -100,8 +100,7 @@ Common::String Lucerna::nextstring() {
 }
 
 void Lucerna::scram1(Common::String &x) {
-	byte fz;
-	for (fz = 1; fz <= x.size(); fz ++)
+	for (int fz = 0; fz < x.size(); fz ++)
 		x.setChar(x[fz] ^ 177, fz);
 }
 
@@ -637,9 +636,9 @@ void Lucerna::inkey() {
 			_vm->_enhanced.extd = '#'; /* alt-spacebar = alt-H */
 		}
 	} else {
-		if (_vm->_gyro.mousetext[1] == '`')
-			_vm->_gyro.mousetext.setChar(13,1); /* Backquote = return in a macro */
-		_vm->_enhanced.inchar = _vm->_gyro.mousetext[1];
+		if (_vm->_gyro.mousetext[0] == '`')
+			_vm->_gyro.mousetext.setChar(13,0); /* Backquote = return in a macro */
+		_vm->_enhanced.inchar = _vm->_gyro.mousetext[0];
 		_vm->_gyro.mousetext = Common::String(_vm->_gyro.mousetext.c_str() + 2, 253);
 	}
 }
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index a9c94b5..cefb4a2 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -44,16 +44,15 @@
 
 namespace Avalanche {
 
-Scrolls::Scrolls() {
-	loadfont();
-	resetscrolldriver();
-
-}
-
 void Scrolls::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+void Scrolls::init() {
+	loadfont();
+	resetscrolldriver();
+}
+
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	warning("STUB: Scrolls::state()");
 }
@@ -156,7 +155,7 @@ bool Scrolls::ask(Common::String question) {
 void Scrolls::resetscroll() {
 	_vm->_gyro.scrolln = 1;
 	for (int j = 0; j < 15; j ++)
-		for (int i = 0; i < sizeof(_vm->_gyro.scroll); i++)
+		for (int i = 0; i < _vm->_gyro.scroll[j].size(); i++)
 			_vm->_gyro.scroll[j].setChar(0, i);
 }
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index f946b8f..e343309 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -43,7 +43,7 @@ public:
 
 
 
-	Scrolls();
+	void init();
 
 	void setParent(AvalancheEngine *vm);
 


Commit: e27948a1a5df08cf698917b0eb50b6b292d2b60a
    https://github.com/scummvm/scummvm/commit/e27948a1a5df08cf698917b0eb50b6b292d2b60a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T06:59:27-07:00

Commit Message:
AVALANCHE: Minor repair in Trip, move initialization of the engine into the constructor.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6c559d8..dec0535 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -45,7 +45,9 @@ namespace Avalanche {
 	AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
 		_system = syst;
 		_console = new AvalancheConsole(this);
-		_rnd = 0;
+
+		_rnd = new Common::RandomSource("avalanche");
+		_rnd->setSeed(42);     
 
 		_gyro.setParent(this);
 		_enhanced.setParent(this);
@@ -97,12 +99,11 @@ namespace Avalanche {
 		//	_sound->syncVolume();
 	}
 
-	void AvalancheEngine::initialize() {
-		//debugC(1, kDebugEngine, "initialize");
+	
+
+
+
 
-		_rnd = new Common::RandomSource("avalanche");
-		_rnd->setSeed(42);                              // Kick random number generator
-	}
 
 
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 51081a0..592df70 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -114,7 +114,8 @@ private:
 	AvalancheConsole *_console;
 	Common::Platform _platform;
 
-	void initialize();
+	
+
 
 	// From bootstrp:
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 151e93f..d41fa10 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -319,7 +319,8 @@ void Trip::loadtrip() {
 	for (gm = 1; gm <= numtr; gm++)
 		tr[gm].original();
 	// CHECKME: A 'i++' is missing somewhere, obviously!
-	for (int i = 0; i < sizeof(aa); aa[i] = 0);
+	for (int i = 0; i < sizeof(aa); i++)
+		aa[i] = 0;
 }
 
 byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {


Commit: f47bc39f64166a21d9cf592a680403bb62030273
    https://github.com/scummvm/scummvm/commit/f47bc39f64166a21d9cf592a680403bb62030273
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-02T07:46:56-07:00

Commit Message:
AVALANCHE: Update the description of classes.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5172e30..e2ba3a4 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* AVALOT		The kernel of the program. */
+
 #include "avalanche/avalanche.h"
 
 #include "avalanche/avalot.h"
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 5881108..23463d5 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+/* AVALOT		The kernel of the program. */
+
 #ifndef AVALOT_H
 #define AVALOT_H
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index cefb4a2..4bb4f9d 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+ /* SCROLLS		The scroll driver. */
+
 #include "avalanche/avalanche.h"
 
 #include "avalanche/scrolls2.h"
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index e343309..2536e66 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+ /* SCROLLS		The scroll driver. */
+
 #ifndef SCROLLS2_H
 #define SCROLLS2_H
 


Commit: 8d03232cf85068f1ceb40940f92644fa6441310a
    https://github.com/scummvm/scummvm/commit/8d03232cf85068f1ceb40940f92644fa6441310a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-03T05:05:06-07:00

Commit Message:
AVALANCHE: Minor repair.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c86660e..5af1670 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -525,9 +525,7 @@ void Gyro::super_on() {
 }
 
 bool Gyro::mouse_near_text() {
-	bool mouse_near_text_result;
-	mouse_near_text_result = (my > 144) && (my < 188);
-	return mouse_near_text_result;
+	return (my > 144) && (my < 188);
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d41fa10..7fe643c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -84,21 +84,14 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 bool triptype::collision_check() {
 	byte fv;
 
-	bool collision_check_result = false;
-	for (fv = 1; fv <= _tr->numtr; fv++) {
+	for (fv = 1; fv <= _tr->numtr; fv++) 
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + a.xl) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
-			(_tr->tr[fv].y == y)) {
-			collision_check_result = true;
-			break;
-		}
-		// CHECKME: Only checks the first element of the for() statement.
-		// Both lines should certainly be removed
-		collision_check_result = false;
-		return collision_check_result;
-	}
-	return collision_check_result;
+			(_tr->tr[fv].y == y)) 
+				return true;
+
+	return false;
 }
 
 void triptype::walk() {
@@ -318,7 +311,7 @@ void Trip::loadtrip() {
 
 	for (gm = 1; gm <= numtr; gm++)
 		tr[gm].original();
-	// CHECKME: A 'i++' is missing somewhere, obviously!
+	
 	for (int i = 0; i < sizeof(aa); i++)
 		aa[i] = 0;
 }


Commit: 590f89e90e547076f27c25dfb2c1058f7f95bbbf
    https://github.com/scummvm/scummvm/commit/590f89e90e547076f27c25dfb2c1058f7f95bbbf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-03T08:06:36-07:00

Commit Message:
AVALANCHE: Celer: Implement file handling.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index c02a82f..6bacde7 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -268,8 +268,55 @@ void Celer::pics_link() {
 	}
 }
 
-void Celer::load_chunks(Common::String xx) {
-	warning("STUB: Celer::load_chunks()");
+void Celer::load_chunks(char *xx) {
+	chunkblocktype ch;
+	byte fv;
+	
+	Common::String filename;
+	filename = filename.format("chunk%s.avd", xx);
+	if (!f.open(filename)) {
+		warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
+		return;
+	}
+
+	f.seek(44);
+	num_chunks = f.readByte();
+	for (int i = 0; i < num_chunks; i++)
+		offsets[i] = f.readSint32LE();
+
+	for (fv = 0; fv < num_chunks; fv++) {
+		f.seek(offsets[fv]);
+		
+		ch.flavour = flavourtype(f.readByte());
+		ch.x = f.readSint16LE();
+		ch.y = f.readSint16LE();
+		ch.xl = f.readSint16LE();
+		ch.yl = f.readSint16LE();
+		ch.size = f.readSint32LE();
+		ch.natural = f.readByte();
+		ch.memorise = f.readByte();
+				
+		if (ch.memorise) {
+
+			memos[fv].x = ch.x;
+			memos[fv].xl = ch.xl;
+			memos[fv].y = ch.y;
+			memos[fv].yl = ch.yl;
+			memos[fv].flavour = ch.flavour;
+			memos[fv].size = ch.size;
+
+			memory[fv] = malloc(ch.size); // Celer::forget_chunks() deallocates it.
+
+			/*if (ch.natural) {
+			getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
+			} else
+			blockread(f, memory[fv], ch.size);*/
+		} else
+			memos[fv].x = on_disk;
+		
+	}
+
+	f.close();
 }
 
 void Celer::forget_chunks() {
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index e71dec5..aa32bf5 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -31,6 +31,7 @@
 #define CELER2_H
 
 #include "common/scummsys.h"
+#include "common/file.h"
 #include "common/str.h"
 
 namespace Avalanche {
@@ -38,7 +39,7 @@ class AvalancheEngine;
 
 class Celer {
 public:
-	enum flavourtype {ch_ega, ch_bgi, last_flavourtype};
+	enum flavourtype {ch_ega, ch_bgi};
 
 	struct chunkblocktype {
 		flavourtype flavour;
@@ -62,6 +63,9 @@ public:
 	memotype memos[40];
 	void *memory[40];
 
+	Common::File f;
+
+
 
 	Celer();
 
@@ -69,7 +73,7 @@ public:
 
 	void pics_link();
 
-	void load_chunks(Common::String xx);
+	void load_chunks(char *xx);
 
 	void forget_chunks();
 


Commit: 490e66e239bc4128250ad089611bb213ad87ccf2
    https://github.com/scummvm/scummvm/commit/490e66e239bc4128250ad089611bb213ad87ccf2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-03T08:09:19-07:00

Commit Message:
AVALANCHE: Gyro: Implement file handling.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 5af1670..04a1d14 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -38,6 +38,7 @@
 #include "avalanche/trip6.h"
 
 #include "common/textconsole.h"
+#include "common/file.h"
 
 //#include "dropdown.h"
 //#include "basher.h"
@@ -248,6 +249,18 @@ Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
 		whereis[i] = static_const_whereis[i];
 }
 
+Gyro::~Gyro() {
+	/* These are allocated in Gyro::setup_vmc */
+
+	free(vmc.andpic);
+	free(vmc.xorpic);
+
+	for (int fv = 0; fv < 2; fv ++) {
+		free(vmc.backpic[fv]);
+	}
+
+}
+
 void Gyro::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
@@ -467,7 +480,13 @@ void Gyro::wipe_vmc(byte page_) {
 }
 
 void Gyro::setup_vmc() {
-	warning("STUB: Gyro::setup_vmc()");
+	vmc.andpic = malloc(mouse_size);
+	vmc.xorpic = malloc(mouse_size);
+
+	for (int fv = 0; fv < 2; fv ++) {
+		vmc.backpic[fv] = malloc(mouse_size);
+		vmc.wherewas[fv].x = 32767;
+	}
 }
 
 void Gyro::clear_vmc() {
@@ -483,7 +502,28 @@ void Gyro::setminmaxvertcurspos(uint16 min, uint16 max) {
 }
 
 void Gyro::load_a_mouse(byte which) {
-	warning("STUB: Gyro::load_a_mouse()");
+	Common::File f;
+
+	if (!f.open("mice.avd")) {
+		warning("AVALANCHE: Gyro: File not found: mice.avd");
+		return;
+	}
+
+	f.seek(mouse_size * 2 * (which - 1) + 134);
+
+	for (int i = 0; i < mouse_size; i++)
+		((byte *) vmc.andpic)[i] = f.readByte();
+	
+	for (int i = 0; i < mouse_size; i++)
+		((byte *) vmc.xorpic)[i] = f.readByte();
+	
+	f.close();
+	
+	vmc.ofsx = -mps[which].horzhotspot;
+	vmc.ofsy = -mps[which].verthotspot;
+
+	setminmaxhorzcurspos(mps[which].horzhotspot, 624 + mps[which].horzhotspot);
+	setminmaxvertcurspos(mps[which].verthotspot, 199);
 }
 
 void Gyro::background(byte x) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 4246350..719d048 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -224,10 +224,15 @@ struct quasiped_type {
 
 typedef byte tunetype[31];
 
+
+struct PointType {
+	int16 x, y;
+};
+
 struct vmctype { /* Virtual Mouse Cursor */
 	void *andpic, *xorpic;
 	void *backpic[2];
-	void* wherewas[2];
+	PointType wherewas[2];
 	byte picnumber;
 	int8 ofsx, ofsy;
 };
@@ -607,6 +612,8 @@ public:
 
 	Gyro();
 
+	~Gyro();
+
 	void setParent(AvalancheEngine *vm);
 
 	void newpointer(byte m);


Commit: d66e89c888b53b8d4424480825db82e855bd93de
    https://github.com/scummvm/scummvm/commit/d66e89c888b53b8d4424480825db82e855bd93de
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T02:23:20-07:00

Commit Message:
AVALANCHE: Update module.mk.

Changed paths:
    engines/avalanche/module.mk



diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 5f65d01..ff5bc61 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -5,7 +5,22 @@ MODULE_OBJS = \
 	avalot.o \
 	console.o \
 	detection.o \
-	gyro2.o
+	gyro2.o \
+	enhanced2.o \
+	logger2.o \
+	pingo2.o \
+	scrolls2.o \
+	visa2.o \
+	lucerna2.o \
+	enid2.o \
+	celer2.o \
+	sequence2.o \
+	timeout2.o \
+	trip6.o \
+	acci2.o \
+	basher2.o \
+	dropdown2.o \
+	closing2.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)


Commit: 218c7c3ffb939d9e23b9670dd57a4c71b2385308
    https://github.com/scummvm/scummvm/commit/218c7c3ffb939d9e23b9670dd57a4c71b2385308
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T02:41:42-07:00

Commit Message:
AVALANCHE: Gyro: change void* to byte*, make memory handling more C++-like.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 04a1d14..078eb1c 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -252,11 +252,11 @@ Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
 Gyro::~Gyro() {
 	/* These are allocated in Gyro::setup_vmc */
 
-	free(vmc.andpic);
-	free(vmc.xorpic);
+	delete[] vmc.andpic;
+	delete[] vmc.xorpic;
 
 	for (int fv = 0; fv < 2; fv ++) {
-		free(vmc.backpic[fv]);
+		delete[] vmc.backpic[fv];
 	}
 
 }
@@ -480,11 +480,11 @@ void Gyro::wipe_vmc(byte page_) {
 }
 
 void Gyro::setup_vmc() {
-	vmc.andpic = malloc(mouse_size);
-	vmc.xorpic = malloc(mouse_size);
+	vmc.andpic = new byte[mouse_size];
+	vmc.xorpic = new byte[mouse_size];
 
 	for (int fv = 0; fv < 2; fv ++) {
-		vmc.backpic[fv] = malloc(mouse_size);
+		vmc.backpic[fv] = new byte[mouse_size];
 		vmc.wherewas[fv].x = 32767;
 	}
 }
@@ -512,10 +512,10 @@ void Gyro::load_a_mouse(byte which) {
 	f.seek(mouse_size * 2 * (which - 1) + 134);
 
 	for (int i = 0; i < mouse_size; i++)
-		((byte *) vmc.andpic)[i] = f.readByte();
+		vmc.andpic[i] = f.readByte();
 	
 	for (int i = 0; i < mouse_size; i++)
-		((byte *) vmc.xorpic)[i] = f.readByte();
+		vmc.xorpic[i] = f.readByte();
 	
 	f.close();
 	
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 719d048..4aab223 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -230,8 +230,8 @@ struct PointType {
 };
 
 struct vmctype { /* Virtual Mouse Cursor */
-	void *andpic, *xorpic;
-	void *backpic[2];
+	byte *andpic, *xorpic;
+	byte *backpic[2];
 	PointType wherewas[2];
 	byte picnumber;
 	int8 ofsx, ofsy;


Commit: 78befcb24aec615b9124b43178afd7e2fb0df5d6
    https://github.com/scummvm/scummvm/commit/78befcb24aec615b9124b43178afd7e2fb0df5d6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T09:26:18-07:00

Commit Message:
AVALANCHE: Lucerna: implement load_also().

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 48ccd3a..dbbcde1 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -90,13 +90,11 @@ void Lucerna::draw_also_lines() {
 
 
 Common::String Lucerna::nextstring() {
-	byte l;
-	Common::String x;
-
-	
-	warning("STUB: Lucerna::nextstring()");
-
-	return "STUB: Lucerna::nextstring()";
+	Common::String str;
+	byte length = f.readByte();
+	for (int i = 0; i < length; i++)
+		str += f.readByte();
+	return str;
 }
 
 void Lucerna::scram1(Common::String &x) {
@@ -105,10 +103,8 @@ void Lucerna::scram1(Common::String &x) {
 }
 
 void Lucerna::unscramble() {
-	byte fv, ff;
-
-	for (fv = 0; fv <= 30; fv ++)
-		for (ff = 0; ff <= 1; ff ++)
+	for (byte fv = 0; fv <= 30; fv ++)
+		for (byte ff = 0; ff <= 1; ff ++)
 			if (_vm->_gyro.also[fv][ff] != 0)
 				scram1(*_vm->_gyro.also[fv][ff]);
 	scram1(_vm->_gyro.listen);
@@ -117,19 +113,93 @@ void Lucerna::unscramble() {
 	      _vm->_gyro.also[fv,ff]^[fz]:=chr(ord(_vm->_gyro.also[fv,ff]^[fz]) xor 177);*/
 }
 
-void Lucerna::load_also(Common::String n) {
-	byte minnames;
+void Lucerna::load_also(char *n) {
 	byte ff, fv;
-
-
-	for (fv = 0; fv <= 30; fv ++)
-		for (ff = 0; ff <= 1; ff ++)
+	
+	for (fv = 0; fv < 31; fv++)
+		for (ff = 0; ff < 2; ff++)
 			if (_vm->_gyro.also[fv][ff] != 0)  {
 				delete _vm->_gyro.also[fv][ff];
 				_vm->_gyro.also[fv][ff] = 0;
 			}
 
+	Common::String filename;
+	filename = filename.format("also%s.avd", n);
+	if (!f.open(filename)) {
+		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+		return;
+	}
+
+	f.seek(128);
+
+	byte minnames = f.readByte();
+	for (fv = 0; fv <= minnames; fv++) {
+		for (ff = 0; ff < 2; ff++) {
+			_vm->_gyro.also[fv][ff] = new Common::String;
+			*_vm->_gyro.also[fv][ff] = nextstring();
+		}
+		*_vm->_gyro.also[fv][0] = Common::String(157) + *_vm->_gyro.also[fv][0] + 157;
+	}
+	
+	memset(_vm->_gyro.lines, 0xFF, sizeof(_vm->_gyro.lines));
+
+	//fv = getpixel(0, 0);
+	warning("STUB: Lucerna::load_also()");
+		
+	fv = f.readByte();
+	for (byte i = 0; i < fv; i++) {
+		_vm->_gyro.lines[i].col = f.readByte();
+		_vm->_gyro.lines[i].x1 = f.readSint16LE();
+		_vm->_gyro.lines[i].x2 = f.readSint16LE();
+		_vm->_gyro.lines[i].y1 = f.readSint16LE();
+		_vm->_gyro.lines[i].y2 = f.readSint16LE();
+	}
+
+	memset(_vm->_gyro.peds, 177, sizeof(_vm->_gyro.peds));
+	fv = f.readByte();
+	for (byte i = 0; i < fv; i++) {
+		_vm->_gyro.peds[i].dir = f.readByte();
+		_vm->_gyro.peds[i].x = f.readSint16LE();
+		_vm->_gyro.peds[i].y = f.readSint16LE();
+	}
+	
+	_vm->_gyro.numfields = f.readByte();
+	for (byte i = 0; i < _vm->_gyro.numfields; i++) {
+		_vm->_gyro.fields[i].x1 = f.readSint16LE();
+		_vm->_gyro.fields[i].x2 = f.readSint16LE();
+		_vm->_gyro.fields[i].y1 = f.readSint16LE();
+		_vm->_gyro.fields[i].y2 = f.readSint16LE();
+	}
+
+	for (byte i = 0; i < 15; i++) {
+		_vm->_gyro.magics[i].data = f.readUint16LE();
+		_vm->_gyro.magics[i].op = f.readByte();
+	}
+
+	for (byte i = 0; i < 7; i++) {
+		_vm->_gyro.portals[i].data = f.readUint16LE();
+		_vm->_gyro.portals[i].op = f.readByte();
+	}
+
+	for (byte i = 0;  i < 26; i++)
+		_vm->_gyro.flags += f.readByte();
+
+	int16 listen_length;
+	listen_length = f.readByte();
+	_vm->_gyro.listen.clear();
+	for (byte i = 0; i < listen_length; i++)
+		_vm->_gyro.listen.setChar(f.readByte(), i);
+	
+	draw_also_lines();
+
+	//setactivepage(1);
 	warning("STUB: Lucerna::load_also()");
+
+	f.close();
+	unscramble();
+	for (fv = 0; fv <= minnames; fv++)
+		*_vm->_gyro.also[fv][0] = Common::String(',') + *_vm->_gyro.also[fv][0] + ',';
+	
 }
 
 void Lucerna::load(byte n) {     /* Load2, actually */
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 69888ac..c986877 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -31,6 +31,7 @@
 #define LUCERNA2_H
 
 #include "common/scummsys.h"
+#include "common/file.h"
 
 namespace Avalanche {
 class AvalancheEngine;
@@ -111,11 +112,11 @@ public:
 
 	void fix_flashers();
 
+	void load_also(char *n);
+
 private:
 	AvalancheEngine *_vm;
 
-	bool fxhidden;
-
 	struct rgbrec {
 		int16 red;
 		int16 green;
@@ -127,8 +128,6 @@ private:
 		rgbrec colors[256];
 	};
 
-	palettetype fxpal[4];
-
 	//Clock
 	static const int16 xm = 510;
 	static const int16 ym = 183;
@@ -136,11 +135,17 @@ private:
 	uint16 nh;
 
 
-	//untyped_file f;
+	palettetype fxpal[4];
+
+	bool fxhidden;
+
+	Common::File f;
+
+
 	Common::String nextstring();
 	void scram1(Common::String &x);
 	void unscramble();
-	void load_also(Common::String n);
+	//lódalszó
 
 	void zoomout(int16 x, int16 y);
 


Commit: d27a3e07f7250ea7d8ca6304095b882adc4f22b7
    https://github.com/scummvm/scummvm/commit/d27a3e07f7250ea7d8ca6304095b882adc4f22b7
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T09:27:59-07:00

Commit Message:
AVALANCHE: Gyro: expand initialization.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 078eb1c..2dd2a28 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -247,6 +247,11 @@ const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
 	for (int i = 0; i < 29; i++)
 		whereis[i] = static_const_whereis[i];
+
+	/* Needed becouse of Lucerna::load_also() */
+	for (int fv = 0; fv < 31; fv++)
+		for (int ff = 0; ff < 2; ff++)
+			also[fv][ff] = 0;
 }
 
 Gyro::~Gyro() {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 4aab223..e83e0a9 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -530,7 +530,7 @@ public:
 	byte cmp; /* current mouse-void **/
 	Common::String verbstr; /* what you can do with your object. :-) */
 
-	Common::String * also[31][2];
+	Common::String *also[31][2];
 	pedtype peds[15];
 	magictype magics[15];
 	magictype portals[7];


Commit: 7078b4de148dd895f50b1db66cb647ef43a51b85
    https://github.com/scummvm/scummvm/commit/7078b4de148dd895f50b1db66cb647ef43a51b85
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T09:29:04-07:00

Commit Message:
AVALANCHE: Avalot: repair initialization.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index dec0535..a510718 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -65,7 +65,7 @@ namespace Avalanche {
 		_basher.setParent(this);
 		_dropdown.setParent(this);
 		_closing.setParent(this);
-		_avalot.setParent(this); _avalot.init();
+		_avalot.setParent(this);
 	}
 
 	AvalancheEngine::~AvalancheEngine() {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e2ba3a4..e5b000f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -52,7 +52,7 @@
 
 namespace Avalanche {
 
-void Avalot::init() {
+void Avalot::setup() {
 	int16 gd, gm;
 
 	checkbreak = false;
@@ -144,6 +144,11 @@ void Avalot::setParent(AvalancheEngine *vm) {
 
 
 void Avalot::run(Common::String arg) {
+	setup();
+	
+	_vm->_lucerna.load_also("1");
+
+
 	do {
 		_vm->_lucerna.clock_lucerna();
 		_vm->_basher.keyboard_link();
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 23463d5..50bff72 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -39,7 +39,7 @@ class Avalot {
 public:
 	void setParent(AvalancheEngine *vm);
 
-	void init();
+	void setup();
 
 	void run(Common::String arg);
 


Commit: 430dcc037fa879f01e57526a814975914d252e8e
    https://github.com/scummvm/scummvm/commit/430dcc037fa879f01e57526a814975914d252e8e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-04T16:18:02-07:00

Commit Message:
AVALANCHE: Lucerna: Repair load_also().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e5b000f..67b543b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -146,7 +146,7 @@ void Avalot::setParent(AvalancheEngine *vm) {
 void Avalot::run(Common::String arg) {
 	setup();
 	
-	_vm->_lucerna.load_also("1");
+	_vm->_lucerna.load_also("9");
 
 
 	do {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index dbbcde1..68912c2 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -111,6 +111,7 @@ void Lucerna::unscramble() {
 	scram1(_vm->_gyro.flags);
 	/*     for fz:=1 to length(_vm->_gyro.also[fv,ff]^) do
 	      _vm->_gyro.also[fv,ff]^[fz]:=chr(ord(_vm->_gyro.also[fv,ff]^[fz]) xor 177);*/
+	warning("STUB: Lucerna::unscramble()");
 }
 
 void Lucerna::load_also(char *n) {
@@ -142,53 +143,50 @@ void Lucerna::load_also(char *n) {
 	}
 	
 	memset(_vm->_gyro.lines, 0xFF, sizeof(_vm->_gyro.lines));
-
-	//fv = getpixel(0, 0);
-	warning("STUB: Lucerna::load_also()");
-		
+	
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro.lines[i].col = f.readByte();
 		_vm->_gyro.lines[i].x1 = f.readSint16LE();
-		_vm->_gyro.lines[i].x2 = f.readSint16LE();
 		_vm->_gyro.lines[i].y1 = f.readSint16LE();
+		_vm->_gyro.lines[i].x2 = f.readSint16LE();
 		_vm->_gyro.lines[i].y2 = f.readSint16LE();
+		_vm->_gyro.lines[i].col = f.readByte();
 	}
 
 	memset(_vm->_gyro.peds, 177, sizeof(_vm->_gyro.peds));
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro.peds[i].dir = f.readByte();
 		_vm->_gyro.peds[i].x = f.readSint16LE();
 		_vm->_gyro.peds[i].y = f.readSint16LE();
+		_vm->_gyro.peds[i].dir = f.readByte();
 	}
 	
 	_vm->_gyro.numfields = f.readByte();
 	for (byte i = 0; i < _vm->_gyro.numfields; i++) {
 		_vm->_gyro.fields[i].x1 = f.readSint16LE();
-		_vm->_gyro.fields[i].x2 = f.readSint16LE();
 		_vm->_gyro.fields[i].y1 = f.readSint16LE();
+		_vm->_gyro.fields[i].x2 = f.readSint16LE();
 		_vm->_gyro.fields[i].y2 = f.readSint16LE();
 	}
 
 	for (byte i = 0; i < 15; i++) {
-		_vm->_gyro.magics[i].data = f.readUint16LE();
 		_vm->_gyro.magics[i].op = f.readByte();
+		_vm->_gyro.magics[i].data = f.readUint16LE();
 	}
 
 	for (byte i = 0; i < 7; i++) {
-		_vm->_gyro.portals[i].data = f.readUint16LE();
 		_vm->_gyro.portals[i].op = f.readByte();
+		_vm->_gyro.portals[i].data = f.readUint16LE();
 	}
 
+	_vm->_gyro.flags.clear();
 	for (byte i = 0;  i < 26; i++)
 		_vm->_gyro.flags += f.readByte();
 
-	int16 listen_length;
-	listen_length = f.readByte();
+	int16 listen_length = f.readByte();
 	_vm->_gyro.listen.clear();
 	for (byte i = 0; i < listen_length; i++)
-		_vm->_gyro.listen.setChar(f.readByte(), i);
+		_vm->_gyro.listen += f.readByte();
 	
 	draw_also_lines();
 


Commit: 9a6684b37c5efe2e0c96be8bdcead9a51ca30ded
    https://github.com/scummvm/scummvm/commit/9a6684b37c5efe2e0c96be8bdcead9a51ca30ded
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T02:32:49-07:00

Commit Message:
AVALANCHE:  Celer: implement load_chunks() further.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 6bacde7..a106ce5 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -281,7 +281,7 @@ void Celer::load_chunks(char *xx) {
 
 	f.seek(44);
 	num_chunks = f.readByte();
-	for (int i = 0; i < num_chunks; i++)
+	for (byte i = 0; i < num_chunks; i++)
 		offsets[i] = f.readSint32LE();
 
 	for (fv = 0; fv < num_chunks; fv++) {
@@ -305,22 +305,29 @@ void Celer::load_chunks(char *xx) {
 			memos[fv].flavour = ch.flavour;
 			memos[fv].size = ch.size;
 
-			memory[fv] = malloc(ch.size); // Celer::forget_chunks() deallocates it.
+			memory[fv] = new byte[ch.size]; // Celer::forget_chunks() deallocates it.
 
 			/*if (ch.natural) {
 			getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
 			} else
 			blockread(f, memory[fv], ch.size);*/
+			warning("STUB: Celer::load_chunks()");
+
+			if (!ch.natural)
+				for (int32 i = 0; i < ch.size; i++)
+					memory[fv][i] = f.readByte();
 		} else
 			memos[fv].x = on_disk;
-		
 	}
-
 	f.close();
 }
 
 void Celer::forget_chunks() {
-	warning("STUB: Celer::forget_chunks()");
+	for (byte fv = 0; fv < num_chunks; fv ++)
+		if (memos[fv].x > on_disk)
+			delete[] memory[fv];
+
+	memset(memos, 255, sizeof(memos)); /* x=-1, => on disk. */
 }
 
 void Celer::mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) { /* assembler;
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index aa32bf5..444a5aa 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -61,7 +61,7 @@ public:
 	int32 offsets[40];
 	byte num_chunks;
 	memotype memos[40];
-	void *memory[40];
+	byte *memory[40];
 
 	Common::File f;
 


Commit: 617898d42c996380d7f0253e9c7cf52cd50688ea
    https://github.com/scummvm/scummvm/commit/617898d42c996380d7f0253e9c7cf52cd50688ea
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T03:31:12-07:00

Commit Message:
AVALANCHE: Celer: implement show_one().

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index a106ce5..20413ff 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -272,7 +272,6 @@ void Celer::load_chunks(char *xx) {
 	chunkblocktype ch;
 	byte fv;
 	
-	Common::String filename;
 	filename = filename.format("chunk%s.avd", xx);
 	if (!f.open(filename)) {
 		warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
@@ -433,7 +432,49 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 }
 
 void Celer::show_one(byte which) {
+	chunkblocktype ch;
+	byte *p;
+	
+	//setactivepage(3);
+	warning("STUB: Celer::show_one()");
+
+	if (memos[which].x > on_disk)
+		display_it(memos[which].x, memos[which].y, memos[which].xl, memos[which].yl, memos[which].flavour, memory[which]);
+	else {
+		if (!f.open(filename)) { /* Filename was set in load_chunks() */
+			warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
+			return;
+		}
+
+		f.seek(offsets[which]);
+
+		ch.flavour = flavourtype(f.readByte());
+		ch.x = f.readSint16LE();
+		ch.y = f.readSint16LE();
+		ch.xl = f.readSint16LE();
+		ch.yl = f.readSint16LE();
+		ch.size = f.readSint32LE();
+		ch.natural = f.readByte();
+		ch.memorise = f.readByte();
+
+
+		p = new byte[ch.size];
+
+		for (int32 i = 0; i < ch.size; i++)
+			p[i] = f.readByte();
+
+		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p);
+
+		delete[] p;
+
+		f.close();
+	}
+
+	//setactivepage(1 - cp);
 	warning("STUB: Celer::show_one()");
+
+	for (byte fv = 0; fv < 2; fv ++)
+		_vm->_trip.getset[fv].remember(r);
 }
 
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 444a5aa..a70c814 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -62,11 +62,9 @@ public:
 	byte num_chunks;
 	memotype memos[40];
 	byte *memory[40];
+	bytefield r;
 
-	Common::File f;
-
-
-
+	
 	Celer();
 
 	void setParent(AvalancheEngine *vm);
@@ -84,7 +82,9 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	//untyped_file f; /* Private variable- not accessible from elsewhere. */
+	Common::String filename;
+
+	Common::File f;
 
 	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
 


Commit: 397ebad3851a989412dd052f5afd8554bc684091
    https://github.com/scummvm/scummvm/commit/397ebad3851a989412dd052f5afd8554bc684091
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T03:33:15-07:00

Commit Message:
AVALANCHE: Minor repairs regarding file handling.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 2dd2a28..7485648 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -527,7 +527,7 @@ void Gyro::load_a_mouse(byte which) {
 	vmc.ofsx = -mps[which].horzhotspot;
 	vmc.ofsy = -mps[which].verthotspot;
 
-	setminmaxhorzcurspos(mps[which].horzhotspot, 624 + mps[which].horzhotspot);
+	setminmaxhorzcurspos(mps[which].horzhotspot + 3, 624 + mps[which].horzhotspot);
 	setminmaxvertcurspos(mps[which].verthotspot, 199);
 }
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 68912c2..79dcd93 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -103,15 +103,12 @@ void Lucerna::scram1(Common::String &x) {
 }
 
 void Lucerna::unscramble() {
-	for (byte fv = 0; fv <= 30; fv ++)
-		for (byte ff = 0; ff <= 1; ff ++)
+	for (byte fv = 0; fv < 31; fv ++)
+		for (byte ff = 0; ff < 2; ff ++)
 			if (_vm->_gyro.also[fv][ff] != 0)
 				scram1(*_vm->_gyro.also[fv][ff]);
 	scram1(_vm->_gyro.listen);
 	scram1(_vm->_gyro.flags);
-	/*     for fz:=1 to length(_vm->_gyro.also[fv,ff]^) do
-	      _vm->_gyro.also[fv,ff]^[fz]:=chr(ord(_vm->_gyro.also[fv,ff]^[fz]) xor 177);*/
-	warning("STUB: Lucerna::unscramble()");
 }
 
 void Lucerna::load_also(char *n) {
@@ -197,7 +194,6 @@ void Lucerna::load_also(char *n) {
 	unscramble();
 	for (fv = 0; fv <= minnames; fv++)
 		*_vm->_gyro.also[fv][0] = Common::String(',') + *_vm->_gyro.also[fv][0] + ',';
-	
 }
 
 void Lucerna::load(byte n) {     /* Load2, actually */


Commit: cc5e4bbad04459a075e9afbbe4d1fee25c02a29d
    https://github.com/scummvm/scummvm/commit/cc5e4bbad04459a075e9afbbe4d1fee25c02a29d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T06:30:26-07:00

Commit Message:
AVALANCHE: Partly implement load() in Lucerna, change char * to Common::String in parameter lists.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 20413ff..eae8dca 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -268,11 +268,11 @@ void Celer::pics_link() {
 	}
 }
 
-void Celer::load_chunks(char *xx) {
+void Celer::load_chunks(Common::String xx) {
 	chunkblocktype ch;
 	byte fv;
 	
-	filename = filename.format("chunk%s.avd", xx);
+	filename = filename.format("chunk%s.avd", xx.c_str());
 	if (!f.open(filename)) {
 		warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
 		return;
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index a70c814..19f1871 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -71,7 +71,7 @@ public:
 
 	void pics_link();
 
-	void load_chunks(char *xx);
+	void load_chunks(Common::String xx);
 
 	void forget_chunks();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 79dcd93..d7e2814 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -111,7 +111,7 @@ void Lucerna::unscramble() {
 	scram1(_vm->_gyro.flags);
 }
 
-void Lucerna::load_also(char *n) {
+void Lucerna::load_also(Common::String n) {
 	byte ff, fv;
 	
 	for (fv = 0; fv < 31; fv++)
@@ -122,7 +122,7 @@ void Lucerna::load_also(char *n) {
 			}
 
 	Common::String filename;
-	filename = filename.format("also%s.avd", n);
+	filename = filename.format("also%s.avd", n.c_str());
 	if (!f.open(filename)) {
 		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 		return;
@@ -200,8 +200,59 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	byte a0;  /*absolute $A000:800;*/
 	byte a1;  /*absolute $A000:17184;*/
 	byte bit;
+	Common::String xx;
+	bool was_virtual;
 
+	was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual;
+	if (was_virtual)
+		_vm->_gyro.off_virtual();
+	else
+		_vm->_gyro.off();
+
+	_vm->_gyro.clear_vmc();
+
+	xx = _vm->_gyro.strf(n);
+	flesh_colours();
+
+	Common::String filename;
+	filename = filename.format("place%s.avd", xx.c_str());
+	if (!f.open(filename)) {
+		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+		return;
+	}
+
+	f.seek(146);
+	for (byte i = 0; i < 30; i++)
+		_vm->_gyro.roomname += f.readByte();
+	/* Compression method byte follows this... */
+
+	f.seek(177);
 	warning("STUB: Lucerna::load()");
+	for (bit = 0; bit <= 3; bit++) {
+		/*port[0x3c4] = 2;
+		port[0x3ce] = 4;
+		port[0x3c5] = 1 << bit;
+		port[0x3cf] = bit;
+		blockread(f, a0, 12080);
+		move(a0, a1, 12080);*/
+	}
+
+	f.close();
+
+	load_also(xx);
+	_vm->_celer.load_chunks(xx);
+
+	_vm->_pingo.copy03();
+
+	//bit = getpixel(0, 0);
+	warning("STUB: Lucerna::load()");
+
+	_vm->_logger.log_newroom(_vm->_gyro.roomname);
+
+	if (was_virtual)
+		_vm->_gyro.on_virtual();
+	else 
+		_vm->_gyro.on();
 }
 
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index c986877..f9d43f7 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -112,7 +112,7 @@ public:
 
 	void fix_flashers();
 
-	void load_also(char *n);
+	void load_also(Common::String n);
 
 private:
 	AvalancheEngine *_vm;


Commit: c6ff09a246dfa9049f917a36a3224f0d703b9c91
    https://github.com/scummvm/scummvm/commit/c6ff09a246dfa9049f917a36a3224f0d703b9c91
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T07:38:34-07:00

Commit Message:
AVALANCHE: Lucerna: implement thinkabout(). Modify newpointer() in Gyro.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 7485648..2fe3b54 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -271,7 +271,20 @@ void Gyro::setParent(AvalancheEngine *vm) {
 }
 
 void Gyro::newpointer(byte m) {
+	if (m == cmp)  return;
+	cmp = m;
+	
+	/*r.ax = 9;
+	r.bx = (word)(mps[m].horzhotspot);
+	r.cx = (word)(mps[m].verthotspot);
+	r.es = seg(mps[m].mask);
+	r.dx = ofs(mps[m].mask);
+	intr(0x33, r);
+	
+	r is a 'registers' type variable of Gyro in the Pascal code.*/
+
 	warning("STUB: Gyro::newpointer()");
+	load_a_mouse(m);
 }
 
 void Gyro::wait() {   /* makes hourglass */
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d7e2814..29fac29 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -707,7 +707,75 @@ void Lucerna::enterroom(byte x, byte ped) {
 }
 
 void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! */
+	const int16 x = 205;
+	const int16 y = 170;
+	const int16 picsize = 966;
+	const bytefield thinkspace = {25, 170, 32, 200};
+	byte *p;
+	byte fv;
+
+
+	_vm->_gyro.thinks = z;
+	z--;
+
+	if (th) {
+		/* Things */
+		_vm->_gyro.wait();
+	
+		p = new byte[picsize];
+	
+		if (!f.open("thinks.avd")) {
+			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
+			return;
+		}
+
+		f.seek(z * picsize + 65);
+
+		for (int16 i = 0; i < picsize; i++)
+			p[i] = f.readByte();
+
+		_vm->_gyro.off();
+
+		f.close();
+	} else {
+		/* People */
+		_vm->_gyro.wait();
+
+		p = new byte[picsize];
+
+		if (!f.open("folk.avd")) {
+			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
+			return;
+		}
+
+		fv = z - 149;
+		if (fv >= 25)
+			fv -= 8;
+		if (fv == 20) 
+			fv--; /* Last time... */
+
+		f.seek(fv * picsize + 65);
+
+		for (int16 i = 0; i < picsize; i++)
+			p[i] = f.readByte();
+
+		_vm->_gyro.off();
+
+		f.close();
+	}
+
+	/*setactivepage(3);
+	putimage(x, y, p, 0);
+	setactivepage(1 - cp);*/
 	warning("STUB: Lucerna::thinkabout()");
+
+	for (fv = 0; fv <= 1; fv ++)
+		_vm->_trip.getset[fv].remember(thinkspace);
+
+	delete[] p;
+	
+	_vm->_gyro.on();
+	_vm->_gyro.thinkthing = th;
 }
 
 void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */


Commit: fcaf659c7ab676fa9c6ccfe6a6b3b8a6e8f1eb9f
    https://github.com/scummvm/scummvm/commit/fcaf659c7ab676fa9c6ccfe6a6b3b8a6e8f1eb9f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T09:05:08-07:00

Commit Message:
AVALANCHE: Lucerna: implement load_digits().

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index e83e0a9..3852ef3 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -523,8 +523,8 @@ public:
 	bool ontoolbar, seescroll;
 
 	char objlist[10];
-	void * digit[10];
-	void *rwlite[9];
+	byte *digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	byte *rwlite[9]; // Maybe it will be needed to move them to the class itself instead.
 	byte oldrw;
 	Common::String lastscore;
 	byte cmp; /* current mouse-void **/
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 29fac29..da2aaae 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -744,7 +744,7 @@ void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! *
 		p = new byte[picsize];
 
 		if (!f.open("folk.avd")) {
-			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
+			warning("AVALANCHE: Lucerna: File not found: folk.avd");
 			return;
 		}
 
@@ -779,7 +779,26 @@ void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! *
 }
 
 void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
-	warning("STUB: Lucerna::load_digits()");
+	const byte digitsize = 134;
+	const byte rwlitesize = 126;
+
+	if (!f.open("digit.avd")) {
+		warning("AVALANCHE: Lucerna: File not found: digit.avd");
+		return;
+	}
+
+	for (byte fv = 0; fv < 10; fv ++) {
+		_vm->_gyro.digit[fv] = new byte[digitsize];
+		for (byte i = 0; i < digitsize; i++)
+			_vm->_gyro.digit[fv][i] = f.readByte();
+	}
+
+	for (byte ff = 0; ff < 9; ff ++) {
+		_vm->_gyro.digit[ff] = new byte[rwlitesize];
+		for (byte i = 0; i < rwlitesize; i++)
+			_vm->_gyro.digit[ff][i] = f.readByte();
+	}
+	f.close();
 }
 
 void Lucerna::toolbar() {


Commit: 14dfc468ea8cf80048d23c531bdb6ce0c945cf46
    https://github.com/scummvm/scummvm/commit/14dfc468ea8cf80048d23c531bdb6ce0c945cf46
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T09:28:43-07:00

Commit Message:
AVALANCHE: Lucerna: implement toolbar().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index da2aaae..3dc69d5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -802,7 +802,38 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 }
 
 void Lucerna::toolbar() {
+	uint16 s;
+	byte *p;
+
+	if (!f.open("useful.avd")) {
+		warning("AVALANCHE: Lucerna: File not found: useful.avd");
+		return;
+	}
+
+	s = f.size() - 40;
+	p = new byte[s];
+	f.seek(40);
+	for (uint16 i = 0; i < s; i++)
+		p[i] = f.readByte();
+	f.close();
+	/* off;*/
+
+	//setcolor(15); /* (And sent for chrysanthemums...) Yellow and white. */
+	//setfillstyle(1, 6);
+	//for (byte fv = 0; fv <= 1; fv ++) {
+	//	setactivepage(fv);
+	//	putimage(5, 169, p, 0);
+	//	if (demo) {
+	//		bar(264, 177, 307, 190);
+	//		outtextxy(268, 188, "Demo!"); /* well... actually only white now. */
+	//	}
+	//}
 	warning("STUB: Lucerna::toolbar()");
+
+	/* on;*/
+	delete[] p;
+	_vm->_gyro.oldrw = 177;
+	showrw();
 }
 
 void Lucerna::showscore() {


Commit: 0f2a0cf2a48a35cf54d4a1bc2af0062b36861533
    https://github.com/scummvm/scummvm/commit/0f2a0cf2a48a35cf54d4a1bc2af0062b36861533
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T10:00:31-07:00

Commit Message:
AVALANCHE: Pingo: partially implement winning_pic().

Changed paths:
    engines/avalanche/pingo2.cpp



diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 92c22e6..7a468d4 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -36,6 +36,7 @@
 #include "avalanche/scrolls2.h"
 
 #include "common/textconsole.h"
+#include "common/file.h"
 
 namespace Avalanche {
 
@@ -107,6 +108,38 @@ void Pingo::zonk() {
 }
 
 void Pingo::winning_pic() {
+	Common::File f;
+	char r;
+
+	_vm->_lucerna.dusk();
+
+	if (!f.open("finale.avd")) {
+		warning("AVALANCHE: Lucerna: File not found: finale.avd");
+		return;
+	}
+
+	/*for (byte bit = 0; bit <= 3; bit ++) {
+	port[0x3c4] = 2;
+	port[0x3ce] = 4;
+	port[0x3c5] = 1 << bit;
+	port[0x3cf] = bit;
+	blockread(f, mem[0xa000 * 0], 16000);
+	}*/
+	warning("STUB: Pingo::winning_pic()");
+
+	f.close();
+	_vm->_lucerna.blitfix();
+
+	//setvisualpage(0);
+	warning("STUB: Pingo::winning_pic()");
+
+	_vm->_lucerna.dawn();
+
+	/*do {
+		_vm->_gyro.check();
+	} while (!(keypressed() || (mrelease > 0)));
+	while (keypressed())  r = readkey();
+	major_redraw();*/
 	warning("STUB: Pingo::winning_pic()");
 }
 


Commit: 755d07a8dea913cbbd0137aae089379c42a5af99
    https://github.com/scummvm/scummvm/commit/755d07a8dea913cbbd0137aae089379c42a5af99
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-05T14:13:33-07:00

Commit Message:
AVALANCHE: Scrolls: implement file handling.

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4bb4f9d..8bf53cb 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -41,6 +41,7 @@
 #include "avalanche/basher2.h"
 
 #include "common/textconsole.h"
+#include "common/file.h"
 
 //#include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
 
@@ -134,11 +135,55 @@ void Scrolls::undodgem() {   /* This is the opposite of Dodgem. It moves the
 }
 
 void Scrolls::geticon(int16 x, int16 y, byte which) {
+	Common::File f;
+	byte *p;
+
+	if (!f.open("icons.avd")) {
+		warning("AVALANCHE: Scrolls: File not found: icons.avd");
+		return;
+	}
+
+	which--;
+	f.seek(which * 426);
+
+	p = new byte[426];
+	for (int16 i = 0; i < 426; i++)
+		p[i] = f.readByte();
+
+	//putimage(x, y, p, 0);
 	warning("STUB: Scrolls::geticon()");
+
+	delete[] p;
+	f.close();
 }
 
 void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
+	Common::File f;
+	byte bit;
+	int16 fv;
+	uint16 st;
+
+	st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro.cp) * _vm->_gyro.pagetop);
+
+	Common::String filename;
+	filename = filename.format("%s.avd", fn.c_str());
+	if (!f.open(filename)) {
+		warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
+		return;
+	}
+
+	/*for (fv = 1; fv <= yl; fv ++)
+	for (bit = 0; bit <= 3; bit ++) {
+	port[0x3c4] = 2;
+	port[0x3ce] = 4;
+	port[0x3c5] = 1 << bit;
+	port[0x3cf] = bit;
+	blockread(f, mem[0xa000 * st + (fv * 80)], xl);
+	}
+	bit = getpixel(0, 0);*/
 	warning("STUB: Scrolls::block_drop()");
+
+	f.close();
 }
 
 void Scrolls::drawscroll(func2 gotoit) {     /* This is one of the oldest func2s in the game. */


Commit: 8a44a94bb66cf9fc6b0979245198526a4e7cf6cc
    https://github.com/scummvm/scummvm/commit/8a44a94bb66cf9fc6b0979245198526a4e7cf6cc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T01:13:53-07:00

Commit Message:
AVALANCHE: Celer: implement show_one_at().

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index eae8dca..b6257d7 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -457,16 +457,12 @@ void Celer::show_one(byte which) {
 		ch.natural = f.readByte();
 		ch.memorise = f.readByte();
 
-
 		p = new byte[ch.size];
-
-		for (int32 i = 0; i < ch.size; i++)
-			p[i] = f.readByte();
+		f.read(p, ch.size);
 
 		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p);
 
 		delete[] p;
-
 		f.close();
 	}
 
@@ -479,12 +475,51 @@ void Celer::show_one(byte which) {
 
 
 
-void Celer::display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
+void Celer::display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
 	warning("STUB: Celer::display_it1()");
 }
 
 void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
+	chunkblocktype ch;
+	byte *p;
+
+	//setactivepage(3);
 	warning("STUB: Celer::show_one_at()");
+
+	if (memos[which].x > on_disk) {
+		display_it_at(memos[which].xl, memos[which].yl, memos[which].flavour, memory[which], xxx, yyy);
+	} else {
+		if (!f.open(filename)) { /* Filename was set in load_chunks() */
+			warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
+			return;
+		}
+
+		f.seek(offsets[which]);
+		ch.flavour = flavourtype(f.readByte());
+		ch.x = f.readSint16LE();
+		ch.y = f.readSint16LE();
+		ch.xl = f.readSint16LE();
+		ch.yl = f.readSint16LE();
+		ch.size = f.readSint32LE();
+		ch.natural = f.readByte();
+		ch.memorise = f.readByte();
+
+		{
+			p = new byte[ch.size];
+			f.read(p, ch.size);
+
+			display_it_at(ch.xl, ch.yl, ch.flavour, p, xxx, yyy);
+
+			delete[] p;
+			f.close();
+		}
+	}
+
+	//setactivepage(1 - cp);
+	warning("STUB: Celer::show_one_at()");
+
+	for (byte fv = 0; fv < 2; fv ++)
+		_vm->_trip.getset[fv].remember(r);
 }
 
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 19f1871..88baa3d 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -92,7 +92,7 @@ private:
 
 	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p);
 
-	void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);
+	void display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);
 };
 
 } // End of namespace Avalanche.


Commit: f01cbaa4e1d9d8126d6ed16d61365841f6459708
    https://github.com/scummvm/scummvm/commit/f01cbaa4e1d9d8126d6ed16d61365841f6459708
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T01:14:28-07:00

Commit Message:
AVALANCHE: Enid: update header.

Changed paths:
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index f0488db..107330a 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* ENID		Edna's manager. */
+/* ENID		Edna's manager. Loads/saves files. */
 
 #include "avalanche/avalanche.h"
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 8c02ef1..87b81d3 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* ENID		Edna's manager. */
+/* ENID		Edna's manager. Loads/saves files. */
 
 #ifndef ENID2_H
 #define ENID2_H


Commit: 2d4f710c9c14d93dabae061f54db22932e7140d9
    https://github.com/scummvm/scummvm/commit/2d4f710c9c14d93dabae061f54db22932e7140d9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T08:20:42-07:00

Commit Message:
AVALANCHE: Trip: implement triptype::init().

Changed paths:
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7fe643c..f5faa5b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -41,6 +41,7 @@
 
 #include "common/scummsys.h"
 #include "common/textconsole.h"
+#include "common/file.h"
 
 /*#include "Dropdown.h"*/
 
@@ -48,10 +49,97 @@
 namespace Avalanche {
 
 	
-triptype *triptype::init(byte spritenum, bool do_check, Trip *tr) {
-	warning("STUB: Trip::init()");	
+void triptype::init(byte spritenum, bool do_check, Trip *tr) {
+	const int32 idshould = -1317732048;
+	int16 gd, gm;
+	byte fv/*,nds*/;
+	int32 id;
+	uint16 soa;
+	Common::File inf;
+
+	if (spritenum == 177)
+		return; /* Already running! */
+
+	Common::String filename;
+	filename = filename.format("sprite%d.avd", spritenum);
+	if (!inf.open(filename)) {
+		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
+		return;
+	}
+
+	inf.seek(177);
+
+	id = inf.readSint32LE();
+	if (id != idshould) {
+		//output << '\7';
+		inf.close();
+		return;
+	}
+
+	soa = inf.readUint16LE(); // Only used in the original code. 
+	// I use it just to jump forward in the file. Should be replaced with seek().
+	
+	byte size = inf.readByte(); // Same purpose as soa.
+	for (byte i = 0; i < 12; i++) {
+		byte be = inf.readByte();
+		a.name += be;
+	}
+
+	size = inf.readByte(); // Same purpose as soa.
+	for (byte i = 0; i < 16; i++) {
+		byte be = inf.readByte();
+		a.comment += be;
+	}
+
+	a.num = inf.readByte();
+	a.xl = inf.readByte();
+	a.yl = inf.readByte();
+	a.seq = inf.readByte();
+	a.size = inf.readUint16LE();
+	a.fgc = inf.readByte();
+	a.bgc = inf.readByte();
+	a.accinum = inf.readByte();
+
+	totalnum = 0; // = 1;
+	xw = a.xl / 8;
+	if ((a.xl % 8) > 0)
+		xw++;
+	for (byte aa = 0; aa < /*nds*seq*/a.num; aa++) {
+
+		sil[totalnum] = new siltype[11 * (a.yl + 1)];
+		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
+		mani[totalnum] = new manitype[a.size - 6];
+		//getmem(mani[totalnum-1], a.size - 6);
+		for (fv = 0; fv <= a.yl; fv ++)
+			inf.read((*sil[totalnum])[fv], xw);
+			//blockread(inf, (*sil[totalnum-1])[fv], xw);
+		inf.read(*mani[totalnum], a.size - 6);
+		//blockread(inf, *mani[totalnum-1], a.size - 6);
+
+		totalnum ++;
+	}
+
+	/* on; */
+	x = 0;
+	y = 0;
+	quick = true;
+	visible = false;
+	xs = 3;
+	ys = 1;
+	/* if spritenum=1 then newspeed; { Just for the lights. }*/
+
+	homing = false;
+	ix = 0;
+	iy = 0;
+	step = 0;
+	check_me = do_check;
+	count = 0;
+	whichsprite = spritenum;
+	vanishifstill = false;
+	call_eachstep = false;
+	inf.close();
+	
 	_tr = tr;
-	return this;
 }
 
 void triptype::original() {
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 954b870..1c45037 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -44,8 +44,8 @@ typedef byte manitype[2049]; // manitype = array[5..2053] of byte;
 typedef byte siltype[51][11]; /* 35, 4 */
 
 struct adxtype { /* Second revision of ADX type */
-	Common::String name; /* name of character */
-	Common::String comment; /* comment */
+	Common::String name/*[13]*/; /* name of character */ // uruk: Note to self: TRAILING /0 !!! Real size: 12
+	Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16.
 	byte num; /* number of pictures */
 	byte xl, yl; /* x & y lengths of pictures */
 	byte seq; /* how many in one stride */
@@ -99,7 +99,7 @@ public:
 	bool call_eachstep; /* Do we call the eachstep procedure? */
 	byte eachstep;
 
-	triptype *init(byte spritenum, bool do_check, Trip *tr);
+	void init(byte spritenum, bool do_check, Trip *tr);
 	/* loads & sets up the sprite */
 	void original();    /* just sets Quick to false */
 	void andexor();    /* drops sprite onto screen */


Commit: 848860a5fb556dad3d22e882cbfca73bda6da500
    https://github.com/scummvm/scummvm/commit/848860a5fb556dad3d22e882cbfca73bda6da500
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T09:17:02-07:00

Commit Message:
AVALANCHE: Trip: modify trptype::init(), minor modifications in other functions parameter lists.

Changed paths:
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f5faa5b..3bc6d4c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -54,7 +54,6 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	int16 gd, gm;
 	byte fv/*,nds*/;
 	int32 id;
-	uint16 soa;
 	Common::File inf;
 
 	if (spritenum == 177)
@@ -76,20 +75,15 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 		return;
 	}
 
-	soa = inf.readUint16LE(); // Only used in the original code. 
-	// I use it just to jump forward in the file. Should be replaced with seek().
+	inf.skip(2); // Replace variable named 'soa' in the original code.
 	
-	byte size = inf.readByte(); // Same purpose as soa.
-	for (byte i = 0; i < 12; i++) {
-		byte be = inf.readByte();
-		a.name += be;
-	}
-
-	size = inf.readByte(); // Same purpose as soa.
-	for (byte i = 0; i < 16; i++) {
-		byte be = inf.readByte();
-		a.comment += be;
-	}
+	inf.skip(1); // We don't need to read the size of the string as in the original code.
+	for (byte i = 0; i < 12; i++) 
+		a.name += inf.readByte();
+	
+	inf.skip(1); // Same as above.
+	for (byte i = 0; i < 16; i++)
+		a.comment += inf.readByte();
 
 	a.num = inf.readByte();
 	a.xl = inf.readByte();
@@ -148,7 +142,7 @@ void triptype::original() {
 }
 
 void triptype::andexor() {
-	warning("STUB: Trip::andexor()");
+	warning("STUB: triptype::andexor()");
 }
 
 void triptype::turn(byte whichway) {
@@ -183,7 +177,7 @@ bool triptype::collision_check() {
 }
 
 void triptype::walk() {
-	warning("STUB: Trip::walk()");
+	warning("STUB: triptype::walk()");
 }
 
 void triptype::bounce() {
@@ -328,20 +322,20 @@ void triptype::unload_saver(trip_saver_type v) {
 	vanishifstill = v.vanishifstill;
 }
 
-void triptype::savedata(/*untyped_file &f*/) {
-	warning("STUB: _vm->_timeout.savedata()");
+void triptype::savedata(Common::File &f) {
+	warning("STUB: triptype::savedata()");
 }
 
-void triptype::loaddata(/*untyped_file &f*/) {
-	warning("STUB: _vm->_timeout.loaddata()");
+void triptype::loaddata(Common::File &f) {
+	warning("STUB: triptype::loaddata()");
 }
 
 void triptype::save_data_to_mem(uint16 &where) {
-	warning("STUB: save_data_to_mem()");
+	warning("STUB: triptype::save_data_to_mem()");
 }
 
 void triptype::load_data_from_mem(uint16 &where) {
-	warning("STUB: load_data_from_mem()");
+	warning("STUB: triptype::load_data_from_mem()");
 }
 
 triptype *triptype::done() {
@@ -376,7 +370,7 @@ getsettype *getsettype::init() {
 
 void getsettype::remember(bytefield r) {
 	numleft++;
-	warning("STUB: _vm->_timeout.getsettype::remember()");
+	warning("STUB: getsettype::remember()");
 	gs[numleft] = r;
 }
 
@@ -385,6 +379,11 @@ void getsettype::recall(bytefield &r) {
 	numleft--;
 }
 
+
+
+
+
+
 Trip::Trip() {
 	getsetclear();
 	mustexclaim = false;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 1c45037..bbb4785 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -116,8 +116,8 @@ public:
 	void set_up_saver(trip_saver_type &v);
 	void unload_saver(trip_saver_type v);
 
-	void savedata(/*untyped_file &f*/); /* Self-explanatory, */
-	void loaddata(/*untyped_file &f*/);  /* really. */
+	void savedata(Common::File &f); /* Self-explanatory, */
+	void loaddata(Common::File &f);  /* really. */
 
 	void save_data_to_mem(uint16 &where);
 	void load_data_from_mem(uint16 &where);


Commit: a394fea15d4991128fdaa452698c2f926032527e
    https://github.com/scummvm/scummvm/commit/a394fea15d4991128fdaa452698c2f926032527e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T09:40:29-07:00

Commit Message:
AVALANCHE: Add a comment to Gyro, remove test line from Avalot.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 67b543b..ae437a6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -146,9 +146,6 @@ void Avalot::setParent(AvalancheEngine *vm) {
 void Avalot::run(Common::String arg) {
 	setup();
 	
-	_vm->_lucerna.load_also("9");
-
-
 	do {
 		_vm->_lucerna.clock_lucerna();
 		_vm->_basher.keyboard_link();
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 2fe3b54..6c5d960 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -501,6 +501,7 @@ void Gyro::setup_vmc() {
 	vmc.andpic = new byte[mouse_size];
 	vmc.xorpic = new byte[mouse_size];
 
+	/* Released in Gyro's destructor. */
 	for (int fv = 0; fv < 2; fv ++) {
 		vmc.backpic[fv] = new byte[mouse_size];
 		vmc.wherewas[fv].x = 32767;


Commit: 2c0b69437161d03cf08f8b8da5b45af4c3e5696d
    https://github.com/scummvm/scummvm/commit/2c0b69437161d03cf08f8b8da5b45af4c3e5696d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T09:54:53-07:00

Commit Message:
AVALANCHE: update file handling in multiple files.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index b6257d7..cc44021 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -296,7 +296,6 @@ void Celer::load_chunks(Common::String xx) {
 		ch.memorise = f.readByte();
 				
 		if (ch.memorise) {
-
 			memos[fv].x = ch.x;
 			memos[fv].xl = ch.xl;
 			memos[fv].y = ch.y;
@@ -313,8 +312,7 @@ void Celer::load_chunks(Common::String xx) {
 			warning("STUB: Celer::load_chunks()");
 
 			if (!ch.natural)
-				for (int32 i = 0; i < ch.size; i++)
-					memory[fv][i] = f.readByte();
+				f.read(memory[fv], ch.size);
 		} else
 			memos[fv].x = on_disk;
 	}
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 6c5d960..faafdcd 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -530,11 +530,9 @@ void Gyro::load_a_mouse(byte which) {
 
 	f.seek(mouse_size * 2 * (which - 1) + 134);
 
-	for (int i = 0; i < mouse_size; i++)
-		vmc.andpic[i] = f.readByte();
+	f.read(vmc.andpic, mouse_size);
 	
-	for (int i = 0; i < mouse_size; i++)
-		vmc.xorpic[i] = f.readByte();
+	f.read(vmc.xorpic, mouse_size);
 	
 	f.close();
 	
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3dc69d5..9feca69 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -731,8 +731,7 @@ void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 		f.seek(z * picsize + 65);
 
-		for (int16 i = 0; i < picsize; i++)
-			p[i] = f.readByte();
+		f.read(p, picsize);
 
 		_vm->_gyro.off();
 
@@ -756,8 +755,7 @@ void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 		f.seek(fv * picsize + 65);
 
-		for (int16 i = 0; i < picsize; i++)
-			p[i] = f.readByte();
+		f.read(p, picsize);
 
 		_vm->_gyro.off();
 
@@ -789,15 +787,14 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 
 	for (byte fv = 0; fv < 10; fv ++) {
 		_vm->_gyro.digit[fv] = new byte[digitsize];
-		for (byte i = 0; i < digitsize; i++)
-			_vm->_gyro.digit[fv][i] = f.readByte();
+		f.read(_vm->_gyro.digit[fv], digitsize);
 	}
 
 	for (byte ff = 0; ff < 9; ff ++) {
 		_vm->_gyro.digit[ff] = new byte[rwlitesize];
-		for (byte i = 0; i < rwlitesize; i++)
-			_vm->_gyro.digit[ff][i] = f.readByte();
+		f.read(_vm->_gyro.digit[ff], rwlitesize);
 	}
+
 	f.close();
 }
 
@@ -813,8 +810,7 @@ void Lucerna::toolbar() {
 	s = f.size() - 40;
 	p = new byte[s];
 	f.seek(40);
-	for (uint16 i = 0; i < s; i++)
-		p[i] = f.readByte();
+	f.read(p, s);
 	f.close();
 	/* off;*/
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8bf53cb..d4a7752 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -147,8 +147,7 @@ void Scrolls::geticon(int16 x, int16 y, byte which) {
 	f.seek(which * 426);
 
 	p = new byte[426];
-	for (int16 i = 0; i < 426; i++)
-		p[i] = f.readByte();
+	f.read(p, 426);
 
 	//putimage(x, y, p, 0);
 	warning("STUB: Scrolls::geticon()");


Commit: 223c2d82e56c3fc20100090a3263627b3066d73c
    https://github.com/scummvm/scummvm/commit/223c2d82e56c3fc20100090a3263627b3066d73c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-09T13:18:29-07:00

Commit Message:
AVALANCHE: Implement file handling in Visa.

Changed paths:
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index e53f55a..ea5144f 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -45,8 +45,8 @@ namespace Avalanche {
 		_vm = vm;
 	}
 
-	const bool Visa::bubbling = false;
-	const bool Visa::report_dixi_errors = true;
+	bool Visa::bubbling = false;
+	bool Visa::report_dixi_errors = true;
 
 	void Visa::unskrimble() {
 		for (uint16  fv = 0; fv < _vm->_gyro.bufsize; fv++) 
@@ -58,13 +58,104 @@ namespace Avalanche {
 		_vm->_gyro.buffer[_vm->_gyro.bufsize] = 2;
 	}
 
-	// File handling.
 	void Visa::dixi(char block, byte point) {
-		warning("STUB: Visa::dixi()");
+		Common::File indexfile, sezfile;
+		uint16 idx_offset, sez_offset;
+		bool error = false;
+
+		if (!indexfile.open("avalot.idx")) {
+			warning("AVALANCHE: Visa: File not found: avalot.idx");
+			return;
+		}
+
+		indexfile.seek((toupper(block) - 65) * 2);
+		idx_offset = indexfile.readUint16LE();
+		if (idx_offset == 0)
+			error = true;
+
+		indexfile.seek(idx_offset + point * 2);
+		sez_offset = indexfile.readUint16LE();
+		if (sez_offset == 0)
+			error = true;
+
+		indexfile.close();
+
+		went_ok = !error;
+
+		if (error) {
+			if (report_dixi_errors) {
+				Common::String todisplay;
+				todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro.strf(point).c_str());
+				_vm->_scrolls.display(todisplay);
+			}
+			return;
+		}
+
+		if (!sezfile.open("avalot.sez")) {
+			warning("AVALANCHE: Visa: File not found: avalot.sez");
+			return;
+		}
+		sezfile.seek(sez_offset);
+		_vm->_gyro.bufsize = sezfile.readUint16LE();
+		sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize);
+		sezfile.close();
+		unskrimble();
+
+		if (bubbling)  do_the_bubble();
+
+		_vm->_scrolls.calldrivers();
 	}
 
-	// File handling.
 	void Visa::speech(byte who, byte subject) {
+		Common::File indexfile, sezfile;
+		uint16 idx_offset, sez_offset, next_idx_offset;
+
+		if (subject == 0) {
+			/* No subject. */
+
+			bubbling = true;
+			report_dixi_errors = false;
+			dixi('s', who);
+			bubbling = false;
+			report_dixi_errors = true;
+		} else {
+			/* Subject given. */
+
+			went_ok = false; /* Assume that until we know otherwise. */
+
+			if (!indexfile.open("converse.avd")) {
+				warning("AVALANCHE: Visa: File not found: converse.avd");
+				return;
+			}
+
+			indexfile.seek(who * 2 - 2);
+			idx_offset = indexfile.readUint16LE();
+			next_idx_offset = indexfile.readUint16LE();
+
+			if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))  return;
+
+			indexfile.seek(idx_offset + subject * 2);
+			sez_offset = indexfile.readUint16LE();
+			if ((sez_offset == 0) || (indexfile.err()))
+				return;
+			indexfile.close();
+
+			if (!sezfile.open("avalot.sez")) {
+				warning("AVALANCHE: Visa: File not found: avalot.sez");
+				return;
+			}
+			sezfile.seek(sez_offset);
+			_vm->_gyro.bufsize = sezfile.readUint16LE();
+			sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize);
+			sezfile.close();
+
+			unskrimble();
+			do_the_bubble();
+
+			_vm->_scrolls.calldrivers();
+			went_ok = true;
+		}
+
 		warning("STUB: Visa::speech()");
 	}
 
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index 6749a1d..e33045c 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -46,8 +46,8 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	static const bool bubbling;
-	static const bool report_dixi_errors;
+	static bool bubbling;
+	static bool report_dixi_errors;
 
 	bool went_ok;
 


Commit: c90357724fa6602b3b54bfcac401b520226a2740
    https://github.com/scummvm/scummvm/commit/c90357724fa6602b3b54bfcac401b520226a2740
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-10T03:34:46-07:00

Commit Message:
AVALANCHE: Implement Basher's initialization.

Changed paths:
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 61ad226..176cbfc 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -48,15 +48,36 @@
 #include "common/textconsole.h"
 
 namespace Avalanche {
-	
-Basher::Basher() {
-	warning("STUB: Basher::Basher()");
-}
+
 
 void Basher::setParent(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+void Basher::init() {
+	/* new(previous);*/
+	if (!_vm->_gyro.last.empty())
+		_vm->_gyro.last.clear();
+
+	normal_edit();
+
+	if (_vm->_gyro.demo) {
+		if (!_vm->_gyro.demofile.open("demo.avd")) {
+			warning("AVALANCHE: Basher: File not found: demo.avd");
+			throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
+		}
+	}
+
+// Not sure that the following part will be used ever...
+#ifdef RECORD
+	count = 0;
+	if (!_vm->_gyro.demofile_save.open("demo.avd")) {
+		warning("AVALANCHE: Basher: File not found: demo.avd");
+		throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
+	}
+#endif
+}
+
 void Basher::plottext() {
 	warning("STUB: Basher::plottext()");
 }
@@ -161,7 +182,11 @@ void Basher::filename_edit() {
 }
 
 void Basher::normal_edit() {
-	warning("STUB: Basher::normal_edit()");
+	entering_filename = false;
+	/*if (!_vm->_gyro.current.empty())
+		_vm->_gyro.current.clear();*/
+	left_margin = 1;
+	_vm->_gyro.curpos = 1;
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index 326ea93..1a97a85 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -45,10 +45,10 @@ public:
 
 
 
-	Basher();
-
 	void setParent(AvalancheEngine *vm);
 
+	void init();
+
 	void plottext();
 
 	void keyboard_link();
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 3852ef3..5c40b42 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -32,6 +32,7 @@
 
 #include "common/str.h"
 #include "common/scummsys.h"
+#include "common/file.h"
 
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"
@@ -582,7 +583,8 @@ public:
 
 	/* For the demo: */
 	demo_type demo_rec;
-	//file<demo_type> demofile; // http://www.freepascal.org/docs-html/ref/refsu21.html#x45-520003.3.4
+	Common::File demofile; // of demo_type
+	Common::DumpFile demofile_save; // uruk added it - first use located in constructor of Basher
 
 	char last_person; /* Last person to have been selected using the People
 						menu. */


Commit: 11cbacfe9dffb8d555addb0464a7f0cebf914ef4
    https://github.com/scummvm/scummvm/commit/11cbacfe9dffb8d555addb0464a7f0cebf914ef4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-10T04:26:49-07:00

Commit Message:
AVALANCHE: Implement file loadfont() in Scrolls. Move initializations to run(), so loadfont() can access the data files of the game.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a510718..98e8865 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -53,15 +53,15 @@ namespace Avalanche {
 		_enhanced.setParent(this);
 		_logger.setParent(this);
 		_pingo.setParent(this);
-		_scrolls.setParent(this); _scrolls.init();
+		_scrolls.setParent(this);
 		_visa.setParent(this);
-		_lucerna.setParent(this); _lucerna.init();
+		_lucerna.setParent(this);
 		_enid.setParent(this);
 		_celer.setParent(this);
 		_sequence.setParent(this);
 		_timeout.setParent(this);
 		_trip.setParent(this);
-		_acci.setParent(this); _acci.init();
+		_acci.setParent(this);
 		_basher.setParent(this);
 		_dropdown.setParent(this);
 		_closing.setParent(this);
@@ -230,8 +230,10 @@ namespace Avalanche {
 	void AvalancheEngine::run_avalot() {
 		bflight_on();
 
-		_avalot.run(Common::String(runcodes[first_time]) + arguments);  // TODO: Check if parameteres are ever use and eventually remove them
+		_avalot.run(Common::String(runcodes[first_time]) + arguments);
+		// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
 		// If there's an error initalizing avalot, i'll handle it in there, not here
+
 		first_time = false;
 	}
 
@@ -242,7 +244,10 @@ namespace Avalanche {
 		initGraphics(320, 200, false);
 		_console = new AvalancheConsole(this);
 
-
+		_scrolls.init();
+		_lucerna.init();
+		_acci.init();
+		_basher.init();
 
 		// From bootstrp:
 
@@ -257,6 +262,8 @@ namespace Avalanche {
 		if (!zoomy)
 			call_menu();    /* Not run when zoomy. */
 
+		
+
 		do {
 			run_avalot();
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d4a7752..ca0ac30 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -254,7 +254,31 @@ void Scrolls::display(Common::String z) {
 }
 
 void Scrolls::loadfont() {
-	warning("STUB: Scrolls::loadfont()");
+	Common::File f;
+
+	if (!f.open("avalot.fnt")) {
+		warning("AVALANCHE: Scrolls: File not found: avalot.fnt");
+		return;
+	}
+	for (int16 i = 0; i < 256; i++)
+		f.read(ch[0][i],16);
+	f.close();
+
+	if (!f.open("avitalic.fnt")) {
+		warning("AVALANCHE: Scrolls: File not found: avitalic.fnt");
+		return;
+	}
+	for (int16 i = 0; i < 256; i++)
+		f.read(ch[1][i],16);
+	f.close();
+	
+	if (!f.open("ttsmall.fnt")) {
+		warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
+		return;
+	}
+	for (int16 i = 0; i < 256; i++)
+		f.read(_vm->_gyro.little[i],16);
+	f.close();
 }
 
 void Scrolls::okay() {


Commit: c99abdeb6115c54a0c7bec21f52114a4086e90cc
    https://github.com/scummvm/scummvm/commit/c99abdeb6115c54a0c7bec21f52114a4086e90cc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-10T05:48:10-07:00

Commit Message:
AVALANCHE: Implement log_epsonroman() in Logger.

Changed paths:
    engines/avalanche/logger2.cpp



diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index c709e68..eeedb23 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -54,17 +54,17 @@ const char Logger::divide[] = "--- oOo ---";
 
 /* L'jet codes: */
 
-//// Not sure if these will be needed at all...
-//
-//const Common::String startwith = Common::String('\33') + '\50' + "10J" + '\130';
-//const Common::String endwith = Common::String('\33') + '\105';
-//const Common::String italic = Common::String('\33') + '\50' + '\163' + '\61' + '\123'; /* switches italics on... */
-//const Common::String italic_off = Common::String('\33') + '\50' + '\163' + '\60' + '\123'; /* and off. */
-//const Common::String emph_on = Common::String('\33') + '\50' + '\163' + '\63' + '\102';
-//const Common::String emph_off = Common::String('\33') + '\50' + '\163' + '\60' + '\102';
-//
-//const Common::String double_width = emph_on; /* There IS no double-width. */
-//const Common::String double_off = emph_off; /* So we'll have to use bold. */
+// Not sure if these will be needed at all...
+
+const Common::String startwith = Common::String(33) + 50 + "10J" + 130;
+const Common::String endwith = Common::String(33) + 105;
+const Common::String italic = Common::String(33) + 50 + 163 + 61 + 123; /* switches italics on... */
+const Common::String italic_off = Common::String(33) + 50 + 163 + 60 + 123; /* and off. */
+const Common::String emph_on = Common::String(33) + 50 + 163 + 63 + 102;
+const Common::String emph_off = Common::String(33) + 50 + 163 + 60 + 102;
+
+const Common::String double_width = emph_on; /* There IS no double-width. */
+const Common::String double_off = emph_off; /* So we'll have to use bold. */
 
 
 
@@ -197,10 +197,8 @@ void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on
 	if (!_vm->_gyro.logging)
 		return;
 
-	warning("STUB: Logger::log_epsonroman()");
-
-	//if (_vm->_gyro.log_epson)
-	//	log_addstuff(italic_off);
+	if (_vm->_gyro.log_epson)
+		log_addstuff(italic_off);
 }
 
 void Logger::log_scrollline() {   /* Set up a line for the scroll driver */


Commit: 4656a7a285c48427691cc9ee70d3afe6adbdc5d4
    https://github.com/scummvm/scummvm/commit/4656a7a285c48427691cc9ee70d3afe6adbdc5d4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-11T01:07:53-07:00

Commit Message:
AVALANCHE: Don't call the menu by default.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 98e8865..94b2b16 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -256,8 +256,8 @@ namespace Avalanche {
 		get_arguments();
 		get_slope();
 
-		zoomy = false; 
-		// Call the menu by default. Might be modified later, if get_slope() gets implemented,
+		zoomy = true; 
+		// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
 		// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
 		if (!zoomy)
 			call_menu();    /* Not run when zoomy. */


Commit: 6b87fc4f45d99d8d6f69984afa9bd408ccacd887
    https://github.com/scummvm/scummvm/commit/6b87fc4f45d99d8d6f69984afa9bd408ccacd887
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-11T01:36:41-07:00

Commit Message:
AVALANCHE: Little revision in Gyro.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index faafdcd..8319c17 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -194,7 +194,7 @@ const tunetype Gyro::tune = {
 	lower, same, lower, higher, same, lower, higher
 };
 
-const byte Gyro::static_const_whereis[29] = {
+byte Gyro::whereis[29] = {
 	/* The Lads */
 	r__yours, /* Avvy */
 	r__spludwicks, /* Spludwick */
@@ -245,9 +245,6 @@ const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 
 
 Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
-	for (int i = 0; i < 29; i++)
-		whereis[i] = static_const_whereis[i];
-
 	/* Needed becouse of Lucerna::load_also() */
 	for (int fv = 0; fv < 31; fv++)
 		for (int ff = 0; ff < 2; ff++)
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 5c40b42..39fabf8 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -460,8 +460,6 @@ public:
 
 	static const int16 runerr_getset_overflow = 50;
 
-	static const byte static_const_whereis[29];
-
 
 
 
@@ -472,7 +470,7 @@ public:
 		the DNA in a position dictated by the value. If a scroll comes up,
 		or you leave the room, it's automatically set to zero. */
 
-	byte whereis[29];
+	static byte whereis[29];
 
 	bool oncandopageswap; 
 	/* Variable static constant for overriding the ability of On to switch pages.


Commit: 0aaffcfb941c95141eaa400082ee943463360068
    https://github.com/scummvm/scummvm/commit/0aaffcfb941c95141eaa400082ee943463360068
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-11T08:36:59-07:00

Commit Message:
AVALANCHE: Add Graph.

Changed paths:
  A engines/avalanche/graph.cpp
  A engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
new file mode 100644
index 0000000..30dd20a
--- /dev/null
+++ b/engines/avalanche/graph.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Replacement class for the Graph unit from Pascal. */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/graph.h"
+
+#include "common/system.h"
+
+#include "engines/util.h"
+
+#include "graphics/palette.h"
+
+namespace Avalanche {
+
+const byte Graph::ega_palette_index[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
+
+const byte Graph::ega_palette[64][3] =
+{
+	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
+	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
+	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
+	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
+	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
+	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
+	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
+	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f}
+};
+
+
+
+
+void Graph::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Graph::init() {
+	initGraphics(_screenWidth, _screenHeight, false);
+
+	for (byte i = 0; i < 16; i++)
+		g_system->getPaletteManager()->setPalette(ega_palette[ega_palette_index[i]], i, 1);
+
+	_surface.create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
+}
+
+Graph::~Graph() {
+	_surface.free();
+}
+
+byte *Graph::getPixel(int16 x, int16 y) {
+	return (byte *)_surface.getBasePtr(x, y);
+}
+
+void Graph::setPixel(byte *pixel, byte color) {
+	memset(pixel, color, 1);
+}
+
+void Graph::drawToScreen() {
+	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, _screenWidth, _screenHeight);
+	g_system->updateScreen();
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
new file mode 100644
index 0000000..9ddd69f
--- /dev/null
+++ b/engines/avalanche/graph.h
@@ -0,0 +1,69 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Replacement class for the Graph unit from Pascal. */
+
+#ifndef GRAPH_H
+#define GRAPH_H
+
+#include "graphics/surface.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Graph {
+public:
+	static const int16 _screenWidth = 320;
+	static const int16 _screenHeight = 200;
+
+	
+
+	void setParent(AvalancheEngine *vm);
+
+	void init();
+
+	~Graph();
+
+	byte *getPixel(int16 x, int16 y);
+
+	void setPixel(byte *pixel, byte color);
+
+	void drawToScreen();
+
+private:
+	AvalancheEngine *_vm;
+
+	Graphics::Surface _surface;
+
+	static const byte ega_palette_index[16];
+
+	static const byte ega_palette[64][3];
+};
+
+} // End of namespace Avalanche
+
+#endif // GRAPH_H


Commit: 096bd2df76b6132dad8ccefb2a212dbc53218870
    https://github.com/scummvm/scummvm/commit/096bd2df76b6132dad8ccefb2a212dbc53218870
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-11T09:02:15-07:00

Commit Message:
AVALANCHE: Major update in the Engine (include Graph), minor updates in Graph and Lucerna.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/graph.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 94b2b16..88e6e0e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -38,6 +38,8 @@
 
 #include "engines/util.h"
 
+
+
 namespace Avalanche {
 
 	AvalancheEngine *AvalancheEngine::s_Engine = 0;
@@ -49,6 +51,8 @@ namespace Avalanche {
 		_rnd = new Common::RandomSource("avalanche");
 		_rnd->setSeed(42);     
 
+		_graph.setParent(this);
+
 		_gyro.setParent(this);
 		_enhanced.setParent(this);
 		_logger.setParent(this);
@@ -241,13 +245,17 @@ namespace Avalanche {
 
 	Common::Error AvalancheEngine::run() {
 		s_Engine = this;
-		initGraphics(320, 200, false);
-		_console = new AvalancheConsole(this);
 
+		_console = new AvalancheConsole(this);
+		
 		_scrolls.init();
 		_lucerna.init();
 		_acci.init();
 		_basher.init();
+		_graph.init();
+
+		
+
 
 		// From bootstrp:
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 592df70..bd8e532 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -30,6 +30,8 @@
 
 #include "avalanche/console.h"
 
+#include "avalanche/graph.h"
+
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/enhanced2.h"
@@ -63,6 +65,8 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
+	Graph _graph;
+
 	Avalot _avalot;
 	Gyro _gyro;
 	Enhanced _enhanced;
@@ -81,6 +85,8 @@ public:
 	Dropdown _dropdown;
 	Closing _closing;
 
+
+
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 
@@ -94,8 +100,6 @@ public:
 	uint32 getFeatures() const;
 	const char *getGameId() const;
 
-	void initGame(const AvalancheGameDescription *gd);
-
 	Common::Platform getPlatform() const;
 
 	bool hasFeature(EngineFeature f) const;
diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 30dd20a..73ea430 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -77,7 +77,7 @@ byte *Graph::getPixel(int16 x, int16 y) {
 }
 
 void Graph::setPixel(byte *pixel, byte color) {
-	memset(pixel, color, 1);
+	*pixel = color;
 }
 
 void Graph::drawToScreen() {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index f9d43f7..94da2db 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -176,5 +176,4 @@ private:
 
 } // End of namespace Avalanche
 
-
 #endif // LUCERNA2_H


Commit: d7b82409205ce924c0a8fc206ad13937e72f8bc2
    https://github.com/scummvm/scummvm/commit/d7b82409205ce924c0a8fc206ad13937e72f8bc2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-11T23:41:14-07:00

Commit Message:
AVALANCHE: Update Graph, leave a comment in Lucerna.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 73ea430..2c845c0 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -38,20 +38,7 @@
 
 namespace Avalanche {
 
-const byte Graph::ega_palette_index[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
-
-const byte Graph::ega_palette[64][3] =
-{
-	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
-	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
-	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
-	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
-	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
-	{0x00,0x00,0x00}, {0x00,0x00,0x2a}, {0x00,0x2a,0x00}, {0x00,0x2a,0x2a}, {0x2a,0x00,0x00}, {0x2a,0x00,0x2a}, {0x2a,0x15,0x00}, {0x2a,0x2a,0x2a},
-	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
-	{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f}
-};
-
+const byte Graph::_egaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
 
 
 
@@ -60,10 +47,16 @@ void Graph::setParent(AvalancheEngine *vm) {
 }
 
 void Graph::init() {
-	initGraphics(_screenWidth, _screenHeight, false);
+	initGraphics(_screenWidth, _screenHeight, true);
+
+	for (int i = 0; i < 64; ++i) {
+		_egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
+		_egaPalette[i][1] = (i >> 1 & 1) * 0xaa + (i >> 4 & 1) * 0x55;
+		_egaPalette[i][2] = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
+	}
 
 	for (byte i = 0; i < 16; i++)
-		g_system->getPaletteManager()->setPalette(ega_palette[ega_palette_index[i]], i, 1);
+		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
 
 	_surface.create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
 }
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 9ddd69f..220f87f 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -37,8 +37,8 @@ class AvalancheEngine;
 
 class Graph {
 public:
-	static const int16 _screenWidth = 320;
-	static const int16 _screenHeight = 200;
+	static const int16 _screenWidth = 640;
+	static const int16 _screenHeight = 350;
 
 	
 
@@ -59,9 +59,9 @@ private:
 
 	Graphics::Surface _surface;
 
-	static const byte ega_palette_index[16];
+	static const byte _egaPaletteIndex[16];
 
-	static const byte ega_palette[64][3];
+	byte _egaPalette[64][3];
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 9feca69..0fd7fee 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -980,11 +980,11 @@ int8 Lucerna::fades(int8 x) {
 
 
 void Lucerna::fadeout(byte n) {
-	warning("STUB: Lucerna::fadeout()");
+	warning("STUB: Lucerna::fadeout()"); // I'll bother with colors later.
 }
 
 void Lucerna::dusk() {
-	warning("STUB: Lucerna::dusk()");
+	warning("STUB: Lucerna::dusk()"); // I'll bother with colors later.
 }
 
 


Commit: 0fc20c25dea704eafecd8786722f8e26ca552e2f
    https://github.com/scummvm/scummvm/commit/0fc20c25dea704eafecd8786722f8e26ca552e2f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T00:37:21-07:00

Commit Message:
AVALANCHE: Repair Lucerna.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 0fd7fee..66036e0 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -46,6 +46,8 @@
 
 #include "common/system.h"
 
+#include "graphics/palette.h"
+
 //#include "dropdown.h"
 //#include "basher.h"
 
@@ -791,8 +793,8 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 	}
 
 	for (byte ff = 0; ff < 9; ff ++) {
-		_vm->_gyro.digit[ff] = new byte[rwlitesize];
-		f.read(_vm->_gyro.digit[ff], rwlitesize);
+		_vm->_gyro.rwlite[ff] = new byte[rwlitesize];
+		f.read(_vm->_gyro.rwlite[ff], rwlitesize);
 	}
 
 	f.close();
@@ -949,7 +951,7 @@ void Lucerna::checkclick() {
 }
 
 void Lucerna::mouse_init() {
-	warning("STUB: Lucerna::mouse_init()");
+	_vm->_gyro.wait();
 }
 
 void Lucerna::mousepage(uint16 page_) {


Commit: 1bb9d2b9965348e6526e9b9d5100ff443fdef3cd
    https://github.com/scummvm/scummvm/commit/1bb9d2b9965348e6526e9b9d5100ff443fdef3cd
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T01:25:16-07:00

Commit Message:
AVALANCHE: Grap: rename drawToScreen to refreshScreen, add drawBar.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 2c845c0..47836aa 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -35,6 +35,7 @@
 #include "engines/util.h"
 
 #include "graphics/palette.h"
+#include "common/rect.h"
 
 namespace Avalanche {
 
@@ -73,7 +74,11 @@ void Graph::setPixel(byte *pixel, byte color) {
 	*pixel = color;
 }
 
-void Graph::drawToScreen() {
+void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
+	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
+}
+
+void Graph::refreshScreen() {
 	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, _screenWidth, _screenHeight);
 	g_system->updateScreen();
 }
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 220f87f..beaa796 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 class Graph {
 public:
 	static const int16 _screenWidth = 640;
-	static const int16 _screenHeight = 350;
+	static const int16 _screenHeight = 200;
 
 	
 
@@ -52,7 +52,9 @@ public:
 
 	void setPixel(byte *pixel, byte color);
 
-	void drawToScreen();
+	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
+
+	void refreshScreen();
 
 private:
 	AvalancheEngine *_vm;


Commit: a096ee19576ce9b518f28c3da27463244d51893e
    https://github.com/scummvm/scummvm/commit/a096ee19576ce9b518f28c3da27463244d51893e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T01:43:13-07:00

Commit Message:
AVALANCHE: Partially implement Scrolls::state. (Bother with the patterns later.)

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index ca0ac30..972091d 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -57,7 +57,46 @@ void Scrolls::init() {
 }
 
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
+	byte page_;
+
+	if (_vm->_gyro.ledstatus == x)
+		return; /* Already like that! */
+
+	byte color;
+	switch (x) {
+	case 0:
+		color = black;
+		break; /* Off */
+	case 1:
+	case 2:
+	case 3:
+		color = green;
+		break; /* Hit a key */
+	}
+
+	//switch (x) {
+	//case 0:
+	//	setfillstyle(1, black);
+	//	break; /* Off */
+	//case 1:
+	//	setfillstyle(9, green);
+	//	break; /* Half-on (menus) */
+	//case 2:
+	//	setfillstyle(1, green);
+	//	break; /* On (kbd) */
+	//case 3:
+	//	setfillstyle(6, green);
+	//	break; /* Hit a key */
+	//}
 	warning("STUB: Scrolls::state()");
+
+	_vm->_gyro.super_off();
+
+	_vm->_graph.drawBar(419, 195, 438, 197, color);
+	_vm->_graph.refreshScreen();
+
+	_vm->_gyro.super_on();
+	_vm->_gyro.ledstatus = x;
 }
 
 void Scrolls::easteregg() {


Commit: fa881567db05ffb6c2f8aaf96a37a3321e9c417f
    https://github.com/scummvm/scummvm/commit/fa881567db05ffb6c2f8aaf96a37a3321e9c417f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T07:08:35-07:00

Commit Message:
AVALANCHE: Update Graph.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 47836aa..d932d12 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,6 +78,10 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
+void Graph::copySurface(Graphics::Surface source) {
+	_surface.copyFrom(source);
+}
+
 void Graph::refreshScreen() {
 	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, _screenWidth, _screenHeight);
 	g_system->updateScreen();
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index beaa796..24fffcc 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -54,6 +54,8 @@ public:
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
+	void copySurface(Graphics::Surface source);
+
 	void refreshScreen();
 
 private:


Commit: c18b41b21dd3674b44c07ef68f317822bcfb1d37
    https://github.com/scummvm/scummvm/commit/c18b41b21dd3674b44c07ef68f317822bcfb1d37
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T07:11:07-07:00

Commit Message:
AVALANCHE: Lucerna: finish implementation of load().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 66036e0..5cbd46c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -230,14 +230,35 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	f.seek(177);
 	warning("STUB: Lucerna::load()");
-	for (bit = 0; bit <= 3; bit++) {
-		/*port[0x3c4] = 2;
-		port[0x3ce] = 4;
-		port[0x3c5] = 1 << bit;
-		port[0x3cf] = bit;
-		blockread(f, a0, 12080);
-		move(a0, a1, 12080);*/
-	}
+
+	Graphics::Surface background;
+	background.create(_vm->_graph._screenWidth, _vm->_graph._screenHeight, Graphics::PixelFormat::createFormatCLUT8());
+
+	for (byte plane = 0; plane < 4; plane++)
+		for (uint16 y = 0; y < 151; y++)
+			for (uint16 x = 0; x < 640/8; x++) {
+				byte pixel = f.readByte();
+				for (byte i = 0; i < 8; i++) {
+					byte pixelBit = (pixel >> i) & 1;
+					*(byte *)background.getBasePtr(x * 8, y) += (pixelBit << plane);
+				}	
+			}
+
+	_vm->_graph.copySurface(background);
+
+	background.free();
+
+	_vm->_graph.refreshScreen();
+
+
+	/*for (bit = 0; bit <= 3; bit++) {
+	port[0x3c4] = 2;
+	port[0x3ce] = 4;
+	port[0x3c5] = 1 << bit;
+	port[0x3cf] = bit;
+	blockread(f, a0, 12080);
+	move(a0, a1, 12080);
+	}*/
 
 	f.close();
 
@@ -246,8 +267,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	_vm->_pingo.copy03();
 
-	//bit = getpixel(0, 0);
-	warning("STUB: Lucerna::load()");
+	bit = *_vm->_graph.getPixel(0,0);
 
 	_vm->_logger.log_newroom(_vm->_gyro.roomname);
 


Commit: b4f564276578413c6bd152461069d199a78b3eac
    https://github.com/scummvm/scummvm/commit/b4f564276578413c6bd152461069d199a78b3eac
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T07:20:01-07:00

Commit Message:
AVALANCHE: Revise Lucerna::load().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5cbd46c..bb22530 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -236,11 +236,11 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	for (byte plane = 0; plane < 4; plane++)
 		for (uint16 y = 0; y < 151; y++)
-			for (uint16 x = 0; x < 640/8; x++) {
+			for (uint16 x = 0; x < 640; x += 8) {
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)background.getBasePtr(x * 8, y) += (pixelBit << plane);
+					*(byte *)background.getBasePtr(x + i, y) += (pixelBit << plane);
 				}	
 			}
 


Commit: a1673fe167077c206a80e67522ba7c7d0cac9cc0
    https://github.com/scummvm/scummvm/commit/a1673fe167077c206a80e67522ba7c7d0cac9cc0
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-12T09:08:27-07:00

Commit Message:
AVALANCHE: Lucerna: finish load().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index bb22530..6cd99b5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -229,18 +229,29 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	/* Compression method byte follows this... */
 
 	f.seek(177);
-	warning("STUB: Lucerna::load()");
+
+	/*for (bit = 0; bit <= 3; bit++) {
+	port[0x3c4] = 2;
+	port[0x3ce] = 4;
+	port[0x3c5] = 1 << bit;
+	port[0x3cf] = bit;
+	blockread(f, a0, 12080);
+	move(a0, a1, 12080);
+	}*/
 
 	Graphics::Surface background;
 	background.create(_vm->_graph._screenWidth, _vm->_graph._screenHeight, Graphics::PixelFormat::createFormatCLUT8());
 
+	byte backgroundHeight = 8 * 12080 / _vm->_graph._screenWidth; // With 640 width it's 151
+	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
+
 	for (byte plane = 0; plane < 4; plane++)
-		for (uint16 y = 0; y < 151; y++)
-			for (uint16 x = 0; x < 640; x += 8) {
+		for (uint16 y = 0; y < backgroundHeight; y++)
+			for (uint16 x = 0; x < _vm->_graph._screenWidth; x += 8) {
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)background.getBasePtr(x + i, y) += (pixelBit << plane);
+					*(byte *)background.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
 				}	
 			}
 
@@ -251,14 +262,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	_vm->_graph.refreshScreen();
 
 
-	/*for (bit = 0; bit <= 3; bit++) {
-	port[0x3c4] = 2;
-	port[0x3ce] = 4;
-	port[0x3c5] = 1 << bit;
-	port[0x3cf] = bit;
-	blockread(f, a0, 12080);
-	move(a0, a1, 12080);
-	}*/
+
 
 	f.close();
 


Commit: 0f8a091597092f7efc308f4d20a3d09c648fcb2a
    https://github.com/scummvm/scummvm/commit/0f8a091597092f7efc308f4d20a3d09c648fcb2a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-13T04:02:12-07:00

Commit Message:
AVALANCHE: Update Lucerna::load(), update makefile, increase screen height (in Graph).

Changed paths:
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk



diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 24fffcc..559e78c 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 class Graph {
 public:
 	static const int16 _screenWidth = 640;
-	static const int16 _screenHeight = 200;
+	static const int16 _screenHeight = 400;
 
 	
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 6cd99b5..493d114 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -251,7 +251,8 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)background.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+					for (byte j = 0; j < 2; j++) // We draw every line twice to reach 400 picture height.
+						*(byte *)background.getBasePtr(x + 7 - i, y * 2 + j) += (pixelBit << plane);
 				}	
 			}
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index ff5bc61..222482e 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/avalanche
 
 MODULE_OBJS = \
 	avalanche.o \
+	graph.o \
 	avalot.o \
 	console.o \
 	detection.o \


Commit: 58dc18a2da981273fd0fb10ba53274a14fec88e6
    https://github.com/scummvm/scummvm/commit/58dc18a2da981273fd0fb10ba53274a14fec88e6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-13T09:21:18-07:00

Commit Message:
AVALANCHE: Move the height-doubling part from Lucerna to Graph.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index d932d12..e101749 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -79,7 +79,11 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graph::copySurface(Graphics::Surface source) {
-	_surface.copyFrom(source);
+	for (uint16 y = 0; y < _screenHeight / 2; y++)
+		for (uint16 x = 0; x < _screenWidth; x ++) {
+			for (byte j = 0; j < 2; j++) // We copy every line twice to reach 400 picture height.
+				*(byte *)_surface.getBasePtr(x, y * 2 + j) = *(byte *)source.getBasePtr(x, y);
+			}	
 }
 
 void Graph::refreshScreen() {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 493d114..e878e77 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -251,8 +251,8 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					for (byte j = 0; j < 2; j++) // We draw every line twice to reach 400 picture height.
-						*(byte *)background.getBasePtr(x + 7 - i, y * 2 + j) += (pixelBit << plane);
+					//for (byte j = 0; j < 2; j++) // We draw every line twice to reach 400 picture height.
+						*(byte *)background.getBasePtr(x + 7 - i, y /** 2 + j*/) += (pixelBit << plane);
 				}	
 			}
 
@@ -260,8 +260,6 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	background.free();
 
-	_vm->_graph.refreshScreen();
-
 
 
 


Commit: bc15033c14f658a033460589ba5d1effb1538602
    https://github.com/scummvm/scummvm/commit/bc15033c14f658a033460589ba5d1effb1538602
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-13T11:11:44-07:00

Commit Message:
AVALANCHE: Remove unnecessary comments from Lucerna::load().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e878e77..16da58c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -251,8 +251,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					//for (byte j = 0; j < 2; j++) // We draw every line twice to reach 400 picture height.
-						*(byte *)background.getBasePtr(x + 7 - i, y /** 2 + j*/) += (pixelBit << plane);
+					*(byte *)background.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
 				}	
 			}
 


Commit: 4a373a192556b573975a2d84b6c16213f122e78a
    https://github.com/scummvm/scummvm/commit/4a373a192556b573975a2d84b6c16213f122e78a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-15T02:24:38-07:00

Commit Message:
AVALANCHE: update Avalot.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ae437a6..af52635 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -29,6 +29,7 @@
 
 #include "avalanche/avalanche.h"
 
+#include "avalanche/graph.h"
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/trip6.h"
@@ -43,13 +44,15 @@
 #include "avalanche/celer2.h"
 #include "avalanche/enid2.h"
 #include "avalanche/visa2.h"
+#include "avalanche/closing2.h"
 
 /*#include "Incline.h"*/
-/*#include "Closing.h"*/
 
 #include "common/str.h"
 #include "common/textconsole.h"
 
+
+
 namespace Avalanche {
 
 void Avalot::setup() {
@@ -98,7 +101,7 @@ void Avalot::setup() {
 
 	_vm->_trip.loadtrip();
 
-	if ((_vm->_gyro.filetoload == "") && (! _vm->_gyro.reloaded))
+	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded)*)
 		_vm->_gyro.newgame(); /* no game was requested- load the default */
 	else {
 		if (! _vm->_gyro.reloaded)
@@ -145,7 +148,7 @@ void Avalot::setParent(AvalancheEngine *vm) {
 
 void Avalot::run(Common::String arg) {
 	setup();
-	
+
 	do {
 		_vm->_lucerna.clock_lucerna();
 		_vm->_basher.keyboard_link();


Commit: 885a8113bc3e47a0c37a0b8612d9dac95f78e5bd
    https://github.com/scummvm/scummvm/commit/885a8113bc3e47a0c37a0b8612d9dac95f78e5bd
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-15T03:15:49-07:00

Commit Message:
AVALANCHE: repair Avalot.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index af52635..a178328 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -101,7 +101,7 @@ void Avalot::setup() {
 
 	_vm->_trip.loadtrip();
 
-	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded)*)
+	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded))
 		_vm->_gyro.newgame(); /* no game was requested- load the default */
 	else {
 		if (! _vm->_gyro.reloaded)


Commit: 9683ced39efe6bb0033d18498f6e553506bf39e6
    https://github.com/scummvm/scummvm/commit/9683ced39efe6bb0033d18498f6e553506bf39e6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-15T07:57:03-07:00

Commit Message:
AVALANCHE: implement Lucerna::toolbar(), revise Graph::copySurface() and Graph::setPixel(), update Lucerna::load() accordingly.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index e101749..1b0e56c 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -70,20 +70,18 @@ byte *Graph::getPixel(int16 x, int16 y) {
 	return (byte *)_surface.getBasePtr(x, y);
 }
 
-void Graph::setPixel(byte *pixel, byte color) {
-	*pixel = color;
+void Graph::setPixel(int16 x, int16 y, byte color) {
+	*(byte *)_surface.getBasePtr(x, y) = color;
 }
 
 void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
-void Graph::copySurface(Graphics::Surface source) {
-	for (uint16 y = 0; y < _screenHeight / 2; y++)
-		for (uint16 x = 0; x < _screenWidth; x ++) {
-			for (byte j = 0; j < 2; j++) // We copy every line twice to reach 400 picture height.
-				*(byte *)_surface.getBasePtr(x, y * 2 + j) = *(byte *)source.getBasePtr(x, y);
-			}	
+void Graph::copySurface(Graphics::Surface source, uint16 destX, uint16 destY) {
+	for (uint16 y = 0; y < source.h; y++)
+		for (uint16 x = 0; x < source.w; x++)
+			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)source.getBasePtr(x, y);		
 }
 
 void Graph::refreshScreen() {
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 559e78c..3d819d1 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 class Graph {
 public:
 	static const int16 _screenWidth = 640;
-	static const int16 _screenHeight = 400;
+	static const int16 _screenHeight = 200;
 
 	
 
@@ -50,11 +50,11 @@ public:
 
 	byte *getPixel(int16 x, int16 y);
 
-	void setPixel(byte *pixel, byte color);
+	void setPixel(int16 x, int16 y, byte color);
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
-	void copySurface(Graphics::Surface source);
+	void copySurface(Graphics::Surface source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 16da58c..f665c54 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -240,14 +240,16 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	}*/
 
 	Graphics::Surface background;
-	background.create(_vm->_graph._screenWidth, _vm->_graph._screenHeight, Graphics::PixelFormat::createFormatCLUT8());
-
+	
+	uint16 backgroundWidht = _vm->_graph._screenWidth;
 	byte backgroundHeight = 8 * 12080 / _vm->_graph._screenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
+	background.create(backgroundWidht, backgroundHeight, Graphics::PixelFormat::createFormatCLUT8());
+
 	for (byte plane = 0; plane < 4; plane++)
 		for (uint16 y = 0; y < backgroundHeight; y++)
-			for (uint16 x = 0; x < _vm->_graph._screenWidth; x += 8) {
+			for (uint16 x = 0; x < backgroundWidht; x += 8) {
 				byte pixel = f.readByte();
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
@@ -255,7 +257,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				}	
 			}
 
-	_vm->_graph.copySurface(background);
+	_vm->_graph.copySurface(background, 0 ,0);
 
 	background.free();
 
@@ -823,35 +825,41 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 }
 
 void Lucerna::toolbar() {
-	uint16 s;
-	byte *p;
-
 	if (!f.open("useful.avd")) {
 		warning("AVALANCHE: Lucerna: File not found: useful.avd");
 		return;
 	}
 
-	s = f.size() - 40;
-	p = new byte[s];
 	f.seek(40);
-	f.read(p, s);
-	f.close();
+	
 	/* off;*/
 
-	//setcolor(15); /* (And sent for chrysanthemums...) Yellow and white. */
-	//setfillstyle(1, 6);
-	//for (byte fv = 0; fv <= 1; fv ++) {
-	//	setactivepage(fv);
-	//	putimage(5, 169, p, 0);
-	//	if (demo) {
-	//		bar(264, 177, 307, 190);
-	//		outtextxy(268, 188, "Demo!"); /* well... actually only white now. */
-	//	}
-	//}
+	uint16 toolbarWidth = f.readUint16LE() + 1;
+	uint16 toolbarHeight = f.readUint16LE() + 1;
+
+	Graphics::Surface toolbar;
+	toolbar.create(toolbarWidth, toolbarHeight, Graphics::PixelFormat::createFormatCLUT8());
+	
+	for (byte y = 0; y < toolbarHeight; y++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 x = 0; x < toolbarWidth; x += 8) {
+				byte pixel = f.readByte();
+				for (byte i = 0; i < 8; i++) {
+					byte pixelBit = (pixel >> i) & 1;
+					*(byte *)toolbar.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+				} 
+			}
+	
+	_vm->_graph.copySurface(toolbar, 5, 169);
+
+	toolbar.free();
+
+	f.close();
+
 	warning("STUB: Lucerna::toolbar()");
 
 	/* on;*/
-	delete[] p;
+
 	_vm->_gyro.oldrw = 177;
 	showrw();
 }


Commit: fa1b5d3f3afb5d21fa4d8250e80699dc9fe00bfe
    https://github.com/scummvm/scummvm/commit/fa1b5d3f3afb5d21fa4d8250e80699dc9fe00bfe
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-15T09:27:26-07:00

Commit Message:
AVALANCHE: Update Graph.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 1b0e56c..712e3a6 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,7 +78,7 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
-void Graph::copySurface(Graphics::Surface source, uint16 destX, uint16 destY) {
+void Graph::copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY) {
 	for (uint16 y = 0; y < source.h; y++)
 		for (uint16 x = 0; x < source.w; x++)
 			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)source.getBasePtr(x, y);		
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 3d819d1..7c09071 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -54,7 +54,7 @@ public:
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
-	void copySurface(Graphics::Surface source, uint16 destX, uint16 destY);
+	void copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
 


Commit: 1c95316924a759ebae91ceaf4f0963c8a4a579cc
    https://github.com/scummvm/scummvm/commit/1c95316924a759ebae91ceaf4f0963c8a4a579cc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-16T02:11:31-07:00

Commit Message:
AVALANCHE: Implement getsettype::remember().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 3bc6d4c..786dfa4 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -370,7 +370,8 @@ getsettype *getsettype::init() {
 
 void getsettype::remember(bytefield r) {
 	numleft++;
-	warning("STUB: getsettype::remember()");
+	if (numleft > maxgetset)
+		error("Trip::remember() : runerr_Getset_Overflow");
 	gs[numleft] = r;
 }
 


Commit: c8bf87918a7dc5b99beed563e01d9f71654628df
    https://github.com/scummvm/scummvm/commit/c8bf87918a7dc5b99beed563e01d9f71654628df
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-16T03:47:51-07:00

Commit Message:
AVALANCHE: Repair Scrolls::state().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 972091d..e2288b2 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -93,7 +93,6 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	_vm->_gyro.super_off();
 
 	_vm->_graph.drawBar(419, 195, 438, 197, color);
-	_vm->_graph.refreshScreen();
 
 	_vm->_gyro.super_on();
 	_vm->_gyro.ledstatus = x;


Commit: 964374024b64c58925541171a5ae506b6dceae4a
    https://github.com/scummvm/scummvm/commit/964374024b64c58925541171a5ae506b6dceae4a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-16T04:03:22-07:00

Commit Message:
AVALANCHE: Add new Graph::readImage(), implement Lucerna::thinkabout() using it and use it in Lucerna::toolbar() as well.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 712e3a6..2272fb6 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,6 +78,27 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
+Graphics::Surface *Graph::readImage(Common::File &f) {
+	Graphics::Surface *picture = new Graphics::Surface;
+
+	uint16 pictureWidth = f.readUint16LE() + 1;
+	uint16 pictureHeight = f.readUint16LE() + 1;
+
+	picture->create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
+
+	for (byte y = 0; y < pictureHeight; y++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 x = 0; x < pictureWidth; x += 8) {
+				byte pixel = f.readByte();
+				for (byte i = 0; i < 8; i++) {
+					byte pixelBit = (pixel >> i) & 1;
+					*(byte *)picture->getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+				} 
+			}
+
+	return picture;
+}
+
 void Graph::copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY) {
 	for (uint16 y = 0; y < source.h; y++)
 		for (uint16 x = 0; x < source.w; x++)
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 7c09071..7d5f12f 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -30,6 +30,8 @@
 #ifndef GRAPH_H
 #define GRAPH_H
 
+#include "common/file.h"
+
 #include "graphics/surface.h"
 
 namespace Avalanche {
@@ -54,6 +56,9 @@ public:
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
+	// Must free the returened pointer!!!
+	Graphics::Surface *readImage(Common::File &f);
+
 	void copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f665c54..fb54376 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -732,71 +732,56 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 }
 
-void Lucerna::thinkabout(char z, bool th) {     /* Hey!!! Get it and put it!!! */
+void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! */
 	const int16 x = 205;
 	const int16 y = 170;
 	const int16 picsize = 966;
 	const bytefield thinkspace = {25, 170, 32, 200};
-	byte *p;
-	byte fv;
-
 
 	_vm->_gyro.thinks = z;
 	z--;
 
+	_vm->_gyro.wait();
+
 	if (th) {
-		/* Things */
-		_vm->_gyro.wait();
-	
-		p = new byte[picsize];
-	
 		if (!f.open("thinks.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
 			return;
 		}
-
-		f.seek(z * picsize + 65);
-
-		f.read(p, picsize);
-
-		_vm->_gyro.off();
-
-		f.close();
 	} else {
-		/* People */
-		_vm->_gyro.wait();
-
-		p = new byte[picsize];
-
 		if (!f.open("folk.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: folk.avd");
 			return;
 		}
 
-		fv = z - 149;
-		if (fv >= 25)
-			fv -= 8;
-		if (fv == 20) 
-			fv--; /* Last time... */
+		z = z - 149;
+		if (z >= 25)
+			z -= 8;
+		if (z == 20) 
+			z--; /* Last time... */
 
-		f.seek(fv * picsize + 65);
+	}
 
-		f.read(p, picsize);
+	f.seek(z * picsize + 65);
 
-		_vm->_gyro.off();
+	Graphics::Surface *picture = _vm->_graph.readImage(f);
 
-		f.close();
-	}
+	_vm->_graph.copySurface(*picture, x, y);
+
+	picture->free();
+
+	delete picture;
+
+	f.close();
+
+	_vm->_gyro.off();
 
 	/*setactivepage(3);
 	putimage(x, y, p, 0);
 	setactivepage(1 - cp);*/
-	warning("STUB: Lucerna::thinkabout()");
 
-	for (fv = 0; fv <= 1; fv ++)
+	for (byte fv = 0; fv <= 1; fv ++)
 		_vm->_trip.getset[fv].remember(thinkspace);
-
-	delete[] p;
 	
 	_vm->_gyro.on();
 	_vm->_gyro.thinkthing = th;
@@ -834,29 +819,15 @@ void Lucerna::toolbar() {
 	
 	/* off;*/
 
-	uint16 toolbarWidth = f.readUint16LE() + 1;
-	uint16 toolbarHeight = f.readUint16LE() + 1;
+	Graphics::Surface *toolbar = _vm->_graph.readImage(f);
 
-	Graphics::Surface toolbar;
-	toolbar.create(toolbarWidth, toolbarHeight, Graphics::PixelFormat::createFormatCLUT8());
-	
-	for (byte y = 0; y < toolbarHeight; y++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 x = 0; x < toolbarWidth; x += 8) {
-				byte pixel = f.readByte();
-				for (byte i = 0; i < 8; i++) {
-					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)toolbar.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
-				} 
-			}
-	
-	_vm->_graph.copySurface(toolbar, 5, 169);
+	_vm->_graph.copySurface(*toolbar, 5, 169);
 
-	toolbar.free();
+	toolbar->free();
 
-	f.close();
+	delete toolbar;
 
-	warning("STUB: Lucerna::toolbar()");
+	f.close();
 
 	/* on;*/
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 94da2db..ca23845 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -58,7 +58,7 @@ public:
 
 	void enterroom(byte x, byte ped);
 
-	void thinkabout(char z, bool th);      /* Hey!!! Get it and put it!!! */
+	void thinkabout(byte z, bool th);      /* Hey!!! Get it and put it!!! */
 
 	void load_digits();    /* Load the scoring digits & rwlites */
 


Commit: 251c4b0acb702aac814e0fa442bc0d1d0a5bfde5
    https://github.com/scummvm/scummvm/commit/251c4b0acb702aac814e0fa442bc0d1d0a5bfde5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-16T13:47:07-07:00

Commit Message:
AVALANCHE: Revise Lucerna, remove a blank line in Trip.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index fb54376..6ec856f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -90,6 +90,7 @@ void Lucerna::draw_also_lines() {
 
 
 
+// nextstring, scram1 and unscrable are only used in load_also 
 
 Common::String Lucerna::nextstring() {
 	Common::String str;
@@ -111,6 +112,8 @@ void Lucerna::unscramble() {
 				scram1(*_vm->_gyro.also[fv][ff]);
 	scram1(_vm->_gyro.listen);
 	scram1(_vm->_gyro.flags);
+	/*     for fz:=1 to length(also[fv,ff]^) do
+	      also[fv,ff]^[fz]:=chr(ord(also[fv,ff]^[fz]) xor 177);*/
 }
 
 void Lucerna::load_also(Common::String n) {
@@ -143,6 +146,7 @@ void Lucerna::load_also(Common::String n) {
 	
 	memset(_vm->_gyro.lines, 0xFF, sizeof(_vm->_gyro.lines));
 	
+	//fv = getpixel(0, 0);
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
 		_vm->_gyro.lines[i].x1 = f.readSint16LE();
@@ -261,11 +265,10 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	background.free();
 
+	f.close();
 
 
 
-	f.close();
-
 	load_also(xx);
 	_vm->_celer.load_chunks(xx);
 
@@ -291,44 +294,38 @@ void Lucerna::zoomout(int16 x, int16 y) {
 }
 
 void Lucerna::find_people(byte room) {
-	char fv;
-
-	for (fv = 151; fv <= 178; fv ++)
+	for (byte fv = 151; fv <= 178; fv++)
 		if (_vm->_gyro.whereis[fv] == room) {
-			if (fv < 175)  _vm->_gyro.him = fv;
-			else _vm->_gyro.her = fv;
+			if (fv < 175)
+				_vm->_gyro.him = fv;
+			else
+				_vm->_gyro.her = fv;
 		}
 }
 
 void Lucerna::exitroom(byte x) {
 	//nosound();
 	_vm->_celer.forget_chunks();
-	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the
-  length of this procedure. */
+	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
 
-	{
-		dnatype &with = _vm->_gyro.dna;
-		switch (x) {
-		case r__spludwicks: {
-			_vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks);
-			/* He doesn't HAVE to be talking for this to work. It just deletes it IF it
-			exists. */        with.avaricius_talk = 0;
-		}
+	switch (x) {
+	case r__spludwicks:
+		_vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks);
+		 _vm->_gyro.dna.avaricius_talk = 0;
+		/* He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. */       
 		break;
-		case r__bridge:
-			if (with.drawbridge_open > 0) {
-				with.drawbridge_open = 4; /* Fully open. */
-				_vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls);
-			}
-			break;
-		case r__outsidecardiffcastle:
-			_vm->_timeout.lose_timer(_vm->_timeout.reason_cardiffsurvey);
-			break;
-
-		case r__robins:
-			_vm->_timeout.lose_timer(_vm->_timeout.reason_getting_tied_up);
-			break;
+	case r__bridge:
+		if (_vm->_gyro.dna.drawbridge_open > 0) {
+			_vm->_gyro.dna.drawbridge_open = 4; /* Fully open. */
+			_vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls);
 		}
+		break;
+	case r__outsidecardiffcastle:
+		_vm->_timeout.lose_timer(_vm->_timeout.reason_cardiffsurvey);
+		break;
+	case r__robins:
+		_vm->_timeout.lose_timer(_vm->_timeout.reason_getting_tied_up);
+		break;
 	}
 
 	_vm->_gyro.interrogation = 0; /* Leaving the room cancels all the questions automatically. */
@@ -345,8 +342,7 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 
 	switch (_vm->_gyro.dna.room) {
 	case r__outsidenottspub: /* Entry into Nottingham. */
-		if ((_vm->_gyro.dna.rooms[r__robins] > 0) && (_vm->_gyro.dna.been_tied_up) &&
-		        (! _vm->_gyro.dna.taken_mushroom))
+		if ((_vm->_gyro.dna.rooms[r__robins] > 0) && (_vm->_gyro.dna.been_tied_up) && (! _vm->_gyro.dna.taken_mushroom))
 			_vm->_gyro.dna.mushroom_growing = true;
 		break;
 	case r__wisewomans: { /* Entry into Argent. */
@@ -371,7 +367,8 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 
 
 void Lucerna::put_geida_at(byte whichped, byte &ped) {
-	if (ped == 0)  return;
+	if (ped == 0)
+		return;
 	_vm->_trip.tr[2].init(5, false, &_vm->_trip); /* load Geida */
 	_vm->_trip.apped(2, whichped);
 	_vm->_trip.tr[2].call_eachstep = true;
@@ -383,7 +380,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	find_people(x);
 	_vm->_gyro.dna.room = x;
-	if (ped != 0)  _vm->_gyro.dna.rooms[x] += 1;
+	if (ped != 0)
+		_vm->_gyro.dna.rooms[x]++;
 
 	load(x);
 
@@ -397,11 +395,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	_vm->_gyro.roomtime = 0;
 
-	{
-		dnatype &with = _vm->_gyro.dna;
-		if ((with.last_room == r__map) && (with.last_room_not_map != with.room))
-			new_town();
-	}
+	
+	if ((_vm->_gyro.dna.last_room == r__map) && (_vm->_gyro.dna.last_room_not_map != _vm->_gyro.dna.room))
+		new_town();
+	
 
 	switch (x) {
 	case r__yours:
@@ -690,7 +687,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__aylesoffice:
-		if (_vm->_gyro.dna.ayles_is_awake)  _vm->_celer.show_one(2);
+		if (_vm->_gyro.dna.ayles_is_awake)
+			_vm->_celer.show_one(2);
 		break; /* Ayles awake. */
 
 	case r__geidas:
@@ -884,67 +882,67 @@ void Lucerna::fxtoggle() {
 }
 
 void Lucerna::objectlist() {
-	char fv;
-
 	_vm->_gyro.dna.carrying = 0;
 	if (_vm->_gyro.thinkthing && ! _vm->_gyro.dna.obj[_vm->_gyro.thinks])
 		thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing); /* you always have money */
-	for (fv = '\1'; fv <= numobjs; fv ++)
+	for (byte fv = 0; fv < numobjs; fv ++)
 		if (_vm->_gyro.dna.obj[fv]) {
-			_vm->_gyro.dna.carrying += 1;
-			_vm->_gyro.objlist[_vm->_gyro.dna.carrying] = fv;
+			_vm->_gyro.dna.carrying ++;
+			_vm->_gyro.objlist[_vm->_gyro.dna.carrying] = fv + 1;
 		}
 }
 
 void Lucerna::verte() {
 	byte what;
 
-	if (! _vm->_gyro.dna.user_moves_avvy)  return;
-	{
-		triptype &with = _vm->_trip.tr[1];  /* that's the only one we're interested in here */
-
-
-		if (_vm->_gyro.mx < with.x)  what = 1;
-		else if (_vm->_gyro.mx > (unsigned char)(with.x + with.a.xl))  what = 2;
-		else
-			what = 0; /* On top */
-
-		if (_vm->_gyro.my < with.y)  what += 3;
-		else if (_vm->_gyro.my > (unsigned char)(with.y + with.a.yl))  what += 6;
+	if (! _vm->_gyro.dna.user_moves_avvy) 
+		return;
 
-		switch (what) {
-		case 0:
-			_vm->_trip.stopwalking();
-			break; /* Clicked on Avvy- no movement */
-		case 1:
-			_vm->_trip.rwsp(1, _vm->_trip.left);
-			break;
-		case 2:
-			_vm->_trip.rwsp(1, _vm->_trip.right);
-			break;
-		case 3:
-			_vm->_trip.rwsp(1, _vm->_trip.up);
-			break;
-		case 4:
-			_vm->_trip.rwsp(1, _vm->_trip.ul);
-			break;
-		case 5:
-			_vm->_trip.rwsp(1, _vm->_trip.ur);
-			break;
-		case 6:
-			_vm->_trip.rwsp(1, _vm->_trip.down);
-			break;
-		case 7:
-			_vm->_trip.rwsp(1, _vm->_trip.dl);
-			break;
-		case 8:
-			_vm->_trip.rwsp(1, _vm->_trip.dr);
-			break;
-		}    /* no other values are possible... */
 
-		showrw();
+	/* _vm->_trip.tr[0] : that's the only one we're interested in here */
+	if (_vm->_gyro.mx < _vm->_trip.tr[0].x) 
+		what = 1;
+	else if (_vm->_gyro.mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0].a.xl)) 
+		what = 2;
+	else
+		what = 0; /* On top */
+
+	if (_vm->_gyro.my < _vm->_trip.tr[0].y)
+		what += 3;
+	else if (_vm->_gyro.my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0].a.yl))
+		what += 6;
+
+	switch (what) {
+	case 0:
+		_vm->_trip.stopwalking();
+		break; /* Clicked on Avvy- no movement */
+	case 1:
+		_vm->_trip.rwsp(1, _vm->_trip.left);
+		break;
+	case 2:
+		_vm->_trip.rwsp(1, _vm->_trip.right);
+		break;
+	case 3:
+		_vm->_trip.rwsp(1, _vm->_trip.up);
+		break;
+	case 4:
+		_vm->_trip.rwsp(1, _vm->_trip.ul);
+		break;
+	case 5:
+		_vm->_trip.rwsp(1, _vm->_trip.ur);
+		break;
+	case 6:
+		_vm->_trip.rwsp(1, _vm->_trip.down);
+		break;
+	case 7:
+		_vm->_trip.rwsp(1, _vm->_trip.dl);
+		break;
+	case 8:
+		_vm->_trip.rwsp(1, _vm->_trip.dr);
+		break;
+	}    /* no other values are possible... */
 
-	}
+	showrw();
 }
 
 void Lucerna::checkclick() {
@@ -964,19 +962,15 @@ void Lucerna::errorled() {
 }
 
 int8 Lucerna::fades(int8 x) {
-	byte r, g, b;
-
-	int8 fades_result;
-	r = x / 16;
+	byte r = x / 16;
 	x = x % 16;
-	g = x / 4;
-	b = x % 4;
-	if (r > 0)  r -= 1;
-	if (g > 0)  g -= 1;
-	if (b > 0)  b -= 1;
-	fades_result = (16 * r + 4 * g + b);
+	byte g = x / 4;
+	byte b = x % 4;
+	if (r > 0)  r --;
+	if (g > 0)  g --;
+	if (b > 0)  b --;
+	return (16 * r + 4 * g + b);
 	/* fades:=x-1;*/
-	return fades_result;
 }
 
 
@@ -1155,11 +1149,11 @@ void Lucerna::delavvy() {
 	byte page_;
 
 	_vm->_gyro.off();
-	{
-		triptype &with = _vm->_trip.tr[1];
-		for (page_ = 0; page_ <= 1; page_ ++)
-			mblit(with.x / 8, with.y, (with.x + with.a.xl) / 8 + 1, with.y + with.a.yl, 3, page_);
-	}
+	
+	triptype &with = _vm->_trip.tr[0];
+	for (page_ = 0; page_ <= 1; page_ ++)
+		mblit(with.x / 8, with.y, (with.x + with.a.xl) / 8 + 1, with.y + with.a.yl, 3, page_);
+	
 	blitfix();
 	_vm->_gyro.on();
 }
@@ -1197,13 +1191,9 @@ void Lucerna::minor_redraw() {
 		_vm->_trip.getback();
 	}
 
-	{
-		dnatype &with = _vm->_gyro.dna;
-
-		_vm->_gyro.lastscore = "TJA"; /* impossible digits */
-		showscore();
-	}
-
+	_vm->_gyro.lastscore = "TJA"; /* impossible digits */
+	showscore();
+	
 	dawn();
 }
 
@@ -1220,10 +1210,10 @@ uint16 Lucerna::bearing(byte whichped) {
 		pedtype &with = _vm->_gyro.peds[whichped];
 		if (_vm->_trip.tr[1].x == with.x)
 			bearing_result = 0; /* This would cause a division by zero if we let it through. */
-		else
+		else {
 			/*
 			 bearing:=trunc(((arctan((_vm->_trip.tr[1].y-y)/(_vm->_trip.tr[1].x-x)))*rad2deg)+90) mod 360*/
-		{
+		
 			if (_vm->_trip.tr[1].x < with.x)
 				bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 90;
 			else
@@ -1261,15 +1251,13 @@ asm
 {
 }
 
-void Lucerna::sprite_run()
-/* A sprite run is performed before _vm->_scrolls.displaying a scroll, if not all the
+void Lucerna::sprite_run() {
+/* A sprite run is performed before displaying a scroll, if not all the
   sprites are still. It performs two fast cycles, only using a few of
   the links usually used, and without any extra animation. This should
   make the sprites the same on both pages. */
-{
 	byte fv;
 
-
 	_vm->_gyro.doing_sprite_run = true;
 
 	for (fv = 0; fv <= 1; fv ++) {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index ca23845..6a62a7d 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -145,7 +145,6 @@ private:
 	Common::String nextstring();
 	void scram1(Common::String &x);
 	void unscramble();
-	//lódalszó
 
 	void zoomout(int16 x, int16 y);
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 786dfa4..a4365f4 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -363,6 +363,8 @@ triptype *triptype::done() {
 	return this;
 }
 
+
+
 getsettype *getsettype::init() {
 	numleft = 0; /* initialise array pointer */
 	return this;


Commit: 66cf00ab110b09e3f1d426a97cfeca7109a525b3
    https://github.com/scummvm/scummvm/commit/66cf00ab110b09e3f1d426a97cfeca7109a525b3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-17T02:35:40-07:00

Commit Message:
AVALANCHE: Change the source of data in Graph::readImage() for further use. Change existing use of the function accordingly in Lucerna.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 2272fb6..2143bcf 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,18 +78,22 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
-Graphics::Surface *Graph::readImage(Common::File &f) {
+Graphics::Surface *Graph::readImage(const byte *source) {
 	Graphics::Surface *picture = new Graphics::Surface;
+	
+	uint32 i = 0;
 
-	uint16 pictureWidth = f.readUint16LE() + 1;
-	uint16 pictureHeight = f.readUint16LE() + 1;
+	uint16 pictureWidth = (source[i++] + 1);
+	pictureWidth +=  (source[i++] << 8);
+	uint16 pictureHeight = (source[i++] + 1); 
+	pictureHeight += (source[i++] << 8);
 
 	picture->create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
 
 	for (byte y = 0; y < pictureHeight; y++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
 			for (uint16 x = 0; x < pictureWidth; x += 8) {
-				byte pixel = f.readByte();
+				byte pixel = source[i++];
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
 					*(byte *)picture->getBasePtr(x + 7 - i, y) += (pixelBit << plane);
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 7d5f12f..f1a6678 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -57,7 +57,7 @@ public:
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
 	// Must free the returened pointer!!!
-	Graphics::Surface *readImage(Common::File &f);
+	Graphics::Surface *readImage(const byte *source);
 
 	void copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 6ec856f..a72b5b1 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -731,8 +731,6 @@ void Lucerna::enterroom(byte x, byte ped) {
 }
 
 void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! */
-	const int16 x = 205;
-	const int16 y = 170;
 	const int16 picsize = 966;
 	const bytefield thinkspace = {25, 170, 32, 200};
 
@@ -762,14 +760,20 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	f.seek(z * picsize + 65);
 
-	Graphics::Surface *picture = _vm->_graph.readImage(f);
+	byte *buffer = new byte[picsize];
 
-	_vm->_graph.copySurface(*picture, x, y);
+	f.read(buffer, picsize);
+
+	Graphics::Surface *picture = _vm->_graph.readImage(buffer);
+
+	_vm->_graph.copySurface(*picture, 205, 170);
 
 	picture->free();
 
 	delete picture;
 
+	delete[] buffer;
+
 	f.close();
 
 	_vm->_gyro.off();
@@ -817,7 +821,13 @@ void Lucerna::toolbar() {
 	
 	/* off;*/
 
-	Graphics::Surface *toolbar = _vm->_graph.readImage(f);
+	uint32 bufferSize = f.size()-40;
+
+	byte *buffer = new byte[bufferSize];
+
+	f.read(buffer, bufferSize);
+
+	Graphics::Surface *toolbar = _vm->_graph.readImage(buffer);
 
 	_vm->_graph.copySurface(*toolbar, 5, 169);
 
@@ -825,6 +835,8 @@ void Lucerna::toolbar() {
 
 	delete toolbar;
 
+	delete[] buffer;
+
 	f.close();
 
 	/* on;*/
@@ -834,6 +846,56 @@ void Lucerna::toolbar() {
 }
 
 void Lucerna::showscore() {
+
+	const bytefield scorespace = {33, 177, 39, 200};
+	Common::String q;
+
+	if (_vm->_gyro.demo)
+		return;
+
+	_vm->_gyro.dna.score = 156;
+	byte score = _vm->_gyro.dna.score;
+	byte numbers[3] = {0, 0, 0};
+	for (byte i = 0; i < 2; i++) {
+		byte divisor = 1;
+		for (byte j = 0; j < (2 - i); j++)
+			divisor *= 10;
+		numbers[i] = score / divisor;
+		score -= numbers[i] * divisor;
+	}
+	numbers[2] = score;
+
+
+
+
+	//Át kell írni a Graph::copySurface() -t hogy *byte tömböt kapjon és mindehol így is használni!!!!
+
+
+
+
+
+	
+
+	//str(_vm->_gyro.dna.score, q);
+	//while (q[0] < '\3')  q = string('0') + q;
+
+	//str(dna.score,q);
+	//while q[0]<#3 do q:='0'+q;
+
+	//_vm->_gyro.off();
+
+	////setactivepage(3);
+	//for (byte fv = 0; fv < 3; fv ++)
+	//	if (_vm->_gyro.lastscore[fv] != q[fv])
+	//		putimage(250 + fv * 15, 177, _vm->_gyro.digit[q[fv]], 0);
+
+	//for (byte fv = 0; fv <= 1; fv ++)
+	//	_vm->_trip.getset[fv].remember(scorespace);
+
+	//setactivepage(1 - cp);
+	_vm->_gyro.on();
+	_vm->_gyro.lastscore = q;
+
 	warning("STUB: Lucerna::showscore()");
 }
 


Commit: 90788cec113de7c9d26058cfa5e103c475105c21
    https://github.com/scummvm/scummvm/commit/90788cec113de7c9d26058cfa5e103c475105c21
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-17T03:27:08-07:00

Commit Message:
AVALANCHE: Implement Lucerna::showscore().

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 39fabf8..1f9d9a1 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -525,7 +525,7 @@ public:
 	byte *digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
 	byte *rwlite[9]; // Maybe it will be needed to move them to the class itself instead.
 	byte oldrw;
-	Common::String lastscore;
+	int8 lastscore[3];
 	byte cmp; /* current mouse-void **/
 	Common::String verbstr; /* what you can do with your object. :-) */
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a72b5b1..b4febf2 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -848,14 +848,12 @@ void Lucerna::toolbar() {
 void Lucerna::showscore() {
 
 	const bytefield scorespace = {33, 177, 39, 200};
-	Common::String q;
 
 	if (_vm->_gyro.demo)
 		return;
 
-	_vm->_gyro.dna.score = 156;
-	byte score = _vm->_gyro.dna.score;
-	byte numbers[3] = {0, 0, 0};
+	uint16 score = _vm->_gyro.dna.score;
+	int8 numbers[3] = {0, 0, 0};
 	for (byte i = 0; i < 2; i++) {
 		byte divisor = 1;
 		for (byte j = 0; j < (2 - i); j++)
@@ -865,38 +863,29 @@ void Lucerna::showscore() {
 	}
 	numbers[2] = score;
 
+	_vm->_gyro.off();
 
+	//setactivepage(3);
 
+	for (byte fv = 0; fv < 3; fv ++)
+		if (_vm->_gyro.lastscore[fv] != numbers[fv]) {
+			Graphics::Surface *digit = _vm->_graph.readImage(_vm->_gyro.digit[numbers[fv]]);
 
-	//Át kell írni a Graph::copySurface() -t hogy *byte tömböt kapjon és mindehol így is használni!!!!
-
-
-
-
-
-	
-
-	//str(_vm->_gyro.dna.score, q);
-	//while (q[0] < '\3')  q = string('0') + q;
-
-	//str(dna.score,q);
-	//while q[0]<#3 do q:='0'+q;
+			_vm->_graph.copySurface(*digit, 250 + (fv + 1) * 15, 177);
 
-	//_vm->_gyro.off();
+			digit->free();
 
-	////setactivepage(3);
-	//for (byte fv = 0; fv < 3; fv ++)
-	//	if (_vm->_gyro.lastscore[fv] != q[fv])
-	//		putimage(250 + fv * 15, 177, _vm->_gyro.digit[q[fv]], 0);
+			delete digit;
+		}
 
-	//for (byte fv = 0; fv <= 1; fv ++)
-	//	_vm->_trip.getset[fv].remember(scorespace);
+	for (byte fv = 0; fv < 2; fv ++)
+		_vm->_trip.getset[fv].remember(scorespace);
 
 	//setactivepage(1 - cp);
-	_vm->_gyro.on();
-	_vm->_gyro.lastscore = q;
 
-	warning("STUB: Lucerna::showscore()");
+	_vm->_gyro.on();
+	for (byte i = 0; i < 3; i++)
+		_vm->_gyro.lastscore[i] = numbers[i];
 }
 
 void Lucerna::points(byte num) {     /* Add on no. of points */
@@ -1252,8 +1241,9 @@ void Lucerna::minor_redraw() {
 		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
 		_vm->_trip.getback();
 	}
-
-	_vm->_gyro.lastscore = "TJA"; /* impossible digits */
+	
+	for (byte i = 0; i < 3; i++)
+		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
 	showscore();
 	
 	dawn();


Commit: b6f42c532ec07be6052d32d2fd86b49c3ca7331b
    https://github.com/scummvm/scummvm/commit/b6f42c532ec07be6052d32d2fd86b49c3ca7331b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-17T04:00:15-07:00

Commit Message:
AVALANCHE: Partially implement Lucerna::points(). (No sounds.)

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index b4febf2..25a571b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -889,7 +889,17 @@ void Lucerna::showscore() {
 }
 
 void Lucerna::points(byte num) {     /* Add on no. of points */
+	for (byte q = 1; q <= num; q ++) {
+		_vm->_gyro.dna.score++;
+		/*if (soundfx)
+			for (byte fv = 1; fv <= 97; fv ++)
+				sound(177 + dna.score * 3);
+		nosound;*/
+	}
 	warning("STUB: Lucerna::points()");
+
+	_vm->_logger.log_score(num, _vm->_gyro.dna.score);
+	showscore();
 }
 
 void Lucerna::topcheck() {


Commit: d3ec729c8f7dff3689775ad32a42399e4f1ae015
    https://github.com/scummvm/scummvm/commit/d3ec729c8f7dff3689775ad32a42399e4f1ae015
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-17T11:48:55-07:00

Commit Message:
AVALANCHE: Add Graph::drawLine().

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 2143bcf..9b5662e 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,6 +78,10 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
+void Graph::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
+	_surface.drawLine(x0, y0, x1, y1, color);
+}
+
 Graphics::Surface *Graph::readImage(const byte *source) {
 	Graphics::Surface *picture = new Graphics::Surface;
 	
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index f1a6678..d602864 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -56,7 +56,9 @@ public:
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
-	// Must free the returened pointer!!!
+	void drawLine(int x0, int y0, int x1, int y1, uint32 color);
+
+	// Must free the returned pointer!!!
 	Graphics::Surface *readImage(const byte *source);
 
 	void copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY);


Commit: 42928502977918deafb68987d7c1e54a3bc65490
    https://github.com/scummvm/scummvm/commit/42928502977918deafb68987d7c1e54a3bc65490
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T03:04:04-07:00

Commit Message:
AVALANCHE: Stub Dropdown::lightup().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index d0d9005..bdb8148 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -139,12 +139,13 @@ void onemenu::movehighlight(int8 add) {
 }
 
 void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
-	if ((_dr->_vm->_gyro.mx < flx1 * 8) || (_dr->_vm->_gyro.mx > flx2 * 8) ||
+	warning("STUB: Dropdown::onemenu::lightup()");
+	/*if ((_dr->_vm->_gyro.mx < flx1 * 8) || (_dr->_vm->_gyro.mx > flx2 * 8) ||
 		(_dr->_vm->_gyro.my <= 12) || (_dr->_vm->_gyro.my > fly - 3))
 			return;
 	highlightnum = (_dr->_vm->_gyro.my - 13) / 10;
 	if (highlightnum == oldy)  return;
-	movehighlight(0);
+	movehighlight(0);*/
 	
 }
 


Commit: dd511cfc0983cb29a22a8f60f26c8c065726844b
    https://github.com/scummvm/scummvm/commit/dd511cfc0983cb29a22a8f60f26c8c065726844b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T03:06:45-07:00

Commit Message:
AVALANCHE: Implement Gyro::newgame(), update Avalot::setup() and Avalot::run(), add some comment in gyro2.h.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a178328..ec5d9ad 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -92,7 +92,8 @@ void Avalot::setup() {
 	_vm->_lucerna.toolbar();
 	_vm->_scrolls.state(2);
 	_vm->_pingo.copy03();
-	_vm->_gyro.lastscore = "TJA";
+	for (byte i = 0; i < 3; i++)
+		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
 
 	/* for gd:=0 to 1 do
 	 begin
@@ -101,6 +102,8 @@ void Avalot::setup() {
 
 	_vm->_trip.loadtrip();
 
+	_vm->_gyro.reloaded = false; // TODO: Remove it later, when SAVE/LOAD system is implemented. Until then, we always start a new game.
+
 	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded))
 		_vm->_gyro.newgame(); /* no game was requested- load the default */
 	else {
@@ -169,7 +172,9 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_timeout.one_tick();
 
-	} while (! _vm->_gyro.lmo);
+		_vm->_graph.refreshScreen();
+
+	} while (false /*! _vm->_gyro.lmo*/); // So we run only one cycle during the testing. Of course it will be restored later.
 
 	//restorecrtmode();
 	//if (logging)
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 8319c17..054019e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -40,6 +40,8 @@
 #include "common/textconsole.h"
 #include "common/file.h"
 
+#include "common/random.h"
+
 //#include "dropdown.h"
 //#include "basher.h"
 
@@ -347,6 +349,62 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 }
 
 void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
+	byte gd, gm;
+
+	for (gm = 0; gm < numtr; gm ++)
+		if (_vm->_trip.tr[gm].quick)
+			_vm->_trip.tr[gm].done();
+	/* Deallocate sprite. Sorry, beta testers! */
+
+	_vm->_trip.tr[1].init(0, true, &_vm->_trip);
+	alive = true;
+
+	score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
+	memset(&_vm->_gyro.dna, 0, sizeof(dnatype));
+	_vm->_scrolls.natural();
+	_vm->_basher.normal_edit();
+	_vm->_lucerna.mousepage(0);
+	dna.spare_evening = "answer a questionnaire";
+	dna.like2drink = "beer";
+
+	dna.pence = 30; /* 2/6 */ dna.rw = stopped;
+	dna.wearing = clothes;
+	dna.obj[money] = true;
+	dna.obj[bodkin] = true;
+	dna.obj[bell] = true;
+	dna.obj[clothes] = true;
+	
+	thinks = '\2';
+	_vm->_lucerna.objectlist();
+	ontoolbar = false;
+	seescroll = false;
+
+	ppos[0][1] = -177; /*tr[1].appear(300,117,right);*/ gd = 0;
+	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
+	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
+	him = 254;
+	her = 254;
+	it = 254;
+	last_person = 254; /* = Pardon? */
+	dna.pass_num = _vm->_rnd->getRandomNumber(30) + 1;//Random(30) + 1;
+	after_the_scroll = false;
+	dna.user_moves_avvy = false;
+	doing_sprite_run = false;
+	dna.avvy_in_bed = true;
+	enid_filename = "";
+
+	for (gd = 0; gd <= 1; gd ++) {
+		cp = 1 - cp;
+		_vm->_trip.getback();
+	}
+
+	_vm->_lucerna.enterroom(1, 1);
+	_vm->_trip.new_game_for_trippancy();
+	_vm->_lucerna.showscore();
+
+	_vm->_dropdown.standard_bar();
+	_vm->_lucerna.clock_lucerna();
+	_vm->_lucerna.sprite_run();
 	warning("STUB: Gyro::newgame()");
 }
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 1f9d9a1..29de10c 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -519,7 +519,7 @@ public:
 	int16 talkx, talky;
 	byte talkb, talkf;
 	byte scrollbells; /* no. of times to ring the bell */
-	bool ontoolbar, seescroll;
+	bool ontoolbar, seescroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 
 	char objlist[10];
 	byte *digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!


Commit: c46bb2449fc680767d17363af5dd35eca5ae7596
    https://github.com/scummvm/scummvm/commit/c46bb2449fc680767d17363af5dd35eca5ae7596
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T03:16:32-07:00

Commit Message:
AVALANCHE: Add comment in Avalot::run().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ec5d9ad..0b93201 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -172,7 +172,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_timeout.one_tick();
 
-		_vm->_graph.refreshScreen();
+		_vm->_graph.refreshScreen(); // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 	} while (false /*! _vm->_gyro.lmo*/); // So we run only one cycle during the testing. Of course it will be restored later.
 


Commit: 293c8f9b7e44d87d0a3479386a89d525b2e4a812
    https://github.com/scummvm/scummvm/commit/293c8f9b7e44d87d0a3479386a89d525b2e4a812
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T06:13:23-07:00

Commit Message:
AVALANCHE: Add class SpriteInfo to graph.h, use it in Trip.

Changed paths:
    engines/avalanche/graph.h
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index d602864..c79179c 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -37,6 +37,23 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
+// Be aware!!!
+
+typedef byte siltype[51][11]; /* 35, 4 */
+
+class SpriteInfo {
+public:
+	byte xw; /* x-width in bytes */
+	byte xl, yl; /* x & y lengths of pictures */
+
+	manitype *mani[24];
+	siltype *sil[24];
+
+	uint16 size; /* the size of one picture */
+};
+
+
 class Graph {
 public:
 	static const int16 _screenWidth = 640;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index bbb4785..2c3f963 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -31,6 +31,8 @@
 #ifndef TRIP6_H
 #define TRIP6_H
 
+#include "avalanche/graph.h"
+
 #include "common/scummsys.h"
 #include "common/str.h"
 
@@ -47,9 +49,7 @@ struct adxtype { /* Second revision of ADX type */
 	Common::String name/*[13]*/; /* name of character */ // uruk: Note to self: TRAILING /0 !!! Real size: 12
 	Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16.
 	byte num; /* number of pictures */
-	byte xl, yl; /* x & y lengths of pictures */
 	byte seq; /* how many in one stride */
-	uint16 size; /* the size of one picture */
 	byte fgc, bgc; /* foreground & background bubble colours */
 	byte accinum; /* the number according to Acci (1=Avvy, etc.) */
 };
@@ -80,13 +80,13 @@ class Trip;
 
 class triptype {
 public:
+	SpriteInfo _info;
+
 	adxtype a; /* vital statistics */
 	byte face, step;
 	int16 x, y; /* current xy coords */
 	int16 ox[2], oy[2];  /* last xy coords */
 	int8 ix, iy; /* amount to move sprite by, each step */
-	manitype *mani[24];
-	siltype *sil[24];
 	byte whichsprite;
 	bool quick, visible, homing, check_me;
 	int16 hx, hy; /* homing x & y coords */


Commit: c96ac1664a0038cfa7ef3f38d84b897ee0c4a9a9
    https://github.com/scummvm/scummvm/commit/c96ac1664a0038cfa7ef3f38d84b897ee0c4a9a9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T06:20:50-07:00

Commit Message:
AVALANCHE: Repair build errors due to the introduction of _info in Trip::triptype.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 25a571b..4301818 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -963,14 +963,14 @@ void Lucerna::verte() {
 	/* _vm->_trip.tr[0] : that's the only one we're interested in here */
 	if (_vm->_gyro.mx < _vm->_trip.tr[0].x) 
 		what = 1;
-	else if (_vm->_gyro.mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0].a.xl)) 
+	else if (_vm->_gyro.mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) 
 		what = 2;
 	else
 		what = 0; /* On top */
 
 	if (_vm->_gyro.my < _vm->_trip.tr[0].y)
 		what += 3;
-	else if (_vm->_gyro.my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0].a.yl))
+	else if (_vm->_gyro.my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl))
 		what += 6;
 
 	switch (what) {
@@ -1213,7 +1213,7 @@ void Lucerna::delavvy() {
 	
 	triptype &with = _vm->_trip.tr[0];
 	for (page_ = 0; page_ <= 1; page_ ++)
-		mblit(with.x / 8, with.y, (with.x + with.a.xl) / 8 + 1, with.y + with.a.yl, 3, page_);
+		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
 	
 	blitfix();
 	_vm->_gyro.on();
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index a4365f4..5ca587f 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -86,28 +86,28 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 		a.comment += inf.readByte();
 
 	a.num = inf.readByte();
-	a.xl = inf.readByte();
-	a.yl = inf.readByte();
+	_info.xl = inf.readByte();
+	_info.yl = inf.readByte();
 	a.seq = inf.readByte();
-	a.size = inf.readUint16LE();
+	_info.size = inf.readUint16LE();
 	a.fgc = inf.readByte();
 	a.bgc = inf.readByte();
 	a.accinum = inf.readByte();
 
 	totalnum = 0; // = 1;
-	xw = a.xl / 8;
-	if ((a.xl % 8) > 0)
+	xw = _info.xl / 8;
+	if ((_info.xl % 8) > 0)
 		xw++;
 	for (byte aa = 0; aa < /*nds*seq*/a.num; aa++) {
 
-		sil[totalnum] = new siltype[11 * (a.yl + 1)];
+		_info.sil[totalnum] = new siltype[11 * (_info.yl + 1)];
 		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
-		mani[totalnum] = new manitype[a.size - 6];
+		_info.mani[totalnum] = new manitype[_info.size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
-		for (fv = 0; fv <= a.yl; fv ++)
-			inf.read((*sil[totalnum])[fv], xw);
+		for (fv = 0; fv <= _info.yl; fv ++)
+			inf.read((*_info.sil[totalnum])[fv], xw);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
-		inf.read(*mani[totalnum], a.size - 6);
+		inf.read(*_info.mani[totalnum], _info.size - 6);
 		//blockread(inf, *mani[totalnum-1], a.size - 6);
 
 		totalnum ++;
@@ -168,8 +168,8 @@ bool triptype::collision_check() {
 
 	for (fv = 1; fv <= _tr->numtr; fv++) 
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
-			((x + a.xl) > _tr->tr[fv].x) &&
-			(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
+			((x + _info.xl) > _tr->tr[fv].x) &&
+			(x < (_tr->tr[fv].x + _tr->tr[fv]._info.xl)) &&
 			(_tr->tr[fv].y == y)) 
 				return true;
 
@@ -205,8 +205,8 @@ int8 triptype::sgn(int16 x) {
 
 void triptype::walkto(byte pednum) {
 	speed(sgn(_tr->_vm->_gyro.peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro.peds[pednum].y - y));
-	hx = _tr->_vm->_gyro.peds[pednum].x - a.xl / 2;
-	hy = _tr->_vm->_gyro.peds[pednum].y - a.yl;
+	hx = _tr->_vm->_gyro.peds[pednum].x - _info.xl / 2;
+	hy = _tr->_vm->_gyro.peds[pednum].y - _info.yl;
 	homing = true;
 }
 
@@ -270,7 +270,7 @@ void triptype::stopwalk() {
 }
 
 void triptype::chatter() {
-	_tr->_vm->_gyro.talkx = x + a.xl / 2;
+	_tr->_vm->_gyro.talkx = x + _info.xl / 2;
 	_tr->_vm->_gyro.talky = y;
 	_tr->_vm->_gyro.talkf = a.fgc;
 	_tr->_vm->_gyro.talkb = a.bgc;
@@ -346,16 +346,14 @@ triptype *triptype::done() {
 	int32 id;
 	uint16 soa;
 
-	adxtype &with = a;
-
 	/*  nds:=num div seq;*/
-	xw = with.xl / 8;
-	if ((with.xl % 8) > 0)
+	xw = _info.xl / 8;
+	if ((_info.xl % 8) > 0)
 		xw += 1;
-	for (aa = 1; aa <= /*nds*seq*/ with.num; aa++) {
+	for (aa = 1; aa <= /*nds*seq*/ a.num; aa++) {
 		totalnum--;
-		free(mani[totalnum]);
-		free(sil[totalnum]); /* <<- Width of a siltype. */
+		free(_info.mani[totalnum]);
+		free(_info.sil[totalnum]); /* <<- Width of a siltype. */
 	}
 
 	quick = false;
@@ -1016,7 +1014,7 @@ void Trip::rwsp(byte t, byte r) {
 }
 
 void Trip::apped(byte trn, byte np) {
-	tr[trn].appear(tr[trn].x - tr[trn].a.xl / 2, tr[trn].y - tr[trn].a.yl, _vm->_gyro.peds[np].dir);
+	tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro.peds[np].dir);
 	rwsp(trn, _vm->_gyro.peds[np].dir);
 }
 
@@ -1115,9 +1113,9 @@ void Trip::arrow_procs(byte tripnum) {
 			This is so if: a) the bottom of the arrow is below Avvy's head,
 			b) the left of the arrow is left of the right of Avvy's head, and
 			c) the right of the arrow is right of the left of Avvy's head. */
-		if (((tr[tripnum].y + tr[tripnum].a.yl) >= tr[1].y) /* A */
-				&& (tr[tripnum].x <= (tr[1].x + tr[1].a.xl)) /* B */
-				&& ((tr[tripnum].x + tr[tripnum].a.xl) >= tr[1].x)) { /* C */
+		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[1].y) /* A */
+				&& (tr[tripnum].x <= (tr[1].x + tr[1]._info.xl)) /* B */
+				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[1].x)) { /* C */
 			/* OK, it's hit him... what now? */
 
 			tr[2].call_eachstep = false; /* prevent recursion. */
@@ -1518,7 +1516,7 @@ void Trip::fliproom(byte room, byte ped) {
 
 bool Trip::infield(byte which) {
 /* returns True if you're within field "which" */
-	int16 yy = tr[1].y + tr[1].a.yl;
+	int16 yy = tr[1].y + tr[1]._info.yl;
 
 	return (tr[1].x >= _vm->_gyro.fields[which].x1) && (tr[1].x <= _vm->_gyro.fields[which].x2)
 		&& (yy >= _vm->_gyro.fields[which].y1) && (yy <= _vm->_gyro.fields[which].y2);
@@ -1538,7 +1536,7 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 	}
 		
 	ux = tr[1].x;
-	uy = tr[1].y + tr[1].a.yl;
+	uy = tr[1].y + tr[1]._info.yl;
 		
 	nd = false;
 	for (fv = 9; fv <= _vm->_gyro.numfields; fv++) {


Commit: a2dfb3635fbc94f78fb5a3409abf1bd0f6ec7d73
    https://github.com/scummvm/scummvm/commit/a2dfb3635fbc94f78fb5a3409abf1bd0f6ec7d73
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T06:51:46-07:00

Commit Message:
AVALANCHE: Implement/repair multiple functions in Trip.

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 5ca587f..9cf85f2 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -142,7 +142,14 @@ void triptype::original() {
 }
 
 void triptype::andexor() {
-	warning("STUB: triptype::andexor()");
+
+
+
+	if ((vanishifstill) && (ix == 0) && (iy == 0))
+		return;
+	byte picnum = face * a.seq + step + 1;
+
+	_tr->_vm->_graph.drawSprite(_info);	
 }
 
 void triptype::turn(byte whichway) {
@@ -1255,14 +1262,14 @@ void Trip::call_andexors() {
 	for (int i = 0; i < 5; i++)
 		order[i] = 0;
 
-	for (fv = 1; fv <= numtr; fv++) {
+	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
 			order[fv] = fv;
 	}
 
 	do {
 		ok = true;
-		for (fv = 1; fv <= 4; fv++) {
+		for (fv = 0; fv < 4; fv++) {
 			if (((order[fv] != 0) && (order[fv + 1] != 0))
 					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
 				/* Swap them! */
@@ -1274,7 +1281,7 @@ void Trip::call_andexors() {
 		}
 	} while (!ok);
 
-	for (fv = 1; fv <= 5; fv++) {
+	for (fv = 0; fv < 5; fv++) {
 		if (order[fv] > 0)
 			tr[order[fv]].andexor();
 	}


Commit: bcab639266c54fc0827f1f0fc483c39ae455b616
    https://github.com/scummvm/scummvm/commit/bcab639266c54fc0827f1f0fc483c39ae455b616
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T07:07:07-07:00

Commit Message:
AVALANCHE: Add Graph::drawSprite().

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 9b5662e..17462da 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -82,6 +82,10 @@ void Graph::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
 	_surface.drawLine(x0, y0, x1, y1, color);
 }
 
+void Graph::drawSprite(const SpriteInfo &sprite) {
+	warning("STUB: Graph::drawSprite()");
+}
+
 Graphics::Surface *Graph::readImage(const byte *source) {
 	Graphics::Surface *picture = new Graphics::Surface;
 	
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index c79179c..01be7b1 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -75,6 +75,8 @@ public:
 
 	void drawLine(int x0, int y0, int x1, int y1, uint32 color);
 
+	void drawSprite(const SpriteInfo &sprite);
+
 	// Must free the returned pointer!!!
 	Graphics::Surface *readImage(const byte *source);
 


Commit: 4fc9de5d469625150ee1d78ccca5d9c2a237f3f6
    https://github.com/scummvm/scummvm/commit/4fc9de5d469625150ee1d78ccca5d9c2a237f3f6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T11:00:14-07:00

Commit Message:
AVALANCHE: Replace Pingo::copy03() with Graph::refreshScreen().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0b93201..0415f95 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -91,7 +91,7 @@ void Avalot::setup() {
 	_vm->_gyro.enid_filename = ""; /* undefined. */
 	_vm->_lucerna.toolbar();
 	_vm->_scrolls.state(2);
-	_vm->_pingo.copy03();
+	_vm->_graph.refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
 
@@ -172,8 +172,6 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_timeout.one_tick();
 
-		_vm->_graph.refreshScreen(); // TODO: Maybe it'll have a better place later. Move it there when it's needed.
-
 	} while (false /*! _vm->_gyro.lmo*/); // So we run only one cycle during the testing. Of course it will be restored later.
 
 	//restorecrtmode();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 4301818..1a55b55 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -272,7 +272,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	load_also(xx);
 	_vm->_celer.load_chunks(xx);
 
-	_vm->_pingo.copy03();
+	_vm->_graph.refreshScreen(); // _vm->_pingo.copy03();  -  See Avalot::setup()
 
 	bit = *_vm->_graph.getPixel(0,0);
 
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index 28f140f..b6113f8 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -44,7 +44,7 @@ public:
 
 	void copy02();
 
-	void copy03();
+	void copy03(); // Should always be replaced with _vm->_graph.refreshScreen(); - See Avalot::setup();
 
 	void copypage(byte frp, byte top);
 


Commit: e5614ef0dcd185b9fd65a5641d785ff6e4edabda
    https://github.com/scummvm/scummvm/commit/e5614ef0dcd185b9fd65a5641d785ff6e4edabda
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T13:31:51-07:00

Commit Message:
AVALANCHE: Fix Gyro::newgame().

Changed paths:
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 054019e..aba169c 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -349,14 +349,13 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 }
 
 void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
-	byte gd, gm;
-
-	for (gm = 0; gm < numtr; gm ++)
+	for (byte gm = 0; gm < numtr; gm ++) {
 		if (_vm->_trip.tr[gm].quick)
 			_vm->_trip.tr[gm].done();
+	}
 	/* Deallocate sprite. Sorry, beta testers! */
 
-	_vm->_trip.tr[1].init(0, true, &_vm->_trip);
+	_vm->_trip.tr[0].init(0, true, &_vm->_trip);
 	alive = true;
 
 	score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
@@ -374,12 +373,13 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	dna.obj[bell] = true;
 	dna.obj[clothes] = true;
 	
-	thinks = '\2';
+	thinks = 2;
 	_vm->_lucerna.objectlist();
 	ontoolbar = false;
 	seescroll = false;
 
-	ppos[0][1] = -177; /*tr[1].appear(300,117,right);*/ gd = 0;
+	ppos[0][1] = -177; 
+	_vm->_trip.tr[0].appear(300,117,right);
 	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
 	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
 	him = 254;
@@ -393,7 +393,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	dna.avvy_in_bed = true;
 	enid_filename = "";
 
-	for (gd = 0; gd <= 1; gd ++) {
+	for (byte gd = 0; gd <= 1; gd ++) {
 		cp = 1 - cp;
 		_vm->_trip.getback();
 	}
@@ -405,7 +405,6 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	_vm->_dropdown.standard_bar();
 	_vm->_lucerna.clock_lucerna();
 	_vm->_lucerna.sprite_run();
-	warning("STUB: Gyro::newgame()");
 }
 
 void Gyro::click() {   /* "Audio keyboard feedback" */


Commit: 467246c00416d9ed9896d8bcd1eb72e3cd5d151a
    https://github.com/scummvm/scummvm/commit/467246c00416d9ed9896d8bcd1eb72e3cd5d151a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T13:33:08-07:00

Commit Message:
AVALANCHE: Add refreshScreen() to every iteration of the main loop in Avalot::run().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0415f95..ecd1095 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -172,6 +172,8 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_timeout.one_tick();
 
+		_vm->_graph.refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
+
 	} while (false /*! _vm->_gyro.lmo*/); // So we run only one cycle during the testing. Of course it will be restored later.
 
 	//restorecrtmode();


Commit: e2e979897ed1aab48db4c8229e8b740756abfd16
    https://github.com/scummvm/scummvm/commit/e2e979897ed1aab48db4c8229e8b740756abfd16
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T13:35:55-07:00

Commit Message:
AVALANCHE: Update Graph::drawSprite(), update Trip::axendor() accordingly, fix Trip::call_axendors().

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 17462da..af4f56d 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -82,7 +82,10 @@ void Graph::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
 	_surface.drawLine(x0, y0, x1, y1, color);
 }
 
-void Graph::drawSprite(const SpriteInfo &sprite) {
+void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+	/* These 2 lines are here SOLELY for testing purposes. */
+	Common::Rect r(x, y, x + sprite.xl, y + sprite.yl);
+	_surface.frameRect(r, magenta);
 	warning("STUB: Graph::drawSprite()");
 }
 
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 01be7b1..bd3418e 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -75,7 +75,7 @@ public:
 
 	void drawLine(int x0, int y0, int x1, int y1, uint32 color);
 
-	void drawSprite(const SpriteInfo &sprite);
+	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
 	// Must free the returned pointer!!!
 	Graphics::Surface *readImage(const byte *source);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 9cf85f2..41abf8c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -142,14 +142,11 @@ void triptype::original() {
 }
 
 void triptype::andexor() {
-
-
-
 	if ((vanishifstill) && (ix == 0) && (iy == 0))
 		return;
 	byte picnum = face * a.seq + step + 1;
 
-	_tr->_vm->_graph.drawSprite(_info);	
+	_tr->_vm->_graph.drawSprite(_info, picnum, x, y);	
 }
 
 void triptype::turn(byte whichway) {
@@ -404,7 +401,7 @@ void Trip::setParent(AvalancheEngine *vm) {
 void Trip::loadtrip() {
 	byte gm;
 
-	for (gm = 1; gm <= numtr; gm++)
+	for (gm = 0; gm < numtr; gm++)
 		tr[gm].original();
 	
 	for (int i = 0; i < sizeof(aa); i++)
@@ -1255,12 +1252,12 @@ void Trip::geida_procs(byte tripnum) {
 /* That's all... */
 
 void Trip::call_andexors() {
-	byte order[5];
+	int8 order[5];
 	byte fv, temp;
 	bool ok;
 
 	for (int i = 0; i < 5; i++)
-		order[i] = 0;
+		order[i] = -1;
 
 	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
@@ -1282,7 +1279,7 @@ void Trip::call_andexors() {
 	} while (!ok);
 
 	for (fv = 0; fv < 5; fv++) {
-		if (order[fv] > 0)
+		if (order[fv] > -1)
 			tr[order[fv]].andexor();
 	}
 }


Commit: c71d4dcc646ad0ba4720b22d0c5c6f7043a060d1
    https://github.com/scummvm/scummvm/commit/c71d4dcc646ad0ba4720b22d0c5c6f7043a060d1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T14:10:23-07:00

Commit Message:
AVALANCHE: Lucerna:load() - put the background lower, making space for the toolbar on the top.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1a55b55..f5d833b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -261,7 +261,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				}	
 			}
 
-	_vm->_graph.copySurface(background, 0 ,0);
+	_vm->_graph.copySurface(background, 0, 10);
 
 	background.free();
 


Commit: c6d2b45df9bd068b6d73c9e78fb04e44cf823dae
    https://github.com/scummvm/scummvm/commit/c6d2b45df9bd068b6d73c9e78fb04e44cf823dae
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-18T14:56:55-07:00

Commit Message:
AVALANCHE: Implement Lucerna::showrw().

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f5d833b..6f65927 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1058,7 +1058,28 @@ void Lucerna::dawn() {
 
 
 
-void Lucerna::showrw() {
+void Lucerna::showrw() { // It's data is loaded in load_digits().
+	if (_vm->_gyro.oldrw == _vm->_gyro.dna.rw) 
+		return;
+	_vm->_gyro.oldrw = _vm->_gyro.dna.rw;
+	_vm->_gyro.off();
+	
+	/*	for (byte page_ = 0; page_ <= 1; page_ ++) {
+	setactivepage(page_);
+	putimage(0, 161, rwlite[with.rw], 0);
+	}*/
+
+	Graphics::Surface *rwlite = _vm->_graph.readImage(_vm->_gyro.rwlite[_vm->_gyro.dna.rw]);
+
+	_vm->_graph.copySurface(*rwlite, 0, 161);
+
+	rwlite->free();
+
+	delete rwlite;
+
+	_vm->_gyro.on();
+	//setactivepage(1 - cp);
+	
 	warning("STUB: Lucerna::showrw()");
 }
 


Commit: b18ed9a5ffe67d0e2d76fc1b1cdf8cab5a395fb8
    https://github.com/scummvm/scummvm/commit/b18ed9a5ffe67d0e2d76fc1b1cdf8cab5a395fb8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-19T01:55:12-07:00

Commit Message:
AVALANCHE: Remove Graph::drawLine().

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index af4f56d..fac96fe 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -78,10 +78,6 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
-void Graph::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
-	_surface.drawLine(x0, y0, x1, y1, color);
-}
-
 void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	/* These 2 lines are here SOLELY for testing purposes. */
 	Common::Rect r(x, y, x + sprite.xl, y + sprite.yl);
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index bd3418e..b825f17 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -73,8 +73,6 @@ public:
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
-	void drawLine(int x0, int y0, int x1, int y1, uint32 color);
-
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
 	// Must free the returned pointer!!!


Commit: 4dc97824e602d83a952692e875aeecaed7348f2a
    https://github.com/scummvm/scummvm/commit/4dc97824e602d83a952692e875aeecaed7348f2a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-19T02:14:39-07:00

Commit Message:
AVALANCHE: Incorporate Graph::readImage() into Grap::copySurface(), update Lucerna's functions accordingly. Delete Graph::setPixel().

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index fac96fe..84dde5a 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -70,10 +70,6 @@ byte *Graph::getPixel(int16 x, int16 y) {
 	return (byte *)_surface.getBasePtr(x, y);
 }
 
-void Graph::setPixel(int16 x, int16 y, byte color) {
-	*(byte *)_surface.getBasePtr(x, y) = color;
-}
-
 void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
@@ -85,9 +81,9 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 	warning("STUB: Graph::drawSprite()");
 }
 
-Graphics::Surface *Graph::readImage(const byte *source) {
-	Graphics::Surface *picture = new Graphics::Surface;
-	
+void Graph::copySurface(const byte *source, uint16 destX, uint16 destY) {
+	Graphics::Surface picture;
+
 	uint32 i = 0;
 
 	uint16 pictureWidth = (source[i++] + 1);
@@ -95,7 +91,7 @@ Graphics::Surface *Graph::readImage(const byte *source) {
 	uint16 pictureHeight = (source[i++] + 1); 
 	pictureHeight += (source[i++] << 8);
 
-	picture->create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
+	picture.create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
 
 	for (byte y = 0; y < pictureHeight; y++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
@@ -103,17 +99,13 @@ Graphics::Surface *Graph::readImage(const byte *source) {
 				byte pixel = source[i++];
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)picture->getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
 				} 
 			}
 
-	return picture;
-}
-
-void Graph::copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY) {
-	for (uint16 y = 0; y < source.h; y++)
-		for (uint16 x = 0; x < source.w; x++)
-			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)source.getBasePtr(x, y);		
+	for (uint16 y = 0; y < picture.h; y++)
+		for (uint16 x = 0; x < picture.w; x++)
+			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
 }
 
 void Graph::refreshScreen() {
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index b825f17..80f7913 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -69,16 +69,11 @@ public:
 
 	byte *getPixel(int16 x, int16 y);
 
-	void setPixel(int16 x, int16 y, byte color);
-
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
-	// Must free the returned pointer!!!
-	Graphics::Surface *readImage(const byte *source);
-
-	void copySurface(const Graphics::Surface &source, uint16 destX, uint16 destY);
+	void copySurface(const byte *source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 6f65927..d58ddfc 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -261,7 +261,9 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 				}	
 			}
 
-	_vm->_graph.copySurface(background, 0, 10);
+	for (uint16 y = 0; y < backgroundHeight; y++)
+		for (uint16 x = 0; x < backgroundWidht; x++)
+			*_vm->_graph.getPixel(x + 0, y + 10) = *(byte *)background.getBasePtr(x, y);	
 
 	background.free();
 
@@ -764,13 +766,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	f.read(buffer, picsize);
 
-	Graphics::Surface *picture = _vm->_graph.readImage(buffer);
-
-	_vm->_graph.copySurface(*picture, 205, 170);
-
-	picture->free();
-
-	delete picture;
+	_vm->_graph.copySurface(buffer, 205, 170);
 
 	delete[] buffer;
 
@@ -827,13 +823,7 @@ void Lucerna::toolbar() {
 
 	f.read(buffer, bufferSize);
 
-	Graphics::Surface *toolbar = _vm->_graph.readImage(buffer);
-
-	_vm->_graph.copySurface(*toolbar, 5, 169);
-
-	toolbar->free();
-
-	delete toolbar;
+	_vm->_graph.copySurface(buffer, 5, 169);
 
 	delete[] buffer;
 
@@ -868,15 +858,8 @@ void Lucerna::showscore() {
 	//setactivepage(3);
 
 	for (byte fv = 0; fv < 3; fv ++)
-		if (_vm->_gyro.lastscore[fv] != numbers[fv]) {
-			Graphics::Surface *digit = _vm->_graph.readImage(_vm->_gyro.digit[numbers[fv]]);
-
-			_vm->_graph.copySurface(*digit, 250 + (fv + 1) * 15, 177);
-
-			digit->free();
-
-			delete digit;
-		}
+		if (_vm->_gyro.lastscore[fv] != numbers[fv]) 
+			_vm->_graph.copySurface(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
 		_vm->_trip.getset[fv].remember(scorespace);
@@ -1069,13 +1052,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
 
-	Graphics::Surface *rwlite = _vm->_graph.readImage(_vm->_gyro.rwlite[_vm->_gyro.dna.rw]);
-
-	_vm->_graph.copySurface(*rwlite, 0, 161);
-
-	rwlite->free();
-
-	delete rwlite;
+	_vm->_graph.copySurface(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
 
 	_vm->_gyro.on();
 	//setactivepage(1 - cp);


Commit: f8ad6eb650957c985974262bcf41779020c09caf
    https://github.com/scummvm/scummvm/commit/f8ad6eb650957c985974262bcf41779020c09caf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-19T02:58:06-07:00

Commit Message:
AVALANCHE: Rename copySurface() to drawPicture(), add some comment to it.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 84dde5a..5c12884 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -81,18 +81,20 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 	warning("STUB: Graph::drawSprite()");
 }
 
-void Graph::copySurface(const byte *source, uint16 destX, uint16 destY) {
-	Graphics::Surface picture;
-
+void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 	uint32 i = 0;
 
+	// The height and the width are stored in 2 bytes.
 	uint16 pictureWidth = (source[i++] + 1);
 	pictureWidth +=  (source[i++] << 8);
 	uint16 pictureHeight = (source[i++] + 1); 
 	pictureHeight += (source[i++] << 8);
 
+	Graphics::Surface picture; // We make a Surface object for the picture itself.
+
 	picture.create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
 
+	// Produce the picture.
 	for (byte y = 0; y < pictureHeight; y++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
 			for (uint16 x = 0; x < pictureWidth; x += 8) {
@@ -103,6 +105,7 @@ void Graph::copySurface(const byte *source, uint16 destX, uint16 destY) {
 				} 
 			}
 
+	// Copy the picture to a given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++)
 		for (uint16 x = 0; x < picture.w; x++)
 			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 80f7913..4682ca6 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -73,7 +73,7 @@ public:
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
-	void copySurface(const byte *source, uint16 destX, uint16 destY);
+	void drawPicture(const byte *source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d58ddfc..614a081 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -766,7 +766,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	f.read(buffer, picsize);
 
-	_vm->_graph.copySurface(buffer, 205, 170);
+	_vm->_graph.drawPicture(buffer, 205, 170);
 
 	delete[] buffer;
 
@@ -823,7 +823,7 @@ void Lucerna::toolbar() {
 
 	f.read(buffer, bufferSize);
 
-	_vm->_graph.copySurface(buffer, 5, 169);
+	_vm->_graph.drawPicture(buffer, 5, 169);
 
 	delete[] buffer;
 
@@ -859,7 +859,7 @@ void Lucerna::showscore() {
 
 	for (byte fv = 0; fv < 3; fv ++)
 		if (_vm->_gyro.lastscore[fv] != numbers[fv]) 
-			_vm->_graph.copySurface(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
+			_vm->_graph.drawPicture(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
 		_vm->_trip.getset[fv].remember(scorespace);
@@ -1052,7 +1052,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
 
-	_vm->_graph.copySurface(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
+	_vm->_graph.drawPicture(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
 
 	_vm->_gyro.on();
 	//setactivepage(1 - cp);


Commit: ef77a84c83fb1baab98e91f3e90783d01539efec
    https://github.com/scummvm/scummvm/commit/ef77a84c83fb1baab98e91f3e90783d01539efec
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-19T14:36:00-07:00

Commit Message:
AVALANCHE: Trip: repair triptype:init(), remove unnecessary data field from definition.

Changed paths:
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 41abf8c..ed64847 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -50,6 +50,8 @@ namespace Avalanche {
 
 	
 void triptype::init(byte spritenum, bool do_check, Trip *tr) {
+	_tr = tr;
+
 	const int32 idshould = -1317732048;
 	int16 gd, gm;
 	byte fv/*,nds*/;
@@ -77,13 +79,17 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 
 	inf.skip(2); // Replace variable named 'soa' in the original code.
 	
-	inf.skip(1); // We don't need to read the size of the string as in the original code.
-	for (byte i = 0; i < 12; i++) 
+	//inf.skip(1); // We don't need to read the size of the string as in the original code.
+	byte nameSize = inf.readByte();
+	for (byte i = 0; i < nameSize; i++) 
 		a.name += inf.readByte();
+	inf.skip(12 - nameSize);
 	
-	inf.skip(1); // Same as above.
-	for (byte i = 0; i < 16; i++)
+	//inf.skip(1); // Same as above.
+	byte commentSize = inf.readByte();
+	for (byte i = 0; i < commentSize; i++)
 		a.comment += inf.readByte();
+	inf.skip(16 - commentSize);
 
 	a.num = inf.readByte();
 	_info.xl = inf.readByte();
@@ -95,9 +101,9 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	a.accinum = inf.readByte();
 
 	totalnum = 0; // = 1;
-	xw = _info.xl / 8;
+	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
-		xw++;
+		_info.xw++;
 	for (byte aa = 0; aa < /*nds*seq*/a.num; aa++) {
 
 		_info.sil[totalnum] = new siltype[11 * (_info.yl + 1)];
@@ -105,13 +111,14 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 		_info.mani[totalnum] = new manitype[_info.size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
 		for (fv = 0; fv <= _info.yl; fv ++)
-			inf.read((*_info.sil[totalnum])[fv], xw);
+			inf.read((*_info.sil[totalnum])[fv], _info.xw);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
 		inf.read(*_info.mani[totalnum], _info.size - 6);
 		//blockread(inf, *mani[totalnum-1], a.size - 6);
 
-		totalnum ++;
+		totalnum++;
 	}
+	totalnum++;
 
 	/* on; */
 	x = 0;
@@ -120,7 +127,8 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	visible = false;
 	xs = 3;
 	ys = 1;
-	/* if spritenum=1 then newspeed; { Just for the lights. }*/
+	if (spritenum == 1)
+		_tr->newspeed(); /* Just for the lights. */
 
 	homing = false;
 	ix = 0;
@@ -131,9 +139,8 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	whichsprite = spritenum;
 	vanishifstill = false;
 	call_eachstep = false;
+
 	inf.close();
-	
-	_tr = tr;
 }
 
 void triptype::original() {
@@ -292,7 +299,7 @@ void triptype::set_up_saver(trip_saver_type &v) {
 	v.homing = homing;
 	v.check_me = check_me;
 	v.count = count;
-	v.xw = xw;
+	v.xw = _info.xw;
 	v.xs = xs;
 	v.ys = ys;
 	v.totalnum = totalnum;
@@ -315,7 +322,7 @@ void triptype::unload_saver(trip_saver_type v) {
 	homing = v.homing;
 	check_me = v.check_me;
 	count = v.count;
-	xw = v.xw;
+	_info.xw = v.xw;
 	xs = v.xs;
 	ys = v.ys;
 	totalnum = v.totalnum;
@@ -351,9 +358,9 @@ triptype *triptype::done() {
 	uint16 soa;
 
 	/*  nds:=num div seq;*/
-	xw = _info.xl / 8;
+	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
-		xw += 1;
+		_info.xw += 1;
 	for (aa = 1; aa <= /*nds*seq*/ a.num; aa++) {
 		totalnum--;
 		free(_info.mani[totalnum]);
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 2c3f963..c202b76 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -91,7 +91,6 @@ public:
 	bool quick, visible, homing, check_me;
 	int16 hx, hy; /* homing x & y coords */
 	byte count; /* counts before changing step */
-	byte xw; /* x-width in bytes */
 	byte xs, ys; /* x & y speed */
 	byte totalnum; /* total number of sprites */
 	bool vanishifstill; /* Do we show this sprite if it's still? */


Commit: 459a8ce2f5cbc88d1347249b6459dcc78a693495
    https://github.com/scummvm/scummvm/commit/459a8ce2f5cbc88d1347249b6459dcc78a693495
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-19T14:36:58-07:00

Commit Message:
AVALANCHE: Partially implement Graph::drawSprite().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 5c12884..bbe7e5e 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -75,9 +75,25 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	/* These 2 lines are here SOLELY for testing purposes. */
-	Common::Rect r(x, y, x + sprite.xl, y + sprite.yl);
-	_surface.frameRect(r, magenta);
+
+	for (byte qay = 0; qay < sprite.yl; qay++) {
+		byte *mask = new byte[sprite.xl];
+
+		for (byte qax = 0; qax < sprite.xl; qax++) {
+			byte count = qax / 8;
+			mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
+			if (mask[qax] == 0)
+				*getPixel(x + qax, y + qay) = 255;
+		}
+
+		delete[] mask;
+	}
+
+/*
+	for (fv = 5; fv <= sprite.size - 2; fv ++)
+		aa[fv] = aa[fv] ^ (*sprite.mani[picnum])[fv];
+*/
+
 	warning("STUB: Graph::drawSprite()");
 }
 
@@ -99,9 +115,9 @@ void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
 			for (uint16 x = 0; x < pictureWidth; x += 8) {
 				byte pixel = source[i++];
-				for (byte i = 0; i < 8; i++) {
-					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
 				} 
 			}
 


Commit: 09877044b3b9695368c5772842ce843f1e5026f9
    https://github.com/scummvm/scummvm/commit/09877044b3b9695368c5772842ce843f1e5026f9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T01:06:43-07:00

Commit Message:
AVALANCHE: Repair Graph::drawSprite().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index bbe7e5e..56a9be0 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -83,7 +83,7 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 			byte count = qax / 8;
 			mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
 			if (mask[qax] == 0)
-				*getPixel(x + qax, y + qay) = 255;
+				*getPixel(x + qax, y + qay) = 0;
 		}
 
 		delete[] mask;


Commit: 097572193fd29324a582b18d6b7d80ff643c6776
    https://github.com/scummvm/scummvm/commit/097572193fd29324a582b18d6b7d80ff643c6776
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T01:40:57-07:00

Commit Message:
AVALANCHE: Update Graph::drawPicture().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 56a9be0..2f5b377 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -98,13 +98,11 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 }
 
 void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
-	uint32 i = 0;
+	// The height and the width are stored in 2-2 bytes. We have to add 1 to each becouse Pascal stores the value of them -1.
+	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
+	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
 
-	// The height and the width are stored in 2 bytes.
-	uint16 pictureWidth = (source[i++] + 1);
-	pictureWidth +=  (source[i++] << 8);
-	uint16 pictureHeight = (source[i++] + 1); 
-	pictureHeight += (source[i++] << 8);
+	uint32 i = 4;
 
 	Graphics::Surface picture; // We make a Surface object for the picture itself.
 


Commit: 137d33414499584a61640159570768dade068883
    https://github.com/scummvm/scummvm/commit/137d33414499584a61640159570768dade068883
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T01:55:19-07:00

Commit Message:
AVALANCHE: Finish implementation of Graph::drawSprite().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 2f5b377..7c9d09e 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -89,12 +89,17 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 		delete[] mask;
 	}
 
-/*
-	for (fv = 5; fv <= sprite.size - 2; fv ++)
-		aa[fv] = aa[fv] ^ (*sprite.mani[picnum])[fv];
-*/
+	uint16 i = 0; // Becouse the original siltype starts at 5!!! See Graph.h for definition.
 
-	warning("STUB: Graph::drawSprite()");
+	for (byte qay = 0; qay < sprite.yl; qay++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 qax = 0; qax  < sprite.xl; qax += 8) {
+				byte pixel = (*sprite.mani[picnum])[i++];
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*getPixel(x + qax + 7 - bit, y + qay) += (pixelBit << plane);
+				} 
+			}
 }
 
 void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {


Commit: 6f20b8f5a24499cd39c55001afcf99ccc987a113
    https://github.com/scummvm/scummvm/commit/6f20b8f5a24499cd39c55001afcf99ccc987a113
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T02:05:21-07:00

Commit Message:
AVALANCHE: Graph: change 'becouse' to 'because' in comments...

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 7c9d09e..7748dad 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -89,7 +89,7 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 		delete[] mask;
 	}
 
-	uint16 i = 0; // Becouse the original siltype starts at 5!!! See Graph.h for definition.
+	uint16 i = 0; // Because the original siltype starts at 5!!! See Graph.h for definition.
 
 	for (byte qay = 0; qay < sprite.yl; qay++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
@@ -103,7 +103,7 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 }
 
 void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
-	// The height and the width are stored in 2-2 bytes. We have to add 1 to each becouse Pascal stores the value of them -1.
+	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
 	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
 	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
 


Commit: e70b5167c9ba9e1802482e0123f448b3c2d250c2
    https://github.com/scummvm/scummvm/commit/e70b5167c9ba9e1802482e0123f448b3c2d250c2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T02:12:10-07:00

Commit Message:
AVALANCHE: Change computing method of picnum in triptype::andexor().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ed64847..1758f1b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -151,7 +151,7 @@ void triptype::original() {
 void triptype::andexor() {
 	if ((vanishifstill) && (ix == 0) && (iy == 0))
 		return;
-	byte picnum = face * a.seq + step + 1;
+	byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). 
 
 	_tr->_vm->_graph.drawSprite(_info, picnum, x, y);	
 }


Commit: 79c6a48bd244ab4f150945bec0e0e663de987125
    https://github.com/scummvm/scummvm/commit/79c6a48bd244ab4f150945bec0e0e663de987125
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T03:07:21-07:00

Commit Message:
AVALANCHE: Add some blank lines in Trip.

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 1758f1b..8213939 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -374,6 +374,9 @@ triptype *triptype::done() {
 
 
 
+
+
+
 getsettype *getsettype::init() {
 	numleft = 0; /* initialise array pointer */
 	return this;


Commit: d6f93d06eeb5e8e8b8d14fbce887db7830baa568
    https://github.com/scummvm/scummvm/commit/d6f93d06eeb5e8e8b8d14fbce887db7830baa568
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T03:16:06-07:00

Commit Message:
AVALANCHE: Move flesh_colours() from Lucerna to Graph. Implement it.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 7748dad..078842a 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -66,6 +66,13 @@ Graph::~Graph() {
 	_surface.free();
 }
 
+
+void Graph::flesh_colours()
+{
+	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
+}
+
+
 byte *Graph::getPixel(int16 x, int16 y) {
 	return (byte *)_surface.getBasePtr(x, y);
 }
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 4682ca6..7d6db70 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -67,6 +67,8 @@ public:
 
 	~Graph();
 
+	void flesh_colours();
+
 	byte *getPixel(int16 x, int16 y);
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 614a081..5d60c75 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -216,10 +216,10 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 		_vm->_gyro.off();
 
 	_vm->_gyro.clear_vmc();
+	
+	_vm->_graph.flesh_colours();
 
 	xx = _vm->_gyro.strf(n);
-	flesh_colours();
-
 	Common::String filename;
 	filename = filename.format("place%s.avd", xx.c_str());
 	if (!f.open(filename)) {
@@ -1283,34 +1283,6 @@ uint16 Lucerna::bearing(byte whichped) {
 	return bearing_result;
 }
 
-void Lucerna::flesh_colours()     /* assembler;
-asm
-  mov ax,$1012;
-  mov bx,21;                 { 21 = light pink (why?) }
-  mov cx,1;
-  mov dx,seg    @flesh;
-  mov es,dx;
-  mov dx,offset @flesh;
-  int $10;
-
-  mov dx,seg    @darkflesh;
-  mov es,dx;
-  mov dx,offset @darkflesh;
-  mov bx,5;                 { 5 = dark pink. }
-  int $10;
-
-  jmp @TheEnd;
-
- @flesh:
-  db 56,35,35;
-
- @darkflesh:
-  db 43,22,22;
-
- @TheEnd: */
-{
-}
-
 void Lucerna::sprite_run() {
 /* A sprite run is performed before displaying a scroll, if not all the
   sprites are still. It performs two fast cycles, only using a few of


Commit: 44bf47f75e03f9b599c9aef32f9ecdc95c5b7736
    https://github.com/scummvm/scummvm/commit/44bf47f75e03f9b599c9aef32f9ecdc95c5b7736
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T03:27:52-07:00

Commit Message:
AVALANCHE: Update Graph::flesh_colours().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 078842a..04b5f2e 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -70,6 +70,7 @@ Graph::~Graph() {
 void Graph::flesh_colours()
 {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
+	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
 }
 
 


Commit: a16dc4c558510f8404f2af9d41f5512adba7be1b
    https://github.com/scummvm/scummvm/commit/a16dc4c558510f8404f2af9d41f5512adba7be1b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-20T07:58:37-07:00

Commit Message:
AVALANCHE: Add comments to Graph::drawSprite().

Changed paths:
    engines/avalanche/graph.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 04b5f2e..3e22f45 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -84,6 +84,7 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 
 void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 
+	/* First we make the pixels of the spirte blank. */
 	for (byte qay = 0; qay < sprite.yl; qay++) {
 		byte *mask = new byte[sprite.xl];
 
@@ -97,6 +98,7 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
 		delete[] mask;
 	}
 
+	/* Then we draw the picture to the blank places. */
 	uint16 i = 0; // Because the original siltype starts at 5!!! See Graph.h for definition.
 
 	for (byte qay = 0; qay < sprite.yl; qay++)


Commit: 050c60c1926d3bfc1955c642381e00bdf224e861
    https://github.com/scummvm/scummvm/commit/050c60c1926d3bfc1955c642381e00bdf224e861
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-23T03:34:58-07:00

Commit Message:
AVALANCHE: Implement menuset::update().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index bdb8148..6ee7499 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -191,6 +191,26 @@ void menuset::create(char t, Common::String n, char alttrig, func dw, func dc) {
 }
 
 void menuset::update() {
+	const bytefield menuspace = {0, 0, 80, 9};
+	byte fv, page_, savecp;
+
+	/*setactivepage(3);
+	setfillstyle(1, _dr->menu_b);
+	bar(0, 0, 640, 9);*/
+	_dr->_vm->_graph.drawBar(0, 0, 640, 9, _dr->menu_b);
+
+	savecp = _dr->_vm->_gyro.cp;
+	_dr->_vm->_gyro.cp = 3;
+
+	for (fv = 1; fv <= howmany; fv ++)
+		ddms[fv].display();
+
+	for (page_ = 0; page_ <= 1; page_ ++)
+		_dr->_vm->_trip.getset[page_].remember(menuspace);
+
+	_dr->_vm->_gyro.cp = savecp;
+
+
 	warning("STUB: Dropdown::menuset::update()");
 }
 
@@ -616,8 +636,8 @@ void Dropdown::standard_bar() {   /* Standard menu bar */
 	ddm_m.create('O', "Objects", '\30', &Avalanche::Dropdown::ddm__objects, &Avalanche::Dropdown::do__objects); /* here... */
 	ddm_m.create('P', "People", '\31', &Avalanche::Dropdown::ddm__people, &Avalanche::Dropdown::do__people);
 	ddm_m.create('W', "With", '\21', &Avalanche::Dropdown::ddm__with, &Avalanche::Dropdown::do__with);
-	ddm_m.update();
 
+	ddm_m.update();
 }
 
 


Commit: 9970ab90fbd73994451088e652d93099d3ef87b8
    https://github.com/scummvm/scummvm/commit/9970ab90fbd73994451088e652d93099d3ef87b8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-23T08:21:53-07:00

Commit Message:
AVALANCHE: Dropdown: Repair menuset::update(), implement Dropdown:chalk().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 6ee7499..7b996d6 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -197,7 +197,7 @@ void menuset::update() {
 	/*setactivepage(3);
 	setfillstyle(1, _dr->menu_b);
 	bar(0, 0, 640, 9);*/
-	_dr->_vm->_graph.drawBar(0, 0, 640, 9, _dr->menu_b);
+	_dr->_vm->_graph.drawBar(0, 0, 640, 10, _dr->menu_b);
 
 	savecp = _dr->_vm->_gyro.cp;
 	_dr->_vm->_gyro.cp = 3;
@@ -282,11 +282,37 @@ void Dropdown::find_what_you_can_do_with_it() {
 }
 
 void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
-	byte fv, ff, p, bit;
-	uint16 pageseg;
 	byte ander;
+	if (valid)
+		ander = 255;
+	else
+		ander = 170;
+
+	for (byte fv = 0; fv < z.size(); fv++)
+		for (byte ff = 0; ff < 8; ff++) {
+				byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
+					// We don't have to bother with the planes. See the original. Note that it's the bitwise OR operator!
+				}
+			}
+
+	if (! z.contains(t))
+		return;
+	else {
+		byte fv;
+		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+	
+		// Similar to the cycle before.
+		byte pixel = ~ ander;
+		for (byte bit = 0; bit < 8; bit++) {
+			byte pixelBit = (pixel >> bit) & 1;
+			*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
+		}
+	}
 
-	warning("STUB: Dropdown::chalk()");
+	_vm->_lucerna.blitfix();
 }
 
 void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {


Commit: de066939d1d997c66d6c8695ba4f72ed3ccf5c03
    https://github.com/scummvm/scummvm/commit/de066939d1d997c66d6c8695ba4f72ed3ccf5c03
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-23T11:52:26-07:00

Commit Message:
AVALANCHE: Remove warning from menuset::update().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 7b996d6..6c7c70e 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -209,9 +209,6 @@ void menuset::update() {
 		_dr->_vm->_trip.getset[page_].remember(menuspace);
 
 	_dr->_vm->_gyro.cp = savecp;
-
-
-	warning("STUB: Dropdown::menuset::update()");
 }
 
 void menuset::extd(char c) {


Commit: 2af413cccfc7f2bd09b097cffa369bb222b20484
    https://github.com/scummvm/scummvm/commit/2af413cccfc7f2bd09b097cffa369bb222b20484
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-23T13:24:20-07:00

Commit Message:
AVALANCHE: Cosmetic correction in Dropdown::chalk().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 6c7c70e..ce95fd2 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -287,13 +287,13 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 
 	for (byte fv = 0; fv < z.size(); fv++)
 		for (byte ff = 0; ff < 8; ff++) {
-				byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
-				for (byte bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
-					// We don't have to bother with the planes. See the original. Note that it's the bitwise OR operator!
-				}
+			byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
+			for (byte bit = 0; bit < 8; bit++) {
+				byte pixelBit = (pixel >> bit) & 1;
+				*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
+				// We don't have to bother with the planes. See the original. Note that it's the bitwise OR operator!
 			}
+		}
 
 	if (! z.contains(t))
 		return;


Commit: 984b478132d4d7bd65c17a7ff5728373e5b2fdd9
    https://github.com/scummvm/scummvm/commit/984b478132d4d7bd65c17a7ff5728373e5b2fdd9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-23T15:14:07-07:00

Commit Message:
AVALANCHE: Modify comment in Dropdown::chalk().

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index ce95fd2..8828cb6 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -290,8 +290,9 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 			byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
-				*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
-				// We don't have to bother with the planes. See the original. Note that it's the bitwise OR operator!
+				*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
+				// We don't have to bother with the planes, since they all have the same value. See the original.
+				// Note that it's the bitwise OR operator!
 			}
 		}
 


Commit: 9e15eee97059c5baf5db7ad197cbd1f577acad5f
    https://github.com/scummvm/scummvm/commit/9e15eee97059c5baf5db7ad197cbd1f577acad5f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T02:03:52-07:00

Commit Message:
AVALANCHE: Modify Avalot::run() to don't exit after a single loop, comment out the error in getsettype::remember() until I find out why it is invoked.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ecd1095..d63790f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -174,7 +174,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_graph.refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
-	} while (false /*! _vm->_gyro.lmo*/); // So we run only one cycle during the testing. Of course it will be restored later.
+	} while (! _vm->_gyro.lmo);
 
 	//restorecrtmode();
 	//if (logging)
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 8213939..5f04ebc 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -384,8 +384,8 @@ getsettype *getsettype::init() {
 
 void getsettype::remember(bytefield r) {
 	numleft++;
-	if (numleft > maxgetset)
-		error("Trip::remember() : runerr_Getset_Overflow");
+	//if (numleft > maxgetset)
+	//	error("Trip::remember() : runerr_Getset_Overflow");
 	gs[numleft] = r;
 }
 


Commit: 5dc6abe87b174673304826c00c05e54eab53625f
    https://github.com/scummvm/scummvm/commit/5dc6abe87b174673304826c00c05e54eab53625f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T03:55:01-07:00

Commit Message:
AVALANCHE: Add event handling.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 88e6e0e..0c04e6b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -26,7 +26,6 @@
  */
 
 #include "avalanche/avalanche.h"
-#include "avalanche/avalot.h"
 
 #include "common/system.h"
 #include "common/random.h"
@@ -103,7 +102,16 @@ namespace Avalanche {
 		//	_sound->syncVolume();
 	}
 
-	
+	void AvalancheEngine::updateEvents() {
+		Common::Event event;
+
+		while (_eventMan->pollEvent(event)) {
+			switch (event.type) {
+			case Common::EVENT_KEYDOWN:
+				_avalot.handleKeyDown(event);
+			}
+		}
+	}
 
 
 
@@ -255,7 +263,7 @@ namespace Avalanche {
 		_graph.init();
 
 		
-
+		
 
 		// From bootstrp:
 
@@ -270,7 +278,7 @@ namespace Avalanche {
 		if (!zoomy)
 			call_menu();    /* Not run when zoomy. */
 
-		
+
 
 		do {
 			run_avalot();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index bd8e532..fac36b4 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -108,6 +108,8 @@ public:
 	Common::String getSavegameFilename(int slot);
 	void syncSoundSettings();
 
+	void updateEvents();
+
 protected:
 	// Engine APIs
 	Common::Error run();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index d63790f..21ce5ab 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1,28 +1,28 @@
 /* ScummVM - Graphic Adventure Engine
  *
- * ScummVM is the legal property of its developers, whose names
+ * 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.
+ * of the License: or (at your option) any later version.
 
- * This program is distributed in the hope that it will be useful,
+ * 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.
+ * along with this program; if not: write to the Free Software
+ * Foundation: Inc.: 51 Franklin Street: Fifth Floor: Boston: MA 02110-1301: USA.
  *
  */
 
 /*
  * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ * Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman.
  */
 
 /* AVALOT		The kernel of the program. */
@@ -55,6 +55,14 @@
 
 namespace Avalanche {
 
+
+
+void Avalot::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+
+
 void Avalot::setup() {
 	int16 gd, gm;
 
@@ -67,7 +75,7 @@ void Avalot::setup() {
 	_vm->_gyro.on_virtual();
 	gd = 3;
 	gm = 0;
-	//initgraph(gd, gm, "");
+	//initgraph(gd: gm: "");
 	_vm->_gyro.holdthedawn = true;
 	_vm->_lucerna.dusk();
 	_vm->_gyro.cmp = 177;
@@ -77,7 +85,7 @@ void Avalot::setup() {
 	_vm->_gyro.oldjw = 177;
 	_vm->_gyro.mousetext = "";
 	_vm->_gyro.c = 999;
-	//settextjustify(0, 0);
+	//settextjustify(0: 0);
 	_vm->_gyro.ddmnow = false;
 	_vm->_lucerna.load_digits();
 	_vm->_gyro.cheat = false;
@@ -97,12 +105,12 @@ void Avalot::setup() {
 
 	/* for gd:=0 to 1 do
 	 begin
-	  setactivepage(gd); outtextxy(7,177,chr(48+gd));
+	  setactivepage(gd); outtextxy(7:177:chr(48+gd));
 	 end;*/
 
 	_vm->_trip.loadtrip();
 
-	_vm->_gyro.reloaded = false; // TODO: Remove it later, when SAVE/LOAD system is implemented. Until then, we always start a new game.
+	_vm->_gyro.reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
 
 	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded))
 		_vm->_gyro.newgame(); /* no game was requested- load the default */
@@ -132,7 +140,7 @@ void Avalot::setup() {
 	}
 
 	_vm->_trip.get_back_loretta();
-	//gm = getpixel(0, 0);
+	//gm = getpixel(0: 0);
 	//setcolor(7);
 	_vm->_gyro.holdthedawn = false;
 	_vm->_lucerna.dawn();
@@ -141,14 +149,33 @@ void Avalot::setup() {
 	_vm->_trip.newspeed();
 
 	if (! _vm->_gyro.reloaded)
-		_vm->_visa.dixi('q', 83); /* Info on the game, etc. */
+		_vm->_visa.dixi('q', 83); /* Info on the game: etc. */
 }
 
-void Avalot::setParent(AvalancheEngine *vm) {
-	_vm = vm;
+
+
+void Avalot::handleKeyDown(const Common::Event &event) {
+	switch (event.kbd.keycode) {
+	case Common::KEYCODE_UP:
+	case Common::KEYCODE_DOWN:
+	case Common::KEYCODE_RIGHT:
+	case Common::KEYCODE_LEFT:
+	case Common::KEYCODE_PAGEUP:
+	case Common::KEYCODE_PAGEDOWN:
+	case Common::KEYCODE_HOME:
+	case Common::KEYCODE_END:
+		handleMoveKey(event); // Fallthroughs are intended.
+		break;
+	}
+
+}
+
+void Avalot::handleMoveKey(const Common::Event &event) { 
+	warning("STUB: Avalot::handleMoveKey()");
 }
 
 
+
 void Avalot::run(Common::String arg) {
 	setup();
 
@@ -172,6 +199,12 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_timeout.one_tick();
 
+
+
+		// Not in the original:
+
+		_vm->updateEvents(); // The event handler.
+
 		_vm->_graph.refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 	} while (! _vm->_gyro.lmo);
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 50bff72..502358e 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -30,6 +30,7 @@
 #ifndef AVALOT_H
 #define AVALOT_H
 
+#include "common/events.h"
 #include "common/system.h"
 
 namespace Avalanche {
@@ -41,6 +42,14 @@ public:
 
 	void setup();
 
+
+
+	void handleKeyDown(const Common::Event &event);
+
+	void handleMoveKey(const Common::Event &event); // To replace Trip::tripkey().
+
+
+
 	void run(Common::String arg);
 
 private:


Commit: 3058a02ab9d3c8791768fb7b60556e61d2414f8c
    https://github.com/scummvm/scummvm/commit/3058a02ab9d3c8791768fb7b60556e61d2414f8c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T03:56:55-07:00

Commit Message:
AVALANCHE: Fix commas.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 21ce5ab..0dcfd84 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1,22 +1,22 @@
 /* ScummVM - Graphic Adventure Engine
  *
- * ScummVM is the legal property of its developers: whose names
+ * 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.
+ * of the License, or (at your option) any later version.
 
- * This program is distributed in the hope that it will be useful:
+ * 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.
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  */
 


Commit: bddc0e5cbf1046aef3d6dfe543954477791d4b3b
    https://github.com/scummvm/scummvm/commit/bddc0e5cbf1046aef3d6dfe543954477791d4b3b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T04:11:24-07:00

Commit Message:
AVALANCHE: Move handleMoveKey() from Avalot to Trip.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0dcfd84..7b315b3 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -164,16 +164,12 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_PAGEDOWN:
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
-		handleMoveKey(event); // Fallthroughs are intended.
+		_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
 		break;
 	}
 
 }
 
-void Avalot::handleMoveKey(const Common::Event &event) { 
-	warning("STUB: Avalot::handleMoveKey()");
-}
-
 
 
 void Avalot::run(Common::String arg) {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 502358e..24ee4fe 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -46,7 +46,7 @@ public:
 
 	void handleKeyDown(const Common::Event &event);
 
-	void handleMoveKey(const Common::Event &event); // To replace Trip::tripkey().
+	
 
 
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 5f04ebc..b90c500 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1567,4 +1567,11 @@ void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
 	tr[1].visible = false;
 }
 
+
+
+void Trip::handleMoveKey(const Common::Event &event) { 
+	warning("STUB: Avalot::handleMoveKey()");
+}
+
+
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index c202b76..bd9b00a 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -223,6 +223,11 @@ public:
 
 	void take_a_step(byte &tripnum);
 
+
+
+	void handleMoveKey(const Common::Event &event); // To replace tripkey().
+
+
 	triptype tr[numtr];
 	getsettype getset[2];
 	byte aa[1600];


Commit: e8841fbe5c39ff07aa099f8207cd8d571779585e
    https://github.com/scummvm/scummvm/commit/e8841fbe5c39ff07aa099f8207cd8d571779585e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T04:38:32-07:00

Commit Message:
AVALANCHE: Implement Trip::handleMoveKey(), update Avalot::handleKeyDown().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7b315b3..1d62e0b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -164,6 +164,7 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_PAGEDOWN:
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
+	case Common::KEYCODE_KP5:
 		_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
 		break;
 	}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index b90c500..3d8d540 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1570,7 +1570,72 @@ void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
 
 
 void Trip::handleMoveKey(const Common::Event &event) { 
-	warning("STUB: Avalot::handleMoveKey()");
+	//if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
+	//	return;
+	//	
+	// We don't mess around with the joystick.
+	
+	switch (event.kbd.keycode) {
+	case Common::KEYCODE_UP:
+		if (_vm->_gyro.dna.rw != up) {
+			_vm->_gyro.dna.rw = up;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_DOWN:
+		if (_vm->_gyro.dna.rw != down) {
+			_vm->_gyro.dna.rw = down;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_LEFT:
+		if (_vm->_gyro.dna.rw != left) {
+			_vm->_gyro.dna.rw = left;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_RIGHT:
+		if (_vm->_gyro.dna.rw != right) {
+			_vm->_gyro.dna.rw = right;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_PAGEUP:
+		if (_vm->_gyro.dna.rw != ur) {
+			_vm->_gyro.dna.rw = ur;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_PAGEDOWN:
+		if (_vm->_gyro.dna.rw != dr) {
+			_vm->_gyro.dna.rw = dr;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_END:
+		if (_vm->_gyro.dna.rw != dl) {
+			_vm->_gyro.dna.rw = dl;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_HOME:
+		if (_vm->_gyro.dna.rw != ul) {
+			_vm->_gyro.dna.rw = ul;
+			rwsp(0, _vm->_gyro.dna.rw);
+		} else
+			stopwalking();
+		break;
+	case Common::KEYCODE_KP5:
+		stopwalking();
+		break;
+	}
 }
 
 


Commit: aed0c42f152ab9a0bcbefabdc7935d3646433d79
    https://github.com/scummvm/scummvm/commit/aed0c42f152ab9a0bcbefabdc7935d3646433d79
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T04:54:39-07:00

Commit Message:
AVALANCHE: Add comments to Avalot:handleKeyDown().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 1d62e0b..f9b6a1f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -155,6 +155,11 @@ void Avalot::setup() {
 
 
 void Avalot::handleKeyDown(const Common::Event &event) {
+	//if (keyboardclick)
+	//	click();
+	//	
+	// To be implemented later with the sounds, I assume.
+
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_UP:
 	case Common::KEYCODE_DOWN:
@@ -168,7 +173,6 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 		_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
 		break;
 	}
-
 }
 
 
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 24ee4fe..d309138 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -44,7 +44,7 @@ public:
 
 
 
-	void handleKeyDown(const Common::Event &event);
+	void handleKeyDown(const Common::Event &event); // To replace Basher::keyboard_link().
 
 	
 


Commit: aa0603cf427c2a703325abab061d9b16f09cf4cd
    https://github.com/scummvm/scummvm/commit/aa0603cf427c2a703325abab061d9b16f09cf4cd
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T07:42:23-07:00

Commit Message:
AVALANCHE: rename constants to follow our code formatting conventions.

Changed paths:
    engines/avalanche/graph.cpp
    engines/avalanche/graph.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 3e22f45..b3d5012 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -48,7 +48,7 @@ void Graph::setParent(AvalancheEngine *vm) {
 }
 
 void Graph::init() {
-	initGraphics(_screenWidth, _screenHeight, true);
+	initGraphics(kScreenWidth, kScreenHeight, true);
 
 	for (int i = 0; i < 64; ++i) {
 		_egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
@@ -59,7 +59,7 @@ void Graph::init() {
 	for (byte i = 0; i < 16; i++)
 		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
 
-	_surface.create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
+	_surface.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
 }
 
 Graph::~Graph() {
@@ -141,7 +141,7 @@ void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 }
 
 void Graph::refreshScreen() {
-	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, _screenWidth, _screenHeight);
+	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, kScreenWidth, kScreenHeight);
 	g_system->updateScreen();
 }
 
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
index 7d6db70..e24e042 100644
--- a/engines/avalanche/graph.h
+++ b/engines/avalanche/graph.h
@@ -56,8 +56,8 @@ public:
 
 class Graph {
 public:
-	static const int16 _screenWidth = 640;
-	static const int16 _screenHeight = 200;
+	static const int16 kScreenWidth = 640;
+	static const int16 kScreenHeight = 200;
 
 	
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5d60c75..d75468d 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -245,8 +245,8 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	Graphics::Surface background;
 	
-	uint16 backgroundWidht = _vm->_graph._screenWidth;
-	byte backgroundHeight = 8 * 12080 / _vm->_graph._screenWidth; // With 640 width it's 151
+	uint16 backgroundWidht = _vm->_graph.kScreenWidth;
+	byte backgroundHeight = 8 * 12080 / _vm->_graph.kScreenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
 	background.create(backgroundWidht, backgroundHeight, Graphics::PixelFormat::createFormatCLUT8());


Commit: 0d6a327f98b1c4d02d78927f78f2865c000bf816
    https://github.com/scummvm/scummvm/commit/0d6a327f98b1c4d02d78927f78f2865c000bf816
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T07:43:34-07:00

Commit Message:
AVALANCHE: Remove unnecessary indents from avalanche.cpp.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0c04e6b..2007d6b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -65,53 +65,53 @@ namespace Avalanche {
 		_timeout.setParent(this);
 		_trip.setParent(this);
 		_acci.setParent(this);
-		_basher.setParent(this);
-		_dropdown.setParent(this);
-		_closing.setParent(this);
-		_avalot.setParent(this);
-	}
-
-	AvalancheEngine::~AvalancheEngine() {
-		delete _console;
-		delete _rnd;
-	}
-
-	GUI::Debugger *AvalancheEngine::getDebugger() {
-		return _console;
-	}
-
-	Common::Platform AvalancheEngine::getPlatform() const {
-		return _platform;
-	}
-
-	bool AvalancheEngine::hasFeature(EngineFeature f) const {
-		return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime);
-	}
-
-	const char *AvalancheEngine::getCopyrightString() const {
-		return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
-	}
-
-	Common::String AvalancheEngine::getSavegameFilename(int slot) {
-		return _targetName + Common::String::format("-%02d.SAV", slot);
-	}
-
-	void AvalancheEngine::syncSoundSettings() {
-		Engine::syncSoundSettings();
-
-		//	_sound->syncVolume();
-	}
-
-	void AvalancheEngine::updateEvents() {
-		Common::Event event;
-
-		while (_eventMan->pollEvent(event)) {
-			switch (event.type) {
-			case Common::EVENT_KEYDOWN:
-				_avalot.handleKeyDown(event);
-			}
+	_basher.setParent(this);
+	_dropdown.setParent(this);
+	_closing.setParent(this);
+	_avalot.setParent(this);
+}
+
+AvalancheEngine::~AvalancheEngine() {
+	delete _console;
+	delete _rnd;
+}
+
+GUI::Debugger *AvalancheEngine::getDebugger() {
+	return _console;
+}
+
+Common::Platform AvalancheEngine::getPlatform() const {
+	return _platform;
+}
+
+bool AvalancheEngine::hasFeature(EngineFeature f) const {
+	return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime);
+}
+
+const char *AvalancheEngine::getCopyrightString() const {
+	return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
+}
+
+Common::String AvalancheEngine::getSavegameFilename(int slot) {
+	return _targetName + Common::String::format("-%02d.SAV", slot);
+}
+
+void AvalancheEngine::syncSoundSettings() {
+	Engine::syncSoundSettings();
+
+	//	_sound->syncVolume();
+}
+
+void AvalancheEngine::updateEvents() {
+	Common::Event event;
+
+	while (_eventMan->pollEvent(event)) {
+		switch (event.type) {
+		case Common::EVENT_KEYDOWN:
+			_avalot.handleKeyDown(event);
 		}
 	}
+}
 
 
 
@@ -119,193 +119,193 @@ namespace Avalanche {
 
 
 
-	// From Bootstrp:
+// From Bootstrp:
 
-	const char AvalancheEngine::runcodes[2][3] = {"et", "Go"};
+const char AvalancheEngine::runcodes[2][3] = {"et", "Go"};
 
 
 
-	// The original ones were all commented out, so porbably there's no need
-	// of these two cursor functions at all. TODO: Remove later.
-	void AvalancheEngine::cursor_off() {
-		warning("STUB: cursor_off()");
-	}
+// The original ones were all commented out, so porbably there's no need
+// of these two cursor functions at all. TODO: Remove later.
+void AvalancheEngine::cursor_off() {
+	warning("STUB: cursor_off()");
+}
 
-	void AvalancheEngine::cursor_on() {
-		warning("STUB: cursor_on()");
-	}
+void AvalancheEngine::cursor_on() {
+	warning("STUB: cursor_on()");
+}
 
-	// Needed later.
-	void AvalancheEngine::quit() {
-		cursor_on();
-	}
+// Needed later.
+void AvalancheEngine::quit() {
+	cursor_on();
+}
 
-	Common::String AvalancheEngine::strf(int32 x) {
-		Common::String q = Common::String::format("%d", x);
-		return q;
-	}
+Common::String AvalancheEngine::strf(int32 x) {
+	Common::String q = Common::String::format("%d", x);
+	return q;
+}
 
-	// Needed in dos_shell(). TODO: Remove later.
-	Common::String AvalancheEngine::command_com() {
-		warning("STUB: command_com()");
-		return ("STUB: command_com()");
-	}
+// Needed in dos_shell(). TODO: Remove later.
+Common::String AvalancheEngine::command_com() {
+	warning("STUB: command_com()");
+	return ("STUB: command_com()");
+}
 
-	// Needed for run_avalot()'s errors. TODO: Remove later.
-	void AvalancheEngine::explain(byte error) {
-		warning("STUB: explain()");
-	}
+// Needed for run_avalot()'s errors. TODO: Remove later.
+void AvalancheEngine::explain(byte error) {
+	warning("STUB: explain()");
+}
 
 
 
-	//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
+//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
 
-	void AvalancheEngine::b_flight() {   /*interrupt;*/
-		_storage.skellern++;
-	}
+void AvalancheEngine::b_flight() {   /*interrupt;*/
+	_storage.skellern++;
+}
 
-	void AvalancheEngine::bflight_on() {
-		_storage.skellern = _reset_;
-		// setintvec(0x1c, &b_flight);
-	}
+void AvalancheEngine::bflight_on() {
+	_storage.skellern = _reset_;
+	// setintvec(0x1c, &b_flight);
+}
 
-	void AvalancheEngine::bflight_off() {
-		// setintvec(0x1c, old_1c);
-	}
+void AvalancheEngine::bflight_off() {
+	// setintvec(0x1c, old_1c);
+}
 
 
 
-	Common::String AvalancheEngine::elm2str(elm how) {
-		Common::String elm2str_result;
-		switch (how) {
-		case Normal:
-		case Musical:
-			elm2str_result = "jsb";
-			break;
-		case Regi:
-			elm2str_result = "REGI";
-			break;
-		case Elmpoyten:
-			elm2str_result = "ELMPOYTEN";
-			break;
-		}
-		return elm2str_result;
+Common::String AvalancheEngine::elm2str(elm how) {
+	Common::String elm2str_result;
+	switch (how) {
+	case Normal:
+	case Musical:
+		elm2str_result = "jsb";
+		break;
+	case Regi:
+		elm2str_result = "REGI";
+		break;
+	case Elmpoyten:
+		elm2str_result = "ELMPOYTEN";
+		break;
 	}
+	return elm2str_result;
+}
 
-	void AvalancheEngine::run(Common::String what, bool with_jsb, bool with_bflight, elm how) {
-		warning("STUB: run(%s)", what.c_str()); 
-		// Probably there'll be no need of this function, as all *.AVX-es will become classes.
-	}
+void AvalancheEngine::run(Common::String what, bool with_jsb, bool with_bflight, elm how) {
+	warning("STUB: run(%s)", what.c_str()); 
+	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
+}
 
-	void AvalancheEngine::get_arguments() {
-		// This function should mess around with command line arguments,
-		// but I am not sure if there'll be use of these arguments at all...
-		warning("STUB: get_arguments()"); 
-	}
+void AvalancheEngine::get_arguments() {
+	// This function should mess around with command line arguments,
+	// but I am not sure if there'll be use of these arguments at all...
+	warning("STUB: get_arguments()"); 
+}
 
-	void AvalancheEngine::get_slope() {
-		// Same as get_arguments()
-		warning("STUB: get_slope()");
-	}
+void AvalancheEngine::get_slope() {
+	// Same as get_arguments()
+	warning("STUB: get_slope()");
+}
 
-	void AvalancheEngine::call_menu() {
-		warning("STUB: call_menu()");
-	}
+void AvalancheEngine::call_menu() {
+	warning("STUB: call_menu()");
+}
 
-	void AvalancheEngine::run_the_demo() {
-		warning("STUB: run_the_demo()");
-	}
+void AvalancheEngine::run_the_demo() {
+	warning("STUB: run_the_demo()");
+}
 
-	void AvalancheEngine::dos_shell() {
-		warning("STUB: dos_shell()");
-	}
+void AvalancheEngine::dos_shell() {
+	warning("STUB: dos_shell()");
+}
 
-	// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
-	bool AvalancheEngine::keypressed1() {	
-		warning("STUB: keypressed1()");
-		return false;
-	}
+// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
+bool AvalancheEngine::keypressed1() {	
+	warning("STUB: keypressed1()");
+	return false;
+}
 
-	// Same as keypressed1().
-	void AvalancheEngine::flush_buffer() {
-		warning("STUB: flush_buffer()");
-	}
+// Same as keypressed1().
+void AvalancheEngine::flush_buffer() {
+	warning("STUB: flush_buffer()");
+}
 
-	// Same as keypressed1().
-	void AvalancheEngine::demo() {
-		warning("STUB: demo()");
-	}
+// Same as keypressed1().
+void AvalancheEngine::demo() {
+	warning("STUB: demo()");
+}
 
 
 
 	
-	void AvalancheEngine::run_avalot() {
-		bflight_on();
+void AvalancheEngine::run_avalot() {
+	bflight_on();
 
-		_avalot.run(Common::String(runcodes[first_time]) + arguments);
-		// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
-		// If there's an error initalizing avalot, i'll handle it in there, not here
+	_avalot.run(Common::String(runcodes[first_time]) + arguments);
+	// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
+	// If there's an error initalizing avalot, i'll handle it in there, not here
 
-		first_time = false;
-	}
+	first_time = false;
+}
 
 
 
-	Common::Error AvalancheEngine::run() {
-		s_Engine = this;
+Common::Error AvalancheEngine::run() {
+	s_Engine = this;
 
-		_console = new AvalancheConsole(this);
+	_console = new AvalancheConsole(this);
 		
-		_scrolls.init();
-		_lucerna.init();
-		_acci.init();
-		_basher.init();
-		_graph.init();
+	_scrolls.init();
+	_lucerna.init();
+	_acci.init();
+	_basher.init();
+	_graph.init();
 
 		
 		
 
-		// From bootstrp:
+	// From bootstrp:
 
-		first_time = true;
+	first_time = true;
 
-		get_arguments();
-		get_slope();
+	get_arguments();
+	get_slope();
 
-		zoomy = true; 
-		// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
-		// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
-		if (!zoomy)
-			call_menu();    /* Not run when zoomy. */
+	zoomy = true; 
+	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
+	// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
+	if (!zoomy)
+		call_menu();    /* Not run when zoomy. */
 
 
 
-		do {
-			run_avalot();
+	do {
+		run_avalot();
 
-			//if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
+		//if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
 
-			switch (_storage.operation) {
-			case _runShootemup:
-				run("seu.avx", _jsb, _bflight, Normal);
-				break;
-			case _runDosshell:
-				dos_shell();
-				break;
-			case _runGhostroom:
-				run("g-room.avx", _jsb, _no_bflight, Normal);
-				break;
-			case _runGolden:
-				run("golden.avx", _jsb, _bflight, Musical);
-				break;
-			}
+		switch (_storage.operation) {
+		case _runShootemup:
+			run("seu.avx", _jsb, _bflight, Normal);
+			break;
+		case _runDosshell:
+			dos_shell();
+			break;
+		case _runGhostroom:
+			run("g-room.avx", _jsb, _no_bflight, Normal);
+			break;
+		case _runGolden:
+			run("golden.avx", _jsb, _bflight, Musical);
+			break;
+		}
 
-		} while (true);
+	} while (true);
 
 
 
-		return Common::kNoError;
-	}
+	return Common::kNoError;
+}
 
 	
 


Commit: bc5b3fbb65cc902d9ac2b44f3038f9543342ee96
    https://github.com/scummvm/scummvm/commit/bc5b3fbb65cc902d9ac2b44f3038f9543342ee96
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T08:02:08-07:00

Commit Message:
AVALANCHE: Rename Graph to Graphics. Update everything accordingly.

Changed paths:
  A engines/avalanche/graphics.cpp
  A engines/avalanche/graphics.h
  R engines/avalanche/graph.cpp
  R engines/avalanche/graph.h
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index fac36b4..122959e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -30,7 +30,7 @@
 
 #include "avalanche/console.h"
 
-#include "avalanche/graph.h"
+#include "avalanche/graphics.h"
 
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
@@ -65,7 +65,7 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
-	Graph _graph;
+	Graphics _graph;
 
 	Avalot _avalot;
 	Gyro _gyro;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f9b6a1f..2f62dc1 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -29,7 +29,7 @@
 
 #include "avalanche/avalanche.h"
 
-#include "avalanche/graph.h"
+#include "avalanche/graphics.h"
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/trip6.h"
diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
deleted file mode 100644
index b3d5012..0000000
--- a/engines/avalanche/graph.cpp
+++ /dev/null
@@ -1,148 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* Replacement class for the Graph unit from Pascal. */
-
-#include "avalanche/avalanche.h"
-#include "avalanche/graph.h"
-
-#include "common/system.h"
-
-#include "engines/util.h"
-
-#include "graphics/palette.h"
-#include "common/rect.h"
-
-namespace Avalanche {
-
-const byte Graph::_egaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
-
-
-
-void Graph::setParent(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Graph::init() {
-	initGraphics(kScreenWidth, kScreenHeight, true);
-
-	for (int i = 0; i < 64; ++i) {
-		_egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
-		_egaPalette[i][1] = (i >> 1 & 1) * 0xaa + (i >> 4 & 1) * 0x55;
-		_egaPalette[i][2] = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
-	}
-
-	for (byte i = 0; i < 16; i++)
-		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
-
-	_surface.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
-}
-
-Graph::~Graph() {
-	_surface.free();
-}
-
-
-void Graph::flesh_colours()
-{
-	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
-	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
-}
-
-
-byte *Graph::getPixel(int16 x, int16 y) {
-	return (byte *)_surface.getBasePtr(x, y);
-}
-
-void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
-	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
-}
-
-void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-
-	/* First we make the pixels of the spirte blank. */
-	for (byte qay = 0; qay < sprite.yl; qay++) {
-		byte *mask = new byte[sprite.xl];
-
-		for (byte qax = 0; qax < sprite.xl; qax++) {
-			byte count = qax / 8;
-			mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
-			if (mask[qax] == 0)
-				*getPixel(x + qax, y + qay) = 0;
-		}
-
-		delete[] mask;
-	}
-
-	/* Then we draw the picture to the blank places. */
-	uint16 i = 0; // Because the original siltype starts at 5!!! See Graph.h for definition.
-
-	for (byte qay = 0; qay < sprite.yl; qay++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 qax = 0; qax  < sprite.xl; qax += 8) {
-				byte pixel = (*sprite.mani[picnum])[i++];
-				for (byte bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*getPixel(x + qax + 7 - bit, y + qay) += (pixelBit << plane);
-				} 
-			}
-}
-
-void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
-	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
-	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
-	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
-
-	uint32 i = 4;
-
-	Graphics::Surface picture; // We make a Surface object for the picture itself.
-
-	picture.create(pictureWidth, pictureHeight, Graphics::PixelFormat::createFormatCLUT8());
-
-	// Produce the picture.
-	for (byte y = 0; y < pictureHeight; y++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 x = 0; x < pictureWidth; x += 8) {
-				byte pixel = source[i++];
-				for (byte bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
-				} 
-			}
-
-	// Copy the picture to a given place on the screen.
-	for (uint16 y = 0; y < picture.h; y++)
-		for (uint16 x = 0; x < picture.w; x++)
-			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
-}
-
-void Graph::refreshScreen() {
-	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, kScreenWidth, kScreenHeight);
-	g_system->updateScreen();
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/graph.h b/engines/avalanche/graph.h
deleted file mode 100644
index e24e042..0000000
--- a/engines/avalanche/graph.h
+++ /dev/null
@@ -1,94 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* Replacement class for the Graph unit from Pascal. */
-
-#ifndef GRAPH_H
-#define GRAPH_H
-
-#include "common/file.h"
-
-#include "graphics/surface.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
-// Be aware!!!
-
-typedef byte siltype[51][11]; /* 35, 4 */
-
-class SpriteInfo {
-public:
-	byte xw; /* x-width in bytes */
-	byte xl, yl; /* x & y lengths of pictures */
-
-	manitype *mani[24];
-	siltype *sil[24];
-
-	uint16 size; /* the size of one picture */
-};
-
-
-class Graph {
-public:
-	static const int16 kScreenWidth = 640;
-	static const int16 kScreenHeight = 200;
-
-	
-
-	void setParent(AvalancheEngine *vm);
-
-	void init();
-
-	~Graph();
-
-	void flesh_colours();
-
-	byte *getPixel(int16 x, int16 y);
-
-	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
-
-	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-
-	void drawPicture(const byte *source, uint16 destX, uint16 destY);
-
-	void refreshScreen();
-
-private:
-	AvalancheEngine *_vm;
-
-	Graphics::Surface _surface;
-
-	static const byte _egaPaletteIndex[16];
-
-	byte _egaPalette[64][3];
-};
-
-} // End of namespace Avalanche
-
-#endif // GRAPH_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
new file mode 100644
index 0000000..aefaa49
--- /dev/null
+++ b/engines/avalanche/graphics.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Replacement class for the Graph unit from Pascal. */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/graphics.h"
+
+#include "common/system.h"
+
+#include "engines/util.h"
+
+#include "graphics/palette.h"
+#include "common/rect.h"
+
+namespace Avalanche {
+
+const byte Graphics::_egaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
+
+
+
+void Graphics::setParent(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Graphics::init() {
+	initGraphics(kScreenWidth, kScreenHeight, true);
+
+	for (int i = 0; i < 64; ++i) {
+		_egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
+		_egaPalette[i][1] = (i >> 1 & 1) * 0xaa + (i >> 4 & 1) * 0x55;
+		_egaPalette[i][2] = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
+	}
+
+	for (byte i = 0; i < 16; i++)
+		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
+
+	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+}
+
+Graphics::~Graphics() {
+	_surface.free();
+}
+
+
+void Graphics::flesh_colours()
+{
+	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
+	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
+}
+
+
+byte *Graphics::getPixel(int16 x, int16 y) {
+	return (byte *)_surface.getBasePtr(x, y);
+}
+
+void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
+	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
+}
+
+void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+
+	/* First we make the pixels of the spirte blank. */
+	for (byte qay = 0; qay < sprite.yl; qay++) {
+		byte *mask = new byte[sprite.xl];
+
+		for (byte qax = 0; qax < sprite.xl; qax++) {
+			byte count = qax / 8;
+			mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
+			if (mask[qax] == 0)
+				*getPixel(x + qax, y + qay) = 0;
+		}
+
+		delete[] mask;
+	}
+
+	/* Then we draw the picture to the blank places. */
+	uint16 i = 0; // Because the original siltype starts at 5!!! See Graph.h for definition.
+
+	for (byte qay = 0; qay < sprite.yl; qay++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 qax = 0; qax  < sprite.xl; qax += 8) {
+				byte pixel = (*sprite.mani[picnum])[i++];
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*getPixel(x + qax + 7 - bit, y + qay) += (pixelBit << plane);
+				} 
+			}
+}
+
+void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
+	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
+	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
+	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
+
+	uint32 i = 4;
+
+	::Graphics::Surface picture; // We make a Surface object for the picture itself.
+
+	picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	// Produce the picture.
+	for (byte y = 0; y < pictureHeight; y++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 x = 0; x < pictureWidth; x += 8) {
+				byte pixel = source[i++];
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+				} 
+			}
+
+	// Copy the picture to a given place on the screen.
+	for (uint16 y = 0; y < picture.h; y++)
+		for (uint16 x = 0; x < picture.w; x++)
+			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+}
+
+void Graphics::refreshScreen() {
+	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, kScreenWidth, kScreenHeight);
+	g_system->updateScreen();
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
new file mode 100644
index 0000000..333cbdd
--- /dev/null
+++ b/engines/avalanche/graphics.h
@@ -0,0 +1,94 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Replacement class for the Graph unit from Pascal. */
+
+#ifndef GRAPH_H
+#define GRAPH_H
+
+#include "common/file.h"
+
+#include "graphics/surface.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
+// Be aware!!!
+
+typedef byte siltype[51][11]; /* 35, 4 */
+
+class SpriteInfo {
+public:
+	byte xw; /* x-width in bytes */
+	byte xl, yl; /* x & y lengths of pictures */
+
+	manitype *mani[24];
+	siltype *sil[24];
+
+	uint16 size; /* the size of one picture */
+};
+
+
+class Graphics {
+public:
+	static const int16 kScreenWidth = 640;
+	static const int16 kScreenHeight = 200;
+
+	
+
+	void setParent(AvalancheEngine *vm);
+
+	void init();
+
+	~Graphics();
+
+	void flesh_colours();
+
+	byte *getPixel(int16 x, int16 y);
+
+	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
+
+	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
+
+	void drawPicture(const byte *source, uint16 destX, uint16 destY);
+
+	void refreshScreen();
+
+private:
+	AvalancheEngine *_vm;
+
+	::Graphics::Surface _surface;
+
+	static const byte _egaPaletteIndex[16];
+
+	byte _egaPalette[64][3];
+};
+
+} // End of namespace Avalanche
+
+#endif // GRAPH_H
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d75468d..3b30451 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -243,13 +243,13 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	move(a0, a1, 12080);
 	}*/
 
-	Graphics::Surface background;
+	::Graphics::Surface background;
 	
 	uint16 backgroundWidht = _vm->_graph.kScreenWidth;
 	byte backgroundHeight = 8 * 12080 / _vm->_graph.kScreenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
-	background.create(backgroundWidht, backgroundHeight, Graphics::PixelFormat::createFormatCLUT8());
+	background.create(backgroundWidht, backgroundHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	for (byte plane = 0; plane < 4; plane++)
 		for (uint16 y = 0; y < backgroundHeight; y++)
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 222482e..306df15 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -2,7 +2,7 @@ MODULE := engines/avalanche
 
 MODULE_OBJS = \
 	avalanche.o \
-	graph.o \
+	graphics.o \
 	avalot.o \
 	console.o \
 	detection.o \
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index bd9b00a..4b84221 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -31,7 +31,7 @@
 #ifndef TRIP6_H
 #define TRIP6_H
 
-#include "avalanche/graph.h"
+#include "avalanche/graphics.h"
 
 #include "common/scummsys.h"
 #include "common/str.h"


Commit: 043ded818508a14a0ef909bd7c151b355d8bb597
    https://github.com/scummvm/scummvm/commit/043ded818508a14a0ef909bd7c151b355d8bb597
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T08:02:38-07:00

Commit Message:
AVALANCHE: Implement triptype::walk().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 3d8d540..0f648cf 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -175,9 +175,7 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 }
 
 bool triptype::collision_check() {
-	byte fv;
-
-	for (fv = 1; fv <= _tr->numtr; fv++) 
+	for (byte fv = 0; fv < _tr->numtr; fv++) 
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + _info.xl) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv]._info.xl)) &&
@@ -188,7 +186,75 @@ bool triptype::collision_check() {
 }
 
 void triptype::walk() {
-	warning("STUB: triptype::walk()");
+	byte tc;
+	bytefield r;
+
+
+	if (visible) {
+		{
+			r.x1 = (x / 8) - 1;
+			if (r.x1 == 255)
+				r.x1 = 0;
+			r.y1 = y - 2;
+			r.x2 = ((x + _info.xl) / 8) + 1;
+			r.y2 = y + _info.yl + 2;
+		}
+		_tr->getset[1 - _tr->_vm->_gyro.cp].remember(r);
+	}
+
+	if (!_tr->_vm->_gyro.doing_sprite_run) {
+		ox[_tr->_vm->_gyro.cp] = x;
+		oy[_tr->_vm->_gyro.cp] = y;
+		if (homing)  homestep();
+		x = x + ix;
+		y = y + iy;
+	}
+
+	if (check_me) {
+		if (collision_check()) {
+			bounce();
+			return;
+		}
+
+		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro.cp], y, _info.yl);
+
+		if ((tc != 0) & (!_tr->_vm->_gyro.doing_sprite_run)) {
+			switch (_tr->_vm->_gyro.magics[tc].op) {
+			case _tr->_vm->_gyro.exclaim: {
+				bounce();
+				_tr->mustexclaim = true;
+				_tr->saywhat = _tr->_vm->_gyro.magics[tc].data;
+				}
+				break;
+			case _tr->_vm->_gyro.bounces:
+				bounce();
+				break;
+			case _tr->_vm->_gyro.transport:
+				_tr->fliproom(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff);
+				break;
+			case _tr->_vm->_gyro.unfinished: {
+				bounce();
+				_tr->_vm->_scrolls.display("\7Sorry.\3\rThis place is not available yet!");
+				}
+				break;
+			case _tr->_vm->_gyro.special:
+				_tr->call_special(_tr->_vm->_gyro.magics[tc].data);
+				break;
+			case _tr->_vm->_gyro.mopendoor:
+				_tr->open_the_door(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff, tc);
+				break;
+			}
+		}
+	}
+
+	if (!_tr->_vm->_gyro.doing_sprite_run) {
+		count += 1;
+		if (((ix != 0) || (iy != 0)) && (count > 1)) {
+			step += 1;
+			if (step == a.seq)  step = 0;
+			count = 0;
+		}
+	}
 }
 
 void triptype::bounce() {


Commit: ba581b0b325d14684dcb9a302fd06c098cacea05
    https://github.com/scummvm/scummvm/commit/ba581b0b325d14684dcb9a302fd06c098cacea05
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T08:12:46-07:00

Commit Message:
AVALANCHE: Fix indents in avalanche.cpp.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2007d6b..aa9fe9f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -41,30 +41,30 @@
 
 namespace Avalanche {
 
-	AvalancheEngine *AvalancheEngine::s_Engine = 0;
-
-	AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
-		_system = syst;
-		_console = new AvalancheConsole(this);
-
-		_rnd = new Common::RandomSource("avalanche");
-		_rnd->setSeed(42);     
-
-		_graph.setParent(this);
-
-		_gyro.setParent(this);
-		_enhanced.setParent(this);
-		_logger.setParent(this);
-		_pingo.setParent(this);
-		_scrolls.setParent(this);
-		_visa.setParent(this);
-		_lucerna.setParent(this);
-		_enid.setParent(this);
-		_celer.setParent(this);
-		_sequence.setParent(this);
-		_timeout.setParent(this);
-		_trip.setParent(this);
-		_acci.setParent(this);
+AvalancheEngine *AvalancheEngine::s_Engine = 0;
+
+AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
+	_system = syst;
+	_console = new AvalancheConsole(this);
+
+	_rnd = new Common::RandomSource("avalanche");
+	_rnd->setSeed(42);     
+
+	_graph.setParent(this);
+
+	_gyro.setParent(this);
+	_enhanced.setParent(this);
+	_logger.setParent(this);
+	_pingo.setParent(this);
+	_scrolls.setParent(this);
+	_visa.setParent(this);
+	_lucerna.setParent(this);
+	_enid.setParent(this);
+	_celer.setParent(this);
+	_sequence.setParent(this);
+	_timeout.setParent(this);
+	_trip.setParent(this);
+	_acci.setParent(this);
 	_basher.setParent(this);
 	_dropdown.setParent(this);
 	_closing.setParent(this);


Commit: 8c5ce549e655a0f739cd161ed33efa6750a8fd95
    https://github.com/scummvm/scummvm/commit/8c5ce549e655a0f739cd161ed33efa6750a8fd95
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T08:52:57-07:00

Commit Message:
AVALANCHE: Change _graphics into a pointer, modify the rest of the code accordingly. Introduce AvalanhceEngine::initialize(), use it in AvalancheEninge::run(), modify rest of the code accordingly.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index aa9fe9f..4b51c8b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -45,12 +45,22 @@ AvalancheEngine *AvalancheEngine::s_Engine = 0;
 
 AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
 	_system = syst;
+	s_Engine = this;
 	_console = new AvalancheConsole(this);
 
 	_rnd = new Common::RandomSource("avalanche");
 	_rnd->setSeed(42);     
+}
+
+AvalancheEngine::~AvalancheEngine() {
+	delete _console;
+	delete _rnd;
+
+	delete _graphics;
+}
 
-	_graph.setParent(this);
+Common::ErrorCode AvalancheEngine::initialize() {
+	_graphics = new Graphics(this);
 
 	_gyro.setParent(this);
 	_enhanced.setParent(this);
@@ -69,13 +79,19 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	_dropdown.setParent(this);
 	_closing.setParent(this);
 	_avalot.setParent(this);
-}
 
-AvalancheEngine::~AvalancheEngine() {
-	delete _console;
-	delete _rnd;
+	_graphics->init();
+
+	_scrolls.init();
+	_lucerna.init();
+	_acci.init();
+	_basher.init();
+	
+
+	return Common::kNoError;
 }
 
+
 GUI::Debugger *AvalancheEngine::getDebugger() {
 	return _console;
 }
@@ -252,17 +268,10 @@ void AvalancheEngine::run_avalot() {
 
 
 Common::Error AvalancheEngine::run() {
-	s_Engine = this;
+	Common::ErrorCode err = initialize();
+	if (err != Common::kNoError)
+		return err;
 
-	_console = new AvalancheConsole(this);
-		
-	_scrolls.init();
-	_lucerna.init();
-	_acci.init();
-	_basher.init();
-	_graph.init();
-
-		
 		
 
 	// From bootstrp:
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 122959e..676f3f9 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -65,7 +65,7 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
-	Graphics _graph;
+	Graphics *_graphics;
 
 	Avalot _avalot;
 	Gyro _gyro;
@@ -86,11 +86,13 @@ public:
 	Closing _closing;
 
 
+	OSystem *_system;
+
 
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 
-	OSystem *_system;
+	Common::ErrorCode initialize(); 
 
 	GUI::Debugger *getDebugger();
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2f62dc1..9e64ae4 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -99,7 +99,7 @@ void Avalot::setup() {
 	_vm->_gyro.enid_filename = ""; /* undefined. */
 	_vm->_lucerna.toolbar();
 	_vm->_scrolls.state(2);
-	_vm->_graph.refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
+	_vm->_graphics->refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
 
@@ -206,7 +206,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->updateEvents(); // The event handler.
 
-		_vm->_graph.refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
+		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 	} while (! _vm->_gyro.lmo);
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 8828cb6..219df15 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -197,7 +197,7 @@ void menuset::update() {
 	/*setactivepage(3);
 	setfillstyle(1, _dr->menu_b);
 	bar(0, 0, 640, 9);*/
-	_dr->_vm->_graph.drawBar(0, 0, 640, 10, _dr->menu_b);
+	_dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->menu_b);
 
 	savecp = _dr->_vm->_gyro.cp;
 	_dr->_vm->_gyro.cp = 3;
@@ -290,7 +290,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 			byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
-				*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
+				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
 				// We don't have to bother with the planes, since they all have the same value. See the original.
 				// Note that it's the bitwise OR operator!
 			}
@@ -306,7 +306,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 		byte pixel = ~ ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
-			*_vm->_graph.getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
+			*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
 		}
 	}
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index aefaa49..8035491 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -43,7 +43,7 @@ const byte Graphics::_egaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58
 
 
 
-void Graphics::setParent(AvalancheEngine *vm) {
+Graphics::Graphics(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 333cbdd..1a58002 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -61,7 +61,7 @@ public:
 
 	
 
-	void setParent(AvalancheEngine *vm);
+	Graphics(AvalancheEngine *vm);
 
 	void init();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3b30451..aefa6bf 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -217,7 +217,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	_vm->_gyro.clear_vmc();
 	
-	_vm->_graph.flesh_colours();
+	_vm->_graphics->flesh_colours();
 
 	xx = _vm->_gyro.strf(n);
 	Common::String filename;
@@ -245,8 +245,8 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	::Graphics::Surface background;
 	
-	uint16 backgroundWidht = _vm->_graph.kScreenWidth;
-	byte backgroundHeight = 8 * 12080 / _vm->_graph.kScreenWidth; // With 640 width it's 151
+	uint16 backgroundWidht = _vm->_graphics->kScreenWidth;
+	byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
 	background.create(backgroundWidht, backgroundHeight, ::Graphics::PixelFormat::createFormatCLUT8());
@@ -263,7 +263,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	for (uint16 y = 0; y < backgroundHeight; y++)
 		for (uint16 x = 0; x < backgroundWidht; x++)
-			*_vm->_graph.getPixel(x + 0, y + 10) = *(byte *)background.getBasePtr(x, y);	
+			*_vm->_graphics->getPixel(x + 0, y + 10) = *(byte *)background.getBasePtr(x, y);	
 
 	background.free();
 
@@ -274,9 +274,9 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	load_also(xx);
 	_vm->_celer.load_chunks(xx);
 
-	_vm->_graph.refreshScreen(); // _vm->_pingo.copy03();  -  See Avalot::setup()
+	_vm->_graphics->refreshScreen(); // _vm->_pingo.copy03();  -  See Avalot::setup()
 
-	bit = *_vm->_graph.getPixel(0,0);
+	bit = *_vm->_graphics->getPixel(0,0);
 
 	_vm->_logger.log_newroom(_vm->_gyro.roomname);
 
@@ -766,7 +766,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	f.read(buffer, picsize);
 
-	_vm->_graph.drawPicture(buffer, 205, 170);
+	_vm->_graphics->drawPicture(buffer, 205, 170);
 
 	delete[] buffer;
 
@@ -823,7 +823,7 @@ void Lucerna::toolbar() {
 
 	f.read(buffer, bufferSize);
 
-	_vm->_graph.drawPicture(buffer, 5, 169);
+	_vm->_graphics->drawPicture(buffer, 5, 169);
 
 	delete[] buffer;
 
@@ -859,7 +859,7 @@ void Lucerna::showscore() {
 
 	for (byte fv = 0; fv < 3; fv ++)
 		if (_vm->_gyro.lastscore[fv] != numbers[fv]) 
-			_vm->_graph.drawPicture(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
+			_vm->_graphics->drawPicture(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
 		_vm->_trip.getset[fv].remember(scorespace);
@@ -1052,7 +1052,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
 
-	_vm->_graph.drawPicture(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
 
 	_vm->_gyro.on();
 	//setactivepage(1 - cp);
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index e2288b2..35ae4fc 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -92,7 +92,7 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 
 	_vm->_gyro.super_off();
 
-	_vm->_graph.drawBar(419, 195, 438, 197, color);
+	_vm->_graphics->drawBar(419, 195, 438, 197, color);
 
 	_vm->_gyro.super_on();
 	_vm->_gyro.ledstatus = x;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 0f648cf..f9e8faa 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -153,7 +153,7 @@ void triptype::andexor() {
 		return;
 	byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). 
 
-	_tr->_vm->_graph.drawSprite(_info, picnum, x, y);	
+	_tr->_vm->_graphics->drawSprite(_info, picnum, x, y);	
 }
 
 void triptype::turn(byte whichway) {


Commit: cc6197d77f9fc97243473f59cda144f95c0b25c3
    https://github.com/scummvm/scummvm/commit/cc6197d77f9fc97243473f59cda144f95c0b25c3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:12:16-07:00

Commit Message:
AVALANCHE: Change _avalot into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 4b51c8b..f5013cd 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -57,11 +57,14 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _rnd;
 
 	delete _graphics;
+
+	delete _avalot;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
 	_graphics = new Graphics(this);
 
+	_avalot = new Avalot(this);
 	_gyro.setParent(this);
 	_enhanced.setParent(this);
 	_logger.setParent(this);
@@ -78,7 +81,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_basher.setParent(this);
 	_dropdown.setParent(this);
 	_closing.setParent(this);
-	_avalot.setParent(this);
 
 	_graphics->init();
 
@@ -124,7 +126,7 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_KEYDOWN:
-			_avalot.handleKeyDown(event);
+			_avalot->handleKeyDown(event);
 		}
 	}
 }
@@ -258,7 +260,7 @@ void AvalancheEngine::demo() {
 void AvalancheEngine::run_avalot() {
 	bflight_on();
 
-	_avalot.run(Common::String(runcodes[first_time]) + arguments);
+	_avalot->run(Common::String(runcodes[first_time]) + arguments);
 	// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
 	// If there's an error initalizing avalot, i'll handle it in there, not here
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 676f3f9..c6c4b2c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -67,7 +67,7 @@ class AvalancheEngine : public Engine {
 public:
 	Graphics *_graphics;
 
-	Avalot _avalot;
+	Avalot *_avalot;
 	Gyro _gyro;
 	Enhanced _enhanced;
 	Logger _logger;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 9e64ae4..61d5ad3 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -57,12 +57,11 @@ namespace Avalanche {
 
 
 
-void Avalot::setParent(AvalancheEngine *vm) {
+Avalot::Avalot(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
 
-
 void Avalot::setup() {
 	int16 gd, gm;
 
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index d309138..138d4b3 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 
 class Avalot {
 public:
-	void setParent(AvalancheEngine *vm);
+	Avalot(AvalancheEngine *vm);
 
 	void setup();
 


Commit: f035622b14966e3af0a1fe53b63619ee29591e3a
    https://github.com/scummvm/scummvm/commit/f035622b14966e3af0a1fe53b63619ee29591e3a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:14:10-07:00

Commit Message:
AVALANCHE: Get rid of parts of the engine I don't use yet.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f5013cd..55bbf33 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -102,6 +102,8 @@ Common::Platform AvalancheEngine::getPlatform() const {
 	return _platform;
 }
 
+
+
 bool AvalancheEngine::hasFeature(EngineFeature f) const {
 	return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime);
 }
@@ -110,15 +112,7 @@ const char *AvalancheEngine::getCopyrightString() const {
 	return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
 }
 
-Common::String AvalancheEngine::getSavegameFilename(int slot) {
-	return _targetName + Common::String::format("-%02d.SAV", slot);
-}
 
-void AvalancheEngine::syncSoundSettings() {
-	Engine::syncSoundSettings();
-
-	//	_sound->syncVolume();
-}
 
 void AvalancheEngine::updateEvents() {
 	Common::Event event;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index c6c4b2c..99540b4 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -107,9 +107,6 @@ public:
 	bool hasFeature(EngineFeature f) const;
 	const char *getCopyrightString() const;
 
-	Common::String getSavegameFilename(int slot);
-	void syncSoundSettings();
-
 	void updateEvents();
 
 protected:


Commit: 10ec7e0e0f2d4cc246db0c3792c5af05e413976b
    https://github.com/scummvm/scummvm/commit/10ec7e0e0f2d4cc246db0c3792c5af05e413976b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:25:07-07:00

Commit Message:
AVALANCHE: Change _gyro into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/logger2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d16c8c6..5e2fb23f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -158,7 +158,7 @@ const Acci::vocab Acci::words[nowords] = {
 	{178, "WITCH"},
 
 	/* Pronouns, 200-224 */
-	{200, "_vm->_gyro.him"},       {200, "MAN"},       {200, "GUY"},
+	{200, "_vm->_gyro->him"},       {200, "MAN"},       {200, "GUY"},
 	{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
 	{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
 	{202, "IT"},        {202, "THING"},
@@ -221,7 +221,7 @@ void Acci::setParent(AvalancheEngine *vm) {
 }
 
 void Acci::init() {
-	_vm->_gyro.weirdword = false;
+	_vm->_gyro->weirdword = false;
 }
 
 void Acci::checkword(Common::String &x) { /* Checks uint16 "fv". */
@@ -257,7 +257,7 @@ begin
 	off;
 	assign(f,'avvydump.avd');
 	rewrite(f,1);
-	blockwrite(f,_vm->_gyro.dna,177); { just anything }
+	blockwrite(f,_vm->_gyro->dna,177); { just anything }
 	for bit:=0 to 3 do
 	begin
 	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
@@ -272,7 +272,7 @@ Common::String Acci::rank() {
 
 	Common::String rank_result = "";
 	for (fv = 1; fv <= 8; fv++) {
-		if ((_vm->_gyro.dna.score >= ranks[fv].score) && (_vm->_gyro.dna.score < ranks[fv + 1].score)) {
+		if ((_vm->_gyro->dna.score >= ranks[fv].score) && (_vm->_gyro->dna.score < ranks[fv + 1].score)) {
 			rank_result = ranks[fv].title;
 			return rank_result;
 		}
@@ -430,30 +430,30 @@ void Acci::others() {
 
 void Acci::lookaround() {
 /* This is called when you say "look." */
-	_vm->_scrolls.display(*_vm->_gyro.also[0][1]);
-	switch (_vm->_gyro.dna.room) {
+	_vm->_scrolls.display(*_vm->_gyro->also[0][1]);
+	switch (_vm->_gyro->dna.room) {
 	case r__spludwicks:
-		if (_vm->_gyro.dna.avaricius_talk > 0)
+		if (_vm->_gyro->dna.avaricius_talk > 0)
 			_vm->_visa.dixi('q', 23);
 		else
 			others();
 		break;
 	case r__robins:
-		if (_vm->_gyro.dna.tied_up)
+		if (_vm->_gyro->dna.tied_up)
 			_vm->_visa.dixi('q', 38);
-		if (_vm->_gyro.dna.mushroom_growing)
+		if (_vm->_gyro->dna.mushroom_growing)
 			_vm->_visa.dixi('q', 55);
 		break;
 	case r__insidecardiffcastle:
-		if (!_vm->_gyro.dna.taken_pen)
+		if (!_vm->_gyro->dna.taken_pen)
 			_vm->_visa.dixi('q', 49);
 		break;
 	case r__lustiesroom:
-		if (_vm->_gyro.dna.lustie_is_asleep)
+		if (_vm->_gyro->dna.lustie_is_asleep)
 			_vm->_visa.dixi('q', 65);
 		break;
 	case r__catacombs:
-		switch (_vm->_gyro.dna.cat_y * 256 + _vm->_gyro.dna.cat_x) {
+		switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) {
 		case 258 :
 			_vm->_visa.dixi('q', 80);
 			break; /* Inside art gallery */
@@ -473,7 +473,7 @@ void Acci::lookaround() {
 void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	byte fv;
 
-	switch (_vm->_gyro.dna.room) {   /* Special cases. */
+	switch (_vm->_gyro->dna.room) {   /* Special cases. */
 	case r__yours:
 		if (_vm->_trip.infield(2)) {
 			/* Opening the box. */
@@ -491,30 +491,30 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	}
 
 
-	if ((!_vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
+	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
 		return; /* No doors can open if you can't move Avvy. */
 
 	for (fv = 9; fv <= 15; fv++) {
 		if (_vm->_trip.infield(fv)) {
 			{
-				_vm->_gyro.portals[fv];
-				switch (_vm->_gyro.portals[fv].op) {
-				case _vm->_gyro.exclaim:
+				_vm->_gyro->portals[fv];
+				switch (_vm->_gyro->portals[fv].op) {
+				case _vm->_gyro->exclaim:
 					_vm->_trip.tr[1].bounce();
-					_vm->_visa.dixi('x', _vm->_gyro.portals[fv].data);
+					_vm->_visa.dixi('x', _vm->_gyro->portals[fv].data);
 					break;
-				case _vm->_gyro.transport:
-					_vm->_trip.fliproom((_vm->_gyro.portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro.portals[fv].data) & 0x0F /*Low byte*/);
+				case _vm->_gyro->transport:
+					_vm->_trip.fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
 					break;
-				case _vm->_gyro.unfinished:
+				case _vm->_gyro->unfinished:
 					_vm->_trip.tr[1].bounce();
 					_vm->_scrolls.display("Sorry. This place is not available yet!");
 					break;
-				case _vm->_gyro.special:
-					_vm->_trip.call_special(_vm->_gyro.portals[fv].data);
+				case _vm->_gyro->special:
+					_vm->_trip.call_special(_vm->_gyro->portals[fv].data);
 					break;
-				case _vm->_gyro.mopendoor:
-					_vm->_trip.open_the_door((_vm->_gyro.portals[fv].data) >> 8, (_vm->_gyro.portals[fv].data) & 0x0F, fv);
+				case _vm->_gyro->mopendoor:
+					_vm->_trip.open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
 					break;
 				}
 			}
@@ -522,7 +522,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 		}
 	}
 
-	if (_vm->_gyro.dna.room == r__map)
+	if (_vm->_gyro->dna.room == r__map)
 		_vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going "
 				"to anywhere other than Argent, Birmingham, Cardiff, "
 				"Nottingham and Norwich."));
@@ -552,16 +552,16 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 		putting it. */
 	/* Convenience thing. */
 	switch (thing2) {
-	case _vm->_gyro.wine:
-		if (thing == _vm->_gyro.onion) {
-			if (_vm->_gyro.dna.rotten_onion)
+	case _vm->_gyro->wine:
+		if (thing == _vm->_gyro->onion) {
+			if (_vm->_gyro->dna.rotten_onion)
 				_vm->_scrolls.display(Common::String("That's a bit like shutting the stable door after the "
 						"horse has bolted!"));
 			else {     /* Put onion into wine? */
-				if (_vm->_gyro.dna.winestate != 3)
+				if (_vm->_gyro->dna.winestate != 3)
 					_vm->_scrolls.display("\6Oignon au vin\22 is a bit too strong for your tastes!");
 				else {     /* Put onion into vinegar! Yes! */
-					_vm->_gyro.dna.onion_in_vinegar = true;
+					_vm->_gyro->dna.onion_in_vinegar = true;
 					_vm->_lucerna.points(7);
 					_vm->_visa.dixi('u', 9);
 				}
@@ -571,32 +571,32 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 		break;
 
 	case 54:
-		if (_vm->_gyro.dna.room == 1) { /* Put something into the box. */
-			if (_vm->_gyro.dna.box_contents != nowt)
+		if (_vm->_gyro->dna.room == 1) { /* Put something into the box. */
+			if (_vm->_gyro->dna.box_contents != nowt)
 				_vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking"
 						" that out first."));
 			else {
 				switch (thing) {
-				case _vm->_gyro.money:
+				case _vm->_gyro->money:
 					_vm->_scrolls.display("You'd better keep some ready cash on you!");
 					break;
-				case _vm->_gyro.bell:
+				case _vm->_gyro->bell:
 					_vm->_scrolls.display("That's a silly place to keep a bell.");
 					break;
-				case _vm->_gyro.bodkin:
+				case _vm->_gyro->bodkin:
 					_vm->_scrolls.display("But you might need it!");
 					break;
-				case _vm->_gyro.onion:
+				case _vm->_gyro->onion:
 					_vm->_scrolls.display("Just give it to Spludwick, Avvy!");
 					break;
 				default:
 					/* Put the object into the box... */
-					if (_vm->_gyro.dna.wearing == thing)
-						_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro.get_better(thing) + " off first!");
+					if (_vm->_gyro->dna.wearing == thing)
+						_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
 					else {
 						_vm->_celer.show_one(5); /* Open box. */
-						_vm->_gyro.dna.box_contents = thing;
-						_vm->_gyro.dna.obj[thing] = false;
+						_vm->_gyro->dna.box_contents = thing;
+						_vm->_gyro->dna.obj[thing] = false;
 						_vm->_lucerna.objectlist();
 						_vm->_scrolls.display("OK, it's in the box.");
 						_vm->_celer.show_one(6); /* Shut box. */
@@ -617,7 +617,7 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 void Acci::not_in_order() {
 	_vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
 			" What I need next is " +
-			_vm->_gyro.get_better(_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick]) + ".\232\2");
+			_vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ".\232\2");
 }
 
 void Acci::go_to_cauldron() {
@@ -629,39 +629,39 @@ void Acci::go_to_cauldron() {
 bool Acci::give2spludwick() {
 	bool give2spludwick_result = false;
 
-	if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
+	if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != thing) {
 		not_in_order();
 		return give2spludwick_result;
 	}
 
 	switch (thing) {
-	case _vm->_gyro.onion:
-		_vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
-		if (_vm->_gyro.dna.rotten_onion)
+	case _vm->_gyro->onion:
+		_vm->_gyro->dna.obj[_vm->_gyro->onion] = false;
+		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa.dixi('q', 22);
 		else {
-			_vm->_gyro.dna.given2spludwick += 1;
+			_vm->_gyro->dna.given2spludwick += 1;
 			_vm->_visa.dixi('q', 20);
 			go_to_cauldron();
 			_vm->_lucerna.points(3);
 		}
 		_vm->_lucerna.objectlist();
 		break;
-	case _vm->_gyro.ink:
-		_vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
+	case _vm->_gyro->ink:
+		_vm->_gyro->dna.obj[_vm->_gyro->ink] = false;
 		_vm->_lucerna.objectlist();
-		_vm->_gyro.dna.given2spludwick += 1;
+		_vm->_gyro->dna.given2spludwick += 1;
 		_vm->_visa.dixi('q', 24);
 		go_to_cauldron();
 		_vm->_lucerna.points(3);
 		break;
-	case _vm->_gyro.mushroom:
-		_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
+	case _vm->_gyro->mushroom:
+		_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false;
 		_vm->_visa.dixi('q', 25);
 		_vm->_lucerna.points(5);
-		_vm->_gyro.dna.given2spludwick += 1;
+		_vm->_gyro->dna.given2spludwick += 1;
 		go_to_cauldron();
-		_vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
+		_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
 		_vm->_lucerna.objectlist();
 		break;
 	default:
@@ -672,32 +672,32 @@ bool Acci::give2spludwick() {
 }
 
 void Acci::have_a_drink() {
-	_vm->_gyro.dna.alcohol += 1;
-	if (_vm->_gyro.dna.alcohol == 5) {
-		_vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
-		_vm->_gyro.dna.teetotal = true;
-		_vm->_gyro.dna.avvy_is_awake = false;
-		_vm->_gyro.dna.avvy_in_bed = true;
+	_vm->_gyro->dna.alcohol += 1;
+	if (_vm->_gyro->dna.alcohol == 5) {
+		_vm->_gyro->dna.obj[_vm->_gyro->key] = true; /* Get the key. */
+		_vm->_gyro->dna.teetotal = true;
+		_vm->_gyro->dna.avvy_is_awake = false;
+		_vm->_gyro->dna.avvy_in_bed = true;
 		_vm->_lucerna.objectlist();
 		_vm->_lucerna.dusk();
-		_vm->_gyro.hang_around_for_a_while();
+		_vm->_gyro->hang_around_for_a_while();
 		_vm->_trip.fliproom(1, 1);
-		_vm->_gyro.background(14);
+		_vm->_gyro->background(14);
 		_vm->_trip.new_game_for_trippancy(); /* Not really */
 	}
 }
 
 void Acci::cardiff_climbing() {
-	if (_vm->_gyro.dna.standing_on_dais) {
+	if (_vm->_gyro->dna.standing_on_dais) {
 		/* Clamber up. */
 		_vm->_scrolls.display("You climb down, back onto the floor.");
-		_vm->_gyro.dna.standing_on_dais = false;
+		_vm->_gyro->dna.standing_on_dais = false;
 		_vm->_trip.apped(1, 3);
 	} else {
 		/* Clamber down. */
 		if (_vm->_trip.infield(1)) {
 			_vm->_scrolls.display("You clamber up onto the dais.");
-			_vm->_gyro.dna.standing_on_dais = true;
+			_vm->_gyro->dna.standing_on_dais = true;
 			_vm->_trip.apped(1, 2);
 		} else
 			_vm->_scrolls.display("Get a bit closer, Avvy.");
@@ -711,21 +711,21 @@ void Acci::already() {
 }
 
 void Acci::stand_up() {
-	switch (_vm->_gyro.dna.room) {
+	switch (_vm->_gyro->dna.room) {
 	case r__yours: /* Avvy isn't asleep. */
-		if (_vm->_gyro.dna.avvy_in_bed) {  /* But he's in bed. */
-			if (_vm->_gyro.dna.teetotal) {
+		if (_vm->_gyro->dna.avvy_in_bed) {  /* But he's in bed. */
+			if (_vm->_gyro->dna.teetotal) {
 				_vm->_visa.dixi('d', 12);
-				_vm->_gyro.background(0);
+				_vm->_gyro->background(0);
 				_vm->_visa.dixi('d', 14);
 			}
 			_vm->_trip.tr[1].visible = true;
-			_vm->_gyro.dna.user_moves_avvy = true;
+			_vm->_gyro->dna.user_moves_avvy = true;
 			_vm->_trip.apped(1, 2);
-			_vm->_gyro.dna.rw = _vm->_gyro.left;
+			_vm->_gyro->dna.rw = _vm->_gyro->left;
 			_vm->_celer.show_one(4); /* Picture of empty pillow. */
 			_vm->_lucerna.points(1);
-			_vm->_gyro.dna.avvy_in_bed = false;
+			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts);
 		} else
 			already();
@@ -736,12 +736,12 @@ void Acci::stand_up() {
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro.dna.sitting_in_pub)  {
+		if (_vm->_gyro->dna.sitting_in_pub)  {
 			_vm->_celer.show_one(4); /* Not sitting down. */
 			_vm->_trip.tr[1].visible = true; /* But standing up. */
 			_vm->_trip.apped(1, 4); /* And walking away. */
-			_vm->_gyro.dna.sitting_in_pub = false; /* Really not sitting down. */
-			_vm->_gyro.dna.user_moves_avvy = true; /* And ambulant. */
+			_vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */
+			_vm->_gyro->dna.user_moves_avvy = true; /* And ambulant. */
 		} else
 			already();
 		break;
@@ -752,44 +752,44 @@ void Acci::stand_up() {
 
 
 void Acci::getproc(char thing) {
-	switch (_vm->_gyro.dna.room) {
+	switch (_vm->_gyro->dna.room) {
 	case r__yours:
 		if (_vm->_trip.infield(2)) {
-			if (_vm->_gyro.dna.box_contents == thing) {
+			if (_vm->_gyro->dna.box_contents == thing) {
 				_vm->_celer.show_one(5);
 				_vm->_scrolls.display("OK, I've got it.");
-				_vm->_gyro.dna.obj[thing] = true;
+				_vm->_gyro->dna.obj[thing] = true;
 				_vm->_lucerna.objectlist();
-				_vm->_gyro.dna.box_contents = nowt;
+				_vm->_gyro->dna.box_contents = nowt;
 				_vm->_celer.show_one(6);
 			} else
-				_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro.get_better(thing) + " in the box.");
+				_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
 			_vm->_visa.dixi('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
-		case _vm->_gyro.pen:
+		case _vm->_gyro->pen:
 			if (_vm->_trip.infield(2)) {
 				/* Standing on the dais. */
 
-				if (_vm->_gyro.dna.taken_pen)
+				if (_vm->_gyro->dna.taken_pen)
 					_vm->_scrolls.display("It's not there, Avvy.");
 				else {
 					/* OK: we're taking the pen, and it's there. */
 					_vm->_celer.show_one(4); /* No pen there now. */
 					_vm->_trip.call_special(3); /* Zap! */
-					_vm->_gyro.dna.taken_pen = true;
-					_vm->_gyro.dna.obj[_vm->_gyro.pen] = true;
+					_vm->_gyro->dna.taken_pen = true;
+					_vm->_gyro->dna.obj[_vm->_gyro->pen] = true;
 					_vm->_lucerna.objectlist();
 					_vm->_scrolls.display("Taken.");
 				}
-			} else if (_vm->_gyro.dna.standing_on_dais)
+			} else if (_vm->_gyro->dna.standing_on_dais)
 				_vm->_visa.dixi('q', 53);
 			else
 				_vm->_visa.dixi('q', 51);
 			break;
-		case _vm->_gyro.bolt:
+		case _vm->_gyro->bolt:
 			_vm->_visa.dixi('q', 52);
 			break;
 		default:
@@ -797,12 +797,12 @@ void Acci::getproc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro.mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro.dna.mushroom_growing)) {
+		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
 			_vm->_celer.show_one(3);
 			_vm->_scrolls.display("Got it!");
-			_vm->_gyro.dna.mushroom_growing = false;
-			_vm->_gyro.dna.taken_mushroom = true;
-			_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = true;
+			_vm->_gyro->dna.mushroom_growing = false;
+			_vm->_gyro->dna.taken_mushroom = true;
+			_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = true;
 			_vm->_lucerna.objectlist();
 			_vm->_lucerna.points(3);
 		} else
@@ -814,11 +814,11 @@ void Acci::getproc(char thing) {
 }
 
 void Acci::give_geida_the_lute() {
-	if (_vm->_gyro.dna.room != r__lustiesroom) {
+	if (_vm->_gyro->dna.room != r__lustiesroom) {
 		_vm->_scrolls.display("Not yet. Try later!\232\2");
 		return;
 	}
-	_vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
+	_vm->_gyro->dna.obj[_vm->_gyro->lute] = false;
 	_vm->_lucerna.objectlist();
 	_vm->_visa.dixi('q', 64); /* She plays it. */
 
@@ -851,14 +851,14 @@ void Acci::person_speaks() {
 
 
 	if ((person == pardon) || (person == '\0')) {
-		if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room))
-			person = _vm->_gyro.her;
+		if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him] != _vm->_gyro->dna.room))
+			person = _vm->_gyro->her;
 		else
-			person = _vm->_gyro.him;
+			person = _vm->_gyro->him;
 	}
 
-	if (_vm->_gyro.whereis[person] != _vm->_gyro.dna.room) {
-		_vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro.himself! */
+	if (_vm->_gyro->whereis[person] != _vm->_gyro->dna.room) {
+		_vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro->himself! */
 		return;
 	}
 
@@ -873,8 +873,8 @@ void Acci::person_speaks() {
 
 	if (!found) {
 		for (fv = 10; fv <= 25; fv++) {
-			_vm->_gyro.quasipeds[fv];
-			if ((_vm->_gyro.quasipeds[fv].who == person) && (_vm->_gyro.quasipeds[fv].room == _vm->_gyro.dna.room)) {
+			_vm->_gyro->quasipeds[fv];
+			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room)) {
 				_vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4');
 			}
 		}
@@ -884,7 +884,7 @@ void Acci::person_speaks() {
 void Acci::heythanks() {
 	person_speaks();
 	_vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)");
-	_vm->_gyro.dna.obj[thing] = false;
+	_vm->_gyro->dna.obj[thing] = false;
 }
 
 void Acci::do_that() {
@@ -898,13 +898,13 @@ void Acci::do_that() {
 		thats = "";
 		return;
 	}
-	if (_vm->_gyro.weirdword)
+	if (_vm->_gyro->weirdword)
 		return;
 	if (thing < '\310')
 		thing -= 49; /* "Slip" */
 
 	/*
-	if ((!_vm->_gyro.alive) &
+	if ((!_vm->_gyro->alive) &
 		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
 		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
 		vb_highscores, vb_smartalec, eos).has(verb))) {
@@ -913,7 +913,7 @@ void Acci::do_that() {
 		return;
 	}
 
-	if ((~ _vm->_gyro.dna.avvy_is_awake) &
+	if ((~ _vm->_gyro->dna.avvy_is_awake) &
 		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
 		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
 		vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
@@ -937,7 +937,7 @@ void Acci::do_that() {
 	case vb_get:
 		if (thing != pardon) {
 			/* Legitimate try to pick something up. */
-			if (_vm->_gyro.dna.carrying >= maxobjs)
+			if (_vm->_gyro->dna.carrying >= maxobjs)
 				_vm->_scrolls.display("You can't carry any more!");
 			else
 				getproc(thing);
@@ -954,13 +954,13 @@ void Acci::do_that() {
 		_vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
-		/*       begin _vm->_gyro.dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/
+		/*       begin _vm->_gyro->dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/
 	case vb_inv:
 		inv();
 		break;
 	case vb_talk:
 		if (person == pardon) {
-			if (_vm->_gyro.subjnumber == 99) /* They typed "say passuint16". */
+			if (_vm->_gyro->subjnumber == 99) /* They typed "say passuint16". */
 				_vm->_scrolls.display("Yes, but what \6is\22 the passuint16?");
 			/*
 			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
@@ -970,7 +970,7 @@ void Acci::do_that() {
 				do_that();
 				return;
 			} else {
-				person = _vm->_gyro.subjnumber;
+				person = _vm->_gyro->subjnumber;
 				subjnumber = 0;
 				if (set::of(pardon, '\0', eos).has(person))
 					_vm->_scrolls.display("Talk to whom?");
@@ -990,56 +990,56 @@ void Acci::do_that() {
 				_vm->_scrolls.display("Give to whom?");
 			else if (personshere()) {
 				switch (thing) {
-				case _vm->_gyro.money :
+				case _vm->_gyro->money :
 					_vm->_scrolls.display("You can't bring yourself to give away your moneybag.");
 					break;
-				case _vm->_gyro.bodkin:
-				case _vm->_gyro.bell:
-				case _vm->_gyro.clothes:
-				case _vm->_gyro.habit :
+				case _vm->_gyro->bodkin:
+				case _vm->_gyro->bell:
+				case _vm->_gyro->clothes:
+				case _vm->_gyro->habit :
 					_vm->_scrolls.display("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (person) {
-					case _vm->_gyro.pcrapulus:
+					case _vm->_gyro->pcrapulus:
 						switch (thing) {
-						case _vm->_gyro.wine:
+						case _vm->_gyro->wine:
 							_vm->_scrolls.display("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro.dna.obj[_vm->_gyro.wine] = false;
+							_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
 							break;
 						default:
 							heythanks();
 						}
 						break;
-					case _vm->_gyro.pcwytalot:
+					case _vm->_gyro->pcwytalot:
 						/*if (set::of(crossbow, bolt, eos).has(thing))
 							_vm->_scrolls.display(Common::String("You might be able to influence ") +
 									"Cwytalot more if you used it!");
 						else */heythanks();
 						break;
-					case _vm->_gyro.pspludwick:
+					case _vm->_gyro->pspludwick:
 						if (give2spludwick())
 							heythanks();
 						break;
-					case _vm->_gyro.pibythneth:
-						if (thing == _vm->_gyro.badge) {
+					case _vm->_gyro->pibythneth:
+						if (thing == _vm->_gyro->badge) {
 							_vm->_visa.dixi('q', 32); /* Thanks! Wow! */
 							_vm->_lucerna.points(3);
-							_vm->_gyro.dna.obj[_vm->_gyro.badge] = false;
-							_vm->_gyro.dna.obj[_vm->_gyro.habit] = true;
-							_vm->_gyro.dna.givenbadgetoiby = true;
+							_vm->_gyro->dna.obj[_vm->_gyro->badge] = false;
+							_vm->_gyro->dna.obj[_vm->_gyro->habit] = true;
+							_vm->_gyro->dna.givenbadgetoiby = true;
 							_vm->_celer.show_one(8);
 							_vm->_celer.show_one(9);
 						} else
 							heythanks();
 						break;
-					case _vm->_gyro.payles:
-						if (_vm->_gyro.dna.ayles_is_awake) {
-							if (thing == _vm->_gyro.pen) {
-								_vm->_gyro.dna.obj[_vm->_gyro.pen] = false;
+					case _vm->_gyro->payles:
+						if (_vm->_gyro->dna.ayles_is_awake) {
+							if (thing == _vm->_gyro->pen) {
+								_vm->_gyro->dna.obj[_vm->_gyro->pen] = false;
 								_vm->_visa.dixi('q', 54);
-								_vm->_gyro.dna.obj[_vm->_gyro.ink] = true;
-								_vm->_gyro.dna.given_pen_to_ayles = true;
+								_vm->_gyro->dna.obj[_vm->_gyro->ink] = true;
+								_vm->_gyro->dna.given_pen_to_ayles = true;
 								_vm->_lucerna.objectlist();
 								_vm->_lucerna.points(2);
 							} else
@@ -1047,26 +1047,26 @@ void Acci::do_that() {
 						} else
 							_vm->_scrolls.display("But he's asleep!");
 						break;
-					case _vm->_gyro.pgeida:
+					case _vm->_gyro->pgeida:
 						switch (thing) {
-						case _vm->_gyro.potion:
-							_vm->_gyro.dna.obj[_vm->_gyro.potion] = false;
+						case _vm->_gyro->potion:
+							_vm->_gyro->dna.obj[_vm->_gyro->potion] = false;
 							_vm->_visa.dixi('u', 16); /* She drinks it. */
 							_vm->_lucerna.points(2);
-							_vm->_gyro.dna.geida_given_potion = true;
+							_vm->_gyro->dna.geida_given_potion = true;
 							_vm->_lucerna.objectlist();
 							break;
-						case _vm->_gyro.lute:
+						case _vm->_gyro->lute:
 							give_geida_the_lute();
 							break;
 						default:
 							heythanks();
 						}
 						break;
-					case _vm->_gyro.parkata:
+					case _vm->_gyro->parkata:
 						switch (thing) {
-						case _vm->_gyro.potion:
-							if (_vm->_gyro.dna.geida_given_potion)
+						case _vm->_gyro->potion:
+							if (_vm->_gyro->dna.geida_given_potion)
 								winsequence();
 							else
 								_vm->_visa.dixi('q', 77);
@@ -1093,7 +1093,7 @@ void Acci::do_that() {
 		_vm->_enid.edna_load(realwords[2]);
 		break;
 	case vb_save:
-		if (_vm->_gyro.alive)
+		if (_vm->_gyro->alive)
 			_vm->_enid.edna_save(realwords[2]);
 		else
 			_vm->_scrolls.display("It's a bit late now to save your game!");
@@ -1108,7 +1108,7 @@ void Acci::do_that() {
 		_vm->_scrolls.display("Vandalism is prohibited within this game!");
 		break;
 	case vb_quit: /* quit */
-		//if (_vm->_gyro.demo) {
+		//if (_vm->_gyro->demo) {
 		//	_vm->_visa.dixi('q', 31);
 		//	close(demofile);
 		//	exit(0); /* Change this later!!! */
@@ -1116,7 +1116,7 @@ void Acci::do_that() {
 		if (!polite)
 			_vm->_scrolls.display("How about a `please\", Avvy?");
 		else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))
-			_vm->_gyro.lmo = true;
+			_vm->_gyro->lmo = true;
 		break;
 	case vb_go:
 		_vm->_scrolls.display("Just use the arrow keys to walk there.");
@@ -1132,16 +1132,16 @@ void Acci::do_that() {
 		_vm->_scrolls.display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
 				"The medi‘val descendant of" + '\15' +
 				"Denarius Avaricius Sextus" +
-				'\15' + '\15' + "version " + _vm->_gyro.vernum + '\15' + '\15' + "Copyright ï "
-				+ _vm->_gyro.copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
+				'\15' + '\15' + "version " + _vm->_gyro->vernum + '\15' + '\15' + "Copyright ï "
+				+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
 		_vm->_scrolls.aboutscroll = false;
 		break;
 	case vb_undress:
-		if (_vm->_gyro.dna.wearing == nowt)
+		if (_vm->_gyro->dna.wearing == nowt)
 			_vm->_scrolls.display("You're already stark naked!");
-		else if (_vm->_gyro.dna.avvys_in_the_cupboard) {
-			_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro.get_better(_vm->_gyro.dna.wearing) + '.');
-			_vm->_gyro.dna.wearing = nowt;
+		else if (_vm->_gyro->dna.avvys_in_the_cupboard) {
+			_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.');
+			_vm->_gyro->dna.wearing = nowt;
 			_vm->_lucerna.objectlist();
 		} else
 			_vm->_scrolls.display("Hadn't you better find somewhere more private, Avvy?");
@@ -1150,23 +1150,23 @@ void Acci::do_that() {
 		if (holding()) {
 			/* wear something */
 			switch (thing) {
-			case _vm->_gyro.chastity:
+			case _vm->_gyro->chastity:
 				_vm->_scrolls.display("Hey, what kind of a weirdo are you\??!");
 				break;
-			case _vm->_gyro.clothes:
-			case _vm->_gyro.habit: /* Change this! */
-				if (_vm->_gyro.dna.wearing != nowt) {
-					if (_vm->_gyro.dna.wearing == thing)
+			case _vm->_gyro->clothes:
+			case _vm->_gyro->habit: /* Change this! */
+				if (_vm->_gyro->dna.wearing != nowt) {
+					if (_vm->_gyro->dna.wearing == thing)
 						_vm->_scrolls.display("You're already wearing that.");
 					else
 						_vm->_scrolls.display(Common::String("You'll be rather warm wearing two ") +
 								"sets of clothes!");
 					return;
 				} else
-					_vm->_gyro.dna.wearing = thing;
+					_vm->_gyro->dna.wearing = thing;
 				_vm->_lucerna.objectlist();
 
-				if (thing == _vm->_gyro.habit)
+				if (thing == _vm->_gyro->habit)
 					fv = 3;
 				else
 					fv = 0;
@@ -1187,7 +1187,7 @@ void Acci::do_that() {
 		break;
 	case vb_play:
 		if (thing == pardon) {
-			switch (_vm->_gyro.dna.room) { /* They just typed "play"... */
+			switch (_vm->_gyro->dna.room) { /* They just typed "play"... */
 			case r__argentpub:
 				// play_nim();
 				// I just don't plan to implement Nim yet.
@@ -1198,22 +1198,22 @@ void Acci::do_that() {
 			}
 		} else if (holding()) {
 			switch (thing) {
-			case _vm->_gyro.lute :
+			case _vm->_gyro->lute :
 				_vm->_visa.dixi('U', 7);
-				if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room)
+				if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot] == _vm->_gyro->dna.room)
 					_vm->_visa.dixi('U', 10);
 
-				if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room)
+				if (_vm->_gyro->whereis[_vm->_gyro->pdulustie] == _vm->_gyro->dna.room)
 					_vm->_visa.dixi('U', 15);
 				break;
 			case 52:
-				if (_vm->_gyro.dna.room == r__musicroom)
+				if (_vm->_gyro->dna.room == r__musicroom)
 					play_harp();
 				else
 					_vm->_scrolls.display(what);
 				break;
 			case 55:
-				if (_vm->_gyro.dna.room == r__argentpub)
+				if (_vm->_gyro->dna.room == r__argentpub)
 					;  /*play_nim(); - Don't implement yet.*/
 				else
 					_vm->_scrolls.display(what);
@@ -1225,9 +1225,9 @@ void Acci::do_that() {
 		break;
 	case vb_ring:
 		if (holding()) {
-			if (thing == _vm->_gyro.bell) {
+			if (thing == _vm->_gyro->bell) {
 				_vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
+				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
 					_vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)");
 			} else
 				_vm->_scrolls.display(what);
@@ -1248,7 +1248,7 @@ void Acci::do_that() {
 		// I don't want to implement bosskey yet.
 		break;
 	case vb_pee:
-		if (_vm->_gyro.flagset('P')) {
+		if (_vm->_gyro->flagset('P')) {
 			_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet);
 		} else
@@ -1256,16 +1256,16 @@ void Acci::do_that() {
 		break;
 	case vb_cheat:
 		_vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled.");
-		_vm->_gyro.cheat = true;
+		_vm->_gyro->cheat = true;
 		break;
 	case vb_magic:
-		if (_vm->_gyro.dna.avaricius_talk > 0)
+		if (_vm->_gyro->dna.avaricius_talk > 0)
 			_vm->_visa.dixi('q', 19);
 		else {
-			if ((_vm->_gyro.dna.room == 12) & (_vm->_trip.infield(2))) {
+			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip.infield(2))) {
 				/* Avaricius appears! */
 				_vm->_visa.dixi('q', 17);
-				if (_vm->_gyro.whereis['\227'] == 12)
+				if (_vm->_gyro->whereis['\227'] == 12)
 					_vm->_visa.dixi('q', 18);
 				else {
 					_vm->_trip.tr[2].init(1, false, &_vm->_trip); /* Avaricius */
@@ -1273,7 +1273,7 @@ void Acci::do_that() {
 					_vm->_trip.tr[2].walkto(5);
 					_vm->_trip.tr[2].call_eachstep = true;
 					_vm->_trip.tr[2].eachstep = _vm->_trip.procback_and_forth;
-					_vm->_gyro.dna.avaricius_talk = 14;
+					_vm->_gyro->dna.avaricius_talk = 14;
 					_vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks);
 				}
 			} else
@@ -1284,7 +1284,7 @@ void Acci::do_that() {
 		_vm->_scrolls.display("Listen, smart alec, that was just rhetoric.");
 		break;
 	case vb_expletive:
-		switch (_vm->_gyro.dna.swore) {
+		switch (_vm->_gyro->dna.swore) {
 		case 0:
 			_vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
 					"(I shouldn't say it again, if I were you!)");
@@ -1299,20 +1299,20 @@ void Acci::do_that() {
 					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna.gameover();
 		}
-		_vm->_gyro.dna.swore++;
+		_vm->_gyro->dna.swore++;
 		break;
 	case vb_listen:
-		if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
+		if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
 			_vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") +
 					"the bells.");
-		else if (_vm->_gyro.listen == "")
+		else if (_vm->_gyro->listen == "")
 			_vm->_scrolls.display("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_scrolls.display(_vm->_gyro.listen);
+			_vm->_scrolls.display(_vm->_gyro->listen);
 		break;
 	case vb_buy:
 		/* What are they trying to buy? */
-		switch (_vm->_gyro.dna.room) {
+		switch (_vm->_gyro->dna.room) {
 		case r__argentpub:
 			if (_vm->_trip.infield(6)) {
 				/* We're in a pub, and near the bar. */
@@ -1321,49 +1321,49 @@ void Acci::do_that() {
 				case '\65':
 				case '\66':
 				case '\72': /* Beer, whisky, cider or mead */
-					if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
+					if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
 						_vm->_visa.dixi('D', 15);
 						return;
 					}
 
-					if (_vm->_gyro.dna.teetotal)  {
+					if (_vm->_gyro->dna.teetotal)  {
 						_vm->_visa.dixi('D', 6);
 						return;
 					}
 
-					if (_vm->_gyro.dna.alcohol == 0)
+					if (_vm->_gyro->dna.alcohol == 0)
 						_vm->_lucerna.points(3);
 					_vm->_celer.show_one(12);
 					_vm->_scrolls.display(booze[thing] + ", please.\231\2");
-					_vm->_gyro.dna.drinking = thing;
+					_vm->_gyro->dna.drinking = thing;
 
 					_vm->_celer.show_one(10);
-					_vm->_gyro.dna.malagauche = 177;
+					_vm->_gyro->dna.malagauche = 177;
 					_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks);
 					break;
 				case '\64':
 					examine();
 					break; /* We have a right one here- buy Pepsi??! */
-				case _vm->_gyro.wine:
-					if (_vm->_gyro.dna.obj[_vm->_gyro.wine])  /* We've already got the wine! */
+				case _vm->_gyro->wine:
+					if (_vm->_gyro->dna.obj[_vm->_gyro->wine])  /* We've already got the wine! */
 						_vm->_visa.dixi('D', 2); /* 1 bottle's shufishent! */
 					else {
-						if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
+						if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
 							_vm->_visa.dixi('D', 15);
 							return;
 						}
 
-						if (_vm->_gyro.dna.carrying >= maxobjs) {
+						if (_vm->_gyro->dna.carrying >= maxobjs) {
 							_vm->_scrolls.display("Your hands are full.");
 							return;
 						}
 
 						_vm->_celer.show_one(12);
 						_vm->_scrolls.display("Wine, please.\231\2");
-						if (_vm->_gyro.dna.alcohol == 0)
+						if (_vm->_gyro->dna.alcohol == 0)
 							_vm->_lucerna.points(3);
 						_vm->_celer.show_one(10);
-						_vm->_gyro.dna.malagauche = 177;
+						_vm->_gyro->dna.malagauche = 177;
 
 						_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuywine, _vm->_timeout.reason_drinks);
 					}
@@ -1375,24 +1375,24 @@ void Acci::do_that() {
 
 		case r__outsideducks:
 			if (_vm->_trip.infield(6)) {
-				if (thing == _vm->_gyro.onion) {
-					if (_vm->_gyro.dna.obj[_vm->_gyro.onion])
+				if (thing == _vm->_gyro->onion) {
+					if (_vm->_gyro->dna.obj[_vm->_gyro->onion])
 						_vm->_visa.dixi('D', 10); /* not planning to juggle with the things! */
-					else if (_vm->_gyro.dna.carrying >= maxobjs)
+					else if (_vm->_gyro->dna.carrying >= maxobjs)
 						_vm->_scrolls.display("Before you ask, you remember that your hands are full.");
 					else {
-						if (_vm->_gyro.dna.bought_onion)
+						if (_vm->_gyro->dna.bought_onion)
 							_vm->_visa.dixi('D', 11);
 						else {
 							_vm->_visa.dixi('D', 9);
 							_vm->_lucerna.points(3);
 						}
-						_vm->_gyro.pennycheck(3); /* It costs thruppence. */
-						_vm->_gyro.dna.obj[_vm->_gyro.onion] = true;
+						_vm->_gyro->pennycheck(3); /* It costs thruppence. */
+						_vm->_gyro->dna.obj[_vm->_gyro->onion] = true;
 						_vm->_lucerna.objectlist();
-						_vm->_gyro.dna.bought_onion = true;
-						_vm->_gyro.dna.rotten_onion = false; /* It's OK when it leaves the stall! */
-						_vm->_gyro.dna.onion_in_vinegar = false;
+						_vm->_gyro->dna.bought_onion = true;
+						_vm->_gyro->dna.rotten_onion = false; /* It's OK when it leaves the stall! */
+						_vm->_gyro->dna.onion_in_vinegar = false;
 					}
 				} else
 					_vm->_visa.dixi('D', 0);
@@ -1408,10 +1408,10 @@ void Acci::do_that() {
 		}
 		break;
 	case vb_attack:
-		if ((_vm->_gyro.dna.room == r__brummieroad) &&
-				((person == '\235') || (thing == _vm->_gyro.crossbow) || (thing == _vm->_gyro.bolt))
-				&& (_vm->_gyro.whereis['\235'] == _vm->_gyro.dna.room)) {
-			switch (_vm->_gyro.dna.obj[_vm->_gyro.bolt] + _vm->_gyro.dna.obj[_vm->_gyro.crossbow] * 2) {
+		if ((_vm->_gyro->dna.room == r__brummieroad) &&
+				((person == '\235') || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
+				&& (_vm->_gyro->whereis['\235'] == _vm->_gyro->dna.room)) {
+			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow] * 2) {
 				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
 					3 = both. */
 			case 0:
@@ -1419,7 +1419,7 @@ void Acci::do_that() {
 				_vm->_scrolls.display("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_scrolls.display(Common::String("Attack _vm->_gyro.him with only a crossbow bolt? Are you ") +
+				_vm->_scrolls.display(Common::String("Attack _vm->_gyro->him with only a crossbow bolt? Are you ") +
 						"planning on playing darts?!");
 				break;
 			case 2:
@@ -1428,16 +1428,16 @@ void Acci::do_that() {
 				break;
 			case 3:
 				_vm->_visa.dixi('Q', 11);
-				_vm->_gyro.dna.cwytalot_gone = true;
-				_vm->_gyro.dna.obj[_vm->_gyro.bolt] = false;
-				_vm->_gyro.dna.obj[_vm->_gyro.crossbow] = false;
+				_vm->_gyro->dna.cwytalot_gone = true;
+				_vm->_gyro->dna.obj[_vm->_gyro->bolt] = false;
+				_vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false;
 				_vm->_lucerna.objectlist();
-				_vm->_gyro.magics[12].op = _vm->_gyro.nix;
+				_vm->_gyro->magics[12].op = _vm->_gyro->nix;
 				_vm->_lucerna.points(7);
 				_vm->_trip.tr[2].walkto(2);
 				_vm->_trip.tr[2].vanishifstill = true;
 				_vm->_trip.tr[2].call_eachstep = false;
-				_vm->_gyro.whereis['\235'] = 177;
+				_vm->_gyro->whereis['\235'] = 177;
 				break;
 			default:
 				_vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */
@@ -1446,27 +1446,27 @@ void Acci::do_that() {
 			_vm->_visa.dixi('Q', 10);
 		break;
 	case vb_password:
-		if (_vm->_gyro.dna.room != r__bridge)
+		if (_vm->_gyro->dna.room != r__bridge)
 			_vm->_visa.dixi('Q', 12);
 		else {
 			ok = true;
 			for (ff = 1; ff <= thats.size(); ff++) {
-				for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv++) {
+				for (fv = 1; fv <= words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++) {
 					Common::String temp = realwords[ff];
 					temp.toUppercase();
-					if (words[_vm->_gyro.dna.pass_num + first_password].w[fv] != temp[fv])
+					if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv])
 						ok = false;
 				}
 			}
 
 			if (ok) {
-				if (_vm->_gyro.dna.drawbridge_open != 0)
+				if (_vm->_gyro->dna.drawbridge_open != 0)
 					_vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
 					_vm->_lucerna.points(4);
 					_vm->_scrolls.display("The drawbridge opens!");
 					_vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls);
-					_vm->_gyro.dna.drawbridge_open = 1;
+					_vm->_gyro->dna.drawbridge_open = 1;
 				}
 			} else
 				_vm->_visa.dixi('Q', 12);
@@ -1479,7 +1479,7 @@ void Acci::do_that() {
 		_vm->_lucerna.gameover();
 		break;
 	case vb_score:
-		_vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro.strf(_vm->_gyro.dna.score) + ",\3\rout of a " +
+		_vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ",\3\rout of a " +
 				"possible 128.\r\rThis gives you a rank of " + rank() +
 				".\r\r" + totaltime());
 		break;
@@ -1495,13 +1495,13 @@ void Acci::do_that() {
 			_vm->_scrolls.display("Kiss whom?");
 		else if (personshere()) {
 			switch (person) {
-			case _vm->_gyro.parkata:
+			case _vm->_gyro->parkata:
 				_vm->_visa.dixi('U', 12);
 				break;
-			case _vm->_gyro.pgeida:
+			case _vm->_gyro->pgeida:
 				_vm->_visa.dixi('U', 13);
 				break;
-			case _vm->_gyro.pwisewoman:
+			case _vm->_gyro->pwisewoman:
 				_vm->_visa.dixi('U', 14);
 				break;
 			default:
@@ -1513,7 +1513,7 @@ void Acci::do_that() {
 		break;
 
 	case vb_climb:
-		if (_vm->_gyro.dna.room == r__insidecardiffcastle)
+		if (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			cardiff_climbing();
 		else /* In the wrong room! */
 			_vm->_scrolls.display("Not with your head for heights, Avvy!");
@@ -1521,7 +1521,7 @@ void Acci::do_that() {
 
 	case vb_jump:
 		_vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping);
-		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
 
 	case vb_highscores:
@@ -1533,23 +1533,23 @@ void Acci::do_that() {
 		if (personshere())
 			switch (person) {
 			case pardon:
-			case _vm->_gyro.pavalot:
+			case _vm->_gyro->pavalot:
 			case '\0':
-				if (!_vm->_gyro.dna.avvy_is_awake) {
-					_vm->_gyro.dna.avvy_is_awake = true;
+				if (!_vm->_gyro->dna.avvy_is_awake) {
+					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna.points(1);
-					_vm->_gyro.dna.avvy_in_bed = true;
+					_vm->_gyro->dna.avvy_in_bed = true;
 					_vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */
-					if (_vm->_gyro.dna.teetotal)
+					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa.dixi('d', 13);
 				} else
 					_vm->_scrolls.display("You're already awake, Avvy!");
 				break;
-			case _vm->_gyro.payles:
-				if (!_vm->_gyro.dna.ayles_is_awake)
-					_vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
+			case _vm->_gyro->payles:
+				if (!_vm->_gyro->dna.ayles_is_awake)
+					_vm->_scrolls.display("You can't seem to wake _vm->_gyro->him by yourself.");
 				break;
-			case _vm->_gyro.pjacques:
+			case _vm->_gyro->pjacques:
 				_vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
 					"Hmmm... that doesn't seem to do any good...");
 				break;
@@ -1559,17 +1559,17 @@ void Acci::do_that() {
 		break;
 
 	case vb_sit:
-		if (_vm->_gyro.dna.room == r__nottspub) {
-			if (_vm->_gyro.dna.sitting_in_pub)
+		if (_vm->_gyro->dna.room == r__nottspub) {
+			if (_vm->_gyro->dna.sitting_in_pub)
 				_vm->_scrolls.display("You're already sitting!");
 			else {
-				_vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro.him down. */
+				_vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */
 				_vm->_timeout.set_up_timer(1, _vm->_timeout.procavvy_sit_down, _vm->_timeout.reason_sitting_down);
 			}
 		} else {
 			/* Default doodah. */
 			_vm->_lucerna.dusk();
-			_vm->_gyro.hang_around_for_a_while();
+			_vm->_gyro->hang_around_for_a_while();
 			_vm->_lucerna.dawn();
 			_vm->_scrolls.display("A few hours later...\20nothing much has happened...");
 		}
@@ -1578,7 +1578,7 @@ void Acci::do_that() {
 	case vb_restart:
 		if (_vm->_scrolls.ask("Restart game and lose changes?"))  {
 			_vm->_lucerna.dusk();
-			_vm->_gyro.newgame();
+			_vm->_gyro->newgame();
 			_vm->_lucerna.dawn();
 		}
 		break;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 55bbf33..d5187f1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -59,13 +59,14 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _graphics;
 
 	delete _avalot;
+	delete _gyro;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
 	_graphics = new Graphics(this);
 
 	_avalot = new Avalot(this);
-	_gyro.setParent(this);
+	_gyro = new Gyro(this);
 	_enhanced.setParent(this);
 	_logger.setParent(this);
 	_pingo.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 99540b4..49c02ff 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -68,7 +68,7 @@ public:
 	Graphics *_graphics;
 
 	Avalot *_avalot;
-	Gyro _gyro;
+	Gyro *_gyro;
 	Enhanced _enhanced;
 	Logger _logger;
 	Pingo _pingo;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 61d5ad3..6ce6348 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -66,41 +66,41 @@ void Avalot::setup() {
 	int16 gd, gm;
 
 	checkbreak = false;
-	_vm->_gyro.visible = _vm->_gyro.m_no;
-	_vm->_gyro.to_do = 0;
-	_vm->_gyro.lmo = false;
+	_vm->_gyro->visible = _vm->_gyro->m_no;
+	_vm->_gyro->to_do = 0;
+	_vm->_gyro->lmo = false;
 	_vm->_scrolls.resetscroll();
-	_vm->_gyro.setup_vmc();
-	_vm->_gyro.on_virtual();
+	_vm->_gyro->setup_vmc();
+	_vm->_gyro->on_virtual();
 	gd = 3;
 	gm = 0;
 	//initgraph(gd: gm: "");
-	_vm->_gyro.holdthedawn = true;
+	_vm->_gyro->holdthedawn = true;
 	_vm->_lucerna.dusk();
-	_vm->_gyro.cmp = 177;
+	_vm->_gyro->cmp = 177;
 	_vm->_lucerna.mouse_init();  /*on;*/
-	_vm->_gyro.dropsok = true;
-	_vm->_gyro.ctrl = ckey;
-	_vm->_gyro.oldjw = 177;
-	_vm->_gyro.mousetext = "";
-	_vm->_gyro.c = 999;
+	_vm->_gyro->dropsok = true;
+	_vm->_gyro->ctrl = ckey;
+	_vm->_gyro->oldjw = 177;
+	_vm->_gyro->mousetext = "";
+	_vm->_gyro->c = 999;
 	//settextjustify(0: 0);
-	_vm->_gyro.ddmnow = false;
+	_vm->_gyro->ddmnow = false;
 	_vm->_lucerna.load_digits();
-	_vm->_gyro.cheat = false;
-	_vm->_gyro.cp = 0;
-	_vm->_gyro.curpos = 1;
-	_vm->_gyro.quote = true;
-	_vm->_gyro.ledstatus = 177;
-	_vm->_gyro.defaultled = 2;
+	_vm->_gyro->cheat = false;
+	_vm->_gyro->cp = 0;
+	_vm->_gyro->curpos = 1;
+	_vm->_gyro->quote = true;
+	_vm->_gyro->ledstatus = 177;
+	_vm->_gyro->defaultled = 2;
 	/* TSkellern:=0; { Replace with a more local variable sometime }*/
-	_vm->_gyro.dna.rw = _vm->_gyro.stopped;
-	_vm->_gyro.enid_filename = ""; /* undefined. */
+	_vm->_gyro->dna.rw = _vm->_gyro->stopped;
+	_vm->_gyro->enid_filename = ""; /* undefined. */
 	_vm->_lucerna.toolbar();
 	_vm->_scrolls.state(2);
 	_vm->_graphics->refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
+		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
 
 	/* for gd:=0 to 1 do
 	 begin
@@ -109,45 +109,45 @@ void Avalot::setup() {
 
 	_vm->_trip.loadtrip();
 
-	_vm->_gyro.reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
+	_vm->_gyro->reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
 
-	if ((_vm->_gyro.filetoload.empty()) && (! _vm->_gyro.reloaded))
-		_vm->_gyro.newgame(); /* no game was requested- load the default */
+	if ((_vm->_gyro->filetoload.empty()) && (! _vm->_gyro->reloaded))
+		_vm->_gyro->newgame(); /* no game was requested- load the default */
 	else {
-		if (! _vm->_gyro.reloaded)
+		if (! _vm->_gyro->reloaded)
 			_vm->_enid.avvy_background();
 		_vm->_dropdown.standard_bar();
 		_vm->_lucerna.sprite_run();
-		if (_vm->_gyro.reloaded)
+		if (_vm->_gyro->reloaded)
 			_vm->_enid.edna_reload();
 		else {
 			/* Filename given on the command line (or loadfirst) */
-			_vm->_enid.edna_load(_vm->_gyro.filetoload);
+			_vm->_enid.edna_load(_vm->_gyro->filetoload);
 			if (_vm->_enid.there_was_a_problem()) {
 				_vm->_scrolls.display("So let's start from the beginning instead...");
-				_vm->_gyro.holdthedawn = true;
+				_vm->_gyro->holdthedawn = true;
 				_vm->_lucerna.dusk();
-				_vm->_gyro.newgame();
+				_vm->_gyro->newgame();
 			}
 		}
 	}
 
-	if (! _vm->_gyro.reloaded) {
-		_vm->_gyro.soundfx = ! _vm->_gyro.soundfx;
+	if (! _vm->_gyro->reloaded) {
+		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
 		_vm->_lucerna.fxtoggle();
-		_vm->_lucerna.thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing);
+		_vm->_lucerna.thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
 	}
 
 	_vm->_trip.get_back_loretta();
 	//gm = getpixel(0: 0);
 	//setcolor(7);
-	_vm->_gyro.holdthedawn = false;
+	_vm->_gyro->holdthedawn = false;
 	_vm->_lucerna.dawn();
-	_vm->_gyro.cursoron = false;
+	_vm->_gyro->cursoron = false;
 	_vm->_basher.cursor_on();
 	_vm->_trip.newspeed();
 
-	if (! _vm->_gyro.reloaded)
+	if (! _vm->_gyro->reloaded)
 		_vm->_visa.dixi('q', 83); /* Info on the game: etc. */
 }
 
@@ -184,18 +184,18 @@ void Avalot::run(Common::String arg) {
 		_vm->_basher.keyboard_link();
 		_vm->_dropdown.menu_link();
 		_vm->_trip.readstick();
-		_vm->_gyro.force_numlock();
+		_vm->_gyro->force_numlock();
 		_vm->_trip.get_back_loretta();
 		_vm->_trip.trippancy_link();
 		_vm->_celer.pics_link();
 		_vm->_lucerna.checkclick();
 
-		if (_vm->_gyro.visible == _vm->_gyro.m_virtual)
-			_vm->_gyro.plot_vmc(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.cp);
+		if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
+			_vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp);
 		_vm->_lucerna.flip_page(); /* <<<! */
-		_vm->_gyro.slowdown();
-		if (_vm->_gyro.visible == _vm->_gyro.m_virtual) 
-			_vm->_gyro.wipe_vmc(_vm->_gyro.cp);
+		_vm->_gyro->slowdown();
+		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
+			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
 
 		_vm->_timeout.one_tick();
 
@@ -207,7 +207,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
-	} while (! _vm->_gyro.lmo);
+	} while (! _vm->_gyro->lmo);
 
 	//restorecrtmode();
 	//if (logging)
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 176cbfc..3f2b01b 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -56,13 +56,13 @@ void Basher::setParent(AvalancheEngine *vm) {
 
 void Basher::init() {
 	/* new(previous);*/
-	if (!_vm->_gyro.last.empty())
-		_vm->_gyro.last.clear();
+	if (!_vm->_gyro->last.empty())
+		_vm->_gyro->last.clear();
 
 	normal_edit();
 
-	if (_vm->_gyro.demo) {
-		if (!_vm->_gyro.demofile.open("demo.avd")) {
+	if (_vm->_gyro->demo) {
+		if (!_vm->_gyro->demofile.open("demo.avd")) {
 			warning("AVALANCHE: Basher: File not found: demo.avd");
 			throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
 		}
@@ -71,7 +71,7 @@ void Basher::init() {
 // Not sure that the following part will be used ever...
 #ifdef RECORD
 	count = 0;
-	if (!_vm->_gyro.demofile_save.open("demo.avd")) {
+	if (!_vm->_gyro->demofile_save.open("demo.avd")) {
 		warning("AVALANCHE: Basher: File not found: demo.avd");
 		throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
 	}
@@ -183,10 +183,10 @@ void Basher::filename_edit() {
 
 void Basher::normal_edit() {
 	entering_filename = false;
-	/*if (!_vm->_gyro.current.empty())
-		_vm->_gyro.current.clear();*/
+	/*if (!_vm->_gyro->current.empty())
+		_vm->_gyro->current.clear();*/
 	left_margin = 1;
-	_vm->_gyro.curpos = 1;
+	_vm->_gyro->curpos = 1;
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index cc44021..e73f51c 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -53,36 +53,36 @@ void Celer::setParent(AvalancheEngine *vm) {
 void Celer::pics_link() {
 	byte xx;
 
-	if (_vm->_gyro.ddmnow)
+	if (_vm->_gyro->ddmnow)
 		return; /* No animation when the menus are up. */
 
 	
-	switch (_vm->_gyro.dna.room) {
+	switch (_vm->_gyro->dna.room) {
 	case r__outsideargentpub:
-		if ((_vm->_gyro.roomtime % int32(12)) == 0)
-			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
+		if ((_vm->_gyro->roomtime % int32(12)) == 0)
+			show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(4));
 		break;
 
 	case r__brummieroad:
-		if ((_vm->_gyro.roomtime % int32(2)) == 0)
-			show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
+		if ((_vm->_gyro->roomtime % int32(2)) == 0)
+			show_one(int32(1) + (_vm->_gyro->roomtime / int32(2)) % int32(4));
 		break;
 
 	case r__bridge:
-		if ((_vm->_gyro.roomtime % int32(2)) == 0)
-			show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4));
+		if ((_vm->_gyro->roomtime % int32(2)) == 0)
+			show_one(int32(4) + (_vm->_gyro->roomtime / int32(2)) % int32(4));
 		break;
 
 	case r__yours:
-		if ((!_vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
-			show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
+		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % int32(4)) == 0))
+			show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(2));
 		break;
 
 	case r__argentpub:
-		if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) {
+		if (((_vm->_gyro->roomtime % int32(7)) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
 			/* Malagauche cycle */
-			_vm->_gyro.dna.malagauche += 1;
-			switch (_vm->_gyro.dna.malagauche) {
+			_vm->_gyro->dna.malagauche += 1;
+			switch (_vm->_gyro->dna.malagauche) {
 			case 1:
 			case 11:
 			case 21:
@@ -98,12 +98,12 @@ void Celer::pics_link() {
 				show_one(13);
 				break; /* Winks. */
 			case 33:
-				_vm->_gyro.dna.malagauche = 0;
+				_vm->_gyro->dna.malagauche = 0;
 				break;
 			}
 		}
 
-		switch (_vm->_gyro.roomtime % 200) {
+		switch (_vm->_gyro->roomtime % 200) {
 		case 179:
 		case 197:
 			show_one(5);
@@ -116,11 +116,11 @@ void Celer::pics_link() {
 			show_one(7);
 			break;
 		case 199:
-			_vm->_gyro.dna.dogfoodpos = 177;
+			_vm->_gyro->dna.dogfoodpos = 177;
 			break; /* Impossible value for this. */
 		}
 
-		if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */
+		if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { /* Normally. */
 			if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
 				xx = 3;
 			else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
@@ -128,16 +128,16 @@ void Celer::pics_link() {
 			else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
 				xx = 4;
 
-			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
 				show_one(xx);
-				_vm->_gyro.dna.dogfoodpos = xx;
+				_vm->_gyro->dna.dogfoodpos = xx;
 			}
 		}
 		break;
 
 	case r__westhall:
-		if ((_vm->_gyro.roomtime % int32(3)) == 0) {
-			switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) {
+		if ((_vm->_gyro->roomtime % int32(3)) == 0) {
+			switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) {
 			case 4:
 				show_one(1);
 				break;
@@ -155,8 +155,8 @@ void Celer::pics_link() {
 		break;
 
 	case r__lustiesroom:
-		if (!(_vm->_gyro.dna.lustie_is_asleep)) {
-			if ((_vm->_gyro.roomtime % int32(45)) > 42)
+		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
+			if ((_vm->_gyro->roomtime % int32(45)) > 42)
 				xx = 4; /* du Lustie blinks */
 
 			/* Bearing of Avvy from du Lustie. */
@@ -167,16 +167,16 @@ void Celer::pics_link() {
 			else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
 				xx = 3; /* Right. */
 
-			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
 				show_one(xx);
-				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+				_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 			}
 		}
 		break;
 
 	case r__aylesoffice:
-		if ((!_vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) {
-			switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) {
+		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % int32(14) == 0)) {
+			switch ((_vm->_gyro->roomtime / int32(14)) % int32(2)) {
 			case 0:
 				show_one(1);
 				break; /* Frame 2: EGA. */
@@ -188,8 +188,8 @@ void Celer::pics_link() {
 		break;
 
 	case r__robins:
-		if (_vm->_gyro.dna.tied_up) {
-			switch (_vm->_gyro.roomtime % int32(54)) {
+		if (_vm->_gyro->dna.tied_up) {
+			switch (_vm->_gyro->roomtime % int32(54)) {
 			case 20:
 				show_one(4);
 				break; /* Frame 4: Avalot blinks. */
@@ -209,15 +209,15 @@ void Celer::pics_link() {
 		else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
 			xx = 8; /* Right. */
 
-		if ((_vm->_gyro.roomtime % int32(60)) > 57)
+		if ((_vm->_gyro->roomtime % int32(60)) > 57)
 			xx--; /* Blinks */
 
-		if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
 			show_one(xx);
-			_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 		}
 
-		switch (_vm->_gyro.roomtime % 50) {
+		switch (_vm->_gyro->roomtime % 50) {
 		case 45 :
 			show_one(9);
 			break; /* Spurge blinks */
@@ -228,8 +228,8 @@ void Celer::pics_link() {
 		break;
 
 	case r__ducks:
-		if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */
-			show_one(1 + (_vm->_gyro.roomtime / 3) % 3);
+		if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
+			show_one(1 + (_vm->_gyro->roomtime / 3) % 3);
 
 		{/* _vm->_lucerna.bearing of Avvy from Duck. */
 		if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
@@ -239,26 +239,26 @@ void Celer::pics_link() {
 		else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
 			xx = 8; /* Right. */
 
-		if ((_vm->_gyro.roomtime % int32(45)) > 42)
+		if ((_vm->_gyro->roomtime % int32(45)) > 42)
 			xx += 1; /* Duck blinks */
 
-		if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/
+		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
 			show_one(xx);
-			_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 		}
 		break;
 
 	}
 }
 
-	if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B'))) {
+	if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) {
 		/* They're ringing the bells. */
-		switch (_vm->_gyro.roomtime % int32(4)) {
+		switch (_vm->_gyro->roomtime % int32(4)) {
 		case 1:
-			if (_vm->_gyro.dna.nextbell < 5)
-				_vm->_gyro.dna.nextbell = 12;
-			_vm->_gyro.dna.nextbell -= 1;
-			_vm->_gyro.note(_vm->_gyro.notes[_vm->_gyro.dna.nextbell]);
+			if (_vm->_gyro->dna.nextbell < 5)
+				_vm->_gyro->dna.nextbell = 12;
+			_vm->_gyro->dna.nextbell -= 1;
+			_vm->_gyro->note(_vm->_gyro->notes[_vm->_gyro->dna.nextbell]);
 			break;
 		case 2:
 			//nosound;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 219df15..985eb7f 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -58,14 +58,14 @@ headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, f
 }
 
 void headtype::display() {
-	_dr->_vm->_gyro.off(); /*MT*/
+	_dr->_vm->_gyro->off(); /*MT*/
 	_dr->chalk(xpos, 1, trigger, title, true);
-	_dr->_vm->_gyro.on(); /*MT*/
+	_dr->_vm->_gyro->on(); /*MT*/
 }
 
 void headtype::highlight() {
-	_dr->_vm->_gyro.off();
-	_dr->_vm->_gyro.off_virtual();
+	_dr->_vm->_gyro->off();
+	_dr->_vm->_gyro->off_virtual();
 
 	//nosound();
 	//setactivepage(cp);
@@ -75,10 +75,10 @@ void headtype::highlight() {
 	{
 		_dr->ddm_o.left = xpos;
 		_dr->ddm_o.menunow = true;
-		_dr->_vm->_gyro.ddmnow = true;
+		_dr->_vm->_gyro->ddmnow = true;
 		_dr->ddm_o.menunum = position;
 	}
-	_dr->_vm->_gyro.cmp = 177; /* Force redraw of cursor. */
+	_dr->_vm->_gyro->cmp = 177; /* Force redraw of cursor. */
 }
 
 bool headtype::extdparse(char c) {
@@ -95,7 +95,7 @@ bool headtype::extdparse(char c) {
 onemenu *onemenu::init(Dropdown *dr) {
 	_dr = dr;
 	menunow = false;
-	_dr->_vm->_gyro.ddmnow = false;
+	_dr->_vm->_gyro->ddmnow = false;
 	menunum = 1;
 	return this;
 }
@@ -140,10 +140,10 @@ void onemenu::movehighlight(int8 add) {
 
 void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
 	warning("STUB: Dropdown::onemenu::lightup()");
-	/*if ((_dr->_vm->_gyro.mx < flx1 * 8) || (_dr->_vm->_gyro.mx > flx2 * 8) ||
-		(_dr->_vm->_gyro.my <= 12) || (_dr->_vm->_gyro.my > fly - 3))
+	/*if ((_dr->_vm->_gyro->mx < flx1 * 8) || (_dr->_vm->_gyro->mx > flx2 * 8) ||
+		(_dr->_vm->_gyro->my <= 12) || (_dr->_vm->_gyro->my > fly - 3))
 			return;
-	highlightnum = (_dr->_vm->_gyro.my - 13) / 10;
+	highlightnum = (_dr->_vm->_gyro->my - 13) / 10;
 	if (highlightnum == oldy)  return;
 	movehighlight(0);*/
 	
@@ -172,7 +172,7 @@ void onemenu::keystroke(char c) {
 		}
 	}
 	if (! found)
-		_dr->_vm->_gyro.blip();
+		_dr->_vm->_gyro->blip();
 }
 
 
@@ -199,8 +199,8 @@ void menuset::update() {
 	bar(0, 0, 640, 9);*/
 	_dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->menu_b);
 
-	savecp = _dr->_vm->_gyro.cp;
-	_dr->_vm->_gyro.cp = 3;
+	savecp = _dr->_vm->_gyro->cp;
+	_dr->_vm->_gyro->cp = 3;
 
 	for (fv = 1; fv <= howmany; fv ++)
 		ddms[fv].display();
@@ -208,7 +208,7 @@ void menuset::update() {
 	for (page_ = 0; page_ <= 1; page_ ++)
 		_dr->_vm->_trip.getset[page_].remember(menuspace);
 
-	_dr->_vm->_gyro.cp = savecp;
+	_dr->_vm->_gyro->cp = savecp;
 }
 
 void menuset::extd(char c) {
@@ -251,30 +251,30 @@ void Dropdown::setParent(AvalancheEngine *vm) {
 }
 
 void Dropdown::find_what_you_can_do_with_it() {
-	switch (_vm->_gyro.thinks) {
-	case _vm->_gyro.wine:
-	case _vm->_gyro.potion:
-	case _vm->_gyro.ink:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink;
+	switch (_vm->_gyro->thinks) {
+	case _vm->_gyro->wine:
+	case _vm->_gyro->potion:
+	case _vm->_gyro->ink:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink;
 		break;
-	case _vm->_gyro.bell:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring;
+	case _vm->_gyro->bell:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring;
 		break;
-	case _vm->_gyro.chastity:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+	case _vm->_gyro->chastity:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
 		break;
-	case _vm->_gyro.lute:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play;
+	case _vm->_gyro->lute:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play;
 		break;
-	case _vm->_gyro.mushroom:
-	case _vm->_gyro.onion:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat;
+	case _vm->_gyro->mushroom:
+	case _vm->_gyro->onion:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat;
 		break;
-	case _vm->_gyro.clothes:
-		_vm->_gyro.verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+	case _vm->_gyro->clothes:
+		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
 		break;
 	default:
-		_vm->_gyro.verbstr = _vm->_acci.vb_exam; /* anything else */
+		_vm->_gyro->verbstr = _vm->_acci.vb_exam; /* anything else */
 	}
 }
 
@@ -287,7 +287,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 
 	for (byte fv = 0; fv < z.size(); fv++)
 		for (byte ff = 0; ff < 8; ff++) {
-			byte pixel = ~(_vm->_gyro.little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
+			byte pixel = ~(_vm->_gyro->little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
@@ -398,9 +398,9 @@ void Dropdown::ddm__file() {
 		ddm_o.start_afresh();
 		ddm_o.opt("New game", 'N', "f4", true);
 		ddm_o.opt("Load...", 'L', "^f3", true);
-		ddm_o.opt("Save", 'S', "^f2", _vm->_gyro.alive);
-		ddm_o.opt("Save As...", 'v', "", _vm->_gyro.alive);
-		ddm_o.opt("DOS Shell", 'D', _vm->_gyro.atkey + '1', true);
+		ddm_o.opt("Save", 'S', "^f2", _vm->_gyro->alive);
+		ddm_o.opt("Save As...", 'v', "", _vm->_gyro->alive);
+		ddm_o.opt("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
 		ddm_o.opt("Quit", 'Q', "alt-X", true);
 		ddm_o.display();
 	}
@@ -408,7 +408,7 @@ void Dropdown::ddm__file() {
 
 void Dropdown::ddm__action() {
 	Common::String n;
-	n = Common::String(_vm->_gyro.f5_does().c_str() + 2, 253);
+	n = Common::String(_vm->_gyro->f5_does().c_str() + 2, 253);
 
 	{
 		ddm_o.start_afresh();
@@ -417,13 +417,13 @@ void Dropdown::ddm__action() {
 		else
 			ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
 		ddm_o.opt("Pause game", 'P', "f6", true);
-		if (_vm->_gyro.dna.room == 99)
+		if (_vm->_gyro->dna.room == 99)
 			ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip.neardoor());
 		else
 			ddm_o.opt("Open the door", 'O', "f7", _vm->_trip.neardoor());
 		ddm_o.opt("Look around", 'L', "f8", true);
 		ddm_o.opt("Inventory", 'I', "Tab", true);
-		if (_vm->_trip.tr[1].xs == _vm->_gyro.walk)
+		if (_vm->_trip.tr[1].xs == _vm->_gyro->walk)
 			ddm_o.opt("Run fast", 'R', "^R", true);
 		else
 			ddm_o.opt("Walk slowly", 'W', "^W", true);
@@ -436,13 +436,13 @@ void Dropdown::ddm__people() {
 	char fv;
 
 	people = "";
-	here = _vm->_gyro.dna.room;
+	here = _vm->_gyro->dna.room;
 
 	{
 		ddm_o.start_afresh();
 		for (fv = '\226'; fv <= '\262'; fv ++)
-			if (_vm->_gyro.whereis[fv] == here) {
-				ddm_o.opt(_vm->_gyro.getname(fv), _vm->_gyro.getnamechar(fv), "", true);
+			if (_vm->_gyro->whereis[fv] == here) {
+				ddm_o.opt(_vm->_gyro->getname(fv), _vm->_gyro->getnamechar(fv), "", true);
 				people = people + fv;
 			}
 		ddm_o.display();
@@ -454,8 +454,8 @@ void Dropdown::ddm__objects() {
 	{
 		ddm_o.start_afresh();
 		for (fv = '\1'; fv <= numobjs; fv ++)
-			if (_vm->_gyro.dna.obj[fv])
-				ddm_o.opt(_vm->_gyro.get_thing(fv), _vm->_gyro.get_thingchar(fv), "", true);
+			if (_vm->_gyro->dna.obj[fv])
+				ddm_o.opt(_vm->_gyro->get_thing(fv), _vm->_gyro->get_thingchar(fv), "", true);
 		ddm_o.display();
 	}
 }
@@ -553,7 +553,7 @@ void Dropdown::do__action() {
 	case 0: {
 		_vm->_acci.person = _vm->_acci.pardon;
 		_vm->_acci.thing = _vm->_acci.pardon;
-		n = _vm->_gyro.f5_does();
+		n = _vm->_gyro->f5_does();
 		_vm->_lucerna.callverb(n[1]);
 	}
 	break;
@@ -570,8 +570,8 @@ void Dropdown::do__action() {
 		_vm->_lucerna.callverb(_vm->_acci.vb_inv);
 		break;
 	case 5: {
-		if (_vm->_trip.tr[1].xs == _vm->_gyro.walk)  _vm->_trip.tr[1].xs = _vm->_gyro.run;
-		else _vm->_trip.tr[1].xs = _vm->_gyro.walk;
+		if (_vm->_trip.tr[1].xs == _vm->_gyro->walk)  _vm->_trip.tr[1].xs = _vm->_gyro->run;
+		else _vm->_trip.tr[1].xs = _vm->_gyro->walk;
 		_vm->_trip.newspeed();
 	}
 	break;
@@ -579,28 +579,28 @@ void Dropdown::do__action() {
 }
 
 void Dropdown::do__objects() {
-	_vm->_lucerna.thinkabout(_vm->_gyro.objlist[ddm_o.choicenum + 1], _vm->_gyro.a_thing);
+	_vm->_lucerna.thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
 }
 
 void Dropdown::do__people() {
-	_vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro.a_person);
-	_vm->_gyro.last_person = people[ddm_o.choicenum + 1];
+	_vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
+	_vm->_gyro->last_person = people[ddm_o.choicenum + 1];
 }
 
 void Dropdown::do__with() {
-	_vm->_acci.thing = _vm->_gyro.thinks;
+	_vm->_acci.thing = _vm->_gyro->thinks;
 
-	if (_vm->_gyro.thinkthing) {
+	if (_vm->_gyro->thinkthing) {
 
 		_vm->_acci.thing += 49;
 
-		if (_vm->_gyro.verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give)
-			_vm->_acci.person = _vm->_gyro.last_person;
+		if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give)
+			_vm->_acci.person = _vm->_gyro->last_person;
 		else
 			_vm->_acci.person = '\376';
 
 	} else {
-		switch (_vm->_gyro.verbstr[ddm_o.choicenum + 1]) {
+		switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) {
 		case '\144': {
 			_vm->_acci.thing = '\144';
 			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
@@ -643,7 +643,7 @@ void Dropdown::do__with() {
 		}
 		}
 	}
-	_vm->_lucerna.callverb(_vm->_gyro.verbstr[ddm_o.choicenum + 1]);
+	_vm->_lucerna.callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
 }
 
 /*$F- That's all. Now for the ...bar funcs. */
@@ -680,26 +680,26 @@ begin;
 end;*/
 
 void Dropdown::checkclick() {   /* only for when the menu's displayed */
-	if (_vm->_gyro.mpress > 0) {
-		if (_vm->_gyro.mpy > 10) {
+	if (_vm->_gyro->mpress > 0) {
+		if (_vm->_gyro->mpy > 10) {
 			if (!((ddm_o.firstlix) &&
-			   ((_vm->_gyro.mpx >= ddm_o.flx1 * 8) && (_vm->_gyro.mpx <= ddm_o.flx2 * 8) &&
-			   (_vm->_gyro.mpy >= 12) && (_vm->_gyro.mpy <= ddm_o.fly)))) {
+			   ((_vm->_gyro->mpx >= ddm_o.flx1 * 8) && (_vm->_gyro->mpx <= ddm_o.flx2 * 8) &&
+			   (_vm->_gyro->mpy >= 12) && (_vm->_gyro->mpy <= ddm_o.fly)))) {
 			     /* Clicked OUTSIDE the menu. */
 				if (ddm_o.menunow)
 					ddm_o.wipe();
 			}    /* No "else"- clicking on menu has no effect (only releasing) */
 		} else {
 			 /* Clicked on menu bar */
-			ddm_m.getmenu(_vm->_gyro.mpx);
+			ddm_m.getmenu(_vm->_gyro->mpx);
 		}
 	} else {
 		;     /* NOT clicked button... */
-		if (_vm->_gyro.mrelease > 0) {
+		if (_vm->_gyro->mrelease > 0) {
 			if ((ddm_o.firstlix) &&
-			   ((_vm->_gyro.mrx >= ddm_o.flx1 * 8) && (_vm->_gyro.mrx <= ddm_o.flx2 * 8) &&
-			   (_vm->_gyro.mry >= 12) && (_vm->_gyro.mry <= ddm_o.fly)))
-					ddm_o.select((_vm->_gyro.mry - 13) / 10);
+			   ((_vm->_gyro->mrx >= ddm_o.flx1 * 8) && (_vm->_gyro->mrx <= ddm_o.flx2 * 8) &&
+			   (_vm->_gyro->mry >= 12) && (_vm->_gyro->mry <= ddm_o.fly)))
+					ddm_o.select((_vm->_gyro->mry - 13) / 10);
 		}
 	}
 }
@@ -707,22 +707,22 @@ void Dropdown::checkclick() {   /* only for when the menu's displayed */
 void Dropdown::menu_link() {
 	if (! ddm_o.menunow)  return;
 
-	_vm->_gyro.check(); /* find mouse coords & click information */
+	_vm->_gyro->check(); /* find mouse coords & click information */
 	checkclick(); /* work out click codes */
 
 	/* Change arrow... */
 
 		
-	if ((_vm->_gyro.my >= 0) && (_vm->_gyro.my <= 10))
-		_vm->_gyro.newpointer(1); /* up-arrow */
-	else if ((_vm->_gyro.my >= 11) && (_vm->_gyro.my <= 169)) {
-		if ((_vm->_gyro.mx >= ddm_o.flx1 * 8) && (_vm->_gyro.mx <= ddm_o.flx2 * 8)
-			&& (_vm->_gyro.my > 10) && (_vm->_gyro.my <= ddm_o.fly))
-			_vm->_gyro.newpointer(3); /* right-arrow */
+	if ((_vm->_gyro->my >= 0) && (_vm->_gyro->my <= 10))
+		_vm->_gyro->newpointer(1); /* up-arrow */
+	else if ((_vm->_gyro->my >= 11) && (_vm->_gyro->my <= 169)) {
+		if ((_vm->_gyro->mx >= ddm_o.flx1 * 8) && (_vm->_gyro->mx <= ddm_o.flx2 * 8)
+			&& (_vm->_gyro->my > 10) && (_vm->_gyro->my <= ddm_o.fly))
+			_vm->_gyro->newpointer(3); /* right-arrow */
 		else
-			_vm->_gyro.newpointer(4); /* fletch */
-	} else if ((_vm->_gyro.my >= 169) && (_vm->_gyro.my <= 200))
-		_vm->_gyro.newpointer(2); /* screwdriver */
+			_vm->_gyro->newpointer(4); /* fletch */
+	} else if ((_vm->_gyro->my >= 169) && (_vm->_gyro->my <= 200))
+		_vm->_gyro->newpointer(2); /* screwdriver */
 
 	if (! ddm_o.menunow)
 		return;
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 107330a..7284b88 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -94,7 +94,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 		break;
 	}
 
-	day = _vm->_gyro.strf(d);
+	day = _vm->_gyro->strf(d);
 
 	if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31))) {
 		switch (d % 10) {
@@ -112,7 +112,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 		}
 	}
 
-	expanddate_result = day + ' ' + month + ' ' + _vm->_gyro.strf(y);
+	expanddate_result = day + ' ' + month + ' ' + _vm->_gyro->strf(y);
 	return expanddate_result;
 }
 
@@ -148,8 +148,8 @@ void Enid::edna_save(Common::String name) {
 }
 
 void Enid::loaderror(Common::String x, char icon) {
-	if (_vm->_gyro.holdthedawn) {
-		_vm->_gyro.holdthedawn = false;
+	if (_vm->_gyro->holdthedawn) {
+		_vm->_gyro->holdthedawn = false;
 		_vm->_lucerna.dawn();
 	}
 	_vm->_scrolls.display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
@@ -250,17 +250,17 @@ void Enid::avvy_background() {    /* Not really a filing procedure,
 }
 
 void Enid::to_sundry(sundry &sund) {
-	sund.qenid_filename = _vm->_gyro.enid_filename;
-	sund.qsoundfx = _vm->_gyro.soundfx;
-	sund.qthinks = _vm->_gyro.thinks;
-	sund.qthinkthing = _vm->_gyro.thinkthing;
+	sund.qenid_filename = _vm->_gyro->enid_filename;
+	sund.qsoundfx = _vm->_gyro->soundfx;
+	sund.qthinks = _vm->_gyro->thinks;
+	sund.qthinkthing = _vm->_gyro->thinkthing;
 }
 
 void Enid::from_sundry(sundry sund) {
-	_vm->_gyro.enid_filename = sund.qenid_filename;
-	_vm->_gyro.soundfx = sund.qsoundfx;
-	_vm->_gyro.thinks = sund.qthinks;
-	_vm->_gyro.thinkthing = sund.qthinkthing;
+	_vm->_gyro->enid_filename = sund.qenid_filename;
+	_vm->_gyro->soundfx = sund.qsoundfx;
+	_vm->_gyro->thinks = sund.qthinks;
+	_vm->_gyro->thinkthing = sund.qthinkthing;
 }
 
 void Enid::restore_dna() {
@@ -274,19 +274,19 @@ void Enid::edna_reload() {
 
 	restore_dna();
 
-	_vm->_gyro.seescroll = true;  /* This prevents display of the new sprites before the
+	_vm->_gyro->seescroll = true;  /* This prevents display of the new sprites before the
 	new picture is loaded. */
 
 	_vm->_lucerna.major_redraw();
 
-	_vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room;
+	_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
 
-	_vm->_gyro.alive = true;
+	_vm->_gyro->alive = true;
 
 	_vm->_lucerna.objectlist();
 
-	if (_vm->_gyro.holdthedawn) {
-		_vm->_gyro.holdthedawn = false;
+	if (_vm->_gyro->holdthedawn) {
+		_vm->_gyro->holdthedawn = false;
 		_vm->_lucerna.dawn();
 	}
 }
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index aba169c..dd1157b 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -246,7 +246,9 @@ const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 
 
 
-Gyro::Gyro() : interrogation(0), oncandopageswap(true) {
+Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
+	_vm = vm;
+
 	/* Needed becouse of Lucerna::load_also() */
 	for (int fv = 0; fv < 31; fv++)
 		for (int ff = 0; ff < 2; ff++)
@@ -265,10 +267,6 @@ Gyro::~Gyro() {
 
 }
 
-void Gyro::setParent(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
 void Gyro::newpointer(byte m) {
 	if (m == cmp)  return;
 	cmp = m;
@@ -359,7 +357,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	alive = true;
 
 	score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
-	memset(&_vm->_gyro.dna, 0, sizeof(dnatype));
+	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
 	_vm->_scrolls.natural();
 	_vm->_basher.normal_edit();
 	_vm->_lucerna.mousepage(0);
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 29de10c..58b5844 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -610,12 +610,10 @@ public:
 	bool use_joy_a;
 
 
-	Gyro();
+	Gyro(AvalancheEngine *vm);
 
 	~Gyro();
 
-	void setParent(AvalancheEngine *vm);
-
 	void newpointer(byte m);
 
 	void wait();    /* makes hourglass */
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index eeedb23..20ca558 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -82,7 +82,7 @@ void Logger::setParent(AvalancheEngine *vm) {
 void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
 	byte fv;
 	
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::centre()");
@@ -109,13 +109,13 @@ void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
 
 void Logger::log_divider() {   /* Prints the divider sign. */
 	byte fv;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_divider()");
 
 	/*
-	if (_vm->_gyro.log_epson) {
+	if (_vm->_gyro->log_epson) {
 		output << logfile << Common::String(' ') + double_width;
 		for (fv = 1; fv <= divide_indent; fv++)
 			output << logfile << ' ';
@@ -129,19 +129,19 @@ void Logger::log_divider() {   /* Prints the divider sign. */
 }
 
 void Logger::log_command(Common::String x) {     /* Prints a command */
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_command()");
 
-	/*if (_vm->_gyro.log_epson)
+	/*if (_vm->_gyro->log_epson)
 		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
 	else
 		output << logfile << Common::String("> ") + x << NL;*/
 }
 
 void Logger::log_addstuff(Common::String x) {
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	scroll_line += x;
@@ -149,7 +149,7 @@ void Logger::log_addstuff(Common::String x) {
 
 void Logger::log_scrollchar(Common::String x) {     /* print one character */
 	Common::String z;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	switch (x[1]) {
@@ -170,34 +170,34 @@ void Logger::log_scrollchar(Common::String x) {     /* print one character */
 }
 
 void Logger::log_italic() {
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_italic()");
 
-	/*if (_vm->_gyro.log_epson)
+	/*if (_vm->_gyro->log_epson)
 		log_addstuff(italic);
 	else
 		log_addstuff("*");*/
 }
 
 void Logger::log_roman() {
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_roman()");
 
-	/* if (_vm->_gyro.log_epson)
+	/* if (_vm->_gyro->log_epson)
 		log_addstuff(italic_off);
 	else
 		log_addstuff("*");*/
 }
 
 void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
-	if (_vm->_gyro.log_epson)
+	if (_vm->_gyro->log_epson)
 		log_addstuff(italic_off);
 }
 
@@ -208,7 +208,7 @@ void Logger::log_scrollline() {   /* Set up a line for the scroll driver */
 
 void Logger::log_scrollendline(bool centred) {
 	byte x, fv;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 	x = 17;
 	if (centred)
@@ -223,7 +223,7 @@ void Logger::log_scrollendline(bool centred) {
 
 void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
 	byte fv;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_bubbleline()");
@@ -242,30 +242,30 @@ void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
 void Logger::log_newline() {
 	warning("STUB: Logger::log_newline()");
 
-	//if (_vm->_gyro.logging)
+	//if (_vm->_gyro->logging)
 	//	output << logfile << NL;
 }
 
 void Logger::log_newroom(Common::String where) {
 	byte fv;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_newroom()");
 
 	/*for (fv = 1; fv <= 20; fv++)
 		output << logfile << ' ';
-	if (_vm->_gyro.log_epson)
+	if (_vm->_gyro->log_epson)
 		output << logfile << emph_on;
 	output << logfile << Common::String('(') + where + ')';
-	if (_vm->_gyro.log_epson)
+	if (_vm->_gyro->log_epson)
 		output << logfile << emph_off;
 	output << logfile << NL;*/
 }
 
 void Logger::log_aside(Common::String what) {
 /* This writes "asides" to the printer. For example, moves in Nim. */
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_aside()");
@@ -276,7 +276,7 @@ void Logger::log_aside(Common::String what) {
 
 void Logger::log_score(uint16 credit, uint16 now) {
 	byte fv;
-	if (!_vm->_gyro.logging)
+	if (!_vm->_gyro->logging)
 		return;
 
 	warning("STUB: Logger::log_score()");
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index aefa6bf..f269008 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -61,10 +61,10 @@ void Lucerna::setParent(AvalancheEngine *vm) {
 }
 
 void Lucerna::init() {
-	_vm->_gyro.oh = 17717;
-	_vm->_gyro.om = 17717;
-	if (_vm->_enhanced.atbios)  _vm->_gyro.atkey = "f1";
-	else _vm->_gyro.atkey = "alt-";
+	_vm->_gyro->oh = 17717;
+	_vm->_gyro->om = 17717;
+	if (_vm->_enhanced.atbios)  _vm->_gyro->atkey = "f1";
+	else _vm->_gyro->atkey = "alt-";
 }
 	
 void Lucerna::callverb(char n) {
@@ -74,7 +74,7 @@ void Lucerna::callverb(char n) {
 			"assigned to it. You may press alt-A to see what the " +
 			"current setting of this key is.");
 	} else {
-		_vm->_gyro.weirdword = false;
+		_vm->_gyro->weirdword = false;
 		_vm->_acci.polite = true;
 		_vm->_acci.verb = n;
 		_vm->_acci.do_that();
@@ -108,10 +108,10 @@ void Lucerna::scram1(Common::String &x) {
 void Lucerna::unscramble() {
 	for (byte fv = 0; fv < 31; fv ++)
 		for (byte ff = 0; ff < 2; ff ++)
-			if (_vm->_gyro.also[fv][ff] != 0)
-				scram1(*_vm->_gyro.also[fv][ff]);
-	scram1(_vm->_gyro.listen);
-	scram1(_vm->_gyro.flags);
+			if (_vm->_gyro->also[fv][ff] != 0)
+				scram1(*_vm->_gyro->also[fv][ff]);
+	scram1(_vm->_gyro->listen);
+	scram1(_vm->_gyro->flags);
 	/*     for fz:=1 to length(also[fv,ff]^) do
 	      also[fv,ff]^[fz]:=chr(ord(also[fv,ff]^[fz]) xor 177);*/
 }
@@ -121,9 +121,9 @@ void Lucerna::load_also(Common::String n) {
 	
 	for (fv = 0; fv < 31; fv++)
 		for (ff = 0; ff < 2; ff++)
-			if (_vm->_gyro.also[fv][ff] != 0)  {
-				delete _vm->_gyro.also[fv][ff];
-				_vm->_gyro.also[fv][ff] = 0;
+			if (_vm->_gyro->also[fv][ff] != 0)  {
+				delete _vm->_gyro->also[fv][ff];
+				_vm->_gyro->also[fv][ff] = 0;
 			}
 
 	Common::String filename;
@@ -138,58 +138,58 @@ void Lucerna::load_also(Common::String n) {
 	byte minnames = f.readByte();
 	for (fv = 0; fv <= minnames; fv++) {
 		for (ff = 0; ff < 2; ff++) {
-			_vm->_gyro.also[fv][ff] = new Common::String;
-			*_vm->_gyro.also[fv][ff] = nextstring();
+			_vm->_gyro->also[fv][ff] = new Common::String;
+			*_vm->_gyro->also[fv][ff] = nextstring();
 		}
-		*_vm->_gyro.also[fv][0] = Common::String(157) + *_vm->_gyro.also[fv][0] + 157;
+		*_vm->_gyro->also[fv][0] = Common::String(157) + *_vm->_gyro->also[fv][0] + 157;
 	}
 	
-	memset(_vm->_gyro.lines, 0xFF, sizeof(_vm->_gyro.lines));
+	memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines));
 	
 	//fv = getpixel(0, 0);
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro.lines[i].x1 = f.readSint16LE();
-		_vm->_gyro.lines[i].y1 = f.readSint16LE();
-		_vm->_gyro.lines[i].x2 = f.readSint16LE();
-		_vm->_gyro.lines[i].y2 = f.readSint16LE();
-		_vm->_gyro.lines[i].col = f.readByte();
+		_vm->_gyro->lines[i].x1 = f.readSint16LE();
+		_vm->_gyro->lines[i].y1 = f.readSint16LE();
+		_vm->_gyro->lines[i].x2 = f.readSint16LE();
+		_vm->_gyro->lines[i].y2 = f.readSint16LE();
+		_vm->_gyro->lines[i].col = f.readByte();
 	}
 
-	memset(_vm->_gyro.peds, 177, sizeof(_vm->_gyro.peds));
+	memset(_vm->_gyro->peds, 177, sizeof(_vm->_gyro->peds));
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro.peds[i].x = f.readSint16LE();
-		_vm->_gyro.peds[i].y = f.readSint16LE();
-		_vm->_gyro.peds[i].dir = f.readByte();
+		_vm->_gyro->peds[i].x = f.readSint16LE();
+		_vm->_gyro->peds[i].y = f.readSint16LE();
+		_vm->_gyro->peds[i].dir = f.readByte();
 	}
 	
-	_vm->_gyro.numfields = f.readByte();
-	for (byte i = 0; i < _vm->_gyro.numfields; i++) {
-		_vm->_gyro.fields[i].x1 = f.readSint16LE();
-		_vm->_gyro.fields[i].y1 = f.readSint16LE();
-		_vm->_gyro.fields[i].x2 = f.readSint16LE();
-		_vm->_gyro.fields[i].y2 = f.readSint16LE();
+	_vm->_gyro->numfields = f.readByte();
+	for (byte i = 0; i < _vm->_gyro->numfields; i++) {
+		_vm->_gyro->fields[i].x1 = f.readSint16LE();
+		_vm->_gyro->fields[i].y1 = f.readSint16LE();
+		_vm->_gyro->fields[i].x2 = f.readSint16LE();
+		_vm->_gyro->fields[i].y2 = f.readSint16LE();
 	}
 
 	for (byte i = 0; i < 15; i++) {
-		_vm->_gyro.magics[i].op = f.readByte();
-		_vm->_gyro.magics[i].data = f.readUint16LE();
+		_vm->_gyro->magics[i].op = f.readByte();
+		_vm->_gyro->magics[i].data = f.readUint16LE();
 	}
 
 	for (byte i = 0; i < 7; i++) {
-		_vm->_gyro.portals[i].op = f.readByte();
-		_vm->_gyro.portals[i].data = f.readUint16LE();
+		_vm->_gyro->portals[i].op = f.readByte();
+		_vm->_gyro->portals[i].data = f.readUint16LE();
 	}
 
-	_vm->_gyro.flags.clear();
+	_vm->_gyro->flags.clear();
 	for (byte i = 0;  i < 26; i++)
-		_vm->_gyro.flags += f.readByte();
+		_vm->_gyro->flags += f.readByte();
 
 	int16 listen_length = f.readByte();
-	_vm->_gyro.listen.clear();
+	_vm->_gyro->listen.clear();
 	for (byte i = 0; i < listen_length; i++)
-		_vm->_gyro.listen += f.readByte();
+		_vm->_gyro->listen += f.readByte();
 	
 	draw_also_lines();
 
@@ -199,7 +199,7 @@ void Lucerna::load_also(Common::String n) {
 	f.close();
 	unscramble();
 	for (fv = 0; fv <= minnames; fv++)
-		*_vm->_gyro.also[fv][0] = Common::String(',') + *_vm->_gyro.also[fv][0] + ',';
+		*_vm->_gyro->also[fv][0] = Common::String(',') + *_vm->_gyro->also[fv][0] + ',';
 }
 
 void Lucerna::load(byte n) {     /* Load2, actually */
@@ -209,17 +209,17 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	Common::String xx;
 	bool was_virtual;
 
-	was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual;
+	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
 	if (was_virtual)
-		_vm->_gyro.off_virtual();
+		_vm->_gyro->off_virtual();
 	else
-		_vm->_gyro.off();
+		_vm->_gyro->off();
 
-	_vm->_gyro.clear_vmc();
+	_vm->_gyro->clear_vmc();
 	
 	_vm->_graphics->flesh_colours();
 
-	xx = _vm->_gyro.strf(n);
+	xx = _vm->_gyro->strf(n);
 	Common::String filename;
 	filename = filename.format("place%s.avd", xx.c_str());
 	if (!f.open(filename)) {
@@ -229,7 +229,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	f.seek(146);
 	for (byte i = 0; i < 30; i++)
-		_vm->_gyro.roomname += f.readByte();
+		_vm->_gyro->roomname += f.readByte();
 	/* Compression method byte follows this... */
 
 	f.seek(177);
@@ -278,12 +278,12 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
-	_vm->_logger.log_newroom(_vm->_gyro.roomname);
+	_vm->_logger.log_newroom(_vm->_gyro->roomname);
 
 	if (was_virtual)
-		_vm->_gyro.on_virtual();
+		_vm->_gyro->on_virtual();
 	else 
-		_vm->_gyro.on();
+		_vm->_gyro->on();
 }
 
 
@@ -297,28 +297,28 @@ void Lucerna::zoomout(int16 x, int16 y) {
 
 void Lucerna::find_people(byte room) {
 	for (byte fv = 151; fv <= 178; fv++)
-		if (_vm->_gyro.whereis[fv] == room) {
+		if (_vm->_gyro->whereis[fv] == room) {
 			if (fv < 175)
-				_vm->_gyro.him = fv;
+				_vm->_gyro->him = fv;
 			else
-				_vm->_gyro.her = fv;
+				_vm->_gyro->her = fv;
 		}
 }
 
 void Lucerna::exitroom(byte x) {
 	//nosound();
 	_vm->_celer.forget_chunks();
-	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
+	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
 
 	switch (x) {
 	case r__spludwicks:
 		_vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks);
-		 _vm->_gyro.dna.avaricius_talk = 0;
+		 _vm->_gyro->dna.avaricius_talk = 0;
 		/* He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. */       
 		break;
 	case r__bridge:
-		if (_vm->_gyro.dna.drawbridge_open > 0) {
-			_vm->_gyro.dna.drawbridge_open = 4; /* Fully open. */
+		if (_vm->_gyro->dna.drawbridge_open > 0) {
+			_vm->_gyro->dna.drawbridge_open = 4; /* Fully open. */
 			_vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls);
 		}
 		break;
@@ -330,39 +330,39 @@ void Lucerna::exitroom(byte x) {
 		break;
 	}
 
-	_vm->_gyro.interrogation = 0; /* Leaving the room cancels all the questions automatically. */
+	_vm->_gyro->interrogation = 0; /* Leaving the room cancels all the questions automatically. */
 
-	_vm->_gyro.seescroll = false; /* Now it can work again! */
+	_vm->_gyro->seescroll = false; /* Now it can work again! */
 
-	_vm->_gyro.dna.last_room = _vm->_gyro.dna.room;
-	if (_vm->_gyro.dna.room != r__map)
-		_vm->_gyro.dna.last_room_not_map = _vm->_gyro.dna.room;
+	_vm->_gyro->dna.last_room = _vm->_gyro->dna.room;
+	if (_vm->_gyro->dna.room != r__map)
+		_vm->_gyro->dna.last_room_not_map = _vm->_gyro->dna.room;
 }
 
 void Lucerna::new_town() {   /* You've just entered a town from the map. */
 	_vm->_dropdown.standard_bar();
 
-	switch (_vm->_gyro.dna.room) {
+	switch (_vm->_gyro->dna.room) {
 	case r__outsidenottspub: /* Entry into Nottingham. */
-		if ((_vm->_gyro.dna.rooms[r__robins] > 0) && (_vm->_gyro.dna.been_tied_up) && (! _vm->_gyro.dna.taken_mushroom))
-			_vm->_gyro.dna.mushroom_growing = true;
+		if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (! _vm->_gyro->dna.taken_mushroom))
+			_vm->_gyro->dna.mushroom_growing = true;
 		break;
 	case r__wisewomans: { /* Entry into Argent. */
-		if (_vm->_gyro.dna.talked_to_crapulus && (! _vm->_gyro.dna.lustie_is_asleep)) {
-			_vm->_gyro.dna.spludwicks_here = !((_vm->_gyro.dna.rooms[r__wisewomans] % 3) == 1);
-			_vm->_gyro.dna.crapulus_will_tell = ! _vm->_gyro.dna.spludwicks_here;
+		if (_vm->_gyro->dna.talked_to_crapulus && (! _vm->_gyro->dna.lustie_is_asleep)) {
+			_vm->_gyro->dna.spludwicks_here = !((_vm->_gyro->dna.rooms[r__wisewomans] % 3) == 1);
+			_vm->_gyro->dna.crapulus_will_tell = ! _vm->_gyro->dna.spludwicks_here;
 		} else {
-			_vm->_gyro.dna.spludwicks_here = true;
-			_vm->_gyro.dna.crapulus_will_tell = false;
+			_vm->_gyro->dna.spludwicks_here = true;
+			_vm->_gyro->dna.crapulus_will_tell = false;
 		}
-		if (_vm->_gyro.dna.box_contents == _vm->_gyro.wine)  _vm->_gyro.dna.winestate = 3; /* Vinegar */
+		if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine)  _vm->_gyro->dna.winestate = 3; /* Vinegar */
 	}
 	break;
 	}
 
-	if (_vm->_gyro.dna.room != r__outsideducks) {
-		if ((_vm->_gyro.dna.obj[_vm->_gyro.onion]) && !(_vm->_gyro.dna.onion_in_vinegar))
-			_vm->_gyro.dna.rotten_onion = true; /* You're holding the onion */
+	if (_vm->_gyro->dna.room != r__outsideducks) {
+		if ((_vm->_gyro->dna.obj[_vm->_gyro->onion]) && !(_vm->_gyro->dna.onion_in_vinegar))
+			_vm->_gyro->dna.rotten_onion = true; /* You're holding the onion */
 	}
 }
 
@@ -378,33 +378,33 @@ void Lucerna::put_geida_at(byte whichped, byte &ped) {
 }
 
 void Lucerna::enterroom(byte x, byte ped) {
-	_vm->_gyro.seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
+	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
 
 	find_people(x);
-	_vm->_gyro.dna.room = x;
+	_vm->_gyro->dna.room = x;
 	if (ped != 0)
-		_vm->_gyro.dna.rooms[x]++;
+		_vm->_gyro->dna.rooms[x]++;
 
 	load(x);
 
-	if ((_vm->_gyro.dna.rooms[x] == 0) && (! _vm->_gyro.flagset('S')))
+	if ((_vm->_gyro->dna.rooms[x] == 0) && (! _vm->_gyro->flagset('S')))
 		points(1);
 
-	_vm->_gyro.whereis[_vm->_gyro.pavalot] = _vm->_gyro.dna.room;
+	_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
 
-	if (_vm->_gyro.dna.geida_follows)
-		_vm->_gyro.whereis[_vm->_gyro.pgeida] = x;
+	if (_vm->_gyro->dna.geida_follows)
+		_vm->_gyro->whereis[_vm->_gyro->pgeida] = x;
 
-	_vm->_gyro.roomtime = 0;
+	_vm->_gyro->roomtime = 0;
 
 	
-	if ((_vm->_gyro.dna.last_room == r__map) && (_vm->_gyro.dna.last_room_not_map != _vm->_gyro.dna.room))
+	if ((_vm->_gyro->dna.last_room == r__map) && (_vm->_gyro->dna.last_room_not_map != _vm->_gyro->dna.room))
 		new_town();
 	
 
 	switch (x) {
 	case r__yours:
-		if (_vm->_gyro.dna.avvy_in_bed) {
+		if (_vm->_gyro->dna.avvy_in_bed) {
 			_vm->_celer.show_one(3);
 			_vm->_timeout.set_up_timer(100, _vm->_timeout.procarkata_shouts, _vm->_timeout.reason_arkata_shouts);
 		}
@@ -412,12 +412,12 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsideyours:
 		if (ped > 0) {
-			if (! _vm->_gyro.dna.talked_to_crapulus) {
+			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
-				_vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__outsideyours;
+				_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
 				_vm->_trip.tr[2].init(8, false, &_vm->_trip); /* load Crapulus */
 
-				if (_vm->_gyro.dna.rooms[r__outsideyours] == 1) {
+				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
 					_vm->_trip.apped(2, 4); /* Start on the right-hand side of the screen. */
 					_vm->_trip.tr[2].walkto(5); /* Walks up to greet you. */
 				} else {
@@ -428,14 +428,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip.tr[2].call_eachstep = true;
 				_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* He always faces Avvy. */
 
-			} else _vm->_gyro.whereis[_vm->_gyro.pcrapulus] = r__nowhere;
+			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
 
-			if (_vm->_gyro.dna.crapulus_will_tell) {
+			if (_vm->_gyro->dna.crapulus_will_tell) {
 				_vm->_trip.tr[2].init(8, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
 				_vm->_trip.tr[2].walkto(4);
 				_vm->_timeout.set_up_timer(20, _vm->_timeout.proccrapulus_splud_out, _vm->_timeout.reason_crapulus_says_spludwick_out);
-				_vm->_gyro.dna.crapulus_will_tell = false;
+				_vm->_gyro->dna.crapulus_will_tell = false;
 			}
 		}
 		break;
@@ -443,40 +443,40 @@ void Lucerna::enterroom(byte x, byte ped) {
 	/* Need to find out which room is this!
 	 
 	 case r__outsidespludwicks:
-		if ((_vm->_gyro.dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
+		if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
 			_vm->_timeout.set_up_timer(20, _vm->_timeout.procbang, _vm->_timeout.reason_explosion);
-			_vm->_gyro.dna.spludwicks_here = true;
+			_vm->_gyro->dna.spludwicks_here = true;
 		}
 		break;*/
 
 	case r__spludwicks:
-		if (_vm->_gyro.dna.spludwicks_here) {
+		if (_vm->_gyro->dna.spludwicks_here) {
 			if (ped > 0) {
 				_vm->_trip.tr[2].init(2, false, &_vm->_trip); /* load Spludwick */
 				_vm->_trip.apped(2, 2);
-				_vm->_gyro.whereis['\227'] = r__spludwicks;
+				_vm->_gyro->whereis['\227'] = r__spludwicks;
 			}
 
-			_vm->_gyro.dna.dogfoodpos = 0;  /* _vm->_gyro.also Spludwick pos. */
+			_vm->_gyro->dna.dogfoodpos = 0;  /* _vm->_gyro->also Spludwick pos. */
 
 			_vm->_trip.tr[2].call_eachstep = true;
 			_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
-		} else _vm->_gyro.whereis['\227'] = r__nowhere;
+		} else _vm->_gyro->whereis['\227'] = r__nowhere;
 		break;
 
 	case r__brummieroad: {
-		if (_vm->_gyro.dna.geida_follows)  put_geida_at(5, ped);
-		if (_vm->_gyro.dna.cwytalot_gone) {
-			_vm->_gyro.magics[lightred].op = _vm->_gyro.nix;
-			_vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__nowhere;
+		if (_vm->_gyro->dna.geida_follows)  put_geida_at(5, ped);
+		if (_vm->_gyro->dna.cwytalot_gone) {
+			_vm->_gyro->magics[lightred].op = _vm->_gyro->nix;
+			_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere;
 		} else {
 			if (ped > 0) {
 				_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot*/
 				_vm->_trip.tr[2].call_eachstep = true;
 				_vm->_trip.tr[2].eachstep = _vm->_trip.procfollow_avvy_y;
-				_vm->_gyro.whereis[_vm->_gyro.pcwytalot] = r__brummieroad;
+				_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
 
-				if (_vm->_gyro.dna.rooms[r__brummieroad] == 1) { /* First time here... */
+				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
 					_vm->_trip.apped(2, 2); /* He appears on the right of the screen... */
 					_vm->_trip.tr[2].walkto(4); /* ...and he walks up... */
 				} else {
@@ -490,32 +490,32 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__argentroad: {
-		dnatype &with = _vm->_gyro.dna;
+		dnatype &with = _vm->_gyro->dna;
 		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
-		        (_vm->_gyro.dna.rooms[r__argentroad] > 3)) {
+		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
 			_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot again*/
 			_vm->_trip.apped(2, 1);
 			_vm->_trip.tr[2].walkto(2);
 			_vm->_trip.tr[2].vanishifstill = true;
 			with.cwytalot_in_herts = true;
-			/*_vm->_gyro.whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
+			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
 			_vm->_timeout.set_up_timer(20, _vm->_timeout.proc_cwytalot_in_herts, _vm->_timeout.reason_cwytalot_in_herts);
 		}
 	}
 	break;
 
 	case r__bridge: {
-		if (_vm->_gyro.dna.drawbridge_open == 4) { /*open*/
+		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
 			_vm->_celer.show_one(3); /* Position of drawbridge */
-			_vm->_gyro.magics[green].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
+			_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
-		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 3, ped); /* load Geida */
+		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 3, ped); /* load Geida */
 	}
 	break;
 
 	case r__robins: {
 		if (ped > 0) {
-			if (! _vm->_gyro.dna.been_tied_up) {
+			if (! _vm->_gyro->dna.been_tied_up) {
 				/* A welcome party... or maybe not... */
 				_vm->_trip.tr[2].init(6, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
@@ -524,22 +524,22 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 		}
 
-		if (_vm->_gyro.dna.been_tied_up) {
-			_vm->_gyro.whereis[_vm->_gyro.probinhood] = 0;
-			_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 0;
+		if (_vm->_gyro->dna.been_tied_up) {
+			_vm->_gyro->whereis[_vm->_gyro->probinhood] = 0;
+			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 0;
 		}
 
-		if (_vm->_gyro.dna.tied_up)
+		if (_vm->_gyro->dna.tied_up)
 			_vm->_celer.show_one(2);
 
-		if (! _vm->_gyro.dna.mushroom_growing) 
+		if (! _vm->_gyro->dna.mushroom_growing) 
 			_vm->_celer.show_one(3);
 	}
 	break;
 
 	case r__outsidecardiffcastle: {
 		if (ped > 0)
-			switch (_vm->_gyro.dna.cardiff_things) {
+			switch (_vm->_gyro->dna.cardiff_things) {
 			case 0 : { /* You've answered NONE of his questions. */
 				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
@@ -548,7 +548,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 			break;
 			case 5 :
-				_vm->_gyro.magics[2].op = _vm->_gyro.nix;
+				_vm->_gyro->magics[2].op = _vm->_gyro->nix;
 				break; /* You've answered ALL his questions. => nothing happens. */
 			default: { /* You've answered SOME of his questions. */
 				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
@@ -557,9 +557,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_timeout.set_up_timer(3, _vm->_timeout.proccardiff_return, _vm->_timeout.reason_cardiffsurvey);
 			}
 			}
-		if (_vm->_gyro.dna.cardiff_things < 5)
-			_vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things;
-		else _vm->_gyro.interrogation = 0;
+		if (_vm->_gyro->dna.cardiff_things < 5)
+			_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
+		else _vm->_gyro->interrogation = 0;
 	}
 	break;
 
@@ -574,9 +574,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__argentpub: {
-		if (_vm->_gyro.dna.wonnim)  _vm->_celer.show_one(1);   /* No lute by the settle. */
-		_vm->_gyro.dna.malagauche = 0; /* Ready to boot Malagauche */
-		if (_vm->_gyro.dna.givenbadgetoiby) {
+		if (_vm->_gyro->dna.wonnim)  _vm->_celer.show_one(1);   /* No lute by the settle. */
+		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
+		if (_vm->_gyro->dna.givenbadgetoiby) {
 			_vm->_celer.show_one(8);
 			_vm->_celer.show_one(9);
 		}
@@ -584,27 +584,27 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__lustiesroom: {
-		_vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
+		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 		if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */
 			_vm->_timeout.set_up_timer(3, _vm->_timeout.proccallsguards, _vm->_timeout.reason_du_lustie_talks);
-		else if (! _vm->_gyro.dna.entered_lusties_room_as_monk) /*already*/
+		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
 			/* Presumably, Avvy dressed as a monk. */
 			_vm->_timeout.set_up_timer(3, _vm->_timeout.procgreetsmonk, _vm->_timeout.reason_du_lustie_talks);
 
-		if (_vm->_gyro.dna.geida_follows) {
+		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(5, ped);
-			if (_vm->_gyro.dna.lustie_is_asleep)  _vm->_celer.show_one(5);
+			if (_vm->_gyro->dna.lustie_is_asleep)  _vm->_celer.show_one(5);
 		}
 	}
 	break;
 
 	case r__musicroom: {
-		if (_vm->_gyro.dna.jacques_awake > 0) {
-			_vm->_gyro.dna.jacques_awake = 5;
+		if (_vm->_gyro->dna.jacques_awake > 0) {
+			_vm->_gyro->dna.jacques_awake = 5;
 			_vm->_celer.show_one(2);
 			_vm->_celer.show_one(4);
-			_vm->_gyro.magics[brown].op = _vm->_gyro.nix;
-			_vm->_gyro.whereis[_vm->_gyro.pjacques] = 0;
+			_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
+			_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer.show_one(6);
@@ -636,7 +636,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__wisewomans: {
 		_vm->_trip.tr[2].init(11, false, &_vm->_trip);
-		if ((_vm->_gyro.dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
+		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_trip.apped(2, 2); /* Start on the right-hand side of the screen. */
 			_vm->_trip.tr[2].walkto(4); /* Walks up to greet you. */
 		} else {
@@ -653,18 +653,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0) {
 			_vm->_trip.tr[2].init(10, false, &_vm->_trip); /* Define the dart. */
 			_vm->_sequence.first_show(1);
-			if (_vm->_gyro.dna.arrow_in_the_door)
+			if (_vm->_gyro->dna.arrow_in_the_door)
 				_vm->_sequence.then_show(3);
 			else
 				_vm->_sequence.then_show(2);
 
-			if (_vm->_gyro.dna.taken_pen)
+			if (_vm->_gyro->dna.taken_pen)
 				_vm->_celer.show_one(4);
 
 			_vm->_sequence.start_to_close();
 		} else {
 			_vm->_celer.show_one(1);
-			if (_vm->_gyro.dna.arrow_in_the_door)  _vm->_celer.show_one(3);
+			if (_vm->_gyro->dna.arrow_in_the_door)  _vm->_celer.show_one(3);
 			else _vm->_celer.show_one(2);
 		}
 		break;
@@ -689,7 +689,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__aylesoffice:
-		if (_vm->_gyro.dna.ayles_is_awake)
+		if (_vm->_gyro->dna.ayles_is_awake)
 			_vm->_celer.show_one(2);
 		break; /* Ayles awake. */
 
@@ -699,16 +699,16 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__easthall:
 	case r__westhall:
-		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 2, ped);
+		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 2, ped);
 		break;
 
 	case r__lusties:
-		if (_vm->_gyro.dna.geida_follows)  put_geida_at(ped + 6, ped);
+		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 6, ped);
 		break;
 
 	case r__nottspub: {
-		if (_vm->_gyro.dna.sitting_in_pub)  _vm->_celer.show_one(3);
-		_vm->_gyro.dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
+		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer.show_one(3);
+		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 	}
 	break;
 
@@ -723,12 +723,12 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 		break;
 	case r__ducks:
-		_vm->_gyro.dna.dogfoodpos = 1;
+		_vm->_gyro->dna.dogfoodpos = 1;
 		break; /* Actually, Duck pos. */
 
 	}
 
-	_vm->_gyro.seescroll = false; /* Now it can work again! */
+	_vm->_gyro->seescroll = false; /* Now it can work again! */
 
 }
 
@@ -736,10 +736,10 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	const int16 picsize = 966;
 	const bytefield thinkspace = {25, 170, 32, 200};
 
-	_vm->_gyro.thinks = z;
+	_vm->_gyro->thinks = z;
 	z--;
 
-	_vm->_gyro.wait();
+	_vm->_gyro->wait();
 
 	if (th) {
 		if (!f.open("thinks.avd")) {
@@ -772,7 +772,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	f.close();
 
-	_vm->_gyro.off();
+	_vm->_gyro->off();
 
 	/*setactivepage(3);
 	putimage(x, y, p, 0);
@@ -781,8 +781,8 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	for (byte fv = 0; fv <= 1; fv ++)
 		_vm->_trip.getset[fv].remember(thinkspace);
 	
-	_vm->_gyro.on();
-	_vm->_gyro.thinkthing = th;
+	_vm->_gyro->on();
+	_vm->_gyro->thinkthing = th;
 }
 
 void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
@@ -795,13 +795,13 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 	}
 
 	for (byte fv = 0; fv < 10; fv ++) {
-		_vm->_gyro.digit[fv] = new byte[digitsize];
-		f.read(_vm->_gyro.digit[fv], digitsize);
+		_vm->_gyro->digit[fv] = new byte[digitsize];
+		f.read(_vm->_gyro->digit[fv], digitsize);
 	}
 
 	for (byte ff = 0; ff < 9; ff ++) {
-		_vm->_gyro.rwlite[ff] = new byte[rwlitesize];
-		f.read(_vm->_gyro.rwlite[ff], rwlitesize);
+		_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
+		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
 	}
 
 	f.close();
@@ -831,7 +831,7 @@ void Lucerna::toolbar() {
 
 	/* on;*/
 
-	_vm->_gyro.oldrw = 177;
+	_vm->_gyro->oldrw = 177;
 	showrw();
 }
 
@@ -839,10 +839,10 @@ void Lucerna::showscore() {
 
 	const bytefield scorespace = {33, 177, 39, 200};
 
-	if (_vm->_gyro.demo)
+	if (_vm->_gyro->demo)
 		return;
 
-	uint16 score = _vm->_gyro.dna.score;
+	uint16 score = _vm->_gyro->dna.score;
 	int8 numbers[3] = {0, 0, 0};
 	for (byte i = 0; i < 2; i++) {
 		byte divisor = 1;
@@ -853,27 +853,27 @@ void Lucerna::showscore() {
 	}
 	numbers[2] = score;
 
-	_vm->_gyro.off();
+	_vm->_gyro->off();
 
 	//setactivepage(3);
 
 	for (byte fv = 0; fv < 3; fv ++)
-		if (_vm->_gyro.lastscore[fv] != numbers[fv]) 
-			_vm->_graphics->drawPicture(_vm->_gyro.digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
+		if (_vm->_gyro->lastscore[fv] != numbers[fv]) 
+			_vm->_graphics->drawPicture(_vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
 		_vm->_trip.getset[fv].remember(scorespace);
 
 	//setactivepage(1 - cp);
 
-	_vm->_gyro.on();
+	_vm->_gyro->on();
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro.lastscore[i] = numbers[i];
+		_vm->_gyro->lastscore[i] = numbers[i];
 }
 
 void Lucerna::points(byte num) {     /* Add on no. of points */
 	for (byte q = 1; q <= num; q ++) {
-		_vm->_gyro.dna.score++;
+		_vm->_gyro->dna.score++;
 		/*if (soundfx)
 			for (byte fv = 1; fv <= 97; fv ++)
 				sound(177 + dna.score * 3);
@@ -881,13 +881,13 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 	}
 	warning("STUB: Lucerna::points()");
 
-	_vm->_logger.log_score(num, _vm->_gyro.dna.score);
+	_vm->_logger.log_score(num, _vm->_gyro->dna.score);
 	showscore();
 }
 
 void Lucerna::topcheck() {
 	/* Menuset */
-	_vm->_dropdown.ddm_m.getmenu(_vm->_gyro.mpx);
+	_vm->_dropdown.ddm_m.getmenu(_vm->_gyro->mpx);
 	/* Do this one */
 }
 
@@ -899,10 +899,10 @@ void Lucerna::inkey() {
 	char r;
 
 
-	if (_vm->_gyro.demo)
+	if (_vm->_gyro->demo)
 		return; /* Demo handles this itself. */
 
-	if (_vm->_gyro.mousetext == "") {
+	if (_vm->_gyro->mousetext == "") {
 		/* read keyboard */
 		_vm->_enhanced.readkeye();
 		if ((_vm->_enhanced.inchar == ' ') && ((_vm->_enhanced.shiftstate & 8) > 0)) {
@@ -910,10 +910,10 @@ void Lucerna::inkey() {
 			_vm->_enhanced.extd = '#'; /* alt-spacebar = alt-H */
 		}
 	} else {
-		if (_vm->_gyro.mousetext[0] == '`')
-			_vm->_gyro.mousetext.setChar(13,0); /* Backquote = return in a macro */
-		_vm->_enhanced.inchar = _vm->_gyro.mousetext[0];
-		_vm->_gyro.mousetext = Common::String(_vm->_gyro.mousetext.c_str() + 2, 253);
+		if (_vm->_gyro->mousetext[0] == '`')
+			_vm->_gyro->mousetext.setChar(13,0); /* Backquote = return in a macro */
+		_vm->_enhanced.inchar = _vm->_gyro->mousetext[0];
+		_vm->_gyro->mousetext = Common::String(_vm->_gyro->mousetext.c_str() + 2, 253);
 	}
 }
 
@@ -926,34 +926,34 @@ void Lucerna::fxtoggle() {
 }
 
 void Lucerna::objectlist() {
-	_vm->_gyro.dna.carrying = 0;
-	if (_vm->_gyro.thinkthing && ! _vm->_gyro.dna.obj[_vm->_gyro.thinks])
-		thinkabout(_vm->_gyro.money, _vm->_gyro.a_thing); /* you always have money */
+	_vm->_gyro->dna.carrying = 0;
+	if (_vm->_gyro->thinkthing && ! _vm->_gyro->dna.obj[_vm->_gyro->thinks])
+		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */
 	for (byte fv = 0; fv < numobjs; fv ++)
-		if (_vm->_gyro.dna.obj[fv]) {
-			_vm->_gyro.dna.carrying ++;
-			_vm->_gyro.objlist[_vm->_gyro.dna.carrying] = fv + 1;
+		if (_vm->_gyro->dna.obj[fv]) {
+			_vm->_gyro->dna.carrying ++;
+			_vm->_gyro->objlist[_vm->_gyro->dna.carrying] = fv + 1;
 		}
 }
 
 void Lucerna::verte() {
 	byte what;
 
-	if (! _vm->_gyro.dna.user_moves_avvy) 
+	if (! _vm->_gyro->dna.user_moves_avvy) 
 		return;
 
 
 	/* _vm->_trip.tr[0] : that's the only one we're interested in here */
-	if (_vm->_gyro.mx < _vm->_trip.tr[0].x) 
+	if (_vm->_gyro->mx < _vm->_trip.tr[0].x) 
 		what = 1;
-	else if (_vm->_gyro.mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) 
+	else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) 
 		what = 2;
 	else
 		what = 0; /* On top */
 
-	if (_vm->_gyro.my < _vm->_trip.tr[0].y)
+	if (_vm->_gyro->my < _vm->_trip.tr[0].y)
 		what += 3;
-	else if (_vm->_gyro.my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl))
+	else if (_vm->_gyro->my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl))
 		what += 6;
 
 	switch (what) {
@@ -994,7 +994,7 @@ void Lucerna::checkclick() {
 }
 
 void Lucerna::mouse_init() {
-	_vm->_gyro.wait();
+	_vm->_gyro->wait();
 }
 
 void Lucerna::mousepage(uint16 page_) {
@@ -1042,19 +1042,19 @@ void Lucerna::dawn() {
 
 
 void Lucerna::showrw() { // It's data is loaded in load_digits().
-	if (_vm->_gyro.oldrw == _vm->_gyro.dna.rw) 
+	if (_vm->_gyro->oldrw == _vm->_gyro->dna.rw) 
 		return;
-	_vm->_gyro.oldrw = _vm->_gyro.dna.rw;
-	_vm->_gyro.off();
+	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
+	_vm->_gyro->off();
 	
 	/*	for (byte page_ = 0; page_ <= 1; page_ ++) {
 	setactivepage(page_);
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
 
-	_vm->_graphics->drawPicture(_vm->_gyro.rwlite[_vm->_gyro.dna.rw], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
 
-	_vm->_gyro.on();
+	_vm->_gyro->on();
 	//setactivepage(1 - cp);
 	
 	warning("STUB: Lucerna::showrw()");
@@ -1207,21 +1207,21 @@ void Lucerna::flip_page() {
 void Lucerna::delavvy() {
 	byte page_;
 
-	_vm->_gyro.off();
+	_vm->_gyro->off();
 	
 	triptype &with = _vm->_trip.tr[0];
 	for (page_ = 0; page_ <= 1; page_ ++)
 		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
 	
 	blitfix();
-	_vm->_gyro.on();
+	_vm->_gyro->on();
 }
 
 void Lucerna::gameover() {
 	byte fv;
 	int16 sx, sy;
 
-	_vm->_gyro.dna.user_moves_avvy = false;
+	_vm->_gyro->dna.user_moves_avvy = false;
 
 	sx = _vm->_trip.tr[1].x;
 	sy = _vm->_trip.tr[1].y;
@@ -1233,7 +1233,7 @@ void Lucerna::gameover() {
 	
 	_vm->_timeout.set_up_timer(3, _vm->_timeout.procavalot_falls, _vm->_timeout.reason_falling_over);
 	/* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
-	_vm->_gyro.alive = false;
+	_vm->_gyro->alive = false;
 }
 
 /* OK. There are two kinds of redraw: Major and Minor. Minor is what happens
@@ -1243,15 +1243,15 @@ void Lucerna::minor_redraw() {
 	byte fv;
 
 	dusk();
-	enterroom(_vm->_gyro.dna.room, 0); /* Ped unknown or non-existant. */
+	enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */
 
 	for (fv = 0; fv <= 1; fv ++) {
-		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
+		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
 		_vm->_trip.getback();
 	}
 	
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro.lastscore[i] = -1; /* impossible digits */
+		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
 	showscore();
 	
 	dawn();
@@ -1267,7 +1267,7 @@ uint16 Lucerna::bearing(byte whichped) {
 
 	uint16 bearing_result; 
 	{
-		pedtype &with = _vm->_gyro.peds[whichped];
+		pedtype &with = _vm->_gyro->peds[whichped];
 		if (_vm->_trip.tr[1].x == with.x)
 			bearing_result = 0; /* This would cause a division by zero if we let it through. */
 		else {
@@ -1290,7 +1290,7 @@ void Lucerna::sprite_run() {
   make the sprites the same on both pages. */
 	byte fv;
 
-	_vm->_gyro.doing_sprite_run = true;
+	_vm->_gyro->doing_sprite_run = true;
 
 	for (fv = 0; fv <= 1; fv ++) {
 		_vm->_trip.get_back_loretta();
@@ -1299,13 +1299,13 @@ void Lucerna::sprite_run() {
 		flip_page();
 	}
 
-	_vm->_gyro.doing_sprite_run = false;
+	_vm->_gyro->doing_sprite_run = false;
 
 }
 
 void Lucerna::fix_flashers() {
-	_vm->_gyro.ledstatus = 177;
-	_vm->_gyro.oldrw = 177;
+	_vm->_gyro->ledstatus = 177;
+	_vm->_gyro->oldrw = 177;
 	_vm->_scrolls.state(2);
 	showrw();
 }
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 7a468d4..1f7c35e 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -136,7 +136,7 @@ void Pingo::winning_pic() {
 	_vm->_lucerna.dawn();
 
 	/*do {
-		_vm->_gyro.check();
+		_vm->_gyro->check();
 	} while (!(keypressed() || (mrelease > 0)));
 	while (keypressed())  r = readkey();
 	major_redraw();*/
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 35ae4fc..b0563c6 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -59,7 +59,7 @@ void Scrolls::init() {
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	byte page_;
 
-	if (_vm->_gyro.ledstatus == x)
+	if (_vm->_gyro->ledstatus == x)
 		return; /* Already like that! */
 
 	byte color;
@@ -90,12 +90,12 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	//}
 	warning("STUB: Scrolls::state()");
 
-	_vm->_gyro.super_off();
+	_vm->_gyro->super_off();
 
 	_vm->_graphics->drawBar(419, 195, 438, 197, color);
 
-	_vm->_gyro.super_on();
-	_vm->_gyro.ledstatus = x;
+	_vm->_gyro->super_on();
+	_vm->_gyro->ledstatus = x;
 }
 
 void Scrolls::easteregg() {
@@ -130,7 +130,7 @@ bool Scrolls::they_match(tunetype &played) {
 	mistakes = 0;
 
 	for (fv = 1; fv <= sizeof(played); fv ++)
-		if (played[fv] != _vm->_gyro.tune[fv]) {
+		if (played[fv] != _vm->_gyro->tune[fv]) {
 			mistakes += 1;
 		}
 
@@ -144,32 +144,32 @@ void Scrolls::music_scroll() {
 /* ThatsAll, so put us back to */ /*$F-*/
 
 void Scrolls::resetscrolldriver() {   /* phew */
-	_vm->_gyro.scrollbells = 0;
+	_vm->_gyro->scrollbells = 0;
 	cfont = roman;
 	_vm->_logger.log_epsonroman();
 	use_icon = 0;
-	_vm->_gyro.interrogation = 0; /* always reset after a scroll comes up. */
+	_vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */
 }
 
 void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little... */
 	byte fv;
 
-	for (fv = 1; fv <= _vm->_gyro.scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */
+	for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */
 }
 
 void Scrolls::dodgem() {     /* This moves the mouse pointer off the scroll so that you can read it. */
-	_vm->_gyro.xycheck(); /* Mx & my now contain xy pos of mouse */
-	dodgex = _vm->_gyro.mx;
-	dodgey = _vm->_gyro.my; /* Store 'em */
-	_vm->_gyro.hopto(dodgex, _vm->_gyro.underscroll); /* Move the pointer off the scroll. */
+	_vm->_gyro->xycheck(); /* Mx & my now contain xy pos of mouse */
+	dodgex = _vm->_gyro->mx;
+	dodgey = _vm->_gyro->my; /* Store 'em */
+	_vm->_gyro->hopto(dodgex, _vm->_gyro->underscroll); /* Move the pointer off the scroll. */
 }
 
 void Scrolls::undodgem() {   /* This is the opposite of Dodgem. It moves the
  mouse pointer back, IF you haven't moved it in the meantime. */
-	_vm->_gyro.xycheck();
-	if ((_vm->_gyro.mx == dodgex) && (_vm->_gyro.my == _vm->_gyro.underscroll))
+	_vm->_gyro->xycheck();
+	if ((_vm->_gyro->mx == dodgex) && (_vm->_gyro->my == _vm->_gyro->underscroll))
 		/* No change, so restore the pointer's original position. */
-		_vm->_gyro.hopto(dodgex, dodgey);
+		_vm->_gyro->hopto(dodgex, dodgey);
 }
 
 void Scrolls::geticon(int16 x, int16 y, byte which) {
@@ -200,7 +200,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	int16 fv;
 	uint16 st;
 
-	st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro.cp) * _vm->_gyro.pagetop);
+	st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
 
 	Common::String filename;
 	filename = filename.format("%s.avd", fn.c_str());
@@ -237,35 +237,35 @@ bool Scrolls::ask(Common::String question) {
 }
 
 void Scrolls::resetscroll() {
-	_vm->_gyro.scrolln = 1;
+	_vm->_gyro->scrolln = 1;
 	for (int j = 0; j < 15; j ++)
-		for (int i = 0; i < _vm->_gyro.scroll[j].size(); i++)
-			_vm->_gyro.scroll[j].setChar(0, i);
+		for (int i = 0; i < _vm->_gyro->scroll[j].size(); i++)
+			_vm->_gyro->scroll[j].setChar(0, i);
 }
 
 void Scrolls::natural() {   /* Natural state of bubbles */
-	_vm->_gyro.talkx = 320;
-	_vm->_gyro.talky = 200;
-	_vm->_gyro.talkb = 8;
-	_vm->_gyro.talkf = 15;
+	_vm->_gyro->talkx = 320;
+	_vm->_gyro->talky = 200;
+	_vm->_gyro->talkb = 8;
+	_vm->_gyro->talkf = 15;
 }
 
 Common::String Scrolls::lsd() {
 	Common::String x;
 
 	Common::String lsd_result;
-	if (_vm->_gyro.dna.pence < 12) {
+	if (_vm->_gyro->dna.pence < 12) {
 		/* just pence */
-		x = _vm->_gyro.strf(_vm->_gyro.dna.pence) + 'd';
-	} else if (_vm->_gyro.dna.pence < 240) {
+		x = _vm->_gyro->strf(_vm->_gyro->dna.pence) + 'd';
+	} else if (_vm->_gyro->dna.pence < 240) {
 		/* shillings & pence */
-		x = _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(12)) + '/';
-		if ((_vm->_gyro.dna.pence % int32(12)) == 0)  x = x + '-';
-		else x = x + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12));
+		x = _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(12)) + '/';
+		if ((_vm->_gyro->dna.pence % int32(12)) == 0)  x = x + '-';
+		else x = x + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12));
 	} else   /* L, s & d */
-		x = Common::String('œ') + _vm->_gyro.strf(_vm->_gyro.dna.pence / int32(240)) + '.' + _vm->_gyro.strf((_vm->_gyro.dna.pence / int32(12)) % int32(20))
-			+ '.' + _vm->_gyro.strf(_vm->_gyro.dna.pence % int32(12));
-	if (_vm->_gyro.dna.pence > 12)  x = x + " (that's " + _vm->_gyro.strf(_vm->_gyro.dna.pence) + "d)";
+		x = Common::String('œ') + _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(240)) + '.' + _vm->_gyro->strf((_vm->_gyro->dna.pence / int32(12)) % int32(20))
+			+ '.' + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12));
+	if (_vm->_gyro->dna.pence > 12)  x = x + " (that's " + _vm->_gyro->strf(_vm->_gyro->dna.pence) + "d)";
 	lsd_result = x;
 	return lsd_result;
 }
@@ -286,8 +286,8 @@ void Scrolls::calldrivers() {
 }
 
 void Scrolls::display(Common::String z) {
-	_vm->_gyro.bufsize = z.size();
-	memcpy(_vm->_gyro.buffer, z.c_str() + 1, _vm->_gyro.bufsize);
+	_vm->_gyro->bufsize = z.size();
+	memcpy(_vm->_gyro->buffer, z.c_str() + 1, _vm->_gyro->bufsize);
 	calldrivers();
 }
 
@@ -315,7 +315,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_vm->_gyro.little[i],16);
+		f.read(_vm->_gyro->little[i],16);
 	f.close();
 }
 
@@ -331,15 +331,15 @@ void Scrolls::musical_scroll() {
 
 	_vm->_lucerna.sprite_run();
 
-	was_virtual = _vm->_gyro.visible == _vm->_gyro.m_virtual;
+	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
 
 	if (was_virtual)
-		_vm->_gyro.off_virtual();
+		_vm->_gyro->off_virtual();
 
 	drawscroll(&Avalanche::Scrolls::music_scroll);
 
 	if (was_virtual)
-		_vm->_gyro.on_virtual();
+		_vm->_gyro->on_virtual();
 	resetscroll();
 }
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index f3ba72a..61198d2 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -66,8 +66,8 @@ void Sequence::then_show(byte what) {
 void Sequence::then_flip(byte where, byte ped) {
 	then_show(now_flip);
 
-	_vm->_gyro.dna.flip_to_where = where;
-	_vm->_gyro.dna.flip_to_ped = ped;
+	_vm->_gyro->dna.flip_to_where = where;
+	_vm->_gyro->dna.flip_to_ped = ped;
 }
 
 void Sequence::start_to_close() {
@@ -76,7 +76,7 @@ void Sequence::start_to_close() {
 }
 
 void Sequence::start_to_open() {
-	_vm->_gyro.dna.user_moves_avvy = false; /* They can't move. */
+	_vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */
 	_vm->_trip.stopwalking(); /* And they're not moving now. */
 	start_to_close(); /* Apart from that, it's the same thing. */
 }
@@ -94,8 +94,8 @@ void Sequence::call_sequencer() {
 		return;
 		break; /* No more routines. */
 	case 177:
-		_vm->_gyro.dna.user_moves_avvy = true;
-		_vm->_trip.fliproom(_vm->_gyro.dna.flip_to_where, _vm->_gyro.dna.flip_to_ped); /* 177 = Flip room. */
+		_vm->_gyro->dna.user_moves_avvy = true;
+		_vm->_trip.fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
 		if (seq[0] == 177)
 			shove_left();
 		break;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 623bb75..b10c1c1 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -73,7 +73,7 @@ void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
 }
 
 void Timeout::one_tick() {
-	if (_vm->_gyro.ddmnow)
+	if (_vm->_gyro->ddmnow)
 		return;
 
 	for (fv = 1; fv <= 7; fv++) {
@@ -210,8 +210,8 @@ void Timeout::one_tick() {
 			}
 		}
 	}
-	_vm->_gyro.roomtime += 1; /* Cycles since you've been in this room. */
-	_vm->_gyro.dna.total_time += 1; /* Total amount of time for this game. */
+	_vm->_gyro->roomtime += 1; /* Cycles since you've been in this room. */
+	_vm->_gyro->dna.total_time += 1; /* Total amount of time for this game. */
 }
 
 void Timeout::lose_timer(byte which) {
@@ -240,11 +240,11 @@ end;*/
 /* Timeout procedures: */
 
 void Timeout::open_drawbridge() {
-	_vm->_gyro.dna.drawbridge_open++;
-	_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
+	_vm->_gyro->dna.drawbridge_open++;
+	_vm->_celer.show_one(_vm->_gyro->dna.drawbridge_open - 1);
 
-	if (_vm->_gyro.dna.drawbridge_open == 4)
-		_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* You may enter the drawbridge. */
+	if (_vm->_gyro->dna.drawbridge_open == 4)
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 	else
 		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
@@ -252,10 +252,10 @@ void Timeout::open_drawbridge() {
 /* --- */
 
 void Timeout::avaricius_talks() {
-	_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
-	_vm->_gyro.dna.avaricius_talk++;
+	_vm->_visa.dixi('q', _vm->_gyro->dna.avaricius_talk);
+	_vm->_gyro->dna.avaricius_talk++;
 
-	if (_vm->_gyro.dna.avaricius_talk < 17)
+	if (_vm->_gyro->dna.avaricius_talk < 17)
 		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
 	else
 		_vm->_lucerna.points(3);
@@ -282,25 +282,25 @@ void Timeout::bang2() {
 }
 
 void Timeout::stairs() {
-	_vm->_gyro.blip();
+	_vm->_gyro->blip();
 	_vm->_trip.tr[0].walkto(4);
 	_vm->_celer.show_one(2);
-	_vm->_gyro.dna.brummie_stairs = 2;
-	_vm->_gyro.magics[11].op = _vm->_gyro.special;
-	_vm->_gyro.magics[11].data = 2; /* Reached the bottom of the stairs. */
-	_vm->_gyro.magics[4].op = _vm->_gyro.nix; /* Stop them hitting the sides (or the game will hang.) */
+	_vm->_gyro->dna.brummie_stairs = 2;
+	_vm->_gyro->magics[11].op = _vm->_gyro->special;
+	_vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */
+	_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */
 }
 
 void Timeout::cardiff_survey() {
-	switch (_vm->_gyro.dna.cardiff_things) {
+	switch (_vm->_gyro->dna.cardiff_things) {
 	case 0:
-		_vm->_gyro.dna.cardiff_things += 1;
+		_vm->_gyro->dna.cardiff_things += 1;
 		_vm->_visa.dixi('q', 27);
 		break;
 	}
-	_vm->_visa.dixi('z', _vm->_gyro.dna.cardiff_things);
+	_vm->_visa.dixi('z', _vm->_gyro->dna.cardiff_things);
 
-	_vm->_gyro.interrogation = _vm->_gyro.dna.cardiff_things;
+	_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
 
@@ -315,8 +315,8 @@ void Timeout::cwytalot_in_herts() {
 
 void Timeout::get_tied_up() {
 	_vm->_visa.dixi('q', 34); /* ...Trouble! */
-	_vm->_gyro.dna.user_moves_avvy = false;
-	_vm->_gyro.dna.been_tied_up = true;
+	_vm->_gyro->dna.user_moves_avvy = false;
+	_vm->_gyro->dna.been_tied_up = true;
 	_vm->_trip.stopwalking();
 	_vm->_trip.tr[2].stopwalk();
 	_vm->_trip.tr[2].stophoming();
@@ -328,14 +328,14 @@ void Timeout::get_tied_up() {
 void Timeout::get_tied_up2() {
 	_vm->_trip.tr[1].walkto(4);
 	_vm->_trip.tr[2].walkto(5);
-	_vm->_gyro.magics[4].op = _vm->_gyro.nix; /* No effect when you touch the boundaries. */
-	_vm->_gyro.dna.friar_will_tie_you_up = true;
+	_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
+	_vm->_gyro->dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
 	_vm->_trip.tr[2].check_me = false;
 	_vm->_trip.tr[1].init(7, true, &_vm->_trip); /* Robin Hood */
-	_vm->_gyro.whereis[_vm->_gyro.probinhood] = r__robins;
+	_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
 	_vm->_trip.apped(1, 2);
 	_vm->_visa.dixi('q', 39);
 	_vm->_trip.tr[1].walkto(7);
@@ -346,7 +346,7 @@ void Timeout::hang_around2() {
 	_vm->_visa.dixi('q', 40);
 	_vm->_trip.tr[2].vanishifstill = false;
 	_vm->_trip.tr[2].walkto(4);
-	_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = r__robins;
+	_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
 	_vm->_visa.dixi('q', 41);
 	_vm->_trip.tr[1].done();
 	_vm->_trip.tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
@@ -354,7 +354,7 @@ void Timeout::hang_around2() {
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
 	/* Immediately call the following proc (when you have a chance). */
 
-	_vm->_gyro.dna.tied_up = false;
+	_vm->_gyro->dna.tied_up = false;
 
 	_vm->_enid.back_to_bootstrap(1); /* Call the shoot-'em-up. */
 }
@@ -364,9 +364,9 @@ void Timeout::after_the_shootemup() {
 }
 
 void Timeout::jacques_wakes_up() {
-	_vm->_gyro.dna.jacques_awake += 1;
+	_vm->_gyro->dna.jacques_awake += 1;
 
-	switch (_vm->_gyro.dna.jacques_awake) { /* Additional pictures. */
+	switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
 	case 1 :
 		_vm->_celer.show_one(1); /* Eyes open. */
 		_vm->_visa.dixi('Q', 45);
@@ -374,23 +374,23 @@ void Timeout::jacques_wakes_up() {
 	case 2 : /* Going through the door. */
 		_vm->_celer.show_one(2); /* Not on the floor. */
 		_vm->_celer.show_one(3); /* But going through the door. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* You can't wake him up now. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */
 		break;
 	case 3 :  /* Gone through the door. */
 		_vm->_celer.show_one(2); /* Not on the floor, either. */
 		_vm->_celer.show_one(4); /* He's gone... so the door's open. */
-		_vm->_gyro.whereis[_vm->_gyro.pjacques] = 0; /* Gone! */
+		_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */
 		break;
 	}
 
 
-	if (_vm->_gyro.dna.jacques_awake == 5) {
-		_vm->_gyro.dna.ringing_bells = true;
-		_vm->_gyro.dna.ayles_is_awake = true;
+	if (_vm->_gyro->dna.jacques_awake == 5) {
+		_vm->_gyro->dna.ringing_bells = true;
+		_vm->_gyro->dna.ayles_is_awake = true;
 		_vm->_lucerna.points(2);
 	}
 
-	switch (_vm->_gyro.dna.jacques_awake) {
+	switch (_vm->_gyro->dna.jacques_awake) {
 	case 1:
 	case 2:
 	case 3:
@@ -431,7 +431,7 @@ void Timeout::naughty_duke3() {
 }
 
 void Timeout::jump() {
-	dnatype &with = _vm->_gyro.dna;
+	dnatype &with = _vm->_gyro->dna;
 
 	with.jumpstatus += 1;
 
@@ -457,24 +457,24 @@ void Timeout::jump() {
 
 	if (with.jumpstatus == 20) {
 		/* End of jump. */
-		_vm->_gyro.dna.user_moves_avvy = true;
-		_vm->_gyro.dna.jumpstatus = 0;
+		_vm->_gyro->dna.user_moves_avvy = true;
+		_vm->_gyro->dna.jumpstatus = 0;
 	} else {
 		/* Still jumping. */
 		set_up_timer(1, procjump, reason_jumping);
 	}
 
 	if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
-			&& (_vm->_gyro.dna.room == r__insidecardiffcastle)
-			&& (_vm->_gyro.dna.arrow_in_the_door == true)
+			&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
+			&& (_vm->_gyro->dna.arrow_in_the_door == true)
 			&& (_vm->_trip.infield(3))) { /* beside the wall*/
 		/* Grab the arrow! */
-		if (_vm->_gyro.dna.carrying >= maxobjs)
+		if (_vm->_gyro->dna.carrying >= maxobjs)
 			_vm->_scrolls.display("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_celer.show_one(2);
-			_vm->_gyro.dna.arrow_in_the_door = false; /* You've got it. */
-			_vm->_gyro.dna.obj[_vm->_gyro.bolt] = true;
+			_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
+			_vm->_gyro->dna.obj[_vm->_gyro->bolt] = true;
 			_vm->_lucerna.objectlist();
 			_vm->_visa.dixi('q', 50);
 			_vm->_lucerna.points(3);
@@ -484,32 +484,32 @@ void Timeout::jump() {
 
 void Timeout::crapulus_says_splud_out() {
 	_vm->_visa.dixi('q', 56);
-	_vm->_gyro.dna.crapulus_will_tell = false;
+	_vm->_gyro->dna.crapulus_will_tell = false;
 }
 
 void Timeout::buydrinks() {
 	_vm->_celer.show_one(11); /* Malagauche gets up again. */
-	_vm->_gyro.dna.malagauche = 0;
+	_vm->_gyro->dna.malagauche = 0;
 
-	_vm->_visa.dixi('D', _vm->_gyro.dna.drinking); /* _vm->_scrolls.display message about it. */
+	_vm->_visa.dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls.display message about it. */
 	_vm->_pingo.wobble(); /* Do the special effects. */
 	_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
-	if (_vm->_gyro.pennycheck(3)) /* Pay 3d. */
+	if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
 		_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
 	_vm->_acci.have_a_drink();
 }
 
 void Timeout::buywine() {
 	_vm->_celer.show_one(11); /* Malagauche gets up again. */
-	_vm->_gyro.dna.malagauche = 0;
+	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa.dixi('D', 50); /* You buy the wine. */
 	_vm->_visa.dixi('D', 1); /* It'll be thruppence. */
-	if (_vm->_gyro.pennycheck(3)) {
+	if (_vm->_gyro->pennycheck(3)) {
 		_vm->_visa.dixi('D', 4); /* You paid up. */
-		_vm->_gyro.dna.obj[_vm->_gyro.wine] = true;
+		_vm->_gyro->dna.obj[_vm->_gyro->wine] = true;
 		_vm->_lucerna.objectlist();
-		_vm->_gyro.dna.winestate = 1; /* OK Wine */
+		_vm->_gyro->dna.winestate = 1; /* OK Wine */
 	}
 }
 
@@ -520,23 +520,23 @@ void Timeout::callsguards() {
 
 void Timeout::greetsmonk() {
 	_vm->_visa.dixi('Q', 59);
-	_vm->_gyro.dna.entered_lusties_room_as_monk = true;
+	_vm->_gyro->dna.entered_lusties_room_as_monk = true;
 }
 
 void Timeout::fall_down_oubliette() {
-	_vm->_gyro.magics[9].op = _vm->_gyro.nix;
+	_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 	_vm->_trip.tr[1].iy += 1; /* increments dx/dy! */
 	_vm->_trip.tr[1].y += _vm->_trip.tr[1].iy;   /* Dowwwn we go... */
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
 void Timeout::meet_avaroid() {
-	if (_vm->_gyro.dna.met_avaroid) {
+	if (_vm->_gyro->dna.met_avaroid) {
 		_vm->_scrolls.display("You can't expect to be \6that\22 lucky twice in a row!");
 		_vm->_lucerna.gameover();
 	} else {
 		_vm->_visa.dixi('Q', 60);
-		_vm->_gyro.dna.met_avaroid = true;
+		_vm->_gyro->dna.met_avaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
 		triptype &with = _vm->_trip.tr[1];
@@ -545,7 +545,7 @@ void Timeout::meet_avaroid() {
 		with.ix = -3;
 		with.iy = -5;
 
-		_vm->_gyro.background(2);
+		_vm->_gyro->background(2);
 	}
 }
 
@@ -558,7 +558,7 @@ void Timeout::rise_up_oubliette() {
 	if (with.iy > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
-		_vm->_gyro.dna.user_moves_avvy = true;
+		_vm->_gyro->dna.user_moves_avvy = true;
 }
 
 void Timeout::robin_hood_and_geida() {
@@ -568,7 +568,7 @@ void Timeout::robin_hood_and_geida() {
 	_vm->_trip.tr[2].stopwalk();
 	_vm->_trip.tr[2].face = _vm->_trip.left;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
-	_vm->_gyro.dna.geida_follows = false;
+	_vm->_gyro->dna.geida_follows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
@@ -586,7 +586,7 @@ void Timeout::avalot_returns() {
 	_vm->_trip.tr[1].init(0, true, &_vm->_trip);
 	_vm->_trip.apped(1, 1);
 	_vm->_visa.dixi('q', 67);
-	_vm->_gyro.dna.user_moves_avvy = true;
+	_vm->_gyro->dna.user_moves_avvy = true;
 }
 
 void Timeout::avvy_sit_down() {
@@ -596,8 +596,8 @@ void Timeout::avvy_sit_down() {
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer.show_one(3);
-		_vm->_gyro.dna.sitting_in_pub = true;
-		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_gyro->dna.sitting_in_pub = true;
+		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_trip.tr[1].visible = false;
 	}
 }
@@ -607,7 +607,7 @@ void Timeout::ghost_room_phew() {
 }
 
 void Timeout::arkata_shouts() {
-	if (_vm->_gyro.dna.teetotal)
+	if (_vm->_gyro->dna.teetotal)
 		return;
 
 	_vm->_visa.dixi('q', 76);
@@ -620,10 +620,10 @@ void Timeout::winning() {
 
 	do {
 		_vm->_lucerna.checkclick();
-	} while (!(_vm->_gyro.mrelease == 0));
+	} while (!(_vm->_gyro->mrelease == 0));
 	_vm->_lucerna.callverb(_vm->_acci.vb_score);
 	_vm->_scrolls.display(" T H E    E N D ");
-	_vm->_gyro.lmo = true;
+	_vm->_gyro->lmo = true;
 }
 
 void Timeout::avalot_falls() {
@@ -648,7 +648,7 @@ void Timeout::spludwick_leaves_cauldron() {
 void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */
 	_vm->_visa.dixi('Q', 86);
 	_vm->_lucerna.points(4);
-	_vm->_gyro.dna.lustie_is_asleep = true;
+	_vm->_gyro->dna.lustie_is_asleep = true;
 	_vm->_sequence.first_show(5);
 	_vm->_sequence.then_show(6); /* He falls asleep... */
 	_vm->_sequence.start_to_close(); /* Not really closing, but we're using the same procedure. */
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f9e8faa..00fac65 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -166,8 +166,8 @@ void triptype::turn(byte whichway) {
 void triptype::appear(int16 wx, int16 wy, byte wf) {
 	x = (wx / 8) * 8;
 	y = wy;
-	ox[_tr->_vm->_gyro.cp] = wx;
-	oy[_tr->_vm->_gyro.cp] = wy;
+	ox[_tr->_vm->_gyro->cp] = wx;
+	oy[_tr->_vm->_gyro->cp] = wy;
 	turn(wf);
 	visible = true;
 	ix = 0;
@@ -199,12 +199,12 @@ void triptype::walk() {
 			r.x2 = ((x + _info.xl) / 8) + 1;
 			r.y2 = y + _info.yl + 2;
 		}
-		_tr->getset[1 - _tr->_vm->_gyro.cp].remember(r);
+		_tr->getset[1 - _tr->_vm->_gyro->cp].remember(r);
 	}
 
-	if (!_tr->_vm->_gyro.doing_sprite_run) {
-		ox[_tr->_vm->_gyro.cp] = x;
-		oy[_tr->_vm->_gyro.cp] = y;
+	if (!_tr->_vm->_gyro->doing_sprite_run) {
+		ox[_tr->_vm->_gyro->cp] = x;
+		oy[_tr->_vm->_gyro->cp] = y;
 		if (homing)  homestep();
 		x = x + ix;
 		y = y + iy;
@@ -216,38 +216,38 @@ void triptype::walk() {
 			return;
 		}
 
-		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro.cp], y, _info.yl);
+		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl);
 
-		if ((tc != 0) & (!_tr->_vm->_gyro.doing_sprite_run)) {
-			switch (_tr->_vm->_gyro.magics[tc].op) {
-			case _tr->_vm->_gyro.exclaim: {
+		if ((tc != 0) & (!_tr->_vm->_gyro->doing_sprite_run)) {
+			switch (_tr->_vm->_gyro->magics[tc].op) {
+			case _tr->_vm->_gyro->exclaim: {
 				bounce();
 				_tr->mustexclaim = true;
-				_tr->saywhat = _tr->_vm->_gyro.magics[tc].data;
+				_tr->saywhat = _tr->_vm->_gyro->magics[tc].data;
 				}
 				break;
-			case _tr->_vm->_gyro.bounces:
+			case _tr->_vm->_gyro->bounces:
 				bounce();
 				break;
-			case _tr->_vm->_gyro.transport:
-				_tr->fliproom(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff);
+			case _tr->_vm->_gyro->transport:
+				_tr->fliproom(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff);
 				break;
-			case _tr->_vm->_gyro.unfinished: {
+			case _tr->_vm->_gyro->unfinished: {
 				bounce();
 				_tr->_vm->_scrolls.display("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
-			case _tr->_vm->_gyro.special:
-				_tr->call_special(_tr->_vm->_gyro.magics[tc].data);
+			case _tr->_vm->_gyro->special:
+				_tr->call_special(_tr->_vm->_gyro->magics[tc].data);
 				break;
-			case _tr->_vm->_gyro.mopendoor:
-				_tr->open_the_door(_tr->_vm->_gyro.magics[tc].data >> 8, _tr->_vm->_gyro.magics[tc].data & 0xff, tc);
+			case _tr->_vm->_gyro->mopendoor:
+				_tr->open_the_door(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff, tc);
 				break;
 			}
 		}
 	}
 
-	if (!_tr->_vm->_gyro.doing_sprite_run) {
+	if (!_tr->_vm->_gyro->doing_sprite_run) {
 		count += 1;
 		if (((ix != 0) || (iy != 0)) && (count > 1)) {
 			step += 1;
@@ -258,15 +258,15 @@ void triptype::walk() {
 }
 
 void triptype::bounce() {
-	x = ox[_tr->_vm->_gyro.cp];
-	y = oy[_tr->_vm->_gyro.cp];
+	x = ox[_tr->_vm->_gyro->cp];
+	y = oy[_tr->_vm->_gyro->cp];
 	if (check_me)
 		_tr->stopwalking();
 	else
 		stopwalk();
-	_tr->_vm->_gyro.oncandopageswap = false;
+	_tr->_vm->_gyro->oncandopageswap = false;
 	_tr->_vm->_lucerna.showrw();
-	_tr->_vm->_gyro.oncandopageswap = true;
+	_tr->_vm->_gyro->oncandopageswap = true;
 }
 
 int8 triptype::sgn(int16 x) {
@@ -281,9 +281,9 @@ int8 triptype::sgn(int16 x) {
 }
 
 void triptype::walkto(byte pednum) {
-	speed(sgn(_tr->_vm->_gyro.peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro.peds[pednum].y - y));
-	hx = _tr->_vm->_gyro.peds[pednum].x - _info.xl / 2;
-	hy = _tr->_vm->_gyro.peds[pednum].y - _info.yl;
+	speed(sgn(_tr->_vm->_gyro->peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro->peds[pednum].y - y));
+	hx = _tr->_vm->_gyro->peds[pednum].x - _info.xl / 2;
+	hy = _tr->_vm->_gyro->peds[pednum].y - _info.yl;
 	homing = true;
 }
 
@@ -347,10 +347,10 @@ void triptype::stopwalk() {
 }
 
 void triptype::chatter() {
-	_tr->_vm->_gyro.talkx = x + _info.xl / 2;
-	_tr->_vm->_gyro.talky = y;
-	_tr->_vm->_gyro.talkf = a.fgc;
-	_tr->_vm->_gyro.talkb = a.bgc;
+	_tr->_vm->_gyro->talkx = x + _info.xl / 2;
+	_tr->_vm->_gyro->talky = y;
+	_tr->_vm->_gyro->talkf = a.fgc;
+	_tr->_vm->_gyro->talkb = a.bgc;
 }
 
 void triptype::set_up_saver(trip_saver_type &v) {
@@ -535,8 +535,8 @@ void Trip::catamove(byte ped) {
 
 
 		
-	xy_uint16 = _vm->_gyro.dna.cat_x + _vm->_gyro.dna.cat_y * 256;
-	_vm->_gyro.dna.geida_spin = 0;
+	xy_uint16 = _vm->_gyro->dna.cat_x + _vm->_gyro->dna.cat_y * 256;
+	_vm->_gyro->dna.geida_spin = 0;
 		
 	switch (xy_uint16) {
 	case 1801: /* Exit catacombs */
@@ -553,78 +553,78 @@ void Trip::catamove(byte ped) {
 	case 2307:
 		fliproom(r__lusties, 5);
 		_vm->_scrolls.display("Oh no... here we go again...");
-		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_gyro->dna.user_moves_avvy = false;
 		tr[1].iy = 1;
 		tr[1].ix = 0;
 		return;
 	}
 
-	if (!_vm->_gyro.dna.enter_catacombs_from_lusties_room)
+	if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
 		_vm->_lucerna.load(29);
-	here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x];
+	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x];
 
 	switch (here & 0xf) { /* West. */
 	case 0: /* no connection (wall) */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(28);
 		break;
 	case 0x1: /* no connection (wall + shield), */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(29); /* ...shield. */
 		break;
 	case 0x2: /* wall with door */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door. */
 		break;
 	case 0x3: /* wall with door and shield */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(29); /* ...shield. */
 		break;
 	case 0x4: /* no connection (wall + window), */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(5);  /* ...window. */
 		break;
 	case 0x5: /* wall with door and window */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(5); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.nix; /* No door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* No door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(7); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
-		_vm->_gyro.magics[2].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[13].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(28); /* Wall, plus... */
 		_vm->_celer.show_one(30); /* ...door, and... */
 		_vm->_celer.show_one(7); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
-		_vm->_gyro.magics[2].op = _vm->_gyro.nix; /* Sloping wall. */
-		_vm->_gyro.magics[3].op = _vm->_gyro.special; /* Straight wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Sloping wall. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->special; /* Straight wall. */
 		break;
 	}
 
@@ -632,52 +632,52 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { /* East */
 	case 0: /* no connection (wall) */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(19);
 		break;
 	case 0x1: /* no connection (wall + window), */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(20); /* ...window. */
 		break;
 	case 0x2: /* wall with door */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(21); /* ...door. */
 		break;
 	case 0x3: /* wall with door and window */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(20); /* ...door, and... */
 		_vm->_celer.show_one(21); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* No door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* No door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(18); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
-		_vm->_gyro.magics[5].op = _vm->_gyro.bounces; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.nix; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer.show_one(19); /* Wall, plus... */
 		_vm->_celer.show_one(21); /* ...door, and... */
 		_vm->_celer.show_one(18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
-		_vm->_gyro.magics[5].op = _vm->_gyro.nix; /* Sloping wall. */
-		_vm->_gyro.magics[6].op = _vm->_gyro.special; /* Straight wall. */
-		_vm->_gyro.portals[15].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Sloping wall. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Straight wall. */
+		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
 		break;
 	}
 
@@ -685,75 +685,75 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf00) >> 8) { /* South */
 	case 0: /* No connection. */
-		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
-		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
-		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
+		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x1:
 		_vm->_celer.show_one(22);
 			
-		if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows))
-			_vm->_gyro.magics[13].op = _vm->_gyro.exclaim;
+		if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows))
+			_vm->_gyro->magics[13].op = _vm->_gyro->exclaim;
 		else
-			_vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
+			_vm->_gyro->magics[13].op = _vm->_gyro->special; /* Right exit south. */
 
-		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
-		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
+		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
 		_vm->_celer.show_one(23);
-		_vm->_gyro.magics[7].op = _vm->_gyro.special; /* Middle exit south. */
-		_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
-		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
+		_vm->_gyro->magics[7].op = _vm->_gyro->special; /* Middle exit south. */
+		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
 		_vm->_celer.show_one(24);
-		_vm->_gyro.magics[12].op = _vm->_gyro.special; /* Left exit south. */
-		_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
-		_vm->_gyro.magics[13].op = _vm->_gyro.bounces;
+		_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Left exit south. */
+		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { /* North */
 	case 0: /* No connection */
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
-		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
 		break;
 	// LEFT handles: 
 /*
 	case 0x1:
 		_vm->_celer.show_one(4);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x2:
 		_vm->_celer.show_one(4);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // Middle exit north.
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Middle exit north.
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // Door.
 		break;
 /*	case 0x3:
 		_vm->_celer.show_one(4);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. } { Change magic number! }
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 	// RIGHT handles:
 	case 0x4:
 		_vm->_celer.show_one(3);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x5:
 		_vm->_celer.show_one(3);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; /* Middle exit north. */
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Middle exit north. */
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
 		break;
 /*
 	case 0x6:
 		_vm->_celer.show_one(3);
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces; // { Right exit north. }
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; // { Door. }
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	// ARCHWAYS:
@@ -767,26 +767,26 @@ void Trip::catamove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer.show_one(32);
 
-		_vm->_gyro.magics[1].op = _vm->_gyro.special; /* Middle arch north. */
-		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->special; /* Middle arch north. */
+		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
 	}
 	break;
 	/* DECORATIONS: */
 	case 0xd: /* No connection + WINDOW */
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
-		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(14);
 		break;
 	case 0xe: /* No connection + TORCH */
-		_vm->_gyro.magics[1].op = _vm->_gyro.bounces;
-		_vm->_gyro.portals[12].op = _vm->_gyro.nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer.show_one(8);
 		break;
 	/* Recessed door: */
 	case 0xf:
-		_vm->_gyro.magics[1].op = _vm->_gyro.nix; /* Door to Geida's room. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Door to Geida's room. */
 		_vm->_celer.show_one(1);
-		_vm->_gyro.portals[12].op = _vm->_gyro.special; /* Door. */
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
 		break;
 	}
 
@@ -822,7 +822,7 @@ void Trip::catamove(byte ped) {
 		break; /* [1,1] : the other two. */
 	}
 
-	if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) {
+	if ((_vm->_gyro->dna.geida_follows) & (ped > 0)) {
 		triptype &with = tr[2];
 
 		if (!with.quick)  /* If we don't already have her... */
@@ -835,36 +835,36 @@ void Trip::catamove(byte ped) {
 
 	
 
-/* This proc gets called whenever you touch a line defined as _vm->_gyro.special. */
+/* This proc gets called whenever you touch a line defined as _vm->_gyro->special. */
 void Trip::dawndelay() {
 	_vm->_timeout.set_up_timer(2, _vm->_timeout.procdawn_delay, _vm->_timeout.reason_dawndelay);
 }
 
 void Trip::call_special(uint16 which) {
 	switch (which) {
-	case 1: /* _vm->_gyro.special 1: Room 22: top of stairs. */
+	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
 		_vm->_celer.show_one(1);
-		_vm->_gyro.dna.brummie_stairs = 1;
-		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
+		_vm->_gyro->dna.brummie_stairs = 1;
+		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		_vm->_timeout.set_up_timer(10, _vm->_timeout.procstairs, _vm->_timeout.reason_brummiestairs);
 		stopwalking();
-		_vm->_gyro.dna.user_moves_avvy = false;
-		break;
-	case 2: /* _vm->_gyro.special 2: Room 22: bottom of stairs. */
-		_vm->_gyro.dna.brummie_stairs = 3;
-		_vm->_gyro.magics[11].op = _vm->_gyro.nix;
-		_vm->_gyro.magics[12].op = _vm->_gyro.exclaim;
-		_vm->_gyro.magics[12].data = 5;
-		_vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Now works as planned! */
+		_vm->_gyro->dna.user_moves_avvy = false;
+		break;
+	case 2: /* _vm->_gyro->special 2: Room 22: bottom of stairs. */
+		_vm->_gyro->dna.brummie_stairs = 3;
+		_vm->_gyro->magics[11].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
+		_vm->_gyro->magics[12].data = 5;
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Now works as planned! */
 		stopwalking();
 		_vm->_visa.dixi('q', 26);
-		_vm->_gyro.dna.user_moves_avvy = true;
+		_vm->_gyro->dna.user_moves_avvy = true;
 		break;
-	case 3: /* _vm->_gyro.special 3: Room 71: triggers dart. */
+	case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */
 		tr[1].bounce(); /* Must include that. */
 
-		if (!_vm->_gyro.dna.arrow_triggered) {
-			_vm->_gyro.dna.arrow_triggered = true;
+		if (!_vm->_gyro->dna.arrow_triggered) {
+			_vm->_gyro->dna.arrow_triggered = true;
 			apped(2, 4); /* The dart starts at ped 4, and... */
 			tr[2].walkto(5); /* flies to ped 5. */
 			tr[2].face = 0; /* Only face. */
@@ -883,33 +883,33 @@ void Trip::call_special(uint16 which) {
 		_vm->_enid.back_to_bootstrap(3);
 		break;
 	case 5:
-		if (_vm->_gyro.dna.friar_will_tie_you_up) {
-			/* _vm->_gyro.special 5: Room 42: touched tree, and get tied up. */
-			_vm->_gyro.magics[4].op = _vm->_gyro.bounces; /* Boundary effect is now working again. */
+		if (_vm->_gyro->dna.friar_will_tie_you_up) {
+			/* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */
+			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */
 			_vm->_visa.dixi('q', 35);
 			tr[1].done();
 			/*tr[1].vanishifstill:=true;*/
 			_vm->_celer.show_one(2);
 			_vm->_visa.dixi('q', 36);
-			_vm->_gyro.dna.tied_up = true;
-			_vm->_gyro.dna.friar_will_tie_you_up = false;
+			_vm->_gyro->dna.tied_up = true;
+			_vm->_gyro->dna.friar_will_tie_you_up = false;
 			tr[2].walkto(3);
 			tr[2].vanishifstill = true;
 			tr[2].check_me = true; /* One of them must have Check_Me switched on. */
-			_vm->_gyro.whereis[_vm->_gyro.pfriartuck] = 177; /* Not here, then. */
+			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 177; /* Not here, then. */
 			_vm->_timeout.set_up_timer(364, _vm->_timeout.prochang_around, _vm->_timeout.reason_hanging_around);
 		}
 		break;
-	case 6: /* _vm->_gyro.special 6: fall down oubliette. */
-		_vm->_gyro.dna.user_moves_avvy = false;
+	case 6: /* _vm->_gyro->special 6: fall down oubliette. */
+		_vm->_gyro->dna.user_moves_avvy = false;
 		tr[1].ix = 3;
 		tr[1].iy = 0;
 		tr[1].face = right;
 		_vm->_timeout.set_up_timer(1, _vm->_timeout.procfall_down_oubliette, _vm->_timeout.reason_falling_down_oubliette);
 		break;
-	case 7: /* _vm->_gyro.special 7: stop falling down oubliette. */
+	case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */
 		tr[1].visible = false;
-		_vm->_gyro.magics[10].op = _vm->_gyro.nix;
+		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout.lose_timer(_vm->_timeout.reason_falling_down_oubliette);
 		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 0);
@@ -917,8 +917,8 @@ void Trip::call_special(uint16 which) {
 		_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
 		break;
-	case 8:        /* _vm->_gyro.special 8: leave du Lustie's room. */
-		if ((_vm->_gyro.dna.geida_follows) && (!_vm->_gyro.dna.lustie_is_asleep)) {
+	case 8:        /* _vm->_gyro->special 8: leave du Lustie's room. */
+		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
 			_vm->_visa.dixi('q', 63);
 			tr[2].turn(down);
 			tr[2].stopwalk();
@@ -926,19 +926,19 @@ void Trip::call_special(uint16 which) {
 			_vm->_lucerna.gameover();
 		}
 		break;
-	case 9: /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
-		if (!_vm->_gyro.dna.geida_follows)
+	case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */
+		if (!_vm->_gyro->dna.geida_follows)
 			return;   /* DOESN'T COUNT: no Geida. */
 		tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
 		tr[2].walkto(4); /* She walks to somewhere... */
 		tr[1].done();     /* Lose Avvy. */
-		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_timeout.set_up_timer(40, _vm->_timeout.procrobin_hood_and_geida, _vm->_timeout.reason_robin_hood_and_geida);
 		break;
-	case 10: /* _vm->_gyro.special 10: transfer north in catacombs. */
-		if ((_vm->_gyro.dna.cat_x == 4) && (_vm->_gyro.dna.cat_y == 1)) {
+	case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */
+		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
 			/* Into Geida's room. */
-			if (_vm->_gyro.dna.obj[_vm->_gyro.key])
+			if (_vm->_gyro->dna.obj[_vm->_gyro->key])
 				_vm->_visa.dixi('q', 62);
 			else {
 				_vm->_visa.dixi('q', 61);
@@ -946,12 +946,12 @@ void Trip::call_special(uint16 which) {
 			}
 		}
 		_vm->_lucerna.dusk();
-		_vm->_gyro.dna.cat_y -= 1;
+		_vm->_gyro->dna.cat_y -= 1;
 		catamove(4);
-		if (_vm->_gyro.dna.room != r__catacombs)
+		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna.delavvy();
-		switch ((_vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x] & 0xf00) >> 8) {
+		switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
 			break;
@@ -964,33 +964,33 @@ void Trip::call_special(uint16 which) {
 		getback();
 		dawndelay();
 		break;
-	case 11: /* _vm->_gyro.special 11: transfer east in catacombs. */
+	case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */
 		_vm->_lucerna.dusk();
-		_vm->_gyro.dna.cat_x += 1;
+		_vm->_gyro->dna.cat_x += 1;
 		catamove(1);
-		if (_vm->_gyro.dna.room != r__catacombs)
+		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 1);
 		getback();
 		dawndelay();
 		break;
-	case 12: /* _vm->_gyro.special 12: transfer south in catacombs. */
+	case 12: /* _vm->_gyro->special 12: transfer south in catacombs. */
 		_vm->_lucerna.dusk();
-		_vm->_gyro.dna.cat_y += 1;
+		_vm->_gyro->dna.cat_y += 1;
 		catamove(2);
-		if (_vm->_gyro.dna.room != r__catacombs)
+		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 2);
 		getback();
 		dawndelay();
 		break;
-	case 13: /* _vm->_gyro.special 13: transfer west in catacombs. */
+	case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */
 		_vm->_lucerna.dusk();
-		_vm->_gyro.dna.cat_x -= 1;
+		_vm->_gyro->dna.cat_x -= 1;
 		catamove(3);
-		if (_vm->_gyro.dna.room != r__catacombs)
+		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna.delavvy();
 		apped(1, 3);
@@ -1006,7 +1006,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 /* This slides the door open. (The data really ought to be saved in
 	the Also file, and will be next time. However, for now, they're
 	here.) */
-	switch (_vm->_gyro.dna.room) {
+	switch (_vm->_gyro->dna.room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
 	case r__outsideducks:
@@ -1032,7 +1032,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
-			if (_vm->_gyro.dna.avvys_in_the_cupboard) {
+			if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 				hide_in_the_cupboard();
 				_vm->_sequence.first_show(8);
 				_vm->_sequence.then_show(7);
@@ -1094,8 +1094,8 @@ void Trip::rwsp(byte t, byte r) {
 }
 
 void Trip::apped(byte trn, byte np) {
-	tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro.peds[np].dir);
-	rwsp(trn, _vm->_gyro.peds[np].dir);
+	tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
+	rwsp(trn, _vm->_gyro->peds[np].dir);
 }
 
 
@@ -1104,12 +1104,12 @@ void Trip::apped(byte trn, byte np) {
 	begin { By De Morgan's law: }
 	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
 	end;*/
-/* x1,x2 - as _vm->_gyro.bytefield, but *8. y1,y2 - as _vm->_gyro.bytefield.
+/* x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
 	x3,y3 = mx,my. x4,y4 = mx+16,my+16. */
 bool Trip::overlaps_with_mouse() {
 	bool overlaps_with_mouse_result;
 	overlaps_with_mouse_result =
-		(r.x2 * 8 >= _vm->_gyro.mx) && (_vm->_gyro.mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro.my) && (_vm->_gyro.my + 16 >= r.y1);
+		(r.x2 * 8 >= _vm->_gyro->mx) && (_vm->_gyro->mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro->my) && (_vm->_gyro->my + 16 >= r.y1);
 	return overlaps_with_mouse_result;
 }
 
@@ -1121,8 +1121,8 @@ void Trip::getback() {
 	endangered = false;
 	/* Super_Off;*/
 
-	while (getset[1 - _vm->_gyro.cp].numleft > 0) {
-		getset[1 - _vm->_gyro.cp].recall(r);
+	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
+		getset[1 - _vm->_gyro->cp].recall(r);
 
 		/*
 		if overlaps_with_mouse and not endangered then
@@ -1133,7 +1133,7 @@ void Trip::getback() {
 			end;
 		*/
 
-		_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
+		_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}
 
 	_vm->_lucerna.blitfix();
@@ -1213,13 +1213,13 @@ void Trip::arrow_procs(byte tripnum) {
 
 			_vm->_lucerna.gameover();
 
-			_vm->_gyro.dna.user_moves_avvy = false; /* Stop the user from moving him. */
+			_vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */
 			_vm->_timeout.set_up_timer(55, _vm->_timeout.procnaughty_duke, _vm->_timeout.reason_naughty_duke);
 		}
 	} else { /* Arrow has hit the wall! */
 		tr[tripnum].done(); /* Deallocate the arrow. */
 		_vm->_celer.show_one(3); /* Show pic of arrow stuck into the door. */
-		_vm->_gyro.dna.arrow_in_the_door = true; /* So that we can pick it up. */
+		_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
 	}
 		
 }
@@ -1230,7 +1230,7 @@ begin
 	with tr[tripnum] do
 	if not homing then { We only need to do anything if Spludwick *stops*
 						walking. }
-	with _vm->_gyro.dna do
+	with _vm->_gyro->dna do
 	begin
 	inc(DogfoodPos);
 	if DogfoodPos=8 then DogfoodPos:=1;
@@ -1279,21 +1279,21 @@ void Trip::spin(byte whichway, byte &tripnum) {
 		if (tr[tripnum].whichsprite == 2)
 			return; /* Not for Spludwick */
 
-		_vm->_gyro.dna.geida_spin += 1;
-		_vm->_gyro.dna.geida_time = 20;
-		if (_vm->_gyro.dna.geida_spin == 5) {
+		_vm->_gyro->dna.geida_spin += 1;
+		_vm->_gyro->dna.geida_time = 20;
+		if (_vm->_gyro->dna.geida_spin == 5) {
 			_vm->_scrolls.display("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_gyro.dna.geida_spin = 0;
-			_vm->_gyro.dna.geida_time = 0; /* knock out records */
+			_vm->_gyro->dna.geida_spin = 0;
+			_vm->_gyro->dna.geida_time = 0; /* knock out records */
 		}
 	}
 }
 
 void Trip::geida_procs(byte tripnum) {
-	if (_vm->_gyro.dna.geida_time > 0) {
-		_vm->_gyro.dna.geida_time -= 1;
-		if (_vm->_gyro.dna.geida_time == 0)
-			_vm->_gyro.dna.geida_spin = 0;
+	if (_vm->_gyro->dna.geida_time > 0) {
+		_vm->_gyro->dna.geida_time -= 1;
+		if (_vm->_gyro->dna.geida_time == 0)
+			_vm->_gyro->dna.geida_spin = 0;
 	}
 
 	if (tr[tripnum].y < (tr[1].y - 2)) {
@@ -1363,7 +1363,7 @@ void Trip::call_andexors() {
 void Trip::trippancy_link() {
 	byte fv;
 
-	if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)
+	if (_vm->_gyro->ddmnow | _vm->_gyro->ontoolbar | _vm->_gyro->seescroll)
 		return;
 	for (fv = 1; fv <= numtr; fv++) {
 		if (tr[fv].quick)
@@ -1418,71 +1418,71 @@ void Trip::get_back_loretta() {
 
 void Trip::stopwalking() {
 	tr[1].stopwalk();
-	_vm->_gyro.dna.rw = stopped;
-	if (_vm->_gyro.alive)
+	_vm->_gyro->dna.rw = stopped;
+	if (_vm->_gyro->alive)
 		tr[1].step = 1;
 }
 
 void Trip::tripkey(char dir) {
-	if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
+	if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy))
 		return;
 
 	triptype &with = tr[1];
 
 	switch (dir) {
 	case 'H':
-		if (_vm->_gyro.dna.rw != up) {
-			_vm->_gyro.dna.rw = up;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != up) {
+			_vm->_gyro->dna.rw = up;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'P':
-		if (_vm->_gyro.dna.rw != down) {
-			_vm->_gyro.dna.rw = down;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != down) {
+			_vm->_gyro->dna.rw = down;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'K':
-		if (_vm->_gyro.dna.rw != left) {
-			_vm->_gyro.dna.rw = left;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != left) {
+			_vm->_gyro->dna.rw = left;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'M':
-		if (_vm->_gyro.dna.rw != right) {
-			_vm->_gyro.dna.rw = right;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != right) {
+			_vm->_gyro->dna.rw = right;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'I':
-		if (_vm->_gyro.dna.rw != ur) {
-			_vm->_gyro.dna.rw = ur;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != ur) {
+			_vm->_gyro->dna.rw = ur;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'Q':
-		if (_vm->_gyro.dna.rw != dr) {
-			_vm->_gyro.dna.rw = dr;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != dr) {
+			_vm->_gyro->dna.rw = dr;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'O':
-		if (_vm->_gyro.dna.rw != dl) {
-			_vm->_gyro.dna.rw = dl;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != dl) {
+			_vm->_gyro->dna.rw = dl;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case 'G':
-		if (_vm->_gyro.dna.rw != ul) {
-			_vm->_gyro.dna.rw = ul;
-			rwsp(1, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != ul) {
+			_vm->_gyro->dna.rw = ul;
+			rwsp(1, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
@@ -1504,15 +1504,15 @@ void Trip::getsetclear() {
 void Trip::hide_in_the_cupboard() {
 	const char nowt = 250; /* As in Acci. */
 
-	if (_vm->_gyro.dna.avvys_in_the_cupboard) {
-		if (_vm->_gyro.dna.wearing == nowt)
+	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
+		if (_vm->_gyro->dna.wearing == nowt)
 			_vm->_scrolls.display("\6AVVY!\22 Get dressed first!");
 		else {
 			tr[1].visible = true;
-			_vm->_gyro.dna.user_moves_avvy = true;
+			_vm->_gyro->dna.user_moves_avvy = true;
 			apped(1, 3); /* Walk out of the cupboard. */
 			_vm->_scrolls.display("You leave the cupboard. Nice to be out of there!");
-			_vm->_gyro.dna.avvys_in_the_cupboard = false;
+			_vm->_gyro->dna.avvys_in_the_cupboard = false;
 			_vm->_sequence.first_show(8);
 			_vm->_sequence.then_show(7);
 			_vm->_sequence.start_to_close();
@@ -1520,11 +1520,11 @@ void Trip::hide_in_the_cupboard() {
 	} else {
 		/* Not hiding in the cupboard */
 		tr[1].visible = false;
-		_vm->_gyro.dna.user_moves_avvy = false;
+		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_scrolls.display(Common::String("You walk into the room...\20It seems to be an empty, ") +
 				"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
 				"avoid suffocation.");
-		_vm->_gyro.dna.avvys_in_the_cupboard = true;
+		_vm->_gyro->dna.avvys_in_the_cupboard = true;
 		_vm->_celer.show_one(8);
 	}
 }
@@ -1535,36 +1535,36 @@ void Trip::tidy_up(int16 a, int16 b, int16 c, int16 d) {
 
 void Trip::tidy_after_mouse() {
 	tidy_up(beforex, beforey, beforex + 15, beforey + 15);
-	_vm->_gyro.xycheck();
-	tidy_up(_vm->_gyro.mx, _vm->_gyro.my, _vm->_gyro.mx + 15, _vm->_gyro.my + 15);
+	_vm->_gyro->xycheck();
+	tidy_up(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->mx + 15, _vm->_gyro->my + 15);
 }
 
 void Trip::fliproom(byte room, byte ped) {
 	byte fv;
 
-	if (!_vm->_gyro.alive) {
+	if (!_vm->_gyro->alive) {
 		/* You can't leave the room if you're dead. */
 		tr[1].ix = 0;
 		tr[1].iy = 0; /* Stop him from moving. */
 		return;
 	}
 
-	if ((ped == 177) && (_vm->_gyro.dna.room == r__lusties)) {
+	if ((ped == 177) && (_vm->_gyro->dna.room == r__lusties)) {
 		hide_in_the_cupboard();
 		return;
 	}
 
-	if ((_vm->_gyro.dna.jumpstatus > 0) && (_vm->_gyro.dna.room == r__insidecardiffcastle)) {
+	if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) {
 		/* You can't *jump* out of Cardiff Castle! */
 		tr[1].ix = 0;
 		return;
 	}
 
-	_vm->_gyro.xycheck();
-	beforex = _vm->_gyro.mx;
-	beforey = _vm->_gyro.my;
+	_vm->_gyro->xycheck();
+	beforex = _vm->_gyro->mx;
+	beforey = _vm->_gyro->my;
 
-	_vm->_lucerna.exitroom(_vm->_gyro.dna.room);
+	_vm->_lucerna.exitroom(_vm->_gyro->dna.room);
 	_vm->_lucerna.dusk();
 	getsetclear();
 
@@ -1574,18 +1574,18 @@ void Trip::fliproom(byte room, byte ped) {
 			tr[fv].done();
 	} /* Deallocate sprite */
 
-	if (_vm->_gyro.dna.room == r__lustiesroom)
-		_vm->_gyro.dna.enter_catacombs_from_lusties_room = true;
+	if (_vm->_gyro->dna.room == r__lustiesroom)
+		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
 
 	_vm->_lucerna.enterroom(room, ped);
 	apped(1, ped);
-	_vm->_gyro.dna.enter_catacombs_from_lusties_room = false;
-	_vm->_gyro.oldrw = _vm->_gyro.dna.rw;
-	_vm->_gyro.dna.rw = tr[1].face;
+	_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
+	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
+	_vm->_gyro->dna.rw = tr[1].face;
 	_vm->_lucerna.showrw();
 
 	for (fv = 0; fv <= 1; fv++) {
-		_vm->_gyro.cp = 1 - _vm->_gyro.cp;
+		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
 		getback();
 	}
 	_vm->_lucerna.dawn();
@@ -1598,8 +1598,8 @@ bool Trip::infield(byte which) {
 /* returns True if you're within field "which" */
 	int16 yy = tr[1].y + tr[1]._info.yl;
 
-	return (tr[1].x >= _vm->_gyro.fields[which].x1) && (tr[1].x <= _vm->_gyro.fields[which].x2)
-		&& (yy >= _vm->_gyro.fields[which].y1) && (yy <= _vm->_gyro.fields[which].y2);
+	return (tr[1].x >= _vm->_gyro->fields[which].x1) && (tr[1].x <= _vm->_gyro->fields[which].x2)
+		&& (yy >= _vm->_gyro->fields[which].y1) && (yy <= _vm->_gyro->fields[which].y2);
 
 }
 
@@ -1609,7 +1609,7 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 	bool nd;
 
 	bool neardoor_result;
-	if (_vm->_gyro.numfields < 9) {
+	if (_vm->_gyro->numfields < 9) {
 		/* there ARE no doors here! */
 		neardoor_result = false;
 		return neardoor_result;
@@ -1619,11 +1619,11 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 	uy = tr[1].y + tr[1]._info.yl;
 		
 	nd = false;
-	for (fv = 9; fv <= _vm->_gyro.numfields; fv++) {
-		_vm->_gyro.fields[fv];
+	for (fv = 9; fv <= _vm->_gyro->numfields; fv++) {
+		_vm->_gyro->fields[fv];
 
-		if ((ux >= _vm->_gyro.fields[fv].x1) && (ux <= _vm->_gyro.fields[fv].x2)
-			&& (uy >= _vm->_gyro.fields[fv].y1) && (uy <= _vm->_gyro.fields[fv].y2)) 
+		if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
+			&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2)) 
 			nd = true;
 	}
 	return nd;
@@ -1636,65 +1636,65 @@ void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
 
 
 void Trip::handleMoveKey(const Common::Event &event) { 
-	//if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
+	//if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy))
 	//	return;
 	//	
 	// We don't mess around with the joystick.
 	
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_UP:
-		if (_vm->_gyro.dna.rw != up) {
-			_vm->_gyro.dna.rw = up;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != up) {
+			_vm->_gyro->dna.rw = up;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_DOWN:
-		if (_vm->_gyro.dna.rw != down) {
-			_vm->_gyro.dna.rw = down;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != down) {
+			_vm->_gyro->dna.rw = down;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_LEFT:
-		if (_vm->_gyro.dna.rw != left) {
-			_vm->_gyro.dna.rw = left;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != left) {
+			_vm->_gyro->dna.rw = left;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_RIGHT:
-		if (_vm->_gyro.dna.rw != right) {
-			_vm->_gyro.dna.rw = right;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != right) {
+			_vm->_gyro->dna.rw = right;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_PAGEUP:
-		if (_vm->_gyro.dna.rw != ur) {
-			_vm->_gyro.dna.rw = ur;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != ur) {
+			_vm->_gyro->dna.rw = ur;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_PAGEDOWN:
-		if (_vm->_gyro.dna.rw != dr) {
-			_vm->_gyro.dna.rw = dr;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != dr) {
+			_vm->_gyro->dna.rw = dr;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_END:
-		if (_vm->_gyro.dna.rw != dl) {
-			_vm->_gyro.dna.rw = dl;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != dl) {
+			_vm->_gyro->dna.rw = dl;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
 	case Common::KEYCODE_HOME:
-		if (_vm->_gyro.dna.rw != ul) {
-			_vm->_gyro.dna.rw = ul;
-			rwsp(0, _vm->_gyro.dna.rw);
+		if (_vm->_gyro->dna.rw != ul) {
+			_vm->_gyro->dna.rw = ul;
+			rwsp(0, _vm->_gyro->dna.rw);
 		} else
 			stopwalking();
 		break;
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index ea5144f..9359595 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -49,13 +49,13 @@ namespace Avalanche {
 	bool Visa::report_dixi_errors = true;
 
 	void Visa::unskrimble() {
-		for (uint16  fv = 0; fv < _vm->_gyro.bufsize; fv++) 
-			_vm->_gyro.buffer[fv] = (char)((!(_vm->_gyro.buffer[fv]) - fv) % 256);
+		for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
+			_vm->_gyro->buffer[fv] = (char)((!(_vm->_gyro->buffer[fv]) - fv) % 256);
 	}
 
 	void Visa::do_the_bubble() {
-		_vm->_gyro.bufsize++;
-		_vm->_gyro.buffer[_vm->_gyro.bufsize] = 2;
+		_vm->_gyro->bufsize++;
+		_vm->_gyro->buffer[_vm->_gyro->bufsize] = 2;
 	}
 
 	void Visa::dixi(char block, byte point) {
@@ -85,7 +85,7 @@ namespace Avalanche {
 		if (error) {
 			if (report_dixi_errors) {
 				Common::String todisplay;
-				todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro.strf(point).c_str());
+				todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
 				_vm->_scrolls.display(todisplay);
 			}
 			return;
@@ -96,8 +96,8 @@ namespace Avalanche {
 			return;
 		}
 		sezfile.seek(sez_offset);
-		_vm->_gyro.bufsize = sezfile.readUint16LE();
-		sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize);
+		_vm->_gyro->bufsize = sezfile.readUint16LE();
+		sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
 		sezfile.close();
 		unskrimble();
 
@@ -145,8 +145,8 @@ namespace Avalanche {
 				return;
 			}
 			sezfile.seek(sez_offset);
-			_vm->_gyro.bufsize = sezfile.readUint16LE();
-			sezfile.read(_vm->_gyro.buffer, _vm->_gyro.bufsize);
+			_vm->_gyro->bufsize = sezfile.readUint16LE();
+			sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
 			sezfile.close();
 
 			unskrimble();


Commit: ca51bf19c9dae1474ffacfb1a40f955972c368a8
    https://github.com/scummvm/scummvm/commit/ca51bf19c9dae1474ffacfb1a40f955972c368a8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:42:41-07:00

Commit Message:
AVALANCHE: Change _timeout into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 5e2fb23f..d9180f4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -622,7 +622,7 @@ void Acci::not_in_order() {
 
 void Acci::go_to_cauldron() {
 	_vm->_trip.tr[2].call_eachstep = false; /* Stops Geida_Procs. */
-	_vm->_timeout.set_up_timer(1, _vm->_timeout.procspludwick_goes_to_cauldron, _vm->_timeout.reason_spludwalk);
+	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
 	_vm->_trip.tr[2].walkto(2);
 }
 
@@ -726,7 +726,7 @@ void Acci::stand_up() {
 			_vm->_celer.show_one(4); /* Picture of empty pillow. */
 			_vm->_lucerna.points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
-			_vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts);
+			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
 		} else
 			already();
 		break;
@@ -824,7 +824,7 @@ void Acci::give_geida_the_lute() {
 
 	/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
 
-	_vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
+	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
 	_vm->_enid.back_to_bootstrap(4);
 }
 
@@ -841,7 +841,7 @@ void Acci::winsequence() {
 	_vm->_sequence.then_show(8);
 	_vm->_sequence.then_show(9);
 	_vm->_sequence.start_to_close();
-	_vm->_timeout.set_up_timer(30, _vm->_timeout.procwinning, _vm->_timeout.reason_winning);
+	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning);
 }
 
 void Acci::person_speaks() {
@@ -1250,7 +1250,7 @@ void Acci::do_that() {
 	case vb_pee:
 		if (_vm->_gyro->flagset('P')) {
 			_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
-			_vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet);
+			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
 		} else
 			_vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
 		break;
@@ -1274,7 +1274,7 @@ void Acci::do_that() {
 					_vm->_trip.tr[2].call_eachstep = true;
 					_vm->_trip.tr[2].eachstep = _vm->_trip.procback_and_forth;
 					_vm->_gyro->dna.avaricius_talk = 14;
-					_vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks);
+					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
 			} else
 				_vm->_scrolls.display("Nothing appears to happen...");
@@ -1339,7 +1339,7 @@ void Acci::do_that() {
 
 					_vm->_celer.show_one(10);
 					_vm->_gyro->dna.malagauche = 177;
-					_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks);
+					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
 				case '\64':
 					examine();
@@ -1365,7 +1365,7 @@ void Acci::do_that() {
 						_vm->_celer.show_one(10);
 						_vm->_gyro->dna.malagauche = 177;
 
-						_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuywine, _vm->_timeout.reason_drinks);
+						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
 					}
 					break;
 				}
@@ -1465,7 +1465,7 @@ void Acci::do_that() {
 				else {
 					_vm->_lucerna.points(4);
 					_vm->_scrolls.display("The drawbridge opens!");
-					_vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls);
+					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
 					_vm->_gyro->dna.drawbridge_open = 1;
 				}
 			} else
@@ -1520,7 +1520,7 @@ void Acci::do_that() {
 		break;
 
 	case vb_jump:
-		_vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
 
@@ -1564,7 +1564,7 @@ void Acci::do_that() {
 				_vm->_scrolls.display("You're already sitting!");
 			else {
 				_vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */
-				_vm->_timeout.set_up_timer(1, _vm->_timeout.procavvy_sit_down, _vm->_timeout.reason_sitting_down);
+				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
 			}
 		} else {
 			/* Default doodah. */
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d5187f1..27dd779 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -60,6 +60,7 @@ AvalancheEngine::~AvalancheEngine() {
 
 	delete _avalot;
 	delete _gyro;
+	delete _timeout;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
@@ -76,7 +77,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_enid.setParent(this);
 	_celer.setParent(this);
 	_sequence.setParent(this);
-	_timeout.setParent(this);
+	_timeout = new Timeout(this);
 	_trip.setParent(this);
 	_acci.setParent(this);
 	_basher.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 49c02ff..e9de899 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -78,7 +78,7 @@ public:
 	Enid _enid;
 	Celer _celer;
 	Sequence _sequence;
-	Timeout _timeout;
+	Timeout *_timeout;
 	Trip _trip;
 	Acci _acci;
 	Basher _basher;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6ce6348..856d8b8 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -197,7 +197,7 @@ void Avalot::run(Common::String arg) {
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
 			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
 
-		_vm->_timeout.one_tick();
+		//_vm->_timeout->one_tick();
 
 
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f269008..5034e13 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -312,21 +312,21 @@ void Lucerna::exitroom(byte x) {
 
 	switch (x) {
 	case r__spludwicks:
-		_vm->_timeout.lose_timer(_vm->_timeout.reason_avariciustalks);
+		_vm->_timeout->lose_timer(_vm->_timeout->reason_avariciustalks);
 		 _vm->_gyro->dna.avaricius_talk = 0;
 		/* He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. */       
 		break;
 	case r__bridge:
 		if (_vm->_gyro->dna.drawbridge_open > 0) {
 			_vm->_gyro->dna.drawbridge_open = 4; /* Fully open. */
-			_vm->_timeout.lose_timer(_vm->_timeout.reason_drawbridgefalls);
+			_vm->_timeout->lose_timer(_vm->_timeout->reason_drawbridgefalls);
 		}
 		break;
 	case r__outsidecardiffcastle:
-		_vm->_timeout.lose_timer(_vm->_timeout.reason_cardiffsurvey);
+		_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey);
 		break;
 	case r__robins:
-		_vm->_timeout.lose_timer(_vm->_timeout.reason_getting_tied_up);
+		_vm->_timeout->lose_timer(_vm->_timeout->reason_getting_tied_up);
 		break;
 	}
 
@@ -406,7 +406,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__yours:
 		if (_vm->_gyro->dna.avvy_in_bed) {
 			_vm->_celer.show_one(3);
-			_vm->_timeout.set_up_timer(100, _vm->_timeout.procarkata_shouts, _vm->_timeout.reason_arkata_shouts);
+			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
 		}
 		break;
 
@@ -434,7 +434,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip.tr[2].init(8, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
 				_vm->_trip.tr[2].walkto(4);
-				_vm->_timeout.set_up_timer(20, _vm->_timeout.proccrapulus_splud_out, _vm->_timeout.reason_crapulus_says_spludwick_out);
+				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
 				_vm->_gyro->dna.crapulus_will_tell = false;
 			}
 		}
@@ -444,7 +444,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	 
 	 case r__outsidespludwicks:
 		if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
-			_vm->_timeout.set_up_timer(20, _vm->_timeout.procbang, _vm->_timeout.reason_explosion);
+			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->reason_explosion);
 			_vm->_gyro->dna.spludwicks_here = true;
 		}
 		break;*/
@@ -499,7 +499,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_trip.tr[2].vanishifstill = true;
 			with.cwytalot_in_herts = true;
 			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
-			_vm->_timeout.set_up_timer(20, _vm->_timeout.proc_cwytalot_in_herts, _vm->_timeout.reason_cwytalot_in_herts);
+			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
 		}
 	}
 	break;
@@ -520,7 +520,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip.tr[2].init(6, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
 				_vm->_trip.tr[2].walkto(3);
-				_vm->_timeout.set_up_timer(36, _vm->_timeout.procget_tied_up, _vm->_timeout.reason_getting_tied_up);
+				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
 			}
 		}
 
@@ -544,7 +544,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
 				_vm->_trip.apped(2, 2);
 				_vm->_trip.tr[2].walkto(3);
-				_vm->_timeout.set_up_timer(47, _vm->_timeout.proccardiffsurvey, _vm->_timeout.reason_cardiffsurvey);
+				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
 			}
 			break;
 			case 5 :
@@ -554,7 +554,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
 				_vm->_trip.apped(2, 3);
 				_vm->_trip.tr[2].face = _vm->_trip.right;
-				_vm->_timeout.set_up_timer(3, _vm->_timeout.proccardiff_return, _vm->_timeout.reason_cardiffsurvey);
+				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
 		if (_vm->_gyro->dna.cardiff_things < 5)
@@ -586,10 +586,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__lustiesroom: {
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 		if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */
-			_vm->_timeout.set_up_timer(3, _vm->_timeout.proccallsguards, _vm->_timeout.reason_du_lustie_talks);
+			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
 		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
 			/* Presumably, Avvy dressed as a monk. */
-			_vm->_timeout.set_up_timer(3, _vm->_timeout.procgreetsmonk, _vm->_timeout.reason_du_lustie_talks);
+			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
 		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(5, ped);
@@ -1231,7 +1231,7 @@ void Lucerna::gameover() {
 	_vm->_trip.tr[1].step = 0;
 	_vm->_trip.tr[1].appear(sx, sy, 0);
 	
-	_vm->_timeout.set_up_timer(3, _vm->_timeout.procavalot_falls, _vm->_timeout.reason_falling_over);
+	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
 	/* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
 	_vm->_gyro->alive = false;
 }
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 61198d2..5edb00a 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -71,8 +71,8 @@ void Sequence::then_flip(byte where, byte ped) {
 }
 
 void Sequence::start_to_close() {
-	_vm->_timeout.lose_timer(_vm->_timeout.reason_sequencer);
-	_vm->_timeout.set_up_timer(7, _vm->_timeout.procsequence, _vm->_timeout.reason_sequencer);
+	_vm->_timeout->lose_timer(_vm->_timeout->reason_sequencer);
+	_vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->reason_sequencer);
 }
 
 void Sequence::start_to_open() {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index b10c1c1..420469f 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -46,7 +46,9 @@
 
 namespace Avalanche {
 
-Timeout::Timeout() {
+Timeout::Timeout(AvalancheEngine *vm) {
+	_vm = vm;
+
 	for (int i = 0; i < sizeof(times); i++) {
 		times[i].time_left = 0;
 		times[i].then_where = 0;
@@ -54,10 +56,6 @@ Timeout::Timeout() {
 	}
 }
 
-void Timeout::setParent(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
 void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
 	fv = 1;
 	while ((fv < 8) && (times[fv].time_left != 0))
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 07a48d6..d315d59 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -164,7 +164,7 @@ public:
 	
 
 	
-	Timeout();
+	Timeout(AvalancheEngine *vm);
 
 	void setParent(AvalancheEngine *vm);
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 00fac65..492c6bf 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -837,7 +837,7 @@ void Trip::catamove(byte ped) {
 
 /* This proc gets called whenever you touch a line defined as _vm->_gyro->special. */
 void Trip::dawndelay() {
-	_vm->_timeout.set_up_timer(2, _vm->_timeout.procdawn_delay, _vm->_timeout.reason_dawndelay);
+	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->reason_dawndelay);
 }
 
 void Trip::call_special(uint16 which) {
@@ -846,7 +846,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_celer.show_one(1);
 		_vm->_gyro->dna.brummie_stairs = 1;
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
-		_vm->_timeout.set_up_timer(10, _vm->_timeout.procstairs, _vm->_timeout.reason_brummiestairs);
+		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
 		stopwalking();
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
@@ -879,7 +879,7 @@ void Trip::call_special(uint16 which) {
 	case 4: /* This is the ghost room link. */
 		_vm->_lucerna.dusk();
 		tr[1].turn(right); /* you'll see this after we get back from bootstrap */
-		_vm->_timeout.set_up_timer(1, _vm->_timeout.procghost_room_phew, _vm->_timeout.reason_ghost_room_phew);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
 		_vm->_enid.back_to_bootstrap(3);
 		break;
 	case 5:
@@ -897,7 +897,7 @@ void Trip::call_special(uint16 which) {
 			tr[2].vanishifstill = true;
 			tr[2].check_me = true; /* One of them must have Check_Me switched on. */
 			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 177; /* Not here, then. */
-			_vm->_timeout.set_up_timer(364, _vm->_timeout.prochang_around, _vm->_timeout.reason_hanging_around);
+			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
 	case 6: /* _vm->_gyro->special 6: fall down oubliette. */
@@ -905,17 +905,17 @@ void Trip::call_special(uint16 which) {
 		tr[1].ix = 3;
 		tr[1].iy = 0;
 		tr[1].face = right;
-		_vm->_timeout.set_up_timer(1, _vm->_timeout.procfall_down_oubliette, _vm->_timeout.reason_falling_down_oubliette);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
 		break;
 	case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */
 		tr[1].visible = false;
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		stopwalking();
-		_vm->_timeout.lose_timer(_vm->_timeout.reason_falling_down_oubliette);
+		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 0);
 		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
+		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
 	case 8:        /* _vm->_gyro->special 8: leave du Lustie's room. */
 		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
@@ -933,7 +933,7 @@ void Trip::call_special(uint16 which) {
 		tr[2].walkto(4); /* She walks to somewhere... */
 		tr[1].done();     /* Lose Avvy. */
 		_vm->_gyro->dna.user_moves_avvy = false;
-		_vm->_timeout.set_up_timer(40, _vm->_timeout.procrobin_hood_and_geida, _vm->_timeout.reason_robin_hood_and_geida);
+		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
 		break;
 	case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */
 		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
@@ -1214,7 +1214,7 @@ void Trip::arrow_procs(byte tripnum) {
 			_vm->_lucerna.gameover();
 
 			_vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */
-			_vm->_timeout.set_up_timer(55, _vm->_timeout.procnaughty_duke, _vm->_timeout.reason_naughty_duke);
+			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
 		}
 	} else { /* Arrow has hit the wall! */
 		tr[tripnum].done(); /* Deallocate the arrow. */


Commit: bc9823ad9b45b5314255f11f3732cfb8ac93c05b
    https://github.com/scummvm/scummvm/commit/bc9823ad9b45b5314255f11f3732cfb8ac93c05b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:45:10-07:00

Commit Message:
AVALANCHE: Change _enhanced into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/enhanced2.cpp
    engines/avalanche/enhanced2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 27dd779..0b522b1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -60,6 +60,7 @@ AvalancheEngine::~AvalancheEngine() {
 
 	delete _avalot;
 	delete _gyro;
+	delete _enhanced;
 	delete _timeout;
 }
 
@@ -68,7 +69,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
-	_enhanced.setParent(this);
+	_enhanced = new Enhanced(this);
 	_logger.setParent(this);
 	_pingo.setParent(this);
 	_scrolls.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e9de899..4af8a82 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -69,7 +69,7 @@ public:
 
 	Avalot *_avalot;
 	Gyro *_gyro;
-	Enhanced _enhanced;
+	Enhanced *_enhanced;
 	Logger _logger;
 	Pingo _pingo;
 	Scrolls _scrolls;
diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
index f664d82..d6187a0 100644
--- a/engines/avalanche/enhanced2.cpp
+++ b/engines/avalanche/enhanced2.cpp
@@ -33,7 +33,7 @@
 
 namespace Avalanche {
 
-void Enhanced::setParent(AvalancheEngine *vm) {
+Enhanced::Enhanced(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
index 917ed3c..ed7f1e6 100644
--- a/engines/avalanche/enhanced2.h
+++ b/engines/avalanche/enhanced2.h
@@ -43,7 +43,7 @@ public:
 	bool atbios; // BIOS type
 	char inchar, extd;
 
-	void setParent(AvalancheEngine *vm);
+	Enhanced(AvalancheEngine *vm);
 
 	void readkeye();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5034e13..59942ac 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -63,7 +63,7 @@ void Lucerna::setParent(AvalancheEngine *vm) {
 void Lucerna::init() {
 	_vm->_gyro->oh = 17717;
 	_vm->_gyro->om = 17717;
-	if (_vm->_enhanced.atbios)  _vm->_gyro->atkey = "f1";
+	if (_vm->_enhanced->atbios)  _vm->_gyro->atkey = "f1";
 	else _vm->_gyro->atkey = "alt-";
 }
 	
@@ -904,15 +904,15 @@ void Lucerna::inkey() {
 
 	if (_vm->_gyro->mousetext == "") {
 		/* read keyboard */
-		_vm->_enhanced.readkeye();
-		if ((_vm->_enhanced.inchar == ' ') && ((_vm->_enhanced.shiftstate & 8) > 0)) {
-			_vm->_enhanced.inchar = '\0';
-			_vm->_enhanced.extd = '#'; /* alt-spacebar = alt-H */
+		_vm->_enhanced->readkeye();
+		if ((_vm->_enhanced->inchar == ' ') && ((_vm->_enhanced->shiftstate & 8) > 0)) {
+			_vm->_enhanced->inchar = '\0';
+			_vm->_enhanced->extd = '#'; /* alt-spacebar = alt-H */
 		}
 	} else {
 		if (_vm->_gyro->mousetext[0] == '`')
 			_vm->_gyro->mousetext.setChar(13,0); /* Backquote = return in a macro */
-		_vm->_enhanced.inchar = _vm->_gyro->mousetext[0];
+		_vm->_enhanced->inchar = _vm->_gyro->mousetext[0];
 		_vm->_gyro->mousetext = Common::String(_vm->_gyro->mousetext.c_str() + 2, 253);
 	}
 }


Commit: 4d251171354a5a2cc0d8df32a54f716f4e23fe64
    https://github.com/scummvm/scummvm/commit/4d251171354a5a2cc0d8df32a54f716f4e23fe64
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:47:33-07:00

Commit Message:
AVALANCHE: Change _logger into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/logger2.cpp
    engines/avalanche/logger2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0b522b1..f130089 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -62,6 +62,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _gyro;
 	delete _enhanced;
 	delete _timeout;
+	delete _logger;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
@@ -70,7 +71,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
 	_enhanced = new Enhanced(this);
-	_logger.setParent(this);
+	_logger = new Logger(this);
 	_pingo.setParent(this);
 	_scrolls.setParent(this);
 	_visa.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 4af8a82..76873a5 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -70,7 +70,7 @@ public:
 	Avalot *_avalot;
 	Gyro *_gyro;
 	Enhanced *_enhanced;
-	Logger _logger;
+	Logger *_logger;
 	Pingo _pingo;
 	Scrolls _scrolls;
 	Visa _visa;
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 20ca558..ef94eb3 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -75,7 +75,7 @@ const int16 Logger::divide_indent = 30;
 
 
 
-void Logger::setParent(AvalancheEngine *vm) {
+Logger::Logger(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h
index 05a96d0..95e5ea8 100644
--- a/engines/avalanche/logger2.h
+++ b/engines/avalanche/logger2.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 
 class Logger {
 public:
-	void setParent(AvalancheEngine *vm);
+	Logger(AvalancheEngine *vm);
 
 	void log_setup(Common::String name, bool printing);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 59942ac..dd6503c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -278,7 +278,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
-	_vm->_logger.log_newroom(_vm->_gyro->roomname);
+	_vm->_logger->log_newroom(_vm->_gyro->roomname);
 
 	if (was_virtual)
 		_vm->_gyro->on_virtual();
@@ -881,7 +881,7 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 	}
 	warning("STUB: Lucerna::points()");
 
-	_vm->_logger.log_score(num, _vm->_gyro->dna.score);
+	_vm->_logger->log_score(num, _vm->_gyro->dna.score);
 	showscore();
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index b0563c6..0a76168 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -146,7 +146,7 @@ void Scrolls::music_scroll() {
 void Scrolls::resetscrolldriver() {   /* phew */
 	_vm->_gyro->scrollbells = 0;
 	cfont = roman;
-	_vm->_logger.log_epsonroman();
+	_vm->_logger->log_epsonroman();
 	use_icon = 0;
 	_vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */
 }


Commit: c0823f3e79bb17369904f704a27fad8127faeb9e
    https://github.com/scummvm/scummvm/commit/c0823f3e79bb17369904f704a27fad8127faeb9e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T09:50:13-07:00

Commit Message:
AVALANCHE: Change _pingo into pointer, update everything accordingly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/pingo2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d9180f4..b9958f1 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1294,7 +1294,7 @@ void Acci::do_that() {
 					"do things I tell you not to?\r\rDon't do it again!");
 			break;
 		default:
-			_vm->_pingo.zonk();
+			_vm->_pingo->zonk();
 			_vm->_scrolls.display(Common::String("A crack of lightning shoots from the sky, ") +
 					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna.gameover();
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f130089..e490ace 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -61,8 +61,10 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _avalot;
 	delete _gyro;
 	delete _enhanced;
-	delete _timeout;
 	delete _logger;
+	delete _pingo;
+
+	delete _timeout;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
@@ -72,7 +74,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_gyro = new Gyro(this);
 	_enhanced = new Enhanced(this);
 	_logger = new Logger(this);
-	_pingo.setParent(this);
+	_pingo = new Pingo(this);
 	_scrolls.setParent(this);
 	_visa.setParent(this);
 	_lucerna.setParent(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 76873a5..66bfd22 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -71,7 +71,7 @@ public:
 	Gyro *_gyro;
 	Enhanced *_enhanced;
 	Logger *_logger;
-	Pingo _pingo;
+	Pingo *_pingo;
 	Scrolls _scrolls;
 	Visa _visa;
 	Lucerna _lucerna;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 856d8b8..64f679f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -98,7 +98,7 @@ void Avalot::setup() {
 	_vm->_gyro->enid_filename = ""; /* undefined. */
 	_vm->_lucerna.toolbar();
 	_vm->_scrolls.state(2);
-	_vm->_graphics->refreshScreen(); //_vm->_pingo.copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
+	_vm->_graphics->refreshScreen(); //_vm->_pingo->copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index dd6503c..c11a245 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -274,7 +274,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	load_also(xx);
 	_vm->_celer.load_chunks(xx);
 
-	_vm->_graphics->refreshScreen(); // _vm->_pingo.copy03();  -  See Avalot::setup()
+	_vm->_graphics->refreshScreen(); // _vm->_pingo->copy03();  -  See Avalot::setup()
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 1f7c35e..7b34167 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -40,7 +40,7 @@
 
 namespace Avalanche {
 
-void Pingo::setParent(AvalancheEngine *vm) {
+Pingo::Pingo(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index b6113f8..9625236 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 
 class Pingo {
 public:
-	void setParent(AvalancheEngine *vm);
+	Pingo(AvalancheEngine *vm);
 
 	void bosskey();
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 420469f..9deae84 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -490,7 +490,7 @@ void Timeout::buydrinks() {
 	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa.dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls.display message about it. */
-	_vm->_pingo.wobble(); /* Do the special effects. */
+	_vm->_pingo->wobble(); /* Do the special effects. */
 	_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
 	if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
 		_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
@@ -614,7 +614,7 @@ void Timeout::arkata_shouts() {
 
 void Timeout::winning() {
 	_vm->_visa.dixi('q', 79);
-	_vm->_pingo.winning_pic();
+	_vm->_pingo->winning_pic();
 
 	do {
 		_vm->_lucerna.checkclick();


Commit: 39dfddff1f3d35c889e1a0ea7053a4e648e036fa
    https://github.com/scummvm/scummvm/commit/39dfddff1f3d35c889e1a0ea7053a4e648e036fa
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T10:43:10-07:00

Commit Message:
AVALANCHE: Change class variables to pointers, update everything accordingly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/closing2.cpp
    engines/avalanche/closing2.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index b9958f1..e87e120 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -216,7 +216,7 @@ const Acci::ranktype Acci::ranks[9] = {
 };
 
 
-void Acci::setParent(AvalancheEngine *vm) {
+Acci::Acci(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
@@ -264,7 +264,7 @@ begin
 	blockwrite(f,a,12080);
 	end;
 	close(f); on;
-	_vm->_scrolls.display('Dumped.');
+	_vm->_scrolls->display('Dumped.');
 end;*/
 
 Common::String Acci::rank() {
@@ -323,7 +323,7 @@ void Acci::displaywhat(char ch, bool animate, bool &ambigous) { /* << it's an ad
 	byte ff;
 	Common::String z;
 
-	warning("STUB: Acci::_vm->_scrolls.displaywhat()");
+	warning("STUB: Acci::_vm->_scrolls->displaywhat()");
 }
 
 bool Acci::do_pronouns() {
@@ -430,38 +430,38 @@ void Acci::others() {
 
 void Acci::lookaround() {
 /* This is called when you say "look." */
-	_vm->_scrolls.display(*_vm->_gyro->also[0][1]);
+	_vm->_scrolls->display(*_vm->_gyro->also[0][1]);
 	switch (_vm->_gyro->dna.room) {
 	case r__spludwicks:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa.dixi('q', 23);
+			_vm->_visa->dixi('q', 23);
 		else
 			others();
 		break;
 	case r__robins:
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_visa.dixi('q', 38);
+			_vm->_visa->dixi('q', 38);
 		if (_vm->_gyro->dna.mushroom_growing)
-			_vm->_visa.dixi('q', 55);
+			_vm->_visa->dixi('q', 55);
 		break;
 	case r__insidecardiffcastle:
 		if (!_vm->_gyro->dna.taken_pen)
-			_vm->_visa.dixi('q', 49);
+			_vm->_visa->dixi('q', 49);
 		break;
 	case r__lustiesroom:
 		if (_vm->_gyro->dna.lustie_is_asleep)
-			_vm->_visa.dixi('q', 65);
+			_vm->_visa->dixi('q', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) {
 		case 258 :
-			_vm->_visa.dixi('q', 80);
+			_vm->_visa->dixi('q', 80);
 			break; /* Inside art gallery */
 		case 514 :
-			_vm->_visa.dixi('q', 81);
+			_vm->_visa->dixi('q', 81);
 			break; /* Outside ditto */
 		case 260 :
-			_vm->_visa.dixi('q', 82);
+			_vm->_visa->dixi('q', 82);
 			break; /* Outside Geida's room. */
 		}
 		break;
@@ -475,7 +475,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 
 	switch (_vm->_gyro->dna.room) {   /* Special cases. */
 	case r__yours:
-		if (_vm->_trip.infield(2)) {
+		if (_vm->_trip->infield(2)) {
 			/* Opening the box. */
 			thing = 54; /* The box. */ person = pardon;
 			examine();
@@ -484,7 +484,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 		break;
 	case r__spludwicks:
 		if (thing == 61) {
-			_vm->_visa.dixi('q', 85);
+			_vm->_visa->dixi('q', 85);
 			return;
 		}
 		break;
@@ -495,26 +495,26 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 		return; /* No doors can open if you can't move Avvy. */
 
 	for (fv = 9; fv <= 15; fv++) {
-		if (_vm->_trip.infield(fv)) {
+		if (_vm->_trip->infield(fv)) {
 			{
 				_vm->_gyro->portals[fv];
 				switch (_vm->_gyro->portals[fv].op) {
 				case _vm->_gyro->exclaim:
-					_vm->_trip.tr[1].bounce();
-					_vm->_visa.dixi('x', _vm->_gyro->portals[fv].data);
+					_vm->_trip->tr[1].bounce();
+					_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
 					break;
 				case _vm->_gyro->transport:
-					_vm->_trip.fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
+					_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
 					break;
 				case _vm->_gyro->unfinished:
-					_vm->_trip.tr[1].bounce();
-					_vm->_scrolls.display("Sorry. This place is not available yet!");
+					_vm->_trip->tr[1].bounce();
+					_vm->_scrolls->display("Sorry. This place is not available yet!");
 					break;
 				case _vm->_gyro->special:
-					_vm->_trip.call_special(_vm->_gyro->portals[fv].data);
+					_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
 					break;
 				case _vm->_gyro->mopendoor:
-					_vm->_trip.open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
+					_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
 					break;
 				}
 			}
@@ -523,18 +523,18 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	}
 
 	if (_vm->_gyro->dna.room == r__map)
-		_vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going "
+		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
 				"to anywhere other than Argent, Birmingham, Cardiff, "
 				"Nottingham and Norwich."));
 	else
-		_vm->_scrolls.display("Door? What door?");
+		_vm->_scrolls->display("Door? What door?");
 }
 
 
 
 
 void Acci::silly() {
-	_vm->_scrolls.display("Don't be silly!");
+	_vm->_scrolls->display("Don't be silly!");
 }
 
 void Acci::putproc() {   /* Called when you call vb_put. */
@@ -555,15 +555,15 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 	case _vm->_gyro->wine:
 		if (thing == _vm->_gyro->onion) {
 			if (_vm->_gyro->dna.rotten_onion)
-				_vm->_scrolls.display(Common::String("That's a bit like shutting the stable door after the "
+				_vm->_scrolls->display(Common::String("That's a bit like shutting the stable door after the "
 						"horse has bolted!"));
 			else {     /* Put onion into wine? */
 				if (_vm->_gyro->dna.winestate != 3)
-					_vm->_scrolls.display("\6Oignon au vin\22 is a bit too strong for your tastes!");
+					_vm->_scrolls->display("\6Oignon au vin\22 is a bit too strong for your tastes!");
 				else {     /* Put onion into vinegar! Yes! */
 					_vm->_gyro->dna.onion_in_vinegar = true;
-					_vm->_lucerna.points(7);
-					_vm->_visa.dixi('u', 9);
+					_vm->_lucerna->points(7);
+					_vm->_visa->dixi('u', 9);
 				}
 			}
 		} else
@@ -573,33 +573,33 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 	case 54:
 		if (_vm->_gyro->dna.room == 1) { /* Put something into the box. */
 			if (_vm->_gyro->dna.box_contents != nowt)
-				_vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking"
+				_vm->_scrolls->display(Common::String("There's something in the box already, Avvy. Try taking"
 						" that out first."));
 			else {
 				switch (thing) {
 				case _vm->_gyro->money:
-					_vm->_scrolls.display("You'd better keep some ready cash on you!");
+					_vm->_scrolls->display("You'd better keep some ready cash on you!");
 					break;
 				case _vm->_gyro->bell:
-					_vm->_scrolls.display("That's a silly place to keep a bell.");
+					_vm->_scrolls->display("That's a silly place to keep a bell.");
 					break;
 				case _vm->_gyro->bodkin:
-					_vm->_scrolls.display("But you might need it!");
+					_vm->_scrolls->display("But you might need it!");
 					break;
 				case _vm->_gyro->onion:
-					_vm->_scrolls.display("Just give it to Spludwick, Avvy!");
+					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
 					break;
 				default:
 					/* Put the object into the box... */
 					if (_vm->_gyro->dna.wearing == thing)
-						_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
+						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
 					else {
-						_vm->_celer.show_one(5); /* Open box. */
+						_vm->_celer->show_one(5); /* Open box. */
 						_vm->_gyro->dna.box_contents = thing;
 						_vm->_gyro->dna.obj[thing] = false;
-						_vm->_lucerna.objectlist();
-						_vm->_scrolls.display("OK, it's in the box.");
-						_vm->_celer.show_one(6); /* Shut box. */
+						_vm->_lucerna->objectlist();
+						_vm->_scrolls->display("OK, it's in the box.");
+						_vm->_celer->show_one(6); /* Shut box. */
 					}
 				}
 			}
@@ -615,15 +615,15 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 
 /* The result of this fn is whether or not he says "Hey, thanks!" */
 void Acci::not_in_order() {
-	_vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
+	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
 			" What I need next is " +
 			_vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ".\232\2");
 }
 
 void Acci::go_to_cauldron() {
-	_vm->_trip.tr[2].call_eachstep = false; /* Stops Geida_Procs. */
+	_vm->_trip->tr[2].call_eachstep = false; /* Stops Geida_Procs. */
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
-	_vm->_trip.tr[2].walkto(2);
+	_vm->_trip->tr[2].walkto(2);
 }
 
 bool Acci::give2spludwick() {
@@ -638,31 +638,31 @@ bool Acci::give2spludwick() {
 	case _vm->_gyro->onion:
 		_vm->_gyro->dna.obj[_vm->_gyro->onion] = false;
 		if (_vm->_gyro->dna.rotten_onion)
-			_vm->_visa.dixi('q', 22);
+			_vm->_visa->dixi('q', 22);
 		else {
 			_vm->_gyro->dna.given2spludwick += 1;
-			_vm->_visa.dixi('q', 20);
+			_vm->_visa->dixi('q', 20);
 			go_to_cauldron();
-			_vm->_lucerna.points(3);
+			_vm->_lucerna->points(3);
 		}
-		_vm->_lucerna.objectlist();
+		_vm->_lucerna->objectlist();
 		break;
 	case _vm->_gyro->ink:
 		_vm->_gyro->dna.obj[_vm->_gyro->ink] = false;
-		_vm->_lucerna.objectlist();
+		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.given2spludwick += 1;
-		_vm->_visa.dixi('q', 24);
+		_vm->_visa->dixi('q', 24);
 		go_to_cauldron();
-		_vm->_lucerna.points(3);
+		_vm->_lucerna->points(3);
 		break;
 	case _vm->_gyro->mushroom:
 		_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false;
-		_vm->_visa.dixi('q', 25);
-		_vm->_lucerna.points(5);
+		_vm->_visa->dixi('q', 25);
+		_vm->_lucerna->points(5);
 		_vm->_gyro->dna.given2spludwick += 1;
 		go_to_cauldron();
 		_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
-		_vm->_lucerna.objectlist();
+		_vm->_lucerna->objectlist();
 		break;
 	default:
 		give2spludwick_result = true;
@@ -678,36 +678,36 @@ void Acci::have_a_drink() {
 		_vm->_gyro->dna.teetotal = true;
 		_vm->_gyro->dna.avvy_is_awake = false;
 		_vm->_gyro->dna.avvy_in_bed = true;
-		_vm->_lucerna.objectlist();
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->objectlist();
+		_vm->_lucerna->dusk();
 		_vm->_gyro->hang_around_for_a_while();
-		_vm->_trip.fliproom(1, 1);
+		_vm->_trip->fliproom(1, 1);
 		_vm->_gyro->background(14);
-		_vm->_trip.new_game_for_trippancy(); /* Not really */
+		_vm->_trip->new_game_for_trippancy(); /* Not really */
 	}
 }
 
 void Acci::cardiff_climbing() {
 	if (_vm->_gyro->dna.standing_on_dais) {
 		/* Clamber up. */
-		_vm->_scrolls.display("You climb down, back onto the floor.");
+		_vm->_scrolls->display("You climb down, back onto the floor.");
 		_vm->_gyro->dna.standing_on_dais = false;
-		_vm->_trip.apped(1, 3);
+		_vm->_trip->apped(1, 3);
 	} else {
 		/* Clamber down. */
-		if (_vm->_trip.infield(1)) {
-			_vm->_scrolls.display("You clamber up onto the dais.");
+		if (_vm->_trip->infield(1)) {
+			_vm->_scrolls->display("You clamber up onto the dais.");
 			_vm->_gyro->dna.standing_on_dais = true;
-			_vm->_trip.apped(1, 2);
+			_vm->_trip->apped(1, 2);
 		} else
-			_vm->_scrolls.display("Get a bit closer, Avvy.");
+			_vm->_scrolls->display("Get a bit closer, Avvy.");
 	}
 }
 
 
 /* Called when you ask Avvy to stand. */
 void Acci::already() {
-	_vm->_scrolls.display("You're already standing!");
+	_vm->_scrolls->display("You're already standing!");
 }
 
 void Acci::stand_up() {
@@ -715,16 +715,16 @@ void Acci::stand_up() {
 	case r__yours: /* Avvy isn't asleep. */
 		if (_vm->_gyro->dna.avvy_in_bed) {  /* But he's in bed. */
 			if (_vm->_gyro->dna.teetotal) {
-				_vm->_visa.dixi('d', 12);
+				_vm->_visa->dixi('d', 12);
 				_vm->_gyro->background(0);
-				_vm->_visa.dixi('d', 14);
+				_vm->_visa->dixi('d', 14);
 			}
-			_vm->_trip.tr[1].visible = true;
+			_vm->_trip->tr[1].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
-			_vm->_trip.apped(1, 2);
+			_vm->_trip->apped(1, 2);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer.show_one(4); /* Picture of empty pillow. */
-			_vm->_lucerna.points(1);
+			_vm->_celer->show_one(4); /* Picture of empty pillow. */
+			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
 		} else
@@ -737,9 +737,9 @@ void Acci::stand_up() {
 
 	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  {
-			_vm->_celer.show_one(4); /* Not sitting down. */
-			_vm->_trip.tr[1].visible = true; /* But standing up. */
-			_vm->_trip.apped(1, 4); /* And walking away. */
+			_vm->_celer->show_one(4); /* Not sitting down. */
+			_vm->_trip->tr[1].visible = true; /* But standing up. */
+			_vm->_trip->apped(1, 4); /* And walking away. */
 			_vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */
 			_vm->_gyro->dna.user_moves_avvy = true; /* And ambulant. */
 		} else
@@ -754,93 +754,93 @@ void Acci::stand_up() {
 void Acci::getproc(char thing) {
 	switch (_vm->_gyro->dna.room) {
 	case r__yours:
-		if (_vm->_trip.infield(2)) {
+		if (_vm->_trip->infield(2)) {
 			if (_vm->_gyro->dna.box_contents == thing) {
-				_vm->_celer.show_one(5);
-				_vm->_scrolls.display("OK, I've got it.");
+				_vm->_celer->show_one(5);
+				_vm->_scrolls->display("OK, I've got it.");
 				_vm->_gyro->dna.obj[thing] = true;
-				_vm->_lucerna.objectlist();
+				_vm->_lucerna->objectlist();
 				_vm->_gyro->dna.box_contents = nowt;
-				_vm->_celer.show_one(6);
+				_vm->_celer->show_one(6);
 			} else
-				_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
+				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
-			_vm->_visa.dixi('q', 57);
+			_vm->_visa->dixi('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
 		case _vm->_gyro->pen:
-			if (_vm->_trip.infield(2)) {
+			if (_vm->_trip->infield(2)) {
 				/* Standing on the dais. */
 
 				if (_vm->_gyro->dna.taken_pen)
-					_vm->_scrolls.display("It's not there, Avvy.");
+					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
 					/* OK: we're taking the pen, and it's there. */
-					_vm->_celer.show_one(4); /* No pen there now. */
-					_vm->_trip.call_special(3); /* Zap! */
+					_vm->_celer->show_one(4); /* No pen there now. */
+					_vm->_trip->call_special(3); /* Zap! */
 					_vm->_gyro->dna.taken_pen = true;
 					_vm->_gyro->dna.obj[_vm->_gyro->pen] = true;
-					_vm->_lucerna.objectlist();
-					_vm->_scrolls.display("Taken.");
+					_vm->_lucerna->objectlist();
+					_vm->_scrolls->display("Taken.");
 				}
 			} else if (_vm->_gyro->dna.standing_on_dais)
-				_vm->_visa.dixi('q', 53);
+				_vm->_visa->dixi('q', 53);
 			else
-				_vm->_visa.dixi('q', 51);
+				_vm->_visa->dixi('q', 51);
 			break;
 		case _vm->_gyro->bolt:
-			_vm->_visa.dixi('q', 52);
+			_vm->_visa->dixi('q', 52);
 			break;
 		default:
-			_vm->_visa.dixi('q', 57);
+			_vm->_visa->dixi('q', 57);
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip.infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
-			_vm->_celer.show_one(3);
-			_vm->_scrolls.display("Got it!");
+		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
+			_vm->_celer->show_one(3);
+			_vm->_scrolls->display("Got it!");
 			_vm->_gyro->dna.mushroom_growing = false;
 			_vm->_gyro->dna.taken_mushroom = true;
 			_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = true;
-			_vm->_lucerna.objectlist();
-			_vm->_lucerna.points(3);
+			_vm->_lucerna->objectlist();
+			_vm->_lucerna->points(3);
 		} else
-			_vm->_visa.dixi('q', 57);
+			_vm->_visa->dixi('q', 57);
 		break;
 	default:
-		_vm->_visa.dixi('q', 57);
+		_vm->_visa->dixi('q', 57);
 	}
 }
 
 void Acci::give_geida_the_lute() {
 	if (_vm->_gyro->dna.room != r__lustiesroom) {
-		_vm->_scrolls.display("Not yet. Try later!\232\2");
+		_vm->_scrolls->display("Not yet. Try later!\232\2");
 		return;
 	}
 	_vm->_gyro->dna.obj[_vm->_gyro->lute] = false;
-	_vm->_lucerna.objectlist();
-	_vm->_visa.dixi('q', 64); /* She plays it. */
+	_vm->_lucerna->objectlist();
+	_vm->_visa->dixi('q', 64); /* She plays it. */
 
 	/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
 
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
-	_vm->_enid.back_to_bootstrap(4);
+	_vm->_enid->back_to_bootstrap(4);
 }
 
 void Acci::play_harp() {
-	if (_vm->_trip.infield(7))
-		_vm->_scrolls.musical_scroll();
+	if (_vm->_trip->infield(7))
+		_vm->_scrolls->musical_scroll();
 	else
-		_vm->_scrolls.display("Get a bit closer to it, Avvy!");
+		_vm->_scrolls->display("Get a bit closer to it, Avvy!");
 }
 
 void Acci::winsequence() {
-	_vm->_visa.dixi('q', 78);
-	_vm->_sequence.first_show(7);
-	_vm->_sequence.then_show(8);
-	_vm->_sequence.then_show(9);
-	_vm->_sequence.start_to_close();
+	_vm->_visa->dixi('q', 78);
+	_vm->_sequence->first_show(7);
+	_vm->_sequence->then_show(8);
+	_vm->_sequence->then_show(9);
+	_vm->_sequence->start_to_close();
 	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning);
 }
 
@@ -858,15 +858,15 @@ void Acci::person_speaks() {
 	}
 
 	if (_vm->_gyro->whereis[person] != _vm->_gyro->dna.room) {
-		_vm->_scrolls.display("\231\4"); /* Avvy _vm->_gyro->himself! */
+		_vm->_scrolls->display("\231\4"); /* Avvy _vm->_gyro->himself! */
 		return;
 	}
 
 	found = false; /* The person we're looking for's code is in Person. */
 
-	for (fv = 1; fv <= _vm->_trip.numtr; fv++) {
-		if (_vm->_trip.tr[fv].quick && ((_vm->_trip.tr[fv].a.accinum + 149) == person)) {
-			_vm->_scrolls.display(Common::String('\23') + char(fv + 48) + '\4');
+	for (fv = 1; fv <= _vm->_trip->numtr; fv++) {
+		if (_vm->_trip->tr[fv].quick && ((_vm->_trip->tr[fv].a.accinum + 149) == person)) {
+			_vm->_scrolls->display(Common::String('\23') + char(fv + 48) + '\4');
 			found = true;
 		}
 	}
@@ -875,7 +875,7 @@ void Acci::person_speaks() {
 		for (fv = 10; fv <= 25; fv++) {
 			_vm->_gyro->quasipeds[fv];
 			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room)) {
-				_vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4');
+				_vm->_scrolls->display(Common::String('\23') + char(fv + 55) + '\4');
 			}
 		}
 	}
@@ -883,7 +883,7 @@ void Acci::person_speaks() {
 
 void Acci::heythanks() {
 	person_speaks();
-	_vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)");
+	_vm->_scrolls->display("Hey, thanks!\2(But now, you've lost it!)");
 	_vm->_gyro->dna.obj[thing] = false;
 }
 
@@ -908,7 +908,7 @@ void Acci::do_that() {
 		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
 		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
 		vb_highscores, vb_smartalec, eos).has(verb))) {
-		_vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
+		_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
 		"or something? Try restarting, or restoring a saved game!");
 		return;
 	}
@@ -917,7 +917,7 @@ void Acci::do_that() {
 		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
 		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
 		vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
-		_vm->_scrolls.display("Talking in your sleep? Try waking up!");
+		_vm->_scrolls->display("Talking in your sleep? Try waking up!");
 		return;
 	}
 	*/
@@ -931,37 +931,37 @@ void Acci::do_that() {
 		opendoor();
 		break;
 	case vb_pause:
-		_vm->_scrolls.display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
+		_vm->_scrolls->display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
 				"the mouse on the `O.K.\" box to continue.");
 		break;
 	case vb_get:
 		if (thing != pardon) {
 			/* Legitimate try to pick something up. */
 			if (_vm->_gyro->dna.carrying >= maxobjs)
-				_vm->_scrolls.display("You can't carry any more!");
+				_vm->_scrolls->display("You can't carry any more!");
 			else
 				getproc(thing);
 
 		} else {
 			/* Not... ditto. */
 			if (person != pardon)
-				_vm->_scrolls.display("You can't sweep folk off their feet!");
+				_vm->_scrolls->display("You can't sweep folk off their feet!");
 			else
-				_vm->_scrolls.display("I assure you, you don't need it.");
+				_vm->_scrolls->display("I assure you, you don't need it.");
 		}
 		break;
 	case vb_drop:
-		_vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
+		_vm->_scrolls->display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
-		/*       begin _vm->_gyro->dna.obj[thing]:=false; _vm->_lucerna.objectlist(); end;*/
+		/*       begin _vm->_gyro->dna.obj[thing]:=false; _vm->_lucerna->objectlist(); end;*/
 	case vb_inv:
 		inv();
 		break;
 	case vb_talk:
 		if (person == pardon) {
 			if (_vm->_gyro->subjnumber == 99) /* They typed "say passuint16". */
-				_vm->_scrolls.display("Yes, but what \6is\22 the passuint16?");
+				_vm->_scrolls->display("Yes, but what \6is\22 the passuint16?");
 			/*
 			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
 				Delete(thats, 1, 1);
@@ -973,38 +973,38 @@ void Acci::do_that() {
 				person = _vm->_gyro->subjnumber;
 				subjnumber = 0;
 				if (set::of(pardon, '\0', eos).has(person))
-					_vm->_scrolls.display("Talk to whom?");
+					_vm->_scrolls->display("Talk to whom?");
 				else if (personshere())
 					talkto(ord(person));
 			}
 			*/
 			else if (person == pardon)
-				_vm->_scrolls.display("Talk to whom?");
+				_vm->_scrolls->display("Talk to whom?");
 		} else if (personshere())
-			_vm->_visa.talkto(person);
+			_vm->_visa->talkto(person);
 		break;
 
 	case vb_give:
 		if (holding()) {
 			if (person == pardon)
-				_vm->_scrolls.display("Give to whom?");
+				_vm->_scrolls->display("Give to whom?");
 			else if (personshere()) {
 				switch (thing) {
 				case _vm->_gyro->money :
-					_vm->_scrolls.display("You can't bring yourself to give away your moneybag.");
+					_vm->_scrolls->display("You can't bring yourself to give away your moneybag.");
 					break;
 				case _vm->_gyro->bodkin:
 				case _vm->_gyro->bell:
 				case _vm->_gyro->clothes:
 				case _vm->_gyro->habit :
-					_vm->_scrolls.display("Don't give it away, it might be useful!");
+					_vm->_scrolls->display("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (person) {
 					case _vm->_gyro->pcrapulus:
 						switch (thing) {
 						case _vm->_gyro->wine:
-							_vm->_scrolls.display("Crapulus grabs the wine and gulps it down.");
+							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
 							break;
 						default:
@@ -1013,7 +1013,7 @@ void Acci::do_that() {
 						break;
 					case _vm->_gyro->pcwytalot:
 						/*if (set::of(crossbow, bolt, eos).has(thing))
-							_vm->_scrolls.display(Common::String("You might be able to influence ") +
+							_vm->_scrolls->display(Common::String("You might be able to influence ") +
 									"Cwytalot more if you used it!");
 						else */heythanks();
 						break;
@@ -1023,13 +1023,13 @@ void Acci::do_that() {
 						break;
 					case _vm->_gyro->pibythneth:
 						if (thing == _vm->_gyro->badge) {
-							_vm->_visa.dixi('q', 32); /* Thanks! Wow! */
-							_vm->_lucerna.points(3);
+							_vm->_visa->dixi('q', 32); /* Thanks! Wow! */
+							_vm->_lucerna->points(3);
 							_vm->_gyro->dna.obj[_vm->_gyro->badge] = false;
 							_vm->_gyro->dna.obj[_vm->_gyro->habit] = true;
 							_vm->_gyro->dna.givenbadgetoiby = true;
-							_vm->_celer.show_one(8);
-							_vm->_celer.show_one(9);
+							_vm->_celer->show_one(8);
+							_vm->_celer->show_one(9);
 						} else
 							heythanks();
 						break;
@@ -1037,24 +1037,24 @@ void Acci::do_that() {
 						if (_vm->_gyro->dna.ayles_is_awake) {
 							if (thing == _vm->_gyro->pen) {
 								_vm->_gyro->dna.obj[_vm->_gyro->pen] = false;
-								_vm->_visa.dixi('q', 54);
+								_vm->_visa->dixi('q', 54);
 								_vm->_gyro->dna.obj[_vm->_gyro->ink] = true;
 								_vm->_gyro->dna.given_pen_to_ayles = true;
-								_vm->_lucerna.objectlist();
-								_vm->_lucerna.points(2);
+								_vm->_lucerna->objectlist();
+								_vm->_lucerna->points(2);
 							} else
 								heythanks();
 						} else
-							_vm->_scrolls.display("But he's asleep!");
+							_vm->_scrolls->display("But he's asleep!");
 						break;
 					case _vm->_gyro->pgeida:
 						switch (thing) {
 						case _vm->_gyro->potion:
 							_vm->_gyro->dna.obj[_vm->_gyro->potion] = false;
-							_vm->_visa.dixi('u', 16); /* She drinks it. */
-							_vm->_lucerna.points(2);
+							_vm->_visa->dixi('u', 16); /* She drinks it. */
+							_vm->_lucerna->points(2);
 							_vm->_gyro->dna.geida_given_potion = true;
-							_vm->_lucerna.objectlist();
+							_vm->_lucerna->objectlist();
 							break;
 						case _vm->_gyro->lute:
 							give_geida_the_lute();
@@ -1069,7 +1069,7 @@ void Acci::do_that() {
 							if (_vm->_gyro->dna.geida_given_potion)
 								winsequence();
 							else
-								_vm->_visa.dixi('q', 77);
+								_vm->_visa->dixi('q', 77);
 							break;             /* That Geida woman! */
 						default:
 							heythanks();
@@ -1080,7 +1080,7 @@ void Acci::do_that() {
 					}
 				}
 			}
-			_vm->_lucerna.objectlist(); /* Just in case... */
+			_vm->_lucerna->objectlist(); /* Just in case... */
 		}
 		break;
 
@@ -1090,98 +1090,98 @@ void Acci::do_that() {
 			swallow();
 		break;
 	case vb_load:
-		_vm->_enid.edna_load(realwords[2]);
+		_vm->_enid->edna_load(realwords[2]);
 		break;
 	case vb_save:
 		if (_vm->_gyro->alive)
-			_vm->_enid.edna_save(realwords[2]);
+			_vm->_enid->edna_save(realwords[2]);
 		else
-			_vm->_scrolls.display("It's a bit late now to save your game!");
+			_vm->_scrolls->display("It's a bit late now to save your game!");
 		break;
 	case vb_pay:
-		_vm->_scrolls.display("No money need change hands.");
+		_vm->_scrolls->display("No money need change hands.");
 		break;
 	case vb_look:
 		lookaround();
 		break;
 	case vb_break:
-		_vm->_scrolls.display("Vandalism is prohibited within this game!");
+		_vm->_scrolls->display("Vandalism is prohibited within this game!");
 		break;
 	case vb_quit: /* quit */
 		//if (_vm->_gyro->demo) {
-		//	_vm->_visa.dixi('q', 31);
+		//	_vm->_visa->dixi('q', 31);
 		//	close(demofile);
 		//	exit(0); /* Change this later!!! */
 		//}
 		if (!polite)
-			_vm->_scrolls.display("How about a `please\", Avvy?");
-		else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))
+			_vm->_scrolls->display("How about a `please\", Avvy?");
+		else if (_vm->_scrolls->ask("\23C\26Do you really want to quit?"))
 			_vm->_gyro->lmo = true;
 		break;
 	case vb_go:
-		_vm->_scrolls.display("Just use the arrow keys to walk there.");
+		_vm->_scrolls->display("Just use the arrow keys to walk there.");
 		break;
 	case vb_info:
-		_vm->_scrolls.aboutscroll = true;
-		/*            _vm->_scrolls.display('Thorsoft of Letchworth presents:'+^c+^m+^m+
+		_vm->_scrolls->aboutscroll = true;
+		/*            _vm->_scrolls->display('Thorsoft of Letchworth presents:'+^c+^m+^m+
 						'The medi‘val descendant of'+^m+
 						'Denarius Avaricius Sextus'+^m+'in:'+
 						^m+^m+'LORD AVALOT D''ARGENT'+
 						^m+'version '+vernum+^m+^m+'Copyright ï '
 						+copyright+', Mark, Mike and Thomas Thurman.');*/
-		_vm->_scrolls.display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
+		_vm->_scrolls->display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
 				"The medi‘val descendant of" + '\15' +
 				"Denarius Avaricius Sextus" +
 				'\15' + '\15' + "version " + _vm->_gyro->vernum + '\15' + '\15' + "Copyright ï "
 				+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
-		_vm->_scrolls.aboutscroll = false;
+		_vm->_scrolls->aboutscroll = false;
 		break;
 	case vb_undress:
 		if (_vm->_gyro->dna.wearing == nowt)
-			_vm->_scrolls.display("You're already stark naked!");
+			_vm->_scrolls->display("You're already stark naked!");
 		else if (_vm->_gyro->dna.avvys_in_the_cupboard) {
-			_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.');
+			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.');
 			_vm->_gyro->dna.wearing = nowt;
-			_vm->_lucerna.objectlist();
+			_vm->_lucerna->objectlist();
 		} else
-			_vm->_scrolls.display("Hadn't you better find somewhere more private, Avvy?");
+			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case vb_wear:
 		if (holding()) {
 			/* wear something */
 			switch (thing) {
 			case _vm->_gyro->chastity:
-				_vm->_scrolls.display("Hey, what kind of a weirdo are you\??!");
+				_vm->_scrolls->display("Hey, what kind of a weirdo are you\??!");
 				break;
 			case _vm->_gyro->clothes:
 			case _vm->_gyro->habit: /* Change this! */
 				if (_vm->_gyro->dna.wearing != nowt) {
 					if (_vm->_gyro->dna.wearing == thing)
-						_vm->_scrolls.display("You're already wearing that.");
+						_vm->_scrolls->display("You're already wearing that.");
 					else
-						_vm->_scrolls.display(Common::String("You'll be rather warm wearing two ") +
+						_vm->_scrolls->display(Common::String("You'll be rather warm wearing two ") +
 								"sets of clothes!");
 					return;
 				} else
 					_vm->_gyro->dna.wearing = thing;
-				_vm->_lucerna.objectlist();
+				_vm->_lucerna->objectlist();
 
 				if (thing == _vm->_gyro->habit)
 					fv = 3;
 				else
 					fv = 0;
 
-				if (_vm->_trip.tr[1].whichsprite != fv) {
-					sx = _vm->_trip.tr[1].x;
-					sy = _vm->_trip.tr[1].y;
-					_vm->_trip.tr[1].done();
-					_vm->_trip.tr[1].init(fv, true, &_vm->_trip);
-					_vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
-					_vm->_trip.tr[1].visible = false;
+				if (_vm->_trip->tr[1].whichsprite != fv) {
+					sx = _vm->_trip->tr[1].x;
+					sy = _vm->_trip->tr[1].y;
+					_vm->_trip->tr[1].done();
+					_vm->_trip->tr[1].init(fv, true, _vm->_trip);
+					_vm->_trip->tr[1].appear(sx, sy, _vm->_trip->left);
+					_vm->_trip->tr[1].visible = false;
 				}
 			break;
 			default:
-				_vm->_scrolls.display(what);
+				_vm->_scrolls->display(what);
 			}
 		}
 		break;
@@ -1199,38 +1199,38 @@ void Acci::do_that() {
 		} else if (holding()) {
 			switch (thing) {
 			case _vm->_gyro->lute :
-				_vm->_visa.dixi('U', 7);
+				_vm->_visa->dixi('U', 7);
 				if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot] == _vm->_gyro->dna.room)
-					_vm->_visa.dixi('U', 10);
+					_vm->_visa->dixi('U', 10);
 
 				if (_vm->_gyro->whereis[_vm->_gyro->pdulustie] == _vm->_gyro->dna.room)
-					_vm->_visa.dixi('U', 15);
+					_vm->_visa->dixi('U', 15);
 				break;
 			case 52:
 				if (_vm->_gyro->dna.room == r__musicroom)
 					play_harp();
 				else
-					_vm->_scrolls.display(what);
+					_vm->_scrolls->display(what);
 				break;
 			case 55:
 				if (_vm->_gyro->dna.room == r__argentpub)
 					;  /*play_nim(); - Don't implement yet.*/
 				else
-					_vm->_scrolls.display(what);
+					_vm->_scrolls->display(what);
 				break;
 			default:
-				_vm->_scrolls.display(what);
+				_vm->_scrolls->display(what);
 			}
 		}
 		break;
 	case vb_ring:
 		if (holding()) {
 			if (thing == _vm->_gyro->bell) {
-				_vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
-					_vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)");
+					_vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)");
 			} else
-				_vm->_scrolls.display(what);
+				_vm->_scrolls->display(what);
 		}
 		break;
 	case vb_help:
@@ -1238,10 +1238,10 @@ void Acci::do_that() {
 		// I don't want to implement help yet.
 		break;
 	case vb_larrypass:
-		_vm->_scrolls.display("Wrong game!");
+		_vm->_scrolls->display("Wrong game!");
 		break;
 	case vb_phaon:
-		_vm->_scrolls.display("Hello, Phaon!");
+		_vm->_scrolls->display("Hello, Phaon!");
 		break;
 	case vb_boss:
 		// bosskey();
@@ -1249,72 +1249,72 @@ void Acci::do_that() {
 		break;
 	case vb_pee:
 		if (_vm->_gyro->flagset('P')) {
-			_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
+			_vm->_scrolls->display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
 		} else
-			_vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
+			_vm->_scrolls->display("It would be \6VERY\22 unwise to do that here, Avvy!");
 		break;
 	case vb_cheat:
-		_vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled.");
+		_vm->_scrolls->display(Common::String('\6') + "Cheat mode now enabled.");
 		_vm->_gyro->cheat = true;
 		break;
 	case vb_magic:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa.dixi('q', 19);
+			_vm->_visa->dixi('q', 19);
 		else {
-			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip.infield(2))) {
+			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) {
 				/* Avaricius appears! */
-				_vm->_visa.dixi('q', 17);
+				_vm->_visa->dixi('q', 17);
 				if (_vm->_gyro->whereis['\227'] == 12)
-					_vm->_visa.dixi('q', 18);
+					_vm->_visa->dixi('q', 18);
 				else {
-					_vm->_trip.tr[2].init(1, false, &_vm->_trip); /* Avaricius */
-					_vm->_trip.apped(2, 4);
-					_vm->_trip.tr[2].walkto(5);
-					_vm->_trip.tr[2].call_eachstep = true;
-					_vm->_trip.tr[2].eachstep = _vm->_trip.procback_and_forth;
+					_vm->_trip->tr[2].init(1, false, _vm->_trip); /* Avaricius */
+					_vm->_trip->apped(2, 4);
+					_vm->_trip->tr[2].walkto(5);
+					_vm->_trip->tr[2].call_eachstep = true;
+					_vm->_trip->tr[2].eachstep = _vm->_trip->procback_and_forth;
 					_vm->_gyro->dna.avaricius_talk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
 			} else
-				_vm->_scrolls.display("Nothing appears to happen...");
+				_vm->_scrolls->display("Nothing appears to happen...");
 		}
 		break;
 	case vb_smartalec:
-		_vm->_scrolls.display("Listen, smart alec, that was just rhetoric.");
+		_vm->_scrolls->display("Listen, smart alec, that was just rhetoric.");
 		break;
 	case vb_expletive:
 		switch (_vm->_gyro->dna.swore) {
 		case 0:
-			_vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
+			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
 					"(I shouldn't say it again, if I were you!)");
 			break;
 		case 1:
-			_vm->_scrolls.display(Common::String("You hear a distant rumble of thunder. Must you always ") +
+			_vm->_scrolls->display(Common::String("You hear a distant rumble of thunder. Must you always ") +
 					"do things I tell you not to?\r\rDon't do it again!");
 			break;
 		default:
 			_vm->_pingo->zonk();
-			_vm->_scrolls.display(Common::String("A crack of lightning shoots from the sky, ") +
+			_vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, ") +
 					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
-			_vm->_lucerna.gameover();
+			_vm->_lucerna->gameover();
 		}
 		_vm->_gyro->dna.swore++;
 		break;
 	case vb_listen:
 		if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
-			_vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") +
+			_vm->_scrolls->display(Common::String("All other noise is drowned out by the ringing of ") +
 					"the bells.");
 		else if (_vm->_gyro->listen == "")
-			_vm->_scrolls.display("You can't hear anything much at the moment, Avvy.");
+			_vm->_scrolls->display("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_scrolls.display(_vm->_gyro->listen);
+			_vm->_scrolls->display(_vm->_gyro->listen);
 		break;
 	case vb_buy:
 		/* What are they trying to buy? */
 		switch (_vm->_gyro->dna.room) {
 		case r__argentpub:
-			if (_vm->_trip.infield(6)) {
+			if (_vm->_trip->infield(6)) {
 				/* We're in a pub, and near the bar. */
 				switch (thing) {
 				case '\63':
@@ -1322,22 +1322,22 @@ void Acci::do_that() {
 				case '\66':
 				case '\72': /* Beer, whisky, cider or mead */
 					if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
-						_vm->_visa.dixi('D', 15);
+						_vm->_visa->dixi('D', 15);
 						return;
 					}
 
 					if (_vm->_gyro->dna.teetotal)  {
-						_vm->_visa.dixi('D', 6);
+						_vm->_visa->dixi('D', 6);
 						return;
 					}
 
 					if (_vm->_gyro->dna.alcohol == 0)
-						_vm->_lucerna.points(3);
-					_vm->_celer.show_one(12);
-					_vm->_scrolls.display(booze[thing] + ", please.\231\2");
+						_vm->_lucerna->points(3);
+					_vm->_celer->show_one(12);
+					_vm->_scrolls->display(booze[thing] + ", please.\231\2");
 					_vm->_gyro->dna.drinking = thing;
 
-					_vm->_celer.show_one(10);
+					_vm->_celer->show_one(10);
 					_vm->_gyro->dna.malagauche = 177;
 					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
@@ -1346,23 +1346,23 @@ void Acci::do_that() {
 					break; /* We have a right one here- buy Pepsi??! */
 				case _vm->_gyro->wine:
 					if (_vm->_gyro->dna.obj[_vm->_gyro->wine])  /* We've already got the wine! */
-						_vm->_visa.dixi('D', 2); /* 1 bottle's shufishent! */
+						_vm->_visa->dixi('D', 2); /* 1 bottle's shufishent! */
 					else {
 						if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
-							_vm->_visa.dixi('D', 15);
+							_vm->_visa->dixi('D', 15);
 							return;
 						}
 
 						if (_vm->_gyro->dna.carrying >= maxobjs) {
-							_vm->_scrolls.display("Your hands are full.");
+							_vm->_scrolls->display("Your hands are full.");
 							return;
 						}
 
-						_vm->_celer.show_one(12);
-						_vm->_scrolls.display("Wine, please.\231\2");
+						_vm->_celer->show_one(12);
+						_vm->_scrolls->display("Wine, please.\231\2");
 						if (_vm->_gyro->dna.alcohol == 0)
-							_vm->_lucerna.points(3);
-						_vm->_celer.show_one(10);
+							_vm->_lucerna->points(3);
+						_vm->_celer->show_one(10);
 						_vm->_gyro->dna.malagauche = 177;
 
 						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
@@ -1370,41 +1370,41 @@ void Acci::do_that() {
 					break;
 				}
 			} else
-				_vm->_visa.dixi('D', 5);
+				_vm->_visa->dixi('D', 5);
 			break;                /* Go to the bar! */
 
 		case r__outsideducks:
-			if (_vm->_trip.infield(6)) {
+			if (_vm->_trip->infield(6)) {
 				if (thing == _vm->_gyro->onion) {
 					if (_vm->_gyro->dna.obj[_vm->_gyro->onion])
-						_vm->_visa.dixi('D', 10); /* not planning to juggle with the things! */
+						_vm->_visa->dixi('D', 10); /* not planning to juggle with the things! */
 					else if (_vm->_gyro->dna.carrying >= maxobjs)
-						_vm->_scrolls.display("Before you ask, you remember that your hands are full.");
+						_vm->_scrolls->display("Before you ask, you remember that your hands are full.");
 					else {
 						if (_vm->_gyro->dna.bought_onion)
-							_vm->_visa.dixi('D', 11);
+							_vm->_visa->dixi('D', 11);
 						else {
-							_vm->_visa.dixi('D', 9);
-							_vm->_lucerna.points(3);
+							_vm->_visa->dixi('D', 9);
+							_vm->_lucerna->points(3);
 						}
 						_vm->_gyro->pennycheck(3); /* It costs thruppence. */
 						_vm->_gyro->dna.obj[_vm->_gyro->onion] = true;
-						_vm->_lucerna.objectlist();
+						_vm->_lucerna->objectlist();
 						_vm->_gyro->dna.bought_onion = true;
 						_vm->_gyro->dna.rotten_onion = false; /* It's OK when it leaves the stall! */
 						_vm->_gyro->dna.onion_in_vinegar = false;
 					}
 				} else
-					_vm->_visa.dixi('D', 0);
+					_vm->_visa->dixi('D', 0);
 			} else
-				_vm->_visa.dixi('D', 0);
+				_vm->_visa->dixi('D', 0);
 			break;
 
 		case r__nottspub:
-			_vm->_visa.dixi('n', 15);
+			_vm->_visa->dixi('n', 15);
 			break; /* Can't sell to southerners. */
 		default:
-			_vm->_visa.dixi('D', 0); /* Can't buy that. */
+			_vm->_visa->dixi('D', 0); /* Can't buy that. */
 		}
 		break;
 	case vb_attack:
@@ -1415,39 +1415,39 @@ void Acci::do_that() {
 				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
 					3 = both. */
 			case 0:
-				_vm->_visa.dixi('Q', 10);
-				_vm->_scrolls.display("(At the very least, don't use your bare hands!)");
+				_vm->_visa->dixi('Q', 10);
+				_vm->_scrolls->display("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_scrolls.display(Common::String("Attack _vm->_gyro->him with only a crossbow bolt? Are you ") +
+				_vm->_scrolls->display(Common::String("Attack _vm->_gyro->him with only a crossbow bolt? Are you ") +
 						"planning on playing darts?!");
 				break;
 			case 2:
-				_vm->_scrolls.display(Common::String("Come on, Avvy! You're not going to get very far ") +
+				_vm->_scrolls->display(Common::String("Come on, Avvy! You're not going to get very far ") +
 						"with only a crossbow!");
 				break;
 			case 3:
-				_vm->_visa.dixi('Q', 11);
+				_vm->_visa->dixi('Q', 11);
 				_vm->_gyro->dna.cwytalot_gone = true;
 				_vm->_gyro->dna.obj[_vm->_gyro->bolt] = false;
 				_vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false;
-				_vm->_lucerna.objectlist();
+				_vm->_lucerna->objectlist();
 				_vm->_gyro->magics[12].op = _vm->_gyro->nix;
-				_vm->_lucerna.points(7);
-				_vm->_trip.tr[2].walkto(2);
-				_vm->_trip.tr[2].vanishifstill = true;
-				_vm->_trip.tr[2].call_eachstep = false;
+				_vm->_lucerna->points(7);
+				_vm->_trip->tr[2].walkto(2);
+				_vm->_trip->tr[2].vanishifstill = true;
+				_vm->_trip->tr[2].call_eachstep = false;
 				_vm->_gyro->whereis['\235'] = 177;
 				break;
 			default:
-				_vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */
+				_vm->_visa->dixi('Q', 10); /* Please try not to be so violent! */
 			}
 		} else
-			_vm->_visa.dixi('Q', 10);
+			_vm->_visa->dixi('Q', 10);
 		break;
 	case vb_password:
 		if (_vm->_gyro->dna.room != r__bridge)
-			_vm->_visa.dixi('Q', 12);
+			_vm->_visa->dixi('Q', 12);
 		else {
 			ok = true;
 			for (ff = 1; ff <= thats.size(); ff++) {
@@ -1461,25 +1461,25 @@ void Acci::do_that() {
 
 			if (ok) {
 				if (_vm->_gyro->dna.drawbridge_open != 0)
-					_vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again.");
+					_vm->_scrolls->display("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
-					_vm->_lucerna.points(4);
-					_vm->_scrolls.display("The drawbridge opens!");
+					_vm->_lucerna->points(4);
+					_vm->_scrolls->display("The drawbridge opens!");
 					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
 					_vm->_gyro->dna.drawbridge_open = 1;
 				}
 			} else
-				_vm->_visa.dixi('Q', 12);
+				_vm->_visa->dixi('Q', 12);
 		}
 		break;
 	case vb_dir:
-		_vm->_enid.dir(realwords[2]);
+		_vm->_enid->dir(realwords[2]);
 		break;
 	case vb_die:
-		_vm->_lucerna.gameover();
+		_vm->_lucerna->gameover();
 		break;
 	case vb_score:
-		_vm->_scrolls.display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ",\3\rout of a " +
+		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ",\3\rout of a " +
 				"possible 128.\r\rThis gives you a rank of " + rank() +
 				".\r\r" + totaltime());
 		break;
@@ -1492,23 +1492,23 @@ void Acci::do_that() {
 
 	case vb_kiss:
 		if (person == pardon)
-			_vm->_scrolls.display("Kiss whom?");
+			_vm->_scrolls->display("Kiss whom?");
 		else if (personshere()) {
 			switch (person) {
 			case _vm->_gyro->parkata:
-				_vm->_visa.dixi('U', 12);
+				_vm->_visa->dixi('U', 12);
 				break;
 			case _vm->_gyro->pgeida:
-				_vm->_visa.dixi('U', 13);
+				_vm->_visa->dixi('U', 13);
 				break;
 			case _vm->_gyro->pwisewoman:
-				_vm->_visa.dixi('U', 14);
+				_vm->_visa->dixi('U', 14);
 				break;
 			default:
-				_vm->_visa.dixi('U', 5); /* You WHAT? */
+				_vm->_visa->dixi('U', 5); /* You WHAT? */
 			}
 		} else if ((150 <= person) && (person <= 174))
-			_vm->_scrolls.display("Hey, what kind of a weirdo are you??");
+			_vm->_scrolls->display("Hey, what kind of a weirdo are you??");
 
 		break;
 
@@ -1516,7 +1516,7 @@ void Acci::do_that() {
 		if (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			cardiff_climbing();
 		else /* In the wrong room! */
-			_vm->_scrolls.display("Not with your head for heights, Avvy!");
+			_vm->_scrolls->display("Not with your head for heights, Avvy!");
 		break;
 
 	case vb_jump:
@@ -1537,66 +1537,66 @@ void Acci::do_that() {
 			case '\0':
 				if (!_vm->_gyro->dna.avvy_is_awake) {
 					_vm->_gyro->dna.avvy_is_awake = true;
-					_vm->_lucerna.points(1);
+					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->show_one(3); /* Picture of Avvy, awake in bed. */
 					if (_vm->_gyro->dna.teetotal)
-						_vm->_visa.dixi('d', 13);
+						_vm->_visa->dixi('d', 13);
 				} else
-					_vm->_scrolls.display("You're already awake, Avvy!");
+					_vm->_scrolls->display("You're already awake, Avvy!");
 				break;
 			case _vm->_gyro->payles:
 				if (!_vm->_gyro->dna.ayles_is_awake)
-					_vm->_scrolls.display("You can't seem to wake _vm->_gyro->him by yourself.");
+					_vm->_scrolls->display("You can't seem to wake _vm->_gyro->him by yourself.");
 				break;
 			case _vm->_gyro->pjacques:
-				_vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
+				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
 					"Hmmm... that doesn't seem to do any good...");
 				break;
 			default:
-				_vm->_scrolls.display("It's difficult to awaken people who aren't asleep...!");
+				_vm->_scrolls->display("It's difficult to awaken people who aren't asleep...!");
 		}
 		break;
 
 	case vb_sit:
 		if (_vm->_gyro->dna.room == r__nottspub) {
 			if (_vm->_gyro->dna.sitting_in_pub)
-				_vm->_scrolls.display("You're already sitting!");
+				_vm->_scrolls->display("You're already sitting!");
 			else {
-				_vm->_trip.tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */
+				_vm->_trip->tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */
 				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
 			}
 		} else {
 			/* Default doodah. */
-			_vm->_lucerna.dusk();
+			_vm->_lucerna->dusk();
 			_vm->_gyro->hang_around_for_a_while();
-			_vm->_lucerna.dawn();
-			_vm->_scrolls.display("A few hours later...\20nothing much has happened...");
+			_vm->_lucerna->dawn();
+			_vm->_scrolls->display("A few hours later...\20nothing much has happened...");
 		}
 		break;
 
 	case vb_restart:
-		if (_vm->_scrolls.ask("Restart game and lose changes?"))  {
-			_vm->_lucerna.dusk();
+		if (_vm->_scrolls->ask("Restart game and lose changes?"))  {
+			_vm->_lucerna->dusk();
 			_vm->_gyro->newgame();
-			_vm->_lucerna.dawn();
+			_vm->_lucerna->dawn();
 		}
 		break;
 
 	case pardon:
-		_vm->_scrolls.display("Hey, a verb would be helpful!");
+		_vm->_scrolls->display("Hey, a verb would be helpful!");
 		break;
 
 	case vb_hello:
 		person_speaks();
-		_vm->_scrolls.display("Hello.\2");
+		_vm->_scrolls->display("Hello.\2");
 		break;
 	case vb_thanks:
 		person_speaks();
-		_vm->_scrolls.display("That's OK.\2");
+		_vm->_scrolls->display("That's OK.\2");
 		break;
 	default:
-		_vm->_scrolls.display(Common::String('\7') + "Parser bug!");
+		_vm->_scrolls->display(Common::String('\7') + "Parser bug!");
 	}
 }
 
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 5650146..40cda48 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -130,7 +130,7 @@ public:
 
 
 
-	void setParent(AvalancheEngine *vm);
+	Acci(AvalancheEngine *vm);
 
 	void init();
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index e490ace..9194816 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -63,8 +63,18 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _enhanced;
 	delete _logger;
 	delete _pingo;
-
+	delete _scrolls;
+	delete _visa;
+	delete _lucerna;
+	delete _enid;
+	delete _celer;
+	delete _sequence;
 	delete _timeout;
+	delete _trip;
+	delete _acci;
+	delete _basher;
+	delete _dropdown;
+	delete _closing;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
@@ -75,25 +85,25 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_enhanced = new Enhanced(this);
 	_logger = new Logger(this);
 	_pingo = new Pingo(this);
-	_scrolls.setParent(this);
-	_visa.setParent(this);
-	_lucerna.setParent(this);
-	_enid.setParent(this);
-	_celer.setParent(this);
-	_sequence.setParent(this);
+	_scrolls = new Scrolls(this);
+	_visa = new Visa(this);
+	_lucerna = new Lucerna(this);
+	_enid = new Enid(this);
+	_celer = new Celer(this);
+	_sequence = new Sequence(this);
 	_timeout = new Timeout(this);
-	_trip.setParent(this);
-	_acci.setParent(this);
-	_basher.setParent(this);
-	_dropdown.setParent(this);
-	_closing.setParent(this);
+	_trip = new Trip(this);
+	_acci = new Acci(this);
+	_basher = new Basher(this);
+	_dropdown = new Dropdown(this);
+	_closing = new Closing(this);
 
 	_graphics->init();
 
-	_scrolls.init();
-	_lucerna.init();
-	_acci.init();
-	_basher.init();
+	_scrolls->init();
+	_lucerna->init();
+	_acci->init();
+	_basher->init();
 	
 
 	return Common::kNoError;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 66bfd22..f43b6a7 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -72,18 +72,18 @@ public:
 	Enhanced *_enhanced;
 	Logger *_logger;
 	Pingo *_pingo;
-	Scrolls _scrolls;
-	Visa _visa;
-	Lucerna _lucerna;
-	Enid _enid;
-	Celer _celer;
-	Sequence _sequence;
+	Scrolls *_scrolls;
+	Visa *_visa;
+	Lucerna *_lucerna;
+	Enid *_enid;
+	Celer *_celer;
+	Sequence *_sequence;
 	Timeout *_timeout;
-	Trip _trip;
-	Acci _acci;
-	Basher _basher;
-	Dropdown _dropdown;
-	Closing _closing;
+	Trip *_trip;
+	Acci *_acci;
+	Basher *_basher;
+	Dropdown *_dropdown;
+	Closing *_closing;
 
 
 	OSystem *_system;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 64f679f..4674cea 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -69,16 +69,16 @@ void Avalot::setup() {
 	_vm->_gyro->visible = _vm->_gyro->m_no;
 	_vm->_gyro->to_do = 0;
 	_vm->_gyro->lmo = false;
-	_vm->_scrolls.resetscroll();
+	_vm->_scrolls->resetscroll();
 	_vm->_gyro->setup_vmc();
 	_vm->_gyro->on_virtual();
 	gd = 3;
 	gm = 0;
 	//initgraph(gd: gm: "");
 	_vm->_gyro->holdthedawn = true;
-	_vm->_lucerna.dusk();
+	_vm->_lucerna->dusk();
 	_vm->_gyro->cmp = 177;
-	_vm->_lucerna.mouse_init();  /*on;*/
+	_vm->_lucerna->mouse_init();  /*on;*/
 	_vm->_gyro->dropsok = true;
 	_vm->_gyro->ctrl = ckey;
 	_vm->_gyro->oldjw = 177;
@@ -86,7 +86,7 @@ void Avalot::setup() {
 	_vm->_gyro->c = 999;
 	//settextjustify(0: 0);
 	_vm->_gyro->ddmnow = false;
-	_vm->_lucerna.load_digits();
+	_vm->_lucerna->load_digits();
 	_vm->_gyro->cheat = false;
 	_vm->_gyro->cp = 0;
 	_vm->_gyro->curpos = 1;
@@ -96,8 +96,8 @@ void Avalot::setup() {
 	/* TSkellern:=0; { Replace with a more local variable sometime }*/
 	_vm->_gyro->dna.rw = _vm->_gyro->stopped;
 	_vm->_gyro->enid_filename = ""; /* undefined. */
-	_vm->_lucerna.toolbar();
-	_vm->_scrolls.state(2);
+	_vm->_lucerna->toolbar();
+	_vm->_scrolls->state(2);
 	_vm->_graphics->refreshScreen(); //_vm->_pingo->copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
@@ -107,7 +107,7 @@ void Avalot::setup() {
 	  setactivepage(gd); outtextxy(7:177:chr(48+gd));
 	 end;*/
 
-	_vm->_trip.loadtrip();
+	_vm->_trip->loadtrip();
 
 	_vm->_gyro->reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
 
@@ -115,18 +115,18 @@ void Avalot::setup() {
 		_vm->_gyro->newgame(); /* no game was requested- load the default */
 	else {
 		if (! _vm->_gyro->reloaded)
-			_vm->_enid.avvy_background();
-		_vm->_dropdown.standard_bar();
-		_vm->_lucerna.sprite_run();
+			_vm->_enid->avvy_background();
+		_vm->_dropdown->standard_bar();
+		_vm->_lucerna->sprite_run();
 		if (_vm->_gyro->reloaded)
-			_vm->_enid.edna_reload();
+			_vm->_enid->edna_reload();
 		else {
 			/* Filename given on the command line (or loadfirst) */
-			_vm->_enid.edna_load(_vm->_gyro->filetoload);
-			if (_vm->_enid.there_was_a_problem()) {
-				_vm->_scrolls.display("So let's start from the beginning instead...");
+			_vm->_enid->edna_load(_vm->_gyro->filetoload);
+			if (_vm->_enid->there_was_a_problem()) {
+				_vm->_scrolls->display("So let's start from the beginning instead...");
 				_vm->_gyro->holdthedawn = true;
-				_vm->_lucerna.dusk();
+				_vm->_lucerna->dusk();
 				_vm->_gyro->newgame();
 			}
 		}
@@ -134,21 +134,21 @@ void Avalot::setup() {
 
 	if (! _vm->_gyro->reloaded) {
 		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
-		_vm->_lucerna.fxtoggle();
-		_vm->_lucerna.thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
+		_vm->_lucerna->fxtoggle();
+		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
 	}
 
-	_vm->_trip.get_back_loretta();
+	_vm->_trip->get_back_loretta();
 	//gm = getpixel(0: 0);
 	//setcolor(7);
 	_vm->_gyro->holdthedawn = false;
-	_vm->_lucerna.dawn();
+	_vm->_lucerna->dawn();
 	_vm->_gyro->cursoron = false;
-	_vm->_basher.cursor_on();
-	_vm->_trip.newspeed();
+	_vm->_basher->cursor_on();
+	_vm->_trip->newspeed();
 
 	if (! _vm->_gyro->reloaded)
-		_vm->_visa.dixi('q', 83); /* Info on the game: etc. */
+		_vm->_visa->dixi('q', 83); /* Info on the game: etc. */
 }
 
 
@@ -169,7 +169,7 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
-		_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
+		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 		break;
 	}
 }
@@ -180,19 +180,19 @@ void Avalot::run(Common::String arg) {
 	setup();
 
 	do {
-		_vm->_lucerna.clock_lucerna();
-		_vm->_basher.keyboard_link();
-		_vm->_dropdown.menu_link();
-		_vm->_trip.readstick();
+		_vm->_lucerna->clock_lucerna();
+		_vm->_basher->keyboard_link();
+		_vm->_dropdown->menu_link();
+		_vm->_trip->readstick();
 		_vm->_gyro->force_numlock();
-		_vm->_trip.get_back_loretta();
-		_vm->_trip.trippancy_link();
-		_vm->_celer.pics_link();
-		_vm->_lucerna.checkclick();
+		_vm->_trip->get_back_loretta();
+		_vm->_trip->trippancy_link();
+		_vm->_celer->pics_link();
+		_vm->_lucerna->checkclick();
 
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
 			_vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp);
-		_vm->_lucerna.flip_page(); /* <<<! */
+		_vm->_lucerna->flip_page(); /* <<<! */
 		_vm->_gyro->slowdown();
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
 			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
@@ -213,7 +213,7 @@ void Avalot::run(Common::String arg) {
 	//if (logging)
 	//	close(logfile);
 
-	_vm->_closing.end_of_program();
+	_vm->_closing->end_of_program();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 3f2b01b..0ce98e7 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -50,7 +50,7 @@
 namespace Avalanche {
 
 
-void Basher::setParent(AvalancheEngine *vm) {
+Basher::Basher(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index 1a97a85..eadf3dd 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -45,7 +45,7 @@ public:
 
 
 
-	void setParent(AvalancheEngine *vm);
+	Basher(AvalancheEngine *vm);
 
 	void init();
 
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index e73f51c..3cedb67 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -42,12 +42,9 @@ namespace Avalanche {
 const int16 Celer::on_disk = -1;
 
 
-Celer::Celer() {
-	num_chunks = 0;
-}
-
-void Celer::setParent(AvalancheEngine *vm) {
+Celer::Celer(AvalancheEngine *vm) {
 	_vm = vm;
+	num_chunks = 0;
 }
 
 void Celer::pics_link() {
@@ -121,11 +118,11 @@ void Celer::pics_link() {
 		}
 
 		if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { /* Normally. */
-			if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
+			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
 				xx = 3;
-			else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
+			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
 				xx = 2;
-			else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
+			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
 				xx = 4;
 
 			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@@ -160,11 +157,11 @@ void Celer::pics_link() {
 				xx = 4; /* du Lustie blinks */
 
 			/* Bearing of Avvy from du Lustie. */
-			else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+			else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
 					xx = 1; /* Middle. */
-			else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
+			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
 					xx = 2; /* Left. */
-			else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
+			else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
 				xx = 3; /* Right. */
 
 			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@@ -202,11 +199,11 @@ void Celer::pics_link() {
 
 	case r__nottspub:
 		/* Bearing of Avvy from Port. */
-		if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360)))
+		if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
 			xx = 2; /* Middle. */
-		else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180))
+		else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
 			xx = 6; /* Left. */
-		else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
+		else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
 			xx = 8; /* Right. */
 
 		if ((_vm->_gyro->roomtime % int32(60)) > 57)
@@ -231,12 +228,12 @@ void Celer::pics_link() {
 		if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
 			show_one(1 + (_vm->_gyro->roomtime / 3) % 3);
 
-		{/* _vm->_lucerna.bearing of Avvy from Duck. */
-		if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
+		{/* _vm->_lucerna->bearing of Avvy from Duck. */
+		if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
 			xx = 4; /* Middle. */
-		else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
+		else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
 			xx = 6; /* Left. */
-		else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
+		else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
 			xx = 8; /* Right. */
 
 		if ((_vm->_gyro->roomtime % int32(45)) > 42)
@@ -468,7 +465,7 @@ void Celer::show_one(byte which) {
 	warning("STUB: Celer::show_one()");
 
 	for (byte fv = 0; fv < 2; fv ++)
-		_vm->_trip.getset[fv].remember(r);
+		_vm->_trip->getset[fv].remember(r);
 }
 
 
@@ -517,7 +514,7 @@ void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
 	warning("STUB: Celer::show_one_at()");
 
 	for (byte fv = 0; fv < 2; fv ++)
-		_vm->_trip.getset[fv].remember(r);
+		_vm->_trip->getset[fv].remember(r);
 }
 
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 88baa3d..1d35005 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -65,9 +65,8 @@ public:
 	bytefield r;
 
 	
-	Celer();
 
-	void setParent(AvalancheEngine *vm);
+	Celer(AvalancheEngine *vm);
 
 	void pics_link();
 
diff --git a/engines/avalanche/closing2.cpp b/engines/avalanche/closing2.cpp
index 3336a5f..431b1af 100644
--- a/engines/avalanche/closing2.cpp
+++ b/engines/avalanche/closing2.cpp
@@ -38,12 +38,9 @@
 
 namespace Avalanche {
 
-Closing::Closing() {
-	warning("STUB: Closing::Closing()");
-}
-
-void Closing::setParent(AvalancheEngine *vm) {
+Closing::Closing(AvalancheEngine *vm) {
 	_vm = vm;
+	warning("STUB: Closing::Closing()");
 }
 
 void Closing::get_screen(byte which) {
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
index 122a8e2..ed73f9f 100644
--- a/engines/avalanche/closing2.h
+++ b/engines/avalanche/closing2.h
@@ -43,9 +43,7 @@ public:
 	static const int16 scr_nagscreen = 3;
 	static const int16 scr_twocopies = 5;
 
-	Closing();
-
-	void setParent(AvalancheEngine *vm);
+	Closing(AvalancheEngine *vm);
 
 	void quit_with(byte which, byte errorlev);
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 985eb7f..134a3b0 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -206,7 +206,7 @@ void menuset::update() {
 		ddms[fv].display();
 
 	for (page_ = 0; page_ <= 1; page_ ++)
-		_dr->_vm->_trip.getset[page_].remember(menuspace);
+		_dr->_vm->_trip->getset[page_].remember(menuspace);
 
 	_dr->_vm->_gyro->cp = savecp;
 }
@@ -246,7 +246,7 @@ void menuset::getmenu(int16 x) {
 
 
 
-void Dropdown::setParent(AvalancheEngine *vm) {
+Dropdown::Dropdown(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
@@ -255,26 +255,26 @@ void Dropdown::find_what_you_can_do_with_it() {
 	case _vm->_gyro->wine:
 	case _vm->_gyro->potion:
 	case _vm->_gyro->ink:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_drink;
 		break;
 	case _vm->_gyro->bell:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_ring;
 		break;
 	case _vm->_gyro->chastity:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
 		break;
 	case _vm->_gyro->lute:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_play;
 		break;
 	case _vm->_gyro->mushroom:
 	case _vm->_gyro->onion:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_eat;
 		break;
 	case _vm->_gyro->clothes:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
 		break;
 	default:
-		_vm->_gyro->verbstr = _vm->_acci.vb_exam; /* anything else */
+		_vm->_gyro->verbstr = _vm->_acci->vb_exam; /* anything else */
 	}
 }
 
@@ -310,7 +310,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 		}
 	}
 
-	_vm->_lucerna.blitfix();
+	_vm->_lucerna->blitfix();
 }
 
 void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
@@ -418,12 +418,12 @@ void Dropdown::ddm__action() {
 			ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
 		ddm_o.opt("Pause game", 'P', "f6", true);
 		if (_vm->_gyro->dna.room == 99)
-			ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip.neardoor());
+			ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip->neardoor());
 		else
-			ddm_o.opt("Open the door", 'O', "f7", _vm->_trip.neardoor());
+			ddm_o.opt("Open the door", 'O', "f7", _vm->_trip->neardoor());
 		ddm_o.opt("Look around", 'L', "f8", true);
 		ddm_o.opt("Inventory", 'I', "Tab", true);
-		if (_vm->_trip.tr[1].xs == _vm->_gyro->walk)
+		if (_vm->_trip->tr[1].xs == _vm->_gyro->walk)
 			ddm_o.opt("Run fast", 'R', "^R", true);
 		else
 			ddm_o.opt("Walk slowly", 'W', "^W", true);
@@ -501,19 +501,19 @@ void Dropdown::do__game() {
 	switch (ddm_o.choicenum) {
 		/* Help, boss, untrash screen. */
 	case 0:
-		_vm->_lucerna.callverb(_vm->_acci.vb_help);
+		_vm->_lucerna->callverb(_vm->_acci->vb_help);
 		break;
 	case 1:
-		_vm->_lucerna.callverb(_vm->_acci.vb_boss);
+		_vm->_lucerna->callverb(_vm->_acci->vb_boss);
 		break;
 	case 2:
-		_vm->_lucerna.major_redraw();
+		_vm->_lucerna->major_redraw();
 		break;
 	case 3:
-		_vm->_lucerna.callverb(_vm->_acci.vb_score);
+		_vm->_lucerna->callverb(_vm->_acci->vb_score);
 		break;
 	case 4:
-		_vm->_lucerna.callverb(_vm->_acci.vb_info);
+		_vm->_lucerna->callverb(_vm->_acci->vb_info);
 		break;
 	}
 }
@@ -522,26 +522,26 @@ void Dropdown::do__file() {
 	switch (ddm_o.choicenum) {
 		/* New game, load, save, save as, DOS shell, about, quit. */
 	case 0:
-		_vm->_lucerna.callverb(_vm->_acci.vb_restart);
+		_vm->_lucerna->callverb(_vm->_acci->vb_restart);
 		break;
 	case 1: {
-		_vm->_acci.realwords[2] = "";
-		_vm->_lucerna.callverb(_vm->_acci.vb_load);
+		_vm->_acci->realwords[2] = "";
+		_vm->_lucerna->callverb(_vm->_acci->vb_load);
 	}
 	break;
 	case 2: {
-		_vm->_acci.realwords[2] = "";
-		_vm->_lucerna.callverb(_vm->_acci.vb_save);
+		_vm->_acci->realwords[2] = "";
+		_vm->_lucerna->callverb(_vm->_acci->vb_save);
 	}
 	break;
 	case 3:
-		_vm->_basher.filename_edit();
+		_vm->_basher->filename_edit();
 		break;
 	case 4:
-		_vm->_enid.back_to_bootstrap(2);
+		_vm->_enid->back_to_bootstrap(2);
 		break;
 	case 5:
-		_vm->_lucerna.callverb(_vm->_acci.vb_quit);
+		_vm->_lucerna->callverb(_vm->_acci->vb_quit);
 		break;
 	}
 }
@@ -551,99 +551,99 @@ void Dropdown::do__action() {
 	switch (ddm_o.choicenum) {
 		/* Get up/pause game/open door/look/inv/walk-run */
 	case 0: {
-		_vm->_acci.person = _vm->_acci.pardon;
-		_vm->_acci.thing = _vm->_acci.pardon;
+		_vm->_acci->person = _vm->_acci->pardon;
+		_vm->_acci->thing = _vm->_acci->pardon;
 		n = _vm->_gyro->f5_does();
-		_vm->_lucerna.callverb(n[1]);
+		_vm->_lucerna->callverb(n[1]);
 	}
 	break;
 	case 1:
-		_vm->_lucerna.callverb(_vm->_acci.vb_pause);
+		_vm->_lucerna->callverb(_vm->_acci->vb_pause);
 		break;
 	case 2:
-		_vm->_lucerna.callverb(_vm->_acci.vb_open);
+		_vm->_lucerna->callverb(_vm->_acci->vb_open);
 		break;
 	case 3:
-		_vm->_lucerna.callverb(_vm->_acci.vb_look);
+		_vm->_lucerna->callverb(_vm->_acci->vb_look);
 		break;
 	case 4:
-		_vm->_lucerna.callverb(_vm->_acci.vb_inv);
+		_vm->_lucerna->callverb(_vm->_acci->vb_inv);
 		break;
 	case 5: {
-		if (_vm->_trip.tr[1].xs == _vm->_gyro->walk)  _vm->_trip.tr[1].xs = _vm->_gyro->run;
-		else _vm->_trip.tr[1].xs = _vm->_gyro->walk;
-		_vm->_trip.newspeed();
+		if (_vm->_trip->tr[1].xs == _vm->_gyro->walk)  _vm->_trip->tr[1].xs = _vm->_gyro->run;
+		else _vm->_trip->tr[1].xs = _vm->_gyro->walk;
+		_vm->_trip->newspeed();
 	}
 	break;
 	}
 }
 
 void Dropdown::do__objects() {
-	_vm->_lucerna.thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
+	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
 }
 
 void Dropdown::do__people() {
-	_vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
+	_vm->_lucerna->thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
 	_vm->_gyro->last_person = people[ddm_o.choicenum + 1];
 }
 
 void Dropdown::do__with() {
-	_vm->_acci.thing = _vm->_gyro->thinks;
+	_vm->_acci->thing = _vm->_gyro->thinks;
 
 	if (_vm->_gyro->thinkthing) {
 
-		_vm->_acci.thing += 49;
+		_vm->_acci->thing += 49;
 
-		if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give)
-			_vm->_acci.person = _vm->_gyro->last_person;
+		if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci->vb_give)
+			_vm->_acci->person = _vm->_gyro->last_person;
 		else
-			_vm->_acci.person = '\376';
+			_vm->_acci->person = '\376';
 
 	} else {
 		switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) {
 		case '\144': {
-			_vm->_acci.thing = '\144';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\144';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Beer */
 		case '\145': {
-			_vm->_acci.thing = '\62';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\62';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Wine */
 		case '\146': {
-			_vm->_acci.thing = '\146';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\146';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Whisky */
 		case '\147': {
-			_vm->_acci.thing = '\147';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\147';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Cider */
 		case '\150': {
-			_vm->_acci.thing = '\153';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\153';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Mead */
 		case '\151': {
-			_vm->_acci.thing = '\103';
-			_vm->_lucerna.callverb(_vm->_acci.vb_buy);
+			_vm->_acci->thing = '\103';
+			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
 		break; /* Onion (trader) */
 		default: {
-			_vm->_acci.person = _vm->_acci.thing;
-			_vm->_acci.thing = '\376';
+			_vm->_acci->person = _vm->_acci->thing;
+			_vm->_acci->thing = '\376';
 		}
 		}
 	}
-	_vm->_lucerna.callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
+	_vm->_lucerna->callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
 }
 
 /*$F- That's all. Now for the ...bar funcs. */
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index abcc81b..51be377 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -122,8 +122,6 @@ public:
 	friend onemenu;
 	friend menuset;
 
-	void setParent(AvalancheEngine *vm);
-
 	onemenu ddm_o;
 	menuset ddm_m;
 
@@ -131,6 +129,8 @@ public:
 
 
 
+	Dropdown(AvalancheEngine *vm);
+
 	void find_what_you_can_do_with_it();
 
 	void parsekey(char r, char re);
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 7284b88..9b67359 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -45,7 +45,7 @@
 
 namespace Avalanche {
 
-void Enid::setParent(AvalancheEngine *vm) {
+Enid::Enid(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
@@ -117,7 +117,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 }
 
 void Enid::show_bug(char icon, Common::String strn) {
-	_vm->_scrolls.display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
+	_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
 }
 
 bool Enid::test_bug(byte what) {
@@ -150,9 +150,9 @@ void Enid::edna_save(Common::String name) {
 void Enid::loaderror(Common::String x, char icon) {
 	if (_vm->_gyro->holdthedawn) {
 		_vm->_gyro->holdthedawn = false;
-		_vm->_lucerna.dawn();
+		_vm->_lucerna->dawn();
 	}
-	_vm->_scrolls.display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
+	_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
 	bug = true;
 }
 
@@ -161,7 +161,7 @@ void Enid::edna_load(Common::String name) {
 }
 
 void Enid::showheader() {
-	_vm->_scrolls.display(Common::String("Dir: ") + path + "\r\r\4");
+	_vm->_scrolls->display(Common::String("Dir: ") + path + "\r\r\4");
 }
 
 void Enid::dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
@@ -246,7 +246,7 @@ void Enid::avvy_background() {    /* Not really a filing procedure,
 		@the_end:
 		end;
 	*/
-	_vm->_lucerna.blitfix();
+	_vm->_lucerna->blitfix();
 }
 
 void Enid::to_sundry(sundry &sund) {
@@ -277,17 +277,17 @@ void Enid::edna_reload() {
 	_vm->_gyro->seescroll = true;  /* This prevents display of the new sprites before the
 	new picture is loaded. */
 
-	_vm->_lucerna.major_redraw();
+	_vm->_lucerna->major_redraw();
 
 	_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
 
 	_vm->_gyro->alive = true;
 
-	_vm->_lucerna.objectlist();
+	_vm->_lucerna->objectlist();
 
 	if (_vm->_gyro->holdthedawn) {
 		_vm->_gyro->holdthedawn = false;
-		_vm->_lucerna.dawn();
+		_vm->_lucerna->dawn();
 	}
 }
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 87b81d3..6fac687 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -38,7 +38,7 @@ class AvalancheEngine;
 
 class Enid {
 public:
-	void setParent(AvalancheEngine *vm);
+	Enid(AvalancheEngine *vm);
 
 	void edna_save(Common::String name);
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index dd1157b..f759f89 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -348,19 +348,19 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 
 void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	for (byte gm = 0; gm < numtr; gm ++) {
-		if (_vm->_trip.tr[gm].quick)
-			_vm->_trip.tr[gm].done();
+		if (_vm->_trip->tr[gm].quick)
+			_vm->_trip->tr[gm].done();
 	}
 	/* Deallocate sprite. Sorry, beta testers! */
 
-	_vm->_trip.tr[0].init(0, true, &_vm->_trip);
+	_vm->_trip->tr[0].init(0, true, _vm->_trip);
 	alive = true;
 
 	score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
 	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
-	_vm->_scrolls.natural();
-	_vm->_basher.normal_edit();
-	_vm->_lucerna.mousepage(0);
+	_vm->_scrolls->natural();
+	_vm->_basher->normal_edit();
+	_vm->_lucerna->mousepage(0);
 	dna.spare_evening = "answer a questionnaire";
 	dna.like2drink = "beer";
 
@@ -372,12 +372,12 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	dna.obj[clothes] = true;
 	
 	thinks = 2;
-	_vm->_lucerna.objectlist();
+	_vm->_lucerna->objectlist();
 	ontoolbar = false;
 	seescroll = false;
 
 	ppos[0][1] = -177; 
-	_vm->_trip.tr[0].appear(300,117,right);
+	_vm->_trip->tr[0].appear(300,117,right);
 	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
 	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
 	him = 254;
@@ -393,16 +393,16 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 
 	for (byte gd = 0; gd <= 1; gd ++) {
 		cp = 1 - cp;
-		_vm->_trip.getback();
+		_vm->_trip->getback();
 	}
 
-	_vm->_lucerna.enterroom(1, 1);
-	_vm->_trip.new_game_for_trippancy();
-	_vm->_lucerna.showscore();
+	_vm->_lucerna->enterroom(1, 1);
+	_vm->_trip->new_game_for_trippancy();
+	_vm->_lucerna->showscore();
 
-	_vm->_dropdown.standard_bar();
-	_vm->_lucerna.clock_lucerna();
-	_vm->_lucerna.sprite_run();
+	_vm->_dropdown->standard_bar();
+	_vm->_lucerna->clock_lucerna();
+	_vm->_lucerna->sprite_run();
 }
 
 void Gyro::click() {   /* "Audio keyboard feedback" */
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c11a245..1d22deb 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -54,9 +54,7 @@
 
 namespace Avalanche {
 
-Lucerna::Lucerna() : fxhidden(false) {}
-
-void Lucerna::setParent(AvalancheEngine *vm) {
+Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 	_vm = vm;
 }
 
@@ -68,16 +66,16 @@ void Lucerna::init() {
 }
 	
 void Lucerna::callverb(char n) {
-	if (n == _vm->_acci.pardon) {
-		_vm->_scrolls.display(Common::String("The f5 key lets you do a particular action in certain ") +
+	if (n == _vm->_acci->pardon) {
+		_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
 			"situations. However, at the moment there is nothing " +
 			"assigned to it. You may press alt-A to see what the " +
 			"current setting of this key is.");
 	} else {
 		_vm->_gyro->weirdword = false;
-		_vm->_acci.polite = true;
-		_vm->_acci.verb = n;
-		_vm->_acci.do_that();
+		_vm->_acci->polite = true;
+		_vm->_acci->verb = n;
+		_vm->_acci->do_that();
 	}
 }
 
@@ -272,7 +270,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 
 	load_also(xx);
-	_vm->_celer.load_chunks(xx);
+	_vm->_celer->load_chunks(xx);
 
 	_vm->_graphics->refreshScreen(); // _vm->_pingo->copy03();  -  See Avalot::setup()
 
@@ -307,7 +305,7 @@ void Lucerna::find_people(byte room) {
 
 void Lucerna::exitroom(byte x) {
 	//nosound();
-	_vm->_celer.forget_chunks();
+	_vm->_celer->forget_chunks();
 	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
 
 	switch (x) {
@@ -340,7 +338,7 @@ void Lucerna::exitroom(byte x) {
 }
 
 void Lucerna::new_town() {   /* You've just entered a town from the map. */
-	_vm->_dropdown.standard_bar();
+	_vm->_dropdown->standard_bar();
 
 	switch (_vm->_gyro->dna.room) {
 	case r__outsidenottspub: /* Entry into Nottingham. */
@@ -371,10 +369,10 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 void Lucerna::put_geida_at(byte whichped, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_trip.tr[2].init(5, false, &_vm->_trip); /* load Geida */
-	_vm->_trip.apped(2, whichped);
-	_vm->_trip.tr[2].call_eachstep = true;
-	_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
+	_vm->_trip->tr[2].init(5, false, _vm->_trip); /* load Geida */
+	_vm->_trip->apped(2, whichped);
+	_vm->_trip->tr[2].call_eachstep = true;
+	_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
 }
 
 void Lucerna::enterroom(byte x, byte ped) {
@@ -405,7 +403,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	switch (x) {
 	case r__yours:
 		if (_vm->_gyro->dna.avvy_in_bed) {
-			_vm->_celer.show_one(3);
+			_vm->_celer->show_one(3);
 			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
 		}
 		break;
@@ -415,25 +413,25 @@ void Lucerna::enterroom(byte x, byte ped) {
 			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
 				_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
-				_vm->_trip.tr[2].init(8, false, &_vm->_trip); /* load Crapulus */
+				_vm->_trip->tr[2].init(8, false, _vm->_trip); /* load Crapulus */
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
-					_vm->_trip.apped(2, 4); /* Start on the right-hand side of the screen. */
-					_vm->_trip.tr[2].walkto(5); /* Walks up to greet you. */
+					_vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
+					_vm->_trip->tr[2].walkto(5); /* Walks up to greet you. */
 				} else {
-					_vm->_trip.apped(2, 5); /* Starts where he was before. */
-					_vm->_trip.tr[2].face = 3;
+					_vm->_trip->apped(2, 5); /* Starts where he was before. */
+					_vm->_trip->tr[2].face = 3;
 				}
 
-				_vm->_trip.tr[2].call_eachstep = true;
-				_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* He always faces Avvy. */
+				_vm->_trip->tr[2].call_eachstep = true;
+				_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
 
 			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
 
 			if (_vm->_gyro->dna.crapulus_will_tell) {
-				_vm->_trip.tr[2].init(8, false, &_vm->_trip);
-				_vm->_trip.apped(2, 2);
-				_vm->_trip.tr[2].walkto(4);
+				_vm->_trip->tr[2].init(8, false, _vm->_trip);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[2].walkto(4);
 				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
 				_vm->_gyro->dna.crapulus_will_tell = false;
 			}
@@ -452,15 +450,15 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__spludwicks:
 		if (_vm->_gyro->dna.spludwicks_here) {
 			if (ped > 0) {
-				_vm->_trip.tr[2].init(2, false, &_vm->_trip); /* load Spludwick */
-				_vm->_trip.apped(2, 2);
+				_vm->_trip->tr[2].init(2, false, _vm->_trip); /* load Spludwick */
+				_vm->_trip->apped(2, 2);
 				_vm->_gyro->whereis['\227'] = r__spludwicks;
 			}
 
 			_vm->_gyro->dna.dogfoodpos = 0;  /* _vm->_gyro->also Spludwick pos. */
 
-			_vm->_trip.tr[2].call_eachstep = true;
-			_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
+			_vm->_trip->tr[2].call_eachstep = true;
+			_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
 		} else _vm->_gyro->whereis['\227'] = r__nowhere;
 		break;
 
@@ -471,18 +469,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot*/
-				_vm->_trip.tr[2].call_eachstep = true;
-				_vm->_trip.tr[2].eachstep = _vm->_trip.procfollow_avvy_y;
+				_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot*/
+				_vm->_trip->tr[2].call_eachstep = true;
+				_vm->_trip->tr[2].eachstep = _vm->_trip->procfollow_avvy_y;
 				_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
 
 				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
-					_vm->_trip.apped(2, 2); /* He appears on the right of the screen... */
-					_vm->_trip.tr[2].walkto(4); /* ...and he walks up... */
+					_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
+					_vm->_trip->tr[2].walkto(4); /* ...and he walks up... */
 				} else {
 					/* You've been here before. */
-					_vm->_trip.apped(2, 4); /* He's standing in your way straight away... */
-					_vm->_trip.tr[2].face = _vm->_trip.left;
+					_vm->_trip->apped(2, 4); /* He's standing in your way straight away... */
+					_vm->_trip->tr[2].face = _vm->_trip->left;
 				}
 			}
 		}
@@ -493,10 +491,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 		dnatype &with = _vm->_gyro->dna;
 		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
-			_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot again*/
-			_vm->_trip.apped(2, 1);
-			_vm->_trip.tr[2].walkto(2);
-			_vm->_trip.tr[2].vanishifstill = true;
+			_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
+			_vm->_trip->apped(2, 1);
+			_vm->_trip->tr[2].walkto(2);
+			_vm->_trip->tr[2].vanishifstill = true;
 			with.cwytalot_in_herts = true;
 			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
@@ -506,7 +504,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__bridge: {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
-			_vm->_celer.show_one(3); /* Position of drawbridge */
+			_vm->_celer->show_one(3); /* Position of drawbridge */
 			_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
 		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 3, ped); /* load Geida */
@@ -517,9 +515,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.been_tied_up) {
 				/* A welcome party... or maybe not... */
-				_vm->_trip.tr[2].init(6, false, &_vm->_trip);
-				_vm->_trip.apped(2, 2);
-				_vm->_trip.tr[2].walkto(3);
+				_vm->_trip->tr[2].init(6, false, _vm->_trip);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[2].walkto(3);
 				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
 			}
 		}
@@ -530,10 +528,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_celer.show_one(2);
+			_vm->_celer->show_one(2);
 
 		if (! _vm->_gyro->dna.mushroom_growing) 
-			_vm->_celer.show_one(3);
+			_vm->_celer->show_one(3);
 	}
 	break;
 
@@ -541,9 +539,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0)
 			switch (_vm->_gyro->dna.cardiff_things) {
 			case 0 : { /* You've answered NONE of his questions. */
-				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
-				_vm->_trip.apped(2, 2);
-				_vm->_trip.tr[2].walkto(3);
+				_vm->_trip->tr[2].init(9, false, _vm->_trip);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[2].walkto(3);
 				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
 			}
 			break;
@@ -551,9 +549,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_gyro->magics[2].op = _vm->_gyro->nix;
 				break; /* You've answered ALL his questions. => nothing happens. */
 			default: { /* You've answered SOME of his questions. */
-				_vm->_trip.tr[2].init(9, false, &_vm->_trip);
-				_vm->_trip.apped(2, 3);
-				_vm->_trip.tr[2].face = _vm->_trip.right;
+				_vm->_trip->tr[2].init(9, false, _vm->_trip);
+				_vm->_trip->apped(2, 3);
+				_vm->_trip->tr[2].face = _vm->_trip->right;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
@@ -574,18 +572,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__argentpub: {
-		if (_vm->_gyro->dna.wonnim)  _vm->_celer.show_one(1);   /* No lute by the settle. */
+		if (_vm->_gyro->dna.wonnim)  _vm->_celer->show_one(1);   /* No lute by the settle. */
 		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
 		if (_vm->_gyro->dna.givenbadgetoiby) {
-			_vm->_celer.show_one(8);
-			_vm->_celer.show_one(9);
+			_vm->_celer->show_one(8);
+			_vm->_celer->show_one(9);
 		}
 	}
 	break;
 
 	case r__lustiesroom: {
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
-		if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */
+		if (_vm->_trip->tr[1].whichsprite == 0) /* Avvy in his normal clothes */
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
 		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
 			/* Presumably, Avvy dressed as a monk. */
@@ -593,7 +591,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(5, ped);
-			if (_vm->_gyro->dna.lustie_is_asleep)  _vm->_celer.show_one(5);
+			if (_vm->_gyro->dna.lustie_is_asleep)  _vm->_celer->show_one(5);
 		}
 	}
 	break;
@@ -601,96 +599,96 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__musicroom: {
 		if (_vm->_gyro->dna.jacques_awake > 0) {
 			_vm->_gyro->dna.jacques_awake = 5;
-			_vm->_celer.show_one(2);
-			_vm->_celer.show_one(4);
+			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(4);
 			_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0;
 		}
 		if (ped != 0) {
-			_vm->_celer.show_one(6);
-			_vm->_sequence.first_show(5);
-			_vm->_sequence.then_show(7);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(6);
+			_vm->_sequence->first_show(5);
+			_vm->_sequence->then_show(7);
+			_vm->_sequence->start_to_close();
 		}
 	}
 	break;
 
 	case r__outsidenottspub:
 		if (ped == 2) {
-			_vm->_celer.show_one(3);
-			_vm->_sequence.first_show(2);
-			_vm->_sequence.then_show(1);
-			_vm->_sequence.then_show(4);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(3);
+			_vm->_sequence->first_show(2);
+			_vm->_sequence->then_show(1);
+			_vm->_sequence->then_show(4);
+			_vm->_sequence->start_to_close();
 		}
 		break;
 
 	case r__outsideargentpub:
 		if (ped == 2)  {
-			_vm->_celer.show_one(6);
-			_vm->_sequence.first_show(5);
-			_vm->_sequence.then_show(7);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(6);
+			_vm->_sequence->first_show(5);
+			_vm->_sequence->then_show(7);
+			_vm->_sequence->start_to_close();
 		}
 		break;
 
 	case r__wisewomans: {
-		_vm->_trip.tr[2].init(11, false, &_vm->_trip);
+		_vm->_trip->tr[2].init(11, false, _vm->_trip);
 		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_trip.apped(2, 2); /* Start on the right-hand side of the screen. */
-			_vm->_trip.tr[2].walkto(4); /* Walks up to greet you. */
+			_vm->_trip->apped(2, 2); /* Start on the right-hand side of the screen. */
+			_vm->_trip->tr[2].walkto(4); /* Walks up to greet you. */
 		} else {
-			_vm->_trip.apped(2, 4); /* Starts where she was before. */
-			_vm->_trip.tr[2].face = 3;
+			_vm->_trip->apped(2, 4); /* Starts where she was before. */
+			_vm->_trip->tr[2].face = 3;
 		}
 
-		_vm->_trip.tr[2].call_eachstep = true;
-		_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* She always faces Avvy. */
+		_vm->_trip->tr[2].call_eachstep = true;
+		_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* She always faces Avvy. */
 	}
 	break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
-			_vm->_trip.tr[2].init(10, false, &_vm->_trip); /* Define the dart. */
-			_vm->_sequence.first_show(1);
+			_vm->_trip->tr[2].init(10, false, _vm->_trip); /* Define the dart. */
+			_vm->_sequence->first_show(1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
-				_vm->_sequence.then_show(3);
+				_vm->_sequence->then_show(3);
 			else
-				_vm->_sequence.then_show(2);
+				_vm->_sequence->then_show(2);
 
 			if (_vm->_gyro->dna.taken_pen)
-				_vm->_celer.show_one(4);
+				_vm->_celer->show_one(4);
 
-			_vm->_sequence.start_to_close();
+			_vm->_sequence->start_to_close();
 		} else {
-			_vm->_celer.show_one(1);
-			if (_vm->_gyro->dna.arrow_in_the_door)  _vm->_celer.show_one(3);
-			else _vm->_celer.show_one(2);
+			_vm->_celer->show_one(1);
+			if (_vm->_gyro->dna.arrow_in_the_door)  _vm->_celer->show_one(3);
+			else _vm->_celer->show_one(2);
 		}
 		break;
 
 	case r__avvysgarden:
 		if (ped == 1)  {
-			_vm->_celer.show_one(2);
-			_vm->_sequence.first_show(1);
-			_vm->_sequence.then_show(3);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(2);
+			_vm->_sequence->first_show(1);
+			_vm->_sequence->then_show(3);
+			_vm->_sequence->start_to_close();
 		}
 		break;
 
 	case r__entrancehall:
 	case r__insideabbey:
 		if (ped == 2)  {
-			_vm->_celer.show_one(2);
-			_vm->_sequence.first_show(1);
-			_vm->_sequence.then_show(3);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(2);
+			_vm->_sequence->first_show(1);
+			_vm->_sequence->then_show(3);
+			_vm->_sequence->start_to_close();
 		}
 		break;
 
 	case r__aylesoffice:
 		if (_vm->_gyro->dna.ayles_is_awake)
-			_vm->_celer.show_one(2);
+			_vm->_celer->show_one(2);
 		break; /* Ayles awake. */
 
 	case r__geidas:
@@ -707,7 +705,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__nottspub: {
-		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer.show_one(3);
+		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->show_one(3);
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 	}
 	break;
@@ -715,11 +713,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsideducks:
 		if (ped == 2) {
 			/* Shut the door */
-			_vm->_celer.show_one(3);
-			_vm->_sequence.first_show(2);
-			_vm->_sequence.then_show(1);
-			_vm->_sequence.then_show(4);
-			_vm->_sequence.start_to_close();
+			_vm->_celer->show_one(3);
+			_vm->_sequence->first_show(2);
+			_vm->_sequence->then_show(1);
+			_vm->_sequence->then_show(4);
+			_vm->_sequence->start_to_close();
 		}
 		break;
 	case r__ducks:
@@ -779,7 +777,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	setactivepage(1 - cp);*/
 
 	for (byte fv = 0; fv <= 1; fv ++)
-		_vm->_trip.getset[fv].remember(thinkspace);
+		_vm->_trip->getset[fv].remember(thinkspace);
 	
 	_vm->_gyro->on();
 	_vm->_gyro->thinkthing = th;
@@ -862,7 +860,7 @@ void Lucerna::showscore() {
 			_vm->_graphics->drawPicture(_vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
-		_vm->_trip.getset[fv].remember(scorespace);
+		_vm->_trip->getset[fv].remember(scorespace);
 
 	//setactivepage(1 - cp);
 
@@ -887,7 +885,7 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 
 void Lucerna::topcheck() {
 	/* Menuset */
-	_vm->_dropdown.ddm_m.getmenu(_vm->_gyro->mpx);
+	_vm->_dropdown->ddm_m.getmenu(_vm->_gyro->mpx);
 	/* Do this one */
 }
 
@@ -943,46 +941,46 @@ void Lucerna::verte() {
 		return;
 
 
-	/* _vm->_trip.tr[0] : that's the only one we're interested in here */
-	if (_vm->_gyro->mx < _vm->_trip.tr[0].x) 
+	/* _vm->_trip->tr[0] : that's the only one we're interested in here */
+	if (_vm->_gyro->mx < _vm->_trip->tr[0].x) 
 		what = 1;
-	else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl)) 
+	else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info.xl)) 
 		what = 2;
 	else
 		what = 0; /* On top */
 
-	if (_vm->_gyro->my < _vm->_trip.tr[0].y)
+	if (_vm->_gyro->my < _vm->_trip->tr[0].y)
 		what += 3;
-	else if (_vm->_gyro->my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl))
+	else if (_vm->_gyro->my > (unsigned char)(_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info.yl))
 		what += 6;
 
 	switch (what) {
 	case 0:
-		_vm->_trip.stopwalking();
+		_vm->_trip->stopwalking();
 		break; /* Clicked on Avvy- no movement */
 	case 1:
-		_vm->_trip.rwsp(1, _vm->_trip.left);
+		_vm->_trip->rwsp(1, _vm->_trip->left);
 		break;
 	case 2:
-		_vm->_trip.rwsp(1, _vm->_trip.right);
+		_vm->_trip->rwsp(1, _vm->_trip->right);
 		break;
 	case 3:
-		_vm->_trip.rwsp(1, _vm->_trip.up);
+		_vm->_trip->rwsp(1, _vm->_trip->up);
 		break;
 	case 4:
-		_vm->_trip.rwsp(1, _vm->_trip.ul);
+		_vm->_trip->rwsp(1, _vm->_trip->ul);
 		break;
 	case 5:
-		_vm->_trip.rwsp(1, _vm->_trip.ur);
+		_vm->_trip->rwsp(1, _vm->_trip->ur);
 		break;
 	case 6:
-		_vm->_trip.rwsp(1, _vm->_trip.down);
+		_vm->_trip->rwsp(1, _vm->_trip->down);
 		break;
 	case 7:
-		_vm->_trip.rwsp(1, _vm->_trip.dl);
+		_vm->_trip->rwsp(1, _vm->_trip->dl);
 		break;
 	case 8:
-		_vm->_trip.rwsp(1, _vm->_trip.dr);
+		_vm->_trip->rwsp(1, _vm->_trip->dr);
 		break;
 	}    /* no other values are possible... */
 
@@ -1209,7 +1207,7 @@ void Lucerna::delavvy() {
 
 	_vm->_gyro->off();
 	
-	triptype &with = _vm->_trip.tr[0];
+	triptype &with = _vm->_trip->tr[0];
 	for (page_ = 0; page_ <= 1; page_ ++)
 		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
 	
@@ -1223,16 +1221,16 @@ void Lucerna::gameover() {
 
 	_vm->_gyro->dna.user_moves_avvy = false;
 
-	sx = _vm->_trip.tr[1].x;
-	sy = _vm->_trip.tr[1].y;
+	sx = _vm->_trip->tr[1].x;
+	sy = _vm->_trip->tr[1].y;
 	
-	_vm->_trip.tr[1].done();
-	_vm->_trip.tr[1].init(12, true, &_vm->_trip);       /* 12 = Avalot falls */
-	_vm->_trip.tr[1].step = 0;
-	_vm->_trip.tr[1].appear(sx, sy, 0);
+	_vm->_trip->tr[1].done();
+	_vm->_trip->tr[1].init(12, true, _vm->_trip);       /* 12 = Avalot falls */
+	_vm->_trip->tr[1].step = 0;
+	_vm->_trip->tr[1].appear(sx, sy, 0);
 	
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
-	/* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
+	/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
 	_vm->_gyro->alive = false;
 }
 
@@ -1247,7 +1245,7 @@ void Lucerna::minor_redraw() {
 
 	for (fv = 0; fv <= 1; fv ++) {
 		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
-		_vm->_trip.getback();
+		_vm->_trip->getback();
 	}
 	
 	for (byte i = 0; i < 3; i++)
@@ -1268,16 +1266,16 @@ uint16 Lucerna::bearing(byte whichped) {
 	uint16 bearing_result; 
 	{
 		pedtype &with = _vm->_gyro->peds[whichped];
-		if (_vm->_trip.tr[1].x == with.x)
+		if (_vm->_trip->tr[1].x == with.x)
 			bearing_result = 0; /* This would cause a division by zero if we let it through. */
 		else {
 			/*
-			 bearing:=trunc(((arctan((_vm->_trip.tr[1].y-y)/(_vm->_trip.tr[1].x-x)))*rad2deg)+90) mod 360*/
+			 bearing:=trunc(((arctan((_vm->_trip->tr[1].y-y)/(_vm->_trip->tr[1].x-x)))*rad2deg)+90) mod 360*/
 		
-			if (_vm->_trip.tr[1].x < with.x)
-				bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 90;
+			if (_vm->_trip->tr[1].x < with.x)
+				bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 90;
 			else
-				bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 270;
+				bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 270;
 		}
 	}
 	return bearing_result;
@@ -1293,8 +1291,8 @@ void Lucerna::sprite_run() {
 	_vm->_gyro->doing_sprite_run = true;
 
 	for (fv = 0; fv <= 1; fv ++) {
-		_vm->_trip.get_back_loretta();
-		_vm->_trip.trippancy_link();
+		_vm->_trip->get_back_loretta();
+		_vm->_trip->trippancy_link();
 
 		flip_page();
 	}
@@ -1306,7 +1304,7 @@ void Lucerna::sprite_run() {
 void Lucerna::fix_flashers() {
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->oldrw = 177;
-	_vm->_scrolls.state(2);
+	_vm->_scrolls->state(2);
 	showrw();
 }
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 6a62a7d..7486b0d 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -38,9 +38,7 @@ class AvalancheEngine;
 
 class Lucerna {
 public:
-	Lucerna();
-
-	void setParent(AvalancheEngine *vm);
+	Lucerna(AvalancheEngine *vm);
 
 	void init();
 
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 7b34167..00c9978 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -111,7 +111,7 @@ void Pingo::winning_pic() {
 	Common::File f;
 	char r;
 
-	_vm->_lucerna.dusk();
+	_vm->_lucerna->dusk();
 
 	if (!f.open("finale.avd")) {
 		warning("AVALANCHE: Lucerna: File not found: finale.avd");
@@ -128,12 +128,12 @@ void Pingo::winning_pic() {
 	warning("STUB: Pingo::winning_pic()");
 
 	f.close();
-	_vm->_lucerna.blitfix();
+	_vm->_lucerna->blitfix();
 
 	//setvisualpage(0);
 	warning("STUB: Pingo::winning_pic()");
 
-	_vm->_lucerna.dawn();
+	_vm->_lucerna->dawn();
 
 	/*do {
 		_vm->_gyro->check();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 0a76168..6335863 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -47,7 +47,7 @@
 
 namespace Avalanche {
 
-void Scrolls::setParent(AvalancheEngine *vm) {
+Scrolls::Scrolls(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
@@ -154,7 +154,7 @@ void Scrolls::resetscrolldriver() {   /* phew */
 void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little... */
 	byte fv;
 
-	for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */
+	for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna->errorled(); /* ring the bell "x" times */
 }
 
 void Scrolls::dodgem() {     /* This moves the mouse pointer off the scroll so that you can read it. */
@@ -329,7 +329,7 @@ void Scrolls::musical_scroll() {
 	display(Common::String("To play the harp...\r\rUse these keys:\r\n") +
 	        "Q W E R T Y U I O P [ ]\r\rOr press Enter to stop playing.\4");
 
-	_vm->_lucerna.sprite_run();
+	_vm->_lucerna->sprite_run();
 
 	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 2536e66..5fdbab7 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -45,10 +45,10 @@ public:
 
 
 
+	Scrolls(AvalancheEngine *vm);
+	
 	void init();
 
-	void setParent(AvalancheEngine *vm);
-
 	void state(byte x);      /* Sets "Ready" light to whatever */
 
 	void drawscroll(func2 gotoit);      /* This is one of the oldest funcs in the game. */
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 5edb00a..bdc809e 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -39,7 +39,7 @@
 
 namespace Avalanche {
 
-void Sequence::setParent(AvalancheEngine *vm) {
+Sequence::Sequence(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
@@ -77,7 +77,7 @@ void Sequence::start_to_close() {
 
 void Sequence::start_to_open() {
 	_vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */
-	_vm->_trip.stopwalking(); /* And they're not moving now. */
+	_vm->_trip->stopwalking(); /* And they're not moving now. */
 	start_to_close(); /* Apart from that, it's the same thing. */
 }
 
@@ -95,7 +95,7 @@ void Sequence::call_sequencer() {
 		break; /* No more routines. */
 	case 177:
 		_vm->_gyro->dna.user_moves_avvy = true;
-		_vm->_trip.fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
+		_vm->_trip->fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
 		if (seq[0] == 177)
 			shove_left();
 		break;
@@ -103,7 +103,7 @@ void Sequence::call_sequencer() {
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
 		/* Show a frame. */
-		_vm->_celer.show_one(seq[1]);
+		_vm->_celer->show_one(seq[1]);
 		shove_left();
 	}
 	
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
index 7bd79bc..d93cf42 100644
--- a/engines/avalanche/sequence2.h
+++ b/engines/avalanche/sequence2.h
@@ -46,7 +46,7 @@ public:
 	byte seq[seq_length];
 
 
-	void setParent(AvalancheEngine *vm);
+	Sequence(AvalancheEngine *vm);
 
 	void first_show(byte what);
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 9deae84..7a10d67 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -142,13 +142,13 @@ void Timeout::one_tick() {
 					jump();
 					break;
 				case procsequence:
-					_vm->_sequence.call_sequencer();
+					_vm->_sequence->call_sequencer();
 					break;
 				case proccrapulus_splud_out:
 					crapulus_says_splud_out();
 					break;
 				case procdawn_delay:
-					_vm->_lucerna.dawn();
+					_vm->_lucerna->dawn();
 					break;
 				case procbuydrinks:
 					buydrinks();
@@ -239,7 +239,7 @@ end;*/
 
 void Timeout::open_drawbridge() {
 	_vm->_gyro->dna.drawbridge_open++;
-	_vm->_celer.show_one(_vm->_gyro->dna.drawbridge_open - 1);
+	_vm->_celer->show_one(_vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
@@ -250,39 +250,39 @@ void Timeout::open_drawbridge() {
 /* --- */
 
 void Timeout::avaricius_talks() {
-	_vm->_visa.dixi('q', _vm->_gyro->dna.avaricius_talk);
+	_vm->_visa->dixi('q', _vm->_gyro->dna.avaricius_talk);
 	_vm->_gyro->dna.avaricius_talk++;
 
 	if (_vm->_gyro->dna.avaricius_talk < 17)
 		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
 	else
-		_vm->_lucerna.points(3);
+		_vm->_lucerna->points(3);
 }
 
 void Timeout::urinate() {
-	_vm->_trip.tr[1].turn(_vm->_trip.up);
-	_vm->_trip.stopwalking();
-	_vm->_lucerna.showrw();
+	_vm->_trip->tr[1].turn(_vm->_trip->up);
+	_vm->_trip->stopwalking();
+	_vm->_lucerna->showrw();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
 }
 
 void Timeout::toilet2() {
-	_vm->_scrolls.display("That's better!");
+	_vm->_scrolls->display("That's better!");
 }
 
 void Timeout::bang() {
-	_vm->_scrolls.display("\6< BANG! >");
+	_vm->_scrolls->display("\6< BANG! >");
 	set_up_timer(30, procbang2, reason_explosion);
 }
 
 void Timeout::bang2() {
-	_vm->_scrolls.display("Hmm... sounds like Spludwick's up to something...");
+	_vm->_scrolls->display("Hmm... sounds like Spludwick's up to something...");
 }
 
 void Timeout::stairs() {
 	_vm->_gyro->blip();
-	_vm->_trip.tr[0].walkto(4);
-	_vm->_celer.show_one(2);
+	_vm->_trip->tr[0].walkto(4);
+	_vm->_celer->show_one(2);
 	_vm->_gyro->dna.brummie_stairs = 2;
 	_vm->_gyro->magics[11].op = _vm->_gyro->special;
 	_vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */
@@ -293,68 +293,68 @@ void Timeout::cardiff_survey() {
 	switch (_vm->_gyro->dna.cardiff_things) {
 	case 0:
 		_vm->_gyro->dna.cardiff_things += 1;
-		_vm->_visa.dixi('q', 27);
+		_vm->_visa->dixi('q', 27);
 		break;
 	}
-	_vm->_visa.dixi('z', _vm->_gyro->dna.cardiff_things);
+	_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
 
 	_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
 
 void Timeout::cardiff_return() {
-	_vm->_visa.dixi('q', 28);
+	_vm->_visa->dixi('q', 28);
 	cardiff_survey(); /* add end of question. */
 }
 
 void Timeout::cwytalot_in_herts() {
-	_vm->_visa.dixi('q', 29);
+	_vm->_visa->dixi('q', 29);
 }
 
 void Timeout::get_tied_up() {
-	_vm->_visa.dixi('q', 34); /* ...Trouble! */
+	_vm->_visa->dixi('q', 34); /* ...Trouble! */
 	_vm->_gyro->dna.user_moves_avvy = false;
 	_vm->_gyro->dna.been_tied_up = true;
-	_vm->_trip.stopwalking();
-	_vm->_trip.tr[2].stopwalk();
-	_vm->_trip.tr[2].stophoming();
-	_vm->_trip.tr[2].call_eachstep = true;
-	_vm->_trip.tr[2].eachstep = _vm->_trip.procgrab_avvy;
+	_vm->_trip->stopwalking();
+	_vm->_trip->tr[2].stopwalk();
+	_vm->_trip->tr[2].stophoming();
+	_vm->_trip->tr[2].call_eachstep = true;
+	_vm->_trip->tr[2].eachstep = _vm->_trip->procgrab_avvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 
 void Timeout::get_tied_up2() {
-	_vm->_trip.tr[1].walkto(4);
-	_vm->_trip.tr[2].walkto(5);
+	_vm->_trip->tr[1].walkto(4);
+	_vm->_trip->tr[2].walkto(5);
 	_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
 	_vm->_gyro->dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
-	_vm->_trip.tr[2].check_me = false;
-	_vm->_trip.tr[1].init(7, true, &_vm->_trip); /* Robin Hood */
+	_vm->_trip->tr[2].check_me = false;
+	_vm->_trip->tr[1].init(7, true, _vm->_trip); /* Robin Hood */
 	_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
-	_vm->_trip.apped(1, 2);
-	_vm->_visa.dixi('q', 39);
-	_vm->_trip.tr[1].walkto(7);
+	_vm->_trip->apped(1, 2);
+	_vm->_visa->dixi('q', 39);
+	_vm->_trip->tr[1].walkto(7);
 	set_up_timer(55, prochang_around2, reason_hanging_around);
 }
 
 void Timeout::hang_around2() {
-	_vm->_visa.dixi('q', 40);
-	_vm->_trip.tr[2].vanishifstill = false;
-	_vm->_trip.tr[2].walkto(4);
+	_vm->_visa->dixi('q', 40);
+	_vm->_trip->tr[2].vanishifstill = false;
+	_vm->_trip->tr[2].walkto(4);
 	_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
-	_vm->_visa.dixi('q', 41);
-	_vm->_trip.tr[1].done();
-	_vm->_trip.tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+	_vm->_visa->dixi('q', 41);
+	_vm->_trip->tr[1].done();
+	_vm->_trip->tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
 
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
 	/* Immediately call the following proc (when you have a chance). */
 
 	_vm->_gyro->dna.tied_up = false;
 
-	_vm->_enid.back_to_bootstrap(1); /* Call the shoot-'em-up. */
+	_vm->_enid->back_to_bootstrap(1); /* Call the shoot-'em-up. */
 }
 
 void Timeout::after_the_shootemup() {
@@ -366,17 +366,17 @@ void Timeout::jacques_wakes_up() {
 
 	switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
 	case 1 :
-		_vm->_celer.show_one(1); /* Eyes open. */
-		_vm->_visa.dixi('Q', 45);
+		_vm->_celer->show_one(1); /* Eyes open. */
+		_vm->_visa->dixi('Q', 45);
 		break;
 	case 2 : /* Going through the door. */
-		_vm->_celer.show_one(2); /* Not on the floor. */
-		_vm->_celer.show_one(3); /* But going through the door. */
+		_vm->_celer->show_one(2); /* Not on the floor. */
+		_vm->_celer->show_one(3); /* But going through the door. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */
 		break;
 	case 3 :  /* Gone through the door. */
-		_vm->_celer.show_one(2); /* Not on the floor, either. */
-		_vm->_celer.show_one(4); /* He's gone... so the door's open. */
+		_vm->_celer->show_one(2); /* Not on the floor, either. */
+		_vm->_celer->show_one(4); /* He's gone... so the door's open. */
 		_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */
 		break;
 	}
@@ -385,7 +385,7 @@ void Timeout::jacques_wakes_up() {
 	if (_vm->_gyro->dna.jacques_awake == 5) {
 		_vm->_gyro->dna.ringing_bells = true;
 		_vm->_gyro->dna.ayles_is_awake = true;
-		_vm->_lucerna.points(2);
+		_vm->_lucerna->points(2);
 	}
 
 	switch (_vm->_gyro->dna.jacques_awake) {
@@ -403,29 +403,29 @@ void Timeout::jacques_wakes_up() {
 
 void Timeout::naughty_duke() {
 /* This is when the Duke comes in and takes your money. */
-	_vm->_trip.tr[2].init(9, false, &_vm->_trip); /* Here comes the Duke. */
-	_vm->_trip.apped(2, 1); /* He starts at the door... */
-	_vm->_trip.tr[2].walkto(3); /* He walks over to you. */
+	_vm->_trip->tr[2].init(9, false, _vm->_trip); /* Here comes the Duke. */
+	_vm->_trip->apped(2, 1); /* He starts at the door... */
+	_vm->_trip->tr[2].walkto(3); /* He walks over to you. */
 
 	/* Let's get the door opening. */
-	_vm->_celer.show_one(1);
-	_vm->_sequence.first_show(2);
-	_vm->_sequence.start_to_close();
+	_vm->_celer->show_one(1);
+	_vm->_sequence->first_show(2);
+	_vm->_sequence->start_to_close();
 
 	set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
 }
 
 void Timeout::naughty_duke2() {
-	_vm->_visa.dixi('q', 48); /* Ha ha, it worked again! */
-	_vm->_trip.tr[2].walkto(1); /* Walk to the door. */
-	_vm->_trip.tr[2].vanishifstill = true; /* Then go away! */
+	_vm->_visa->dixi('q', 48); /* Ha ha, it worked again! */
+	_vm->_trip->tr[2].walkto(1); /* Walk to the door. */
+	_vm->_trip->tr[2].vanishifstill = true; /* Then go away! */
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
 void Timeout::naughty_duke3() {
-	_vm->_celer.show_one(1);
-	_vm->_sequence.first_show(2);
-	_vm->_sequence.start_to_close();
+	_vm->_celer->show_one(1);
+	_vm->_sequence->first_show(2);
+	_vm->_sequence->start_to_close();
 }
 
 void Timeout::jump() {
@@ -433,7 +433,7 @@ void Timeout::jump() {
 
 	with.jumpstatus += 1;
 
-	triptype &with1 = _vm->_trip.tr[1];
+	triptype &with1 = _vm->_trip->tr[1];
 	switch (with.jumpstatus) {
 	case 1:
 	case 2:
@@ -465,80 +465,80 @@ void Timeout::jump() {
 	if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
 			&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			&& (_vm->_gyro->dna.arrow_in_the_door == true)
-			&& (_vm->_trip.infield(3))) { /* beside the wall*/
+			&& (_vm->_trip->infield(3))) { /* beside the wall*/
 		/* Grab the arrow! */
 		if (_vm->_gyro->dna.carrying >= maxobjs)
-			_vm->_scrolls.display("You fail to grab it, because your hands are full.");
+			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_celer.show_one(2);
+			_vm->_celer->show_one(2);
 			_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
 			_vm->_gyro->dna.obj[_vm->_gyro->bolt] = true;
-			_vm->_lucerna.objectlist();
-			_vm->_visa.dixi('q', 50);
-			_vm->_lucerna.points(3);
+			_vm->_lucerna->objectlist();
+			_vm->_visa->dixi('q', 50);
+			_vm->_lucerna->points(3);
 		}
 	}
 }
 
 void Timeout::crapulus_says_splud_out() {
-	_vm->_visa.dixi('q', 56);
+	_vm->_visa->dixi('q', 56);
 	_vm->_gyro->dna.crapulus_will_tell = false;
 }
 
 void Timeout::buydrinks() {
-	_vm->_celer.show_one(11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(11); /* Malagauche gets up again. */
 	_vm->_gyro->dna.malagauche = 0;
 
-	_vm->_visa.dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls.display message about it. */
+	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls->display message about it. */
 	_vm->_pingo->wobble(); /* Do the special effects. */
-	_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
+	_vm->_visa->dixi('D', 1); /* That'll be thruppence. */
 	if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
-		_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
-	_vm->_acci.have_a_drink();
+		_vm->_visa->dixi('D', 3); /* Tell 'em you paid up. */
+	_vm->_acci->have_a_drink();
 }
 
 void Timeout::buywine() {
-	_vm->_celer.show_one(11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(11); /* Malagauche gets up again. */
 	_vm->_gyro->dna.malagauche = 0;
 
-	_vm->_visa.dixi('D', 50); /* You buy the wine. */
-	_vm->_visa.dixi('D', 1); /* It'll be thruppence. */
+	_vm->_visa->dixi('D', 50); /* You buy the wine. */
+	_vm->_visa->dixi('D', 1); /* It'll be thruppence. */
 	if (_vm->_gyro->pennycheck(3)) {
-		_vm->_visa.dixi('D', 4); /* You paid up. */
+		_vm->_visa->dixi('D', 4); /* You paid up. */
 		_vm->_gyro->dna.obj[_vm->_gyro->wine] = true;
-		_vm->_lucerna.objectlist();
+		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.winestate = 1; /* OK Wine */
 	}
 }
 
 void Timeout::callsguards() {
-	_vm->_visa.dixi('Q', 58); /* GUARDS!!! */
-	_vm->_lucerna.gameover();
+	_vm->_visa->dixi('Q', 58); /* GUARDS!!! */
+	_vm->_lucerna->gameover();
 }
 
 void Timeout::greetsmonk() {
-	_vm->_visa.dixi('Q', 59);
+	_vm->_visa->dixi('Q', 59);
 	_vm->_gyro->dna.entered_lusties_room_as_monk = true;
 }
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro->magics[9].op = _vm->_gyro->nix;
-	_vm->_trip.tr[1].iy += 1; /* increments dx/dy! */
-	_vm->_trip.tr[1].y += _vm->_trip.tr[1].iy;   /* Dowwwn we go... */
+	_vm->_trip->tr[1].iy += 1; /* increments dx/dy! */
+	_vm->_trip->tr[1].y += _vm->_trip->tr[1].iy;   /* Dowwwn we go... */
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
 void Timeout::meet_avaroid() {
 	if (_vm->_gyro->dna.met_avaroid) {
-		_vm->_scrolls.display("You can't expect to be \6that\22 lucky twice in a row!");
-		_vm->_lucerna.gameover();
+		_vm->_scrolls->display("You can't expect to be \6that\22 lucky twice in a row!");
+		_vm->_lucerna->gameover();
 	} else {
-		_vm->_visa.dixi('Q', 60);
+		_vm->_visa->dixi('Q', 60);
 		_vm->_gyro->dna.met_avaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
-		triptype &with = _vm->_trip.tr[1];
-		with.face = _vm->_trip.left;
+		triptype &with = _vm->_trip->tr[1];
+		with.face = _vm->_trip->left;
 		with.x = 151;
 		with.ix = -3;
 		with.iy = -5;
@@ -548,7 +548,7 @@ void Timeout::meet_avaroid() {
 }
 
 void Timeout::rise_up_oubliette() {
-	triptype &with = _vm->_trip.tr[1];
+	triptype &with = _vm->_trip->tr[1];
 
 	with.visible = true;
 	with.iy += 1; /* decrements dx/dy! */
@@ -560,96 +560,96 @@ void Timeout::rise_up_oubliette() {
 }
 
 void Timeout::robin_hood_and_geida() {
-	_vm->_trip.tr[1].init(7, true, &_vm->_trip);
-	_vm->_trip.apped(1, 7);
-	_vm->_trip.tr[1].walkto(6);
-	_vm->_trip.tr[2].stopwalk();
-	_vm->_trip.tr[2].face = _vm->_trip.left;
+	_vm->_trip->tr[1].init(7, true, _vm->_trip);
+	_vm->_trip->apped(1, 7);
+	_vm->_trip->tr[1].walkto(6);
+	_vm->_trip->tr[2].stopwalk();
+	_vm->_trip->tr[2].face = _vm->_trip->left;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro->dna.geida_follows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
-	_vm->_visa.dixi('q', 66);
-	_vm->_trip.tr[1].walkto(2);
-	_vm->_trip.tr[2].walkto(2);
-	_vm->_trip.tr[1].vanishifstill = true;
-	_vm->_trip.tr[2].vanishifstill = true;
+	_vm->_visa->dixi('q', 66);
+	_vm->_trip->tr[1].walkto(2);
+	_vm->_trip->tr[2].walkto(2);
+	_vm->_trip->tr[1].vanishifstill = true;
+	_vm->_trip->tr[2].vanishifstill = true;
 	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
 }
 
 void Timeout::avalot_returns() {
-	_vm->_trip.tr[1].done();
-	_vm->_trip.tr[2].done();
-	_vm->_trip.tr[1].init(0, true, &_vm->_trip);
-	_vm->_trip.apped(1, 1);
-	_vm->_visa.dixi('q', 67);
+	_vm->_trip->tr[1].done();
+	_vm->_trip->tr[2].done();
+	_vm->_trip->tr[1].init(0, true, _vm->_trip);
+	_vm->_trip->apped(1, 1);
+	_vm->_visa->dixi('q', 67);
 	_vm->_gyro->dna.user_moves_avvy = true;
 }
 
 void Timeout::avvy_sit_down() {
 /* This is used when you sit down in the pub in Notts. It loops around so
 	that it will happen when Avvy stops walking. */
-	if (_vm->_trip.tr[1].homing)    /* Still walking */
+	if (_vm->_trip->tr[1].homing)    /* Still walking */
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
-		_vm->_celer.show_one(3);
+		_vm->_celer->show_one(3);
 		_vm->_gyro->dna.sitting_in_pub = true;
 		_vm->_gyro->dna.user_moves_avvy = false;
-		_vm->_trip.tr[1].visible = false;
+		_vm->_trip->tr[1].visible = false;
 	}
 }
 
 void Timeout::ghost_room_phew() {
-	_vm->_scrolls.display("\6PHEW!\22 You're glad to get out of \6there!");
+	_vm->_scrolls->display("\6PHEW!\22 You're glad to get out of \6there!");
 }
 
 void Timeout::arkata_shouts() {
 	if (_vm->_gyro->dna.teetotal)
 		return;
 
-	_vm->_visa.dixi('q', 76);
+	_vm->_visa->dixi('q', 76);
 	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
 }
 
 void Timeout::winning() {
-	_vm->_visa.dixi('q', 79);
+	_vm->_visa->dixi('q', 79);
 	_vm->_pingo->winning_pic();
 
 	do {
-		_vm->_lucerna.checkclick();
+		_vm->_lucerna->checkclick();
 	} while (!(_vm->_gyro->mrelease == 0));
-	_vm->_lucerna.callverb(_vm->_acci.vb_score);
-	_vm->_scrolls.display(" T H E    E N D ");
+	_vm->_lucerna->callverb(_vm->_acci->vb_score);
+	_vm->_scrolls->display(" T H E    E N D ");
 	_vm->_gyro->lmo = true;
 }
 
 void Timeout::avalot_falls() {
-	if (_vm->_trip.tr[1].step < 5) {
-		_vm->_trip.tr[1].step += 1;
+	if (_vm->_trip->tr[1].step < 5) {
+		_vm->_trip->tr[1].step += 1;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
 	} else
-		_vm->_scrolls.display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+		_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
-	if (_vm->_trip.tr[2].homing)
+	if (_vm->_trip->tr[2].homing)
 		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
 	else
 		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	_vm->_trip.tr[2].call_eachstep = true; /* So that normal procs will continue. */
+	_vm->_trip->tr[2].call_eachstep = true; /* So that normal procs will continue. */
 }
 
 void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */
-	_vm->_visa.dixi('Q', 86);
-	_vm->_lucerna.points(4);
+	_vm->_visa->dixi('Q', 86);
+	_vm->_lucerna->points(4);
 	_vm->_gyro->dna.lustie_is_asleep = true;
-	_vm->_sequence.first_show(5);
-	_vm->_sequence.then_show(6); /* He falls asleep... */
-	_vm->_sequence.start_to_close(); /* Not really closing, but we're using the same procedure. */
+	_vm->_sequence->first_show(5);
+	_vm->_sequence->then_show(6); /* He falls asleep... */
+	_vm->_sequence->start_to_close(); /* Not really closing, but we're using the same procedure. */
 }
 
 /* "This is all!" */
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 492c6bf..181cde8 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -234,7 +234,7 @@ void triptype::walk() {
 				break;
 			case _tr->_vm->_gyro->unfinished: {
 				bounce();
-				_tr->_vm->_scrolls.display("\7Sorry.\3\rThis place is not available yet!");
+				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
 			case _tr->_vm->_gyro->special:
@@ -265,7 +265,7 @@ void triptype::bounce() {
 	else
 		stopwalk();
 	_tr->_vm->_gyro->oncandopageswap = false;
-	_tr->_vm->_lucerna.showrw();
+	_tr->_vm->_lucerna->showrw();
 	_tr->_vm->_gyro->oncandopageswap = true;
 }
 
@@ -465,15 +465,13 @@ void getsettype::recall(bytefield &r) {
 
 
 
-Trip::Trip() {
+Trip::Trip(AvalancheEngine *vm) {
+	_vm = vm;
+
 	getsetclear();
 	mustexclaim = false;
 }
 
-void Trip::setParent(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
 void Trip::loadtrip() {
 	byte gm;
 
@@ -541,18 +539,18 @@ void Trip::catamove(byte ped) {
 	switch (xy_uint16) {
 	case 1801: /* Exit catacombs */
 		fliproom(r__lustiesroom, 4);
-		_vm->_scrolls.display("Phew! Nice to be out of there!");
+		_vm->_scrolls->display("Phew! Nice to be out of there!");
 		return;
 	case 1033: /* Oubliette */
 		fliproom(r__oubliette, 1);
-		_vm->_scrolls.display("Oh, NO!\231\2");
+		_vm->_scrolls->display("Oh, NO!\231\2");
 		return;
 	case 4:
 		fliproom(r__geidas, 1);
 		return;
 	case 2307:
 		fliproom(r__lusties, 5);
-		_vm->_scrolls.display("Oh no... here we go again...");
+		_vm->_scrolls->display("Oh no... here we go again...");
 		_vm->_gyro->dna.user_moves_avvy = false;
 		tr[1].iy = 1;
 		tr[1].ix = 0;
@@ -560,7 +558,7 @@ void Trip::catamove(byte ped) {
 	}
 
 	if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
-		_vm->_lucerna.load(29);
+		_vm->_lucerna->load(29);
 	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x];
 
 	switch (here & 0xf) { /* West. */
@@ -568,59 +566,59 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(28);
+		_vm->_celer->show_one(28);
 		break;
 	case 0x1: /* no connection (wall + shield), */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(29); /* ...shield. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(29); /* ...shield. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(30); /* ...door. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(30); /* ...door. */
 		break;
 	case 0x3: /* wall with door and shield */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(30); /* ...door, and... */
-		_vm->_celer.show_one(29); /* ...shield. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(30); /* ...door, and... */
+		_vm->_celer->show_one(29); /* ...shield. */
 		break;
 	case 0x4: /* no connection (wall + window), */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(5);  /* ...window. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(5);  /* ...window. */
 		break;
 	case 0x5: /* wall with door and window */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(30); /* ...door, and... */
-		_vm->_celer.show_one(5); /* ...window. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(30); /* ...door, and... */
+		_vm->_celer->show_one(5); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(7); /* ...torches. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(7); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(28); /* Wall, plus... */
-		_vm->_celer.show_one(30); /* ...door, and... */
-		_vm->_celer.show_one(7); /* ...torches. */
+		_vm->_celer->show_one(28); /* Wall, plus... */
+		_vm->_celer->show_one(30); /* ...door, and... */
+		_vm->_celer->show_one(7); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -635,44 +633,44 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(19);
+		_vm->_celer->show_one(19);
 		break;
 	case 0x1: /* no connection (wall + window), */
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(19); /* Wall, plus... */
-		_vm->_celer.show_one(20); /* ...window. */
+		_vm->_celer->show_one(19); /* Wall, plus... */
+		_vm->_celer->show_one(20); /* ...window. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(19); /* Wall, plus... */
-		_vm->_celer.show_one(21); /* ...door. */
+		_vm->_celer->show_one(19); /* Wall, plus... */
+		_vm->_celer->show_one(21); /* ...door. */
 		break;
 	case 0x3: /* wall with door and window */
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(19); /* Wall, plus... */
-		_vm->_celer.show_one(20); /* ...door, and... */
-		_vm->_celer.show_one(21); /* ...window. */
+		_vm->_celer->show_one(19); /* Wall, plus... */
+		_vm->_celer->show_one(20); /* ...door, and... */
+		_vm->_celer->show_one(21); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer.show_one(19); /* Wall, plus... */
-		_vm->_celer.show_one(18); /* ...torches. */
+		_vm->_celer->show_one(19); /* Wall, plus... */
+		_vm->_celer->show_one(18); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer.show_one(19); /* Wall, plus... */
-		_vm->_celer.show_one(21); /* ...door, and... */
-		_vm->_celer.show_one(18); /* ...torches. */
+		_vm->_celer->show_one(19); /* Wall, plus... */
+		_vm->_celer->show_one(21); /* ...door, and... */
+		_vm->_celer->show_one(18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -690,7 +688,7 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x1:
-		_vm->_celer.show_one(22);
+		_vm->_celer->show_one(22);
 			
 		if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows))
 			_vm->_gyro->magics[13].op = _vm->_gyro->exclaim;
@@ -701,13 +699,13 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
-		_vm->_celer.show_one(23);
+		_vm->_celer->show_one(23);
 		_vm->_gyro->magics[7].op = _vm->_gyro->special; /* Middle exit south. */
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
-		_vm->_celer.show_one(24);
+		_vm->_celer->show_one(24);
 		_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Left exit south. */
 		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
@@ -722,36 +720,36 @@ void Trip::catamove(byte ped) {
 	// LEFT handles: 
 /*
 	case 0x1:
-		_vm->_celer.show_one(4);
+		_vm->_celer->show_one(4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x2:
-		_vm->_celer.show_one(4);
+		_vm->_celer->show_one(4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Middle exit north.
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // Door.
 		break;
 /*	case 0x3:
-		_vm->_celer.show_one(4);
+		_vm->_celer->show_one(4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 	// RIGHT handles:
 	case 0x4:
-		_vm->_celer.show_one(3);
+		_vm->_celer->show_one(3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x5:
-		_vm->_celer.show_one(3);
+		_vm->_celer->show_one(3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Middle exit north. */
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
 		break;
 /*
 	case 0x6:
-		_vm->_celer.show_one(3);
+		_vm->_celer->show_one(3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
@@ -760,12 +758,12 @@ void Trip::catamove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9: {
-		_vm->_celer.show_one(6);
+		_vm->_celer->show_one(6);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer.show_one(31);
+			_vm->_celer->show_one(31);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer.show_one(32);
+			_vm->_celer->show_one(32);
 
 		_vm->_gyro->magics[1].op = _vm->_gyro->special; /* Middle arch north. */
 		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
@@ -775,50 +773,50 @@ void Trip::catamove(byte ped) {
 	case 0xd: /* No connection + WINDOW */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(14);
+		_vm->_celer->show_one(14);
 		break;
 	case 0xe: /* No connection + TORCH */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer.show_one(8);
+		_vm->_celer->show_one(8);
 		break;
 	/* Recessed door: */
 	case 0xf:
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Door to Geida's room. */
-		_vm->_celer.show_one(1);
+		_vm->_celer->show_one(1);
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_celer.show_one(17);
+		_vm->_celer->show_one(17);
 		break;     /* [2,2] : "Art Gallery" sign over door. */
 	case 264:
-		_vm->_celer.show_one(9);
+		_vm->_celer->show_one(9);
 		break;      /* [8,1] : "The Wrong Way!" sign. */
 	case 1797:
-		_vm->_celer.show_one(2);
+		_vm->_celer->show_one(2);
 		break;      /* [5,7] : "Ite Mingite" sign. */
 	case 258:
 		for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
-			_vm->_celer.show_one_at(15, 130 + fv * 120, 70);
-			_vm->_celer.show_one_at(16, 184 + fv * 120, 78);
+			_vm->_celer->show_one_at(15, 130 + fv * 120, 70);
+			_vm->_celer->show_one_at(16, 184 + fv * 120, 78);
 		}
 		break;
 	case 1287:
 		for (fv = 10; fv <= 13; fv++)
-			_vm->_celer.show_one(fv);
+			_vm->_celer->show_one(fv);
 		break; /* [7,5] : 4 candles. */
 	case 776:
-		_vm->_celer.show_one(10);
+		_vm->_celer->show_one(10);
 		break;     /* [8,3] : 1 candle. */
 	case 2049:
-		_vm->_celer.show_one(11);
+		_vm->_celer->show_one(11);
 		break;     /* [1,8] : another candle. */
 	case 257:
-		_vm->_celer.show_one(12);
-		_vm->_celer.show_one(13);
+		_vm->_celer->show_one(12);
+		_vm->_celer->show_one(13);
 		break; /* [1,1] : the other two. */
 	}
 
@@ -843,7 +841,7 @@ void Trip::dawndelay() {
 void Trip::call_special(uint16 which) {
 	switch (which) {
 	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
-		_vm->_celer.show_one(1);
+		_vm->_celer->show_one(1);
 		_vm->_gyro->dna.brummie_stairs = 1;
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
@@ -857,7 +855,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_gyro->magics[12].data = 5;
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Now works as planned! */
 		stopwalking();
-		_vm->_visa.dixi('q', 26);
+		_vm->_visa->dixi('q', 26);
 		_vm->_gyro->dna.user_moves_avvy = true;
 		break;
 	case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */
@@ -877,20 +875,20 @@ void Trip::call_special(uint16 which) {
 		}
 		break;
 	case 4: /* This is the ghost room link. */
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->dusk();
 		tr[1].turn(right); /* you'll see this after we get back from bootstrap */
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
-		_vm->_enid.back_to_bootstrap(3);
+		_vm->_enid->back_to_bootstrap(3);
 		break;
 	case 5:
 		if (_vm->_gyro->dna.friar_will_tie_you_up) {
 			/* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */
 			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */
-			_vm->_visa.dixi('q', 35);
+			_vm->_visa->dixi('q', 35);
 			tr[1].done();
 			/*tr[1].vanishifstill:=true;*/
-			_vm->_celer.show_one(2);
-			_vm->_visa.dixi('q', 36);
+			_vm->_celer->show_one(2);
+			_vm->_visa->dixi('q', 36);
 			_vm->_gyro->dna.tied_up = true;
 			_vm->_gyro->dna.friar_will_tie_you_up = false;
 			tr[2].walkto(3);
@@ -912,18 +910,18 @@ void Trip::call_special(uint16 which) {
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
-		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 0);
-		_vm->_lucerna.mblit(12, 80, 38, 160, 3, 1);
-		_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
+		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
+		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
+		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
 	case 8:        /* _vm->_gyro->special 8: leave du Lustie's room. */
 		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
-			_vm->_visa.dixi('q', 63);
+			_vm->_visa->dixi('q', 63);
 			tr[2].turn(down);
 			tr[2].stopwalk();
 			tr[2].call_eachstep = false; /* Geida */
-			_vm->_lucerna.gameover();
+			_vm->_lucerna->gameover();
 		}
 		break;
 	case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */
@@ -939,18 +937,18 @@ void Trip::call_special(uint16 which) {
 		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
 			/* Into Geida's room. */
 			if (_vm->_gyro->dna.obj[_vm->_gyro->key])
-				_vm->_visa.dixi('q', 62);
+				_vm->_visa->dixi('q', 62);
 			else {
-				_vm->_visa.dixi('q', 61);
+				_vm->_visa->dixi('q', 61);
 				return;
 			}
 		}
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_y -= 1;
 		catamove(4);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
-		_vm->_lucerna.delavvy();
+		_vm->_lucerna->delavvy();
 		switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
@@ -965,34 +963,34 @@ void Trip::call_special(uint16 which) {
 		dawndelay();
 		break;
 	case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_x += 1;
 		catamove(1);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
-		_vm->_lucerna.delavvy();
+		_vm->_lucerna->delavvy();
 		apped(1, 1);
 		getback();
 		dawndelay();
 		break;
 	case 12: /* _vm->_gyro->special 12: transfer south in catacombs. */
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_y += 1;
 		catamove(2);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
-		_vm->_lucerna.delavvy();
+		_vm->_lucerna->delavvy();
 		apped(1, 2);
 		getback();
 		dawndelay();
 		break;
 	case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */
-		_vm->_lucerna.dusk();
+		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_x -= 1;
 		catamove(3);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
-		_vm->_lucerna.delavvy();
+		_vm->_lucerna->delavvy();
 		apped(1, 3);
 		getback();
 		dawndelay();
@@ -1010,52 +1008,52 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 	case r__outsideyours:
 	case r__outsidenottspub:
 	case r__outsideducks:
-		_vm->_sequence.first_show(1);
-		_vm->_sequence.then_show(2);
-		_vm->_sequence.then_show(3);
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(2);
+		_vm->_sequence->then_show(3);
 		break;
 	case r__insidecardiffcastle:
-		_vm->_sequence.first_show(1);
-		_vm->_sequence.then_show(5);
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(5);
 		break;
 	case r__avvysgarden:
 	case r__entrancehall:
 	case r__insideabbey:
-		_vm->_sequence.first_show(1);
-		_vm->_sequence.then_show(2);
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(2);
 		break;
 	case r__musicroom:
 	case r__outsideargentpub:
-		_vm->_sequence.first_show(5);
-		_vm->_sequence.then_show(6);
+		_vm->_sequence->first_show(5);
+		_vm->_sequence->then_show(6);
 		break;
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
 			if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 				hide_in_the_cupboard();
-				_vm->_sequence.first_show(8);
-				_vm->_sequence.then_show(7);
-				_vm->_sequence.start_to_close();
+				_vm->_sequence->first_show(8);
+				_vm->_sequence->then_show(7);
+				_vm->_sequence->start_to_close();
 				return;
 			} else {
 				apped(1, 6);
 				tr[1].face = right; /* added by TT 12/3/1995 */
-				_vm->_sequence.first_show(8);
-				_vm->_sequence.then_show(9);
+				_vm->_sequence->first_show(8);
+				_vm->_sequence->then_show(9);
 			}
 			break;
 		case 12:
-			_vm->_sequence.first_show(4);
-			_vm->_sequence.then_show(5);
-			_vm->_sequence.then_show(6);
+			_vm->_sequence->first_show(4);
+			_vm->_sequence->then_show(5);
+			_vm->_sequence->then_show(6);
 			break;
 		}
 		break;
 	}
 
-	_vm->_sequence.then_flip(whither, ped);
-	_vm->_sequence.start_to_open();
+	_vm->_sequence->then_flip(whither, ped);
+	_vm->_sequence->start_to_open();
 }
 
 void Trip::newspeed() {
@@ -1133,10 +1131,10 @@ void Trip::getback() {
 			end;
 		*/
 
-		_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
+		_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}
 
-	_vm->_lucerna.blitfix();
+	_vm->_lucerna->blitfix();
 
 	/*
 	if endangered then
@@ -1199,7 +1197,7 @@ void Trip::arrow_procs(byte tripnum) {
 			/* OK, it's hit him... what now? */
 
 			tr[2].call_eachstep = false; /* prevent recursion. */
-			_vm->_visa.dixi('Q', 47); /* Complaint! */
+			_vm->_visa->dixi('Q', 47); /* Complaint! */
 			tr[tripnum].done(); /* Deallocate the arrow. */
 			/*     tr[1].done; { Deallocate normal pic of Avvy. }
 
@@ -1211,14 +1209,14 @@ void Trip::arrow_procs(byte tripnum) {
 					end;
 					on;*/
 
-			_vm->_lucerna.gameover();
+			_vm->_lucerna->gameover();
 
 			_vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */
 			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
 		}
 	} else { /* Arrow has hit the wall! */
 		tr[tripnum].done(); /* Deallocate the arrow. */
-		_vm->_celer.show_one(3); /* Show pic of arrow stuck into the door. */
+		_vm->_celer->show_one(3); /* Show pic of arrow stuck into the door. */
 		_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
 	}
 		
@@ -1282,7 +1280,7 @@ void Trip::spin(byte whichway, byte &tripnum) {
 		_vm->_gyro->dna.geida_spin += 1;
 		_vm->_gyro->dna.geida_time = 20;
 		if (_vm->_gyro->dna.geida_spin == 5) {
-			_vm->_scrolls.display("Steady on, Avvy, you'll make the poor girl dizzy!");
+			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
 			_vm->_gyro->dna.geida_spin = 0;
 			_vm->_gyro->dna.geida_time = 0; /* knock out records */
 		}
@@ -1399,7 +1397,7 @@ void Trip::trippancy_link() {
 	}
 	if (mustexclaim) {
 		mustexclaim = false;
-		_vm->_visa.dixi('x', saywhat);
+		_vm->_visa->dixi('x', saywhat);
 	}
 }
 
@@ -1506,26 +1504,26 @@ void Trip::hide_in_the_cupboard() {
 
 	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 		if (_vm->_gyro->dna.wearing == nowt)
-			_vm->_scrolls.display("\6AVVY!\22 Get dressed first!");
+			_vm->_scrolls->display("\6AVVY!\22 Get dressed first!");
 		else {
 			tr[1].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
 			apped(1, 3); /* Walk out of the cupboard. */
-			_vm->_scrolls.display("You leave the cupboard. Nice to be out of there!");
+			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->dna.avvys_in_the_cupboard = false;
-			_vm->_sequence.first_show(8);
-			_vm->_sequence.then_show(7);
-			_vm->_sequence.start_to_close();
+			_vm->_sequence->first_show(8);
+			_vm->_sequence->then_show(7);
+			_vm->_sequence->start_to_close();
 		}
 	} else {
 		/* Not hiding in the cupboard */
 		tr[1].visible = false;
 		_vm->_gyro->dna.user_moves_avvy = false;
-		_vm->_scrolls.display(Common::String("You walk into the room...\20It seems to be an empty, ") +
+		_vm->_scrolls->display(Common::String("You walk into the room...\20It seems to be an empty, ") +
 				"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
 				"avoid suffocation.");
 		_vm->_gyro->dna.avvys_in_the_cupboard = true;
-		_vm->_celer.show_one(8);
+		_vm->_celer->show_one(8);
 	}
 }
 
@@ -1564,8 +1562,8 @@ void Trip::fliproom(byte room, byte ped) {
 	beforex = _vm->_gyro->mx;
 	beforey = _vm->_gyro->my;
 
-	_vm->_lucerna.exitroom(_vm->_gyro->dna.room);
-	_vm->_lucerna.dusk();
+	_vm->_lucerna->exitroom(_vm->_gyro->dna.room);
+	_vm->_lucerna->dusk();
 	getsetclear();
 
 
@@ -1577,18 +1575,18 @@ void Trip::fliproom(byte room, byte ped) {
 	if (_vm->_gyro->dna.room == r__lustiesroom)
 		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
 
-	_vm->_lucerna.enterroom(room, ped);
+	_vm->_lucerna->enterroom(room, ped);
 	apped(1, ped);
 	_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
 	_vm->_gyro->dna.rw = tr[1].face;
-	_vm->_lucerna.showrw();
+	_vm->_lucerna->showrw();
 
 	for (fv = 0; fv <= 1; fv++) {
 		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
 		getback();
 	}
-	_vm->_lucerna.dawn();
+	_vm->_lucerna->dawn();
 
 	/* Tidy up after mouse. I know it's a kludge... */
 	/*  tidy_after_mouse;*/
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 4b84221..30fcba2 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -154,9 +154,7 @@ public:
 	friend triptype;
 	friend getsettype;
 
-	Trip();
 
-	void setParent(AvalancheEngine *vm);
 
 	static const int16 up = 0;
 	static const int16 right = 1;
@@ -187,6 +185,9 @@ public:
 	static const int16 procgeida_procs = 7;
 
 
+
+	Trip(AvalancheEngine *vm);
+
 	void trippancy_link();
 
 	void get_back_loretta();
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 9359595..4ffedc2 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -41,7 +41,7 @@
 
 namespace Avalanche {
 
-	void Visa::setParent(AvalancheEngine *vm) {
+	Visa::Visa(AvalancheEngine *vm) {
 		_vm = vm;
 	}
 
@@ -86,7 +86,7 @@ namespace Avalanche {
 			if (report_dixi_errors) {
 				Common::String todisplay;
 				todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
-				_vm->_scrolls.display(todisplay);
+				_vm->_scrolls->display(todisplay);
 			}
 			return;
 		}
@@ -103,7 +103,7 @@ namespace Avalanche {
 
 		if (bubbling)  do_the_bubble();
 
-		_vm->_scrolls.calldrivers();
+		_vm->_scrolls->calldrivers();
 	}
 
 	void Visa::speech(byte who, byte subject) {
@@ -152,7 +152,7 @@ namespace Avalanche {
 			unskrimble();
 			do_the_bubble();
 
-			_vm->_scrolls.calldrivers();
+			_vm->_scrolls->calldrivers();
 			went_ok = true;
 		}
 
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index e33045c..c3aa3f6 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -37,7 +37,7 @@ class AvalancheEngine;
 
 class Visa {
 public:
-	void Visa::setParent(AvalancheEngine *vm);
+	Visa(AvalancheEngine *vm);
 
 	void dixi(char block, byte point);
 


Commit: 03665fac214574ec58458676789347855c34c29a
    https://github.com/scummvm/scummvm/commit/03665fac214574ec58458676789347855c34c29a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T10:47:41-07:00

Commit Message:
AVALANCHE: Graphics: double screen height.

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 8035491..287f85c 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -48,7 +48,7 @@ Graphics::Graphics(AvalancheEngine *vm) {
 }
 
 void Graphics::init() {
-	initGraphics(kScreenWidth, kScreenHeight, true);
+	initGraphics(kScreenWidth, kScreenHeight * 2, true); // Doubling the height.
 
 	for (int i = 0; i < 64; ++i) {
 		_egaPalette[i][0] = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
@@ -141,8 +141,18 @@ void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 }
 
 void Graphics::refreshScreen() {
-	g_system->copyRectToScreen(_surface.pixels, _surface.pitch , 0, 0, kScreenWidth, kScreenHeight);
+	// These cycles are for doubling the screen height.
+	::Graphics::Surface source;
+	source.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
+	for (uint16 y = 0; y < source.h / 2; y++)
+		for (uint16 x = 0; x < source.w; x++)
+			for (byte j = 0; j < 2; j++) 
+				*(byte *)source.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
+
+	// Now we copy the stretched picture to the screen.
+	g_system->copyRectToScreen(source.pixels, source.pitch , 0, 0, kScreenWidth, kScreenHeight * 2);
 	g_system->updateScreen();
 }
 
+
 } // End of namespace Avalanche


Commit: 0beae3b95cbdd719b5778c79ee944ab2f426e7fc
    https://github.com/scummvm/scummvm/commit/0beae3b95cbdd719b5778c79ee944ab2f426e7fc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T12:09:16-07:00

Commit Message:
AVALANCHE: free() the surfaces in Graphics' functions.

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 287f85c..aa49a0c 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -138,20 +138,24 @@ void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 	for (uint16 y = 0; y < picture.h; y++)
 		for (uint16 x = 0; x < picture.w; x++)
 			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+
+	picture.free();
 }
 
 void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
-	::Graphics::Surface source;
-	source.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
-	for (uint16 y = 0; y < source.h / 2; y++)
-		for (uint16 x = 0; x < source.w; x++)
+	::Graphics::Surface picture;
+	picture.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
+	for (uint16 y = 0; y < picture.h / 2; y++)
+		for (uint16 x = 0; x < picture.w; x++)
 			for (byte j = 0; j < 2; j++) 
-				*(byte *)source.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
+				*(byte *)picture.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
 
 	// Now we copy the stretched picture to the screen.
-	g_system->copyRectToScreen(source.pixels, source.pitch , 0, 0, kScreenWidth, kScreenHeight * 2);
+	g_system->copyRectToScreen(picture.pixels, picture.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
 	g_system->updateScreen();
+
+	picture.free();
 }
 
 


Commit: e5fb4e3866e8a23b80e99e4cce4509a362e916c3
    https://github.com/scummvm/scummvm/commit/e5fb4e3866e8a23b80e99e4cce4509a362e916c3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T12:18:51-07:00

Commit Message:
AVALANCHE: Cosmetic modifications in triptype::walk().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 181cde8..e16efed 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -191,14 +191,13 @@ void triptype::walk() {
 
 
 	if (visible) {
-		{
-			r.x1 = (x / 8) - 1;
-			if (r.x1 == 255)
-				r.x1 = 0;
-			r.y1 = y - 2;
-			r.x2 = ((x + _info.xl) / 8) + 1;
-			r.y2 = y + _info.yl + 2;
-		}
+		r.x1 = (x / 8) - 1;
+		if (r.x1 == 255)
+			r.x1 = 0;
+		r.y1 = y - 2;
+		r.x2 = ((x + _info.xl) / 8) + 1;
+		r.y2 = y + _info.yl + 2;
+		
 		_tr->getset[1 - _tr->_vm->_gyro->cp].remember(r);
 	}
 
@@ -248,9 +247,9 @@ void triptype::walk() {
 	}
 
 	if (!_tr->_vm->_gyro->doing_sprite_run) {
-		count += 1;
+		count++;
 		if (((ix != 0) || (iy != 0)) && (count > 1)) {
-			step += 1;
+			step++;
 			if (step == a.seq)  step = 0;
 			count = 0;
 		}


Commit: 63fbb1d04f338d88d6a40a636af3fd4bbc97de1c
    https://github.com/scummvm/scummvm/commit/63fbb1d04f338d88d6a40a636af3fd4bbc97de1c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T13:20:21-07:00

Commit Message:
AVALANCHE: Implement Lucerna::find_people().

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index f759f89..fa1298a 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -356,7 +356,8 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	_vm->_trip->tr[0].init(0, true, _vm->_trip);
 	alive = true;
 
-	score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
+	score = 0;
+	/*for gd:=0 to 5 do which[gd]:=1;*/
 	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
 	_vm->_scrolls->natural();
 	_vm->_basher->normal_edit();
@@ -377,7 +378,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	seescroll = false;
 
 	ppos[0][1] = -177; 
-	_vm->_trip->tr[0].appear(300,117,right);
+	//_vm->_trip->tr[0].appear(300,117,right);
 	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
 	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
 	him = 254;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1d22deb..6ca03b0 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -294,9 +294,9 @@ void Lucerna::zoomout(int16 x, int16 y) {
 }
 
 void Lucerna::find_people(byte room) {
-	for (byte fv = 151; fv <= 178; fv++)
+	for (byte fv = 1; fv < 29; fv++) // There'll may be problems with this.
 		if (_vm->_gyro->whereis[fv] == room) {
-			if (fv < 175)
+			if (fv < 25) // And this. See definition of whereis[].
 				_vm->_gyro->him = fv;
 			else
 				_vm->_gyro->her = fv;


Commit: ab04dd7aa6b5279f472a0136ba9a9e162b7fbe6c
    https://github.com/scummvm/scummvm/commit/ab04dd7aa6b5279f472a0136ba9a9e162b7fbe6c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-24T13:23:40-07:00

Commit Message:
AVALANCHE: Cosmetic modification in Gyro.

Changed paths:
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 58b5844..a99d4c6 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -73,8 +73,7 @@ struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
 	char wearing; /* what you're wearing */
 	byte swore; /* number of times you've sworn */
 	byte saves; /* number of times this game has been saved */
-	byte rooms[100];     /* Add one to each every time
-											you enter a room */
+	byte rooms[100]; /* Add one to each every time you enter a room */
 	byte alcohol; /* Your blood alcohol level. */
 	byte playednim; /* How many times you've played Nim. */
 	bool wonnim; /* Have you *won* Nim? (That's harder.) */


Commit: 28b0076e63a71bfa7e1d0b82f9153e13d26c4316
    https://github.com/scummvm/scummvm/commit/28b0076e63a71bfa7e1d0b82f9153e13d26c4316
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T02:41:33-07:00

Commit Message:
AVALANCHE: Celer: add new flavour: ch_natural_image.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 3cedb67..17d4ae1 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -302,13 +302,10 @@ void Celer::load_chunks(Common::String xx) {
 
 			memory[fv] = new byte[ch.size]; // Celer::forget_chunks() deallocates it.
 
-			/*if (ch.natural) {
-			getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
+			if (ch.natural) {
+				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
+				//getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
 			} else
-			blockread(f, memory[fv], ch.size);*/
-			warning("STUB: Celer::load_chunks()");
-
-			if (!ch.natural)
 				f.read(memory[fv], ch.size);
 		} else
 			memos[fv].x = on_disk;
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 1d35005..3084fdd 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -39,7 +39,7 @@ class AvalancheEngine;
 
 class Celer {
 public:
-	enum flavourtype {ch_ega, ch_bgi};
+	enum flavourtype {ch_ega, ch_bgi, ch_natural_image};
 
 	struct chunkblocktype {
 		flavourtype flavour;


Commit: 502cd7a01791d1812f8b29e9cc36fd5cc2653003
    https://github.com/scummvm/scummvm/commit/502cd7a01791d1812f8b29e9cc36fd5cc2653003
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T03:15:15-07:00

Commit Message:
AVALANCHE: Improve Celer::display_it(), update Celer::load_chunks() to work properly with it.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 17d4ae1..b73e16a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -298,15 +298,19 @@ void Celer::load_chunks(Common::String xx) {
 			memos[fv].y = ch.y;
 			memos[fv].yl = ch.yl;
 			memos[fv].flavour = ch.flavour;
-			memos[fv].size = ch.size;
-
-			memory[fv] = new byte[ch.size]; // Celer::forget_chunks() deallocates it.
 
 			if (ch.natural) {
 				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
-				//getimage(ch.x * 8, ch.y, (ch.x + ch.xl) * 8, ch.y + ch.yl, memory[fv]);
-			} else
+				memos[fv].size = ch.xl * ch.yl; 
+				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
+				for (uint16 j = 0; j < memos[fv].yl; j++)
+					for (uint16 i = 0; i < memos[fv].xl; i++)
+						memory[fv][j * memos[fv].xl + i] = *_vm->_graphics->getPixel(memos[fv].x + i, memos[fv].y + j);
+			} else {
+				memos[fv].size = ch.size;
+				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
 				f.read(memory[fv], ch.size);
+			}
 		} else
 			memos[fv].x = on_disk;
 	}
@@ -324,7 +328,7 @@ void Celer::forget_chunks() {
 void Celer::mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) { /* assembler;
 asm
 	push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
-	push bp;      { Nor BP! }
+	push bp;      { Nor BP! 
 
 
 	{ DI holds the offset on this page. It starts at the top left-hand corner. }
@@ -419,8 +423,33 @@ asm
 
 
 
-void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) {
-	warning("STUB: Celer::display_it()");
+void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p) {
+	switch (flavour) {
+	case ch_natural_image: {
+		for (uint16 j = 0; j < yl; j++)
+			for (uint16 i = 0; i < xl; i++)
+				*_vm->_graphics->getPixel(x + i, y + j) = p[j * xl + i];
+		}
+		break;
+	case ch_bgi : {
+		_vm->_graphics->drawPicture(p, x, y);
+		//putimage(x * 8, y, p, 0);
+		r.x1 = x;
+		r.y1 = y;
+		r.x2 = x + xl + 1;
+		r.y2 = y + yl;
+		}
+		break;
+	case ch_ega : {
+		mdrop(x, y, xl, yl, p);
+		_vm->_lucerna->blitfix();
+		r.x1 = x;
+		r.y1 = y;
+		r.x2 = x + xl;
+		r.y2 = y + yl;
+		}
+		break;
+	}
 }
 
 void Celer::show_one(byte which) {
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 3084fdd..82f97a5 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -89,7 +89,7 @@ private:
 
 	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p);
 
-	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p);
+	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p);
 
 	void display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);
 };


Commit: 6644905eaca4576c5429592b5e892a733ebefbdc
    https://github.com/scummvm/scummvm/commit/6644905eaca4576c5429592b5e892a733ebefbdc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T03:33:03-07:00

Commit Message:
AVALANCHE: Fix cycle in Trip::trippancy_link().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index e16efed..0acad63 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1362,7 +1362,7 @@ void Trip::trippancy_link() {
 
 	if (_vm->_gyro->ddmnow | _vm->_gyro->ontoolbar | _vm->_gyro->seescroll)
 		return;
-	for (fv = 1; fv <= numtr; fv++) {
+	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick)
 			tr[fv].walk();
 	}


Commit: 9b4c9e496fc81dc0f7a3194d0a65b82b111f7457
    https://github.com/scummvm/scummvm/commit/9b4c9e496fc81dc0f7a3194d0a65b82b111f7457
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T07:26:49-07:00

Commit Message:
AVALANCHE: Add Graphics::drawFrame().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index aa49a0c..eb93423 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -78,6 +78,10 @@ byte *Graphics::getPixel(int16 x, int16 y) {
 	return (byte *)_surface.getBasePtr(x, y);
 }
 
+void Graphics::drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
+	_surface.frameRect(Common::Rect(x1, y1, x2, y2), color);
+}
+
 void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 1a58002..14eb3fa 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -71,6 +71,8 @@ public:
 
 	byte *getPixel(int16 x, int16 y);
 
+	void drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color); // Solely for testing purposes!
+
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);


Commit: 63e7c5b3d110eb24563535a92b1804e4d2f4859b
    https://github.com/scummvm/scummvm/commit/63e7c5b3d110eb24563535a92b1804e4d2f4859b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T07:28:52-07:00

Commit Message:
AVALANCHE: Repair array indexes in Timeout and Trip.

Changed paths:
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 7a10d67..b36f143 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -57,11 +57,11 @@ Timeout::Timeout(AvalancheEngine *vm) {
 }
 
 void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
-	fv = 1;
-	while ((fv < 8) && (times[fv].time_left != 0))
-		fv += 1;
+	fv = 0;
+	while ((fv < 7) && (times[fv].time_left != 0))
+		fv++;
 
-	if (fv == 8)
+	if (fv == 7)
 		return; /* Oh dear... */
 
 	timetype &with = times[fv];  /* Everything's OK here! */
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 0acad63..1a525d7 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1404,7 +1404,7 @@ void Trip::get_back_loretta() {
 	byte fv;
 
 	/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
-	for (fv = 1; fv <= numtr; fv++) {
+	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick) {
 			getback();
 			return;
@@ -1627,7 +1627,7 @@ bool Trip::neardoor() {       /* returns True if you're near a door! */
 }
 
 void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
-	tr[1].visible = false;
+	tr[0].visible = false;
 }
 
 


Commit: 06bde8b277e0729c693243c2ba4d8566ff1e9012
    https://github.com/scummvm/scummvm/commit/06bde8b277e0729c693243c2ba4d8566ff1e9012
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T12:38:46-07:00

Commit Message:
AVALANCHE: Implement Celer::load_chunks().

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index b73e16a..b7ee5bb 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -301,11 +301,11 @@ void Celer::load_chunks(Common::String xx) {
 
 			if (ch.natural) {
 				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
-				memos[fv].size = ch.xl * ch.yl; 
+				memos[fv].size = memos[fv].xl * 8 * memos[fv].yl; 
 				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
 				for (uint16 j = 0; j < memos[fv].yl; j++)
-					for (uint16 i = 0; i < memos[fv].xl; i++)
-						memory[fv][j * memos[fv].xl + i] = *_vm->_graphics->getPixel(memos[fv].x + i, memos[fv].y + j);
+					for (uint16 i = 0; i < memos[fv].xl * 8; i++)
+						memory[fv][j * memos[fv].xl * 8 + i] = *_vm->_graphics->getPixel(memos[fv].x * 8 + i, memos[fv].y + j);
 			} else {
 				memos[fv].size = ch.size;
 				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
@@ -426,13 +426,21 @@ asm
 void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p) {
 	switch (flavour) {
 	case ch_natural_image: {
+		r.x1 = x;
+		r.y1 = y;
+		r.x2 = x + xl + 1;
+		r.y2 = y + yl;
+
+		x *= 8;
+		xl *= 8;
+
 		for (uint16 j = 0; j < yl; j++)
 			for (uint16 i = 0; i < xl; i++)
 				*_vm->_graphics->getPixel(x + i, y + j) = p[j * xl + i];
 		}
 		break;
 	case ch_bgi : {
-		_vm->_graphics->drawPicture(p, x, y);
+		_vm->_graphics->drawPicture(p, x * 8, y);
 		//putimage(x * 8, y, p, 0);
 		r.x1 = x;
 		r.y1 = y;
@@ -441,12 +449,44 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 		}
 		break;
 	case ch_ega : {
-		mdrop(x, y, xl, yl, p);
-		_vm->_lucerna->blitfix();
 		r.x1 = x;
 		r.y1 = y;
 		r.x2 = x + xl;
 		r.y2 = y + yl;
+
+
+		x *= 8;
+		xl *= 8;
+
+		
+
+		::Graphics::Surface picture; // We make a Surface object for the picture itself.
+
+		picture.create(xl, yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+
+		uint32 h = 0;
+
+		// Produce the picture.
+		for (int8 plane = 0; plane < 4; plane++) // The planes are in the opposite way.
+			for (byte j = 0; j < yl + 1; j++)
+				for (uint16 i = 0; i < xl; i += 8) {
+					byte pixel = p[h++];
+					for (byte bit = 0; bit < 8; bit++) {
+						byte pixelBit = (pixel >> bit) & 1;
+						*(byte *)picture.getBasePtr(i + 7 - bit, j) += (pixelBit << plane);
+					} 
+				}
+
+		// Copy the picture to a given place on the screen.
+		for (uint16 j = 0; j < picture.h; j++) 
+			for (uint16 i = 0; i < picture.w; i++)
+				*_vm->_graphics->getPixel(i + x, j + y) = *(byte *)picture.getBasePtr(i, j);		
+
+		picture.free();
+
+
+
+		_vm->_lucerna->blitfix();
 		}
 		break;
 	}


Commit: 395b917e94c4cc02035ec2e54cfe3e2b2074596c
    https://github.com/scummvm/scummvm/commit/395b917e94c4cc02035ec2e54cfe3e2b2074596c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T13:42:41-07:00

Commit Message:
AVALANCHE: Repair Timeout.

Changed paths:
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index b36f143..647cfe4 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -49,7 +49,7 @@ namespace Avalanche {
 Timeout::Timeout(AvalancheEngine *vm) {
 	_vm = vm;
 
-	for (int i = 0; i < sizeof(times); i++) {
+	for (byte i = 0; i < 7; i++) {
 		times[i].time_left = 0;
 		times[i].then_where = 0;
 		times[i].what_for = 0;
@@ -64,10 +64,10 @@ void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
 	if (fv == 7)
 		return; /* Oh dear... */
 
-	timetype &with = times[fv];  /* Everything's OK here! */
-	with.time_left = howlong;
-	with.then_where = whither;
-	with.what_for = why;
+	/* Everything's OK here! */
+	times[fv].time_left = howlong;
+	times[fv].then_where = whither;
+	times[fv].what_for = why;
 }
 
 void Timeout::one_tick() {


Commit: 5e257a500b982c77d617f2103e504d72d489697b
    https://github.com/scummvm/scummvm/commit/5e257a500b982c77d617f2103e504d72d489697b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T13:54:28-07:00

Commit Message:
AVALANCHE: Implement Timeout::one_tick().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4674cea..408da93 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -197,7 +197,7 @@ void Avalot::run(Common::String arg) {
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
 			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
 
-		//_vm->_timeout->one_tick();
+		_vm->_timeout->one_tick();
 
 
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 647cfe4..88277ef 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -74,13 +74,12 @@ void Timeout::one_tick() {
 	if (_vm->_gyro->ddmnow)
 		return;
 
-	for (fv = 1; fv <= 7; fv++) {
-		timetype &with = times[fv];
-		if (with.time_left > 0) {
-			with.time_left -= 1;
+	for (fv = 0; fv < 7; fv++) {
+		if (times[fv].time_left > 0) {
+			times[fv].time_left --;
 
-			if (with.time_left == 0) {
-				switch (with.then_where) {
+			if (times[fv].time_left == 0) {
+				switch (times[fv].then_where) {
 				case procopen_drawbridge :
 					open_drawbridge();
 					break;
@@ -208,8 +207,8 @@ void Timeout::one_tick() {
 			}
 		}
 	}
-	_vm->_gyro->roomtime += 1; /* Cycles since you've been in this room. */
-	_vm->_gyro->dna.total_time += 1; /* Total amount of time for this game. */
+	_vm->_gyro->roomtime++; /* Cycles since you've been in this room. */
+	_vm->_gyro->dna.total_time++; /* Total amount of time for this game. */
 }
 
 void Timeout::lose_timer(byte which) {


Commit: a955f6acaba48e91cf1753dd4f85fee06fdeec52
    https://github.com/scummvm/scummvm/commit/a955f6acaba48e91cf1753dd4f85fee06fdeec52
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T14:10:18-07:00

Commit Message:
AVALANCHE: Revise Celer::pics_link() a bit.

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index b7ee5bb..b8e89fd 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -72,7 +72,7 @@ void Celer::pics_link() {
 
 	case r__yours:
 		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % int32(4)) == 0))
-			show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(2));
+			show_one(0 + (_vm->_gyro->roomtime / 12) % 2);
 		break;
 
 	case r__argentpub:


Commit: 37ea01644ababf4ab432fc43bea36347a3b6180e
    https://github.com/scummvm/scummvm/commit/37ea01644ababf4ab432fc43bea36347a3b6180e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T14:32:22-07:00

Commit Message:
AVALANCHE: Replace Gyro::slowdown() with ScummVM's own utilities.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 408da93..d4700ea 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -180,6 +180,8 @@ void Avalot::run(Common::String arg) {
 	setup();
 
 	do {
+		uint32 beginLoop = _vm->_system->getMillis();
+
 		_vm->_lucerna->clock_lucerna();
 		_vm->_basher->keyboard_link();
 		_vm->_dropdown->menu_link();
@@ -193,7 +195,7 @@ void Avalot::run(Common::String arg) {
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
 			_vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp);
 		_vm->_lucerna->flip_page(); /* <<<! */
-		_vm->_gyro->slowdown();
+		
 		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
 			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
 
@@ -207,6 +209,10 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
+		uint32 delay = _vm->_system->getMillis() - beginLoop;
+		if ((delay) <= 55)
+			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown();
+
 	} while (! _vm->_gyro->lmo);
 
 	//restorecrtmode();


Commit: 9a26bb502f69b6e51b34c18e9784bcdf7379af06
    https://github.com/scummvm/scummvm/commit/9a26bb502f69b6e51b34c18e9784bcdf7379af06
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-25T14:38:06-07:00

Commit Message:
AVALANCHE: Remove parenthesis and add comment to Avalot::run().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index d4700ea..6c49a66 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -210,8 +210,8 @@ void Avalot::run(Common::String arg) {
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
-		if ((delay) <= 55)
-			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown();
+		if (delay <= 55)
+			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
 
 	} while (! _vm->_gyro->lmo);
 


Commit: b0d4019ceabd1180f41447c2b232c5328f181c4e
    https://github.com/scummvm/scummvm/commit/b0d4019ceabd1180f41447c2b232c5328f181c4e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T01:42:50-07:00

Commit Message:
AVALANCHE: Remove Celer:mdrop().

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index b8e89fd..5fc029e 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -325,104 +325,6 @@ void Celer::forget_chunks() {
 	memset(memos, 255, sizeof(memos)); /* x=-1, => on disk. */
 }
 
-void Celer::mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) { /* assembler;
-asm
-	push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.}
-	push bp;      { Nor BP! 
-
-
-	{ DI holds the offset on this page. It starts at the top left-hand corner. }
-	{ (It should equal ch.y*80+ch.x. }
-
-	mov ax,y;
-	mov dl,80;
-	mul dl; { Line offset now calculated. }
-	mov di,ax; { Move it into DI. }
-	mov ax,x;
-	add di,ax; { Full offset now calculated. }
-
-	mov bx,yl; { No. of times to repeat lineloop. }
-	inc bx;        { "loop" doesn't execute the zeroth time. }
-	mov bh,bl;     { Put it into BH. }
-
-	{ BP holds the length of the Common::String to copy. It's equal to ch.xl.}
-
-	mov ax,uint16(p);   { Data is held at DS:SI. }
-	mov si,ax;
-	mov ax,uint16(p+2); { This will be moved over into ds in just a tick... }
-
-	mov bp,xl;
-
-	mov ds,ax;
-
-
-	cld;          { We're allowed to hack around with the flags! }
-
-	mov ax,$AC00; { Top of the first EGA page. }
-	mov es,ax;    { Offset on this page is calculated below... }
-
-
-{    port[$3c4]:=2; port[$3ce]:=4; }
-
-	mov dx,$3c4;
-	mov al,2;
-	out dx,al;
-	mov dx,$3ce;
-	mov al,4;
-	out dx,al;
-
-	mov cx,4;  { This loop executes for 3, 2, 1, and 0. }
-	mov bl,0;
-
-
-	@mainloop:
-
-	push di;
-	push cx;
-
-{    port[$3C5]:=1 shl bit; }
-	mov dx,$3C5;
-	mov al,1;
-	mov cl,bl; { BL = bit. }
-	shl al,cl;
-	out dx,al;
-{     port[$3CF]:=bit; }
-	mov dx,$3CF;
-	mov al,bl; { BL = bit. }
-	out dx,al;
-
-	xor ch,ch;
-	mov cl,bh; { BH = ch.yl. }
-
-	@lineloop:
-
-		push cx;
-
-		mov cx,bp;
-
-		repz movsb; { Copy the data. }
-
-		sub di,bp;
-		add di,80;
-
-		pop cx;
-
-	loop @lineloop;
-
-	inc bl; { One more on BL. }
-
-	pop cx;
-	pop di;
-
-	loop @mainloop;
-
-	pop bp;
-	pop ds;       { Get DS back again. }
-*/
-}
-
-
-
 void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p) {
 	switch (flavour) {
 	case ch_natural_image: {
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 82f97a5..2177ea2 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -87,8 +87,6 @@ private:
 
 	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
 
-	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p);
-
 	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p);
 
 	void display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);


Commit: 6e8dec45dd946b365d095029072f09fa1ed4c675
    https://github.com/scummvm/scummvm/commit/6e8dec45dd946b365d095029072f09fa1ed4c675
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T04:32:08-07:00

Commit Message:
AVALANCHE: Add loadPictureGraphic, loadPictureRow, revise drawPicture in Graphics, update almost everything accordingly.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 5fc029e..52b57b3 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -326,12 +326,13 @@ void Celer::forget_chunks() {
 }
 
 void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p) {
+	r.x1 = x;
+	r.y1 = y;
+	r.y2 = y + yl;
+
 	switch (flavour) {
 	case ch_natural_image: {
-		r.x1 = x;
-		r.y1 = y;
 		r.x2 = x + xl + 1;
-		r.y2 = y + yl;
 
 		x *= 8;
 		xl *= 8;
@@ -342,19 +343,15 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 		}
 		break;
 	case ch_bgi : {
-		_vm->_graphics->drawPicture(p, x * 8, y);
-		//putimage(x * 8, y, p, 0);
-		r.x1 = x;
-		r.y1 = y;
 		r.x2 = x + xl + 1;
-		r.y2 = y + yl;
+
+		_vm->_graphics->drawPicture_old(p, x * 8, y);
+		//putimage(x * 8, y, p, 0);
 		}
 		break;
 	case ch_ega : {
-		r.x1 = x;
-		r.y1 = y;
 		r.x2 = x + xl;
-		r.y2 = y + yl;
+		
 
 
 		x *= 8;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index eb93423..0fcfdac 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -116,7 +116,55 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 			}
 }
 
-void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
+::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
+	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
+	uint16 pictureWidth = file.readUint16LE() + 1;
+	uint16 pictureHeight = file.readUint16LE() + 1;
+
+	::Graphics::Surface picture; // We make a Surface object for the picture itself.
+
+	picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	// Produce the picture.
+	for (byte y = 0; y < pictureHeight; y++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 x = 0; x < pictureWidth; x += 8) {
+				byte pixel = file.readByte();
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+				} 
+			}
+
+	return picture;
+}
+
+::Graphics::Surface Graphics::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
+	::Graphics::Surface picture;
+
+	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	for (byte plane = 0; plane < 4; plane++)
+		for (uint16 y = 0; y < height; y++)
+			for (uint16 x = 0; x < width; x += 8) {
+				byte pixel = file.readByte();
+				for (byte i = 0; i < 8; i++) {
+					byte pixelBit = (pixel >> i) & 1;
+					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
+				}	
+			}
+
+	return picture;
+}
+
+void Graphics::drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+	// Copy the picture to the given place on the screen.
+	for (uint16 y = 0; y < picture.h; y++)
+		for (uint16 x = 0; x < picture.w; x++)
+			*getPixel(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+}
+
+void Graphics::drawPicture_old(const byte *source, uint16 destX, uint16 destY) {
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
 	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
 	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
@@ -141,7 +189,7 @@ void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
 	// Copy the picture to a given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++)
 		for (uint16 x = 0; x < picture.w; x++)
-			*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+			*getPixel(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
 
 	picture.free();
 }
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 14eb3fa..dfd06a4 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -77,7 +77,16 @@ public:
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
-	void drawPicture(const byte *source, uint16 destX, uint16 destY);
+
+	// The caller has to .free() the returned Surfaces!!!
+	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
+
+	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
+
+
+	void drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+
+	void drawPicture_old(const byte *source, uint16 destX, uint16 destY);
 
 	void refreshScreen();
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index fa1298a..7664073 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -261,10 +261,16 @@ Gyro::~Gyro() {
 	delete[] vmc.andpic;
 	delete[] vmc.xorpic;
 
-	for (int fv = 0; fv < 2; fv ++) {
+	for (byte fv = 0; fv < 2; fv ++) {
 		delete[] vmc.backpic[fv];
 	}
 
+	for (byte i = 0; i < 9; i++) {
+		digit[i].free();
+		rwlite[i].free();
+	}
+	digit[9].free();
+
 }
 
 void Gyro::newpointer(byte m) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index a99d4c6..b2fc47f 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -34,6 +34,8 @@
 #include "common/scummsys.h"
 #include "common/file.h"
 
+#include "graphics/surface.h"
+
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"
 
@@ -521,8 +523,11 @@ public:
 	bool ontoolbar, seescroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 
 	char objlist[10];
-	byte *digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
-	byte *rwlite[9]; // Maybe it will be needed to move them to the class itself instead.
+
+	::Graphics::Surface digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface rwlite[9]; // Maybe it will be needed to move them to the class itself instead.
+	// Called .free() for them in ~Gyro().
+
 	byte oldrw;
 	int8 lastscore[3];
 	byte cmp; /* current mouse-void **/
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 6ca03b0..c1136ed 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -241,27 +241,15 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	move(a0, a1, 12080);
 	}*/
 
-	::Graphics::Surface background;
+	
 	
 	uint16 backgroundWidht = _vm->_graphics->kScreenWidth;
 	byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
-	background.create(backgroundWidht, backgroundHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-
-	for (byte plane = 0; plane < 4; plane++)
-		for (uint16 y = 0; y < backgroundHeight; y++)
-			for (uint16 x = 0; x < backgroundWidht; x += 8) {
-				byte pixel = f.readByte();
-				for (byte i = 0; i < 8; i++) {
-					byte pixelBit = (pixel >> i) & 1;
-					*(byte *)background.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
-				}	
-			}
+	::Graphics::Surface background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
 
-	for (uint16 y = 0; y < backgroundHeight; y++)
-		for (uint16 x = 0; x < backgroundWidht; x++)
-			*_vm->_graphics->getPixel(x + 0, y + 10) = *(byte *)background.getBasePtr(x, y);	
+	_vm->_graphics->drawPicture(background, 0, 10);
 
 	background.free();
 
@@ -759,15 +747,13 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	}
 
 	f.seek(z * picsize + 65);
+	
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
-	byte *buffer = new byte[picsize];
-
-	f.read(buffer, picsize);
-
-	_vm->_graphics->drawPicture(buffer, 205, 170);
-
-	delete[] buffer;
+	_vm->_graphics->drawPicture(picture, 205, 170);
 
+	picture.free();
+	
 	f.close();
 
 	_vm->_gyro->off();
@@ -793,13 +779,17 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 	}
 
 	for (byte fv = 0; fv < 10; fv ++) {
-		_vm->_gyro->digit[fv] = new byte[digitsize];
-		f.read(_vm->_gyro->digit[fv], digitsize);
+		f.seek(fv * digitsize);
+		/*_vm->_gyro->digit[fv] = new byte[digitsize];
+		f.read(_vm->_gyro->digit[fv], digitsize);*/
+		_vm->_gyro->digit[fv] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
 	for (byte ff = 0; ff < 9; ff ++) {
-		_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
-		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
+		f.seek(10 * digitsize + ff * rwlitesize);
+		/*_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
+		f.read(_vm->_gyro->rwlite[ff], rwlitesize);*/
+		_vm->_gyro->rwlite[ff] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
 	f.close();
@@ -815,15 +805,11 @@ void Lucerna::toolbar() {
 	
 	/* off;*/
 
-	uint32 bufferSize = f.size()-40;
-
-	byte *buffer = new byte[bufferSize];
-
-	f.read(buffer, bufferSize);
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
-	_vm->_graphics->drawPicture(buffer, 5, 169);
+	_vm->_graphics->drawPicture(picture, 5, 169);
 
-	delete[] buffer;
+	picture.free();
 
 	f.close();
 


Commit: 0a4747d9159feae4b92d72dc5a724262315e1f7d
    https://github.com/scummvm/scummvm/commit/0a4747d9159feae4b92d72dc5a724262315e1f7d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T05:19:54-07:00

Commit Message:
AVALANCHE: Update rest of Celer accorded to the revision in Graphics.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 52b57b3..be925ed 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -47,6 +47,11 @@ Celer::Celer(AvalancheEngine *vm) {
 	num_chunks = 0;
 }
 
+Celer::~Celer() {
+	for (byte i = 0; i < 40; i++)
+		memory[i].free();
+}
+
 void Celer::pics_link() {
 	byte xx;
 
@@ -302,14 +307,14 @@ void Celer::load_chunks(Common::String xx) {
 			if (ch.natural) {
 				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
 				memos[fv].size = memos[fv].xl * 8 * memos[fv].yl; 
-				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
+				memory[fv].create(memos[fv].xl * 8, memos[fv].yl, ::Graphics::PixelFormat::createFormatCLUT8());
+
 				for (uint16 j = 0; j < memos[fv].yl; j++)
 					for (uint16 i = 0; i < memos[fv].xl * 8; i++)
-						memory[fv][j * memos[fv].xl * 8 + i] = *_vm->_graphics->getPixel(memos[fv].x * 8 + i, memos[fv].y + j);
+						*(byte *)memory[fv].getBasePtr(i, j) = *_vm->_graphics->getPixel(memos[fv].x * 8 + i, memos[fv].y + j);
 			} else {
 				memos[fv].size = ch.size;
-				memory[fv] = new byte[memos[fv].size]; // Celer::forget_chunks() deallocates it.
-				f.read(memory[fv], ch.size);
+				memory[fv] = _vm->_graphics->loadPictureRow(f, memos[fv].xl * 8, memos[fv].yl + 1); // Celer::forget_chunks() deallocates it.
 			}
 		} else
 			memos[fv].x = on_disk;
@@ -320,80 +325,35 @@ void Celer::load_chunks(Common::String xx) {
 void Celer::forget_chunks() {
 	for (byte fv = 0; fv < num_chunks; fv ++)
 		if (memos[fv].x > on_disk)
-			delete[] memory[fv];
+			memory[fv].free();
 
 	memset(memos, 255, sizeof(memos)); /* x=-1, => on disk. */
 }
 
-void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p) {
+void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture) {
 	r.x1 = x;
 	r.y1 = y;
 	r.y2 = y + yl;
 
 	switch (flavour) {
-	case ch_natural_image: {
-		r.x2 = x + xl + 1;
-
-		x *= 8;
-		xl *= 8;
-
-		for (uint16 j = 0; j < yl; j++)
-			for (uint16 i = 0; i < xl; i++)
-				*_vm->_graphics->getPixel(x + i, y + j) = p[j * xl + i];
-		}
-		break;
+	case ch_natural_image: // Allow fallthorugh on purpose.
 	case ch_bgi : {
 		r.x2 = x + xl + 1;
-
-		_vm->_graphics->drawPicture_old(p, x * 8, y);
-		//putimage(x * 8, y, p, 0);
 		}
 		break;
 	case ch_ega : {
 		r.x2 = x + xl;
-		
-
-
-		x *= 8;
-		xl *= 8;
-
-		
-
-		::Graphics::Surface picture; // We make a Surface object for the picture itself.
-
-		picture.create(xl, yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
-
-		uint32 h = 0;
-
-		// Produce the picture.
-		for (int8 plane = 0; plane < 4; plane++) // The planes are in the opposite way.
-			for (byte j = 0; j < yl + 1; j++)
-				for (uint16 i = 0; i < xl; i += 8) {
-					byte pixel = p[h++];
-					for (byte bit = 0; bit < 8; bit++) {
-						byte pixelBit = (pixel >> bit) & 1;
-						*(byte *)picture.getBasePtr(i + 7 - bit, j) += (pixelBit << plane);
-					} 
-				}
-
-		// Copy the picture to a given place on the screen.
-		for (uint16 j = 0; j < picture.h; j++) 
-			for (uint16 i = 0; i < picture.w; i++)
-				*_vm->_graphics->getPixel(i + x, j + y) = *(byte *)picture.getBasePtr(i, j);		
-
-		picture.free();
-
-
 
 		_vm->_lucerna->blitfix();
 		}
 		break;
 	}
+
+	_vm->_graphics->drawPicture(picture, x * 8, y);
 }
 
 void Celer::show_one(byte which) {
 	chunkblocktype ch;
-	byte *p;
 	
 	//setactivepage(3);
 	warning("STUB: Celer::show_one()");
@@ -417,12 +377,11 @@ void Celer::show_one(byte which) {
 		ch.natural = f.readByte();
 		ch.memorise = f.readByte();
 
-		p = new byte[ch.size];
-		f.read(p, ch.size);
+		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, ch.xl * 8, ch.yl + 1); // There'll may be problems with the width!
 
-		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p);
+		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, picture);
 
-		delete[] p;
+		picture.free();
 		f.close();
 	}
 
@@ -435,51 +394,12 @@ void Celer::show_one(byte which) {
 
 
 
-void Celer::display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) {
-	warning("STUB: Celer::display_it1()");
+void Celer::display_it_at(int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture, int16 &xxx, int16 &yyy) {
+	warning("STUB: Celer::display_it_at()");
 }
 
 void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
-	chunkblocktype ch;
-	byte *p;
-
-	//setactivepage(3);
 	warning("STUB: Celer::show_one_at()");
-
-	if (memos[which].x > on_disk) {
-		display_it_at(memos[which].xl, memos[which].yl, memos[which].flavour, memory[which], xxx, yyy);
-	} else {
-		if (!f.open(filename)) { /* Filename was set in load_chunks() */
-			warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
-			return;
-		}
-
-		f.seek(offsets[which]);
-		ch.flavour = flavourtype(f.readByte());
-		ch.x = f.readSint16LE();
-		ch.y = f.readSint16LE();
-		ch.xl = f.readSint16LE();
-		ch.yl = f.readSint16LE();
-		ch.size = f.readSint32LE();
-		ch.natural = f.readByte();
-		ch.memorise = f.readByte();
-
-		{
-			p = new byte[ch.size];
-			f.read(p, ch.size);
-
-			display_it_at(ch.xl, ch.yl, ch.flavour, p, xxx, yyy);
-
-			delete[] p;
-			f.close();
-		}
-	}
-
-	//setactivepage(1 - cp);
-	warning("STUB: Celer::show_one_at()");
-
-	for (byte fv = 0; fv < 2; fv ++)
-		_vm->_trip->getset[fv].remember(r);
 }
 
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 2177ea2..46ba53f 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -34,6 +34,8 @@
 #include "common/file.h"
 #include "common/str.h"
 
+#include "graphics/surface.h"
+
 namespace Avalanche {
 class AvalancheEngine;
 
@@ -61,13 +63,15 @@ public:
 	int32 offsets[40];
 	byte num_chunks;
 	memotype memos[40];
-	byte *memory[40];
+	::Graphics::Surface memory[40]; // .free() is called in ~Celer()
 	bytefield r;
 
 	
 
 	Celer(AvalancheEngine *vm);
 
+	~Celer();
+
 	void pics_link();
 
 	void load_chunks(Common::String xx);
@@ -87,9 +91,9 @@ private:
 
 	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
 
-	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, byte *p);
+	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture);
 
-	void display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy);
+	void display_it_at(int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture, int16 &xxx, int16 &yyy);
 };
 
 } // End of namespace Avalanche.


Commit: efe3a662bfec950f9be3477547627dd745a98d6d
    https://github.com/scummvm/scummvm/commit/efe3a662bfec950f9be3477547627dd745a98d6d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T05:38:06-07:00

Commit Message:
AVALANCHE: Add comments to Graphics.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0fcfdac..1b5d686 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -117,6 +117,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 }
 
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
+	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
 	uint16 pictureWidth = file.readUint16LE() + 1;
 	uint16 pictureHeight = file.readUint16LE() + 1;
@@ -125,7 +126,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 
 	picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 
-	// Produce the picture.
+	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
 	for (byte y = 0; y < pictureHeight; y++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
 			for (uint16 x = 0; x < pictureWidth; x += 8) {
@@ -140,6 +141,10 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 }
 
 ::Graphics::Surface Graphics::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
+	// This function is our own creation, very much like the one above. The main differences are that
+	// we don't read the width and the height from the file, the planes are in a different order
+	// and we read the picture plane-by-plane.
+
 	::Graphics::Surface picture;
 
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index dfd06a4..0cee2fe 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -82,7 +82,7 @@ public:
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
 
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
-
+	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 
 	void drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 


Commit: ff1bc9e5a54061b2eb9edd4975f05b5f88b0fca0
    https://github.com/scummvm/scummvm/commit/ff1bc9e5a54061b2eb9edd4975f05b5f88b0fca0
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T05:50:15-07:00

Commit Message:
AVALANCHE: Get rid of Lucerna::mblit() and Lucerna::blitfix().

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/pingo2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index be925ed..4d4a1fa 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -343,8 +343,6 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 		break;
 	case ch_ega : {
 		r.x2 = x + xl;
-
-		_vm->_lucerna->blitfix();
 		}
 		break;
 	}
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 134a3b0..d2282c9 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -309,8 +309,6 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 			*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
 		}
 	}
-
-	_vm->_lucerna->blitfix();
 }
 
 void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 9b67359..ee37cc7 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -246,7 +246,6 @@ void Enid::avvy_background() {    /* Not really a filing procedure,
 		@the_end:
 		end;
 	*/
-	_vm->_lucerna->blitfix();
 }
 
 void Enid::to_sundry(sundry &sund) {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c1136ed..7fe24ce 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1044,118 +1044,6 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	warning("STUB: Lucerna::showrw()");
 }
 
-void Lucerna::mblit(byte x1, byte y1, byte x2, byte y2, byte f, byte t) /* assembler; */
-/* The Minstrel Blitter */
-/* asm
-{  ofsfr:=f*$4000+x1+y1*80;
-   ofsto:=t*$4000+x1+y1*80;}
-
-  mov bx,80; { We're multiplying by 80. }
-  mov al,y1;
-  mul bl;    { AX now contains y1*80. }
-  xor cx,cx; { Zero CX. }
-  mov cl,x1; { CX now equals x1 }
-  add ax,cx; { AX now contains x1+y1*80. }
-  mov si,ax;
-  mov di,ax;
-
-  mov ax,$4000;
-  mov bl,f;
-  mul bx; { Note that this is a *uint16*! }
-  add si,ax;
-
-  mov ax,$4000;
-  mov bl,t;
-  mul bx; { Note that this is a *uint16*! }
-  add di,ax;
-
-  push ds; { *** <<<< *** WE MUST PRESERVE THIS! }
-  cld;  { Clear Direction flag - we're going forwards! }
-
-  mov ax,$A000; { The screen memory. }
-  mov ds,ax;
-  mov es,ax; { The same. }
-
-  { AH stores the number of bytes to copy. }
-  { len:=(x2-x1)+1; }
-
-  mov ah,x2;
-  sub ah,x1;
-  inc ah;
-
-  { Firstly, let's decide how many times we're going round. }
-
-  mov cl,y2; { How many numbers between y1 and y2? }
-  sub cl,y1;
-  inc cl; { Inclusive reckoning (for example, from 3 to 5 is 5-3+1=3 turns. }
-
-  { We'll use SI and DI to be Ofsfr and Ofsto. }
-
-  @Y_axis_loop:
-   push cx;
-
-
-   { OK... We've changed this loop from a for-next loop. "Bit" is
-     represented by CX. }
-
-{     port[$3c4]:=2; port[$3ce]:=4; }
-   mov dx,$3c4;
-   mov al,2;
-   out dx,al;
-   mov dx,$3ce;
-   mov al,4;
-   out dx,al;
-
-   mov cx,4; { We have to copy planes 3, 2, 1 and Zero. We'll add 1 to the
-    number, because at zero it stops. }
-
-   mov bx,3; { This has a similar function to that of CX. }
-
-   @start_of_loop:
-
-    push cx;
-
-{     port[$3C5]:=1 shl bit; }
-    mov dx,$3C5;
-    mov al,1;
-    mov cl,bl; { BL = bit. }
-    shl al,cl;
-    out dx,al;
-{     port[$3CF]:=bit; }
-    mov dx,$3CF;
-    mov al,bl; { BL = bit. }
-    out dx,al;
-
-{   move(mem[$A000:ofsfr],mem[$A000:ofsto],len); }
-
-    xor ch,ch; { Clear CH. }
-    mov cl,ah;
-
-    repz movsb; { That's all we need to say! }
-
-    mov cl,ah;
-    sub si,cx; { This is MUCH, MUCH faster than pushing and popping them! }
-    sub di,cx;
-
-    pop cx; { Get the loop count back again. }
-    dec bx; { One less... }
-   loop @start_of_loop; { Until cx=0. }
-
-   add si,80; { Do the next line... }
-   add di,80;
-
-   pop cx;
-  loop @Y_axis_loop;
-
-  pop ds; { Get it back again (or we'll be in trouble with TP!) }
-*/
-{
-}
-
-void Lucerna::blitfix() {
-	warning("STUB: Lucerna::blitfix()");
-}
-
 
 
 
@@ -1194,10 +1082,9 @@ void Lucerna::delavvy() {
 	_vm->_gyro->off();
 	
 	triptype &with = _vm->_trip->tr[0];
-	for (page_ = 0; page_ <= 1; page_ ++)
-		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
+	/*for (page_ = 0; page_ <= 1; page_ ++)
+		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);*/
 	
-	blitfix();
 	_vm->_gyro->on();
 }
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 7486b0d..efb45e2 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -86,10 +86,6 @@ public:
 
 	void showrw();
 
-	void mblit(byte x1, byte y1, byte x2, byte y2, byte f, byte t); /* The Minstrel Blitter */
-
-	void blitfix();
-
 	void clock_lucerna();
 
 	void flip_page();
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 00c9978..4f3d171 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -128,7 +128,6 @@ void Pingo::winning_pic() {
 	warning("STUB: Pingo::winning_pic()");
 
 	f.close();
-	_vm->_lucerna->blitfix();
 
 	//setvisualpage(0);
 	warning("STUB: Pingo::winning_pic()");
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 1a525d7..8abf313 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -909,8 +909,8 @@ void Trip::call_special(uint16 which) {
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
-		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
-		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
+		/*_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
+		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);*/
 		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
@@ -1130,11 +1130,8 @@ void Trip::getback() {
 			end;
 		*/
 
-		_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
+		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}
-
-	_vm->_lucerna->blitfix();
-
 	/*
 	if endangered then
 		Super_On;


Commit: 190e37d3f9f7b990722163df5aae247fdbe8688c
    https://github.com/scummvm/scummvm/commit/190e37d3f9f7b990722163df5aae247fdbe8688c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-26T05:52:26-07:00

Commit Message:
AVALANCHE: Remove Graphics::drawPicture_old().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 1b5d686..12b94fe 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -169,36 +169,6 @@ void Graphics::drawPicture(const ::Graphics::Surface &picture, uint16 destX, uin
 			*getPixel(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
 }
 
-void Graphics::drawPicture_old(const byte *source, uint16 destX, uint16 destY) {
-	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
-	uint16 pictureWidth = READ_LE_UINT16(source) + 1;
-	uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
-
-	uint32 i = 4;
-
-	::Graphics::Surface picture; // We make a Surface object for the picture itself.
-
-	picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-
-	// Produce the picture.
-	for (byte y = 0; y < pictureHeight; y++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 x = 0; x < pictureWidth; x += 8) {
-				byte pixel = source[i++];
-				for (byte bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
-				} 
-			}
-
-	// Copy the picture to a given place on the screen.
-	for (uint16 y = 0; y < picture.h; y++)
-		for (uint16 x = 0; x < picture.w; x++)
-			*getPixel(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
-
-	picture.free();
-}
-
 void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	::Graphics::Surface picture;
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 0cee2fe..67e9c5f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -86,8 +86,6 @@ public:
 
 	void drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 
-	void drawPicture_old(const byte *source, uint16 destX, uint16 destY);
-
 	void refreshScreen();
 
 private:


Commit: 5fe090a38c91845712635e897d7e1e3ea6983235
    https://github.com/scummvm/scummvm/commit/5fe090a38c91845712635e897d7e1e3ea6983235
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T01:05:09-07:00

Commit Message:
AVALANCHE: Add comments in Graphics and Trip, repair functions in Trip.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 12b94fe..e7fb6ea 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -103,7 +103,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	}
 
 	/* Then we draw the picture to the blank places. */
-	uint16 i = 0; // Because the original siltype starts at 5!!! See Graph.h for definition.
+	uint16 i = 0; // Because the original siltype starts at 5!!! See Graphics.h for definition.
 
 	for (byte qay = 0; qay < sprite.yl; qay++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 8abf313..ff3a757 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* TRIP5	Trippancy V */
+/* TRIP5	Trippancy V - the sprite animation subsystem */
 
 #include "avalanche/avalanche.h"
 
@@ -204,7 +204,8 @@ void triptype::walk() {
 	if (!_tr->_vm->_gyro->doing_sprite_run) {
 		ox[_tr->_vm->_gyro->cp] = x;
 		oy[_tr->_vm->_gyro->cp] = y;
-		if (homing)  homestep();
+		if (homing)
+			homestep();
 		x = x + ix;
 		y = y + iy;
 	}
@@ -250,7 +251,8 @@ void triptype::walk() {
 		count++;
 		if (((ix != 0) || (iy != 0)) && (count > 1)) {
 			step++;
-			if (step == a.seq)  step = 0;
+			if (step == a.seq)
+				step = 0;
 			count = 0;
 		}
 	}
@@ -1365,9 +1367,9 @@ void Trip::trippancy_link() {
 	}
 
 	call_andexors();
-	for (fv = 1; fv <= numtr; fv++) {
-		triptype &with = tr[fv];
-		if (with.quick && with.call_eachstep) {
+
+	for (fv = 0; fv < numtr; fv++) {
+		if (tr[fv].quick && tr[fv].call_eachstep) {
 			switch (tr[fv].eachstep) {
 			case procfollow_avvy_y :
 				follow_avvy_y(fv);
@@ -1391,6 +1393,7 @@ void Trip::trippancy_link() {
 			}
 		}
 	}
+
 	if (mustexclaim) {
 		mustexclaim = false;
 		_vm->_visa->dixi('x', saywhat);
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 30fcba2..b960edc 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* TRIP5	Trippancy V */
+/* TRIP5	Trippancy V - the sprite animation subsystem */
 
 
 #ifndef TRIP6_H


Commit: d3ff894ff6a62a37543a8dbd25dace62b1ce69d9
    https://github.com/scummvm/scummvm/commit/d3ff894ff6a62a37543a8dbd25dace62b1ce69d9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T01:17:32-07:00

Commit Message:
AVALANCHE: Replace call of Basher::keyboard_link() with Avalanche::updateEvents() in Avalot::run().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6c49a66..3f967fb 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -182,8 +182,9 @@ void Avalot::run(Common::String arg) {
 	do {
 		uint32 beginLoop = _vm->_system->getMillis();
 
+		_vm->updateEvents(); // The event handler.
+
 		_vm->_lucerna->clock_lucerna();
-		_vm->_basher->keyboard_link();
 		_vm->_dropdown->menu_link();
 		_vm->_trip->readstick();
 		_vm->_gyro->force_numlock();
@@ -205,7 +206,7 @@ void Avalot::run(Common::String arg) {
 
 		// Not in the original:
 
-		_vm->updateEvents(); // The event handler.
+	
 
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index eadf3dd..476a6d3 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -31,6 +31,8 @@
 // to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
 // cause them to be played back. 
 
+// TODO: Replace these functions gradually with ScummVM's own methods.
+
 #ifndef BASHER2_H
 #define BASHER2_H
 


Commit: c9fbfb6d32af41b3b55df553ecd7aa203dff5eed
    https://github.com/scummvm/scummvm/commit/c9fbfb6d32af41b3b55df553ecd7aa203dff5eed
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T01:30:16-07:00

Commit Message:
AVALANCHE: Remove unnecessary indents from Visa.

Changed paths:
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 4ffedc2..5938f52 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -41,56 +41,105 @@
 
 namespace Avalanche {
 
-	Visa::Visa(AvalancheEngine *vm) {
-		_vm = vm;
+Visa::Visa(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+bool Visa::bubbling = false;
+bool Visa::report_dixi_errors = true;
+
+void Visa::unskrimble() {
+	for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
+		_vm->_gyro->buffer[fv] = (char)((!(_vm->_gyro->buffer[fv]) - fv) % 256);
+}
+
+void Visa::do_the_bubble() {
+	_vm->_gyro->bufsize++;
+	_vm->_gyro->buffer[_vm->_gyro->bufsize] = 2;
+}
+
+void Visa::dixi(char block, byte point) {
+	Common::File indexfile, sezfile;
+	uint16 idx_offset, sez_offset;
+	bool error = false;
+
+	if (!indexfile.open("avalot.idx")) {
+		warning("AVALANCHE: Visa: File not found: avalot.idx");
+		return;
 	}
 
-	bool Visa::bubbling = false;
-	bool Visa::report_dixi_errors = true;
+	indexfile.seek((toupper(block) - 65) * 2);
+	idx_offset = indexfile.readUint16LE();
+	if (idx_offset == 0)
+		error = true;
 
-	void Visa::unskrimble() {
-		for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
-			_vm->_gyro->buffer[fv] = (char)((!(_vm->_gyro->buffer[fv]) - fv) % 256);
+	indexfile.seek(idx_offset + point * 2);
+	sez_offset = indexfile.readUint16LE();
+	if (sez_offset == 0)
+		error = true;
+
+	indexfile.close();
+
+	went_ok = !error;
+
+	if (error) {
+		if (report_dixi_errors) {
+			Common::String todisplay;
+			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
+			_vm->_scrolls->display(todisplay);
+		}
+		return;
 	}
 
-	void Visa::do_the_bubble() {
-		_vm->_gyro->bufsize++;
-		_vm->_gyro->buffer[_vm->_gyro->bufsize] = 2;
+	if (!sezfile.open("avalot.sez")) {
+		warning("AVALANCHE: Visa: File not found: avalot.sez");
+		return;
 	}
+	sezfile.seek(sez_offset);
+	_vm->_gyro->bufsize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
+	sezfile.close();
+	unskrimble();
 
-	void Visa::dixi(char block, byte point) {
-		Common::File indexfile, sezfile;
-		uint16 idx_offset, sez_offset;
-		bool error = false;
+	if (bubbling)  do_the_bubble();
 
-		if (!indexfile.open("avalot.idx")) {
-			warning("AVALANCHE: Visa: File not found: avalot.idx");
-			return;
-		}
+	_vm->_scrolls->calldrivers();
+}
 
-		indexfile.seek((toupper(block) - 65) * 2);
-		idx_offset = indexfile.readUint16LE();
-		if (idx_offset == 0)
-			error = true;
+void Visa::speech(byte who, byte subject) {
+	Common::File indexfile, sezfile;
+	uint16 idx_offset, sez_offset, next_idx_offset;
 
-		indexfile.seek(idx_offset + point * 2);
-		sez_offset = indexfile.readUint16LE();
-		if (sez_offset == 0)
-			error = true;
+	if (subject == 0) {
+		/* No subject. */
 
-		indexfile.close();
+		bubbling = true;
+		report_dixi_errors = false;
+		dixi('s', who);
+		bubbling = false;
+		report_dixi_errors = true;
+	} else {
+		/* Subject given. */
 
-		went_ok = !error;
+		went_ok = false; /* Assume that until we know otherwise. */
 
-		if (error) {
-			if (report_dixi_errors) {
-				Common::String todisplay;
-				todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
-				_vm->_scrolls->display(todisplay);
-			}
+		if (!indexfile.open("converse.avd")) {
+			warning("AVALANCHE: Visa: File not found: converse.avd");
 			return;
 		}
 
+		indexfile.seek(who * 2 - 2);
+		idx_offset = indexfile.readUint16LE();
+		next_idx_offset = indexfile.readUint16LE();
+
+		if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))  return;
+
+		indexfile.seek(idx_offset + subject * 2);
+		sez_offset = indexfile.readUint16LE();
+		if ((sez_offset == 0) || (indexfile.err()))
+			return;
+		indexfile.close();
+
 		if (!sezfile.open("avalot.sez")) {
 			warning("AVALANCHE: Visa: File not found: avalot.sez");
 			return;
@@ -99,71 +148,22 @@ namespace Avalanche {
 		_vm->_gyro->bufsize = sezfile.readUint16LE();
 		sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
 		sezfile.close();
-		unskrimble();
 
-		if (bubbling)  do_the_bubble();
+		unskrimble();
+		do_the_bubble();
 
 		_vm->_scrolls->calldrivers();
+		went_ok = true;
 	}
 
-	void Visa::speech(byte who, byte subject) {
-		Common::File indexfile, sezfile;
-		uint16 idx_offset, sez_offset, next_idx_offset;
-
-		if (subject == 0) {
-			/* No subject. */
-
-			bubbling = true;
-			report_dixi_errors = false;
-			dixi('s', who);
-			bubbling = false;
-			report_dixi_errors = true;
-		} else {
-			/* Subject given. */
-
-			went_ok = false; /* Assume that until we know otherwise. */
-
-			if (!indexfile.open("converse.avd")) {
-				warning("AVALANCHE: Visa: File not found: converse.avd");
-				return;
-			}
-
-			indexfile.seek(who * 2 - 2);
-			idx_offset = indexfile.readUint16LE();
-			next_idx_offset = indexfile.readUint16LE();
-
-			if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))  return;
-
-			indexfile.seek(idx_offset + subject * 2);
-			sez_offset = indexfile.readUint16LE();
-			if ((sez_offset == 0) || (indexfile.err()))
-				return;
-			indexfile.close();
-
-			if (!sezfile.open("avalot.sez")) {
-				warning("AVALANCHE: Visa: File not found: avalot.sez");
-				return;
-			}
-			sezfile.seek(sez_offset);
-			_vm->_gyro->bufsize = sezfile.readUint16LE();
-			sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
-			sezfile.close();
-
-			unskrimble();
-			do_the_bubble();
-
-			_vm->_scrolls->calldrivers();
-			went_ok = true;
-		}
+	warning("STUB: Visa::speech()");
+}
 
-		warning("STUB: Visa::speech()");
-	}
+void Visa::talkto(byte whom) {
+	byte fv;
+	bool no_matches;
 
-	void Visa::talkto(byte whom) {
-		byte fv;
-		bool no_matches;
-
-		warning("STUB: Visa::talkto()");
-	}
+	warning("STUB: Visa::talkto()");
+}
 
 } // End of namespace Avalanche.


Commit: de97da2fe64fb713d547441a7510c71828376bb1
    https://github.com/scummvm/scummvm/commit/de97da2fe64fb713d547441a7510c71828376bb1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T06:05:06-07:00

Commit Message:
AVALANCHE: Implement Basher::plottext().

Changed paths:
    engines/avalanche/basher2.cpp



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 0ce98e7..5f87322 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -79,7 +79,25 @@ void Basher::init() {
 }
 
 void Basher::plottext() {
-	warning("STUB: Basher::plottext()");
+	if (_vm->_gyro->mouse_near_text())
+		_vm->_gyro->super_off();
+
+	cursor_off();
+
+	_vm->_graphics->drawBar(24, 161, 640, 169, black);
+
+	for (byte i = 0; i < _vm->_gyro->current.size(); i++)
+		for (byte j = 0; j < 8; j++) {
+			byte pixel = _vm->_gyro->little[_vm->_gyro->current[i]][j];
+			for (byte bit = 0; bit < 8; bit++) {
+				byte pixelBit = (pixel >> bit) & 1;
+				if (pixelBit != 0)
+					*_vm->_graphics->getPixel(/*x * 8 + */ 24 + i * 8 + 7 - bit, 161 + j) = white;
+			}
+		}
+
+	cursor_on();
+	_vm->_gyro->super_on();
 }
 
 void Basher::wipetext() {


Commit: 9c96417041ed16c1025fcf0fda7dc2b51a9dcf83
    https://github.com/scummvm/scummvm/commit/9c96417041ed16c1025fcf0fda7dc2b51a9dcf83
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T06:07:21-07:00

Commit Message:
AVALANCHE: Add comments to Basher::plottext().

Changed paths:
    engines/avalanche/basher2.cpp



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 5f87322..355bdaf 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -84,8 +84,9 @@ void Basher::plottext() {
 
 	cursor_off();
 
-	_vm->_graphics->drawBar(24, 161, 640, 169, black);
+	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
 
+	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
 	for (byte i = 0; i < _vm->_gyro->current.size(); i++)
 		for (byte j = 0; j < 8; j++) {
 			byte pixel = _vm->_gyro->little[_vm->_gyro->current[i]][j];


Commit: bda09042b584f1b5f0ad77cc35f53e953a3dd2ef
    https://github.com/scummvm/scummvm/commit/bda09042b584f1b5f0ad77cc35f53e953a3dd2ef
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T06:19:16-07:00

Commit Message:
AVALANCHE: Rename little[] to characters[] and current to inputText in Gyro.

Changed paths:
    engines/avalanche/basher2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 355bdaf..16122fa 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -87,9 +87,9 @@ void Basher::plottext() {
 	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
 
 	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
-	for (byte i = 0; i < _vm->_gyro->current.size(); i++)
+	for (byte i = 0; i < _vm->_gyro->inputText.size(); i++)
 		for (byte j = 0; j < 8; j++) {
-			byte pixel = _vm->_gyro->little[_vm->_gyro->current[i]][j];
+			byte pixel = _vm->_gyro->characters[_vm->_gyro->inputText[i]][j];
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit != 0)
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index d2282c9..bc8414d 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -287,7 +287,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 
 	for (byte fv = 0; fv < z.size(); fv++)
 		for (byte ff = 0; ff < 8; ff++) {
-			byte pixel = ~(_vm->_gyro->little[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
+			byte pixel = ~(_vm->_gyro->characters[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index b2fc47f..3eee077 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -481,7 +481,7 @@ public:
 
 
 
-	Common::String current;
+	Common::String inputText;
 	byte curpos;
 	bool cursoron;
 	/* previous:^previoustype;*/
@@ -547,7 +547,7 @@ public:
 	Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
 
 	byte cp, ledstatus, defaultled;
-	raw little;
+	raw characters;
 	bool quote; /* 66 or 99 next? */
 	bool alive;
 	char buffer[2000];
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 6335863..8250880 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -315,7 +315,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_vm->_gyro->little[i],16);
+		f.read(_vm->_gyro->characters[i],16);
 	f.close();
 }
 


Commit: 7d3b69251fa0dc3cca7fa5e3f8f86198050e8177
    https://github.com/scummvm/scummvm/commit/7d3b69251fa0dc3cca7fa5e3f8f86198050e8177
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T07:55:03-07:00

Commit Message:
AVALANCHE: Minor repairs in Basher.

Changed paths:
    engines/avalanche/basher2.cpp



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 16122fa..007c0b5 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -93,7 +93,7 @@ void Basher::plottext() {
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit != 0)
-					*_vm->_graphics->getPixel(/*x * 8 + */ 24 + i * 8 + 7 - bit, 161 + j) = white;
+					*_vm->_graphics->getPixel(24 + i * 8 + 7 - bit, 161 + j) = white;
 			}
 		}
 
@@ -205,7 +205,7 @@ void Basher::normal_edit() {
 	/*if (!_vm->_gyro->current.empty())
 		_vm->_gyro->current.clear();*/
 	left_margin = 1;
-	_vm->_gyro->curpos = 1;
+	_vm->_gyro->curpos = 0;
 }
 
 } // End of namespace Avalanche.


Commit: 541f5f9c3b20311140d11f64f71678de2cc5c663
    https://github.com/scummvm/scummvm/commit/541f5f9c3b20311140d11f64f71678de2cc5c663
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T07:55:50-07:00

Commit Message:
AVALANCHE: Implement Avalot::handleKeyDown() further.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3f967fb..ef0de65 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -89,7 +89,7 @@ void Avalot::setup() {
 	_vm->_lucerna->load_digits();
 	_vm->_gyro->cheat = false;
 	_vm->_gyro->cp = 0;
-	_vm->_gyro->curpos = 1;
+	_vm->_gyro->curpos = 0;
 	_vm->_gyro->quote = true;
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->defaultled = 2;
@@ -172,6 +172,29 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 		break;
 	}
+
+	if (((32 <= event.kbd.ascii) && (event.kbd.ascii <= 46)) || ((48 <= event.kbd.ascii) && (event.kbd.ascii <= 223))
+		|| ((225 <= event.kbd.ascii) && (event.kbd.ascii <= 255))) {
+			byte inChar = event.kbd.ascii;
+			if (_vm->_dropdown->ddm_o.menunow) {
+				_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
+			} else {
+				if (_vm->_gyro->inputText.size() < 76) {
+					if ((inChar == '"') || (inChar == '`')) {
+						if (_vm->_gyro->quote)
+							inChar = '`';
+						else
+							inChar = '"';
+						_vm->_gyro->quote = !_vm->_gyro->quote;  // quote - unquote
+					}
+
+					_vm->_gyro->inputText.insertChar(inChar, _vm->_gyro->curpos);
+					_vm->_gyro->curpos++;
+					_vm->_basher->plottext();
+				} else
+					_vm->_gyro->blip();
+			}
+	}
 }
 
 


Commit: 0703085d20330624a741c52583b4bbc9ed252498
    https://github.com/scummvm/scummvm/commit/0703085d20330624a741c52583b4bbc9ed252498
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T08:00:02-07:00

Commit Message:
AVALANCHE: Repair Avalot::handleKeyDown().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ef0de65..d7dcff9 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -173,8 +173,7 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 		break;
 	}
 
-	if (((32 <= event.kbd.ascii) && (event.kbd.ascii <= 46)) || ((48 <= event.kbd.ascii) && (event.kbd.ascii <= 223))
-		|| ((225 <= event.kbd.ascii) && (event.kbd.ascii <= 255))) {
+	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47)) {
 			byte inChar = event.kbd.ascii;
 			if (_vm->_dropdown->ddm_o.menunow) {
 				_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);


Commit: 7c8d415a9422e5fb1e79d55682483d8f505c2230
    https://github.com/scummvm/scummvm/commit/7c8d415a9422e5fb1e79d55682483d8f505c2230
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T08:19:35-07:00

Commit Message:
AVALANCHE: Remove comment from Graphics.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index e7fb6ea..9fa4ffe 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -25,8 +25,6 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* Replacement class for the Graph unit from Pascal. */
-
 #include "avalanche/avalanche.h"
 #include "avalanche/graphics.h"
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 67e9c5f..5cc5a2e 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -25,8 +25,6 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* Replacement class for the Graph unit from Pascal. */
-
 #ifndef GRAPH_H
 #define GRAPH_H
 


Commit: 341bf679c00ae2de0f3350b1ec95d4b02b246093
    https://github.com/scummvm/scummvm/commit/341bf679c00ae2de0f3350b1ec95d4b02b246093
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T08:22:56-07:00

Commit Message:
AVALANCHE: Cosmetic repairs in Graphics.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9fa4ffe..bed8136 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -29,11 +29,11 @@
 #include "avalanche/graphics.h"
 
 #include "common/system.h"
+#include "common/rect.h"
 
 #include "engines/util.h"
 
 #include "graphics/palette.h"
-#include "common/rect.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 5cc5a2e..3d32bda 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#ifndef GRAPH_H
-#define GRAPH_H
+#ifndef GRAPHICS_H
+#define GRAPHICS_H
 
 #include "common/file.h"
 
@@ -98,4 +98,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // GRAPH_H
+#endif // GRAPHICS_H


Commit: eec48fa42e83f7bf364d61c8d2d687ad2a758830
    https://github.com/scummvm/scummvm/commit/eec48fa42e83f7bf364d61c8d2d687ad2a758830
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T12:36:07-07:00

Commit Message:
AVALANCHE: Introduce new class: Parser. Update rest of the code accordingly.

Changed paths:
  A engines/avalanche/parser.cpp
  A engines/avalanche/parser.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/gyro2.h
    engines/avalanche/module.mk



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9194816..09695cd 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -57,6 +57,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _rnd;
 
 	delete _graphics;
+	delete _parser;
 
 	delete _avalot;
 	delete _gyro;
@@ -79,6 +80,7 @@ AvalancheEngine::~AvalancheEngine() {
 
 Common::ErrorCode AvalancheEngine::initialize() {
 	_graphics = new Graphics(this);
+	_parser = new Parser(this);
 
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f43b6a7..a2b7ab6 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -31,6 +31,7 @@
 #include "avalanche/console.h"
 
 #include "avalanche/graphics.h"
+#include "avalanche/parser.h"
 
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
@@ -66,6 +67,7 @@ static const int kSavegameVersion = 1;
 class AvalancheEngine : public Engine {
 public:
 	Graphics *_graphics;
+	Parser *_parser;
 
 	Avalot *_avalot;
 	Gyro *_gyro;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index d7dcff9..ceaf754 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -89,8 +89,8 @@ void Avalot::setup() {
 	_vm->_lucerna->load_digits();
 	_vm->_gyro->cheat = false;
 	_vm->_gyro->cp = 0;
-	_vm->_gyro->curpos = 0;
-	_vm->_gyro->quote = true;
+	_vm->_parser->inputTextPos = 0;
+	_vm->_parser->quote = true;
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->defaultled = 2;
 	/* TSkellern:=0; { Replace with a more local variable sometime }*/
@@ -173,27 +173,8 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 		break;
 	}
 
-	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47)) {
-			byte inChar = event.kbd.ascii;
-			if (_vm->_dropdown->ddm_o.menunow) {
-				_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
-			} else {
-				if (_vm->_gyro->inputText.size() < 76) {
-					if ((inChar == '"') || (inChar == '`')) {
-						if (_vm->_gyro->quote)
-							inChar = '`';
-						else
-							inChar = '"';
-						_vm->_gyro->quote = !_vm->_gyro->quote;  // quote - unquote
-					}
-
-					_vm->_gyro->inputText.insertChar(inChar, _vm->_gyro->curpos);
-					_vm->_gyro->curpos++;
-					_vm->_basher->plottext();
-				} else
-					_vm->_gyro->blip();
-			}
-	}
+	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
+		_vm->_parser->handleInputText(event);
 }
 
 
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 007c0b5..c91b3af 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -78,29 +78,6 @@ void Basher::init() {
 #endif
 }
 
-void Basher::plottext() {
-	if (_vm->_gyro->mouse_near_text())
-		_vm->_gyro->super_off();
-
-	cursor_off();
-
-	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
-
-	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
-	for (byte i = 0; i < _vm->_gyro->inputText.size(); i++)
-		for (byte j = 0; j < 8; j++) {
-			byte pixel = _vm->_gyro->characters[_vm->_gyro->inputText[i]][j];
-			for (byte bit = 0; bit < 8; bit++) {
-				byte pixelBit = (pixel >> bit) & 1;
-				if (pixelBit != 0)
-					*_vm->_graphics->getPixel(24 + i * 8 + 7 - bit, 161 + j) = white;
-			}
-		}
-
-	cursor_on();
-	_vm->_gyro->super_on();
-}
-
 void Basher::wipetext() {
 	warning("STUB: Basher::wipetext()");
 }
@@ -202,10 +179,10 @@ void Basher::filename_edit() {
 
 void Basher::normal_edit() {
 	entering_filename = false;
-	/*if (!_vm->_gyro->current.empty())
-		_vm->_gyro->current.clear();*/
 	left_margin = 1;
-	_vm->_gyro->curpos = 0;
+	if (!_vm->_parser->inputText.empty())
+		_vm->_parser->inputText.clear();
+	_vm->_parser->inputTextPos = 0;
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index 476a6d3..3459144 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -51,8 +51,6 @@ public:
 
 	void init();
 
-	void plottext();
-
 	void keyboard_link();
 
 	void cursor_on();
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 3eee077..27a184e 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -479,10 +479,6 @@ public:
 
 
 
-
-
-	Common::String inputText;
-	byte curpos;
 	bool cursoron;
 	/* previous:^previoustype;*/
 	Common::String last;
@@ -548,7 +544,6 @@ public:
 
 	byte cp, ledstatus, defaultled;
 	raw characters;
-	bool quote; /* 66 or 99 next? */
 	bool alive;
 	char buffer[2000];
 	uint16 bufsize;
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 306df15..e2dd67d 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/avalanche
 MODULE_OBJS = \
 	avalanche.o \
 	graphics.o \
+	parser.o\
 	avalot.o \
 	console.o \
 	detection.o \
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
new file mode 100644
index 0000000..d8cd37a
--- /dev/null
+++ b/engines/avalanche/parser.cpp
@@ -0,0 +1,82 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/parser.h"
+
+namespace Avalanche {
+
+Parser::Parser(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Parser::handleInputText(const Common::Event &event) {
+	byte inChar = event.kbd.ascii;
+	if (_vm->_dropdown->ddm_o.menunow) {
+		_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
+	} else {
+		if (inputText.size() < 76) {
+			if ((inChar == '"') || (inChar == '`')) {
+				if (quote)
+					inChar = '`';
+				else
+					inChar = '"';
+				quote = !quote;  // quote - unquote
+			}
+
+			inputText.insertChar(inChar, inputTextPos);
+			inputTextPos++;
+			plotText();
+		} else
+			_vm->_gyro->blip();
+	}
+}
+
+void Parser::plotText() {
+	if (_vm->_gyro->mouse_near_text())
+		_vm->_gyro->super_off();
+
+	_vm->_basher->cursor_off();
+
+	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
+
+	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
+	for (byte i = 0; i < _vm->_parser->inputText.size(); i++)
+		for (byte j = 0; j < 8; j++) {
+			byte pixel = _vm->_gyro->characters[_vm->_parser->inputText[i]][j];
+			for (byte bit = 0; bit < 8; bit++) {
+				byte pixelBit = (pixel >> bit) & 1;
+				if (pixelBit != 0)
+					*_vm->_graphics->getPixel(24 + i * 8 + 7 - bit, 161 + j) = white;
+			}
+		}
+
+	_vm->_basher->cursor_on();
+	_vm->_gyro->super_on();
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
new file mode 100644
index 0000000..da6ef6e
--- /dev/null
+++ b/engines/avalanche/parser.h
@@ -0,0 +1,57 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include "common/events.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Parser {
+public:
+	Common::String inputText;
+	byte inputTextPos;
+	bool quote; // 66 or 99 next?
+
+
+
+	Parser(AvalancheEngine *vm);
+
+	void handleInputText(const Common::Event &event);
+
+	void plotText();
+
+private:
+	AvalancheEngine *_vm;
+
+};
+
+} // End of namespace Avalanche
+
+#endif // PARSER_H


Commit: 31f8e91444a17c9d48cbcb409c067d470cb7c36a
    https://github.com/scummvm/scummvm/commit/31f8e91444a17c9d48cbcb409c067d470cb7c36a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T12:48:28-07:00

Commit Message:
AVALANCHE: Rename variables in Parser. Add _leftMargin to Parser. Fix _leftMargins in Basher.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ceaf754..772a6c7 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -89,8 +89,8 @@ void Avalot::setup() {
 	_vm->_lucerna->load_digits();
 	_vm->_gyro->cheat = false;
 	_vm->_gyro->cp = 0;
-	_vm->_parser->inputTextPos = 0;
-	_vm->_parser->quote = true;
+	_vm->_parser->_inputTextPos = 0;
+	_vm->_parser->_quote = true;
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->defaultled = 2;
 	/* TSkellern:=0; { Replace with a more local variable sometime }*/
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index c91b3af..dcd3158 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -179,10 +179,10 @@ void Basher::filename_edit() {
 
 void Basher::normal_edit() {
 	entering_filename = false;
-	left_margin = 1;
-	if (!_vm->_parser->inputText.empty())
-		_vm->_parser->inputText.clear();
-	_vm->_parser->inputTextPos = 0;
+	_vm->_parser->_leftMargin = 0;
+	if (!_vm->_parser->_inputText.empty())
+		_vm->_parser->_inputText.clear();
+	_vm->_parser->_inputTextPos = 0;
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index 3459144..0c865d4 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -73,7 +73,6 @@ private:
 	AvalancheEngine *_vm;
 
 	bool entering_filename;
-	byte left_margin;
 
 	void wipetext();
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index d8cd37a..7429fd9 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -39,17 +39,17 @@ void Parser::handleInputText(const Common::Event &event) {
 	if (_vm->_dropdown->ddm_o.menunow) {
 		_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
 	} else {
-		if (inputText.size() < 76) {
+		if (_inputText.size() < 76) {
 			if ((inChar == '"') || (inChar == '`')) {
-				if (quote)
+				if (_quote)
 					inChar = '`';
 				else
 					inChar = '"';
-				quote = !quote;  // quote - unquote
+				_quote = !_quote;  // quote - unquote
 			}
 
-			inputText.insertChar(inChar, inputTextPos);
-			inputTextPos++;
+			_inputText.insertChar(inChar, _inputTextPos);
+			_inputTextPos++;
 			plotText();
 		} else
 			_vm->_gyro->blip();
@@ -65,9 +65,9 @@ void Parser::plotText() {
 	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
 
 	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
-	for (byte i = 0; i < _vm->_parser->inputText.size(); i++)
+	for (byte i = 0; i < _vm->_parser->_inputText.size(); i++)
 		for (byte j = 0; j < 8; j++) {
-			byte pixel = _vm->_gyro->characters[_vm->_parser->inputText[i]][j];
+			byte pixel = _vm->_gyro->characters[_vm->_parser->_inputText[i]][j];
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit != 0)
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index da6ef6e..e10ca15 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -35,9 +35,10 @@ class AvalancheEngine;
 
 class Parser {
 public:
-	Common::String inputText;
-	byte inputTextPos;
-	bool quote; // 66 or 99 next?
+	Common::String _inputText;
+	byte _inputTextPos;
+	bool _quote; // 66 or 99 next?
+	byte _leftMargin;
 
 
 


Commit: df427ba7e833f98b295ceb7abe6f7fb86c1331b1
    https://github.com/scummvm/scummvm/commit/df427ba7e833f98b295ceb7abe6f7fb86c1331b1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T13:03:59-07:00

Commit Message:
AVALANCHE: Broaden comment in avalot.h.

Changed paths:
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 138d4b3..a053267 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -44,7 +44,7 @@ public:
 
 
 
-	void handleKeyDown(const Common::Event &event); // To replace Basher::keyboard_link().
+	void handleKeyDown(const Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 
 	
 


Commit: 825df596e66587963c59e51da831b938ae9d3886
    https://github.com/scummvm/scummvm/commit/825df596e66587963c59e51da831b938ae9d3886
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-27T13:14:23-07:00

Commit Message:
AVALANCHE: Add Parser::handleBackspace(). Update Avalot::handleKeyDown() accordingly.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 772a6c7..f553c45 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -171,6 +171,8 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_KP5:
 		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 		break;
+	case Common::KEYCODE_BACKSPACE :
+		_vm->_parser->handleBackspace();
 	}
 
 	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 7429fd9..096aca3 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -56,6 +56,19 @@ void Parser::handleInputText(const Common::Event &event) {
 	}
 }
 
+void Parser::handleBackspace() {
+	if (! _vm->_dropdown->ddm_o.menunow) {
+		if (_inputTextPos > _leftMargin) {
+			_inputTextPos--;
+			if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
+				_quote = !_quote;
+			_inputText.deleteChar(_inputTextPos);
+			plotText();
+		} else
+			_vm->_gyro->blip();
+	}
+}
+
 void Parser::plotText() {
 	if (_vm->_gyro->mouse_near_text())
 		_vm->_gyro->super_off();
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index e10ca15..3dd5d37 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -46,6 +46,8 @@ public:
 
 	void handleInputText(const Common::Event &event);
 
+	void handleBackspace();
+
 	void plotText();
 
 private:


Commit: a1a2fa2da8f54d5c573e45ff553c1440137b8b6a
    https://github.com/scummvm/scummvm/commit/a1a2fa2da8f54d5c573e45ff553c1440137b8b6a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T01:00:14-07:00

Commit Message:
AVALANCHE: Implement handling of the cursor in Parser.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/gyro2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f553c45..e1879e1 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -143,8 +143,8 @@ void Avalot::setup() {
 	//setcolor(7);
 	_vm->_gyro->holdthedawn = false;
 	_vm->_lucerna->dawn();
-	_vm->_gyro->cursoron = false;
-	_vm->_basher->cursor_on();
+	_vm->_parser->_cursorState = false;
+	_vm->_parser->cursorOn();
 	_vm->_trip->newspeed();
 
 	if (! _vm->_gyro->reloaded)
@@ -171,8 +171,12 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_KP5:
 		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 		break;
-	case Common::KEYCODE_BACKSPACE :
+	case Common::KEYCODE_BACKSPACE:
 		_vm->_parser->handleBackspace();
+		break;
+	case Common::KEYCODE_RETURN:
+		_vm->_parser->handleReturn();
+		break;
 	}
 
 	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index dcd3158..8e51abe 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -95,19 +95,6 @@ begin
  end else dec(curflash);
 end;*/
 
-void Basher::do_cursor() {
-	warning("STUB: Basher::do_cursor()");
-}
-
-void Basher::cursor_on() {
-	warning("STUB: Basher::cursor_on()");
-}
-
-void Basher::cursor_off() {
-	warning("STUB: Basher::cursor_off()");
-}
-
-
 void Basher::get_demorec() {
 	warning("STUB: Basher::get_demorec()");
 }
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index 0c865d4..a6d7067 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -53,14 +53,10 @@ public:
 
 	void keyboard_link();
 
-	void cursor_on();
-
 	void get_demorec();
 
 	bool demo_ready();
 
-	void cursor_off();
-
 	void filename_edit();
 
 	void normal_edit();
@@ -76,8 +72,6 @@ private:
 
 	void wipetext();
 
-	void do_cursor();
-
 	char firstchar(Common::String x);
 
 	void try_dd();
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 27a184e..5038e51 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -479,7 +479,6 @@ public:
 
 
 
-	bool cursoron;
 	/* previous:^previoustype;*/
 	Common::String last;
 	dnatype dna;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 096aca3..14eae44 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -57,7 +57,7 @@ void Parser::handleInputText(const Common::Event &event) {
 }
 
 void Parser::handleBackspace() {
-	if (! _vm->_dropdown->ddm_o.menunow) {
+	if (!_vm->_dropdown->ddm_o.menunow) {
 		if (_inputTextPos > _leftMargin) {
 			_inputTextPos--;
 			if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
@@ -69,11 +69,14 @@ void Parser::handleBackspace() {
 	}
 }
 
+void Parser::handleReturn() {
+}
+
 void Parser::plotText() {
 	if (_vm->_gyro->mouse_near_text())
 		_vm->_gyro->super_off();
 
-	_vm->_basher->cursor_off();
+	cursorOff();
 
 	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
 
@@ -88,8 +91,46 @@ void Parser::plotText() {
 			}
 		}
 
-	_vm->_basher->cursor_on();
+	cursorOn();
 	_vm->_gyro->super_on();
 }
 
+void Parser::cursorOn() {
+	if (_cursorState == true)
+		return;
+	drawCursor();
+	_cursorState = true;
+}
+
+void Parser::cursorOff() {
+	if (_cursorState == false)
+		return;
+	drawCursor();
+	_cursorState = false;
+}
+
+void Parser::drawCursor() {
+	// Draw the '_' character. Similar to plotText().
+	char cursor = '_';
+
+	for (byte j = 0; j < 8; j++) {
+		byte pixel = _vm->_gyro->characters[cursor][j];
+		for (byte bit = 0; bit < 8; bit++) {
+			byte pixelBit = (pixel >> bit) & 1;
+			if (pixelBit != 0)
+				*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 161 + j) = white;
+		}
+	}
+	
+
+
+	bytefield bf;
+	bf.x1 = _inputTextPos + 1;
+	bf.x2 = _inputTextPos + 2;
+	bf.y1 = 168;
+	bf.y2 = 168;
+	for (byte fv = 0; fv <= 1; fv ++)
+		_vm->_trip->getset[fv].remember(bf);
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 3dd5d37..7484988 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -39,6 +39,7 @@ public:
 	byte _inputTextPos;
 	bool _quote; // 66 or 99 next?
 	byte _leftMargin;
+	bool _cursorState;
 
 
 
@@ -48,11 +49,19 @@ public:
 
 	void handleBackspace();
 
+	void handleReturn();
+
 	void plotText();
 
+	void cursorOn();
+
+	void cursorOff();
+
 private:
 	AvalancheEngine *_vm;
 
+	void drawCursor();
+
 };
 
 } // End of namespace Avalanche


Commit: ad7f8add4d8d9f888f5a2c5bcdae1b861d35ab06
    https://github.com/scummvm/scummvm/commit/ad7f8add4d8d9f888f5a2c5bcdae1b861d35ab06
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T01:46:46-07:00

Commit Message:
AVALANCHE: Add tryDropdown() and _inputTextBackup to Parser, implement handleReturn(), stub tryDropdown() in Parser.

Changed paths:
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/gyro2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 8e51abe..0df3b39 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -56,8 +56,8 @@ Basher::Basher(AvalancheEngine *vm) {
 
 void Basher::init() {
 	/* new(previous);*/
-	if (!_vm->_gyro->last.empty())
-		_vm->_gyro->last.clear();
+	if (!_vm->_parser->_inputTextBackup.empty())
+		_vm->_parser->_inputTextBackup.clear();
 
 	normal_edit();
 
@@ -140,9 +140,7 @@ char Basher::firstchar(Common::String x) {
 }
 
 
-void Basher::try_dd() { /* This asks the Parsekey proc in Dropdown if it knows it. */
-	warning("STUB: Basher::try_dd()");
-}
+
 
 void Basher::typein() {
 	warning("STUB: Basher::typein()");
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index a6d7067..bc62fe6 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -74,8 +74,6 @@ private:
 
 	char firstchar(Common::String x);
 
-	void try_dd();
-
 	void typein();
 };
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 5038e51..50ae339 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -480,7 +480,6 @@ public:
 
 
 	/* previous:^previoustype;*/
-	Common::String last;
 	dnatype dna;
 	linetype lines[50]; /* For Also. */
 	int16 c;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 14eae44..fca29ad 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -70,6 +70,16 @@ void Parser::handleBackspace() {
 }
 
 void Parser::handleReturn() {
+	if (_vm->_dropdown->ddm_o.menunow)
+		_vm->_parser->tryDropdown();
+	else {
+		_vm->_logger->log_command(_inputText);
+		
+		if (!_inputText.empty())
+			_inputTextBackup = _inputText;
+		_vm->_acci->parse();
+		_vm->_acci->do_that();
+	}
 }
 
 void Parser::plotText() {
@@ -109,6 +119,10 @@ void Parser::cursorOff() {
 	_cursorState = false;
 }
 
+void Parser::tryDropdown() { 
+	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown.
+}
+
 void Parser::drawCursor() {
 	// Draw the '_' character. Similar to plotText().
 	char cursor = '_';
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 7484988..1cfb21b 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -36,11 +36,12 @@ class AvalancheEngine;
 class Parser {
 public:
 	Common::String _inputText;
+	Common::String _inputTextBackup;
 	byte _inputTextPos;
 	bool _quote; // 66 or 99 next?
 	byte _leftMargin;
 	bool _cursorState;
-
+	
 
 
 	Parser(AvalancheEngine *vm);
@@ -57,6 +58,8 @@ public:
 
 	void cursorOff();
 
+	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
+
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ff3a757..d7823c3 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1633,72 +1633,70 @@ void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
 
 
 void Trip::handleMoveKey(const Common::Event &event) { 
-	//if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy))
-	//	return;
-	//	
-	// We don't mess around with the joystick.
-	
-	switch (event.kbd.keycode) {
-	case Common::KEYCODE_UP:
-		if (_vm->_gyro->dna.rw != up) {
-			_vm->_gyro->dna.rw = up;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_DOWN:
-		if (_vm->_gyro->dna.rw != down) {
-			_vm->_gyro->dna.rw = down;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_LEFT:
-		if (_vm->_gyro->dna.rw != left) {
-			_vm->_gyro->dna.rw = left;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_RIGHT:
-		if (_vm->_gyro->dna.rw != right) {
-			_vm->_gyro->dna.rw = right;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_PAGEUP:
-		if (_vm->_gyro->dna.rw != ur) {
-			_vm->_gyro->dna.rw = ur;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_PAGEDOWN:
-		if (_vm->_gyro->dna.rw != dr) {
-			_vm->_gyro->dna.rw = dr;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_END:
-		if (_vm->_gyro->dna.rw != dl) {
-			_vm->_gyro->dna.rw = dl;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case Common::KEYCODE_HOME:
-		if (_vm->_gyro->dna.rw != ul) {
-			_vm->_gyro->dna.rw = ul;
-			rwsp(0, _vm->_gyro->dna.rw);
-		} else
+	if (_vm->_dropdown->ddm_o.menunow)
+		_vm->_parser->tryDropdown();
+	else
+		switch (event.kbd.keycode) {
+		case Common::KEYCODE_UP:
+			if (_vm->_gyro->dna.rw != up) {
+				_vm->_gyro->dna.rw = up;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_DOWN:
+			if (_vm->_gyro->dna.rw != down) {
+				_vm->_gyro->dna.rw = down;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_LEFT:
+			if (_vm->_gyro->dna.rw != left) {
+				_vm->_gyro->dna.rw = left;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_RIGHT:
+			if (_vm->_gyro->dna.rw != right) {
+				_vm->_gyro->dna.rw = right;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_PAGEUP:
+			if (_vm->_gyro->dna.rw != ur) {
+				_vm->_gyro->dna.rw = ur;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_PAGEDOWN:
+			if (_vm->_gyro->dna.rw != dr) {
+				_vm->_gyro->dna.rw = dr;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_END:
+			if (_vm->_gyro->dna.rw != dl) {
+				_vm->_gyro->dna.rw = dl;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_HOME:
+			if (_vm->_gyro->dna.rw != ul) {
+				_vm->_gyro->dna.rw = ul;
+				rwsp(0, _vm->_gyro->dna.rw);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_KP5:
 			stopwalking();
-		break;
-	case Common::KEYCODE_KP5:
-		stopwalking();
-		break;
-	}
+			break;
+		}
 }
 
 


Commit: 17b2fb02c0cff674edeb4eeb0640e1739f71c457
    https://github.com/scummvm/scummvm/commit/17b2fb02c0cff674edeb4eeb0640e1739f71c457
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T07:46:15-07:00

Commit Message:
AVALANCHE: Partially implement Acci::parse(), add Acci::pos(),  Acci::clearwords(), reimplement Acci::wordnum(), implement Acci::punctustrip().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index e87e120..6f03d7f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -43,6 +43,8 @@
 
 #include "common/textconsole.h"
 
+#include <cstring>
+
 
 /*#include "NimUnit.h"*/
 /*#include "Highs.h"*/
@@ -224,27 +226,25 @@ void Acci::init() {
 	_vm->_gyro->weirdword = false;
 }
 
-void Acci::checkword(Common::String &x) { /* Checks uint16 "fv". */
-	warning("STUB: Acci::checkuint16()");
+void Acci::clearwords() {
+	for (byte i = 0; i < 11; i++)
+		if (!realwords[i].empty())
+			realwords[i].clear();
 }
 
-Common::String Acci::wordnum(Common::String x)
-{
-	char whatsit;
-	uint16 fv;
-	bool gotcha;
-
-	Common::String wordnum_result;
-	if (x == "") {
-		wordnum_result = "";
-		return wordnum_result;
+byte Acci::wordnum(Common::String x) {
+	if (x.empty())
+		return 0;
+
+	byte whatsit = pardon;
+	bool gotcha = false;
+	for (uint16 fv = 0; fv < nowords; fv++) {
+		if ((words[fv].w == x) || ((Common::String(words[fv].w.c_str(), x.size()) == x) && !gotcha))
+			whatsit = words[fv].n;
+		if (words[fv].w == x)
+			gotcha = true;
 	}
-	whatsit = pardon;
-	gotcha = false;
-	for (fv = nowords; fv >= 1; fv--)
-		checkword(x);
-	wordnum_result = whatsit;
-	return wordnum_result;
+	return whatsit;
 }
 
 void Acci::replace(Common::String old1, Common::String new1) {
@@ -314,7 +314,15 @@ void Acci::cheatparse(Common::String codes) {
 }
 
 void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x. */
-	warning("STUB: Acci::punctustrip()");
+	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
+
+	for (byte fv = 0; fv < 32; fv++)
+		do {
+			int16 p = pos(Common::String(punct[fv]), x);
+			if (p == -1)
+				break;
+			x.deleteChar(p);
+		} while (true);
 }
 
 
@@ -370,14 +378,186 @@ void Acci::clearuint16s() {
 	warning("STUB: Acci::clearuint16s()");
 }
 
+int16 Acci::pos(const Common::String &crit, const Common::String &src) {
+	if (src.contains(crit))
+		return strstr(src.c_str(),crit.c_str()) - src.c_str();
+	else
+		return -1;
+}
+
 void Acci::parse() {
 	byte n, fv, ff;
-	Common::String c, cc, thisuint16;
+	Common::String c, cc, thisword;
 	Common::String answer;
 	bool notfound;
 
-	/* first parsing - uint16 identification */
-	warning("STUB: Acci::parse()");
+	// First parsing - word identification
+
+	thats = "";
+	c = _vm->_parser->_inputText + ' ';
+	n = 0;
+	polite = false;
+	verb = pardon;
+	thing = pardon;
+	thing2 = pardon;
+	person = pardon;
+	clearwords();
+	if (_vm->_parser->_inputText[0] == '.') {
+		// A cheat mode attempt.
+		cheatparse(_vm->_parser->_inputText);
+		thats = nowt;
+		return;
+	} // Not our department! Otherwise...
+
+	// Are we being interrogated right now?
+
+	if (_vm->_gyro->interrogation > 0) {
+		store_interrogation(_vm->_gyro->interrogation);
+		_vm->_gyro->weirdword = true;
+		return;
+	}
+
+	cc = c;
+	c.toUppercase();
+	while (!c.empty()) {
+		while ((c[0] == ' ') && (!c.empty())) {
+			c.deleteChar(0);
+			cc.deleteChar(0);
+		}
+
+		// Get the first words of the strings.
+		byte size = pos(Common::String(' '), c) + 1;
+		char *subStr = new char[size];
+		Common::strlcpy(subStr, c.c_str(), size);
+		thisword = subStr;
+		Common::strlcpy(subStr, cc.c_str(), size);
+		realwords[n] = subStr;
+		delete[] subStr;
+
+		punctustrip(c);
+
+		notfound = true;
+		if (!thisword.empty()) {
+			for (ff = 0; ff < 31; ff++) { // Check Also, FIRST!
+				if (pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1) {
+					thats = thats + Common::String(99 + ff);
+					notfound = false;
+				}
+			}
+		}
+
+		if (notfound) {
+			answer = wordnum(thisword);
+			if (answer[0] == pardon) {
+				notfound = true;
+				thats = thats + pardon;
+			} else
+				thats = thats + answer;
+			n++;
+		}
+
+		c.deleteChar(pos(c, Common::String(' ')));
+		cc.deleteChar(pos(cc, Common::String(' ')));
+	}
+
+	//if (pos("\376", thats) > 0)  unknown = realwords[pos("\376", thats)];
+	//else unknown = "";
+	//replace("\377", ""); /* zap noise words */
+	//replace(string('\15') + '\342', "\1"); /* "look at" = "examine" */
+	//replace(string('\15') + '\344', "\1"); /* "look in" = "examine" */
+	//replace(string('\4') + '\343', "\21"); /* "get up" = "stand" */
+	//replace(string('\4') + '\347', "\21"); /* "get down" = "stand"... well, why not? */
+	//replace(string('\22') + '\344', "\2"); /* "go in" = "open [door]" */
+	//replace(string('\34') + '\345', "\375"); /* "P' off" is a swear word */
+	//replace(string('\4') + '\6', "\6"); /* "Take inventory" (remember Colossal Adventure?) */
+	//replace(string('\50') + '\350', "\25"); /* "put on" = "don" */
+	//replace(string('\4') + '\345', "\24"); /* "take off" = "doff" */
+
+	//* Words that could mean more than one person */
+	//{
+	//	if (room == r__nottspub)  replace("\314", "\244"); /* Barman = Port */
+	//	else replace("\314", "\232");                  /* Barman = Malagauche */
+	//	switch (room) {
+	//	case r__aylesoffice:
+	//		replace("\313", "\243");
+	//		break;        /* Monk = Ayles */
+	//	case r__musicroom:
+	//		replace("\313", "\246");
+	//		break;          /* Monk = Jacques */
+	//	default:
+	//		replace("\313", "\242");                  /* Monk = Ibythneth */
+	//	}
+	//}
+
+	//if (do_pronouns()) {
+	//	weirdword = true;
+	//	thats = nowt;
+	//	return;
+	//}
+
+	//* second parsing - accidence */
+
+	//subject = "";
+	//subjnumber = 0; /* Find subject of conversation. */
+	//for (fv = 1; fv <= 11; fv ++)
+	//	if (set::of('`', '\'', eos).has(realwords[fv][1])) {
+	//		subjnumber = ord(thats[fv]);
+	//		thats[fv] = moved;
+	//		flush(); /* Only the second time I've used that! */
+	//	}
+
+	//if (subjnumber == 0) /* Still not found. */
+	//	for (fv = 1; fv <= 10; fv ++)
+	//		if (thats[fv] == '\374') { /* the word is "about", or something similar */
+	//			subjnumber = ord(thats[fv + 1]);
+	//			thats[fv + 1] = '\0';
+	//			flush(); /* ...Third! */
+	//		}
+
+	//if (subjnumber == 0) /* STILL not found! Must be the word after "say". */
+	//	for (fv = 1; fv <= 10; fv ++)
+	//		if ((thats[fv] == '\7') && !(set::of('\0', range('\341', '\345'), eos).has(thats[fv + 1]))) {
+	//			/* SAY not followed by a preposition */
+	//			subjnumber = ord(thats[fv + 1]);
+	//			thats[fv + 1] = '\0';
+	//			flush(); /* ...Fourth! */
+	//		}
+
+	//for (fv = length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
+	//	switch (thats[fv]) {
+	//	case '\1' ... '\61':
+	//	case '\375':
+	//	case '\371':
+	//		verb = thats[fv];
+	//		break;
+	//	case '\62' ... '\225': {
+	//		thing2 = thing;
+	//		thing = thats[fv];
+	//							}
+	//							break;
+	//	case '\226' ... '\307':
+	//		person = thats[fv];
+	//		break;
+	//	case '\373':
+	//		polite = true;
+	//		break;
+	//}
+
+	//if ((unknown != "") && !
+	//	(set::of(vb_exam, vb_talk, vb_save, vb_load, vb_dir, eos).has(verb))) {
+	//		display(string("Sorry, but I have no idea what `") + unknown +
+	//			"\" means. Can you rephrase it?");
+	//		weirdword = true;
+	//} else weirdword = false;
+
+	//if (thats == "")  thats = nowt;
+
+	//if (thing != pardon)  it = thing;
+
+	//if (person != pardon) {
+	//	if (person < '\257')  him = person;
+	//	else her = person;
+	//}
 }
 
 void Acci::examobj() {   /* Examine a standard object-thing */
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 40cda48..dbc96f4 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -147,8 +147,7 @@ private:
 
 	byte fv;
 
-	void checkword(Common::String &x);
-	Common::String wordnum(Common::String x);
+	byte wordnum(Common::String x);
 
 	void replace(Common::String old1, Common::String new1);
 
@@ -212,6 +211,8 @@ private:
 
 	void heythanks();
 
+	int16 pos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+
 };
 
 } // End of namespace Avalanche.


Commit: 9474e2dc61c25abab1b069de3d94b49ef25b655b
    https://github.com/scummvm/scummvm/commit/9474e2dc61c25abab1b069de3d94b49ef25b655b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T09:50:46-07:00

Commit Message:
AVALANCHE: Revisions in acci2.h and lucerna2.cpp, partially implement Acci::parse() and functions connected to it.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 6f03d7f..1716b60 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -235,10 +235,10 @@ void Acci::clearwords() {
 byte Acci::wordnum(Common::String x) {
 	if (x.empty())
 		return 0;
-
+	
 	byte whatsit = pardon;
 	bool gotcha = false;
-	for (uint16 fv = 0; fv < nowords; fv++) {
+	for (int32 fv = nowords - 1; fv >= 0; fv--) {
 		if ((words[fv].w == x) || ((Common::String(words[fv].w.c_str(), x.size()) == x) && !gotcha))
 			whatsit = words[fv].n;
 		if (words[fv].w == x)
@@ -388,12 +388,13 @@ int16 Acci::pos(const Common::String &crit, const Common::String &src) {
 void Acci::parse() {
 	byte n, fv, ff;
 	Common::String c, cc, thisword;
-	Common::String answer;
+	byte answer;
 	bool notfound;
 
 	// First parsing - word identification
 
-	thats = "";
+	if (!thats.empty())
+		thats.clear();
 	c = _vm->_parser->_inputText + ' ';
 	n = 0;
 	polite = false;
@@ -410,7 +411,6 @@ void Acci::parse() {
 	} // Not our department! Otherwise...
 
 	// Are we being interrogated right now?
-
 	if (_vm->_gyro->interrogation > 0) {
 		store_interrogation(_vm->_gyro->interrogation);
 		_vm->_gyro->weirdword = true;
@@ -437,9 +437,11 @@ void Acci::parse() {
 		punctustrip(c);
 
 		notfound = true;
+
+		// Check also first, which conatins words about the actual room.
 		if (!thisword.empty()) {
-			for (ff = 0; ff < 31; ff++) { // Check Also, FIRST!
-				if (pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1) {
+			for (ff = 0; ff < 31; ff++) {
+				if ((_vm->_gyro->also[ff][0] != 0) && (pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1)) {
 					thats = thats + Common::String(99 + ff);
 					notfound = false;
 				}
@@ -448,7 +450,7 @@ void Acci::parse() {
 
 		if (notfound) {
 			answer = wordnum(thisword);
-			if (answer[0] == pardon) {
+			if (answer == pardon) {
 				notfound = true;
 				thats = thats + pardon;
 			} else
@@ -456,12 +458,22 @@ void Acci::parse() {
 			n++;
 		}
 
-		c.deleteChar(pos(c, Common::String(' ')));
-		cc.deleteChar(pos(cc, Common::String(' ')));
+		int16 spacePos = pos(Common::String(' '), c);
+		if (spacePos > -1)
+			for (byte i = 0; i <= spacePos; i++)
+				c.deleteChar(0);
+		spacePos = pos(Common::String(' '), cc);
+		if (spacePos > -1)
+			for (byte i = 0; i <= spacePos; i++)
+				cc.deleteChar(0);
 	}
 
-	//if (pos("\376", thats) > 0)  unknown = realwords[pos("\376", thats)];
-	//else unknown = "";
+	if (pos(Common::String(254), thats) > -1) 
+		unknown = realwords[pos("\376", thats)];
+	else
+		if (!unknown.empty())
+			unknown.clear();
+
 	//replace("\377", ""); /* zap noise words */
 	//replace(string('\15') + '\342', "\1"); /* "look at" = "examine" */
 	//replace(string('\15') + '\344', "\1"); /* "look in" = "examine" */
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index dbc96f4..bb55dac 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -39,62 +39,62 @@ class AvalancheEngine;
 class Acci {
 public:
 		/* verb codes */
-	static const char vb_exam = 1;
-	static const char vb_open = 2;
-	static const char vb_pause = 3;
-	static const char vb_get = 4;
-	static const char vb_drop = 5;
-	static const char vb_inv = 6;
-	static const char vb_talk = 7;
-	static const char vb_give = 8;
-	static const char vb_drink = 9;
-	static const char vb_load = 10;
-	static const char vb_save = 11;
-	static const char vb_pay = 12;
-	static const char vb_look = 13;
-	static const char vb_break = 14;
-	static const char vb_quit = 15;
-	static const char vb_sit = 16;
-	static const char vb_stand = 17;
-	static const char vb_go = 18;
-	static const char vb_info = 19;
-	static const char vb_undress = 20;
-	static const char vb_wear = 21;
-	static const char vb_play = 22;
-	static const char vb_ring = 23;
-	static const char vb_help = 24;
-	static const char vb_larrypass = 25;
-	static const char vb_phaon = 26;
-	static const char vb_boss = 27;
-	static const char vb_pee = 28;
-	static const char vb_cheat = 29;
-	static const char vb_magic = 30;
-	static const char vb_restart = 31;
-	static const char vb_eat = 32;
-	static const char vb_listen = 33;
-	static const char vb_buy = 34;
-	static const char vb_attack = 35;
-	static const char vb_password = 36;
-	static const char vb_dir = 37;
-	static const char vb_die = 38;
-	static const char vb_score = 39;
-	static const char vb_put = 40;
-	static const char vb_kiss = 41;
-	static const char vb_climb = 42;
-	static const char vb_jump = 43;
-	static const char vb_highscores = 44;
-	static const char vb_wake = 45;
-	static const char vb_hello = 46;
-	static const char vb_thanks = 47;
-
-	static const char vb_smartalec = 249;
-	static const char vb_expletive = 253;
-
-	static const char pardon = 254; /* =didn't understand / wasn't given. */
+	static const byte vb_exam = 1;
+	static const byte vb_open = 2;
+	static const byte vb_pause = 3;
+	static const byte vb_get = 4;
+	static const byte vb_drop = 5;
+	static const byte vb_inv = 6;
+	static const byte vb_talk = 7;
+	static const byte vb_give = 8;
+	static const byte vb_drink = 9;
+	static const byte vb_load = 10;
+	static const byte vb_save = 11;
+	static const byte vb_pay = 12;
+	static const byte vb_look = 13;
+	static const byte vb_break = 14;
+	static const byte vb_quit = 15;
+	static const byte vb_sit = 16;
+	static const byte vb_stand = 17;
+	static const byte vb_go = 18;
+	static const byte vb_info = 19;
+	static const byte vb_undress = 20;
+	static const byte vb_wear = 21;
+	static const byte vb_play = 22;
+	static const byte vb_ring = 23;
+	static const byte vb_help = 24;
+	static const byte vb_larrypass = 25;
+	static const byte vb_phaon = 26;
+	static const byte vb_boss = 27;
+	static const byte vb_pee = 28;
+	static const byte vb_cheat = 29;
+	static const byte vb_magic = 30;
+	static const byte vb_restart = 31;
+	static const byte vb_eat = 32;
+	static const byte vb_listen = 33;
+	static const byte vb_buy = 34;
+	static const byte vb_attack = 35;
+	static const byte vb_password = 36;
+	static const byte vb_dir = 37;
+	static const byte vb_die = 38;
+	static const byte vb_score = 39;
+	static const byte vb_put = 40;
+	static const byte vb_kiss = 41;
+	static const byte vb_climb = 42;
+	static const byte vb_jump = 43;
+	static const byte vb_highscores = 44;
+	static const byte vb_wake = 45;
+	static const byte vb_hello = 46;
+	static const byte vb_thanks = 47;
+
+	static const byte vb_smartalec = 249;
+	static const byte vb_expletive = 253;
+
+	static const byte pardon = 254; /* =didn't understand / wasn't given. */
 
 	static const int16 nowords = 277; /* how many words does the parser know? */
-	static const char nowt = 372;
-	static const char moved = 0; /* This word was moved. (Usually because it was the subject of
+	static const byte nowt = 372;
+	static const byte moved = 0; /* This word was moved. (Usually because it was the subject of
 	  conversation.) */
 
 	static const int16 first_password = 89; /* Words[first_password] should equal "TIROS". */
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 7fe24ce..eb5f509 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -110,8 +110,6 @@ void Lucerna::unscramble() {
 				scram1(*_vm->_gyro->also[fv][ff]);
 	scram1(_vm->_gyro->listen);
 	scram1(_vm->_gyro->flags);
-	/*     for fz:=1 to length(also[fv,ff]^) do
-	      also[fv,ff]^[fz]:=chr(ord(also[fv,ff]^[fz]) xor 177);*/
 }
 
 void Lucerna::load_also(Common::String n) {


Commit: 591a4852c48a3566ace1e73ac28ad567e65eb34b
    https://github.com/scummvm/scummvm/commit/591a4852c48a3566ace1e73ac28ad567e65eb34b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T11:57:40-07:00

Commit Message:
AVALANCHE: Repair parser, implement Acci::replace(), further implement Acci:parse().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1716b60..66b7874 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -236,19 +236,25 @@ byte Acci::wordnum(Common::String x) {
 	if (x.empty())
 		return 0;
 	
-	byte whatsit = pardon;
-	bool gotcha = false;
-	for (int32 fv = nowords - 1; fv >= 0; fv--) {
-		if ((words[fv].w == x) || ((Common::String(words[fv].w.c_str(), x.size()) == x) && !gotcha))
-			whatsit = words[fv].n;
-		if (words[fv].w == x)
-			gotcha = true;
-	}
-	return whatsit;
+	for (int32 fv = nowords - 1; fv >= 0; fv--) 
+		if ((words[fv].w == x) || (Common::String(words[fv].w.c_str(), x.size()) == x))
+			return words[fv].n;
+
+	return pardon;
 }
 
-void Acci::replace(Common::String old1, Common::String new1) {
-	warning("STUB: Acci::replace()");
+void Acci::replace(Common::String old1, byte new1) {
+	int16 q = pos(old1, thats);
+	while (q != -1) {
+		if (new1 == 0)
+			thats.deleteChar(q);
+		else {
+			for (byte i = q; i < q + old1.size(); i++)
+				thats.deleteChar(q);
+			thats.insertChar(new1, q);
+		}
+		q = pos(old1, thats);
+	}
 }
 
 /*procedure ninetydump;
@@ -403,12 +409,14 @@ void Acci::parse() {
 	thing2 = pardon;
 	person = pardon;
 	clearwords();
+
+
+	// A cheat mode attempt.
 	if (_vm->_parser->_inputText[0] == '.') {
-		// A cheat mode attempt.
 		cheatparse(_vm->_parser->_inputText);
 		thats = nowt;
 		return;
-	} // Not our department! Otherwise...
+	}
 
 	// Are we being interrogated right now?
 	if (_vm->_gyro->interrogation > 0) {
@@ -417,6 +425,7 @@ void Acci::parse() {
 		return;
 	}
 
+	// Actually process the command.
 	cc = c;
 	c.toUppercase();
 	while (!c.empty()) {
@@ -425,7 +434,7 @@ void Acci::parse() {
 			cc.deleteChar(0);
 		}
 
-		// Get the first words of the strings.
+		// Get the following word of the strings.
 		byte size = pos(Common::String(' '), c) + 1;
 		char *subStr = new char[size];
 		Common::strlcpy(subStr, c.c_str(), size);
@@ -438,7 +447,7 @@ void Acci::parse() {
 
 		notfound = true;
 
-		// Check also first, which conatins words about the actual room.
+		// Check also[] first, which conatins words about the actual room.
 		if (!thisword.empty()) {
 			for (ff = 0; ff < 31; ff++) {
 				if ((_vm->_gyro->also[ff][0] != 0) && (pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1)) {
@@ -448,6 +457,7 @@ void Acci::parse() {
 			}
 		}
 
+		// Check Accis's own tables for "global" commands.
 		if (notfound) {
 			answer = wordnum(thisword);
 			if (answer == pardon) {
@@ -458,6 +468,7 @@ void Acci::parse() {
 			n++;
 		}
 
+		// Delete words we already processed.
 		int16 spacePos = pos(Common::String(' '), c);
 		if (spacePos > -1)
 			for (byte i = 0; i <= spacePos; i++)
@@ -469,21 +480,22 @@ void Acci::parse() {
 	}
 
 	if (pos(Common::String(254), thats) > -1) 
-		unknown = realwords[pos("\376", thats)];
+		unknown = realwords[pos(Common::String(254), thats)];
 	else
 		if (!unknown.empty())
 			unknown.clear();
 
-	//replace("\377", ""); /* zap noise words */
-	//replace(string('\15') + '\342', "\1"); /* "look at" = "examine" */
-	//replace(string('\15') + '\344', "\1"); /* "look in" = "examine" */
-	//replace(string('\4') + '\343', "\21"); /* "get up" = "stand" */
-	//replace(string('\4') + '\347', "\21"); /* "get down" = "stand"... well, why not? */
-	//replace(string('\22') + '\344', "\2"); /* "go in" = "open [door]" */
-	//replace(string('\34') + '\345', "\375"); /* "P' off" is a swear word */
-	//replace(string('\4') + '\6', "\6"); /* "Take inventory" (remember Colossal Adventure?) */
-	//replace(string('\50') + '\350', "\25"); /* "put on" = "don" */
-	//replace(string('\4') + '\345', "\24"); /* "take off" = "doff" */
+	// Replace words' codes that mean the same.
+	replace(Common::String(255), 0); /* zap noise words */
+	replace(Common::String(13) + 226, 1); // "look at" = "examine"
+	replace(Common::String(13) + 228, 1); // "look in" = "examine"
+	replace(Common::String(4) + 227, 17); // "get up" = "stand" 
+	replace(Common::String(4) + 231, 17); // "get down" = "stand"... well, why not?
+	replace(Common::String(18) + 228, 2); // "go in" = "open [door]"
+	replace(Common::String(28) + 229, 253); // "P' off" is a swear word
+	replace(Common::String(4) + 6, 6); // "Take inventory" (remember Colossal Adventure?)
+	replace(Common::String(40) + 232, 21); // "put on" = "don"
+	replace(Common::String(4) + 229, 20); // "take off" = "doff"
 
 	//* Words that could mean more than one person */
 	//{
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index bb55dac..d4efa02 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -149,7 +149,7 @@ private:
 
 	byte wordnum(Common::String x);
 
-	void replace(Common::String old1, Common::String new1);
+	void replace(Common::String old1, byte new1);
 
 	Common::String rank();
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index fca29ad..5a23a24 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -75,10 +75,11 @@ void Parser::handleReturn() {
 	else {
 		_vm->_logger->log_command(_inputText);
 		
-		if (!_inputText.empty())
+		if (!_inputText.empty()) {
 			_inputTextBackup = _inputText;
-		_vm->_acci->parse();
-		_vm->_acci->do_that();
+			_vm->_acci->parse();
+			_vm->_acci->do_that();
+		}
 	}
 }
 


Commit: 9b9c9d0fa5f41d4cc029411449421f7264d7d8ca
    https://github.com/scummvm/scummvm/commit/9b9c9d0fa5f41d4cc029411449421f7264d7d8ca
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-28T14:13:34-07:00

Commit Message:
AVALANCHE: Implement Acci::do_pronouns() and Acci::displaywhat().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 66b7874..f85d9df 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -334,23 +334,46 @@ void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x.
 
 
 void Acci::displaywhat(char ch, bool animate, bool &ambigous) { /* << it's an adjective! */
-	byte ff;
-	Common::String z;
-
-	warning("STUB: Acci::_vm->_scrolls->displaywhat()");
+	if (ch == pardon) {
+		ambigous = true;
+		if (animate)
+			_vm->_scrolls->display("Whom?");
+		else
+			_vm->_scrolls->display("What?");
+	} else {
+		if (animate)
+			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getname(ch) + " }");
+		else {
+			Common::String z = _vm->_gyro->get_better(ch);
+			if (z != "") 
+				_vm->_scrolls->display(Common::String("{ ") + z + " }");
+		}
+	}
 }
 
 bool Acci::do_pronouns() {
-	bool ambiguous;
-	byte fv;
+	bool ambiguous = false;
 
-	bool do_pronouns_result;
-	ambiguous = false;
-		
-	warning("STUB: Acci::do_pronouns()");
+	for (byte fv = 0; fv < thats.size(); fv++)
+		switch (thats[fv]) {
+		case 200: {
+			displaywhat(_vm->_gyro->him, true, ambiguous);
+			thats.setChar(_vm->_gyro->him, fv);
+			}
+			break;
+		case 201: {
+			displaywhat(_vm->_gyro->her, true, ambiguous);
+			thats.setChar(_vm->_gyro->her, fv);
+			}
+			break;
+		case 202: {
+			displaywhat(_vm->_gyro->it, false, ambiguous);
+			thats.setChar(_vm->_gyro->it, fv);
+			}
+			break;
+	}
 
-	do_pronouns_result = ambiguous;
-	return do_pronouns_result;
+	return ambiguous;
 }
 
 void Acci::lowercase() {
@@ -497,27 +520,28 @@ void Acci::parse() {
 	replace(Common::String(40) + 232, 21); // "put on" = "don"
 	replace(Common::String(4) + 229, 20); // "take off" = "doff"
 
-	//* Words that could mean more than one person */
-	//{
-	//	if (room == r__nottspub)  replace("\314", "\244"); /* Barman = Port */
-	//	else replace("\314", "\232");                  /* Barman = Malagauche */
-	//	switch (room) {
-	//	case r__aylesoffice:
-	//		replace("\313", "\243");
-	//		break;        /* Monk = Ayles */
-	//	case r__musicroom:
-	//		replace("\313", "\246");
-	//		break;          /* Monk = Jacques */
-	//	default:
-	//		replace("\313", "\242");                  /* Monk = Ibythneth */
-	//	}
-	//}
+	// Words that could mean more than one person
+	if (_vm->_gyro->dna.room == r__nottspub)
+		replace(Common::String(204), 164); // Barman = Port
+	else
+		replace(Common::String(204), 154); // Barman = Malagauche
 
-	//if (do_pronouns()) {
-	//	weirdword = true;
-	//	thats = nowt;
-	//	return;
-	//}
+	switch (_vm->_gyro->dna.room) {
+	case r__aylesoffice:
+		replace(Common::String(203), 163); // Monk = Ayles
+		break;       
+	case r__musicroom:
+		replace(Common::String(203), 166); // Monk = Jacques
+		break;          
+	default:
+		replace(Common::String(203), 162); // Monk = Ibythneth
+	}
+	
+	if (do_pronouns()) {
+		_vm->_gyro->weirdword = true;
+		thats = nowt;
+		return;
+	}
 
 	//* second parsing - accidence */
 


Commit: c2ac2fdc87e3882e8d75feab3a193991969ec442
    https://github.com/scummvm/scummvm/commit/c2ac2fdc87e3882e8d75feab3a193991969ec442
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T01:06:13-07:00

Commit Message:
AVALANCHE: Finish implementation of Acci::parse(), repair Acci::displaywhat() and Acci::words[].

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index f85d9df..2d0975f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -160,7 +160,7 @@ const Acci::vocab Acci::words[nowords] = {
 	{178, "WITCH"},
 
 	/* Pronouns, 200-224 */
-	{200, "_vm->_gyro->him"},       {200, "MAN"},       {200, "GUY"},
+	{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
 	{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
 	{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
 	{202, "IT"},        {202, "THING"},
@@ -333,7 +333,7 @@ void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x.
 
 
 
-void Acci::displaywhat(char ch, bool animate, bool &ambigous) { /* << it's an adjective! */
+void Acci::displaywhat(byte ch, bool animate, bool &ambigous) { /* << it's an adjective! */
 	if (ch == pardon) {
 		ambigous = true;
 		if (animate)
@@ -354,8 +354,9 @@ void Acci::displaywhat(char ch, bool animate, bool &ambigous) { /* << it's an ad
 bool Acci::do_pronouns() {
 	bool ambiguous = false;
 
-	for (byte fv = 0; fv < thats.size(); fv++)
-		switch (thats[fv]) {
+	for (byte fv = 0; fv < thats.size(); fv++) {
+		byte word = thats[fv];
+		switch (word) {
 		case 200: {
 			displaywhat(_vm->_gyro->him, true, ambiguous);
 			thats.setChar(_vm->_gyro->him, fv);
@@ -371,6 +372,7 @@ bool Acci::do_pronouns() {
 			thats.setChar(_vm->_gyro->it, fv);
 			}
 			break;
+		}
 	}
 
 	return ambiguous;
@@ -480,7 +482,7 @@ void Acci::parse() {
 			}
 		}
 
-		// Check Accis's own tables for "global" commands.
+		// Check Accis's own table (words[]) for "global" commands.
 		if (notfound) {
 			answer = wordnum(thisword);
 			if (answer == pardon) {
@@ -543,69 +545,66 @@ void Acci::parse() {
 		return;
 	}
 
-	//* second parsing - accidence */
-
-	//subject = "";
-	//subjnumber = 0; /* Find subject of conversation. */
-	//for (fv = 1; fv <= 11; fv ++)
-	//	if (set::of('`', '\'', eos).has(realwords[fv][1])) {
-	//		subjnumber = ord(thats[fv]);
-	//		thats[fv] = moved;
-	//		flush(); /* Only the second time I've used that! */
-	//	}
-
-	//if (subjnumber == 0) /* Still not found. */
-	//	for (fv = 1; fv <= 10; fv ++)
-	//		if (thats[fv] == '\374') { /* the word is "about", or something similar */
-	//			subjnumber = ord(thats[fv + 1]);
-	//			thats[fv + 1] = '\0';
-	//			flush(); /* ...Third! */
-	//		}
-
-	//if (subjnumber == 0) /* STILL not found! Must be the word after "say". */
-	//	for (fv = 1; fv <= 10; fv ++)
-	//		if ((thats[fv] == '\7') && !(set::of('\0', range('\341', '\345'), eos).has(thats[fv + 1]))) {
-	//			/* SAY not followed by a preposition */
-	//			subjnumber = ord(thats[fv + 1]);
-	//			thats[fv + 1] = '\0';
-	//			flush(); /* ...Fourth! */
-	//		}
-
-	//for (fv = length(thats); fv >= 1; fv --) /* Reverse order- so first'll be used */
-	//	switch (thats[fv]) {
-	//	case '\1' ... '\61':
-	//	case '\375':
-	//	case '\371':
-	//		verb = thats[fv];
-	//		break;
-	//	case '\62' ... '\225': {
-	//		thing2 = thing;
-	//		thing = thats[fv];
-	//							}
-	//							break;
-	//	case '\226' ... '\307':
-	//		person = thats[fv];
-	//		break;
-	//	case '\373':
-	//		polite = true;
-	//		break;
-	//}
-
-	//if ((unknown != "") && !
-	//	(set::of(vb_exam, vb_talk, vb_save, vb_load, vb_dir, eos).has(verb))) {
-	//		display(string("Sorry, but I have no idea what `") + unknown +
-	//			"\" means. Can you rephrase it?");
-	//		weirdword = true;
-	//} else weirdword = false;
-
-	//if (thats == "")  thats = nowt;
-
-	//if (thing != pardon)  it = thing;
-
-	//if (person != pardon) {
-	//	if (person < '\257')  him = person;
-	//	else her = person;
-	//}
+	// Second parsing.
+	if (!_vm->_gyro->subject.empty())
+		_vm->_gyro->subject.clear();
+	_vm->_gyro->subjnumber = 0; // Find subject of conversation.
+	
+	fv = 0;
+	while ((fv < 11) && !realwords[fv].empty()) {
+		if ((realwords[fv][0] == '\'') || (realwords[fv][0] == '\"')) {
+			_vm->_gyro->subjnumber = thats[fv];
+			thats.setChar(moved, fv);
+			break;
+		}
+		fv++;
+	}
+
+	if (_vm->_gyro->subjnumber == 0) // Still not found.
+		for (fv = 0; fv < thats.size(); fv++)
+			if (thats[fv] == 252) { // The word is "about", or something similar.
+				_vm->_gyro->subjnumber = thats[fv + 1];
+				thats.setChar(0, fv + 1);
+				break;
+			}
+
+	if (_vm->_gyro->subjnumber == 0) // STILL not found! Must be the word after "say".
+		for (fv = 0; fv < thats.size(); fv++)
+			if ((thats[fv] == 7) && (thats[fv + 1] != 0) && !((225 <= thats[fv + 1]) && (thats[fv + 1] <= 229))) {
+				// SAY not followed by a preposition
+				_vm->_gyro->subjnumber = thats[fv + 1];
+				thats.setChar(0, fv + 1);
+				break;
+			}
+
+	for (int8 fv = thats.size() - 1; fv >= 0; fv--) // Reverse order, so first will be used.
+		if ((thats[fv] == 253) || (thats[fv] == 249) || ((1 <= thats[fv]) && (thats[fv] <= 49)))
+			verb = thats[fv];
+		else if ((50 <= thats[fv]) && (thats[fv] <= 149)) {
+			thing2 = thing;
+			thing = thats[fv];
+		} else if ((150 <= thats[fv]) && (thats[fv] <= 199))
+			person = thats[fv];
+		else if (thats[fv] == 251)
+			polite = true;
+
+		if ((!unknown.empty()) && (verb != vb_exam) && (verb != vb_talk) && (verb != vb_save) && (verb != vb_load) && (verb != vb_dir)) {
+				_vm->_scrolls->display(Common::String("Sorry, but I have no idea what \"") + unknown + "\" means. Can you rephrase it?");
+				_vm->_gyro->weirdword = true;
+		} else
+			_vm->_gyro->weirdword = false;
+
+	if (thats.empty())
+		thats = nowt;
+
+	if (thing != pardon)
+		_vm->_gyro->it = thing;
+
+	if (person != pardon)
+		if (person < 175)
+			_vm->_gyro->him = person;
+		else
+			_vm->_gyro->her = person;
 }
 
 void Acci::examobj() {   /* Examine a standard object-thing */
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index d4efa02..6a42c08 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -90,14 +90,13 @@ public:
 	static const byte vb_smartalec = 249;
 	static const byte vb_expletive = 253;
 
-	static const byte pardon = 254; /* =didn't understand / wasn't given. */
+	static const byte pardon = 254; // Didn't understand / wasn't given.
 
-	static const int16 nowords = 277; /* how many words does the parser know? */
-	static const byte nowt = 372;
-	static const byte moved = 0; /* This word was moved. (Usually because it was the subject of
-	  conversation.) */
+	static const int16 nowords = 277; // How many words does the parser know?
+	static const byte nowt = 250;
+	static const byte moved = 0; // This word was moved. (Usually because it was the subject of conversation.)
 
-	static const int16 first_password = 89; /* Words[first_password] should equal "TIROS". */
+	static const int16 first_password = 89; // Words[first_password] should equal "TIROS".
 
 
 
@@ -160,7 +159,7 @@ private:
 
 	void punctustrip(Common::String &x);
 
-	void displaywhat(char ch, bool animate, bool &ambigous);
+	void displaywhat(byte ch, bool animate, bool &ambigous);
 	bool do_pronouns();
 
 	void lowercase();


Commit: e08980c7a4ac8b56f4503205dd8488e91d14fddf
    https://github.com/scummvm/scummvm/commit/e08980c7a4ac8b56f4503205dd8488e91d14fddf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T01:30:57-07:00

Commit Message:
AVALANCHE: Repair Acci::person_speaks().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2d0975f..914ca54 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1077,21 +1077,20 @@ void Acci::person_speaks() {
 	char cfv;
 
 
-	if ((person == pardon) || (person == '\0')) {
+	if ((person == pardon) || (person == 0))
 		if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him] != _vm->_gyro->dna.room))
 			person = _vm->_gyro->her;
 		else
 			person = _vm->_gyro->him;
-	}
 
 	if (_vm->_gyro->whereis[person] != _vm->_gyro->dna.room) {
-		_vm->_scrolls->display("\231\4"); /* Avvy _vm->_gyro->himself! */
+		_vm->_scrolls->display("\231\4"); // Avvy himself!
 		return;
 	}
 
 	found = false; /* The person we're looking for's code is in Person. */
 
-	for (fv = 1; fv <= _vm->_trip->numtr; fv++) {
+	for (fv = 0; fv < _vm->_trip->numtr; fv++) {
 		if (_vm->_trip->tr[fv].quick && ((_vm->_trip->tr[fv].a.accinum + 149) == person)) {
 			_vm->_scrolls->display(Common::String('\23') + char(fv + 48) + '\4');
 			found = true;
@@ -1099,7 +1098,7 @@ void Acci::person_speaks() {
 	}
 
 	if (!found) {
-		for (fv = 10; fv <= 25; fv++) {
+		for (fv = 0; fv < 16; fv++) {
 			_vm->_gyro->quasipeds[fv];
 			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room)) {
 				_vm->_scrolls->display(Common::String('\23') + char(fv + 55) + '\4');


Commit: e32110339e710072b2f3bbf12b3248d26f2a6032
    https://github.com/scummvm/scummvm/commit/e32110339e710072b2f3bbf12b3248d26f2a6032
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T02:27:31-07:00

Commit Message:
AVALANCHE: Move wipeText() from Basher to Parser, implement it. Fix parts of Acci::do_that().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/basher2.cpp
    engines/avalanche/basher2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 914ca54..1f237a8 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1121,13 +1121,16 @@ void Acci::do_that() {
 
 
 	if (thats == Common::String(nowt))  {
-		thats = "";
+		if (!thats.empty())
+			thats.clear();
 		return;
 	}
+
 	if (_vm->_gyro->weirdword)
 		return;
-	if (thing < '\310')
-		thing -= 49; /* "Slip" */
+
+	if (thing < 200)
+		thing -= 49; // "Slip"
 
 	/*
 	if ((!_vm->_gyro->alive) &
@@ -1760,12 +1763,12 @@ void Acci::do_that() {
 			switch (person) {
 			case pardon:
 			case _vm->_gyro->pavalot:
-			case '\0':
+			case 0:
 				if (!_vm->_gyro->dna.avvy_is_awake) {
 					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer->show_one(3); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->show_one(2); /* Picture of Avvy, awake in bed. */
 					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 6a42c08..0660f49 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -123,7 +123,7 @@ public:
 	Common::String thats;
 	Common::String unknown;
 	Common::String realwords[11];
-	char verb, person, thing, thing2;
+	byte verb, person, thing, thing2;
 	bool polite;
 
 
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
index 0df3b39..6bbf8b2 100644
--- a/engines/avalanche/basher2.cpp
+++ b/engines/avalanche/basher2.cpp
@@ -78,10 +78,6 @@ void Basher::init() {
 #endif
 }
 
-void Basher::wipetext() {
-	warning("STUB: Basher::wipetext()");
-}
-
 /*procedure cursor;
 begin
  if curflash=0 then
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
index bc62fe6..f4a78f4 100644
--- a/engines/avalanche/basher2.h
+++ b/engines/avalanche/basher2.h
@@ -70,8 +70,6 @@ private:
 
 	bool entering_filename;
 
-	void wipetext();
-
 	char firstchar(Common::String x);
 
 	void typein();
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 5a23a24..5fbc31e 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -79,6 +79,8 @@ void Parser::handleReturn() {
 			_inputTextBackup = _inputText;
 			_vm->_acci->parse();
 			_vm->_acci->do_that();
+			_inputText.clear();
+			wipeText();
 		}
 	}
 }
@@ -148,4 +150,18 @@ void Parser::drawCursor() {
 		_vm->_trip->getset[fv].remember(bf);
 }
 
+void Parser::wipeText() {
+	if (_vm->_gyro->mouse_near_text())
+		_vm->_gyro->super_off();
+
+	cursorOff();
+	
+	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
+
+	_quote = true;
+	_inputTextPos = 0;
+	cursorOn();
+	_vm->_gyro->super_on();
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 1cfb21b..2a34839 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -65,6 +65,8 @@ private:
 
 	void drawCursor();
 
+	void wipeText();
+
 };
 
 } // End of namespace Avalanche


Commit: b182fd814ecd0d70ea4c34cbe2d188b363df94ed
    https://github.com/scummvm/scummvm/commit/b182fd814ecd0d70ea4c34cbe2d188b363df94ed
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T03:05:16-07:00

Commit Message:
AVALANCHE: Partially implement Acci::stand_up(), repair Acci::parse().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1f237a8..9a86333 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -514,7 +514,7 @@ void Acci::parse() {
 	replace(Common::String(255), 0); /* zap noise words */
 	replace(Common::String(13) + 226, 1); // "look at" = "examine"
 	replace(Common::String(13) + 228, 1); // "look in" = "examine"
-	replace(Common::String(4) + 227, 17); // "get up" = "stand" 
+	replace(Common::String(4) + 230, 17); // "get up" = "stand" 
 	replace(Common::String(4) + 231, 17); // "get down" = "stand"... well, why not?
 	replace(Common::String(18) + 228, 2); // "go in" = "open [door]"
 	replace(Common::String(28) + 229, 253); // "P' off" is a swear word
@@ -946,11 +946,11 @@ void Acci::stand_up() {
 				_vm->_gyro->background(0);
 				_vm->_visa->dixi('d', 14);
 			}
-			_vm->_trip->tr[1].visible = true;
+			_vm->_trip->tr[0].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
-			_vm->_trip->apped(1, 2);
+			_vm->_trip->apped(0, 1);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer->show_one(4); /* Picture of empty pillow. */
+			_vm->_celer->show_one(3); /* Picture of empty pillow. */
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);


Commit: a1f87fdaebc86be92b189086bba1dba0d3e049c6
    https://github.com/scummvm/scummvm/commit/a1f87fdaebc86be92b189086bba1dba0d3e049c6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T03:22:59-07:00

Commit Message:
AVALANCHE: Modify Graphics and Lucerna, so the engine saves the background and redraws it every time before a sprite is drawn.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index bed8136..6338893 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -62,6 +62,7 @@ void Graphics::init() {
 
 Graphics::~Graphics() {
 	_surface.free();
+	_background.free();
 }
 
 
@@ -85,6 +86,7 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+	drawPicture(_background, 0, 10);
 
 	/* First we make the pixels of the spirte blank. */
 	for (byte qay = 0; qay < sprite.yl; qay++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 3d32bda..d0adb17 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -57,7 +57,9 @@ public:
 	static const int16 kScreenWidth = 640;
 	static const int16 kScreenHeight = 200;
 
-	
+	::Graphics::Surface _background;
+
+
 
 	Graphics(AvalancheEngine *vm);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index eb5f509..047301c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -245,11 +245,11 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
 	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
 
-	::Graphics::Surface background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
+	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
 
-	_vm->_graphics->drawPicture(background, 0, 10);
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
 
-	background.free();
+	_vm->_graphics->refreshScreen();
 
 	f.close();
 


Commit: 3b11fc12240650bfdf693a31b09d6349c1bf3f61
    https://github.com/scummvm/scummvm/commit/3b11fc12240650bfdf693a31b09d6349c1bf3f61
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T10:17:43-07:00

Commit Message:
AVALANCHE: Repair Celer::load_chunks(), remove background drawing from Graphics::drawSprite().

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 4d4a1fa..061eb6b 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -306,10 +306,10 @@ void Celer::load_chunks(Common::String xx) {
 
 			if (ch.natural) {
 				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
-				memos[fv].size = memos[fv].xl * 8 * memos[fv].yl; 
-				memory[fv].create(memos[fv].xl * 8, memos[fv].yl, ::Graphics::PixelFormat::createFormatCLUT8());
+				memos[fv].size = memos[fv].xl * 8 * memos[fv].yl + 1; 
+				memory[fv].create(memos[fv].xl * 8, memos[fv].yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
 
-				for (uint16 j = 0; j < memos[fv].yl; j++)
+				for (uint16 j = 0; j < memos[fv].yl + 1; j++)
 					for (uint16 i = 0; i < memos[fv].xl * 8; i++)
 						*(byte *)memory[fv].getBasePtr(i, j) = *_vm->_graphics->getPixel(memos[fv].x * 8 + i, memos[fv].y + j);
 			} else {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 6338893..9574680 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -86,8 +86,6 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	drawPicture(_background, 0, 10);
-
 	/* First we make the pixels of the spirte blank. */
 	for (byte qay = 0; qay < sprite.yl; qay++) {
 		byte *mask = new byte[sprite.xl];


Commit: 9855cb8f1f6b8e6d6a61f5bf018e3e03b2c4280d
    https://github.com/scummvm/scummvm/commit/9855cb8f1f6b8e6d6a61f5bf018e3e03b2c4280d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T15:30:10-07:00

Commit Message:
AVALANCHE: Add warning to Acci::do_that(), remove blank lines from Avalot::run(), remove unnecessary cycle from Lucerna::sprite_run().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 9a86333..ce236d4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1150,7 +1150,7 @@ void Acci::do_that() {
 		return;
 	}
 	*/
-
+	warning("STUB: Acci::do_that()");
 
 	switch (verb) {
 	case vb_exam:
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e1879e1..7b993a5 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -215,8 +215,6 @@ void Avalot::run(Common::String arg) {
 
 		// Not in the original:
 
-	
-
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 047301c..3c3ad35 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1161,12 +1161,8 @@ void Lucerna::sprite_run() {
 
 	_vm->_gyro->doing_sprite_run = true;
 
-	for (fv = 0; fv <= 1; fv ++) {
-		_vm->_trip->get_back_loretta();
-		_vm->_trip->trippancy_link();
-
-		flip_page();
-	}
+	_vm->_trip->get_back_loretta();
+	_vm->_trip->trippancy_link();
 
 	_vm->_gyro->doing_sprite_run = false;
 


Commit: 2857f5aad2c4a024c97e43da67d056a2f7a22def
    https://github.com/scummvm/scummvm/commit/2857f5aad2c4a024c97e43da67d056a2f7a22def
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-29T16:48:21-07:00

Commit Message:
AVALANCHE: Revise Graphics::drawSprite(), repair Trip::apped().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9574680..0574705 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -86,20 +86,14 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	/* First we make the pixels of the spirte blank. */
-	for (byte qay = 0; qay < sprite.yl; qay++) {
-		byte *mask = new byte[sprite.xl];
+	drawPicture(_background, 0, 10); // TODO: Remove it later, implement otherwise!!! Now it only works with one sprite on the screen.
 
-		for (byte qax = 0; qax < sprite.xl; qax++) {
-			byte count = qax / 8;
-			mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
-			if (mask[qax] == 0)
+	/* First we make the pixels of the spirte blank. */
+	for (byte qay = 0; qay < sprite.yl; qay++)
+		for (byte qax = 0; qax < sprite.xl; qax++)
+			if (((*sprite.sil[picnum])[qay][qax / 8] >> ((7 - qax % 8)) & 1) == 0)
 				*getPixel(x + qax, y + qay) = 0;
-		}
-
-		delete[] mask;
-	}
-
+	
 	/* Then we draw the picture to the blank places. */
 	uint16 i = 0; // Because the original siltype starts at 5!!! See Graphics.h for definition.
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d7823c3..d9b33ac 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1093,7 +1093,7 @@ void Trip::rwsp(byte t, byte r) {
 }
 
 void Trip::apped(byte trn, byte np) {
-	tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
+	tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info.xl / 2, _vm->_gyro->peds[np].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
 	rwsp(trn, _vm->_gyro->peds[np].dir);
 }
 


Commit: a13d37e5ca26a5a9c6c9435324c89e4eceb1d846
    https://github.com/scummvm/scummvm/commit/a13d37e5ca26a5a9c6c9435324c89e4eceb1d846
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T10:05:05-07:00

Commit Message:
AVALANCHE: Implement Trip::checkfeet(), repair Trip::stopwalking(). Repair Acci::stand_up().  Repair Gyro::newgame().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ce236d4..86600d6 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -940,7 +940,7 @@ void Acci::already() {
 void Acci::stand_up() {
 	switch (_vm->_gyro->dna.room) {
 	case r__yours: /* Avvy isn't asleep. */
-		if (_vm->_gyro->dna.avvy_in_bed) {  /* But he's in bed. */
+		if (_vm->_gyro->dna.avvy_is_awake && _vm->_gyro->dna.avvy_in_bed) {  /* But he's in bed. */
 			if (_vm->_gyro->dna.teetotal) {
 				_vm->_visa->dixi('d', 12);
 				_vm->_gyro->background(0);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 7664073..9f006af 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -384,7 +384,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	seescroll = false;
 
 	ppos[0][1] = -177; 
-	//_vm->_trip->tr[0].appear(300,117,right);
+	_vm->_trip->tr[0].appear(300,117,right); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
 	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
 	him = 254;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d9b33ac..47f6075 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -488,13 +488,31 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	int16 fv, ff;
 
 	/* if not alive then begin checkfeet:=0; exit; end;*/
-	byte checkfeet_result;
 	a = 0;
 
-	warning("STUB: Trip::checkfeet()");
-		
-	checkfeet_result = a;
-	return checkfeet_result;
+	//setactivepage(2);
+
+	if (x1 < 0)
+		x1 = 0;
+	if (x2 > 639)
+		x2 = 639;
+	if (oy < y)
+		for (fv = x1; fv <= x2; fv ++)
+			for (ff = oy + yl; ff <= y + yl; ff ++) {
+				c = *_vm->_graphics->getPixel(fv, ff);
+				if (c > a) 
+					a = c;
+			}
+	else
+		for (fv = x1; fv <= x2; fv ++)
+			for (ff = y + yl; ff <= oy + yl; ff ++) {
+				c = *_vm->_graphics->getPixel(fv, ff);
+				if (c > a)
+					a = c;
+			}
+
+	//setactivepage(1 - cp);
+	return a;
 }
 
 byte Trip::geida_ped(byte which) {
@@ -1414,10 +1432,10 @@ void Trip::get_back_loretta() {
 }
 
 void Trip::stopwalking() {
-	tr[1].stopwalk();
+	tr[0].stopwalk();
 	_vm->_gyro->dna.rw = stopped;
 	if (_vm->_gyro->alive)
-		tr[1].step = 1;
+		tr[0].step = 1;
 }
 
 void Trip::tripkey(char dir) {


Commit: 06f86bedb0f6e9a4d0c8858ff0c61a22ecb464c3
    https://github.com/scummvm/scummvm/commit/06f86bedb0f6e9a4d0c8858ff0c61a22ecb464c3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T11:33:05-07:00

Commit Message:
AVALANCHE: Add _magics to Graphics, implement Lucerna::draw_also_lines(), update Trip::checkfeet() accordingly.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0574705..737147b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -58,10 +58,13 @@ void Graphics::init() {
 		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
 
 	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	_magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
 Graphics::~Graphics() {
 	_surface.free();
+	_magics.free();
 	_background.free();
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index d0adb17..074031f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -59,6 +59,11 @@ public:
 
 	::Graphics::Surface _background;
 
+	::Graphics::Surface _magics;
+	// Lucerna::draw_also_lines() draws the "magical" lines here.
+	// Further information: https://github.com/urukgit/avalot/wiki/Also
+	
+
 
 
 	Graphics(AvalancheEngine *vm);
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3c3ad35..fa1e3db 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -44,6 +44,7 @@
 #include "avalanche/acci2.h"
 #include "avalanche/roomnums.h"
 
+#include "common/rect.h"
 #include "common/system.h"
 
 #include "graphics/palette.h"
@@ -83,7 +84,41 @@ void Lucerna::draw_also_lines() {
 	byte ff;
 	byte squeaky_code;
 
-	warning("STUB: Lucerna::draw_also_lines()");
+	switch (_vm->_gyro->visible) {
+	case _vm->_gyro->m_virtual: {
+		squeaky_code = 1;
+		_vm->_gyro->off_virtual();
+		}
+		break;
+	case _vm->_gyro->m_no:
+		squeaky_code = 2;
+		break;
+	case _vm->_gyro->m_yes: {
+		squeaky_code = 3;
+		_vm->_gyro->off();
+		}
+		break;
+	}
+
+	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
+	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 160), 15);
+
+	for (ff = 0; ff < 50; ff++) {
+		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/) {
+			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
+		}
+	}
+
+	switch (squeaky_code) {
+	case 1 :
+		_vm->_gyro->on_virtual();
+		break;
+	case 2 :
+		break; // Zzz... it was off anyway.
+	case 3 :
+		_vm->_gyro->on();
+		break;
+	}
 }
 
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 47f6075..2c73bf1 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -216,7 +216,8 @@ void triptype::walk() {
 			return;
 		}
 
-		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl);
+		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl) - 1;
+		// -1  is becouse the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 0) & (!_tr->_vm->_gyro->doing_sprite_run)) {
 			switch (_tr->_vm->_gyro->magics[tc].op) {
@@ -498,15 +499,15 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 		x2 = 639;
 	if (oy < y)
 		for (fv = x1; fv <= x2; fv ++)
-			for (ff = oy + yl; ff <= y + yl; ff ++) {
-				c = *_vm->_graphics->getPixel(fv, ff);
+			for (ff = oy + yl; ff <= y + yl; ff++) {
+				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a) 
 					a = c;
 			}
 	else
 		for (fv = x1; fv <= x2; fv ++)
-			for (ff = y + yl; ff <= oy + yl; ff ++) {
-				c = *_vm->_graphics->getPixel(fv, ff);
+			for (ff = y + yl; ff <= oy + yl; ff++) {
+				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a)
 					a = c;
 			}


Commit: 7800c4735f7d38efc2f54d8e19b8a5ed2cd9e1c6
    https://github.com/scummvm/scummvm/commit/7800c4735f7d38efc2f54d8e19b8a5ed2cd9e1c6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T12:32:14-07:00

Commit Message:
AVALANCHE: Repair Acci::parse().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 86600d6..45518fb 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -454,10 +454,12 @@ void Acci::parse() {
 	cc = c;
 	c.toUppercase();
 	while (!c.empty()) {
-		while ((c[0] == ' ') && (!c.empty())) {
+		while ((!c.empty()) && (c[0] == ' ')) {
 			c.deleteChar(0);
 			cc.deleteChar(0);
 		}
+		if (c.empty())
+			break;
 
 		// Get the following word of the strings.
 		byte size = pos(Common::String(' '), c) + 1;


Commit: 2e741241c5b38725b1f2911e22312102155c0d72
    https://github.com/scummvm/scummvm/commit/2e741241c5b38725b1f2911e22312102155c0d72
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T12:52:49-07:00

Commit Message:
AVALANCHE: Broaden Avalot::handleKeyDown().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7b993a5..3363b92 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -181,6 +181,12 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 
 	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
 		_vm->_parser->handleInputText(event);
+
+
+
+	_vm->_lucerna->showrw();
+	 if (_vm->_gyro->demo)
+		 _vm->_basher->get_demorec();
 }
 
 


Commit: 6ffcb714af5f446826b0c029ebcaed222291e961
    https://github.com/scummvm/scummvm/commit/6ffcb714af5f446826b0c029ebcaed222291e961
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T13:25:04-07:00

Commit Message:
AVALANCHE: Broaden Avalot::handleKeyDown().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3363b92..bdf7472 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -153,11 +153,38 @@ void Avalot::setup() {
 
 
 
-void Avalot::handleKeyDown(const Common::Event &event) {
+void Avalot::handleKeyDown(Common::Event &event) {
 	//if (keyboardclick)
 	//	click();
 	//	
 	// To be implemented later with the sounds, I assume.
+	
+	switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
+	case Common::KEYCODE_KP8:
+		event.kbd.keycode = Common::KEYCODE_UP;
+		break;
+	case Common::KEYCODE_KP2:
+		event.kbd.keycode = Common::KEYCODE_DOWN;
+		break;
+	case Common::KEYCODE_KP6:
+		event.kbd.keycode = Common::KEYCODE_RIGHT;
+		break;
+	case Common::KEYCODE_KP4:
+		event.kbd.keycode = Common::KEYCODE_LEFT;
+		break;
+	case Common::KEYCODE_KP9:
+		event.kbd.keycode = Common::KEYCODE_PAGEUP;
+		break;
+	case Common::KEYCODE_KP3:
+		event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
+		break;
+	case Common::KEYCODE_KP7:
+		event.kbd.keycode = Common::KEYCODE_HOME;
+		break;
+	case Common::KEYCODE_KP1:
+		event.kbd.keycode = Common::KEYCODE_END;
+		break;
+	}
 
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_UP:
@@ -170,7 +197,10 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
 		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
-		break;
+		_vm->_lucerna->showrw();
+		if (_vm->_gyro->demo)
+			_vm->_basher->get_demorec();
+		return;
 	case Common::KEYCODE_BACKSPACE:
 		_vm->_parser->handleBackspace();
 		break;
@@ -182,8 +212,6 @@ void Avalot::handleKeyDown(const Common::Event &event) {
 	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
 		_vm->_parser->handleInputText(event);
 
-
-
 	_vm->_lucerna->showrw();
 	 if (_vm->_gyro->demo)
 		 _vm->_basher->get_demorec();
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index a053267..c792a17 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -44,7 +44,7 @@ public:
 
 
 
-	void handleKeyDown(const Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
+	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 
 	
 


Commit: 5290eb98797c638276b47b3b53ec6a30e63473dd
    https://github.com/scummvm/scummvm/commit/5290eb98797c638276b47b3b53ec6a30e63473dd
Author: uruk (koppirnyo at gmail.com)
Date: 2013-07-30T14:43:20-07:00

Commit Message:
AVALANCHE: Repair Lucerna::draw_also_lines().

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index fa1e3db..29f93c7 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -101,7 +101,7 @@ void Lucerna::draw_also_lines() {
 	}
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
-	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 160), 15);
+	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 161), 15);
 
 	for (ff = 0; ff < 50; ff++) {
 		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/) {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 2c73bf1..26530a5 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -492,20 +492,19 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	a = 0;
 
 	//setactivepage(2);
-
 	if (x1 < 0)
 		x1 = 0;
 	if (x2 > 639)
 		x2 = 639;
 	if (oy < y)
-		for (fv = x1; fv <= x2; fv ++)
+		for (fv = x1; fv <= x2; fv++)
 			for (ff = oy + yl; ff <= y + yl; ff++) {
 				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a) 
 					a = c;
 			}
 	else
-		for (fv = x1; fv <= x2; fv ++)
+		for (fv = x1; fv <= x2; fv++)
 			for (ff = y + yl; ff <= oy + yl; ff++) {
 				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a)


Commit: d66feb32a0ee26671e2439b52e35c8c8c4d45d4c
    https://github.com/scummvm/scummvm/commit/d66feb32a0ee26671e2439b52e35c8c8c4d45d4c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-01T02:15:59-07:00

Commit Message:
AVALANCHE: Implement rest of Acci::do_that().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 45518fb..02fda21 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1134,25 +1134,19 @@ void Acci::do_that() {
 	if (thing < 200)
 		thing -= 49; // "Slip"
 
-	/*
-	if ((!_vm->_gyro->alive) &
-		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
-		vb_highscores, vb_smartalec, eos).has(verb))) {
-		_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
-		"or something? Try restarting, or restoring a saved game!");
-		return;
-	}
 
-	if ((~ _vm->_gyro->dna.avvy_is_awake) &
-		!(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
-		vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
-		vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
-		_vm->_scrolls->display("Talking in your sleep? Try waking up!");
-		return;
+	if ((verb != vb_load) && (verb != vb_save) && (verb != vb_quit) && (verb != vb_info) && (verb != vb_help)
+		&& (verb != vb_larrypass) && (verb != vb_phaon) && (verb != vb_boss) && (verb != vb_cheat) && (verb != vb_restart) && (verb != vb_dir)
+		&& (verb != vb_score) && (verb != vb_highscores) && (verb != vb_smartalec)) {
+			if (!_vm->_gyro->alive) {
+				_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
+				return;
+			}
+			if (!_vm->_gyro->dna.avvy_is_awake  && (verb != vb_die) && (verb != vb_expletive) && (verb != vb_wake)) {
+				_vm->_scrolls->display("Talking in your sleep? Try waking up!");
+				return;
+			}
 	}
-	*/
-	warning("STUB: Acci::do_that()");
 
 	switch (verb) {
 	case vb_exam:


Commit: 599aa9a0637bce5e25f5f0cf178e953079c65794
    https://github.com/scummvm/scummvm/commit/599aa9a0637bce5e25f5f0cf178e953079c65794
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-01T03:13:44-07:00

Commit Message:
AVALANCHE: Move pos() from Acci to Parser, update other code accordingly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 02fda21..d1eeb71 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -244,7 +244,7 @@ byte Acci::wordnum(Common::String x) {
 }
 
 void Acci::replace(Common::String old1, byte new1) {
-	int16 q = pos(old1, thats);
+	int16 q = _vm->_parser->pos(old1, thats);
 	while (q != -1) {
 		if (new1 == 0)
 			thats.deleteChar(q);
@@ -253,7 +253,7 @@ void Acci::replace(Common::String old1, byte new1) {
 				thats.deleteChar(q);
 			thats.insertChar(new1, q);
 		}
-		q = pos(old1, thats);
+		q = _vm->_parser->pos(old1, thats);
 	}
 }
 
@@ -324,7 +324,7 @@ void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x.
 
 	for (byte fv = 0; fv < 32; fv++)
 		do {
-			int16 p = pos(Common::String(punct[fv]), x);
+			int16 p = _vm->_parser->pos(Common::String(punct[fv]), x);
 			if (p == -1)
 				break;
 			x.deleteChar(p);
@@ -409,13 +409,6 @@ void Acci::clearuint16s() {
 	warning("STUB: Acci::clearuint16s()");
 }
 
-int16 Acci::pos(const Common::String &crit, const Common::String &src) {
-	if (src.contains(crit))
-		return strstr(src.c_str(),crit.c_str()) - src.c_str();
-	else
-		return -1;
-}
-
 void Acci::parse() {
 	byte n, fv, ff;
 	Common::String c, cc, thisword;
@@ -462,7 +455,7 @@ void Acci::parse() {
 			break;
 
 		// Get the following word of the strings.
-		byte size = pos(Common::String(' '), c) + 1;
+		byte size = _vm->_parser->pos(Common::String(' '), c) + 1;
 		char *subStr = new char[size];
 		Common::strlcpy(subStr, c.c_str(), size);
 		thisword = subStr;
@@ -477,7 +470,7 @@ void Acci::parse() {
 		// Check also[] first, which conatins words about the actual room.
 		if (!thisword.empty()) {
 			for (ff = 0; ff < 31; ff++) {
-				if ((_vm->_gyro->also[ff][0] != 0) && (pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1)) {
+				if ((_vm->_gyro->also[ff][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1)) {
 					thats = thats + Common::String(99 + ff);
 					notfound = false;
 				}
@@ -496,18 +489,18 @@ void Acci::parse() {
 		}
 
 		// Delete words we already processed.
-		int16 spacePos = pos(Common::String(' '), c);
+		int16 spacePos = _vm->_parser->pos(Common::String(' '), c);
 		if (spacePos > -1)
 			for (byte i = 0; i <= spacePos; i++)
 				c.deleteChar(0);
-		spacePos = pos(Common::String(' '), cc);
+		spacePos = _vm->_parser->pos(Common::String(' '), cc);
 		if (spacePos > -1)
 			for (byte i = 0; i <= spacePos; i++)
 				cc.deleteChar(0);
 	}
 
-	if (pos(Common::String(254), thats) > -1) 
-		unknown = realwords[pos(Common::String(254), thats)];
+	if (_vm->_parser->pos(Common::String(254), thats) > -1) 
+		unknown = realwords[_vm->_parser->pos(Common::String(254), thats)];
 	else
 		if (!unknown.empty())
 			unknown.clear();
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 0660f49..2a97b98 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -210,8 +210,6 @@ private:
 
 	void heythanks();
 
-	int16 pos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
-
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 5fbc31e..86f46c1 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -126,6 +126,13 @@ void Parser::tryDropdown() {
 	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown.
 }
 
+int16 Parser::pos(const Common::String &crit, const Common::String &src) {
+	if (src.contains(crit))
+		return strstr(src.c_str(),crit.c_str()) - src.c_str();
+	else
+		return -1;
+}
+
 void Parser::drawCursor() {
 	// Draw the '_' character. Similar to plotText().
 	char cursor = '_';
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 2a34839..6b92400 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -60,6 +60,8 @@ public:
 
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
 
+	int16 pos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+
 private:
 	AvalancheEngine *_vm;
 


Commit: 544cf3775714bd6f40b8572c29acf4b33baf1162
    https://github.com/scummvm/scummvm/commit/544cf3775714bd6f40b8572c29acf4b33baf1162
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-02T03:18:01-07:00

Commit Message:
AVALANCHE: Move strf() from Avalanche to Gyro.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 09695cd..35693ed 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -170,11 +170,6 @@ void AvalancheEngine::quit() {
 	cursor_on();
 }
 
-Common::String AvalancheEngine::strf(int32 x) {
-	Common::String q = Common::String::format("%d", x);
-	return q;
-}
-
 // Needed in dos_shell(). TODO: Remove later.
 Common::String AvalancheEngine::command_com() {
 	warning("STUB: command_com()");
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index a2b7ab6..94ac6af 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -161,8 +161,6 @@ private:
 
 	void quit();
 
-	Common::String strf(int32 x);
-
 	Common::String command_com();
 
 	void explain(byte error);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 9f006af..73a321a 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -273,6 +273,11 @@ Gyro::~Gyro() {
 
 }
 
+Common::String Gyro::strf(int32 x) {
+	Common::String q = Common::String::format("%d", x);
+	return q;
+}
+
 void Gyro::newpointer(byte m) {
 	if (m == cmp)  return;
 	cmp = m;
@@ -339,11 +344,6 @@ void Gyro::blip() {
 	warning("STUB: Gyro::blip()");
 }
 
-Common::String Gyro::strf(int32 x) {
-	Common::String q = Common::String::format("%d", x);
-	return q;
-}
-
 void Gyro::shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
 	warning("STUB: Gyro::shadow()");
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 50ae339..7573581 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -611,6 +611,8 @@ public:
 
 	~Gyro();
 
+	Common::String strf(int32 x);
+
 	void newpointer(byte m);
 
 	void wait();    /* makes hourglass */
@@ -633,8 +635,6 @@ public:
 
 	void blip();
 
-	Common::String strf(int32 x);
-
 	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
 	void newgame();


Commit: 9660c1a56651c424c6223fdad2c271e7cd8756b5
    https://github.com/scummvm/scummvm/commit/9660c1a56651c424c6223fdad2c271e7cd8756b5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-02T04:17:50-07:00

Commit Message:
AVALANCHE: Add some constatns to Scolls, implement Scrolls::calldrivers(), Scrolls::solidify() and Scrolls::strip().

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8250880..1f85ba0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -273,21 +273,237 @@ Common::String Scrolls::lsd() {
 
 
 
-void Scrolls::strip(Common::String &q) {
-	warning("STUB: Scrolls::strip()");
+void Scrolls::strip(Common::String &q) { // Strip trailing spaces.
+	while (q[q.size() - 1] == ' ') {
+		q.deleteLastChar();
+	}
 }
 
 void Scrolls::solidify(byte n) {
-	warning("STUB: Scrolls::solidify()");
+	if (!_vm->_gyro->scroll[n].contains(' '))
+		return; // No spaces.
+
+	// So there MUST be a space there, somewhere...
+	do {
+		_vm->_gyro->scroll[n + 1] = _vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] + _vm->_gyro->scroll[n + 1];
+		_vm->_gyro->scroll[n].deleteLastChar();
+	} while (!_vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] != ' ');
+
+	strip(_vm->_gyro->scroll[n]);
 }
 
 void Scrolls::calldrivers() {
+	uint16 fv;
+	byte nn;
+	char nnn;
+	bool mouthnext;
+	bool call_spriterun; // Only call sprite_run the FIRST time.
+	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
+
+
+	//nosound();
 	warning("STUB: Scrolls::calldrivers()");
+
+	state(0);
+	_vm->_gyro->screturn = false;
+	mouthnext = false;
+	call_spriterun = true;
+
+	switch (_vm->_gyro->buffer[_vm->_gyro->bufsize - 1]) {
+	case kControlToBuffer:
+		_vm->_gyro->bufsize--;
+		break; // ^D = (D)on't include pagebreak
+	case kControlSpeechBubble:
+	case kControlQuestion:
+		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
+	default: {
+		_vm->_gyro->bufsize++;
+		_vm->_gyro->buffer[_vm->_gyro->bufsize - 1] = kControlParagraph;
+		}
+	}
+
+	for (fv = 0; fv <= _vm->_gyro->bufsize; fv++)
+		if (mouthnext) {
+			if (_vm->_gyro->buffer[fv] == kControlRegister)
+				param = 0;
+			else
+				if (('0' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < '9'))
+					param = _vm->_gyro->buffer[fv] - 48;
+				else if (('A' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < 'Z'))
+					param = _vm->_gyro->buffer[fv] - 55;
+
+			mouthnext = false;
+		} else
+			switch (_vm->_gyro->buffer[fv]) {
+			case kControlParagraph: {
+				if ((_vm->_gyro->scrolln == 0) && (_vm->_gyro->scroll[0].empty()))
+					break;
+
+				if (call_spriterun)
+					_vm->_lucerna->sprite_run();
+				call_spriterun = false;
+
+				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
+				if (was_virtual)
+					_vm->_gyro->off_virtual();
+
+				drawscroll(&Avalanche::Scrolls::normscroll);
+
+				if (was_virtual)
+					_vm->_gyro->on_virtual();
+
+				resetscroll();
+
+				if (_vm->_gyro->screturn)
+					return;
+			}
+			break;
+			case kControlBell:
+				_vm->_gyro->scrollbells++;
+				break; // #7 = "Bel"
+			case kControlSpeechBubble: {
+				if ((_vm->_gyro->scrolln == 0) && (_vm->_gyro->scroll[0].empty()))
+					break;
+
+				if (call_spriterun)
+					_vm->_lucerna->sprite_run();
+				call_spriterun = false;
+
+				if (param == 0)
+					natural();
+				else if ((1 <= param) && (param <= 9))
+					if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param].quick)) { // Not valid.
+						_vm->_lucerna->errorled();
+						natural();
+					} else
+						_vm->_trip->tr[param].chatter(); // Normal sprite talking routine.
+				else if ((10 <= param) && (param <= 36)) {
+					/* Quasi-peds. (This routine performs the same
+					thing with QPs as triptype.chatter does with the
+					sprites.) */
+					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->quasipeds[param].whichped].x;
+					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param].whichped].y; // Position.
+		
+					_vm->_gyro->talkf = _vm->_gyro->quasipeds[param].fgc;
+					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param].bgc; // Colours.
+				} else {
+					_vm->_lucerna->errorled(); // Not valid.
+					natural();
+				}
+
+				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
+				if (was_virtual)
+					_vm->_gyro->off_virtual();
+
+				bubble(&Avalanche::Scrolls::normscroll);
+
+				if (was_virtual)
+					_vm->_gyro->on_virtual();
+
+				resetscroll();
+
+				if (_vm->_gyro->screturn)
+					return;
+			}
+			break;
+			case kControlNegative: {
+				switch (param) {
+				case 1:
+					display(lsd() + kControlToBuffer);
+					break; /* insert cash balance (recursion) */
+				case 2:
+					display(_vm->_acci->words[_vm->_acci->first_password + _vm->_gyro->dna.pass_num].w + kControlToBuffer);
+					break;
+				case 3:
+					display(_vm->_gyro->dna.like2drink + kControlToBuffer);
+					break;
+				case 4:
+					display(_vm->_gyro->dna.favourite_song + kControlToBuffer);
+					break;
+				case 5:
+					display(_vm->_gyro->dna.worst_place_on_earth + kControlToBuffer);
+					break;
+				case 6:
+					display(_vm->_gyro->dna.spare_evening + kControlToBuffer);
+					break;
+				case 9:
+					display(_vm->_gyro->strf(_vm->_gyro->dna.cat_x) + ',' + _vm->_gyro->strf(_vm->_gyro->dna.cat_y) + kControlToBuffer);
+					break;
+				case 10:
+					switch (_vm->_gyro->dna.box_contents) {
+					case 0: { // Sixpence.
+						_vm->_visa->dixi('q', 37); // You find the sixpence.
+						_vm->_gyro->dna.pence += 6;
+						_vm->_gyro->dna.box_contents = _vm->_acci->nowt;
+						_vm->_lucerna->points(2);
+						return;
+					}
+					break;
+					case _vm->_acci->nowt:
+						display("nothing at all. It's completely empty.");
+						break;
+					default:
+						display(_vm->_gyro->get_better(_vm->_gyro->dna.box_contents) + '.');
+					}
+					break;
+				case 11: {
+					nn = 1;
+					for (nnn = 0; nnn < numobjs; nnn++)
+						if (_vm->_gyro->dna.obj[nnn]) {
+							nn ++;
+							display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer);
+						}
+					}
+					break;
+				}
+				
+				}
+				break;
+			case kControlIcon:
+				use_icon = param;
+				break;
+			case kControlNewLine:
+				_vm->_gyro->scrolln++;
+				break;
+			case kControlQuestion: {
+				if (call_spriterun)
+					_vm->_lucerna->sprite_run();
+				call_spriterun = false;
+
+				_vm->_gyro->scrolln++;
+				_vm->_gyro->scroll[_vm->_gyro->scrolln] = kControlQuestion;
+
+				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
+				if (was_virtual)
+					_vm->_gyro->off_virtual();
+
+				drawscroll(&Avalanche::Scrolls::dialogue);
+
+				if (was_virtual)
+					_vm->_gyro->on_virtual();
+
+				resetscroll();
+				}
+				break;
+			case kControlRegister:
+				mouthnext = true;
+				break;
+			case kControlInsertSpaces:
+				for (nn = 0; nn < 9; nn++) _vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + ' ';
+				break;
+			default: { // Add new char.
+				if (_vm->_gyro->scroll[_vm->_gyro->scrolln].size() == 50) {
+					solidify(_vm->_gyro->scrolln);
+					_vm->_gyro->scrolln++;
+				}
+				_vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + _vm->_gyro->buffer[fv];
+				}
+			}
 }
 
 void Scrolls::display(Common::String z) {
 	_vm->_gyro->bufsize = z.size();
-	memcpy(_vm->_gyro->buffer, z.c_str() + 1, _vm->_gyro->bufsize);
+	memcpy(_vm->_gyro->buffer, z.c_str(), _vm->_gyro->bufsize);
 	calldrivers();
 }
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 5fdbab7..1caaf5e 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -77,14 +77,34 @@ private:
 	static const int16 roman = 0;
 	static const int16 italic = 1;
 
-	static const int16 halficonwidth = 19; /* Half the width of an icon. */
+	static const int16 halficonwidth = 19; // Half the width of an icon.
+
+
+
+	// Constants to replace the command characters from Pascal:
+	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
+	
+	static const char kControlSpeechBubble = 2; // ^B
+	static const char kControlCenter = 3; // ^C
+	static const char kControlToBuffer = 4; // ^D
+	static const char kControlBell = 7; // ^G
+	static const char kControlInsertSpaces = 9; // ^I
+	static const char kControlLeftJustified = 12; // ^L
+	static const char kControlNewLine = 13; // ^M
+	static const char kControlParagraph = 16; // ^P
+	static const char kControlQuestion = 17; // ^Q
+	static const char kControlRegister = 19; // ^S
+	static const char kControlNegative = 21; // ^U
+	static const char kControlIcon = 22; // ^V
+
+
 
 	int16 dix, diy;
 	raw ch[2];
-	byte cfont; /* Current font */
+	byte cfont; // Current font
 
 	int16 dodgex, dodgey;
-	byte param; /* For using arguments code */
+	byte param; // For using arguments code
 
 	byte use_icon;
 


Commit: 832a11a2bad40b8330fe9bd0a9f6c7cdb871e670
    https://github.com/scummvm/scummvm/commit/832a11a2bad40b8330fe9bd0a9f6c7cdb871e670
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-02T05:15:36-07:00

Commit Message:
AVALANCHE: Repair Scrolls::resetscroll() and Scrolls::calldrivers().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index bdf7472..c403f00 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -147,8 +147,10 @@ void Avalot::setup() {
 	_vm->_parser->cursorOn();
 	_vm->_trip->newspeed();
 
-	if (! _vm->_gyro->reloaded)
-		_vm->_visa->dixi('q', 83); /* Info on the game: etc. */
+	//if (! _vm->_gyro->reloaded)
+	//	_vm->_visa->dixi('q', 83); /* Info on the game: etc. */
+	//
+	// TODO: UNCOMMENT THIS! ONLY COMMENTED OUT FOR TESTING!!!
 }
 
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1f85ba0..4c3ebc0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -237,10 +237,10 @@ bool Scrolls::ask(Common::String question) {
 }
 
 void Scrolls::resetscroll() {
-	_vm->_gyro->scrolln = 1;
+	_vm->_gyro->scrolln = 0;
 	for (int j = 0; j < 15; j ++)
-		for (int i = 0; i < _vm->_gyro->scroll[j].size(); i++)
-			_vm->_gyro->scroll[j].setChar(0, i);
+		if (!_vm->_gyro->scroll[j].empty())
+			_vm->_gyro->scroll[j].clear();
 }
 
 void Scrolls::natural() {   /* Natural state of bubbles */
@@ -496,12 +496,12 @@ void Scrolls::calldrivers() {
 					solidify(_vm->_gyro->scrolln);
 					_vm->_gyro->scrolln++;
 				}
-				_vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + _vm->_gyro->buffer[fv];
+				_vm->_gyro->scroll[_vm->_gyro->scrolln] += _vm->_gyro->buffer[fv];
 				}
 			}
 }
 
-void Scrolls::display(Common::String z) {
+void Scrolls::display(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
 	_vm->_gyro->bufsize = z.size();
 	memcpy(_vm->_gyro->buffer, z.c_str(), _vm->_gyro->bufsize);
 	calldrivers();


Commit: 471933a3fd0719a938c635735c56652e01a3ee36
    https://github.com/scummvm/scummvm/commit/471933a3fd0719a938c635735c56652e01a3ee36
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-04T03:54:11-07:00

Commit Message:
AVALANCHE: Remove comment from Graphics, partially implement Scrolls::drawscroll(), repair Scrolls::solidify(), broaden scrolls2.h.

Changed paths:
    engines/avalanche/graphics.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 074031f..f1dbe4a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -76,7 +76,7 @@ public:
 
 	byte *getPixel(int16 x, int16 y);
 
-	void drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color); // Solely for testing purposes!
+	void drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
 	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4c3ebc0..bf039d6 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -106,7 +106,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	warning("STUB: Scrolls::say()");
 }
 
-/* Here are the func2edures that Scroll calls */ /* So they must be... */ /*$F+*/
+/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
 
 void Scrolls::normscroll() {
 	warning("STUB: Scrolls::normscroll()");
@@ -223,7 +223,141 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	f.close();
 }
 
-void Scrolls::drawscroll(func2 gotoit) {     /* This is one of the oldest func2s in the game. */
+void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in the game.
+	byte b, groi;
+	int16 lx, ly, mx, my, ex, ey;
+	bool centre;
+	byte icon_indent;
+
+	_vm->_gyro->off_virtual();
+	//setvisualpage(cp);
+	//setactivepage(1 - cp);
+	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
+	_vm->_logger->log_epsonroman(); /* Scrolls always START with Roman. */
+
+	lx = 0;
+	ly = (_vm->_gyro->scrolln + 1) * 6;
+	for (b = 0; b <= _vm->_gyro->scrolln; b++) {
+		ex = _vm->_gyro->scroll[b].size() * 8;
+		if (lx < ex)
+			lx = ex;
+	}
+	mx = 320;
+	my = 100; // Getmaxx & getmaxy div 2, both.
+	lx = lx / 2;
+	ly -= 2;
+
+	if ((1 <= use_icon) && (use_icon <= 34))
+		lx += halficonwidth;
+		
+	_vm->_gyro->off();
+	/* mblit(mx-lx-46,my-ly-6,mx+lx+15,my+ly+6,0,3);*/
+	/*setfillstyle(1, 7);
+	setcolor(7);
+	pieslice(mx + lx, my - ly, 360, 90, 15);
+	pieslice(mx + lx, my + ly, 270, 360, 15);
+	setcolor(4);
+	arc(mx + lx, my - ly, 360, 90, 15);
+	arc(mx + lx, my + ly, 270, 360, 15);*/
+	_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
+	_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly, lightgray);
+	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);
+	/*setfillstyle(1, 8);
+	pieslice(mx - lx - 31, my - ly, 360, 180, 15);
+	pieslice(mx - lx - 31, my + ly, 180, 360, 15);
+	setfillstyle(1, 4);*/
+	_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
+	_vm->_graphics->drawBar(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7, red);
+	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx - lx - 14, my + ly, red);
+	_vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);
+	ex = mx - lx;
+	ey = my - ly;
+	mx -= lx;
+	my -= ly + 2;
+	//setcolor(0);
+	centre = false;
+
+	switch (use_icon) {
+	case 0:
+		icon_indent = 0;
+		break; /* No icon. */
+	case 34: {
+		block_drop("about", 28, 76, 15);
+		icon_indent = 0;
+		}
+		break;
+	case 35: {
+		block_drop("gameover", 52, 59, 71);
+		icon_indent = 0;
+		}
+		break;
+	}
+
+	if ((1 <= use_icon) && (use_icon <= 33)) { // Standard icon.
+		geticon(mx, my + ly / 2, use_icon);
+		icon_indent = 53;
+	}
+
+
+	for (b = 0; b <= _vm->_gyro->scrolln; b++) {
+		switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
+		case kControlCenter: {
+			centre = true;
+			_vm->_gyro->scroll[b].deleteLastChar();
+			}
+			break;
+		case kControlLeftJustified: {
+			centre = false;
+			_vm->_gyro->scroll[b].deleteLastChar();
+			}
+			break;
+		case kControlQuestion: {
+			//settextjustify(1, 1);
+			dix = mx + lx;
+			diy = my + ly;
+			_vm->_gyro->scroll[b].setChar(' ', 0);
+			groi = *_vm->_graphics->getPixel(0, 0);
+			// inc(diy,14);
+			_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
+			_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+			}
+			break;
+		}
+
+		if (centre)
+			say(320 - _vm->_gyro->scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->scroll[b]);
+		else
+			say(mx + icon_indent, my, _vm->_gyro->scroll[b]);
+
+		_vm->_logger->log_scrollendline(centre);
+		my += 12;
+	}
+
+	_vm->_gyro->underscroll = my + 3;
+	//setvisualpage(1 - cp);
+	dingdongbell();
+	//my = getpixel(0, 0);
+	_vm->_gyro->dropsok = false;
+	dodgem();
+
+	(this->*gotoit)();
+
+	undodgem();
+	_vm->_gyro->dropsok = true;
+	_vm->_logger->log_divider();
+	//setvisualpage(cp);
+	//mousepage(cp);
+	_vm->_gyro->off();
+	/* mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);*/
+	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
+	//blitfix();
+	_vm->_gyro->oncandopageswap = true; // Normality again.
+	_vm->_gyro->on();
+	//settextjustify(0, 0); /*sink*/
+	resetscrolldriver();
+	if (_vm->_gyro->mpress > 0)
+		_vm->_gyro->after_the_scroll = true;
+
 	warning("STUB: Scrolls::drawscroll()");
 }
 
@@ -273,7 +407,7 @@ Common::String Scrolls::lsd() {
 
 
 
-void Scrolls::strip(Common::String &q) { // Strip trailing spaces.
+void Scrolls::strip(Common::String &q) {
 	while (q[q.size() - 1] == ' ') {
 		q.deleteLastChar();
 	}
@@ -287,7 +421,7 @@ void Scrolls::solidify(byte n) {
 	do {
 		_vm->_gyro->scroll[n + 1] = _vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] + _vm->_gyro->scroll[n + 1];
 		_vm->_gyro->scroll[n].deleteLastChar();
-	} while (!_vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] != ' ');
+	} while (_vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] != ' ');
 
 	strip(_vm->_gyro->scroll[n]);
 }
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 1caaf5e..a4f5c09 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -87,12 +87,14 @@ private:
 	static const char kControlSpeechBubble = 2; // ^B
 	static const char kControlCenter = 3; // ^C
 	static const char kControlToBuffer = 4; // ^D
+	static const char kControlItalic = 6; // ^F
 	static const char kControlBell = 7; // ^G
 	static const char kControlInsertSpaces = 9; // ^I
 	static const char kControlLeftJustified = 12; // ^L
 	static const char kControlNewLine = 13; // ^M
 	static const char kControlParagraph = 16; // ^P
 	static const char kControlQuestion = 17; // ^Q
+	static const char kControlRoman = 18; // ^R
 	static const char kControlRegister = 19; // ^S
 	static const char kControlNegative = 21; // ^U
 	static const char kControlIcon = 22; // ^V
@@ -134,9 +136,9 @@ private:
 
 	void block_drop(Common::String fn, int16 xl, int16 yl, int16 y);
 
-	void strip(Common::String &q);
+	void strip(Common::String &q); // Strip trailing spaces.
 
-	void solidify(byte n);
+	void solidify(byte n); // Does the word wrapping.
 
 	void loadfont();
 };


Commit: 1956ca280bdd6491fd595c1c8f8da9aee679984b
    https://github.com/scummvm/scummvm/commit/1956ca280bdd6491fd595c1c8f8da9aee679984b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-04T12:48:11-07:00

Commit Message:
AVALANCHE: Repair Logger::log_scrollchar(), cosmetic corrections in Scrolls and Timeout.

Changed paths:
    engines/avalanche/logger2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index ef94eb3..24c6d55 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -152,14 +152,14 @@ void Logger::log_scrollchar(Common::String x) {     /* print one character */
 	if (!_vm->_gyro->logging)
 		return;
 
-	switch (x[1]) {
-	case '`':
+	switch (x[0]) {
+	case '\'':
 		z = quote;
 		break; /* Open quotes: "66" */
-	case '"':
+	case '\"':
 		z = unquote;
 		break; /* Close quotes: "99" */
-	case '\357':
+	case 239:
 		z = copyright;
 		break; /* Copyright sign. */
 	default:
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index a4f5c09..6fa2be9 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -81,7 +81,7 @@ private:
 
 
 
-	// Constants to replace the command characters from Pascal:
+	// Constants to replace the command characters from Pascal.
 	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
 	
 	static const char kControlSpeechBubble = 2; // ^B
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 88277ef..1574a95 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -76,7 +76,7 @@ void Timeout::one_tick() {
 
 	for (fv = 0; fv < 7; fv++) {
 		if (times[fv].time_left > 0) {
-			times[fv].time_left --;
+			times[fv].time_left--;
 
 			if (times[fv].time_left == 0) {
 				switch (times[fv].then_where) {


Commit: 15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b
    https://github.com/scummvm/scummvm/commit/15f6ba8b2aa3883e47e07bdb131d9ed65a21ee5b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-05T03:19:10-07:00

Commit Message:
AVALANCHE: Introduce _screen in Graphics.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 737147b..677f510 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -60,12 +60,15 @@ void Graphics::init() {
 	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	_magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	_screen.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
 Graphics::~Graphics() {
 	_surface.free();
 	_magics.free();
 	_background.free();
+	_screen.free();
 }
 
 
@@ -166,18 +169,14 @@ void Graphics::drawPicture(const ::Graphics::Surface &picture, uint16 destX, uin
 
 void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
-	::Graphics::Surface picture;
-	picture.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
-	for (uint16 y = 0; y < picture.h / 2; y++)
-		for (uint16 x = 0; x < picture.w; x++)
+	for (uint16 y = 0; y < _screen.h / 2; y++)
+		for (uint16 x = 0; x < _screen.w; x++)
 			for (byte j = 0; j < 2; j++) 
-				*(byte *)picture.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
+				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
 
 	// Now we copy the stretched picture to the screen.
-	g_system->copyRectToScreen(picture.pixels, picture.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
+	g_system->copyRectToScreen(_screen.pixels, _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
 	g_system->updateScreen();
-
-	picture.free();
 }
 
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index f1dbe4a..d16b0c0 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -63,6 +63,8 @@ public:
 	// Lucerna::draw_also_lines() draws the "magical" lines here.
 	// Further information: https://github.com/urukgit/avalot/wiki/Also
 	
+	::Graphics::Surface _screen;
+
 
 
 


Commit: ba00b2a7d9b08265023d3b478c24c44f43c2e33f
    https://github.com/scummvm/scummvm/commit/ba00b2a7d9b08265023d3b478c24c44f43c2e33f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-05T06:25:44-07:00

Commit Message:
AVALANCHE: Mostly cosmetic modifications in Visa, stub Timeout::arkata_shouts() until dixi() works, partially implement Scrolls::say().

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index bf039d6..634ee10 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -103,6 +103,67 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
+	const byte locol = 2;
+	byte xx, yy, ox, bit, lz, t;
+	int16 yp;
+	bool offset;
+	byte itw[12][80];
+
+	offset = x % 8 == 4;
+	x = x / 8;
+	lz = z.size();
+	ox = 0;
+	_vm->_logger->log_scrollline();
+
+	for (xx = 0; xx < lz; xx++) {
+		switch (z[xx]) {
+		case kControlRoman: {
+			cfont = roman;
+			_vm->_logger->log_roman();
+			}
+			break;
+		case kControlItalic: {
+			cfont = italic;
+			_vm->_logger->log_italic();
+			}
+			break;
+		default: {
+			for (yy = 0; yy < 12; yy ++)
+				itw[yy][ox] = ~ch[cfont][z[xx]][yy + 1];
+			ox++;
+			_vm->_logger->log_scrollchar(Common::String(z[xx]));
+			}
+		}
+	}
+
+	lz = ox;
+	if (offset) {
+		/* offsetting routine */
+		for (yy = 0; yy < 12; yy++) {
+			bit = 240;
+			itw[yy][lz] = 255;
+			for (xx = 0; xx < lz; xx++) {
+				t = itw[yy][xx];
+				itw[yy][xx] = bit + t / 16;
+				bit = t << 4;
+			}
+		}
+		lz++;
+	}
+
+	/*yp = x + y * 80 + (1 - _vm->_gyro->cp) * _vm->_gyro->pagetop;
+	for (yy = 0; yy < 12; yy++) {
+	yp += 80;
+	for (bit = 0; bit <= locol; bit ++) {
+	port[0x3c4] = 2;
+	port[0x3ce] = 4;
+	port[0x3c5] = 1 << bit;
+	port[0x3cf] = bit;
+	move(itw[yy], mem[0xa000 * yp], lz);
+	}
+	}*/
+
+
 	warning("STUB: Scrolls::say()");
 }
 
@@ -227,7 +288,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	byte b, groi;
 	int16 lx, ly, mx, my, ex, ey;
 	bool centre;
-	byte icon_indent;
+	byte icon_indent = 0;
 
 	_vm->_gyro->off_virtual();
 	//setvisualpage(cp);
@@ -456,7 +517,7 @@ void Scrolls::calldrivers() {
 		}
 	}
 
-	for (fv = 0; fv <= _vm->_gyro->bufsize; fv++)
+	for (fv = 0; fv < _vm->_gyro->bufsize; fv++)
 		if (mouthnext) {
 			if (_vm->_gyro->buffer[fv] == kControlRegister)
 				param = 0;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 1574a95..e23114d 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -607,7 +607,8 @@ void Timeout::arkata_shouts() {
 	if (_vm->_gyro->dna.teetotal)
 		return;
 
-	_vm->_visa->dixi('q', 76);
+	// _vm->_visa->dixi('q', 76);
+	warning("STUB: Timeout::arkata_shouts()");
 	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
 }
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 5938f52..e2f83d6 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -50,12 +50,12 @@ bool Visa::report_dixi_errors = true;
 
 void Visa::unskrimble() {
 	for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
-		_vm->_gyro->buffer[fv] = (char)((!(_vm->_gyro->buffer[fv]) - fv) % 256);
+		_vm->_gyro->buffer[fv] = (~(_vm->_gyro->buffer[fv]) - fv + 1) % 256;
 }
 
 void Visa::do_the_bubble() {
 	_vm->_gyro->bufsize++;
-	_vm->_gyro->buffer[_vm->_gyro->bufsize] = 2;
+	_vm->_gyro->buffer[_vm->_gyro->bufsize - 1] = 2;
 }
 
 void Visa::dixi(char block, byte point) {
@@ -101,7 +101,8 @@ void Visa::dixi(char block, byte point) {
 	sezfile.close();
 	unskrimble();
 
-	if (bubbling)  do_the_bubble();
+	if (bubbling)
+		do_the_bubble();
 
 	_vm->_scrolls->calldrivers();
 }


Commit: a971cf3a3997dd71282c5566bb2f5ee062c190bf
    https://github.com/scummvm/scummvm/commit/a971cf3a3997dd71282c5566bb2f5ee062c190bf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-05T08:35:17-07:00

Commit Message:
AVALANCHE: Implement Scrolls::say().

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 634ee10..4a62f24 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -129,7 +129,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			break;
 		default: {
 			for (yy = 0; yy < 12; yy ++)
-				itw[yy][ox] = ~ch[cfont][z[xx]][yy + 1];
+				itw[yy][ox] = ~ch[cfont][z[xx]][yy + 2];
 			ox++;
 			_vm->_logger->log_scrollchar(Common::String(z[xx]));
 			}
@@ -151,6 +151,18 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 		lz++;
 	}
 
+	y++;
+	for (byte fv = 0; fv < z.size(); fv++)
+		for (byte ff = 0; ff < 12; ff++) {
+			byte pixel = itw[ff][fv]; // Note that it's the bitwise NOT operator!
+			for (byte bit = 0; bit < 8; bit++) {
+				byte pixelBit = (pixel >> bit) & 1;
+				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
+				// We don't have to bother with the planes, since they all have the same value. See the original.
+				// Note that it's the bitwise OR operator!
+			}
+		}
+
 	/*yp = x + y * 80 + (1 - _vm->_gyro->cp) * _vm->_gyro->pagetop;
 	for (yy = 0; yy < 12; yy++) {
 	yp += 80;
@@ -162,14 +174,63 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	move(itw[yy], mem[0xa000 * yp], lz);
 	}
 	}*/
-
-
-	warning("STUB: Scrolls::say()");
 }
 
 /* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
 
 void Scrolls::normscroll() {
+	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
+	Common::String e = "(c) 1994";
+	char r;
+	bool oktoexit;
+
+	state(3);
+	_vm->_gyro->seescroll = true;
+	_vm->_gyro->off_virtual();
+	_vm->_gyro->on();
+	_vm->_gyro->newpointer(4);
+	_vm->_lucerna->mousepage(1 - _vm->_gyro->cp);
+
+	if (_vm->_gyro->demo)
+		_vm->_basher->get_demorec();
+
+//	do {
+//		do {
+//			_vm->_gyro->check(); /* was "checkclick;" */
+//
+//#ifdef RECORD slowdown(); basher::count += 1; #endif
+//
+//			if (_vm->_gyro->demo) {
+//				if (_vm->_basher->demo_ready())
+//					break;
+//				if (_vm->_enhanced->keypressede())
+//					return;
+//			} else if (_vm->_enhanced->keypressede())
+//				break;
+//		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
+//
+//
+//		if (mrelease == 0) {
+//			inkey();
+//			if (aboutscroll) {
+//				move(e[2 - 1], e[1 - 1], 7);
+//				e[8 - 1] = inchar;
+//				if (egg == e)  easteregg();
+//			}
+//			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
+//			if (! oktoexit)  errorled();
+//		}
+//
+//	} while (!((oktoexit) || (mrelease > 0)));
+//
+//#ifdef RECORD record_one(); #endif
+//
+	//_vm->_gyro->screturn = r == '#'; /* "back door" */
+	state(0);
+	_vm->_gyro->seescroll = false;
+	_vm->_lucerna->mousepage(_vm->_gyro->cp);
+	_vm->_gyro->off();
+
 	warning("STUB: Scrolls::normscroll()");
 }
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 6fa2be9..b267ff6 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -89,6 +89,7 @@ private:
 	static const char kControlToBuffer = 4; // ^D
 	static const char kControlItalic = 6; // ^F
 	static const char kControlBell = 7; // ^G
+	static const char kControlBackspace = 8; // ^H
 	static const char kControlInsertSpaces = 9; // ^I
 	static const char kControlLeftJustified = 12; // ^L
 	static const char kControlNewLine = 13; // ^M


Commit: 532306f8cb86882b45cffc1002d0d2a81f28de34
    https://github.com/scummvm/scummvm/commit/532306f8cb86882b45cffc1002d0d2a81f28de34
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-05T16:13:25-07:00

Commit Message:
AVALANCHE: Introduce AvalancheEngine::getEvent().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 35693ed..922f701 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -143,6 +143,10 @@ void AvalancheEngine::updateEvents() {
 	}
 }
 
+bool AvalancheEngine::getEvent(Common::Event &event) {
+	return _eventMan->pollEvent(event);
+}
+
 
 
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 94ac6af..8ce7312 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -111,6 +111,8 @@ public:
 
 	void updateEvents();
 
+	bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example.
+
 protected:
 	// Engine APIs
 	Common::Error run();


Commit: bd516f4244bc4fdf4342dbd1abc0c479270b2ed3
    https://github.com/scummvm/scummvm/commit/bd516f4244bc4fdf4342dbd1abc0c479270b2ed3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-05T16:17:44-07:00

Commit Message:
AVALANCHE: Implement Scrolls::say(). Introduce Graphics::_scrolls, implement Scrolls::normscroll() and update Scrolls::drawscroll() using it.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 677f510..2c266e9 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -62,6 +62,8 @@ void Graphics::init() {
 	_magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	_screen.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
+
+	_scrolls.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
 Graphics::~Graphics() {
@@ -69,6 +71,7 @@ Graphics::~Graphics() {
 	_magics.free();
 	_background.free();
 	_screen.free();
+	_scrolls.free();
 }
 
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index d16b0c0..13c6001 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -57,6 +57,8 @@ public:
 	static const int16 kScreenWidth = 640;
 	static const int16 kScreenHeight = 200;
 
+	::Graphics::Surface _surface;
+
 	::Graphics::Surface _background;
 
 	::Graphics::Surface _magics;
@@ -65,6 +67,7 @@ public:
 	
 	::Graphics::Surface _screen;
 
+	::Graphics::Surface _scrolls;
 
 
 
@@ -98,8 +101,6 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	::Graphics::Surface _surface;
-
 	static const byte _egaPaletteIndex[16];
 
 	byte _egaPalette[64][3];
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4a62f24..8cf0fff 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -103,19 +103,13 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-	const byte locol = 2;
-	byte xx, yy, ox, bit, lz, t;
-	int16 yp;
-	bool offset;
 	byte itw[12][80];
-
-	offset = x % 8 == 4;
-	x = x / 8;
-	lz = z.size();
-	ox = 0;
+	byte lz = z.size();
+	byte ox = 0;
+	
 	_vm->_logger->log_scrollline();
 
-	for (xx = 0; xx < lz; xx++) {
+	for (byte xx = 0; xx < lz; xx++) {
 		switch (z[xx]) {
 		case kControlRoman: {
 			cfont = roman;
@@ -128,7 +122,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			}
 			break;
 		default: {
-			for (yy = 0; yy < 12; yy ++)
+			for (byte yy = 0; yy < 12; yy++)
 				itw[yy][ox] = ~ch[cfont][z[xx]][yy + 2];
 			ox++;
 			_vm->_logger->log_scrollchar(Common::String(z[xx]));
@@ -136,44 +130,21 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 		}
 	}
 
+	bool offset = x % 8 == 4;
 	lz = ox;
-	if (offset) {
-		/* offsetting routine */
-		for (yy = 0; yy < 12; yy++) {
-			bit = 240;
-			itw[yy][lz] = 255;
-			for (xx = 0; xx < lz; xx++) {
-				t = itw[yy][xx];
-				itw[yy][xx] = bit + t / 16;
-				bit = t << 4;
-			}
-		}
-		lz++;
-	}
-
+	x = x / 8;
 	y++;
-	for (byte fv = 0; fv < z.size(); fv++)
+	// Similar to Dropdown::chalk().
+	for (byte fv = 0; fv < lz; fv++)
 		for (byte ff = 0; ff < 12; ff++) {
-			byte pixel = itw[ff][fv]; // Note that it's the bitwise NOT operator!
+			byte pixel = itw[ff][fv]; 
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
-				// We don't have to bother with the planes, since they all have the same value. See the original.
-				// Note that it's the bitwise OR operator!
+				uint16 xa = x * 8 + fv * 8 + 7 - bit + offset * 4;
+				uint16 ya = y + ff;
+				*(byte *)_vm->_graphics->_scrolls.getBasePtr(xa, ya) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
 			}
 		}
-
-	/*yp = x + y * 80 + (1 - _vm->_gyro->cp) * _vm->_gyro->pagetop;
-	for (yy = 0; yy < 12; yy++) {
-	yp += 80;
-	for (bit = 0; bit <= locol; bit ++) {
-	port[0x3c4] = 2;
-	port[0x3ce] = 4;
-	port[0x3c5] = 1 << bit;
-	port[0x3cf] = bit;
-	move(itw[yy], mem[0xa000 * yp], lz);
-	}
-	}*/
 }
 
 /* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
@@ -194,6 +165,24 @@ void Scrolls::normscroll() {
 	if (_vm->_gyro->demo)
 		_vm->_basher->get_demorec();
 
+
+
+	::Graphics::Surface temp;
+	temp.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls);
+	_vm->_graphics->refreshScreen();
+
+	Common::Event event;
+	while (true) {
+		_vm->getEvent(event);
+		if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS)))
+			break;
+	}
+
+	_vm->_graphics->_surface.copyFrom(temp);
+
+
+
 //	do {
 //		do {
 //			_vm->_gyro->check(); /* was "checkclick;" */
@@ -371,7 +360,10 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	if ((1 <= use_icon) && (use_icon <= 34))
 		lx += halficonwidth;
-		
+	
+
+	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
+
 	_vm->_gyro->off();
 	/* mblit(mx-lx-46,my-ly-6,mx+lx+15,my+ly+6,0,3);*/
 	/*setfillstyle(1, 7);
@@ -381,17 +373,28 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	setcolor(4);
 	arc(mx + lx, my - ly, 360, 90, 15);
 	arc(mx + lx, my + ly, 270, 360, 15);*/
-	_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
+
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
+	/*_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
 	_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly, lightgray);
-	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);
+	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);*/
+
 	/*setfillstyle(1, 8);
 	pieslice(mx - lx - 31, my - ly, 360, 180, 15);
 	pieslice(mx - lx - 31, my + ly, 180, 360, 15);
 	setfillstyle(1, 4);*/
-	_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
+
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), red);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
+	/*_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
 	_vm->_graphics->drawBar(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7, red);
 	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx - lx - 14, my + ly, red);
-	_vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);
+	_vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);*/
+
 	ex = mx - lx;
 	ey = my - ly;
 	mx -= lx;


Commit: 26b73331375488a0d5c0fa6b7e0f9c49de4e45a1
    https://github.com/scummvm/scummvm/commit/26b73331375488a0d5c0fa6b7e0f9c49de4e45a1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T01:30:44-07:00

Commit Message:
AVALANCHE: Repair parts of the scrolls system, implement the death of Avalot and almost everything connected to it.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c403f00..3f4c545 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -161,58 +161,60 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	//	
 	// To be implemented later with the sounds, I assume.
 	
-	switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
-	case Common::KEYCODE_KP8:
-		event.kbd.keycode = Common::KEYCODE_UP;
-		break;
-	case Common::KEYCODE_KP2:
-		event.kbd.keycode = Common::KEYCODE_DOWN;
-		break;
-	case Common::KEYCODE_KP6:
-		event.kbd.keycode = Common::KEYCODE_RIGHT;
-		break;
-	case Common::KEYCODE_KP4:
-		event.kbd.keycode = Common::KEYCODE_LEFT;
-		break;
-	case Common::KEYCODE_KP9:
-		event.kbd.keycode = Common::KEYCODE_PAGEUP;
-		break;
-	case Common::KEYCODE_KP3:
-		event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
-		break;
-	case Common::KEYCODE_KP7:
-		event.kbd.keycode = Common::KEYCODE_HOME;
-		break;
-	case Common::KEYCODE_KP1:
-		event.kbd.keycode = Common::KEYCODE_END;
-		break;
-	}
-
-	switch (event.kbd.keycode) {
-	case Common::KEYCODE_UP:
-	case Common::KEYCODE_DOWN:
-	case Common::KEYCODE_RIGHT:
-	case Common::KEYCODE_LEFT:
-	case Common::KEYCODE_PAGEUP:
-	case Common::KEYCODE_PAGEDOWN:
-	case Common::KEYCODE_HOME:
-	case Common::KEYCODE_END:
-	case Common::KEYCODE_KP5:
-		_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
-		_vm->_lucerna->showrw();
-		if (_vm->_gyro->demo)
-			_vm->_basher->get_demorec();
-		return;
-	case Common::KEYCODE_BACKSPACE:
-		_vm->_parser->handleBackspace();
-		break;
-	case Common::KEYCODE_RETURN:
-		_vm->_parser->handleReturn();
-		break;
-	}
-
 	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
 		_vm->_parser->handleInputText(event);
+	else
+		switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
+		case Common::KEYCODE_KP8:
+			event.kbd.keycode = Common::KEYCODE_UP;
+			break;
+		case Common::KEYCODE_KP2:
+			event.kbd.keycode = Common::KEYCODE_DOWN;
+			break;
+		case Common::KEYCODE_KP6:
+			event.kbd.keycode = Common::KEYCODE_RIGHT;
+			break;
+		case Common::KEYCODE_KP4:
+			event.kbd.keycode = Common::KEYCODE_LEFT;
+			break;
+		case Common::KEYCODE_KP9:
+			event.kbd.keycode = Common::KEYCODE_PAGEUP;
+			break;
+		case Common::KEYCODE_KP3:
+			event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
+			break;
+		case Common::KEYCODE_KP7:
+			event.kbd.keycode = Common::KEYCODE_HOME;
+			break;
+		case Common::KEYCODE_KP1:
+			event.kbd.keycode = Common::KEYCODE_END;
+			break;
+		}
+
+		switch (event.kbd.keycode) {
+		case Common::KEYCODE_UP:
+		case Common::KEYCODE_DOWN:
+		case Common::KEYCODE_RIGHT:
+		case Common::KEYCODE_LEFT:
+		case Common::KEYCODE_PAGEUP:
+		case Common::KEYCODE_PAGEDOWN:
+		case Common::KEYCODE_HOME:
+		case Common::KEYCODE_END:
+		case Common::KEYCODE_KP5:
+			if (_vm->_gyro->alive) {
+				_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
+				_vm->_lucerna->showrw();
+				if (_vm->_gyro->demo)
+					_vm->_basher->get_demorec();
+				return;
+			}
+		case Common::KEYCODE_BACKSPACE:
+			_vm->_parser->handleBackspace();
+			break;
+		case Common::KEYCODE_RETURN:
+			_vm->_parser->handleReturn();
+			break;
+		}
 
 	_vm->_lucerna->showrw();
 	 if (_vm->_gyro->demo)
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 29f93c7..b78c8ce 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1127,16 +1127,19 @@ void Lucerna::gameover() {
 
 	_vm->_gyro->dna.user_moves_avvy = false;
 
-	sx = _vm->_trip->tr[1].x;
-	sy = _vm->_trip->tr[1].y;
+	sx = _vm->_trip->tr[0].x;
+	sy = _vm->_trip->tr[0].y;
 	
-	_vm->_trip->tr[1].done();
-	_vm->_trip->tr[1].init(12, true, _vm->_trip);       /* 12 = Avalot falls */
-	_vm->_trip->tr[1].step = 0;
-	_vm->_trip->tr[1].appear(sx, sy, 0);
+	_vm->_trip->tr[0].done();
+	_vm->_trip->tr[0].init(12, true, _vm->_trip);       /* 12 = Avalot falls */
+	_vm->_trip->tr[0].step = 0;
+	_vm->_trip->tr[0].appear(sx, sy, 0);
 	
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
+
 	/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
+	warning("STUB: Timeout::avalot_falls()");
+
 	_vm->_gyro->alive = false;
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8cf0fff..6b21a99 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -329,6 +329,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	blockread(f, mem[0xa000 * st + (fv * 80)], xl);
 	}
 	bit = getpixel(0, 0);*/
+
 	warning("STUB: Scrolls::block_drop()");
 
 	f.close();
@@ -360,7 +361,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	if ((1 <= use_icon) && (use_icon <= 34))
 		lx += halficonwidth;
-	
 
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
@@ -377,9 +377,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
-	/*_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
-	_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly, lightgray);
-	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);*/
 
 	/*setfillstyle(1, 8);
 	pieslice(mx - lx - 31, my - ly, 360, 180, 15);
@@ -390,10 +387,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
-	/*_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
-	_vm->_graphics->drawBar(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7, red);
-	_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx - lx - 14, my + ly, red);
-	_vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);*/
 
 	ex = mx - lx;
 	ey = my - ly;
@@ -425,29 +418,30 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 
 	for (b = 0; b <= _vm->_gyro->scrolln; b++) {
-		switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
-		case kControlCenter: {
-			centre = true;
-			_vm->_gyro->scroll[b].deleteLastChar();
-			}
-			break;
-		case kControlLeftJustified: {
-			centre = false;
-			_vm->_gyro->scroll[b].deleteLastChar();
-			}
-			break;
-		case kControlQuestion: {
-			//settextjustify(1, 1);
-			dix = mx + lx;
-			diy = my + ly;
-			_vm->_gyro->scroll[b].setChar(' ', 0);
-			groi = *_vm->_graphics->getPixel(0, 0);
-			// inc(diy,14);
-			_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
-			_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+		if (!_vm->_gyro->scroll[b].empty())
+			switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
+			case kControlCenter: {
+				centre = true;
+				_vm->_gyro->scroll[b].deleteLastChar();
+				}
+				break;
+			case kControlLeftJustified: {
+				centre = false;
+				_vm->_gyro->scroll[b].deleteLastChar();
+				}
+				break;
+			case kControlQuestion: {
+				//settextjustify(1, 1);
+				dix = mx + lx;
+				diy = my + ly;
+				_vm->_gyro->scroll[b].setChar(' ', 0);
+				groi = *_vm->_graphics->getPixel(0, 0);
+				// inc(diy,14);
+				_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
+				_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+				}
+				break;
 			}
-			break;
-		}
 
 		if (centre)
 			say(320 - _vm->_gyro->scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->scroll[b]);
@@ -586,9 +580,9 @@ void Scrolls::calldrivers() {
 			if (_vm->_gyro->buffer[fv] == kControlRegister)
 				param = 0;
 			else
-				if (('0' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < '9'))
+				if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
 					param = _vm->_gyro->buffer[fv] - 48;
-				else if (('A' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < 'Z'))
+				else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
 					param = _vm->_gyro->buffer[fv] - 55;
 
 			mouthnext = false;
@@ -748,7 +742,8 @@ void Scrolls::calldrivers() {
 				mouthnext = true;
 				break;
 			case kControlInsertSpaces:
-				for (nn = 0; nn < 9; nn++) _vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + ' ';
+				for (nn = 0; nn < 9; nn++)
+					_vm->_gyro->scroll[_vm->_gyro->scrolln] += ' ';
 				break;
 			default: { // Add new char.
 				if (_vm->_gyro->scroll[_vm->_gyro->scrolln].size() == 50) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index e23114d..692d732 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -625,11 +625,13 @@ void Timeout::winning() {
 }
 
 void Timeout::avalot_falls() {
-	if (_vm->_trip->tr[1].step < 5) {
-		_vm->_trip->tr[1].step += 1;
+	if (_vm->_trip->tr[0].step < 5) {
+		_vm->_trip->tr[0].step += 1;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
 	} else
-		_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+		//_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+
+	warning("STUB: Timeout::avalot_falls()");
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 26530a5..dcdd807 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -426,13 +426,14 @@ triptype *triptype::done() {
 	uint16 soa;
 
 	/*  nds:=num div seq;*/
+	totalnum--;
 	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
 		_info.xw += 1;
-	for (aa = 1; aa <= /*nds*seq*/ a.num; aa++) {
+	for (aa = 0; aa < /*nds*seq*/ a.num; aa++) {
 		totalnum--;
-		free(_info.mani[totalnum]);
-		free(_info.sil[totalnum]); /* <<- Width of a siltype. */
+		delete _info.mani[totalnum];
+		delete _info.sil[totalnum];
 	}
 
 	quick = false;


Commit: 84aac3e49beeeda18a9d08e485e97bf25a961708
    https://github.com/scummvm/scummvm/commit/84aac3e49beeeda18a9d08e485e97bf25a961708
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T01:37:59-07:00

Commit Message:
AVALANCHE: Rework Scrolls::normscroll().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 6b21a99..5087232 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -169,11 +169,11 @@ void Scrolls::normscroll() {
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
 	_vm->_graphics->refreshScreen();
 
 	Common::Event event;
-	while (true) {
+	while (!_vm->shouldQuit()) {
 		_vm->getEvent(event);
 		if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS)))
 			break;


Commit: 84bf0984b0fc7f2bd18d5f233a001ba311369bd5
    https://github.com/scummvm/scummvm/commit/84bf0984b0fc7f2bd18d5f233a001ba311369bd5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T14:51:12-07:00

Commit Message:
AVALANCHE: Introduce Graphics::drawArc(), use it in Scrolls::drawscroll().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 2c266e9..158440b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
+#include "math.h"
+
 #include "avalanche/avalanche.h"
 #include "avalanche/graphics.h"
 
@@ -117,6 +119,88 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 			}
 }
 
+void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+	const double pi = 3.14;
+	const double convfac = pi / 180.0;
+
+	int32 xRadius = radius;
+	int32 yRadius = radius * kScreenWidth / (8 * kScreenHeight); // Just don't ask why...
+
+	if (xRadius == 0)
+		xRadius ++;
+	if (yRadius == 0)
+		yRadius ++;
+
+	/* check for an ellipse with negligable x and y radius */
+	if ((xRadius <= 1) && (yRadius <= 1)) 
+	{
+		*(byte *)_scrolls.getBasePtr(x,y) = color;
+		return;
+	}
+
+	/* check if valid angles */
+	stAngle = stAngle % 361;
+	endAngle = endAngle % 361;
+
+	/* if impossible angles then swap them! */
+	if (endAngle < stAngle) 
+	{
+		uint16 tmpAngle=endAngle;
+		endAngle=stAngle;
+		stAngle=tmpAngle;
+	}
+
+	/* approximate the number of pixels required by using the circumference */
+	/* equation of an ellipse.                                              */
+	uint16 numOfPixels=floor(sqrt(3.0)*sqrt(pow(float(xRadius), 2)+pow(float(yRadius), 2)) + 0.5);
+
+	/* Calculate the angle precision required */
+	double delta = 90.0 / numOfPixels;
+
+	/* Always just go over the first 90 degrees. Could be optimized a   */
+	/* bit if startAngle and endAngle lie in the same quadrant, left as an */
+	/* exercise for the reader :) (JM)                                  */
+	double j = 0;
+
+	/* calculate stop position, go 1 further than 90 because otherwise */
+	/* 1 pixel is sometimes not drawn (JM)                             */
+	uint16 deltaEnd = 91;
+
+	/* Calculate points */
+	int16 xNext = xRadius;
+	int16 yNext = 0;
+	do {
+		int16 xTemp = xNext;
+		int16 yTemp = yNext;
+		/* this is used by both sin and cos */
+		double tempTerm = (j+delta)*convfac;
+		/* Calculate points */
+		xNext = floor(xRadius*cos(tempTerm) + 0.5);
+		yNext = floor(yRadius*sin(tempTerm + pi) + 0.5);
+
+		int16 xp = x + xTemp;
+		int16 xm = x - xTemp;
+		int16 yp = y + yTemp;
+		int16 ym = y - yTemp;
+		if ((j >= stAngle) && (j <= endAngle)) 
+			*(byte *)_scrolls.getBasePtr(xp,yp) = color;
+		
+		if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
+			*(byte *)_scrolls.getBasePtr(xm,yp) = color;
+		
+		if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
+			*(byte *)_scrolls.getBasePtr(xm,ym) = color;
+		
+		if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
+			*(byte *)_scrolls.getBasePtr(xp,ym) = color;
+		
+		j += delta;
+	} while (j <= deltaEnd);
+}
+
+
+
+
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 13c6001..56300f4 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -87,6 +87,9 @@ public:
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
+	void drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
+
 
 	// The caller has to .free() the returned Surfaces!!!
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 5087232..eeb9b4d 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -373,7 +373,9 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	setcolor(4);
 	arc(mx + lx, my - ly, 360, 90, 15);
 	arc(mx + lx, my + ly, 270, 360, 15);*/
-
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my - ly, 0, 90, 15, red);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my + ly, 270, 360, 15, red);
+	
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);


Commit: c182d28b02c25ce69547ef12db56a9f72c82bcc5
    https://github.com/scummvm/scummvm/commit/c182d28b02c25ce69547ef12db56a9f72c82bcc5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T15:57:10-07:00

Commit Message:
AVALANCHE: Introduce Graphics::drawPieSlice(), use it in Scrolls::drawscroll().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 158440b..7870f1d 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -198,6 +198,11 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
 	} while (j <= deltaEnd);
 }
 
+void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+	while (radius > 0)
+		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
+	//*(byte *)surface.getBasePtr(x + 1, y) = color;
+}
 
 
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 56300f4..c304932 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -90,6 +90,8 @@ public:
 	void drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 
+	void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+
 
 	// The caller has to .free() the returned Surfaces!!!
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index eeb9b4d..36626ca 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -365,26 +365,27 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	_vm->_gyro->off();
-	/* mblit(mx-lx-46,my-ly-6,mx+lx+15,my+ly+6,0,3);*/
-	/*setfillstyle(1, 7);
-	setcolor(7);
-	pieslice(mx + lx, my - ly, 360, 90, 15);
-	pieslice(mx + lx, my + ly, 270, 360, 15);
-	setcolor(4);
-	arc(mx + lx, my - ly, 360, 90, 15);
-	arc(mx + lx, my + ly, 270, 360, 15);*/
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my - ly, 0, 90, 15, red);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my + ly, 270, 360, 15, red);
+
+	// The right corners of the scroll.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my - ly, 0, 90, 15, lightgray);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my + ly, 270, 360, 15, lightgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, red);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, red);
 	
+	// The body of the scroll.
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
 
-	/*setfillstyle(1, 8);
-	pieslice(mx - lx - 31, my - ly, 360, 180, 15);
-	pieslice(mx - lx - 31, my + ly, 180, 360, 15);
-	setfillstyle(1, 4);*/
+	// The left corners of the scroll.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, darkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, red);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, red);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, darkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, red);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, red);
 
+	// The rear borders of the scroll.
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), red);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
@@ -394,7 +395,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	ey = my - ly;
 	mx -= lx;
 	my -= ly + 2;
-	//setcolor(0);
+	
 	centre = false;
 
 	switch (use_icon) {


Commit: 59ff20b32cdfb4d1ac2f112472ebb79048188c5b
    https://github.com/scummvm/scummvm/commit/59ff20b32cdfb4d1ac2f112472ebb79048188c5b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T18:59:29-07:00

Commit Message:
AVALANCHE: Implement the clock in Lucerna, upgrade Graphics::drawArc() to work in synergy with that.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 7870f1d..9e772d3 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -119,7 +119,8 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 			}
 }
 
-void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+	Common::Point endPoint;
 	const double pi = 3.14;
 	const double convfac = pi / 180.0;
 
@@ -134,8 +135,10 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
 	/* check for an ellipse with negligable x and y radius */
 	if ((xRadius <= 1) && (yRadius <= 1)) 
 	{
-		*(byte *)_scrolls.getBasePtr(x,y) = color;
-		return;
+		*(byte *)_scrolls.getBasePtr(x, y) = color;
+		endPoint.x = x;
+		endPoint.y = y;
+		return endPoint;
 	}
 
 	/* check if valid angles */
@@ -152,7 +155,7 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
 
 	/* approximate the number of pixels required by using the circumference */
 	/* equation of an ellipse.                                              */
-	uint16 numOfPixels=floor(sqrt(3.0)*sqrt(pow(float(xRadius), 2)+pow(float(yRadius), 2)) + 0.5);
+	uint16 numOfPixels=floor(sqrt(3.0)*sqrt(pow(double(xRadius), 2)+pow(double(yRadius), 2)) + 0.5);
 
 	/* Calculate the angle precision required */
 	double delta = 90.0 / numOfPixels;
@@ -166,6 +169,11 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
 	/* 1 pixel is sometimes not drawn (JM)                             */
 	uint16 deltaEnd = 91;
 
+	// Set the end point.
+	double tempTerm = endAngle * convfac;
+	endPoint.x = floor(xRadius * cos(tempTerm) + 0.5) + x;
+	endPoint.y = floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
+
 	/* Calculate points */
 	int16 xNext = xRadius;
 	int16 yNext = 0;
@@ -196,6 +204,8 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
 		
 		j += delta;
 	} while (j <= deltaEnd);
+
+	return endPoint;
 }
 
 void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index c304932..ce4218e 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -31,6 +31,7 @@
 #include "common/file.h"
 
 #include "graphics/surface.h"
+#include "common/rect.h"
 
 namespace Avalanche {
 class AvalancheEngine;
@@ -87,8 +88,9 @@ public:
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
-	void drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	Common::Point drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
+	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
 
 	void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index b78c8ce..740fa8c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1082,24 +1082,77 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 
 
 
-void Lucerna::calchand(uint16 ang, uint16 length, /*arccoordstype &a,*/ byte c) {
-	warning("STUB: Lucerna::calchand()");
+void Lucerna::calchand(uint16 ang, uint16 length, Common::Point &a, byte c) {
+	if (ang > 900) {
+		a.x = 177;
+		return;
+	}
+
+	a = _vm->_graphics->drawArc(_vm->_graphics->_surface, xm, ym, 449 - ang, 450 - ang, length, c);
 }
 
-void Lucerna::hand(/*arccoordstype a,*/ byte c) {
-	warning("STUB: Lucerna::hand()");
+void Lucerna::hand(const Common::Point &a, byte c) {
+	if (a.x == 177)
+		return;
+
+	_vm->_graphics->_surface.drawLine(xm, ym, a.x, a.y, c);
 }
 
-void Lucerna::chime() {
-	warning("STUB: Lucerna::chime()");
+void Lucerna::refresh_hands() {
+	const bytefield clockspace = {61, 166, 66, 200};
+
+	for (byte page_ = 0; page_ < 2; page_++)
+		_vm->_trip->getset[page_].remember(clockspace);
 }
 
 void Lucerna::plothands() {
-	warning("STUB: Lucerna::plothands()");
+	/*   off;*/
+	//setactivepage(3);
+	calchand(_vm->_gyro->onh, 14, ah, yellow);
+	calchand(_vm->_gyro->om * 6, 17, am, yellow);
+	hand(ah, brown);
+	hand(am, brown);
+
+	calchand(nh, 14, ah, brown);
+	calchand(_vm->_gyro->m * 6, 17, am, brown);
+	hand(ah, yellow);
+	hand(am, yellow);
+
+	//setactivepage(1 - cp);
+
+	refresh_hands();
+
+	/*   on;*/
+}
+
+void Lucerna::chime() {
+	warning("STUB: Lucerna::chime()");
 }
 
 void Lucerna::clock_lucerna() {
-	warning("STUB: Lucerna::clock_lucerna()");
+	/* ...Clock. */
+	TimeDate t;
+	_vm->_system->getTimeAndDate(t);
+	_vm->_gyro->h = t.tm_hour;
+	_vm->_gyro->m = t.tm_min;
+	_vm->_gyro->s = t.tm_sec;
+
+	nh = (_vm->_gyro->h % 12) * 30 + _vm->_gyro->m / 2;
+
+	if (_vm->_gyro->oh != _vm->_gyro->h)  {
+		plothands();
+		chime();
+	}
+
+	if (_vm->_gyro->om != _vm->_gyro->m)
+		plothands();
+
+	if ((_vm->_gyro->h == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
+		_vm->_scrolls->display(Common::String("Good morning!") + 13 + 13 + "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
+	
+	_vm->_gyro->oh = _vm->_gyro->h;
+	_vm->_gyro->onh = nh;
+	_vm->_gyro->om = _vm->_gyro->m;
 }
 
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index efb45e2..f0ecf2b 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -125,7 +125,7 @@ private:
 	//Clock
 	static const int16 xm = 510;
 	static const int16 ym = 183;
-	//arccoordstype ah, am; http://www.freepascal.org/docs-html/rtl/graph/arccoordstype.html
+	Common::Point ah, am;
 	uint16 nh;
 
 
@@ -159,11 +159,11 @@ private:
 	void fadein(byte n);
 
 	// clock_lucerna
-	void calchand(uint16 ang, uint16 length,/* arccoordstype &a,*/ byte c);
-	void hand(/*arccoordstype a,*/ byte c);
-	void chime();
+	void calchand(uint16 ang, uint16 length, Common::Point &a, byte c);
+	void hand(const Common::Point &a, byte c);
 	void refresh_hands();
 	void plothands();
+	void chime();
 
 };
 


Commit: 44ec5b68b5e1e2de4d8565654b6f2e870f7a8df3
    https://github.com/scummvm/scummvm/commit/44ec5b68b5e1e2de4d8565654b6f2e870f7a8df3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-07T19:05:27-07:00

Commit Message:
AVALANCHE: Repair Graphics::drawArc(), update Scrolls::drawscroll() accordingly.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9e772d3..6a8b2ab 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -211,7 +211,7 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
 	while (radius > 0)
 		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
-	//*(byte *)surface.getBasePtr(x + 1, y) = color;
+	*(byte *)surface.getBasePtr(x + 1, y) = color;
 }
 
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 36626ca..e7c6eb0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -367,8 +367,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_gyro->off();
 
 	// The right corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my - ly, 0, 90, 15, lightgray);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my + ly, 270, 360, 15, lightgray);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, lightgray);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, lightgray);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, red);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, red);
 	


Commit: ae2d657dc6119b7804a9e63032a1990248b70f56
    https://github.com/scummvm/scummvm/commit/ae2d657dc6119b7804a9e63032a1990248b70f56
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-08T03:24:37-07:00

Commit Message:
AVALANCHE: Update comments connected to Graphics::drawArc().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 6a8b2ab..0042631 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -132,7 +132,7 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 	if (yRadius == 0)
 		yRadius ++;
 
-	/* check for an ellipse with negligable x and y radius */
+	// Check for an ellipse with negligable x and y radius.
 	if ((xRadius <= 1) && (yRadius <= 1)) 
 	{
 		*(byte *)_scrolls.getBasePtr(x, y) = color;
@@ -141,11 +141,11 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 		return endPoint;
 	}
 
-	/* check if valid angles */
+	// Check if valid angles.
 	stAngle = stAngle % 361;
 	endAngle = endAngle % 361;
 
-	/* if impossible angles then swap them! */
+	// If impossible angles, then swap them! 
 	if (endAngle < stAngle) 
 	{
 		uint16 tmpAngle=endAngle;
@@ -153,20 +153,18 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 		stAngle=tmpAngle;
 	}
 
-	/* approximate the number of pixels required by using the circumference */
-	/* equation of an ellipse.                                              */
+	// Approximate the number of pixels required by using the circumference equation of an ellipse.                                              
 	uint16 numOfPixels=floor(sqrt(3.0)*sqrt(pow(double(xRadius), 2)+pow(double(yRadius), 2)) + 0.5);
 
-	/* Calculate the angle precision required */
+	// Calculate the angle precision required.
 	double delta = 90.0 / numOfPixels;
 
-	/* Always just go over the first 90 degrees. Could be optimized a   */
-	/* bit if startAngle and endAngle lie in the same quadrant, left as an */
-	/* exercise for the reader :) (JM)                                  */
+	// Always just go over the first 90 degrees. Could be optimized a   
+	// bit if startAngle and endAngle lie in the same quadrant, left as an 
+	// exercise for the reader. :)                             
 	double j = 0;
 
-	/* calculate stop position, go 1 further than 90 because otherwise */
-	/* 1 pixel is sometimes not drawn (JM)                             */
+	// Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn.                            
 	uint16 deltaEnd = 91;
 
 	// Set the end point.
@@ -174,15 +172,15 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 	endPoint.x = floor(xRadius * cos(tempTerm) + 0.5) + x;
 	endPoint.y = floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
 
-	/* Calculate points */
+	// Calculate points. 
 	int16 xNext = xRadius;
 	int16 yNext = 0;
 	do {
 		int16 xTemp = xNext;
 		int16 yTemp = yNext;
-		/* this is used by both sin and cos */
+		// This is used by both sin and cos.
 		double tempTerm = (j+delta)*convfac;
-		/* Calculate points */
+		
 		xNext = floor(xRadius*cos(tempTerm) + 0.5);
 		yNext = floor(yRadius*sin(tempTerm + pi) + 0.5);
 
@@ -190,16 +188,14 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 		int16 xm = x - xTemp;
 		int16 yp = y + yTemp;
 		int16 ym = y - yTemp;
+
 		if ((j >= stAngle) && (j <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xp,yp) = color;
-		
-		if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
+		else if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xm,yp) = color;
-		
-		if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
+		else if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xm,ym) = color;
-		
-		if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
+		else if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xp,ym) = color;
 		
 		j += delta;
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ce4218e..e371651 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -91,6 +91,7 @@ public:
 	Common::Point drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
+	// TODO: Make it more accurate later.
 
 	void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 


Commit: ad199c4929c9e0e3a3be9097b21338d3617c6f1b
    https://github.com/scummvm/scummvm/commit/ad199c4929c9e0e3a3be9097b21338d3617c6f1b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-08T12:40:41-07:00

Commit Message:
AVALANCHE: Repair Graphics::drawArc().

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0042631..c7774ed 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -191,11 +191,14 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 
 		if ((j >= stAngle) && (j <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xp,yp) = color;
-		else if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
+
+		if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xm,yp) = color;
-		else if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
+
+		if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xm,ym) = color;
-		else if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
+
+		if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
 			*(byte *)_scrolls.getBasePtr(xp,ym) = color;
 		
 		j += delta;


Commit: 626d8aa8c14f09fc735a50a368fe76130a0e1e87
    https://github.com/scummvm/scummvm/commit/626d8aa8c14f09fc735a50a368fe76130a0e1e87
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-08T18:02:28-07:00

Commit Message:
AVALANCHE: Implement switching between rooms (Trip::fliproom(), Lucerna::enterroom()),  implement drawing multiple sprites to the screen (Trip::call_andexors()).

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index c7774ed..d6e1eac 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -97,8 +97,6 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	drawPicture(_background, 0, 10); // TODO: Remove it later, implement otherwise!!! Now it only works with one sprite on the screen.
-
 	/* First we make the pixels of the spirte blank. */
 	for (byte qay = 0; qay < sprite.yl; qay++)
 		for (byte qax = 0; qax < sprite.xl; qax++)
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 740fa8c..a35cc12 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -103,11 +103,9 @@ void Lucerna::draw_also_lines() {
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 161), 15);
 
-	for (ff = 0; ff < 50; ff++) {
-		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/) {
+	for (ff = 0; ff < 50; ff++)
+		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/)
 			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
-		}
-	}
 
 	switch (squeaky_code) {
 	case 1 :
@@ -434,14 +432,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
 				_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
-				_vm->_trip->tr[2].init(8, false, _vm->_trip); /* load Crapulus */
+				_vm->_trip->tr[1].init(8, false, _vm->_trip); /* load Crapulus */
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
-					_vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
-					_vm->_trip->tr[2].walkto(5); /* Walks up to greet you. */
+					_vm->_trip->apped(1, 3); /* Start on the right-hand side of the screen. */
+					_vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
 				} else {
-					_vm->_trip->apped(2, 5); /* Starts where he was before. */
-					_vm->_trip->tr[2].face = 3;
+					_vm->_trip->apped(1, 4); /* Starts where he was before. */
+					_vm->_trip->tr[1].face = 3;
 				}
 
 				_vm->_trip->tr[2].call_eachstep = true;
@@ -450,9 +448,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
 
 			if (_vm->_gyro->dna.crapulus_will_tell) {
-				_vm->_trip->tr[2].init(8, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[2].walkto(4);
+				_vm->_trip->tr[1].init(8, false, _vm->_trip);
+				_vm->_trip->apped(1, 1);
+				_vm->_trip->tr[1].walkto(3);
 				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
 				_vm->_gyro->dna.crapulus_will_tell = false;
 			}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index dcdd807..510d6e5 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -219,7 +219,7 @@ void triptype::walk() {
 		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl) - 1;
 		// -1  is becouse the modified array indexes of magics[] compared to Pascal .
 
-		if ((tc != 0) & (!_tr->_vm->_gyro->doing_sprite_run)) {
+		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
 			switch (_tr->_vm->_gyro->magics[tc].op) {
 			case _tr->_vm->_gyro->exclaim: {
 				bounce();
@@ -1358,7 +1358,7 @@ void Trip::call_andexors() {
 	do {
 		ok = true;
 		for (fv = 0; fv < 4; fv++) {
-			if (((order[fv] != 0) && (order[fv + 1] != 0))
+			if (((order[fv] != -1) && (order[fv + 1] != -1))
 					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
 				/* Swap them! */
 				temp = order[fv];
@@ -1369,6 +1369,17 @@ void Trip::call_andexors() {
 		}
 	} while (!ok);
 
+	// We redraw the background only if we have at least one moving character.
+	bool drawBG = false;
+	for (fv = 0; fv < 5; fv++) {
+		if (order[fv] > -1) {
+			drawBG = true;
+			break;
+		}
+	}
+	if (drawBG)
+		_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
+
 	for (fv = 0; fv < 5; fv++) {
 		if (order[fv] > -1)
 			tr[order[fv]].andexor();
@@ -1560,8 +1571,8 @@ void Trip::fliproom(byte room, byte ped) {
 
 	if (!_vm->_gyro->alive) {
 		/* You can't leave the room if you're dead. */
-		tr[1].ix = 0;
-		tr[1].iy = 0; /* Stop him from moving. */
+		tr[0].ix = 0;
+		tr[0].iy = 0; /* Stop him from moving. */
 		return;
 	}
 
@@ -1572,7 +1583,7 @@ void Trip::fliproom(byte room, byte ped) {
 
 	if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) {
 		/* You can't *jump* out of Cardiff Castle! */
-		tr[1].ix = 0;
+		tr[0].ix = 0;
 		return;
 	}
 
@@ -1585,7 +1596,7 @@ void Trip::fliproom(byte room, byte ped) {
 	getsetclear();
 
 
-	for (fv = 2; fv <= numtr; fv++) {
+	for (fv = 1; fv < numtr; fv++) {
 		if (tr[fv].quick)
 			tr[fv].done();
 	} /* Deallocate sprite */
@@ -1594,10 +1605,10 @@ void Trip::fliproom(byte room, byte ped) {
 		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
 
 	_vm->_lucerna->enterroom(room, ped);
-	apped(1, ped);
+	apped(0, ped - 1);
 	_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
-	_vm->_gyro->dna.rw = tr[1].face;
+	_vm->_gyro->dna.rw = tr[0].face;
 	_vm->_lucerna->showrw();
 
 	for (fv = 0; fv <= 1; fv++) {


Commit: 2a6d70cfb81f2e6ba3277c9d18952a1602c3877c
    https://github.com/scummvm/scummvm/commit/2a6d70cfb81f2e6ba3277c9d18952a1602c3877c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-09T03:37:35-07:00

Commit Message:
AVALANCHE: Repair Acci::parse().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d1eeb71..3b9448a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -556,7 +556,7 @@ void Acci::parse() {
 	}
 
 	if (_vm->_gyro->subjnumber == 0) // Still not found.
-		for (fv = 0; fv < thats.size(); fv++)
+		for (fv = 0; fv < thats.size() - 1; fv++)
 			if (thats[fv] == 252) { // The word is "about", or something similar.
 				_vm->_gyro->subjnumber = thats[fv + 1];
 				thats.setChar(0, fv + 1);
@@ -564,7 +564,7 @@ void Acci::parse() {
 			}
 
 	if (_vm->_gyro->subjnumber == 0) // STILL not found! Must be the word after "say".
-		for (fv = 0; fv < thats.size(); fv++)
+		for (fv = 0; fv < thats.size() - 1; fv++)
 			if ((thats[fv] == 7) && (thats[fv + 1] != 0) && !((225 <= thats[fv + 1]) && (thats[fv + 1] <= 229))) {
 				// SAY not followed by a preposition
 				_vm->_gyro->subjnumber = thats[fv + 1];


Commit: 1443d8ce16fb870cddae900e15e0410f8ba085d5
    https://github.com/scummvm/scummvm/commit/1443d8ce16fb870cddae900e15e0410f8ba085d5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-09T04:21:57-07:00

Commit Message:
AVALANCHE: Repair Lucerna::enterroom(), Lucerna::put_geida_at(), broaden Roomnums.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/roomnums.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a35cc12..e996d57 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -388,10 +388,10 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 void Lucerna::put_geida_at(byte whichped, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_trip->tr[2].init(5, false, _vm->_trip); /* load Geida */
-	_vm->_trip->apped(2, whichped);
-	_vm->_trip->tr[2].call_eachstep = true;
-	_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
+	_vm->_trip->tr[1].init(5, false, _vm->_trip); /* load Geida */
+	_vm->_trip->apped(1, whichped);
+	_vm->_trip->tr[1].call_eachstep = true;
+	_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
 }
 
 void Lucerna::enterroom(byte x, byte ped) {
@@ -457,49 +457,49 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 		break;
 
-	/* Need to find out which room is this!
-	 
-	 case r__outsidespludwicks:
+
+	case r__outsidespludwicks:
 		if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->reason_explosion);
 			_vm->_gyro->dna.spludwicks_here = true;
 		}
-		break;*/
+		break;
 
 	case r__spludwicks:
 		if (_vm->_gyro->dna.spludwicks_here) {
 			if (ped > 0) {
-				_vm->_trip->tr[2].init(2, false, _vm->_trip); /* load Spludwick */
-				_vm->_trip->apped(2, 2);
-				_vm->_gyro->whereis['\227'] = r__spludwicks;
+				_vm->_trip->tr[1].init(2, false, _vm->_trip); /* load Spludwick */
+				_vm->_trip->apped(1, 1);
+				_vm->_gyro->whereis[1] = r__spludwicks;
 			}
 
 			_vm->_gyro->dna.dogfoodpos = 0;  /* _vm->_gyro->also Spludwick pos. */
 
-			_vm->_trip->tr[2].call_eachstep = true;
-			_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
-		} else _vm->_gyro->whereis['\227'] = r__nowhere;
+			_vm->_trip->tr[1].call_eachstep = true;
+			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
+		} else _vm->_gyro->whereis[1] = r__nowhere;
 		break;
 
 	case r__brummieroad: {
-		if (_vm->_gyro->dna.geida_follows)  put_geida_at(5, ped);
+		if (_vm->_gyro->dna.geida_follows)
+			put_geida_at(4, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
 			_vm->_gyro->magics[lightred].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot*/
-				_vm->_trip->tr[2].call_eachstep = true;
-				_vm->_trip->tr[2].eachstep = _vm->_trip->procfollow_avvy_y;
+				_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot*/
+				_vm->_trip->tr[1].call_eachstep = true;
+				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
 				_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
 
 				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
-					_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
-					_vm->_trip->tr[2].walkto(4); /* ...and he walks up... */
+					_vm->_trip->apped(1, 1); /* He appears on the right of the screen... */
+					_vm->_trip->tr[1].walkto(4); /* ...and he walks up... */
 				} else {
 					/* You've been here before. */
-					_vm->_trip->apped(2, 4); /* He's standing in your way straight away... */
-					_vm->_trip->tr[2].face = _vm->_trip->left;
+					_vm->_trip->apped(1, 3); /* He's standing in your way straight away... */
+					_vm->_trip->tr[1].face = _vm->_trip->left;
 				}
 			}
 		}
@@ -510,10 +510,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 		dnatype &with = _vm->_gyro->dna;
 		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
-			_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
-			_vm->_trip->apped(2, 1);
-			_vm->_trip->tr[2].walkto(2);
-			_vm->_trip->tr[2].vanishifstill = true;
+			_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
+			_vm->_trip->apped(1, 0);
+			_vm->_trip->tr[1].walkto(1);
+			_vm->_trip->tr[1].vanishifstill = true;
 			with.cwytalot_in_herts = true;
 			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
@@ -526,7 +526,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->show_one(3); /* Position of drawbridge */
 			_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
-		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 3, ped); /* load Geida */
+		if (_vm->_gyro->dna.geida_follows)
+			put_geida_at(ped + 2, ped); /* load Geida */
 	}
 	break;
 
@@ -534,9 +535,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.been_tied_up) {
 				/* A welcome party... or maybe not... */
-				_vm->_trip->tr[2].init(6, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[2].walkto(3);
+				_vm->_trip->tr[1].init(6, false, _vm->_trip);
+				_vm->_trip->apped(1, 1);
+				_vm->_trip->tr[1].walkto(2);
 				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
 			}
 		}
@@ -558,19 +559,19 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0)
 			switch (_vm->_gyro->dna.cardiff_things) {
 			case 0 : { /* You've answered NONE of his questions. */
-				_vm->_trip->tr[2].init(9, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[2].walkto(3);
+				_vm->_trip->tr[1].init(9, false, _vm->_trip);
+				_vm->_trip->apped(1, 1);
+				_vm->_trip->tr[1].walkto(2);
 				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
 			}
 			break;
 			case 5 :
-				_vm->_gyro->magics[2].op = _vm->_gyro->nix;
+				_vm->_gyro->magics[1].op = _vm->_gyro->nix;
 				break; /* You've answered ALL his questions. => nothing happens. */
 			default: { /* You've answered SOME of his questions. */
-				_vm->_trip->tr[2].init(9, false, _vm->_trip);
-				_vm->_trip->apped(2, 3);
-				_vm->_trip->tr[2].face = _vm->_trip->right;
+				_vm->_trip->tr[1].init(9, false, _vm->_trip);
+				_vm->_trip->apped(1, 2);
+				_vm->_trip->tr[1].face = _vm->_trip->right;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
@@ -602,15 +603,16 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__lustiesroom: {
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
-		if (_vm->_trip->tr[1].whichsprite == 0) /* Avvy in his normal clothes */
+		if (_vm->_trip->tr[0].whichsprite == 0) /* Avvy in his normal clothes */
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
 		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
 			/* Presumably, Avvy dressed as a monk. */
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
 		if (_vm->_gyro->dna.geida_follows) {
-			put_geida_at(5, ped);
-			if (_vm->_gyro->dna.lustie_is_asleep)  _vm->_celer->show_one(5);
+			put_geida_at(4, ped);
+			if (_vm->_gyro->dna.lustie_is_asleep)
+				_vm->_celer->show_one(5);
 		}
 	}
 	break;
@@ -652,23 +654,23 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__wisewomans: {
-		_vm->_trip->tr[2].init(11, false, _vm->_trip);
+		_vm->_trip->tr[1].init(11, false, _vm->_trip);
 		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_trip->apped(2, 2); /* Start on the right-hand side of the screen. */
-			_vm->_trip->tr[2].walkto(4); /* Walks up to greet you. */
+			_vm->_trip->apped(1, 1); /* Start on the right-hand side of the screen. */
+			_vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
 		} else {
-			_vm->_trip->apped(2, 4); /* Starts where she was before. */
-			_vm->_trip->tr[2].face = 3;
+			_vm->_trip->apped(1, 3); /* Starts where she was before. */
+			_vm->_trip->tr[1].face = 3;
 		}
 
-		_vm->_trip->tr[2].call_eachstep = true;
-		_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* She always faces Avvy. */
+		_vm->_trip->tr[1].call_eachstep = true;
+		_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; /* She always faces Avvy. */
 	}
 	break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
-			_vm->_trip->tr[2].init(10, false, _vm->_trip); /* Define the dart. */
+			_vm->_trip->tr[1].init(10, false, _vm->_trip); /* Define the dart. */
 			_vm->_sequence->first_show(1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
 				_vm->_sequence->then_show(3);
@@ -711,16 +713,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break; /* Ayles awake. */
 
 	case r__geidas:
-		put_geida_at(2, ped);
+		put_geida_at(1, ped);
 		break; /* load Geida */
 
 	case r__easthall:
 	case r__westhall:
-		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 2, ped);
+		if (_vm->_gyro->dna.geida_follows)
+			put_geida_at(ped + 1, ped);
 		break;
 
 	case r__lusties:
-		if (_vm->_gyro->dna.geida_follows)  put_geida_at(ped + 6, ped);
+		if (_vm->_gyro->dna.geida_follows)
+			put_geida_at(ped + 5, ped);
 		break;
 
 	case r__nottspub: {
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index 3c5ee49..9d31777 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -35,6 +35,7 @@ namespace Avalanche {
 const byte r__nowhere = 0;
 const byte r__yours = 1;
 const byte r__outsideyours = 2;
+const byte r__outsidespludwicks = 3;
 /*{ a corridor in your castle. = 3 }
 { outside your castle = 5; }*/
 const byte r__musicroom = 7;


Commit: 288abffafa889de25766f6c12c74a6d613c3b3bc
    https://github.com/scummvm/scummvm/commit/288abffafa889de25766f6c12c74a6d613c3b3bc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-09T06:42:10-07:00

Commit Message:
AVALANCHE: Repair Visa::unskrimble() and Scrolls::calldrivers().

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/roomnums.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 7573581..854b5df 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -543,7 +543,7 @@ public:
 	byte cp, ledstatus, defaultled;
 	raw characters;
 	bool alive;
-	char buffer[2000];
+	byte buffer[2000];
 	uint16 bufsize;
 
 	byte oldjw; /* Old joystick-way */
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index 9d31777..a6cb93b 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -36,8 +36,7 @@ const byte r__nowhere = 0;
 const byte r__yours = 1;
 const byte r__outsideyours = 2;
 const byte r__outsidespludwicks = 3;
-/*{ a corridor in your castle. = 3 }
-{ outside your castle = 5; }*/
+//{ outside your castle = 5; }
 const byte r__musicroom = 7;
 const byte r__outsideargentpub = 9;
 const byte r__argentroad = 10;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index e7c6eb0..556658c 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -265,7 +265,8 @@ void Scrolls::resetscrolldriver() {   /* phew */
 void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little... */
 	byte fv;
 
-	for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna->errorled(); /* ring the bell "x" times */
+	for (fv = 0; fv < _vm->_gyro->scrollbells; fv++)
+		_vm->_lucerna->errorled(); /* ring the bell "x" times */
 }
 
 void Scrolls::dodgem() {     /* This moves the mouse pointer off the scroll so that you can read it. */
@@ -348,8 +349,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_logger->log_epsonroman(); /* Scrolls always START with Roman. */
 
 	lx = 0;
-	ly = (_vm->_gyro->scrolln + 1) * 6;
-	for (b = 0; b <= _vm->_gyro->scrolln; b++) {
+	ly = (_vm->_gyro->scrolln) * 6;
+	for (b = 0; b < _vm->_gyro->scrolln; b++) {
 		ex = _vm->_gyro->scroll[b].size() * 8;
 		if (lx < ex)
 			lx = ex;
@@ -420,7 +421,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	}
 
 
-	for (b = 0; b <= _vm->_gyro->scrolln; b++) {
+	for (b = 0; b < _vm->_gyro->scrolln; b++) {
 		if (!_vm->_gyro->scroll[b].empty())
 			switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
 			case kControlCenter: {
@@ -493,7 +494,7 @@ bool Scrolls::ask(Common::String question) {
 }
 
 void Scrolls::resetscroll() {
-	_vm->_gyro->scrolln = 0;
+	_vm->_gyro->scrolln = 1;
 	for (int j = 0; j < 15; j ++)
 		if (!_vm->_gyro->scroll[j].empty())
 			_vm->_gyro->scroll[j].clear();
@@ -592,7 +593,7 @@ void Scrolls::calldrivers() {
 		} else
 			switch (_vm->_gyro->buffer[fv]) {
 			case kControlParagraph: {
-				if ((_vm->_gyro->scrolln == 0) && (_vm->_gyro->scroll[0].empty()))
+				if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -618,7 +619,7 @@ void Scrolls::calldrivers() {
 				_vm->_gyro->scrollbells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble: {
-				if ((_vm->_gyro->scrolln == 0) && (_vm->_gyro->scroll[0].empty()))
+				if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -727,7 +728,7 @@ void Scrolls::calldrivers() {
 				call_spriterun = false;
 
 				_vm->_gyro->scrolln++;
-				_vm->_gyro->scroll[_vm->_gyro->scrolln] = kControlQuestion;
+				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] = kControlQuestion;
 
 				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
 				if (was_virtual)
@@ -746,14 +747,14 @@ void Scrolls::calldrivers() {
 				break;
 			case kControlInsertSpaces:
 				for (nn = 0; nn < 9; nn++)
-					_vm->_gyro->scroll[_vm->_gyro->scrolln] += ' ';
+					_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += ' ';
 				break;
 			default: { // Add new char.
-				if (_vm->_gyro->scroll[_vm->_gyro->scrolln].size() == 50) {
-					solidify(_vm->_gyro->scrolln);
+				if (_vm->_gyro->scroll[_vm->_gyro->scrolln - 1].size() == 50) {
+					solidify(_vm->_gyro->scrolln - 1);
 					_vm->_gyro->scrolln++;
 				}
-				_vm->_gyro->scroll[_vm->_gyro->scrolln] += _vm->_gyro->buffer[fv];
+				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += _vm->_gyro->buffer[fv];
 				}
 			}
 }
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 692d732..cd6e4dc 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -607,8 +607,8 @@ void Timeout::arkata_shouts() {
 	if (_vm->_gyro->dna.teetotal)
 		return;
 
-	// _vm->_visa->dixi('q', 76);
-	warning("STUB: Timeout::arkata_shouts()");
+	_vm->_visa->dixi('q', 76);
+	
 	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
 }
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index e2f83d6..135ab21 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -50,7 +50,7 @@ bool Visa::report_dixi_errors = true;
 
 void Visa::unskrimble() {
 	for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
-		_vm->_gyro->buffer[fv] = (~(_vm->_gyro->buffer[fv]) - fv + 1) % 256;
+		_vm->_gyro->buffer[fv] = (~(_vm->_gyro->buffer[fv] - (fv + 1))) % 256;
 }
 
 void Visa::do_the_bubble() {


Commit: a41736e698f31364219c8d904342a8fcff8d16d0
    https://github.com/scummvm/scummvm/commit/a41736e698f31364219c8d904342a8fcff8d16d0
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-10T15:21:15-07:00

Commit Message:
AVALANCHE: Introduce Graphics::drawTriangle(), use it in Scrolls::bubble(). Modify Graphics::drawPieSlice(), update functions using it accordingly.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index d6e1eac..aa341f3 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -208,9 +208,46 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
 	while (radius > 0)
 		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
-	*(byte *)surface.getBasePtr(x + 1, y) = color;
 }
 
+void Graphics::drawTriangle(const ::Graphics::Surface &surface, Common::Point *p, byte color) {
+	// Draw the borders with a marking color.
+	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255);
+	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255);
+	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, 255);
+
+	// Get the top and the bottom of the triangle.
+	uint16 maxY = p[0].y, minY = p[0].y;
+	for (byte i = 1; i < 3; i++) {
+		if (p[i].y < minY)
+			minY = p[i].y;
+		if (p[i].y > maxY)
+			maxY = p[i].y;
+	}
+
+	// Fill the triangle.
+	for (uint16 y = minY; y <= maxY; y++) {
+		uint16 x = 0;
+		while (*(byte *)_scrolls.getBasePtr(x, y) != 255)
+			x++;
+		uint16 minX = x;
+		uint16 maxX = x;
+		x++;
+		while ((*(byte *)_scrolls.getBasePtr(x, y) != 255) && (x != 639))
+			x++;
+		if (x != 639)
+			maxX = x;
+		if (minX != maxX)
+			_scrolls.drawLine(minX, y, maxX, y, color);
+	}
+
+	// Redraw the borders with the actual color.
+	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, color);
+	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, color);
+	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
+}
+
+
 
 
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index e371651..787eb6d 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -95,6 +95,9 @@ public:
 
 	void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 
+	void drawTriangle(const ::Graphics::Surface &surface, Common::Point *p, byte color);
+
+
 
 	// The caller has to .free() the returned Surfaces!!!
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 556658c..8a95d44 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -375,8 +375,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	
 	// The body of the scroll.
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), lightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), lightgray);
 
 	// The left corners of the scroll.
 	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, darkgray);
@@ -485,6 +485,101 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 }
 
 void Scrolls::bubble(func2 gotoit) {
+	int16 xl, yl, my, xw, yw;
+	byte fv;
+	Common::Point p[3];
+	byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
+	int16 xc; /* x correction */
+
+	/*setvisualpage(cp);
+	setactivepage(1 - cp);*/
+	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
+	//mousepage(1 - cp); /* Mousepage */
+
+	//setfillstyle(1, talkb);
+	//setcolor(talkb);
+	_vm->_gyro->off();
+
+	xl = 0;
+	yl = _vm->_gyro->scrolln * 5;
+	for (int8 fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+		uint16 textWidth = _vm->_gyro->scroll[fv].size() * 8;
+		if (textWidth > xl)
+			xl = textWidth;
+	}
+	xl = xl / 2;
+
+	xw = xl + 18;
+	yw = yl + 7;
+	my = yw * 2 - 2;
+	xc = 0;
+
+	if ((_vm->_gyro->talkx - xw) < 0)
+		xc = -(_vm->_gyro->talkx - xw);
+	if ((_vm->_gyro->talkx + xw) > 639)
+		xc = 639 - (_vm->_gyro->talkx + xw);
+
+	p[0].x = _vm->_gyro->talkx - 10;
+	p[0].y = yw;
+	p[1].x = _vm->_gyro->talkx + 10;
+	p[1].y = yw;
+	p[2].x = _vm->_gyro->talkx;
+	p[2].y = _vm->_gyro->talky;
+
+	/* mblit(talkx-xw+xc,7,talkx+xw+xc,my,0,3);
+	 mblit(talkx-10,my,talkx+10,talky,0,3);*/
+
+	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
+
+	// The body of the bubble.
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->talkx - xw + 9, 7, _vm->_gyro->talkx + xw - 8 + xc, my + 1), _vm->_gyro->talkb);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->talkx - xw - 1, 12, _vm->_gyro->talkx + xw + xc + 2, my - 4), _vm->_gyro->talkb);
+
+	// Top right corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx + xw - 10, 11, 0, 90, 9, _vm->_gyro->talkb);
+	// Bottom right corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->talkb);
+	// Top left corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx - xw + 10, 11, 90, 180, 9, _vm->_gyro->talkb);
+	// Bottom left corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->talkb);
+
+	// "Tail" of the speech bubble.
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->talkb);
+
+	//setcolor(talkf);
+	yl -= 3;
+	//settextjustify(1, 2);
+	/*for (fv = 0; fv < _vm->_gyro->scrolln; fv++)
+	outtextxy(_vm->_gyro->talkx + xc, (fv * 10) + 12, _vm->_gyro->scroll[fv + 1]);*/
+
+	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) /* These should be separate loops. */
+		_vm->_logger->log_bubbleline(fv, param, _vm->_gyro->scroll[fv]);
+
+	_vm->_logger->log_divider();
+
+	//setvisualpage(1 - cp);
+	dingdongbell();
+	_vm->_gyro->oncandopageswap = false;
+	_vm->_gyro->on();
+	_vm->_gyro->dropsok = false;
+
+	(this->*gotoit)();
+
+	_vm->_gyro->off();
+	_vm->_gyro->dropsok = true;
+	/*mblit((talkx - xw + xc) / 8, 7, 1 + (talkx + xw + xc) / 8, my, 3, 1 - cp);
+	mblit((talkx - 10) / 8, my, 1 + (talkx + 10) / 8, talky, 3, 1 - cp);
+	blitfix();*/
+
+	/*setvisualpage(cp);
+	settextjustify(0, 0);*/
+	_vm->_gyro->on(); /*sink;*/
+	_vm->_gyro->oncandopageswap = true;
+	resetscrolldriver();
+	if (_vm->_gyro->mpress > 0)
+		_vm->_gyro->after_the_scroll = true;
+
 	warning("STUB: Scrolls::bubble()");
 }
 
@@ -629,7 +724,7 @@ void Scrolls::calldrivers() {
 				if (param == 0)
 					natural();
 				else if ((1 <= param) && (param <= 9))
-					if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param].quick)) { // Not valid.
+					if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
 						_vm->_lucerna->errorled();
 						natural();
 					} else
@@ -638,11 +733,11 @@ void Scrolls::calldrivers() {
 					/* Quasi-peds. (This routine performs the same
 					thing with QPs as triptype.chatter does with the
 					sprites.) */
-					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->quasipeds[param].whichped].x;
-					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param].whichped].y; // Position.
+					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].x;
+					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].y; // Position.
 		
-					_vm->_gyro->talkf = _vm->_gyro->quasipeds[param].fgc;
-					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param].bgc; // Colours.
+					_vm->_gyro->talkf = _vm->_gyro->quasipeds[param - 10].fgc;
+					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colours.
 				} else {
 					_vm->_lucerna->errorled(); // Not valid.
 					natural();


Commit: c519ea0aa21e774e5a763cbfe98c78165cfcffbb
    https://github.com/scummvm/scummvm/commit/c519ea0aa21e774e5a763cbfe98c78165cfcffbb
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-10T15:29:48-07:00

Commit Message:
AVALANCHE: Remove unnecessary consts from Graphics.

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index aa341f3..42a36ff 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -117,7 +117,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 			}
 }
 
-Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
 	Common::Point endPoint;
 	const double pi = 3.14;
 	const double convfac = pi / 180.0;
@@ -205,12 +205,12 @@ Common::Point Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int
 	return endPoint;
 }
 
-void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
 	while (radius > 0)
 		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
 }
 
-void Graphics::drawTriangle(const ::Graphics::Surface &surface, Common::Point *p, byte color) {
+void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color) {
 	// Draw the borders with a marking color.
 	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255);
 	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 787eb6d..c4c1e85 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -88,14 +88,14 @@ public:
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 
-	Common::Point drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
 	// TODO: Make it more accurate later.
 
-	void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 
-	void drawTriangle(const ::Graphics::Surface &surface, Common::Point *p, byte color);
+	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color);
 
 
 


Commit: ee6119d07feea83718f7a3ce9073d92de2747750
    https://github.com/scummvm/scummvm/commit/ee6119d07feea83718f7a3ce9073d92de2747750
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-10T17:06:11-07:00

Commit Message:
AVALANCHE: Repair Timeout::lose_timer().

Changed paths:
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index cd6e4dc..4debd16 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -214,11 +214,10 @@ void Timeout::one_tick() {
 void Timeout::lose_timer(byte which) {
 	byte fv;
 
-	for (fv = 1; fv <= 7; fv++) {
-		timetype &with = times[fv];
-		if (with.what_for == which)
-			with.time_left = 0;
-	} /* Cancel this one! */
+	for (fv = 0; fv < 7; fv++) {
+		if (times[fv].what_for == which)
+			times[fv].time_left = 0; // Cancel this one!
+	}
 }
 
 /*function timer_is_on(which:byte):boolean;


Commit: 698dae201a38218de71888bc54326429be79013e
    https://github.com/scummvm/scummvm/commit/698dae201a38218de71888bc54326429be79013e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-11T05:06:15-07:00

Commit Message:
AVALANCHE: Introduce Graphics::drawText(). Rename raw to fontType, move it from Gyro to Graphics. Update the rest of the code using these two. Simplifying underlining of characters in Parser and Dropdown.

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.h
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index bc8414d..89eb231 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -285,28 +285,25 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 	else
 		ander = 170;
 
+	fontType font;
 	for (byte fv = 0; fv < z.size(); fv++)
-		for (byte ff = 0; ff < 8; ff++) {
-			byte pixel = ~(_vm->_gyro->characters[z[fv]][ff] & ander); // Note that it's the bitwise NOT operator!
-			for (byte bit = 0; bit < 8; bit++) {
-				byte pixelBit = (pixel >> bit) & 1;
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + ff) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
-				// We don't have to bother with the planes, since they all have the same value. See the original.
-				// Note that it's the bitwise OR operator!
-			}
-		}
+		for (byte ff = 0; ff < 8; ff++)
+			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander;
 
+	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, black);
+	
+	// Underline the selected character.
 	if (! z.contains(t))
 		return;
 	else {
 		byte fv;
 		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
 	
-		// Similar to the cycle before.
-		byte pixel = ~ ander;
+		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
-			*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = pixelBit | (pixelBit << 1) | (pixelBit << 2);
+			if (pixelBit)
+				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = black;
 		}
 	}
 }
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 42a36ff..4b30f6f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -249,6 +249,19 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 
 
 
+void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, fontType font, byte fontHeight, int16 x, int16 y, byte color) {
+	for (byte i = 0; i < text.size(); i++)
+		for (byte j = 0; j < fontHeight; j++) {
+			byte pixel = font[text[i]][j];
+			for (byte bit = 0; bit < 8; bit++) {
+				byte pixelBit = (pixel >> bit) & 1;
+				if (pixelBit)
+					*(byte *)surface.getBasePtr(x + i * 8 + 7 - bit, y + j) = color;
+			}
+		}
+}
+
+
 
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index c4c1e85..7492141 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -36,6 +36,8 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+typedef byte fontType[256][16]; // raw font type
+
 typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
 // Be aware!!!
 
@@ -99,6 +101,10 @@ public:
 
 
 
+	void drawText(::Graphics::Surface &surface, const Common::String &text, fontType font, byte fontHeight, int16 x, int16 y, byte color);
+
+
+
 	// The caller has to .free() the returned Surfaces!!!
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 854b5df..390011c 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -200,8 +200,6 @@ public:
 	byte col;
 };
 
-typedef byte raw[256][16]; /* raw_font_type */
-
 enum controllers {cjoy, ckey};
 
 typedef Common::String previoustype[20];
@@ -541,7 +539,7 @@ public:
 	Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
 
 	byte cp, ledstatus, defaultled;
-	raw characters;
+	fontType characters;
 	bool alive;
 	byte buffer[2000];
 	uint16 bufsize;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 86f46c1..4ce8249 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -93,16 +93,7 @@ void Parser::plotText() {
 
 	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
 
-	// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
-	for (byte i = 0; i < _vm->_parser->_inputText.size(); i++)
-		for (byte j = 0; j < 8; j++) {
-			byte pixel = _vm->_gyro->characters[_vm->_parser->_inputText[i]][j];
-			for (byte bit = 0; bit < 8; bit++) {
-				byte pixelBit = (pixel >> bit) & 1;
-				if (pixelBit != 0)
-					*_vm->_graphics->getPixel(24 + i * 8 + 7 - bit, 161 + j) = white;
-			}
-		}
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, white);
 
 	cursorOn();
 	_vm->_gyro->super_on();
@@ -134,19 +125,9 @@ int16 Parser::pos(const Common::String &crit, const Common::String &src) {
 }
 
 void Parser::drawCursor() {
-	// Draw the '_' character. Similar to plotText().
-	char cursor = '_';
-
-	for (byte j = 0; j < 8; j++) {
-		byte pixel = _vm->_gyro->characters[cursor][j];
-		for (byte bit = 0; bit < 8; bit++) {
-			byte pixelBit = (pixel >> bit) & 1;
-			if (pixelBit != 0)
-				*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 161 + j) = white;
-		}
-	}
-	
-
+	// Draw the '_' character.
+	for (byte bit = 0; bit < 8; bit++)
+		*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 168) = white;
 
 	bytefield bf;
 	bf.x1 = _inputTextPos + 1;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8a95d44..5aa1cd5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -103,9 +103,10 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-	byte itw[12][80];
+	//byte itw[12][80];
+	Common::String text;
+	fontType itw;
 	byte lz = z.size();
-	byte ox = 0;
 	
 	_vm->_logger->log_scrollline();
 
@@ -123,28 +124,20 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			break;
 		default: {
 			for (byte yy = 0; yy < 12; yy++)
-				itw[yy][ox] = ~ch[cfont][z[xx]][yy + 2];
-			ox++;
+				itw[z[xx]][yy] = ch[cfont][z[xx]][yy + 2];
+
+			text += z[xx];
+			
 			_vm->_logger->log_scrollchar(Common::String(z[xx]));
 			}
 		}
 	}
 
 	bool offset = x % 8 == 4;
-	lz = ox;
 	x = x / 8;
 	y++;
-	// Similar to Dropdown::chalk().
-	for (byte fv = 0; fv < lz; fv++)
-		for (byte ff = 0; ff < 12; ff++) {
-			byte pixel = itw[ff][fv]; 
-			for (byte bit = 0; bit < 8; bit++) {
-				byte pixelBit = (pixel >> bit) & 1;
-				uint16 xa = x * 8 + fv * 8 + 7 - bit + offset * 4;
-				uint16 ya = y + ff;
-				*(byte *)_vm->_graphics->_scrolls.getBasePtr(xa, ya) = pixelBit + (pixelBit << 1) + (pixelBit << 2);
-			}
-		}
+
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, itw, 12, x * 8 + offset *4, y, black);
 }
 
 /* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index b267ff6..8af3402 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -103,7 +103,7 @@ private:
 
 
 	int16 dix, diy;
-	raw ch[2];
+	fontType ch[2];
 	byte cfont; // Current font
 
 	int16 dodgex, dodgey;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 4debd16..459f124 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -212,9 +212,7 @@ void Timeout::one_tick() {
 }
 
 void Timeout::lose_timer(byte which) {
-	byte fv;
-
-	for (fv = 0; fv < 7; fv++) {
+	for (byte fv = 0; fv < 7; fv++) {
 		if (times[fv].what_for == which)
 			times[fv].time_left = 0; // Cancel this one!
 	}


Commit: 6a187a04ee3d1db26109e4aadae4c7da2d52dc52
    https://github.com/scummvm/scummvm/commit/6a187a04ee3d1db26109e4aadae4c7da2d52dc52
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-11T05:59:53-07:00

Commit Message:
AVALANCHE: Finish implementation of Scrolls::bubble().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 5aa1cd5..94266f3 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -103,7 +103,6 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-	//byte itw[12][80];
 	Common::String text;
 	fontType itw;
 	byte lz = z.size();
@@ -137,7 +136,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	x = x / 8;
 	y++;
 
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, itw, 12, x * 8 + offset *4, y, black);
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, itw, 12, x * 8 + offset * 4, y, black);
 }
 
 /* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
@@ -489,8 +488,6 @@ void Scrolls::bubble(func2 gotoit) {
 	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
 	//mousepage(1 - cp); /* Mousepage */
 
-	//setfillstyle(1, talkb);
-	//setcolor(talkb);
 	_vm->_gyro->off();
 
 	xl = 0;
@@ -519,9 +516,6 @@ void Scrolls::bubble(func2 gotoit) {
 	p[2].x = _vm->_gyro->talkx;
 	p[2].y = _vm->_gyro->talky;
 
-	/* mblit(talkx-xw+xc,7,talkx+xw+xc,my,0,3);
-	 mblit(talkx-10,my,talkx+10,talky,0,3);*/
-
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	// The body of the bubble.
@@ -540,11 +534,15 @@ void Scrolls::bubble(func2 gotoit) {
 	// "Tail" of the speech bubble.
 	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->talkb);
 
-	//setcolor(talkf);
+	
 	yl -= 3;
-	//settextjustify(1, 2);
-	/*for (fv = 0; fv < _vm->_gyro->scrolln; fv++)
-	outtextxy(_vm->_gyro->talkx + xc, (fv * 10) + 12, _vm->_gyro->scroll[fv + 1]);*/
+
+	// Draw the text of the bubble.
+	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+		int16 x = _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
+		bool offset = _vm->_gyro->scroll[fv].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 12, (fv * 10) + 12, white);
+	}
 
 	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) /* These should be separate loops. */
 		_vm->_logger->log_bubbleline(fv, param, _vm->_gyro->scroll[fv]);
@@ -561,19 +559,13 @@ void Scrolls::bubble(func2 gotoit) {
 
 	_vm->_gyro->off();
 	_vm->_gyro->dropsok = true;
-	/*mblit((talkx - xw + xc) / 8, 7, 1 + (talkx + xw + xc) / 8, my, 3, 1 - cp);
-	mblit((talkx - 10) / 8, my, 1 + (talkx + 10) / 8, talky, 3, 1 - cp);
-	blitfix();*/
 
 	/*setvisualpage(cp);
-	settextjustify(0, 0);*/
 	_vm->_gyro->on(); /*sink;*/
 	_vm->_gyro->oncandopageswap = true;
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
 		_vm->_gyro->after_the_scroll = true;
-
-	warning("STUB: Scrolls::bubble()");
 }
 
 bool Scrolls::ask(Common::String question) {


Commit: 960c8b26302f4bd09ed5ac632077bfbddaff2a35
    https://github.com/scummvm/scummvm/commit/960c8b26302f4bd09ed5ac632077bfbddaff2a35
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-11T06:06:57-07:00

Commit Message:
AVALANCHE: Improve comments in Scrolls::bubble().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 94266f3..93d942a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -516,6 +516,7 @@ void Scrolls::bubble(func2 gotoit) {
 	p[2].x = _vm->_gyro->talkx;
 	p[2].y = _vm->_gyro->talky;
 
+	// Backup the screen before drawing the bubble.
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	// The body of the bubble.
@@ -537,7 +538,9 @@ void Scrolls::bubble(func2 gotoit) {
 	
 	yl -= 3;
 
-	// Draw the text of the bubble.
+	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
+	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
+	// It's almost the same, only notable differences are '?', '!', etc.
 	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
 		int16 x = _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
 		bool offset = _vm->_gyro->scroll[fv].size() % 2;
@@ -555,6 +558,7 @@ void Scrolls::bubble(func2 gotoit) {
 	_vm->_gyro->on();
 	_vm->_gyro->dropsok = false;
 
+	// This does the actual drawing to the screen.
 	(this->*gotoit)();
 
 	_vm->_gyro->off();


Commit: 14076ad0e9daeac9e29349920d3948d59b5340a9
    https://github.com/scummvm/scummvm/commit/14076ad0e9daeac9e29349920d3948d59b5340a9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-11T13:07:42-07:00

Commit Message:
AVALANCHE: Remove unnecessary comments from Avalot::setup().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3f4c545..d3779cb 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -147,10 +147,8 @@ void Avalot::setup() {
 	_vm->_parser->cursorOn();
 	_vm->_trip->newspeed();
 
-	//if (! _vm->_gyro->reloaded)
-	//	_vm->_visa->dixi('q', 83); /* Info on the game: etc. */
-	//
-	// TODO: UNCOMMENT THIS! ONLY COMMENTED OUT FOR TESTING!!!
+	if (! _vm->_gyro->reloaded)
+		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
 }
 
 


Commit: d8798e978a695a1b6ebd853bd05790d11c5fe4f9
    https://github.com/scummvm/scummvm/commit/d8798e978a695a1b6ebd853bd05790d11c5fe4f9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T03:52:17-07:00

Commit Message:
AVALANCHE: Repair Graphics::drawText() and Scrolls::say().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 4b30f6f..0b3a264 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -252,7 +252,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, fontType font, byte fontHeight, int16 x, int16 y, byte color) {
 	for (byte i = 0; i < text.size(); i++)
 		for (byte j = 0; j < fontHeight; j++) {
-			byte pixel = font[text[i]][j];
+			byte pixel = font[(byte)text[i]][j];	
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit)
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 93d942a..99bef8e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -123,7 +123,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			break;
 		default: {
 			for (byte yy = 0; yy < 12; yy++)
-				itw[z[xx]][yy] = ch[cfont][z[xx]][yy + 2];
+				itw[(byte)z[xx]][yy] = ch[cfont][(byte)z[xx]][yy + 2];
 
 			text += z[xx];
 			
@@ -857,7 +857,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(ch[0][i],16);
+		f.read(ch[0][i], 16);
 	f.close();
 
 	if (!f.open("avitalic.fnt")) {
@@ -865,7 +865,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(ch[1][i],16);
+		f.read(ch[1][i], 16);
 	f.close();
 	
 	if (!f.open("ttsmall.fnt")) {


Commit: caed4470f12db61f0bc11c813186a9066527a94d
    https://github.com/scummvm/scummvm/commit/caed4470f12db61f0bc11c813186a9066527a94d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T04:28:28-07:00

Commit Message:
AVALANCHE: Implement Acci::personshere(), Visa::talkto(), make control-constants in Scrolls public.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 3b9448a..437752b 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -606,9 +606,17 @@ void Acci::examobj() {   /* Examine a standard object-thing */
 	warning("STUB: Acci::examobj()");
 }
 
-bool Acci::personshere() {       /* Person equivalent of "holding" */
-	warning("STUB: Acci::personshere()");
-	return true;
+bool Acci::personshere() { // Person equivalent of "holding".
+	if ((person == pardon) || (person == 0) || (_vm->_gyro->whereis[person] == _vm->_gyro->dna.room))
+		return true;
+	else {
+		if (person < 175)
+			_vm->_scrolls->display(Common::String('H') + _vm->_scrolls->kControlToBuffer);
+		else
+			_vm->_scrolls->display(Common::String("Sh") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->display("e isn't around at the moment.");
+		return false;
+	}
 }
 
 void Acci::exampers() {
@@ -1178,30 +1186,31 @@ void Acci::do_that() {
 		break;
 	case vb_talk:
 		if (person == pardon) {
-			if (_vm->_gyro->subjnumber == 99) /* They typed "say passuint16". */
-				_vm->_scrolls->display("Yes, but what \6is\22 the passuint16?");
-			/*
-			else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
-				Delete(thats, 1, 1);
-				move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
-				verb = chr(subjnumber);
+			if (_vm->_gyro->subjnumber == 99) /* They typed "say password". */
+				_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
+			else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 449)) {
+				thats.deleteChar(0);
+
+				for (byte i = 0; i < 10; i++)
+					realwords[i] = realwords[i + 1];
+				//move(realwords[2], realwords[1], sizeof(realwords) - sizeof(realwords[1]));
+
+				verb = _vm->_gyro->subjnumber;
 				do_that();
 				return;
 			} else {
 				person = _vm->_gyro->subjnumber;
-				subjnumber = 0;
-				if (set::of(pardon, '\0', eos).has(person))
+				_vm->_gyro->subjnumber = 0;
+				if ((person == 0) || (person == pardon))
 					_vm->_scrolls->display("Talk to whom?");
 				else if (personshere())
-					talkto(ord(person));
+					_vm->_visa->talkto(person);
 			}
-			*/
-			else if (person == pardon)
-				_vm->_scrolls->display("Talk to whom?");
-		} else if (personshere())
+		} else if (person == pardon)
+			_vm->_scrolls->display("Talk to whom?");
+		else if (personshere())
 			_vm->_visa->talkto(person);
 		break;
-
 	case vb_give:
 		if (holding()) {
 			if (person == pardon)
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 8af3402..b90f280 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -41,6 +41,27 @@ typedef void (Scrolls::*func2)();
 
 class Scrolls {
 public:
+	// Constants to replace the command characters from Pascal.
+	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
+
+	static const char kControlSpeechBubble = 2; // ^B
+	static const char kControlCenter = 3; // ^C
+	static const char kControlToBuffer = 4; // ^D
+	static const char kControlItalic = 6; // ^F
+	static const char kControlBell = 7; // ^G
+	static const char kControlBackspace = 8; // ^H
+	static const char kControlInsertSpaces = 9; // ^I
+	static const char kControlLeftJustified = 12; // ^L
+	static const char kControlNewLine = 13; // ^M
+	static const char kControlParagraph = 16; // ^P
+	static const char kControlQuestion = 17; // ^Q
+	static const char kControlRoman = 18; // ^R
+	static const char kControlRegister = 19; // ^S
+	static const char kControlNegative = 21; // ^U
+	static const char kControlIcon = 22; // ^V
+
+
+
 	bool aboutscroll; /* Is this the about box? */
 
 
@@ -71,6 +92,8 @@ public:
 
 	void musical_scroll();
 
+	fontType ch[2];
+
 private:
 	AvalancheEngine *_vm;
 
@@ -81,29 +104,8 @@ private:
 
 
 
-	// Constants to replace the command characters from Pascal.
-	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
-	
-	static const char kControlSpeechBubble = 2; // ^B
-	static const char kControlCenter = 3; // ^C
-	static const char kControlToBuffer = 4; // ^D
-	static const char kControlItalic = 6; // ^F
-	static const char kControlBell = 7; // ^G
-	static const char kControlBackspace = 8; // ^H
-	static const char kControlInsertSpaces = 9; // ^I
-	static const char kControlLeftJustified = 12; // ^L
-	static const char kControlNewLine = 13; // ^M
-	static const char kControlParagraph = 16; // ^P
-	static const char kControlQuestion = 17; // ^Q
-	static const char kControlRoman = 18; // ^R
-	static const char kControlRegister = 19; // ^S
-	static const char kControlNegative = 21; // ^U
-	static const char kControlIcon = 22; // ^V
-
-
-
 	int16 dix, diy;
-	fontType ch[2];
+	
 	byte cfont; // Current font
 
 	int16 dodgex, dodgey;
@@ -111,6 +113,8 @@ private:
 
 	byte use_icon;
 
+
+
 	void easteregg();
 
 	void say(int16 x, int16 y, Common::String z);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 135ab21..72e4934 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -164,7 +164,132 @@ void Visa::talkto(byte whom) {
 	byte fv;
 	bool no_matches;
 
-	warning("STUB: Visa::talkto()");
+	if (_vm->_acci->person == _vm->_acci->pardon) {
+		_vm->_acci->person = _vm->_gyro->subjnumber;
+		_vm->_gyro->subjnumber = 0;
+	}
+
+	if (_vm->_gyro->subjnumber == 0)
+		switch (whom) {
+		case _vm->_gyro->pspludwick:
+
+			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion])) {
+				dixi('q', 68);
+				_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
+				_vm->_lucerna->objectlist();
+				_vm->_lucerna->points(3);
+				return;
+			} else {
+				if (_vm->_gyro->dna.talked_to_crapulus)
+					// Spludwick - what does he need?
+					// 0 - let it through to use normal routine.
+					switch (_vm->_gyro->dna.given2spludwick) { 
+					case 1: // Falltrough is intended.
+					case 2:{
+						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+						return;
+						}
+						break;
+					case 3: {
+						dixi('q', 30); // Need any help with the game?
+						return;
+						}
+						break;
+				}
+				else {
+					dixi('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+					return;
+				}
+			}
+			break;
+
+		case _vm->_gyro->pibythneth:
+			if (_vm->_gyro->dna.givenbadgetoiby) {
+				dixi('q', 33); // Thanks a lot!
+				return; // And leave the proc.
+			}
+			break; // Or... just continue, 'cos he hasn't got it.
+		case _vm->_gyro->pdogfood:
+			if (_vm->_gyro->dna.wonnim) { // We've won the game.
+				dixi('q', 6); // "I'm Not Playing!"
+				return; // Zap back.
+			} else
+				_vm->_gyro->dna.asked_dogfood_about_nim = true;
+			break;
+		case _vm->_gyro->payles:
+			if (!_vm->_gyro->dna.ayles_is_awake) {
+				dixi('q', 43); // He's fast asleep!
+				return;
+			} else if (!_vm->_gyro->dna.given_pen_to_ayles) {
+				dixi('q', 44); // Can you get me a pen, Avvy?
+				return;
+			}
+			break;
+
+		case _vm->_gyro->pjacques: {
+			dixi('q', 43);
+			return;
+			}
+		case _vm->_gyro->pgeida:
+			if (_vm->_gyro->dna.geida_given_potion)
+				_vm->_gyro->dna.geida_follows = true;
+			else {
+				dixi('u', 17);
+				return;
+			}
+			break;
+		case _vm->_gyro->pspurge:
+			if (~ _vm->_gyro->dna.sitting_in_pub) {
+				dixi('q', 71); // Try going over and sitting down.
+				return;
+			} else {
+				if (_vm->_gyro->dna.spurge_talk < 5)
+					_vm->_gyro->dna.spurge_talk++;
+				if (_vm->_gyro->dna.spurge_talk > 1) { // no. 1 falls through
+					dixi('q', 70 + _vm->_gyro->dna.spurge_talk);
+					return;
+				}
+			}
+			break;
+	}
+	// On a subject. Is there any reason to block it?
+	else if ((whom == _vm->_gyro->payles) && (!_vm->_gyro->dna.ayles_is_awake)) { 
+			dixi('q', 43); // He's fast asleep!
+			return;
+		}
+
+	if (whom > 149)
+		whom -= 149;
+
+	no_matches = true;
+	for (fv = 0; fv <= _vm->_trip->numtr; fv++)
+		if (_vm->_trip->tr[fv].a.accinum == whom) {
+			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
+			no_matches = false;
+			break;
+		}
+
+	if (no_matches)
+		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
+
+	speech(whom, _vm->_gyro->subjnumber);
+
+	if (!went_ok)
+		dixi('n', whom); // File not found!
+
+	if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_gyro->dna.obj[_vm->_gyro->badge] = true;
+		_vm->_lucerna->objectlist();
+		dixi('q', 1); // Circular from Cardiff.
+		_vm->_gyro->dna.talked_to_crapulus = true;
+
+		_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = 177; // Crapulus walks off.
+
+		_vm->_trip->tr[1].vanishifstill = true;
+		_vm->_trip->tr[1].walkto(3); // Walks away.
+
+		_vm->_lucerna->points(2);
+	}
 }
 
 } // End of namespace Avalanche.


Commit: 20c2a756b28af4b231a00ff620dd7ad8d8496eb1
    https://github.com/scummvm/scummvm/commit/20c2a756b28af4b231a00ff620dd7ad8d8496eb1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T04:53:18-07:00

Commit Message:
AVALANCHE: Add typecasts to Acci::parse(), repair Scrolls::calldrivers() and Acci::personshere().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 437752b..48c8118 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -548,7 +548,7 @@ void Acci::parse() {
 	fv = 0;
 	while ((fv < 11) && !realwords[fv].empty()) {
 		if ((realwords[fv][0] == '\'') || (realwords[fv][0] == '\"')) {
-			_vm->_gyro->subjnumber = thats[fv];
+			_vm->_gyro->subjnumber = (byte)thats[fv];
 			thats.setChar(moved, fv);
 			break;
 		}
@@ -557,30 +557,30 @@ void Acci::parse() {
 
 	if (_vm->_gyro->subjnumber == 0) // Still not found.
 		for (fv = 0; fv < thats.size() - 1; fv++)
-			if (thats[fv] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->subjnumber = thats[fv + 1];
+			if ((byte)thats[fv] == 252) { // The word is "about", or something similar.
+				_vm->_gyro->subjnumber = (byte)thats[fv + 1];
 				thats.setChar(0, fv + 1);
 				break;
 			}
 
 	if (_vm->_gyro->subjnumber == 0) // STILL not found! Must be the word after "say".
 		for (fv = 0; fv < thats.size() - 1; fv++)
-			if ((thats[fv] == 7) && (thats[fv + 1] != 0) && !((225 <= thats[fv + 1]) && (thats[fv + 1] <= 229))) {
+			if (((byte)thats[fv] == 7) && ((byte)thats[fv + 1] != 0) && !((225 <= (byte)thats[fv + 1]) && ((byte)thats[fv + 1] <= 229))) {
 				// SAY not followed by a preposition
-				_vm->_gyro->subjnumber = thats[fv + 1];
+				_vm->_gyro->subjnumber = (byte)thats[fv + 1];
 				thats.setChar(0, fv + 1);
 				break;
 			}
 
 	for (int8 fv = thats.size() - 1; fv >= 0; fv--) // Reverse order, so first will be used.
-		if ((thats[fv] == 253) || (thats[fv] == 249) || ((1 <= thats[fv]) && (thats[fv] <= 49)))
-			verb = thats[fv];
-		else if ((50 <= thats[fv]) && (thats[fv] <= 149)) {
+		if (((byte)thats[fv] == 253) || ((byte)thats[fv] == 249) || ((1 <= (byte)thats[fv]) && ((byte)thats[fv] <= 49)))
+			verb = (byte)thats[fv];
+		else if ((50 <= (byte)thats[fv]) && ((byte)thats[fv] <= 149)) {
 			thing2 = thing;
-			thing = thats[fv];
-		} else if ((150 <= thats[fv]) && (thats[fv] <= 199))
-			person = thats[fv];
-		else if (thats[fv] == 251)
+			thing = (byte)thats[fv];
+		} else if ((150 <= (byte)thats[fv]) && ((byte)thats[fv] <= 199))
+			person = (byte)thats[fv];
+		else if ((byte)thats[fv] == 251)
 			polite = true;
 
 		if ((!unknown.empty()) && (verb != vb_exam) && (verb != vb_talk) && (verb != vb_save) && (verb != vb_load) && (verb != vb_dir)) {
@@ -607,7 +607,7 @@ void Acci::examobj() {   /* Examine a standard object-thing */
 }
 
 bool Acci::personshere() { // Person equivalent of "holding".
-	if ((person == pardon) || (person == 0) || (_vm->_gyro->whereis[person] == _vm->_gyro->dna.room))
+	if ((person == pardon) || (person == 0) || (_vm->_gyro->whereis[person - 150] == _vm->_gyro->dna.room))
 		return true;
 	else {
 		if (person < 175)
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 99bef8e..d5ce2f0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -717,7 +717,7 @@ void Scrolls::calldrivers() {
 						_vm->_lucerna->errorled();
 						natural();
 					} else
-						_vm->_trip->tr[param].chatter(); // Normal sprite talking routine.
+						_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
 				else if ((10 <= param) && (param <= 36)) {
 					/* Quasi-peds. (This routine performs the same
 					thing with QPs as triptype.chatter does with the


Commit: 670c7c4863e8f843f8b877005c50952065dfe246
    https://github.com/scummvm/scummvm/commit/670c7c4863e8f843f8b877005c50952065dfe246
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T05:17:42-07:00

Commit Message:
AVALANCHE: Repair Scrolls::bubble() and Visa::talkto().

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d5ce2f0..50254b5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -544,7 +544,7 @@ void Scrolls::bubble(func2 gotoit) {
 	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
 		int16 x = _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
 		bool offset = _vm->_gyro->scroll[fv].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 12, (fv * 10) + 12, white);
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
 	}
 
 	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) /* These should be separate loops. */
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 72e4934..082b07a 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -277,7 +277,7 @@ void Visa::talkto(byte whom) {
 	if (!went_ok)
 		dixi('n', whom); // File not found!
 
-	if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
+	if ((_vm->_gyro->subjnumber == 0) && ((whom + 227) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
 		_vm->_gyro->dna.obj[_vm->_gyro->badge] = true;
 		_vm->_lucerna->objectlist();
 		dixi('q', 1); // Circular from Cardiff.


Commit: 2bbf25e948122d8ef9264a50d5cdb9c6c87f61c9
    https://github.com/scummvm/scummvm/commit/2bbf25e948122d8ef9264a50d5cdb9c6c87f61c9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T05:27:36-07:00

Commit Message:
AVALANCHE: Repair Scrolls::bubble().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 50254b5..c8f20b5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -542,7 +542,7 @@ void Scrolls::bubble(func2 gotoit) {
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
 	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
-		int16 x = _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
+		int16 x = xc + _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
 		bool offset = _vm->_gyro->scroll[fv].size() % 2;
 		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
 	}


Commit: 24312c45f88b8d948251f7958c73f589a1c34771
    https://github.com/scummvm/scummvm/commit/24312c45f88b8d948251f7958c73f589a1c34771
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T05:50:05-07:00

Commit Message:
AVALANCHE: Repair Scrolls::say().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index c8f20b5..8e42419 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -103,12 +103,15 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
-	Common::String text;
 	fontType itw;
 	byte lz = z.size();
 	
 	_vm->_logger->log_scrollline();
 
+	bool offset = x % 8 == 4;
+	x = x / 8;
+	y++;
+	int16 i = 0;
 	for (byte xx = 0; xx < lz; xx++) {
 		switch (z[xx]) {
 		case kControlRoman: {
@@ -125,18 +128,15 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			for (byte yy = 0; yy < 12; yy++)
 				itw[(byte)z[xx]][yy] = ch[cfont][(byte)z[xx]][yy + 2];
 
-			text += z[xx];
-			
+			// We have to draw the characters one-by-one because of the accidental font changes.
+			i++;
+			Common::String chr(z[xx]);
+			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, x * 8 + offset * 4 + i * 8, y, black);
+
 			_vm->_logger->log_scrollchar(Common::String(z[xx]));
 			}
 		}
 	}
-
-	bool offset = x % 8 == 4;
-	x = x / 8;
-	y++;
-
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, itw, 12, x * 8 + offset * 4, y, black);
 }
 
 /* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/


Commit: 31a165c7006a548c5fc79837ba1854dd72d23087
    https://github.com/scummvm/scummvm/commit/31a165c7006a548c5fc79837ba1854dd72d23087
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-12T08:23:39-07:00

Commit Message:
AVALANCHE: Repair constants in Gyro, repair Lucerna::enterroom(), Trip::back_and_forth(), Trip::geida_procs(), Visa::talkto().

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 390011c..03c2ef4 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -309,38 +309,38 @@ public:
 	static const char chastity = 5;
 	static const char bolt = 6;
 	static const char crossbow = 7;
-	static const char lute = 10;
-	static const char badge = 11;
-	static const char mushroom = 12;
-	static const char key = 13;
-	static const char bell = 14;
-	static const char prescription = 15;
-	static const char pen = 16;
-	static const char ink = 17;
-	static const char clothes = 20;
-	static const char habit = 21;
-	static const char onion = 22;
+	static const char lute = 8;
+	static const char badge = 9;
+	static const char mushroom = 10;
+	static const char key = 11;
+	static const char bell = 12;
+	static const char prescription = 13;
+	static const char pen = 14;
+	static const char ink = 15;
+	static const char clothes = 16;
+	static const char habit = 17;
+	static const char onion = 18;
 
 	/* People who hang around this game. */
 
 	/* Boys: */
-	static const uint16 pavalot = 226;
-	static const uint16 pspludwick = 227;
-	static const uint16 pcrapulus = 230;
-	static const uint16 pdrduck = 231;
-	static const uint16 pmalagauche = 232;
-	static const uint16 pfriartuck = 233;
-	static const uint16 probinhood = 234;
-	static const uint16 pcwytalot = 235;
-	static const uint16 pdulustie = 236;
-	static const uint16 pduke = 237;
-	static const uint16 pdogfood = 240;
-	static const uint16 ptrader = 241;
-	static const uint16 pibythneth = 242;
-	static const uint16 payles = 243;
-	static const uint16 pport = 244;
-	static const uint16 pspurge = 245;
-	static const uint16 pjacques = 246;
+	static const uint16 pavalot = 150;
+	static const uint16 pspludwick = 151;
+	static const uint16 pcrapulus = 152;
+	static const uint16 pdrduck = 153;
+	static const uint16 pmalagauche = 154;
+	static const uint16 pfriartuck = 155;
+	static const uint16 probinhood = 156;
+	static const uint16 pcwytalot = 157;
+	static const uint16 pdulustie = 158;
+	static const uint16 pduke = 159;
+	static const uint16 pdogfood = 160;
+	static const uint16 ptrader = 161;
+	static const uint16 pibythneth = 162;
+	static const uint16 payles = 163;
+	static const uint16 pport = 164;
+	static const uint16 pspurge = 165;
+	static const uint16 pjacques = 166;
 
 	/* Girls: */
 	static const uint16 parkata = 257;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e996d57..c8863b3 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -442,8 +442,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 					_vm->_trip->tr[1].face = 3;
 				}
 
-				_vm->_trip->tr[2].call_eachstep = true;
-				_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
+				_vm->_trip->tr[1].call_eachstep = true;
+				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
 
 			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 510d6e5..dfcdd5c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1192,7 +1192,7 @@ void Trip::back_and_forth(byte tripnum) {
 
 void Trip::face_avvy(byte tripnum) {
 	if (!tr[tripnum].homing) {
-		if (tr[1].x >= tr[tripnum].x)
+		if (tr[0].x >= tr[tripnum].x)
 			tr[tripnum].face = right;
 		else
 			tr[tripnum].face = left;
@@ -1306,19 +1306,19 @@ void Trip::spin(byte whichway, byte &tripnum) {
 
 void Trip::geida_procs(byte tripnum) {
 	if (_vm->_gyro->dna.geida_time > 0) {
-		_vm->_gyro->dna.geida_time -= 1;
+		_vm->_gyro->dna.geida_time --;
 		if (_vm->_gyro->dna.geida_time == 0)
 			_vm->_gyro->dna.geida_spin = 0;
 	}
 
-	if (tr[tripnum].y < (tr[1].y - 2)) {
+	if (tr[tripnum].y < (tr[0].y - 2)) {
 		/* Geida is further from the screen than Avvy. */
 		spin(down, tripnum);
 		tr[tripnum].iy = 1;
 		tr[tripnum].ix = 0;
 		take_a_step(tripnum);
 		return;
-	} else if (tr[tripnum].y > (tr[1].y + 2)) {
+	} else if (tr[tripnum].y > (tr[0].y + 2)) {
 		/* Avvy is further from the screen than Geida. */
 		spin(up, tripnum);
 		tr[tripnum].iy = -1;
@@ -1328,12 +1328,14 @@ void Trip::geida_procs(byte tripnum) {
 	}
 
 	tr[tripnum].iy = 0;
-	if (tr[tripnum].x < tr[1].x - tr[1].xs * 8) {
-		tr[tripnum].ix = tr[1].xs;
+	// These 12-s are not in the original, I added them to make the following method more "smooth".
+	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
+	if (tr[tripnum].x < tr[0].x - tr[0].xs * 8 - 12) {
+		tr[tripnum].ix = tr[0].xs;
 		spin(right, tripnum);
 		take_a_step(tripnum);
-	} else if (tr[tripnum].x > tr[1].x + tr[1].xs * 8) {
-		tr[tripnum].ix = -tr[1].xs;
+	} else if (tr[tripnum].x > tr[0].x + tr[0].xs * 8 + 12) {
+		tr[tripnum].ix = -tr[0].xs;
 		spin(left, tripnum);
 		take_a_step(tripnum);
 	} else
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 082b07a..4a6fbc7 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -172,7 +172,6 @@ void Visa::talkto(byte whom) {
 	if (_vm->_gyro->subjnumber == 0)
 		switch (whom) {
 		case _vm->_gyro->pspludwick:
-
 			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion])) {
 				dixi('q', 68);
 				_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
@@ -202,7 +201,6 @@ void Visa::talkto(byte whom) {
 				}
 			}
 			break;
-
 		case _vm->_gyro->pibythneth:
 			if (_vm->_gyro->dna.givenbadgetoiby) {
 				dixi('q', 33); // Thanks a lot!
@@ -277,7 +275,7 @@ void Visa::talkto(byte whom) {
 	if (!went_ok)
 		dixi('n', whom); // File not found!
 
-	if ((_vm->_gyro->subjnumber == 0) && ((whom + 227) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
+	if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
 		_vm->_gyro->dna.obj[_vm->_gyro->badge] = true;
 		_vm->_lucerna->objectlist();
 		dixi('q', 1); // Circular from Cardiff.


Commit: fde55085028b5837a95a394fe8beab394f843fb0
    https://github.com/scummvm/scummvm/commit/fde55085028b5837a95a394fe8beab394f843fb0
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-15T12:55:47-07:00

Commit Message:
AVALANCHE: Rename variables in Graphics::drawSprite().

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0b3a264..9ae0408 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -98,21 +98,21 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	/* First we make the pixels of the spirte blank. */
-	for (byte qay = 0; qay < sprite.yl; qay++)
-		for (byte qax = 0; qax < sprite.xl; qax++)
-			if (((*sprite.sil[picnum])[qay][qax / 8] >> ((7 - qax % 8)) & 1) == 0)
-				*getPixel(x + qax, y + qay) = 0;
+	for (byte j = 0; j < sprite.yl; j++)
+		for (byte i = 0; i < sprite.xl; i++)
+			if (((*sprite.sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
+				*getPixel(x + i, y + j) = 0;
 	
 	/* Then we draw the picture to the blank places. */
-	uint16 i = 0; // Because the original siltype starts at 5!!! See Graphics.h for definition.
+	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
 
-	for (byte qay = 0; qay < sprite.yl; qay++)
+	for (byte j = 0; j < sprite.yl; j++)
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 qax = 0; qax  < sprite.xl; qax += 8) {
-				byte pixel = (*sprite.mani[picnum])[i++];
+			for (uint16 i = 0; i  < sprite.xl; i += 8) {
+				byte pixel = (*sprite.mani[picnum])[maniPos++];
 				for (byte bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					*getPixel(x + qax + 7 - bit, y + qay) += (pixelBit << plane);
+					*getPixel(x + i + 7 - bit, y + j) += (pixelBit << plane);
 				} 
 			}
 }


Commit: ea65a8667872cd2128d786eda2e77c3786161f36
    https://github.com/scummvm/scummvm/commit/ea65a8667872cd2128d786eda2e77c3786161f36
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T03:21:37-07:00

Commit Message:
AVALANCHE: Implement Gyro::load_a_mouse(), some cosmetic correction in Gyro.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 73a321a..4bb2305 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -54,7 +54,7 @@ const char *Gyro::copyright = "1995";
 
 const mp Gyro::mps[9] = {
 	{
-		/* 1 - up-arrow */
+		// 1 - up-arrow
 		{	{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575},
 		{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}
 		},	
@@ -63,17 +63,16 @@ const mp Gyro::mps[9] = {
 	},
 
 	{
-		/* 2 - screwdriver */
+		// 2 - screwdriver
 		{	{8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523},
 		{0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0}
-
 		},
 			0,
 			0
 	},
 
 	{
-		/* 3 - right-arrow */
+		// 3 - right-arrow
 		{	{65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535},
 		{0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0}	
 		},
@@ -82,58 +81,58 @@ const mp Gyro::mps[9] = {
 	},
 
 	{
-		/* 4 - fletch */
+		// 4 - fletch
 		{	{255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511},
 		{0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0}
 		},
 			0,
 			0
-		},
+	},
 
-		{
-			/* 5 - hourglass */
-			{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
-			{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
-			},
-				8,
-				7
+	{
+		// 5 - hourglass
+		{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
+		{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
 		},
+			8,
+			7
+	},
 
-		{
-			/* 6 - TTHand */
-			{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
-			{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
-			},
-				4,
-				0
+	{
+		// 6 - TTHand
+		{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
+		{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
 		},
+			4,
+			0
+	},
 
-		{
-			/* 7- Mark's crosshairs */
-			{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
-			{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
-			},
-				8,
-				5
+	{
+		// 7- Mark's crosshairs
+		{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
+		{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
 		},
+			8,
+			5
+	},
 
-		{
-			/* 8- I-beam. */
-			{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
-			{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
-			},
-				8,
-				7
+	{
+		// 8- I-beam
+		{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
+		{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
 		},
+			8,
+			7
+	},
 
-		{
-			/* 9- Question mark. */
-			{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
-			{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
-			},
-				0,
-				0
-		}
+	{
+		// 9 - question mark
+		{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
+		{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
+		},
+			0,
+			0
+	}
 };
 
 const Common::String Gyro::lads[17] = {
@@ -279,7 +278,8 @@ Common::String Gyro::strf(int32 x) {
 }
 
 void Gyro::newpointer(byte m) {
-	if (m == cmp)  return;
+	if (m == cmp)
+		return;
 	cmp = m;
 	
 	/*r.ax = 9;
@@ -295,7 +295,7 @@ void Gyro::newpointer(byte m) {
 	load_a_mouse(m);
 }
 
-void Gyro::wait() {   /* makes hourglass */
+void Gyro::wait() {   // Makes hourglass.
 	newpointer(5);
 }
 
@@ -587,13 +587,48 @@ void Gyro::load_a_mouse(byte which) {
 		return;
 	}
 
+	::Graphics::Surface cursor;
+	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
+	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
+
+
+	// The AND mask.
 	f.seek(mouse_size * 2 * (which - 1) + 134);
 
-	f.read(vmc.andpic, mouse_size);
-	
-	f.read(vmc.xorpic, mouse_size);
+	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (byte j = 0; j < mask.h; j++)
+		for (byte i = 0; i < mask.w; i++)
+			for (byte k = 0; k < 2; k++)
+				if (*(byte *)mask.getBasePtr(i, j) == 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
 	
+	mask.free();
+
+	// The OR mask.
+	f.seek(mouse_size * 2 * (which - 1) + 134 * 2);
+
+	mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (byte j = 0; j < mask.h; j++)
+		for (byte i = 0; i < mask.w; i++)
+			for (byte k = 0; k < 2; k++) {
+				byte pixel = *(byte *)mask.getBasePtr(i, j);
+				if (pixel != 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
+			}
+
+	mask.free();
+
 	f.close();
+
+
+
+	CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which].horzhotspot, mps[which].verthotspot, 255, false);
+
+	cursor.free();
+
+
 	
 	vmc.ofsx = -mps[which].horzhotspot;
 	vmc.ofsy = -mps[which].verthotspot;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 03c2ef4..a5271fa 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -35,6 +35,7 @@
 #include "common/file.h"
 
 #include "graphics/surface.h"
+#include "graphics/cursorman.h"
 
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"


Commit: 681fe7029aa33fd257c53987ab251fc0253123f4
    https://github.com/scummvm/scummvm/commit/681fe7029aa33fd257c53987ab251fc0253123f4
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T03:52:34-07:00

Commit Message:
AVALANCHE: Remove useless parts/comments from Gyro, replace some comments in it.

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 4bb2305..c948492 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -255,21 +255,11 @@ Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
 }
 
 Gyro::~Gyro() {
-	/* These are allocated in Gyro::setup_vmc */
-
-	delete[] vmc.andpic;
-	delete[] vmc.xorpic;
-
-	for (byte fv = 0; fv < 2; fv ++) {
-		delete[] vmc.backpic[fv];
-	}
-
 	for (byte i = 0; i < 9; i++) {
 		digit[i].free();
 		rwlite[i].free();
 	}
 	digit[9].free();
-
 }
 
 Common::String Gyro::strf(int32 x) {
@@ -281,21 +271,11 @@ void Gyro::newpointer(byte m) {
 	if (m == cmp)
 		return;
 	cmp = m;
-	
-	/*r.ax = 9;
-	r.bx = (word)(mps[m].horzhotspot);
-	r.cx = (word)(mps[m].verthotspot);
-	r.es = seg(mps[m].mask);
-	r.dx = ofs(mps[m].mask);
-	intr(0x33, r);
-	
-	r is a 'registers' type variable of Gyro in the Pascal code.*/
 
-	warning("STUB: Gyro::newpointer()");
 	load_a_mouse(m);
 }
 
-void Gyro::wait() {   // Makes hourglass.
+void Gyro::wait() {
 	newpointer(5);
 }
 
@@ -304,16 +284,7 @@ void Gyro::on() {
 }
 
 void Gyro::on_virtual() {
-	switch (visible) {
-	case m_virtual:
-		return;
-		break;
-	case m_yes:
-		off();
-		break;
-	}
-
-	visible = m_virtual;
+	warning("STUB: Gyro::on_virtual()");
 }
 
 void Gyro::off() {
@@ -324,11 +295,11 @@ void Gyro::off_virtual() {
 	warning("STUB: Gyro::off_virtual()");
 }
 
-void Gyro::xycheck() {   /* only updates mx & my, not all other mouse vars */
+void Gyro::xycheck() { 
 	warning("STUB: Gyro::xycheck()");
 }
 
-void Gyro::hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */
+void Gyro::hopto(int16 x, int16 y) {
 	warning("STUB: Gyro::hopto()");
 }
 
@@ -352,12 +323,12 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 	warning("STUB: Gyro::shbox()");
 }
 
-void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
+void Gyro::newgame() { 
 	for (byte gm = 0; gm < numtr; gm ++) {
 		if (_vm->_trip->tr[gm].quick)
 			_vm->_trip->tr[gm].done();
 	}
-	/* Deallocate sprite. Sorry, beta testers! */
+	// Deallocate sprite. Sorry, beta testers!
 
 	_vm->_trip->tr[0].init(0, true, _vm->_trip);
 	alive = true;
@@ -391,7 +362,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	her = 254;
 	it = 254;
 	last_person = 254; /* = Pardon? */
-	dna.pass_num = _vm->_rnd->getRandomNumber(30) + 1;//Random(30) + 1;
+	dna.pass_num = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	after_the_scroll = false;
 	dna.user_moves_avvy = false;
 	doing_sprite_run = false;
@@ -412,7 +383,7 @@ void Gyro::newgame() {   /* This sets up the DNA for a completely new game. */
 	_vm->_lucerna->sprite_run();
 }
 
-void Gyro::click() {   /* "Audio keyboard feedback" */
+void Gyro::click() { 
 	warning("STUB: Gyro::click()");
 }
 
@@ -539,15 +510,12 @@ Common::String Gyro::get_better(byte which) {
 	return get_better_result;
 }
 
-// Get back here after finished with acci.pas, where vb_-s are resided.
-Common::String Gyro::f5_does()
-/* This procedure determines what f5 does. */
-{
+
+Common::String Gyro::f5_does() {
 	warning("STUB: Gyro::f5_does()");
 	return "STUB: Gyro::f5_does()";
 }
 
-// Pobably vmc functions will deal with the mouse cursor.
 void Gyro::plot_vmc(int16 xx, int16 yy, byte page_) {
 	warning("STUB: Gyro::plot_vmc()");
 }
@@ -557,14 +525,7 @@ void Gyro::wipe_vmc(byte page_) {
 }
 
 void Gyro::setup_vmc() {
-	vmc.andpic = new byte[mouse_size];
-	vmc.xorpic = new byte[mouse_size];
-
-	/* Released in Gyro's destructor. */
-	for (int fv = 0; fv < 2; fv ++) {
-		vmc.backpic[fv] = new byte[mouse_size];
-		vmc.wherewas[fv].x = 32767;
-	}
+	warning("STUB: Gyro::setup_vmc()");
 }
 
 void Gyro::clear_vmc() {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index a5271fa..b247f90 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -614,7 +614,7 @@ public:
 
 	void newpointer(byte m);
 
-	void wait();    /* makes hourglass */
+	void wait();    // Makes hourglass.
 
 	void on();
 
@@ -624,9 +624,9 @@ public:
 
 	void off_virtual();
 
-	void xycheck();
+	void xycheck(); // Only updates mx & my, not all other mouse vars.
 
-	void hopto(int16 x, int16 y); /* Moves mouse pointer to x,y */
+	void hopto(int16 x, int16 y); // Moves mouse pointer to x,y.
 
 	void check();
 
@@ -636,9 +636,9 @@ public:
 
 	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
-	void newgame();
+	void newgame(); // This sets up the DNA for a completely new game.
 
-	void click();
+	void click(); // "Audio keyboard feedback"
 
 	void slowdown();
 
@@ -658,7 +658,7 @@ public:
 
 	Common::String get_better(byte which);
 
-	Common::String f5_does();
+	Common::String f5_does(); // This procedure determines what f5 does.
 
 	void plot_vmc(int16 xx, int16 yy, byte page_);
 


Commit: 1f751ff157d96f91cd9a2854b0a2270bef95acb9
    https://github.com/scummvm/scummvm/commit/1f751ff157d96f91cd9a2854b0a2270bef95acb9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T04:00:00-07:00

Commit Message:
AVALANCHE: Stub Gyro::super_off() and Gyro::super_on().

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 8ce7312..1eea813 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -54,6 +54,8 @@
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
 
+#include "graphics/cursorman.h"
+
 namespace Common {
 class RandomSource;
 }
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c948492..cea5902 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -614,26 +614,11 @@ void Gyro::hang_around_for_a_while() {
 	afterwards. */
 
 void Gyro::super_off() {
-	super_was_off = visible == m_no;
-	if (super_was_off)
-		return;
-
-	super_was_virtual = visible == m_virtual;
-
-	if (visible == m_virtual)
-		off_virtual();
-	else
-		off();
+	warning("STUB: Gyro::super_off()");
 }
 
 void Gyro::super_on() {
-	if ((visible != m_no) || (super_was_off))
-		return;
-
-	if (super_was_virtual)
-		on_virtual();
-	else
-		on();
+	warning("STUB: Gyro::super_on()");
 }
 
 bool Gyro::mouse_near_text() {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index b247f90..e54452f 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -35,7 +35,6 @@
 #include "common/file.h"
 
 #include "graphics/surface.h"
-#include "graphics/cursorman.h"
 
 #include "avalanche/roomnums.h"
 #include "avalanche/color.h"


Commit: d860bc592545e6ebf387e95afb5068c8a5d8d123
    https://github.com/scummvm/scummvm/commit/d860bc592545e6ebf387e95afb5068c8a5d8d123
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T04:40:58-07:00

Commit Message:
AVALANCHE: Remove Gyro::on_virtual(), Gyro::off_virtual(), Gyro::super_off(), Gyro::super_on(). Replace their calls with CursorMan.showMouse().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index d3779cb..ced7150 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -70,8 +70,7 @@ void Avalot::setup() {
 	_vm->_gyro->to_do = 0;
 	_vm->_gyro->lmo = false;
 	_vm->_scrolls->resetscroll();
-	_vm->_gyro->setup_vmc();
-	_vm->_gyro->on_virtual();
+	CursorMan.showMouse(true);
 	gd = 3;
 	gm = 0;
 	//initgraph(gd: gm: "");
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 89eb231..b19b253 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -58,14 +58,13 @@ headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, f
 }
 
 void headtype::display() {
-	_dr->_vm->_gyro->off(); /*MT*/
+	CursorMan.showMouse(false); /*MT*/
 	_dr->chalk(xpos, 1, trigger, title, true);
-	_dr->_vm->_gyro->on(); /*MT*/
+	CursorMan.showMouse(true); /*MT*/
 }
 
 void headtype::highlight() {
-	_dr->_vm->_gyro->off();
-	_dr->_vm->_gyro->off_virtual();
+	CursorMan.showMouse(false);
 
 	//nosound();
 	//setactivepage(cp);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index cea5902..8d42e1b 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -283,18 +283,10 @@ void Gyro::on() {
 	warning("STUB: Gyro::on()");
 }
 
-void Gyro::on_virtual() {
-	warning("STUB: Gyro::on_virtual()");
-}
-
 void Gyro::off() {
 	warning("STUB: Gyro::off()");
 }
 
-void Gyro::off_virtual() {
-	warning("STUB: Gyro::off_virtual()");
-}
-
 void Gyro::xycheck() { 
 	warning("STUB: Gyro::xycheck()");
 }
@@ -609,18 +601,6 @@ void Gyro::hang_around_for_a_while() {
 		slowdown();
 }
 
-/* Super_Off and Super_On are two very useful procedures. Super_Off switches
-	the mouse cursor off, WHATEVER it's like. Super_On restores it again
-	afterwards. */
-
-void Gyro::super_off() {
-	warning("STUB: Gyro::super_off()");
-}
-
-void Gyro::super_on() {
-	warning("STUB: Gyro::super_on()");
-}
-
 bool Gyro::mouse_near_text() {
 	return (my > 144) && (my < 188);
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index e54452f..5f268dc 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -619,10 +619,6 @@ public:
 
 	void off();
 
-	void on_virtual();
-
-	void off_virtual();
-
 	void xycheck(); // Only updates mx & my, not all other mouse vars.
 
 	void hopto(int16 x, int16 y); // Moves mouse pointer to x,y.
@@ -673,10 +669,6 @@ public:
 
 	void hang_around_for_a_while();
 
-	void super_off();
-
-	void super_on();
-
 	bool mouse_near_text();
 
 private:
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c8863b3..afbbc1b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -84,21 +84,8 @@ void Lucerna::draw_also_lines() {
 	byte ff;
 	byte squeaky_code;
 
-	switch (_vm->_gyro->visible) {
-	case _vm->_gyro->m_virtual: {
-		squeaky_code = 1;
-		_vm->_gyro->off_virtual();
-		}
-		break;
-	case _vm->_gyro->m_no:
-		squeaky_code = 2;
-		break;
-	case _vm->_gyro->m_yes: {
-		squeaky_code = 3;
-		_vm->_gyro->off();
-		}
-		break;
-	}
+	
+	CursorMan.showMouse(false);
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 161), 15);
@@ -107,16 +94,8 @@ void Lucerna::draw_also_lines() {
 		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/)
 			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
 
-	switch (squeaky_code) {
-	case 1 :
-		_vm->_gyro->on_virtual();
-		break;
-	case 2 :
-		break; // Zzz... it was off anyway.
-	case 3 :
-		_vm->_gyro->on();
-		break;
-	}
+
+	CursorMan.showMouse(true);
 }
 
 
@@ -236,13 +215,8 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	byte a1;  /*absolute $A000:17184;*/
 	byte bit;
 	Common::String xx;
-	bool was_virtual;
-
-	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
-	if (was_virtual)
-		_vm->_gyro->off_virtual();
-	else
-		_vm->_gyro->off();
+	
+	CursorMan.showMouse(false);
 
 	_vm->_gyro->clear_vmc();
 	
@@ -297,10 +271,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	_vm->_logger->log_newroom(_vm->_gyro->roomname);
 
-	if (was_virtual)
-		_vm->_gyro->on_virtual();
-	else 
-		_vm->_gyro->on();
+	CursorMan.showMouse(true);
 }
 
 
@@ -791,7 +762,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	
 	f.close();
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 
 	/*setactivepage(3);
 	putimage(x, y, p, 0);
@@ -800,7 +771,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	for (byte fv = 0; fv <= 1; fv ++)
 		_vm->_trip->getset[fv].remember(thinkspace);
 	
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	_vm->_gyro->thinkthing = th;
 }
 
@@ -872,7 +843,7 @@ void Lucerna::showscore() {
 	}
 	numbers[2] = score;
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 
 	//setactivepage(3);
 
@@ -885,7 +856,7 @@ void Lucerna::showscore() {
 
 	//setactivepage(1 - cp);
 
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->lastscore[i] = numbers[i];
 }
@@ -1064,7 +1035,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	if (_vm->_gyro->oldrw == _vm->_gyro->dna.rw) 
 		return;
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 	
 	/*	for (byte page_ = 0; page_ <= 1; page_ ++) {
 	setactivepage(page_);
@@ -1073,7 +1044,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 
 	_vm->_graphics->drawPicture(_vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
 
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	//setactivepage(1 - cp);
 	
 	warning("STUB: Lucerna::showrw()");
@@ -1167,13 +1138,13 @@ void Lucerna::flip_page() {
 void Lucerna::delavvy() {
 	byte page_;
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 	
 	triptype &with = _vm->_trip->tr[0];
 	/*for (page_ = 0; page_ <= 1; page_ ++)
 		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);*/
 	
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 }
 
 void Lucerna::gameover() {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 4ce8249..c996a30 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -87,7 +87,7 @@ void Parser::handleReturn() {
 
 void Parser::plotText() {
 	if (_vm->_gyro->mouse_near_text())
-		_vm->_gyro->super_off();
+		CursorMan.showMouse(false);
 
 	cursorOff();
 
@@ -96,7 +96,7 @@ void Parser::plotText() {
 	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, white);
 
 	cursorOn();
-	_vm->_gyro->super_on();
+	CursorMan.showMouse(true);
 }
 
 void Parser::cursorOn() {
@@ -140,7 +140,7 @@ void Parser::drawCursor() {
 
 void Parser::wipeText() {
 	if (_vm->_gyro->mouse_near_text())
-		_vm->_gyro->super_off();
+		CursorMan.showMouse(false);
 
 	cursorOff();
 	
@@ -149,7 +149,7 @@ void Parser::wipeText() {
 	_quote = true;
 	_inputTextPos = 0;
 	cursorOn();
-	_vm->_gyro->super_on();
+	CursorMan.showMouse(true);
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8e42419..a5dd7d0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -90,11 +90,11 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	//}
 	warning("STUB: Scrolls::state()");
 
-	_vm->_gyro->super_off();
+	CursorMan.showMouse(false);
 
 	_vm->_graphics->drawBar(419, 195, 438, 197, color);
 
-	_vm->_gyro->super_on();
+	CursorMan.showMouse(true);
 	_vm->_gyro->ledstatus = x;
 }
 
@@ -149,8 +149,7 @@ void Scrolls::normscroll() {
 
 	state(3);
 	_vm->_gyro->seescroll = true;
-	_vm->_gyro->off_virtual();
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	_vm->_gyro->newpointer(4);
 	_vm->_lucerna->mousepage(1 - _vm->_gyro->cp);
 
@@ -210,7 +209,7 @@ void Scrolls::normscroll() {
 	state(0);
 	_vm->_gyro->seescroll = false;
 	_vm->_lucerna->mousepage(_vm->_gyro->cp);
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 
 	warning("STUB: Scrolls::normscroll()");
 }
@@ -334,7 +333,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	bool centre;
 	byte icon_indent = 0;
 
-	_vm->_gyro->off_virtual();
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
 	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
@@ -357,7 +355,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 
 	// The right corners of the scroll.
 	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, lightgray);
@@ -462,12 +460,12 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_logger->log_divider();
 	//setvisualpage(cp);
 	//mousepage(cp);
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 	/* mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);*/
 	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
 	//blitfix();
 	_vm->_gyro->oncandopageswap = true; // Normality again.
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	//settextjustify(0, 0); /*sink*/
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
@@ -488,7 +486,7 @@ void Scrolls::bubble(func2 gotoit) {
 	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
 	//mousepage(1 - cp); /* Mousepage */
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 
 	xl = 0;
 	yl = _vm->_gyro->scrolln * 5;
@@ -555,17 +553,17 @@ void Scrolls::bubble(func2 gotoit) {
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	_vm->_gyro->oncandopageswap = false;
-	_vm->_gyro->on();
+	CursorMan.showMouse(true);
 	_vm->_gyro->dropsok = false;
 
 	// This does the actual drawing to the screen.
 	(this->*gotoit)();
 
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 	_vm->_gyro->dropsok = true;
 
 	/*setvisualpage(cp);
-	_vm->_gyro->on(); /*sink;*/
+	CursorMan.showMouse(true); /*sink;*/
 	_vm->_gyro->oncandopageswap = true;
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
@@ -684,15 +682,8 @@ void Scrolls::calldrivers() {
 					_vm->_lucerna->sprite_run();
 				call_spriterun = false;
 
-				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
-				if (was_virtual)
-					_vm->_gyro->off_virtual();
-
 				drawscroll(&Avalanche::Scrolls::normscroll);
 
-				if (was_virtual)
-					_vm->_gyro->on_virtual();
-
 				resetscroll();
 
 				if (_vm->_gyro->screturn)
@@ -732,15 +723,8 @@ void Scrolls::calldrivers() {
 					natural();
 				}
 
-				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
-				if (was_virtual)
-					_vm->_gyro->off_virtual();
-
 				bubble(&Avalanche::Scrolls::normscroll);
 
-				if (was_virtual)
-					_vm->_gyro->on_virtual();
-
 				resetscroll();
 
 				if (_vm->_gyro->screturn)
@@ -814,15 +798,8 @@ void Scrolls::calldrivers() {
 				_vm->_gyro->scrolln++;
 				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] = kControlQuestion;
 
-				was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
-				if (was_virtual)
-					_vm->_gyro->off_virtual();
-
 				drawscroll(&Avalanche::Scrolls::dialogue);
 
-				if (was_virtual)
-					_vm->_gyro->on_virtual();
-
 				resetscroll();
 				}
 				break;
@@ -891,13 +868,8 @@ void Scrolls::musical_scroll() {
 
 	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
 
-	if (was_virtual)
-		_vm->_gyro->off_virtual();
-
 	drawscroll(&Avalanche::Scrolls::music_scroll);
 
-	if (was_virtual)
-		_vm->_gyro->on_virtual();
 	resetscroll();
 }
 


Commit: 5e2627542af823c4faad7350a56fab097d10b5b8
    https://github.com/scummvm/scummvm/commit/5e2627542af823c4faad7350a56fab097d10b5b8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T04:56:29-07:00

Commit Message:
AVALANCHE: Remove functions connected to mouse handling from Gyro, remove Lucerna::flip_page().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ced7150..fff969b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -236,14 +236,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_trip->trippancy_link();
 		_vm->_celer->pics_link();
 		_vm->_lucerna->checkclick();
-
-		if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
-			_vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp);
-		_vm->_lucerna->flip_page(); /* <<<! */
 		
-		if (_vm->_gyro->visible == _vm->_gyro->m_virtual) 
-			_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
-
 		_vm->_timeout->one_tick();
 
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 8d42e1b..96b45b4 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -508,30 +508,6 @@ Common::String Gyro::f5_does() {
 	return "STUB: Gyro::f5_does()";
 }
 
-void Gyro::plot_vmc(int16 xx, int16 yy, byte page_) {
-	warning("STUB: Gyro::plot_vmc()");
-}
-
-void Gyro::wipe_vmc(byte page_) {
-	warning("STUB: Gyro::wipe_vmc()");
-}
-
-void Gyro::setup_vmc() {
-	warning("STUB: Gyro::setup_vmc()");
-}
-
-void Gyro::clear_vmc() {
-	warning("STUB: Gyro::clear_vmc()");
-}
-
-void Gyro::setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */
-	warning("STUB: Gyro::setminmaxhorzcurspos()");
-}
-
-void Gyro::setminmaxvertcurspos(uint16 min, uint16 max) {
-	warning("STUB: Gyro::setminmaxvertcurspos()");
-}
-
 void Gyro::load_a_mouse(byte which) {
 	Common::File f;
 
@@ -580,14 +556,6 @@ void Gyro::load_a_mouse(byte which) {
 	CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which].horzhotspot, mps[which].verthotspot, 255, false);
 
 	cursor.free();
-
-
-	
-	vmc.ofsx = -mps[which].horzhotspot;
-	vmc.ofsy = -mps[which].verthotspot;
-
-	setminmaxhorzcurspos(mps[which].horzhotspot + 3, 624 + mps[which].horzhotspot);
-	setminmaxvertcurspos(mps[which].verthotspot, 199);
 }
 
 void Gyro::background(byte x) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 5f268dc..f5dc209 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -655,14 +655,6 @@ public:
 
 	Common::String f5_does(); // This procedure determines what f5 does.
 
-	void plot_vmc(int16 xx, int16 yy, byte page_);
-
-	void wipe_vmc(byte page_);
-
-	void setup_vmc();
-
-	void clear_vmc();
-
 	void load_a_mouse(byte which);
 
 	void background(byte x);
@@ -683,11 +675,6 @@ private:
 	static const char betterchar[];
 
 	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
-
-	void setminmaxhorzcurspos(uint16 min, uint16 max);
-
-	void setminmaxvertcurspos(uint16 min, uint16 max);
-
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index afbbc1b..340116b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -217,8 +217,6 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	Common::String xx;
 	
 	CursorMan.showMouse(false);
-
-	_vm->_gyro->clear_vmc();
 	
 	_vm->_graphics->flesh_colours();
 
@@ -1130,11 +1128,6 @@ void Lucerna::clock_lucerna() {
 
 
 
-
-void Lucerna::flip_page() {
-	warning("STUB: Lucerna::flip_page()");
-}
-
 void Lucerna::delavvy() {
 	byte page_;
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index f0ecf2b..4cee781 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -88,8 +88,6 @@ public:
 
 	void clock_lucerna();
 
-	void flip_page();
-
 	void delavvy();
 
 	void gameover();


Commit: dc1e9022b1c6276af8065e72260b8ae9084bcd57
    https://github.com/scummvm/scummvm/commit/dc1e9022b1c6276af8065e72260b8ae9084bcd57
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T08:29:22-07:00

Commit Message:
AVALANCHE: Add AvalancheEngine::getMousePos(), remove Gyro::hopto(), implement Scrolls::dodgem() and Scrolls::undodgem().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 922f701..8196065 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -147,7 +147,9 @@ bool AvalancheEngine::getEvent(Common::Event &event) {
 	return _eventMan->pollEvent(event);
 }
 
-
+Common::Point AvalancheEngine::getMousePos() {
+	return _eventMan->getMousePos();
+}
 
 
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 1eea813..2f20393 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -115,6 +115,8 @@ public:
 
 	bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example.
 
+	Common::Point getMousePos();
+
 protected:
 	// Engine APIs
 	Common::Error run();
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 96b45b4..fa95a53 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -291,10 +291,6 @@ void Gyro::xycheck() {
 	warning("STUB: Gyro::xycheck()");
 }
 
-void Gyro::hopto(int16 x, int16 y) {
-	warning("STUB: Gyro::hopto()");
-}
-
 void Gyro::check() {
 	warning("STUB: Gyro::check()");
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index f5dc209..7ddfe62 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -621,8 +621,6 @@ public:
 
 	void xycheck(); // Only updates mx & my, not all other mouse vars.
 
-	void hopto(int16 x, int16 y); // Moves mouse pointer to x,y.
-
 	void check();
 
 	void note(uint16 hertz);
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index a5dd7d0..4e7507a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -260,19 +260,15 @@ void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little.
 		_vm->_lucerna->errorled(); /* ring the bell "x" times */
 }
 
-void Scrolls::dodgem() {     /* This moves the mouse pointer off the scroll so that you can read it. */
-	_vm->_gyro->xycheck(); /* Mx & my now contain xy pos of mouse */
-	dodgex = _vm->_gyro->mx;
-	dodgey = _vm->_gyro->my; /* Store 'em */
-	_vm->_gyro->hopto(dodgex, _vm->_gyro->underscroll); /* Move the pointer off the scroll. */
+void Scrolls::dodgem() {     
+	dodgeCoord = _vm->getMousePos();
+	g_system->warpMouse(dodgeCoord.x, _vm->_gyro->underscroll); // Move the pointer off the scroll.
 }
 
-void Scrolls::undodgem() {   /* This is the opposite of Dodgem. It moves the
- mouse pointer back, IF you haven't moved it in the meantime. */
-	_vm->_gyro->xycheck();
-	if ((_vm->_gyro->mx == dodgex) && (_vm->_gyro->my == _vm->_gyro->underscroll))
-		/* No change, so restore the pointer's original position. */
-		_vm->_gyro->hopto(dodgex, dodgey);
+void Scrolls::undodgem() {   
+	Common::Point actCoord = _vm->getMousePos();
+	if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->underscroll))
+		g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
 void Scrolls::geticon(int16 x, int16 y, byte which) {
@@ -446,7 +442,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 		my += 12;
 	}
 
-	_vm->_gyro->underscroll = my + 3;
+	_vm->_gyro->underscroll = my * 2 + 12 + 1; // Multiplying because of the doubled screen height.
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	//my = getpixel(0, 0);
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index b90f280..c16d983 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -108,7 +108,7 @@ private:
 	
 	byte cfont; // Current font
 
-	int16 dodgex, dodgey;
+	Common::Point dodgeCoord;
 	byte param; // For using arguments code
 
 	byte use_icon;
@@ -133,9 +133,9 @@ private:
 
 	void dingdongbell();
 
-	void dodgem();
+	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
 
-	void undodgem();
+	void undodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
 
 	void geticon(int16 x, int16 y, byte which);
 


Commit: 4430e435d8c437cf236f432684fa5dba76f990e7
    https://github.com/scummvm/scummvm/commit/4430e435d8c437cf236f432684fa5dba76f990e7
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T10:24:40-07:00

Commit Message:
AVALANCHE: Upgrade Scrolls::normscroll().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index fff969b..229159f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -61,6 +61,76 @@ Avalot::Avalot(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+void Avalot::handleKeyDown(Common::Event &event) {
+	//if (keyboardclick)
+	//	click();
+	//	
+	// To be implemented later with the sounds, I assume.
+
+	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
+		_vm->_parser->handleInputText(event);
+	else
+		switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
+		case Common::KEYCODE_KP8:
+			event.kbd.keycode = Common::KEYCODE_UP;
+			break;
+		case Common::KEYCODE_KP2:
+			event.kbd.keycode = Common::KEYCODE_DOWN;
+			break;
+		case Common::KEYCODE_KP6:
+			event.kbd.keycode = Common::KEYCODE_RIGHT;
+			break;
+		case Common::KEYCODE_KP4:
+			event.kbd.keycode = Common::KEYCODE_LEFT;
+			break;
+		case Common::KEYCODE_KP9:
+			event.kbd.keycode = Common::KEYCODE_PAGEUP;
+			break;
+		case Common::KEYCODE_KP3:
+			event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
+			break;
+		case Common::KEYCODE_KP7:
+			event.kbd.keycode = Common::KEYCODE_HOME;
+			break;
+		case Common::KEYCODE_KP1:
+			event.kbd.keycode = Common::KEYCODE_END;
+			break;
+	}
+
+	switch (event.kbd.keycode) {
+	case Common::KEYCODE_UP:
+	case Common::KEYCODE_DOWN:
+	case Common::KEYCODE_RIGHT:
+	case Common::KEYCODE_LEFT:
+	case Common::KEYCODE_PAGEUP:
+	case Common::KEYCODE_PAGEDOWN:
+	case Common::KEYCODE_HOME:
+	case Common::KEYCODE_END:
+	case Common::KEYCODE_KP5:
+		if (_vm->_gyro->alive) {
+			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
+			_vm->_lucerna->showrw();
+			if (_vm->_gyro->demo)
+				_vm->_basher->get_demorec();
+			return;
+		}
+	case Common::KEYCODE_BACKSPACE:
+		_vm->_parser->handleBackspace();
+		break;
+	case Common::KEYCODE_RETURN:
+		_vm->_parser->handleReturn();
+		break;
+	}
+
+	_vm->_lucerna->showrw();
+	if (_vm->_gyro->demo)
+		_vm->_basher->get_demorec();
+}
+
+
+
+
+
 
 void Avalot::setup() {
 	int16 gd, gm;
@@ -150,76 +220,6 @@ void Avalot::setup() {
 		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
 }
 
-
-
-void Avalot::handleKeyDown(Common::Event &event) {
-	//if (keyboardclick)
-	//	click();
-	//	
-	// To be implemented later with the sounds, I assume.
-	
-	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
-		_vm->_parser->handleInputText(event);
-	else
-		switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
-		case Common::KEYCODE_KP8:
-			event.kbd.keycode = Common::KEYCODE_UP;
-			break;
-		case Common::KEYCODE_KP2:
-			event.kbd.keycode = Common::KEYCODE_DOWN;
-			break;
-		case Common::KEYCODE_KP6:
-			event.kbd.keycode = Common::KEYCODE_RIGHT;
-			break;
-		case Common::KEYCODE_KP4:
-			event.kbd.keycode = Common::KEYCODE_LEFT;
-			break;
-		case Common::KEYCODE_KP9:
-			event.kbd.keycode = Common::KEYCODE_PAGEUP;
-			break;
-		case Common::KEYCODE_KP3:
-			event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
-			break;
-		case Common::KEYCODE_KP7:
-			event.kbd.keycode = Common::KEYCODE_HOME;
-			break;
-		case Common::KEYCODE_KP1:
-			event.kbd.keycode = Common::KEYCODE_END;
-			break;
-		}
-
-		switch (event.kbd.keycode) {
-		case Common::KEYCODE_UP:
-		case Common::KEYCODE_DOWN:
-		case Common::KEYCODE_RIGHT:
-		case Common::KEYCODE_LEFT:
-		case Common::KEYCODE_PAGEUP:
-		case Common::KEYCODE_PAGEDOWN:
-		case Common::KEYCODE_HOME:
-		case Common::KEYCODE_END:
-		case Common::KEYCODE_KP5:
-			if (_vm->_gyro->alive) {
-				_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
-				_vm->_lucerna->showrw();
-				if (_vm->_gyro->demo)
-					_vm->_basher->get_demorec();
-				return;
-			}
-		case Common::KEYCODE_BACKSPACE:
-			_vm->_parser->handleBackspace();
-			break;
-		case Common::KEYCODE_RETURN:
-			_vm->_parser->handleReturn();
-			break;
-		}
-
-	_vm->_lucerna->showrw();
-	 if (_vm->_gyro->demo)
-		 _vm->_basher->get_demorec();
-}
-
-
-
 void Avalot::run(Common::String arg) {
 	setup();
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4e7507a..1457503 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -161,12 +161,14 @@ void Scrolls::normscroll() {
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
 	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
-	_vm->_graphics->refreshScreen();
-
+	
 	Common::Event event;
 	while (!_vm->shouldQuit()) {
+		_vm->_graphics->refreshScreen();
+
 		_vm->getEvent(event);
-		if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS)))
+		if ((event.type == Common::EVENT_LBUTTONUP) ||
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS))))
 			break;
 	}
 
@@ -205,7 +207,8 @@ void Scrolls::normscroll() {
 //
 //#ifdef RECORD record_one(); #endif
 //
-	//_vm->_gyro->screturn = r == '#'; /* "back door" */
+//	_vm->_gyro->screturn = r == '#'; /* "back door" */
+
 	state(0);
 	_vm->_gyro->seescroll = false;
 	_vm->_lucerna->mousepage(_vm->_gyro->cp);
@@ -558,7 +561,7 @@ void Scrolls::bubble(func2 gotoit) {
 	CursorMan.showMouse(false);
 	_vm->_gyro->dropsok = true;
 
-	/*setvisualpage(cp);
+	//setvisualpage(cp);
 	CursorMan.showMouse(true); /*sink;*/
 	_vm->_gyro->oncandopageswap = true;
 	resetscrolldriver();


Commit: 2bcca8a0dd17f4ae55ff4587a54c63d60a021b03
    https://github.com/scummvm/scummvm/commit/2bcca8a0dd17f4ae55ff4587a54c63d60a021b03
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T10:29:11-07:00

Commit Message:
AVALANCHE: Remove multiple definition. (Already defined in Graphics.)

Changed paths:
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index b960edc..7c86b40 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -39,12 +39,6 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-
-typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
-// Be aware!!!
-
-typedef byte siltype[51][11]; /* 35, 4 */
-
 struct adxtype { /* Second revision of ADX type */
 	Common::String name/*[13]*/; /* name of character */ // uruk: Note to self: TRAILING /0 !!! Real size: 12
 	Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16.


Commit: 05f3838b16a5e9533c2a0faeb18dfc50610eface
    https://github.com/scummvm/scummvm/commit/05f3838b16a5e9533c2a0faeb18dfc50610eface
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T14:02:53-07:00

Commit Message:
AVALANCHE: Partially implement Lucerna::checkclick(), upgrade other parts of the code during the process. Repair Gyro::load_a_mouse().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 8196065..c2d0e0b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -137,6 +137,12 @@ void AvalancheEngine::updateEvents() {
 
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
+		case Common::EVENT_LBUTTONDOWN:
+			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick().
+			break;
+		case Common::EVENT_LBUTTONUP:
+			_lucerna->holdLeftMouse = false; // Same as above.
+			break;
 		case Common::EVENT_KEYDOWN:
 			_avalot->handleKeyDown(event);
 		}
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index fa95a53..5278a3d 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -549,7 +549,7 @@ void Gyro::load_a_mouse(byte which) {
 
 
 
-	CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which].horzhotspot, mps[which].verthotspot, 255, false);
+	CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which - 1].horzhotspot, mps[which - 1].verthotspot * 2, 255, false);
 
 	cursor.free();
 }
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 340116b..8dfb78a 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -978,6 +978,109 @@ void Lucerna::verte() {
 }
 
 void Lucerna::checkclick() {
+	bytefield b;
+
+	Common::Point cursorPos = _vm->getMousePos();
+	_vm->_gyro->ontoolbar = _vm->_gyro->slow_computer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
+	
+	if (_vm->_gyro->mrelease > 0)
+		_vm->_gyro->after_the_scroll = false;
+
+	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+		_vm->_gyro->newpointer(1); // up arrow
+	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
+		_vm->_gyro->newpointer(8); //I-beam
+	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+		_vm->_gyro->newpointer(2); // screwdriver
+	else if (!_vm->_gyro->ddmnow) { // Dropdown can handle its own pointers.
+		if (holdLeftMouse) {
+			_vm->_gyro->newpointer(7); // Mark's crosshairs
+			verte(); // Normally, if you click on the picture, you're guiding Avvy around.
+		} else
+			_vm->_gyro->newpointer(4); // fletch
+	}
+
+
+
+	//if (_vm->_gyro->mpress > 0) {
+	//	switch (_vm->_gyro->mpy) {
+	//	case RANGE_11(0, 10):
+	//		if (_vm->_gyro->dropsok)  topcheck();
+	//		break;
+	//	case 11 ... 158:
+	//		if (!_vm->_gyro->dropsok)
+	//			_vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
+	//		break;                    /* But otherwise, it's
+ //                                      equivalent to pressing Enter. */
+	//	case RANGE_11(159, 169): { /* Click on command line */
+	//		cursor_off();
+	//		curpos = (_vm->_gyro->mx - 16) / 8;
+	//		if (curpos > length(current) + 1)
+	//			curpos = length(current) + 1;
+	//		if (curpos < 1)
+	//			curpos = 1;
+	//		cursor_on();
+	//	}
+	//	break;
+	//	case 170 ... 200:
+	//		switch (_vm->_gyro->mpx) { /* bottom check */
+	//		case 0 ... 207:
+	//			mouseway();
+	//			break;
+	//		case 208 ... 260: { /* Examine the thing */
+	//			do {
+	//				_vm->_gyro->check();
+	//			} while (!(_vm->_gyro->mrelease > 0));
+	//			if (_vm->_gyro->thinkthing) {
+	//				_vm->_acci->thing = _vm->_gyro->thinks;
+	//				_vm->_acci->thing += 49;
+	//				_vm->_acci->person = _vm->_acci->pardon;
+	//			} else {
+	//				_vm->_acci->person = _vm->_gyro->thinks;
+	//				_vm->_acci->thing = _vm->_acci->pardon;
+	//			}
+	//			callverb(_vm->_acci->vb_exam);
+	//		}
+	//		break;
+	//		case 261 ... 319: {
+	//			do {
+	//				checkclick();
+	//			} while (!(_vm->_gyro->mrelease > 0));
+	//			callverb(_vm->_acci->vb_score);
+	//		}
+	//		break;
+	//		case 320 ... 357: {
+	//			_vm->_trip->tr[0].xs = _vm->_gyro->walk;
+	//			_vm->_trip->newspeed();
+	//		}
+	//		break;
+	//		case 358 ... 395: {
+	//			_vm->_trip->tr[0].xs = _vm->_gyro->run;
+	//			_vm->_trip->newspeed();
+	//		}
+	//		break;
+	//		case 396 ... 483:
+	//			fxtoggle();
+	//			break; /* "sound" */
+	//			/*              484..534: begin { clock }
+	//			                         off; if getpixel(mx,my)=14 then mousetext:='#'+mousetext; on;
+	//			                        end;*/
+	//		case 535 ... 640:
+	//			_vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
+	//			break;
+	//		}
+	//		break;
+	//	}
+	//}
+
+	/* if mrelease>0 then
+	 begin
+	  if (cw<>177) and (mry>10) then
+	   begin to_do:=(((mrx-20) div 100)*20)+(mry div 10); closewin; end;
+	 end;*/
+
+
+
 	warning("STUB: Lucerna::checkclick()");
 }
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 4cee781..b422f74 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -38,6 +38,10 @@ class AvalancheEngine;
 
 class Lucerna {
 public:
+	bool holdLeftMouse;
+
+
+
 	Lucerna(AvalancheEngine *vm);
 
 	void init();
@@ -134,6 +138,8 @@ private:
 	Common::File f;
 
 
+
+
 	Common::String nextstring();
 	void scram1(Common::String &x);
 	void unscramble();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1457503..d141edc 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -213,6 +213,7 @@ void Scrolls::normscroll() {
 	_vm->_gyro->seescroll = false;
 	_vm->_lucerna->mousepage(_vm->_gyro->cp);
 	CursorMan.showMouse(false);
+	_vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick().
 
 	warning("STUB: Scrolls::normscroll()");
 }


Commit: 27d7ae56a629f308e605b97988f4ed4d8e0a22bc
    https://github.com/scummvm/scummvm/commit/27d7ae56a629f308e605b97988f4ed4d8e0a22bc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-16T14:29:03-07:00

Commit Message:
AVALANCHE: Repair Lucerna::verte().

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 8dfb78a..5762b76 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -924,55 +924,55 @@ void Lucerna::objectlist() {
 		}
 }
 
-void Lucerna::verte() {
-	byte what;
-
+void Lucerna::verte(Common::Point cursorPos) {
 	if (! _vm->_gyro->dna.user_moves_avvy) 
 		return;
 
+	cursorPos.y /= 2;
+	byte what;
 
-	/* _vm->_trip->tr[0] : that's the only one we're interested in here */
-	if (_vm->_gyro->mx < _vm->_trip->tr[0].x) 
+	// _vm->_trip->tr[0] : that's the only one we're interested in here. (It's Avalot.)
+	if (cursorPos.x < _vm->_trip->tr[0].x) 
 		what = 1;
-	else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info.xl)) 
+	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info.xl)) 
 		what = 2;
 	else
-		what = 0; /* On top */
+		what = 0; // On top
 
-	if (_vm->_gyro->my < _vm->_trip->tr[0].y)
+	if (cursorPos.y < _vm->_trip->tr[0].y)
 		what += 3;
-	else if (_vm->_gyro->my > (unsigned char)(_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info.yl))
+	else if (cursorPos.y > (_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info.yl))
 		what += 6;
 
 	switch (what) {
 	case 0:
 		_vm->_trip->stopwalking();
-		break; /* Clicked on Avvy- no movement */
+		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_trip->rwsp(1, _vm->_trip->left);
+		_vm->_trip->rwsp(0, _vm->_trip->left);
 		break;
 	case 2:
-		_vm->_trip->rwsp(1, _vm->_trip->right);
+		_vm->_trip->rwsp(0, _vm->_trip->right);
 		break;
 	case 3:
-		_vm->_trip->rwsp(1, _vm->_trip->up);
+		_vm->_trip->rwsp(0, _vm->_trip->up);
 		break;
 	case 4:
-		_vm->_trip->rwsp(1, _vm->_trip->ul);
+		_vm->_trip->rwsp(0, _vm->_trip->ul);
 		break;
 	case 5:
-		_vm->_trip->rwsp(1, _vm->_trip->ur);
+		_vm->_trip->rwsp(0, _vm->_trip->ur);
 		break;
 	case 6:
-		_vm->_trip->rwsp(1, _vm->_trip->down);
+		_vm->_trip->rwsp(0, _vm->_trip->down);
 		break;
 	case 7:
-		_vm->_trip->rwsp(1, _vm->_trip->dl);
+		_vm->_trip->rwsp(0, _vm->_trip->dl);
 		break;
 	case 8:
-		_vm->_trip->rwsp(1, _vm->_trip->dr);
+		_vm->_trip->rwsp(0, _vm->_trip->dr);
 		break;
-	}    /* no other values are possible... */
+	}    // No other values are possible.
 
 	showrw();
 }
@@ -995,7 +995,7 @@ void Lucerna::checkclick() {
 	else if (!_vm->_gyro->ddmnow) { // Dropdown can handle its own pointers.
 		if (holdLeftMouse) {
 			_vm->_gyro->newpointer(7); // Mark's crosshairs
-			verte(); // Normally, if you click on the picture, you're guiding Avvy around.
+			verte(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
 			_vm->_gyro->newpointer(4); // fletch
 	}
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index b422f74..840c690 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -154,7 +154,7 @@ private:
 
 	void topcheck();
 
-	void verte();
+	void verte(Common::Point cursorPos);
 
 	int8 fades(int8 x);
 


Commit: 84bf98c9e5bd0d2b3a50f753714852e6d356d985
    https://github.com/scummvm/scummvm/commit/84bf98c9e5bd0d2b3a50f753714852e6d356d985
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-17T04:45:15-07:00

Commit Message:
AVALANCHE: Repair Avalot::handleKeyDown(), add comments to parser.h.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 229159f..3069c8a 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -107,7 +107,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
-		if (_vm->_gyro->alive) {
+		if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake) {
 			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 			_vm->_lucerna->showrw();
 			if (_vm->_gyro->demo)
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 6b92400..cac8aa2 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -35,9 +35,9 @@ class AvalancheEngine;
 
 class Parser {
 public:
-	Common::String _inputText;
+	Common::String _inputText; // Original name: current
 	Common::String _inputTextBackup;
-	byte _inputTextPos;
+	byte _inputTextPos; // Original name: curpos
 	bool _quote; // 66 or 99 next?
 	byte _leftMargin;
 	bool _cursorState;


Commit: 87159b96399b579cc79ce7d78e7710e34cabe460
    https://github.com/scummvm/scummvm/commit/87159b96399b579cc79ce7d78e7710e34cabe460
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-17T06:07:02-07:00

Commit Message:
AVALANCHE: Implement the rest of Lucerna::checkclick() and everything connected to it. (Except sounds.)

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 48c8118..0ba511e 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -44,6 +44,7 @@
 #include "common/textconsole.h"
 
 #include <cstring>
+#include <cmath>
 
 
 /*#include "NimUnit.h"*/
@@ -274,33 +275,38 @@ begin
 end;*/
 
 Common::String Acci::rank() {
-	byte fv;
-
-	Common::String rank_result = "";
-	for (fv = 1; fv <= 8; fv++) {
+	for (byte fv = 0; fv < 8; fv++) {
 		if ((_vm->_gyro->dna.score >= ranks[fv].score) && (_vm->_gyro->dna.score < ranks[fv + 1].score)) {
-			rank_result = ranks[fv].title;
-			return rank_result;
+			return ranks[fv].title;
 		}
 	}
-	
-	return rank_result;
+	return "";
 }
 
 Common::String Acci::totaltime() {
-	const double ticks_in_1_sec = double(65535) / 3600;
+	const double ticks_in_1_sec = (double)(65535) / 3600;
 	uint16 h, m, s;
 	Common::String a;
 
-	/* There are 65535 clock ticks in a second,
-		1092.25 in a minute, and
-		65535 in an hour. */
-	Common::String totaltime_result;
-		
-	warning("STUB: Acci::totaltime()");
-
-	totaltime_result = a;
-	return totaltime_result;
+	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
+	h = _vm->_gyro->dna.total_time / ticks_in_1_sec; // No. of seconds.
+	if (h < 0)
+		h = ceil((float)h);
+	else
+		h = floor((float)h);
+	m = h % 3600;
+	h = h / 3600;
+	s = m % 60;
+	m = m / 60;
+
+	a = "You've been playing for ";
+	if (h > 0)
+		a = a + _vm->_gyro->strf(h) + " hours, ";
+	if ((m > 0) || (h != 0))
+		a = a + _vm->_gyro->strf(m) + " minutes and ";
+	a = a + _vm->_gyro->strf(s) + " seconds.";
+
+	return a;
 }
 
 
@@ -602,8 +608,32 @@ void Acci::parse() {
 			_vm->_gyro->her = person;
 }
 
-void Acci::examobj() {   /* Examine a standard object-thing */
-	warning("STUB: Acci::examobj()");
+void Acci::examobj() {   
+	if (thing != _vm->_gyro->thinks)
+		_vm->_lucerna->thinkabout(thing, _vm->_gyro->a_thing);
+	switch (thing) {
+	case _vm->_gyro->wine :
+		switch (_vm->_gyro->dna.winestate) {// 4 is perfect wine. 0 is not holding the wine.
+		case 1:
+			_vm->_visa->dixi('t', 1); // Normal examine wine scroll
+			break; 
+		case 2:
+			_vm->_visa->dixi('d', 6); // Bad wine
+			break;
+		case 3:
+			_vm->_visa->dixi('d', 7); // Vinegar
+			break;
+		}
+		break;
+	case _vm->_gyro->onion:
+		if (_vm->_gyro->dna.rotten_onion)
+			_vm->_visa->dixi('q', 21); // Yucky onion.
+		else
+			_vm->_visa->dixi('t', 18);  // Normal onion scroll
+		break;       
+	default:
+		_vm->_visa->dixi('t', thing); // <<< Ordinarily
+	}
 }
 
 bool Acci::personshere() { // Person equivalent of "holding".
@@ -624,8 +654,19 @@ void Acci::exampers() {
 }
 
 bool Acci::holding() {
-	warning("STUB: Acci::holding()");
-	return true;
+	if ((51 <= thing) && (thing <= 99)) // Also.
+		return true;
+
+	bool holdingResult = false;
+
+	if (thing > 100)
+		_vm->_scrolls->display("Be reasonable!");
+	else if (!_vm->_gyro->dna.obj[thing])  // Verbs that need "thing" to be in the inventory.
+		_vm->_scrolls->display("You're not holding it, Avvy.");
+	else 
+		holdingResult = true;
+
+	return holdingResult;
 }
 
 
@@ -635,9 +676,21 @@ void Acci::special(bool before) {
 }
 
 void Acci::examine() {
-	/* Examine. EITHER it's an object OR it's an Also OR it's a person OR
-		it's something else. */
-	warning("STUB: Acci::examine()");
+	// EITHER it's an object OR it's an Also OR it's a person OR it's something else.
+	if ((person == pardon) && (thing != pardon)) {
+		if (holding()) {
+			// Remember: it's been Slipped! Ie subtract 49.
+			if ((1 <= thing) && (thing <= 49)) // Standard object
+				examobj();
+			else if ((50 <= thing) && (thing <= 100)) { // Also thing
+				special(true);
+				_vm->_scrolls->display(*_vm->_gyro->also[thing - 51][0]);
+				special(false);
+			}
+		}
+	} else if (person != pardon)
+		exampers();
+	else _vm->_scrolls->display("It's just as it looks on the picture.");  // Don't know: guess.
 }
 
 
@@ -1706,9 +1759,9 @@ void Acci::do_that() {
 		_vm->_lucerna->gameover();
 		break;
 	case vb_score:
-		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ",\3\rout of a " +
-				"possible 128.\r\rThis gives you a rank of " + rank() +
-				".\r\r" + totaltime());
+		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ',' + _vm->_scrolls->kControlCenter
+			+ _vm->_scrolls->kControlNewLine + "out of a possible 128." + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totaltime());
 		break;
 	case vb_put:
 		putproc();
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 2a97b98..2b174f0 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -169,7 +169,7 @@ private:
 
 	void clearuint16s();
 
-	void examobj();
+	void examobj(); // Examine a standard object-thing
 
 	bool personshere();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5762b76..f632a66 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -879,8 +879,43 @@ void Lucerna::topcheck() {
 	/* Do this one */
 }
 
-void Lucerna::mouseway() {
-	warning("STUB: Lucerna::mouseway()");
+void Lucerna::mouseway(const Common::Point &cursorPos) {
+	byte col = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
+
+	switch (col) {
+	case green: {
+			_vm->_gyro->dna.rw = _vm->_trip->up;
+			_vm->_trip->rwsp(0, _vm->_trip->up);
+			showrw();
+		}
+		break;
+	case brown: {
+			_vm->_gyro->dna.rw = _vm->_trip->down;
+			_vm->_trip->rwsp(0, _vm->_trip->down);
+			showrw();
+		}
+		break;
+	case cyan: {
+			_vm->_gyro->dna.rw = _vm->_trip->left;
+			_vm->_trip->rwsp(0, _vm->_trip->left);
+			showrw();
+		}
+		break;
+	case lightmagenta: {
+			_vm->_gyro->dna.rw = _vm->_trip->right;
+			_vm->_trip->rwsp(0, _vm->_trip->right);
+			showrw();
+		}
+		break;
+	case red:
+	case white:
+	case lightcyan:
+	case yellow: { // Fall-throughs are intended.
+			_vm->_trip->stopwalking();
+			showrw();
+		}
+		break;
+	}
 }
 
 void Lucerna::inkey() {
@@ -1000,88 +1035,54 @@ void Lucerna::checkclick() {
 			_vm->_gyro->newpointer(4); // fletch
 	}
 
-
-
-	//if (_vm->_gyro->mpress > 0) {
-	//	switch (_vm->_gyro->mpy) {
-	//	case RANGE_11(0, 10):
-	//		if (_vm->_gyro->dropsok)  topcheck();
-	//		break;
-	//	case 11 ... 158:
-	//		if (!_vm->_gyro->dropsok)
-	//			_vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
-	//		break;                    /* But otherwise, it's
- //                                      equivalent to pressing Enter. */
-	//	case RANGE_11(159, 169): { /* Click on command line */
-	//		cursor_off();
-	//		curpos = (_vm->_gyro->mx - 16) / 8;
-	//		if (curpos > length(current) + 1)
-	//			curpos = length(current) + 1;
-	//		if (curpos < 1)
-	//			curpos = 1;
-	//		cursor_on();
-	//	}
-	//	break;
-	//	case 170 ... 200:
-	//		switch (_vm->_gyro->mpx) { /* bottom check */
-	//		case 0 ... 207:
-	//			mouseway();
-	//			break;
-	//		case 208 ... 260: { /* Examine the thing */
-	//			do {
-	//				_vm->_gyro->check();
-	//			} while (!(_vm->_gyro->mrelease > 0));
-	//			if (_vm->_gyro->thinkthing) {
-	//				_vm->_acci->thing = _vm->_gyro->thinks;
-	//				_vm->_acci->thing += 49;
-	//				_vm->_acci->person = _vm->_acci->pardon;
-	//			} else {
-	//				_vm->_acci->person = _vm->_gyro->thinks;
-	//				_vm->_acci->thing = _vm->_acci->pardon;
-	//			}
-	//			callverb(_vm->_acci->vb_exam);
-	//		}
-	//		break;
-	//		case 261 ... 319: {
-	//			do {
-	//				checkclick();
-	//			} while (!(_vm->_gyro->mrelease > 0));
-	//			callverb(_vm->_acci->vb_score);
-	//		}
-	//		break;
-	//		case 320 ... 357: {
-	//			_vm->_trip->tr[0].xs = _vm->_gyro->walk;
-	//			_vm->_trip->newspeed();
-	//		}
-	//		break;
-	//		case 358 ... 395: {
-	//			_vm->_trip->tr[0].xs = _vm->_gyro->run;
-	//			_vm->_trip->newspeed();
-	//		}
-	//		break;
-	//		case 396 ... 483:
-	//			fxtoggle();
-	//			break; /* "sound" */
-	//			/*              484..534: begin { clock }
-	//			                         off; if getpixel(mx,my)=14 then mousetext:='#'+mousetext; on;
-	//			                        end;*/
-	//		case 535 ... 640:
-	//			_vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
-	//			break;
-	//		}
-	//		break;
-	//	}
-	//}
-
-	/* if mrelease>0 then
-	 begin
-	  if (cw<>177) and (mry>10) then
-	   begin to_do:=(((mrx-20) div 100)*20)+(mry div 10); closewin; end;
-	 end;*/
-
-
-
-	warning("STUB: Lucerna::checkclick()");
+	if (holdLeftMouse)
+		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Clink on the dropdown menu.
+			if (_vm->_gyro->dropsok)
+				topcheck();
+		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
+			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
+			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
+				_vm->_parser->_inputTextPos = _vm->_parser->_inputText.size() + 1;
+			if (_vm->_parser->_inputTextPos < 1)
+				_vm->_parser->_inputTextPos = 1;
+			_vm->_parser->_inputTextPos--;
+			_vm->_parser->plotText();
+		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
+			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
+				if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake)
+					mouseway(cursorPos);
+			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the thing.
+				do {
+					_vm->updateEvents();
+				} while (holdLeftMouse);
+
+				if (_vm->_gyro->thinkthing) {
+					_vm->_acci->thing = _vm->_gyro->thinks;
+					_vm->_acci->thing += 49;
+					_vm->_acci->person = _vm->_acci->pardon;
+				} else {
+					_vm->_acci->person = _vm->_gyro->thinks;
+					_vm->_acci->thing = _vm->_acci->pardon;
+				}
+				callverb(_vm->_acci->vb_exam);
+			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
+				do {
+					_vm->updateEvents();
+				} while (holdLeftMouse);
+
+				callverb(_vm->_acci->vb_score);
+			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
+				_vm->_trip->tr[0].xs = _vm->_gyro->walk;
+				_vm->_trip->newspeed();
+			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
+				_vm->_trip->tr[0].xs = _vm->_gyro->run;
+				_vm->_trip->newspeed();
+			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
+				fxtoggle();
+			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
+				_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
+		} else if (!_vm->_gyro->dropsok)
+			_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
 }
 
 void Lucerna::mouse_init() {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 840c690..8ab7342 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -70,7 +70,7 @@ public:
 
 	void points(byte num);      /* Add on no. of points */
 
-	void mouseway();
+	void mouseway(const Common::Point &cursorPos);
 
 	void inkey();
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d141edc..104a617 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -131,7 +131,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			// We have to draw the characters one-by-one because of the accidental font changes.
 			i++;
 			Common::String chr(z[xx]);
-			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, x * 8 + offset * 4 + i * 8, y, black);
+			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, black);
 
 			_vm->_logger->log_scrollchar(Common::String(z[xx]));
 			}
@@ -592,21 +592,21 @@ void Scrolls::natural() {   /* Natural state of bubbles */
 Common::String Scrolls::lsd() {
 	Common::String x;
 
-	Common::String lsd_result;
-	if (_vm->_gyro->dna.pence < 12) {
-		/* just pence */
+	if (_vm->_gyro->dna.pence < 12) { // just pence
 		x = _vm->_gyro->strf(_vm->_gyro->dna.pence) + 'd';
-	} else if (_vm->_gyro->dna.pence < 240) {
-		/* shillings & pence */
-		x = _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(12)) + '/';
-		if ((_vm->_gyro->dna.pence % int32(12)) == 0)  x = x + '-';
-		else x = x + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12));
-	} else   /* L, s & d */
-		x = Common::String('œ') + _vm->_gyro->strf(_vm->_gyro->dna.pence / int32(240)) + '.' + _vm->_gyro->strf((_vm->_gyro->dna.pence / int32(12)) % int32(20))
-			+ '.' + _vm->_gyro->strf(_vm->_gyro->dna.pence % int32(12));
-	if (_vm->_gyro->dna.pence > 12)  x = x + " (that's " + _vm->_gyro->strf(_vm->_gyro->dna.pence) + "d)";
-	lsd_result = x;
-	return lsd_result;
+	} else if (_vm->_gyro->dna.pence < 240) { // shillings & pence
+		x = _vm->_gyro->strf(_vm->_gyro->dna.pence / 12) + '/';
+		if ((_vm->_gyro->dna.pence % 12) == 0)
+			x = x + '-';
+		else
+			x = x + _vm->_gyro->strf(_vm->_gyro->dna.pence % 12);
+	} else // L, s & d
+		x = Common::String('œ') + _vm->_gyro->strf(_vm->_gyro->dna.pence / 240) + '.' + _vm->_gyro->strf((_vm->_gyro->dna.pence / 12) % 20)
+			+ '.' + _vm->_gyro->strf(_vm->_gyro->dna.pence % 12);
+	if (_vm->_gyro->dna.pence > 12)
+		x = x + " (that's " + _vm->_gyro->strf(_vm->_gyro->dna.pence) + "d)";
+	
+	return x;
 }
 
 
@@ -661,7 +661,9 @@ void Scrolls::calldrivers() {
 		}
 	}
 
-	for (fv = 0; fv < _vm->_gyro->bufsize; fv++)
+	uint16 size = _vm->_gyro->bufsize;
+
+	for (fv = 0; fv < size; fv++)
 		if (mouthnext) {
 			if (_vm->_gyro->buffer[fv] == kControlRegister)
 				param = 0;
@@ -734,8 +736,8 @@ void Scrolls::calldrivers() {
 			case kControlNegative: {
 				switch (param) {
 				case 1:
-					display(lsd() + kControlToBuffer);
-					break; /* insert cash balance (recursion) */
+					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
+					break; 
 				case 2:
 					display(_vm->_acci->words[_vm->_acci->first_password + _vm->_gyro->dna.pass_num].w + kControlToBuffer);
 					break;


Commit: 6555d7d5db7431f3c707da85c33925c415483898
    https://github.com/scummvm/scummvm/commit/6555d7d5db7431f3c707da85c33925c415483898
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-17T07:54:23-07:00

Commit Message:
AVALANCHE: Repair Scrolls::drawscroll().

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 104a617..8019a35 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -446,7 +446,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 		my += 12;
 	}
 
-	_vm->_gyro->underscroll = my * 2 + 12 + 1; // Multiplying because of the doubled screen height.
+	_vm->_gyro->underscroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	//my = getpixel(0, 0);


Commit: 50831c19018598bc4a9007e6d71cd3986e5fd196
    https://github.com/scummvm/scummvm/commit/50831c19018598bc4a9007e6d71cd3986e5fd196
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-17T08:14:00-07:00

Commit Message:
AVALANCHE: Implement Trip::newspeed().

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index dfcdd5c..1114bd5 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1077,9 +1077,29 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 }
 
 void Trip::newspeed() {
-/* Given that you've just changed the speed in triptype.xs, this adjusts
-	ix. */
-	warning("STUB: Trip::newspeed()");
+	// Given that you've just changed the speed in triptype.xs, this adjusts ix.
+	const bytefield lightspace = {40, 199, 47, 199};
+	byte page_;
+
+	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
+	//setactivepage(3);
+
+	if (tr[0].xs == _vm->_gyro->run)
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, yellow);
+	else
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, yellow);
+
+	if (tr[0].xs == _vm->_gyro->run)
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, lightblue);
+	else
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, lightblue);
+
+	_vm->_graphics->refreshScreen();
+
+	//setactivepage(1 - cp);
+	for (page_ = 0; page_ <= 1; page_ ++)
+		getset[page_].remember(lightspace);
+	
 }
 
 void Trip::rwsp(byte t, byte r) {


Commit: 8e0301973147ea864e073e1b9f52c9f59f1520b2
    https://github.com/scummvm/scummvm/commit/8e0301973147ea864e073e1b9f52c9f59f1520b2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-18T01:37:05-07:00

Commit Message:
AVALANCHE: Minor repairs in Avalanche and Trip.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c2d0e0b..b950bdb 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -123,7 +123,7 @@ Common::Platform AvalancheEngine::getPlatform() const {
 
 
 bool AvalancheEngine::hasFeature(EngineFeature f) const {
-	return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime);
+	return false;
 }
 
 const char *AvalancheEngine::getCopyrightString() const {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 1114bd5..d4573a0 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1082,6 +1082,7 @@ void Trip::newspeed() {
 	byte page_;
 
 	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
+
 	//setactivepage(3);
 
 	if (tr[0].xs == _vm->_gyro->run)
@@ -1094,9 +1095,8 @@ void Trip::newspeed() {
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, lightblue);
 
-	_vm->_graphics->refreshScreen();
-
 	//setactivepage(1 - cp);
+
 	for (page_ = 0; page_ <= 1; page_ ++)
 		getset[page_].remember(lightspace);
 	


Commit: c4891ace820ab47c5136e100adacd31418ea615a
    https://github.com/scummvm/scummvm/commit/c4891ace820ab47c5136e100adacd31418ea615a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-18T02:35:36-07:00

Commit Message:
AVALANCHE: Repair Acci::do_that(), remove comments from Lucerna::topcheck().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 0ba511e..087dd27 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1209,9 +1209,9 @@ void Acci::do_that() {
 	case vb_open:
 		opendoor();
 		break;
-	case vb_pause:
-		_vm->_scrolls->display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
-				"the mouse on the `O.K.\" box to continue.");
+	case vb_pause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
+		_vm->_scrolls->display(Common::String("Game paused.") + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+			+ "Press Enter, Esc, or click the mouse on the \"O.K.\" box to continue.");
 		break;
 	case vb_get:
 		if (thing != pardon) {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f632a66..f2ae72c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -874,9 +874,7 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 }
 
 void Lucerna::topcheck() {
-	/* Menuset */
 	_vm->_dropdown->ddm_m.getmenu(_vm->_gyro->mpx);
-	/* Do this one */
 }
 
 void Lucerna::mouseway(const Common::Point &cursorPos) {


Commit: b5914349400b95ac646926e69e5e3acf2094eff2
    https://github.com/scummvm/scummvm/commit/b5914349400b95ac646926e69e5e3acf2094eff2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-18T06:08:32-07:00

Commit Message:
AVALANCHE: Add saving/loading during run time.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b950bdb..f8e873b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -123,7 +123,7 @@ Common::Platform AvalancheEngine::getPlatform() const {
 
 
 bool AvalancheEngine::hasFeature(EngineFeature f) const {
-	return false;
+	return (f == kSupportsSavingDuringRuntime) || (f == kSupportsLoadingDuringRuntime);
 }
 
 const char *AvalancheEngine::getCopyrightString() const {
@@ -132,6 +132,24 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 
 
+bool AvalancheEngine::canSaveGameStateCurrently() {
+	return true;
+}
+
+Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
+	return Common::kNoError;
+}
+
+bool AvalancheEngine::canLoadGameStateCurrently() {
+	return true;
+}
+
+Common::Error AvalancheEngine::loadGameState(int slot, const Common::String &desc) {
+	return Common::kNoError;
+}
+
+
+
 void AvalancheEngine::updateEvents() {
 	Common::Event event;
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 2f20393..a027dc5 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -111,10 +111,16 @@ public:
 	bool hasFeature(EngineFeature f) const;
 	const char *getCopyrightString() const;
 
-	void updateEvents();
 
-	bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example.
 
+	virtual bool canSaveGameStateCurrently();
+	Common::Error saveGameState(int slot, const Common::String &desc);
+	virtual bool canLoadGameStateCurrently();
+	Common::Error loadGameState(int slot, const Common::String &desc);
+
+
+	void updateEvents();
+	bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example.
 	Common::Point getMousePos();
 
 protected:


Commit: 99b4b12b1cd1db9ab2ba092722a528c3703d93e9
    https://github.com/scummvm/scummvm/commit/99b4b12b1cd1db9ab2ba092722a528c3703d93e9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-19T09:18:02-07:00

Commit Message:
AVALANCHE: Add AvalancheEngine::synchronize(),   AvalancheEngine::generateSaveFileName(), AvalancheEngine::saveGame().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f8e873b..113b199 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -34,6 +34,9 @@
 #include "common/debug-channels.h"
 #include "common/config-manager.h"
 #include "common/textconsole.h"
+#include "common/savefile.h"
+
+
 
 #include "engines/util.h"
 
@@ -132,15 +135,252 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 
 
-bool AvalancheEngine::canSaveGameStateCurrently() {
+void AvalancheEngine::synchronize(Common::Serializer &sz) {
+	Common::String signature;
+	if (sz.isSaving()) {
+		signature = "AVAL";
+		for (uint16 i = 0; i < 4; i++) {
+			char actChr = signature[i];
+			sz.syncAsByte(actChr);
+		}
+	} else {
+		if (!signature.empty())
+			signature.clear();
+		for (uint16 i = 0; i < 4; i++) {
+			char actChr;
+			sz.syncAsByte(actChr);
+			signature += actChr;
+		}
+		if (signature != "AVAL")
+			error("Corrupted save file!");
+	}
+
+	//blockwrite(f, dna, sizeof(dna));
+	sz.syncAsByte(_gyro->dna.rw);
+	sz.syncAsByte(_gyro->dna.carrying);
+	for (byte i = 0; i < numobjs; i++)
+		sz.syncAsByte(_gyro->dna.obj[i]);
+	sz.syncAsSint16LE(_gyro->dna.score);
+	sz.syncAsSint32LE(_gyro->dna.pence);
+	sz.syncAsByte(_gyro->dna.room);
+	sz.syncAsByte(_gyro->dna.wearing);
+	sz.syncAsByte(_gyro->dna.swore);
+	sz.syncAsByte(_gyro->dna.saves);
+	sz.syncBytes(_gyro->dna.rooms, 100);
+	sz.syncAsByte(_gyro->dna.alcohol);
+	sz.syncAsByte(_gyro->dna.playednim);
+	sz.syncAsByte(_gyro->dna.wonnim);
+	sz.syncAsByte(_gyro->dna.winestate);
+	sz.syncAsByte(_gyro->dna.cwytalot_gone);
+	sz.syncAsByte(_gyro->dna.pass_num);
+	sz.syncAsByte(_gyro->dna.ayles_is_awake);
+	sz.syncAsByte(_gyro->dna.drawbridge_open);
+	sz.syncAsByte(_gyro->dna.avaricius_talk);
+	sz.syncAsByte(_gyro->dna.bought_onion);
+	sz.syncAsByte(_gyro->dna.rotten_onion);
+	sz.syncAsByte(_gyro->dna.onion_in_vinegar);
+	sz.syncAsByte(_gyro->dna.given2spludwick);
+	sz.syncAsByte(_gyro->dna.brummie_stairs);
+	sz.syncAsByte(_gyro->dna.cardiff_things);
+	sz.syncAsByte(_gyro->dna.cwytalot_in_herts);
+	sz.syncAsByte(_gyro->dna.avvy_is_awake);
+	sz.syncAsByte(_gyro->dna.avvy_in_bed);
+	sz.syncAsByte(_gyro->dna.user_moves_avvy);
+	sz.syncAsByte(_gyro->dna.dogfoodpos);
+	sz.syncAsByte(_gyro->dna.givenbadgetoiby);
+	sz.syncAsByte(_gyro->dna.friar_will_tie_you_up);
+	sz.syncAsByte(_gyro->dna.tied_up);
+	sz.syncAsByte(_gyro->dna.box_contents);
+	sz.syncAsByte(_gyro->dna.talked_to_crapulus);
+	sz.syncAsByte(_gyro->dna.jacques_awake);
+	sz.syncAsByte(_gyro->dna.ringing_bells);
+	sz.syncAsByte(_gyro->dna.standing_on_dais);
+	sz.syncAsByte(_gyro->dna.taken_pen);
+	sz.syncAsByte(_gyro->dna.arrow_triggered);
+	sz.syncAsByte(_gyro->dna.arrow_in_the_door);
+
+	if (sz.isSaving()) {
+		uint16 like2drinkSize = _gyro->dna.like2drink.size();
+		sz.syncAsUint16LE(like2drinkSize);
+		for (uint16 i = 0; i < like2drinkSize; i++) {
+			char actChr = _gyro->dna.like2drink[i];
+			sz.syncAsByte(actChr);
+		}
+
+		uint16 favourite_songSize = _gyro->dna.favourite_song.size();
+		sz.syncAsUint16LE(favourite_songSize);
+		for (uint16 i = 0; i < favourite_songSize; i++) {
+			char actChr = _gyro->dna.favourite_song[i];
+			sz.syncAsByte(actChr);
+		}
+
+		uint16 worst_place_on_earthSize = _gyro->dna.worst_place_on_earth.size();
+		sz.syncAsUint16LE(worst_place_on_earthSize);
+		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
+			char actChr = _gyro->dna.worst_place_on_earth[i];
+			sz.syncAsByte(actChr);
+		}
+
+		uint16 spare_eveningSize = _gyro->dna.spare_evening.size();
+		sz.syncAsUint16LE(spare_eveningSize);
+		for (uint16 i = 0; i < spare_eveningSize; i++) {
+			char actChr = _gyro->dna.spare_evening[i];
+			sz.syncAsByte(actChr);
+		}
+	} else {
+		if (!_gyro->dna.like2drink.empty())
+			_gyro->dna.like2drink.clear();
+		uint16 like2drinkSize;
+		sz.syncAsUint16LE(like2drinkSize);
+		for (uint16 i = 0; i < like2drinkSize; i++) {
+			char actChr;
+			sz.syncAsByte(actChr);
+			_gyro->dna.like2drink += actChr;
+		}
+
+		if (!_gyro->dna.favourite_song.empty())
+			_gyro->dna.favourite_song.clear();
+		uint16 favourite_songSize;
+		sz.syncAsUint16LE(favourite_songSize);
+		for (uint16 i = 0; i < favourite_songSize; i++) {
+			char actChr;
+			sz.syncAsByte(actChr);
+			_gyro->dna.favourite_song += actChr;
+		}
+
+		if (!_gyro->dna.worst_place_on_earth.empty())
+			_gyro->dna.worst_place_on_earth.clear();
+		uint16 worst_place_on_earthSize;
+		sz.syncAsUint16LE(worst_place_on_earthSize);
+		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
+			char actChr;
+			sz.syncAsByte(actChr);
+			_gyro->dna.worst_place_on_earth += actChr;
+		}
+
+		if (!_gyro->dna.spare_evening.empty())
+			_gyro->dna.spare_evening.clear();
+		uint16 spare_eveningSize;
+		sz.syncAsUint16LE(spare_eveningSize);
+		for (uint16 i = 0; i < spare_eveningSize; i++) {
+			char actChr;
+			sz.syncAsByte(actChr);
+			_gyro->dna.spare_evening += actChr;
+		}
+	}
+	
+	sz.syncAsSint32LE(_gyro->dna.total_time);
+	sz.syncAsByte(_gyro->dna.jumpstatus);
+	sz.syncAsByte(_gyro->dna.mushroom_growing);
+	sz.syncAsByte(_gyro->dna.spludwicks_here);
+	sz.syncAsByte(_gyro->dna.last_room);
+	sz.syncAsByte(_gyro->dna.last_room_not_map);
+	sz.syncAsByte(_gyro->dna.crapulus_will_tell);
+	sz.syncAsByte(_gyro->dna.enter_catacombs_from_lusties_room);
+	sz.syncAsByte(_gyro->dna.teetotal);
+	sz.syncAsByte(_gyro->dna.malagauche);
+	sz.syncAsByte(_gyro->dna.drinking);
+	sz.syncAsByte(_gyro->dna.entered_lusties_room_as_monk);
+	sz.syncAsByte(_gyro->dna.cat_x);
+	sz.syncAsByte(_gyro->dna.cat_y);
+	sz.syncAsByte(_gyro->dna.avvys_in_the_cupboard);
+	sz.syncAsByte(_gyro->dna.geida_follows);
+	sz.syncAsByte(_gyro->dna.geida_spin);
+	sz.syncAsByte(_gyro->dna.geida_time);
+	sz.syncAsByte(_gyro->dna.nextbell);
+	sz.syncAsByte(_gyro->dna.geida_given_potion);
+	sz.syncAsByte(_gyro->dna.lustie_is_asleep);
+	sz.syncAsByte(_gyro->dna.flip_to_where);
+	sz.syncAsByte(_gyro->dna.flip_to_ped);
+	sz.syncAsByte(_gyro->dna.been_tied_up);
+	sz.syncAsByte(_gyro->dna.sitting_in_pub);
+	sz.syncAsByte(_gyro->dna.spurge_talk);
+	sz.syncAsByte(_gyro->dna.met_avaroid);
+	sz.syncAsByte(_gyro->dna.taken_mushroom);
+	sz.syncAsByte(_gyro->dna.given_pen_to_ayles);
+	sz.syncAsByte(_gyro->dna.asked_dogfood_about_nim);
+
+
+	//for (byte groi = 0; groi < numtr; groi ++) {
+	//	if (tr[groi].quick) {
+	//		blockwrite(f, groi, 1);
+	//		tr[groi].savedata(f);
+	//	}
+	//}
+	for (byte i = 0; i < _trip->numtr; i++)
+		if (_trip->tr[i].quick) {
+			sz.syncAsByte(_trip->tr[i].whichsprite);
+			sz.syncAsByte(_trip->tr[i].face);
+			sz.syncAsByte(_trip->tr[i].step);
+			sz.syncAsSint16LE(_trip->tr[i].x);
+			sz.syncAsSint16LE(_trip->tr[i].y);
+			sz.syncAsByte(_trip->tr[i].ix);
+			sz.syncAsByte(_trip->tr[i].iy);
+			sz.syncAsByte(_trip->tr[i].visible);
+			sz.syncAsByte(_trip->tr[i].homing);
+			sz.syncAsByte(_trip->tr[i].check_me);
+			sz.syncAsByte(_trip->tr[i].count);
+			sz.syncAsByte(_trip->tr[i]._info.xw);
+			sz.syncAsByte(_trip->tr[i].xs);
+			sz.syncAsByte(_trip->tr[i].ys);
+			sz.syncAsByte(_trip->tr[i].totalnum);
+			sz.syncAsSint16LE(_trip->tr[i].hx);
+			sz.syncAsSint16LE(_trip->tr[i].hy);
+			sz.syncAsByte(_trip->tr[i].call_eachstep);
+			sz.syncAsByte(_trip->tr[i].eachstep);
+			sz.syncAsByte(_trip->tr[i].vanishifstill);
+		}
+
+	//groi = 177;
+	//blockwrite(f, groi, 1);
+
+	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
+	for (byte i = 0; i < 7; i++) {
+		sz.syncAsSint32LE(_timeout->times[i].time_left);
+		sz.syncAsByte(_timeout->times[i].then_where);
+		sz.syncAsByte(_timeout->times[i].what_for);
+	}
+
+	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
+	sz.syncBytes(_sequence->seq, _sequence->seq_length);
+}
+
+bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
 	return true;
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
-	return Common::kNoError;
+	return (saveGame(slot, desc) ? Common::kNoError : Common::kWritingFailed);
+}
+
+Common::String AvalancheEngine::generateSaveFileName(Common::String name, const int slot) {
+	name.toUppercase();
+	return Common::String::format("%s-%d.ASG", name.c_str(), slot);
+}
+
+bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
+	Common::String fileName = generateSaveFileName(desc, slot);
+	Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving(fileName);
+
+	if (!f) {
+		warning("Can't create file '%s', game not saved.", fileName.c_str());
+		return false;
+	}
+
+	Common::Serializer sz(NULL, f);
+
+	synchronize(sz);
+	
+	f->finalize();
+
+	delete f;
+
+	return true;
 }
 
-bool AvalancheEngine::canLoadGameStateCurrently() {
+
+
+bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
 	return true;
 }
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index a027dc5..39457ef 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -51,11 +51,14 @@
 #include "avalanche/dropdown2.h"
 #include "avalanche/closing2.h"
 
+#include "common/serializer.h"
+
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
 
 #include "graphics/cursorman.h"
 
+
 namespace Common {
 class RandomSource;
 }
@@ -113,14 +116,18 @@ public:
 
 
 
+	void synchronize(Common::Serializer &sz);
 	virtual bool canSaveGameStateCurrently();
 	Common::Error saveGameState(int slot, const Common::String &desc);
+	Common::String generateSaveFileName(Common::String name, const int slot);
+	bool saveGame(const int16 slot, const Common::String &desc);
+
 	virtual bool canLoadGameStateCurrently();
 	Common::Error loadGameState(int slot, const Common::String &desc);
 
 
 	void updateEvents();
-	bool getEvent(Common::Event &event); // A warpper around _eventMan->pollEvent(), se we can use it in Scrolls::normscroll() for example.
+	bool getEvent(Common::Event &event); // A wrapper around _eventMan->pollEvent(), so we can use it in Scrolls::normscroll() for example.
 	Common::Point getMousePos();
 
 protected:


Commit: 52c07d08c0602936f33ea569ea6515cc1ae9f976
    https://github.com/scummvm/scummvm/commit/52c07d08c0602936f33ea569ea6515cc1ae9f976
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-19T12:14:21-07:00

Commit Message:
AVALANCHE: AvalancheEngine: Revise synchronize(), saveGame(), loadGameState(). Add loadGame(). Rename generateSaveFileName() to getSaveFileName(). AvalancheMetaEngine: Add listSaves() and removeSaveState().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 113b199..44b736f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -36,10 +36,9 @@
 #include "common/textconsole.h"
 #include "common/savefile.h"
 
-
-
 #include "engines/util.h"
 
+#include "gui/saveload.h"
 
 
 namespace Avalanche {
@@ -136,25 +135,6 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
-	Common::String signature;
-	if (sz.isSaving()) {
-		signature = "AVAL";
-		for (uint16 i = 0; i < 4; i++) {
-			char actChr = signature[i];
-			sz.syncAsByte(actChr);
-		}
-	} else {
-		if (!signature.empty())
-			signature.clear();
-		for (uint16 i = 0; i < 4; i++) {
-			char actChr;
-			sz.syncAsByte(actChr);
-			signature += actChr;
-		}
-		if (signature != "AVAL")
-			error("Corrupted save file!");
-	}
-
 	//blockwrite(f, dna, sizeof(dna));
 	sz.syncAsByte(_gyro->dna.rw);
 	sz.syncAsByte(_gyro->dna.carrying);
@@ -353,13 +333,8 @@ Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &des
 	return (saveGame(slot, desc) ? Common::kNoError : Common::kWritingFailed);
 }
 
-Common::String AvalancheEngine::generateSaveFileName(Common::String name, const int slot) {
-	name.toUppercase();
-	return Common::String::format("%s-%d.ASG", name.c_str(), slot);
-}
-
 bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
-	Common::String fileName = generateSaveFileName(desc, slot);
+	Common::String fileName = getSaveFileName(slot);
 	Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving(fileName);
 
 	if (!f) {
@@ -367,6 +342,14 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 		return false;
 	}
 
+	char *signature = "AVAL";
+
+	f->write(signature, 4);
+
+	f->writeUint32LE(desc.size());
+
+	f->write(desc.c_str(), desc.size());
+
 	Common::Serializer sz(NULL, f);
 
 	synchronize(sz);
@@ -380,12 +363,47 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 
 
 
+Common::String AvalancheEngine::getSaveFileName(const int slot) {
+	Common::String upperName = _targetName;
+	upperName.toUppercase();
+	return upperName+ Common::String::format("-%02d.SAV", slot);
+}
+
+
+
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
 	return true;
 }
 
-Common::Error AvalancheEngine::loadGameState(int slot, const Common::String &desc) {
-	return Common::kNoError;
+Common::Error AvalancheEngine::loadGameState(int slot) {
+	return (loadGame(slot) ? Common::kNoError : Common::kReadingFailed);
+}
+
+bool AvalancheEngine::loadGame(const int16 slot) {
+	Common::String fileName = getSaveFileName(slot);
+	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
+
+	if (!f)
+		return false;
+	
+	// Check for our signature.
+	Common::String signature;
+	for (byte i = 0; i < 4; i++)
+		signature += f->readByte();
+	if (signature != "AVAL")
+		return false;
+
+	// We dont care about the description here.
+	uint32 descSize = f->readUint32LE();
+	f->skip(descSize);
+
+	Common::Serializer sz(f, NULL);
+
+	synchronize(sz);
+
+	delete f;
+
+	return true;
 }
 
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 39457ef..52472b6 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -117,13 +117,16 @@ public:
 
 
 	void synchronize(Common::Serializer &sz);
+
 	virtual bool canSaveGameStateCurrently();
 	Common::Error saveGameState(int slot, const Common::String &desc);
-	Common::String generateSaveFileName(Common::String name, const int slot);
 	bool saveGame(const int16 slot, const Common::String &desc);
 
+	Common::String getSaveFileName(const int slot);
+
 	virtual bool canLoadGameStateCurrently();
-	Common::Error loadGameState(int slot, const Common::String &desc);
+	Common::Error loadGameState(int slot);
+	bool loadGame(const int16 slot);
 
 
 	void updateEvents();
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 701f12b..fb68e2e 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -83,6 +83,10 @@ public:
 
 	bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
 	bool hasFeature(MetaEngineFeature f) const;
+
+	int getMaximumSaveSlot() const { return 99; }
+	SaveStateList listSaves(const char *target) const;
+	void removeSaveState(const char *target, int slot) const;
 };
 
 bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -92,7 +96,63 @@ bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const A
 }
 
 bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return false;
+	return (f == kSupportsListSaves) || (f == kSupportsDeleteSave);
+}
+
+SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringArray filenames;
+	Common::String pattern = target;
+	pattern.toUppercase();
+	pattern += "-??.SAV";
+
+	filenames = saveFileMan->listSavefiles(pattern);
+	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
+
+	SaveStateList saveList;
+	char slot[3];
+	int slotNum = 0;
+	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
+		slot[0] = filename->c_str()[filename->size() - 6];
+		slot[1] = filename->c_str()[filename->size() - 5];
+		slot[2] = '\0';
+		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
+		slotNum = atoi(slot);
+		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
+			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+			if (file) {
+				/*int saveVersion = file->readByte();
+
+				if (saveVersion != kSavegameVersion) {
+				warning("Savegame of incompatible version");
+				delete file;
+				continue;
+				}*/
+
+				// Read name
+				file->seek(4); // We skip the "AVAL" signature.
+				uint32 nameSize = file->readUint32LE();
+				if (nameSize >= 255) {
+					delete file;
+					continue;
+				}
+				char *name = new char[nameSize + 1];
+				file->read(name, nameSize);
+				name[nameSize] = 0;
+
+				saveList.push_back(SaveStateDescriptor(slotNum, name));
+				delete[] name;
+				delete file;
+			}
+		}
+	}
+
+	return saveList;
+}
+
+void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	g_system->getSavefileManager()->removeSavefile(fileName);
 }
 
 } // End of namespace Avalanche


Commit: f9047bb83d8b66a604ebb02dabe77974dd758a4e
    https://github.com/scummvm/scummvm/commit/f9047bb83d8b66a604ebb02dabe77974dd758a4e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-20T04:37:14-07:00

Commit Message:
AVALANCHE: Repair synchronize() and loadGame(), update canSaveGameStateCurrently() and canLoadGameStateCurrently() in AvalancheEngine.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 44b736f..8e4577a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -287,30 +287,60 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//		tr[groi].savedata(f);
 	//	}
 	//}
-	for (byte i = 0; i < _trip->numtr; i++)
-		if (_trip->tr[i].quick) {
-			sz.syncAsByte(_trip->tr[i].whichsprite);
-			sz.syncAsByte(_trip->tr[i].face);
-			sz.syncAsByte(_trip->tr[i].step);
-			sz.syncAsSint16LE(_trip->tr[i].x);
-			sz.syncAsSint16LE(_trip->tr[i].y);
-			sz.syncAsByte(_trip->tr[i].ix);
-			sz.syncAsByte(_trip->tr[i].iy);
-			sz.syncAsByte(_trip->tr[i].visible);
-			sz.syncAsByte(_trip->tr[i].homing);
-			sz.syncAsByte(_trip->tr[i].check_me);
-			sz.syncAsByte(_trip->tr[i].count);
-			sz.syncAsByte(_trip->tr[i]._info.xw);
-			sz.syncAsByte(_trip->tr[i].xs);
-			sz.syncAsByte(_trip->tr[i].ys);
-			sz.syncAsByte(_trip->tr[i].totalnum);
-			sz.syncAsSint16LE(_trip->tr[i].hx);
-			sz.syncAsSint16LE(_trip->tr[i].hy);
-			sz.syncAsByte(_trip->tr[i].call_eachstep);
-			sz.syncAsByte(_trip->tr[i].eachstep);
-			sz.syncAsByte(_trip->tr[i].vanishifstill);
+	
+	byte spriteNum;
+	if (sz.isSaving()) {
+		spriteNum = 0;
+		for (byte i = 0; i < _trip->numtr; i++)
+			if (_trip->tr[i].quick)
+				spriteNum++;
+	}
+	sz.syncAsByte(spriteNum);
+	
+	if (sz.isLoading())
+		for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites.
+			if (_trip->tr[i].quick)
+				_trip->tr[i].done();
 		}
 
+	for (byte i = 0; i < spriteNum; i++) {
+		sz.syncAsByte(_trip->tr[i].whichsprite);
+		sz.syncAsByte(_trip->tr[i].check_me);
+		
+	
+		if (sz.isLoading()) {
+			_trip->tr[i].quick = true;
+			_trip->tr[i].init(_trip->tr[i].whichsprite, _trip->tr[i].check_me, _trip);
+		}
+
+		sz.syncAsByte(_trip->tr[i].ix);
+		sz.syncAsByte(_trip->tr[i].iy);
+		sz.syncAsByte(_trip->tr[i].face);
+		sz.syncAsByte(_trip->tr[i].step);
+		sz.syncAsByte(_trip->tr[i].visible);
+		sz.syncAsByte(_trip->tr[i].homing);
+		sz.syncAsByte(_trip->tr[i].count);
+		sz.syncAsByte(_trip->tr[i]._info.xw);
+		sz.syncAsByte(_trip->tr[i].xs);
+		sz.syncAsByte(_trip->tr[i].ys);
+		sz.syncAsByte(_trip->tr[i].totalnum);
+		sz.syncAsSint16LE(_trip->tr[i].hx);
+		sz.syncAsSint16LE(_trip->tr[i].hy);
+		sz.syncAsByte(_trip->tr[i].call_eachstep);
+		sz.syncAsByte(_trip->tr[i].eachstep);
+		sz.syncAsByte(_trip->tr[i].vanishifstill);
+
+		sz.syncAsSint16LE(_trip->tr[i].x);
+		sz.syncAsSint16LE(_trip->tr[i].y);
+
+		if (sz.isLoading() && _trip->tr[i].visible)
+			_trip->tr[i].appear(_trip->tr[i].x, _trip->tr[i].y, _trip->tr[i].face);
+	}
+
+	
+
+
+
 	//groi = 177;
 	//blockwrite(f, groi, 1);
 
@@ -326,7 +356,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
-	return true;
+	return (!_gyro->seescroll);
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
@@ -372,7 +402,7 @@ Common::String AvalancheEngine::getSaveFileName(const int slot) {
 
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
-	return true;
+	return (!_gyro->seescroll);
 }
 
 Common::Error AvalancheEngine::loadGameState(int slot) {
@@ -403,6 +433,27 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	delete f;
 
+	_gyro->seescroll = true;  // This prevents display of the new sprites before the new picture is loaded.
+
+	if (_gyro->holdthedawn) {
+		_gyro->holdthedawn = false;
+		_lucerna->dawn();
+	}
+
+	_celer->forget_chunks();
+
+	_lucerna->minor_redraw();
+
+	_gyro->whereis[0] = _gyro->dna.room;
+	
+	_gyro->alive = true;
+
+	_lucerna->objectlist();
+
+	_trip->newspeed();
+
+	_lucerna->showrw();
+
 	return true;
 }
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f2ae72c..797dabd 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1268,12 +1268,11 @@ void Lucerna::gameover() {
   when you load a game, etc. Major redraws EVERYTHING. */
 
 void Lucerna::minor_redraw() {
-	byte fv;
-
 	dusk();
+
 	enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */
 
-	for (fv = 0; fv <= 1; fv ++) {
+	for (byte fv = 0; fv <= 1; fv ++) {
 		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
 		_vm->_trip->getback();
 	}


Commit: aab393077942224a5f376846582f7cd987366f75
    https://github.com/scummvm/scummvm/commit/aab393077942224a5f376846582f7cd987366f75
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-20T10:23:24-07:00

Commit Message:
AVALANCHE: Implement loading from the Launcher. Upgrade saveGame(), loadGame() in, add expandDate() to AvalancheEngine. Revise Avalot::setup(). Repair Lucerna::load() and triptype::init().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 8e4577a..e714f0b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -108,7 +108,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_lucerna->init();
 	_acci->init();
 	_basher->init();
-	
 
 	return Common::kNoError;
 }
@@ -337,10 +336,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 			_trip->tr[i].appear(_trip->tr[i].x, _trip->tr[i].y, _trip->tr[i].face);
 	}
 
-	
-
-
-
 	//groi = 177;
 	//blockwrite(f, groi, 1);
 
@@ -380,6 +375,12 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 
 	f->write(desc.c_str(), desc.size());
 
+	TimeDate t;
+	_system->getTimeAndDate(t);
+	f->writeSint16LE(t.tm_mday);
+	f->writeSint16LE(t.tm_mon);
+	f->writeSint16LE(t.tm_year);
+
 	Common::Serializer sz(NULL, f);
 
 	synchronize(sz);
@@ -423,9 +424,19 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	if (signature != "AVAL")
 		return false;
 
-	// We dont care about the description here.
+	// Read the description.
 	uint32 descSize = f->readUint32LE();
-	f->skip(descSize);
+	Common::String description;
+	for (uint32 i = 0; i < descSize; i++) {
+		char actChar = f->readByte();
+		description += actChar;
+	}
+	description.toUppercase();
+
+	TimeDate t;
+	t.tm_mday = f->readSint16LE();
+	t.tm_mon = f->readSint16LE();
+	t.tm_year = f->readSint16LE();
 
 	Common::Serializer sz(f, NULL);
 
@@ -444,6 +455,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->minor_redraw();
 
+	_dropdown->standard_bar();
+
 	_gyro->whereis[0] = _gyro->dna.room;
 	
 	_gyro->alive = true;
@@ -454,9 +467,49 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->showrw();
 
+	_gyro->ontoolbar = false;
+	_trip->trippancy_link();
+
+	_celer->pics_link();
+	
+	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
+		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
+		+ _gyro->roomname + _scrolls->kControlNewLine + _scrolls->kControlNewLine
+		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
+
+	if (_trip->tr[0].quick && _trip->tr[0].visible)
+		_trip->rwsp(0, _gyro->dna.rw);
+
 	return true;
 }
 
+Common::String AvalancheEngine::expandDate(int d, int m, int y) {
+	const Common::String months[12] = {
+		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+	};
+
+	Common::String month = months[m];
+
+	Common::String day = _gyro->strf(d);
+
+	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
+		switch (d % 10) {
+		case 1:
+			day = day + "st";
+			break;
+		case 2:
+			day = day + "nd";
+			break;
+		case 3:
+			day = day + "rd";
+			break;
+		default:
+			day = day + "th";
+		}
+
+	return day + ' ' + month + ' ' + _gyro->strf(y + 1900);
+}
+
 
 
 void AvalancheEngine::updateEvents() {
@@ -620,7 +673,7 @@ Common::Error AvalancheEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-		
+	
 
 	// From bootstrp:
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 52472b6..6b62ad7 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -127,6 +127,8 @@ public:
 	virtual bool canLoadGameStateCurrently();
 	Common::Error loadGameState(int slot);
 	bool loadGame(const int16 slot);
+	Common::String expandDate(int d, int m, int y);
+
 
 
 	void updateEvents();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3069c8a..9cf6660 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -50,6 +50,7 @@
 
 #include "common/str.h"
 #include "common/textconsole.h"
+#include "common/config-manager.h"
 
 
 
@@ -167,7 +168,6 @@ void Avalot::setup() {
 	_vm->_gyro->enid_filename = ""; /* undefined. */
 	_vm->_lucerna->toolbar();
 	_vm->_scrolls->state(2);
-	_vm->_graphics->refreshScreen(); //_vm->_pingo->copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
 
@@ -178,35 +178,6 @@ void Avalot::setup() {
 
 	_vm->_trip->loadtrip();
 
-	_vm->_gyro->reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
-
-	if ((_vm->_gyro->filetoload.empty()) && (! _vm->_gyro->reloaded))
-		_vm->_gyro->newgame(); /* no game was requested- load the default */
-	else {
-		if (! _vm->_gyro->reloaded)
-			_vm->_enid->avvy_background();
-		_vm->_dropdown->standard_bar();
-		_vm->_lucerna->sprite_run();
-		if (_vm->_gyro->reloaded)
-			_vm->_enid->edna_reload();
-		else {
-			/* Filename given on the command line (or loadfirst) */
-			_vm->_enid->edna_load(_vm->_gyro->filetoload);
-			if (_vm->_enid->there_was_a_problem()) {
-				_vm->_scrolls->display("So let's start from the beginning instead...");
-				_vm->_gyro->holdthedawn = true;
-				_vm->_lucerna->dusk();
-				_vm->_gyro->newgame();
-			}
-		}
-	}
-
-	if (! _vm->_gyro->reloaded) {
-		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
-		_vm->_lucerna->fxtoggle();
-		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
-	}
-
 	_vm->_trip->get_back_loretta();
 	//gm = getpixel(0: 0);
 	//setcolor(7);
@@ -216,13 +187,34 @@ void Avalot::setup() {
 	_vm->_parser->cursorOn();
 	_vm->_trip->newspeed();
 
-	if (! _vm->_gyro->reloaded)
+
+
+	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
+	if (loadSlot >= 0) {		
+		_vm->loadGame(loadSlot);
+
+		_vm->_gyro->reloaded = true;
+	} else
+		_vm->_gyro->reloaded = false;
+
+
+
+	if (!_vm->_gyro->reloaded) {
+		_vm->_gyro->newgame(); // No game was requested- load the default.
+
+		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
+		_vm->_lucerna->fxtoggle();
+		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
+
 		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
+	}	
 }
 
 void Avalot::run(Common::String arg) {
 	setup();
 
+	
+
 	do {
 		uint32 beginLoop = _vm->_system->getMillis();
 
@@ -249,6 +241,11 @@ void Avalot::run(Common::String arg) {
 		if (delay <= 55)
 			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
 
+		
+
+
+
+
 	} while (! _vm->_gyro->lmo);
 
 	//restorecrtmode();
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index fb68e2e..a81e9a3 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -96,7 +96,7 @@ bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const A
 }
 
 bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return (f == kSupportsListSaves) || (f == kSupportsDeleteSave);
+	return (f == kSupportsListSaves) || (f == kSupportsDeleteSave) || (f == kSupportsLoadingDuringStartup);
 }
 
 SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 797dabd..3fcb1ac 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -229,8 +229,13 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	}
 
 	f.seek(146);
-	for (byte i = 0; i < 30; i++)
-		_vm->_gyro->roomname += f.readByte();
+	if (!_vm->_gyro->roomname.empty())
+		_vm->_gyro->roomname.clear();
+	for (byte i = 0; i < 30; i++) {
+		char actChar = f.readByte();
+		if ((32 <= actChar) && (actChar <= 126))
+			_vm->_gyro->roomname += actChar;
+	}
 	/* Compression method byte follows this... */
 
 	f.seek(177);
@@ -254,16 +259,13 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
 
-	_vm->_graphics->refreshScreen();
-
 	f.close();
 
 
 
 	load_also(xx);
-	_vm->_celer->load_chunks(xx);
 
-	_vm->_graphics->refreshScreen(); // _vm->_pingo->copy03();  -  See Avalot::setup()
+	_vm->_celer->load_chunks(xx);
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
@@ -948,11 +950,11 @@ void Lucerna::fxtoggle() {
 
 void Lucerna::objectlist() {
 	_vm->_gyro->dna.carrying = 0;
-	if (_vm->_gyro->thinkthing && ! _vm->_gyro->dna.obj[_vm->_gyro->thinks])
+	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks])
 		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */
-	for (byte fv = 0; fv < numobjs; fv ++)
+	for (byte fv = 0; fv < numobjs; fv++)
 		if (_vm->_gyro->dna.obj[fv]) {
-			_vm->_gyro->dna.carrying ++;
+			_vm->_gyro->dna.carrying++;
 			_vm->_gyro->objlist[_vm->_gyro->dna.carrying] = fv + 1;
 		}
 }
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d4573a0..54312ce 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -79,7 +79,8 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 
 	inf.skip(2); // Replace variable named 'soa' in the original code.
 	
-	//inf.skip(1); // We don't need to read the size of the string as in the original code.
+	if (!a.name.empty())
+		a.name.clear();
 	byte nameSize = inf.readByte();
 	for (byte i = 0; i < nameSize; i++) 
 		a.name += inf.readByte();


Commit: f8796e720eea8122bf7ecef7f1dcd75c39b75a97
    https://github.com/scummvm/scummvm/commit/f8796e720eea8122bf7ecef7f1dcd75c39b75a97
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-20T12:26:23-07:00

Commit Message:
AVALANCHE: Add thumbnail support and version tracking to the saving/loading system. Repair Trip::trippancy_link().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index e714f0b..8c89317 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -39,6 +39,7 @@
 #include "engines/util.h"
 
 #include "gui/saveload.h"
+#include "graphics/thumbnail.h"
 
 
 namespace Avalanche {
@@ -361,19 +362,20 @@ Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &des
 bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 	Common::String fileName = getSaveFileName(slot);
 	Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving(fileName);
-
 	if (!f) {
 		warning("Can't create file '%s', game not saved.", fileName.c_str());
 		return false;
 	}
 
 	char *signature = "AVAL";
-
 	f->write(signature, 4);
 
-	f->writeUint32LE(desc.size());
+	// Write version. We can't restore from obsolete versions.
+	f->writeByte(kSavegameVersion);
 
+	f->writeUint32LE(desc.size());
 	f->write(desc.c_str(), desc.size());
+	::Graphics::saveThumbnail(*f);
 
 	TimeDate t;
 	_system->getTimeAndDate(t);
@@ -413,10 +415,9 @@ Common::Error AvalancheEngine::loadGameState(int slot) {
 bool AvalancheEngine::loadGame(const int16 slot) {
 	Common::String fileName = getSaveFileName(slot);
 	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
-
 	if (!f)
 		return false;
-	
+
 	// Check for our signature.
 	Common::String signature;
 	for (byte i = 0; i < 4; i++)
@@ -424,6 +425,14 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	if (signature != "AVAL")
 		return false;
 
+	// Check version. We can't restore from obsolete versions.
+	byte saveVersion = f->readByte();
+	if (saveVersion != kSavegameVersion) {
+		warning("Savegame of incompatible version!");
+		delete f;
+		return false;
+	}
+
 	// Read the description.
 	uint32 descSize = f->readUint32LE();
 	Common::String description;
@@ -433,6 +442,9 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	}
 	description.toUppercase();
 
+	::Graphics::skipThumbnail(*f);
+
+	// Read the time the game was saved.
 	TimeDate t;
 	t.tm_mday = f->readSint16LE();
 	t.tm_mon = f->readSint16LE();
@@ -478,7 +490,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
 
 	if (_trip->tr[0].quick && _trip->tr[0].visible)
-		_trip->rwsp(0, _gyro->dna.rw);
+		_trip->rwsp(0, _gyro->dna.rw); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index a81e9a3..39c6f08 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -87,6 +87,7 @@ public:
 	int getMaximumSaveSlot() const { return 99; }
 	SaveStateList listSaves(const char *target) const;
 	void removeSaveState(const char *target, int slot) const;
+	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
 };
 
 bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -96,7 +97,12 @@ bool AvalancheMetaEngine::createInstance(OSystem *syst, Engine **engine, const A
 }
 
 bool AvalancheMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return (f == kSupportsListSaves) || (f == kSupportsDeleteSave) || (f == kSupportsLoadingDuringStartup);
+	return
+		(f == kSupportsListSaves) ||
+		(f == kSupportsDeleteSave) ||
+		(f == kSupportsLoadingDuringStartup) ||
+		(f == kSavesSupportMetaInfo) ||
+		(f == kSavesSupportThumbnail);
 }
 
 SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
@@ -121,16 +127,25 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
 			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
 			if (file) {
-				/*int saveVersion = file->readByte();
+				// Check for our signature.
+				Common::String signature;
+				for (byte i = 0; i < 4; i++)
+					signature += file->readByte();
+				if (signature != "AVAL") {
+					warning("Savegame of incompatible type!");
+					delete file;
+					continue;
+				}
 
+				// Check version.
+				byte saveVersion = file->readByte();
 				if (saveVersion != kSavegameVersion) {
-				warning("Savegame of incompatible version");
-				delete file;
-				continue;
-				}*/
+					warning("Savegame of incompatible version!");
+					delete file;
+					continue;
+				}
 
-				// Read name
-				file->seek(4); // We skip the "AVAL" signature.
+				// Read name.
 				uint32 nameSize = file->readUint32LE();
 				if (nameSize >= 255) {
 					delete file;
@@ -155,6 +170,48 @@ void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
 	g_system->getSavefileManager()->removeSavefile(fileName);
 }
 
+SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
+
+	if (f) {
+		// Check for our signature.
+		Common::String signature;
+		for (byte i = 0; i < 4; i++)
+			signature += f->readByte();
+		if (signature != "AVAL") {
+			warning("Savegame of incompatible type!");
+			delete f;
+			return SaveStateDescriptor();
+		}
+
+		// Check version.
+		byte saveVersion = f->readByte();
+		if (saveVersion != kSavegameVersion) {
+			warning("Savegame of incompatible version!");
+			delete f;
+			return SaveStateDescriptor();
+		}
+
+		// Read the description.
+		uint32 descSize = f->readUint32LE();
+		Common::String description;
+		for (uint32 i = 0; i < descSize; i++) {
+			char actChar = f->readByte();
+			description += actChar;
+		}
+
+		SaveStateDescriptor desc(slot, description);
+
+		::Graphics::Surface *const thumbnail = ::Graphics::loadThumbnail(*f);
+		desc.setThumbnail(thumbnail);
+
+		delete f;
+		return desc;
+	}
+	return SaveStateDescriptor();
+}
+
 } // End of namespace Avalanche
 
 #if PLUGIN_ENABLED_DYNAMIC(AVALANCHE)
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 54312ce..0009477 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1415,7 +1415,7 @@ void Trip::trippancy_link() {
 	if (_vm->_gyro->ddmnow | _vm->_gyro->ontoolbar | _vm->_gyro->seescroll)
 		return;
 	for (fv = 0; fv < numtr; fv++) {
-		if (tr[fv].quick)
+		if (tr[fv].quick && tr[fv].visible)
 			tr[fv].walk();
 	}
 


Commit: 44f7802777df8b3dce2eaa25b66bfe0d0f094bdf
    https://github.com/scummvm/scummvm/commit/44f7802777df8b3dce2eaa25b66bfe0d0f094bdf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-21T04:45:22-07:00

Commit Message:
AVALANCHE: Rename Gyro::reloaded to Gyro::isLoaded. Repair a bug in the original engine regarding timing of animations/scrolls/etc. when loading a savegame using this variable.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 8c89317..2c4ae6f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -456,6 +456,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	delete f;
 
+	_gyro->isLoaded = true;
+
 	_gyro->seescroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
 	if (_gyro->holdthedawn) {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 9cf6660..cb73123 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -192,14 +192,12 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {		
 		_vm->loadGame(loadSlot);
-
-		_vm->_gyro->reloaded = true;
 	} else
-		_vm->_gyro->reloaded = false;
+		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
 
 
 
-	if (!_vm->_gyro->reloaded) {
+	if (!_vm->_gyro->isLoaded) {
 		_vm->_gyro->newgame(); // No game was requested- load the default.
 
 		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 7ddfe62..547b324 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -594,7 +594,7 @@ public:
 
 	uint16 storage_seg, storage_ofs; /* Seg and ofs of the Storage area. */
 	uint16 skellern; /* Offset of the timer variable - 1 more than storage_OFS */
-	bool reloaded; /* Is this NOT the primary loading? */
+	bool isLoaded; // Is it a loaded gamestate?
 
 	bool super_was_virtual, super_was_off; /* Used by Super_Off and Super_On */
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 459f124..dba7887 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -57,17 +57,22 @@ Timeout::Timeout(AvalancheEngine *vm) {
 }
 
 void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
-	fv = 0;
-	while ((fv < 7) && (times[fv].time_left != 0))
-		fv++;
-
-	if (fv == 7)
-		return; /* Oh dear... */
-
-	/* Everything's OK here! */
-	times[fv].time_left = howlong;
-	times[fv].then_where = whither;
-	times[fv].what_for = why;
+	if (_vm->_gyro->isLoaded == false) {
+		byte i = 0;
+		while ((i < 7) && (times[i].time_left != 0))
+			i++;
+
+		if (i == 7)
+			return; // Oh dear...
+
+		// Everything's OK here!
+		times[i].time_left = howlong;
+		times[i].then_where = whither;
+		times[i].what_for = why;
+	} else {
+		_vm->_gyro->isLoaded = false;
+		return;
+	}
 }
 
 void Timeout::one_tick() {


Commit: c43373f7ae714e5640452db026a0195b304c8ec1
    https://github.com/scummvm/scummvm/commit/c43373f7ae714e5640452db026a0195b304c8ec1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-21T09:01:31-07:00

Commit Message:
AVALANCHE: Implement opening of doors. Rethink a bit the graphics and the timer system to do so.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 087dd27..baecec9 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -758,7 +758,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 
 	switch (_vm->_gyro->dna.room) {   /* Special cases. */
 	case r__yours:
-		if (_vm->_trip->infield(2)) {
+		if (_vm->_trip->infield(1)) {
 			/* Opening the box. */
 			thing = 54; /* The box. */ person = pardon;
 			examine();
@@ -777,33 +777,32 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
 		return; /* No doors can open if you can't move Avvy. */
 
-	for (fv = 9; fv <= 15; fv++) {
+	for (fv = 8; fv < 15; fv++)
 		if (_vm->_trip->infield(fv)) {
-			{
-				_vm->_gyro->portals[fv];
-				switch (_vm->_gyro->portals[fv].op) {
-				case _vm->_gyro->exclaim:
-					_vm->_trip->tr[1].bounce();
-					_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
-					break;
-				case _vm->_gyro->transport:
-					_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
-					break;
-				case _vm->_gyro->unfinished:
-					_vm->_trip->tr[1].bounce();
-					_vm->_scrolls->display("Sorry. This place is not available yet!");
-					break;
-				case _vm->_gyro->special:
-					_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
-					break;
-				case _vm->_gyro->mopendoor:
-					_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
-					break;
-				}
+			fv -= 8;
+
+			switch (_vm->_gyro->portals[fv].op) {
+			case _vm->_gyro->exclaim:
+				_vm->_trip->tr[0].bounce();
+				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
+				break;
+			case _vm->_gyro->transport:
+				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
+				break;
+			case _vm->_gyro->unfinished:
+				_vm->_trip->tr[0].bounce();
+				_vm->_scrolls->display("Sorry. This place is not available yet!");
+				break;
+			case _vm->_gyro->special:
+				_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
+				break;
+			case _vm->_gyro->mopendoor:
+				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
+				break;
 			}
+			
 			return;
 		}
-	}
 
 	if (_vm->_gyro->dna.room == r__map)
 		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index cb73123..6968932 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -223,8 +223,8 @@ void Avalot::run(Common::String arg) {
 		_vm->_trip->readstick();
 		_vm->_gyro->force_numlock();
 		_vm->_trip->get_back_loretta();
-		_vm->_trip->trippancy_link();
 		_vm->_celer->pics_link();
+		_vm->_trip->trippancy_link();
 		_vm->_lucerna->checkclick();
 		
 		_vm->_timeout->one_tick();
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 061eb6b..3667ae1 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -347,7 +347,8 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 		break;
 	}
 
-	_vm->_graphics->drawPicture(picture, x * 8, y);
+	// These pictures are practically parts of the background. -10 is for the drop-down menu.
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, picture, x * 8, y - 10);
 }
 
 void Celer::show_one(byte which) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9ae0408..3821536 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -309,11 +309,11 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	return picture;
 }
 
-void Graphics::drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void Graphics::drawPicture(const ::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++)
 		for (uint16 x = 0; x < picture.w; x++)
-			*getPixel(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+			*(byte *)target.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
 }
 
 void Graphics::refreshScreen() {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 7492141..e8cf02a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -60,6 +60,10 @@ public:
 	static const int16 kScreenWidth = 640;
 	static const int16 kScreenHeight = 200;
 
+	static const uint16 kBackgroundWidth = kScreenWidth;
+	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151
+	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
+
 	::Graphics::Surface _surface;
 
 	::Graphics::Surface _background;
@@ -111,7 +115,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 
-	void drawPicture(const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(const ::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 
 	void refreshScreen();
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 547b324..09f5a92 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -479,6 +479,7 @@ public:
 
 	/* previous:^previoustype;*/
 	dnatype dna;
+	byte lineNum; // Number of lines.
 	linetype lines[50]; /* For Also. */
 	int16 c;
 	//registers r; // http://www.freepascal.org/docs-html/rtl/dos/registers.html
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3fcb1ac..18e5858 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -88,13 +88,11 @@ void Lucerna::draw_also_lines() {
 	CursorMan.showMouse(false);
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
-	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 161), 15);
-
-	for (ff = 0; ff < 50; ff++)
-		if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/)
-			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
-
+	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
+	for (ff = 0; ff < _vm->_gyro->lineNum; ff++)
+		_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
+		
 	CursorMan.showMouse(true);
 }
 
@@ -155,8 +153,8 @@ void Lucerna::load_also(Common::String n) {
 	memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines));
 	
 	//fv = getpixel(0, 0);
-	fv = f.readByte();
-	for (byte i = 0; i < fv; i++) {
+	_vm->_gyro->lineNum = f.readByte();
+	for (byte i = 0; i < _vm->_gyro->lineNum; i++) {
 		_vm->_gyro->lines[i].x1 = f.readSint16LE();
 		_vm->_gyro->lines[i].y1 = f.readSint16LE();
 		_vm->_gyro->lines[i].x2 = f.readSint16LE();
@@ -171,7 +169,7 @@ void Lucerna::load_also(Common::String n) {
 		_vm->_gyro->peds[i].y = f.readSint16LE();
 		_vm->_gyro->peds[i].dir = f.readByte();
 	}
-	
+
 	_vm->_gyro->numfields = f.readByte();
 	for (byte i = 0; i < _vm->_gyro->numfields; i++) {
 		_vm->_gyro->fields[i].x1 = f.readSint16LE();
@@ -251,13 +249,9 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	
 	
-	uint16 backgroundWidht = _vm->_graphics->kScreenWidth;
-	byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
-	// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
-
-	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
+	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
 
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
 
 	f.close();
 
@@ -756,7 +750,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
-	_vm->_graphics->drawPicture(picture, 205, 170);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
 
 	picture.free();
 	
@@ -813,7 +807,7 @@ void Lucerna::toolbar() {
 
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
-	_vm->_graphics->drawPicture(picture, 5, 169);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
 
 	picture.free();
 
@@ -849,7 +843,7 @@ void Lucerna::showscore() {
 
 	for (byte fv = 0; fv < 3; fv ++)
 		if (_vm->_gyro->lastscore[fv] != numbers[fv]) 
-			_vm->_graphics->drawPicture(_vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
+			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv ++)
 		_vm->_trip->getset[fv].remember(scorespace);
@@ -1144,7 +1138,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
 
-	_vm->_graphics->drawPicture(_vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
 
 	CursorMan.showMouse(true);
 	//setactivepage(1 - cp);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index bdc809e..fcca724 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -54,8 +54,7 @@ void Sequence::first_show(byte what) {
 }
 
 void Sequence::then_show(byte what) {
-	byte fv;
-	for (fv = 1; fv <= seq_length; fv++) {
+	for (byte fv = 0; fv < seq_length; fv++) {
 		if (seq[fv] == 0) {
 			seq[fv] = what;
 			return;
@@ -103,7 +102,7 @@ void Sequence::call_sequencer() {
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
 		/* Show a frame. */
-		_vm->_celer->show_one(seq[1]);
+		_vm->_celer->show_one(seq[0] - 1);
 		shove_left();
 	}
 	
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index dba7887..ece5317 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -57,7 +57,7 @@ Timeout::Timeout(AvalancheEngine *vm) {
 }
 
 void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
-	if (_vm->_gyro->isLoaded == false) {
+	if ((_vm->_gyro->isLoaded == false) || (timerLost == true)) {
 		byte i = 0;
 		while ((i < 7) && (times[i].time_left != 0))
 			i++;
@@ -221,6 +221,8 @@ void Timeout::lose_timer(byte which) {
 		if (times[fv].what_for == which)
 			times[fv].time_left = 0; // Cancel this one!
 	}
+
+	timerLost = true;
 }
 
 /*function timer_is_on(which:byte):boolean;
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index d315d59..80f0677 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -162,6 +162,8 @@ public:
 
 	timetype times[7];
 	
+	bool timerLost; // Is the timer "lost"?
+
 
 	
 	Timeout(AvalancheEngine *vm);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 0009477..637c510 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1392,16 +1392,8 @@ void Trip::call_andexors() {
 		}
 	} while (!ok);
 
-	// We redraw the background only if we have at least one moving character.
-	bool drawBG = false;
-	for (fv = 0; fv < 5; fv++) {
-		if (order[fv] > -1) {
-			drawBG = true;
-			break;
-		}
-	}
-	if (drawBG)
-		_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
+	
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
 
 	for (fv = 0; fv < 5; fv++) {
 		if (order[fv] > -1)
@@ -1646,9 +1638,9 @@ void Trip::fliproom(byte room, byte ped) {
 
 bool Trip::infield(byte which) {
 /* returns True if you're within field "which" */
-	int16 yy = tr[1].y + tr[1]._info.yl;
+	int16 yy = tr[0].y + tr[0]._info.yl;
 
-	return (tr[1].x >= _vm->_gyro->fields[which].x1) && (tr[1].x <= _vm->_gyro->fields[which].x2)
+	return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2)
 		&& (yy >= _vm->_gyro->fields[which].y1) && (yy <= _vm->_gyro->fields[which].y2);
 
 }


Commit: dbd330bf2fdfdae94d4e50e9c4e3fff2162de478
    https://github.com/scummvm/scummvm/commit/dbd330bf2fdfdae94d4e50e9c4e3fff2162de478
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-21T11:20:42-07:00

Commit Message:
AVALANCHE: Rename special() to openBox() in Acci, implement it.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index baecec9..39dfd88 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -671,8 +671,23 @@ bool Acci::holding() {
 
 
 
-void Acci::special(bool before) {
-	warning("STUB: Acci::special()");
+void Acci::openBox(bool before) {
+	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
+		_vm->_celer->show_one(4);
+
+		_vm->_celer->pics_link();
+		_vm->_trip->trippancy_link();
+		_vm->_graphics->refreshScreen();
+
+		_vm->_system->delayMillis(55);
+
+		if (!before) {
+			_vm->_celer->show_one(5);
+			_vm->_celer->pics_link();
+			_vm->_trip->trippancy_link();
+			_vm->_graphics->refreshScreen();
+		}
+	}
 }
 
 void Acci::examine() {
@@ -683,9 +698,9 @@ void Acci::examine() {
 			if ((1 <= thing) && (thing <= 49)) // Standard object
 				examobj();
 			else if ((50 <= thing) && (thing <= 100)) { // Also thing
-				special(true);
-				_vm->_scrolls->display(*_vm->_gyro->also[thing - 51][0]);
-				special(false);
+				openBox(true);
+				_vm->_scrolls->display(*_vm->_gyro->also[thing - 50][1]);
+				openBox(false);
 			}
 		}
 	} else if (person != pardon)
@@ -754,8 +769,6 @@ void Acci::lookaround() {
 }
 
 void Acci::opendoor() {   /* so whaddya THINK this does?! */
-	byte fv;
-
 	switch (_vm->_gyro->dna.room) {   /* Special cases. */
 	case r__yours:
 		if (_vm->_trip->infield(1)) {
@@ -777,7 +790,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
 		return; /* No doors can open if you can't move Avvy. */
 
-	for (fv = 8; fv < 15; fv++)
+	for (byte fv = 8; fv < 15; fv++)
 		if (_vm->_trip->infield(fv)) {
 			fv -= 8;
 
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 2b174f0..a635072 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -177,7 +177,7 @@ private:
 
 	bool holding();
 
-	void special(bool before);
+	void openBox(bool before);
 	void examine();
 
 	void inv();
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 5278a3d..82daf2e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -490,7 +490,7 @@ Common::String Gyro::get_better(byte which) {
 			get_better_result = better[which];
 		break;
 	default:
-		if ((which < numobjs) && (which > '\0'))
+		if ((which < numobjs) && (which > 0))
 			get_better_result = better[which];
 		else
 			get_better_result = "";
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 09f5a92..aa5a0fd 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -109,7 +109,7 @@ struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
 	bool friar_will_tie_you_up; /* If you're going to get tied up. */
 	bool tied_up; /* You ARE tied up! */
 
-	char box_contents; /* 0 = money (sixpence), 254 = empty, any
+	byte box_contents; /* 0 = money (sixpence), 254 = empty, any
 				other number implies the contents of the box. */
 
 	bool talked_to_crapulus; /* Pretty self-explanatory. */


Commit: 457d898ff3a5fe5ee156a6d03be49b144cab551e
    https://github.com/scummvm/scummvm/commit/457d898ff3a5fe5ee156a6d03be49b144cab551e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-23T02:33:37-07:00

Commit Message:
AVALANCHE: Upgrade Lucerna::enterroom(). Add r__yourhall to roomnums.h, handle it's cases in Lucerna:enterroom() and Trip::open_the_door(). Remove unnecessary typecasts in Celer::pics_link(), upgrade Celer::show_one(). Introduce Graphics::refreshBackground(), use it where needed.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/roomnums.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 39dfd88..d586519 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -673,7 +673,7 @@ bool Acci::holding() {
 
 void Acci::openBox(bool before) {
 	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
-		_vm->_celer->show_one(4);
+		_vm->_celer->show_one(5);
 
 		_vm->_celer->pics_link();
 		_vm->_trip->trippancy_link();
@@ -682,7 +682,7 @@ void Acci::openBox(bool before) {
 		_vm->_system->delayMillis(55);
 
 		if (!before) {
-			_vm->_celer->show_one(5);
+			_vm->_celer->show_one(6);
 			_vm->_celer->pics_link();
 			_vm->_trip->trippancy_link();
 			_vm->_graphics->refreshScreen();
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 3667ae1..7f19662 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -61,27 +61,27 @@ void Celer::pics_link() {
 	
 	switch (_vm->_gyro->dna.room) {
 	case r__outsideargentpub:
-		if ((_vm->_gyro->roomtime % int32(12)) == 0)
-			show_one(int32(1) + (_vm->_gyro->roomtime / int32(12)) % int32(4));
+		if ((_vm->_gyro->roomtime % 12) == 0)
+			show_one(1 + (_vm->_gyro->roomtime / 12) % 4);
 		break;
 
 	case r__brummieroad:
-		if ((_vm->_gyro->roomtime % int32(2)) == 0)
-			show_one(int32(1) + (_vm->_gyro->roomtime / int32(2)) % int32(4));
+		if ((_vm->_gyro->roomtime % 2) == 0)
+			show_one(1 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
 
 	case r__bridge:
-		if ((_vm->_gyro->roomtime % int32(2)) == 0)
-			show_one(int32(4) + (_vm->_gyro->roomtime / int32(2)) % int32(4));
+		if ((_vm->_gyro->roomtime % 2) == 0)
+			show_one(4 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
 
 	case r__yours:
-		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % int32(4)) == 0))
-			show_one(0 + (_vm->_gyro->roomtime / 12) % 2);
+		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0))
+			show_one(1 + (_vm->_gyro->roomtime / 12) % 2);
 		break;
 
 	case r__argentpub:
-		if (((_vm->_gyro->roomtime % int32(7)) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
+		if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
 			/* Malagauche cycle */
 			_vm->_gyro->dna.malagauche += 1;
 			switch (_vm->_gyro->dna.malagauche) {
@@ -138,7 +138,7 @@ void Celer::pics_link() {
 		break;
 
 	case r__westhall:
-		if ((_vm->_gyro->roomtime % int32(3)) == 0) {
+		if ((_vm->_gyro->roomtime % 3) == 0) {
 			switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) {
 			case 4:
 				show_one(1);
@@ -158,7 +158,7 @@ void Celer::pics_link() {
 
 	case r__lustiesroom:
 		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
-			if ((_vm->_gyro->roomtime % int32(45)) > 42)
+			if ((_vm->_gyro->roomtime % 45) > 42)
 				xx = 4; /* du Lustie blinks */
 
 			/* Bearing of Avvy from du Lustie. */
@@ -177,8 +177,8 @@ void Celer::pics_link() {
 		break;
 
 	case r__aylesoffice:
-		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % int32(14) == 0)) {
-			switch ((_vm->_gyro->roomtime / int32(14)) % int32(2)) {
+		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % 14 == 0)) {
+			switch ((_vm->_gyro->roomtime / 14) % 2) {
 			case 0:
 				show_one(1);
 				break; /* Frame 2: EGA. */
@@ -191,7 +191,7 @@ void Celer::pics_link() {
 
 	case r__robins:
 		if (_vm->_gyro->dna.tied_up) {
-			switch (_vm->_gyro->roomtime % int32(54)) {
+			switch (_vm->_gyro->roomtime % 54) {
 			case 20:
 				show_one(4);
 				break; /* Frame 4: Avalot blinks. */
@@ -241,7 +241,7 @@ void Celer::pics_link() {
 		else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
 			xx = 8; /* Right. */
 
-		if ((_vm->_gyro->roomtime % int32(45)) > 42)
+		if ((_vm->_gyro->roomtime % 45) > 42)
 			xx += 1; /* Duck blinks */
 
 		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@@ -255,7 +255,7 @@ void Celer::pics_link() {
 
 	if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) {
 		/* They're ringing the bells. */
-		switch (_vm->_gyro->roomtime % int32(4)) {
+		switch (_vm->_gyro->roomtime % 4) {
 		case 1:
 			if (_vm->_gyro->dna.nextbell < 5)
 				_vm->_gyro->dna.nextbell = 12;
@@ -353,7 +353,7 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 
 void Celer::show_one(byte which) {
 	chunkblocktype ch;
-	
+	which--; // For the difference between the Pascal and C array indexes.
 	//setactivepage(3);
 	warning("STUB: Celer::show_one()");
 
@@ -376,7 +376,7 @@ void Celer::show_one(byte which) {
 		ch.natural = f.readByte();
 		ch.memorise = f.readByte();
 
-		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, ch.xl * 8, ch.yl + 1); // There'll may be problems with the width!
+		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, ch.xl * 8, ch.yl + 1);
 
 		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, picture);
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 3821536..b6dbe16 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -328,5 +328,8 @@ void Graphics::refreshScreen() {
 	g_system->updateScreen();
 }
 
+void Graphics::refreshBackground() {
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
+}
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index e8cf02a..ca28772 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -119,6 +119,8 @@ public:
 
 	void refreshScreen();
 
+	void refreshBackground();
+
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 18e5858..3f86eb5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -251,7 +251,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	
 	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
 
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
+	_vm->_graphics->refreshBackground();
 
 	f.close();
 
@@ -388,6 +388,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__yours:
 		if (_vm->_gyro->dna.avvy_in_bed) {
 			_vm->_celer->show_one(3);
+			_vm->_graphics->refreshBackground();
 			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
 		}
 		break;
@@ -489,6 +490,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__bridge: {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
 			_vm->_celer->show_one(3); /* Position of drawbridge */
+			_vm->_graphics->refreshBackground();
 			_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
 		if (_vm->_gyro->dna.geida_follows)
@@ -517,6 +519,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		if (! _vm->_gyro->dna.mushroom_growing) 
 			_vm->_celer->show_one(3);
+		_vm->_graphics->refreshBackground();
 	}
 	break;
 
@@ -557,12 +560,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__argentpub: {
-		if (_vm->_gyro->dna.wonnim)  _vm->_celer->show_one(1);   /* No lute by the settle. */
+		if (_vm->_gyro->dna.wonnim)
+			_vm->_celer->show_one(1);   /* No lute by the settle. */
 		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
 		if (_vm->_gyro->dna.givenbadgetoiby) {
 			_vm->_celer->show_one(8);
 			_vm->_celer->show_one(9);
 		}
+		_vm->_graphics->refreshBackground();
 	}
 	break;
 
@@ -576,8 +581,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(4, ped);
-			if (_vm->_gyro->dna.lustie_is_asleep)
+			if (_vm->_gyro->dna.lustie_is_asleep) {
 				_vm->_celer->show_one(5);
+				_vm->_graphics->refreshBackground();
+			}
 		}
 	}
 	break;
@@ -586,13 +593,16 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.jacques_awake > 0) {
 			_vm->_gyro->dna.jacques_awake = 5;
 			_vm->_celer->show_one(2);
+			_vm->_graphics->refreshBackground();
 			_vm->_celer->show_one(4);
 			_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer->show_one(6);
-			_vm->_sequence->first_show(5);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(6);
+			_vm->_sequence->then_show(5);
 			_vm->_sequence->then_show(7);
 			_vm->_sequence->start_to_close();
 		}
@@ -602,7 +612,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsidenottspub:
 		if (ped == 2) {
 			_vm->_celer->show_one(3);
-			_vm->_sequence->first_show(2);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(3);
+			_vm->_sequence->then_show(2);
 			_vm->_sequence->then_show(1);
 			_vm->_sequence->then_show(4);
 			_vm->_sequence->start_to_close();
@@ -612,7 +624,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsideargentpub:
 		if (ped == 2)  {
 			_vm->_celer->show_one(6);
-			_vm->_sequence->first_show(5);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(6);
+			_vm->_sequence->then_show(5);
 			_vm->_sequence->then_show(7);
 			_vm->_sequence->start_to_close();
 		}
@@ -636,6 +650,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__insidecardiffcastle:
 		if (ped > 0) {
 			_vm->_trip->tr[1].init(10, false, _vm->_trip); /* Define the dart. */
+			_vm->_celer->show_one(1);
+			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
 				_vm->_sequence->then_show(3);
@@ -648,26 +664,40 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_sequence->start_to_close();
 		} else {
 			_vm->_celer->show_one(1);
-			if (_vm->_gyro->dna.arrow_in_the_door)  _vm->_celer->show_one(3);
-			else _vm->_celer->show_one(2);
+			if (_vm->_gyro->dna.arrow_in_the_door)
+				_vm->_celer->show_one(3);
+			else
+				_vm->_celer->show_one(2);
+			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case r__avvysgarden:
 		if (ped == 1)  {
 			_vm->_celer->show_one(2);
-			_vm->_sequence->first_show(1);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(2);
+			_vm->_sequence->then_show(1);
 			_vm->_sequence->then_show(3);
 			_vm->_sequence->start_to_close();
 		}
 		break;
-
+	
 	case r__entrancehall:
 	case r__insideabbey:
+	case r__yourhall:
 		if (ped == 2)  {
+			/* It was the original:
 			_vm->_celer->show_one(2);
 			_vm->_sequence->first_show(1);
 			_vm->_sequence->then_show(3);
+			_vm->_sequence->start_to_close();*/
+
+			_vm->_celer->show_one(2);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(2);
+			_vm->_sequence->then_show(1);
+			_vm->_sequence->then_show(3);
 			_vm->_sequence->start_to_close();
 		}
 		break;
@@ -675,6 +705,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__aylesoffice:
 		if (_vm->_gyro->dna.ayles_is_awake)
 			_vm->_celer->show_one(2);
+		_vm->_graphics->refreshBackground();
 		break; /* Ayles awake. */
 
 	case r__geidas:
@@ -702,6 +733,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped == 2) {
 			/* Shut the door */
 			_vm->_celer->show_one(3);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->first_show(3);
 			_vm->_sequence->first_show(2);
 			_vm->_sequence->then_show(1);
 			_vm->_sequence->then_show(4);
@@ -1291,16 +1324,16 @@ uint16 Lucerna::bearing(byte whichped) {
 	uint16 bearing_result; 
 	{
 		pedtype &with = _vm->_gyro->peds[whichped];
-		if (_vm->_trip->tr[1].x == with.x)
+		if (_vm->_trip->tr[0].x == with.x)
 			bearing_result = 0; /* This would cause a division by zero if we let it through. */
 		else {
 			/*
 			 bearing:=trunc(((arctan((_vm->_trip->tr[1].y-y)/(_vm->_trip->tr[1].x-x)))*rad2deg)+90) mod 360*/
 		
-			if (_vm->_trip->tr[1].x < with.x)
-				bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 90;
+			if (_vm->_trip->tr[0].x < with.x)
+				bearing_result = (atan(double((_vm->_trip->tr[0].y - with.y)) / (_vm->_trip->tr[0].x - with.x)) * rad2deg) + 90;
 			else
-				bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 270;
+				bearing_result = (atan(double((_vm->_trip->tr[0].y - with.y)) / (_vm->_trip->tr[0].x - with.x)) * rad2deg) + 270;
 		}
 	}
 	return bearing_result;
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index a6cb93b..fb99f5c 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -36,7 +36,7 @@ const byte r__nowhere = 0;
 const byte r__yours = 1;
 const byte r__outsideyours = 2;
 const byte r__outsidespludwicks = 3;
-//{ outside your castle = 5; }
+const byte r__yourhall = 5;
 const byte r__musicroom = 7;
 const byte r__outsideargentpub = 9;
 const byte r__argentroad = 10;
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index fcca724..6439df2 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -102,7 +102,7 @@ void Sequence::call_sequencer() {
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
 		/* Show a frame. */
-		_vm->_celer->show_one(seq[0] - 1);
+		_vm->_celer->show_one(seq[0]);
 		shove_left();
 	}
 	
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index ece5317..bbb5e8c 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -79,7 +79,7 @@ void Timeout::one_tick() {
 	if (_vm->_gyro->ddmnow)
 		return;
 
-	for (fv = 0; fv < 7; fv++) {
+	for (byte fv = 0; fv < 7; fv++) {
 		if (times[fv].time_left > 0) {
 			times[fv].time_left--;
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 637c510..12294ba 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1040,6 +1040,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 	case r__avvysgarden:
 	case r__entrancehall:
 	case r__insideabbey:
+	case r__yourhall:
 		_vm->_sequence->first_show(1);
 		_vm->_sequence->then_show(2);
 		break;
@@ -1393,7 +1394,7 @@ void Trip::call_andexors() {
 	} while (!ok);
 
 	
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
+	_vm->_graphics->refreshBackground();
 
 	for (fv = 0; fv < 5; fv++) {
 		if (order[fv] > -1)


Commit: 90da6c5e6c6adc20ff238a292c505bd0cd32b91c
    https://github.com/scummvm/scummvm/commit/90da6c5e6c6adc20ff238a292c505bd0cd32b91c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-23T05:56:56-07:00

Commit Message:
AVALANCHE: Repair Acci::do_that(), Gyro::getname(), Lucerna::find_people(), triptype::walkto().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d586519..731d297 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1839,11 +1839,11 @@ void Acci::do_that() {
 				break;
 			case _vm->_gyro->payles:
 				if (!_vm->_gyro->dna.ayles_is_awake)
-					_vm->_scrolls->display("You can't seem to wake _vm->_gyro->him by yourself.");
+					_vm->_scrolls->display("You can't seem to wake him by yourself.");
 				break;
 			case _vm->_gyro->pjacques:
-				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
-					"Hmmm... that doesn't seem to do any good...");
+				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + 
+					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
 			default:
 				_vm->_scrolls->display("It's difficult to awaken people who aren't asleep...!");
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 82daf2e..a7305c9 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -401,12 +401,10 @@ bool Gyro::pennycheck(uint16 howmuchby) {
 // There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
 // Keep an eye open!
 Common::String Gyro::getname(byte whose) { 
-	Common::String getname_result;
-	if (whose < 17)
-		getname_result = lads[whose];
+	if (whose < 175)
+		return lads[whose - 150];
 	else
-		getname_result = lasses[whose-17];
-	return getname_result;
+		return lasses[whose - 175];
 }
 
 // Keep an eye open! ^
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index aa5a0fd..cafaabb 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -570,7 +570,7 @@ public:
 
 	bool keyboardclick; /* Is a keyboard click noise wanted? */
 
-	char him, her, it;
+	byte him, her, it;
 	int32 roomtime; /* Set to 0 when you enter a room, added to in every loop.*/
 
 	bool after_the_scroll;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3f86eb5..1b4d835 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -281,9 +281,9 @@ void Lucerna::find_people(byte room) {
 	for (byte fv = 1; fv < 29; fv++) // There'll may be problems with this.
 		if (_vm->_gyro->whereis[fv] == room) {
 			if (fv < 25) // And this. See definition of whereis[].
-				_vm->_gyro->him = fv;
+				_vm->_gyro->him = fv + 150;
 			else
-				_vm->_gyro->her = fv;
+				_vm->_gyro->her = fv + 150;
 		}
 }
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 12294ba..afbe13b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -284,6 +284,7 @@ int8 triptype::sgn(int16 x) {
 }
 
 void triptype::walkto(byte pednum) {
+	pednum--; // Pascal -> C conversion: different array indexes.
 	speed(sgn(_tr->_vm->_gyro->peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro->peds[pednum].y - y));
 	hx = _tr->_vm->_gyro->peds[pednum].x - _info.xl / 2;
 	hy = _tr->_vm->_gyro->peds[pednum].y - _info.yl;


Commit: 38c51209a406ac3ed8c5c0fbfd250ca3c01e4c10
    https://github.com/scummvm/scummvm/commit/38c51209a406ac3ed8c5c0fbfd250ca3c01e4c10
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-23T07:03:06-07:00

Commit Message:
AVALANCHE: Upgrade Trip::apped(). Update rest of the code to call it and the previously upgraded Celer::show_one() properly.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 731d297..a8fb0a6 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1016,9 +1016,9 @@ void Acci::stand_up() {
 			}
 			_vm->_trip->tr[0].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
-			_vm->_trip->apped(0, 1);
+			_vm->_trip->apped(1, 2);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer->show_one(3); /* Picture of empty pillow. */
+			_vm->_celer->show_one(4); /* Picture of empty pillow. */
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
@@ -1831,7 +1831,7 @@ void Acci::do_that() {
 					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer->show_one(2); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->show_one(3); /* Picture of Avvy, awake in bed. */
 					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1b4d835..277069d 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -354,7 +354,7 @@ void Lucerna::put_geida_at(byte whichped, byte &ped) {
 	if (ped == 0)
 		return;
 	_vm->_trip->tr[1].init(5, false, _vm->_trip); /* load Geida */
-	_vm->_trip->apped(1, whichped);
+	_vm->_trip->apped(2, whichped);
 	_vm->_trip->tr[1].call_eachstep = true;
 	_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
 }
@@ -401,10 +401,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip->tr[1].init(8, false, _vm->_trip); /* load Crapulus */
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
-					_vm->_trip->apped(1, 3); /* Start on the right-hand side of the screen. */
-					_vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
+					_vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
+					_vm->_trip->tr[1].walkto(5); /* Walks up to greet you. */
 				} else {
-					_vm->_trip->apped(1, 4); /* Starts where he was before. */
+					_vm->_trip->apped(2, 5); /* Starts where he was before. */
 					_vm->_trip->tr[1].face = 3;
 				}
 
@@ -415,15 +415,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 			if (_vm->_gyro->dna.crapulus_will_tell) {
 				_vm->_trip->tr[1].init(8, false, _vm->_trip);
-				_vm->_trip->apped(1, 1);
-				_vm->_trip->tr[1].walkto(3);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[1].walkto(4);
 				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
 				_vm->_gyro->dna.crapulus_will_tell = false;
 			}
 		}
 		break;
 
-
 	case r__outsidespludwicks:
 		if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->reason_explosion);
@@ -435,7 +434,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.spludwicks_here) {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(2, false, _vm->_trip); /* load Spludwick */
-				_vm->_trip->apped(1, 1);
+				_vm->_trip->apped(2, 2);
 				_vm->_gyro->whereis[1] = r__spludwicks;
 			}
 
@@ -460,11 +459,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
 
 				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
-					_vm->_trip->apped(1, 1); /* He appears on the right of the screen... */
+					_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
 					_vm->_trip->tr[1].walkto(4); /* ...and he walks up... */
 				} else {
 					/* You've been here before. */
-					_vm->_trip->apped(1, 3); /* He's standing in your way straight away... */
+					_vm->_trip->apped(2, 4); /* He's standing in your way straight away... */
 					_vm->_trip->tr[1].face = _vm->_trip->left;
 				}
 			}
@@ -477,8 +476,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
 			_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
-			_vm->_trip->apped(1, 0);
-			_vm->_trip->tr[1].walkto(1);
+			_vm->_trip->apped(2, 1);
+			_vm->_trip->tr[1].walkto(2);
 			_vm->_trip->tr[1].vanishifstill = true;
 			with.cwytalot_in_herts = true;
 			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
@@ -503,8 +502,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			if (! _vm->_gyro->dna.been_tied_up) {
 				/* A welcome party... or maybe not... */
 				_vm->_trip->tr[1].init(6, false, _vm->_trip);
-				_vm->_trip->apped(1, 1);
-				_vm->_trip->tr[1].walkto(2);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[1].walkto(3);
 				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
 			}
 		}
@@ -528,8 +527,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			switch (_vm->_gyro->dna.cardiff_things) {
 			case 0 : { /* You've answered NONE of his questions. */
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
-				_vm->_trip->apped(1, 1);
-				_vm->_trip->tr[1].walkto(2);
+				_vm->_trip->apped(2, 2);
+				_vm->_trip->tr[1].walkto(3);
 				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
 			}
 			break;
@@ -538,7 +537,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				break; /* You've answered ALL his questions. => nothing happens. */
 			default: { /* You've answered SOME of his questions. */
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
-				_vm->_trip->apped(1, 2);
+				_vm->_trip->apped(2, 3);
 				_vm->_trip->tr[1].face = _vm->_trip->right;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
@@ -635,10 +634,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__wisewomans: {
 		_vm->_trip->tr[1].init(11, false, _vm->_trip);
 		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_trip->apped(1, 1); /* Start on the right-hand side of the screen. */
+			_vm->_trip->apped(2, 2); /* Start on the right-hand side of the screen. */
 			_vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
 		} else {
-			_vm->_trip->apped(1, 3); /* Starts where she was before. */
+			_vm->_trip->apped(2, 4); /* Starts where she was before. */
 			_vm->_trip->tr[1].face = 3;
 		}
 
@@ -741,6 +740,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_sequence->start_to_close();
 		}
 		break;
+
 	case r__ducks:
 		_vm->_gyro->dna.dogfoodpos = 1;
 		break; /* Actually, Duck pos. */
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index afbe13b..d55567c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1135,6 +1135,8 @@ void Trip::rwsp(byte t, byte r) {
 }
 
 void Trip::apped(byte trn, byte np) {
+	trn--;
+	np--;
 	tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info.xl / 2, _vm->_gyro->peds[np].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
 	rwsp(trn, _vm->_gyro->peds[np].dir);
 }
@@ -1622,7 +1624,7 @@ void Trip::fliproom(byte room, byte ped) {
 		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
 
 	_vm->_lucerna->enterroom(room, ped);
-	apped(0, ped - 1);
+	apped(1, ped);
 	_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
 	_vm->_gyro->dna.rw = tr[0].face;


Commit: c19b50b3f4228cea0d672982bf3a7bc94e9050b2
    https://github.com/scummvm/scummvm/commit/c19b50b3f4228cea0d672982bf3a7bc94e9050b2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-23T07:58:22-07:00

Commit Message:
AVALANCHE: Upgrade Trip::infield(), update the rest of the code accordingly. Repair Trip::neardoor(). Introduce Parser::handleFunctionKey(), partially implement it. Implement Gyro::f5_does(). Implement missing part of Lucerna::enterroom().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index a8fb0a6..77f7b44 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -771,7 +771,7 @@ void Acci::lookaround() {
 void Acci::opendoor() {   /* so whaddya THINK this does?! */
 	switch (_vm->_gyro->dna.room) {   /* Special cases. */
 	case r__yours:
-		if (_vm->_trip->infield(1)) {
+		if (_vm->_trip->infield(2)) {
 			/* Opening the box. */
 			thing = 54; /* The box. */ person = pardon;
 			examine();
@@ -791,7 +791,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 		return; /* No doors can open if you can't move Avvy. */
 
 	for (byte fv = 8; fv < 15; fv++)
-		if (_vm->_trip->infield(fv)) {
+		if (_vm->_trip->infield(fv + 1)) {
 			fv -= 8;
 
 			switch (_vm->_gyro->portals[fv].op) {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6968932..95f564e 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -67,8 +67,11 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	//	click();
 	//	
 	// To be implemented later with the sounds, I assume.
+	
 
-	if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
+	if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15))
+		_vm->_parser->handleFunctionKey(event);
+	else if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
 		_vm->_parser->handleInputText(event);
 	else
 		switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
@@ -211,13 +214,13 @@ void Avalot::setup() {
 void Avalot::run(Common::String arg) {
 	setup();
 
-	
-
 	do {
 		uint32 beginLoop = _vm->_system->getMillis();
 
 		_vm->updateEvents(); // The event handler.
 
+
+
 		_vm->_lucerna->clock_lucerna();
 		_vm->_dropdown->menu_link();
 		_vm->_trip->readstick();
@@ -226,24 +229,27 @@ void Avalot::run(Common::String arg) {
 		_vm->_celer->pics_link();
 		_vm->_trip->trippancy_link();
 		_vm->_lucerna->checkclick();
-		
 		_vm->_timeout->one_tick();
 
 
 
-		// Not in the original:
+		// ONLY FOR TESTING!!!
+		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
+			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+
+		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
+			if (_vm->_gyro->fields[i].x1 < 640)
+				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+		}
+		// ONYL FOR TESTING!!!
+
+
 
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
 		if (delay <= 55)
 			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
-
-		
-
-
-
-
 	} while (! _vm->_gyro->lmo);
 
 	//restorecrtmode();
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index a7305c9..4ae61c2 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -498,8 +498,34 @@ Common::String Gyro::get_better(byte which) {
 
 
 Common::String Gyro::f5_does() {
-	warning("STUB: Gyro::f5_does()");
-	return "STUB: Gyro::f5_does()";
+	Common::String f5_does_result;
+	switch (dna.room) {
+	case r__yours: {
+			if (!dna.avvy_is_awake)
+				return Common::String(_vm->_acci->vb_wake) + "WWake up";
+			else if (dna.avvy_in_bed)
+				return Common::String(_vm->_acci->vb_stand) + "GGet up";
+		}
+		break;
+	case r__insidecardiffcastle: 
+		if (dna.standing_on_dais)
+			return Common::String(_vm->_acci->vb_climb) + "CClimb down";
+		else
+			return Common::String(_vm->_acci->vb_climb) + "CClimb up";
+		break;
+	case r__nottspub:
+		if (dna.sitting_in_pub)
+			return Common::String(_vm->_acci->vb_stand) + "SStand up";
+		else
+			return Common::String(_vm->_acci->vb_sit) + "SSit down";
+		break;
+	case r__musicroom:
+		if (_vm->_trip->infield(7))
+			return Common::String(_vm->_acci->vb_play) + "PPlay the harp";
+		break;
+	}
+
+	return Common::String(_vm->_acci->pardon); /* If all else fails... */
 }
 
 void Gyro::load_a_mouse(byte which) {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 277069d..48b17c4 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -549,7 +549,23 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__map: {
-		warning("STUB: Lucerna::enterroom() - case: r__map");
+		/* You're entering the map. */
+		dawn();
+		//setactivepage(cp);
+		if (ped > 0)
+			zoomout(_vm->_gyro->peds[ped - 1].x, _vm->_gyro->peds[ped - 1].y);
+		//setactivepage(1 - cp);
+
+		{
+			dnatype &with = _vm->_gyro->dna;
+			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine]) && (_vm->_gyro->dna.winestate != 3)) {
+				_vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */
+				_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
+				objectlist();
+			}
+		}
+
+		_vm->_visa->dixi('q', 69);
 	}
 	break;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index c996a30..d52ab86 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -85,6 +85,20 @@ void Parser::handleReturn() {
 	}
 }
 
+void Parser::handleFunctionKey(const Common::Event &event) {
+	switch (event.kbd.keycode) {
+	case Common::KEYCODE_F5: {
+		_vm->_acci->person = _vm->_acci->pardon;
+		_vm->_acci->thing = _vm->_acci->pardon;
+		_vm->_lucerna->callverb(_vm->_gyro->f5_does()[0]);
+		}
+		break;
+	case Common::KEYCODE_F7:
+		_vm->_lucerna->callverb(_vm->_acci->vb_open);
+		break;
+	}
+}
+
 void Parser::plotText() {
 	if (_vm->_gyro->mouse_near_text())
 		CursorMan.showMouse(false);
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index cac8aa2..da2b761 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -52,6 +52,8 @@ public:
 
 	void handleReturn();
 
+	void handleFunctionKey(const Common::Event &event);
+
 	void plotText();
 
 	void cursorOn();
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d55567c..7dbda47 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1641,7 +1641,8 @@ void Trip::fliproom(byte room, byte ped) {
 }
 
 bool Trip::infield(byte which) {
-/* returns True if you're within field "which" */
+	which--; // Pascal -> C: different array indexes.
+
 	int16 yy = tr[0].y + tr[0]._info.yl;
 
 	return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2)
@@ -1649,29 +1650,19 @@ bool Trip::infield(byte which) {
 
 }
 
-bool Trip::neardoor() {       /* returns True if you're near a door! */
-	int16 ux, uy;
-	byte fv;
-	bool nd;
-
-	bool neardoor_result;
+bool Trip::neardoor() {
 	if (_vm->_gyro->numfields < 9) {
 		/* there ARE no doors here! */
-		neardoor_result = false;
-		return neardoor_result;
+		return false;
 	}
 		
-	ux = tr[1].x;
-	uy = tr[1].y + tr[1]._info.yl;
-		
-	nd = false;
-	for (fv = 9; fv <= _vm->_gyro->numfields; fv++) {
-		_vm->_gyro->fields[fv];
-
+	int16 ux = tr[0].x;
+	int16 uy = tr[0].y + tr[0]._info.yl;
+	bool nd = false;
+	for (byte fv = 9; fv <= _vm->_gyro->numfields; fv++)
 		if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
 			&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2)) 
 			nd = true;
-	}
 	return nd;
 }
 
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 7c86b40..cc13c9b 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -206,9 +206,9 @@ public:
 
 	void fliproom(byte room, byte ped);
 
-	bool infield(byte which);          /* returns True if you're within field "which" */
+	bool infield(byte which); // Returns true if you're within field "which".
 
-	bool neardoor();        /* returns True if you're near a door! */
+	bool neardoor(); // Returns True if you're near a door.
 
 	void readstick();
 


Commit: 29f159b3ac05499eebf8a76f9bb59034f74c338c
    https://github.com/scummvm/scummvm/commit/29f159b3ac05499eebf8a76f9bb59034f74c338c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-25T04:25:50-07:00

Commit Message:
AVALANCHE: Implement/repair Acci::do_that() and (almost) everything connected to it.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 77f7b44..5cfafd1 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -672,21 +672,19 @@ bool Acci::holding() {
 
 
 void Acci::openBox(bool before) {
-	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
-		_vm->_celer->show_one(5);
+	_vm->_celer->show_one(5);
 
+	_vm->_celer->pics_link();
+	_vm->_trip->trippancy_link();
+	_vm->_graphics->refreshScreen();
+
+	_vm->_system->delayMillis(55);
+
+	if (!before) {
+		_vm->_celer->show_one(6);
 		_vm->_celer->pics_link();
 		_vm->_trip->trippancy_link();
 		_vm->_graphics->refreshScreen();
-
-		_vm->_system->delayMillis(55);
-
-		if (!before) {
-			_vm->_celer->show_one(6);
-			_vm->_celer->pics_link();
-			_vm->_trip->trippancy_link();
-			_vm->_graphics->refreshScreen();
-		}
 	}
 }
 
@@ -718,7 +716,61 @@ void Acci::inv() {   /* the time-honoured command... */
 }
 
 void Acci::swallow() {   /* Eat something. */
-	warning("STUB: Acci::swallow()");
+	switch (thing) {
+	case _vm->_gyro->wine:
+		switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */
+		case 1: {
+			if (_vm->_gyro->dna.teetotal)  {
+				_vm->_visa->dixi('D', 6);
+				return;
+			}
+			_vm->_visa->dixi('U', 1);
+			_vm->_pingo->wobble();
+			_vm->_visa->dixi('U', 2);
+			_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
+			_vm->_lucerna->objectlist();
+			have_a_drink();
+				}
+				break;
+		case 2:
+		case 3:
+			_vm->_visa->dixi('d', 8);
+			break; /* You can't drink it! */
+		}
+		break;
+	case _vm->_gyro->potion: {
+			_vm->_gyro->background(4);
+			_vm->_visa->dixi('U', 3);
+			_vm->_lucerna->gameover();
+			_vm->_gyro->background(0);
+		}
+		break;
+	case _vm->_gyro->ink:
+		_vm->_visa->dixi('U', 4);
+		break;
+	case _vm->_gyro->chastity:
+		_vm->_visa->dixi('U', 5);
+		break;
+	case _vm->_gyro->mushroom: {
+			_vm->_visa->dixi('U', 6);
+			_vm->_lucerna->gameover();
+		}
+		break;
+	case _vm->_gyro->onion:
+		if (_vm->_gyro->dna.rotten_onion)  _vm->_visa->dixi('U', 11);
+		else {
+			_vm->_visa->dixi('U', 8);
+			_vm->_gyro->dna.obj[_vm->_gyro->onion] = false;
+			_vm->_lucerna->objectlist();
+		}
+		break;
+	default:
+		if ((_vm->_gyro->dna.room == r__argentpub) || (_vm->_gyro->dna.room == r__nottspub))
+			_vm->_scrolls->display("Try BUYing things before you drink them!");
+		else
+			_vm->_scrolls->display("The taste of it makes you retch!");
+		/* Constant- leave this one */
+	}
 }
 
 void Acci::others() {
@@ -843,19 +895,17 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 		return;
 	thing = temp;
 
-	/* Thing is the thing which you're putting in. Thing2 is where you're
-		putting it. */
-	/* Convenience thing. */
+	// Thing is the thing which you're putting in. Thing2 is where you're putting it.
 	switch (thing2) {
 	case _vm->_gyro->wine:
 		if (thing == _vm->_gyro->onion) {
 			if (_vm->_gyro->dna.rotten_onion)
-				_vm->_scrolls->display(Common::String("That's a bit like shutting the stable door after the "
-						"horse has bolted!"));
-			else {     /* Put onion into wine? */
+				_vm->_scrolls->display("That's a bit like shutting the stable door after the horse has bolted!");
+			else { // Put onion into wine?
 				if (_vm->_gyro->dna.winestate != 3)
-					_vm->_scrolls->display("\6Oignon au vin\22 is a bit too strong for your tastes!");
-				else {     /* Put onion into vinegar! Yes! */
+					_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Oignon au vin"
+					+ _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!");
+				else { // Put onion into vinegar! Yes!
 					_vm->_gyro->dna.onion_in_vinegar = true;
 					_vm->_lucerna->points(7);
 					_vm->_visa->dixi('u', 9);
@@ -866,10 +916,9 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 		break;
 
 	case 54:
-		if (_vm->_gyro->dna.room == 1) { /* Put something into the box. */
+		if (_vm->_gyro->dna.room == r__yours) { // Put something into the box.
 			if (_vm->_gyro->dna.box_contents != nowt)
-				_vm->_scrolls->display(Common::String("There's something in the box already, Avvy. Try taking"
-						" that out first."));
+				_vm->_scrolls->display("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (thing) {
 				case _vm->_gyro->money:
@@ -884,17 +933,20 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 				case _vm->_gyro->onion:
 					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
 					break;
-				default:
-					/* Put the object into the box... */
+				default: // Put the object into the box...
 					if (_vm->_gyro->dna.wearing == thing)
 						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
 					else {
-						_vm->_celer->show_one(5); /* Open box. */
+						//_vm->_celer->show_one(5); // Open box.
+						openBox(true);
+
 						_vm->_gyro->dna.box_contents = thing;
-						_vm->_gyro->dna.obj[thing] = false;
+						_vm->_gyro->dna.obj[thing - 1] = false;
 						_vm->_lucerna->objectlist();
 						_vm->_scrolls->display("OK, it's in the box.");
-						_vm->_celer->show_one(6); /* Shut box. */
+
+						//_vm->_celer->show_one(6); // Shut box.
+						openBox(false);
 					}
 				}
 			}
@@ -910,15 +962,15 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 
 /* The result of this fn is whether or not he says "Hey, thanks!" */
 void Acci::not_in_order() {
-	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
-			" What I need next is " +
-			_vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ".\232\2");
+	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
+			+ _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick])
+			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
 
 void Acci::go_to_cauldron() {
-	_vm->_trip->tr[2].call_eachstep = false; /* Stops Geida_Procs. */
+	_vm->_trip->tr[1].call_eachstep = false; /* Stops Geida_Procs. */
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
-	_vm->_trip->tr[2].walkto(2);
+	_vm->_trip->tr[1].walkto(2);
 }
 
 bool Acci::give2spludwick() {
@@ -935,7 +987,7 @@ bool Acci::give2spludwick() {
 		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa->dixi('q', 22);
 		else {
-			_vm->_gyro->dna.given2spludwick += 1;
+			_vm->_gyro->dna.given2spludwick++;
 			_vm->_visa->dixi('q', 20);
 			go_to_cauldron();
 			_vm->_lucerna->points(3);
@@ -945,7 +997,7 @@ bool Acci::give2spludwick() {
 	case _vm->_gyro->ink:
 		_vm->_gyro->dna.obj[_vm->_gyro->ink] = false;
 		_vm->_lucerna->objectlist();
-		_vm->_gyro->dna.given2spludwick += 1;
+		_vm->_gyro->dna.given2spludwick++;
 		_vm->_visa->dixi('q', 24);
 		go_to_cauldron();
 		_vm->_lucerna->points(3);
@@ -954,7 +1006,7 @@ bool Acci::give2spludwick() {
 		_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false;
 		_vm->_visa->dixi('q', 25);
 		_vm->_lucerna->points(5);
-		_vm->_gyro->dna.given2spludwick += 1;
+		_vm->_gyro->dna.given2spludwick++;
 		go_to_cauldron();
 		_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
 		_vm->_lucerna->objectlist();
@@ -983,13 +1035,11 @@ void Acci::have_a_drink() {
 }
 
 void Acci::cardiff_climbing() {
-	if (_vm->_gyro->dna.standing_on_dais) {
-		/* Clamber up. */
+	if (_vm->_gyro->dna.standing_on_dais) { // Clamber up.
 		_vm->_scrolls->display("You climb down, back onto the floor.");
 		_vm->_gyro->dna.standing_on_dais = false;
 		_vm->_trip->apped(1, 3);
-	} else {
-		/* Clamber down. */
+	} else { // Clamber down.
 		if (_vm->_trip->infield(1)) {
 			_vm->_scrolls->display("You clamber up onto the dais.");
 			_vm->_gyro->dna.standing_on_dais = true;
@@ -999,7 +1049,6 @@ void Acci::cardiff_climbing() {
 	}
 }
 
-
 /* Called when you ask Avvy to stand. */
 void Acci::already() {
 	_vm->_scrolls->display("You're already standing!");
@@ -1033,7 +1082,7 @@ void Acci::stand_up() {
 	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  {
 			_vm->_celer->show_one(4); /* Not sitting down. */
-			_vm->_trip->tr[1].visible = true; /* But standing up. */
+			_vm->_trip->tr[0].visible = true; /* But standing up. */
 			_vm->_trip->apped(1, 4); /* And walking away. */
 			_vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */
 			_vm->_gyro->dna.user_moves_avvy = true; /* And ambulant. */
@@ -1146,13 +1195,13 @@ void Acci::person_speaks() {
 
 
 	if ((person == pardon) || (person == 0))
-		if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him] != _vm->_gyro->dna.room))
+		if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
 			person = _vm->_gyro->her;
 		else
 			person = _vm->_gyro->him;
 
-	if (_vm->_gyro->whereis[person] != _vm->_gyro->dna.room) {
-		_vm->_scrolls->display("\231\4"); // Avvy himself!
+	if (_vm->_gyro->whereis[person - 150] != _vm->_gyro->dna.room) {
+		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
 		return;
 	}
 
@@ -1160,24 +1209,20 @@ void Acci::person_speaks() {
 
 	for (fv = 0; fv < _vm->_trip->numtr; fv++) {
 		if (_vm->_trip->tr[fv].quick && ((_vm->_trip->tr[fv].a.accinum + 149) == person)) {
-			_vm->_scrolls->display(Common::String('\23') + char(fv + 48) + '\4');
+			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(fv + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
 	}
 
-	if (!found) {
-		for (fv = 0; fv < 16; fv++) {
-			_vm->_gyro->quasipeds[fv];
-			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room)) {
-				_vm->_scrolls->display(Common::String('\23') + char(fv + 55) + '\4');
-			}
-		}
-	}
+	if (!found)
+		for (fv = 0; fv < 16; fv++) 
+			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room))
+				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(fv + 65) + _vm->_scrolls->kControlToBuffer);
 }
 
 void Acci::heythanks() {
 	person_speaks();
-	_vm->_scrolls->display("Hey, thanks!\2(But now, you've lost it!)");
+	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
 	_vm->_gyro->dna.obj[thing] = false;
 }
 
@@ -1294,20 +1339,17 @@ void Acci::do_that() {
 				default:
 					switch (person) {
 					case _vm->_gyro->pcrapulus:
-						switch (thing) {
-						case _vm->_gyro->wine:
+						if (thing == _vm->_gyro->wine) {
 							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
-							break;
-						default:
+						} else
 							heythanks();
-						}
 						break;
 					case _vm->_gyro->pcwytalot:
-						/*if (set::of(crossbow, bolt, eos).has(thing))
-							_vm->_scrolls->display(Common::String("You might be able to influence ") +
-									"Cwytalot more if you used it!");
-						else */heythanks();
+						if ((thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
+							_vm->_scrolls->display(Common::String("You might be able to influence Cwytalot more if you used it!"));
+						else
+							heythanks();
 						break;
 					case _vm->_gyro->pspludwick:
 						if (give2spludwick())
@@ -1381,15 +1423,13 @@ void Acci::do_that() {
 		if (holding())
 			swallow();
 		break;
+
 	case vb_load:
-		_vm->_enid->edna_load(realwords[2]);
 		break;
 	case vb_save:
-		if (_vm->_gyro->alive)
-			_vm->_enid->edna_save(realwords[2]);
-		else
-			_vm->_scrolls->display("It's a bit late now to save your game!");
 		break;
+	// We don't handle these two because we use ScummVM's save/load system.
+
 	case vb_pay:
 		_vm->_scrolls->display("No money need change hands.");
 		break;
@@ -1400,33 +1440,35 @@ void Acci::do_that() {
 		_vm->_scrolls->display("Vandalism is prohibited within this game!");
 		break;
 	case vb_quit: /* quit */
-		//if (_vm->_gyro->demo) {
+		if (_vm->_gyro->demo) {
+			warning("STUB: Acci::do_that() - case vb_quit");
 		//	_vm->_visa->dixi('q', 31);
 		//	close(demofile);
 		//	exit(0); /* Change this later!!! */
-		//}
+		}
 		if (!polite)
 			_vm->_scrolls->display("How about a `please\", Avvy?");
-		else if (_vm->_scrolls->ask("\23C\26Do you really want to quit?"))
+		else if (_vm->_scrolls->ask(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
 			_vm->_gyro->lmo = true;
 		break;
 	case vb_go:
 		_vm->_scrolls->display("Just use the arrow keys to walk there.");
 		break;
-	case vb_info:
-		_vm->_scrolls->aboutscroll = true;
-		/*            _vm->_scrolls->display('Thorsoft of Letchworth presents:'+^c+^m+^m+
-						'The medi‘val descendant of'+^m+
-						'Denarius Avaricius Sextus'+^m+'in:'+
-						^m+^m+'LORD AVALOT D''ARGENT'+
-						^m+'version '+vernum+^m+^m+'Copyright ï '
-						+copyright+', Mark, Mike and Thomas Thurman.');*/
-		_vm->_scrolls->display(Common::String("\r\r\r\r\r\r\r") + "LORD AVALOT D'ARGENT" + "\3\r" +
-				"The medi‘val descendant of" + '\15' +
-				"Denarius Avaricius Sextus" +
-				'\15' + '\15' + "version " + _vm->_gyro->vernum + '\15' + '\15' + "Copyright ï "
-				+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
-		_vm->_scrolls->aboutscroll = false;
+	case vb_info: {
+			_vm->_scrolls->aboutscroll = true;
+
+			Common::String toDisplay;
+			for (byte i = 0; i < 7; i++)
+				toDisplay += _vm->_scrolls->kControlNewLine;
+			toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
+				+ "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine
+				+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+				+ "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
+				+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
+			_vm->_scrolls->display(toDisplay);
+
+			_vm->_scrolls->aboutscroll = false;
+		}
 		break;
 	case vb_undress:
 		if (_vm->_gyro->dna.wearing == nowt)
@@ -1439,39 +1481,39 @@ void Acci::do_that() {
 			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case vb_wear:
-		if (holding()) {
-			/* wear something */
+		if (holding()) { /* wear something */
 			switch (thing) {
 			case _vm->_gyro->chastity:
-				_vm->_scrolls->display("Hey, what kind of a weirdo are you\??!");
+				_vm->_scrolls->display("Hey, what kind of a weirdo are you??!");
 				break;
 			case _vm->_gyro->clothes:
-			case _vm->_gyro->habit: /* Change this! */
-				if (_vm->_gyro->dna.wearing != nowt) {
-					if (_vm->_gyro->dna.wearing == thing)
-						_vm->_scrolls->display("You're already wearing that.");
-					else
-						_vm->_scrolls->display(Common::String("You'll be rather warm wearing two ") +
-								"sets of clothes!");
-					return;
-				} else
-					_vm->_gyro->dna.wearing = thing;
-				_vm->_lucerna->objectlist();
+			case _vm->_gyro->habit: { /* Change this! */
+					if (_vm->_gyro->dna.wearing != nowt) {
+						if (_vm->_gyro->dna.wearing == thing)
+							_vm->_scrolls->display("You're already wearing that.");
+						else
+							_vm->_scrolls->display("You'll be rather warm wearing two sets of clothes!");
+						return;
+					} else
+						_vm->_gyro->dna.wearing = thing;
 
-				if (thing == _vm->_gyro->habit)
-					fv = 3;
-				else
-					fv = 0;
-
-				if (_vm->_trip->tr[1].whichsprite != fv) {
-					sx = _vm->_trip->tr[1].x;
-					sy = _vm->_trip->tr[1].y;
-					_vm->_trip->tr[1].done();
-					_vm->_trip->tr[1].init(fv, true, _vm->_trip);
-					_vm->_trip->tr[1].appear(sx, sy, _vm->_trip->left);
-					_vm->_trip->tr[1].visible = false;
+					_vm->_lucerna->objectlist();
+
+					if (thing == _vm->_gyro->habit)
+						fv = 3;
+					else
+						fv = 0;
+
+					if (_vm->_trip->tr[0].whichsprite != fv) {
+						sx = _vm->_trip->tr[0].x;
+						sy = _vm->_trip->tr[0].y;
+						_vm->_trip->tr[0].done();
+						_vm->_trip->tr[0].init(fv, true, _vm->_trip);
+						_vm->_trip->tr[0].appear(sx, sy, _vm->_trip->left);
+						_vm->_trip->tr[0].visible = false;
+					}
 				}
-			break;
+				break;
 			default:
 				_vm->_scrolls->display(what);
 			}
@@ -1482,7 +1524,7 @@ void Acci::do_that() {
 			switch (_vm->_gyro->dna.room) { /* They just typed "play"... */
 			case r__argentpub:
 				// play_nim();
-				// I just don't plan to implement Nim yet.
+				warning("STUB: Acci::do_that() - case vb_play");
 				break; /* ...in the pub, => play Nim. */
 			case r__musicroom:
 				play_harp();
@@ -1490,13 +1532,15 @@ void Acci::do_that() {
 			}
 		} else if (holding()) {
 			switch (thing) {
-			case _vm->_gyro->lute :
-				_vm->_visa->dixi('U', 7);
-				if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot] == _vm->_gyro->dna.room)
-					_vm->_visa->dixi('U', 10);
+			case _vm->_gyro->lute : {
+					_vm->_visa->dixi('U', 7);
 
-				if (_vm->_gyro->whereis[_vm->_gyro->pdulustie] == _vm->_gyro->dna.room)
-					_vm->_visa->dixi('U', 15);
+					if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
+						_vm->_visa->dixi('U', 10);
+
+					if (_vm->_gyro->whereis[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room)
+						_vm->_visa->dixi('U', 15);
+				}
 				break;
 			case 52:
 				if (_vm->_gyro->dna.room == r__musicroom)
@@ -1506,7 +1550,8 @@ void Acci::do_that() {
 				break;
 			case 55:
 				if (_vm->_gyro->dna.room == r__argentpub)
-					;  /*play_nim(); - Don't implement yet.*/
+					// play_nim();
+					warning("STUB: Acci::do_that() - case vb_play");
 				else
 					_vm->_scrolls->display(what);
 				break;
@@ -1520,14 +1565,14 @@ void Acci::do_that() {
 			if (thing == _vm->_gyro->bell) {
 				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
-					_vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)");
+					_vm->_scrolls->display("(Are you trying to join in, Avvy??!)");
 			} else
 				_vm->_scrolls->display(what);
 		}
 		break;
 	case vb_help:
 		// boot_help();
-		// I don't want to implement help yet.
+		warning("STUB: Acci::do_that() - case vb_help");
 		break;
 	case vb_larrypass:
 		_vm->_scrolls->display("Wrong game!");
@@ -1537,34 +1582,34 @@ void Acci::do_that() {
 		break;
 	case vb_boss:
 		// bosskey();
-		// I don't want to implement bosskey yet.
+		warning("STUB: Acci::do_that() - case vb_boss");
 		break;
 	case vb_pee:
 		if (_vm->_gyro->flagset('P')) {
 			_vm->_scrolls->display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
 		} else
-			_vm->_scrolls->display("It would be \6VERY\22 unwise to do that here, Avvy!");
+			_vm->_scrolls->display(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
+			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
 		break;
 	case vb_cheat:
-		_vm->_scrolls->display(Common::String('\6') + "Cheat mode now enabled.");
+		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
 		_vm->_gyro->cheat = true;
 		break;
 	case vb_magic:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
 			_vm->_visa->dixi('q', 19);
 		else {
-			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) {
-				/* Avaricius appears! */
+			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
 				_vm->_visa->dixi('q', 17);
-				if (_vm->_gyro->whereis['\227'] == 12)
+				if (_vm->_gyro->whereis[1] == 12)
 					_vm->_visa->dixi('q', 18);
 				else {
-					_vm->_trip->tr[2].init(1, false, _vm->_trip); /* Avaricius */
+					_vm->_trip->tr[1].init(1, false, _vm->_trip); /* Avaricius */
 					_vm->_trip->apped(2, 4);
-					_vm->_trip->tr[2].walkto(5);
-					_vm->_trip->tr[2].call_eachstep = true;
-					_vm->_trip->tr[2].eachstep = _vm->_trip->procback_and_forth;
+					_vm->_trip->tr[1].walkto(5);
+					_vm->_trip->tr[1].call_eachstep = true;
+					_vm->_trip->tr[1].eachstep = _vm->_trip->procback_and_forth;
 					_vm->_gyro->dna.avaricius_talk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
@@ -1578,42 +1623,39 @@ void Acci::do_that() {
 	case vb_expletive:
 		switch (_vm->_gyro->dna.swore) {
 		case 0:
-			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
-					"(I shouldn't say it again, if I were you!)");
+			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!")
+				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(I shouldn't say it again, if I were you!)");
 			break;
 		case 1:
-			_vm->_scrolls->display(Common::String("You hear a distant rumble of thunder. Must you always ") +
-					"do things I tell you not to?\r\rDon't do it again!");
+			_vm->_scrolls->display(Common::String("You hear a distant rumble of thunder. Must you always do things I tell you not to?")
+				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Don't do it again!");
 			break;
 		default:
 			_vm->_pingo->zonk();
-			_vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, ") +
-					"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
+			_vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, and fries you.")
+				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna->gameover();
 		}
 		_vm->_gyro->dna.swore++;
 		break;
 	case vb_listen:
 		if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
-			_vm->_scrolls->display(Common::String("All other noise is drowned out by the ringing of ") +
-					"the bells.");
-		else if (_vm->_gyro->listen == "")
+			_vm->_scrolls->display("All other noise is drowned out by the ringing of the bells.");
+		else if (_vm->_gyro->listen.empty())
 			_vm->_scrolls->display("You can't hear anything much at the moment, Avvy.");
 		else
 			_vm->_scrolls->display(_vm->_gyro->listen);
 		break;
-	case vb_buy:
-		/* What are they trying to buy? */
+	case vb_buy: // What are they trying to buy?
 		switch (_vm->_gyro->dna.room) {
 		case r__argentpub:
-			if (_vm->_trip->infield(6)) {
-				/* We're in a pub, and near the bar. */
+			if (_vm->_trip->infield(6)) { // We're in a pub, and near the bar.
 				switch (thing) {
-				case '\63':
-				case '\65':
-				case '\66':
-				case '\72': /* Beer, whisky, cider or mead */
-					if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
+				case 51:
+				case 53:
+				case 54:
+				case 58: // Beer, whisky, cider or mead.
+					if (_vm->_gyro->dna.malagauche == 177) { // Already getting us one.
 						_vm->_visa->dixi('D', 15);
 						return;
 					}
@@ -1625,22 +1667,23 @@ void Acci::do_that() {
 
 					if (_vm->_gyro->dna.alcohol == 0)
 						_vm->_lucerna->points(3);
+
 					_vm->_celer->show_one(12);
-					_vm->_scrolls->display(booze[thing] + ", please.\231\2");
+					_vm->_scrolls->display(booze[thing] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 					_vm->_gyro->dna.drinking = thing;
 
 					_vm->_celer->show_one(10);
 					_vm->_gyro->dna.malagauche = 177;
 					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
-				case '\64':
+				case 52:
 					examine();
-					break; /* We have a right one here- buy Pepsi??! */
+					break; // We have a right one here - buy Pepsi??!
 				case _vm->_gyro->wine:
-					if (_vm->_gyro->dna.obj[_vm->_gyro->wine])  /* We've already got the wine! */
-						_vm->_visa->dixi('D', 2); /* 1 bottle's shufishent! */
+					if (_vm->_gyro->dna.obj[_vm->_gyro->wine])  // We've already got the wine!
+						_vm->_visa->dixi('D', 2); // 1 bottle's shufishent!
 					else {
-						if (_vm->_gyro->dna.malagauche == 177) { /* Already getting us one. */
+						if (_vm->_gyro->dna.malagauche == 177) { // Already getting us one.
 							_vm->_visa->dixi('D', 15);
 							return;
 						}
@@ -1651,7 +1694,7 @@ void Acci::do_that() {
 						}
 
 						_vm->_celer->show_one(12);
-						_vm->_scrolls->display("Wine, please.\231\2");
+						_vm->_scrolls->display("Wine, please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->dna.alcohol == 0)
 							_vm->_lucerna->points(3);
 						_vm->_celer->show_one(10);
@@ -1662,14 +1705,14 @@ void Acci::do_that() {
 					break;
 				}
 			} else
-				_vm->_visa->dixi('D', 5);
-			break;                /* Go to the bar! */
+				_vm->_visa->dixi('D', 5); // Go to the bar!
+			break;                
 
 		case r__outsideducks:
 			if (_vm->_trip->infield(6)) {
 				if (thing == _vm->_gyro->onion) {
-					if (_vm->_gyro->dna.obj[_vm->_gyro->onion])
-						_vm->_visa->dixi('D', 10); /* not planning to juggle with the things! */
+					if (_vm->_gyro->dna.obj[_vm->_gyro->onion - 1])
+						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->dna.carrying >= maxobjs)
 						_vm->_scrolls->display("Before you ask, you remember that your hands are full.");
 					else {
@@ -1679,11 +1722,11 @@ void Acci::do_that() {
 							_vm->_visa->dixi('D', 9);
 							_vm->_lucerna->points(3);
 						}
-						_vm->_gyro->pennycheck(3); /* It costs thruppence. */
+						_vm->_gyro->pennycheck(3); // It costs thruppence.
 						_vm->_gyro->dna.obj[_vm->_gyro->onion] = true;
 						_vm->_lucerna->objectlist();
 						_vm->_gyro->dna.bought_onion = true;
-						_vm->_gyro->dna.rotten_onion = false; /* It's OK when it leaves the stall! */
+						_vm->_gyro->dna.rotten_onion = false; // It's OK when it leaves the stall!
 						_vm->_gyro->dna.onion_in_vinegar = false;
 					}
 				} else
@@ -1693,30 +1736,27 @@ void Acci::do_that() {
 			break;
 
 		case r__nottspub:
-			_vm->_visa->dixi('n', 15);
-			break; /* Can't sell to southerners. */
+			_vm->_visa->dixi('n', 15); // Can't sell to southerners.
+			break; 
 		default:
-			_vm->_visa->dixi('D', 0); /* Can't buy that. */
+			_vm->_visa->dixi('D', 0); // Can't buy that.
 		}
 		break;
 	case vb_attack:
 		if ((_vm->_gyro->dna.room == r__brummieroad) &&
-				((person == '\235') || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
-				&& (_vm->_gyro->whereis['\235'] == _vm->_gyro->dna.room)) {
+				((person == 157) || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
+				&& (_vm->_gyro->whereis[7] == _vm->_gyro->dna.room)) {
 			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow] * 2) {
-				/* 0 = neither, 1 = only bolt, 2 = only crossbow,
-					3 = both. */
+				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->dixi('Q', 10);
 				_vm->_scrolls->display("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_scrolls->display(Common::String("Attack _vm->_gyro->him with only a crossbow bolt? Are you ") +
-						"planning on playing darts?!");
+				_vm->_scrolls->display("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
 				break;
 			case 2:
-				_vm->_scrolls->display(Common::String("Come on, Avvy! You're not going to get very far ") +
-						"with only a crossbow!");
+				_vm->_scrolls->display("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
 				_vm->_visa->dixi('Q', 11);
@@ -1724,12 +1764,12 @@ void Acci::do_that() {
 				_vm->_gyro->dna.obj[_vm->_gyro->bolt] = false;
 				_vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false;
 				_vm->_lucerna->objectlist();
-				_vm->_gyro->magics[12].op = _vm->_gyro->nix;
+				_vm->_gyro->magics[11].op = _vm->_gyro->nix;
 				_vm->_lucerna->points(7);
-				_vm->_trip->tr[2].walkto(2);
-				_vm->_trip->tr[2].vanishifstill = true;
-				_vm->_trip->tr[2].call_eachstep = false;
-				_vm->_gyro->whereis['\235'] = 177;
+				_vm->_trip->tr[1].walkto(2);
+				_vm->_trip->tr[1].vanishifstill = true;
+				_vm->_trip->tr[1].call_eachstep = false;
+				_vm->_gyro->whereis[7] = 177;
 				break;
 			default:
 				_vm->_visa->dixi('Q', 10); /* Please try not to be so violent! */
@@ -1742,8 +1782,8 @@ void Acci::do_that() {
 			_vm->_visa->dixi('Q', 12);
 		else {
 			ok = true;
-			for (ff = 1; ff <= thats.size(); ff++) {
-				for (fv = 1; fv <= words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++) {
+			for (ff = 0; ff < thats.size(); ff++) {
+				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++) {
 					Common::String temp = realwords[ff];
 					temp.toUppercase();
 					if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv])
@@ -1765,7 +1805,7 @@ void Acci::do_that() {
 		}
 		break;
 	case vb_dir:
-		_vm->_enid->dir(realwords[2]);
+		_vm->_enid->dir(realwords[1]);
 		break;
 	case vb_die:
 		_vm->_lucerna->gameover();
@@ -1781,7 +1821,6 @@ void Acci::do_that() {
 	case vb_stand:
 		stand_up();
 		break;
-
 	case vb_kiss:
 		if (person == pardon)
 			_vm->_scrolls->display("Kiss whom?");
@@ -1803,24 +1842,20 @@ void Acci::do_that() {
 			_vm->_scrolls->display("Hey, what kind of a weirdo are you??");
 
 		break;
-
 	case vb_climb:
 		if (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			cardiff_climbing();
 		else /* In the wrong room! */
 			_vm->_scrolls->display("Not with your head for heights, Avvy!");
 		break;
-
 	case vb_jump:
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
-
 	case vb_highscores:
 		//	show_highs();
-		// to be implemented later...
+		warning("STUB: Acci::do_that() - case vb_highscores");
 		break;
-
 	case vb_wake:
 		if (personshere())
 			switch (person) {
@@ -1849,24 +1884,21 @@ void Acci::do_that() {
 				_vm->_scrolls->display("It's difficult to awaken people who aren't asleep...!");
 		}
 		break;
-
 	case vb_sit:
 		if (_vm->_gyro->dna.room == r__nottspub) {
 			if (_vm->_gyro->dna.sitting_in_pub)
 				_vm->_scrolls->display("You're already sitting!");
 			else {
-				_vm->_trip->tr[1].walkto(4); /* Move Avvy to the place, and sit _vm->_gyro->him down. */
+				_vm->_trip->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
 				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
 			}
-		} else {
-			/* Default doodah. */
+		} else { // Default doodah.
 			_vm->_lucerna->dusk();
 			_vm->_gyro->hang_around_for_a_while();
 			_vm->_lucerna->dawn();
-			_vm->_scrolls->display("A few hours later...\20nothing much has happened...");
+			_vm->_scrolls->display(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
 		}
 		break;
-
 	case vb_restart:
 		if (_vm->_scrolls->ask("Restart game and lose changes?"))  {
 			_vm->_lucerna->dusk();
@@ -1874,21 +1906,19 @@ void Acci::do_that() {
 			_vm->_lucerna->dawn();
 		}
 		break;
-
 	case pardon:
 		_vm->_scrolls->display("Hey, a verb would be helpful!");
 		break;
-
 	case vb_hello:
 		person_speaks();
-		_vm->_scrolls->display("Hello.\2");
+		_vm->_scrolls->display(Common::String("Hello.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
 	case vb_thanks:
 		person_speaks();
-		_vm->_scrolls->display("That's OK.\2");
+		_vm->_scrolls->display(Common::String("That's OK.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
 	default:
-		_vm->_scrolls->display(Common::String('\7') + "Parser bug!");
+		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlBell) + "Parser bug!");
 	}
 }
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2c4ae6f..2c7041d 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -352,7 +352,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
-	return (!_gyro->seescroll);
+	return (!_gyro->seescroll && _gyro->alive);
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 4ae61c2..e7cf879 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -394,8 +394,13 @@ void Gyro::force_numlock() {
 }
 
 bool Gyro::pennycheck(uint16 howmuchby) {
-	warning("STUB: Gyro::pennycheck()");
-	return true;
+	dna.pence -= howmuchby;
+	if (dna.pence < 0) {
+		_vm->_visa->dixi('Q', 2); // "You are now denariusless!"
+		_vm->_lucerna->gameover();
+		return false;
+	} else
+		return true;
 }
 
 // There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
@@ -472,7 +477,7 @@ Common::String Gyro::get_better(byte which) {
 		case 0:
 		case 1:
 		case 4:
-			get_better_result = better[which];
+			get_better_result = better[which - 1];
 			break;
 		case 3:
 			get_better_result = "some vinegar";
@@ -485,11 +490,11 @@ Common::String Gyro::get_better(byte which) {
 		else if (dna.onion_in_vinegar)
 			get_better_result = "a pickled onion (in the vinegar)";
 		else
-			get_better_result = better[which];
+			get_better_result = better[which - 1];
 		break;
 	default:
 		if ((which < numobjs) && (which > 0))
-			get_better_result = better[which];
+			get_better_result = better[which - 1];
 		else
 			get_better_result = "";
 	}
@@ -583,9 +588,7 @@ void Gyro::background(byte x) {
 }
 
 void Gyro::hang_around_for_a_while() {
-	byte fv;
-
-	for (fv = 1; fv <= 28; fv++)
+	for (byte i = 0; i < 28; i++)
 		slowdown();
 }
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index cafaabb..825d40f 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -343,9 +343,9 @@ public:
 	static const uint16 pjacques = 166;
 
 	/* Girls: */
-	static const uint16 parkata = 257;
-	static const uint16 pgeida = 260;
-	static const uint16 pwisewoman = 262;
+	static const uint16 parkata = 175;
+	static const uint16 pgeida = 176;
+	static const uint16 pwisewoman = 178;
 
 	static const int16 xw = 30;
 	static const int16 yw = 36; /* x width & y whatsit */
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 48b17c4..d6aab20 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -278,9 +278,9 @@ void Lucerna::zoomout(int16 x, int16 y) {
 }
 
 void Lucerna::find_people(byte room) {
-	for (byte fv = 1; fv < 29; fv++) // There'll may be problems with this.
+	for (byte fv = 1; fv < 29; fv++)
 		if (_vm->_gyro->whereis[fv] == room) {
-			if (fv < 25) // And this. See definition of whereis[].
+			if (fv < 25)
 				_vm->_gyro->him = fv + 150;
 			else
 				_vm->_gyro->her = fv + 150;
@@ -326,7 +326,7 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 
 	switch (_vm->_gyro->dna.room) {
 	case r__outsidenottspub: /* Entry into Nottingham. */
-		if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (! _vm->_gyro->dna.taken_mushroom))
+		if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (!_vm->_gyro->dna.taken_mushroom))
 			_vm->_gyro->dna.mushroom_growing = true;
 		break;
 	case r__wisewomans: { /* Entry into Argent. */
@@ -337,7 +337,8 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 			_vm->_gyro->dna.spludwicks_here = true;
 			_vm->_gyro->dna.crapulus_will_tell = false;
 		}
-		if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine)  _vm->_gyro->dna.winestate = 3; /* Vinegar */
+		if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine)
+			_vm->_gyro->dna.winestate = 3; /* Vinegar */
 	}
 	break;
 	}
@@ -1297,15 +1298,12 @@ void Lucerna::gameover() {
 	sy = _vm->_trip->tr[0].y;
 	
 	_vm->_trip->tr[0].done();
-	_vm->_trip->tr[0].init(12, true, _vm->_trip);       /* 12 = Avalot falls */
+	_vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls
 	_vm->_trip->tr[0].step = 0;
 	_vm->_trip->tr[0].appear(sx, sy, 0);
 	
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
 
-	/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
-	warning("STUB: Timeout::avalot_falls()");
-
 	_vm->_gyro->alive = false;
 }
 


Commit: f4824986ecbd45ceb720ecf54a085d02429acd98
    https://github.com/scummvm/scummvm/commit/f4824986ecbd45ceb720ecf54a085d02429acd98
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-25T04:52:05-07:00

Commit Message:
AVALANCHE: Repair Lucerna::bearing().

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d6aab20..d96bbbc 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1332,25 +1332,19 @@ void Lucerna::major_redraw() {
 }
 
 uint16 Lucerna::bearing(byte whichped) {
-/* Returns the bearing from ped Whichped to Avvy, in degrees. */
-	const double rad2deg = 180 / 3.14/*Pi*/;
-
-	uint16 bearing_result; 
-	{
-		pedtype &with = _vm->_gyro->peds[whichped];
-		if (_vm->_trip->tr[0].x == with.x)
-			bearing_result = 0; /* This would cause a division by zero if we let it through. */
-		else {
-			/*
-			 bearing:=trunc(((arctan((_vm->_trip->tr[1].y-y)/(_vm->_trip->tr[1].x-x)))*rad2deg)+90) mod 360*/
+	whichped--; // Different array indexes in Pascal and C.
+
+	const double rad2deg = 180 / 3.14 /*Pi*/;
 		
-			if (_vm->_trip->tr[0].x < with.x)
-				bearing_result = (atan(double((_vm->_trip->tr[0].y - with.y)) / (_vm->_trip->tr[0].x - with.x)) * rad2deg) + 90;
-			else
-				bearing_result = (atan(double((_vm->_trip->tr[0].y - with.y)) / (_vm->_trip->tr[0].x - with.x)) * rad2deg) + 270;
-		}
-	}
-	return bearing_result;
+	if (_vm->_trip->tr[0].x == _vm->_gyro->peds[whichped].x)
+		return 0;
+	else 
+		if (_vm->_trip->tr[0].x < _vm->_gyro->peds[whichped].x)
+			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
+					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 90;
+		else
+			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
+					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 270;
 }
 
 void Lucerna::sprite_run() {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 8ab7342..854c01c 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -100,7 +100,7 @@ public:
 
 	void major_redraw();
 
-	uint16 bearing(byte whichped);
+	uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees.
 
 	void flesh_colours();
 


Commit: f729e9e84893e2da9803a9b1ae2210d42db449f8
    https://github.com/scummvm/scummvm/commit/f729e9e84893e2da9803a9b1ae2210d42db449f8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-25T08:10:29-07:00

Commit Message:
AVALANCHE: Repair Acci::wordnum().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 5cfafd1..74a74b7 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -238,7 +238,12 @@ byte Acci::wordnum(Common::String x) {
 		return 0;
 	
 	for (int32 fv = nowords - 1; fv >= 0; fv--) 
-		if ((words[fv].w == x) || (Common::String(words[fv].w.c_str(), x.size()) == x))
+		if (words[fv].w == x)
+			return words[fv].n;
+
+	// If not found as a whole, we look for it as a substring.
+	for (int32 fv = nowords - 1; fv >= 0; fv--) 
+		if (Common::String(words[fv].w.c_str(), x.size()) == x)
 			return words[fv].n;
 
 	return pardon;
@@ -561,7 +566,7 @@ void Acci::parse() {
 		fv++;
 	}
 
-	if (_vm->_gyro->subjnumber == 0) // Still not found.
+	if ((_vm->_gyro->subjnumber == 0) && !thats.empty()) // Still not found.
 		for (fv = 0; fv < thats.size() - 1; fv++)
 			if ((byte)thats[fv] == 252) { // The word is "about", or something similar.
 				_vm->_gyro->subjnumber = (byte)thats[fv + 1];
@@ -569,7 +574,7 @@ void Acci::parse() {
 				break;
 			}
 
-	if (_vm->_gyro->subjnumber == 0) // STILL not found! Must be the word after "say".
+	if ((_vm->_gyro->subjnumber == 0) && !thats.empty())// STILL not found! Must be the word after "say".
 		for (fv = 0; fv < thats.size() - 1; fv++)
 			if (((byte)thats[fv] == 7) && ((byte)thats[fv + 1] != 0) && !((225 <= (byte)thats[fv + 1]) && ((byte)thats[fv + 1] <= 229))) {
 				// SAY not followed by a preposition


Commit: 26d2e1bd18b9e9654d3aaa2e900ca36d424244ca
    https://github.com/scummvm/scummvm/commit/26d2e1bd18b9e9654d3aaa2e900ca36d424244ca
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-25T08:38:22-07:00

Commit Message:
AVALANCHE: Fix array indexes in Acci::do_that(), upgrade Lucerna::enterroom().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 74a74b7..2ee878d 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1364,8 +1364,8 @@ void Acci::do_that() {
 						if (thing == _vm->_gyro->badge) {
 							_vm->_visa->dixi('q', 32); /* Thanks! Wow! */
 							_vm->_lucerna->points(3);
-							_vm->_gyro->dna.obj[_vm->_gyro->badge] = false;
-							_vm->_gyro->dna.obj[_vm->_gyro->habit] = true;
+							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
+							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
 							_vm->_gyro->dna.givenbadgetoiby = true;
 							_vm->_celer->show_one(8);
 							_vm->_celer->show_one(9);
@@ -1375,9 +1375,9 @@ void Acci::do_that() {
 					case _vm->_gyro->payles:
 						if (_vm->_gyro->dna.ayles_is_awake) {
 							if (thing == _vm->_gyro->pen) {
-								_vm->_gyro->dna.obj[_vm->_gyro->pen] = false;
+								_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false;
 								_vm->_visa->dixi('q', 54);
-								_vm->_gyro->dna.obj[_vm->_gyro->ink] = true;
+								_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = true;
 								_vm->_gyro->dna.given_pen_to_ayles = true;
 								_vm->_lucerna->objectlist();
 								_vm->_lucerna->points(2);
@@ -1389,7 +1389,7 @@ void Acci::do_that() {
 					case _vm->_gyro->pgeida:
 						switch (thing) {
 						case _vm->_gyro->potion:
-							_vm->_gyro->dna.obj[_vm->_gyro->potion] = false;
+							_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = false;
 							_vm->_visa->dixi('u', 16); /* She drinks it. */
 							_vm->_lucerna->points(2);
 							_vm->_gyro->dna.geida_given_potion = true;
@@ -1674,7 +1674,7 @@ void Acci::do_that() {
 						_vm->_lucerna->points(3);
 
 					_vm->_celer->show_one(12);
-					_vm->_scrolls->display(booze[thing] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+					_vm->_scrolls->display(booze[thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 					_vm->_gyro->dna.drinking = thing;
 
 					_vm->_celer->show_one(10);
@@ -1685,7 +1685,7 @@ void Acci::do_that() {
 					examine();
 					break; // We have a right one here - buy Pepsi??!
 				case _vm->_gyro->wine:
-					if (_vm->_gyro->dna.obj[_vm->_gyro->wine])  // We've already got the wine!
+					if (_vm->_gyro->dna.obj[_vm->_gyro->wine - 1])  // We've already got the wine!
 						_vm->_visa->dixi('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_gyro->dna.malagauche == 177) { // Already getting us one.
@@ -1751,7 +1751,7 @@ void Acci::do_that() {
 		if ((_vm->_gyro->dna.room == r__brummieroad) &&
 				((person == 157) || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
 				&& (_vm->_gyro->whereis[7] == _vm->_gyro->dna.room)) {
-			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow] * 2) {
+			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->dixi('Q', 10);
@@ -1788,10 +1788,10 @@ void Acci::do_that() {
 		else {
 			ok = true;
 			for (ff = 0; ff < thats.size(); ff++) {
-				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++) {
+				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password - 1].w.size(); fv++) {
 					Common::String temp = realwords[ff];
 					temp.toUppercase();
-					if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv])
+					if (words[_vm->_gyro->dna.pass_num + first_password - 1].w[fv] != temp[fv])
 						ok = false;
 				}
 			}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d96bbbc..3249f1b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -766,6 +766,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	_vm->_gyro->seescroll = false; /* Now it can work again! */
 
+	if (_vm->_gyro->isLoaded)
+		_vm->_gyro->isLoaded = false;
 }
 
 void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! */


Commit: 6df55520b7ea32b0c74873b9586e3578cebd271c
    https://github.com/scummvm/scummvm/commit/6df55520b7ea32b0c74873b9586e3578cebd271c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-25T09:05:02-07:00

Commit Message:
AVALANCHE: Implement Acci::exampers(). Repair Avalot::setup().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2ee878d..8a194eb 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -655,7 +655,27 @@ bool Acci::personshere() { // Person equivalent of "holding".
 }
 
 void Acci::exampers() {
-	warning("STUB: Acci::exampers()");
+	if (personshere()) {
+		if (thing != _vm->_gyro->thinks)
+			_vm->_lucerna->thinkabout(person, _vm->_gyro->a_person);
+		person -= 149;
+		switch (person) { /* Special cases */
+		case 11:
+			if (_vm->_gyro->dna.wonnim)
+				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
+			return;
+		case 99:
+			if (_vm->_gyro->dna.lustie_is_asleep)
+				_vm->_visa->dixi('Q', 65); // He's asleep. (65! Wow!)
+			return;
+		}
+		// Otherwise...
+		_vm->_visa->dixi('p', person);
+	} 
+	
+	// And afterwards...
+	if ((person == 14) && (!_vm->_gyro->dna.ayles_is_awake))
+		_vm->_visa->dixi('Q', 13);
 }
 
 bool Acci::holding() {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 95f564e..de37f50 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -195,12 +195,8 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {		
 		_vm->loadGame(loadSlot);
-	} else
+	} else {
 		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
-
-
-
-	if (!_vm->_gyro->isLoaded) {
 		_vm->_gyro->newgame(); // No game was requested- load the default.
 
 		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 825d40f..ec78028 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -500,7 +500,7 @@ public:
 	bool lmo, mousemade;
 	Common::String scroll[15];
 	byte scrolln, score, whichwas;
-	char thinks;
+	byte thinks;
 	bool thinkthing;
 
 	/* pp:array[1..1000] of postype;


Commit: 762e91218d0fe1febcc15d1310c9e7f4c9937073
    https://github.com/scummvm/scummvm/commit/762e91218d0fe1febcc15d1310c9e7f4c9937073
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T00:14:27-07:00

Commit Message:
AVALANCHE: Repair array indexes in Timeout.

Changed paths:
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index bbb5e8c..a7f61be 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -245,7 +245,7 @@ void Timeout::open_drawbridge() {
 	_vm->_celer->show_one(_vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 	else
 		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
@@ -263,7 +263,7 @@ void Timeout::avaricius_talks() {
 }
 
 void Timeout::urinate() {
-	_vm->_trip->tr[1].turn(_vm->_trip->up);
+	_vm->_trip->tr[0].turn(_vm->_trip->up);
 	_vm->_trip->stopwalking();
 	_vm->_lucerna->showrw();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
@@ -287,9 +287,9 @@ void Timeout::stairs() {
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_celer->show_one(2);
 	_vm->_gyro->dna.brummie_stairs = 2;
-	_vm->_gyro->magics[11].op = _vm->_gyro->special;
-	_vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */
-	_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */
+	_vm->_gyro->magics[10].op = _vm->_gyro->special;
+	_vm->_gyro->magics[10].data = 2; /* Reached the bottom of the stairs. */
+	_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */
 }
 
 void Timeout::cardiff_survey() {
@@ -319,38 +319,38 @@ void Timeout::get_tied_up() {
 	_vm->_gyro->dna.user_moves_avvy = false;
 	_vm->_gyro->dna.been_tied_up = true;
 	_vm->_trip->stopwalking();
-	_vm->_trip->tr[2].stopwalk();
-	_vm->_trip->tr[2].stophoming();
-	_vm->_trip->tr[2].call_eachstep = true;
-	_vm->_trip->tr[2].eachstep = _vm->_trip->procgrab_avvy;
+	_vm->_trip->tr[1].stopwalk();
+	_vm->_trip->tr[1].stophoming();
+	_vm->_trip->tr[1].call_eachstep = true;
+	_vm->_trip->tr[1].eachstep = _vm->_trip->procgrab_avvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 
 void Timeout::get_tied_up2() {
-	_vm->_trip->tr[1].walkto(4);
-	_vm->_trip->tr[2].walkto(5);
-	_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
+	_vm->_trip->tr[0].walkto(4);
+	_vm->_trip->tr[1].walkto(5);
+	_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
 	_vm->_gyro->dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
-	_vm->_trip->tr[2].check_me = false;
-	_vm->_trip->tr[1].init(7, true, _vm->_trip); /* Robin Hood */
+	_vm->_trip->tr[1].check_me = false;
+	_vm->_trip->tr[0].init(7, true, _vm->_trip); /* Robin Hood */
 	_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
 	_vm->_trip->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
-	_vm->_trip->tr[1].walkto(7);
+	_vm->_trip->tr[0].walkto(7);
 	set_up_timer(55, prochang_around2, reason_hanging_around);
 }
 
 void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
-	_vm->_trip->tr[2].vanishifstill = false;
-	_vm->_trip->tr[2].walkto(4);
+	_vm->_trip->tr[1].vanishifstill = false;
+	_vm->_trip->tr[1].walkto(4);
 	_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
 	_vm->_visa->dixi('q', 41);
-	_vm->_trip->tr[1].done();
-	_vm->_trip->tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
+	_vm->_trip->tr[0].done();
+	_vm->_trip->tr[1].done(); /* Get rid of Robin Hood and Friar Tuck. */
 
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
 	/* Immediately call the following proc (when you have a chance). */
@@ -380,7 +380,7 @@ void Timeout::jacques_wakes_up() {
 	case 3 :  /* Gone through the door. */
 		_vm->_celer->show_one(2); /* Not on the floor, either. */
 		_vm->_celer->show_one(4); /* He's gone... so the door's open. */
-		_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */
+		_vm->_gyro->whereis[_vm->_gyro->pjacques - 1] = 0; /* Gone! */
 		break;
 	}
 
@@ -406,9 +406,9 @@ void Timeout::jacques_wakes_up() {
 
 void Timeout::naughty_duke() {
 /* This is when the Duke comes in and takes your money. */
-	_vm->_trip->tr[2].init(9, false, _vm->_trip); /* Here comes the Duke. */
+	_vm->_trip->tr[1].init(9, false, _vm->_trip); /* Here comes the Duke. */
 	_vm->_trip->apped(2, 1); /* He starts at the door... */
-	_vm->_trip->tr[2].walkto(3); /* He walks over to you. */
+	_vm->_trip->tr[1].walkto(3); /* He walks over to you. */
 
 	/* Let's get the door opening. */
 	_vm->_celer->show_one(1);
@@ -420,8 +420,8 @@ void Timeout::naughty_duke() {
 
 void Timeout::naughty_duke2() {
 	_vm->_visa->dixi('q', 48); /* Ha ha, it worked again! */
-	_vm->_trip->tr[2].walkto(1); /* Walk to the door. */
-	_vm->_trip->tr[2].vanishifstill = true; /* Then go away! */
+	_vm->_trip->tr[1].walkto(1); /* Walk to the door. */
+	_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
@@ -432,19 +432,16 @@ void Timeout::naughty_duke3() {
 }
 
 void Timeout::jump() {
-	dnatype &with = _vm->_gyro->dna;
+	_vm->_gyro->dna.jumpstatus++;
 
-	with.jumpstatus += 1;
-
-	triptype &with1 = _vm->_trip->tr[1];
-	switch (with.jumpstatus) {
+	switch (_vm->_gyro->dna.jumpstatus) {
 	case 1:
 	case 2:
 	case 3:
 	case 5:
 	case 7:
 	case 9:
-		with1.y -= 1;
+		_vm->_trip->tr[0].y--;
 		break;
 	case 12:
 	case 13:
@@ -452,20 +449,18 @@ void Timeout::jump() {
 	case 16:
 	case 18:
 	case 19:
-		with1.y += 1;
+		_vm->_trip->tr[0].y++;
 		break;
 	}
 
-	if (with.jumpstatus == 20) {
-		/* End of jump. */
+	if (_vm->_gyro->dna.jumpstatus == 20) { /* End of jump. */
 		_vm->_gyro->dna.user_moves_avvy = true;
 		_vm->_gyro->dna.jumpstatus = 0;
-	} else {
-		/* Still jumping. */
+	} else { /* Still jumping. */
 		set_up_timer(1, procjump, reason_jumping);
 	}
 
-	if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
+	if ((_vm->_gyro->dna.jumpstatus == 10) /* You're at the highest point of your jump. */
 			&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			&& (_vm->_gyro->dna.arrow_in_the_door == true)
 			&& (_vm->_trip->infield(3))) { /* beside the wall*/
@@ -525,9 +520,9 @@ void Timeout::greetsmonk() {
 }
 
 void Timeout::fall_down_oubliette() {
-	_vm->_gyro->magics[9].op = _vm->_gyro->nix;
-	_vm->_trip->tr[1].iy += 1; /* increments dx/dy! */
-	_vm->_trip->tr[1].y += _vm->_trip->tr[1].iy;   /* Dowwwn we go... */
+	_vm->_gyro->magics[8].op = _vm->_gyro->nix;
+	_vm->_trip->tr[0].iy += 1; /* increments dx/dy! */
+	_vm->_trip->tr[0].y += _vm->_trip->tr[1].iy;   /* Dowwwn we go... */
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
@@ -540,51 +535,48 @@ void Timeout::meet_avaroid() {
 		_vm->_gyro->dna.met_avaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
-		triptype &with = _vm->_trip->tr[1];
-		with.face = _vm->_trip->left;
-		with.x = 151;
-		with.ix = -3;
-		with.iy = -5;
+		_vm->_trip->tr[0].face = _vm->_trip->left;
+		_vm->_trip->tr[0].x = 151;
+		_vm->_trip->tr[0].ix = -3;
+		_vm->_trip->tr[0].iy = -5;
 
 		_vm->_gyro->background(2);
 	}
 }
 
 void Timeout::rise_up_oubliette() {
-	triptype &with = _vm->_trip->tr[1];
-
-	with.visible = true;
-	with.iy += 1; /* decrements dx/dy! */
-	with.y -= with.iy; /* Uuuupppp we go... */
-	if (with.iy > 0)
+	_vm->_trip->tr[0].visible = true;
+	_vm->_trip->tr[0].iy++; /* decrements dx/dy! */
+	_vm->_trip->tr[0].y -= _vm->_trip->tr[0].iy; /* Uuuupppp we go... */
+	if (_vm->_trip->tr[0].iy > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
 		_vm->_gyro->dna.user_moves_avvy = true;
 }
 
 void Timeout::robin_hood_and_geida() {
-	_vm->_trip->tr[1].init(7, true, _vm->_trip);
+	_vm->_trip->tr[0].init(7, true, _vm->_trip);
 	_vm->_trip->apped(1, 7);
-	_vm->_trip->tr[1].walkto(6);
-	_vm->_trip->tr[2].stopwalk();
-	_vm->_trip->tr[2].face = _vm->_trip->left;
+	_vm->_trip->tr[0].walkto(6);
+	_vm->_trip->tr[1].stopwalk();
+	_vm->_trip->tr[1].face = _vm->_trip->left;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro->dna.geida_follows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
 	_vm->_visa->dixi('q', 66);
+	_vm->_trip->tr[0].walkto(2);
 	_vm->_trip->tr[1].walkto(2);
-	_vm->_trip->tr[2].walkto(2);
+	_vm->_trip->tr[0].vanishifstill = true;
 	_vm->_trip->tr[1].vanishifstill = true;
-	_vm->_trip->tr[2].vanishifstill = true;
 	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
 }
 
 void Timeout::avalot_returns() {
+	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[1].done();
-	_vm->_trip->tr[2].done();
-	_vm->_trip->tr[1].init(0, true, _vm->_trip);
+	_vm->_trip->tr[0].init(0, true, _vm->_trip);
 	_vm->_trip->apped(1, 1);
 	_vm->_visa->dixi('q', 67);
 	_vm->_gyro->dna.user_moves_avvy = true;
@@ -593,13 +585,13 @@ void Timeout::avalot_returns() {
 void Timeout::avvy_sit_down() {
 /* This is used when you sit down in the pub in Notts. It loops around so
 	that it will happen when Avvy stops walking. */
-	if (_vm->_trip->tr[1].homing)    /* Still walking */
+	if (_vm->_trip->tr[0].homing)    /* Still walking */
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer->show_one(3);
 		_vm->_gyro->dna.sitting_in_pub = true;
 		_vm->_gyro->dna.user_moves_avvy = false;
-		_vm->_trip->tr[1].visible = false;
+		_vm->_trip->tr[0].visible = false;
 	}
 }
 
@@ -639,14 +631,14 @@ void Timeout::avalot_falls() {
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
-	if (_vm->_trip->tr[2].homing)
+	if (_vm->_trip->tr[1].homing)
 		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
 	else
 		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	_vm->_trip->tr[2].call_eachstep = true; /* So that normal procs will continue. */
+	_vm->_trip->tr[1].call_eachstep = true; /* So that normal procs will continue. */
 }
 
 void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */


Commit: f2049db1db474d52ed5a85f3a37fbdb5d892301e
    https://github.com/scummvm/scummvm/commit/f2049db1db474d52ed5a85f3a37fbdb5d892301e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T00:47:39-07:00

Commit Message:
AVALANCHE: Repair array indexes in Trip.

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7dbda47..685c8d8 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -273,14 +273,12 @@ void triptype::bounce() {
 }
 
 int8 triptype::sgn(int16 x) {
-	int8 sgn_result;
 	if (x > 0)
-		sgn_result = 1;
+		return 1;
 	else if (x < 0)
-		sgn_result = -1;
+		return -1;
 	else
-		sgn_result = 0; /* x=0 */
-	return sgn_result;
+		return 0;
 }
 
 void triptype::walkto(byte pednum) {
@@ -431,7 +429,7 @@ triptype *triptype::done() {
 	totalnum--;
 	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
-		_info.xw += 1;
+		_info.xw++;
 	for (aa = 0; aa < /*nds*seq*/ a.num; aa++) {
 		totalnum--;
 		delete _info.mani[totalnum];
@@ -544,8 +542,6 @@ void Trip::catamove(byte ped) {
 	be called. It changes the Also codes so that they may match the picture
 	on the screen. (Coming soon: It draws up the screen, too.) */
 
-	warning("Repair array indexes in Trip::catamove()");
-
 	int32 here;
 	uint16 xy_uint16;
 	byte fv, ff;
@@ -574,8 +570,8 @@ void Trip::catamove(byte ped) {
 		fliproom(r__lusties, 5);
 		_vm->_scrolls->display("Oh no... here we go again...");
 		_vm->_gyro->dna.user_moves_avvy = false;
-		tr[1].iy = 1;
-		tr[1].ix = 0;
+		tr[0].iy = 1;
+		tr[0].ix = 0;
 		return;
 	}
 
@@ -585,66 +581,66 @@ void Trip::catamove(byte ped) {
 
 	switch (here & 0xf) { /* West. */
 	case 0: /* no connection (wall) */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(28);
 		break;
 	case 0x1: /* no connection (wall + shield), */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(29); /* ...shield. */
 		break;
 	case 0x2: /* wall with door */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(30); /* ...door. */
 		break;
 	case 0x3: /* wall with door and shield */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(30); /* ...door, and... */
 		_vm->_celer->show_one(29); /* ...shield. */
 		break;
 	case 0x4: /* no connection (wall + window), */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(5);  /* ...window. */
 		break;
 	case 0x5: /* wall with door and window */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(30); /* ...door, and... */
 		_vm->_celer->show_one(5); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* No door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* No door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(7); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
-		_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(28); /* Wall, plus... */
 		_vm->_celer->show_one(30); /* ...door, and... */
 		_vm->_celer->show_one(7); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Sloping wall. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->special; /* Straight wall. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Sloping wall. */
+		_vm->_gyro->magics[2].op = _vm->_gyro->special; /* Straight wall. */
 		break;
 	}
 
@@ -652,52 +648,52 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { /* East */
 	case 0: /* no connection (wall) */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(19);
 		break;
 	case 0x1: /* no connection (wall + window), */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(19); /* Wall, plus... */
 		_vm->_celer->show_one(20); /* ...window. */
 		break;
 	case 0x2: /* wall with door */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(19); /* Wall, plus... */
 		_vm->_celer->show_one(21); /* ...door. */
 		break;
 	case 0x3: /* wall with door and window */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(19); /* Wall, plus... */
 		_vm->_celer->show_one(20); /* ...door, and... */
 		_vm->_celer->show_one(21); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* No door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* No door. */
 		_vm->_celer->show_one(19); /* Wall, plus... */
 		_vm->_celer->show_one(18); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
-		_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
 		_vm->_celer->show_one(19); /* Wall, plus... */
 		_vm->_celer->show_one(21); /* ...door, and... */
 		_vm->_celer->show_one(18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Sloping wall. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Straight wall. */
-		_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Sloping wall. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->special; /* Straight wall. */
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
 		break;
 	}
 
@@ -705,39 +701,39 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf00) >> 8) { /* South */
 	case 0: /* No connection. */
-		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x1:
 		_vm->_celer->show_one(22);
 			
 		if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows))
-			_vm->_gyro->magics[13].op = _vm->_gyro->exclaim;
+			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
 		else
-			_vm->_gyro->magics[13].op = _vm->_gyro->special; /* Right exit south. */
+			_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Right exit south. */
 
-		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
 		_vm->_celer->show_one(23);
-		_vm->_gyro->magics[7].op = _vm->_gyro->special; /* Middle exit south. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Middle exit south. */
+		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
 		_vm->_celer->show_one(24);
-		_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Left exit south. */
-		_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[11].op = _vm->_gyro->special; /* Left exit south. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { /* North */
 	case 0: /* No connection */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
 		break;
 	// LEFT handles: 
 /*
@@ -749,8 +745,8 @@ void Trip::catamove(byte ped) {
 */
 	case 0x2:
 		_vm->_celer->show_one(4);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Middle exit north.
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
 /*	case 0x3:
 		_vm->_celer->show_one(4);
@@ -766,8 +762,8 @@ void Trip::catamove(byte ped) {
 */
 	case 0x5:
 		_vm->_celer->show_one(3);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Middle exit north. */
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; /* Middle exit north. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
 /*
 	case 0x6:
@@ -787,26 +783,26 @@ void Trip::catamove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer->show_one(32);
 
-		_vm->_gyro->magics[1].op = _vm->_gyro->special; /* Middle arch north. */
-		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->special; /* Middle arch north. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
 	}
 	break;
 	/* DECORATIONS: */
 	case 0xd: /* No connection + WINDOW */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(14);
 		break;
 	case 0xe: /* No connection + TORCH */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
 		_vm->_celer->show_one(8);
 		break;
 	/* Recessed door: */
 	case 0xf:
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Door to Geida's room. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->nix; /* Door to Geida's room. */
 		_vm->_celer->show_one(1);
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
 	}
 
@@ -843,13 +839,11 @@ void Trip::catamove(byte ped) {
 	}
 
 	if ((_vm->_gyro->dna.geida_follows) & (ped > 0)) {
-		triptype &with = tr[2];
-
-		if (!with.quick)  /* If we don't already have her... */
-			tr[2].init(5, true, this); /* ...Load Geida. */
+		if (!tr[1].quick)  /* If we don't already have her... */
+			tr[1].init(5, true, this); /* ...Load Geida. */
 		apped(2, geida_ped(ped));
-		tr[2].call_eachstep = true;
-		tr[2].eachstep = procgeida_procs;
+		tr[1].call_eachstep = true;
+		tr[1].eachstep = procgeida_procs;
 	}
 }
 
@@ -865,40 +859,40 @@ void Trip::call_special(uint16 which) {
 	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
 		_vm->_celer->show_one(1);
 		_vm->_gyro->dna.brummie_stairs = 1;
-		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
 		stopwalking();
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
 	case 2: /* _vm->_gyro->special 2: Room 22: bottom of stairs. */
 		_vm->_gyro->dna.brummie_stairs = 3;
-		_vm->_gyro->magics[11].op = _vm->_gyro->nix;
-		_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
-		_vm->_gyro->magics[12].data = 5;
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Now works as planned! */
+		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[11].op = _vm->_gyro->exclaim;
+		_vm->_gyro->magics[11].data = 5;
+		_vm->_gyro->magics[3].op = _vm->_gyro->bounces; /* Now works as planned! */
 		stopwalking();
 		_vm->_visa->dixi('q', 26);
 		_vm->_gyro->dna.user_moves_avvy = true;
 		break;
 	case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */
-		tr[1].bounce(); /* Must include that. */
+		tr[0].bounce(); /* Must include that. */
 
 		if (!_vm->_gyro->dna.arrow_triggered) {
 			_vm->_gyro->dna.arrow_triggered = true;
 			apped(2, 4); /* The dart starts at ped 4, and... */
-			tr[2].walkto(5); /* flies to ped 5. */
-			tr[2].face = 0; /* Only face. */
+			tr[1].walkto(5); /* flies to ped 5. */
+			tr[1].face = 0; /* Only face. */
 			/* Should call some kind of Eachstep procedure which will deallocate
 				the sprite when it hits the wall, and replace it with the chunk
 				graphic of the arrow buried in the plaster. */
 			/* OK! */
-			tr[2].call_eachstep = true;
-			tr[2].eachstep = procarrow_procs;
+			tr[1].call_eachstep = true;
+			tr[1].eachstep = procarrow_procs;
 		}
 		break;
 	case 4: /* This is the ghost room link. */
 		_vm->_lucerna->dusk();
-		tr[1].turn(right); /* you'll see this after we get back from bootstrap */
+		tr[0].turn(right); /* you'll see this after we get back from bootstrap */
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
 		_vm->_enid->back_to_bootstrap(3);
 		break;
@@ -907,28 +901,28 @@ void Trip::call_special(uint16 which) {
 			/* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */
 			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */
 			_vm->_visa->dixi('q', 35);
-			tr[1].done();
+			tr[0].done();
 			/*tr[1].vanishifstill:=true;*/
 			_vm->_celer->show_one(2);
 			_vm->_visa->dixi('q', 36);
 			_vm->_gyro->dna.tied_up = true;
 			_vm->_gyro->dna.friar_will_tie_you_up = false;
-			tr[2].walkto(3);
-			tr[2].vanishifstill = true;
-			tr[2].check_me = true; /* One of them must have Check_Me switched on. */
+			tr[1].walkto(3);
+			tr[1].vanishifstill = true;
+			tr[1].check_me = true; /* One of them must have Check_Me switched on. */
 			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 177; /* Not here, then. */
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
 	case 6: /* _vm->_gyro->special 6: fall down oubliette. */
 		_vm->_gyro->dna.user_moves_avvy = false;
-		tr[1].ix = 3;
-		tr[1].iy = 0;
-		tr[1].face = right;
+		tr[0].ix = 3;
+		tr[0].iy = 0;
+		tr[0].face = right;
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
 		break;
 	case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */
-		tr[1].visible = false;
+		tr[0].visible = false;
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
@@ -940,18 +934,18 @@ void Trip::call_special(uint16 which) {
 	case 8:        /* _vm->_gyro->special 8: leave du Lustie's room. */
 		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
 			_vm->_visa->dixi('q', 63);
-			tr[2].turn(down);
-			tr[2].stopwalk();
-			tr[2].call_eachstep = false; /* Geida */
+			tr[1].turn(down);
+			tr[1].stopwalk();
+			tr[1].call_eachstep = false; /* Geida */
 			_vm->_lucerna->gameover();
 		}
 		break;
 	case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */
 		if (!_vm->_gyro->dna.geida_follows)
 			return;   /* DOESN'T COUNT: no Geida. */
-		tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
-		tr[2].walkto(4); /* She walks to somewhere... */
-		tr[1].done();     /* Lose Avvy. */
+		tr[1].call_eachstep = false; /* She no longer follows Avvy around. */
+		tr[1].walkto(4); /* She walks to somewhere... */
+		tr[0].done();     /* Lose Avvy. */
 		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
 		break;
@@ -1008,7 +1002,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_x -= 1;
+		_vm->_gyro->dna.cat_x--;
 		catamove(3);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
@@ -1186,7 +1180,7 @@ void Trip::getback() {
 
 /* Eachstep procedures: */
 void Trip::follow_avvy_y(byte tripnum) {
-	if (tr[1].face == left)
+	if (tr[0].face == left)
 		return;
 	if (tr[tripnum].homing)
 		tr[tripnum].hy = tr[1].y;
@@ -1233,12 +1227,12 @@ void Trip::arrow_procs(byte tripnum) {
 			This is so if: a) the bottom of the arrow is below Avvy's head,
 			b) the left of the arrow is left of the right of Avvy's head, and
 			c) the right of the arrow is right of the left of Avvy's head. */
-		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[1].y) /* A */
-				&& (tr[tripnum].x <= (tr[1].x + tr[1]._info.xl)) /* B */
-				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[1].x)) { /* C */
+		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[0].y) /* A */
+				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info.xl)) /* B */
+				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[0].x)) { /* C */
 			/* OK, it's hit him... what now? */
 
-			tr[2].call_eachstep = false; /* prevent recursion. */
+			tr[1].call_eachstep = false; /* prevent recursion. */
 			_vm->_visa->dixi('Q', 47); /* Complaint! */
 			tr[tripnum].done(); /* Deallocate the arrow. */
 			/*     tr[1].done; { Deallocate normal pic of Avvy. }
@@ -1282,8 +1276,8 @@ void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
 	byte fv;
 	int16 tox, toy;
 			
-	tox = tr[1].x + 17;
-	toy = tr[1].y - 1;
+	tox = tr[0].x + 17;
+	toy = tr[0].y--;
 	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
 		tr[tripnum].call_eachstep = false;
 		tr[tripnum].face = left;
@@ -1297,8 +1291,8 @@ void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
 				tr[tripnum].x = tox;
 		}
 		if (tr[tripnum].y < toy)
-			tr[tripnum].y += 1;
-		tr[tripnum].step += 1;
+			tr[tripnum].y++;
+		tr[tripnum].step++;
 		if (tr[tripnum].step == tr[tripnum].a.seq)
 			tr[tripnum].step = 0;
 	}
@@ -1306,7 +1300,7 @@ void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
 
 void Trip::take_a_step(byte &tripnum) {
 	if (tr[tripnum].ix == 0) {
-		tr[tripnum].step += 1;
+		tr[tripnum].step++;
 		if (tr[tripnum].step == tr[tripnum].a.seq)
 			tr[tripnum].step = 0;
 		tr[tripnum].count = 0;
@@ -1470,72 +1464,7 @@ void Trip::stopwalking() {
 }
 
 void Trip::tripkey(char dir) {
-	if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy))
-		return;
-
-	triptype &with = tr[1];
-
-	switch (dir) {
-	case 'H':
-		if (_vm->_gyro->dna.rw != up) {
-			_vm->_gyro->dna.rw = up;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'P':
-		if (_vm->_gyro->dna.rw != down) {
-			_vm->_gyro->dna.rw = down;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'K':
-		if (_vm->_gyro->dna.rw != left) {
-			_vm->_gyro->dna.rw = left;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'M':
-		if (_vm->_gyro->dna.rw != right) {
-			_vm->_gyro->dna.rw = right;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'I':
-		if (_vm->_gyro->dna.rw != ur) {
-			_vm->_gyro->dna.rw = ur;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'Q':
-		if (_vm->_gyro->dna.rw != dr) {
-			_vm->_gyro->dna.rw = dr;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'O':
-		if (_vm->_gyro->dna.rw != dl) {
-			_vm->_gyro->dna.rw = dl;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'G':
-		if (_vm->_gyro->dna.rw != ul) {
-			_vm->_gyro->dna.rw = ul;
-			rwsp(1, _vm->_gyro->dna.rw);
-		} else
-			stopwalking();
-		break;
-	case 'L':
-		stopwalking();
-		break;
-	}
+	warning("Replaced by Trip::handleMoveKey!");
 }
 
 void Trip::readstick() {
@@ -1552,9 +1481,9 @@ void Trip::hide_in_the_cupboard() {
 
 	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 		if (_vm->_gyro->dna.wearing == nowt)
-			_vm->_scrolls->display("\6AVVY!\22 Get dressed first!");
+			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
 		else {
-			tr[1].visible = true;
+			tr[0].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
 			apped(1, 3); /* Walk out of the cupboard. */
 			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
@@ -1565,11 +1494,10 @@ void Trip::hide_in_the_cupboard() {
 		}
 	} else {
 		/* Not hiding in the cupboard */
-		tr[1].visible = false;
+		tr[0].visible = false;
 		_vm->_gyro->dna.user_moves_avvy = false;
-		_vm->_scrolls->display(Common::String("You walk into the room...\20It seems to be an empty, ") +
-				"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
-				"avoid suffocation.");
+		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
+			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
 		_vm->_gyro->dna.avvys_in_the_cupboard = true;
 		_vm->_celer->show_one(8);
 	}


Commit: e36d90f8b8a10f9820975088dea1992b940289a6
    https://github.com/scummvm/scummvm/commit/e36d90f8b8a10f9820975088dea1992b940289a6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T00:54:40-07:00

Commit Message:
AVALANCHE: Repair Lucerna::callverb().

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3249f1b..2477db1 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -66,7 +66,7 @@ void Lucerna::init() {
 	else _vm->_gyro->atkey = "alt-";
 }
 	
-void Lucerna::callverb(char n) {
+void Lucerna::callverb(byte n) {
 	if (n == _vm->_acci->pardon) {
 		_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
 			"situations. However, at the moment there is nothing " +
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 854c01c..451bd73 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -46,7 +46,7 @@ public:
 
 	void init();
 
-	void callverb(char n);
+	void callverb(byte n);
 
 	void draw_also_lines();
 


Commit: 934170b35398cb5957270685d8bb65af4df8191e
    https://github.com/scummvm/scummvm/commit/934170b35398cb5957270685d8bb65af4df8191e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T02:45:06-07:00

Commit Message:
AVALANCHE: Implement Acci::inv().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 8a194eb..cec1d4b 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -734,10 +734,25 @@ void Acci::examine() {
 
 
 void Acci::inv() {   /* the time-honoured command... */
-	char fv;
 	byte q = 0;
-
-	warning("STUB: Acci::inv()");
+	_vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
+	{
+		for (byte fv = 0; fv < numobjs; fv++)
+			if (_vm->_gyro->dna.obj[fv]) {
+				q++;
+				if (q == _vm->_gyro->dna.carrying)
+					_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->display(_vm->_gyro->get_better(fv) + _vm->_scrolls->kControlToBuffer);
+				if (fv == _vm->_gyro->dna.wearing)
+					_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
+				if (q < _vm->_gyro->dna.carrying)
+					_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
+			}
+			if (_vm->_gyro->dna.wearing == nowt)
+				_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
+			else
+				_vm->_scrolls->display(".");
+	}
 }
 
 void Acci::swallow() {   /* Eat something. */


Commit: 06346339a9deb849e09f25049c42a1bcd0a45e0c
    https://github.com/scummvm/scummvm/commit/06346339a9deb849e09f25049c42a1bcd0a45e0c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T07:10:17-07:00

Commit Message:
AVALANCHE: Implement Timeout::after_the_shootemup(), repair a lot of array indexes in various places.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index cec1d4b..644db34 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -742,8 +742,8 @@ void Acci::inv() {   /* the time-honoured command... */
 				q++;
 				if (q == _vm->_gyro->dna.carrying)
 					_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-				_vm->_scrolls->display(_vm->_gyro->get_better(fv) + _vm->_scrolls->kControlToBuffer);
-				if (fv == _vm->_gyro->dna.wearing)
+				_vm->_scrolls->display(_vm->_gyro->get_better(fv + 1) + _vm->_scrolls->kControlToBuffer);
+				if ((fv + 1) == _vm->_gyro->dna.wearing)
 					_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
 				if (q < _vm->_gyro->dna.carrying)
 					_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
@@ -767,7 +767,7 @@ void Acci::swallow() {   /* Eat something. */
 			_vm->_visa->dixi('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_visa->dixi('U', 2);
-			_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
+			_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 			_vm->_lucerna->objectlist();
 			have_a_drink();
 				}
@@ -800,7 +800,7 @@ void Acci::swallow() {   /* Eat something. */
 		if (_vm->_gyro->dna.rotten_onion)  _vm->_visa->dixi('U', 11);
 		else {
 			_vm->_visa->dixi('U', 8);
-			_vm->_gyro->dna.obj[_vm->_gyro->onion] = false;
+			_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
 			_vm->_lucerna->objectlist();
 		}
 		break;
@@ -1023,7 +1023,7 @@ bool Acci::give2spludwick() {
 
 	switch (thing) {
 	case _vm->_gyro->onion:
-		_vm->_gyro->dna.obj[_vm->_gyro->onion] = false;
+		_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
 		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa->dixi('q', 22);
 		else {
@@ -1035,7 +1035,7 @@ bool Acci::give2spludwick() {
 		_vm->_lucerna->objectlist();
 		break;
 	case _vm->_gyro->ink:
-		_vm->_gyro->dna.obj[_vm->_gyro->ink] = false;
+		_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false;
 		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.given2spludwick++;
 		_vm->_visa->dixi('q', 24);
@@ -1043,12 +1043,12 @@ bool Acci::give2spludwick() {
 		_vm->_lucerna->points(3);
 		break;
 	case _vm->_gyro->mushroom:
-		_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false;
+		_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false;
 		_vm->_visa->dixi('q', 25);
 		_vm->_lucerna->points(5);
 		_vm->_gyro->dna.given2spludwick++;
 		go_to_cauldron();
-		_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
+		_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
 		_vm->_lucerna->objectlist();
 		break;
 	default:
@@ -1061,7 +1061,7 @@ bool Acci::give2spludwick() {
 void Acci::have_a_drink() {
 	_vm->_gyro->dna.alcohol += 1;
 	if (_vm->_gyro->dna.alcohol == 5) {
-		_vm->_gyro->dna.obj[_vm->_gyro->key] = true; /* Get the key. */
+		_vm->_gyro->dna.obj[_vm->_gyro->key - 1] = true; /* Get the key. */
 		_vm->_gyro->dna.teetotal = true;
 		_vm->_gyro->dna.avvy_is_awake = false;
 		_vm->_gyro->dna.avvy_in_bed = true;
@@ -1142,7 +1142,7 @@ void Acci::getproc(char thing) {
 			if (_vm->_gyro->dna.box_contents == thing) {
 				_vm->_celer->show_one(5);
 				_vm->_scrolls->display("OK, I've got it.");
-				_vm->_gyro->dna.obj[thing] = true;
+				_vm->_gyro->dna.obj[thing - 1] = true;
 				_vm->_lucerna->objectlist();
 				_vm->_gyro->dna.box_contents = nowt;
 				_vm->_celer->show_one(6);
@@ -1164,7 +1164,7 @@ void Acci::getproc(char thing) {
 					_vm->_celer->show_one(4); /* No pen there now. */
 					_vm->_trip->call_special(3); /* Zap! */
 					_vm->_gyro->dna.taken_pen = true;
-					_vm->_gyro->dna.obj[_vm->_gyro->pen] = true;
+					_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true;
 					_vm->_lucerna->objectlist();
 					_vm->_scrolls->display("Taken.");
 				}
@@ -1186,7 +1186,7 @@ void Acci::getproc(char thing) {
 			_vm->_scrolls->display("Got it!");
 			_vm->_gyro->dna.mushroom_growing = false;
 			_vm->_gyro->dna.taken_mushroom = true;
-			_vm->_gyro->dna.obj[_vm->_gyro->mushroom] = true;
+			_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = true;
 			_vm->_lucerna->objectlist();
 			_vm->_lucerna->points(3);
 		} else
@@ -1202,7 +1202,7 @@ void Acci::give_geida_the_lute() {
 		_vm->_scrolls->display("Not yet. Try later!\232\2");
 		return;
 	}
-	_vm->_gyro->dna.obj[_vm->_gyro->lute] = false;
+	_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false;
 	_vm->_lucerna->objectlist();
 	_vm->_visa->dixi('q', 64); /* She plays it. */
 
@@ -1263,7 +1263,7 @@ void Acci::person_speaks() {
 void Acci::heythanks() {
 	person_speaks();
 	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
-	_vm->_gyro->dna.obj[thing] = false;
+	_vm->_gyro->dna.obj[thing - 1] = false;
 }
 
 void Acci::do_that() {
@@ -1381,7 +1381,7 @@ void Acci::do_that() {
 					case _vm->_gyro->pcrapulus:
 						if (thing == _vm->_gyro->wine) {
 							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
+							_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 						} else
 							heythanks();
 						break;
@@ -1763,7 +1763,7 @@ void Acci::do_that() {
 							_vm->_lucerna->points(3);
 						}
 						_vm->_gyro->pennycheck(3); // It costs thruppence.
-						_vm->_gyro->dna.obj[_vm->_gyro->onion] = true;
+						_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = true;
 						_vm->_lucerna->objectlist();
 						_vm->_gyro->dna.bought_onion = true;
 						_vm->_gyro->dna.rotten_onion = false; // It's OK when it leaves the stall!
@@ -1801,8 +1801,8 @@ void Acci::do_that() {
 			case 3:
 				_vm->_visa->dixi('Q', 11);
 				_vm->_gyro->dna.cwytalot_gone = true;
-				_vm->_gyro->dna.obj[_vm->_gyro->bolt] = false;
-				_vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false;
+				_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = false;
+				_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = false;
 				_vm->_lucerna->objectlist();
 				_vm->_gyro->magics[11].op = _vm->_gyro->nix;
 				_vm->_lucerna->points(7);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index e7cf879..f689142 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -332,10 +332,10 @@ void Gyro::newgame() {
 
 	dna.pence = 30; /* 2/6 */ dna.rw = stopped;
 	dna.wearing = clothes;
-	dna.obj[money] = true;
-	dna.obj[bodkin] = true;
-	dna.obj[bell] = true;
-	dna.obj[clothes] = true;
+	dna.obj[money - 1] = true;
+	dna.obj[bodkin - 1] = true;
+	dna.obj[bell - 1] = true;
+	dna.obj[clothes - 1] = true;
 	
 	thinks = 2;
 	_vm->_lucerna->objectlist();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 2477db1..7ed5214 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -344,7 +344,7 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 	}
 
 	if (_vm->_gyro->dna.room != r__outsideducks) {
-		if ((_vm->_gyro->dna.obj[_vm->_gyro->onion]) && !(_vm->_gyro->dna.onion_in_vinegar))
+		if ((_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]) && !(_vm->_gyro->dna.onion_in_vinegar))
 			_vm->_gyro->dna.rotten_onion = true; /* You're holding the onion */
 	}
 }
@@ -559,9 +559,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		{
 			dnatype &with = _vm->_gyro->dna;
-			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine]) && (_vm->_gyro->dna.winestate != 3)) {
+			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) {
 				_vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */
-				_vm->_gyro->dna.obj[_vm->_gyro->wine] = false;
+				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 				objectlist();
 			}
 		}
@@ -996,7 +996,7 @@ void Lucerna::fxtoggle() {
 
 void Lucerna::objectlist() {
 	_vm->_gyro->dna.carrying = 0;
-	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks])
+	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks - 1])
 		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */
 	for (byte fv = 0; fv < numobjs; fv++)
 		if (_vm->_gyro->dna.obj[fv]) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index a7f61be..e7508ec 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -361,7 +361,37 @@ void Timeout::hang_around2() {
 }
 
 void Timeout::after_the_shootemup() {
+	
+	_vm->_trip->fliproom(_vm->_gyro->dna.room, 0);
+	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
+
+	_vm->_trip->tr[0].init(0, true, _vm->_trip); /* Avalot. */
+	_vm->_trip->apped(1, 2);
+	_vm->_gyro->dna.user_moves_avvy = true;
+	_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = true;
+	_vm->_lucerna->objectlist();
+
+	// Same as the added line above: TODO: Remove it later!!!
+	_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+
+	//byte shootscore, gain;
+
+	//shootscore = mem[storage_seg * storage_ofs];
+	//gain = (shootscore + 5) / 10; /* Rounding up. */
+
+	//display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
+	//	strf(shootscore) + " ö 10) = " + strf(gain) + " points.");
+
+	//if (gain > 20) {
+	//	display("But we won't let you have more than 20 points!");
+	//	points(20);
+	//} else
+	//	points(gain);
+
 	warning("STUB: Timeout::after_the_shootemup()");
+
+	_vm->_visa->dixi('q', 70);
 }
 
 void Timeout::jacques_wakes_up() {
@@ -470,7 +500,7 @@ void Timeout::jump() {
 		else {
 			_vm->_celer->show_one(2);
 			_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
-			_vm->_gyro->dna.obj[_vm->_gyro->bolt] = true;
+			_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true;
 			_vm->_lucerna->objectlist();
 			_vm->_visa->dixi('q', 50);
 			_vm->_lucerna->points(3);
@@ -503,7 +533,7 @@ void Timeout::buywine() {
 	_vm->_visa->dixi('D', 1); /* It'll be thruppence. */
 	if (_vm->_gyro->pennycheck(3)) {
 		_vm->_visa->dixi('D', 4); /* You paid up. */
-		_vm->_gyro->dna.obj[_vm->_gyro->wine] = true;
+		_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = true;
 		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.winestate = 1; /* OK Wine */
 	}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 685c8d8..8762250 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -952,7 +952,7 @@ void Trip::call_special(uint16 which) {
 	case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */
 		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
 			/* Into Geida's room. */
-			if (_vm->_gyro->dna.obj[_vm->_gyro->key])
+			if (_vm->_gyro->dna.obj[_vm->_gyro->key - 1])
 				_vm->_visa->dixi('q', 62);
 			else {
 				_vm->_visa->dixi('q', 61);
@@ -1277,7 +1277,7 @@ void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
 	int16 tox, toy;
 			
 	tox = tr[0].x + 17;
-	toy = tr[0].y--;
+	toy = tr[0].y - 1;
 	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
 		tr[tripnum].call_eachstep = false;
 		tr[tripnum].face = left;
@@ -1601,6 +1601,9 @@ void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
 
 
 void Trip::handleMoveKey(const Common::Event &event) { 
+	if (!_vm->_gyro->dna.user_moves_avvy)
+		return;
+
 	if (_vm->_dropdown->ddm_o.menunow)
 		_vm->_parser->tryDropdown();
 	else
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 4a6fbc7..182783e 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -172,9 +172,9 @@ void Visa::talkto(byte whom) {
 	if (_vm->_gyro->subjnumber == 0)
 		switch (whom) {
 		case _vm->_gyro->pspludwick:
-			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion])) {
+			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion - 1])) {
 				dixi('q', 68);
-				_vm->_gyro->dna.obj[_vm->_gyro->potion] = true;
+				_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
 				_vm->_lucerna->objectlist();
 				_vm->_lucerna->points(3);
 				return;
@@ -276,7 +276,7 @@ void Visa::talkto(byte whom) {
 		dixi('n', whom); // File not found!
 
 	if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->dna.obj[_vm->_gyro->badge] = true;
+		_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = true;
 		_vm->_lucerna->objectlist();
 		dixi('q', 1); // Circular from Cardiff.
 		_vm->_gyro->dna.talked_to_crapulus = true;


Commit: 338dac4e10b4795096ee3cce9fd895e783a14efa
    https://github.com/scummvm/scummvm/commit/338dac4e10b4795096ee3cce9fd895e783a14efa
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-26T11:13:43-07:00

Commit Message:
AVALANCHE: Implement Acci::store_interrogation() and all the functions it uses.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 644db34..c1a1950 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -389,29 +389,85 @@ bool Acci::do_pronouns() {
 	return ambiguous;
 }
 
-void Acci::lowercase() {
-	byte fv;
 
-	warning("STUB: Acci::lowercase()");
+
+void Acci::lowercase() {
+	_vm->_parser->_inputText.toLowercase();
 }
 
 void Acci::propernouns() {
-	byte fv;
-
 	lowercase();
-	warning("STUB: Acci::propernouns()");
+
+	// We set every word's first character to uppercase.
+	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++)
+		if (_vm->_parser->_inputText[i] == ' ')
+			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
+	// And the first character as well.
+	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
 }
 
 void Acci::sayit() { /* This makes Avalot say the response. */
-	Common::String x;
-
-	warning("STUB: Acci::sayit()");
+	Common::String x = _vm->_parser->_inputText;
+	x.setChar(toupper(x[0]), 0);
+	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x 
+		+ '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2');
 }
 
 void Acci::store_interrogation(byte interrogation) {
-	byte fv;
+	if (_vm->_parser->_inputText.empty())
+		return;
+
+	/* Strip _vm->_parser->_inputText: */
+	while ((_vm->_parser->_inputText[0] == ' ') && (!_vm->_parser->_inputText.empty()))
+		_vm->_parser->_inputText.deleteChar(0);
+	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
+		_vm->_parser->_inputText.deleteLastChar();
+	
+	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // if you want to use any other timer, put this into the case statement. */
+
+	switch (interrogation) {
+	case 1: {
+			lowercase();
+			sayit();
+			_vm->_gyro->dna.like2drink = _vm->_parser->_inputText;
+			_vm->_gyro->dna.cardiff_things = 2;
+		}
+		break;
+	case 2: {
+			propernouns();
+			sayit();
+			_vm->_gyro->dna.favourite_song = _vm->_parser->_inputText;
+			_vm->_gyro->dna.cardiff_things = 3;
+		}
+		break;
+	case 3: {
+			propernouns();
+			sayit();
+			_vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText;
+			_vm->_gyro->dna.cardiff_things = 4;
+		}
+		break;
+	case 4: {
+			lowercase();
+			sayit();
+			if (!_vm->_gyro->dna.spare_evening.empty())
+				_vm->_gyro->dna.spare_evening.clear();
+			_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
+			_vm->_visa->dixi('z', 5); /* His closing statement... */
+			_vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */
+			_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
+			_vm->_gyro->magics[1].op = _vm->_gyro->nix;
+			_vm->_gyro->dna.cardiff_things = 5;
+		}
+		break;
+	case 99:
+		//store_high(_vm->_parser->_inputText);
+		warning("STUB: Acci::store_interrogation()");
+		break;
+	}
 
-	warning("STUB: Acci::store_interrogation()");
+	if (interrogation < 4)
+		_vm->_timeout->cardiff_survey();
 }
 
 
@@ -686,7 +742,7 @@ bool Acci::holding() {
 
 	if (thing > 100)
 		_vm->_scrolls->display("Be reasonable!");
-	else if (!_vm->_gyro->dna.obj[thing])  // Verbs that need "thing" to be in the inventory.
+	else if (!_vm->_gyro->dna.obj[thing - 1])  // Verbs that need "thing" to be in the inventory.
 		_vm->_scrolls->display("You're not holding it, Avvy.");
 	else 
 		holdingResult = true;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index e7508ec..5c786ce 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -293,15 +293,15 @@ void Timeout::stairs() {
 }
 
 void Timeout::cardiff_survey() {
-	switch (_vm->_gyro->dna.cardiff_things) {
-	case 0:
-		_vm->_gyro->dna.cardiff_things += 1;
+	if (_vm->_gyro->dna.cardiff_things == 0) {
+		_vm->_gyro->dna.cardiff_things++;
 		_vm->_visa->dixi('q', 27);
-		break;
 	}
+
 	_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
 
 	_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
+
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
 


Commit: f0dbe10cb2c4b14b7a441bdde3ee0a9273309ef8
    https://github.com/scummvm/scummvm/commit/f0dbe10cb2c4b14b7a441bdde3ee0a9273309ef8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-27T02:10:24-07:00

Commit Message:
AVALANCHE: Repair exampers(), openBox() and do_that() in Acci. Repair loading from the Launcher.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index c1a1950..87f89fa 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -717,13 +717,17 @@ void Acci::exampers() {
 		person -= 149;
 		switch (person) { /* Special cases */
 		case 11:
-			if (_vm->_gyro->dna.wonnim)
+			if (_vm->_gyro->dna.wonnim) {
 				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
-			return;
+				return;
+			}
+			break;
 		case 99:
-			if (_vm->_gyro->dna.lustie_is_asleep)
+			if (_vm->_gyro->dna.lustie_is_asleep) {
 				_vm->_visa->dixi('Q', 65); // He's asleep. (65! Wow!)
-			return;
+				return;
+			}
+			break;
 		}
 		// Otherwise...
 		_vm->_visa->dixi('p', person);
@@ -753,19 +757,21 @@ bool Acci::holding() {
 
 
 void Acci::openBox(bool before) {
-	_vm->_celer->show_one(5);
-
-	_vm->_celer->pics_link();
-	_vm->_trip->trippancy_link();
-	_vm->_graphics->refreshScreen();
-
-	_vm->_system->delayMillis(55);
+	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
+		_vm->_celer->show_one(5);
 
-	if (!before) {
-		_vm->_celer->show_one(6);
 		_vm->_celer->pics_link();
 		_vm->_trip->trippancy_link();
 		_vm->_graphics->refreshScreen();
+
+		_vm->_system->delayMillis(55);
+
+		if (!before) {
+			_vm->_celer->show_one(6);
+			_vm->_celer->pics_link();
+			_vm->_trip->trippancy_link();
+			_vm->_graphics->refreshScreen();
+		}
 	}
 }
 
@@ -1790,7 +1796,7 @@ void Acci::do_that() {
 						}
 
 						_vm->_celer->show_one(12);
-						_vm->_scrolls->display("Wine, please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->dna.alcohol == 0)
 							_vm->_lucerna->points(3);
 						_vm->_celer->show_one(10);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index de37f50..4306bb2 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -193,7 +193,10 @@ void Avalot::setup() {
 
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
-	if (loadSlot >= 0) {		
+	if (loadSlot >= 0) {	
+		_vm->_gyro->thinks = 2; // You always have money.
+		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
+
 		_vm->loadGame(loadSlot);
 	} else {
 		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
@@ -230,13 +233,13 @@ void Avalot::run(Common::String arg) {
 
 
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
-			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+		/*	for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
+		_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
 
 		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-			if (_vm->_gyro->fields[i].x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
-		}
+		if (_vm->_gyro->fields[i].x1 < 640)
+		_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+		}*/
 		// ONYL FOR TESTING!!!
 
 


Commit: f7d17fd7b71a13ed585f13471b296d585c4e054c
    https://github.com/scummvm/scummvm/commit/f7d17fd7b71a13ed585f13471b296d585c4e054c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-27T10:41:54-07:00

Commit Message:
AVALANCHE: Partially implement the music room. (Without music.)

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8019a35..88c928c 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -244,7 +244,28 @@ bool Scrolls::they_match(tunetype &played) {
 }
 
 void Scrolls::music_scroll() {
+	state(3);
+	_vm->_gyro->seescroll = true;
+	_vm->_gyro->on();
+	_vm->_gyro->newpointer(4);
+
+	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further. 
+	// For now we act like the player just played the right tone.
+	//if (they_match(played)) {
+		_vm->_gyro->screturn = true;
+		_vm->_gyro->off();
+		state(0);
+		_vm->_gyro->seescroll = false;
+
+		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->reason_jacques_waking_up);
+		return;
+	//}
 	warning("STUB: Scrolls::music_scroll()");
+
+	_vm->_gyro->screturn = false;
+	_vm->_gyro->off();
+	state(0);
+	_vm->_gyro->seescroll = false;
 }
 
 /* ThatsAll, so put us back to */ /*$F-*/
@@ -861,19 +882,15 @@ void Scrolls::okay() {
 }
 
 void Scrolls::musical_scroll() {
-	bool was_virtual;
-
-	display(Common::String("To play the harp...\r\rUse these keys:\r\n") +
-	        "Q W E R T Y U I O P [ ]\r\rOr press Enter to stop playing.\4");
+	display(Common::String("To play the harp...") + kControlNewLine + kControlNewLine + "Use these keys:" + + kControlNewLine
+		+ kControlInsertSpaces + "Q W E R T Y U I O P [ ]" + kControlNewLine + kControlNewLine + "Or press Enter to stop playing."
+		+ kControlToBuffer);
 
 	_vm->_lucerna->sprite_run();
 
-	was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;
-
 	drawscroll(&Avalanche::Scrolls::music_scroll);
 
 	resetscroll();
 }
 
-
 } // End of namespace Avalanche
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 5c786ce..5b0f285 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -405,7 +405,7 @@ void Timeout::jacques_wakes_up() {
 	case 2 : /* Going through the door. */
 		_vm->_celer->show_one(2); /* Not on the floor. */
 		_vm->_celer->show_one(3); /* But going through the door. */
-		_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* You can't wake him up now. */
 		break;
 	case 3 :  /* Gone through the door. */
 		_vm->_celer->show_one(2); /* Not on the floor, either. */


Commit: f53d998e53d1c5f12dcc58ff490c18fdb16765c1
    https://github.com/scummvm/scummvm/commit/f53d998e53d1c5f12dcc58ff490c18fdb16765c1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-27T11:34:44-07:00

Commit Message:
AVALANCHE: Repair Gyro::whereis indexes.

Changed paths:
    engines/avalanche/enid2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index ee37cc7..9841fa0 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -278,7 +278,7 @@ void Enid::edna_reload() {
 
 	_vm->_lucerna->major_redraw();
 
-	_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
+	_vm->_gyro->whereis[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
 
 	_vm->_gyro->alive = true;
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 7ed5214..8512e82 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -373,10 +373,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 	if ((_vm->_gyro->dna.rooms[x] == 0) && (! _vm->_gyro->flagset('S')))
 		points(1);
 
-	_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
+	_vm->_gyro->whereis[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
 
 	if (_vm->_gyro->dna.geida_follows)
-		_vm->_gyro->whereis[_vm->_gyro->pgeida] = x;
+		_vm->_gyro->whereis[_vm->_gyro->pgeida - 150] = x;
 
 	_vm->_gyro->roomtime = 0;
 
@@ -398,7 +398,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
-				_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
+				_vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__outsideyours;
 				_vm->_trip->tr[1].init(8, false, _vm->_trip); /* load Crapulus */
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
@@ -412,7 +412,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
 
-			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
+			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->dna.crapulus_will_tell) {
 				_vm->_trip->tr[1].init(8, false, _vm->_trip);
@@ -450,14 +450,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(4, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
-			_vm->_gyro->magics[lightred].op = _vm->_gyro->nix;
-			_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere;
+			_vm->_gyro->magics[lightred - 11].op = _vm->_gyro->nix;
+			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot*/
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
-				_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
+				_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
 					_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
@@ -510,14 +510,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		if (_vm->_gyro->dna.been_tied_up) {
-			_vm->_gyro->whereis[_vm->_gyro->probinhood] = 0;
-			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 0;
+			_vm->_gyro->whereis[_vm->_gyro->probinhood - 150] = 0;
+			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 0;
 		}
 
 		if (_vm->_gyro->dna.tied_up)
 			_vm->_celer->show_one(2);
 
-		if (! _vm->_gyro->dna.mushroom_growing) 
+		if (!_vm->_gyro->dna.mushroom_growing) 
 			_vm->_celer->show_one(3);
 		_vm->_graphics->refreshBackground();
 	}
@@ -612,7 +612,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->show_one(4);
 			_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
-			_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0;
+			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer->show_one(6);
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 5b0f285..e17ef72 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -336,7 +336,7 @@ void Timeout::get_tied_up2() {
 void Timeout::hang_around() {
 	_vm->_trip->tr[1].check_me = false;
 	_vm->_trip->tr[0].init(7, true, _vm->_trip); /* Robin Hood */
-	_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
+	_vm->_gyro->whereis[_vm->_gyro->probinhood - 150] = r__robins;
 	_vm->_trip->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
 	_vm->_trip->tr[0].walkto(7);
@@ -347,7 +347,7 @@ void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
 	_vm->_trip->tr[1].vanishifstill = false;
 	_vm->_trip->tr[1].walkto(4);
-	_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
+	_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[1].done(); /* Get rid of Robin Hood and Friar Tuck. */
@@ -410,7 +410,7 @@ void Timeout::jacques_wakes_up() {
 	case 3 :  /* Gone through the door. */
 		_vm->_celer->show_one(2); /* Not on the floor, either. */
 		_vm->_celer->show_one(4); /* He's gone... so the door's open. */
-		_vm->_gyro->whereis[_vm->_gyro->pjacques - 1] = 0; /* Gone! */
+		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; /* Gone! */
 		break;
 	}
 
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 8762250..b478e9b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -910,7 +910,7 @@ void Trip::call_special(uint16 which) {
 			tr[1].walkto(3);
 			tr[1].vanishifstill = true;
 			tr[1].check_me = true; /* One of them must have Check_Me switched on. */
-			_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = 177; /* Not here, then. */
+			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 177; /* Not here, then. */
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 182783e..b0cabd4 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -281,7 +281,7 @@ void Visa::talkto(byte whom) {
 		dixi('q', 1); // Circular from Cardiff.
 		_vm->_gyro->dna.talked_to_crapulus = true;
 
-		_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = 177; // Crapulus walks off.
+		_vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_trip->tr[1].vanishifstill = true;
 		_vm->_trip->tr[1].walkto(3); // Walks away.


Commit: 6531ca39b955268d6a4274b4889252f5d382c6d6
    https://github.com/scummvm/scummvm/commit/6531ca39b955268d6a4274b4889252f5d382c6d6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-27T11:46:08-07:00

Commit Message:
AVALANCHE: Various index fixes in Lucerna.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 8512e82..e3de0da 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -450,7 +450,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(4, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
-			_vm->_gyro->magics[lightred - 11].op = _vm->_gyro->nix;
+			_vm->_gyro->magics[lightred - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
@@ -473,14 +473,13 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__argentroad: {
-		dnatype &with = _vm->_gyro->dna;
-		if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
+		if ((_vm->_gyro->dna.cwytalot_gone) && (! _vm->_gyro->dna.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
 			_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
 			_vm->_trip->apped(2, 1);
 			_vm->_trip->tr[1].walkto(2);
 			_vm->_trip->tr[1].vanishifstill = true;
-			with.cwytalot_in_herts = true;
+			_vm->_gyro->dna.cwytalot_in_herts = true;
 			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
 		}
@@ -491,7 +490,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
 			_vm->_celer->show_one(3); /* Position of drawbridge */
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
+			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(ped + 2, ped); /* load Geida */
@@ -611,7 +610,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->show_one(2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->show_one(4);
-			_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
+			_vm->_gyro->magics[brown - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {


Commit: 499d176ab121803bc6956fcff664f46a72b77e16
    https://github.com/scummvm/scummvm/commit/499d176ab121803bc6956fcff664f46a72b77e16
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-29T03:07:04-07:00

Commit Message:
AVALANCHE: Repair Acci::do_that() and roomnums.h. Some cosmetic repairs here and there.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/roomnums.h
    engines/avalanche/sequence2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 87f89fa..f4b9686 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1885,12 +1885,11 @@ void Acci::do_that() {
 		else {
 			ok = true;
 			for (ff = 0; ff < thats.size(); ff++) {
-				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password - 1].w.size(); fv++) {
-					Common::String temp = realwords[ff];
-					temp.toUppercase();
-					if (words[_vm->_gyro->dna.pass_num + first_password - 1].w[fv] != temp[fv])
+				Common::String temp = realwords[ff];
+				temp.toUppercase();
+				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++)
+					if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv])
 						ok = false;
-				}
 			}
 
 			if (ok) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index ec78028..c3711c5 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -82,7 +82,7 @@ struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
 	byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/
 	bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/
 
-	byte pass_num; /* Number of the passuint16 for this game. */
+	byte pass_num; /* Number of the passw for this game. */
 	bool ayles_is_awake; /* pretty obvious! */
 	byte drawbridge_open; /* Between 0 (shut) and 4 (open). */
 	byte avaricius_talk; /* How much Avaricius has said to you. */
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e3de0da..76b8bcd 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -443,7 +443,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 			_vm->_trip->tr[1].call_eachstep = true;
 			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
-		} else _vm->_gyro->whereis[1] = r__nowhere;
+		} else
+			_vm->_gyro->whereis[1] = r__nowhere;
 		break;
 
 	case r__brummieroad: {
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index fb99f5c..3032f71 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -48,7 +48,7 @@ const byte r__avvysgarden = 15;
 const byte r__aylesoffice = 16;
 const byte r__argentpub = 19;
 const byte r__brummieroad = 20;
-const byte r__lusties = 21; /*{ ? not sure }*/
+const byte r__bridge = 21; /*{ ? not sure }*/
 const byte r__entrancehall = 22;
 const byte r__lustiesroom = 23;
 const byte r__westhall = 25;
@@ -59,7 +59,7 @@ const byte r__catacombs = 29;
 
 //{ -------------- }
 
-const byte r__bridge = 40;
+const byte r__lusties = 40;
 const byte r__robins = 42;
 const byte r__outsidenottspub = 46;
 const byte r__nottspub = 47;
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 6439df2..f41ac12 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -90,11 +90,11 @@ void Sequence::shove_left() {
 void Sequence::call_sequencer() {
 	switch (seq[0]) {
 	case 0:
-		return;
-		break; /* No more routines. */
-	case 177:
+		return; // No more routines.
+		break; 
+	case 177: // Flip room.
 		_vm->_gyro->dna.user_moves_avvy = true;
-		_vm->_trip->fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
+		_vm->_trip->fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); 
 		if (seq[0] == 177)
 			shove_left();
 		break;


Commit: f95834ca05ae0f3a60e475fdef2fe42f6d2f18d5
    https://github.com/scummvm/scummvm/commit/f95834ca05ae0f3a60e475fdef2fe42f6d2f18d5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-29T05:33:05-07:00

Commit Message:
AVALANCHE: Repair "entrance hall" room and everything connected to it.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/roomnums.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index f4b9686..586f228 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -964,7 +964,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 				_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
 				break;
 			case _vm->_gyro->mopendoor:
-				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv);
+				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv + 9);
 				break;
 			}
 			
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index c3711c5..a7ad6b6 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -72,7 +72,7 @@ struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
 	int16 score; /* your score, of course */
 	int32 pence; /* your current amount of dosh */
 	byte room; /* your current room */
-	char wearing; /* what you're wearing */
+	byte wearing; /* what you're wearing */
 	byte swore; /* number of times you've sworn */
 	byte saves; /* number of times this game has been saved */
 	byte rooms[100]; /* Add one to each every time you enter a room */
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index 3032f71..f38c25d 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -49,7 +49,7 @@ const byte r__aylesoffice = 16;
 const byte r__argentpub = 19;
 const byte r__brummieroad = 20;
 const byte r__bridge = 21; /*{ ? not sure }*/
-const byte r__entrancehall = 22;
+const byte r__entrancehall = 40;
 const byte r__lustiesroom = 23;
 const byte r__westhall = 25;
 const byte r__easthall = 26;
@@ -59,7 +59,7 @@ const byte r__catacombs = 29;
 
 //{ -------------- }
 
-const byte r__lusties = 40;
+const byte r__lusties = 22;
 const byte r__robins = 42;
 const byte r__outsidenottspub = 46;
 const byte r__nottspub = 47;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index b478e9b..e5a110f 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1055,7 +1055,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 				return;
 			} else {
 				apped(1, 6);
-				tr[1].face = right; /* added by TT 12/3/1995 */
+				tr[0].face = right; /* added by TT 12/3/1995 */
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(9);
 			}
@@ -1523,7 +1523,7 @@ void Trip::fliproom(byte room, byte ped) {
 		return;
 	}
 
-	if ((ped == 177) && (_vm->_gyro->dna.room == r__lusties)) {
+	if ((room == 177) && (_vm->_gyro->dna.room == r__lusties)) {
 		hide_in_the_cupboard();
 		return;
 	}


Commit: 3aa059848a0bc64f7395115db75bb39d0e1b6794
    https://github.com/scummvm/scummvm/commit/3aa059848a0bc64f7395115db75bb39d0e1b6794
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-29T14:38:47-07:00

Commit Message:
AVALANCHE: Repair the catacombs.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/roomnums.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 76b8bcd..4190c75 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -571,7 +571,30 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__catacombs: {
-		warning("STUB: Lucerna::enterroom() - case: r__catacombs");
+		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
+
+			switch (ped) {
+			case 3: { // Enter from oubliette
+				_vm->_gyro->dna.cat_x = 8;
+				_vm->_gyro->dna.cat_y = 4;
+			}
+			break; 
+			case 5: { // Enter from du Lustie's
+				_vm->_gyro->dna.cat_x = 8;
+				_vm->_gyro->dna.cat_y = 7;
+			}
+			break; 
+			case 6: { // Enter from Geida's
+				_vm->_gyro->dna.cat_x = 4;
+				_vm->_gyro->dna.cat_y = 1;
+			}
+			break; 
+			}
+
+			_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
+			_vm->_trip->catamove(ped);
+			_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
+		}
 	}
 	break;
 
@@ -761,7 +784,6 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__ducks:
 		_vm->_gyro->dna.dogfoodpos = 1;
 		break; /* Actually, Duck pos. */
-
 	}
 
 	_vm->_gyro->seescroll = false; /* Now it can work again! */
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index f38c25d..a21da00 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -49,7 +49,7 @@ const byte r__aylesoffice = 16;
 const byte r__argentpub = 19;
 const byte r__brummieroad = 20;
 const byte r__bridge = 21; /*{ ? not sure }*/
-const byte r__entrancehall = 40;
+const byte r__lusties = 22;
 const byte r__lustiesroom = 23;
 const byte r__westhall = 25;
 const byte r__easthall = 26;
@@ -59,7 +59,7 @@ const byte r__catacombs = 29;
 
 //{ -------------- }
 
-const byte r__lusties = 22;
+const byte r__entrancehall = 40;
 const byte r__robins = 42;
 const byte r__outsidenottspub = 46;
 const byte r__nottspub = 47;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index e5a110f..db7dbea 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -517,24 +517,18 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 }
 
 byte Trip::geida_ped(byte which) {
-	byte geida_ped_result;
 	switch (which) {
 	case 1:
-		geida_ped_result = 7;
-		break;
+		return 7;
 	case 2:
 	case 6:
-		geida_ped_result = 8;
-		break;
+		return 8;
 	case 3:
 	case 5:
-		geida_ped_result = 9;
-		break;
+		return 9;
 	case 4:
-		geida_ped_result = 10;
-		break;
+		return 10;	
 	}
-	return geida_ped_result;
 }
 
 void Trip::catamove(byte ped) {
@@ -561,7 +555,7 @@ void Trip::catamove(byte ped) {
 		return;
 	case 1033: /* Oubliette */
 		fliproom(r__oubliette, 1);
-		_vm->_scrolls->display("Oh, NO!\231\2");
+		_vm->_scrolls->display(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	case 4:
 		fliproom(r__geidas, 1);
@@ -577,7 +571,7 @@ void Trip::catamove(byte ped) {
 
 	if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
 		_vm->_lucerna->load(29);
-	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x];
+	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1];
 
 	switch (here & 0xf) { /* West. */
 	case 0: /* no connection (wall) */
@@ -691,7 +685,7 @@ void Trip::catamove(byte ped) {
 		_vm->_celer->show_one(18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
-		_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Sloping wall. */
+		_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->special; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
 		break;
@@ -708,7 +702,7 @@ void Trip::catamove(byte ped) {
 	case 0x1:
 		_vm->_celer->show_one(22);
 			
-		if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows))
+		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
 			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
 		else
 			_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Right exit south. */
@@ -838,7 +832,7 @@ void Trip::catamove(byte ped) {
 		break; /* [1,1] : the other two. */
 	}
 
-	if ((_vm->_gyro->dna.geida_follows) & (ped > 0)) {
+	if ((_vm->_gyro->dna.geida_follows) && (ped > 0)) {
 		if (!tr[1].quick)  /* If we don't already have her... */
 			tr[1].init(5, true, this); /* ...Load Geida. */
 		apped(2, geida_ped(ped));
@@ -960,12 +954,12 @@ void Trip::call_special(uint16 which) {
 			}
 		}
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_y -= 1;
+		_vm->_gyro->dna.cat_y --;
 		catamove(4);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
-		switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x] & 0xf00) >> 8) {
+		switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
 			break;
@@ -980,7 +974,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_x += 1;
+		_vm->_gyro->dna.cat_x++;
 		catamove(1);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;


Commit: bdde166c4991c5d7de552b7c3bfd59823fc600e8
    https://github.com/scummvm/scummvm/commit/bdde166c4991c5d7de552b7c3bfd59823fc600e8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-30T00:37:00-07:00

Commit Message:
AVALANCHE: Repair the Oubliette in the catacombs and wrong parameters connected to Geida's follow-function. Repair the so-called "also" lines.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 4190c75..95011bd 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -91,7 +91,9 @@ void Lucerna::draw_also_lines() {
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
 	for (ff = 0; ff < _vm->_gyro->lineNum; ff++)
-		_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
+		if ((_vm->_gyro->lines[ff].x1 >= 0) && (_vm->_gyro->lines[ff].x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y1 >= 0) && (_vm->_gyro->lines[ff].y1 < _vm->_graphics->kScreenHeight)
+			&& (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight))
+				_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
 		
 	CursorMan.showMouse(true);
 }
@@ -449,7 +451,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__brummieroad: {
 		if (_vm->_gyro->dna.geida_follows)
-			put_geida_at(4, ped);
+			put_geida_at(5, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
 			_vm->_gyro->magics[lightred - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
@@ -494,7 +496,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
 		if (_vm->_gyro->dna.geida_follows)
-			put_geida_at(ped + 2, ped); /* load Geida */
+			put_geida_at(ped + 3, ped); /* load Geida */
 	}
 	break;
 
@@ -619,7 +621,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
 		if (_vm->_gyro->dna.geida_follows) {
-			put_geida_at(4, ped);
+			put_geida_at(5, ped);
 			if (_vm->_gyro->dna.lustie_is_asleep) {
 				_vm->_celer->show_one(5);
 				_vm->_graphics->refreshBackground();
@@ -748,18 +750,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break; /* Ayles awake. */
 
 	case r__geidas:
-		put_geida_at(1, ped);
+		put_geida_at(2, ped);
 		break; /* load Geida */
 
 	case r__easthall:
 	case r__westhall:
 		if (_vm->_gyro->dna.geida_follows)
-			put_geida_at(ped + 1, ped);
+			put_geida_at(ped + 2, ped);
 		break;
 
 	case r__lusties:
 		if (_vm->_gyro->dna.geida_follows)
-			put_geida_at(ped + 5, ped);
+			put_geida_at(ped + 6, ped);
 		break;
 
 	case r__nottspub: {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index e17ef72..f147ad7 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -551,14 +551,15 @@ void Timeout::greetsmonk() {
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro->magics[8].op = _vm->_gyro->nix;
-	_vm->_trip->tr[0].iy += 1; /* increments dx/dy! */
-	_vm->_trip->tr[0].y += _vm->_trip->tr[1].iy;   /* Dowwwn we go... */
+	_vm->_trip->tr[0].iy++; /* increments dx/dy! */
+	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   /* Dowwwn we go... */
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
 void Timeout::meet_avaroid() {
 	if (_vm->_gyro->dna.met_avaroid) {
-		_vm->_scrolls->display("You can't expect to be \6that\22 lucky twice in a row!");
+		_vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
 		_vm->_lucerna->gameover();
 	} else {
 		_vm->_visa->dixi('Q', 60);
@@ -626,7 +627,8 @@ void Timeout::avvy_sit_down() {
 }
 
 void Timeout::ghost_room_phew() {
-	_vm->_scrolls->display("\6PHEW!\22 You're glad to get out of \6there!");
+	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
 }
 
 void Timeout::arkata_shouts() {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index db7dbea..2b3018b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -917,7 +917,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */
 		tr[0].visible = false;
-		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		/*_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);


Commit: 06d0ce1b0f4ed08260bdfc408fe31e9d9ebdefa7
    https://github.com/scummvm/scummvm/commit/06d0ce1b0f4ed08260bdfc408fe31e9d9ebdefa7
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-30T02:23:17-07:00

Commit Message:
AVALANCHE: Minor cosmetic fixes.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4306bb2..6c80ee9 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -233,13 +233,13 @@ void Avalot::run(Common::String arg) {
 
 
 		// ONLY FOR TESTING!!!
-		/*	for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
-		_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
+			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
 
 		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-		if (_vm->_gyro->fields[i].x1 < 640)
-		_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
-		}*/
+			if (_vm->_gyro->fields[i].x1 < 640)
+				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+		}
 		// ONYL FOR TESTING!!!
 
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 95011bd..c54d567 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -91,6 +91,7 @@ void Lucerna::draw_also_lines() {
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
 	for (ff = 0; ff < _vm->_gyro->lineNum; ff++)
+		// We had to check if the lines are within the borders of the screen.
 		if ((_vm->_gyro->lines[ff].x1 >= 0) && (_vm->_gyro->lines[ff].x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y1 >= 0) && (_vm->_gyro->lines[ff].y1 < _vm->_graphics->kScreenHeight)
 			&& (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight))
 				_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index b0cabd4..0a0c031 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -237,7 +237,7 @@ void Visa::talkto(byte whom) {
 			}
 			break;
 		case _vm->_gyro->pspurge:
-			if (~ _vm->_gyro->dna.sitting_in_pub) {
+			if (!_vm->_gyro->dna.sitting_in_pub) {
 				dixi('q', 71); // Try going over and sitting down.
 				return;
 			} else {


Commit: 73048872b2c2e9381fa0d11c207a11125d04ce2a
    https://github.com/scummvm/scummvm/commit/73048872b2c2e9381fa0d11c207a11125d04ce2a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-30T02:56:16-07:00

Commit Message:
AVALANCHE: Upgrade show_one() so it can replace show_one_at(), preventing code duplication.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 586f228..0b982db 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -758,7 +758,7 @@ bool Acci::holding() {
 
 void Acci::openBox(bool before) {
 	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
-		_vm->_celer->show_one(5);
+		_vm->_celer->show_one(-1, -1, 5);
 
 		_vm->_celer->pics_link();
 		_vm->_trip->trippancy_link();
@@ -767,7 +767,7 @@ void Acci::openBox(bool before) {
 		_vm->_system->delayMillis(55);
 
 		if (!before) {
-			_vm->_celer->show_one(6);
+			_vm->_celer->show_one(-1, -1, 6);
 			_vm->_celer->pics_link();
 			_vm->_trip->trippancy_link();
 			_vm->_graphics->refreshScreen();
@@ -1039,7 +1039,7 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 					if (_vm->_gyro->dna.wearing == thing)
 						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
 					else {
-						//_vm->_celer->show_one(5); // Open box.
+						//_vm->_celer->show_one(-1, -1, 5); // Open box.
 						openBox(true);
 
 						_vm->_gyro->dna.box_contents = thing;
@@ -1047,7 +1047,7 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 						_vm->_lucerna->objectlist();
 						_vm->_scrolls->display("OK, it's in the box.");
 
-						//_vm->_celer->show_one(6); // Shut box.
+						//_vm->_celer->show_one(-1, -1, 6); // Shut box.
 						openBox(false);
 					}
 				}
@@ -1169,7 +1169,7 @@ void Acci::stand_up() {
 			_vm->_gyro->dna.user_moves_avvy = true;
 			_vm->_trip->apped(1, 2);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer->show_one(4); /* Picture of empty pillow. */
+			_vm->_celer->show_one(-1, -1, 4); /* Picture of empty pillow. */
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
@@ -1183,7 +1183,7 @@ void Acci::stand_up() {
 
 	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  {
-			_vm->_celer->show_one(4); /* Not sitting down. */
+			_vm->_celer->show_one(-1, -1, 4); /* Not sitting down. */
 			_vm->_trip->tr[0].visible = true; /* But standing up. */
 			_vm->_trip->apped(1, 4); /* And walking away. */
 			_vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */
@@ -1202,12 +1202,12 @@ void Acci::getproc(char thing) {
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
 			if (_vm->_gyro->dna.box_contents == thing) {
-				_vm->_celer->show_one(5);
+				_vm->_celer->show_one(-1, -1, 5);
 				_vm->_scrolls->display("OK, I've got it.");
 				_vm->_gyro->dna.obj[thing - 1] = true;
 				_vm->_lucerna->objectlist();
 				_vm->_gyro->dna.box_contents = nowt;
-				_vm->_celer->show_one(6);
+				_vm->_celer->show_one(-1, -1, 6);
 			} else
 				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
@@ -1223,7 +1223,7 @@ void Acci::getproc(char thing) {
 					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
 					/* OK: we're taking the pen, and it's there. */
-					_vm->_celer->show_one(4); /* No pen there now. */
+					_vm->_celer->show_one(-1, -1, 4); /* No pen there now. */
 					_vm->_trip->call_special(3); /* Zap! */
 					_vm->_gyro->dna.taken_pen = true;
 					_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true;
@@ -1244,7 +1244,7 @@ void Acci::getproc(char thing) {
 		break;
 	case r__robins:
 		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
-			_vm->_celer->show_one(3);
+			_vm->_celer->show_one(-1, -1, 3);
 			_vm->_scrolls->display("Got it!");
 			_vm->_gyro->dna.mushroom_growing = false;
 			_vm->_gyro->dna.taken_mushroom = true;
@@ -1464,8 +1464,8 @@ void Acci::do_that() {
 							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
 							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
 							_vm->_gyro->dna.givenbadgetoiby = true;
-							_vm->_celer->show_one(8);
-							_vm->_celer->show_one(9);
+							_vm->_celer->show_one(-1, -1, 8);
+							_vm->_celer->show_one(-1, -1, 9);
 						} else
 							heythanks();
 						break;
@@ -1770,11 +1770,11 @@ void Acci::do_that() {
 					if (_vm->_gyro->dna.alcohol == 0)
 						_vm->_lucerna->points(3);
 
-					_vm->_celer->show_one(12);
+					_vm->_celer->show_one(-1, -1, 12);
 					_vm->_scrolls->display(booze[thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 					_vm->_gyro->dna.drinking = thing;
 
-					_vm->_celer->show_one(10);
+					_vm->_celer->show_one(-1, -1, 10);
 					_vm->_gyro->dna.malagauche = 177;
 					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
@@ -1795,11 +1795,11 @@ void Acci::do_that() {
 							return;
 						}
 
-						_vm->_celer->show_one(12);
+						_vm->_celer->show_one(-1, -1, 12);
 						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->dna.alcohol == 0)
 							_vm->_lucerna->points(3);
-						_vm->_celer->show_one(10);
+						_vm->_celer->show_one(-1, -1, 10);
 						_vm->_gyro->dna.malagauche = 177;
 
 						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
@@ -1967,7 +1967,7 @@ void Acci::do_that() {
 					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer->show_one(3); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->show_one(-1, -1, 3); /* Picture of Avvy, awake in bed. */
 					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 7f19662..25093a9 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -62,22 +62,22 @@ void Celer::pics_link() {
 	switch (_vm->_gyro->dna.room) {
 	case r__outsideargentpub:
 		if ((_vm->_gyro->roomtime % 12) == 0)
-			show_one(1 + (_vm->_gyro->roomtime / 12) % 4);
+			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 4);
 		break;
 
 	case r__brummieroad:
 		if ((_vm->_gyro->roomtime % 2) == 0)
-			show_one(1 + (_vm->_gyro->roomtime / 2) % 4);
+			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
 
 	case r__bridge:
 		if ((_vm->_gyro->roomtime % 2) == 0)
-			show_one(4 + (_vm->_gyro->roomtime / 2) % 4);
+			show_one(-1, -1, 4 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
 
 	case r__yours:
 		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0))
-			show_one(1 + (_vm->_gyro->roomtime / 12) % 2);
+			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2);
 		break;
 
 	case r__argentpub:
@@ -88,16 +88,16 @@ void Celer::pics_link() {
 			case 1:
 			case 11:
 			case 21:
-				show_one(12);
+				show_one(-1, -1, 12);
 				break; /* Looks forwards. */
 			case 8:
 			case 18:
 			case 28:
 			case 32:
-				show_one(11);
+				show_one(-1, -1, 11);
 				break; /* Looks at you. */
 			case 30:
-				show_one(13);
+				show_one(-1, -1, 13);
 				break; /* Winks. */
 			case 33:
 				_vm->_gyro->dna.malagauche = 0;
@@ -108,14 +108,14 @@ void Celer::pics_link() {
 		switch (_vm->_gyro->roomtime % 200) {
 		case 179:
 		case 197:
-			show_one(5);
+			show_one(-1, -1, 5);
 			break; /* Dogfood's drinking cycle */
 		case 182:
 		case 194:
-			show_one(6);
+			show_one(-1, -1, 6);
 			break;
 		case 185:
-			show_one(7);
+			show_one(-1, -1, 7);
 			break;
 		case 199:
 			_vm->_gyro->dna.dogfoodpos = 177;
@@ -131,7 +131,7 @@ void Celer::pics_link() {
 				xx = 4;
 
 			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(xx);
+				show_one(-1, -1, xx);
 				_vm->_gyro->dna.dogfoodpos = xx;
 			}
 		}
@@ -141,16 +141,16 @@ void Celer::pics_link() {
 		if ((_vm->_gyro->roomtime % 3) == 0) {
 			switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) {
 			case 4:
-				show_one(1);
+				show_one(-1, -1, 1);
 				break;
 			case 1:
 			case 3:
 			case 5:
-				show_one(2);
+				show_one(-1, -1, 2);
 				break;
 			case 0:
 			case 2:
-				show_one(3);
+				show_one(-1, -1, 3);
 				break;
 			}
 		}
@@ -170,7 +170,7 @@ void Celer::pics_link() {
 				xx = 3; /* Right. */
 
 			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(xx);
+				show_one(-1, -1, xx);
 				_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 			}
 		}
@@ -180,10 +180,10 @@ void Celer::pics_link() {
 		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % 14 == 0)) {
 			switch ((_vm->_gyro->roomtime / 14) % 2) {
 			case 0:
-				show_one(1);
+				show_one(-1, -1, 1);
 				break; /* Frame 2: EGA. */
 			case 1:
-				show_one(3);
+				show_one(-1, -1, 3);
 				break; /* Frame 1: Natural. */
 			}
 		}
@@ -193,10 +193,10 @@ void Celer::pics_link() {
 		if (_vm->_gyro->dna.tied_up) {
 			switch (_vm->_gyro->roomtime % 54) {
 			case 20:
-				show_one(4);
+				show_one(-1, -1, 4);
 				break; /* Frame 4: Avalot blinks. */
 			case 23:
-				show_one(2);
+				show_one(-1, -1, 2);
 				break; /* Frame 1: Back to normal. */
 			}
 		}
@@ -215,23 +215,23 @@ void Celer::pics_link() {
 			xx--; /* Blinks */
 
 		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-			show_one(xx);
+			show_one(-1, -1, xx);
 			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 		}
 
 		switch (_vm->_gyro->roomtime % 50) {
 		case 45 :
-			show_one(9);
+			show_one(-1, -1, 9);
 			break; /* Spurge blinks */
 		case 49 :
-			show_one(10);
+			show_one(-1, -1, 10);
 			break;
 		}
 		break;
 
 	case r__ducks:
 		if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
-			show_one(1 + (_vm->_gyro->roomtime / 3) % 3);
+			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
 
 		{/* _vm->_lucerna->bearing of Avvy from Duck. */
 		if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
@@ -245,7 +245,7 @@ void Celer::pics_link() {
 			xx += 1; /* Duck blinks */
 
 		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-			show_one(xx);
+			show_one(-1, -1, xx);
 			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
 		}
 		break;
@@ -348,18 +348,22 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 	}
 
 	// These pictures are practically parts of the background. -10 is for the drop-down menu.
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, picture, x * 8, y - 10);
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, picture, x, y - 10);
 }
 
-void Celer::show_one(byte which) {
+void Celer::show_one(int16 destX, int16 destY, byte which) {
 	chunkblocktype ch;
 	which--; // For the difference between the Pascal and C array indexes.
 	//setactivepage(3);
 	warning("STUB: Celer::show_one()");
 
-	if (memos[which].x > on_disk)
-		display_it(memos[which].x, memos[which].y, memos[which].xl, memos[which].yl, memos[which].flavour, memory[which]);
-	else {
+	if (memos[which].x > on_disk) {
+		if (destX == -1) {
+			destX = memos[which].x * 8;
+			destY = memos[which].y;
+		}
+		display_it(destX, destY, memos[which].xl, memos[which].yl, memos[which].flavour, memory[which]);
+	} else {
 		if (!f.open(filename)) { /* Filename was set in load_chunks() */
 			warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
 			return;
@@ -378,7 +382,11 @@ void Celer::show_one(byte which) {
 
 		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, ch.xl * 8, ch.yl + 1);
 
-		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, picture);
+		if (destX == -1) {
+			destX = ch.x * 8;
+			destY = ch.y;
+		}
+		display_it(destX, destY, ch.xl, ch.yl, ch.flavour, picture);
 
 		picture.free();
 		f.close();
@@ -393,14 +401,4 @@ void Celer::show_one(byte which) {
 
 
 
-void Celer::display_it_at(int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture, int16 &xxx, int16 &yyy) {
-	warning("STUB: Celer::display_it_at()");
-}
-
-void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
-	warning("STUB: Celer::show_one_at()");
-}
-
-
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 46ba53f..3c7eda3 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -78,9 +78,10 @@ public:
 
 	void forget_chunks();
 
-	void show_one(byte which);
-
-	void show_one_at(byte which, int16 xxx, int16 yyy);
+	// Settint the destination to -1,-1 means the picture should be drawn to it's original position.
+	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
+	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
+	void show_one(int16 destX, int16 destY, byte which);
 
 private:
 	AvalancheEngine *_vm;
@@ -92,8 +93,6 @@ private:
 	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
 
 	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture);
-
-	void display_it_at(int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture, int16 &xxx, int16 &yyy);
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c54d567..036ae4e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -391,7 +391,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	switch (x) {
 	case r__yours:
 		if (_vm->_gyro->dna.avvy_in_bed) {
-			_vm->_celer->show_one(3);
+			_vm->_celer->show_one(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
 		}
@@ -492,7 +492,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__bridge: {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
-			_vm->_celer->show_one(3); /* Position of drawbridge */
+			_vm->_celer->show_one(-1, -1, 3); /* Position of drawbridge */
 			_vm->_graphics->refreshBackground();
 			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
@@ -518,10 +518,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 
 		if (!_vm->_gyro->dna.mushroom_growing) 
-			_vm->_celer->show_one(3);
+			_vm->_celer->show_one(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
 	}
 	break;
@@ -603,11 +603,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__argentpub: {
 		if (_vm->_gyro->dna.wonnim)
-			_vm->_celer->show_one(1);   /* No lute by the settle. */
+			_vm->_celer->show_one(-1, -1, 1);   /* No lute by the settle. */
 		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
 		if (_vm->_gyro->dna.givenbadgetoiby) {
-			_vm->_celer->show_one(8);
-			_vm->_celer->show_one(9);
+			_vm->_celer->show_one(-1, -1, 8);
+			_vm->_celer->show_one(-1, -1, 9);
 		}
 		_vm->_graphics->refreshBackground();
 	}
@@ -624,7 +624,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(5, ped);
 			if (_vm->_gyro->dna.lustie_is_asleep) {
-				_vm->_celer->show_one(5);
+				_vm->_celer->show_one(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
 			}
 		}
@@ -634,14 +634,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__musicroom: {
 		if (_vm->_gyro->dna.jacques_awake > 0) {
 			_vm->_gyro->dna.jacques_awake = 5;
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_celer->show_one(4);
+			_vm->_celer->show_one(-1, -1, 4);
 			_vm->_gyro->magics[brown - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {
-			_vm->_celer->show_one(6);
+			_vm->_celer->show_one(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(6);
 			_vm->_sequence->then_show(5);
@@ -653,7 +653,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsidenottspub:
 		if (ped == 2) {
-			_vm->_celer->show_one(3);
+			_vm->_celer->show_one(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(3);
 			_vm->_sequence->then_show(2);
@@ -665,7 +665,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsideargentpub:
 		if (ped == 2)  {
-			_vm->_celer->show_one(6);
+			_vm->_celer->show_one(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(6);
 			_vm->_sequence->then_show(5);
@@ -692,7 +692,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__insidecardiffcastle:
 		if (ped > 0) {
 			_vm->_trip->tr[1].init(10, false, _vm->_trip); /* Define the dart. */
-			_vm->_celer->show_one(1);
+			_vm->_celer->show_one(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
@@ -701,22 +701,22 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_sequence->then_show(2);
 
 			if (_vm->_gyro->dna.taken_pen)
-				_vm->_celer->show_one(4);
+				_vm->_celer->show_one(-1, -1, 4);
 
 			_vm->_sequence->start_to_close();
 		} else {
-			_vm->_celer->show_one(1);
+			_vm->_celer->show_one(-1, -1, 1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
-				_vm->_celer->show_one(3);
+				_vm->_celer->show_one(-1, -1, 3);
 			else
-				_vm->_celer->show_one(2);
+				_vm->_celer->show_one(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case r__avvysgarden:
 		if (ped == 1)  {
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(2);
 			_vm->_sequence->then_show(1);
@@ -730,12 +730,12 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__yourhall:
 		if (ped == 2)  {
 			/* It was the original:
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_sequence->first_show(1);
 			_vm->_sequence->then_show(3);
 			_vm->_sequence->start_to_close();*/
 
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(2);
 			_vm->_sequence->then_show(1);
@@ -746,7 +746,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__aylesoffice:
 		if (_vm->_gyro->dna.ayles_is_awake)
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break; /* Ayles awake. */
 
@@ -766,7 +766,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__nottspub: {
-		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->show_one(3);
+		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 	}
 	break;
@@ -774,7 +774,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsideducks:
 		if (ped == 2) {
 			/* Shut the door */
-			_vm->_celer->show_one(3);
+			_vm->_celer->show_one(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(3);
 			_vm->_sequence->first_show(2);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index f41ac12..d9f52a3 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -102,7 +102,7 @@ void Sequence::call_sequencer() {
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
 		/* Show a frame. */
-		_vm->_celer->show_one(seq[0]);
+		_vm->_celer->show_one(-1, -1, seq[0]);
 		shove_left();
 	}
 	
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index f147ad7..d68b943 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -242,7 +242,7 @@ end;*/
 
 void Timeout::open_drawbridge() {
 	_vm->_gyro->dna.drawbridge_open++;
-	_vm->_celer->show_one(_vm->_gyro->dna.drawbridge_open - 1);
+	_vm->_celer->show_one(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
@@ -285,7 +285,7 @@ void Timeout::bang2() {
 void Timeout::stairs() {
 	_vm->_gyro->blip();
 	_vm->_trip->tr[0].walkto(4);
-	_vm->_celer->show_one(2);
+	_vm->_celer->show_one(-1, -1, 2);
 	_vm->_gyro->dna.brummie_stairs = 2;
 	_vm->_gyro->magics[10].op = _vm->_gyro->special;
 	_vm->_gyro->magics[10].data = 2; /* Reached the bottom of the stairs. */
@@ -399,17 +399,17 @@ void Timeout::jacques_wakes_up() {
 
 	switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
 	case 1 :
-		_vm->_celer->show_one(1); /* Eyes open. */
+		_vm->_celer->show_one(-1, -1, 1); /* Eyes open. */
 		_vm->_visa->dixi('Q', 45);
 		break;
 	case 2 : /* Going through the door. */
-		_vm->_celer->show_one(2); /* Not on the floor. */
-		_vm->_celer->show_one(3); /* But going through the door. */
+		_vm->_celer->show_one(-1, -1, 2); /* Not on the floor. */
+		_vm->_celer->show_one(-1, -1, 3); /* But going through the door. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* You can't wake him up now. */
 		break;
 	case 3 :  /* Gone through the door. */
-		_vm->_celer->show_one(2); /* Not on the floor, either. */
-		_vm->_celer->show_one(4); /* He's gone... so the door's open. */
+		_vm->_celer->show_one(-1, -1, 2); /* Not on the floor, either. */
+		_vm->_celer->show_one(-1, -1, 4); /* He's gone... so the door's open. */
 		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; /* Gone! */
 		break;
 	}
@@ -441,7 +441,7 @@ void Timeout::naughty_duke() {
 	_vm->_trip->tr[1].walkto(3); /* He walks over to you. */
 
 	/* Let's get the door opening. */
-	_vm->_celer->show_one(1);
+	_vm->_celer->show_one(-1, -1, 1);
 	_vm->_sequence->first_show(2);
 	_vm->_sequence->start_to_close();
 
@@ -456,7 +456,7 @@ void Timeout::naughty_duke2() {
 }
 
 void Timeout::naughty_duke3() {
-	_vm->_celer->show_one(1);
+	_vm->_celer->show_one(-1, -1, 1);
 	_vm->_sequence->first_show(2);
 	_vm->_sequence->start_to_close();
 }
@@ -498,7 +498,7 @@ void Timeout::jump() {
 		if (_vm->_gyro->dna.carrying >= maxobjs)
 			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
 			_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true;
 			_vm->_lucerna->objectlist();
@@ -514,7 +514,7 @@ void Timeout::crapulus_says_splud_out() {
 }
 
 void Timeout::buydrinks() {
-	_vm->_celer->show_one(11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(-1, -1, 11); /* Malagauche gets up again. */
 	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls->display message about it. */
@@ -526,7 +526,7 @@ void Timeout::buydrinks() {
 }
 
 void Timeout::buywine() {
-	_vm->_celer->show_one(11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(-1, -1, 11); /* Malagauche gets up again. */
 	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa->dixi('D', 50); /* You buy the wine. */
@@ -619,7 +619,7 @@ void Timeout::avvy_sit_down() {
 	if (_vm->_trip->tr[0].homing)    /* Still walking */
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
-		_vm->_celer->show_one(3);
+		_vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->dna.sitting_in_pub = true;
 		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_trip->tr[0].visible = false;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 2b3018b..f83bfc07 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -578,59 +578,59 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(28);
+		_vm->_celer->show_one(-1, -1, 28);
 		break;
 	case 0x1: /* no connection (wall + shield), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(29); /* ...shield. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 29); /* ...shield. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(30); /* ...door. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 30); /* ...door. */
 		break;
 	case 0x3: /* wall with door and shield */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(30); /* ...door, and... */
-		_vm->_celer->show_one(29); /* ...shield. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->show_one(-1, -1, 29); /* ...shield. */
 		break;
 	case 0x4: /* no connection (wall + window), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(5);  /* ...window. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 5);  /* ...window. */
 		break;
 	case 0x5: /* wall with door and window */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(30); /* ...door, and... */
-		_vm->_celer->show_one(5); /* ...window. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->show_one(-1, -1, 5); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(7); /* ...torches. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 7); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(28); /* Wall, plus... */
-		_vm->_celer->show_one(30); /* ...door, and... */
-		_vm->_celer->show_one(7); /* ...torches. */
+		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->show_one(-1, -1, 7); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -645,44 +645,44 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(19);
+		_vm->_celer->show_one(-1, -1, 19);
 		break;
 	case 0x1: /* no connection (wall + window), */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(19); /* Wall, plus... */
-		_vm->_celer->show_one(20); /* ...window. */
+		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 20); /* ...window. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(19); /* Wall, plus... */
-		_vm->_celer->show_one(21); /* ...door. */
+		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 21); /* ...door. */
 		break;
 	case 0x3: /* wall with door and window */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(19); /* Wall, plus... */
-		_vm->_celer->show_one(20); /* ...door, and... */
-		_vm->_celer->show_one(21); /* ...window. */
+		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 20); /* ...door, and... */
+		_vm->_celer->show_one(-1, -1, 21); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->show_one(19); /* Wall, plus... */
-		_vm->_celer->show_one(18); /* ...torches. */
+		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 18); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(19); /* Wall, plus... */
-		_vm->_celer->show_one(21); /* ...door, and... */
-		_vm->_celer->show_one(18); /* ...torches. */
+		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->show_one(-1, -1, 21); /* ...door, and... */
+		_vm->_celer->show_one(-1, -1, 18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -700,7 +700,7 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x1:
-		_vm->_celer->show_one(22);
+		_vm->_celer->show_one(-1, -1, 22);
 			
 		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
 			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
@@ -711,13 +711,13 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
-		_vm->_celer->show_one(23);
+		_vm->_celer->show_one(-1, -1, 23);
 		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Middle exit south. */
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
-		_vm->_celer->show_one(24);
+		_vm->_celer->show_one(-1, -1, 24);
 		_vm->_gyro->magics[11].op = _vm->_gyro->special; /* Left exit south. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
@@ -732,36 +732,36 @@ void Trip::catamove(byte ped) {
 	// LEFT handles: 
 /*
 	case 0x1:
-		_vm->_celer->show_one(4);
+		_vm->_celer->show_one(-1, -1, 4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x2:
-		_vm->_celer->show_one(4);
+		_vm->_celer->show_one(-1, -1, 4);
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
 /*	case 0x3:
-		_vm->_celer->show_one(4);
+		_vm->_celer->show_one(-1, -1, 4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 	// RIGHT handles:
 	case 0x4:
-		_vm->_celer->show_one(3);
+		_vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
 */
 	case 0x5:
-		_vm->_celer->show_one(3);
+		_vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; /* Middle exit north. */
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
 /*
 	case 0x6:
-		_vm->_celer->show_one(3);
+		_vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
@@ -770,12 +770,12 @@ void Trip::catamove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9: {
-		_vm->_celer->show_one(6);
+		_vm->_celer->show_one(-1, -1, 6);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer->show_one(31);
+			_vm->_celer->show_one(-1, -1, 31);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer->show_one(32);
+			_vm->_celer->show_one(-1, -1, 32);
 
 		_vm->_gyro->magics[0].op = _vm->_gyro->special; /* Middle arch north. */
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
@@ -785,50 +785,50 @@ void Trip::catamove(byte ped) {
 	case 0xd: /* No connection + WINDOW */
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(14);
+		_vm->_celer->show_one(-1, -1, 14);
 		break;
 	case 0xe: /* No connection + TORCH */
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(8);
+		_vm->_celer->show_one(-1, -1, 8);
 		break;
 	/* Recessed door: */
 	case 0xf:
 		_vm->_gyro->magics[0].op = _vm->_gyro->nix; /* Door to Geida's room. */
-		_vm->_celer->show_one(1);
+		_vm->_celer->show_one(-1, -1, 1);
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_celer->show_one(17);
+		_vm->_celer->show_one(-1, -1, 17);
 		break;     /* [2,2] : "Art Gallery" sign over door. */
 	case 264:
-		_vm->_celer->show_one(9);
+		_vm->_celer->show_one(-1, -1, 9);
 		break;      /* [8,1] : "The Wrong Way!" sign. */
 	case 1797:
-		_vm->_celer->show_one(2);
+		_vm->_celer->show_one(-1, -1, 2);
 		break;      /* [5,7] : "Ite Mingite" sign. */
 	case 258:
 		for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
-			_vm->_celer->show_one_at(15, 130 + fv * 120, 70);
-			_vm->_celer->show_one_at(16, 184 + fv * 120, 78);
+			_vm->_celer->show_one(130 + fv * 120, 70, 15);
+			_vm->_celer->show_one(184 + fv * 120, 78, 16);
 		}
 		break;
 	case 1287:
 		for (fv = 10; fv <= 13; fv++)
-			_vm->_celer->show_one(fv);
+			_vm->_celer->show_one(-1, -1, fv);
 		break; /* [7,5] : 4 candles. */
 	case 776:
-		_vm->_celer->show_one(10);
+		_vm->_celer->show_one(-1, -1, 10);
 		break;     /* [8,3] : 1 candle. */
 	case 2049:
-		_vm->_celer->show_one(11);
+		_vm->_celer->show_one(-1, -1, 11);
 		break;     /* [1,8] : another candle. */
 	case 257:
-		_vm->_celer->show_one(12);
-		_vm->_celer->show_one(13);
+		_vm->_celer->show_one(-1, -1, 12);
+		_vm->_celer->show_one(-1, -1, 13);
 		break; /* [1,1] : the other two. */
 	}
 
@@ -851,7 +851,7 @@ void Trip::dawndelay() {
 void Trip::call_special(uint16 which) {
 	switch (which) {
 	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
-		_vm->_celer->show_one(1);
+		_vm->_celer->show_one(-1, -1, 1);
 		_vm->_gyro->dna.brummie_stairs = 1;
 		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
@@ -897,7 +897,7 @@ void Trip::call_special(uint16 which) {
 			_vm->_visa->dixi('q', 35);
 			tr[0].done();
 			/*tr[1].vanishifstill:=true;*/
-			_vm->_celer->show_one(2);
+			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_visa->dixi('q', 36);
 			_vm->_gyro->dna.tied_up = true;
 			_vm->_gyro->dna.friar_will_tie_you_up = false;
@@ -1246,7 +1246,7 @@ void Trip::arrow_procs(byte tripnum) {
 		}
 	} else { /* Arrow has hit the wall! */
 		tr[tripnum].done(); /* Deallocate the arrow. */
-		_vm->_celer->show_one(3); /* Show pic of arrow stuck into the door. */
+		_vm->_celer->show_one(-1, -1, 3); /* Show pic of arrow stuck into the door. */
 		_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
 	}
 		
@@ -1493,7 +1493,7 @@ void Trip::hide_in_the_cupboard() {
 		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
 			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
 		_vm->_gyro->dna.avvys_in_the_cupboard = true;
-		_vm->_celer->show_one(8);
+		_vm->_celer->show_one(-1, -1, 8);
 	}
 }
 


Commit: 0abeaababb04956fb014775e716c0344ca7f7b14
    https://github.com/scummvm/scummvm/commit/0abeaababb04956fb014775e716c0344ca7f7b14
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-30T14:54:42-07:00

Commit Message:
AVALANCHE: Replace the mini-game "Nim" until implementation.

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 0b982db..9819d7e 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1624,10 +1624,43 @@ void Acci::do_that() {
 	case vb_play:
 		if (thing == pardon) {
 			switch (_vm->_gyro->dna.room) { /* They just typed "play"... */
-			case r__argentpub:
-				// play_nim();
-				warning("STUB: Acci::do_that() - case vb_play");
-				break; /* ...in the pub, => play Nim. */
+			case r__argentpub: { /* ...in the pub, => play Nim. */
+					warning("STUB: Acci::do_that() - case vb_play");
+					// play_nim();
+					// The following parts are copied from play_nim().
+					// The player automatically wins the game everytime he wins, until I implement the mini-game.
+
+					if (_vm->_gyro->dna.wonnim) {
+						/* Already won the game. */
+						_vm->_visa->dixi('Q', 6);
+						return;
+					}
+
+					if (!_vm->_gyro->dna.asked_dogfood_about_nim) {
+						_vm->_visa->dixi('q', 84);
+						return;
+					}
+
+					_vm->_visa->dixi('Q', 3);
+					_vm->_gyro->dna.playednim++;
+
+					/* You won - strange! */
+					_vm->_logger->log_aside("You won.");
+					_vm->_visa->dixi('Q', 7); /* You won! Give us a lute! */
+					_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true;
+					_vm->_lucerna->objectlist();
+					_vm->_gyro->dna.wonnim = true;
+					_vm->_celer->show_one(-1, -1, 1); /* Show the settle with no lute on it. */
+					_vm->_lucerna->points(7); /* 7 points for winning! */
+
+					if (_vm->_gyro->dna.playednim == 1)
+						_vm->_lucerna->points(3); /* 3 points for playing your 1st game. */
+
+					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
+					_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+						+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+				}
+				break; 
 			case r__musicroom:
 				play_harp();
 				break;


Commit: c421426d8abe447ca2c4b75bc978bd0ae25e858a
    https://github.com/scummvm/scummvm/commit/c421426d8abe447ca2c4b75bc978bd0ae25e858a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-30T15:30:06-07:00

Commit Message:
AVALANCHE: Make the game finally completable.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 9819d7e..fb024ae 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1261,7 +1261,7 @@ void Acci::getproc(char thing) {
 
 void Acci::give_geida_the_lute() {
 	if (_vm->_gyro->dna.room != r__lustiesroom) {
-		_vm->_scrolls->display("Not yet. Try later!\232\2");
+		_vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	}
 	_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2c7041d..3c2fc49 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -724,7 +724,7 @@ Common::Error AvalancheEngine::run() {
 			break;
 		}
 
-	} while (true);
+	} while (false);
 
 
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index d68b943..d6dff88 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -642,11 +642,14 @@ void Timeout::arkata_shouts() {
 
 void Timeout::winning() {
 	_vm->_visa->dixi('q', 79);
+
 	_vm->_pingo->winning_pic();
+	warning("STUB: Timeout::winning()");
+	/*do {
+	_vm->_lucerna->checkclick();
+	} while (!(_vm->_gyro->mrelease == 0));*/
+	// To be implemented with Pingo::winning_pic().
 
-	do {
-		_vm->_lucerna->checkclick();
-	} while (!(_vm->_gyro->mrelease == 0));
 	_vm->_lucerna->callverb(_vm->_acci->vb_score);
 	_vm->_scrolls->display(" T H E    E N D ");
 	_vm->_gyro->lmo = true;


Commit: a9e9a8b9af29a0270f8feef19cac4da37743860d
    https://github.com/scummvm/scummvm/commit/a9e9a8b9af29a0270f8feef19cac4da37743860d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-08-31T12:15:33-07:00

Commit Message:
AVALANCHE: Cosmetic and other repairs in Timeout.

Changed paths:
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index d6dff88..334b49f 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -27,9 +27,6 @@
 
 /* TIMEOUT	The scheduling unit. */
 
-// DON'T FORGET ABOUT THE ARRAY INDEXES, THEY MAY'LL CAUSE TROUBLES!!!
-
-
 #include "avalanche/avalanche.h"
 
 #include "avalanche/timeout2.h"
@@ -212,8 +209,8 @@ void Timeout::one_tick() {
 			}
 		}
 	}
-	_vm->_gyro->roomtime++; /* Cycles since you've been in this room. */
-	_vm->_gyro->dna.total_time++; /* Total amount of time for this game. */
+	_vm->_gyro->roomtime++; // Cycles since you've been in this room.
+	_vm->_gyro->dna.total_time++; // Total amount of time for this game.
 }
 
 void Timeout::lose_timer(byte which) {
@@ -225,33 +222,16 @@ void Timeout::lose_timer(byte which) {
 	timerLost = true;
 }
 
-/*function timer_is_on(which:byte):boolean;
-var fv:byte;
-begin
-	for fv:=1 to 7 do
-	with times[fv] do
-	if (what_for=which) and (time_left>0) then
-	begin
-	timer_is_on:=true;
-	exit;
-	end;
-	timer_is_on:=false;
-end;*/
-
-/* Timeout procedures: */
-
 void Timeout::open_drawbridge() {
 	_vm->_gyro->dna.drawbridge_open++;
 	_vm->_celer->show_one(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix; // You may enter the drawbridge.
 	else
 		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
 
-/* --- */
-
 void Timeout::avaricius_talks() {
 	_vm->_visa->dixi('q', _vm->_gyro->dna.avaricius_talk);
 	_vm->_gyro->dna.avaricius_talk++;
@@ -274,7 +254,7 @@ void Timeout::toilet2() {
 }
 
 void Timeout::bang() {
-	_vm->_scrolls->display("\6< BANG! >");
+	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
 	set_up_timer(30, procbang2, reason_explosion);
 }
 
@@ -288,8 +268,8 @@ void Timeout::stairs() {
 	_vm->_celer->show_one(-1, -1, 2);
 	_vm->_gyro->dna.brummie_stairs = 2;
 	_vm->_gyro->magics[10].op = _vm->_gyro->special;
-	_vm->_gyro->magics[10].data = 2; /* Reached the bottom of the stairs. */
-	_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */
+	_vm->_gyro->magics[10].data = 2; // Reached the bottom of the stairs.
+	_vm->_gyro->magics[3].op = _vm->_gyro->nix; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timeout::cardiff_survey() {
@@ -307,7 +287,7 @@ void Timeout::cardiff_survey() {
 
 void Timeout::cardiff_return() {
 	_vm->_visa->dixi('q', 28);
-	cardiff_survey(); /* add end of question. */
+	cardiff_survey(); // Add end of question.
 }
 
 void Timeout::cwytalot_in_herts() {
@@ -315,7 +295,7 @@ void Timeout::cwytalot_in_herts() {
 }
 
 void Timeout::get_tied_up() {
-	_vm->_visa->dixi('q', 34); /* ...Trouble! */
+	_vm->_visa->dixi('q', 34); // ...Trouble!
 	_vm->_gyro->dna.user_moves_avvy = false;
 	_vm->_gyro->dna.been_tied_up = true;
 	_vm->_trip->stopwalking();
@@ -329,13 +309,13 @@ void Timeout::get_tied_up() {
 void Timeout::get_tied_up2() {
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_trip->tr[1].walkto(5);
-	_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
+	_vm->_gyro->magics[3].op = _vm->_gyro->nix; // No effect when you touch the boundaries.
 	_vm->_gyro->dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
 	_vm->_trip->tr[1].check_me = false;
-	_vm->_trip->tr[0].init(7, true, _vm->_trip); /* Robin Hood */
+	_vm->_trip->tr[0].init(7, true, _vm->_trip); // Robin Hood
 	_vm->_gyro->whereis[_vm->_gyro->probinhood - 150] = r__robins;
 	_vm->_trip->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
@@ -350,14 +330,14 @@ void Timeout::hang_around2() {
 	_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
 	_vm->_trip->tr[0].done();
-	_vm->_trip->tr[1].done(); /* Get rid of Robin Hood and Friar Tuck. */
+	_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
-	/* Immediately call the following proc (when you have a chance). */
+	// Immediately call the following proc (when you have a chance).
 
 	_vm->_gyro->dna.tied_up = false;
 
-	_vm->_enid->back_to_bootstrap(1); /* Call the shoot-'em-up. */
+	_vm->_enid->back_to_bootstrap(1); // Call the shoot-'em-up.
 }
 
 void Timeout::after_the_shootemup() {
@@ -395,26 +375,25 @@ void Timeout::after_the_shootemup() {
 }
 
 void Timeout::jacques_wakes_up() {
-	_vm->_gyro->dna.jacques_awake += 1;
+	_vm->_gyro->dna.jacques_awake++;
 
-	switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
+	switch (_vm->_gyro->dna.jacques_awake) { // Additional pictures.
 	case 1 :
-		_vm->_celer->show_one(-1, -1, 1); /* Eyes open. */
+		_vm->_celer->show_one(-1, -1, 1); // Eyes open.
 		_vm->_visa->dixi('Q', 45);
 		break;
-	case 2 : /* Going through the door. */
-		_vm->_celer->show_one(-1, -1, 2); /* Not on the floor. */
-		_vm->_celer->show_one(-1, -1, 3); /* But going through the door. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* You can't wake him up now. */
+	case 2 : // Going through the door.
+		_vm->_celer->show_one(-1, -1, 2); // Not on the floor.
+		_vm->_celer->show_one(-1, -1, 3); // But going through the door.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // You can't wake him up now.
 		break;
-	case 3 :  /* Gone through the door. */
-		_vm->_celer->show_one(-1, -1, 2); /* Not on the floor, either. */
-		_vm->_celer->show_one(-1, -1, 4); /* He's gone... so the door's open. */
-		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; /* Gone! */
+	case 3 :  // Gone through the door.
+		_vm->_celer->show_one(-1, -1, 2); // Not on the floor, either.
+		_vm->_celer->show_one(-1, -1, 4); // He's gone... so the door's open.
+		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; // Gone!
 		break;
 	}
 
-
 	if (_vm->_gyro->dna.jacques_awake == 5) {
 		_vm->_gyro->dna.ringing_bells = true;
 		_vm->_gyro->dna.ayles_is_awake = true;
@@ -431,16 +410,14 @@ void Timeout::jacques_wakes_up() {
 		set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
 		break;
 	}
-
 }
 
-void Timeout::naughty_duke() {
-/* This is when the Duke comes in and takes your money. */
-	_vm->_trip->tr[1].init(9, false, _vm->_trip); /* Here comes the Duke. */
-	_vm->_trip->apped(2, 1); /* He starts at the door... */
-	_vm->_trip->tr[1].walkto(3); /* He walks over to you. */
+void Timeout::naughty_duke() { // This is when the Duke comes in and takes your money.
+	_vm->_trip->tr[1].init(9, false, _vm->_trip); // Here comes the Duke.
+	_vm->_trip->apped(2, 1); // He starts at the door...
+	_vm->_trip->tr[1].walkto(3); // He walks over to you.
 
-	/* Let's get the door opening. */
+	// Let's get the door opening.
 	_vm->_celer->show_one(-1, -1, 1);
 	_vm->_sequence->first_show(2);
 	_vm->_sequence->start_to_close();
@@ -449,9 +426,9 @@ void Timeout::naughty_duke() {
 }
 
 void Timeout::naughty_duke2() {
-	_vm->_visa->dixi('q', 48); /* Ha ha, it worked again! */
-	_vm->_trip->tr[1].walkto(1); /* Walk to the door. */
-	_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
+	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
+	_vm->_trip->tr[1].walkto(1); // Walk to the door.
+	_vm->_trip->tr[1].vanishifstill = true; // Then go away!
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
@@ -483,23 +460,23 @@ void Timeout::jump() {
 		break;
 	}
 
-	if (_vm->_gyro->dna.jumpstatus == 20) { /* End of jump. */
+	if (_vm->_gyro->dna.jumpstatus == 20) { // End of jump.
 		_vm->_gyro->dna.user_moves_avvy = true;
 		_vm->_gyro->dna.jumpstatus = 0;
-	} else { /* Still jumping. */
+	} else { // Still jumping.
 		set_up_timer(1, procjump, reason_jumping);
 	}
 
-	if ((_vm->_gyro->dna.jumpstatus == 10) /* You're at the highest point of your jump. */
+	if ((_vm->_gyro->dna.jumpstatus == 10) // You're at the highest point of your jump.
 			&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
 			&& (_vm->_gyro->dna.arrow_in_the_door == true)
-			&& (_vm->_trip->infield(3))) { /* beside the wall*/
-		/* Grab the arrow! */
+			&& (_vm->_trip->infield(3))) { // Beside the wall
+		// Grab the arrow!
 		if (_vm->_gyro->dna.carrying >= maxobjs)
 			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_celer->show_one(-1, -1, 2);
-			_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
+			_vm->_gyro->dna.arrow_in_the_door = false; // You've got it.
 			_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true;
 			_vm->_lucerna->objectlist();
 			_vm->_visa->dixi('q', 50);
@@ -514,33 +491,33 @@ void Timeout::crapulus_says_splud_out() {
 }
 
 void Timeout::buydrinks() {
-	_vm->_celer->show_one(-1, -1, 11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->dna.malagauche = 0;
 
-	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls->display message about it. */
-	_vm->_pingo->wobble(); /* Do the special effects. */
-	_vm->_visa->dixi('D', 1); /* That'll be thruppence. */
-	if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
-		_vm->_visa->dixi('D', 3); /* Tell 'em you paid up. */
+	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); // Display message about it.
+	_vm->_pingo->wobble(); // Do the special effects.
+	_vm->_visa->dixi('D', 1); // That'll be thruppence.
+	if (_vm->_gyro->pennycheck(3)) // Pay 3d.
+		_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
 	_vm->_acci->have_a_drink();
 }
 
 void Timeout::buywine() {
-	_vm->_celer->show_one(-1, -1, 11); /* Malagauche gets up again. */
+	_vm->_celer->show_one(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->dna.malagauche = 0;
 
-	_vm->_visa->dixi('D', 50); /* You buy the wine. */
-	_vm->_visa->dixi('D', 1); /* It'll be thruppence. */
+	_vm->_visa->dixi('D', 50); // You buy the wine.
+	_vm->_visa->dixi('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->pennycheck(3)) {
-		_vm->_visa->dixi('D', 4); /* You paid up. */
+		_vm->_visa->dixi('D', 4); // You paid up.
 		_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = true;
 		_vm->_lucerna->objectlist();
-		_vm->_gyro->dna.winestate = 1; /* OK Wine */
+		_vm->_gyro->dna.winestate = 1; // OK Wine.
 	}
 }
 
 void Timeout::callsguards() {
-	_vm->_visa->dixi('Q', 58); /* GUARDS!!! */
+	_vm->_visa->dixi('Q', 58); // "GUARDS!!!"
 	_vm->_lucerna->gameover();
 }
 
@@ -551,8 +528,8 @@ void Timeout::greetsmonk() {
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro->magics[8].op = _vm->_gyro->nix;
-	_vm->_trip->tr[0].iy++; /* increments dx/dy! */
-	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   /* Dowwwn we go... */
+	_vm->_trip->tr[0].iy++; // Increments dx/dy!
+	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   // Dowwwn we go...
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
@@ -577,8 +554,8 @@ void Timeout::meet_avaroid() {
 
 void Timeout::rise_up_oubliette() {
 	_vm->_trip->tr[0].visible = true;
-	_vm->_trip->tr[0].iy++; /* decrements dx/dy! */
-	_vm->_trip->tr[0].y -= _vm->_trip->tr[0].iy; /* Uuuupppp we go... */
+	_vm->_trip->tr[0].iy++; // Decrements dx/dy!
+	_vm->_trip->tr[0].y -= _vm->_trip->tr[0].iy; // Uuuupppp we go...
 	if (_vm->_trip->tr[0].iy > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
@@ -614,9 +591,8 @@ void Timeout::avalot_returns() {
 }
 
 void Timeout::avvy_sit_down() {
-/* This is used when you sit down in the pub in Notts. It loops around so
-	that it will happen when Avvy stops walking. */
-	if (_vm->_trip->tr[0].homing)    /* Still walking */
+// This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
+	if (_vm->_trip->tr[0].homing)    // Still walking.
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer->show_one(-1, -1, 3);
@@ -657,12 +633,17 @@ void Timeout::winning() {
 
 void Timeout::avalot_falls() {
 	if (_vm->_trip->tr[0].step < 5) {
-		_vm->_trip->tr[0].step += 1;
+		_vm->_trip->tr[0].step++;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
-	} else
-		//_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
-
-	warning("STUB: Timeout::avalot_falls()");
+	} else {
+		Common::String toDisplay;
+		for (byte i = 0; i < 6; i++)
+			toDisplay += _vm->_scrolls->kControlNewLine;
+		for (byte i = 0; i < 6; i++)
+			toDisplay += _vm->_scrolls->kControlInsertSpaces;
+		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
+		_vm->_scrolls->display(toDisplay);
+	}
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
@@ -673,19 +654,16 @@ void Timeout::spludwick_goes_to_cauldron() {
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	_vm->_trip->tr[1].call_eachstep = true; /* So that normal procs will continue. */
+	_vm->_trip->tr[1].call_eachstep = true; // So that normal procs will continue.
 }
 
-void Timeout::give_lute_to_geida() {   /* Moved here from Acci. */
+void Timeout::give_lute_to_geida() { // Moved here from Acci.
 	_vm->_visa->dixi('Q', 86);
 	_vm->_lucerna->points(4);
 	_vm->_gyro->dna.lustie_is_asleep = true;
 	_vm->_sequence->first_show(5);
-	_vm->_sequence->then_show(6); /* He falls asleep... */
-	_vm->_sequence->start_to_close(); /* Not really closing, but we're using the same procedure. */
+	_vm->_sequence->then_show(6); // He falls asleep...
+	_vm->_sequence->start_to_close(); // Not really closing, but we're using the same procedure.
 }
 
-/* "This is all!" */
-
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 80f0677..9ad2c30 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -71,85 +71,45 @@ public:
 	/* procx now runs between 1 and 41. */
 
 	static const int16 procopen_drawbridge = 3;
-
 	static const int16 procavaricius_talks = 4;
-
 	static const int16 procurinate = 5;
-
 	static const int16 proctoilet2 = 6;
-
 	static const int16 procbang = 7;
-
 	static const int16 procbang2 = 8;
-
 	static const int16 procstairs = 9;
-
 	static const int16 proccardiffsurvey = 10;
-
 	static const int16 proccardiff_return = 11;
-
 	static const int16 proc_cwytalot_in_herts = 12;
-
 	static const int16 procget_tied_up = 13;
-
 	static const int16 procget_tied_up2 = 1;
-
 	static const int16 prochang_around = 14;
-
 	static const int16 prochang_around2 = 15;
-
 	static const int16 procafter_the_shootemup = 32;
-
 	static const int16 procjacques_wakes_up = 16;
-
 	static const int16 procnaughty_duke = 17;
-
 	static const int16 procnaughty_duke2 = 18;
-
 	static const int16 procnaughty_duke3 = 38;
-
 	static const int16 procjump = 19;
-
 	static const int16 procsequence = 20;
-
 	static const int16 proccrapulus_splud_out = 21;
-
 	static const int16 procdawn_delay = 22;
-
 	static const int16 procbuydrinks = 23;
-
 	static const int16 procbuywine = 24;
-
 	static const int16 proccallsguards = 25;
-
 	static const int16 procgreetsmonk = 26;
-
 	static const int16 procfall_down_oubliette = 27;
-
 	static const int16 procmeet_avaroid = 28;
-
 	static const int16 procrise_up_oubliette = 29;
-
 	static const int16 procrobin_hood_and_geida = 2;
-
 	static const int16 procrobin_hood_and_geida_talk = 30;
-
 	static const int16 procavalot_returns = 31;
-
 	static const int16 procavvy_sit_down = 33; /* In Nottingham. */
-
 	static const int16 procghost_room_phew = 34;
-
 	static const int16 procarkata_shouts = 35;
-
 	static const int16 procwinning = 36;
-
 	static const int16 procavalot_falls = 37;
-
 	static const int16 procspludwick_goes_to_cauldron = 39;
-
 	static const int16 procspludwick_leaves_cauldron = 40;
-
 	static const int16 procgive_lute_to_geida = 41;
 
 	struct timetype {
@@ -162,7 +122,7 @@ public:
 
 	timetype times[7];
 	
-	bool timerLost; // Is the timer "lost"?
+	bool timerLost; // Is the timer "lost"? (Because of using lose_timer())
 
 
 	
@@ -176,9 +136,7 @@ public:
 
 	void lose_timer(byte which);
 
-	/*function timer_is_on(which:byte):boolean;*/
-
-	/* procedures to do things at the end of amounts of time: */
+	// Procedures to do things at the end of amounts of time:
 
 	void open_drawbridge();
 
@@ -260,8 +218,6 @@ public:
 
 private:
 	AvalancheEngine *_vm;
-
-	byte fv;
 };
 
 } // End of namespace Avalanche.


Commit: 4d6573a80ebc2ca2aab356426ea50adf3ca77505
    https://github.com/scummvm/scummvm/commit/4d6573a80ebc2ca2aab356426ea50adf3ca77505
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-01T08:15:55-07:00

Commit Message:
AVALANCHE: Start implementation of the drop-down menu.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3c2fc49..0c5869e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -532,7 +532,7 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick().
+			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::checkclick().
 			break;
 		case Common::EVENT_LBUTTONUP:
 			_lucerna->holdLeftMouse = false; // Same as above.
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6c80ee9..96cb307 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -222,7 +222,6 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_lucerna->clock_lucerna();
 		_vm->_dropdown->menu_link();
-		_vm->_trip->readstick();
 		_vm->_gyro->force_numlock();
 		_vm->_trip->get_back_loretta();
 		_vm->_celer->pics_link();
@@ -233,13 +232,13 @@ void Avalot::run(Common::String arg) {
 
 
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
-			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+		/*for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
+		_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
 
 		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-			if (_vm->_gyro->fields[i].x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
-		}
+		if (_vm->_gyro->fields[i].x1 < 640)
+		_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+		}*/
 		// ONYL FOR TESTING!!!
 
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index b19b253..4565c2f 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -49,8 +49,8 @@ headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, f
 	alttrigger = alttrig;
 	title = name;
 	position = p;
-	xpos = (position - 1) * _dr->spacing + _dr->indent;
-	xright = position * _dr->spacing + _dr->indent;
+	xpos = position * _dr->spacing + _dr->indent;
+	xright = (position + 1) * _dr->spacing + _dr->indent;
 	do_setup = dw;
 	do_choose = dc;
 
@@ -71,12 +71,12 @@ void headtype::highlight() {
 	warning("STUB: Dropdown::headytpe::highlight()");
 
 	_dr->hlchalk(xpos, 1, trigger, title, true);
-	{
-		_dr->ddm_o.left = xpos;
-		_dr->ddm_o.menunow = true;
-		_dr->_vm->_gyro->ddmnow = true;
-		_dr->ddm_o.menunum = position;
-	}
+	
+	_dr->ddm_o.left = xpos;
+	_dr->ddm_o.menunow = true;
+	_dr->_vm->_gyro->ddmnow = true;
+	_dr->ddm_o.menunum = position;
+	
 	_dr->_vm->_gyro->cmp = 177; /* Force redraw of cursor. */
 }
 
@@ -91,12 +91,11 @@ bool headtype::extdparse(char c) {
 
 
 
-onemenu *onemenu::init(Dropdown *dr) {
+void onemenu::init(Dropdown *dr) {
 	_dr = dr;
 	menunow = false;
 	_dr->_vm->_gyro->ddmnow = false;
 	menunum = 1;
-	return this;
 }
 
 void onemenu::start_afresh() {
@@ -108,55 +107,121 @@ void onemenu::start_afresh() {
 }
 
 void onemenu::opt(Common::String n, char tr, Common::String key, bool val) {
-	int16 l;
-	number += 1;
-	l = (n + key).size() + 3;
-	if (width < l)  width = l;
-	{
-		optiontype &with = oo[number];
-		with.title = n;
-		with.trigger = tr;
-		with.shortcut = key;
-		with.valid = val;
-	}
+	int16 l = (n + key).size() + 3;
+	if (width < l)
+		width = l;
+
+	oo[number].title = n;
+	oo[number].trigger = tr;
+	oo[number].shortcut = key;
+	oo[number].valid = val;
+	number++;
 }
 
 void onemenu::displayopt(byte y, bool highlit) {
-	warning("STUB: Dropdown::onemenu::displayopt()");
+	byte backgroundColor;
+	if (highlit)
+		backgroundColor = 0;
+	else
+		backgroundColor = 7;
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((flx1 + 1) * 8, 3 + (y + 1) * 10, (flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
+	//bar((flx1 + 1) * 8, 3 + y * 10, (flx2 + 1) * 8, 12 + y * 10);
+
+	Common::String data = oo[y].title;
+	while ((data + oo[y].shortcut).size() < width)
+		data += ' '; /* Pad oo[y] spaces. */
+	data = data + oo[y].shortcut;
+
+	if (highlit)
+		_dr->hlchalk(left, 4 + (y + 1) * 10, oo[y].trigger, data, oo[y].valid);
+	else
+		_dr->chalk(left, 4 + (y + 1) * 10, oo[y].trigger, data, oo[y].valid);
 }
 
 void onemenu::display() {
-	warning("STUB: Dropdown::onemenu::display()");
+	CursorMan.showMouse(false);
+	/*setactivepage(cp);
+	setvisualpage(cp);
+	setfillstyle(1, menu_b);
+	setcolor(menu_border);*/
+	firstlix = true;
+	flx1 = left - 2;
+	flx2 = left + width;
+	fly = 15 + number * 10;
+	menunow = true;
+	_dr->_vm->_gyro->ddmnow = true;
+
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((flx1 + 1) * 8, 12, (flx2 + 1) * 8, fly), _dr->menu_b);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((flx1 + 1) * 8 - 1, 11, (flx2 + 1) * 8 + 1, fly + 1), _dr->menu_border);
+	/*bar((flx1 + 1) * 8, 12, (flx2 + 1) * 8, fly);
+	rectangle((flx1 + 1) * 8 - 1, 11, (flx2 + 1) * 8 + 1, fly + 1);*/
+
+	displayopt(0, true);
+	for (byte y = 1; y < number; y++)
+		displayopt(y, false);
+	
+	_dr->_vm->_gyro->defaultled = 1;
+	_dr->_vm->_gyro->cmp = 177;
+	//mousepage(cp);
+	CursorMan.showMouse(true); // 4 = fletch
 }
 
 void onemenu::wipe() {
-	warning("STUB: Dropdown::onemenu::wipe()");
+	//setactivepage(cp);
+	CursorMan.showMouse(false); 
+	
+	_dr->chalk(_dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].xpos, 1, _dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].trigger, _dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].title, true);
+
+	/*mblit(flx1, 11, flx2 + 1, fly + 1, 3, cp);
+	blitfix();*/
+
+	menunow = false;
+	_dr->_vm->_gyro->ddmnow = false;
+	firstlix = false;
+	_dr->_vm->_gyro->defaultled = 2;
+
+	CursorMan.showMouse(true); 
 }
 
 void onemenu::movehighlight(int8 add) {
-	warning("STUB: Dropdown::onemenu::movehighlight()");
+	int8 hn;
+	if (add != 0) {
+		hn = highlightnum + add;
+		if ((hn < 0) || (hn >= number))
+			return;
+		highlightnum = hn;
+	}
+	//setactivepage(cp);
+	CursorMan.showMouse(false); 
+	displayopt(oldy, false);
+	displayopt(highlightnum, true);
+	//setactivepage(1 - cp);
+	oldy = highlightnum;
+	CursorMan.showMouse(true); 
 }
 
-void onemenu::lightup() {  /* This makes the menu highlight follow the mouse.*/
-	warning("STUB: Dropdown::onemenu::lightup()");
-	/*if ((_dr->_vm->_gyro->mx < flx1 * 8) || (_dr->_vm->_gyro->mx > flx2 * 8) ||
-		(_dr->_vm->_gyro->my <= 12) || (_dr->_vm->_gyro->my > fly - 3))
-			return;
-	highlightnum = (_dr->_vm->_gyro->my - 13) / 10;
-	if (highlightnum == oldy)  return;
-	movehighlight(0);*/
-	
+void onemenu::lightup(Common::Point cursorPos) { 
+	if ((cursorPos.x < flx1 * 8) || (cursorPos.x > flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
+		return;
+	highlightnum = (cursorPos.y - 26) / 20;
+	if (highlightnum == oldy)
+		return;
+	movehighlight(0);
 }
 
 void onemenu::select(byte n) {    /* Choose which one you want. */
-	if (! oo[n + 1].valid)  return;
+	if (!oo[n].valid)
+		return;
+
 	choicenum = n;
 	wipe();
 
-	if (choicenum == number)  choicenum -= 1; /* Off the bottom. */
-	if (choicenum > number)  choicenum = 0; /* Off the top, I suppose. */
+	if (choicenum == number)
+		choicenum--; /* Off the bottom. */
+	if (choicenum > number)
+		choicenum = 0; /* Off the top, I suppose. */
 
-	_dr->ddm_m.ddms[menunum].do_choose;
+	(_dr->*_dr->ddm_m.ddms[menunum].do_choose)();
 }
 
 void onemenu::keystroke(char c) {
@@ -164,13 +229,13 @@ void onemenu::keystroke(char c) {
 	bool found;
 	c = toupper(c);
 	found = false;
-	for (fv = 1; fv <= number; fv ++) {
+	for (fv = 0; fv < number; fv++) {
 		if ((toupper(oo[fv].trigger) == c) && oo[fv].valid) {
-			select(fv - 1);
+			select(fv);
 			found = true;
 		}
 	}
-	if (! found)
+	if (!found)
 		_dr->_vm->_gyro->blip();
 }
 
@@ -178,15 +243,14 @@ void onemenu::keystroke(char c) {
 
 
 
-menuset *menuset::init(Dropdown *dr) {
+void menuset::init(Dropdown *dr) {
 	_dr = dr;
 	howmany = 0;
-	return this;
 }
 
 void menuset::create(char t, Common::String n, char alttrig, func dw, func dc) {
-	howmany ++;
 	ddms[howmany].init(t, alttrig, n, howmany, dw, dc, _dr);
+	howmany++;
 }
 
 void menuset::update() {
@@ -201,10 +265,10 @@ void menuset::update() {
 	savecp = _dr->_vm->_gyro->cp;
 	_dr->_vm->_gyro->cp = 3;
 
-	for (fv = 1; fv <= howmany; fv ++)
+	for (fv = 0; fv < howmany; fv++)
 		ddms[fv].display();
 
-	for (page_ = 0; page_ <= 1; page_ ++)
+	for (page_ = 0; page_ <= 1; page_++)
 		_dr->_vm->_trip->getset[page_].remember(menuspace);
 
 	_dr->_vm->_gyro->cp = savecp;
@@ -212,33 +276,34 @@ void menuset::update() {
 
 void menuset::extd(char c) {
 	byte fv;
-	fv = 1;
-	while ((fv <= howmany) && (ddms[fv].extdparse(c)))  fv += 1;
-	if (fv > howmany)  return;
+	fv = 0;
+	while ((fv < howmany) && (ddms[fv].extdparse(c)))
+		fv ++;
+	if (fv == howmany)
+		return;
 	getcertain(fv);
 }
 
 void menuset::getcertain(byte fv) {
-	{
-		if (_dr->ddm_o.menunow) {
-			_dr->ddm_o.wipe(); /* get rid of menu */
-			if (_dr->ddm_o.menunum == ddms[fv].position)  return; /* clicked on own highlight */
-		}
-		ddms[fv].highlight();
-		ddms[fv].do_setup;
+	if (_dr->ddm_o.menunow) {
+		_dr->ddm_o.wipe(); // Get rid of menu.
+		if (_dr->ddm_o.menunum == ddms[fv].position)
+			return; // Clicked on own highlight.
 	}
+	ddms[fv].highlight();
+	(_dr->*ddms[fv].do_setup)();
 }
 
 void menuset::getmenu(int16 x) {
 	byte fv;
 	fv = 0;
 	do {
-		fv += 1;
 		if ((x > ddms[fv].xpos * 8) && (x < ddms[fv].xright * 8)) {
 			getcertain(fv);
 			return;
 		}
-	} while (!(fv > howmany));
+		fv++;
+	} while (fv < howmany);
 }
 
 
@@ -247,6 +312,8 @@ void menuset::getmenu(int16 x) {
 
 Dropdown::Dropdown(AvalancheEngine *vm) {
 	_vm = vm;
+	ddm_o.init(this);
+	ddm_m.init(this);
 }
 
 void Dropdown::find_what_you_can_do_with_it() {
@@ -305,15 +372,42 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = black;
 		}
 	}
+
+	_vm->_graphics->refreshScreen();
 }
 
 void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
-/* Highlighted. */
-	byte fv, ff, p;
-	uint16 pageseg;
 	byte ander;
+	if (valid)
+		ander = 255;
+	else
+		ander = 170;
+
+	fontType font;
+	for (byte fv = 0; fv < z.size(); fv++)
+		for (byte ff = 0; ff < 8; ff++) {
+			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander; // Set the font.
+			// And set the background of the text to black.
+			for (byte i = 0; i < 8; i++)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = black;
+		}
+
+	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, white);
+
+	// Underline the selected character.
+	if (z.contains(t)) {
+		byte fv;
+		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+
+		byte pixel = ander;
+		for (byte bit = 0; bit < 8; bit++) {
+			byte pixelBit = (pixel >> bit) & 1;
+			if (pixelBit)
+				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = white;
+		}
+	}
 
-	warning("STUB: Dropdown::hlchalk()");
+	_vm->_graphics->refreshScreen();
 }
 
 /*funcedure say(x,y:int16; t:char; z:Common::String; f,b:byte);
@@ -337,9 +431,9 @@ void Dropdown::parsekey(char r, char re) {
 				ddm_o.wipe();
 				ddm_m.getcertain(ddm_o.menunum - 1);
 			} else {
-				;     /* Get menu on the left-hand side */
+				// Get menu on the left-hand side.
 				ddm_o.wipe();
-				ddm_m.getmenu((ddm_m.howmany - 1)*spacing + indent);
+				ddm_m.getmenu((ddm_m.howmany - 1) * spacing + indent);
 			}
 			break;
 		case 'M':
@@ -347,7 +441,7 @@ void Dropdown::parsekey(char r, char re) {
 				ddm_o.wipe();
 				ddm_m.getcertain(ddm_o.menunum + 1);
 			} else {
-				;     /* Get menu on the far right-hand side */
+				// Get menu on the far right-hand side.
 				ddm_o.wipe();
 				ddm_m.getmenu(indent);
 			}
@@ -369,92 +463,83 @@ void Dropdown::parsekey(char r, char re) {
 	default: {
 		if (ddm_o.menunow)
 			ddm_o.keystroke(r);
-	}
+		}
 	}
 }
 
 /*$F+  *** Here follow all the ddm__ and do__ funcedures for the DDM system. */
 
 void Dropdown::ddm__game() {
-	{
-		ddm_o.start_afresh();
-		ddm_o.opt("Help...", 'H', "f1", true);
-		ddm_o.opt("Boss Key", 'B', "alt-B", true);
-		ddm_o.opt("Untrash screen", 'U', "ctrl-f7", true);
-		ddm_o.opt("Score and rank", 'S', "f9", true);
-		ddm_o.opt("About Avvy...", 'A', "shift-f10", true);
-		ddm_o.display();
-	}
+	ddm_o.start_afresh();
+	ddm_o.opt("Help...", 'H', "f1", true);
+	ddm_o.opt("Boss Key", 'B', "alt-B", true);
+	ddm_o.opt("Untrash screen", 'U', "ctrl-f7", true);
+	ddm_o.opt("Score and rank", 'S', "f9", true);
+	ddm_o.opt("About Avvy...", 'A', "shift-f10", true);
+	ddm_o.display();
 }
 
 void Dropdown::ddm__file() {
-	{
-		ddm_o.start_afresh();
-		ddm_o.opt("New game", 'N', "f4", true);
-		ddm_o.opt("Load...", 'L', "^f3", true);
-		ddm_o.opt("Save", 'S', "^f2", _vm->_gyro->alive);
-		ddm_o.opt("Save As...", 'v', "", _vm->_gyro->alive);
-		ddm_o.opt("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
-		ddm_o.opt("Quit", 'Q', "alt-X", true);
-		ddm_o.display();
-	}
+	ddm_o.start_afresh();
+	ddm_o.opt("New game", 'N', "f4", true);
+	ddm_o.opt("Load...", 'L', "^f3", true);
+	ddm_o.opt("Save", 'S', "^f2", _vm->_gyro->alive);
+	ddm_o.opt("Save As...", 'v', "", _vm->_gyro->alive);
+	ddm_o.opt("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
+	ddm_o.opt("Quit", 'Q', "alt-X", true);
+	ddm_o.display();
 }
 
 void Dropdown::ddm__action() {
-	Common::String n;
-	n = Common::String(_vm->_gyro->f5_does().c_str() + 2, 253);
+	ddm_o.start_afresh();
 
-	{
-		ddm_o.start_afresh();
-		if (n == "")
-			ddm_o.opt("Do something", 'D', "f5", false);
-		else
-			ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
-		ddm_o.opt("Pause game", 'P', "f6", true);
-		if (_vm->_gyro->dna.room == 99)
-			ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip->neardoor());
-		else
-			ddm_o.opt("Open the door", 'O', "f7", _vm->_trip->neardoor());
-		ddm_o.opt("Look around", 'L', "f8", true);
-		ddm_o.opt("Inventory", 'I', "Tab", true);
-		if (_vm->_trip->tr[1].xs == _vm->_gyro->walk)
-			ddm_o.opt("Run fast", 'R', "^R", true);
-		else
-			ddm_o.opt("Walk slowly", 'W', "^W", true);
-		ddm_o.display();
-	}
+	Common::String n = _vm->_gyro->f5_does();
+	for (byte i = 0; i < 2; i++)
+		n.deleteChar(0);
+	if (n.empty())
+		ddm_o.opt("Do something", 'D', "f5", false);
+	else
+		ddm_o.opt(n, n[0], "f5", true);
+	ddm_o.opt("Pause game", 'P', "f6", true);
+	if (_vm->_gyro->dna.room == 99)
+		ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip->neardoor());
+	else
+		ddm_o.opt("Open the door", 'O', "f7", _vm->_trip->neardoor());
+	ddm_o.opt("Look around", 'L', "f8", true);
+	ddm_o.opt("Inventory", 'I', "Tab", true);
+	if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
+		ddm_o.opt("Run fast", 'R', "^R", true);
+	else
+		ddm_o.opt("Walk slowly", 'W', "^W", true);
+
+	ddm_o.display();
 }
 
 void Dropdown::ddm__people() {
-	byte here;
-	char fv;
-
-	people = "";
-	here = _vm->_gyro->dna.room;
-
-	{
-		ddm_o.start_afresh();
-		for (fv = '\226'; fv <= '\262'; fv ++)
-			if (_vm->_gyro->whereis[fv] == here) {
-				ddm_o.opt(_vm->_gyro->getname(fv), _vm->_gyro->getnamechar(fv), "", true);
-				people = people + fv;
-			}
-		ddm_o.display();
-	}
+	if (!people.empty())
+		people.clear();
+	byte here = _vm->_gyro->dna.room;
+
+	ddm_o.start_afresh();
+
+	for (byte fv = 150; fv <= 178; fv++)
+		if (_vm->_gyro->whereis[fv - 150] == here) {
+			ddm_o.opt(_vm->_gyro->getname(fv), _vm->_gyro->getnamechar(fv), "", true);
+			people = people + fv;
+		}
+
+	ddm_o.display();
 }
 
 void Dropdown::ddm__objects() {
-	char fv;
-	{
-		ddm_o.start_afresh();
-		for (fv = '\1'; fv <= numobjs; fv ++)
-			if (_vm->_gyro->dna.obj[fv])
-				ddm_o.opt(_vm->_gyro->get_thing(fv), _vm->_gyro->get_thingchar(fv), "", true);
-		ddm_o.display();
-	}
+	ddm_o.start_afresh();
+	for (byte fv = 0; fv < numobjs; fv++)
+		if (_vm->_gyro->dna.obj[fv])
+			ddm_o.opt(_vm->_gyro->get_thing(fv + 1), _vm->_gyro->get_thingchar(fv + 1), "", true);
+	ddm_o.display();
 }
 
-Common::String Dropdown::himher(char x) {         /* Returns "im" for boys, and "er" for girls.*/
+Common::String Dropdown::himher(byte x) {
 	if (x < 175)
 		return "im";
 	else
@@ -462,7 +547,63 @@ Common::String Dropdown::himher(char x) {         /* Returns "im" for boys, and
 }
 
 void Dropdown::ddm__with() {
-	warning("STUB: Dropdown::ddm__with()");
+	byte fv;
+	Common::String verb;
+	char vbchar;
+	bool n;
+	
+	ddm_o.start_afresh();
+
+	if (_vm->_gyro->thinkthing) {
+		find_what_you_can_do_with_it();
+
+		for (fv = 0; fv < _vm->_gyro->verbstr.size(); fv++) {
+			_vm->_acci->verbopt(_vm->_gyro->verbstr[fv], verb, vbchar);
+			ddm_o.opt(verb, vbchar, "", true);
+		}
+
+		// We disable the "give" option if: (a), you haven't selected anybody, (b), the person you've selected isn't in the room, or (c), the person you've selected is YOU!
+		
+		if ((_vm->_gyro->last_person != _vm->_gyro->pavalot) || (_vm->_gyro->last_person != _vm->_acci->nowt) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 1] != _vm->_gyro->dna.room))
+			ddm_o.opt("Give to...", 'G', "", false); /* Not here. */
+		else {
+			ddm_o.opt(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_give;
+		}
+	} else {
+		ddm_o.opt("Examine", 'x', "", true);
+		ddm_o.opt(Common::String("Talk to h") + himher(_vm->_gyro->thinks), 'T', "", true);
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_talk;
+		switch (_vm->_gyro->thinks) {
+		case _vm->_gyro->pgeida:
+		case _vm->_gyro->parkata: {
+			ddm_o.opt("Kiss her", 'K', "", true);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_kiss;
+		}
+		break;
+		case _vm->_gyro->pdogfood: {
+			ddm_o.opt("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_play;
+		}
+		break;
+		case _vm->_gyro->pmalagauche: {
+			n = !_vm->_gyro->dna.teetotal;
+			ddm_o.opt("Buy some wine", 'w', "", !_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]);
+			ddm_o.opt("Buy some beer", 'b', "", n);
+			ddm_o.opt("Buy some whisky", 'h', "", n);
+			ddm_o.opt("Buy some cider", 'c', "", n);
+			ddm_o.opt("Buy some mead", 'm', "", n);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\145' + '\144' + '\146' + '\147' + '\150';
+		}
+		break;
+		case _vm->_gyro->ptrader: {
+			ddm_o.opt("Buy an onion", 'o', "", !_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\151';
+		}
+		break;
+		}
+	}
+	ddm_o.display();
 }
 
 /*funcedure ddm__map;
@@ -519,12 +660,14 @@ void Dropdown::do__file() {
 		_vm->_lucerna->callverb(_vm->_acci->vb_restart);
 		break;
 	case 1: {
-		_vm->_acci->realwords[2] = "";
+		if (!_vm->_acci->realwords[1].empty())
+			_vm->_acci->realwords[1].clear();
 		_vm->_lucerna->callverb(_vm->_acci->vb_load);
 	}
 	break;
 	case 2: {
-		_vm->_acci->realwords[2] = "";
+		if (!_vm->_acci->realwords[1].empty())
+			_vm->_acci->realwords[1].clear();
 		_vm->_lucerna->callverb(_vm->_acci->vb_save);
 	}
 	break;
@@ -548,7 +691,7 @@ void Dropdown::do__action() {
 		_vm->_acci->person = _vm->_acci->pardon;
 		_vm->_acci->thing = _vm->_acci->pardon;
 		n = _vm->_gyro->f5_does();
-		_vm->_lucerna->callverb(n[1]);
+		_vm->_lucerna->callverb(n[0]);
 	}
 	break;
 	case 1:
@@ -564,8 +707,10 @@ void Dropdown::do__action() {
 		_vm->_lucerna->callverb(_vm->_acci->vb_inv);
 		break;
 	case 5: {
-		if (_vm->_trip->tr[1].xs == _vm->_gyro->walk)  _vm->_trip->tr[1].xs = _vm->_gyro->run;
-		else _vm->_trip->tr[1].xs = _vm->_gyro->walk;
+		if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
+			_vm->_trip->tr[0].xs = _vm->_gyro->run;
+		else
+			_vm->_trip->tr[0].xs = _vm->_gyro->walk;
 		_vm->_trip->newspeed();
 	}
 	break;
@@ -577,8 +722,8 @@ void Dropdown::do__objects() {
 }
 
 void Dropdown::do__people() {
-	_vm->_lucerna->thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
-	_vm->_gyro->last_person = people[ddm_o.choicenum + 1];
+	_vm->_lucerna->thinkabout(people[ddm_o.choicenum], _vm->_gyro->a_person);
+	_vm->_gyro->last_person = people[ddm_o.choicenum];
 }
 
 void Dropdown::do__with() {
@@ -588,72 +733,73 @@ void Dropdown::do__with() {
 
 		_vm->_acci->thing += 49;
 
-		if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci->vb_give)
+		if (_vm->_gyro->verbstr[ddm_o.choicenum] == _vm->_acci->vb_give)
 			_vm->_acci->person = _vm->_gyro->last_person;
 		else
-			_vm->_acci->person = '\376';
+			_vm->_acci->person = 254;
 
 	} else {
-		switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) {
-		case '\144': {
-			_vm->_acci->thing = '\144';
+		switch (_vm->_gyro->verbstr[ddm_o.choicenum]) {
+		case 100: { // Beer
+			_vm->_acci->thing = 100;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Beer */
-		case '\145': {
-			_vm->_acci->thing = '\62';
+		break;
+		case 101: { // Wine
+			_vm->_acci->thing = 50;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Wine */
-		case '\146': {
-			_vm->_acci->thing = '\146';
+		break;
+		case 102: { // Whisky
+			_vm->_acci->thing = 102;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Whisky */
-		case '\147': {
-			_vm->_acci->thing = '\147';
+		break; 
+		case 103: { // Cider
+			_vm->_acci->thing = 103;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Cider */
-		case '\150': {
-			_vm->_acci->thing = '\153';
+		break; 
+		case 104: { // Mead
+			_vm->_acci->thing = 107;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Mead */
-		case '\151': {
-			_vm->_acci->thing = '\103';
+		break; 
+		case 105: { // Onion (trader)
+			_vm->_acci->thing = 67;
 			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
 			return;
 		}
-		break; /* Onion (trader) */
+		break; 
 		default: {
 			_vm->_acci->person = _vm->_acci->thing;
-			_vm->_acci->thing = '\376';
+			_vm->_acci->thing = 254;
 		}
 		}
 	}
-	_vm->_lucerna->callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
+	_vm->_lucerna->callverb(_vm->_gyro->verbstr[ddm_o.choicenum]);
 }
 
-/*$F- That's all. Now for the ...bar funcs. */
 
 
+// That's all. Now for the ...bar funcs.
+
 void Dropdown::standard_bar() {   /* Standard menu bar */
 	ddm_m.init(this);
 	ddm_o.init(this);
 	/* Set up menus */
 
-	ddm_m.create('F', "File", '!', &Avalanche::Dropdown::ddm__file, &Avalanche::Dropdown::do__file); /* same ones in map_bar, below, */
-	ddm_m.create('G', "Game", '\42', &Avalanche::Dropdown::ddm__game, &Avalanche::Dropdown::do__game); /* Don't forget to change the */
-	ddm_m.create('A', "Action", '\36', &Avalanche::Dropdown::ddm__action, &Avalanche::Dropdown::do__action); /* if you change them */
-	ddm_m.create('O', "Objects", '\30', &Avalanche::Dropdown::ddm__objects, &Avalanche::Dropdown::do__objects); /* here... */
-	ddm_m.create('P', "People", '\31', &Avalanche::Dropdown::ddm__people, &Avalanche::Dropdown::do__people);
-	ddm_m.create('W', "With", '\21', &Avalanche::Dropdown::ddm__with, &Avalanche::Dropdown::do__with);
+	ddm_m.create('F', "File", '!', &Avalanche::Dropdown::ddm__file, &Avalanche::Dropdown::do__file); // same ones in map_bar, below,
+	ddm_m.create('G', "Game", 34, &Avalanche::Dropdown::ddm__game, &Avalanche::Dropdown::do__game); // Don't forget to change the
+	ddm_m.create('A', "Action", 30, &Avalanche::Dropdown::ddm__action, &Avalanche::Dropdown::do__action); // if you change them
+	ddm_m.create('O', "Objects", 24, &Avalanche::Dropdown::ddm__objects, &Avalanche::Dropdown::do__objects); // here...
+	ddm_m.create('P', "People", 25, &Avalanche::Dropdown::ddm__people, &Avalanche::Dropdown::do__people);
+	ddm_m.create('W', "With", 17, &Avalanche::Dropdown::ddm__with, &Avalanche::Dropdown::do__with);
 
 	ddm_m.update();
 }
@@ -673,56 +819,32 @@ begin;
  end;
 end;*/
 
-void Dropdown::checkclick() {   /* only for when the menu's displayed */
-	if (_vm->_gyro->mpress > 0) {
-		if (_vm->_gyro->mpy > 10) {
-			if (!((ddm_o.firstlix) &&
-			   ((_vm->_gyro->mpx >= ddm_o.flx1 * 8) && (_vm->_gyro->mpx <= ddm_o.flx2 * 8) &&
-			   (_vm->_gyro->mpy >= 12) && (_vm->_gyro->mpy <= ddm_o.fly)))) {
-			     /* Clicked OUTSIDE the menu. */
-				if (ddm_o.menunow)
-					ddm_o.wipe();
-			}    /* No "else"- clicking on menu has no effect (only releasing) */
-		} else {
-			 /* Clicked on menu bar */
-			ddm_m.getmenu(_vm->_gyro->mpx);
-		}
-	} else {
-		;     /* NOT clicked button... */
-		if (_vm->_gyro->mrelease > 0) {
-			if ((ddm_o.firstlix) &&
-			   ((_vm->_gyro->mrx >= ddm_o.flx1 * 8) && (_vm->_gyro->mrx <= ddm_o.flx2 * 8) &&
-			   (_vm->_gyro->mry >= 12) && (_vm->_gyro->mry <= ddm_o.fly)))
-					ddm_o.select((_vm->_gyro->mry - 13) / 10);
-		}
-	}
+void Dropdown::checkclick(Common::Point cursorPos) {
+	warning("STUB: Lucerna::checkclick()");
 }
 
 void Dropdown::menu_link() {
-	if (! ddm_o.menunow)  return;
-
-	_vm->_gyro->check(); /* find mouse coords & click information */
-	checkclick(); /* work out click codes */
+	if (!ddm_o.menunow)
+		return;
 
-	/* Change arrow... */
+	Common::Point cursorPos = _vm->getMousePos();
+	checkclick(cursorPos); // Work out click codes.
 
-		
-	if ((_vm->_gyro->my >= 0) && (_vm->_gyro->my <= 10))
-		_vm->_gyro->newpointer(1); /* up-arrow */
-	else if ((_vm->_gyro->my >= 11) && (_vm->_gyro->my <= 169)) {
-		if ((_vm->_gyro->mx >= ddm_o.flx1 * 8) && (_vm->_gyro->mx <= ddm_o.flx2 * 8)
-			&& (_vm->_gyro->my > 10) && (_vm->_gyro->my <= ddm_o.fly))
-			_vm->_gyro->newpointer(3); /* right-arrow */
+	// Change arrow...
+	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+		_vm->_gyro->newpointer(1); // Up arrow
+	else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
+		if ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= ddm_o.fly * 2 + 1))
+			_vm->_gyro->newpointer(3); // Right-arrow
 		else
-			_vm->_gyro->newpointer(4); /* fletch */
-	} else if ((_vm->_gyro->my >= 169) && (_vm->_gyro->my <= 200))
-		_vm->_gyro->newpointer(2); /* screwdriver */
+			_vm->_gyro->newpointer(4); // Fletch
+	} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+		_vm->_gyro->newpointer(2); // Screwdriver
 
-	if (! ddm_o.menunow)
+	if (!ddm_o.menunow)
 		return;
 
-	ddm_o.lightup();
+	ddm_o.lightup(cursorPos);
 }
 
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 51be377..73325a3 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -63,7 +63,7 @@ private:
 
 struct optiontype {
 	Common::String title;
-	char trigger;
+	byte trigger;
 	Common::String shortcut;
 	bool valid;
 };
@@ -81,12 +81,12 @@ public:
 	byte choicenum; /* Your choice? */
 	byte highlightnum;
 
-	onemenu *init(Dropdown *dr);
+	void init(Dropdown *dr);
 	void start_afresh();
 	void opt(Common::String n, char tr, Common::String key, bool val);
 	void display();
 	void wipe();
-	void lightup();
+	void lightup(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
 	void displayopt(byte y, bool highlit);
 	void movehighlight(int8 add);
 	void select(byte n);
@@ -103,7 +103,7 @@ public:
 	headtype ddms[8];
 	byte howmany;
 
-	menuset *menuset::init(Dropdown *dr);
+	void init(Dropdown *dr);
 	void create(char t, Common::String n, char alttrig, func dw, func dc);
 	void update();
 	void extd(char c);
@@ -140,30 +140,17 @@ public:
 	void standard_bar();
 
 private:
-	
-
-	
-
-
-
 	AvalancheEngine *_vm;
 
-	static const int16 indent = 5;
-	static const int16 spacing = 10;
+	static const byte indent = 5;
+	static const byte spacing = 10;
 
-	/* menu_b = blue; { Morpheus }
-	 menu_f = yellow;
-	 menu_border = black;
-	 highlight_b = lightblue;
-	 highlight_f = yellow;
-	 disabled = lightgray; */
-
-	static const int16 menu_b = lightgray; /* Windowsy */
-	static const int16 menu_f = black;
-	static const int16 menu_border = black;
-	static const int16 highlight_b = black;
-	static const int16 highlight_f = white;
-	static const int16 disabled = darkgray;
+	static const byte menu_b = lightgray; /* Windowsy */
+	static const byte menu_f = black;
+	static const byte menu_border = black;
+	static const byte highlight_b = black;
+	static const byte highlight_f = white;
+	static const byte disabled = darkgray;
 
 
 
@@ -174,13 +161,12 @@ private:
 
 	void chalk(int16 x, int16 y, char t, Common::String z, bool valid);
 
-	void hlchalk(int16 x, int16 y, char t, Common::String z, bool valid);
+	void hlchalk(int16 x, int16 y, char t, Common::String z, bool valid); // Highlighted. TODO: It's too similar to chalk! Unify these two!!!
 
 	void bleep();
 
 
 	
-
 	void ddm__game();
 	void ddm__file();
 	void ddm__action();
@@ -188,7 +174,7 @@ private:
 	void ddm__objects();
 	void ddm__with();
 
-	Common::String himher(char x);
+	Common::String himher(byte x); // Returns "im" for boys, and "er" for girls.
 
 	void do__game();
 	void do__file();
@@ -197,7 +183,7 @@ private:
 	void do__people();
 	void do__with();
 
-	void checkclick();
+	void checkclick(Common::Point cursorPos); // Only for when the menu's displayed!
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ca28772..4c1af54 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -76,6 +76,8 @@ public:
 
 	::Graphics::Surface _scrolls;
 
+	::Graphics::Surface _dropdown;
+
 
 
 	Graphics(AvalancheEngine *vm);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index f689142..cfbfd32 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -413,13 +413,11 @@ Common::String Gyro::getname(byte whose) {
 }
 
 // Keep an eye open! ^
-char Gyro::getnamechar(byte whose) {
-	char getnamechar_result;
-	if (whose < 16) 
-		getnamechar_result = ladchar[whose];
+byte Gyro::getnamechar(byte whose) {
+	if (whose < 175) 
+		return ladchar[whose - 150];
 	else
-		getnamechar_result = lasschar[whose-16];
-	return getnamechar_result;
+		return lasschar[whose - 175];
 }
 
 // Keep an eye open! ^^
@@ -430,7 +428,7 @@ Common::String Gyro::get_thing(byte which) {
 		switch (dna.winestate) {
 		case 1:
 		case 4:
-			get_thing_result = things[which];
+			get_thing_result = things[which - 1];
 			break;
 		case 3:
 			get_thing_result = "Vinegar";
@@ -441,10 +439,10 @@ Common::String Gyro::get_thing(byte which) {
 		if (dna.rotten_onion)
 			get_thing_result = "rotten onion";
 		else
-			get_thing_result = things[which];
+			get_thing_result = things[which - 1];
 		break;
 	default:
-		get_thing_result = things[which];
+		get_thing_result = things[which - 1];
 	}
 	return get_thing_result;
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index a7ad6b6..d75ac15 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -644,7 +644,7 @@ public:
 
 	Common::String getname(byte whose);
 
-	char getnamechar(byte whose);
+	byte getnamechar(byte whose);
 
 	Common::String get_thing(byte which);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 036ae4e..e07e428 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -946,8 +946,8 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 	showscore();
 }
 
-void Lucerna::topcheck() {
-	_vm->_dropdown->ddm_m.getmenu(_vm->_gyro->mpx);
+void Lucerna::topcheck(Common::Point cursorPos) {
+	_vm->_dropdown->ddm_m.getmenu(cursorPos.x);
 }
 
 void Lucerna::mouseway(const Common::Point &cursorPos) {
@@ -1084,8 +1084,6 @@ void Lucerna::verte(Common::Point cursorPos) {
 }
 
 void Lucerna::checkclick() {
-	bytefield b;
-
 	Common::Point cursorPos = _vm->getMousePos();
 	_vm->_gyro->ontoolbar = _vm->_gyro->slow_computer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 	
@@ -1107,9 +1105,9 @@ void Lucerna::checkclick() {
 	}
 
 	if (holdLeftMouse)
-		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Clink on the dropdown menu.
+		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->dropsok)
-				topcheck();
+				topcheck(cursorPos);
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
 			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
 			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 451bd73..8c49721 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -152,7 +152,7 @@ private:
 
 	void put_geida_at(byte whichped, byte &ped);
 
-	void topcheck();
+	void topcheck(Common::Point cursorPos);
 
 	void verte(Common::Point cursorPos);
 


Commit: 5720fa1dba82063409472fad41c0c269f9cb2b49
    https://github.com/scummvm/scummvm/commit/5720fa1dba82063409472fad41c0c269f9cb2b49
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-01T16:11:16-07:00

Commit Message:
AVALANCHE: Implement drop-down menu. (Only with mouse control yet.)

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 4565c2f..e7db875 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -170,8 +170,7 @@ void onemenu::wipe() {
 	//setactivepage(cp);
 	CursorMan.showMouse(false); 
 	
-	_dr->chalk(_dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].xpos, 1, _dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].trigger, _dr->ddm_m.ddms[_dr->ddm_o.menunum - 1].title, true);
-
+	_dr->chalk(_dr->ddm_m.ddms[_dr->ddm_o.menunum].xpos, 1, _dr->ddm_m.ddms[_dr->ddm_o.menunum].trigger, _dr->ddm_m.ddms[_dr->ddm_o.menunum].title, true);
 	/*mblit(flx1, 11, flx2 + 1, fly + 1, 3, cp);
 	blitfix();*/
 
@@ -353,8 +352,11 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 
 	fontType font;
 	for (byte fv = 0; fv < z.size(); fv++)
-		for (byte ff = 0; ff < 8; ff++)
+		for (byte ff = 0; ff < 8; ff++) {
 			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander;
+			for (byte i = 0; i < 8; i++)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = lightgray;
+		}
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, black);
 	
@@ -495,7 +497,8 @@ void Dropdown::ddm__action() {
 
 	Common::String n = _vm->_gyro->f5_does();
 	for (byte i = 0; i < 2; i++)
-		n.deleteChar(0);
+		if (!n.empty())
+			n.deleteChar(0);
 	if (n.empty())
 		ddm_o.opt("Do something", 'D', "f5", false);
 	else
@@ -820,31 +823,79 @@ begin;
 end;*/
 
 void Dropdown::checkclick(Common::Point cursorPos) {
-	warning("STUB: Lucerna::checkclick()");
+	warning("STUB: Dropdown::checkclick()");
 }
 
-void Dropdown::menu_link() {
-	if (!ddm_o.menunow)
-		return;
-
+void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 	Common::Point cursorPos = _vm->getMousePos();
-	checkclick(cursorPos); // Work out click codes.
-
-	// Change arrow...
-	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		_vm->_gyro->newpointer(1); // Up arrow
-	else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
-		if ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= ddm_o.fly * 2 + 1))
-			_vm->_gyro->newpointer(3); // Right-arrow
-		else
-			_vm->_gyro->newpointer(4); // Fletch
-	} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		_vm->_gyro->newpointer(2); // Screwdriver
+	::Graphics::Surface backup;
+	backup.copyFrom(_vm->_graphics->_surface);
+
+	while (!ddm_o.menunow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) {
+		ddm_m.getmenu(cursorPos.x);
+		do 
+			_vm->updateEvents();
+		while (_vm->_lucerna->holdLeftMouse);
+	
 
-	if (!ddm_o.menunow)
-		return;
+		while (!_vm->shouldQuit()) {
+			do { 
+				_vm->updateEvents();
+
+				cursorPos = _vm->getMousePos();
+				// Change arrow...
+				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+					_vm->_gyro->newpointer(1); // Up arrow
+				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
+					if ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= ddm_o.fly * 2 + 1))
+						_vm->_gyro->newpointer(3); // Right-arrow
+					else
+						_vm->_gyro->newpointer(4); // Fletch
+				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+					_vm->_gyro->newpointer(2); // Screwdriver
+
+				ddm_o.lightup(cursorPos);
+
+				_vm->_graphics->refreshScreen();
+			} while (!_vm->_lucerna->holdLeftMouse);
+
+			if (_vm->_lucerna->holdLeftMouse) {
+				if (cursorPos.y > 21) {
+					if (!((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) {  // Clicked OUTSIDE the menu.
+							if (ddm_o.menunow) {
+								ddm_o.wipe();
+								_vm->_lucerna->holdLeftMouse = false;
+								return;
+							} // No "else"- clicking on menu has no effect (only releasing).
+						} 
+				} else {
+					// Clicked on menu bar.
+					if (ddm_o.menunow) {
+						ddm_o.wipe();
+						_vm->_lucerna->holdLeftMouse = true;
+						_vm->_graphics->_surface.copyFrom(backup);
+						_vm->_graphics->refreshScreen();
+						break;
+					}
+				}
+	
+				// NOT clicked button...
+				if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
+					&& (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) {
+						do {
+							_vm->updateEvents();
+							_vm->_graphics->refreshScreen();
+						} while (_vm->_lucerna->holdLeftMouse);
+						uint16 which = (cursorPos.y - 26) / 20;
+						ddm_o.select(which);
+						if (ddm_o.oo[which].valid)
+							return;
+				}
+			}
 
-	ddm_o.lightup(cursorPos);
+		}
+	}
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 4c1af54..ca28772 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -76,8 +76,6 @@ public:
 
 	::Graphics::Surface _scrolls;
 
-	::Graphics::Surface _dropdown;
-
 
 
 	Graphics(AvalancheEngine *vm);
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e07e428..eda1a8e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1103,11 +1103,11 @@ void Lucerna::checkclick() {
 		} else
 			_vm->_gyro->newpointer(4); // fletch
 	}
-
+	
 	if (holdLeftMouse)
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->dropsok)
-				topcheck(cursorPos);
+				_vm->_dropdown->menu_link();
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
 			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
 			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)


Commit: cf5f150d9b4d00ee16b0ee51861a4386b35f9626
    https://github.com/scummvm/scummvm/commit/cf5f150d9b4d00ee16b0ee51861a4386b35f9626
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-02T03:53:01-07:00

Commit Message:
AVALANCHE: Upgrade the drop-down menu.

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index e7db875..4647f59 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -842,6 +842,7 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 			do { 
 				_vm->updateEvents();
 
+				// We updadte the cursor's picture.
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
@@ -883,13 +884,22 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 				// NOT clicked button...
 				if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
 					&& (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) {
-						do {
-							_vm->updateEvents();
+
+						// We act only if the button is relased over a menu item.
+						Common::Event event;
+						while (!_vm->shouldQuit()) {
+							cursorPos = _vm->getMousePos();
+							ddm_o.lightup(cursorPos);
 							_vm->_graphics->refreshScreen();
-						} while (_vm->_lucerna->holdLeftMouse);
+
+							_vm->updateEvents();
+							if (!_vm->_lucerna->holdLeftMouse)
+								break;
+						}
+
 						uint16 which = (cursorPos.y - 26) / 20;
 						ddm_o.select(which);
-						if (ddm_o.oo[which].valid)
+						if (ddm_o.oo[which].valid) // If the menu item wasn't active, we do nothing.
 							return;
 				}
 			}


Commit: 9e848e8e64103406a7e356081f18d9c597b0018d
    https://github.com/scummvm/scummvm/commit/9e848e8e64103406a7e356081f18d9c597b0018d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-02T06:44:55-07:00

Commit Message:
AVALANCHE: Upgrade drop-down menu. (Now it's complete.) Fix Trip::neardoor().

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0c5869e..73b39d6 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -532,7 +532,7 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::checkclick().
+			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
 			break;
 		case Common::EVENT_LBUTTONUP:
 			_lucerna->holdLeftMouse = false; // Same as above.
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 4647f59..baf1e94 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -863,7 +863,8 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 			if (_vm->_lucerna->holdLeftMouse) {
 				if (cursorPos.y > 21) {
 					if (!((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
-						&& (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) {  // Clicked OUTSIDE the menu.
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) {
+							// Clicked OUTSIDE the menu.
 							if (ddm_o.menunow) {
 								ddm_o.wipe();
 								_vm->_lucerna->holdLeftMouse = false;
@@ -874,9 +875,16 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 					// Clicked on menu bar.
 					if (ddm_o.menunow) {
 						ddm_o.wipe();
-						_vm->_lucerna->holdLeftMouse = true;
 						_vm->_graphics->_surface.copyFrom(backup);
 						_vm->_graphics->refreshScreen();
+						_vm->_lucerna->holdLeftMouse = true;
+						
+						if (((ddm_o.left * 8) <= cursorPos.x) && (cursorPos.x <= (ddm_o.left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
+							// If we clicked on the same menu item on the bar...
+							_vm->_lucerna->holdLeftMouse = false;
+							return;
+						}
+
 						break;
 					}
 				}
@@ -885,8 +893,7 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 				if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
 					&& (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) {
 
-						// We act only if the button is relased over a menu item.
-						Common::Event event;
+						// We act only if the button is released over a menu item.
 						while (!_vm->shouldQuit()) {
 							cursorPos = _vm->getMousePos();
 							ddm_o.lightup(cursorPos);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f83bfc07..5e42839 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1573,7 +1573,7 @@ bool Trip::infield(byte which) {
 }
 
 bool Trip::neardoor() {
-	if (_vm->_gyro->numfields < 9) {
+	if (_vm->_gyro->numfields < 8) {
 		/* there ARE no doors here! */
 		return false;
 	}
@@ -1581,7 +1581,7 @@ bool Trip::neardoor() {
 	int16 ux = tr[0].x;
 	int16 uy = tr[0].y + tr[0]._info.yl;
 	bool nd = false;
-	for (byte fv = 9; fv <= _vm->_gyro->numfields; fv++)
+	for (byte fv = 8; fv < _vm->_gyro->numfields; fv++)
 		if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
 			&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2)) 
 			nd = true;


Commit: 9b7f138659e5b9b3772c578bb70d9d4a01153098
    https://github.com/scummvm/scummvm/commit/9b7f138659e5b9b3772c578bb70d9d4a01153098
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-02T11:09:44-07:00

Commit Message:
AVALANCHE: Repair drop-down menu, so the already implemented functions are working.

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index baf1e94..d0cd505 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -536,9 +536,10 @@ void Dropdown::ddm__people() {
 
 void Dropdown::ddm__objects() {
 	ddm_o.start_afresh();
-	for (byte fv = 0; fv < numobjs; fv++)
+	for (byte fv = 0; fv < numobjs; fv++) {
 		if (_vm->_gyro->dna.obj[fv])
 			ddm_o.opt(_vm->_gyro->get_thing(fv + 1), _vm->_gyro->get_thingchar(fv + 1), "", true);
+	}
 	ddm_o.display();
 }
 
@@ -567,7 +568,7 @@ void Dropdown::ddm__with() {
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the person you've selected isn't in the room, or (c), the person you've selected is YOU!
 		
-		if ((_vm->_gyro->last_person != _vm->_gyro->pavalot) || (_vm->_gyro->last_person != _vm->_acci->nowt) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 1] != _vm->_gyro->dna.room))
+		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->nowt) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
 			ddm_o.opt("Give to...", 'G', "", false); /* Not here. */
 		else {
 			ddm_o.opt(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
@@ -782,6 +783,7 @@ void Dropdown::do__with() {
 		default: {
 			_vm->_acci->person = _vm->_acci->thing;
 			_vm->_acci->thing = 254;
+			_vm->_gyro->subjnumber = 0;
 		}
 		}
 	}
@@ -877,15 +879,15 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 						ddm_o.wipe();
 						_vm->_graphics->_surface.copyFrom(backup);
 						_vm->_graphics->refreshScreen();
-						_vm->_lucerna->holdLeftMouse = true;
 						
 						if (((ddm_o.left * 8) <= cursorPos.x) && (cursorPos.x <= (ddm_o.left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
-							// If we clicked on the same menu item on the bar...
+							// If we clicked on the same menu item (the one that is already active) on the bar...
 							_vm->_lucerna->holdLeftMouse = false;
 							return;
+						} else {
+							_vm->_lucerna->holdLeftMouse = true;
+							break;
 						}
-
-						break;
 					}
 				}
 	
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index cfbfd32..aab8c82 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -455,10 +455,10 @@ char Gyro::get_thingchar(byte which) {
 		if (dna.winestate == 3)
 			get_thingchar_result = 'V'; /* Vinegar */
 		else
-			get_thingchar_result = thingchar[which];
+			get_thingchar_result = thingchar[which - 1];
 		break;
 	default:
-		get_thingchar_result = thingchar[which];
+		get_thingchar_result = thingchar[which - 1];
 	}
 	return get_thingchar_result;
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index d75ac15..967034a 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -580,7 +580,7 @@ public:
 	Common::File demofile; // of demo_type
 	Common::DumpFile demofile_save; // uruk added it - first use located in constructor of Basher
 
-	char last_person; /* Last person to have been selected using the People
+	byte last_person; /* Last person to have been selected using the People
 						menu. */
 
 	bool doing_sprite_run; /* Only set to True if we're doing a sprite_run


Commit: 0afbcf1cf0530d8a71e5ec12ef3c4ec9cbe91686
    https://github.com/scummvm/scummvm/commit/0afbcf1cf0530d8a71e5ec12ef3c4ec9cbe91686
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T03:09:29-07:00

Commit Message:
AVALANCHE: Rename/refactor avalanche.h/.cpp.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 73b39d6..5c140ca 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -557,29 +557,29 @@ Common::Point AvalancheEngine::getMousePos() {
 
 // From Bootstrp:
 
-const char AvalancheEngine::runcodes[2][3] = {"et", "Go"};
+const char AvalancheEngine::kRuncodes[2][3] = {"et", "Go"};
 
 
 
 // The original ones were all commented out, so porbably there's no need
 // of these two cursor functions at all. TODO: Remove later.
-void AvalancheEngine::cursor_off() {
-	warning("STUB: cursor_off()");
+void AvalancheEngine::cursorOff() {
+	warning("STUB: cursorOff()");
 }
 
-void AvalancheEngine::cursor_on() {
-	warning("STUB: cursor_on()");
+void AvalancheEngine::cursorOn() {
+	warning("STUB: cursorOn()");
 }
 
 // Needed later.
 void AvalancheEngine::quit() {
-	cursor_on();
+	cursorOn();
 }
 
 // Needed in dos_shell(). TODO: Remove later.
-Common::String AvalancheEngine::command_com() {
-	warning("STUB: command_com()");
-	return ("STUB: command_com()");
+Common::String AvalancheEngine::commandCom() {
+	warning("STUB: commandCom()");
+	return ("STUB: commandCom()");
 }
 
 // Needed for run_avalot()'s errors. TODO: Remove later.
@@ -591,75 +591,70 @@ void AvalancheEngine::explain(byte error) {
 
 //TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
 
-void AvalancheEngine::b_flight() {   /*interrupt;*/
-	_storage.skellern++;
+void AvalancheEngine::bFlight() {   /*interrupt;*/
+	_storage._skellern++;
 }
 
-void AvalancheEngine::bflight_on() {
-	_storage.skellern = _reset_;
+void AvalancheEngine::bFlightOn() {
+	_storage._skellern = kReset;
 	// setintvec(0x1c, &b_flight);
 }
 
-void AvalancheEngine::bflight_off() {
+void AvalancheEngine::bFlightOff() {
 	// setintvec(0x1c, old_1c);
 }
 
 
 
-Common::String AvalancheEngine::elm2str(elm how) {
-	Common::String elm2str_result;
+Common::String AvalancheEngine::elm2Str(Elm how) {
 	switch (how) {
-	case Normal:
-	case Musical:
-		elm2str_result = "jsb";
-		break;
-	case Regi:
-		elm2str_result = "REGI";
-		break;
-	case Elmpoyten:
-		elm2str_result = "ELMPOYTEN";
-		break;
+	case kNormal:
+	case kMusical:
+		return "jsb";
+	case kRegi:
+		return "REGI";
+	case kElmpoyten:
+		return "ELMPOYTEN";
 	}
-	return elm2str_result;
 }
 
-void AvalancheEngine::run(Common::String what, bool with_jsb, bool with_bflight, elm how) {
+void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
 	warning("STUB: run(%s)", what.c_str()); 
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 }
 
-void AvalancheEngine::get_arguments() {
+void AvalancheEngine::getArguments() {
 	// This function should mess around with command line arguments,
 	// but I am not sure if there'll be use of these arguments at all...
-	warning("STUB: get_arguments()"); 
+	warning("STUB: getArguments()"); 
 }
 
-void AvalancheEngine::get_slope() {
+void AvalancheEngine::getSlope() {
 	// Same as get_arguments()
-	warning("STUB: get_slope()");
+	warning("STUB: getSlope()");
 }
 
-void AvalancheEngine::call_menu() {
-	warning("STUB: call_menu()");
+void AvalancheEngine::callMenu() {
+	warning("STUB: callMenu()");
 }
 
-void AvalancheEngine::run_the_demo() {
-	warning("STUB: run_the_demo()");
+void AvalancheEngine::runDemo() {
+	warning("STUB: runDemo()");
 }
 
-void AvalancheEngine::dos_shell() {
-	warning("STUB: dos_shell()");
+void AvalancheEngine::dosShell() {
+	warning("STUB: dosShell()");
 }
 
 // Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
-bool AvalancheEngine::keypressed1() {	
-	warning("STUB: keypressed1()");
+bool AvalancheEngine::keyPressed() {	
+	warning("STUB: keyPressed()");
 	return false;
 }
 
 // Same as keypressed1().
-void AvalancheEngine::flush_buffer() {
-	warning("STUB: flush_buffer()");
+void AvalancheEngine::flushBuffer() {
+	warning("STUB: flushBuffer()");
 }
 
 // Same as keypressed1().
@@ -670,14 +665,14 @@ void AvalancheEngine::demo() {
 
 
 	
-void AvalancheEngine::run_avalot() {
-	bflight_on();
+void AvalancheEngine::runAvalot() {
+	bFlightOn();
 
-	_avalot->run(Common::String(runcodes[first_time]) + arguments);
+	_avalot->run(Common::String(kRuncodes[_firstTime]) + _arguments);
 	// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
 	// If there's an error initalizing avalot, i'll handle it in there, not here
 
-	first_time = false;
+	_firstTime = false;
 }
 
 
@@ -691,36 +686,36 @@ Common::Error AvalancheEngine::run() {
 
 	// From bootstrp:
 
-	first_time = true;
+	_firstTime = true;
 
-	get_arguments();
-	get_slope();
+	getArguments();
+	getSlope();
 
-	zoomy = true; 
+	_zoomy = true; 
 	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
 	// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
-	if (!zoomy)
-		call_menu();    /* Not run when zoomy. */
+	if (!_zoomy)
+		callMenu();    /* Not run when zoomy. */
 
 
 
 	do {
-		run_avalot();
+		runAvalot();
 
 		//if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
 
-		switch (_storage.operation) {
-		case _runShootemup:
-			run("seu.avx", _jsb, _bflight, Normal);
+		switch (_storage._operation) {
+		case kRunShootemup:
+			run("seu.avx", kJsb, kBflight, kNormal);
 			break;
-		case _runDosshell:
-			dos_shell();
+		case kRunDosshell:
+			dosShell();
 			break;
-		case _runGhostroom:
-			run("g-room.avx", _jsb, _no_bflight, Normal);
+		case kRunGhostroom:
+			run("g-room.avx", kJsb, kNoBflight, kNormal);
 			break;
-		case _runGolden:
-			run("golden.avx", _jsb, _bflight, Musical);
+		case kRunGolden:
+			run("golden.avx", kJsb, kBflight, kMusical);
 			break;
 		}
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 6b62ad7..f8f2ce1 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -150,70 +150,70 @@ private:
 
 	// From bootstrp:
 
-	enum elm {Normal, Musical, Elmpoyten, Regi};
+	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
 
-	static const int16 _runShootemup = 1, _runDosshell = 2, _runGhostroom = 3, _runGolden = 4;
+	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
 
-	static const char runcodes[2][3];
+	static const char kRuncodes[2][3];
 
-	static const int16 _reset_ = 0;
+	static const int16 kReset = 0;
 
-	static const bool _jsb = true, _no_jsb = false, _bflight = true, _no_bflight = false;
+	static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false;
 
 	struct {
-		byte operation;
-		uint16 skellern;
-		byte contents[1000];
+		byte _operation;
+		uint16 _skellern;
+		byte _contents[1000];
 	} _storage;
 
-	Common::String arguments, demo_args, args_with_no_filename;
+	Common::String _arguments, _demoArgs, _argsWithNoFilename;
 
-	bool first_time;
+	bool _firstTime;
 
-	byte original_mode;
-	void *old_1c;
+	byte _originalMode;
+	byte *_old1c;
 
-	Common::String segofs;
+	Common::String _segofs;
 
-	bool zoomy;
+	bool _zoomy;
 
-	int32 soundcard, speed, baseaddr, irq, dma;
+	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
 
-	void cursor_off();
+	void cursorOff();
 
-	void cursor_on();
+	void cursorOn();
 
 	void quit();
 
-	Common::String command_com();
+	Common::String commandCom();
 
 	void explain(byte error);
 
-	void b_flight();
+	void bFlight();
 
-	void bflight_on();
+	void bFlightOn();
 
-	void bflight_off();
+	void bFlightOff();
 
-	Common::String elm2str(elm how);
+	Common::String elm2Str(Elm how);
 
-	void run(Common::String what, bool with_jsb, bool with_bflight, elm how);
+	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
 
-	void get_arguments();
+	void getArguments();
 
-	void get_slope();
+	void getSlope();
 
-	void call_menu();
+	void callMenu();
 
-	void run_avalot();
+	void runAvalot();
 
-	void run_the_demo();
+	void runDemo();
 
-	void dos_shell();
+	void dosShell();
 
-	bool keypressed1();
+	bool keyPressed();
 
-	void flush_buffer();
+	void flushBuffer();
 
 	void demo();
 };


Commit: 74979869ff22d0c22be2f0d774e3ce6974302d38
    https://github.com/scummvm/scummvm/commit/74979869ff22d0c22be2f0d774e3ce6974302d38
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T06:35:09-07:00

Commit Message:
AVALANCHE: Rename/refactor Acci. Implement Acci::peopleInRoom().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index fb024ae..1f455ec 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -47,54 +47,48 @@
 #include <cmath>
 
 
-/*#include "NimUnit.h"*/
-/*#include "Highs.h"*/
-/*#include "Helper.h"*/
 
 namespace Avalanche {
 
-const Acci::vocab Acci::words[nowords] = {
-		/* Verbs, 1-49 */
-	{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
-	{2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
-	{3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
-	{4, "TAKE"},      {4, "GET"},       {4, "PICK"},
-	{5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
-	{7, "SAY"},       {7, "ASK"},
-	{8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
-	{9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
-	{11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
-	{13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
-	{15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
+const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
+	// Verbs: 1-49
+	{1, "EXAMINE"},      {1, "READ"},      {1, "XAM"}, // short
+	{2, "OPEN"},         {2, "LEAVE"},     {2, "UNLOCK"},
+	{3, "PAUSE"},        {47, "TA"}, // Early to avoid Take and Talk.
+	{4, "TAKE"},         {4, "GET"},       {4, "PICK"},
+	{5, "DROP"},         {6, "INVENTORY"}, {7, "TALK"},
+	{7, "SAY"},          {7, "ASK"},
+	{8, "GIVE"},         {9, "DRINK"},     {9, "IMBIBE"},
+	{9, "DRAIN"},        {10, "LOAD"},     {10, "RESTORE"},
+	{11, "SAVE"},        {12, "BRIBE"},    {12, "PAY"},
+	{13, "LOOK"},        {14, "BREAK"},    {15, "QUIT"},
+	{15, "EXIT"},        {16, "SIT"},      {16, "SLEEP"},
 	{17, "STAND"},
-
-	{18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
+	{18, "GO"},          {19, "INFO"},      {20, "UNDRESS"},
 	{20, "DOFF"},
-	{21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
+	{21, "DRESS"},       {21, "WEAR"},      {21, "DON"},
 	{22, "PLAY"},
-	{22, "STRUM"},     {23, "RING"},      {24, "HELP"},
-	{25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
-	{255, "NINET"},    /* block for NINETY */
-	{28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
+	{22, "STRUM"},       {23, "RING"},      {24, "HELP"},
+	{25, "KENDAL"},      {26, "CAPYBARA"},  {27, "BOSS"},
+	{255, "NINET"}, // block for NINETY
+	{28, "URINATE"},     {28, "MINGITE"},   {29, "NINETY"},
 	{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
-	{30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
-	{30, "WIZZY"},     {30, "PLOVER"},
+	{30, "HOCUS"},       {30, "POCUS"},     {30, "IZZY"},
+	{30, "WIZZY"},       {30, "PLOVER"},
 	{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
-	{30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
-	{30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
-	{30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
+	{30, "THURB"},       {30, "SNOEZE"},    {30, "SAMOHT"},
+	{30, "NOSIDE"},      {30, "PHUGGG"},    {30, "KNERL"},
+	{30, "MAGIC"},       {30, "KLAETU"},    {30, "VODEL"},
 	{30, "BONESCROLLS"}, {30, "RADOF"},
-
 	{31, "RESTART"},
-	{32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
-	{33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
-	{34, "ORDER"},     {34, "DEMAND"},
-	{35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
-	{35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
+	{32, "SWALLOW"},     {32, "EAT"},       {33, "LISTEN"},
+	{33, "HEAR"},        {34, "BUY"},       {34, "PURCHASE"},
+	{34, "ORDER"},       {34, "DEMAND"},
+	{35, "ATTACK"},      {35, "HIT"},       {35, "KILL"},
+	{35, "PUNCH"},       {35, "KICK"},      {35, "SHOOT"},
 	{35, "FIRE"},
 
-	/* Passwords, 36: */
-
+	// Passwords: 36
 	{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
 	{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
 	{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
@@ -105,7 +99,6 @@ const Acci::vocab Acci::words[nowords] = {
 	{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
 	{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
 	{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
-
 	{37, "DIR"},       {37, "LS"},        {38, "DIE"},
 	{39, "SCORE"},
 	{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
@@ -113,105 +106,98 @@ const Acci::vocab Acci::words[nowords] = {
 	{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
 	{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
 	{46, "HELLO"},     {46, "HI"},        {46, "YO"},
-	{47, "THANKS"},       /* = 47, "ta", which was defined earlier. */
+	{47, "THANKS"}, // = 47, "ta", which was defined earlier.
 
-
-	/* Nouns - Objects: 50-100. */
-
-	{50, "WINE"},      {50, "BOOZE"},    {50, "NASTY"},
-	{50, "VINEGAR"},   {51, "MONEYBAG"},
-	{51, "BAG"},       {51, "CASH"},     {51, "DOSH"},
+	// Nouns - Objects: 50-100
+	{50, "WINE"},       {50, "BOOZE"},    {50, "NASTY"},
+	{50, "VINEGAR"},    {51, "MONEYBAG"},
+	{51, "BAG"},        {51, "CASH"},     {51, "DOSH"},
 	{51, "WALLET"},
-	{52, "BODKIN"},    {52, "DAGGER"},   {53, "POTION"},
-	{54, "CHASTITY"},  {54, "BELT"},     {55, "BOLT"},
-	{55, "ARROW"},     {55, "DART"},
-	{56, "CROSSBOW"},  {56, "BOW"},      {57, "LUTE"},
-	{58, "PILGRIM"},   {58, "BADGE"},    {59, "MUSHROOMS"},
+	{52, "BODKIN"},     {52, "DAGGER"},   {53, "POTION"},
+	{54, "CHASTITY"},   {54, "BELT"},     {55, "BOLT"},
+	{55, "ARROW"},      {55, "DART"},
+	{56, "CROSSBOW"},   {56, "BOW"},      {57, "LUTE"},
+	{58, "PILGRIM"},    {58, "BADGE"},    {59, "MUSHROOMS"},
 	{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
-	{62, "PRESCRIPT"}, {62, "SCROLL"},   {62, "MESSAGE"},
-	{63, "PEN"},       {63, "QUILL"},    {64, "INK"},
-	{64, "INKPOT"},    {65, "CLOTHES"},  {66, "HABIT"},
-	{66, "DISGUISE"},  {67, "ONION"},
-
+	{62, "PRESCRIPT"},  {62, "SCROLL"},   {62, "MESSAGE"},
+	{63, "PEN"},        {63, "QUILL"},    {64, "INK"},
+	{64, "INKPOT"},     {65, "CLOTHES"},  {66, "HABIT"},
+	{66, "DISGUISE"},   {67, "ONION"},
 	{99, "PASSWORD"},
 
-	/* Objects from Also are placed between 101 and 131. */
+	// Objects from Also are placed between 101 and 131.
 
-	/* Nouns - People - Male, 150-174 */
-	{150, "AVVY"},      {150, "AVALOT"},    {150, "YOURSELF"},
-	{150, "ME"},        {150, "MYSELF"},    {151, "SPLUDWICK"},
-	{151, "THOMAS"},    {151, "ALCHEMIST"}, {151, "CHEMIST"},
-	{152, "CRAPULUS"},  {152, "SERF"},      {152, "SLAVE"},
-	{158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
-	{152, "CRAPPY"},    {153, "DUCK"},      {153, "DOCTOR"},
+	// Nouns - People - Male: 150-174
+	{150, "AVVY"},       {150, "AVALOT"},    {150, "YOURSELF"},
+	{150, "ME"},         {150, "MYSELF"},    {151, "SPLUDWICK"},
+	{151, "THOMAS"},     {151, "ALCHEMIST"}, {151, "CHEMIST"},
+	{152, "CRAPULUS"},   {152, "SERF"},      {152, "SLAVE"},
+	{158, "DU"}, // <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.
+	{152, "CRAPPY"},     {153, "DUCK"},      {153, "DOCTOR"},
 	{154, "MALAGAUCHE"},
-	{155, "FRIAR"},     {155, "TUCK"},      {156, "ROBIN"},
-	{156, "HOOD"},      {157, "CWYTALOT"},  {157, "GUARD"},
+	{155, "FRIAR"},      {155, "TUCK"},      {156, "ROBIN"},
+	{156, "HOOD"},       {157, "CWYTALOT"},  {157, "GUARD"},
 	{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
-	{159, "DUKE"},      {159, "GRACE"},     {160, "DOGFOOD"},
-	{160, "MINSTREL"},  {161, "TRADER"},    {161, "SHOPKEEPER"},
+	{159, "DUKE"},       {159, "GRACE"},     {160, "DOGFOOD"},
+	{160, "MINSTREL"},   {161, "TRADER"},    {161, "SHOPKEEPER"},
 	{161, "STALLHOLDER"},
-	{162, "PILGRIM"},   {162, "IBYTHNETH"}, {163, "ABBOT"},
-	{163, "AYLES"},     {164, "PORT"},      {165, "SPURGE"},
-	{166, "JACQUES"},   {166, "SLEEPER"},   {166, "RINGER"},
+	{162, "PILGRIM"},    {162, "IBYTHNETH"}, {163, "ABBOT"},
+	{163, "AYLES"},      {164, "PORT"},      {165, "SPURGE"},
+	{166, "JACQUES"},    {166, "SLEEPER"},   {166, "RINGER"},
 
-	/* Nouns- People - Female: 175-199 */
+	// Nouns - People - Female: 175-199
 	{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
 	{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
 	{178, "WITCH"},
 
-	/* Pronouns, 200-224 */
+	// Pronouns: 200-224
 	{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
 	{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
 	{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
 	{202, "IT"},        {202, "THING"},
+	{203, "MONK"},      {204, "BARMAN"},    {204, "BARTENDER"},
 
-	{203, "MONK"},       {204, "BARMAN"},    {204, "BARTENDER"},
-
-	/* Prepositions, 225-249 */
+	// Prepositions: 225-249
 	{225, "TO"},        {226, "AT"},        {227, "UP"},
 	{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
 	{230, "UP"},        {231, "DOWN"},      {232, "ON"},
 
-
-	/* Please, 251 */
+	// Please: 251
 	{251, "PLEASE"},
 
-	/* About, 252 */
+	// About: 252
 	{252, "ABOUT"}, {252, "CONCERNING"},
 
-	/* Swear words, 253 */
-	/*              I M P O R T A N T    M E S S A G E
+	// Swear words: 253
+	/*		  I M P O R T A N T    M E S S A G E
 
-		DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
-		DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
-		GOODNESS KNOWS WHO WROTE THEM.
-		READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
-		WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+	DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+	DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+	GOODNESS KNOWS WHO WROTE THEM.
+	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
 
 	{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
 	{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
 	{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
 	{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
 	{253, "SMEG"},
-	/* and other even ruder words. You didn't read them, did you? Good. */
+	// ...and other even ruder words. You didn't read them, did you? Good. */
 
-	/* Answer-back smart-alec words, 249 */
+	// Answer-back smart-alec words: 249
 	{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},
 
-	/* Noise words, 255 */
+	// Noise words: 255
 	{255, "THE"},       {255, "A"},         {255, "NOW"},
 	{255, "SOME"},      {255, "AND"},       {255, "THAT"},
 	{255, "POCUS"},     {255, "HIS"},
-	{255, "THIS"},      {255, "SENTINEL"}
-	
-};        /* for "Ken SENT Me" */
+	{255, "THIS"},      {255, "SENTINEL"} // for "Ken SENT Me"
+};        
 
+const char Acci::kWhat[] = "That's not possible!";
 
-const char Acci::what[] = "That's not possible!";
-
-const Acci::ranktype Acci::ranks[9] = {
-	{0, "Beginner"},    {10, "Novice"},
+const Acci::RankType Acci::kRanks[9] = {
+	{0, "Beginner"},     {10, "Novice"},
 	{20, "Improving"},   {35, "Not bad"},
 	{50, "Passable"},    {65, "Good"},
 	{80, "Experienced"}, {108, "The BEST!"},
@@ -227,74 +213,57 @@ void Acci::init() {
 	_vm->_gyro->weirdword = false;
 }
 
-void Acci::clearwords() {
+void Acci::clearWords() {
 	for (byte i = 0; i < 11; i++)
-		if (!realwords[i].empty())
-			realwords[i].clear();
+		if (!_realWords[i].empty())
+			_realWords[i].clear();
 }
 
-byte Acci::wordnum(Common::String x) {
-	if (x.empty())
+byte Acci::wordNum(Common::String word) {
+	if (word.empty())
 		return 0;
 	
-	for (int32 fv = nowords - 1; fv >= 0; fv--) 
-		if (words[fv].w == x)
-			return words[fv].n;
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) 
+		if (kVocabulary[i]._word == word)
+			return kVocabulary[i]._number;
 
 	// If not found as a whole, we look for it as a substring.
-	for (int32 fv = nowords - 1; fv >= 0; fv--) 
-		if (Common::String(words[fv].w.c_str(), x.size()) == x)
-			return words[fv].n;
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) 
+		if (Common::String(kVocabulary[i]._word.c_str(), word.size()) == word)
+			return kVocabulary[i]._number;
 
-	return pardon;
+	return kPardon;
 }
 
-void Acci::replace(Common::String old1, byte new1) {
-	int16 q = _vm->_parser->pos(old1, thats);
-	while (q != -1) {
-		if (new1 == 0)
-			thats.deleteChar(q);
+void Acci::replace(Common::String oldChars, byte newChar) {
+	int16 pos = _vm->_parser->pos(oldChars, _thats);
+	while (pos != -1) {
+		if (newChar == 0)
+			_thats.deleteChar(pos);
 		else {
-			for (byte i = q; i < q + old1.size(); i++)
-				thats.deleteChar(q);
-			thats.insertChar(new1, q);
+			for (byte i = pos; i < pos + oldChars.size(); i++)
+				_thats.deleteChar(pos);
+			_thats.insertChar(newChar, pos);
 		}
-		q = _vm->_parser->pos(old1, thats);
+		pos = _vm->_parser->pos(oldChars, _thats);
 	}
 }
 
-/*procedure ninetydump;
-var f:file; y:int16; bit:byte; a:byte absolute $A000:800;
-begin
-	off;
-	assign(f,'avvydump.avd');
-	rewrite(f,1);
-	blockwrite(f,_vm->_gyro->dna,177); { just anything }
-	for bit:=0 to 3 do
-	begin
-	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1 shl bit; port[$3CF]:=bit;
-	blockwrite(f,a,12080);
-	end;
-	close(f); on;
-	_vm->_scrolls->display('Dumped.');
-end;*/
-
 Common::String Acci::rank() {
-	for (byte fv = 0; fv < 8; fv++) {
-		if ((_vm->_gyro->dna.score >= ranks[fv].score) && (_vm->_gyro->dna.score < ranks[fv + 1].score)) {
-			return ranks[fv].title;
+	for (byte i = 0; i < 8; i++) {
+		if ((_vm->_gyro->dna.score >= kRanks[i]._score) && (_vm->_gyro->dna.score < kRanks[i + 1]._score)) {
+			return kRanks[i]._title;
 		}
 	}
 	return "";
 }
 
-Common::String Acci::totaltime() {
-	const double ticks_in_1_sec = (double)(65535) / 3600;
+Common::String Acci::totalTime() {
+	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
+	const double ticksInOneSec = (double)(65535) / 3600; 
 	uint16 h, m, s;
-	Common::String a;
 
-	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	h = _vm->_gyro->dna.total_time / ticks_in_1_sec; // No. of seconds.
+	h = _vm->_gyro->dna.total_time / ticksInOneSec; // No. of seconds.
 	if (h < 0)
 		h = ceil((float)h);
 	else
@@ -304,14 +273,12 @@ Common::String Acci::totaltime() {
 	s = m % 60;
 	m = m / 60;
 
-	a = "You've been playing for ";
+	Common::String result = "You've been playing for ";
 	if (h > 0)
-		a = a + _vm->_gyro->strf(h) + " hours, ";
+		result = result + _vm->_gyro->strf(h) + " hours, ";
 	if ((m > 0) || (h != 0))
-		a = a + _vm->_gyro->strf(m) + " minutes and ";
-	a = a + _vm->_gyro->strf(s) + " seconds.";
-
-	return a;
+		result = result + _vm->_gyro->strf(m) + " minutes and ";
+	return result + _vm->_gyro->strf(s) + " seconds.";
 }
 
 
@@ -320,67 +287,69 @@ void Acci::number(Common::String &codes) {
 	warning("STUB: Acci::number()");
 }
 
-void Acci::cheatparse(Common::String codes) {
+void Acci::cheatParse(Common::String codes) {
 	uint16 num;
 	int16 e;
 
 	char cmd;
 	int16 se, sx, sy;
 
-	warning("STUB: Acci::cheatparse()");
+	warning("STUB: Acci::cheatParse()");
 }
 
-void Acci::punctustrip(Common::String &x) {        /* Strips punctuation from x. */
+
+
+void Acci::stripPunctuation(Common::String &word) {
 	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
 
-	for (byte fv = 0; fv < 32; fv++)
+	for (byte i = 0; i < 32; i++)
 		do {
-			int16 p = _vm->_parser->pos(Common::String(punct[fv]), x);
-			if (p == -1)
+			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
+			if (pos == -1)
 				break;
-			x.deleteChar(p);
+			word.deleteChar(pos);
 		} while (true);
 }
 
 
 
-void Acci::displaywhat(byte ch, bool animate, bool &ambigous) { /* << it's an adjective! */
-	if (ch == pardon) {
-		ambigous = true;
+void Acci::displayWhat(byte target, bool animate, bool &ambiguous) { 
+	if (target == kPardon) {
+		ambiguous = true;
 		if (animate)
 			_vm->_scrolls->display("Whom?");
 		else
 			_vm->_scrolls->display("What?");
 	} else {
 		if (animate)
-			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getname(ch) + " }");
+			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getname(target) + " }");
 		else {
-			Common::String z = _vm->_gyro->get_better(ch);
+			Common::String z = _vm->_gyro->get_better(target);
 			if (z != "") 
 				_vm->_scrolls->display(Common::String("{ ") + z + " }");
 		}
 	}
 }
 
-bool Acci::do_pronouns() {
+bool Acci::doPronouns() {
 	bool ambiguous = false;
 
-	for (byte fv = 0; fv < thats.size(); fv++) {
-		byte word = thats[fv];
-		switch (word) {
+	for (byte i = 0; i < _thats.size(); i++) {
+		byte wordCode = _thats[i];
+		switch (wordCode) {
 		case 200: {
-			displaywhat(_vm->_gyro->him, true, ambiguous);
-			thats.setChar(_vm->_gyro->him, fv);
+			displayWhat(_vm->_gyro->him, true, ambiguous);
+			_thats.setChar(_vm->_gyro->him, i);
 			}
 			break;
 		case 201: {
-			displaywhat(_vm->_gyro->her, true, ambiguous);
-			thats.setChar(_vm->_gyro->her, fv);
+			displayWhat(_vm->_gyro->her, true, ambiguous);
+			_thats.setChar(_vm->_gyro->her, i);
 			}
 			break;
 		case 202: {
-			displaywhat(_vm->_gyro->it, false, ambiguous);
-			thats.setChar(_vm->_gyro->it, fv);
+			displayWhat(_vm->_gyro->it, false, ambiguous);
+			_thats.setChar(_vm->_gyro->it, i);
 			}
 			break;
 		}
@@ -391,12 +360,8 @@ bool Acci::do_pronouns() {
 
 
 
-void Acci::lowercase() {
+void Acci::properNouns() {
 	_vm->_parser->_inputText.toLowercase();
-}
-
-void Acci::propernouns() {
-	lowercase();
 
 	// We set every word's first character to uppercase.
 	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++)
@@ -406,50 +371,50 @@ void Acci::propernouns() {
 	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
 }
 
-void Acci::sayit() { /* This makes Avalot say the response. */
+void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
 	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x 
 		+ '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2');
 }
 
-void Acci::store_interrogation(byte interrogation) {
+void Acci::storeInterrogation(byte interrogation) {
 	if (_vm->_parser->_inputText.empty())
 		return;
 
-	/* Strip _vm->_parser->_inputText: */
+	// Strip _vm->_parser->_inputText:
 	while ((_vm->_parser->_inputText[0] == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteChar(0);
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
 	
-	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // if you want to use any other timer, put this into the case statement. */
+	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
 	case 1: {
-			lowercase();
-			sayit();
+			_vm->_parser->_inputText.toLowercase();
+			sayIt();
 			_vm->_gyro->dna.like2drink = _vm->_parser->_inputText;
 			_vm->_gyro->dna.cardiff_things = 2;
 		}
 		break;
 	case 2: {
-			propernouns();
-			sayit();
+			properNouns();
+			sayIt();
 			_vm->_gyro->dna.favourite_song = _vm->_parser->_inputText;
 			_vm->_gyro->dna.cardiff_things = 3;
 		}
 		break;
 	case 3: {
-			propernouns();
-			sayit();
+			properNouns();
+			sayIt();
 			_vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText;
 			_vm->_gyro->dna.cardiff_things = 4;
 		}
 		break;
 	case 4: {
-			lowercase();
-			sayit();
+			_vm->_parser->_inputText.toLowercase();
+			sayIt();
 			if (!_vm->_gyro->dna.spare_evening.empty())
 				_vm->_gyro->dna.spare_evening.clear();
 			_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
@@ -472,73 +437,64 @@ void Acci::store_interrogation(byte interrogation) {
 
 
 
-void Acci::clearuint16s() {
-	warning("STUB: Acci::clearuint16s()");
-}
-
 void Acci::parse() {
-	byte n, fv, ff;
-	Common::String c, cc, thisword;
-	byte answer;
-	bool notfound;
-
 	// First parsing - word identification
-
-	if (!thats.empty())
-		thats.clear();
-	c = _vm->_parser->_inputText + ' ';
-	n = 0;
-	polite = false;
-	verb = pardon;
-	thing = pardon;
-	thing2 = pardon;
-	person = pardon;
-	clearwords();
+	if (!_thats.empty())
+		_thats.clear();
+	
+	byte n = 0;
+	_polite = false;
+	_verb = kPardon;
+	_thing = kPardon;
+	_thing2 = kPardon;
+	_person = kPardon;
+	clearWords();
 
 
 	// A cheat mode attempt.
 	if (_vm->_parser->_inputText[0] == '.') {
-		cheatparse(_vm->_parser->_inputText);
-		thats = nowt;
+		cheatParse(_vm->_parser->_inputText);
+		_thats = kNothing;
 		return;
 	}
 
 	// Are we being interrogated right now?
 	if (_vm->_gyro->interrogation > 0) {
-		store_interrogation(_vm->_gyro->interrogation);
+		storeInterrogation(_vm->_gyro->interrogation);
 		_vm->_gyro->weirdword = true;
 		return;
 	}
 
 	// Actually process the command.
-	cc = c;
-	c.toUppercase();
-	while (!c.empty()) {
-		while ((!c.empty()) && (c[0] == ' ')) {
-			c.deleteChar(0);
-			cc.deleteChar(0);
+	Common::String inputText = _vm->_parser->_inputText + ' ';
+	Common::String inputTextUpper = inputText;
+	inputTextUpper.toUppercase();
+	while (!inputTextUpper.empty()) {
+		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
+			inputTextUpper.deleteChar(0);
+			inputText.deleteChar(0);
 		}
-		if (c.empty())
+		if (inputTextUpper.empty())
 			break;
 
 		// Get the following word of the strings.
-		byte size = _vm->_parser->pos(Common::String(' '), c) + 1;
+		byte size = _vm->_parser->pos(Common::String(' '), inputTextUpper) + 1;
 		char *subStr = new char[size];
-		Common::strlcpy(subStr, c.c_str(), size);
-		thisword = subStr;
-		Common::strlcpy(subStr, cc.c_str(), size);
-		realwords[n] = subStr;
+		Common::strlcpy(subStr, inputTextUpper.c_str(), size);
+		Common::String thisword = subStr;
+		Common::strlcpy(subStr, inputText.c_str(), size);
+		_realWords[n] = subStr;
 		delete[] subStr;
 
-		punctustrip(c);
+		stripPunctuation(inputTextUpper);
 
-		notfound = true;
+		bool notfound = true;
 
 		// Check also[] first, which conatins words about the actual room.
 		if (!thisword.empty()) {
-			for (ff = 0; ff < 31; ff++) {
-				if ((_vm->_gyro->also[ff][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->also[ff][0]) > -1)) {
-					thats = thats + Common::String(99 + ff);
+			for (byte i = 0; i < 31; i++) {
+				if ((_vm->_gyro->also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->also[i][0]) > -1)) {
+					_thats = _thats + Common::String(99 + i);
 					notfound = false;
 				}
 			}
@@ -546,31 +502,31 @@ void Acci::parse() {
 
 		// Check Accis's own table (words[]) for "global" commands.
 		if (notfound) {
-			answer = wordnum(thisword);
-			if (answer == pardon) {
+			byte answer = wordNum(thisword);
+			if (answer == kPardon) {
 				notfound = true;
-				thats = thats + pardon;
+				_thats = _thats + kPardon;
 			} else
-				thats = thats + answer;
+				_thats = _thats + answer;
 			n++;
 		}
 
 		// Delete words we already processed.
-		int16 spacePos = _vm->_parser->pos(Common::String(' '), c);
+		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
 		if (spacePos > -1)
 			for (byte i = 0; i <= spacePos; i++)
-				c.deleteChar(0);
-		spacePos = _vm->_parser->pos(Common::String(' '), cc);
+				inputTextUpper.deleteChar(0);
+		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
 		if (spacePos > -1)
 			for (byte i = 0; i <= spacePos; i++)
-				cc.deleteChar(0);
+				inputText.deleteChar(0);
 	}
 
-	if (_vm->_parser->pos(Common::String(254), thats) > -1) 
-		unknown = realwords[_vm->_parser->pos(Common::String(254), thats)];
+	if (_vm->_parser->pos(Common::String(254), _thats) > -1) 
+		_unknown = _realWords[_vm->_parser->pos(Common::String(254), _thats)];
 	else
-		if (!unknown.empty())
-			unknown.clear();
+		if (!_unknown.empty())
+			_unknown.clear();
 
 	// Replace words' codes that mean the same.
 	replace(Common::String(255), 0); /* zap noise words */
@@ -584,7 +540,7 @@ void Acci::parse() {
 	replace(Common::String(40) + 232, 21); // "put on" = "don"
 	replace(Common::String(4) + 229, 20); // "take off" = "doff"
 
-	// Words that could mean more than one person
+	// Words that could mean more than one _person
 	if (_vm->_gyro->dna.room == r__nottspub)
 		replace(Common::String(204), 164); // Barman = Port
 	else
@@ -601,9 +557,9 @@ void Acci::parse() {
 		replace(Common::String(203), 162); // Monk = Ibythneth
 	}
 	
-	if (do_pronouns()) {
+	if (doPronouns()) {
 		_vm->_gyro->weirdword = true;
-		thats = nowt;
+		_thats = kNothing;
 		return;
 	}
 
@@ -612,67 +568,67 @@ void Acci::parse() {
 		_vm->_gyro->subject.clear();
 	_vm->_gyro->subjnumber = 0; // Find subject of conversation.
 	
-	fv = 0;
-	while ((fv < 11) && !realwords[fv].empty()) {
-		if ((realwords[fv][0] == '\'') || (realwords[fv][0] == '\"')) {
-			_vm->_gyro->subjnumber = (byte)thats[fv];
-			thats.setChar(moved, fv);
+	byte i = 0;
+	while ((i < 11) && !_realWords[i].empty()) {
+		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
+			_vm->_gyro->subjnumber = (byte)_thats[i];
+			_thats.setChar(kMoved, i);
 			break;
 		}
-		fv++;
+		i++;
 	}
 
-	if ((_vm->_gyro->subjnumber == 0) && !thats.empty()) // Still not found.
-		for (fv = 0; fv < thats.size() - 1; fv++)
-			if ((byte)thats[fv] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->subjnumber = (byte)thats[fv + 1];
-				thats.setChar(0, fv + 1);
+	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) // Still not found.
+		for (i = 0; i < _thats.size() - 1; i++)
+			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
+				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
 				break;
 			}
 
-	if ((_vm->_gyro->subjnumber == 0) && !thats.empty())// STILL not found! Must be the word after "say".
-		for (fv = 0; fv < thats.size() - 1; fv++)
-			if (((byte)thats[fv] == 7) && ((byte)thats[fv + 1] != 0) && !((225 <= (byte)thats[fv + 1]) && ((byte)thats[fv + 1] <= 229))) {
+	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty())// STILL not found! Must be the word after "say".
+		for (i = 0; i < _thats.size() - 1; i++)
+			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
-				_vm->_gyro->subjnumber = (byte)thats[fv + 1];
-				thats.setChar(0, fv + 1);
+				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
 				break;
 			}
 
-	for (int8 fv = thats.size() - 1; fv >= 0; fv--) // Reverse order, so first will be used.
-		if (((byte)thats[fv] == 253) || ((byte)thats[fv] == 249) || ((1 <= (byte)thats[fv]) && ((byte)thats[fv] <= 49)))
-			verb = (byte)thats[fv];
-		else if ((50 <= (byte)thats[fv]) && ((byte)thats[fv] <= 149)) {
-			thing2 = thing;
-			thing = (byte)thats[fv];
-		} else if ((150 <= (byte)thats[fv]) && ((byte)thats[fv] <= 199))
-			person = (byte)thats[fv];
-		else if ((byte)thats[fv] == 251)
-			polite = true;
-
-		if ((!unknown.empty()) && (verb != vb_exam) && (verb != vb_talk) && (verb != vb_save) && (verb != vb_load) && (verb != vb_dir)) {
-				_vm->_scrolls->display(Common::String("Sorry, but I have no idea what \"") + unknown + "\" means. Can you rephrase it?");
+	for (int8 i = _thats.size() - 1; i >= 0; i--) // Reverse order, so first will be used.
+		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
+			_verb = (byte)_thats[i];
+		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
+			_thing2 = _thing;
+			_thing = (byte)_thats[i];
+		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
+			_person = (byte)_thats[i];
+		else if ((byte)_thats[i] == 251)
+			_polite = true;
+
+		if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+				_vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
 				_vm->_gyro->weirdword = true;
 		} else
 			_vm->_gyro->weirdword = false;
 
-	if (thats.empty())
-		thats = nowt;
+	if (_thats.empty())
+		_thats = kNothing;
 
-	if (thing != pardon)
-		_vm->_gyro->it = thing;
+	if (_thing != kPardon)
+		_vm->_gyro->it = _thing;
 
-	if (person != pardon)
-		if (person < 175)
-			_vm->_gyro->him = person;
+	if (_person != kPardon)
+		if (_person < 175)
+			_vm->_gyro->him = _person;
 		else
-			_vm->_gyro->her = person;
+			_vm->_gyro->her = _person;
 }
 
-void Acci::examobj() {   
-	if (thing != _vm->_gyro->thinks)
-		_vm->_lucerna->thinkabout(thing, _vm->_gyro->a_thing);
-	switch (thing) {
+void Acci::examineObject() {   
+	if (_thing != _vm->_gyro->thinks)
+		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->a_thing);
+	switch (_thing) {
 	case _vm->_gyro->wine :
 		switch (_vm->_gyro->dna.winestate) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
@@ -693,15 +649,15 @@ void Acci::examobj() {
 			_vm->_visa->dixi('t', 18);  // Normal onion scroll
 		break;       
 	default:
-		_vm->_visa->dixi('t', thing); // <<< Ordinarily
+		_vm->_visa->dixi('t', _thing); // <<< Ordinarily
 	}
 }
 
-bool Acci::personshere() { // Person equivalent of "holding".
-	if ((person == pardon) || (person == 0) || (_vm->_gyro->whereis[person - 150] == _vm->_gyro->dna.room))
+bool Acci::isPersonHere() { // Person equivalent of "holding".
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->whereis[_person - 150] == _vm->_gyro->dna.room))
 		return true;
 	else {
-		if (person < 175)
+		if (_person < 175)
 			_vm->_scrolls->display(Common::String('H') + _vm->_scrolls->kControlToBuffer);
 		else
 			_vm->_scrolls->display(Common::String("Sh") + _vm->_scrolls->kControlToBuffer);
@@ -711,11 +667,11 @@ bool Acci::personshere() { // Person equivalent of "holding".
 }
 
 void Acci::exampers() {
-	if (personshere()) {
-		if (thing != _vm->_gyro->thinks)
-			_vm->_lucerna->thinkabout(person, _vm->_gyro->a_person);
-		person -= 149;
-		switch (person) { /* Special cases */
+	if (isPersonHere()) {
+		if (_thing != _vm->_gyro->thinks)
+			_vm->_lucerna->thinkabout(_person, _vm->_gyro->a_person);
+		_person -= 149;
+		switch (_person) { /* Special cases */
 		case 11:
 			if (_vm->_gyro->dna.wonnim) {
 				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
@@ -730,23 +686,23 @@ void Acci::exampers() {
 			break;
 		}
 		// Otherwise...
-		_vm->_visa->dixi('p', person);
+		_vm->_visa->dixi('p', _person);
 	} 
 	
 	// And afterwards...
-	if ((person == 14) && (!_vm->_gyro->dna.ayles_is_awake))
+	if ((_person == 14) && (!_vm->_gyro->dna.ayles_is_awake))
 		_vm->_visa->dixi('Q', 13);
 }
 
 bool Acci::holding() {
-	if ((51 <= thing) && (thing <= 99)) // Also.
+	if ((51 <= _thing) && (_thing <= 99)) // Also.
 		return true;
 
 	bool holdingResult = false;
 
-	if (thing > 100)
+	if (_thing > 100)
 		_vm->_scrolls->display("Be reasonable!");
-	else if (!_vm->_gyro->dna.obj[thing - 1])  // Verbs that need "thing" to be in the inventory.
+	else if (!_vm->_gyro->dna.obj[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_scrolls->display("You're not holding it, Avvy.");
 	else 
 		holdingResult = true;
@@ -756,8 +712,8 @@ bool Acci::holding() {
 
 
 
-void Acci::openBox(bool before) {
-	if ((_vm->_gyro->dna.room == r__yours) && (thing == 54)) {
+void Acci::openBox(bool isOpening) {
+	if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) {
 		_vm->_celer->show_one(-1, -1, 5);
 
 		_vm->_celer->pics_link();
@@ -766,7 +722,7 @@ void Acci::openBox(bool before) {
 
 		_vm->_system->delayMillis(55);
 
-		if (!before) {
+		if (!isOpening) {
 			_vm->_celer->show_one(-1, -1, 6);
 			_vm->_celer->pics_link();
 			_vm->_trip->trippancy_link();
@@ -776,41 +732,41 @@ void Acci::openBox(bool before) {
 }
 
 void Acci::examine() {
-	// EITHER it's an object OR it's an Also OR it's a person OR it's something else.
-	if ((person == pardon) && (thing != pardon)) {
+	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
+	if ((_person == kPardon) && (_thing != kPardon)) {
 		if (holding()) {
 			// Remember: it's been Slipped! Ie subtract 49.
-			if ((1 <= thing) && (thing <= 49)) // Standard object
-				examobj();
-			else if ((50 <= thing) && (thing <= 100)) { // Also thing
+			if ((1 <= _thing) && (_thing <= 49)) // Standard object
+				examineObject();
+			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_scrolls->display(*_vm->_gyro->also[thing - 50][1]);
+				_vm->_scrolls->display(*_vm->_gyro->also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
-	} else if (person != pardon)
+	} else if (_person != kPardon)
 		exampers();
 	else _vm->_scrolls->display("It's just as it looks on the picture.");  // Don't know: guess.
 }
 
 
 
-void Acci::inv() {   /* the time-honoured command... */
-	byte q = 0;
+void Acci::inventory() {
+	byte itemNum = 0;
 	_vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
 	{
-		for (byte fv = 0; fv < numobjs; fv++)
-			if (_vm->_gyro->dna.obj[fv]) {
-				q++;
-				if (q == _vm->_gyro->dna.carrying)
+		for (byte i = 0; i < numobjs; i++)
+			if (_vm->_gyro->dna.obj[i]) {
+				itemNum++;
+				if (itemNum == _vm->_gyro->dna.carrying)
 					_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-				_vm->_scrolls->display(_vm->_gyro->get_better(fv + 1) + _vm->_scrolls->kControlToBuffer);
-				if ((fv + 1) == _vm->_gyro->dna.wearing)
+				_vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer);
+				if ((i + 1) == _vm->_gyro->dna.wearing)
 					_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
-				if (q < _vm->_gyro->dna.carrying)
+				if (itemNum < _vm->_gyro->dna.carrying)
 					_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
 			}
-			if (_vm->_gyro->dna.wearing == nowt)
+			if (_vm->_gyro->dna.wearing == kNothing)
 				_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
 			else
 				_vm->_scrolls->display(".");
@@ -818,22 +774,22 @@ void Acci::inv() {   /* the time-honoured command... */
 }
 
 void Acci::swallow() {   /* Eat something. */
-	switch (thing) {
+	switch (_thing) {
 	case _vm->_gyro->wine:
 		switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */
 		case 1: {
-			if (_vm->_gyro->dna.teetotal)  {
-				_vm->_visa->dixi('D', 6);
-				return;
-			}
-			_vm->_visa->dixi('U', 1);
-			_vm->_pingo->wobble();
-			_vm->_visa->dixi('U', 2);
-			_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
-			_vm->_lucerna->objectlist();
-			have_a_drink();
+				if (_vm->_gyro->dna.teetotal)  {
+					_vm->_visa->dixi('D', 6);
+					return;
 				}
-				break;
+				_vm->_visa->dixi('U', 1);
+				_vm->_pingo->wobble();
+				_vm->_visa->dixi('U', 2);
+				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
+				_vm->_lucerna->objectlist();
+				drink();
+			}
+			break;
 		case 2:
 		case 3:
 			_vm->_visa->dixi('d', 8);
@@ -859,7 +815,8 @@ void Acci::swallow() {   /* Eat something. */
 		}
 		break;
 	case _vm->_gyro->onion:
-		if (_vm->_gyro->dna.rotten_onion)  _vm->_visa->dixi('U', 11);
+		if (_vm->_gyro->dna.rotten_onion)
+			_vm->_visa->dixi('U', 11);
 		else {
 			_vm->_visa->dixi('U', 8);
 			_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
@@ -871,70 +828,95 @@ void Acci::swallow() {   /* Eat something. */
 			_vm->_scrolls->display("Try BUYing things before you drink them!");
 		else
 			_vm->_scrolls->display("The taste of it makes you retch!");
-		/* Constant- leave this one */
 	}
 }
 
-void Acci::others() {
-/* This lists the other people in the room. */
-	warning("STUB: Acci::others()");
+void Acci::peopleInRoom() {
+	byte numPeople = 0; // Number of people in the room.
+	
+	for (byte i = 1; i < 29; i++) // Start at 1 so we don't list Avvy himself!
+		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room)
+			numPeople++;
+
+	if (numPeople == 0) // If nobody's here, we can cut out straight away.
+		return;
+
+	byte actPerson = 0; // Actually listed people.
+	for (byte i = 1; i < 29; i++)
+		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room) {
+			actPerson++;
+			if (actPerson == 1) // First on the list.
+				_vm->_scrolls->display(_vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+			else if (actPerson < numPeople) // The middle...
+				_vm->_scrolls->display(Common::String(", ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+			else // The end.
+				_vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+		}
+
+	if (numPeople == 1)
+		_vm->_scrolls->display(Common::String(" is") + _vm->_scrolls->kControlToBuffer);
+	else
+		_vm->_scrolls->display(Common::String(" are") + _vm->_scrolls->kControlToBuffer);
+
+	_vm->_scrolls->display(" here."); // End and display it.
 }
 
-void Acci::lookaround() {
-/* This is called when you say "look." */
+void Acci::lookAround() {
 	_vm->_scrolls->display(*_vm->_gyro->also[0][1]);
 	switch (_vm->_gyro->dna.room) {
 	case r__spludwicks:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa->dixi('q', 23);
+			_vm->_visa->dixi('pos', 23);
 		else
-			others();
+			peopleInRoom();
 		break;
 	case r__robins:
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_visa->dixi('q', 38);
+			_vm->_visa->dixi('pos', 38);
 		if (_vm->_gyro->dna.mushroom_growing)
-			_vm->_visa->dixi('q', 55);
+			_vm->_visa->dixi('pos', 55);
 		break;
 	case r__insidecardiffcastle:
 		if (!_vm->_gyro->dna.taken_pen)
-			_vm->_visa->dixi('q', 49);
+			_vm->_visa->dixi('pos', 49);
 		break;
 	case r__lustiesroom:
 		if (_vm->_gyro->dna.lustie_is_asleep)
-			_vm->_visa->dixi('q', 65);
+			_vm->_visa->dixi('pos', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) {
 		case 258 :
-			_vm->_visa->dixi('q', 80);
-			break; /* Inside art gallery */
+			_vm->_visa->dixi('pos', 80); // Inside art gallery.
+			break; 
 		case 514 :
-			_vm->_visa->dixi('q', 81);
-			break; /* Outside ditto */
+			_vm->_visa->dixi('pos', 81); // Outside ditto.
+			break;
 		case 260 :
-			_vm->_visa->dixi('q', 82);
-			break; /* Outside Geida's room. */
+			_vm->_visa->dixi('pos', 82); // Outside Geida's room.
+			break; 
 		}
 		break;
 	default:
-		others();
+		peopleInRoom();
 	}
 }
 
-void Acci::opendoor() {   /* so whaddya THINK this does?! */
-	switch (_vm->_gyro->dna.room) {   /* Special cases. */
+void Acci::openDoor() { 
+	// Special cases.
+	switch (_vm->_gyro->dna.room) {   
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
-			/* Opening the box. */
-			thing = 54; /* The box. */ person = pardon;
+			// Opening the box.
+			_thing = 54; // The box.
+			_person = kPardon;
 			examine();
 			return;
 		}
 		break;
 	case r__spludwicks:
-		if (thing == 61) {
-			_vm->_visa->dixi('q', 85);
+		if (_thing == 61) {
+			_vm->_visa->dixi('pos', 85);
 			return;
 		}
 		break;
@@ -942,7 +924,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 
 
 	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
-		return; /* No doors can open if you can't move Avvy. */
+		return; // No doors can open if you can't move Avvy.
 
 	for (byte fv = 8; fv < 15; fv++)
 		if (_vm->_trip->infield(fv + 1)) {
@@ -951,7 +933,7 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 			switch (_vm->_gyro->portals[fv].op) {
 			case _vm->_gyro->exclaim:
 				_vm->_trip->tr[0].bounce();
-				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
+				_vm->_visa->dixi('word', _vm->_gyro->portals[fv].data);
 				break;
 			case _vm->_gyro->transport:
 				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
@@ -981,26 +963,25 @@ void Acci::opendoor() {   /* so whaddya THINK this does?! */
 
 
 
-
 void Acci::silly() {
 	_vm->_scrolls->display("Don't be silly!");
 }
 
-void Acci::putproc() {   /* Called when you call vb_put. */
+void Acci::putProc() {
 	if (!holding())
 		return;
 
-	thing2 -= 49;   /* Slip the second object */
-	char temp = thing;
-	thing = thing2;
+	_thing2 -= 49; // Slip the second object.
+	char temp = _thing;
+	_thing = _thing2;
 	if (!holding())
 		return;
-	thing = temp;
+	_thing = temp;
 
-	// Thing is the thing which you're putting in. Thing2 is where you're putting it.
-	switch (thing2) {
+	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
+	switch (_thing2) {
 	case _vm->_gyro->wine:
-		if (thing == _vm->_gyro->onion) {
+		if (_thing == _vm->_gyro->onion) {
 			if (_vm->_gyro->dna.rotten_onion)
 				_vm->_scrolls->display("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
@@ -1019,10 +1000,10 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 
 	case 54:
 		if (_vm->_gyro->dna.room == r__yours) { // Put something into the box.
-			if (_vm->_gyro->dna.box_contents != nowt)
+			if (_vm->_gyro->dna.box_contents != kNothing)
 				_vm->_scrolls->display("There's something in the box already, Avvy. Try taking that out first.");
 			else {
-				switch (thing) {
+				switch (_thing) {
 				case _vm->_gyro->money:
 					_vm->_scrolls->display("You'd better keep some ready cash on you!");
 					break;
@@ -1036,19 +1017,17 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_gyro->dna.wearing == thing)
-						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(thing) + " off first!");
+					if (_vm->_gyro->dna.wearing == _thing)
+						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(_thing) + " off first!");
 					else {
-						//_vm->_celer->show_one(-1, -1, 5); // Open box.
-						openBox(true);
+						openBox(true); // Open box.
 
-						_vm->_gyro->dna.box_contents = thing;
-						_vm->_gyro->dna.obj[thing - 1] = false;
+						_vm->_gyro->dna.box_contents = _thing;
+						_vm->_gyro->dna.obj[_thing - 1] = false;
 						_vm->_lucerna->objectlist();
 						_vm->_scrolls->display("OK, it's in the box.");
 
-						//_vm->_celer->show_one(-1, -1, 6); // Shut box.
-						openBox(false);
+						openBox(false); // Shut box.
 					}
 				}
 			}
@@ -1062,36 +1041,34 @@ void Acci::putproc() {   /* Called when you call vb_put. */
 }
 
 
-/* The result of this fn is whether or not he says "Hey, thanks!" */
-void Acci::not_in_order() {
+
+void Acci::notInOrder() {
 	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
 			+ _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick])
 			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
 
-void Acci::go_to_cauldron() {
-	_vm->_trip->tr[1].call_eachstep = false; /* Stops Geida_Procs. */
+void Acci::goToCauldron() {
+	_vm->_trip->tr[1].call_eachstep = false; // Stops Geida_Procs.
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
 	_vm->_trip->tr[1].walkto(2);
 }
 
-bool Acci::give2spludwick() {
-	bool give2spludwick_result = false;
-
-	if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != thing) {
-		not_in_order();
-		return give2spludwick_result;
+bool Acci::giveToSpludwick() { 
+	if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != _thing) {
+		notInOrder();
+		return false;
 	}
 
-	switch (thing) {
+	switch (_thing) {
 	case _vm->_gyro->onion:
 		_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
 		if (_vm->_gyro->dna.rotten_onion)
-			_vm->_visa->dixi('q', 22);
+			_vm->_visa->dixi('pos', 22);
 		else {
 			_vm->_gyro->dna.given2spludwick++;
-			_vm->_visa->dixi('q', 20);
-			go_to_cauldron();
+			_vm->_visa->dixi('pos', 20);
+			goToCauldron();
 			_vm->_lucerna->points(3);
 		}
 		_vm->_lucerna->objectlist();
@@ -1100,30 +1077,28 @@ bool Acci::give2spludwick() {
 		_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false;
 		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.given2spludwick++;
-		_vm->_visa->dixi('q', 24);
-		go_to_cauldron();
+		_vm->_visa->dixi('pos', 24);
+		goToCauldron();
 		_vm->_lucerna->points(3);
 		break;
 	case _vm->_gyro->mushroom:
 		_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false;
-		_vm->_visa->dixi('q', 25);
+		_vm->_visa->dixi('pos', 25);
 		_vm->_lucerna->points(5);
 		_vm->_gyro->dna.given2spludwick++;
-		go_to_cauldron();
+		goToCauldron();
 		_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
 		_vm->_lucerna->objectlist();
 		break;
 	default:
-		give2spludwick_result = true;
+		return true;
 	}
-
-	return give2spludwick_result;
 }
 
-void Acci::have_a_drink() {
+void Acci::drink() {
 	_vm->_gyro->dna.alcohol += 1;
 	if (_vm->_gyro->dna.alcohol == 5) {
-		_vm->_gyro->dna.obj[_vm->_gyro->key - 1] = true; /* Get the key. */
+		_vm->_gyro->dna.obj[_vm->_gyro->key - 1] = true; // Get the key.
 		_vm->_gyro->dna.teetotal = true;
 		_vm->_gyro->dna.avvy_is_awake = false;
 		_vm->_gyro->dna.avvy_in_bed = true;
@@ -1132,11 +1107,11 @@ void Acci::have_a_drink() {
 		_vm->_gyro->hang_around_for_a_while();
 		_vm->_trip->fliproom(1, 1);
 		_vm->_gyro->background(14);
-		_vm->_trip->new_game_for_trippancy(); /* Not really */
+		_vm->_trip->new_game_for_trippancy(); // Not really.
 	}
 }
 
-void Acci::cardiff_climbing() {
+void Acci::cardiffClimbing() {
 	if (_vm->_gyro->dna.standing_on_dais) { // Clamber up.
 		_vm->_scrolls->display("You climb down, back onto the floor.");
 		_vm->_gyro->dna.standing_on_dais = false;
@@ -1151,15 +1126,16 @@ void Acci::cardiff_climbing() {
 	}
 }
 
-/* Called when you ask Avvy to stand. */
+
+
 void Acci::already() {
 	_vm->_scrolls->display("You're already standing!");
 }
 
-void Acci::stand_up() {
+void Acci::standUp() {
 	switch (_vm->_gyro->dna.room) {
-	case r__yours: /* Avvy isn't asleep. */
-		if (_vm->_gyro->dna.avvy_is_awake && _vm->_gyro->dna.avvy_in_bed) {  /* But he's in bed. */
+	case r__yours: // Avvy isn't asleep.
+		if (_vm->_gyro->dna.avvy_is_awake && _vm->_gyro->dna.avvy_in_bed) {  // But he's in bed.
 			if (_vm->_gyro->dna.teetotal) {
 				_vm->_visa->dixi('d', 12);
 				_vm->_gyro->background(0);
@@ -1169,7 +1145,7 @@ void Acci::stand_up() {
 			_vm->_gyro->dna.user_moves_avvy = true;
 			_vm->_trip->apped(1, 2);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer->show_one(-1, -1, 4); /* Picture of empty pillow. */
+			_vm->_celer->show_one(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
@@ -1178,16 +1154,16 @@ void Acci::stand_up() {
 		break;
 
 	case r__insidecardiffcastle:
-		cardiff_climbing();
+		cardiffClimbing();
 		break;
 
 	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  {
-			_vm->_celer->show_one(-1, -1, 4); /* Not sitting down. */
-			_vm->_trip->tr[0].visible = true; /* But standing up. */
-			_vm->_trip->apped(1, 4); /* And walking away. */
-			_vm->_gyro->dna.sitting_in_pub = false; /* Really not sitting down. */
-			_vm->_gyro->dna.user_moves_avvy = true; /* And ambulant. */
+			_vm->_celer->show_one(-1, -1, 4); // Not sitting down.
+			_vm->_trip->tr[0].visible = true; // But standing up.
+			_vm->_trip->apped(1, 4); // And walking away.
+			_vm->_gyro->dna.sitting_in_pub = false; // Really not sitting down.
+			_vm->_gyro->dna.user_moves_avvy = true; // And ambulant.
 		} else
 			already();
 		break;
@@ -1197,7 +1173,8 @@ void Acci::stand_up() {
 }
 
 
-void Acci::getproc(char thing) {
+
+void Acci::getProc(char thing) {
 	switch (_vm->_gyro->dna.room) {
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
@@ -1206,40 +1183,38 @@ void Acci::getproc(char thing) {
 				_vm->_scrolls->display("OK, I've got it.");
 				_vm->_gyro->dna.obj[thing - 1] = true;
 				_vm->_lucerna->objectlist();
-				_vm->_gyro->dna.box_contents = nowt;
+				_vm->_gyro->dna.box_contents = kNothing;
 				_vm->_celer->show_one(-1, -1, 6);
 			} else
 				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->dixi('pos', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
 		case _vm->_gyro->pen:
-			if (_vm->_trip->infield(2)) {
-				/* Standing on the dais. */
-
+			if (_vm->_trip->infield(2)) { // Standing on the dais.
 				if (_vm->_gyro->dna.taken_pen)
 					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
-					/* OK: we're taking the pen, and it's there. */
-					_vm->_celer->show_one(-1, -1, 4); /* No pen there now. */
-					_vm->_trip->call_special(3); /* Zap! */
+					// OK: we're taking the pen, and it's there.
+					_vm->_celer->show_one(-1, -1, 4); // No pen there now.
+					_vm->_trip->call_special(3); // Zap!
 					_vm->_gyro->dna.taken_pen = true;
 					_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true;
 					_vm->_lucerna->objectlist();
 					_vm->_scrolls->display("Taken.");
 				}
 			} else if (_vm->_gyro->dna.standing_on_dais)
-				_vm->_visa->dixi('q', 53);
+				_vm->_visa->dixi('pos', 53);
 			else
-				_vm->_visa->dixi('q', 51);
+				_vm->_visa->dixi('pos', 51);
 			break;
 		case _vm->_gyro->bolt:
-			_vm->_visa->dixi('q', 52);
+			_vm->_visa->dixi('pos', 52);
 			break;
 		default:
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->dixi('pos', 57);
 		}
 		break;
 	case r__robins:
@@ -1252,37 +1227,35 @@ void Acci::getproc(char thing) {
 			_vm->_lucerna->objectlist();
 			_vm->_lucerna->points(3);
 		} else
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->dixi('pos', 57);
 		break;
 	default:
-		_vm->_visa->dixi('q', 57);
+		_vm->_visa->dixi('pos', 57);
 	}
 }
 
-void Acci::give_geida_the_lute() {
+void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->dna.room != r__lustiesroom) {
 		_vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	}
 	_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false;
 	_vm->_lucerna->objectlist();
-	_vm->_visa->dixi('q', 64); /* She plays it. */
-
-	/* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+	_vm->_visa->dixi('pos', 64); // She plays it.
 
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
 	_vm->_enid->back_to_bootstrap(4);
 }
 
-void Acci::play_harp() {
+void Acci::playHarp() {
 	if (_vm->_trip->infield(7))
 		_vm->_scrolls->musical_scroll();
 	else
 		_vm->_scrolls->display("Get a bit closer to it, Avvy!");
 }
 
-void Acci::winsequence() {
-	_vm->_visa->dixi('q', 78);
+void Acci::winSequence() {
+	_vm->_visa->dixi('pos', 78);
 	_vm->_sequence->first_show(7);
 	_vm->_sequence->then_show(8);
 	_vm->_sequence->then_show(9);
@@ -1290,145 +1263,131 @@ void Acci::winsequence() {
 	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning);
 }
 
-void Acci::person_speaks() {
-	bool found;
-	byte fv;
-	char cfv;
-
-
-	if ((person == pardon) || (person == 0))
-		if ((_vm->_gyro->him == pardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
-			person = _vm->_gyro->her;
+void Acci::personSpeaks() {
+	if ((_person == kPardon) || (_person == 0))
+		if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
+			_person = _vm->_gyro->her;
 		else
-			person = _vm->_gyro->him;
+			_person = _vm->_gyro->him;
 
-	if (_vm->_gyro->whereis[person - 150] != _vm->_gyro->dna.room) {
+	if (_vm->_gyro->whereis[_person - 150] != _vm->_gyro->dna.room) {
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
 		return;
 	}
 
-	found = false; /* The person we're looking for's code is in Person. */
+	bool found = false; // The _person we're looking for's code is in _person.
 
-	for (fv = 0; fv < _vm->_trip->numtr; fv++) {
-		if (_vm->_trip->tr[fv].quick && ((_vm->_trip->tr[fv].a.accinum + 149) == person)) {
-			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(fv + 49) + _vm->_scrolls->kControlToBuffer);
+	for (byte i = 0; i < _vm->_trip->numtr; i++) {
+		if (_vm->_trip->tr[i].quick && ((_vm->_trip->tr[i].a.accinum + 149) == _person)) {
+			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
 	}
 
 	if (!found)
-		for (fv = 0; fv < 16; fv++) 
-			if ((_vm->_gyro->quasipeds[fv].who == person) && (_vm->_gyro->quasipeds[fv].room == _vm->_gyro->dna.room))
-				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(fv + 65) + _vm->_scrolls->kControlToBuffer);
+		for (byte i = 0; i < 16; i++) 
+			if ((_vm->_gyro->quasipeds[i].who == _person) && (_vm->_gyro->quasipeds[i].room == _vm->_gyro->dna.room))
+				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
 }
 
-void Acci::heythanks() {
-	person_speaks();
+void Acci::heyThanks() {
+	personSpeaks();
 	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
-	_vm->_gyro->dna.obj[thing - 1] = false;
+	_vm->_gyro->dna.obj[_thing - 1] = false;
 }
 
-void Acci::do_that() {
+void Acci::doThat() {
 	const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
-	byte fv, ff;
-	int16 sx, sy;
-	bool ok;
 
-
-	if (thats == Common::String(nowt))  {
-		if (!thats.empty())
-			thats.clear();
+	if (_thats == Common::String(kNothing))  {
+		if (!_thats.empty())
+			_thats.clear();
 		return;
 	}
 
 	if (_vm->_gyro->weirdword)
 		return;
 
-	if (thing < 200)
-		thing -= 49; // "Slip"
+	if (_thing < 200)
+		_thing -= 49; // "Slip"
 
 
-	if ((verb != vb_load) && (verb != vb_save) && (verb != vb_quit) && (verb != vb_info) && (verb != vb_help)
-		&& (verb != vb_larrypass) && (verb != vb_phaon) && (verb != vb_boss) && (verb != vb_cheat) && (verb != vb_restart) && (verb != vb_dir)
-		&& (verb != vb_score) && (verb != vb_highscores) && (verb != vb_smartalec)) {
+	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
+		&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir)
+		&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) {
 			if (!_vm->_gyro->alive) {
 				_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
 				return;
 			}
-			if (!_vm->_gyro->dna.avvy_is_awake  && (verb != vb_die) && (verb != vb_expletive) && (verb != vb_wake)) {
+			if (!_vm->_gyro->dna.avvy_is_awake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
 				_vm->_scrolls->display("Talking in your sleep? Try waking up!");
 				return;
 			}
 	}
 
-	switch (verb) {
-	case vb_exam:
+	switch (_verb) {
+	case kVerbCodeExam:
 		examine();
 		break;
-	case vb_open:
-		opendoor();
+	case kVerbCodeOpen:
+		openDoor();
 		break;
-	case vb_pause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
+	case kVerbCodePause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
 		_vm->_scrolls->display(Common::String("Game paused.") + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 			+ "Press Enter, Esc, or click the mouse on the \"O.K.\" box to continue.");
 		break;
-	case vb_get:
-		if (thing != pardon) {
-			/* Legitimate try to pick something up. */
+	case kVerbCodeGet:
+		if (_thing != kPardon) { // Legitimate try to pick something up.
 			if (_vm->_gyro->dna.carrying >= maxobjs)
 				_vm->_scrolls->display("You can't carry any more!");
 			else
-				getproc(thing);
-
-		} else {
-			/* Not... ditto. */
-			if (person != pardon)
+				getProc(_thing);
+		} else { // Not... ditto.
+			if (_person != kPardon)
 				_vm->_scrolls->display("You can't sweep folk off their feet!");
 			else
 				_vm->_scrolls->display("I assure you, you don't need it.");
 		}
 		break;
-	case vb_drop:
+	case kVerbCodeDrop:
 		_vm->_scrolls->display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
-		/*       begin _vm->_gyro->dna.obj[thing]:=false; _vm->_lucerna->objectlist(); end;*/
-	case vb_inv:
-		inv();
+	case kVerbCodeInv:
+		inventory();
 		break;
-	case vb_talk:
-		if (person == pardon) {
-			if (_vm->_gyro->subjnumber == 99) /* They typed "say password". */
-				_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
+	case kVerbCodeTalk:
+		if (_person == kPardon) {
+			if (_vm->_gyro->subjnumber == 99) // They typed "say password".
+				_vm->_scrolls->display(Common::String("Yes, but kWhat ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
 			else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 449)) {
-				thats.deleteChar(0);
+				_thats.deleteChar(0);
 
 				for (byte i = 0; i < 10; i++)
-					realwords[i] = realwords[i + 1];
-				//move(realwords[2], realwords[1], sizeof(realwords) - sizeof(realwords[1]));
+					_realWords[i] = _realWords[i + 1];
 
-				verb = _vm->_gyro->subjnumber;
-				do_that();
+				_verb = _vm->_gyro->subjnumber;
+				doThat();
 				return;
 			} else {
-				person = _vm->_gyro->subjnumber;
+				_person = _vm->_gyro->subjnumber;
 				_vm->_gyro->subjnumber = 0;
-				if ((person == 0) || (person == pardon))
+				if ((_person == 0) || (_person == kPardon))
 					_vm->_scrolls->display("Talk to whom?");
-				else if (personshere())
-					_vm->_visa->talkto(person);
+				else if (isPersonHere())
+					_vm->_visa->talkto(_person);
 			}
-		} else if (person == pardon)
+		} else if (_person == kPardon)
 			_vm->_scrolls->display("Talk to whom?");
-		else if (personshere())
-			_vm->_visa->talkto(person);
+		else if (isPersonHere())
+			_vm->_visa->talkto(_person);
 		break;
-	case vb_give:
+	case kVerbCodeGive:
 		if (holding()) {
-			if (person == pardon)
+			if (_person == kPardon)
 				_vm->_scrolls->display("Give to whom?");
-			else if (personshere()) {
-				switch (thing) {
+			else if (isPersonHere()) {
+				switch (_thing) {
 				case _vm->_gyro->money :
 					_vm->_scrolls->display("You can't bring yourself to give away your moneybag.");
 					break;
@@ -1439,27 +1398,27 @@ void Acci::do_that() {
 					_vm->_scrolls->display("Don't give it away, it might be useful!");
 					break;
 				default:
-					switch (person) {
+					switch (_person) {
 					case _vm->_gyro->pcrapulus:
-						if (thing == _vm->_gyro->wine) {
+						if (_thing == _vm->_gyro->wine) {
 							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 						} else
-							heythanks();
+							heyThanks();
 						break;
 					case _vm->_gyro->pcwytalot:
-						if ((thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
+						if ((_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
 							_vm->_scrolls->display(Common::String("You might be able to influence Cwytalot more if you used it!"));
 						else
-							heythanks();
+							heyThanks();
 						break;
 					case _vm->_gyro->pspludwick:
-						if (give2spludwick())
-							heythanks();
+						if (giveToSpludwick())
+							heyThanks();
 						break;
 					case _vm->_gyro->pibythneth:
-						if (thing == _vm->_gyro->badge) {
-							_vm->_visa->dixi('q', 32); /* Thanks! Wow! */
+						if (_thing == _vm->_gyro->badge) {
+							_vm->_visa->dixi('pos', 32); // Thanks! Wow!
 							_vm->_lucerna->points(3);
 							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
 							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
@@ -1467,96 +1426,96 @@ void Acci::do_that() {
 							_vm->_celer->show_one(-1, -1, 8);
 							_vm->_celer->show_one(-1, -1, 9);
 						} else
-							heythanks();
+							heyThanks();
 						break;
 					case _vm->_gyro->payles:
 						if (_vm->_gyro->dna.ayles_is_awake) {
-							if (thing == _vm->_gyro->pen) {
+							if (_thing == _vm->_gyro->pen) {
 								_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false;
-								_vm->_visa->dixi('q', 54);
+								_vm->_visa->dixi('pos', 54);
 								_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = true;
 								_vm->_gyro->dna.given_pen_to_ayles = true;
 								_vm->_lucerna->objectlist();
 								_vm->_lucerna->points(2);
 							} else
-								heythanks();
+								heyThanks();
 						} else
 							_vm->_scrolls->display("But he's asleep!");
 						break;
 					case _vm->_gyro->pgeida:
-						switch (thing) {
+						switch (_thing) {
 						case _vm->_gyro->potion:
 							_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = false;
-							_vm->_visa->dixi('u', 16); /* She drinks it. */
+							_vm->_visa->dixi('u', 16); // She drinks it.
 							_vm->_lucerna->points(2);
 							_vm->_gyro->dna.geida_given_potion = true;
 							_vm->_lucerna->objectlist();
 							break;
 						case _vm->_gyro->lute:
-							give_geida_the_lute();
+							giveGeidaTheLute();
 							break;
 						default:
-							heythanks();
+							heyThanks();
 						}
 						break;
 					case _vm->_gyro->parkata:
-						switch (thing) {
+						switch (_thing) {
 						case _vm->_gyro->potion:
 							if (_vm->_gyro->dna.geida_given_potion)
-								winsequence();
+								winSequence();
 							else
-								_vm->_visa->dixi('q', 77);
-							break;             /* That Geida woman! */
+								_vm->_visa->dixi('pos', 77); // That Geida woman!
+							break;            
 						default:
-							heythanks();
+							heyThanks();
 						}
 						break;
 					default:
-						heythanks();
+						heyThanks();
 					}
 				}
 			}
-			_vm->_lucerna->objectlist(); /* Just in case... */
+			_vm->_lucerna->objectlist(); // Just in case...
 		}
 		break;
 
-	case vb_eat:
-	case vb_drink:
+	case kVerbCodeEat:
+	case kVerbCodeDrink:
 		if (holding())
 			swallow();
 		break;
 
-	case vb_load:
+	case kVerbCodeLoad:
 		break;
-	case vb_save:
+	case kVerbCodeSave:
 		break;
 	// We don't handle these two because we use ScummVM's save/load system.
 
-	case vb_pay:
+	case kVerbCodePay:
 		_vm->_scrolls->display("No money need change hands.");
 		break;
-	case vb_look:
-		lookaround();
+	case kVerbCodeLook:
+		lookAround();
 		break;
-	case vb_break:
+	case kVerbCodeBreak:
 		_vm->_scrolls->display("Vandalism is prohibited within this game!");
 		break;
-	case vb_quit: /* quit */
+	case kVerbCodeQuit: /* quit */
 		if (_vm->_gyro->demo) {
-			warning("STUB: Acci::do_that() - case vb_quit");
-		//	_vm->_visa->dixi('q', 31);
+			warning("STUB: Acci::doThat() - case kVerbCodequit");
+		//	_vm->_visa->dixi('pos', 31);
 		//	close(demofile);
 		//	exit(0); /* Change this later!!! */
 		}
-		if (!polite)
+		if (!_polite)
 			_vm->_scrolls->display("How about a `please\", Avvy?");
 		else if (_vm->_scrolls->ask(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
 			_vm->_gyro->lmo = true;
 		break;
-	case vb_go:
+	case kVerbCodeGo:
 		_vm->_scrolls->display("Just use the arrow keys to walk there.");
 		break;
-	case vb_info: {
+	case kVerbCodeInfo: {
 			_vm->_scrolls->aboutscroll = true;
 
 			Common::String toDisplay;
@@ -1572,89 +1531,88 @@ void Acci::do_that() {
 			_vm->_scrolls->aboutscroll = false;
 		}
 		break;
-	case vb_undress:
-		if (_vm->_gyro->dna.wearing == nowt)
+	case kVerbCodeUndress:
+		if (_vm->_gyro->dna.wearing == kNothing)
 			_vm->_scrolls->display("You're already stark naked!");
 		else if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.');
-			_vm->_gyro->dna.wearing = nowt;
+			_vm->_gyro->dna.wearing = kNothing;
 			_vm->_lucerna->objectlist();
 		} else
 			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
 		break;
-	case vb_wear:
-		if (holding()) { /* wear something */
-			switch (thing) {
+	case kVerbCodeWear:
+		if (holding()) { // Wear something.
+			switch (_thing) {
 			case _vm->_gyro->chastity:
-				_vm->_scrolls->display("Hey, what kind of a weirdo are you??!");
+				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??!");
 				break;
 			case _vm->_gyro->clothes:
 			case _vm->_gyro->habit: { /* Change this! */
-					if (_vm->_gyro->dna.wearing != nowt) {
-						if (_vm->_gyro->dna.wearing == thing)
+					if (_vm->_gyro->dna.wearing != kNothing) {
+						if (_vm->_gyro->dna.wearing == _thing)
 							_vm->_scrolls->display("You're already wearing that.");
 						else
 							_vm->_scrolls->display("You'll be rather warm wearing two sets of clothes!");
 						return;
 					} else
-						_vm->_gyro->dna.wearing = thing;
+						_vm->_gyro->dna.wearing = _thing;
 
 					_vm->_lucerna->objectlist();
 
-					if (thing == _vm->_gyro->habit)
-						fv = 3;
+					byte i;
+					if (_thing == _vm->_gyro->habit)
+						i = 3;
 					else
-						fv = 0;
-
-					if (_vm->_trip->tr[0].whichsprite != fv) {
-						sx = _vm->_trip->tr[0].x;
-						sy = _vm->_trip->tr[0].y;
+						i = 0;
+					if (_vm->_trip->tr[0].whichsprite != i) {
+						int16 x = _vm->_trip->tr[0].x;
+						int16 y = _vm->_trip->tr[0].y;
 						_vm->_trip->tr[0].done();
-						_vm->_trip->tr[0].init(fv, true, _vm->_trip);
-						_vm->_trip->tr[0].appear(sx, sy, _vm->_trip->left);
+						_vm->_trip->tr[0].init(i, true, _vm->_trip);
+						_vm->_trip->tr[0].appear(x, y, _vm->_trip->left);
 						_vm->_trip->tr[0].visible = false;
 					}
 				}
 				break;
 			default:
-				_vm->_scrolls->display(what);
+				_vm->_scrolls->display(kWhat);
 			}
 		}
 		break;
-	case vb_play:
-		if (thing == pardon) {
-			switch (_vm->_gyro->dna.room) { /* They just typed "play"... */
-			case r__argentpub: { /* ...in the pub, => play Nim. */
-					warning("STUB: Acci::do_that() - case vb_play");
+	case kVerbCodePlay:
+		if (_thing == kPardon) {
+			switch (_vm->_gyro->dna.room) { // They just typed "play"...
+			case r__argentpub: { // ...in the pub, => play Nim.
+					warning("STUB: Acci::doThat() - case kVerbCodeplay");
 					// play_nim();
 					// The following parts are copied from play_nim().
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
-					if (_vm->_gyro->dna.wonnim) {
-						/* Already won the game. */
+					if (_vm->_gyro->dna.wonnim) { // Already won the game.
 						_vm->_visa->dixi('Q', 6);
 						return;
 					}
 
 					if (!_vm->_gyro->dna.asked_dogfood_about_nim) {
-						_vm->_visa->dixi('q', 84);
+						_vm->_visa->dixi('pos', 84);
 						return;
 					}
 
 					_vm->_visa->dixi('Q', 3);
 					_vm->_gyro->dna.playednim++;
 
-					/* You won - strange! */
+					// You won - strange!
 					_vm->_logger->log_aside("You won.");
-					_vm->_visa->dixi('Q', 7); /* You won! Give us a lute! */
+					_vm->_visa->dixi('Q', 7); // You won! Give us a lute!
 					_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true;
 					_vm->_lucerna->objectlist();
 					_vm->_gyro->dna.wonnim = true;
-					_vm->_celer->show_one(-1, -1, 1); /* Show the settle with no lute on it. */
-					_vm->_lucerna->points(7); /* 7 points for winning! */
+					_vm->_celer->show_one(-1, -1, 1); // Show the settle with no lute on it.
+					_vm->_lucerna->points(7); // 7 points for winning!
 
 					if (_vm->_gyro->dna.playednim == 1)
-						_vm->_lucerna->points(3); /* 3 points for playing your 1st game. */
+						_vm->_lucerna->points(3); // 3 points for playing your 1st game.
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 					_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
@@ -1662,11 +1620,11 @@ void Acci::do_that() {
 				}
 				break; 
 			case r__musicroom:
-				play_harp();
+				playHarp();
 				break;
 			}
 		} else if (holding()) {
-			switch (thing) {
+			switch (_thing) {
 			case _vm->_gyro->lute : {
 					_vm->_visa->dixi('U', 7);
 
@@ -1679,47 +1637,47 @@ void Acci::do_that() {
 				break;
 			case 52:
 				if (_vm->_gyro->dna.room == r__musicroom)
-					play_harp();
+					playHarp();
 				else
-					_vm->_scrolls->display(what);
+					_vm->_scrolls->display(kWhat);
 				break;
 			case 55:
 				if (_vm->_gyro->dna.room == r__argentpub)
 					// play_nim();
-					warning("STUB: Acci::do_that() - case vb_play");
+					warning("STUB: Acci::doThat() - case kVerbCodeplay");
 				else
-					_vm->_scrolls->display(what);
+					_vm->_scrolls->display(kWhat);
 				break;
 			default:
-				_vm->_scrolls->display(what);
+				_vm->_scrolls->display(kWhat);
 			}
 		}
 		break;
-	case vb_ring:
+	case kVerbCodeRing:
 		if (holding()) {
-			if (thing == _vm->_gyro->bell) {
+			if (_thing == _vm->_gyro->bell) {
 				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
 					_vm->_scrolls->display("(Are you trying to join in, Avvy??!)");
 			} else
-				_vm->_scrolls->display(what);
+				_vm->_scrolls->display(kWhat);
 		}
 		break;
-	case vb_help:
+	case kVerbCodeHelp:
 		// boot_help();
-		warning("STUB: Acci::do_that() - case vb_help");
+		warning("STUB: Acci::doThat() - case kVerbCodehelp");
 		break;
-	case vb_larrypass:
+	case kVerbCodeLarrypass:
 		_vm->_scrolls->display("Wrong game!");
 		break;
-	case vb_phaon:
+	case kVerbCodePhaon:
 		_vm->_scrolls->display("Hello, Phaon!");
 		break;
-	case vb_boss:
+	case kVerbCodeBoss:
 		// bosskey();
-		warning("STUB: Acci::do_that() - case vb_boss");
+		warning("STUB: Acci::doThat() - case kVerbCodeboss");
 		break;
-	case vb_pee:
+	case kVerbCodePee:
 		if (_vm->_gyro->flagset('P')) {
 			_vm->_scrolls->display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
@@ -1727,20 +1685,20 @@ void Acci::do_that() {
 			_vm->_scrolls->display(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
 			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
 		break;
-	case vb_cheat:
+	case kVerbCodeCheat:
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
 		_vm->_gyro->cheat = true;
 		break;
-	case vb_magic:
+	case kVerbCodeMagic:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa->dixi('q', 19);
+			_vm->_visa->dixi('pos', 19);
 		else {
 			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
-				_vm->_visa->dixi('q', 17);
+				_vm->_visa->dixi('pos', 17);
 				if (_vm->_gyro->whereis[1] == 12)
-					_vm->_visa->dixi('q', 18);
+					_vm->_visa->dixi('pos', 18);
 				else {
-					_vm->_trip->tr[1].init(1, false, _vm->_trip); /* Avaricius */
+					_vm->_trip->tr[1].init(1, false, _vm->_trip); // Avaricius
 					_vm->_trip->apped(2, 4);
 					_vm->_trip->tr[1].walkto(5);
 					_vm->_trip->tr[1].call_eachstep = true;
@@ -1752,10 +1710,10 @@ void Acci::do_that() {
 				_vm->_scrolls->display("Nothing appears to happen...");
 		}
 		break;
-	case vb_smartalec:
+	case kVerbCodeSmartAlec:
 		_vm->_scrolls->display("Listen, smart alec, that was just rhetoric.");
 		break;
-	case vb_expletive:
+	case kVerbCodeExpletive:
 		switch (_vm->_gyro->dna.swore) {
 		case 0:
 			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!")
@@ -1773,7 +1731,7 @@ void Acci::do_that() {
 		}
 		_vm->_gyro->dna.swore++;
 		break;
-	case vb_listen:
+	case kVerbCodeListen:
 		if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
 			_vm->_scrolls->display("All other noise is drowned out by the ringing of the bells.");
 		else if (_vm->_gyro->listen.empty())
@@ -1781,11 +1739,11 @@ void Acci::do_that() {
 		else
 			_vm->_scrolls->display(_vm->_gyro->listen);
 		break;
-	case vb_buy: // What are they trying to buy?
+	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->dna.room) {
 		case r__argentpub:
 			if (_vm->_trip->infield(6)) { // We're in a pub, and near the bar.
-				switch (thing) {
+				switch (_thing) {
 				case 51:
 				case 53:
 				case 54:
@@ -1804,8 +1762,8 @@ void Acci::do_that() {
 						_vm->_lucerna->points(3);
 
 					_vm->_celer->show_one(-1, -1, 12);
-					_vm->_scrolls->display(booze[thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
-					_vm->_gyro->dna.drinking = thing;
+					_vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+					_vm->_gyro->dna.drinking = _thing;
 
 					_vm->_celer->show_one(-1, -1, 10);
 					_vm->_gyro->dna.malagauche = 177;
@@ -1845,7 +1803,7 @@ void Acci::do_that() {
 
 		case r__outsideducks:
 			if (_vm->_trip->infield(6)) {
-				if (thing == _vm->_gyro->onion) {
+				if (_thing == _vm->_gyro->onion) {
 					if (_vm->_gyro->dna.obj[_vm->_gyro->onion - 1])
 						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->dna.carrying >= maxobjs)
@@ -1877,9 +1835,9 @@ void Acci::do_that() {
 			_vm->_visa->dixi('D', 0); // Can't buy that.
 		}
 		break;
-	case vb_attack:
+	case kVerbCodeAttack:
 		if ((_vm->_gyro->dna.room == r__brummieroad) &&
-				((person == 157) || (thing == _vm->_gyro->crossbow) || (thing == _vm->_gyro->bolt))
+				((_person == 157) || (_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
 				&& (_vm->_gyro->whereis[7] == _vm->_gyro->dna.room)) {
 			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
@@ -1912,16 +1870,16 @@ void Acci::do_that() {
 		} else
 			_vm->_visa->dixi('Q', 10);
 		break;
-	case vb_password:
+	case kVerbCodePassword:
 		if (_vm->_gyro->dna.room != r__bridge)
 			_vm->_visa->dixi('Q', 12);
 		else {
-			ok = true;
-			for (ff = 0; ff < thats.size(); ff++) {
-				Common::String temp = realwords[ff];
+			bool ok = true;
+			for (byte i = 0; i < _thats.size(); i++) {
+				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				for (fv = 0; fv < words[_vm->_gyro->dna.pass_num + first_password].w.size(); fv++)
-					if (words[_vm->_gyro->dna.pass_num + first_password].w[fv] != temp[fv])
+				for (byte i = 0; i < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); i++)
+					if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[i] != temp[i])
 						ok = false;
 			}
 
@@ -1938,28 +1896,28 @@ void Acci::do_that() {
 				_vm->_visa->dixi('Q', 12);
 		}
 		break;
-	case vb_dir:
-		_vm->_enid->dir(realwords[1]);
+	case kVerbCodeDir:
+		_vm->_enid->dir(_realWords[1]);
 		break;
-	case vb_die:
+	case kVerbCodeDie:
 		_vm->_lucerna->gameover();
 		break;
-	case vb_score:
+	case kVerbCodeScore:
 		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ',' + _vm->_scrolls->kControlCenter
 			+ _vm->_scrolls->kControlNewLine + "out of a possible 128." + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totaltime());
+			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totalTime());
 		break;
-	case vb_put:
-		putproc();
+	case kVerbCodePut:
+		putProc();
 		break;
-	case vb_stand:
-		stand_up();
+	case kVerbCodeStand:
+		standUp();
 		break;
-	case vb_kiss:
-		if (person == pardon)
+	case kVerbCodeKiss:
+		if (_person == kPardon)
 			_vm->_scrolls->display("Kiss whom?");
-		else if (personshere()) {
-			switch (person) {
+		else if (isPersonHere()) {
+			switch (_person) {
 			case _vm->_gyro->parkata:
 				_vm->_visa->dixi('U', 12);
 				break;
@@ -1970,30 +1928,30 @@ void Acci::do_that() {
 				_vm->_visa->dixi('U', 14);
 				break;
 			default:
-				_vm->_visa->dixi('U', 5); /* You WHAT? */
+				_vm->_visa->dixi('U', 5); // You WHAT?
 			}
-		} else if ((150 <= person) && (person <= 174))
-			_vm->_scrolls->display("Hey, what kind of a weirdo are you??");
+		} else if ((150 <= _person) && (_person <= 174))
+			_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??");
 
 		break;
-	case vb_climb:
+	case kVerbCodeClimb:
 		if (_vm->_gyro->dna.room == r__insidecardiffcastle)
-			cardiff_climbing();
-		else /* In the wrong room! */
+			cardiffClimbing();
+		else // In the wrong room!
 			_vm->_scrolls->display("Not with your head for heights, Avvy!");
 		break;
-	case vb_jump:
+	case kVerbCodeJump:
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
-	case vb_highscores:
+	case kVerbCodeHighscores:
 		//	show_highs();
-		warning("STUB: Acci::do_that() - case vb_highscores");
+		warning("STUB: Acci::doThat() - case kVerbCodehighscores");
 		break;
-	case vb_wake:
-		if (personshere())
-			switch (person) {
-			case pardon:
+	case kVerbCodeWake:
+		if (isPersonHere())
+			switch (_person) {
+			case kPardon:
 			case _vm->_gyro->pavalot:
 			case 0:
 				if (!_vm->_gyro->dna.avvy_is_awake) {
@@ -2018,7 +1976,7 @@ void Acci::do_that() {
 				_vm->_scrolls->display("It's difficult to awaken people who aren't asleep...!");
 		}
 		break;
-	case vb_sit:
+	case kVerbCodeSit:
 		if (_vm->_gyro->dna.room == r__nottspub) {
 			if (_vm->_gyro->dna.sitting_in_pub)
 				_vm->_scrolls->display("You're already sitting!");
@@ -2033,22 +1991,22 @@ void Acci::do_that() {
 			_vm->_scrolls->display(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
 		}
 		break;
-	case vb_restart:
+	case kVerbCodeRestart:
 		if (_vm->_scrolls->ask("Restart game and lose changes?"))  {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->newgame();
 			_vm->_lucerna->dawn();
 		}
 		break;
-	case pardon:
-		_vm->_scrolls->display("Hey, a verb would be helpful!");
+	case kPardon:
+		_vm->_scrolls->display("Hey, a _verb would be helpful!");
 		break;
-	case vb_hello:
-		person_speaks();
+	case kVerbCodeHello:
+		personSpeaks();
 		_vm->_scrolls->display(Common::String("Hello.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
-	case vb_thanks:
-		person_speaks();
+	case kVerbCodeThanks:
+		personSpeaks();
 		_vm->_scrolls->display(Common::String("That's OK.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
 	default:
@@ -2056,39 +2014,37 @@ void Acci::do_that() {
 	}
 }
 
-void Acci::verbopt(char n, Common::String &answer, char &anskey) {
-	switch (n) {
-	case vb_exam:
+void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
+	switch (verb) {
+	case kVerbCodeExam:
 		answer = "Examine";
-		anskey = 'x';
-		break; /* the ubiqutous one */
-	/* vb_give isn't dealt with by this procedure, but by ddm__with */
-	case vb_drink:
+		ansKey = 'word';
+		break; // The ubiqutous one.
+	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
+	case kVerbCodeDrink:
 		answer = "Drink";
-		anskey = 'D';
+		ansKey = 'D';
 		break;
-	case vb_wear:
+	case kVerbCodeWear:
 		answer = "Wear";
-		anskey = 'W';
+		ansKey = 'W';
 		break;
-	case vb_ring:
+	case kVerbCodeRing:
 		answer = "Ring";
-		anskey = 'R';
-		break; /* only the bell! */
-	case vb_play:
+		ansKey = 'R';
+		break; // Only the bell!
+	case kVerbCodePlay:
 		answer = "Play";
-		anskey = 'P';
+		ansKey = 'P';
 		break;
-	case vb_eat:
+	case kVerbCodeEat:
 		answer = "Eat";
-		anskey = 'E';
+		ansKey = 'E';
 		break;
 	default:
-		answer = "? Unknown!";    /* Bug! */
-		anskey = '?';
+		answer = "? Unknown!"; // Bug!
+		ansKey = '?';
 	}
 }
 
-
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index a635072..d34c3ff 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -38,93 +38,93 @@ class AvalancheEngine;
 
 class Acci {
 public:
-		/* verb codes */
-	static const byte vb_exam = 1;
-	static const byte vb_open = 2;
-	static const byte vb_pause = 3;
-	static const byte vb_get = 4;
-	static const byte vb_drop = 5;
-	static const byte vb_inv = 6;
-	static const byte vb_talk = 7;
-	static const byte vb_give = 8;
-	static const byte vb_drink = 9;
-	static const byte vb_load = 10;
-	static const byte vb_save = 11;
-	static const byte vb_pay = 12;
-	static const byte vb_look = 13;
-	static const byte vb_break = 14;
-	static const byte vb_quit = 15;
-	static const byte vb_sit = 16;
-	static const byte vb_stand = 17;
-	static const byte vb_go = 18;
-	static const byte vb_info = 19;
-	static const byte vb_undress = 20;
-	static const byte vb_wear = 21;
-	static const byte vb_play = 22;
-	static const byte vb_ring = 23;
-	static const byte vb_help = 24;
-	static const byte vb_larrypass = 25;
-	static const byte vb_phaon = 26;
-	static const byte vb_boss = 27;
-	static const byte vb_pee = 28;
-	static const byte vb_cheat = 29;
-	static const byte vb_magic = 30;
-	static const byte vb_restart = 31;
-	static const byte vb_eat = 32;
-	static const byte vb_listen = 33;
-	static const byte vb_buy = 34;
-	static const byte vb_attack = 35;
-	static const byte vb_password = 36;
-	static const byte vb_dir = 37;
-	static const byte vb_die = 38;
-	static const byte vb_score = 39;
-	static const byte vb_put = 40;
-	static const byte vb_kiss = 41;
-	static const byte vb_climb = 42;
-	static const byte vb_jump = 43;
-	static const byte vb_highscores = 44;
-	static const byte vb_wake = 45;
-	static const byte vb_hello = 46;
-	static const byte vb_thanks = 47;
-
-	static const byte vb_smartalec = 249;
-	static const byte vb_expletive = 253;
-
-	static const byte pardon = 254; // Didn't understand / wasn't given.
-
-	static const int16 nowords = 277; // How many words does the parser know?
-	static const byte nowt = 250;
-	static const byte moved = 0; // This word was moved. (Usually because it was the subject of conversation.)
-
-	static const int16 first_password = 89; // Words[first_password] should equal "TIROS".
-
-
-
-	struct vocab {
-		byte n;
-		Common::String w;
+	enum VerbCode {
+		kVerbCodeExam = 1,
+		kVerbCodeOpen = 2,
+		kVerbCodePause = 3,
+		kVerbCodeGet = 4,
+		kVerbCodeDrop = 5,
+		kVerbCodeInv = 6,
+		kVerbCodeTalk = 7,
+		kVerbCodeGive = 8,
+		kVerbCodeDrink = 9,
+		kVerbCodeLoad = 10,
+		kVerbCodeSave = 11,
+		kVerbCodePay = 12,
+		kVerbCodeLook = 13,
+		kVerbCodeBreak = 14,
+		kVerbCodeQuit = 15,
+		kVerbCodeSit = 16,
+		kVerbCodeStand = 17,
+		kVerbCodeGo = 18,
+		kVerbCodeInfo = 19,
+		kVerbCodeUndress = 20,
+		kVerbCodeWear = 21,
+		kVerbCodePlay = 22,
+		kVerbCodeRing = 23,
+		kVerbCodeHelp = 24,
+		kVerbCodeLarrypass = 25,
+		kVerbCodePhaon = 26,
+		kVerbCodeBoss = 27,
+		kVerbCodePee = 28,
+		kVerbCodeCheat = 29,
+		kVerbCodeMagic = 30,
+		kVerbCodeRestart = 31,
+		kVerbCodeEat = 32,
+		kVerbCodeListen = 33,
+		kVerbCodeBuy = 34,
+		kVerbCodeAttack = 35,
+		kVerbCodePassword = 36,
+		kVerbCodeDir = 37,
+		kVerbCodeDie = 38,
+		kVerbCodeScore = 39,
+		kVerbCodePut = 40,
+		kVerbCodeKiss = 41,
+		kVerbCodeClimb = 42,
+		kVerbCodeJump = 43,
+		kVerbCodeHighscores = 44,
+		kVerbCodeWake = 45,
+		kVerbCodeHello = 46,
+		kVerbCodeThanks = 47,
+		kVerbCodeSmartAlec = 249,
+		kVerbCodeExpletive = 253,
 	};
 
-	static const vocab words[nowords];
+	static const byte kPardon = 254; // Didn't understand / wasn't given.
 
-	static const char what[];
+	static const int16 kParserWordsNum = 277; // How many words does the parser know?
+	static const byte kNothing = 250;
+	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
 
+	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
 
 
-	struct ranktype {
-		uint16 score;
-		Common::String title;
+
+	struct VocabEntry {
+		byte _number;
+		Common::String _word;
 	};
 
-	static const ranktype ranks[9];
+	static const VocabEntry kVocabulary[kParserWordsNum];
+
+	static const char kWhat[];
+
+
+
+	struct RankType {
+		uint16 _score;
+		Common::String _title;
+	};
 
+	static const RankType kRanks[9];
 
 
-	Common::String thats;
-	Common::String unknown;
-	Common::String realwords[11];
-	byte verb, person, thing, thing2;
-	bool polite;
+
+	Common::String _thats;
+	Common::String _unknown;
+	Common::String _realWords[11];
+	byte _verb, _person, _thing, _thing2;
+	bool _polite;
 
 
 
@@ -133,83 +133,77 @@ public:
 
 	void init();
 
-	void clearwords();
+	void clearWords();
 	void parse();
-	void lookaround();
-	void opendoor();
-	void do_that();
-	void verbopt(char n, Common::String &answer, char &anskey);
-	void have_a_drink();
+	void lookAround(); // This is called when you say "look".
+	void openDoor();
+	void doThat();
+	void verbOpt(byte verb, Common::String &answer, char &ansKey);
+	void drink();
 
 private:
 	AvalancheEngine *_vm;
 
 	byte fv;
 
-	byte wordnum(Common::String x);
-
-	void replace(Common::String old1, byte new1);
+	byte wordNum(Common::String word);
+	void replace(Common::String oldChars, byte newChar);
 
 	Common::String rank();
-
-	Common::String totaltime();
+	Common::String totalTime();
 
 	void number(Common::String &codes);
-	void cheatparse(Common::String codes);
+	void cheatParse(Common::String codes);
 
-	void punctustrip(Common::String &x);
+	void stripPunctuation(Common::String &word); // Strips punctuation from word.
 
-	void displaywhat(byte ch, bool animate, bool &ambigous);
-	bool do_pronouns();
+	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
+	bool doPronouns();
 
-	void lowercase();
-	void propernouns();
-	void sayit();
-	void store_interrogation(byte interrogation);
+	void properNouns();
+	void sayIt();  // This makes Avalot say the response.
+	void storeInterrogation(byte interrogation);
 
-	void clearuint16s();
+	void examineObject(); // Examine a standard object-thing
 
-	void examobj(); // Examine a standard object-thing
-
-	bool personshere();
+	bool isPersonHere();
 
 	void exampers();
 
 	bool holding();
 
-	void openBox(bool before);
+	void openBox(bool isOpening);
 	void examine();
 
-	void inv();
+	void inventory();
 
 	void swallow();
 
-	void others();
+	void peopleInRoom(); // This lists the other people in the room.
 
 	void silly();
-	void putproc();
+	void putProc();  // Called when you call kVerbCodeput.
 
-	void not_in_order();
-	void go_to_cauldron();
-	bool give2spludwick();
+	void notInOrder();
+	void goToCauldron();
+	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
 
-	void cardiff_climbing();
+	void cardiffClimbing();
 
 	void already();
-	void stand_up();
-
-	void getproc(char thing);
+	void standUp(); // Called when you ask Avvy to stand.
 
-	void give_geida_the_lute();
+	void getProc(char thing);
 
-	void play_harp();
+	void giveGeidaTheLute();
 
-	void winsequence();
+	void playHarp();
 
-	void person_speaks();
+	void winSequence();
 
-	void heythanks();
+	void personSpeaks();
 
+	void heyThanks();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 5c140ca..05c01ef 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -606,7 +606,7 @@ void AvalancheEngine::bFlightOff() {
 
 
 
-Common::String AvalancheEngine::elm2Str(Elm how) {
+Common::String AvalancheEngine::elmToStr(Elm how) {
 	switch (how) {
 	case kNormal:
 	case kMusical:
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f8f2ce1..c243aea 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -195,7 +195,7 @@ private:
 
 	void bFlightOff();
 
-	Common::String elm2Str(Elm how);
+	Common::String elmToStr(Elm how);
 
 	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index d0cd505..a29cbcc 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -320,26 +320,26 @@ void Dropdown::find_what_you_can_do_with_it() {
 	case _vm->_gyro->wine:
 	case _vm->_gyro->potion:
 	case _vm->_gyro->ink:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_drink;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeDrink;
 		break;
 	case _vm->_gyro->bell:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_ring;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeRing;
 		break;
 	case _vm->_gyro->chastity:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
 	case _vm->_gyro->lute:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_play;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodePlay;
 		break;
 	case _vm->_gyro->mushroom:
 	case _vm->_gyro->onion:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_eat;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeEat;
 		break;
 	case _vm->_gyro->clothes:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->verbstr = _vm->_acci->vb_exam; /* anything else */
+		_vm->_gyro->verbstr = _vm->_acci->kVerbCodeExam; /* anything else */
 	}
 }
 
@@ -562,32 +562,32 @@ void Dropdown::ddm__with() {
 		find_what_you_can_do_with_it();
 
 		for (fv = 0; fv < _vm->_gyro->verbstr.size(); fv++) {
-			_vm->_acci->verbopt(_vm->_gyro->verbstr[fv], verb, vbchar);
+			_vm->_acci->verbOpt(_vm->_gyro->verbstr[fv], verb, vbchar);
 			ddm_o.opt(verb, vbchar, "", true);
 		}
 
-		// We disable the "give" option if: (a), you haven't selected anybody, (b), the person you've selected isn't in the room, or (c), the person you've selected is YOU!
+		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room, or (c), the _person you've selected is YOU!
 		
-		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->nowt) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
+		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
 			ddm_o.opt("Give to...", 'G', "", false); /* Not here. */
 		else {
 			ddm_o.opt(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_give;
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeGive;
 		}
 	} else {
 		ddm_o.opt("Examine", 'x', "", true);
 		ddm_o.opt(Common::String("Talk to h") + himher(_vm->_gyro->thinks), 'T', "", true);
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_talk;
+		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
 		switch (_vm->_gyro->thinks) {
 		case _vm->_gyro->pgeida:
 		case _vm->_gyro->parkata: {
 			ddm_o.opt("Kiss her", 'K', "", true);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_kiss;
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeKiss;
 		}
 		break;
 		case _vm->_gyro->pdogfood: {
 			ddm_o.opt("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->vb_play;
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodePlay;
 		}
 		break;
 		case _vm->_gyro->pmalagauche: {
@@ -640,19 +640,19 @@ void Dropdown::do__game() {
 	switch (ddm_o.choicenum) {
 		/* Help, boss, untrash screen. */
 	case 0:
-		_vm->_lucerna->callverb(_vm->_acci->vb_help);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_lucerna->callverb(_vm->_acci->vb_boss);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBoss);
 		break;
 	case 2:
 		_vm->_lucerna->major_redraw();
 		break;
 	case 3:
-		_vm->_lucerna->callverb(_vm->_acci->vb_score);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_lucerna->callverb(_vm->_acci->vb_info);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeInfo);
 		break;
 	}
 }
@@ -661,18 +661,18 @@ void Dropdown::do__file() {
 	switch (ddm_o.choicenum) {
 		/* New game, load, save, save as, DOS shell, about, quit. */
 	case 0:
-		_vm->_lucerna->callverb(_vm->_acci->vb_restart);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeRestart);
 		break;
 	case 1: {
-		if (!_vm->_acci->realwords[1].empty())
-			_vm->_acci->realwords[1].clear();
-		_vm->_lucerna->callverb(_vm->_acci->vb_load);
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeLoad);
 	}
 	break;
 	case 2: {
-		if (!_vm->_acci->realwords[1].empty())
-			_vm->_acci->realwords[1].clear();
-		_vm->_lucerna->callverb(_vm->_acci->vb_save);
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeSave);
 	}
 	break;
 	case 3:
@@ -682,7 +682,7 @@ void Dropdown::do__file() {
 		_vm->_enid->back_to_bootstrap(2);
 		break;
 	case 5:
-		_vm->_lucerna->callverb(_vm->_acci->vb_quit);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeQuit);
 		break;
 	}
 }
@@ -692,23 +692,23 @@ void Dropdown::do__action() {
 	switch (ddm_o.choicenum) {
 		/* Get up/pause game/open door/look/inv/walk-run */
 	case 0: {
-		_vm->_acci->person = _vm->_acci->pardon;
-		_vm->_acci->thing = _vm->_acci->pardon;
+		_vm->_acci->_person = _vm->_acci->kPardon;
+		_vm->_acci->_thing = _vm->_acci->kPardon;
 		n = _vm->_gyro->f5_does();
 		_vm->_lucerna->callverb(n[0]);
 	}
 	break;
 	case 1:
-		_vm->_lucerna->callverb(_vm->_acci->vb_pause);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodePause);
 		break;
 	case 2:
-		_vm->_lucerna->callverb(_vm->_acci->vb_open);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
 		break;
 	case 3:
-		_vm->_lucerna->callverb(_vm->_acci->vb_look);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_lucerna->callverb(_vm->_acci->vb_inv);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
 		if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
@@ -731,58 +731,58 @@ void Dropdown::do__people() {
 }
 
 void Dropdown::do__with() {
-	_vm->_acci->thing = _vm->_gyro->thinks;
+	_vm->_acci->_thing = _vm->_gyro->thinks;
 
 	if (_vm->_gyro->thinkthing) {
 
-		_vm->_acci->thing += 49;
+		_vm->_acci->_thing += 49;
 
-		if (_vm->_gyro->verbstr[ddm_o.choicenum] == _vm->_acci->vb_give)
-			_vm->_acci->person = _vm->_gyro->last_person;
+		if (_vm->_gyro->verbstr[ddm_o.choicenum] == _vm->_acci->kVerbCodeGive)
+			_vm->_acci->_person = _vm->_gyro->last_person;
 		else
-			_vm->_acci->person = 254;
+			_vm->_acci->_person = 254;
 
 	} else {
 		switch (_vm->_gyro->verbstr[ddm_o.choicenum]) {
 		case 100: { // Beer
-			_vm->_acci->thing = 100;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 100;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 101: { // Wine
-			_vm->_acci->thing = 50;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 50;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 102: { // Whisky
-			_vm->_acci->thing = 102;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 102;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 103: { // Cider
-			_vm->_acci->thing = 103;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 103;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 104: { // Mead
-			_vm->_acci->thing = 107;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 107;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 105: { // Onion (trader)
-			_vm->_acci->thing = 67;
-			_vm->_lucerna->callverb(_vm->_acci->vb_buy);
+			_vm->_acci->_thing = 67;
+			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		default: {
-			_vm->_acci->person = _vm->_acci->thing;
-			_vm->_acci->thing = 254;
+			_vm->_acci->_person = _vm->_acci->_thing;
+			_vm->_acci->_thing = 254;
 			_vm->_gyro->subjnumber = 0;
 		}
 		}
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index aab8c82..229f387 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -505,30 +505,30 @@ Common::String Gyro::f5_does() {
 	switch (dna.room) {
 	case r__yours: {
 			if (!dna.avvy_is_awake)
-				return Common::String(_vm->_acci->vb_wake) + "WWake up";
+				return Common::String(_vm->_acci->kVerbCodeWake) + "WWake up";
 			else if (dna.avvy_in_bed)
-				return Common::String(_vm->_acci->vb_stand) + "GGet up";
+				return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up";
 		}
 		break;
 	case r__insidecardiffcastle: 
 		if (dna.standing_on_dais)
-			return Common::String(_vm->_acci->vb_climb) + "CClimb down";
+			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down";
 		else
-			return Common::String(_vm->_acci->vb_climb) + "CClimb up";
+			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb up";
 		break;
 	case r__nottspub:
 		if (dna.sitting_in_pub)
-			return Common::String(_vm->_acci->vb_stand) + "SStand up";
+			return Common::String(_vm->_acci->kVerbCodeStand) + "SStand up";
 		else
-			return Common::String(_vm->_acci->vb_sit) + "SSit down";
+			return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down";
 		break;
 	case r__musicroom:
 		if (_vm->_trip->infield(7))
-			return Common::String(_vm->_acci->vb_play) + "PPlay the harp";
+			return Common::String(_vm->_acci->kVerbCodePlay) + "PPlay the harp";
 		break;
 	}
 
-	return Common::String(_vm->_acci->pardon); /* If all else fails... */
+	return Common::String(_vm->_acci->kPardon); /* If all else fails... */
 }
 
 void Gyro::load_a_mouse(byte which) {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index eda1a8e..d2f0e8f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -67,16 +67,16 @@ void Lucerna::init() {
 }
 	
 void Lucerna::callverb(byte n) {
-	if (n == _vm->_acci->pardon) {
+	if (n == _vm->_acci->kPardon) {
 		_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
 			"situations. However, at the moment there is nothing " +
 			"assigned to it. You may press alt-A to see what the " +
 			"current setting of this key is.");
 	} else {
 		_vm->_gyro->weirdword = false;
-		_vm->_acci->polite = true;
-		_vm->_acci->verb = n;
-		_vm->_acci->do_that();
+		_vm->_acci->_polite = true;
+		_vm->_acci->_verb = n;
+		_vm->_acci->doThat();
 	}
 }
 
@@ -1120,26 +1120,26 @@ void Lucerna::checkclick() {
 			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
 				if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake)
 					mouseway(cursorPos);
-			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the thing.
+			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
 					_vm->updateEvents();
 				} while (holdLeftMouse);
 
 				if (_vm->_gyro->thinkthing) {
-					_vm->_acci->thing = _vm->_gyro->thinks;
-					_vm->_acci->thing += 49;
-					_vm->_acci->person = _vm->_acci->pardon;
+					_vm->_acci->_thing = _vm->_gyro->thinks;
+					_vm->_acci->_thing += 49;
+					_vm->_acci->_person = _vm->_acci->kPardon;
 				} else {
-					_vm->_acci->person = _vm->_gyro->thinks;
-					_vm->_acci->thing = _vm->_acci->pardon;
+					_vm->_acci->_person = _vm->_gyro->thinks;
+					_vm->_acci->_thing = _vm->_acci->kPardon;
 				}
-				callverb(_vm->_acci->vb_exam);
+				callverb(_vm->_acci->kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
 				} while (holdLeftMouse);
 
-				callverb(_vm->_acci->vb_score);
+				callverb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
 				_vm->_trip->tr[0].xs = _vm->_gyro->walk;
 				_vm->_trip->newspeed();
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index d52ab86..615f4a4 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -78,7 +78,7 @@ void Parser::handleReturn() {
 		if (!_inputText.empty()) {
 			_inputTextBackup = _inputText;
 			_vm->_acci->parse();
-			_vm->_acci->do_that();
+			_vm->_acci->doThat();
 			_inputText.clear();
 			wipeText();
 		}
@@ -88,13 +88,13 @@ void Parser::handleReturn() {
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_F5: {
-		_vm->_acci->person = _vm->_acci->pardon;
-		_vm->_acci->thing = _vm->_acci->pardon;
+		_vm->_acci->_person = _vm->_acci->kPardon;
+		_vm->_acci->_thing = _vm->_acci->kPardon;
 		_vm->_lucerna->callverb(_vm->_gyro->f5_does()[0]);
 		}
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_lucerna->callverb(_vm->_acci->vb_open);
+		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
 		break;
 	}
 }
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 88c928c..8f4c6dd 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -760,7 +760,7 @@ void Scrolls::calldrivers() {
 					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break; 
 				case 2:
-					display(_vm->_acci->words[_vm->_acci->first_password + _vm->_gyro->dna.pass_num].w + kControlToBuffer);
+					display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->dna.pass_num]._word + kControlToBuffer);
 					break;
 				case 3:
 					display(_vm->_gyro->dna.like2drink + kControlToBuffer);
@@ -782,12 +782,12 @@ void Scrolls::calldrivers() {
 					case 0: { // Sixpence.
 						_vm->_visa->dixi('q', 37); // You find the sixpence.
 						_vm->_gyro->dna.pence += 6;
-						_vm->_gyro->dna.box_contents = _vm->_acci->nowt;
+						_vm->_gyro->dna.box_contents = _vm->_acci->kNothing;
 						_vm->_lucerna->points(2);
 						return;
 					}
 					break;
-					case _vm->_acci->nowt:
+					case _vm->_acci->kNothing:
 						display("nothing at all. It's completely empty.");
 						break;
 					default:
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 334b49f..ab1fcf0 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -499,7 +499,7 @@ void Timeout::buydrinks() {
 	_vm->_visa->dixi('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->pennycheck(3)) // Pay 3d.
 		_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
-	_vm->_acci->have_a_drink();
+	_vm->_acci->drink();
 }
 
 void Timeout::buywine() {
@@ -626,7 +626,7 @@ void Timeout::winning() {
 	} while (!(_vm->_gyro->mrelease == 0));*/
 	// To be implemented with Pingo::winning_pic().
 
-	_vm->_lucerna->callverb(_vm->_acci->vb_score);
+	_vm->_lucerna->callverb(_vm->_acci->kVerbCodeScore);
 	_vm->_scrolls->display(" T H E    E N D ");
 	_vm->_gyro->lmo = true;
 }
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 0a0c031..8a311d0 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -164,8 +164,8 @@ void Visa::talkto(byte whom) {
 	byte fv;
 	bool no_matches;
 
-	if (_vm->_acci->person == _vm->_acci->pardon) {
-		_vm->_acci->person = _vm->_gyro->subjnumber;
+	if (_vm->_acci->_person == _vm->_acci->kPardon) {
+		_vm->_acci->_person = _vm->_gyro->subjnumber;
 		_vm->_gyro->subjnumber = 0;
 	}
 


Commit: 59317d6ac71896ce2aff51ca7d9c57144d315583
    https://github.com/scummvm/scummvm/commit/59317d6ac71896ce2aff51ca7d9c57144d315583
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T07:03:16-07:00

Commit Message:
AVALANCHE: Rename/refactor Avalot.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 96cb307..54c4656 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -133,21 +133,12 @@ void Avalot::handleKeyDown(Common::Event &event) {
 
 
 
-
-
-
 void Avalot::setup() {
-	int16 gd, gm;
-
-	checkbreak = false;
 	_vm->_gyro->visible = _vm->_gyro->m_no;
 	_vm->_gyro->to_do = 0;
 	_vm->_gyro->lmo = false;
 	_vm->_scrolls->resetscroll();
 	CursorMan.showMouse(true);
-	gd = 3;
-	gm = 0;
-	//initgraph(gd: gm: "");
 	_vm->_gyro->holdthedawn = true;
 	_vm->_lucerna->dusk();
 	_vm->_gyro->cmp = 177;
@@ -157,7 +148,6 @@ void Avalot::setup() {
 	_vm->_gyro->oldjw = 177;
 	_vm->_gyro->mousetext = "";
 	_vm->_gyro->c = 999;
-	//settextjustify(0: 0);
 	_vm->_gyro->ddmnow = false;
 	_vm->_lucerna->load_digits();
 	_vm->_gyro->cheat = false;
@@ -168,22 +158,15 @@ void Avalot::setup() {
 	_vm->_gyro->defaultled = 2;
 	/* TSkellern:=0; { Replace with a more local variable sometime }*/
 	_vm->_gyro->dna.rw = _vm->_gyro->stopped;
-	_vm->_gyro->enid_filename = ""; /* undefined. */
+	_vm->_gyro->enid_filename = ""; // Undefined.
 	_vm->_lucerna->toolbar();
 	_vm->_scrolls->state(2);
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
-
-	/* for gd:=0 to 1 do
-	 begin
-	  setactivepage(gd); outtextxy(7:177:chr(48+gd));
-	 end;*/
+		_vm->_gyro->lastscore[i] = -1; // Impossible digits.
 
 	_vm->_trip->loadtrip();
 
 	_vm->_trip->get_back_loretta();
-	//gm = getpixel(0: 0);
-	//setcolor(7);
 	_vm->_gyro->holdthedawn = false;
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
@@ -210,6 +193,8 @@ void Avalot::setup() {
 	}	
 }
 
+
+
 void Avalot::run(Common::String arg) {
 	setup();
 
@@ -250,9 +235,9 @@ void Avalot::run(Common::String arg) {
 			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
 	} while (! _vm->_gyro->lmo);
 
-	//restorecrtmode();
 	//if (logging)
 	//	close(logfile);
+	warning("STUB: Avalot::run()");
 
 	_vm->_closing->end_of_program();
 }
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index c792a17..231d6c9 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -42,21 +42,12 @@ public:
 
 	void setup();
 
-
-
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 
-	
-
-
-
 	void run(Common::String arg);
 
 private:
 	AvalancheEngine *_vm;
-
-	bool checkbreak; // Originally located in avalot9.map
-
 };
 
 } // End of namespace Avalanche


Commit: 84ae6db8938cde4d24a764917972eaef9936472e
    https://github.com/scummvm/scummvm/commit/84ae6db8938cde4d24a764917972eaef9936472e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T08:45:11-07:00

Commit Message:
AVALANCHE: Get rid of Basher. Move everything needed from it to Parser::init().

Changed paths:
  R engines/avalanche/basher2.cpp
  R engines/avalanche/basher2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 05c01ef..b977aeb 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -109,6 +109,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_lucerna->init();
 	_acci->init();
 	_basher->init();
+	_parser->init();
 
 	return Common::kNoError;
 }
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp
deleted file mode 100644
index 6bbf8b2..0000000
--- a/engines/avalanche/basher2.cpp
+++ /dev/null
@@ -1,169 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* BASHER		Handles the keyboard. */
-
-// Note: this unit can record keystrokes, for the demo. If you want it
-// to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
-// cause them to be played back. 
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/basher2.h"
-#include "avalanche/enhanced2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/acci2.h"
-#include "avalanche/trip6.h"
-#include "avalanche/pingo2.h"
-#include "avalanche/dropdown2.h"
-#include "avalanche/logger2.h"
-#include "avalanche/enid2.h"
-//#include "Sticks.h" - Responsible for the joystick
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-
-Basher::Basher(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Basher::init() {
-	/* new(previous);*/
-	if (!_vm->_parser->_inputTextBackup.empty())
-		_vm->_parser->_inputTextBackup.clear();
-
-	normal_edit();
-
-	if (_vm->_gyro->demo) {
-		if (!_vm->_gyro->demofile.open("demo.avd")) {
-			warning("AVALANCHE: Basher: File not found: demo.avd");
-			throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
-		}
-	}
-
-// Not sure that the following part will be used ever...
-#ifdef RECORD
-	count = 0;
-	if (!_vm->_gyro->demofile_save.open("demo.avd")) {
-		warning("AVALANCHE: Basher: File not found: demo.avd");
-		throw "AVALANCHE: Basher: File not found: demo.avd"; // TODO: Some proper exception handling will be needed here.
-	}
-#endif
-}
-
-/*procedure cursor;
-begin
- if curflash=0 then
- begin
-  if mouse_near_text then Super_Off;
-  cursoron:=not cursoron;
-  mem[$A000*13442+curpos]:=not mem[$A000*13442+curpos];
-  mem[$A000*pagetop+13442+curpos]:=not mem[$A000*pagetop+13442+curpos];
-  curflash:=17;
-  Super_On;
- end else dec(curflash);
-end;*/
-
-void Basher::get_demorec() {
-	warning("STUB: Basher::get_demorec()");
-}
-
-#ifdef RECORD
-void Basher::record_one() {
-	warning("STUB: Basher::record_one()");
-}
-#endif
-/*
-procedure storeline(whatwhat:string);
-var
- fv:byte;
- what:string[77];
- ok:boolean;
-
-  function upline(x:string):string;
-  var fv:byte; n:string[77];
-  begin
-   for fv:=1 to length(x) do n[fv]:=upcase(x[fv]);
-   n[0]:=x[0]; upline:=n;
-  end;
-begin
-
- what:=upline(whatwhat); ok:=false;
- for fv:=1 to 20 do
-  if what=upline(previous^[fv]) then
-  begin { it already exists, in string "fv" }
-   move(previous^[fv+1],previous^[fv],(20-fv)*78);
-   previous^[20]:=whatwhat; ok:=true;
-  end;
- if ok then exit;
- { it's not on the list, so add it }
- move(previous^[2],previous^[1],1482); { shove up }
- previous^[20]:=whatwhat;
-end;
-*/
-
-
-char Basher::firstchar(Common::String x) {
-	warning("STUB: Basher::firstchar()");
-	return 'S';
-}
-
-
-
-
-void Basher::typein() {
-	warning("STUB: Basher::typein()");
-}
-
-/*        'x'..'z': begin setvisualpage(ord(extd)-63); write(#7); inkey; end;
-        '': begin setvisualpage(0); write(#7); inkey; end;*/
-
-void Basher::keyboard_link() {
-	warning("STUB: Basher::keyboard_link()");
-}
-
-bool Basher::demo_ready() {
-	warning("STUB: Basher::demo_ready()");
-	return true;
-}
-
-void Basher::filename_edit() {
-	warning("STUB: Basher::filename_edit()");
-}
-
-void Basher::normal_edit() {
-	entering_filename = false;
-	_vm->_parser->_leftMargin = 0;
-	if (!_vm->_parser->_inputText.empty())
-		_vm->_parser->_inputText.clear();
-	_vm->_parser->_inputTextPos = 0;
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h
deleted file mode 100644
index f4a78f4..0000000
--- a/engines/avalanche/basher2.h
+++ /dev/null
@@ -1,80 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* BASHER		Handles the keyboard. */
-
-// Note: this unit can record keystrokes, for the demo. If you want it
-// to do this, define the o.c.c. RECORD. Setting gyro.demo to True will
-// cause them to be played back. 
-
-// TODO: Replace these functions gradually with ScummVM's own methods.
-
-#ifndef BASHER2_H
-#define BASHER2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Basher {
-public:
-	uint16 count;
-
-
-
-	Basher(AvalancheEngine *vm);
-
-	void init();
-
-	void keyboard_link();
-
-	void get_demorec();
-
-	bool demo_ready();
-
-	void filename_edit();
-
-	void normal_edit();
-
-#ifdef RECORD
-	void record_one();
-#endif
-
-private:
-	AvalancheEngine *_vm;
-
-	bool entering_filename;
-
-	char firstchar(Common::String x);
-
-	void typein();
-};
-
-} // End of namespace Avalanche.
-
-#endif // BASHER2_H
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 615f4a4..2457354 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -34,6 +34,13 @@ Parser::Parser(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+void Parser::init() {
+	_leftMargin = 0;
+	if (!_inputText.empty())
+		_inputText.clear();
+	_inputTextPos = 0;
+}
+
 void Parser::handleInputText(const Common::Event &event) {
 	byte inChar = event.kbd.ascii;
 	if (_vm->_dropdown->ddm_o.menunow) {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index da2b761..e16df6d 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -46,6 +46,8 @@ public:
 
 	Parser(AvalancheEngine *vm);
 
+	void init();
+
 	void handleInputText(const Common::Event &event);
 
 	void handleBackspace();


Commit: 09ee31e4cea0b2eedaee993d54a947e6c6394bc2
    https://github.com/scummvm/scummvm/commit/09ee31e4cea0b2eedaee993d54a947e6c6394bc2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T08:51:30-07:00

Commit Message:
AVALANCHE: Get rid of the rest of Basher.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/module.mk
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b977aeb..70d7942 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -76,7 +76,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _timeout;
 	delete _trip;
 	delete _acci;
-	delete _basher;
 	delete _dropdown;
 	delete _closing;
 }
@@ -99,7 +98,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_timeout = new Timeout(this);
 	_trip = new Trip(this);
 	_acci = new Acci(this);
-	_basher = new Basher(this);
 	_dropdown = new Dropdown(this);
 	_closing = new Closing(this);
 
@@ -108,7 +106,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_scrolls->init();
 	_lucerna->init();
 	_acci->init();
-	_basher->init();
 	_parser->init();
 
 	return Common::kNoError;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index c243aea..393bb4d 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -47,7 +47,6 @@
 #include "avalanche/timeout2.h"
 #include "avalanche/trip6.h"
 #include "avalanche/acci2.h"
-#include "avalanche/basher2.h"
 #include "avalanche/dropdown2.h"
 #include "avalanche/closing2.h"
 
@@ -88,7 +87,6 @@ public:
 	Timeout *_timeout;
 	Trip *_trip;
 	Acci *_acci;
-	Basher *_basher;
 	Dropdown *_dropdown;
 	Closing *_closing;
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 54c4656..2678123 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -36,7 +36,6 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/basher2.h"
 #include "avalanche/dropdown2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/logger2.h"
@@ -114,8 +113,6 @@ void Avalot::handleKeyDown(Common::Event &event) {
 		if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake) {
 			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 			_vm->_lucerna->showrw();
-			if (_vm->_gyro->demo)
-				_vm->_basher->get_demorec();
 			return;
 		}
 	case Common::KEYCODE_BACKSPACE:
@@ -127,8 +124,6 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	}
 
 	_vm->_lucerna->showrw();
-	if (_vm->_gyro->demo)
-		_vm->_basher->get_demorec();
 }
 
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index a29cbcc..95a6724 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -36,7 +36,6 @@
 #include "avalanche/acci2.h"
 #include "avalanche/trip6.h"
 #include "avalanche/enid2.h"
-#include "avalanche/basher2.h"
 
 #include "common/textconsole.h"
 
@@ -676,7 +675,7 @@ void Dropdown::do__file() {
 	}
 	break;
 	case 3:
-		_vm->_basher->filename_edit();
+		//_vm->_basher->filename_edit();
 		break;
 	case 4:
 		_vm->_enid->back_to_bootstrap(2);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 229f387..4166ecf 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -325,7 +325,6 @@ void Gyro::newgame() {
 	/*for gd:=0 to 5 do which[gd]:=1;*/
 	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
 	_vm->_scrolls->natural();
-	_vm->_basher->normal_edit();
 	_vm->_lucerna->mousepage(0);
 	dna.spare_evening = "answer a questionnaire";
 	dna.like2drink = "beer";
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index e2dd67d..7f2e40c 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -20,7 +20,6 @@ MODULE_OBJS = \
 	timeout2.o \
 	trip6.o \
 	acci2.o \
-	basher2.o \
 	dropdown2.o \
 	closing2.o
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8f4c6dd..f21645d 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -38,7 +38,6 @@
 #include "avalanche/acci2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
-#include "avalanche/basher2.h"
 
 #include "common/textconsole.h"
 #include "common/file.h"
@@ -153,9 +152,6 @@ void Scrolls::normscroll() {
 	_vm->_gyro->newpointer(4);
 	_vm->_lucerna->mousepage(1 - _vm->_gyro->cp);
 
-	if (_vm->_gyro->demo)
-		_vm->_basher->get_demorec();
-
 
 
 	::Graphics::Surface temp;


Commit: 38ceb705f29c6ddac318b9a62730fb597d647417
    https://github.com/scummvm/scummvm/commit/38ceb705f29c6ddac318b9a62730fb597d647417
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T13:22:42-07:00

Commit Message:
AVALANCHE: Do renaming in Celer.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1f455ec..c75bfa4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -714,17 +714,17 @@ bool Acci::holding() {
 
 void Acci::openBox(bool isOpening) {
 	if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) {
-		_vm->_celer->show_one(-1, -1, 5);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
-		_vm->_celer->pics_link();
+		_vm->_celer->refreshBackgroundSprites();
 		_vm->_trip->trippancy_link();
 		_vm->_graphics->refreshScreen();
 
 		_vm->_system->delayMillis(55);
 
 		if (!isOpening) {
-			_vm->_celer->show_one(-1, -1, 6);
-			_vm->_celer->pics_link();
+			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			_vm->_celer->refreshBackgroundSprites();
 			_vm->_trip->trippancy_link();
 			_vm->_graphics->refreshScreen();
 		}
@@ -1145,7 +1145,7 @@ void Acci::standUp() {
 			_vm->_gyro->dna.user_moves_avvy = true;
 			_vm->_trip->apped(1, 2);
 			_vm->_gyro->dna.rw = _vm->_gyro->left;
-			_vm->_celer->show_one(-1, -1, 4); // Picture of empty pillow.
+			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
@@ -1159,7 +1159,7 @@ void Acci::standUp() {
 
 	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  {
-			_vm->_celer->show_one(-1, -1, 4); // Not sitting down.
+			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_trip->tr[0].visible = true; // But standing up.
 			_vm->_trip->apped(1, 4); // And walking away.
 			_vm->_gyro->dna.sitting_in_pub = false; // Really not sitting down.
@@ -1179,12 +1179,12 @@ void Acci::getProc(char thing) {
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
 			if (_vm->_gyro->dna.box_contents == thing) {
-				_vm->_celer->show_one(-1, -1, 5);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->display("OK, I've got it.");
 				_vm->_gyro->dna.obj[thing - 1] = true;
 				_vm->_lucerna->objectlist();
 				_vm->_gyro->dna.box_contents = kNothing;
-				_vm->_celer->show_one(-1, -1, 6);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else
 				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
@@ -1198,7 +1198,7 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
-					_vm->_celer->show_one(-1, -1, 4); // No pen there now.
+					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
 					_vm->_trip->call_special(3); // Zap!
 					_vm->_gyro->dna.taken_pen = true;
 					_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true;
@@ -1219,7 +1219,7 @@ void Acci::getProc(char thing) {
 		break;
 	case r__robins:
 		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
-			_vm->_celer->show_one(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->display("Got it!");
 			_vm->_gyro->dna.mushroom_growing = false;
 			_vm->_gyro->dna.taken_mushroom = true;
@@ -1423,8 +1423,8 @@ void Acci::doThat() {
 							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
 							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
 							_vm->_gyro->dna.givenbadgetoiby = true;
-							_vm->_celer->show_one(-1, -1, 8);
-							_vm->_celer->show_one(-1, -1, 9);
+							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 						} else
 							heyThanks();
 						break;
@@ -1608,7 +1608,7 @@ void Acci::doThat() {
 					_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true;
 					_vm->_lucerna->objectlist();
 					_vm->_gyro->dna.wonnim = true;
-					_vm->_celer->show_one(-1, -1, 1); // Show the settle with no lute on it.
+					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
 					_vm->_lucerna->points(7); // 7 points for winning!
 
 					if (_vm->_gyro->dna.playednim == 1)
@@ -1761,11 +1761,11 @@ void Acci::doThat() {
 					if (_vm->_gyro->dna.alcohol == 0)
 						_vm->_lucerna->points(3);
 
-					_vm->_celer->show_one(-1, -1, 12);
+					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 					_vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 					_vm->_gyro->dna.drinking = _thing;
 
-					_vm->_celer->show_one(-1, -1, 10);
+					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 					_vm->_gyro->dna.malagauche = 177;
 					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
@@ -1786,11 +1786,11 @@ void Acci::doThat() {
 							return;
 						}
 
-						_vm->_celer->show_one(-1, -1, 12);
+						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->dna.alcohol == 0)
 							_vm->_lucerna->points(3);
-						_vm->_celer->show_one(-1, -1, 10);
+						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->dna.malagauche = 177;
 
 						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
@@ -1958,7 +1958,7 @@ void Acci::doThat() {
 					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer->show_one(-1, -1, 3); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Picture of Avvy, awake in bed. */
 					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 70d7942..d3dfbff 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -463,7 +463,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		_lucerna->dawn();
 	}
 
-	_celer->forget_chunks();
+	_celer->forgetBackgroundSprites();
 
 	_lucerna->minor_redraw();
 
@@ -482,7 +482,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_gyro->ontoolbar = false;
 	_trip->trippancy_link();
 
-	_celer->pics_link();
+	_celer->refreshBackgroundSprites();
 	
 	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
 		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2678123..cade90e 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -204,7 +204,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_dropdown->menu_link();
 		_vm->_gyro->force_numlock();
 		_vm->_trip->get_back_loretta();
-		_vm->_celer->pics_link();
+		_vm->_celer->refreshBackgroundSprites();
 		_vm->_trip->trippancy_link();
 		_vm->_lucerna->checkclick();
 		_vm->_timeout->one_tick();
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 25093a9..37329f1 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -37,224 +37,216 @@
 
 #include "common/textconsole.h"
 
+
+
 namespace Avalanche {
 
-const int16 Celer::on_disk = -1;
+const int16 Celer::kOnDisk = -1;
 
 
 Celer::Celer(AvalancheEngine *vm) {
 	_vm = vm;
-	num_chunks = 0;
+	_chunkNum = 0;
 }
 
 Celer::~Celer() {
 	for (byte i = 0; i < 40; i++)
-		memory[i].free();
+		_memory[i].free();
 }
 
-void Celer::pics_link() {
-	byte xx;
+void Celer::refreshBackgroundSprites() {
+	byte direction;
 
 	if (_vm->_gyro->ddmnow)
-		return; /* No animation when the menus are up. */
+		return; // No animation when the menus are up.
 
-	
 	switch (_vm->_gyro->dna.room) {
 	case r__outsideargentpub:
 		if ((_vm->_gyro->roomtime % 12) == 0)
-			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 4);
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 4);
 		break;
-
 	case r__brummieroad:
 		if ((_vm->_gyro->roomtime % 2) == 0)
-			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 2) % 4);
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
-
 	case r__bridge:
 		if ((_vm->_gyro->roomtime % 2) == 0)
-			show_one(-1, -1, 4 + (_vm->_gyro->roomtime / 2) % 4);
+			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->roomtime / 2) % 4);
 		break;
-
 	case r__yours:
 		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0))
-			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2);
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2);
 		break;
+	case r__argentpub: {
+			if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
+				// Malagauche cycle.
+				_vm->_gyro->dna.malagauche += 1;
+				switch (_vm->_gyro->dna.malagauche) {
+				case 1:
+				case 11:
+				case 21:
+					drawBackgroundSprite(-1, -1, 12); // Looks forwards.
+					break; 
+				case 8:
+				case 18:
+				case 28:
+				case 32:
+					drawBackgroundSprite(-1, -1, 11); // Looks at you.
+					break; 
+				case 30:
+					drawBackgroundSprite(-1, -1, 13); // Winks.
+					break; 
+				case 33:
+					_vm->_gyro->dna.malagauche = 0;
+					break;
+				}
+			}
 
-	case r__argentpub:
-		if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
-			/* Malagauche cycle */
-			_vm->_gyro->dna.malagauche += 1;
-			switch (_vm->_gyro->dna.malagauche) {
-			case 1:
-			case 11:
-			case 21:
-				show_one(-1, -1, 12);
-				break; /* Looks forwards. */
-			case 8:
-			case 18:
-			case 28:
-			case 32:
-				show_one(-1, -1, 11);
-				break; /* Looks at you. */
-			case 30:
-				show_one(-1, -1, 13);
-				break; /* Winks. */
-			case 33:
-				_vm->_gyro->dna.malagauche = 0;
+			switch (_vm->_gyro->roomtime % 200) {
+			case 179:
+			case 197:
+				drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
+				break; 
+			case 182:
+			case 194:
+				drawBackgroundSprite(-1, -1, 6);
+				break;
+			case 185:
+				drawBackgroundSprite(-1, -1, 7);
 				break;
+			case 199:
+				_vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this.
+				break; 
 			}
-		}
-
-		switch (_vm->_gyro->roomtime % 200) {
-		case 179:
-		case 197:
-			show_one(-1, -1, 5);
-			break; /* Dogfood's drinking cycle */
-		case 182:
-		case 194:
-			show_one(-1, -1, 6);
-			break;
-		case 185:
-			show_one(-1, -1, 7);
-			break;
-		case 199:
-			_vm->_gyro->dna.dogfoodpos = 177;
-			break; /* Impossible value for this. */
-		}
 
-		if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { /* Normally. */
-			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
-				xx = 3;
-			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
-				xx = 2;
-			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
-				xx = 4;
-
-			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(-1, -1, xx);
-				_vm->_gyro->dna.dogfoodpos = xx;
+			if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
+				if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
+					direction = 3;
+				else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
+					direction = 2;
+				else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
+					direction = 4;
+
+				if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+					drawBackgroundSprite(-1, -1, direction);
+					_vm->_gyro->dna.dogfoodpos = direction;
+				}
 			}
 		}
 		break;
-
 	case r__westhall:
 		if ((_vm->_gyro->roomtime % 3) == 0) {
 			switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) {
 			case 4:
-				show_one(-1, -1, 1);
+				drawBackgroundSprite(-1, -1, 1);
 				break;
 			case 1:
 			case 3:
 			case 5:
-				show_one(-1, -1, 2);
+				drawBackgroundSprite(-1, -1, 2);
 				break;
 			case 0:
 			case 2:
-				show_one(-1, -1, 3);
+				drawBackgroundSprite(-1, -1, 3);
 				break;
 			}
 		}
 		break;
-
 	case r__lustiesroom:
 		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
 			if ((_vm->_gyro->roomtime % 45) > 42)
-				xx = 4; /* du Lustie blinks */
+				direction = 4; // du Lustie blinks.
 
-			/* Bearing of Avvy from du Lustie. */
+			// Bearing of Avvy from du Lustie.
 			else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
-					xx = 1; /* Middle. */
+					direction = 1; // Middle.
 			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
-					xx = 2; /* Left. */
+					direction = 2; // Left.
 			else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
-				xx = 3; /* Right. */
+				direction = 3; // Right.
 
-			if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-				show_one(-1, -1, xx);
-				_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
 			}
 		}
 		break;
-
 	case r__aylesoffice:
 		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % 14 == 0)) {
 			switch ((_vm->_gyro->roomtime / 14) % 2) {
 			case 0:
-				show_one(-1, -1, 1);
-				break; /* Frame 2: EGA. */
+				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
+				break;
 			case 1:
-				show_one(-1, -1, 3);
-				break; /* Frame 1: Natural. */
+				drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural.
+				break; 
 			}
 		}
 		break;
-
 	case r__robins:
 		if (_vm->_gyro->dna.tied_up) {
 			switch (_vm->_gyro->roomtime % 54) {
 			case 20:
-				show_one(-1, -1, 4);
-				break; /* Frame 4: Avalot blinks. */
+				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
+				break; 
 			case 23:
-				show_one(-1, -1, 2);
-				break; /* Frame 1: Back to normal. */
+				drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal.
+				break; 
 			}
 		}
 		break;
+	case r__nottspub: {
+			// Bearing of Avvy from Port.
+			if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
+				direction = 2; // Middle.
+			else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
+				direction = 6; // Left.
+			else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
+				direction = 8; // Right.
+
+			if ((_vm->_gyro->roomtime % 60) > 57)
+				direction--; // Blinks.
+
+			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+			}
 
-	case r__nottspub:
-		/* Bearing of Avvy from Port. */
-		if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
-			xx = 2; /* Middle. */
-		else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
-			xx = 6; /* Left. */
-		else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
-			xx = 8; /* Right. */
-
-		if ((_vm->_gyro->roomtime % int32(60)) > 57)
-			xx--; /* Blinks */
-
-		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-			show_one(-1, -1, xx);
-			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
-		}
-
-		switch (_vm->_gyro->roomtime % 50) {
-		case 45 :
-			show_one(-1, -1, 9);
-			break; /* Spurge blinks */
-		case 49 :
-			show_one(-1, -1, 10);
-			break;
+			switch (_vm->_gyro->roomtime % 50) {
+			case 45 :
+				drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
+				break; 
+			case 49 :
+				drawBackgroundSprite(-1, -1, 10);
+				break;
+			}
 		}
 		break;
+	case r__ducks: {
+			if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers.
+				drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
 
-	case r__ducks:
-		if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
-			show_one(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
-
-		{/* _vm->_lucerna->bearing of Avvy from Duck. */
-		if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
-			xx = 4; /* Middle. */
-		else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
-			xx = 6; /* Left. */
-		else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
-			xx = 8; /* Right. */
+			// Bearing of Avvy from Duck.
+			if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
+				direction = 4; // Middle.
+			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
+				direction = 6; // Left.
+			else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
+				direction = 8; // Right.
 
-		if ((_vm->_gyro->roomtime % 45) > 42)
-			xx += 1; /* Duck blinks */
+			if ((_vm->_gyro->roomtime % 45) > 42)
+				direction++; // Duck blinks.
 
-		if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
-			show_one(-1, -1, xx);
-			_vm->_gyro->dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */
+			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+			}
 		}
 		break;
-
 	}
-}
 
 	if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) {
-		/* They're ringing the bells. */
+		// They're ringing the bells.
 		switch (_vm->_gyro->roomtime % 4) {
 		case 1:
 			if (_vm->_gyro->dna.nextbell < 5)
@@ -263,86 +255,84 @@ void Celer::pics_link() {
 			_vm->_gyro->note(_vm->_gyro->notes[_vm->_gyro->dna.nextbell]);
 			break;
 		case 2:
-			//nosound;
+			//nosound();
 			warning("STUB: Celer::pics_link()");
 			break;
 		}
 	}
 }
 
-void Celer::load_chunks(Common::String xx) {
-	chunkblocktype ch;
-	byte fv;
-	
-	filename = filename.format("chunk%s.avd", xx.c_str());
-	if (!f.open(filename)) {
-		warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
+void Celer::loadBackgroundSprites(Common::String xx) {
+	_filename = _filename.format("chunk%s.avd", xx.c_str());
+	if (!_f.open(_filename)) {
+		warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 		return;
 	}
 
-	f.seek(44);
-	num_chunks = f.readByte();
-	for (byte i = 0; i < num_chunks; i++)
-		offsets[i] = f.readSint32LE();
+	_f.seek(44);
+	_chunkNum = _f.readByte();
+	for (byte i = 0; i < _chunkNum; i++)
+		_offsets[i] = _f.readSint32LE();
 
-	for (fv = 0; fv < num_chunks; fv++) {
-		f.seek(offsets[fv]);
+	for (byte i = 0; i < _chunkNum; i++) {
+		_f.seek(_offsets[i]);
 		
-		ch.flavour = flavourtype(f.readByte());
-		ch.x = f.readSint16LE();
-		ch.y = f.readSint16LE();
-		ch.xl = f.readSint16LE();
-		ch.yl = f.readSint16LE();
-		ch.size = f.readSint32LE();
-		ch.natural = f.readByte();
-		ch.memorise = f.readByte();
+		SpriteType sprite;
+		sprite._type = PictureType(_f.readByte());
+		sprite._x = _f.readSint16LE();
+		sprite._y = _f.readSint16LE();
+		sprite._xl = _f.readSint16LE();
+		sprite._yl = _f.readSint16LE();
+		sprite._size = _f.readSint32LE();
+		sprite._natural = _f.readByte();
+		sprite._memorise = _f.readByte();
 				
-		if (ch.memorise) {
-			memos[fv].x = ch.x;
-			memos[fv].xl = ch.xl;
-			memos[fv].y = ch.y;
-			memos[fv].yl = ch.yl;
-			memos[fv].flavour = ch.flavour;
-
-			if (ch.natural) {
-				memos[fv].flavour = ch_natural_image; // We simply read from the screen and later, in display_it() we draw it right back.
-				memos[fv].size = memos[fv].xl * 8 * memos[fv].yl + 1; 
-				memory[fv].create(memos[fv].xl * 8, memos[fv].yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
-
-				for (uint16 j = 0; j < memos[fv].yl + 1; j++)
-					for (uint16 i = 0; i < memos[fv].xl * 8; i++)
-						*(byte *)memory[fv].getBasePtr(i, j) = *_vm->_graphics->getPixel(memos[fv].x * 8 + i, memos[fv].y + j);
+		if (sprite._memorise) {
+			_memos[i]._x = sprite._x;
+			_memos[i]._xl = sprite._xl;
+			_memos[i]._y = sprite._y;
+			_memos[i]._yl = sprite._yl;
+			_memos[i]._type = sprite._type;
+
+			if (sprite._natural) {
+				_memos[i]._type = kBaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
+				_memos[i]._size = _memos[i]._xl * 8 * _memos[i]._yl + 1; 
+				_memory[i].create(_memos[i]._xl * 8, _memos[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+
+				for (uint16 y = 0; y < _memos[i]._yl + 1; y++)
+					for (uint16 x = 0; x < _memos[i]._xl * 8; x++)
+						*(byte *)_memory[i].getBasePtr(x, y) = *_vm->_graphics->getPixel(_memos[i]._x * 8 + x, _memos[i]._y + y);
 			} else {
-				memos[fv].size = ch.size;
-				memory[fv] = _vm->_graphics->loadPictureRow(f, memos[fv].xl * 8, memos[fv].yl + 1); // Celer::forget_chunks() deallocates it.
+				_memos[i]._size = sprite._size;
+				_memory[i] = _vm->_graphics->loadPictureRow(_f, _memos[i]._xl * 8, _memos[i]._yl + 1); // Celer::forget_chunks() deallocates it.
 			}
 		} else
-			memos[fv].x = on_disk;
+			_memos[i]._x = kOnDisk;
 	}
-	f.close();
+	_f.close();
 }
 
-void Celer::forget_chunks() {
-	for (byte fv = 0; fv < num_chunks; fv ++)
-		if (memos[fv].x > on_disk)
-			memory[fv].free();
+void Celer::forgetBackgroundSprites() {
+	for (byte i = 0; i < _chunkNum; i ++)
+		if (_memos[i]._x > kOnDisk)
+			_memory[i].free();
 
-	memset(memos, 255, sizeof(memos)); /* x=-1, => on disk. */
+	memset(_memos, 255, sizeof(_memos)); /* x=-1, => on disk. */
 }
 
-void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture) {
-	r.x1 = x;
-	r.y1 = y;
-	r.y2 = y + yl;
+void Celer::drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType flavour, const ::Graphics::Surface &picture) {
+	_r.x1 = x;
+	_r.y1 = y;
+	_r.y2 = y + yl;
 
 	switch (flavour) {
-	case ch_natural_image: // Allow fallthorugh on purpose.
-	case ch_bgi : {
-		r.x2 = x + xl + 1;
+	case kBaturalImage: // Allow fallthorugh on purpose.
+	case kBgi : {
+		_r.x2 = x + xl + 1;
 		}
 		break;
-	case ch_ega : {
-		r.x2 = x + xl;
+	case kEga : {
+		_r.x2 = x + xl;
 		}
 		break;
 	}
@@ -351,52 +341,52 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour
 	_vm->_graphics->drawPicture(_vm->_graphics->_background, picture, x, y - 10);
 }
 
-void Celer::show_one(int16 destX, int16 destY, byte which) {
-	chunkblocktype ch;
+void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 	which--; // For the difference between the Pascal and C array indexes.
 	//setactivepage(3);
 	warning("STUB: Celer::show_one()");
 
-	if (memos[which].x > on_disk) {
-		if (destX == -1) {
-			destX = memos[which].x * 8;
-			destY = memos[which].y;
+	if (_memos[which]._x > kOnDisk) {
+		if (destX < 0) {
+			destX = _memos[which]._x * 8;
+			destY = _memos[which]._y;
 		}
-		display_it(destX, destY, memos[which].xl, memos[which].yl, memos[which].flavour, memory[which]);
+		drawSprite(destX, destY, _memos[which]._xl, _memos[which]._yl, _memos[which]._type, _memory[which]);
 	} else {
-		if (!f.open(filename)) { /* Filename was set in load_chunks() */
-			warning("AVALANCHE: Celer: File not found: %s", filename.c_str());
+		if (!_f.open(_filename)) { /* Filename was set in load_chunks() */
+			warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 			return;
 		}
 
-		f.seek(offsets[which]);
+		_f.seek(_offsets[which]);
 
-		ch.flavour = flavourtype(f.readByte());
-		ch.x = f.readSint16LE();
-		ch.y = f.readSint16LE();
-		ch.xl = f.readSint16LE();
-		ch.yl = f.readSint16LE();
-		ch.size = f.readSint32LE();
-		ch.natural = f.readByte();
-		ch.memorise = f.readByte();
+		SpriteType sprite;
+		sprite._type = PictureType(_f.readByte());
+		sprite._x = _f.readSint16LE();
+		sprite._y = _f.readSint16LE();
+		sprite._xl = _f.readSint16LE();
+		sprite._yl = _f.readSint16LE();
+		sprite._size = _f.readSint32LE();
+		sprite._natural = _f.readByte();
+		sprite._memorise = _f.readByte();
 
-		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, ch.xl * 8, ch.yl + 1);
+		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(_f, sprite._xl * 8, sprite._yl + 1);
 
-		if (destX == -1) {
-			destX = ch.x * 8;
-			destY = ch.y;
+		if (destX < 0) {
+			destX = sprite._x * 8;
+			destY = sprite._y;
 		}
-		display_it(destX, destY, ch.xl, ch.yl, ch.flavour, picture);
+		drawSprite(destX, destY, sprite._xl, sprite._yl, sprite._type, picture);
 
 		picture.free();
-		f.close();
+		_f.close();
 	}
 
 	//setactivepage(1 - cp);
 	warning("STUB: Celer::show_one()");
 
-	for (byte fv = 0; fv < 2; fv ++)
-		_vm->_trip->getset[fv].remember(r);
+	for (byte i = 0; i < 2; i ++)
+		_vm->_trip->getset[i].remember(_r);
 }
 
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 3c7eda3..f85ba34 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -36,35 +36,37 @@
 
 #include "graphics/surface.h"
 
+
+
 namespace Avalanche {
 class AvalancheEngine;
 
 class Celer {
 public:
-	enum flavourtype {ch_ega, ch_bgi, ch_natural_image};
+	enum PictureType {kEga, kBgi, kBaturalImage};
 
-	struct chunkblocktype {
-		flavourtype flavour;
-		int16 x, y;
-		int16 xl, yl;
-		int32 size;
-		bool natural;
+	struct SpriteType {
+		PictureType _type;
+		int16 _x, _y;
+		int16 _xl, _yl;
+		int32 _size;
+		bool _natural;
 
-		bool memorise; /* Hold it in memory? */
+		bool _memorise; /* Hold it in memory? */
 	};
 
-	struct memotype {
-		int16 x, y;
-		int16 xl, yl;
-		flavourtype flavour;
-		uint16 size;
+	struct MemoType {
+		int16 _x, _y;
+		int16 _xl, _yl;
+		PictureType _type;
+		uint16 _size;
 	};
 
-	int32 offsets[40];
-	byte num_chunks;
-	memotype memos[40];
-	::Graphics::Surface memory[40]; // .free() is called in ~Celer()
-	bytefield r;
+	int32 _offsets[40];
+	byte _chunkNum;
+	MemoType _memos[40];
+	::Graphics::Surface _memory[40]; // .free() is called in ~Celer()
+	bytefield _r;
 
 	
 
@@ -72,27 +74,27 @@ public:
 
 	~Celer();
 
-	void pics_link();
+	void refreshBackgroundSprites();
 
-	void load_chunks(Common::String xx);
+	void loadBackgroundSprites(Common::String xx);
 
-	void forget_chunks();
+	void forgetBackgroundSprites();
 
-	// Settint the destination to -1,-1 means the picture should be drawn to it's original position.
+	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
 	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
 	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
-	void show_one(int16 destX, int16 destY, byte which);
+	void drawBackgroundSprite(int16 destX, int16 destY, byte which);
 
 private:
 	AvalancheEngine *_vm;
 
-	Common::String filename;
+	Common::String _filename;
 
-	Common::File f;
+	Common::File _f;
 
-	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */
+	static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */
 
-	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, const ::Graphics::Surface &picture);
+	void drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType type, const ::Graphics::Surface &picture);
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index d2f0e8f..9e04ddb 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -262,7 +262,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	load_also(xx);
 
-	_vm->_celer->load_chunks(xx);
+	_vm->_celer->loadBackgroundSprites(xx);
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
@@ -292,7 +292,7 @@ void Lucerna::find_people(byte room) {
 
 void Lucerna::exitroom(byte x) {
 	//nosound();
-	_vm->_celer->forget_chunks();
+	_vm->_celer->forgetBackgroundSprites();
 	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
 
 	switch (x) {
@@ -391,7 +391,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	switch (x) {
 	case r__yours:
 		if (_vm->_gyro->dna.avvy_in_bed) {
-			_vm->_celer->show_one(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
 		}
@@ -492,7 +492,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__bridge: {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
-			_vm->_celer->show_one(-1, -1, 3); /* Position of drawbridge */
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Position of drawbridge */
 			_vm->_graphics->refreshBackground();
 			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
 		}
@@ -518,10 +518,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 
 		if (!_vm->_gyro->dna.mushroom_growing) 
-			_vm->_celer->show_one(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
 	}
 	break;
@@ -603,11 +603,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__argentpub: {
 		if (_vm->_gyro->dna.wonnim)
-			_vm->_celer->show_one(-1, -1, 1);   /* No lute by the settle. */
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   /* No lute by the settle. */
 		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
 		if (_vm->_gyro->dna.givenbadgetoiby) {
-			_vm->_celer->show_one(-1, -1, 8);
-			_vm->_celer->show_one(-1, -1, 9);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		}
 		_vm->_graphics->refreshBackground();
 	}
@@ -624,7 +624,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.geida_follows) {
 			put_geida_at(5, ped);
 			if (_vm->_gyro->dna.lustie_is_asleep) {
-				_vm->_celer->show_one(-1, -1, 5);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
 			}
 		}
@@ -634,14 +634,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__musicroom: {
 		if (_vm->_gyro->dna.jacques_awake > 0) {
 			_vm->_gyro->dna.jacques_awake = 5;
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_celer->show_one(-1, -1, 4);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 			_vm->_gyro->magics[brown - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {
-			_vm->_celer->show_one(-1, -1, 6);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(6);
 			_vm->_sequence->then_show(5);
@@ -653,7 +653,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsidenottspub:
 		if (ped == 2) {
-			_vm->_celer->show_one(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(3);
 			_vm->_sequence->then_show(2);
@@ -665,7 +665,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsideargentpub:
 		if (ped == 2)  {
-			_vm->_celer->show_one(-1, -1, 6);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(6);
 			_vm->_sequence->then_show(5);
@@ -692,7 +692,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__insidecardiffcastle:
 		if (ped > 0) {
 			_vm->_trip->tr[1].init(10, false, _vm->_trip); /* Define the dart. */
-			_vm->_celer->show_one(-1, -1, 1);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
@@ -701,22 +701,22 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_sequence->then_show(2);
 
 			if (_vm->_gyro->dna.taken_pen)
-				_vm->_celer->show_one(-1, -1, 4);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 
 			_vm->_sequence->start_to_close();
 		} else {
-			_vm->_celer->show_one(-1, -1, 1);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			if (_vm->_gyro->dna.arrow_in_the_door)
-				_vm->_celer->show_one(-1, -1, 3);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			else
-				_vm->_celer->show_one(-1, -1, 2);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case r__avvysgarden:
 		if (ped == 1)  {
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(2);
 			_vm->_sequence->then_show(1);
@@ -735,7 +735,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_sequence->then_show(3);
 			_vm->_sequence->start_to_close();*/
 
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(2);
 			_vm->_sequence->then_show(1);
@@ -746,7 +746,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__aylesoffice:
 		if (_vm->_gyro->dna.ayles_is_awake)
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break; /* Ayles awake. */
 
@@ -766,7 +766,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__nottspub: {
-		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->show_one(-1, -1, 3);
+		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
 	}
 	break;
@@ -774,7 +774,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsideducks:
 		if (ped == 2) {
 			/* Shut the door */
-			_vm->_celer->show_one(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(3);
 			_vm->_sequence->first_show(2);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index d9f52a3..68a8ea3 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -102,7 +102,7 @@ void Sequence::call_sequencer() {
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
 		/* Show a frame. */
-		_vm->_celer->show_one(-1, -1, seq[0]);
+		_vm->_celer->drawBackgroundSprite(-1, -1, seq[0]);
 		shove_left();
 	}
 	
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index ab1fcf0..7979a8d 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -224,7 +224,7 @@ void Timeout::lose_timer(byte which) {
 
 void Timeout::open_drawbridge() {
 	_vm->_gyro->dna.drawbridge_open++;
-	_vm->_celer->show_one(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix; // You may enter the drawbridge.
@@ -265,7 +265,7 @@ void Timeout::bang2() {
 void Timeout::stairs() {
 	_vm->_gyro->blip();
 	_vm->_trip->tr[0].walkto(4);
-	_vm->_celer->show_one(-1, -1, 2);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->dna.brummie_stairs = 2;
 	_vm->_gyro->magics[10].op = _vm->_gyro->special;
 	_vm->_gyro->magics[10].data = 2; // Reached the bottom of the stairs.
@@ -379,17 +379,17 @@ void Timeout::jacques_wakes_up() {
 
 	switch (_vm->_gyro->dna.jacques_awake) { // Additional pictures.
 	case 1 :
-		_vm->_celer->show_one(-1, -1, 1); // Eyes open.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
 		_vm->_visa->dixi('Q', 45);
 		break;
 	case 2 : // Going through the door.
-		_vm->_celer->show_one(-1, -1, 2); // Not on the floor.
-		_vm->_celer->show_one(-1, -1, 3); // But going through the door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
-		_vm->_celer->show_one(-1, -1, 2); // Not on the floor, either.
-		_vm->_celer->show_one(-1, -1, 4); // He's gone... so the door's open.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
 		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; // Gone!
 		break;
 	}
@@ -418,7 +418,7 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 	_vm->_trip->tr[1].walkto(3); // He walks over to you.
 
 	// Let's get the door opening.
-	_vm->_celer->show_one(-1, -1, 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 	_vm->_sequence->first_show(2);
 	_vm->_sequence->start_to_close();
 
@@ -433,7 +433,7 @@ void Timeout::naughty_duke2() {
 }
 
 void Timeout::naughty_duke3() {
-	_vm->_celer->show_one(-1, -1, 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 	_vm->_sequence->first_show(2);
 	_vm->_sequence->start_to_close();
 }
@@ -475,7 +475,7 @@ void Timeout::jump() {
 		if (_vm->_gyro->dna.carrying >= maxobjs)
 			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_gyro->dna.arrow_in_the_door = false; // You've got it.
 			_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true;
 			_vm->_lucerna->objectlist();
@@ -491,7 +491,7 @@ void Timeout::crapulus_says_splud_out() {
 }
 
 void Timeout::buydrinks() {
-	_vm->_celer->show_one(-1, -1, 11); // Malagauche gets up again.
+	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); // Display message about it.
@@ -503,7 +503,7 @@ void Timeout::buydrinks() {
 }
 
 void Timeout::buywine() {
-	_vm->_celer->show_one(-1, -1, 11); // Malagauche gets up again.
+	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->dna.malagauche = 0;
 
 	_vm->_visa->dixi('D', 50); // You buy the wine.
@@ -595,7 +595,7 @@ void Timeout::avvy_sit_down() {
 	if (_vm->_trip->tr[0].homing)    // Still walking.
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
-		_vm->_celer->show_one(-1, -1, 3);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->dna.sitting_in_pub = true;
 		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_trip->tr[0].visible = false;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 5e42839..e034446 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -578,59 +578,59 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
 		break;
 	case 0x1: /* no connection (wall + shield), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 29); /* ...shield. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); /* ...shield. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 30); /* ...door. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door. */
 		break;
 	case 0x3: /* wall with door and shield */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->show_one(-1, -1, 29); /* ...shield. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); /* ...shield. */
 		break;
 	case 0x4: /* no connection (wall + window), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 5);  /* ...window. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  /* ...window. */
 		break;
 	case 0x5: /* wall with door and window */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->show_one(-1, -1, 5); /* ...window. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 7); /* ...torches. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->show_one(-1, -1, 7); /* ...torches. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -645,44 +645,44 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 19);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
 		break;
 	case 0x1: /* no connection (wall + window), */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 20); /* ...window. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); /* ...window. */
 		break;
 	case 0x2: /* wall with door */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 21); /* ...door. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...door. */
 		break;
 	case 0x3: /* wall with door and window */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 20); /* ...door, and... */
-		_vm->_celer->show_one(-1, -1, 21); /* ...window. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); /* ...door, and... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...window. */
 		break;
 	case 0x6: /* no connection (wall + torches), */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 18); /* ...torches. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); /* ...torches. */
 		break;
 	case 0x7: /* wall with door and torches */
 		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
 		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
 		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->show_one(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->show_one(-1, -1, 21); /* ...door, and... */
-		_vm->_celer->show_one(-1, -1, 18); /* ...torches. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...door, and... */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); /* ...torches. */
 		break;
 	case 0xf: /* straight-through corridor. */
 		_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Sloping wall. */
@@ -700,7 +700,7 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x1:
-		_vm->_celer->show_one(-1, -1, 22);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 			
 		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
 			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
@@ -711,13 +711,13 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
-		_vm->_celer->show_one(-1, -1, 23);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
 		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Middle exit south. */
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
-		_vm->_celer->show_one(-1, -1, 24);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
 		_vm->_gyro->magics[11].op = _vm->_gyro->special; /* Left exit south. */
 		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
@@ -738,7 +738,7 @@ void Trip::catamove(byte ped) {
 		break;
 */
 	case 0x2:
-		_vm->_celer->show_one(-1, -1, 4);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
@@ -755,7 +755,7 @@ void Trip::catamove(byte ped) {
 		break;
 */
 	case 0x5:
-		_vm->_celer->show_one(-1, -1, 3);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; /* Middle exit north. */
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
@@ -770,12 +770,12 @@ void Trip::catamove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9: {
-		_vm->_celer->show_one(-1, -1, 6);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer->show_one(-1, -1, 31);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer->show_one(-1, -1, 32);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
 
 		_vm->_gyro->magics[0].op = _vm->_gyro->special; /* Middle arch north. */
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
@@ -785,50 +785,50 @@ void Trip::catamove(byte ped) {
 	case 0xd: /* No connection + WINDOW */
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 14);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
 		break;
 	case 0xe: /* No connection + TORCH */
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
 		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->show_one(-1, -1, 8);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;
 	/* Recessed door: */
 	case 0xf:
 		_vm->_gyro->magics[0].op = _vm->_gyro->nix; /* Door to Geida's room. */
-		_vm->_celer->show_one(-1, -1, 1);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_celer->show_one(-1, -1, 17);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 17);
 		break;     /* [2,2] : "Art Gallery" sign over door. */
 	case 264:
-		_vm->_celer->show_one(-1, -1, 9);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		break;      /* [8,1] : "The Wrong Way!" sign. */
 	case 1797:
-		_vm->_celer->show_one(-1, -1, 2);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		break;      /* [5,7] : "Ite Mingite" sign. */
 	case 258:
 		for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
-			_vm->_celer->show_one(130 + fv * 120, 70, 15);
-			_vm->_celer->show_one(184 + fv * 120, 78, 16);
+			_vm->_celer->drawBackgroundSprite(130 + fv * 120, 70, 15);
+			_vm->_celer->drawBackgroundSprite(184 + fv * 120, 78, 16);
 		}
 		break;
 	case 1287:
 		for (fv = 10; fv <= 13; fv++)
-			_vm->_celer->show_one(-1, -1, fv);
+			_vm->_celer->drawBackgroundSprite(-1, -1, fv);
 		break; /* [7,5] : 4 candles. */
 	case 776:
-		_vm->_celer->show_one(-1, -1, 10);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 		break;     /* [8,3] : 1 candle. */
 	case 2049:
-		_vm->_celer->show_one(-1, -1, 11);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
 		break;     /* [1,8] : another candle. */
 	case 257:
-		_vm->_celer->show_one(-1, -1, 12);
-		_vm->_celer->show_one(-1, -1, 13);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
 		break; /* [1,1] : the other two. */
 	}
 
@@ -851,7 +851,7 @@ void Trip::dawndelay() {
 void Trip::call_special(uint16 which) {
 	switch (which) {
 	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
-		_vm->_celer->show_one(-1, -1, 1);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->dna.brummie_stairs = 1;
 		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
@@ -897,7 +897,7 @@ void Trip::call_special(uint16 which) {
 			_vm->_visa->dixi('q', 35);
 			tr[0].done();
 			/*tr[1].vanishifstill:=true;*/
-			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->dixi('q', 36);
 			_vm->_gyro->dna.tied_up = true;
 			_vm->_gyro->dna.friar_will_tie_you_up = false;
@@ -1246,7 +1246,7 @@ void Trip::arrow_procs(byte tripnum) {
 		}
 	} else { /* Arrow has hit the wall! */
 		tr[tripnum].done(); /* Deallocate the arrow. */
-		_vm->_celer->show_one(-1, -1, 3); /* Show pic of arrow stuck into the door. */
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Show pic of arrow stuck into the door. */
 		_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
 	}
 		
@@ -1493,7 +1493,7 @@ void Trip::hide_in_the_cupboard() {
 		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
 			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
 		_vm->_gyro->dna.avvys_in_the_cupboard = true;
-		_vm->_celer->show_one(-1, -1, 8);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 	}
 }
 


Commit: a6fb557a516fd5deaef5be43b888ecdd9149daca
    https://github.com/scummvm/scummvm/commit/a6fb557a516fd5deaef5be43b888ecdd9149daca
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T13:36:28-07:00

Commit Message:
AVALANCHE: Some more renaming and a little bit of refactoring in Celer.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 37329f1..ec73649 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -55,8 +55,6 @@ Celer::~Celer() {
 }
 
 void Celer::refreshBackgroundSprites() {
-	byte direction;
-
 	if (_vm->_gyro->ddmnow)
 		return; // No animation when the menus are up.
 
@@ -119,6 +117,7 @@ void Celer::refreshBackgroundSprites() {
 				break; 
 			}
 
+			byte direction;
 			if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
 				if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
 					direction = 3;
@@ -154,9 +153,9 @@ void Celer::refreshBackgroundSprites() {
 		break;
 	case r__lustiesroom:
 		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
+			byte direction;
 			if ((_vm->_gyro->roomtime % 45) > 42)
 				direction = 4; // du Lustie blinks.
-
 			// Bearing of Avvy from du Lustie.
 			else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
 					direction = 1; // Middle.
@@ -197,6 +196,7 @@ void Celer::refreshBackgroundSprites() {
 		break;
 	case r__nottspub: {
 			// Bearing of Avvy from Port.
+			byte direction;
 			if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
 				direction = 2; // Middle.
 			else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
@@ -227,6 +227,7 @@ void Celer::refreshBackgroundSprites() {
 				drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
 
 			// Bearing of Avvy from Duck.
+			byte direction;
 			if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
 				direction = 4; // Middle.
 			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
@@ -251,7 +252,7 @@ void Celer::refreshBackgroundSprites() {
 		case 1:
 			if (_vm->_gyro->dna.nextbell < 5)
 				_vm->_gyro->dna.nextbell = 12;
-			_vm->_gyro->dna.nextbell -= 1;
+			_vm->_gyro->dna.nextbell--;
 			_vm->_gyro->note(_vm->_gyro->notes[_vm->_gyro->dna.nextbell]);
 			break;
 		case 2:
@@ -262,8 +263,8 @@ void Celer::refreshBackgroundSprites() {
 	}
 }
 
-void Celer::loadBackgroundSprites(Common::String xx) {
-	_filename = _filename.format("chunk%s.avd", xx.c_str());
+void Celer::loadBackgroundSprites(byte number) {
+	_filename = _filename.format("chunk%d.avd", number);
 	if (!_f.open(_filename)) {
 		warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 		return;
@@ -295,7 +296,7 @@ void Celer::loadBackgroundSprites(Common::String xx) {
 			_memos[i]._type = sprite._type;
 
 			if (sprite._natural) {
-				_memos[i]._type = kBaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
+				_memos[i]._type = kNaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
 				_memos[i]._size = _memos[i]._xl * 8 * _memos[i]._yl + 1; 
 				_memory[i].create(_memos[i]._xl * 8, _memos[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
 
@@ -320,13 +321,13 @@ void Celer::forgetBackgroundSprites() {
 	memset(_memos, 255, sizeof(_memos)); /* x=-1, => on disk. */
 }
 
-void Celer::drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType flavour, const ::Graphics::Surface &picture) {
+void Celer::drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType type, const ::Graphics::Surface &picture) {
 	_r.x1 = x;
 	_r.y1 = y;
 	_r.y2 = y + yl;
 
-	switch (flavour) {
-	case kBaturalImage: // Allow fallthorugh on purpose.
+	switch (type) {
+	case kNaturalImage: // Allow fallthorugh on purpose.
 	case kBgi : {
 		_r.x2 = x + xl + 1;
 		}
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index f85ba34..07fb065 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -43,7 +43,7 @@ class AvalancheEngine;
 
 class Celer {
 public:
-	enum PictureType {kEga, kBgi, kBaturalImage};
+	enum PictureType {kEga, kBgi, kNaturalImage};
 
 	struct SpriteType {
 		PictureType _type;
@@ -76,7 +76,7 @@ public:
 
 	void refreshBackgroundSprites();
 
-	void loadBackgroundSprites(Common::String xx);
+	void loadBackgroundSprites(byte number);
 
 	void forgetBackgroundSprites();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 9e04ddb..2b4c5fe 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -262,7 +262,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	load_also(xx);
 
-	_vm->_celer->loadBackgroundSprites(xx);
+	_vm->_celer->loadBackgroundSprites(n);
 
 	bit = *_vm->_graphics->getPixel(0,0);
 


Commit: 3fe9c6d90b6e5b416e0fa2d6db78044d066aaedf
    https://github.com/scummvm/scummvm/commit/3fe9c6d90b6e5b416e0fa2d6db78044d066aaedf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T13:48:38-07:00

Commit Message:
AVALANCHE: Removing the file variable from Celer's member variables.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index ec73649..4eefe3c 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -264,29 +264,30 @@ void Celer::refreshBackgroundSprites() {
 }
 
 void Celer::loadBackgroundSprites(byte number) {
+	Common::File f;
 	_filename = _filename.format("chunk%d.avd", number);
-	if (!_f.open(_filename)) {
+	if (!f.open(_filename)) {
 		warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 		return;
 	}
 
-	_f.seek(44);
-	_chunkNum = _f.readByte();
+	f.seek(44);
+	_chunkNum = f.readByte();
 	for (byte i = 0; i < _chunkNum; i++)
-		_offsets[i] = _f.readSint32LE();
+		_offsets[i] = f.readSint32LE();
 
 	for (byte i = 0; i < _chunkNum; i++) {
-		_f.seek(_offsets[i]);
+		f.seek(_offsets[i]);
 		
 		SpriteType sprite;
-		sprite._type = PictureType(_f.readByte());
-		sprite._x = _f.readSint16LE();
-		sprite._y = _f.readSint16LE();
-		sprite._xl = _f.readSint16LE();
-		sprite._yl = _f.readSint16LE();
-		sprite._size = _f.readSint32LE();
-		sprite._natural = _f.readByte();
-		sprite._memorise = _f.readByte();
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		sprite._natural = f.readByte();
+		sprite._memorise = f.readByte();
 				
 		if (sprite._memorise) {
 			_memos[i]._x = sprite._x;
@@ -305,12 +306,12 @@ void Celer::loadBackgroundSprites(byte number) {
 						*(byte *)_memory[i].getBasePtr(x, y) = *_vm->_graphics->getPixel(_memos[i]._x * 8 + x, _memos[i]._y + y);
 			} else {
 				_memos[i]._size = sprite._size;
-				_memory[i] = _vm->_graphics->loadPictureRow(_f, _memos[i]._xl * 8, _memos[i]._yl + 1); // Celer::forget_chunks() deallocates it.
+				_memory[i] = _vm->_graphics->loadPictureRow(f, _memos[i]._xl * 8, _memos[i]._yl + 1); // Celer::forget_chunks() deallocates it.
 			}
 		} else
 			_memos[i]._x = kOnDisk;
 	}
-	_f.close();
+	f.close();
 }
 
 void Celer::forgetBackgroundSprites() {
@@ -354,24 +355,25 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		}
 		drawSprite(destX, destY, _memos[which]._xl, _memos[which]._yl, _memos[which]._type, _memory[which]);
 	} else {
-		if (!_f.open(_filename)) { /* Filename was set in load_chunks() */
+		Common::File f;
+		if (!f.open(_filename)) { // Filename was set in loadBackgroundSprites().
 			warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 			return;
 		}
 
-		_f.seek(_offsets[which]);
+		f.seek(_offsets[which]);
 
 		SpriteType sprite;
-		sprite._type = PictureType(_f.readByte());
-		sprite._x = _f.readSint16LE();
-		sprite._y = _f.readSint16LE();
-		sprite._xl = _f.readSint16LE();
-		sprite._yl = _f.readSint16LE();
-		sprite._size = _f.readSint32LE();
-		sprite._natural = _f.readByte();
-		sprite._memorise = _f.readByte();
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		sprite._natural = f.readByte();
+		sprite._memorise = f.readByte();
 
-		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(_f, sprite._xl * 8, sprite._yl + 1);
+		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
 
 		if (destX < 0) {
 			destX = sprite._x * 8;
@@ -380,7 +382,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		drawSprite(destX, destY, sprite._xl, sprite._yl, sprite._type, picture);
 
 		picture.free();
-		_f.close();
+		f.close();
 	}
 
 	//setactivepage(1 - cp);
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 07fb065..8f0a489 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -90,8 +90,6 @@ private:
 
 	Common::String _filename;
 
-	Common::File _f;
-
 	static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */
 
 	void drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType type, const ::Graphics::Surface &picture);


Commit: 212391f337a3beee1fa4d987b62fe8494ab1fc02
    https://github.com/scummvm/scummvm/commit/212391f337a3beee1fa4d987b62fe8494ab1fc02
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T14:41:15-07:00

Commit Message:
AVALANCHE: Refactor Celer.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 4eefe3c..daec21c 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -44,16 +44,18 @@ namespace Avalanche {
 const int16 Celer::kOnDisk = -1;
 
 
+
 Celer::Celer(AvalancheEngine *vm) {
 	_vm = vm;
-	_chunkNum = 0;
+	_spriteNum = 0;
 }
 
 Celer::~Celer() {
-	for (byte i = 0; i < 40; i++)
-		_memory[i].free();
+	forgetBackgroundSprites();
 }
 
+
+
 void Celer::refreshBackgroundSprites() {
 	if (_vm->_gyro->ddmnow)
 		return; // No animation when the menus are up.
@@ -272,11 +274,11 @@ void Celer::loadBackgroundSprites(byte number) {
 	}
 
 	f.seek(44);
-	_chunkNum = f.readByte();
-	for (byte i = 0; i < _chunkNum; i++)
+	_spriteNum = f.readByte();
+	for (byte i = 0; i < _spriteNum; i++)
 		_offsets[i] = f.readSint32LE();
 
-	for (byte i = 0; i < _chunkNum; i++) {
+	for (byte i = 0; i < _spriteNum; i++) {
 		f.seek(_offsets[i]);
 		
 		SpriteType sprite;
@@ -286,61 +288,38 @@ void Celer::loadBackgroundSprites(byte number) {
 		sprite._xl = f.readSint16LE();
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
-		sprite._natural = f.readByte();
-		sprite._memorise = f.readByte();
+		bool natural = f.readByte();
+		bool memorise = f.readByte();
 				
-		if (sprite._memorise) {
-			_memos[i]._x = sprite._x;
-			_memos[i]._xl = sprite._xl;
-			_memos[i]._y = sprite._y;
-			_memos[i]._yl = sprite._yl;
-			_memos[i]._type = sprite._type;
-
-			if (sprite._natural) {
-				_memos[i]._type = kNaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
-				_memos[i]._size = _memos[i]._xl * 8 * _memos[i]._yl + 1; 
-				_memory[i].create(_memos[i]._xl * 8, _memos[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
-
-				for (uint16 y = 0; y < _memos[i]._yl + 1; y++)
-					for (uint16 x = 0; x < _memos[i]._xl * 8; x++)
-						*(byte *)_memory[i].getBasePtr(x, y) = *_vm->_graphics->getPixel(_memos[i]._x * 8 + x, _memos[i]._y + y);
+		if (memorise) {
+			_sprites[i]._x = sprite._x;
+			_sprites[i]._xl = sprite._xl;
+			_sprites[i]._y = sprite._y;
+			_sprites[i]._yl = sprite._yl;
+			_sprites[i]._type = sprite._type;
+
+			if (natural) {
+				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
+				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; 
+				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+
+				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++)
+					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
+						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *_vm->_graphics->getPixel(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
 			} else {
-				_memos[i]._size = sprite._size;
-				_memory[i] = _vm->_graphics->loadPictureRow(f, _memos[i]._xl * 8, _memos[i]._yl + 1); // Celer::forget_chunks() deallocates it.
+				_sprites[i]._size = sprite._size;
+				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1); // Celer::forget_chunks() deallocates it.
 			}
 		} else
-			_memos[i]._x = kOnDisk;
+			_sprites[i]._x = kOnDisk;
 	}
 	f.close();
 }
 
 void Celer::forgetBackgroundSprites() {
-	for (byte i = 0; i < _chunkNum; i ++)
-		if (_memos[i]._x > kOnDisk)
-			_memory[i].free();
-
-	memset(_memos, 255, sizeof(_memos)); /* x=-1, => on disk. */
-}
-
-void Celer::drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType type, const ::Graphics::Surface &picture) {
-	_r.x1 = x;
-	_r.y1 = y;
-	_r.y2 = y + yl;
-
-	switch (type) {
-	case kNaturalImage: // Allow fallthorugh on purpose.
-	case kBgi : {
-		_r.x2 = x + xl + 1;
-		}
-		break;
-	case kEga : {
-		_r.x2 = x + xl;
-		}
-		break;
-	}
-
-	// These pictures are practically parts of the background. -10 is for the drop-down menu.
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, picture, x, y - 10);
+	for (byte i = 0; i < _spriteNum; i ++)
+		if (_sprites[i]._x > kOnDisk)
+			_sprites[i]._picture.free();
 }
 
 void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
@@ -348,12 +327,12 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 	//setactivepage(3);
 	warning("STUB: Celer::show_one()");
 
-	if (_memos[which]._x > kOnDisk) {
+	if (_sprites[which]._x > kOnDisk) {
 		if (destX < 0) {
-			destX = _memos[which]._x * 8;
-			destY = _memos[which]._y;
+			destX = _sprites[which]._x * 8;
+			destY = _sprites[which]._y;
 		}
-		drawSprite(destX, destY, _memos[which]._xl, _memos[which]._yl, _memos[which]._type, _memory[which]);
+		drawSprite(destX, destY, _sprites[which]);
 	} else {
 		Common::File f;
 		if (!f.open(_filename)) { // Filename was set in loadBackgroundSprites().
@@ -370,18 +349,15 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		sprite._xl = f.readSint16LE();
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
-		sprite._natural = f.readByte();
-		sprite._memorise = f.readByte();
-
-		::Graphics::Surface picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
+		f.skip(2); // For the now not existing natural and memorise data members of the SpriteType (called chunkblocktype in the original).
+		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
 
 		if (destX < 0) {
 			destX = sprite._x * 8;
 			destY = sprite._y;
 		}
-		drawSprite(destX, destY, sprite._xl, sprite._yl, sprite._type, picture);
+		drawSprite(destX, destY, sprite);
 
-		picture.free();
 		f.close();
 	}
 
@@ -394,4 +370,23 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 
 
 
+void Celer::drawSprite(int16 x, int16 y, const SpriteType &sprite) {
+	_r.x1 = x;
+	_r.y1 = y;
+	_r.y2 = y + sprite._yl;
+
+	switch (sprite._type) {
+	case kNaturalImage: // Allow fallthorugh on purpose.
+	case kBgi:
+		_r.x2 = x + sprite._xl + 1;
+		break;
+	case kEga:
+		_r.x2 = x + sprite._xl;
+		break;
+	}
+
+	// These pictures are practically parts of the background. -10 is for the drop-down menu.
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
+}
+
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 8f0a489..aac4c88 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -43,37 +43,12 @@ class AvalancheEngine;
 
 class Celer {
 public:
-	enum PictureType {kEga, kBgi, kNaturalImage};
-
-	struct SpriteType {
-		PictureType _type;
-		int16 _x, _y;
-		int16 _xl, _yl;
-		int32 _size;
-		bool _natural;
-
-		bool _memorise; /* Hold it in memory? */
-	};
-
-	struct MemoType {
-		int16 _x, _y;
-		int16 _xl, _yl;
-		PictureType _type;
-		uint16 _size;
-	};
-
-	int32 _offsets[40];
-	byte _chunkNum;
-	MemoType _memos[40];
-	::Graphics::Surface _memory[40]; // .free() is called in ~Celer()
-	bytefield _r;
-
-	
-
 	Celer(AvalancheEngine *vm);
 
 	~Celer();
 
+
+
 	void refreshBackgroundSprites();
 
 	void loadBackgroundSprites(byte number);
@@ -86,13 +61,33 @@ public:
 	void drawBackgroundSprite(int16 destX, int16 destY, byte which);
 
 private:
+	enum PictureType {kEga, kBgi, kNaturalImage};
+
+	struct SpriteType {
+		PictureType _type;
+		int16 _x, _y;
+		int16 _xl, _yl;
+		int32 _size;
+		::Graphics::Surface _picture;
+	};
+
+
+
 	AvalancheEngine *_vm;
 
+	int32 _offsets[40];
+	byte _spriteNum;
+	SpriteType _sprites[40];
+	bytefield _r;
 	Common::String _filename;
 
+
+
 	static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */
 
-	void drawSprite(int16 x, int16 y, int16 xl, int16 yl, PictureType type, const ::Graphics::Surface &picture);
+
+
+	void drawSprite(int16 x, int16 y, const SpriteType &sprite);
 };
 
 } // End of namespace Avalanche.


Commit: 4ae897e3a95f8899b3056627f882e6179b4ebba3
    https://github.com/scummvm/scummvm/commit/4ae897e3a95f8899b3056627f882e6179b4ebba3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-03T14:56:37-07:00

Commit Message:
AVALANCHE: Repair comments in Celer.

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index daec21c..acfde95 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -299,7 +299,7 @@ void Celer::loadBackgroundSprites(byte number) {
 			_sprites[i]._type = sprite._type;
 
 			if (natural) {
-				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in display_it() we draw it right back.
+				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
 				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; 
 				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
 
@@ -308,7 +308,7 @@ void Celer::loadBackgroundSprites(byte number) {
 						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *_vm->_graphics->getPixel(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
 			} else {
 				_sprites[i]._size = sprite._size;
-				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1); // Celer::forget_chunks() deallocates it.
+				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
 			}
 		} else
 			_sprites[i]._x = kOnDisk;


Commit: 4cf40bc87a0252c6533d0896143c511669b417af
    https://github.com/scummvm/scummvm/commit/4cf40bc87a0252c6533d0896143c511669b417af
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T00:25:11-07:00

Commit Message:
AVALANCHE: Rename refreshBackgroundSprites() to updateBackgroundSprites() in Celer.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index c75bfa4..57ecb8e 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -716,7 +716,7 @@ void Acci::openBox(bool isOpening) {
 	if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
-		_vm->_celer->refreshBackgroundSprites();
+		_vm->_celer->updateBackgroundSprites();
 		_vm->_trip->trippancy_link();
 		_vm->_graphics->refreshScreen();
 
@@ -724,7 +724,7 @@ void Acci::openBox(bool isOpening) {
 
 		if (!isOpening) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
-			_vm->_celer->refreshBackgroundSprites();
+			_vm->_celer->updateBackgroundSprites();
 			_vm->_trip->trippancy_link();
 			_vm->_graphics->refreshScreen();
 		}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d3dfbff..2f09899 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -482,7 +482,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_gyro->ontoolbar = false;
 	_trip->trippancy_link();
 
-	_celer->refreshBackgroundSprites();
+	_celer->updateBackgroundSprites();
 	
 	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
 		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index cade90e..7e0f84e 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -204,7 +204,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_dropdown->menu_link();
 		_vm->_gyro->force_numlock();
 		_vm->_trip->get_back_loretta();
-		_vm->_celer->refreshBackgroundSprites();
+		_vm->_celer->updateBackgroundSprites();
 		_vm->_trip->trippancy_link();
 		_vm->_lucerna->checkclick();
 		_vm->_timeout->one_tick();
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index acfde95..ababd4a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -56,7 +56,7 @@ Celer::~Celer() {
 
 
 
-void Celer::refreshBackgroundSprites() {
+void Celer::updateBackgroundSprites() {
 	if (_vm->_gyro->ddmnow)
 		return; // No animation when the menus are up.
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index aac4c88..56c5f22 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -49,7 +49,7 @@ public:
 
 
 
-	void refreshBackgroundSprites();
+	void updateBackgroundSprites();
 
 	void loadBackgroundSprites(byte number);
 


Commit: a2c42df2b21bb913fc44fae05456da9f069c1b64
    https://github.com/scummvm/scummvm/commit/a2c42df2b21bb913fc44fae05456da9f069c1b64
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-09-04T00:25:45-07:00

Commit Message:
AVALANCHE: Fix compile errors

Signed-off-by: uruk <koppirnyo at gmail.com>

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 57ecb8e..72653b2 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -629,7 +629,7 @@ void Acci::examineObject() {
 	if (_thing != _vm->_gyro->thinks)
 		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->a_thing);
 	switch (_thing) {
-	case _vm->_gyro->wine :
+	case Gyro::wine :
 		switch (_vm->_gyro->dna.winestate) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_visa->dixi('t', 1); // Normal examine wine scroll
@@ -642,7 +642,7 @@ void Acci::examineObject() {
 			break;
 		}
 		break;
-	case _vm->_gyro->onion:
+	case Gyro::onion:
 		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa->dixi('q', 21); // Yucky onion.
 		else
@@ -775,7 +775,7 @@ void Acci::inventory() {
 
 void Acci::swallow() {   /* Eat something. */
 	switch (_thing) {
-	case _vm->_gyro->wine:
+	case Gyro::wine:
 		switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */
 		case 1: {
 				if (_vm->_gyro->dna.teetotal)  {
@@ -796,25 +796,25 @@ void Acci::swallow() {   /* Eat something. */
 			break; /* You can't drink it! */
 		}
 		break;
-	case _vm->_gyro->potion: {
+	case Gyro::potion: {
 			_vm->_gyro->background(4);
 			_vm->_visa->dixi('U', 3);
 			_vm->_lucerna->gameover();
 			_vm->_gyro->background(0);
 		}
 		break;
-	case _vm->_gyro->ink:
+	case Gyro::ink:
 		_vm->_visa->dixi('U', 4);
 		break;
-	case _vm->_gyro->chastity:
+	case Gyro::chastity:
 		_vm->_visa->dixi('U', 5);
 		break;
-	case _vm->_gyro->mushroom: {
+	case Gyro::mushroom: {
 			_vm->_visa->dixi('U', 6);
 			_vm->_lucerna->gameover();
 		}
 		break;
-	case _vm->_gyro->onion:
+	case Gyro::onion:
 		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa->dixi('U', 11);
 		else {
@@ -931,21 +931,21 @@ void Acci::openDoor() {
 			fv -= 8;
 
 			switch (_vm->_gyro->portals[fv].op) {
-			case _vm->_gyro->exclaim:
+			case Gyro::exclaim:
 				_vm->_trip->tr[0].bounce();
 				_vm->_visa->dixi('word', _vm->_gyro->portals[fv].data);
 				break;
-			case _vm->_gyro->transport:
+			case Gyro::transport:
 				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
 				break;
-			case _vm->_gyro->unfinished:
+			case Gyro::unfinished:
 				_vm->_trip->tr[0].bounce();
 				_vm->_scrolls->display("Sorry. This place is not available yet!");
 				break;
-			case _vm->_gyro->special:
+			case Gyro::special:
 				_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
 				break;
-			case _vm->_gyro->mopendoor:
+			case Gyro::mopendoor:
 				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv + 9);
 				break;
 			}
@@ -980,7 +980,7 @@ void Acci::putProc() {
 
 	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
 	switch (_thing2) {
-	case _vm->_gyro->wine:
+	case Gyro::wine:
 		if (_thing == _vm->_gyro->onion) {
 			if (_vm->_gyro->dna.rotten_onion)
 				_vm->_scrolls->display("That's a bit like shutting the stable door after the horse has bolted!");
@@ -1004,16 +1004,16 @@ void Acci::putProc() {
 				_vm->_scrolls->display("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
-				case _vm->_gyro->money:
+				case Gyro::money:
 					_vm->_scrolls->display("You'd better keep some ready cash on you!");
 					break;
-				case _vm->_gyro->bell:
+				case Gyro::bell:
 					_vm->_scrolls->display("That's a silly place to keep a bell.");
 					break;
-				case _vm->_gyro->bodkin:
+				case Gyro::bodkin:
 					_vm->_scrolls->display("But you might need it!");
 					break;
-				case _vm->_gyro->onion:
+				case Gyro::onion:
 					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
@@ -1061,7 +1061,7 @@ bool Acci::giveToSpludwick() {
 	}
 
 	switch (_thing) {
-	case _vm->_gyro->onion:
+	case Gyro::onion:
 		_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
 		if (_vm->_gyro->dna.rotten_onion)
 			_vm->_visa->dixi('pos', 22);
@@ -1073,7 +1073,7 @@ bool Acci::giveToSpludwick() {
 		}
 		_vm->_lucerna->objectlist();
 		break;
-	case _vm->_gyro->ink:
+	case Gyro::ink:
 		_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false;
 		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.given2spludwick++;
@@ -1081,7 +1081,7 @@ bool Acci::giveToSpludwick() {
 		goToCauldron();
 		_vm->_lucerna->points(3);
 		break;
-	case _vm->_gyro->mushroom:
+	case Gyro::mushroom:
 		_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false;
 		_vm->_visa->dixi('pos', 25);
 		_vm->_lucerna->points(5);
@@ -1192,7 +1192,7 @@ void Acci::getProc(char thing) {
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
-		case _vm->_gyro->pen:
+		case Gyro::pen:
 			if (_vm->_trip->infield(2)) { // Standing on the dais.
 				if (_vm->_gyro->dna.taken_pen)
 					_vm->_scrolls->display("It's not there, Avvy.");
@@ -1210,7 +1210,7 @@ void Acci::getProc(char thing) {
 			else
 				_vm->_visa->dixi('pos', 51);
 			break;
-		case _vm->_gyro->bolt:
+		case Gyro::bolt:
 			_vm->_visa->dixi('pos', 52);
 			break;
 		default:
@@ -1388,35 +1388,35 @@ void Acci::doThat() {
 				_vm->_scrolls->display("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
-				case _vm->_gyro->money :
+				case Gyro::money :
 					_vm->_scrolls->display("You can't bring yourself to give away your moneybag.");
 					break;
-				case _vm->_gyro->bodkin:
-				case _vm->_gyro->bell:
-				case _vm->_gyro->clothes:
-				case _vm->_gyro->habit :
+				case Gyro::bodkin:
+				case Gyro::bell:
+				case Gyro::clothes:
+				case Gyro::habit :
 					_vm->_scrolls->display("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
-					case _vm->_gyro->pcrapulus:
+					case Gyro::pcrapulus:
 						if (_thing == _vm->_gyro->wine) {
 							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 						} else
 							heyThanks();
 						break;
-					case _vm->_gyro->pcwytalot:
+					case Gyro::pcwytalot:
 						if ((_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
 							_vm->_scrolls->display(Common::String("You might be able to influence Cwytalot more if you used it!"));
 						else
 							heyThanks();
 						break;
-					case _vm->_gyro->pspludwick:
+					case Gyro::pspludwick:
 						if (giveToSpludwick())
 							heyThanks();
 						break;
-					case _vm->_gyro->pibythneth:
+					case Gyro::pibythneth:
 						if (_thing == _vm->_gyro->badge) {
 							_vm->_visa->dixi('pos', 32); // Thanks! Wow!
 							_vm->_lucerna->points(3);
@@ -1428,7 +1428,7 @@ void Acci::doThat() {
 						} else
 							heyThanks();
 						break;
-					case _vm->_gyro->payles:
+					case Gyro::payles:
 						if (_vm->_gyro->dna.ayles_is_awake) {
 							if (_thing == _vm->_gyro->pen) {
 								_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false;
@@ -1442,25 +1442,25 @@ void Acci::doThat() {
 						} else
 							_vm->_scrolls->display("But he's asleep!");
 						break;
-					case _vm->_gyro->pgeida:
+					case Gyro::pgeida:
 						switch (_thing) {
-						case _vm->_gyro->potion:
+						case Gyro::potion:
 							_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = false;
 							_vm->_visa->dixi('u', 16); // She drinks it.
 							_vm->_lucerna->points(2);
 							_vm->_gyro->dna.geida_given_potion = true;
 							_vm->_lucerna->objectlist();
 							break;
-						case _vm->_gyro->lute:
+						case Gyro::lute:
 							giveGeidaTheLute();
 							break;
 						default:
 							heyThanks();
 						}
 						break;
-					case _vm->_gyro->parkata:
+					case Gyro::parkata:
 						switch (_thing) {
-						case _vm->_gyro->potion:
+						case Gyro::potion:
 							if (_vm->_gyro->dna.geida_given_potion)
 								winSequence();
 							else
@@ -1544,11 +1544,11 @@ void Acci::doThat() {
 	case kVerbCodeWear:
 		if (holding()) { // Wear something.
 			switch (_thing) {
-			case _vm->_gyro->chastity:
+			case Gyro::chastity:
 				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??!");
 				break;
-			case _vm->_gyro->clothes:
-			case _vm->_gyro->habit: { /* Change this! */
+			case Gyro::clothes:
+			case Gyro::habit: { /* Change this! */
 					if (_vm->_gyro->dna.wearing != kNothing) {
 						if (_vm->_gyro->dna.wearing == _thing)
 							_vm->_scrolls->display("You're already wearing that.");
@@ -1625,7 +1625,7 @@ void Acci::doThat() {
 			}
 		} else if (holding()) {
 			switch (_thing) {
-			case _vm->_gyro->lute : {
+			case Gyro::lute : {
 					_vm->_visa->dixi('U', 7);
 
 					if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
@@ -1772,7 +1772,7 @@ void Acci::doThat() {
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
-				case _vm->_gyro->wine:
+				case Gyro::wine:
 					if (_vm->_gyro->dna.obj[_vm->_gyro->wine - 1])  // We've already got the wine!
 						_vm->_visa->dixi('D', 2); // 1 bottle's shufishent!
 					else {
@@ -1918,13 +1918,13 @@ void Acci::doThat() {
 			_vm->_scrolls->display("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
-			case _vm->_gyro->parkata:
+			case Gyro::parkata:
 				_vm->_visa->dixi('U', 12);
 				break;
-			case _vm->_gyro->pgeida:
+			case Gyro::pgeida:
 				_vm->_visa->dixi('U', 13);
 				break;
-			case _vm->_gyro->pwisewoman:
+			case Gyro::pwisewoman:
 				_vm->_visa->dixi('U', 14);
 				break;
 			default:
@@ -1952,7 +1952,7 @@ void Acci::doThat() {
 		if (isPersonHere())
 			switch (_person) {
 			case kPardon:
-			case _vm->_gyro->pavalot:
+			case Gyro::pavalot:
 			case 0:
 				if (!_vm->_gyro->dna.avvy_is_awake) {
 					_vm->_gyro->dna.avvy_is_awake = true;
@@ -1964,11 +1964,11 @@ void Acci::doThat() {
 				} else
 					_vm->_scrolls->display("You're already awake, Avvy!");
 				break;
-			case _vm->_gyro->payles:
+			case Gyro::payles:
 				if (!_vm->_gyro->dna.ayles_is_awake)
 					_vm->_scrolls->display("You can't seem to wake him by yourself.");
 				break;
-			case _vm->_gyro->pjacques:
+			case Gyro::pjacques:
 				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + 
 					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 95a6724..224fb01 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -316,25 +316,25 @@ Dropdown::Dropdown(AvalancheEngine *vm) {
 
 void Dropdown::find_what_you_can_do_with_it() {
 	switch (_vm->_gyro->thinks) {
-	case _vm->_gyro->wine:
-	case _vm->_gyro->potion:
-	case _vm->_gyro->ink:
+	case Gyro::wine:
+	case Gyro::potion:
+	case Gyro::ink:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeDrink;
 		break;
-	case _vm->_gyro->bell:
+	case Gyro::bell:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeRing;
 		break;
-	case _vm->_gyro->chastity:
+	case Gyro::chastity:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
-	case _vm->_gyro->lute:
+	case Gyro::lute:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodePlay;
 		break;
-	case _vm->_gyro->mushroom:
-	case _vm->_gyro->onion:
+	case Gyro::mushroom:
+	case Gyro::onion:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeEat;
 		break;
-	case _vm->_gyro->clothes:
+	case Gyro::clothes:
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
 	default:
@@ -578,18 +578,18 @@ void Dropdown::ddm__with() {
 		ddm_o.opt(Common::String("Talk to h") + himher(_vm->_gyro->thinks), 'T', "", true);
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
 		switch (_vm->_gyro->thinks) {
-		case _vm->_gyro->pgeida:
-		case _vm->_gyro->parkata: {
+		case Gyro::pgeida:
+		case Gyro::parkata: {
 			ddm_o.opt("Kiss her", 'K', "", true);
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeKiss;
 		}
 		break;
-		case _vm->_gyro->pdogfood: {
+		case Gyro::pdogfood: {
 			ddm_o.opt("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodePlay;
 		}
 		break;
-		case _vm->_gyro->pmalagauche: {
+		case Gyro::pmalagauche: {
 			n = !_vm->_gyro->dna.teetotal;
 			ddm_o.opt("Buy some wine", 'w', "", !_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]);
 			ddm_o.opt("Buy some beer", 'b', "", n);
@@ -599,7 +599,7 @@ void Dropdown::ddm__with() {
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\145' + '\144' + '\146' + '\147' + '\150';
 		}
 		break;
-		case _vm->_gyro->ptrader: {
+		case Gyro::ptrader: {
 			ddm_o.opt("Buy an onion", 'o', "", !_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]);
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\151';
 		}
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index f21645d..300d275 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -783,7 +783,7 @@ void Scrolls::calldrivers() {
 						return;
 					}
 					break;
-					case _vm->_acci->kNothing:
+					case Acci::kNothing:
 						display("nothing at all. It's completely empty.");
 						break;
 					default:
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index e034446..dc45c6c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -222,27 +222,27 @@ void triptype::walk() {
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
 			switch (_tr->_vm->_gyro->magics[tc].op) {
-			case _tr->_vm->_gyro->exclaim: {
+			case Gyro::exclaim: {
 				bounce();
 				_tr->mustexclaim = true;
 				_tr->saywhat = _tr->_vm->_gyro->magics[tc].data;
 				}
 				break;
-			case _tr->_vm->_gyro->bounces:
+			case Gyro::bounces:
 				bounce();
 				break;
-			case _tr->_vm->_gyro->transport:
+			case Gyro::transport:
 				_tr->fliproom(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff);
 				break;
-			case _tr->_vm->_gyro->unfinished: {
+			case Gyro::unfinished: {
 				bounce();
 				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
-			case _tr->_vm->_gyro->special:
+			case Gyro::special:
 				_tr->call_special(_tr->_vm->_gyro->magics[tc].data);
 				break;
-			case _tr->_vm->_gyro->mopendoor:
+			case Gyro::mopendoor:
 				_tr->open_the_door(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff, tc);
 				break;
 			}
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 8a311d0..0c005fa 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -171,7 +171,7 @@ void Visa::talkto(byte whom) {
 
 	if (_vm->_gyro->subjnumber == 0)
 		switch (whom) {
-		case _vm->_gyro->pspludwick:
+		case Gyro::pspludwick:
 			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion - 1])) {
 				dixi('q', 68);
 				_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
@@ -201,20 +201,20 @@ void Visa::talkto(byte whom) {
 				}
 			}
 			break;
-		case _vm->_gyro->pibythneth:
+		case Gyro::pibythneth:
 			if (_vm->_gyro->dna.givenbadgetoiby) {
 				dixi('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
-		case _vm->_gyro->pdogfood:
+		case Gyro::pdogfood:
 			if (_vm->_gyro->dna.wonnim) { // We've won the game.
 				dixi('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
 				_vm->_gyro->dna.asked_dogfood_about_nim = true;
 			break;
-		case _vm->_gyro->payles:
+		case Gyro::payles:
 			if (!_vm->_gyro->dna.ayles_is_awake) {
 				dixi('q', 43); // He's fast asleep!
 				return;
@@ -224,11 +224,11 @@ void Visa::talkto(byte whom) {
 			}
 			break;
 
-		case _vm->_gyro->pjacques: {
+		case Gyro::pjacques: {
 			dixi('q', 43);
 			return;
 			}
-		case _vm->_gyro->pgeida:
+		case Gyro::pgeida:
 			if (_vm->_gyro->dna.geida_given_potion)
 				_vm->_gyro->dna.geida_follows = true;
 			else {
@@ -236,7 +236,7 @@ void Visa::talkto(byte whom) {
 				return;
 			}
 			break;
-		case _vm->_gyro->pspurge:
+		case Gyro::pspurge:
 			if (!_vm->_gyro->dna.sitting_in_pub) {
 				dixi('q', 71); // Try going over and sitting down.
 				return;


Commit: 458dd5d0cc4dfad39cbd1a3ec161cc55991ef10e
    https://github.com/scummvm/scummvm/commit/458dd5d0cc4dfad39cbd1a3ec161cc55991ef10e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T00:45:53-07:00

Commit Message:
AVALANCHE: Fix link error using MSVC9

Changed paths:
    engines/avalanche/module.mk



diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 7f2e40c..dbaa546 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -3,7 +3,7 @@ MODULE := engines/avalanche
 MODULE_OBJS = \
 	avalanche.o \
 	graphics.o \
-	parser.o\
+	parser.o \
 	avalot.o \
 	console.o \
 	detection.o \


Commit: ccba9863eb3494ad7be532bf4458e752620dca2b
    https://github.com/scummvm/scummvm/commit/ccba9863eb3494ad7be532bf4458e752620dca2b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T01:02:53-07:00

Commit Message:
AVALANCHE: Silent a warning

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2f09899..f34603a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -608,11 +608,14 @@ Common::String AvalancheEngine::elmToStr(Elm how) {
 	switch (how) {
 	case kNormal:
 	case kMusical:
-		return "jsb";
+		return Common::String("jsb");
 	case kRegi:
-		return "REGI";
+		return Common::String("REGI");
 	case kElmpoyten:
-		return "ELMPOYTEN";
+		return Common::String("ELMPOYTEN");
+	// Useless, but silent a warning
+	default:
+		return Common::String("");
 	}
 }
 


Commit: a8d9978de8440bb402f55cdaf0338b947e346491
    https://github.com/scummvm/scummvm/commit/a8d9978de8440bb402f55cdaf0338b947e346491
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T01:03:47-07:00

Commit Message:
AVALANCHE: Silent a sign mismatch warning, improve loop condition

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 224fb01..4ef6504 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -106,7 +106,7 @@ void onemenu::start_afresh() {
 }
 
 void onemenu::opt(Common::String n, char tr, Common::String key, bool val) {
-	int16 l = (n + key).size() + 3;
+	uint16 l = (n + key).size() + 3;
 	if (width < l)
 		width = l;
 
@@ -127,9 +127,9 @@ void onemenu::displayopt(byte y, bool highlit) {
 	//bar((flx1 + 1) * 8, 3 + y * 10, (flx2 + 1) * 8, 12 + y * 10);
 
 	Common::String data = oo[y].title;
-	while ((data + oo[y].shortcut).size() < width)
+	while (data.size() + oo[y].shortcut.size() < width)
 		data += ' '; /* Pad oo[y] spaces. */
-	data = data + oo[y].shortcut;
+	data += oo[y].shortcut;
 
 	if (highlit)
 		_dr->hlchalk(left, 4 + (y + 1) * 10, oo[y].trigger, data, oo[y].valid);
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 73325a3..f0f3917 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -72,7 +72,7 @@ class onemenu {
 public:
 	optiontype oo[12];
 	byte number;
-	int16 width, left;
+	uint16 width, left;
 	bool firstlix;
 	int16 flx1, flx2, fly;
 	byte oldy; /* used by Lightup */


Commit: b38fd85d707ec78f2b3d693bf292669a4b54e749
    https://github.com/scummvm/scummvm/commit/b38fd85d707ec78f2b3d693bf292669a4b54e749
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T01:09:07-07:00

Commit Message:
AVALANCHE: Do renaming/refactoring in Closing.

Changed paths:
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/closing2.cpp
    engines/avalanche/closing2.h



diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index d34c3ff..e09c72e 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -33,6 +33,8 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
+
+
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2f09899..e96a249 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -42,6 +42,7 @@
 #include "graphics/thumbnail.h"
 
 
+
 namespace Avalanche {
 
 AvalancheEngine *AvalancheEngine::s_Engine = 0;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 393bb4d..3ef5bcf 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -58,6 +58,7 @@
 #include "graphics/cursorman.h"
 
 
+
 namespace Common {
 class RandomSource;
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7e0f84e..e7a7a49 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -234,7 +234,7 @@ void Avalot::run(Common::String arg) {
 	//	close(logfile);
 	warning("STUB: Avalot::run()");
 
-	_vm->_closing->end_of_program();
+	_vm->_closing->exitGame();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/closing2.cpp b/engines/avalanche/closing2.cpp
index 431b1af..c9bfcd0 100644
--- a/engines/avalanche/closing2.cpp
+++ b/engines/avalanche/closing2.cpp
@@ -36,6 +36,8 @@
 #include "common/textconsole.h"
 #include "common/random.h"
 
+
+
 namespace Avalanche {
 
 Closing::Closing(AvalancheEngine *vm) {
@@ -43,23 +45,19 @@ Closing::Closing(AvalancheEngine *vm) {
 	warning("STUB: Closing::Closing()");
 }
 
-void Closing::get_screen(byte which) {
-	warning("STUB: Closing::get_screen()");
-}
-
-void Closing::show_screen() {
-	warning("STUB: Closing::show_screen()");
+void Closing::getScreen(ScreenType which) {
+	warning("STUB: Closing::getScreen()");
 }
 
-void Closing::quit_with(byte which, byte errorlev) {
-	warning("STUB: Closing::quit_with()");
+void Closing::showScreen() {
+	warning("STUB: Closing::showScreen()");
 }
 
-void Closing::put_in(Common::String x, uint16 where) {
-	warning("STUB: Closing::put_in()");
+void Closing::putIn(Common::String str, uint16 where) {
+	warning("STUB: Closing::putIn()");
 }
 
-void Closing::end_of_program() {
+void Closing::exitGame() {
 	const Common::String nouns[12] = {
 		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
 		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
@@ -72,17 +70,17 @@ void Closing::end_of_program() {
 
 	Common::String result;
 
-	//nosound;
-	warning("STUB: Closing::end_of_program()");
+	//nosound();
+	warning("STUB: Closing::exitGame()");
 
-	get_screen(scr_nagscreen);
+	getScreen(kScreenNagScreen);
 	result = nouns[_vm->_rnd->getRandomNumber(12)] + " will " + verbs[_vm->_rnd->getRandomNumber(12)] + " you";
-	put_in(result, 1628);
-	show_screen(); /* No halt- it's already set up. */
+	putIn(result, 1628);
+	showScreen(); // No halt- it's already set up.
 }
 
-void Closing::bug_handler() {
-	warning("STUB: Closing::bug_handler()");
+void Closing::handleBug() {
+	warning("STUB: Closing::handleBug()");
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
index ed73f9f..14cf54b 100644
--- a/engines/avalanche/closing2.h
+++ b/engines/avalanche/closing2.h
@@ -33,38 +33,37 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
+
+
 namespace Avalanche {
 class AvalancheEngine;
 
 class Closing {
 public:
-	static const int16 scr_bugalert = 1;
-	static const int16 scr_ramcram = 2;
-	static const int16 scr_nagscreen = 3;
-	static const int16 scr_twocopies = 5;
-
 	Closing(AvalancheEngine *vm);
 
-	void quit_with(byte which, byte errorlev);
-
-	void end_of_program();
+	void exitGame();
 
 private:
-	AvalancheEngine *_vm;
+	enum ScreenType {
+		kScreenBugAlert = 1,
+		kScreenRamCram = 2,
+		kScreenNagScreen = 3,
+		kScreenTwoCopies = 5,
+	};
 
-	typedef Common::String scrtype;
+	AvalancheEngine *_vm;
 
-	scrtype q /*absolute $B8FA:0*/; /* Nobody's using the graphics memory now. */
-	//file<scrtype> f;
-	void *exitsave;
+	Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
+	Common::File f;
 
-	void get_screen(byte which);
+	void getScreen(ScreenType which);
 
-	void show_screen();
+	void showScreen();
 
-	void put_in(Common::String x, uint16 where);
+	void putIn(Common::String str, uint16 where);
 
-	void bug_handler();
+	void handleBug();
 };
 
 } // End of namespace Avalanche.


Commit: d148d08683606f3feadf4f461762eb2487ea2eca
    https://github.com/scummvm/scummvm/commit/d148d08683606f3feadf4f461762eb2487ea2eca
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T01:09:56-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/module.mk





Commit: 666d3eecfcbb038d6b1b33f231c3a03bcbd726b4
    https://github.com/scummvm/scummvm/commit/666d3eecfcbb038d6b1b33f231c3a03bcbd726b4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T01:14:56-07:00

Commit Message:
AVALANCHE: Replace some British terms by American ones

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index ababd4a..2d16dc6 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -289,9 +289,9 @@ void Celer::loadBackgroundSprites(byte number) {
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
 		bool natural = f.readByte();
-		bool memorise = f.readByte();
+		bool memorize = f.readByte();
 				
-		if (memorise) {
+		if (memorize) {
 			_sprites[i]._x = sprite._x;
 			_sprites[i]._xl = sprite._xl;
 			_sprites[i]._y = sprite._y;
@@ -349,7 +349,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		sprite._xl = f.readSint16LE();
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
-		f.skip(2); // For the now not existing natural and memorise data members of the SpriteType (called chunkblocktype in the original).
+		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
 		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
 
 		if (destX < 0) {
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 4ef6504..064af29 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
- /* DROPDOWN	A customised version of Oopmenu (qv). */
+ /* DROPDOWN	A customized version of Oopmenu (qv). */
 
 #include "avalanche/avalanche.h"
 
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index f0f3917..7b8f972 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* DROPDOWN	A customised version of Oopmenu (qv). */
+/* DROPDOWN	A customized version of Oopmenu (qv). */
 
 #ifndef DROPDOWN2_H
 #define DROPDOWN2_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b6dbe16..eaf547c 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -77,7 +77,7 @@ Graphics::~Graphics() {
 }
 
 
-void Graphics::flesh_colours()
+void Graphics::flesh_colors()
 {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ca28772..7f27186 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -84,7 +84,7 @@ public:
 
 	~Graphics();
 
-	void flesh_colours();
+	void flesh_colors();
 
 	byte *getPixel(int16 x, int16 y);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 2b4c5fe..8b278f0 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -219,7 +219,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 	
 	CursorMan.showMouse(false);
 	
-	_vm->_graphics->flesh_colours();
+	_vm->_graphics->flesh_colors();
 
 	xx = _vm->_gyro->strf(n);
 	Common::String filename;
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 8c49721..db9e431 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -102,7 +102,7 @@ public:
 
 	uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees.
 
-	void flesh_colours();
+	void flesh_colors();
 
 	void sprite_run();
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 300d275..6c1ef73 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -736,7 +736,7 @@ void Scrolls::calldrivers() {
 					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].y; // Position.
 		
 					_vm->_gyro->talkf = _vm->_gyro->quasipeds[param - 10].fgc;
-					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colours.
+					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colors.
 				} else {
 					_vm->_lucerna->errorled(); // Not valid.
 					natural();
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index dc45c6c..7e444dc 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -447,7 +447,7 @@ triptype *triptype::done() {
 
 
 getsettype *getsettype::init() {
-	numleft = 0; /* initialise array pointer */
+	numleft = 0; /* initialize array pointer */
 	return this;
 }
 
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index cc13c9b..f91e72c 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -44,7 +44,7 @@ struct adxtype { /* Second revision of ADX type */
 	Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16.
 	byte num; /* number of pictures */
 	byte seq; /* how many in one stride */
-	byte fgc, bgc; /* foreground & background bubble colours */
+	byte fgc, bgc; /* foreground & background bubble colors */
 	byte accinum; /* the number according to Acci (1=Avvy, etc.) */
 };
 


Commit: 543c4f59daabaf13a52f451d245adb44f391971c
    https://github.com/scummvm/scummvm/commit/543c4f59daabaf13a52f451d245adb44f391971c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T01:43:51-07:00

Commit Message:
AVALANCHE: Remove logger

Changed paths:
  R engines/avalanche/logger2.cpp
  R engines/avalanche/logger2.h
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 72653b2..2d532bb 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1603,7 +1603,6 @@ void Acci::doThat() {
 					_vm->_gyro->dna.playednim++;
 
 					// You won - strange!
-					_vm->_logger->log_aside("You won.");
 					_vm->_visa->dixi('Q', 7); // You won! Give us a lute!
 					_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true;
 					_vm->_lucerna->objectlist();
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 68272c8..3d8ba61 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -66,7 +66,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _avalot;
 	delete _gyro;
 	delete _enhanced;
-	delete _logger;
 	delete _pingo;
 	delete _scrolls;
 	delete _visa;
@@ -88,7 +87,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
 	_enhanced = new Enhanced(this);
-	_logger = new Logger(this);
 	_pingo = new Pingo(this);
 	_scrolls = new Scrolls(this);
 	_visa = new Visa(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 3ef5bcf..63f654f 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -36,7 +36,6 @@
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/enhanced2.h"
-#include "avalanche/logger2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
@@ -77,7 +76,6 @@ public:
 	Avalot *_avalot;
 	Gyro *_gyro;
 	Enhanced *_enhanced;
-	Logger *_logger;
 	Pingo *_pingo;
 	Scrolls *_scrolls;
 	Visa *_visa;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e7a7a49..c791a77 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -38,7 +38,6 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/dropdown2.h"
 #include "avalanche/pingo2.h"
-#include "avalanche/logger2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/enid2.h"
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 967034a..3caa946 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -559,7 +559,7 @@ public:
 	Common::String roomname; /* Name of this room */
 
 	//text logfile; // http://wiki.freepascal.org/Text
-	bool logging, log_epson;
+	bool log_epson;
 
 	bool cl_override;
 
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
deleted file mode 100644
index 24c6d55..0000000
--- a/engines/avalanche/logger2.cpp
+++ /dev/null
@@ -1,289 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* LOGGER	Handles the logging. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/logger2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/trip6.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-const char Logger::divide[] = "--- oOo ---";
-
-/* Epson codes:
-
-	startwith='';
-	endwith='';
-	double_width = #14; { shift out (SO) }
-	double_off = #20; { device control 4 (DC4) }
-	italic = #27+'4'; { switches italics on... }
-	italic_off = #27+'5'; { and off. }
-	emph_on = #27+#69;
-	emph_off = #27+#70;
-	divide_indent = 15;
-
-*/
-
-/* L'jet codes: */
-
-// Not sure if these will be needed at all...
-
-const Common::String startwith = Common::String(33) + 50 + "10J" + 130;
-const Common::String endwith = Common::String(33) + 105;
-const Common::String italic = Common::String(33) + 50 + 163 + 61 + 123; /* switches italics on... */
-const Common::String italic_off = Common::String(33) + 50 + 163 + 60 + 123; /* and off. */
-const Common::String emph_on = Common::String(33) + 50 + 163 + 63 + 102;
-const Common::String emph_off = Common::String(33) + 50 + 163 + 60 + 102;
-
-const Common::String double_width = emph_on; /* There IS no double-width. */
-const Common::String double_off = emph_off; /* So we'll have to use bold. */
-
-
-
-const Common::String Logger::quote = "ª";
-const Common::String Logger::unquote = "º";
-const Common::String Logger::copyright = "(c)";
-const int16 Logger::divide_indent = 30;
-
-
-
-Logger::Logger(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
-	byte fv;
-	
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::centre()");
-	/*for (fv = 1; fv <= size - (x / 2); fv++)
-		output << logfile << ' ';*/
-}
-
-void Logger::log_setup(Common::String name, bool printing) {     /* Sets up. */
-
-	warning("STUB: Logger::log_setup()");
-
-	/*	assign(logfile, name);
-	rewrite(logfile);
-	output << logfile << startwith;
-	log_epson = printing;
-	logging = true;
-
-	if (!printing)  {
-		quote = '"';
-		unquote = '"';
-		copyright = "(c)";
-	}*/
-}
-
-void Logger::log_divider() {   /* Prints the divider sign. */
-	byte fv;
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_divider()");
-
-	/*
-	if (_vm->_gyro->log_epson) {
-		output << logfile << Common::String(' ') + double_width;
-		for (fv = 1; fv <= divide_indent; fv++)
-			output << logfile << ' ';
-		output << logfile << Common::String(' ') + double_off;
-	} else {
-		for (fv = 1; fv <= 36; fv++)
-			output << logfile << ' ';
-	}
-	output << logfile << divide << NL;
-	*/
-}
-
-void Logger::log_command(Common::String x) {     /* Prints a command */
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_command()");
-
-	/*if (_vm->_gyro->log_epson)
-		output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
-	else
-		output << logfile << Common::String("> ") + x << NL;*/
-}
-
-void Logger::log_addstuff(Common::String x) {
-	if (!_vm->_gyro->logging)
-		return;
-
-	scroll_line += x;
-}
-
-void Logger::log_scrollchar(Common::String x) {     /* print one character */
-	Common::String z;
-	if (!_vm->_gyro->logging)
-		return;
-
-	switch (x[0]) {
-	case '\'':
-		z = quote;
-		break; /* Open quotes: "66" */
-	case '\"':
-		z = unquote;
-		break; /* Close quotes: "99" */
-	case 239:
-		z = copyright;
-		break; /* Copyright sign. */
-	default:
-		z = x;
-	}
-	log_addstuff(z);
-	scroll_line_length += z.size();
-}
-
-void Logger::log_italic() {
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_italic()");
-
-	/*if (_vm->_gyro->log_epson)
-		log_addstuff(italic);
-	else
-		log_addstuff("*");*/
-}
-
-void Logger::log_roman() {
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_roman()");
-
-	/* if (_vm->_gyro->log_epson)
-		log_addstuff(italic_off);
-	else
-		log_addstuff("*");*/
-}
-
-void Logger::log_epsonroman() {   /* This only sends the Roman code if you're on Epson.*/
-	if (!_vm->_gyro->logging)
-		return;
-
-	if (_vm->_gyro->log_epson)
-		log_addstuff(italic_off);
-}
-
-void Logger::log_scrollline() {   /* Set up a line for the scroll driver */
-	scroll_line_length = 0;
-	scroll_line = "";
-}
-
-void Logger::log_scrollendline(bool centred) {
-	byte x, fv;
-	if (!_vm->_gyro->logging)
-		return;
-	x = 17;
-	if (centred)
-		x += (50 - scroll_line_length) / 2;
-
-	warning("STUB: Logger::log_scrollendline()");
-
-	/*for (fv = 1; fv <= x; fv++)
-		output << logfile << ' ';
-	output << logfile << scroll_line << NL;*/
-}
-
-void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
-	byte fv;
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_bubbleline()");
-
-	/*if (linenum == 1) {
-		for (fv = 1; fv <= 15; fv++)
-			output << logfile << ' ';
-		output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
-	} else {
-		for (fv = 1; fv <= 17; fv++)
-			output << logfile << ' ';
-		output << logfile << x << NL;
-	}*/
-}
-
-void Logger::log_newline() {
-	warning("STUB: Logger::log_newline()");
-
-	//if (_vm->_gyro->logging)
-	//	output << logfile << NL;
-}
-
-void Logger::log_newroom(Common::String where) {
-	byte fv;
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_newroom()");
-
-	/*for (fv = 1; fv <= 20; fv++)
-		output << logfile << ' ';
-	if (_vm->_gyro->log_epson)
-		output << logfile << emph_on;
-	output << logfile << Common::String('(') + where + ')';
-	if (_vm->_gyro->log_epson)
-		output << logfile << emph_off;
-	output << logfile << NL;*/
-}
-
-void Logger::log_aside(Common::String what) {
-/* This writes "asides" to the printer. For example, moves in Nim. */
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_aside()");
-
-	//output << logfile << "   (" << italic << what << italic_off << ')' << NL;
-	/* "What" is what to write. */
-}
-
-void Logger::log_score(uint16 credit, uint16 now) {
-	byte fv;
-	if (!_vm->_gyro->logging)
-		return;
-
-	warning("STUB: Logger::log_score()");
-
-	/*for (fv = 1; fv <= 50; fv++)
-		output << logfile << ' ';
-	output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/logger2.h b/engines/avalanche/logger2.h
deleted file mode 100644
index 95e5ea8..0000000
--- a/engines/avalanche/logger2.h
+++ /dev/null
@@ -1,92 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* LOGGER	Handles the logging. */
-
-#ifndef LOGGER2_H
-#define LOGGER2_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Logger {
-public:
-	Logger(AvalancheEngine *vm);
-
-	void log_setup(Common::String name, bool printing);
-
-	void log_divider();    /* Prints the divider sign. */
-
-	void log_command(Common::String x);      /* Prints a command */
-
-	void log_scrollchar(Common::String x);      /* print one character */
-
-	void log_italic();
-
-	void log_roman();
-
-	void log_epsonroman();
-
-	void log_scrollline();    /* Set up a line for the scroll driver */
-
-	void log_scrollendline(bool centred);
-
-	void log_bubbleline(byte linenum, byte whom, Common::String x);
-
-	void log_newline();
-
-	void log_newroom(Common::String where);
-
-	void log_aside(Common::String what);
-
-	void log_score(uint16 credit, uint16 now);
-
-private:
-	AvalancheEngine *_vm;
-
-	static const char divide[];
-
-	static const Common::String quote;
-	static const Common::String unquote;
-	static const Common::String copyright;
-	static const int16 divide_indent;
-
-	Common::String scroll_line;
-	byte scroll_line_length;
-
-	void centre(byte size, byte x);
-
-	void log_addstuff(Common::String x);
-
-};
-
-} // End of namespace Avalanche
-
-#endif // LOGGER2_H
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 8b278f0..f407c5c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/logger2.h"
 #include "avalanche/enhanced2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
@@ -266,8 +265,6 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	bit = *_vm->_graphics->getPixel(0,0);
 
-	_vm->_logger->log_newroom(_vm->_gyro->roomname);
-
 	CursorMan.showMouse(true);
 }
 
@@ -942,7 +939,6 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 	}
 	warning("STUB: Lucerna::points()");
 
-	_vm->_logger->log_score(num, _vm->_gyro->dna.score);
 	showscore();
 }
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index dbaa546..9698025 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -9,7 +9,6 @@ MODULE_OBJS = \
 	detection.o \
 	gyro2.o \
 	enhanced2.o \
-	logger2.o \
 	pingo2.o \
 	scrolls2.o \
 	visa2.o \
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 2457354..8bd6d52 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -80,8 +80,6 @@ void Parser::handleReturn() {
 	if (_vm->_dropdown->ddm_o.menunow)
 		_vm->_parser->tryDropdown();
 	else {
-		_vm->_logger->log_command(_inputText);
-		
 		if (!_inputText.empty()) {
 			_inputTextBackup = _inputText;
 			_vm->_acci->parse();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 6c1ef73..523c37b 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -31,7 +31,6 @@
 
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/logger2.h"
 #include "avalanche/enhanced2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
@@ -105,8 +104,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	fontType itw;
 	byte lz = z.size();
 	
-	_vm->_logger->log_scrollline();
-
 	bool offset = x % 8 == 4;
 	x = x / 8;
 	y++;
@@ -115,12 +112,10 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 		switch (z[xx]) {
 		case kControlRoman: {
 			cfont = roman;
-			_vm->_logger->log_roman();
 			}
 			break;
 		case kControlItalic: {
 			cfont = italic;
-			_vm->_logger->log_italic();
 			}
 			break;
 		default: {
@@ -131,8 +126,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 			i++;
 			Common::String chr(z[xx]);
 			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, black);
-
-			_vm->_logger->log_scrollchar(Common::String(z[xx]));
 			}
 		}
 	}
@@ -269,7 +262,6 @@ void Scrolls::music_scroll() {
 void Scrolls::resetscrolldriver() {   /* phew */
 	_vm->_gyro->scrollbells = 0;
 	cfont = roman;
-	_vm->_logger->log_epsonroman();
 	use_icon = 0;
 	_vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */
 }
@@ -353,7 +345,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
 	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
-	_vm->_logger->log_epsonroman(); /* Scrolls always START with Roman. */
 
 	lx = 0;
 	ly = (_vm->_gyro->scrolln) * 6;
@@ -459,7 +450,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 		else
 			say(mx + icon_indent, my, _vm->_gyro->scroll[b]);
 
-		_vm->_logger->log_scrollendline(centre);
 		my += 12;
 	}
 
@@ -474,7 +464,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	undodgem();
 	_vm->_gyro->dropsok = true;
-	_vm->_logger->log_divider();
 	//setvisualpage(cp);
 	//mousepage(cp);
 	CursorMan.showMouse(false);
@@ -562,11 +551,6 @@ void Scrolls::bubble(func2 gotoit) {
 		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
 	}
 
-	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) /* These should be separate loops. */
-		_vm->_logger->log_bubbleline(fv, param, _vm->_gyro->scroll[fv]);
-
-	_vm->_logger->log_divider();
-
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	_vm->_gyro->oncandopageswap = false;


Commit: d418b2c50c47cb363035885b2b28fcb372c94253
    https://github.com/scummvm/scummvm/commit/d418b2c50c47cb363035885b2b28fcb372c94253
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T02:18:09-07:00

Commit Message:
AVALANCHE: Fix MSVC warnings in lucerna2

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f407c5c..1406c44 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -81,20 +81,19 @@ void Lucerna::callverb(byte n) {
 
 void Lucerna::draw_also_lines() {
 	byte ff;
-	byte squeaky_code;
-
 	
 	CursorMan.showMouse(false);
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
-	for (ff = 0; ff < _vm->_gyro->lineNum; ff++)
+	for (ff = 0; ff < _vm->_gyro->lineNum; ff++) {
 		// We had to check if the lines are within the borders of the screen.
 		if ((_vm->_gyro->lines[ff].x1 >= 0) && (_vm->_gyro->lines[ff].x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y1 >= 0) && (_vm->_gyro->lines[ff].y1 < _vm->_graphics->kScreenHeight)
-			&& (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight))
-				_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
-		
+		 && (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight))
+			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
+	}
+
 	CursorMan.showMouse(true);
 }
 
@@ -111,13 +110,13 @@ Common::String Lucerna::nextstring() {
 }
 
 void Lucerna::scram1(Common::String &x) {
-	for (int fz = 0; fz < x.size(); fz ++)
+	for (uint fz = 0; fz < x.size(); fz++)
 		x.setChar(x[fz] ^ 177, fz);
 }
 
 void Lucerna::unscramble() {
 	for (byte fv = 0; fv < 31; fv ++)
-		for (byte ff = 0; ff < 2; ff ++)
+		for (byte ff = 0; ff < 2; ff++)
 			if (_vm->_gyro->also[fv][ff] != 0)
 				scram1(*_vm->_gyro->also[fv][ff]);
 	scram1(_vm->_gyro->listen);
@@ -149,7 +148,7 @@ void Lucerna::load_also(Common::String n) {
 			_vm->_gyro->also[fv][ff] = new Common::String;
 			*_vm->_gyro->also[fv][ff] = nextstring();
 		}
-		*_vm->_gyro->also[fv][0] = Common::String(157) + *_vm->_gyro->also[fv][0] + 157;
+		*_vm->_gyro->also[fv][0] = Common::String('\x9D') + *_vm->_gyro->also[fv][0] + Common::String('\x9D');
 	}
 	
 	memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines));
@@ -211,8 +210,6 @@ void Lucerna::load_also(Common::String n) {
 }
 
 void Lucerna::load(byte n) {     /* Load2, actually */
-	byte a0;  /*absolute $A000:800;*/
-	byte a1;  /*absolute $A000:17184;*/
 	byte bit;
 	Common::String xx;
 	
@@ -240,39 +237,22 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	f.seek(177);
 
-	/*for (bit = 0; bit <= 3; bit++) {
-	port[0x3c4] = 2;
-	port[0x3ce] = 4;
-	port[0x3c5] = 1 << bit;
-	port[0x3cf] = bit;
-	blockread(f, a0, 12080);
-	move(a0, a1, 12080);
-	}*/
-
-	
-	
 	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
-
 	_vm->_graphics->refreshBackground();
 
 	f.close();
 
-
-
 	load_also(xx);
-
 	_vm->_celer->loadBackgroundSprites(n);
-
 	bit = *_vm->_graphics->getPixel(0,0);
-
 	CursorMan.showMouse(true);
 }
 
 
 
 void Lucerna::zoomout(int16 x, int16 y) {
-	int16 x1, y1, x2, y2;
-	byte fv;
+//	int16 x1, y1, x2, y2;
+//	byte fv;
 
 	warning("STUB: Lucerna::zoomout()");
 }
@@ -558,7 +538,6 @@ void Lucerna::enterroom(byte x, byte ped) {
 		//setactivepage(1 - cp);
 
 		{
-			dnatype &with = _vm->_gyro->dna;
 			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) {
 				_vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */
 				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
@@ -986,9 +965,6 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 }
 
 void Lucerna::inkey() {
-	char r;
-
-
 	if (_vm->_gyro->demo)
 		return; /* Demo handles this itself. */
 
@@ -1298,25 +1274,20 @@ void Lucerna::clock_lucerna() {
 
 
 void Lucerna::delavvy() {
-	byte page_;
-
 	CursorMan.showMouse(false);
 	
-	triptype &with = _vm->_trip->tr[0];
-	/*for (page_ = 0; page_ <= 1; page_ ++)
-		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);*/
+//	triptype &with = _vm->_trip->tr[0];
+//	for (byte page_ = 0; page_ <= 1; page_ ++)
+//		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
 	
 	CursorMan.showMouse(true);
 }
 
 void Lucerna::gameover() {
-	byte fv;
-	int16 sx, sy;
-
 	_vm->_gyro->dna.user_moves_avvy = false;
 
-	sx = _vm->_trip->tr[0].x;
-	sy = _vm->_trip->tr[0].y;
+	int16 sx = _vm->_trip->tr[0].x;
+	int16 sy = _vm->_trip->tr[0].y;
 	
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls
@@ -1373,8 +1344,6 @@ void Lucerna::sprite_run() {
   sprites are still. It performs two fast cycles, only using a few of
   the links usually used, and without any extra animation. This should
   make the sprites the same on both pages. */
-	byte fv;
-
 	_vm->_gyro->doing_sprite_run = true;
 
 	_vm->_trip->get_back_loretta();


Commit: cd808484aff158ccc8ec78a3898c4d5aff2d8e03
    https://github.com/scummvm/scummvm/commit/cd808484aff158ccc8ec78a3898c4d5aff2d8e03
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T02:43:02-07:00

Commit Message:
AVALANCHE: Fix some more MSVC warnings

Changed paths:
    engines/avalanche/enid2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 9841fa0..1e7c816 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -263,8 +263,8 @@ void Enid::from_sundry(sundry sund) {
 }
 
 void Enid::restore_dna() {
-	uint16 here, fv;
-	sundry sund;
+//	uint16 here, fv;
+//	sundry sund;
 
 	warning("STUB: Enid::restore_dna()");
 }
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 4f3d171..096a8be 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -109,8 +109,6 @@ void Pingo::zonk() {
 
 void Pingo::winning_pic() {
 	Common::File f;
-	char r;
-
 	_vm->_lucerna->dusk();
 
 	if (!f.open("finale.avd")) {
@@ -137,7 +135,8 @@ void Pingo::winning_pic() {
 	/*do {
 		_vm->_gyro->check();
 	} while (!(keypressed() || (mrelease > 0)));
-	while (keypressed())  r = readkey();
+	while (keypressed())
+		char r = readkey();
 	major_redraw();*/
 	warning("STUB: Pingo::winning_pic()");
 }
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 523c37b..fe345d8 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -55,8 +55,6 @@ void Scrolls::init() {
 }
 
 void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
-	byte page_;
-
 	if (_vm->_gyro->ledstatus == x)
 		return; /* Already like that! */
 
@@ -136,8 +134,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 void Scrolls::normscroll() {
 	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
 	Common::String e = "(c) 1994";
-	char r;
-	bool oktoexit;
 
 	state(3);
 	_vm->_gyro->seescroll = true;
@@ -165,6 +161,8 @@ void Scrolls::normscroll() {
 
 
 
+//	char r;
+//	bool oktoexit;
 //	do {
 //		do {
 //			_vm->_gyro->check(); /* was "checkclick;" */
@@ -308,8 +306,6 @@ void Scrolls::geticon(int16 x, int16 y, byte which) {
 
 void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File f;
-	byte bit;
-	int16 fv;
 	uint16 st;
 
 	st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
@@ -321,14 +317,15 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 		return;
 	}
 
-	/*for (fv = 1; fv <= yl; fv ++)
-	for (bit = 0; bit <= 3; bit ++) {
-	port[0x3c4] = 2;
-	port[0x3ce] = 4;
-	port[0x3c5] = 1 << bit;
-	port[0x3cf] = bit;
-	blockread(f, mem[0xa000 * st + (fv * 80)], xl);
-	}
+	/*byte bit;
+	for (uint16 fv = 1; fv <= yl; fv ++)
+		for (bit = 0; bit <= 3; bit ++) {
+			port[0x3c4] = 2;
+			port[0x3ce] = 4;
+			port[0x3c5] = 1 << bit;
+			port[0x3cf] = bit;
+			blockread(f, mem[0xa000 * st + (fv * 80)], xl);
+		}
 	bit = getpixel(0, 0);*/
 
 	warning("STUB: Scrolls::block_drop()");
@@ -484,7 +481,7 @@ void Scrolls::bubble(func2 gotoit) {
 	int16 xl, yl, my, xw, yw;
 	byte fv;
 	Common::Point p[3];
-	byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
+//	byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
 	int16 xc; /* x correction */
 
 	/*setvisualpage(cp);
@@ -638,7 +635,7 @@ void Scrolls::calldrivers() {
 	char nnn;
 	bool mouthnext;
 	bool call_spriterun; // Only call sprite_run the FIRST time.
-	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
+//	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
 
 
 	//nosound();


Commit: c3ce7d48401705b51fb4cbcd790020392da11cd9
    https://github.com/scummvm/scummvm/commit/c3ce7d48401705b51fb4cbcd790020392da11cd9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:02:01-07:00

Commit Message:
AVALANCHE: Fix MSVC warnings in trip6

Changed paths:
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7e444dc..20c22e4 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -53,8 +53,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	_tr = tr;
 
 	const int32 idshould = -1317732048;
-	int16 gd, gm;
-	byte fv/*,nds*/;
+	byte fv;
 	int32 id;
 	Common::File inf;
 
@@ -418,22 +417,17 @@ void triptype::load_data_from_mem(uint16 &where) {
 }
 
 triptype *triptype::done() {
-	int16 gd, gm;
 	Common::String xx;
-	byte fv/*,nds*/;
-	byte aa, bb;
-	int32 id;
-	uint16 soa;
 
 	/*  nds:=num div seq;*/
 	totalnum--;
 	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
 		_info.xw++;
-	for (aa = 0; aa < /*nds*seq*/ a.num; aa++) {
+	for (byte aa = 0; aa < /*nds*seq*/ a.num; aa++) {
 		totalnum--;
-		delete _info.mani[totalnum];
-		delete _info.sil[totalnum];
+		delete[] _info.mani[totalnum];
+		delete[] _info.sil[totalnum];
 	}
 
 	quick = false;
@@ -441,11 +435,6 @@ triptype *triptype::done() {
 	return this;
 }
 
-
-
-
-
-
 getsettype *getsettype::init() {
 	numleft = 0; /* initialize array pointer */
 	return this;
@@ -528,6 +517,8 @@ byte Trip::geida_ped(byte which) {
 		return 9;
 	case 4:
 		return 10;	
+	default:
+		return 0;
 	}
 }
 
@@ -538,7 +529,7 @@ void Trip::catamove(byte ped) {
 
 	int32 here;
 	uint16 xy_uint16;
-	byte fv, ff;
+	byte fv;
 
 	/* XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 		catacombs has a different number for it. */
@@ -1145,7 +1136,6 @@ bool Trip::overlaps_with_mouse() {
 }
 
 void Trip::getback() {
-	byte fv;
 	bool endangered;
 
 
@@ -1213,8 +1203,6 @@ void Trip::face_avvy(byte tripnum) {
 }
 
 void Trip::arrow_procs(byte tripnum) {
-	byte fv;
-			
 	if (tr[tripnum].homing) {
 		/* Arrow is still in flight. */
 		/* We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
@@ -1232,7 +1220,7 @@ void Trip::arrow_procs(byte tripnum) {
 			/*     tr[1].done; { Deallocate normal pic of Avvy. }
 
 					off;
-					for fv:=0 to 1 do
+					for byte fv:=0 to 1 do
 					begin
 					cp:=1-cp;
 					getback;
@@ -1267,11 +1255,8 @@ begin
 end;*/
 
 void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
-	byte fv;
-	int16 tox, toy;
-			
-	tox = tr[0].x + 17;
-	toy = tr[0].y - 1;
+	int16 tox = tr[0].x + 17;
+	int16 toy = tr[0].y - 1;
 	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
 		tr[tripnum].call_eachstep = false;
 		tr[tripnum].face = left;
@@ -1471,7 +1456,7 @@ void Trip::getsetclear() {
 }
 
 void Trip::hide_in_the_cupboard() {
-	const char nowt = 250; /* As in Acci. */
+	const char nowt = '\xFA'; /* As in Acci. */
 
 	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
 		if (_vm->_gyro->dna.wearing == nowt)


Commit: fce3fe83819f05cc2a0598c367124ea8c0ea2dac
    https://github.com/scummvm/scummvm/commit/fce3fe83819f05cc2a0598c367124ea8c0ea2dac
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:32:10-07:00

Commit Message:
AVALANCHE: Fix MSVC warnings in acci2

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2d532bb..4542910 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -288,11 +288,10 @@ void Acci::number(Common::String &codes) {
 }
 
 void Acci::cheatParse(Common::String codes) {
-	uint16 num;
-	int16 e;
-
-	char cmd;
-	int16 se, sx, sy;
+//	uint16 num;
+//	int16 e;
+//	char cmd;
+//	int16 se, sx, sy;
 
 	warning("STUB: Acci::cheatParse()");
 }
@@ -522,39 +521,39 @@ void Acci::parse() {
 				inputText.deleteChar(0);
 	}
 
-	if (_vm->_parser->pos(Common::String(254), _thats) > -1) 
-		_unknown = _realWords[_vm->_parser->pos(Common::String(254), _thats)];
+	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) 
+		_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
 	else
 		if (!_unknown.empty())
 			_unknown.clear();
 
 	// Replace words' codes that mean the same.
-	replace(Common::String(255), 0); /* zap noise words */
-	replace(Common::String(13) + 226, 1); // "look at" = "examine"
-	replace(Common::String(13) + 228, 1); // "look in" = "examine"
-	replace(Common::String(4) + 230, 17); // "get up" = "stand" 
-	replace(Common::String(4) + 231, 17); // "get down" = "stand"... well, why not?
-	replace(Common::String(18) + 228, 2); // "go in" = "open [door]"
-	replace(Common::String(28) + 229, 253); // "P' off" is a swear word
-	replace(Common::String(4) + 6, 6); // "Take inventory" (remember Colossal Adventure?)
-	replace(Common::String(40) + 232, 21); // "put on" = "don"
-	replace(Common::String(4) + 229, 20); // "take off" = "doff"
+	replace(Common::String('\xFF'), 0); /* zap noise words */
+	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
+	replace(Common::String('\xD')  + '\xE4', 1); // "look in" = "examine"
+	replace(Common::String('\x4')  + '\xE6', 17); // "get up" = "stand" 
+	replace(Common::String('\x4')  + '\xE7', 17); // "get down" = "stand"... well, why not?
+	replace(Common::String('\x12') + '\xE4', 2); // "go in" = "open [door]"
+	replace(Common::String('\x1C') + '\xE5', 253); // "P' off" is a swear word
+	replace(Common::String('\x4')  + '\x6' , 6); // "Take inventory" (remember Colossal Adventure?)
+	replace(Common::String('\x28') + '\xE8', 21); // "put on" = "don"
+	replace(Common::String('\x4')  + '\xE5', 20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
 	if (_vm->_gyro->dna.room == r__nottspub)
-		replace(Common::String(204), 164); // Barman = Port
+		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
-		replace(Common::String(204), 154); // Barman = Malagauche
+		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
 	switch (_vm->_gyro->dna.room) {
 	case r__aylesoffice:
-		replace(Common::String(203), 163); // Monk = Ayles
+		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;       
 	case r__musicroom:
-		replace(Common::String(203), 166); // Monk = Jacques
+		replace(Common::String('\xCB'), 166); // Monk = Jacques
 		break;          
 	default:
-		replace(Common::String(203), 162); // Monk = Ibythneth
+		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
 	}
 	
 	if (doPronouns()) {


Commit: 8e148213067a664f384c5eea0082660210ea0d26
    https://github.com/scummvm/scummvm/commit/8e148213067a664f384c5eea0082660210ea0d26
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:35:26-07:00

Commit Message:
AVALANCHE: Fix bug in verbOpt()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 4542910..a7dd24a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -2016,7 +2016,7 @@ void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
 	switch (verb) {
 	case kVerbCodeExam:
 		answer = "Examine";
-		ansKey = 'word';
+		ansKey = 'x';
 		break; // The ubiqutous one.
 	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
 	case kVerbCodeDrink:


Commit: 8c8990368e84d154888e9754b992ff7a8db6393f
    https://github.com/scummvm/scummvm/commit/8c8990368e84d154888e9754b992ff7a8db6393f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:36:48-07:00

Commit Message:
AVALANCHE: Fix bug in lookAround()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index a7dd24a..cd244e6 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -865,34 +865,34 @@ void Acci::lookAround() {
 	switch (_vm->_gyro->dna.room) {
 	case r__spludwicks:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa->dixi('pos', 23);
+			_vm->_visa->dixi('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case r__robins:
 		if (_vm->_gyro->dna.tied_up)
-			_vm->_visa->dixi('pos', 38);
+			_vm->_visa->dixi('q', 38);
 		if (_vm->_gyro->dna.mushroom_growing)
-			_vm->_visa->dixi('pos', 55);
+			_vm->_visa->dixi('q', 55);
 		break;
 	case r__insidecardiffcastle:
 		if (!_vm->_gyro->dna.taken_pen)
-			_vm->_visa->dixi('pos', 49);
+			_vm->_visa->dixi('q', 49);
 		break;
 	case r__lustiesroom:
 		if (_vm->_gyro->dna.lustie_is_asleep)
-			_vm->_visa->dixi('pos', 65);
+			_vm->_visa->dixi('q', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) {
 		case 258 :
-			_vm->_visa->dixi('pos', 80); // Inside art gallery.
+			_vm->_visa->dixi('q', 80); // Inside art gallery.
 			break; 
 		case 514 :
-			_vm->_visa->dixi('pos', 81); // Outside ditto.
+			_vm->_visa->dixi('q', 81); // Outside ditto.
 			break;
 		case 260 :
-			_vm->_visa->dixi('pos', 82); // Outside Geida's room.
+			_vm->_visa->dixi('q', 82); // Outside Geida's room.
 			break; 
 		}
 		break;


Commit: 53d9848f6625b390b3898c18cabf610439e2bba6
    https://github.com/scummvm/scummvm/commit/53d9848f6625b390b3898c18cabf610439e2bba6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:38:19-07:00

Commit Message:
AVALANCHE: Fix bug in openDoor()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index cd244e6..d869fe4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -915,7 +915,7 @@ void Acci::openDoor() {
 		break;
 	case r__spludwicks:
 		if (_thing == 61) {
-			_vm->_visa->dixi('pos', 85);
+			_vm->_visa->dixi('q', 85);
 			return;
 		}
 		break;
@@ -932,7 +932,7 @@ void Acci::openDoor() {
 			switch (_vm->_gyro->portals[fv].op) {
 			case Gyro::exclaim:
 				_vm->_trip->tr[0].bounce();
-				_vm->_visa->dixi('word', _vm->_gyro->portals[fv].data);
+				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
 				break;
 			case Gyro::transport:
 				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
@@ -954,8 +954,7 @@ void Acci::openDoor() {
 
 	if (_vm->_gyro->dna.room == r__map)
 		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
-				"to anywhere other than Argent, Birmingham, Cardiff, "
-				"Nottingham and Norwich."));
+				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."));
 	else
 		_vm->_scrolls->display("Door? What door?");
 }


Commit: c781727a03c0a7db10cf61944b54066199dbe838
    https://github.com/scummvm/scummvm/commit/c781727a03c0a7db10cf61944b54066199dbe838
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:42:27-07:00

Commit Message:
AVALANCHE: Fix bug in giveToSpludwick, add doxygen comment

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d869fe4..9da26a8 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1052,6 +1052,10 @@ void Acci::goToCauldron() {
 	_vm->_trip->tr[1].walkto(2);
 }
 
+/**
+ * Check is it's possible to give something to Spludwick
+ * @remarks	Originally called 'give2spludwick'
+ */
 bool Acci::giveToSpludwick() { 
 	if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != _thing) {
 		notInOrder();
@@ -1062,10 +1066,10 @@ bool Acci::giveToSpludwick() {
 	case Gyro::onion:
 		_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
 		if (_vm->_gyro->dna.rotten_onion)
-			_vm->_visa->dixi('pos', 22);
+			_vm->_visa->dixi('q', 22);
 		else {
 			_vm->_gyro->dna.given2spludwick++;
-			_vm->_visa->dixi('pos', 20);
+			_vm->_visa->dixi('q', 20);
 			goToCauldron();
 			_vm->_lucerna->points(3);
 		}
@@ -1075,13 +1079,13 @@ bool Acci::giveToSpludwick() {
 		_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false;
 		_vm->_lucerna->objectlist();
 		_vm->_gyro->dna.given2spludwick++;
-		_vm->_visa->dixi('pos', 24);
+		_vm->_visa->dixi('q', 24);
 		goToCauldron();
 		_vm->_lucerna->points(3);
 		break;
 	case Gyro::mushroom:
 		_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false;
-		_vm->_visa->dixi('pos', 25);
+		_vm->_visa->dixi('q', 25);
 		_vm->_lucerna->points(5);
 		_vm->_gyro->dna.given2spludwick++;
 		goToCauldron();


Commit: caeb46f3ce251e10f16cd86bd3d968e7c6c2a642
    https://github.com/scummvm/scummvm/commit/caeb46f3ce251e10f16cd86bd3d968e7c6c2a642
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T03:51:29-07:00

Commit Message:
AVALANCHE: Fix bugs in getProc() and giveGeidaTheLute(), add doxygen comment

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 9da26a8..1f7c86a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1190,7 +1190,7 @@ void Acci::getProc(char thing) {
 			} else
 				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
 		} else
-			_vm->_visa->dixi('pos', 57);
+			_vm->_visa->dixi('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
@@ -1208,15 +1208,15 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->display("Taken.");
 				}
 			} else if (_vm->_gyro->dna.standing_on_dais)
-				_vm->_visa->dixi('pos', 53);
+				_vm->_visa->dixi('q', 53);
 			else
-				_vm->_visa->dixi('pos', 51);
+				_vm->_visa->dixi('q', 51);
 			break;
 		case Gyro::bolt:
-			_vm->_visa->dixi('pos', 52);
+			_vm->_visa->dixi('q', 52);
 			break;
 		default:
-			_vm->_visa->dixi('pos', 57);
+			_vm->_visa->dixi('q', 57);
 		}
 		break;
 	case r__robins:
@@ -1229,13 +1229,17 @@ void Acci::getProc(char thing) {
 			_vm->_lucerna->objectlist();
 			_vm->_lucerna->points(3);
 		} else
-			_vm->_visa->dixi('pos', 57);
+			_vm->_visa->dixi('q', 57);
 		break;
 	default:
-		_vm->_visa->dixi('pos', 57);
+		_vm->_visa->dixi('q', 57);
 	}
 }
 
+/**
+ * Give the lute to Geida
+ * @remarks	Originally called 'give_Geida_the_lute'
+ */
 void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->dna.room != r__lustiesroom) {
 		_vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
@@ -1243,7 +1247,7 @@ void Acci::giveGeidaTheLute() {
 	}
 	_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false;
 	_vm->_lucerna->objectlist();
-	_vm->_visa->dixi('pos', 64); // She plays it.
+	_vm->_visa->dixi('q', 64); // She plays it.
 
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
 	_vm->_enid->back_to_bootstrap(4);


Commit: 382046244868c6d08f556ad0ef714b956c9d0389
    https://github.com/scummvm/scummvm/commit/382046244868c6d08f556ad0ef714b956c9d0389
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:06:12-07:00

Commit Message:
AVALANCHE: Fix bugs in winSequence() and doThat()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1f7c86a..0a1a047 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1261,7 +1261,7 @@ void Acci::playHarp() {
 }
 
 void Acci::winSequence() {
-	_vm->_visa->dixi('pos', 78);
+	_vm->_visa->dixi('q', 78);
 	_vm->_sequence->first_show(7);
 	_vm->_sequence->then_show(8);
 	_vm->_sequence->then_show(9);
@@ -1302,6 +1302,9 @@ void Acci::heyThanks() {
 	_vm->_gyro->dna.obj[_thing - 1] = false;
 }
 
+/**
+ * @remarks	Originally called 'do_that'
+ */
 void Acci::doThat() {
 	const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
 
@@ -1424,7 +1427,7 @@ void Acci::doThat() {
 						break;
 					case Gyro::pibythneth:
 						if (_thing == _vm->_gyro->badge) {
-							_vm->_visa->dixi('pos', 32); // Thanks! Wow!
+							_vm->_visa->dixi('q', 32); // Thanks! Wow!
 							_vm->_lucerna->points(3);
 							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
 							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
@@ -1438,7 +1441,7 @@ void Acci::doThat() {
 						if (_vm->_gyro->dna.ayles_is_awake) {
 							if (_thing == _vm->_gyro->pen) {
 								_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false;
-								_vm->_visa->dixi('pos', 54);
+								_vm->_visa->dixi('q', 54);
 								_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = true;
 								_vm->_gyro->dna.given_pen_to_ayles = true;
 								_vm->_lucerna->objectlist();
@@ -1470,7 +1473,7 @@ void Acci::doThat() {
 							if (_vm->_gyro->dna.geida_given_potion)
 								winSequence();
 							else
-								_vm->_visa->dixi('pos', 77); // That Geida woman!
+								_vm->_visa->dixi('q', 77); // That Geida woman!
 							break;            
 						default:
 							heyThanks();
@@ -1601,7 +1604,7 @@ void Acci::doThat() {
 					}
 
 					if (!_vm->_gyro->dna.asked_dogfood_about_nim) {
-						_vm->_visa->dixi('pos', 84);
+						_vm->_visa->dixi('q', 84);
 						return;
 					}
 
@@ -1696,12 +1699,12 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeMagic:
 		if (_vm->_gyro->dna.avaricius_talk > 0)
-			_vm->_visa->dixi('pos', 19);
+			_vm->_visa->dixi('q', 19);
 		else {
 			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
-				_vm->_visa->dixi('pos', 17);
+				_vm->_visa->dixi('q', 17);
 				if (_vm->_gyro->whereis[1] == 12)
-					_vm->_visa->dixi('pos', 18);
+					_vm->_visa->dixi('q', 18);
 				else {
 					_vm->_trip->tr[1].init(1, false, _vm->_trip); // Avaricius
 					_vm->_trip->apped(2, 4);


Commit: 8e7921d19dbc1308505356b7eb45b7d7096257d1
    https://github.com/scummvm/scummvm/commit/8e7921d19dbc1308505356b7eb45b7d7096257d1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:07:09-07:00

Commit Message:
AVALANCHE: USe the default return value in giveToSpludwick()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 0a1a047..b69e051 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1095,6 +1095,8 @@ bool Acci::giveToSpludwick() {
 	default:
 		return true;
 	}
+
+	return false;
 }
 
 void Acci::drink() {


Commit: 9c5cc7bba4661114054f05bbce0250650e1138a5
    https://github.com/scummvm/scummvm/commit/9c5cc7bba4661114054f05bbce0250650e1138a5
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:16:27-07:00

Commit Message:
AVALANCHE: Add a default value to color in state(), remove dead code

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index fe345d8..615bdd5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -58,7 +58,7 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 	if (_vm->_gyro->ledstatus == x)
 		return; /* Already like that! */
 
-	byte color;
+	byte color = black;
 	switch (x) {
 	case 0:
 		color = black;
@@ -69,21 +69,6 @@ void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
 		color = green;
 		break; /* Hit a key */
 	}
-
-	//switch (x) {
-	//case 0:
-	//	setfillstyle(1, black);
-	//	break; /* Off */
-	//case 1:
-	//	setfillstyle(9, green);
-	//	break; /* Half-on (menus) */
-	//case 2:
-	//	setfillstyle(1, green);
-	//	break; /* On (kbd) */
-	//case 3:
-	//	setfillstyle(6, green);
-	//	break; /* Hit a key */
-	//}
 	warning("STUB: Scrolls::state()");
 
 	CursorMan.showMouse(false);


Commit: e4b3fc8064a5fac7655198e3994bac32223d8a30
    https://github.com/scummvm/scummvm/commit/e4b3fc8064a5fac7655198e3994bac32223d8a30
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:28:15-07:00

Commit Message:
AVALANCHE: Add default value to Direction in updateBackgroundSprites()

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 2d16dc6..ce71207 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -55,7 +55,9 @@ Celer::~Celer() {
 }
 
 
-
+/**
+ * @remarks	Originally called 'pics_link'
+ */
 void Celer::updateBackgroundSprites() {
 	if (_vm->_gyro->ddmnow)
 		return; // No animation when the menus are up.
@@ -119,8 +121,8 @@ void Celer::updateBackgroundSprites() {
 				break; 
 			}
 
-			byte direction;
 			if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
+				byte direction = 0;
 				if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
 					direction = 3;
 				else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
@@ -155,7 +157,7 @@ void Celer::updateBackgroundSprites() {
 		break;
 	case r__lustiesroom:
 		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
-			byte direction;
+			byte direction = 0;
 			if ((_vm->_gyro->roomtime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
@@ -197,55 +199,55 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	case r__nottspub: {
-			// Bearing of Avvy from Port.
-			byte direction;
-			if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
-				direction = 2; // Middle.
-			else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
-				direction = 6; // Left.
-			else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
-				direction = 8; // Right.
-
-			if ((_vm->_gyro->roomtime % 60) > 57)
-				direction--; // Blinks.
-
-			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
-				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
-			}
+		// Bearing of Avvy from Port.
+		byte direction = 0;
+		if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
+			direction = 2; // Middle.
+		else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
+			direction = 6; // Left.
+		else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->roomtime % 60) > 57)
+			direction--; // Blinks.
+
+		if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+			drawBackgroundSprite(-1, -1, direction);
+			_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+		}
 
-			switch (_vm->_gyro->roomtime % 50) {
-			case 45 :
-				drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
-				break; 
-			case 49 :
-				drawBackgroundSprite(-1, -1, 10);
-				break;
-			}
+		switch (_vm->_gyro->roomtime % 50) {
+		case 45 :
+			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
+			break; 
+		case 49 :
+			drawBackgroundSprite(-1, -1, 10);
+			break;
 		}
 		break;
+	  }
 	case r__ducks: {
-			if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers.
-				drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
-
-			// Bearing of Avvy from Duck.
-			byte direction;
-			if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
-				direction = 4; // Middle.
-			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
-				direction = 6; // Left.
-			else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
-				direction = 8; // Right.
-
-			if ((_vm->_gyro->roomtime % 45) > 42)
-				direction++; // Duck blinks.
-
-			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
-				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
-			}
+		if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers.
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
+
+		// Bearing of Avvy from Duck.
+		byte direction = 0;
+		if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
+			direction = 4; // Middle.
+		else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
+			direction = 6; // Left.
+		else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->roomtime % 45) > 42)
+			direction++; // Duck blinks.
+
+		if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+			drawBackgroundSprite(-1, -1, direction);
+			_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
 		}
 		break;
+	   }
 	}
 
 	if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) {


Commit: ff31d8e52152c7a988764d361fbcaeda049d2645
    https://github.com/scummvm/scummvm/commit/ff31d8e52152c7a988764d361fbcaeda049d2645
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:29:18-07:00

Commit Message:
AVALANCHE: Replace a STUB by a call to updateBackgroundSprites()

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index ce71207..6dece2f 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -261,7 +261,7 @@ void Celer::updateBackgroundSprites() {
 			break;
 		case 2:
 			//nosound();
-			warning("STUB: Celer::pics_link()");
+			updateBackgroundSprites();
 			break;
 		}
 	}


Commit: fe8e5c7325d3b88ac8bb2dd3db6ee2761e5f9764
    https://github.com/scummvm/scummvm/commit/fe8e5c7325d3b88ac8bb2dd3db6ee2761e5f9764
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:34:58-07:00

Commit Message:
AVALANCHE: Fix coding style: ++ and --

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3d8ba61..a007014 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -278,7 +278,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_gyro->dna.asked_dogfood_about_nim);
 
 
-	//for (byte groi = 0; groi < numtr; groi ++) {
+	//for (byte groi = 0; groi < numtr; groi++) {
 	//	if (tr[groi].quick) {
 	//		blockwrite(f, groi, 1);
 	//		tr[groi].savedata(f);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 6dece2f..a84d151 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -319,7 +319,7 @@ void Celer::loadBackgroundSprites(byte number) {
 }
 
 void Celer::forgetBackgroundSprites() {
-	for (byte i = 0; i < _spriteNum; i ++)
+	for (byte i = 0; i < _spriteNum; i++)
 		if (_sprites[i]._x > kOnDisk)
 			_sprites[i]._picture.free();
 }
@@ -366,7 +366,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 	//setactivepage(1 - cp);
 	warning("STUB: Celer::show_one()");
 
-	for (byte i = 0; i < 2; i ++)
+	for (byte i = 0; i < 2; i++)
 		_vm->_trip->getset[i].remember(_r);
 }
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 064af29..82a5228 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -276,7 +276,7 @@ void menuset::extd(char c) {
 	byte fv;
 	fv = 0;
 	while ((fv < howmany) && (ddms[fv].extdparse(c)))
-		fv ++;
+		fv++;
 	if (fv == howmany)
 		return;
 	getcertain(fv);
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index eaf547c..b4ee2a7 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -126,9 +126,9 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	int32 yRadius = radius * kScreenWidth / (8 * kScreenHeight); // Just don't ask why...
 
 	if (xRadius == 0)
-		xRadius ++;
+		xRadius++;
 	if (yRadius == 0)
-		yRadius ++;
+		yRadius++;
 
 	// Check for an ellipse with negligable x and y radius.
 	if ((xRadius <= 1) && (yRadius <= 1)) 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 4166ecf..1653159 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -312,7 +312,7 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 }
 
 void Gyro::newgame() { 
-	for (byte gm = 0; gm < numtr; gm ++) {
+	for (byte gm = 0; gm < numtr; gm++) {
 		if (_vm->_trip->tr[gm].quick)
 			_vm->_trip->tr[gm].done();
 	}
@@ -343,7 +343,7 @@ void Gyro::newgame() {
 
 	ppos[0][1] = -177; 
 	_vm->_trip->tr[0].appear(300,117,right); // Needed to initialize Avalot.
-	//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
+	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
 	him = 254;
 	her = 254;
@@ -356,7 +356,7 @@ void Gyro::newgame() {
 	dna.avvy_in_bed = true;
 	enid_filename = "";
 
-	for (byte gd = 0; gd <= 1; gd ++) {
+	for (byte gd = 0; gd <= 1; gd++) {
 		cp = 1 - cp;
 		_vm->_trip->getback();
 	}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1406c44..389aa2e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -115,7 +115,7 @@ void Lucerna::scram1(Common::String &x) {
 }
 
 void Lucerna::unscramble() {
-	for (byte fv = 0; fv < 31; fv ++)
+	for (byte fv = 0; fv < 31; fv++)
 		for (byte ff = 0; ff < 2; ff++)
 			if (_vm->_gyro->also[fv][ff] != 0)
 				scram1(*_vm->_gyro->also[fv][ff]);
@@ -815,7 +815,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	putimage(x, y, p, 0);
 	setactivepage(1 - cp);*/
 
-	for (byte fv = 0; fv <= 1; fv ++)
+	for (byte fv = 0; fv <= 1; fv++)
 		_vm->_trip->getset[fv].remember(thinkspace);
 	
 	CursorMan.showMouse(true);
@@ -831,14 +831,14 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 		return;
 	}
 
-	for (byte fv = 0; fv < 10; fv ++) {
+	for (byte fv = 0; fv < 10; fv++) {
 		f.seek(fv * digitsize);
 		/*_vm->_gyro->digit[fv] = new byte[digitsize];
 		f.read(_vm->_gyro->digit[fv], digitsize);*/
 		_vm->_gyro->digit[fv] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
-	for (byte ff = 0; ff < 9; ff ++) {
+	for (byte ff = 0; ff < 9; ff++) {
 		f.seek(10 * digitsize + ff * rwlitesize);
 		/*_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
 		f.read(_vm->_gyro->rwlite[ff], rwlitesize);*/
@@ -894,11 +894,11 @@ void Lucerna::showscore() {
 
 	//setactivepage(3);
 
-	for (byte fv = 0; fv < 3; fv ++)
+	for (byte fv = 0; fv < 3; fv++)
 		if (_vm->_gyro->lastscore[fv] != numbers[fv]) 
 			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
-	for (byte fv = 0; fv < 2; fv ++)
+	for (byte fv = 0; fv < 2; fv++)
 		_vm->_trip->getset[fv].remember(scorespace);
 
 	//setactivepage(1 - cp);
@@ -909,10 +909,10 @@ void Lucerna::showscore() {
 }
 
 void Lucerna::points(byte num) {     /* Add on no. of points */
-	for (byte q = 1; q <= num; q ++) {
+	for (byte q = 1; q <= num; q++) {
 		_vm->_gyro->dna.score++;
 		/*if (soundfx)
-			for (byte fv = 1; fv <= 97; fv ++)
+			for (byte fv = 1; fv <= 97; fv++)
 				sound(177 + dna.score * 3);
 		nosound;*/
 	}
@@ -1143,9 +1143,13 @@ int8 Lucerna::fades(int8 x) {
 	x = x % 16;
 	byte g = x / 4;
 	byte b = x % 4;
-	if (r > 0)  r --;
-	if (g > 0)  g --;
-	if (b > 0)  b --;
+	if (r > 0)
+		r--;
+	if (g > 0)
+		g--;
+	if (b > 0)
+		b--;
+
 	return (16 * r + 4 * g + b);
 	/* fades:=x-1;*/
 }
@@ -1180,7 +1184,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
 	CursorMan.showMouse(false);
 	
-	/*	for (byte page_ = 0; page_ <= 1; page_ ++) {
+	/*	for (byte page_ = 0; page_ <= 1; page_++) {
 	setactivepage(page_);
 	putimage(0, 161, rwlite[with.rw], 0);
 	}*/
@@ -1277,7 +1281,7 @@ void Lucerna::delavvy() {
 	CursorMan.showMouse(false);
 	
 //	triptype &with = _vm->_trip->tr[0];
-//	for (byte page_ = 0; page_ <= 1; page_ ++)
+//	for (byte page_ = 0; page_ <= 1; page_++)
 //		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
 	
 	CursorMan.showMouse(true);
@@ -1307,7 +1311,7 @@ void Lucerna::minor_redraw() {
 
 	enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */
 
-	for (byte fv = 0; fv <= 1; fv ++) {
+	for (byte fv = 0; fv <= 1; fv++) {
 		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
 		_vm->_trip->getback();
 	}
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 8bd6d52..67b893f 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -153,7 +153,7 @@ void Parser::drawCursor() {
 	bf.x2 = _inputTextPos + 2;
 	bf.y1 = 168;
 	bf.y2 = 168;
-	for (byte fv = 0; fv <= 1; fv ++)
+	for (byte fv = 0; fv <= 1; fv++)
 		_vm->_trip->getset[fv].remember(bf);
 }
 
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 096a8be..777a1c7 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -116,7 +116,7 @@ void Pingo::winning_pic() {
 		return;
 	}
 
-	/*for (byte bit = 0; bit <= 3; bit ++) {
+	/*for (byte bit = 0; bit <= 3; bit++) {
 	port[0x3c4] = 2;
 	port[0x3ce] = 4;
 	port[0x3c5] = 1 << bit;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 615bdd5..65c4faa 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -207,7 +207,7 @@ bool Scrolls::they_match(tunetype &played) {
 
 	mistakes = 0;
 
-	for (fv = 1; fv <= sizeof(played); fv ++)
+	for (fv = 1; fv <= sizeof(played); fv++)
 		if (played[fv] != _vm->_gyro->tune[fv]) {
 			mistakes += 1;
 		}
@@ -303,8 +303,8 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	}
 
 	/*byte bit;
-	for (uint16 fv = 1; fv <= yl; fv ++)
-		for (bit = 0; bit <= 3; bit ++) {
+	for (uint16 fv = 1; fv <= yl; fv++)
+		for (bit = 0; bit <= 3; bit++) {
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
@@ -560,7 +560,7 @@ bool Scrolls::ask(Common::String question) {
 
 void Scrolls::resetscroll() {
 	_vm->_gyro->scrolln = 1;
-	for (int j = 0; j < 15; j ++)
+	for (int j = 0; j < 15; j++)
 		if (!_vm->_gyro->scroll[j].empty())
 			_vm->_gyro->scroll[j].clear();
 }
@@ -760,7 +760,7 @@ void Scrolls::calldrivers() {
 					nn = 1;
 					for (nnn = 0; nnn < numobjs; nnn++)
 						if (_vm->_gyro->dna.obj[nnn]) {
-							nn ++;
+							nn++;
 							display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer);
 						}
 					}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 20c22e4..417a920 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -110,7 +110,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
 		_info.mani[totalnum] = new manitype[_info.size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
-		for (fv = 0; fv <= _info.yl; fv ++)
+		for (fv = 0; fv <= _info.yl; fv++)
 			inf.read((*_info.sil[totalnum])[fv], _info.xw);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
 		inf.read(*_info.mani[totalnum], _info.size - 6);
@@ -945,7 +945,7 @@ void Trip::call_special(uint16 which) {
 			}
 		}
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_y --;
+		_vm->_gyro->dna.cat_y--;
 		catamove(4);
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
@@ -1079,7 +1079,7 @@ void Trip::newspeed() {
 
 	//setactivepage(1 - cp);
 
-	for (page_ = 0; page_ <= 1; page_ ++)
+	for (page_ = 0; page_ <= 1; page_++)
 		getset[page_].remember(lightspace);
 	
 }
@@ -1304,7 +1304,7 @@ void Trip::spin(byte whichway, byte &tripnum) {
 
 void Trip::geida_procs(byte tripnum) {
 	if (_vm->_gyro->dna.geida_time > 0) {
-		_vm->_gyro->dna.geida_time --;
+		_vm->_gyro->dna.geida_time--;
 		if (_vm->_gyro->dna.geida_time == 0)
 			_vm->_gyro->dna.geida_spin = 0;
 	}


Commit: d2312e626b9527a7afd2be087e4eb10c78f15351
    https://github.com/scummvm/scummvm/commit/d2312e626b9527a7afd2be087e4eb10c78f15351
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:55:31-07:00

Commit Message:
AVALANCHE: Review use of brackets in acci2

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index b69e051..ef66311 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -214,23 +214,26 @@ void Acci::init() {
 }
 
 void Acci::clearWords() {
-	for (byte i = 0; i < 11; i++)
+	for (byte i = 0; i < 11; i++) {
 		if (!_realWords[i].empty())
 			_realWords[i].clear();
+	}
 }
 
 byte Acci::wordNum(Common::String word) {
 	if (word.empty())
 		return 0;
 	
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) 
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
 		if (kVocabulary[i]._word == word)
 			return kVocabulary[i]._number;
+	}
 
 	// If not found as a whole, we look for it as a substring.
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) 
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
 		if (Common::String(kVocabulary[i]._word.c_str(), word.size()) == word)
 			return kVocabulary[i]._number;
+	}
 
 	return kPardon;
 }
@@ -301,13 +304,14 @@ void Acci::cheatParse(Common::String codes) {
 void Acci::stripPunctuation(Common::String &word) {
 	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
 
-	for (byte i = 0; i < 32; i++)
-		do {
+	for (byte i = 0; i < 32; i++) {
+		for (;;) {
 			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
 			if (pos == -1)
 				break;
 			word.deleteChar(pos);
-		} while (true);
+		}
+	}
 }
 
 
@@ -363,9 +367,11 @@ void Acci::properNouns() {
 	_vm->_parser->_inputText.toLowercase();
 
 	// We set every word's first character to uppercase.
-	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++)
+	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
 		if (_vm->_parser->_inputText[i] == ' ')
 			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
+	}
+	
 	// And the first character as well.
 	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
 }
@@ -390,39 +396,35 @@ void Acci::storeInterrogation(byte interrogation) {
 	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
-	case 1: {
-			_vm->_parser->_inputText.toLowercase();
-			sayIt();
-			_vm->_gyro->dna.like2drink = _vm->_parser->_inputText;
-			_vm->_gyro->dna.cardiff_things = 2;
-		}
-		break;
-	case 2: {
-			properNouns();
-			sayIt();
-			_vm->_gyro->dna.favourite_song = _vm->_parser->_inputText;
-			_vm->_gyro->dna.cardiff_things = 3;
-		}
-		break;
-	case 3: {
-			properNouns();
-			sayIt();
-			_vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText;
-			_vm->_gyro->dna.cardiff_things = 4;
-		}
-		break;
-	case 4: {
-			_vm->_parser->_inputText.toLowercase();
-			sayIt();
-			if (!_vm->_gyro->dna.spare_evening.empty())
-				_vm->_gyro->dna.spare_evening.clear();
-			_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
-			_vm->_visa->dixi('z', 5); /* His closing statement... */
-			_vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */
-			_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
-			_vm->_gyro->magics[1].op = _vm->_gyro->nix;
-			_vm->_gyro->dna.cardiff_things = 5;
-		}
+	case 1:
+		_vm->_parser->_inputText.toLowercase();
+		sayIt();
+		_vm->_gyro->dna.like2drink = _vm->_parser->_inputText;
+		_vm->_gyro->dna.cardiff_things = 2;
+		break;
+	case 2:
+		properNouns();
+		sayIt();
+		_vm->_gyro->dna.favourite_song = _vm->_parser->_inputText;
+		_vm->_gyro->dna.cardiff_things = 3;
+		break;
+	case 3:
+		properNouns();
+		sayIt();
+		_vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText;
+		_vm->_gyro->dna.cardiff_things = 4;
+		break;
+	case 4:
+		_vm->_parser->_inputText.toLowercase();
+		sayIt();
+		if (!_vm->_gyro->dna.spare_evening.empty())
+			_vm->_gyro->dna.spare_evening.clear();
+		_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
+		_vm->_visa->dixi('z', 5); /* His closing statement... */
+		_vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */
+		_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix;
+		_vm->_gyro->dna.cardiff_things = 5;
 		break;
 	case 99:
 		//store_high(_vm->_parser->_inputText);
@@ -512,21 +514,24 @@ void Acci::parse() {
 
 		// Delete words we already processed.
 		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
-		if (spacePos > -1)
+		if (spacePos > -1) {
 			for (byte i = 0; i <= spacePos; i++)
 				inputTextUpper.deleteChar(0);
+		}
+
 		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
-		if (spacePos > -1)
+		if (spacePos > -1) {
 			for (byte i = 0; i <= spacePos; i++)
 				inputText.deleteChar(0);
+		}
 	}
 
 	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) 
 		_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
-	else
+	else {
 		if (!_unknown.empty())
 			_unknown.clear();
-
+	}
 	// Replace words' codes that mean the same.
 	replace(Common::String('\xFF'), 0); /* zap noise words */
 	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
@@ -577,24 +582,28 @@ void Acci::parse() {
 		i++;
 	}
 
-	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) // Still not found.
-		for (i = 0; i < _thats.size() - 1; i++)
+	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // Still not found.
+		for (i = 0; i < _thats.size() - 1; i++) {
 			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
 				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
+		}
+	}
 
-	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty())// STILL not found! Must be the word after "say".
-		for (i = 0; i < _thats.size() - 1; i++)
+	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+		for (i = 0; i < _thats.size() - 1; i++) {
 			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
 				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
+		}
+	}
 
-	for (int8 i = _thats.size() - 1; i >= 0; i--) // Reverse order, so first will be used.
+	for (int8 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
 		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
 			_verb = (byte)_thats[i];
 		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
@@ -604,12 +613,13 @@ void Acci::parse() {
 			_person = (byte)_thats[i];
 		else if ((byte)_thats[i] == 251)
 			_polite = true;
+	}
 
-		if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-				_vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
-				_vm->_gyro->weirdword = true;
-		} else
-			_vm->_gyro->weirdword = false;
+	if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+			_vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
+			_vm->_gyro->weirdword = true;
+	} else
+		_vm->_gyro->weirdword = false;
 
 	if (_thats.empty())
 		_thats = kNothing;
@@ -617,11 +627,12 @@ void Acci::parse() {
 	if (_thing != kPardon)
 		_vm->_gyro->it = _thing;
 
-	if (_person != kPardon)
+	if (_person != kPardon) {
 		if (_person < 175)
 			_vm->_gyro->him = _person;
 		else
 			_vm->_gyro->her = _person;
+	}
 }
 
 void Acci::examineObject() {   
@@ -709,8 +720,6 @@ bool Acci::holding() {
 	return holdingResult;
 }
 
-
-
 void Acci::openBox(bool isOpening) {
 	if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
@@ -745,30 +754,29 @@ void Acci::examine() {
 		}
 	} else if (_person != kPardon)
 		exampers();
-	else _vm->_scrolls->display("It's just as it looks on the picture.");  // Don't know: guess.
+	else
+		_vm->_scrolls->display("It's just as it looks on the picture.");  // Don't know: guess.
 }
 
-
-
 void Acci::inventory() {
 	byte itemNum = 0;
 	_vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
-	{
-		for (byte i = 0; i < numobjs; i++)
-			if (_vm->_gyro->dna.obj[i]) {
-				itemNum++;
-				if (itemNum == _vm->_gyro->dna.carrying)
-					_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-				_vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer);
-				if ((i + 1) == _vm->_gyro->dna.wearing)
-					_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
-				if (itemNum < _vm->_gyro->dna.carrying)
-					_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
-			}
-			if (_vm->_gyro->dna.wearing == kNothing)
-				_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
-			else
-				_vm->_scrolls->display(".");
+
+	for (byte i = 0; i < numobjs; i++) {
+		if (_vm->_gyro->dna.obj[i]) {
+			itemNum++;
+			if (itemNum == _vm->_gyro->dna.carrying)
+				_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer);
+			if ((i + 1) == _vm->_gyro->dna.wearing)
+				_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
+			if (itemNum < _vm->_gyro->dna.carrying)
+				_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
+		}
+		if (_vm->_gyro->dna.wearing == kNothing)
+			_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
+		else
+			_vm->_scrolls->display(".");
 	}
 }
 
@@ -776,18 +784,17 @@ void Acci::swallow() {   /* Eat something. */
 	switch (_thing) {
 	case Gyro::wine:
 		switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */
-		case 1: {
-				if (_vm->_gyro->dna.teetotal)  {
-					_vm->_visa->dixi('D', 6);
-					return;
-				}
-				_vm->_visa->dixi('U', 1);
-				_vm->_pingo->wobble();
-				_vm->_visa->dixi('U', 2);
-				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
-				_vm->_lucerna->objectlist();
-				drink();
+		case 1:
+			if (_vm->_gyro->dna.teetotal)  {
+				_vm->_visa->dixi('D', 6);
+				return;
 			}
+			_vm->_visa->dixi('U', 1);
+			_vm->_pingo->wobble();
+			_vm->_visa->dixi('U', 2);
+			_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
+			_vm->_lucerna->objectlist();
+			drink();
 			break;
 		case 2:
 		case 3:
@@ -795,12 +802,11 @@ void Acci::swallow() {   /* Eat something. */
 			break; /* You can't drink it! */
 		}
 		break;
-	case Gyro::potion: {
-			_vm->_gyro->background(4);
-			_vm->_visa->dixi('U', 3);
-			_vm->_lucerna->gameover();
-			_vm->_gyro->background(0);
-		}
+	case Gyro::potion:
+		_vm->_gyro->background(4);
+		_vm->_visa->dixi('U', 3);
+		_vm->_lucerna->gameover();
+		_vm->_gyro->background(0);
 		break;
 	case Gyro::ink:
 		_vm->_visa->dixi('U', 4);
@@ -808,10 +814,9 @@ void Acci::swallow() {   /* Eat something. */
 	case Gyro::chastity:
 		_vm->_visa->dixi('U', 5);
 		break;
-	case Gyro::mushroom: {
-			_vm->_visa->dixi('U', 6);
-			_vm->_lucerna->gameover();
-		}
+	case Gyro::mushroom:
+		_vm->_visa->dixi('U', 6);
+		_vm->_lucerna->gameover();
 		break;
 	case Gyro::onion:
 		if (_vm->_gyro->dna.rotten_onion)
@@ -833,15 +838,16 @@ void Acci::swallow() {   /* Eat something. */
 void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 	
-	for (byte i = 1; i < 29; i++) // Start at 1 so we don't list Avvy himself!
+	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
 		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room)
 			numPeople++;
+	}
 
 	if (numPeople == 0) // If nobody's here, we can cut out straight away.
 		return;
 
 	byte actPerson = 0; // Actually listed people.
-	for (byte i = 1; i < 29; i++)
+	for (byte i = 1; i < 29; i++) {
 		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
@@ -851,6 +857,7 @@ void Acci::peopleInRoom() {
 			else // The end.
 				_vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
 		}
+	}
 
 	if (numPeople == 1)
 		_vm->_scrolls->display(Common::String(" is") + _vm->_scrolls->kControlToBuffer);
@@ -921,11 +928,10 @@ void Acci::openDoor() {
 		break;
 	}
 
-
 	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
 		return; // No doors can open if you can't move Avvy.
 
-	for (byte fv = 8; fv < 15; fv++)
+	for (byte fv = 8; fv < 15; fv++) {
 		if (_vm->_trip->infield(fv + 1)) {
 			fv -= 8;
 
@@ -951,6 +957,7 @@ void Acci::openDoor() {
 			
 			return;
 		}
+	}
 
 	if (_vm->_gyro->dna.room == r__map)
 		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
@@ -1130,8 +1137,6 @@ void Acci::cardiffClimbing() {
 	}
 }
 
-
-
 void Acci::already() {
 	_vm->_scrolls->display("You're already standing!");
 }
@@ -1272,11 +1277,12 @@ void Acci::winSequence() {
 }
 
 void Acci::personSpeaks() {
-	if ((_person == kPardon) || (_person == 0))
+	if ((_person == kPardon) || (_person == 0)) {
 		if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
 			_person = _vm->_gyro->her;
 		else
 			_person = _vm->_gyro->him;
+	}
 
 	if (_vm->_gyro->whereis[_person - 150] != _vm->_gyro->dna.room) {
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
@@ -1292,12 +1298,13 @@ void Acci::personSpeaks() {
 		}
 	}
 
-	if (!found)
-		for (byte i = 0; i < 16; i++) 
+	if (!found) {
+		for (byte i = 0; i < 16; i++) {
 			if ((_vm->_gyro->quasipeds[i].who == _person) && (_vm->_gyro->quasipeds[i].room == _vm->_gyro->dna.room))
 				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
+		}
+	}
 }
-
 void Acci::heyThanks() {
 	personSpeaks();
 	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
@@ -1324,16 +1331,16 @@ void Acci::doThat() {
 
 
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
-		&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir)
-		&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) {
-			if (!_vm->_gyro->alive) {
-				_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
-				return;
-			}
-			if (!_vm->_gyro->dna.avvy_is_awake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
-				_vm->_scrolls->display("Talking in your sleep? Try waking up!");
-				return;
-			}
+	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir)
+	&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) {
+		if (!_vm->_gyro->alive) {
+			_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
+			return;
+		}
+		if (!_vm->_gyro->dna.avvy_is_awake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+			_vm->_scrolls->display("Talking in your sleep? Try waking up!");
+			return;
+		}
 	}
 
 	switch (_verb) {
@@ -1527,19 +1534,18 @@ void Acci::doThat() {
 		_vm->_scrolls->display("Just use the arrow keys to walk there.");
 		break;
 	case kVerbCodeInfo: {
-			_vm->_scrolls->aboutscroll = true;
-
-			Common::String toDisplay;
-			for (byte i = 0; i < 7; i++)
-				toDisplay += _vm->_scrolls->kControlNewLine;
-			toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
-				+ "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine
-				+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-				+ "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
-				+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
-			_vm->_scrolls->display(toDisplay);
-
-			_vm->_scrolls->aboutscroll = false;
+		_vm->_scrolls->aboutscroll = true;
+
+		Common::String toDisplay;
+		for (byte i = 0; i < 7; i++)
+			toDisplay += _vm->_scrolls->kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
+			+ "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine
+			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+			+ "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
+			+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
+		_vm->_scrolls->display(toDisplay);
+		_vm->_scrolls->aboutscroll = false;
 		}
 		break;
 	case kVerbCodeUndress:
@@ -1635,7 +1641,7 @@ void Acci::doThat() {
 			}
 		} else if (holding()) {
 			switch (_thing) {
-			case Gyro::lute : {
+			case Gyro::lute :
 					_vm->_visa->dixi('U', 7);
 
 					if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
@@ -1643,7 +1649,6 @@ void Acci::doThat() {
 
 					if (_vm->_gyro->whereis[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room)
 						_vm->_visa->dixi('U', 15);
-				}
 				break;
 			case 52:
 				if (_vm->_gyro->dna.room == r__musicroom)


Commit: 93a5fadcb82e6f9dd97a24442a7f694babce04a5
    https://github.com/scummvm/scummvm/commit/93a5fadcb82e6f9dd97a24442a7f694babce04a5
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T04:58:12-07:00

Commit Message:
AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction

Changed paths:
    engines/avalanche/closing2.h



diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
index 14cf54b..89e2d73 100644
--- a/engines/avalanche/closing2.h
+++ b/engines/avalanche/closing2.h
@@ -49,7 +49,7 @@ private:
 		kScreenBugAlert = 1,
 		kScreenRamCram = 2,
 		kScreenNagScreen = 3,
-		kScreenTwoCopies = 5,
+		kScreenTwoCopies = 5
 	};
 
 	AvalancheEngine *_vm;


Commit: 3f3757e03f6e0eaa735235779146cb9f482827c0
    https://github.com/scummvm/scummvm/commit/3f3757e03f6e0eaa735235779146cb9f482827c0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T05:08:00-07:00

Commit Message:
AVALANCHE: Use a class-key when declaring a friend class

Changed paths:
    engines/avalanche/dropdown2.h
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 7b8f972..105b2b8 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -118,9 +118,9 @@ private:
 
 class Dropdown {
 public:
-	friend headtype;
-	friend onemenu;
-	friend menuset;
+	friend class headtype;
+	friend class onemenu;
+	friend class menuset;
 
 	onemenu ddm_o;
 	menuset ddm_m;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index f91e72c..a431633 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -145,8 +145,8 @@ public:
 
 class Trip {
 public:
-	friend triptype;
-	friend getsettype;
+	friend class triptype;
+	friend class getsettype;
 
 
 


Commit: bbaa645b6cb9480505f21556e0460368cc7a753c
    https://github.com/scummvm/scummvm/commit/bbaa645b6cb9480505f21556e0460368cc7a753c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T05:10:15-07:00

Commit Message:
AVALANCHE: Fix error reported by GCC: extra coma in enum declaraction in acci2

Changed paths:
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index e09c72e..4937bb4 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -89,7 +89,7 @@ public:
 		kVerbCodeHello = 46,
 		kVerbCodeThanks = 47,
 		kVerbCodeSmartAlec = 249,
-		kVerbCodeExpletive = 253,
+		kVerbCodeExpletive = 253
 	};
 
 	static const byte kPardon = 254; // Didn't understand / wasn't given.


Commit: 316e84a4d4db512c4f49bfbd7a7b01588e2ebe94
    https://github.com/scummvm/scummvm/commit/316e84a4d4db512c4f49bfbd7a7b01588e2ebe94
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T05:56:05-07:00

Commit Message:
AVALANCHE: cleanup acci2.h

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ef66311..167faf1 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -284,12 +284,6 @@ Common::String Acci::totalTime() {
 	return result + _vm->_gyro->strf(s) + " seconds.";
 }
 
-
-
-void Acci::number(Common::String &codes) {
-	warning("STUB: Acci::number()");
-}
-
 void Acci::cheatParse(Common::String codes) {
 //	uint16 num;
 //	int16 e;
@@ -1332,7 +1326,7 @@ void Acci::doThat() {
 
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir)
-	&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHighscores) && (_verb != kVerbCodeSmartAlec)) {
+	&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_gyro->alive) {
 			_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
 			return;
@@ -1885,7 +1879,7 @@ void Acci::doThat() {
 		} else
 			_vm->_visa->dixi('Q', 10);
 		break;
-	case kVerbCodePassword:
+	case kVerbCodePasswd:
 		if (_vm->_gyro->dna.room != r__bridge)
 			_vm->_visa->dixi('Q', 12);
 		else {
@@ -1959,7 +1953,7 @@ void Acci::doThat() {
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
-	case kVerbCodeHighscores:
+	case kVerbCodeHiscores:
 		//	show_highs();
 		warning("STUB: Acci::doThat() - case kVerbCodehighscores");
 		break;
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 4937bb4..d881eab 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -41,67 +41,24 @@ class AvalancheEngine;
 class Acci {
 public:
 	enum VerbCode {
-		kVerbCodeExam = 1,
-		kVerbCodeOpen = 2,
-		kVerbCodePause = 3,
-		kVerbCodeGet = 4,
-		kVerbCodeDrop = 5,
-		kVerbCodeInv = 6,
-		kVerbCodeTalk = 7,
-		kVerbCodeGive = 8,
-		kVerbCodeDrink = 9,
-		kVerbCodeLoad = 10,
-		kVerbCodeSave = 11,
-		kVerbCodePay = 12,
-		kVerbCodeLook = 13,
-		kVerbCodeBreak = 14,
-		kVerbCodeQuit = 15,
-		kVerbCodeSit = 16,
-		kVerbCodeStand = 17,
-		kVerbCodeGo = 18,
-		kVerbCodeInfo = 19,
-		kVerbCodeUndress = 20,
-		kVerbCodeWear = 21,
-		kVerbCodePlay = 22,
-		kVerbCodeRing = 23,
-		kVerbCodeHelp = 24,
-		kVerbCodeLarrypass = 25,
-		kVerbCodePhaon = 26,
-		kVerbCodeBoss = 27,
-		kVerbCodePee = 28,
-		kVerbCodeCheat = 29,
-		kVerbCodeMagic = 30,
-		kVerbCodeRestart = 31,
-		kVerbCodeEat = 32,
-		kVerbCodeListen = 33,
-		kVerbCodeBuy = 34,
-		kVerbCodeAttack = 35,
-		kVerbCodePassword = 36,
-		kVerbCodeDir = 37,
-		kVerbCodeDie = 38,
-		kVerbCodeScore = 39,
-		kVerbCodePut = 40,
-		kVerbCodeKiss = 41,
-		kVerbCodeClimb = 42,
-		kVerbCodeJump = 43,
-		kVerbCodeHighscores = 44,
-		kVerbCodeWake = 45,
-		kVerbCodeHello = 46,
-		kVerbCodeThanks = 47,
-		kVerbCodeSmartAlec = 249,
-		kVerbCodeExpletive = 253
+		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
+		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
+		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
+		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
+		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
+		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
+		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
+		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
+		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
+		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
 	};
 
 	static const byte kPardon = 254; // Didn't understand / wasn't given.
-
 	static const int16 kParserWordsNum = 277; // How many words does the parser know?
 	static const byte kNothing = 250;
 	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
-
 	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
 
-
-
 	struct VocabEntry {
 		byte _number;
 		Common::String _word;
@@ -109,102 +66,72 @@ public:
 
 	static const VocabEntry kVocabulary[kParserWordsNum];
 
-	static const char kWhat[];
+	Common::String _realWords[11];
+	byte _verb, _person, _thing;
+	bool _polite;
 
+	Acci(AvalancheEngine *vm);
 
+	void init();
+	void parse();
+	void doThat();
+	void verbOpt(byte verb, Common::String &answer, char &ansKey);
+	void drink();
 
+private:
 	struct RankType {
 		uint16 _score;
 		Common::String _title;
 	};
 
 	static const RankType kRanks[9];
-
-
+	static const char kWhat[];
 
 	Common::String _thats;
 	Common::String _unknown;
-	Common::String _realWords[11];
-	byte _verb, _person, _thing, _thing2;
-	bool _polite;
 
+	byte _thing2;
 
-
-
-	Acci(AvalancheEngine *vm);
-
-	void init();
-
-	void clearWords();
-	void parse();
-	void lookAround(); // This is called when you say "look".
-	void openDoor();
-	void doThat();
-	void verbOpt(byte verb, Common::String &answer, char &ansKey);
-	void drink();
-
-private:
 	AvalancheEngine *_vm;
 
-	byte fv;
-
 	byte wordNum(Common::String word);
 	void replace(Common::String oldChars, byte newChar);
 
 	Common::String rank();
 	Common::String totalTime();
 
-	void number(Common::String &codes);
+	void clearWords();
 	void cheatParse(Common::String codes);
-
 	void stripPunctuation(Common::String &word); // Strips punctuation from word.
-
 	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
 	bool doPronouns();
-
 	void properNouns();
+	void lookAround(); // This is called when you say "look".
 	void sayIt();  // This makes Avalot say the response.
+	void openDoor();
 	void storeInterrogation(byte interrogation);
-
 	void examineObject(); // Examine a standard object-thing
-
 	bool isPersonHere();
-
 	void exampers();
-
 	bool holding();
-
 	void openBox(bool isOpening);
 	void examine();
-
 	void inventory();
-
 	void swallow();
-
 	void peopleInRoom(); // This lists the other people in the room.
-
 	void silly();
 	void putProc();  // Called when you call kVerbCodeput.
-
 	void notInOrder();
 	void goToCauldron();
 	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
-
 	void cardiffClimbing();
-
 	void already();
 	void standUp(); // Called when you ask Avvy to stand.
-
 	void getProc(char thing);
-
 	void giveGeidaTheLute();
-
 	void playHarp();
-
 	void winSequence();
-
 	void personSpeaks();
-
 	void heyThanks();
 };
 


Commit: 41416f0c0529fe43040c640c83160aa076b7fc80
    https://github.com/scummvm/scummvm/commit/41416f0c0529fe43040c640c83160aa076b7fc80
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T07:10:48-07:00

Commit Message:
AVALANCHE: Clean up celer2

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index a84d151..d7f318f 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -37,14 +37,10 @@
 
 #include "common/textconsole.h"
 
-
-
 namespace Avalanche {
 
 const int16 Celer::kOnDisk = -1;
 
-
-
 Celer::Celer(AvalancheEngine *vm) {
 	_vm = vm;
 	_spriteNum = 0;
@@ -54,7 +50,6 @@ Celer::~Celer() {
 	forgetBackgroundSprites();
 }
 
-
 /**
  * @remarks	Originally called 'pics_link'
  */
@@ -79,61 +74,60 @@ void Celer::updateBackgroundSprites() {
 		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0))
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2);
 		break;
-	case r__argentpub: {
-			if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
-				// Malagauche cycle.
-				_vm->_gyro->dna.malagauche += 1;
-				switch (_vm->_gyro->dna.malagauche) {
-				case 1:
-				case 11:
-				case 21:
-					drawBackgroundSprite(-1, -1, 12); // Looks forwards.
-					break; 
-				case 8:
-				case 18:
-				case 28:
-				case 32:
-					drawBackgroundSprite(-1, -1, 11); // Looks at you.
-					break; 
-				case 30:
-					drawBackgroundSprite(-1, -1, 13); // Winks.
-					break; 
-				case 33:
-					_vm->_gyro->dna.malagauche = 0;
-					break;
-				}
-			}
-
-			switch (_vm->_gyro->roomtime % 200) {
-			case 179:
-			case 197:
-				drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
+	case r__argentpub:
+		if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
+			// Malagauche cycle.
+			_vm->_gyro->dna.malagauche += 1;
+			switch (_vm->_gyro->dna.malagauche) {
+			case 1:
+			case 11:
+			case 21:
+				drawBackgroundSprite(-1, -1, 12); // Looks forwards.
 				break; 
-			case 182:
-			case 194:
-				drawBackgroundSprite(-1, -1, 6);
-				break;
-			case 185:
-				drawBackgroundSprite(-1, -1, 7);
-				break;
-			case 199:
-				_vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this.
+			case 8:
+			case 18:
+			case 28:
+			case 32:
+				drawBackgroundSprite(-1, -1, 11); // Looks at you.
+				break; 
+			case 30:
+				drawBackgroundSprite(-1, -1, 13); // Winks.
 				break; 
+			case 33:
+				_vm->_gyro->dna.malagauche = 0;
+				break;
 			}
+		}
 
-			if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
-				byte direction = 0;
-				if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
-					direction = 3;
-				else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
-					direction = 2;
-				else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
-					direction = 4;
-
-				if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
-					drawBackgroundSprite(-1, -1, direction);
-					_vm->_gyro->dna.dogfoodpos = direction;
-				}
+		switch (_vm->_gyro->roomtime % 200) {
+		case 179:
+		case 197:
+			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
+			break; 
+		case 182:
+		case 194:
+			drawBackgroundSprite(-1, -1, 6);
+			break;
+		case 185:
+			drawBackgroundSprite(-1, -1, 7);
+			break;
+		case 199:
+			_vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this.
+			break; 
+		}
+
+		if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
+			byte direction = 0;
+			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
+				direction = 3;
+			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
+				direction = 2;
+			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
+				direction = 4;
+
+			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->dna.dogfoodpos = direction;
 			}
 		}
 		break;
@@ -305,9 +299,10 @@ void Celer::loadBackgroundSprites(byte number) {
 				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; 
 				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
 
-				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++)
+				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
 					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
 						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *_vm->_graphics->getPixel(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
+				}
 			} else {
 				_sprites[i]._size = sprite._size;
 				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
@@ -319,9 +314,10 @@ void Celer::loadBackgroundSprites(byte number) {
 }
 
 void Celer::forgetBackgroundSprites() {
-	for (byte i = 0; i < _spriteNum; i++)
+	for (byte i = 0; i < _spriteNum; i++) {
 		if (_sprites[i]._x > kOnDisk)
 			_sprites[i]._picture.free();
+	}
 }
 
 void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
@@ -378,7 +374,7 @@ void Celer::drawSprite(int16 x, int16 y, const SpriteType &sprite) {
 	_r.y2 = y + sprite._yl;
 
 	switch (sprite._type) {
-	case kNaturalImage: // Allow fallthorugh on purpose.
+	case kNaturalImage: // Allow fallthrough on purpose.
 	case kBgi:
 		_r.x2 = x + sprite._xl + 1;
 		break;
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 56c5f22..fe38ebe 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -36,23 +36,16 @@
 
 #include "graphics/surface.h"
 
-
-
 namespace Avalanche {
 class AvalancheEngine;
 
 class Celer {
 public:
 	Celer(AvalancheEngine *vm);
-
 	~Celer();
 
-
-
 	void updateBackgroundSprites();
-
 	void loadBackgroundSprites(byte number);
-
 	void forgetBackgroundSprites();
 
 	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
@@ -71,8 +64,6 @@ private:
 		::Graphics::Surface _picture;
 	};
 
-
-
 	AvalancheEngine *_vm;
 
 	int32 _offsets[40];
@@ -80,13 +71,8 @@ private:
 	SpriteType _sprites[40];
 	bytefield _r;
 	Common::String _filename;
-
-
-
 	static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */
 
-
-
 	void drawSprite(int16 x, int16 y, const SpriteType &sprite);
 };
 


Commit: 70aa840f0ba482271b8379685a40e59fb115fd8c
    https://github.com/scummvm/scummvm/commit/70aa840f0ba482271b8379685a40e59fb115fd8c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T07:52:44-07:00

Commit Message:
AVALANCHE: Fix GCC warnings reported by GCC

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a007014..564f9fa 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -207,40 +207,37 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	} else {
 		if (!_gyro->dna.like2drink.empty())
 			_gyro->dna.like2drink.clear();
-		uint16 like2drinkSize;
+		uint16 like2drinkSize = 0;
+		char actChr = ' ';
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
-			char actChr;
 			sz.syncAsByte(actChr);
 			_gyro->dna.like2drink += actChr;
 		}
 
 		if (!_gyro->dna.favourite_song.empty())
 			_gyro->dna.favourite_song.clear();
-		uint16 favourite_songSize;
+		uint16 favourite_songSize = 0;
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
-			char actChr;
 			sz.syncAsByte(actChr);
 			_gyro->dna.favourite_song += actChr;
 		}
 
 		if (!_gyro->dna.worst_place_on_earth.empty())
 			_gyro->dna.worst_place_on_earth.clear();
-		uint16 worst_place_on_earthSize;
+		uint16 worst_place_on_earthSize = 0;
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
-			char actChr;
 			sz.syncAsByte(actChr);
 			_gyro->dna.worst_place_on_earth += actChr;
 		}
 
 		if (!_gyro->dna.spare_evening.empty())
 			_gyro->dna.spare_evening.clear();
-		uint16 spare_eveningSize;
+		uint16 spare_eveningSize = 0;
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
-			char actChr;
 			sz.syncAsByte(actChr);
 			_gyro->dna.spare_evening += actChr;
 		}
@@ -285,20 +282,21 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//	}
 	//}
 	
-	byte spriteNum;
+	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		spriteNum = 0;
-		for (byte i = 0; i < _trip->numtr; i++)
+		for (byte i = 0; i < _trip->numtr; i++) {
 			if (_trip->tr[i].quick)
 				spriteNum++;
+		}
 	}
 	sz.syncAsByte(spriteNum);
 	
-	if (sz.isLoading())
+	if (sz.isLoading()) {
 		for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites.
 			if (_trip->tr[i].quick)
 				_trip->tr[i].done();
 		}
+	}
 
 	for (byte i = 0; i < spriteNum; i++) {
 		sz.syncAsByte(_trip->tr[i].whichsprite);
@@ -364,7 +362,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 		return false;
 	}
 
-	char *signature = "AVAL";
+	const char *signature = "AVAL";
 	f->write(signature, 4);
 
 	// Write version. We can't restore from obsolete versions.
@@ -536,6 +534,9 @@ void AvalancheEngine::updateEvents() {
 			break;
 		case Common::EVENT_KEYDOWN:
 			_avalot->handleKeyDown(event);
+			break;
+		default:
+			break;
 		}
 	}
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c791a77..12bdbd0 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -97,6 +97,8 @@ void Avalot::handleKeyDown(Common::Event &event) {
 		case Common::KEYCODE_KP1:
 			event.kbd.keycode = Common::KEYCODE_END;
 			break;
+		default:
+			break;
 	}
 
 	switch (event.kbd.keycode) {
@@ -120,6 +122,8 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_RETURN:
 		_vm->_parser->handleReturn();
 		break;
+	default:
+		break;
 	}
 
 	_vm->_lucerna->showrw();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b4ee2a7..35ccd5f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -177,7 +177,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 		int16 xTemp = xNext;
 		int16 yTemp = yNext;
 		// This is used by both sin and cos.
-		double tempTerm = (j+delta)*convfac;
+		tempTerm = (j + delta) * convfac;
 		
 		xNext = floor(xRadius*cos(tempTerm) + 0.5);
 		yNext = floor(yRadius*sin(tempTerm + pi) + 0.5);
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 67b893f..c8a04ae 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -101,6 +101,8 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F7:
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
 		break;
+	default:
+		break;
 	}
 }
 


Commit: 6818dd2eb4749d4b96d8bf6f4b6b2d0b4d2d8753
    https://github.com/scummvm/scummvm/commit/6818dd2eb4749d4b96d8bf6f4b6b2d0b4d2d8753
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T08:15:33-07:00

Commit Message:
AVALANCHE: Fix some more GCC warnings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 167faf1..9ce3180 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1556,7 +1556,8 @@ void Acci::doThat() {
 		if (holding()) { // Wear something.
 			switch (_thing) {
 			case Gyro::chastity:
-				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??!");
+				// \? are used to avoid that ??! is parsed as a trigraph
+				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you\?\?!");
 				break;
 			case Gyro::clothes:
 			case Gyro::habit: { /* Change this! */
@@ -1667,7 +1668,8 @@ void Acci::doThat() {
 			if (_thing == _vm->_gyro->bell) {
 				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
-					_vm->_scrolls->display("(Are you trying to join in, Avvy??!)");
+					// \? are used to avoid that ??! is parsed as a trigraph
+					_vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)");
 			} else
 				_vm->_scrolls->display(kWhat);
 		}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 417a920..e07607a 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1646,6 +1646,8 @@ void Trip::handleMoveKey(const Common::Event &event) {
 		case Common::KEYCODE_KP5:
 			stopwalking();
 			break;
+		default:
+			break;
 		}
 }
 


Commit: ad5529b5d27748f34cbd978eb3c0040e3a2d266f
    https://github.com/scummvm/scummvm/commit/ad5529b5d27748f34cbd978eb3c0040e3a2d266f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T08:54:08-07:00

Commit Message:
AVALANCHE: Fix more GCC warnings

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 82a5228..f0b1194 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -350,11 +350,11 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 		ander = 170;
 
 	fontType font;
-	for (byte fv = 0; fv < z.size(); fv++)
+	for (byte idx = 0; idx < z.size(); idx++)
 		for (byte ff = 0; ff < 8; ff++) {
-			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander;
+			font[z[idx]][ff] = _vm->_gyro->characters[z[idx]][ff] & ander;
 			for (byte i = 0; i < 8; i++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = lightgray;
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + idx * 8 + i, y + ff) = lightgray;
 		}
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, black);
@@ -363,14 +363,15 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 	if (! z.contains(t))
 		return;
 	else {
-		byte fv;
-		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+		byte idx = 0;
+		for (; z[idx] != t; idx++)
+			; // Search for the character in the string.
 	
 		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
 			if (pixelBit)
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = black;
+				*_vm->_graphics->getPixel(x * 8 + idx * 8 + 7 - bit, y + 8) = black;
 		}
 	}
 
@@ -385,26 +386,27 @@ void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 		ander = 170;
 
 	fontType font;
-	for (byte fv = 0; fv < z.size(); fv++)
+	for (byte idx = 0; idx < z.size(); idx++) {
 		for (byte ff = 0; ff < 8; ff++) {
-			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander; // Set the font.
+			font[z[idx]][ff] = _vm->_gyro->characters[z[idx]][ff] & ander; // Set the font.
 			// And set the background of the text to black.
 			for (byte i = 0; i < 8; i++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = black;
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + idx * 8 + i, y + ff) = black;
 		}
+	}
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, white);
 
 	// Underline the selected character.
 	if (z.contains(t)) {
-		byte fv;
-		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+		byte idx;
+		for (idx = 0; z[idx] != t; idx++); // Search for the character in the string.
 
 		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
 			if (pixelBit)
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = white;
+				*_vm->_graphics->getPixel(x * 8 + idx * 8 + 7 - bit, y + 8) = white;
 		}
 	}
 
@@ -422,11 +424,11 @@ void Dropdown::bleep() {
 	warning("STUB: Dropdown::bleep()");
 }
 
-void Dropdown::parsekey(char r, char re) {
-	switch (r) {
+void Dropdown::parsekey(char key1, char key2) {
+	switch (key1) {
 	case 0:
 	case 224: {
-		switch (re) {
+		switch (key2) {
 		case 'K':
 			if (ddm_o.menunum > 1)  {
 				ddm_o.wipe();
@@ -454,7 +456,7 @@ void Dropdown::parsekey(char r, char re) {
 			ddm_o.movehighlight(1);
 			break;
 		default:
-			ddm_m.extd(re);
+			ddm_m.extd(key2);
 		}
 	}
 	break;
@@ -463,7 +465,7 @@ void Dropdown::parsekey(char r, char re) {
 		break;
 	default: {
 		if (ddm_o.menunow)
-			ddm_o.keystroke(r);
+			ddm_o.keystroke(key1);
 		}
 	}
 }
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 105b2b8..3963579 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -133,7 +133,7 @@ public:
 
 	void find_what_you_can_do_with_it();
 
-	void parsekey(char r, char re);
+	void parsekey(char key1, char key2);
 
 	void menu_link(); /* DDM menu-bar funcs */
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 1653159..47f8b72 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -267,12 +267,12 @@ Common::String Gyro::strf(int32 x) {
 	return q;
 }
 
-void Gyro::newpointer(byte m) {
-	if (m == cmp)
+void Gyro::newpointer(byte id) {
+	if (id == cmp)
 		return;
-	cmp = m;
+	cmp = id;
 
-	load_a_mouse(m);
+	load_a_mouse(id);
 }
 
 void Gyro::wait() {
@@ -388,8 +388,8 @@ bool Gyro::flagset(char x) {
 }
 
 void Gyro::force_numlock() {
-	if ((locks & num) > 0)
-		locks -= num;
+	if ((locks & numlockCode) > 0)
+		locks -= numlockCode;
 }
 
 bool Gyro::pennycheck(uint16 howmuchby) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 3caa946..971fbbd 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -45,16 +45,10 @@ class AvalancheEngine;
 
 static const char numobjs = 18; /* always preface with a # */
 static const int16 maxobjs = 12;  /* carry limit */
-static const byte howlong = 1/*8*/; /* 18 ticks. */
-
-static const int16 num = 32;  /* Code for Num Lock */
 
+static const int16 numlockCode = 32;  /* Code for Num Lock */
 static const int16 mouse_size = 134;
 
-
-
-typedef void (*proc)();
-
 struct postype {
 	uint16 x, y, datapos;
 	byte length;
@@ -282,17 +276,6 @@ struct ednahead { /* Edna header */
 	/* DNA values follow, then footer (which is ignored) */
 };
 
-/* Possible values of edhead.os:
-	1 = DOS        4 = Mac
-	2 = Windows    5 = Amiga
-	3 = OS/2       6 = ST
-	7 = Archimedes */
-
-
-
-
-
-
 class Gyro {
 public:
 	static const char *vernum;
@@ -535,7 +518,7 @@ public:
 	Common::String flags;
 	Common::String listen;
 
-	uint16 oh, onh, om, h, m, s, s1;
+	uint16 oh, onh, om, hour, minutes, seconds;
 
 	Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
 
@@ -612,7 +595,7 @@ public:
 
 	Common::String strf(int32 x);
 
-	void newpointer(byte m);
+	void newpointer(byte id);
 
 	void wait();    // Makes hourglass.
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 389aa2e..7bd4ca5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -61,8 +61,10 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 void Lucerna::init() {
 	_vm->_gyro->oh = 17717;
 	_vm->_gyro->om = 17717;
-	if (_vm->_enhanced->atbios)  _vm->_gyro->atkey = "f1";
-	else _vm->_gyro->atkey = "alt-";
+	if (_vm->_enhanced->atbios)
+		_vm->_gyro->atkey = "f1";
+	else
+		_vm->_gyro->atkey = "alt-";
 }
 	
 void Lucerna::callverb(byte n) {
@@ -1234,7 +1236,7 @@ void Lucerna::plothands() {
 	hand(am, brown);
 
 	calchand(nh, 14, ah, brown);
-	calchand(_vm->_gyro->m * 6, 17, am, brown);
+	calchand(_vm->_gyro->minutes * 6, 17, am, brown);
 	hand(ah, yellow);
 	hand(am, yellow);
 
@@ -1253,26 +1255,26 @@ void Lucerna::clock_lucerna() {
 	/* ...Clock. */
 	TimeDate t;
 	_vm->_system->getTimeAndDate(t);
-	_vm->_gyro->h = t.tm_hour;
-	_vm->_gyro->m = t.tm_min;
-	_vm->_gyro->s = t.tm_sec;
+	_vm->_gyro->hour = t.tm_hour;
+	_vm->_gyro->minutes = t.tm_min;
+	_vm->_gyro->seconds = t.tm_sec;
 
-	nh = (_vm->_gyro->h % 12) * 30 + _vm->_gyro->m / 2;
+	nh = (_vm->_gyro->hour % 12) * 30 + _vm->_gyro->minutes / 2;
 
-	if (_vm->_gyro->oh != _vm->_gyro->h)  {
+	if (_vm->_gyro->oh != _vm->_gyro->hour)  {
 		plothands();
 		chime();
 	}
 
-	if (_vm->_gyro->om != _vm->_gyro->m)
+	if (_vm->_gyro->om != _vm->_gyro->minutes)
 		plothands();
 
-	if ((_vm->_gyro->h == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
+	if ((_vm->_gyro->hour == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
 		_vm->_scrolls->display(Common::String("Good morning!") + 13 + 13 + "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
 	
-	_vm->_gyro->oh = _vm->_gyro->h;
+	_vm->_gyro->oh = _vm->_gyro->hour;
 	_vm->_gyro->onh = nh;
-	_vm->_gyro->om = _vm->_gyro->m;
+	_vm->_gyro->om = _vm->_gyro->minutes;
 }
 
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 65c4faa..51d47a9 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -464,7 +464,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 void Scrolls::bubble(func2 gotoit) {
 	int16 xl, yl, my, xw, yw;
-	byte fv;
 	Common::Point p[3];
 //	byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
 	int16 xc; /* x correction */
@@ -478,7 +477,7 @@ void Scrolls::bubble(func2 gotoit) {
 
 	xl = 0;
 	yl = _vm->_gyro->scrolln * 5;
-	for (int8 fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+	for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
 		uint16 textWidth = _vm->_gyro->scroll[fv].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
@@ -527,7 +526,7 @@ void Scrolls::bubble(func2 gotoit) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (fv = 0; fv < _vm->_gyro->scrolln; fv++) {
+	for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
 		int16 x = xc + _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
 		bool offset = _vm->_gyro->scroll[fv].size() % 2;
 		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 68a8ea3..d5983c8 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -45,7 +45,7 @@ Sequence::Sequence(AvalancheEngine *vm) {
 
 void Sequence::first_show(byte what) {
 	/* First, we need to blank out the entire array. */
-	for (int i = 0; i < sizeof(seq); i++)
+	for (uint i = 0; i < sizeof(seq); i++)
 		seq[i] = 0;
 
 	/* Then it's just the same as then_show. */
@@ -54,7 +54,7 @@ void Sequence::first_show(byte what) {
 }
 
 void Sequence::then_show(byte what) {
-	for (byte fv = 0; fv < seq_length; fv++) {
+	for (int16 fv = 0; fv < seq_length; fv++) {
 		if (seq[fv] == 0) {
 			seq[fv] = what;
 			return;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index e07607a..31ff07b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -271,10 +271,10 @@ void triptype::bounce() {
 	_tr->_vm->_gyro->oncandopageswap = true;
 }
 
-int8 triptype::sgn(int16 x) {
-	if (x > 0)
+int8 triptype::sgn(int16 val) {
+	if (val > 0)
 		return 1;
-	else if (x < 0)
+	else if (val < 0)
 		return -1;
 	else
 		return 0;
@@ -465,12 +465,10 @@ Trip::Trip(AvalancheEngine *vm) {
 }
 
 void Trip::loadtrip() {
-	byte gm;
-
-	for (gm = 0; gm < numtr; gm++)
+	for (int16 gm = 0; gm < numtr; gm++)
 		tr[gm].original();
 	
-	for (int i = 0; i < sizeof(aa); i++)
+	for (uint16 i = 0; i < sizeof(aa); i++)
 		aa[i] = 0;
 }
 
@@ -1084,8 +1082,8 @@ void Trip::newspeed() {
 	
 }
 
-void Trip::rwsp(byte t, byte r) {
-	switch (r) {
+void Trip::rwsp(byte t, byte dir) {
+	switch (dir) {
 	case up:
 		tr[t].speed(0, -tr[t].ys);
 		break;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index a431633..1f2b83d 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -121,7 +121,7 @@ private:
 
 	bool collision_check();
 
-	int8 sgn(int16 x);
+	int8 sgn(int16 val);
 };
 
 
@@ -198,7 +198,7 @@ public:
 
 	void tripkey(char dir);
 
-	void rwsp(byte t, byte r);
+	void rwsp(byte t, byte dir);
 
 	void apped(byte trn, byte np);
 


Commit: d77eafb0dbbb2c797d014fcf84c908cf6914b184
    https://github.com/scummvm/scummvm/commit/d77eafb0dbbb2c797d014fcf84c908cf6914b184
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T09:12:06-07:00

Commit Message:
AVALANCHE: Partially do the renaming in Dropdown.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 68272c8..a36ea30 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -468,7 +468,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->minor_redraw();
 
-	_dropdown->standard_bar();
+	_dropdown->setupMenu();
 
 	_gyro->whereis[0] = _gyro->dna.room;
 	
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e7a7a49..14ff7e5 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -201,7 +201,7 @@ void Avalot::run(Common::String arg) {
 
 
 		_vm->_lucerna->clock_lucerna();
-		_vm->_dropdown->menu_link();
+		_vm->_dropdown->updateMenu();
 		_vm->_gyro->force_numlock();
 		_vm->_trip->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 4ef6504..e814ba8 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -39,125 +39,119 @@
 
 #include "common/textconsole.h"
 
-namespace Avalanche {
 
-headtype *headtype::init(char trig, char alttrig, Common::String name, byte p, func dw, func dc, Dropdown *dr) {
-	_dr = dr;
 
-	trigger = trig;
-	alttrigger = alttrig;
-	title = name;
-	position = p;
-	xpos = position * _dr->spacing + _dr->indent;
-	xright = (position + 1) * _dr->spacing + _dr->indent;
-	do_setup = dw;
-	do_choose = dc;
+namespace Avalanche {
+
+void HeadType::init(char trig, char altTrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr) {
+	_trigger = trig;
+	_altTrigger = altTrig;
+	_title = title;
+	_position = pos;
+	_xpos = _position * _dr->kSpacing + _dr->kIndent;
+	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
+	_setupFunc = setupFunc;
+	_chooseFunc = chooseFunc;
 
-	return this;
+	_dr = dr;
 }
 
-void headtype::display() {
-	CursorMan.showMouse(false); /*MT*/
-	_dr->chalk(xpos, 1, trigger, title, true);
-	CursorMan.showMouse(true); /*MT*/
+void HeadType::draw() {
+	CursorMan.showMouse(false); 
+	_dr->drawMenuItem(_xpos, 1, _trigger, _title, true);
+	CursorMan.showMouse(true);
 }
 
-void headtype::highlight() {
+void HeadType::highlight() {
 	CursorMan.showMouse(false);
 
 	//nosound();
 	//setactivepage(cp);
 	warning("STUB: Dropdown::headytpe::highlight()");
 
-	_dr->hlchalk(xpos, 1, trigger, title, true);
+	_dr->drawHighlightedMenuItem(_xpos, 1, _trigger, _title, true);
 	
-	_dr->ddm_o.left = xpos;
-	_dr->ddm_o.menunow = true;
+	_dr->_activeMenuItem._left = _xpos;
+	_dr->_activeMenuItem._activeNow = true;
 	_dr->_vm->_gyro->ddmnow = true;
-	_dr->ddm_o.menunum = position;
+	_dr->_activeMenuItem._activeNum = _position;
 	
-	_dr->_vm->_gyro->cmp = 177; /* Force redraw of cursor. */
+	_dr->_vm->_gyro->cmp = 177; // Force redraw of cursor.
 }
 
-bool headtype::extdparse(char c) {
-	if (c != alttrigger)  
+bool HeadType::parseAltTrigger(char key) {
+	if (key != _altTrigger)  
 		return true;
 	return false;
 }
 
 
 
-
-
-
-void onemenu::init(Dropdown *dr) {
+void MenuItem::init(Dropdown *dr) {
 	_dr = dr;
-	menunow = false;
+	_activeNow = false;
 	_dr->_vm->_gyro->ddmnow = false;
-	menunum = 1;
+	_activeNum = 1;
 }
 
-void onemenu::start_afresh() {
-	number = 0;
-	width = 0;
-	firstlix = false;
-	oldy = 0;
-	highlightnum = 0;
+void MenuItem::reset() {
+	_optionNum = 0;
+	_width = 0;
+	_firstlix = false;
+	_oldY = 0;
+	_highlightNum = 0;
 }
 
-void onemenu::opt(Common::String n, char tr, Common::String key, bool val) {
-	uint16 l = (n + key).size() + 3;
-	if (width < l)
-		width = l;
+void MenuItem::setupOption(Common::String title, char trigger, Common::String shortcut, bool valid) {
+	uint16 width = (title + shortcut).size() + 3;
+	if (_width < width)
+		_width = width;
 
-	oo[number].title = n;
-	oo[number].trigger = tr;
-	oo[number].shortcut = key;
-	oo[number].valid = val;
-	number++;
+	_options[_optionNum]._title = title;
+	_options[_optionNum]._trigger = trigger;
+	_options[_optionNum]._shortcut = shortcut;
+	_options[_optionNum]._valid = valid;
+	_optionNum++;
 }
 
-void onemenu::displayopt(byte y, bool highlit) {
+void MenuItem::displayOption(byte y, bool highlit) {
 	byte backgroundColor;
 	if (highlit)
 		backgroundColor = 0;
 	else
 		backgroundColor = 7;
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((flx1 + 1) * 8, 3 + (y + 1) * 10, (flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
-	//bar((flx1 + 1) * 8, 3 + y * 10, (flx2 + 1) * 8, 12 + y * 10);
-
-	Common::String data = oo[y].title;
-	while (data.size() + oo[y].shortcut.size() < width)
-		data += ' '; /* Pad oo[y] spaces. */
-	data += oo[y].shortcut;
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
+	
+	Common::String data = _options[y]._title;
+	while (data.size() + _options[y]._shortcut.size() < _width)
+		data += ' '; // Pad _options[y] with spaces.
+	data += _options[y]._shortcut;
 
 	if (highlit)
-		_dr->hlchalk(left, 4 + (y + 1) * 10, oo[y].trigger, data, oo[y].valid);
+		_dr->drawHighlightedMenuItem(_left, 4 + (y + 1) * 10, _options[y]._trigger, data, _options[y]._valid);
 	else
-		_dr->chalk(left, 4 + (y + 1) * 10, oo[y].trigger, data, oo[y].valid);
+		_dr->drawMenuItem(_left, 4 + (y + 1) * 10, _options[y]._trigger, data, _options[y]._valid);
 }
 
-void onemenu::display() {
+void MenuItem::display() {
 	CursorMan.showMouse(false);
 	/*setactivepage(cp);
 	setvisualpage(cp);
 	setfillstyle(1, menu_b);
 	setcolor(menu_border);*/
-	firstlix = true;
-	flx1 = left - 2;
-	flx2 = left + width;
-	fly = 15 + number * 10;
-	menunow = true;
+	_firstlix = true;
+	_flx1 = _left - 2;
+	_flx2 = _left + _width;
+	fly = 15 + _optionNum * 10;
+	_activeNow = true;
 	_dr->_vm->_gyro->ddmnow = true;
 
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((flx1 + 1) * 8, 12, (flx2 + 1) * 8, fly), _dr->menu_b);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((flx1 + 1) * 8 - 1, 11, (flx2 + 1) * 8 + 1, fly + 1), _dr->menu_border);
-	/*bar((flx1 + 1) * 8, 12, (flx2 + 1) * 8, fly);
-	rectangle((flx1 + 1) * 8 - 1, 11, (flx2 + 1) * 8 + 1, fly + 1);*/
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, fly), _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
 
-	displayopt(0, true);
-	for (byte y = 1; y < number; y++)
-		displayopt(y, false);
+	displayOption(0, true);
+	for (byte y = 1; y < _optionNum; y++)
+		displayOption(y, false);
 	
 	_dr->_vm->_gyro->defaultled = 1;
 	_dr->_vm->_gyro->cmp = 177;
@@ -165,71 +159,67 @@ void onemenu::display() {
 	CursorMan.showMouse(true); // 4 = fletch
 }
 
-void onemenu::wipe() {
+void MenuItem::wipe() {
 	//setactivepage(cp);
 	CursorMan.showMouse(false); 
 	
-	_dr->chalk(_dr->ddm_m.ddms[_dr->ddm_o.menunum].xpos, 1, _dr->ddm_m.ddms[_dr->ddm_o.menunum].trigger, _dr->ddm_m.ddms[_dr->ddm_o.menunum].title, true);
-	/*mblit(flx1, 11, flx2 + 1, fly + 1, 3, cp);
-	blitfix();*/
+	_dr->drawMenuItem(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true);
 
-	menunow = false;
+	_activeNow = false;
 	_dr->_vm->_gyro->ddmnow = false;
-	firstlix = false;
+	_firstlix = false;
 	_dr->_vm->_gyro->defaultled = 2;
 
 	CursorMan.showMouse(true); 
 }
 
-void onemenu::movehighlight(int8 add) {
-	int8 hn;
-	if (add != 0) {
-		hn = highlightnum + add;
-		if ((hn < 0) || (hn >= number))
+void MenuItem::moveHighlight(int8 inc) {
+	int8 highlightNum;
+	if (inc != 0) {
+		highlightNum = _highlightNum + inc;
+		if ((highlightNum < 0) || (highlightNum >= _optionNum))
 			return;
-		highlightnum = hn;
+		_highlightNum = highlightNum;
 	}
 	//setactivepage(cp);
 	CursorMan.showMouse(false); 
-	displayopt(oldy, false);
-	displayopt(highlightnum, true);
+	displayOption(_oldY, false);
+	displayOption(_highlightNum, true);
 	//setactivepage(1 - cp);
-	oldy = highlightnum;
+	_oldY = _highlightNum;
 	CursorMan.showMouse(true); 
 }
 
-void onemenu::lightup(Common::Point cursorPos) { 
-	if ((cursorPos.x < flx1 * 8) || (cursorPos.x > flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
+void MenuItem::lightUp(Common::Point cursorPos) { 
+	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
 		return;
-	highlightnum = (cursorPos.y - 26) / 20;
-	if (highlightnum == oldy)
+	_highlightNum = (cursorPos.y - 26) / 20;
+	if (_highlightNum == _oldY)
 		return;
-	movehighlight(0);
+	moveHighlight(0);
 }
 
-void onemenu::select(byte n) {    /* Choose which one you want. */
-	if (!oo[n].valid)
+void MenuItem::select(byte which) {    
+	if (!_options[which]._valid)
 		return;
 
-	choicenum = n;
+	_choiceNum = which;
 	wipe();
 
-	if (choicenum == number)
-		choicenum--; /* Off the bottom. */
-	if (choicenum > number)
-		choicenum = 0; /* Off the top, I suppose. */
+	if (_choiceNum == _optionNum)
+		_choiceNum--; /* Off the bottom. */
+	if (_choiceNum > _optionNum)
+		_choiceNum = 0; /* Off the top, I suppose. */
 
-	(_dr->*_dr->ddm_m.ddms[menunum].do_choose)();
+	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
 }
 
-void onemenu::keystroke(char c) {
-	byte fv;
-	bool found;
+void MenuItem::parseKey(char c) {
 	c = toupper(c);
-	found = false;
-	for (fv = 0; fv < number; fv++) {
-		if ((toupper(oo[fv].trigger) == c) && oo[fv].valid) {
-			select(fv);
+	bool found = false;
+	for (byte i = 0; i < _optionNum; i++) {
+		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
+			select(i);
 			found = true;
 		}
 	}
@@ -239,82 +229,74 @@ void onemenu::keystroke(char c) {
 
 
 
-
-
-void menuset::init(Dropdown *dr) {
+void MenuBar::init(Dropdown *dr) {
 	_dr = dr;
-	howmany = 0;
+	_menuNum = 0;
 }
 
-void menuset::create(char t, Common::String n, char alttrig, func dw, func dc) {
-	ddms[howmany].init(t, alttrig, n, howmany, dw, dc, _dr);
-	howmany++;
+void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc) {
+	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
+	_menuNum++;
 }
 
-void menuset::update() {
+void MenuBar::draw() {
 	const bytefield menuspace = {0, 0, 80, 9};
-	byte fv, page_, savecp;
 
-	/*setactivepage(3);
-	setfillstyle(1, _dr->menu_b);
-	bar(0, 0, 640, 9);*/
-	_dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->menu_b);
+	//setactivepage(3);
+	
+	_dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->kMenuBackgroundColor);
 
-	savecp = _dr->_vm->_gyro->cp;
+	byte savecp = _dr->_vm->_gyro->cp;
 	_dr->_vm->_gyro->cp = 3;
 
-	for (fv = 0; fv < howmany; fv++)
-		ddms[fv].display();
+	for (byte i = 0; i < _menuNum; i++)
+		_menuItems[i].draw();
 
-	for (page_ = 0; page_ <= 1; page_++)
-		_dr->_vm->_trip->getset[page_].remember(menuspace);
+	for (byte page = 0; page <= 1; page++)
+		_dr->_vm->_trip->getset[page].remember(menuspace);
 
 	_dr->_vm->_gyro->cp = savecp;
 }
 
-void menuset::extd(char c) {
-	byte fv;
-	fv = 0;
-	while ((fv < howmany) && (ddms[fv].extdparse(c)))
-		fv ++;
-	if (fv == howmany)
+void MenuBar::parseAltTrigger(char c) {
+	byte i = 0;
+	while ((i < _menuNum) && (_menuItems[i].parseAltTrigger(c)))
+		i++;
+	if (i == _menuNum)
 		return;
-	getcertain(fv);
+	setupMenuItem(i);
 }
 
-void menuset::getcertain(byte fv) {
-	if (_dr->ddm_o.menunow) {
-		_dr->ddm_o.wipe(); // Get rid of menu.
-		if (_dr->ddm_o.menunum == ddms[fv].position)
+void MenuBar::setupMenuItem(byte which) {
+	if (_dr->_activeMenuItem._activeNow) {
+		_dr->_activeMenuItem.wipe(); // Get rid of menu.
+		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
 			return; // Clicked on own highlight.
 	}
-	ddms[fv].highlight();
-	(_dr->*ddms[fv].do_setup)();
+	_menuItems[which].highlight();
+	(_dr->*_menuItems[which]._setupFunc)();
 }
 
-void menuset::getmenu(int16 x) {
-	byte fv;
-	fv = 0;
+void MenuBar::chooseMenuItem(int16 x) {
+	byte i = 0;
 	do {
-		if ((x > ddms[fv].xpos * 8) && (x < ddms[fv].xright * 8)) {
-			getcertain(fv);
+		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
+			setupMenuItem(i);
 			return;
 		}
-		fv++;
-	} while (fv < howmany);
+		i++;
+	} while (i < _menuNum);
 }
 
 
 
-
-
 Dropdown::Dropdown(AvalancheEngine *vm) {
 	_vm = vm;
-	ddm_o.init(this);
-	ddm_m.init(this);
+	_activeMenuItem.init(this);
+	_menuBar.init(this);
 }
 
-void Dropdown::find_what_you_can_do_with_it() {
+void Dropdown::findWhatYouCanDoWithIt() {
 	switch (_vm->_gyro->thinks) {
 	case Gyro::wine:
 	case Gyro::potion:
@@ -338,11 +320,11 @@ void Dropdown::find_what_you_can_do_with_it() {
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->verbstr = _vm->_acci->kVerbCodeExam; /* anything else */
+		_vm->_gyro->verbstr = _vm->_acci->kVerbCodeExam; // Anything else.
 	}
 }
 
-void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
+void Dropdown::drawMenuItem(int16 x, int16 y, char t, Common::String z, bool valid) {
 	byte ander;
 	if (valid)
 		ander = 255;
@@ -377,7 +359,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 	_vm->_graphics->refreshScreen();
 }
 
-void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
+void Dropdown::drawHighlightedMenuItem(int16 x, int16 y, char t, Common::String z, bool valid) {
 	byte ander;
 	if (valid)
 		ander = 255;
@@ -411,233 +393,199 @@ void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
 	_vm->_graphics->refreshScreen();
 }
 
-/*funcedure say(x,y:int16; t:char; z:Common::String; f,b:byte);
-begin;
- settextjustify(0,2); setfillstyle(1,b); setcolor(f);
- bar(x-3,y-1,x+textwidth(z)+3,y+textheight(z));
- chalk(x,y,t,z);
-end;*/
-
 void Dropdown::bleep() {
 	warning("STUB: Dropdown::bleep()");
 }
 
-void Dropdown::parsekey(char r, char re) {
-	switch (r) {
-	case 0:
-	case 224: {
-		switch (re) {
-		case 'K':
-			if (ddm_o.menunum > 1)  {
-				ddm_o.wipe();
-				ddm_m.getcertain(ddm_o.menunum - 1);
-			} else {
-				// Get menu on the left-hand side.
-				ddm_o.wipe();
-				ddm_m.getmenu((ddm_m.howmany - 1) * spacing + indent);
-			}
-			break;
-		case 'M':
-			if (ddm_o.menunum < ddm_m.howmany)  {
-				ddm_o.wipe();
-				ddm_m.getcertain(ddm_o.menunum + 1);
-			} else {
-				// Get menu on the far right-hand side.
-				ddm_o.wipe();
-				ddm_m.getmenu(indent);
-			}
-			break;
-		case 'H':
-			ddm_o.movehighlight(-1);
-			break;
-		case 'P':
-			ddm_o.movehighlight(1);
-			break;
-		default:
-			ddm_m.extd(re);
-		}
-	}
-	break;
-	case 13:
-		ddm_o.select(ddm_o.highlightnum);
-		break;
-	default: {
-		if (ddm_o.menunow)
-			ddm_o.keystroke(r);
-		}
-	}
+void Dropdown::parseKey(char r, char re) {
+	//switch (r) {
+	//case 0:
+	//case 224: {
+	//	switch (re) {
+	//	case 'K':
+	//		if (_activeMenuItem._activeNum > 1)  {
+	//			_activeMenuItem.wipe();
+	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum - 1);
+	//		} else {
+	//			// Get menu on the left-hand side.
+	//			_activeMenuItem.wipe();
+	//			_menuBar.chooseMenuItem((_menuBar._menuNum - 1) * kSpacing + kIndent);
+	//		}
+	//		break;
+	//	case 'M':
+	//		if (_activeMenuItem._activeNum < _menuBar._menuNum)  {
+	//			_activeMenuItem.wipe();
+	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum + 1);
+	//		} else {
+	//			// Get menu on the far right-hand side.
+	//			_activeMenuItem.wipe();
+	//			_menuBar.chooseMenuItem(kIndent);
+	//		}
+	//		break;
+	//	case 'H':
+	//		_activeMenuItem.moveHighlight(-1);
+	//		break;
+	//	case 'P':
+	//		_activeMenuItem.moveHighlight(1);
+	//		break;
+	//	default:
+	//		_menuBar.parseAltTrigger(re);
+	//	}
+	//}
+	//break;
+	//case 13:
+	//	_activeMenuItem.select(_activeMenuItem._highlightNum);
+	//	break;
+	//default: {
+	//	if (_activeMenuItem._activeNow)
+	//		_activeMenuItem.parseKey(r);
+	//	}
+	//}
+	warning("STUB: Dropdown::parseKey()");
+}
+
+Common::String Dropdown::selectGender(byte x) {
+	if (x < 175)
+		return "im";
+	else
+		return "er";
 }
 
-/*$F+  *** Here follow all the ddm__ and do__ funcedures for the DDM system. */
-
-void Dropdown::ddm__game() {
-	ddm_o.start_afresh();
-	ddm_o.opt("Help...", 'H', "f1", true);
-	ddm_o.opt("Boss Key", 'B', "alt-B", true);
-	ddm_o.opt("Untrash screen", 'U', "ctrl-f7", true);
-	ddm_o.opt("Score and rank", 'S', "f9", true);
-	ddm_o.opt("About Avvy...", 'A', "shift-f10", true);
-	ddm_o.display();
+void Dropdown::setupMenuGame() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
+	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
+	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
+	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
+	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
+	_activeMenuItem.display();
 }
 
-void Dropdown::ddm__file() {
-	ddm_o.start_afresh();
-	ddm_o.opt("New game", 'N', "f4", true);
-	ddm_o.opt("Load...", 'L', "^f3", true);
-	ddm_o.opt("Save", 'S', "^f2", _vm->_gyro->alive);
-	ddm_o.opt("Save As...", 'v', "", _vm->_gyro->alive);
-	ddm_o.opt("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
-	ddm_o.opt("Quit", 'Q', "alt-X", true);
-	ddm_o.display();
+void Dropdown::setupMenuFile() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("New game", 'N', "f4", true);
+	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->alive);
+	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
+	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
+	_activeMenuItem.display();
 }
 
-void Dropdown::ddm__action() {
-	ddm_o.start_afresh();
+void Dropdown::setupMenuAction() {
+	_activeMenuItem.reset();
 
-	Common::String n = _vm->_gyro->f5_does();
+	Common::String f5Does = _vm->_gyro->f5_does();
 	for (byte i = 0; i < 2; i++)
-		if (!n.empty())
-			n.deleteChar(0);
-	if (n.empty())
-		ddm_o.opt("Do something", 'D', "f5", false);
+		if (!f5Does.empty())
+			f5Does.deleteChar(0);
+	if (f5Does.empty())
+		_activeMenuItem.setupOption("Do something", 'D', "f5", false);
 	else
-		ddm_o.opt(n, n[0], "f5", true);
-	ddm_o.opt("Pause game", 'P', "f6", true);
+		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
+	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
 	if (_vm->_gyro->dna.room == 99)
-		ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip->neardoor());
+		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_trip->neardoor());
 	else
-		ddm_o.opt("Open the door", 'O', "f7", _vm->_trip->neardoor());
-	ddm_o.opt("Look around", 'L', "f8", true);
-	ddm_o.opt("Inventory", 'I', "Tab", true);
+		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_trip->neardoor());
+	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
+	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
 	if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
-		ddm_o.opt("Run fast", 'R', "^R", true);
+		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
-		ddm_o.opt("Walk slowly", 'W', "^W", true);
+		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
 
-	ddm_o.display();
+	_activeMenuItem.display();
 }
 
-void Dropdown::ddm__people() {
+void Dropdown::setupMenuPeople() {
 	if (!people.empty())
 		people.clear();
 	byte here = _vm->_gyro->dna.room;
 
-	ddm_o.start_afresh();
+	_activeMenuItem.reset();
 
-	for (byte fv = 150; fv <= 178; fv++)
-		if (_vm->_gyro->whereis[fv - 150] == here) {
-			ddm_o.opt(_vm->_gyro->getname(fv), _vm->_gyro->getnamechar(fv), "", true);
-			people = people + fv;
+	for (byte i = 150; i <= 178; i++)
+		if (_vm->_gyro->whereis[i - 150] == here) {
+			_activeMenuItem.setupOption(_vm->_gyro->getname(i), _vm->_gyro->getnamechar(i), "", true);
+			people = people + i;
 		}
 
-	ddm_o.display();
+	_activeMenuItem.display();
 }
 
-void Dropdown::ddm__objects() {
-	ddm_o.start_afresh();
-	for (byte fv = 0; fv < numobjs; fv++) {
-		if (_vm->_gyro->dna.obj[fv])
-			ddm_o.opt(_vm->_gyro->get_thing(fv + 1), _vm->_gyro->get_thingchar(fv + 1), "", true);
+void Dropdown::setupMenuObjects() {
+	_activeMenuItem.reset();
+	for (byte i = 0; i < numobjs; i++) {
+		if (_vm->_gyro->dna.obj[i])
+			_activeMenuItem.setupOption(_vm->_gyro->get_thing(i + 1), _vm->_gyro->get_thingchar(i + 1), "", true);
 	}
-	ddm_o.display();
-}
-
-Common::String Dropdown::himher(byte x) {
-	if (x < 175)
-		return "im";
-	else
-		return "er";
+	_activeMenuItem.display();
 }
 
-void Dropdown::ddm__with() {
-	byte fv;
+void Dropdown::setupMenuWith() {
 	Common::String verb;
 	char vbchar;
-	bool n;
 	
-	ddm_o.start_afresh();
+	_activeMenuItem.reset();
 
 	if (_vm->_gyro->thinkthing) {
-		find_what_you_can_do_with_it();
+		findWhatYouCanDoWithIt();
 
-		for (fv = 0; fv < _vm->_gyro->verbstr.size(); fv++) {
-			_vm->_acci->verbOpt(_vm->_gyro->verbstr[fv], verb, vbchar);
-			ddm_o.opt(verb, vbchar, "", true);
+		for (byte i = 0; i < _vm->_gyro->verbstr.size(); i++) {
+			_vm->_acci->verbOpt(_vm->_gyro->verbstr[i], verb, vbchar);
+			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
-		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room, or (c), the _person you've selected is YOU!
+		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
+		// or (c), the _person you've selected is YOU!
 		
-		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing) || (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
-			ddm_o.opt("Give to...", 'G', "", false); /* Not here. */
+		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing)
+			|| (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
+			_activeMenuItem.setupOption("Give to...", 'G', "", false); /* Not here. */
 		else {
-			ddm_o.opt(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeGive;
 		}
 	} else {
-		ddm_o.opt("Examine", 'x', "", true);
-		ddm_o.opt(Common::String("Talk to h") + himher(_vm->_gyro->thinks), 'T', "", true);
+		_activeMenuItem.setupOption("Examine", 'x', "", true);
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->thinks), 'T', "", true);
 		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
 		switch (_vm->_gyro->thinks) {
 		case Gyro::pgeida:
 		case Gyro::parkata: {
-			ddm_o.opt("Kiss her", 'K', "", true);
+			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeKiss;
 		}
 		break;
 		case Gyro::pdogfood: {
-			ddm_o.opt("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodePlay;
 		}
 		break;
 		case Gyro::pmalagauche: {
-			n = !_vm->_gyro->dna.teetotal;
-			ddm_o.opt("Buy some wine", 'w', "", !_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]);
-			ddm_o.opt("Buy some beer", 'b', "", n);
-			ddm_o.opt("Buy some whisky", 'h', "", n);
-			ddm_o.opt("Buy some cider", 'c', "", n);
-			ddm_o.opt("Buy some mead", 'm', "", n);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\145' + '\144' + '\146' + '\147' + '\150';
+			bool isSober = !_vm->_gyro->dna.teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]);
+			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
+			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
+			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
+			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + 101 + 100 + 102 + 103 + 104;
 		}
 		break;
 		case Gyro::ptrader: {
-			ddm_o.opt("Buy an onion", 'o', "", !_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + '\151';
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]);
+			_vm->_gyro->verbstr = _vm->_gyro->verbstr + 105;
 		}
 		break;
 		}
 	}
-	ddm_o.display();
-}
-
-/*funcedure ddm__map;
-begin;
- with ddm_o do
- begin;
-  ddm_o.start_afresh;
-  opt('Cancel map','G','f5',true);
-  opt('Pause game','P','f6',true);
-  opt('Journey thither','J','f7',neardoor);
-  opt('Explanation','L','f8',true);
-  display;
- end;
-end;
-
-funcedure ddm__town;
-begin;
- with ddm_o do
- begin;
-  ddm_o.start_afresh;
-  opt('Argent','A','',true);
-  opt('Birmingham','B','',true);
-  opt('Nottingham','N','',true);
-  opt('Cardiff','C','',true);
-  display;
- end;
-end;*/
-
-void Dropdown::do__game() {
-	switch (ddm_o.choicenum) {
-		/* Help, boss, untrash screen. */
+	_activeMenuItem.display();
+}
+
+void Dropdown::runMenuGame() {
+	// Help, boss, untrash screen.
+	switch (_activeMenuItem._choiceNum) {
 	case 0:
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeHelp);
 		break;
@@ -656,9 +604,9 @@ void Dropdown::do__game() {
 	}
 }
 
-void Dropdown::do__file() {
-	switch (ddm_o.choicenum) {
-		/* New game, load, save, save as, DOS shell, about, quit. */
+void Dropdown::runMenuFile() {
+	// New game, load, save, save as, DOS shell, about, quit.
+	switch (_activeMenuItem._choiceNum) {
 	case 0:
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeRestart);
 		break;
@@ -676,6 +624,7 @@ void Dropdown::do__file() {
 	break;
 	case 3:
 		//_vm->_basher->filename_edit();
+		warning("STUB: Dropdown::runMenuFile()");
 		break;
 	case 4:
 		_vm->_enid->back_to_bootstrap(2);
@@ -686,15 +635,15 @@ void Dropdown::do__file() {
 	}
 }
 
-void Dropdown::do__action() {
-	Common::String n;
-	switch (ddm_o.choicenum) {
-		/* Get up/pause game/open door/look/inv/walk-run */
+void Dropdown::runMenuAction() {
+	Common::String f5Does;
+	// Get up, pause game, open door, look, inventory, walk/run.
+	switch (_activeMenuItem._choiceNum) {
 	case 0: {
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		n = _vm->_gyro->f5_does();
-		_vm->_lucerna->callverb(n[0]);
+		f5Does = _vm->_gyro->f5_does();
+		_vm->_lucerna->callverb(f5Does[0]);
 	}
 	break;
 	case 1:
@@ -720,29 +669,29 @@ void Dropdown::do__action() {
 	}
 }
 
-void Dropdown::do__objects() {
-	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
+void Dropdown::runMenuObjects() {
+	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[_activeMenuItem._choiceNum + 1], _vm->_gyro->a_thing);
 }
 
-void Dropdown::do__people() {
-	_vm->_lucerna->thinkabout(people[ddm_o.choicenum], _vm->_gyro->a_person);
-	_vm->_gyro->last_person = people[ddm_o.choicenum];
+void Dropdown::runMenuPeople() {
+	_vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->a_person);
+	_vm->_gyro->last_person = people[_activeMenuItem._choiceNum];
 }
 
-void Dropdown::do__with() {
+void Dropdown::runMenuWith() {
 	_vm->_acci->_thing = _vm->_gyro->thinks;
 
 	if (_vm->_gyro->thinkthing) {
 
 		_vm->_acci->_thing += 49;
 
-		if (_vm->_gyro->verbstr[ddm_o.choicenum] == _vm->_acci->kVerbCodeGive)
+		if (_vm->_gyro->verbstr[_activeMenuItem._choiceNum] == _vm->_acci->kVerbCodeGive)
 			_vm->_acci->_person = _vm->_gyro->last_person;
 		else
 			_vm->_acci->_person = 254;
 
 	} else {
-		switch (_vm->_gyro->verbstr[ddm_o.choicenum]) {
+		switch (_vm->_gyro->verbstr[_activeMenuItem._choiceNum]) {
 		case 100: { // Beer
 			_vm->_acci->_thing = 100;
 			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
@@ -786,54 +735,32 @@ void Dropdown::do__with() {
 		}
 		}
 	}
-	_vm->_lucerna->callverb(_vm->_gyro->verbstr[ddm_o.choicenum]);
+	_vm->_lucerna->callverb(_vm->_gyro->verbstr[_activeMenuItem._choiceNum]);
 }
 
 
 
-// That's all. Now for the ...bar funcs.
-
-void Dropdown::standard_bar() {   /* Standard menu bar */
-	ddm_m.init(this);
-	ddm_o.init(this);
-	/* Set up menus */
-
-	ddm_m.create('F', "File", '!', &Avalanche::Dropdown::ddm__file, &Avalanche::Dropdown::do__file); // same ones in map_bar, below,
-	ddm_m.create('G', "Game", 34, &Avalanche::Dropdown::ddm__game, &Avalanche::Dropdown::do__game); // Don't forget to change the
-	ddm_m.create('A', "Action", 30, &Avalanche::Dropdown::ddm__action, &Avalanche::Dropdown::do__action); // if you change them
-	ddm_m.create('O', "Objects", 24, &Avalanche::Dropdown::ddm__objects, &Avalanche::Dropdown::do__objects); // here...
-	ddm_m.create('P', "People", 25, &Avalanche::Dropdown::ddm__people, &Avalanche::Dropdown::do__people);
-	ddm_m.create('W', "With", 17, &Avalanche::Dropdown::ddm__with, &Avalanche::Dropdown::do__with);
-
-	ddm_m.update();
-}
-
-
+void Dropdown::setupMenu() {   
+	_menuBar.init(this);
+	_activeMenuItem.init(this);
 
-/*funcedure map_bar; { Special menu bar for the map (screen 99) }
-begin;
- ddm_m.init; ddm_o.init;
- with ddm_m do
- begin; { Set up menus }
-  create('G','Game','#',ddm__game,do__game);
-  create('F','File','!',ddm__file,do__test);
-  create('M','Map','2',ddm__map,do__test);
-  create('T','Town',#20,ddm__town,do__test);
-  update;
- end;
-end;*/
+	_menuBar.createMenuItem('F', "File", '!', &Avalanche::Dropdown::setupMenuFile, &Avalanche::Dropdown::runMenuFile);
+	_menuBar.createMenuItem('G', "Game", 34, &Avalanche::Dropdown::setupMenuGame, &Avalanche::Dropdown::runMenuGame);
+	_menuBar.createMenuItem('A', "Action", 30, &Avalanche::Dropdown::setupMenuAction, &Avalanche::Dropdown::runMenuAction);
+	_menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Dropdown::setupMenuObjects, &Avalanche::Dropdown::runMenuObjects);
+	_menuBar.createMenuItem('P', "People", 25, &Avalanche::Dropdown::setupMenuPeople, &Avalanche::Dropdown::runMenuPeople);
+	_menuBar.createMenuItem('W', "With", 17, &Avalanche::Dropdown::setupMenuWith, &Avalanche::Dropdown::runMenuWith);
 
-void Dropdown::checkclick(Common::Point cursorPos) {
-	warning("STUB: Dropdown::checkclick()");
+	_menuBar.draw();
 }
 
-void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
+void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 	Common::Point cursorPos = _vm->getMousePos();
 	::Graphics::Surface backup;
 	backup.copyFrom(_vm->_graphics->_surface);
 
-	while (!ddm_o.menunow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) {
-		ddm_m.getmenu(cursorPos.x);
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) {
+		_menuBar.chooseMenuItem(cursorPos.x);
 		do 
 			_vm->updateEvents();
 		while (_vm->_lucerna->holdLeftMouse);
@@ -849,37 +776,37 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
 					_vm->_gyro->newpointer(1); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
-					if ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= ddm_o.fly * 2 + 1))
+					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem.fly * 2 + 1))
 						_vm->_gyro->newpointer(3); // Right-arrow
 					else
 						_vm->_gyro->newpointer(4); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
 					_vm->_gyro->newpointer(2); // Screwdriver
 
-				ddm_o.lightup(cursorPos);
+				_activeMenuItem.lightUp(cursorPos);
 
 				_vm->_graphics->refreshScreen();
 			} while (!_vm->_lucerna->holdLeftMouse);
 
 			if (_vm->_lucerna->holdLeftMouse) {
 				if (cursorPos.y > 21) {
-					if (!((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
-						&& (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) {
+					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1))))) {
 							// Clicked OUTSIDE the menu.
-							if (ddm_o.menunow) {
-								ddm_o.wipe();
+							if (_activeMenuItem._activeNow) {
+								_activeMenuItem.wipe();
 								_vm->_lucerna->holdLeftMouse = false;
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
 						} 
 				} else {
 					// Clicked on menu bar.
-					if (ddm_o.menunow) {
-						ddm_o.wipe();
+					if (_activeMenuItem._activeNow) {
+						_activeMenuItem.wipe();
 						_vm->_graphics->_surface.copyFrom(backup);
 						_vm->_graphics->refreshScreen();
 						
-						if (((ddm_o.left * 8) <= cursorPos.x) && (cursorPos.x <= (ddm_o.left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
+						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
 							_vm->_lucerna->holdLeftMouse = false;
 							return;
@@ -891,13 +818,13 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 				}
 	
 				// NOT clicked button...
-				if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
-					&& (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) {
+				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) {
 
 						// We act only if the button is released over a menu item.
 						while (!_vm->shouldQuit()) {
 							cursorPos = _vm->getMousePos();
-							ddm_o.lightup(cursorPos);
+							_activeMenuItem.lightUp(cursorPos);
 							_vm->_graphics->refreshScreen();
 
 							_vm->updateEvents();
@@ -906,8 +833,8 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
 						}
 
 						uint16 which = (cursorPos.y - 26) / 20;
-						ddm_o.select(which);
-						if (ddm_o.oo[which].valid) // If the menu item wasn't active, we do nothing.
+						_activeMenuItem.select(which);
+						if (_activeMenuItem._options[which]._valid) // If the menu item wasn't active, we do nothing.
 							return;
 				}
 			}
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index f0f3917..58b3ca9 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -35,25 +35,31 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
+
+
 namespace Avalanche {
 class AvalancheEngine;
 
 class Dropdown;
 
-typedef void (Dropdown::*func)();
 
-class headtype {
-public:
-	Common::String title;
-	char trigger, alttrigger;
-	byte position;
-	int16 xpos, xright;
-	func do_setup, do_choose;
 
-	headtype *init(char trig, char alttrig, Common::String name, byte p, func dw, func dc, Dropdown *dr);
-	void display();
+typedef void (Dropdown::*DropdownFunc)();
+
+
+
+class HeadType {
+public:
+	Common::String _title;
+	char _trigger, _altTrigger;
+	byte _position;
+	int16 _xpos, _xright;
+	DropdownFunc _setupFunc, _chooseFunc;
+
+	void init(char trig, char alTtrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr);
+	void draw();
 	void highlight();
-	bool extdparse(char c);
+	bool parseAltTrigger(char key);
 
 private:
 	Dropdown *_dr;
@@ -61,36 +67,38 @@ private:
 
 
 
-struct optiontype {
-	Common::String title;
-	byte trigger;
-	Common::String shortcut;
-	bool valid;
+struct OptionType {
+	Common::String _title;
+	byte _trigger;
+	Common::String _shortcut;
+	bool _valid;
 };
 
-class onemenu {
+
+
+class MenuItem {
 public:
-	optiontype oo[12];
-	byte number;
-	uint16 width, left;
-	bool firstlix;
-	int16 flx1, flx2, fly;
-	byte oldy; /* used by Lightup */
-	bool menunow; /* Is there a menu now? */
-	byte menunum; /* And if so, which is it? */
-	byte choicenum; /* Your choice? */
-	byte highlightnum;
+	OptionType _options[12];
+	byte _optionNum;
+	uint16 _width, _left;
+	bool _firstlix;
+	int16 _flx1, _flx2, fly;
+	byte _oldY; // used by lightUp */
+	bool _activeNow; // Is there an active option now?
+	byte _activeNum; // And if so, which is it?
+	byte _choiceNum; // Your choice?
+	byte _highlightNum;
 
 	void init(Dropdown *dr);
-	void start_afresh();
-	void opt(Common::String n, char tr, Common::String key, bool val);
+	void reset();
+	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
 	void display();
 	void wipe();
-	void lightup(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
-	void displayopt(byte y, bool highlit);
-	void movehighlight(int8 add);
-	void select(byte n);
-	void keystroke(char c);
+	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
+	void displayOption(byte y, bool highlit);
+	void moveHighlight(int8 inc);
+	void select(byte which); // Choose which one you want.
+	void parseKey(char c);
 
 private:
 	Dropdown *_dr;
@@ -98,17 +106,17 @@ private:
 
 
 
-class menuset {
+class MenuBar {
 public:
-	headtype ddms[8];
-	byte howmany;
+	HeadType _menuItems[8];
+	byte _menuNum;
 
 	void init(Dropdown *dr);
-	void create(char t, Common::String n, char alttrig, func dw, func dc);
-	void update();
-	void extd(char c);
-	void getcertain(byte fv);
-	void getmenu(int16 x);
+	void createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc);
+	void draw();
+	void parseAltTrigger(char c);
+	void setupMenuItem(byte which);
+	void chooseMenuItem(int16 x);
 
 private:
 	Dropdown *_dr;
@@ -118,12 +126,12 @@ private:
 
 class Dropdown {
 public:
-	friend headtype;
-	friend onemenu;
-	friend menuset;
+	friend HeadType;
+	friend MenuItem;
+	friend MenuBar;
 
-	onemenu ddm_o;
-	menuset ddm_m;
+	MenuItem _activeMenuItem;
+	MenuBar _menuBar;
 
 	Common::String people;
 
@@ -131,59 +139,52 @@ public:
 
 	Dropdown(AvalancheEngine *vm);
 
-	void find_what_you_can_do_with_it();
-
-	void parsekey(char r, char re);
+	void parseKey(char r, char re);
 
-	void menu_link(); /* DDM menu-bar funcs */
+	void updateMenu();
 
-	void standard_bar();
+	void setupMenu(); // Standard menu bar.
 
 private:
-	AvalancheEngine *_vm;
-
-	static const byte indent = 5;
-	static const byte spacing = 10;
-
-	static const byte menu_b = lightgray; /* Windowsy */
-	static const byte menu_f = black;
-	static const byte menu_border = black;
-	static const byte highlight_b = black;
-	static const byte highlight_f = white;
-	static const byte disabled = darkgray;
+	static const byte kIndent = 5;
+	static const byte kSpacing = 10;
 
+	static const byte kMenuBackgroundColor = lightgray;
+	static const byte kMenuFontColor = black;
+	static const byte kMenuBorderColor = black;
+	static const byte kHighlightBackgroundColor = black;
+	static const byte kHighlightFontColor = white;
+	static const byte kDisabledColor = darkgray;
 
 
-	char r;
-	byte fv;
-
 
+	AvalancheEngine *_vm;
 
-	void chalk(int16 x, int16 y, char t, Common::String z, bool valid);
 
-	void hlchalk(int16 x, int16 y, char t, Common::String z, bool valid); // Highlighted. TODO: It's too similar to chalk! Unify these two!!!
 
-	void bleep();
+	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
 
+	void findWhatYouCanDoWithIt();
 
-	
-	void ddm__game();
-	void ddm__file();
-	void ddm__action();
-	void ddm__people();
-	void ddm__objects();
-	void ddm__with();
+	void drawMenuItem(int16 x, int16 y, char t, Common::String z, bool valid);
 
-	Common::String himher(byte x); // Returns "im" for boys, and "er" for girls.
+	void drawHighlightedMenuItem(int16 x, int16 y, char t, Common::String z, bool valid); // Highlighted. TODO: It's too similar to chalk! Unify these two!!!
 
-	void do__game();
-	void do__file();
-	void do__action();
-	void do__objects();
-	void do__people();
-	void do__with();
+	void bleep();
 
-	void checkclick(Common::Point cursorPos); // Only for when the menu's displayed!
+	void setupMenuGame();
+	void setupMenuFile();
+	void setupMenuAction();
+	void setupMenuPeople();
+	void setupMenuObjects();
+	void setupMenuWith();
+
+	void runMenuGame();
+	void runMenuFile();
+	void runMenuAction();
+	void runMenuObjects();
+	void runMenuPeople();
+	void runMenuWith();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 4166ecf..1d6ac7e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -365,7 +365,7 @@ void Gyro::newgame() {
 	_vm->_trip->new_game_for_trippancy();
 	_vm->_lucerna->showscore();
 
-	_vm->_dropdown->standard_bar();
+	_vm->_dropdown->setupMenu();
 	_vm->_lucerna->clock_lucerna();
 	_vm->_lucerna->sprite_run();
 }
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 2b4c5fe..8100c5a 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -325,7 +325,7 @@ void Lucerna::exitroom(byte x) {
 }
 
 void Lucerna::new_town() {   /* You've just entered a town from the map. */
-	_vm->_dropdown->standard_bar();
+	_vm->_dropdown->setupMenu();
 
 	switch (_vm->_gyro->dna.room) {
 	case r__outsidenottspub: /* Entry into Nottingham. */
@@ -947,7 +947,7 @@ void Lucerna::points(byte num) {     /* Add on no. of points */
 }
 
 void Lucerna::topcheck(Common::Point cursorPos) {
-	_vm->_dropdown->ddm_m.getmenu(cursorPos.x);
+	_vm->_dropdown->_menuBar.chooseMenuItem(cursorPos.x);
 }
 
 void Lucerna::mouseway(const Common::Point &cursorPos) {
@@ -1107,7 +1107,7 @@ void Lucerna::checkclick() {
 	if (holdLeftMouse)
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->dropsok)
-				_vm->_dropdown->menu_link();
+				_vm->_dropdown->updateMenu();
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
 			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
 			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 2457354..bd70648 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -43,8 +43,8 @@ void Parser::init() {
 
 void Parser::handleInputText(const Common::Event &event) {
 	byte inChar = event.kbd.ascii;
-	if (_vm->_dropdown->ddm_o.menunow) {
-		_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
+	if (_vm->_dropdown->_activeMenuItem._activeNow) {
+		_vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd);
 	} else {
 		if (_inputText.size() < 76) {
 			if ((inChar == '"') || (inChar == '`')) {
@@ -64,7 +64,7 @@ void Parser::handleInputText(const Common::Event &event) {
 }
 
 void Parser::handleBackspace() {
-	if (!_vm->_dropdown->ddm_o.menunow) {
+	if (!_vm->_dropdown->_activeMenuItem._activeNow) {
 		if (_inputTextPos > _leftMargin) {
 			_inputTextPos--;
 			if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
@@ -77,7 +77,7 @@ void Parser::handleBackspace() {
 }
 
 void Parser::handleReturn() {
-	if (_vm->_dropdown->ddm_o.menunow)
+	if (_vm->_dropdown->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
 	else {
 		_vm->_logger->log_command(_inputText);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index dc45c6c..f25a313 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1598,7 +1598,7 @@ void Trip::handleMoveKey(const Common::Event &event) {
 	if (!_vm->_gyro->dna.user_moves_avvy)
 		return;
 
-	if (_vm->_dropdown->ddm_o.menunow)
+	if (_vm->_dropdown->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
 	else
 		switch (event.kbd.keycode) {


Commit: 8cb9c3825f58e20f5851477173945e204e0ecb14
    https://github.com/scummvm/scummvm/commit/8cb9c3825f58e20f5851477173945e204e0ecb14
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T09:22:55-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/dropdown2.cpp
	engines/avalanche/dropdown2.h

Changed paths:
  R engines/avalanche/logger2.cpp
  R engines/avalanche/logger2.h
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/closing2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --cc engines/avalanche/parser.cpp
index bd70648,c8a04ae..e6cbdab
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@@ -77,11 -77,9 +77,9 @@@ void Parser::handleBackspace() 
  }
  
  void Parser::handleReturn() {
 -	if (_vm->_dropdown->ddm_o.menunow)
 +	if (_vm->_dropdown->_activeMenuItem._activeNow)
  		_vm->_parser->tryDropdown();
  	else {
- 		_vm->_logger->log_command(_inputText);
- 		
  		if (!_inputText.empty()) {
  			_inputTextBackup = _inputText;
  			_vm->_acci->parse();


Commit: 97843d9e943325a29c1dc50ab681a80fac96e6d8
    https://github.com/scummvm/scummvm/commit/97843d9e943325a29c1dc50ab681a80fac96e6d8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T09:26:57-07:00

Commit Message:
AVALANCHE: Repair regression in Acci::inventory().

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 9ce3180..6735397 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -767,11 +767,12 @@ void Acci::inventory() {
 			if (itemNum < _vm->_gyro->dna.carrying)
 				_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
 		}
-		if (_vm->_gyro->dna.wearing == kNothing)
-			_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
-		else
-			_vm->_scrolls->display(".");
 	}
+
+	if (_vm->_gyro->dna.wearing == kNothing)
+		_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
+	else
+		_vm->_scrolls->display(".");
 }
 
 void Acci::swallow() {   /* Eat something. */


Commit: 08e8e92e3a0206b963dacfeecc96b75008c88c02
    https://github.com/scummvm/scummvm/commit/08e8e92e3a0206b963dacfeecc96b75008c88c02
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T09:34:58-07:00

Commit Message:
AVALANCHE: Fix even more GCC warnings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 6735397..01c7d9a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1372,8 +1372,8 @@ void Acci::doThat() {
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
 			if (_vm->_gyro->subjnumber == 99) // They typed "say password".
-				_vm->_scrolls->display(Common::String("Yes, but kWhat ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
-			else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 449)) {
+				_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
+			else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 249)) {
 				_thats.deleteChar(0);
 
 				for (byte i = 0; i < 10; i++)
@@ -1890,9 +1890,10 @@ void Acci::doThat() {
 			for (byte i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				for (byte i = 0; i < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); i++)
-					if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[i] != temp[i])
+				for (byte j = 0; j < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); j++) {
+					if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[j] != temp[j])
 						ok = false;
+				}
 			}
 
 			if (ok) {
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index d7f318f..5c95aca 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -152,14 +152,15 @@ void Celer::updateBackgroundSprites() {
 	case r__lustiesroom:
 		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
 			byte direction = 0;
+			uint16 angle = _vm->_lucerna->bearing(2);
 			if ((_vm->_gyro->roomtime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
-			else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
+			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 					direction = 1; // Middle.
-			else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
+			else if ((angle >= 45) && (angle <= 180))
 					direction = 2; // Left.
-			else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
+			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
 			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
@@ -195,11 +196,12 @@ void Celer::updateBackgroundSprites() {
 	case r__nottspub: {
 		// Bearing of Avvy from Port.
 		byte direction = 0;
-		if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
+		uint16 angle = _vm->_lucerna->bearing(5);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 2; // Middle.
-		else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
+		else if ((angle >= 45) && (angle <= 180))
 			direction = 6; // Left.
-		else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
+		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
 		if ((_vm->_gyro->roomtime % 60) > 57)
@@ -226,11 +228,12 @@ void Celer::updateBackgroundSprites() {
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
-		if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
+		uint16 angle = _vm->_lucerna->bearing(2);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 4; // Middle.
-		else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
+		else if ((angle >= 45) && (angle <= 180))
 			direction = 6; // Left.
-		else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
+		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
 		if ((_vm->_gyro->roomtime % 45) > 42)
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 1e7c816..7a257d0 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -96,7 +96,8 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 
 	day = _vm->_gyro->strf(d);
 
-	if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31))) {
+	// d is always positive
+	if ((d <= 9) || ((d >= 21) && (d <= 31))) {
 		switch (d % 10) {
 		case 1:
 			day = day + "st";
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 9f494db..cd7a219 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1454,10 +1454,8 @@ void Trip::getsetclear() {
 }
 
 void Trip::hide_in_the_cupboard() {
-	const char nowt = '\xFA'; /* As in Acci. */
-
 	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
-		if (_vm->_gyro->dna.wearing == nowt)
+		if (_vm->_gyro->dna.wearing == Acci::kNothing)
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
 		else {
 			tr[0].visible = true;


Commit: a952ae3f8761a390de73a5e9031f9f233041f099
    https://github.com/scummvm/scummvm/commit/a952ae3f8761a390de73a5e9031f9f233041f099
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T09:55:02-07:00

Commit Message:
AVALANCHE: Fix some more GCC warnings

Changed paths:
    engines/avalanche/gyro2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 971fbbd..4e4cb0a 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -43,7 +43,7 @@ namespace Avalanche {
 class AvalancheEngine;
 
 
-static const char numobjs = 18; /* always preface with a # */
+static const byte numobjs = 18; /* always preface with a # */
 static const int16 maxobjs = 12;  /* carry limit */
 
 static const int16 numlockCode = 32;  /* Code for Num Lock */
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 51d47a9..32ad1c9 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -198,8 +198,8 @@ void Scrolls::dialogue() {
 
 
 void Scrolls::store_(byte what, tunetype &played) {
-	memcpy(played+1, played+2, sizeof(played) - 1);
-	played[31] = what;
+	memcpy(played + 1, played + 2, sizeof(played) - 1);
+	played[30] = what;
 }
 
 bool Scrolls::they_match(tunetype &played) {
@@ -207,10 +207,11 @@ bool Scrolls::they_match(tunetype &played) {
 
 	mistakes = 0;
 
-	for (fv = 1; fv <= sizeof(played); fv++)
+	for (fv = 1; fv <= sizeof(played); fv++) {
 		if (played[fv] != _vm->_gyro->tune[fv]) {
 			mistakes += 1;
 		}
+	}
 
 	return mistakes < 5;
 }
@@ -715,7 +716,7 @@ void Scrolls::calldrivers() {
 					return;
 			}
 			break;
-			case kControlNegative: {
+			case kControlNegative:
 				switch (param) {
 				case 1:
 					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
@@ -755,9 +756,9 @@ void Scrolls::calldrivers() {
 						display(_vm->_gyro->get_better(_vm->_gyro->dna.box_contents) + '.');
 					}
 					break;
-				case 11: {
+				case 11:
 					nn = 1;
-					for (nnn = 0; nnn < numobjs; nnn++)
+					for (nnn = 0; nnn < numobjs; nnn++) {
 						if (_vm->_gyro->dna.obj[nnn]) {
 							nn++;
 							display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer);
@@ -765,8 +766,6 @@ void Scrolls::calldrivers() {
 					}
 					break;
 				}
-				
-				}
 				break;
 			case kControlIcon:
 				use_icon = param;


Commit: 247bf3ca26a5e348f2a0c3cc584766a69a1472de
    https://github.com/scummvm/scummvm/commit/247bf3ca26a5e348f2a0c3cc584766a69a1472de
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T10:17:32-07:00

Commit Message:
AVALANCHE: Fix very verbose source of warning

Changed paths:
    engines/avalanche/dropdown2.h



diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 58b3ca9..35b4b56 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -126,9 +126,9 @@ private:
 
 class Dropdown {
 public:
-	friend HeadType;
-	friend MenuItem;
-	friend MenuBar;
+	friend class HeadType;
+	friend class MenuItem;
+	friend class MenuBar;
 
 	MenuItem _activeMenuItem;
 	MenuBar _menuBar;


Commit: 90494e01fd89d9e5d7ea33e31664173590e0e250
    https://github.com/scummvm/scummvm/commit/90494e01fd89d9e5d7ea33e31664173590e0e250
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T11:57:25-07:00

Commit Message:
AVALANCHE: Do renaming/refactoring in Acci, Avalanche and Dropdown. Unify drawing of menus' text in Dropdown in a single function: drawMenuText().

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 01c7d9a..2123471 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -46,8 +46,6 @@
 #include <cstring>
 #include <cmath>
 
-
-
 namespace Avalanche {
 
 const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index d881eab..2f03663 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -33,8 +33,6 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
-
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c82c839..b99090c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -41,8 +41,6 @@
 #include "gui/saveload.h"
 #include "graphics/thumbnail.h"
 
-
-
 namespace Avalanche {
 
 AvalancheEngine *AvalancheEngine::s_Engine = 0;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 63f654f..ddedb5a 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -56,8 +56,6 @@
 
 #include "graphics/cursorman.h"
 
-
-
 namespace Common {
 class RandomSource;
 }
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index e814ba8..54727e7 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -30,7 +30,6 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/dropdown2.h"
-
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/acci2.h"
@@ -39,8 +38,6 @@
 
 #include "common/textconsole.h"
 
-
-
 namespace Avalanche {
 
 void HeadType::init(char trig, char altTrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr) {
@@ -58,7 +55,7 @@ void HeadType::init(char trig, char altTrig, Common::String title, byte pos, Dro
 
 void HeadType::draw() {
 	CursorMan.showMouse(false); 
-	_dr->drawMenuItem(_xpos, 1, _trigger, _title, true);
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
 	CursorMan.showMouse(true);
 }
 
@@ -69,7 +66,7 @@ void HeadType::highlight() {
 	//setactivepage(cp);
 	warning("STUB: Dropdown::headytpe::highlight()");
 
-	_dr->drawHighlightedMenuItem(_xpos, 1, _trigger, _title, true);
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
 	
 	_dr->_activeMenuItem._left = _xpos;
 	_dr->_activeMenuItem._activeNow = true;
@@ -122,15 +119,12 @@ void MenuItem::displayOption(byte y, bool highlit) {
 		backgroundColor = 7;
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
 	
-	Common::String data = _options[y]._title;
-	while (data.size() + _options[y]._shortcut.size() < _width)
-		data += ' '; // Pad _options[y] with spaces.
-	data += _options[y]._shortcut;
+	Common::String text = _options[y]._title;
+	while (text.size() + _options[y]._shortcut.size() < _width)
+		text += ' '; // Pad _options[y] with spaces.
+	text += _options[y]._shortcut;
 
-	if (highlit)
-		_dr->drawHighlightedMenuItem(_left, 4 + (y + 1) * 10, _options[y]._trigger, data, _options[y]._valid);
-	else
-		_dr->drawMenuItem(_left, 4 + (y + 1) * 10, _options[y]._trigger, data, _options[y]._valid);
+	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
 }
 
 void MenuItem::display() {
@@ -163,7 +157,7 @@ void MenuItem::wipe() {
 	//setactivepage(cp);
 	CursorMan.showMouse(false); 
 	
-	_dr->drawMenuItem(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true);
+	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
 
 	_activeNow = false;
 	_dr->_vm->_gyro->ddmnow = false;
@@ -324,7 +318,17 @@ void Dropdown::findWhatYouCanDoWithIt() {
 	}
 }
 
-void Dropdown::drawMenuItem(int16 x, int16 y, char t, Common::String z, bool valid) {
+void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
+	byte fontColor;
+	byte backgroundColor;
+	if (highlighted) {
+		fontColor = white;
+		backgroundColor = black;
+	} else {
+		fontColor = black;
+		backgroundColor = lightgray;
+	}
+
 	byte ander;
 	if (valid)
 		ander = 255;
@@ -332,61 +336,28 @@ void Dropdown::drawMenuItem(int16 x, int16 y, char t, Common::String z, bool val
 		ander = 170;
 
 	fontType font;
-	for (byte fv = 0; fv < z.size(); fv++)
-		for (byte ff = 0; ff < 8; ff++) {
-			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander;
-			for (byte i = 0; i < 8; i++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = lightgray;
+	for (byte i = 0; i < text.size(); i++)
+		for (byte j = 0; j < 8; j++) {
+			font[text[i]][j] = _vm->_gyro->characters[text[i]][j] & ander; // Set the font.
+			// And set the background of the text to the desired color.
+			for (byte k = 0; k < 8; k++)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
 		}
 
-	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, black);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
 	
 	// Underline the selected character.
-	if (! z.contains(t))
+	if (!text.contains(trigger))
 		return;
 	else {
-		byte fv;
-		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
+		byte i;
+		for (i = 0; text[i] != trigger; i++); // Search for the character in the string.
 	
 		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
 			if (pixelBit)
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = black;
-		}
-	}
-
-	_vm->_graphics->refreshScreen();
-}
-
-void Dropdown::drawHighlightedMenuItem(int16 x, int16 y, char t, Common::String z, bool valid) {
-	byte ander;
-	if (valid)
-		ander = 255;
-	else
-		ander = 170;
-
-	fontType font;
-	for (byte fv = 0; fv < z.size(); fv++)
-		for (byte ff = 0; ff < 8; ff++) {
-			font[z[fv]][ff] = _vm->_gyro->characters[z[fv]][ff] & ander; // Set the font.
-			// And set the background of the text to black.
-			for (byte i = 0; i < 8; i++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + fv * 8 + i, y + ff) = black;
-		}
-
-	_vm->_graphics->drawText(_vm->_graphics->_surface, z, font, 8, x * 8, y, white);
-
-	// Underline the selected character.
-	if (z.contains(t)) {
-		byte fv;
-		for (fv = 0; z[fv] != t; fv++); // Search for the character in the string.
-
-		byte pixel = ander;
-		for (byte bit = 0; bit < 8; bit++) {
-			byte pixelBit = (pixel >> bit) & 1;
-			if (pixelBit)
-				*_vm->_graphics->getPixel(x * 8 + fv * 8 + 7 - bit, y + 8) = white;
+				*_vm->_graphics->getPixel(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
 		}
 	}
 
@@ -441,7 +412,7 @@ void Dropdown::parseKey(char r, char re) {
 	//		_activeMenuItem.parseKey(r);
 	//	}
 	//}
-	warning("STUB: Dropdown::parseKey()");
+	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
 }
 
 Common::String Dropdown::selectGender(byte x) {
@@ -501,12 +472,11 @@ void Dropdown::setupMenuAction() {
 void Dropdown::setupMenuPeople() {
 	if (!people.empty())
 		people.clear();
-	byte here = _vm->_gyro->dna.room;
 
 	_activeMenuItem.reset();
 
 	for (byte i = 150; i <= 178; i++)
-		if (_vm->_gyro->whereis[i - 150] == here) {
+		if (_vm->_gyro->whereis[i - 150] == _vm->_gyro->dna.room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getname(i), _vm->_gyro->getnamechar(i), "", true);
 			people = people + i;
 		}
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 35b4b56..8912e60 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -135,14 +135,10 @@ public:
 
 	Common::String people;
 
-
-
 	Dropdown(AvalancheEngine *vm);
 
 	void parseKey(char r, char re);
-
 	void updateMenu();
-
 	void setupMenu(); // Standard menu bar.
 
 private:
@@ -156,20 +152,11 @@ private:
 	static const byte kHighlightFontColor = white;
 	static const byte kDisabledColor = darkgray;
 
-
-
 	AvalancheEngine *_vm;
 
-
-
 	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
-
 	void findWhatYouCanDoWithIt();
-
-	void drawMenuItem(int16 x, int16 y, char t, Common::String z, bool valid);
-
-	void drawHighlightedMenuItem(int16 x, int16 y, char t, Common::String z, bool valid); // Highlighted. TODO: It's too similar to chalk! Unify these two!!!
-
+	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
 	void bleep();
 
 	void setupMenuGame();


Commit: 15947cec7ddfad7993b746c796f4f7dd9ff01a0a
    https://github.com/scummvm/scummvm/commit/15947cec7ddfad7993b746c796f4f7dd9ff01a0a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-04T12:10:29-07:00

Commit Message:
AVALANCHE: Get rid of Enhanced. Further renamings and refactoring in Avalanche and Avalot.

Changed paths:
  R engines/avalanche/enhanced2.cpp
  R engines/avalanche/enhanced2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b99090c..d614581 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -63,7 +63,6 @@ AvalancheEngine::~AvalancheEngine() {
 
 	delete _avalot;
 	delete _gyro;
-	delete _enhanced;
 	delete _pingo;
 	delete _scrolls;
 	delete _visa;
@@ -84,7 +83,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
-	_enhanced = new Enhanced(this);
 	_pingo = new Pingo(this);
 	_scrolls = new Scrolls(this);
 	_visa = new Visa(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index ddedb5a..839618d 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -35,7 +35,6 @@
 
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/enhanced2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
@@ -73,7 +72,6 @@ public:
 
 	Avalot *_avalot;
 	Gyro *_gyro;
-	Enhanced *_enhanced;
 	Pingo *_pingo;
 	Scrolls *_scrolls;
 	Visa *_visa;
@@ -87,15 +85,12 @@ public:
 	Dropdown *_dropdown;
 	Closing *_closing;
 
-
 	OSystem *_system;
 
-
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 
 	Common::ErrorCode initialize(); 
-
 	GUI::Debugger *getDebugger();
 
 	Common::RandomSource *_rnd;
@@ -103,29 +98,20 @@ public:
 	const AvalancheGameDescription *_gameDescription;
 	uint32 getFeatures() const;
 	const char *getGameId() const;
-
 	Common::Platform getPlatform() const;
-
 	bool hasFeature(EngineFeature f) const;
 	const char *getCopyrightString() const;
 
-
-
 	void synchronize(Common::Serializer &sz);
-
 	virtual bool canSaveGameStateCurrently();
 	Common::Error saveGameState(int slot, const Common::String &desc);
 	bool saveGame(const int16 slot, const Common::String &desc);
-
 	Common::String getSaveFileName(const int slot);
-
 	virtual bool canLoadGameStateCurrently();
 	Common::Error loadGameState(int slot);
 	bool loadGame(const int16 slot);
 	Common::String expandDate(int d, int m, int y);
 
-
-
 	void updateEvents();
 	bool getEvent(Common::Event &event); // A wrapper around _eventMan->pollEvent(), so we can use it in Scrolls::normscroll() for example.
 	Common::Point getMousePos();
@@ -140,19 +126,13 @@ private:
 	AvalancheConsole *_console;
 	Common::Platform _platform;
 
-	
-
-
 	// From bootstrp:
 
 	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
 
 	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
-
 	static const char kRuncodes[2][3];
-
 	static const int16 kReset = 0;
-
 	static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false;
 
 	struct {
@@ -162,54 +142,31 @@ private:
 	} _storage;
 
 	Common::String _arguments, _demoArgs, _argsWithNoFilename;
-
 	bool _firstTime;
-
 	byte _originalMode;
 	byte *_old1c;
-
 	Common::String _segofs;
-
 	bool _zoomy;
-
 	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
 
 	void cursorOff();
-
 	void cursorOn();
-
 	void quit();
-
 	Common::String commandCom();
-
 	void explain(byte error);
-
 	void bFlight();
-
 	void bFlightOn();
-
 	void bFlightOff();
-
 	Common::String elmToStr(Elm how);
-
 	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
-
 	void getArguments();
-
 	void getSlope();
-
 	void callMenu();
-
 	void runAvalot();
-
 	void runDemo();
-
 	void dosShell();
-
 	bool keyPressed();
-
 	void flushBuffer();
-
 	void demo();
 };
 
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 231d6c9..00f2edc 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -40,10 +40,8 @@ class Avalot {
 public:
 	Avalot(AvalancheEngine *vm);
 
-	void setup();
-
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
-
+	void setup();
 	void run(Common::String arg);
 
 private:
diff --git a/engines/avalanche/enhanced2.cpp b/engines/avalanche/enhanced2.cpp
deleted file mode 100644
index d6187a0..0000000
--- a/engines/avalanche/enhanced2.cpp
+++ /dev/null
@@ -1,64 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/enhanced2.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-Enhanced::Enhanced(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-
-bool Enhanced::isenh() {
-	warning("STUB: Enhanced::isenh()");
-	return true;
-}
-
-void Enhanced::readkeye() {
-	warning("STUB: Enhanced::readkeye()");
-}
-
-bool Enhanced::keypressede() {
-/*
-	function fancystuff:boolean;
-	inline( $B4/ $11/  { MOV AH,11 }
-			$CD/ $16/  { INT 16 }
-			$B8/ $00/ $00/ { MOV AX, 0000 }
-			$74/ $01/  { JZ 0112 (or wherever- the next byte after $40, anyway) }
-			$40);      { INC AX }
-*/
-	
-	warning("STUB: Enhanced::keypressede()");
-	return true;
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/enhanced2.h b/engines/avalanche/enhanced2.h
deleted file mode 100644
index ed7f1e6..0000000
--- a/engines/avalanche/enhanced2.h
+++ /dev/null
@@ -1,60 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-
-
-// Not sure if this unit will be used at all in the end...
-
-#ifndef ENHANCED2_H
-#define ENHANCED2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Enhanced {
-public:
-	byte shiftstate;	/*ABSOLUTE $40:$17;*/
-	bool atbios; // BIOS type
-	char inchar, extd;
-
-	Enhanced(AvalancheEngine *vm);
-
-	void readkeye();
-
-	bool keypressede();
-private:
-	AvalancheEngine *_vm;
-
-	bool isenh();
-
-};
-
-} // End of namespace Avalanche
-
-#endif // ENHANCED2_H
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 883cf20..4517e6a 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/enhanced2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/trip6.h"
@@ -61,10 +60,10 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 void Lucerna::init() {
 	_vm->_gyro->oh = 17717;
 	_vm->_gyro->om = 17717;
-	if (_vm->_enhanced->atbios)
+	/*if (_vm->_enhanced->atbios)
 		_vm->_gyro->atkey = "f1";
 	else
-		_vm->_gyro->atkey = "alt-";
+		_vm->_gyro->atkey = "alt-";*/
 }
 	
 void Lucerna::callverb(byte n) {
@@ -966,25 +965,6 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 	}
 }
 
-void Lucerna::inkey() {
-	if (_vm->_gyro->demo)
-		return; /* Demo handles this itself. */
-
-	if (_vm->_gyro->mousetext == "") {
-		/* read keyboard */
-		_vm->_enhanced->readkeye();
-		if ((_vm->_enhanced->inchar == ' ') && ((_vm->_enhanced->shiftstate & 8) > 0)) {
-			_vm->_enhanced->inchar = '\0';
-			_vm->_enhanced->extd = '#'; /* alt-spacebar = alt-H */
-		}
-	} else {
-		if (_vm->_gyro->mousetext[0] == '`')
-			_vm->_gyro->mousetext.setChar(13,0); /* Backquote = return in a macro */
-		_vm->_enhanced->inchar = _vm->_gyro->mousetext[0];
-		_vm->_gyro->mousetext = Common::String(_vm->_gyro->mousetext.c_str() + 2, 253);
-	}
-}
-
 void Lucerna::posxy() {
 	warning("STUB: Lucerna::posxy()");
 }
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index db9e431..f20b0d0 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -72,8 +72,6 @@ public:
 
 	void mouseway(const Common::Point &cursorPos);
 
-	void inkey();
-
 	void posxy();
 
 	void fxtoggle();
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 9698025..993e1ca 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -8,7 +8,6 @@ MODULE_OBJS = \
 	console.o \
 	detection.o \
 	gyro2.o \
-	enhanced2.o \
 	pingo2.o \
 	scrolls2.o \
 	visa2.o \
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e6cbdab..6ccacc0 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -43,9 +43,10 @@ void Parser::init() {
 
 void Parser::handleInputText(const Common::Event &event) {
 	byte inChar = event.kbd.ascii;
-	if (_vm->_dropdown->_activeMenuItem._activeNow) {
+	warning("STUB: Parser::handleInputText()");
+	/*if (_vm->_dropdown->_activeMenuItem._activeNow) {
 		_vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd);
-	} else {
+	} else {*/
 		if (_inputText.size() < 76) {
 			if ((inChar == '"') || (inChar == '`')) {
 				if (_quote)
@@ -60,7 +61,7 @@ void Parser::handleInputText(const Common::Event &event) {
 			plotText();
 		} else
 			_vm->_gyro->blip();
-	}
+	//}
 }
 
 void Parser::handleBackspace() {
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 32ad1c9..0df3c78 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -31,7 +31,6 @@
 
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/enhanced2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/trip6.h"
 #include "avalanche/acci2.h"


Commit: c7e78ec6b75a4a5e976de60f5b92c74b0e48ea50
    https://github.com/scummvm/scummvm/commit/c7e78ec6b75a4a5e976de60f5b92c74b0e48ea50
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T12:12:03-07:00

Commit Message:
AVALANCHE: Fix some more GCC warnings

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 4517e6a..f31333d 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -211,7 +211,6 @@ void Lucerna::load_also(Common::String n) {
 }
 
 void Lucerna::load(byte n) {     /* Load2, actually */
-	byte bit;
 	Common::String xx;
 	
 	CursorMan.showMouse(false);
@@ -245,7 +244,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 
 	load_also(xx);
 	_vm->_celer->loadBackgroundSprites(n);
-	bit = *_vm->_graphics->getPixel(0,0);
+	// byte bit = *_vm->_graphics->getPixel(0,0);
 	CursorMan.showMouse(true);
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 0df3c78..4159a88 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -291,9 +291,6 @@ void Scrolls::geticon(int16 x, int16 y, byte which) {
 
 void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File f;
-	uint16 st;
-
-	st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
 
 	Common::String filename;
 	filename = filename.format("%s.avd", fn.c_str());
@@ -302,7 +299,9 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 		return;
 	}
 
-	/*byte bit;
+#if 0
+	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
+	byte bit;
 	for (uint16 fv = 1; fv <= yl; fv++)
 		for (bit = 0; bit <= 3; bit++) {
 			port[0x3c4] = 2;
@@ -311,7 +310,8 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 			port[0x3cf] = bit;
 			blockread(f, mem[0xa000 * st + (fv * 80)], xl);
 		}
-	bit = getpixel(0, 0);*/
+	bit = getpixel(0, 0);
+#endif
 
 	warning("STUB: Scrolls::block_drop()");
 
@@ -319,8 +319,8 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 }
 
 void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in the game.
-	byte b, groi;
-	int16 lx, ly, mx, my, ex, ey;
+	byte b;
+	int16 lx, ly, mx, my, ex;
 	bool centre;
 	byte icon_indent = 0;
 
@@ -373,7 +373,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
 
 	ex = mx - lx;
-	ey = my - ly;
+//	int16 ey = my - ly;
 	mx -= lx;
 	my -= ly + 2;
 	
@@ -419,7 +419,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 				dix = mx + lx;
 				diy = my + ly;
 				_vm->_gyro->scroll[b].setChar(' ', 0);
-				groi = *_vm->_graphics->getPixel(0, 0);
+				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
 				_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
 				_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");


Commit: b52c873c5bb764b9385d46a3d77ac44a79ecee12
    https://github.com/scummvm/scummvm/commit/b52c873c5bb764b9385d46a3d77ac44a79ecee12
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T16:27:51-07:00

Commit Message:
AVALANCHE: Fix GCC warnings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2123471..6256aa9 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -265,10 +265,7 @@ Common::String Acci::totalTime() {
 	uint16 h, m, s;
 
 	h = _vm->_gyro->dna.total_time / ticksInOneSec; // No. of seconds.
-	if (h < 0)
-		h = ceil((float)h);
-	else
-		h = floor((float)h);
+	h = floor((float)h);
 	m = h % 3600;
 	h = h / 3600;
 	s = m % 60;
@@ -564,18 +561,16 @@ void Acci::parse() {
 		_vm->_gyro->subject.clear();
 	_vm->_gyro->subjnumber = 0; // Find subject of conversation.
 	
-	byte i = 0;
-	while ((i < 11) && !_realWords[i].empty()) {
+	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
 		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
 			_vm->_gyro->subjnumber = (byte)_thats[i];
 			_thats.setChar(kMoved, i);
 			break;
 		}
-		i++;
 	}
 
 	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // Still not found.
-		for (i = 0; i < _thats.size() - 1; i++) {
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
 				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
@@ -585,7 +580,7 @@ void Acci::parse() {
 	}
 
 	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
-		for (i = 0; i < _thats.size() - 1; i++) {
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
 				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
@@ -595,7 +590,7 @@ void Acci::parse() {
 		}
 	}
 
-	for (int8 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
+	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
 		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
 			_verb = (byte)_thats[i];
 		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 4e4cb0a..c8a2746 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -122,7 +122,7 @@ struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
 					worst_place_on_earth,
 					spare_evening;            /* Personalisation str's */
 
-	int32 total_time; /* Your total time playing this game, in ticks.*/
+	uint32 total_time; /* Your total time playing this game, in ticks.*/
 
 	byte jumpstatus; /* Fixes how high you're jumping. */
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f31333d..c5c8062 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1057,7 +1057,7 @@ void Lucerna::checkclick() {
 			_vm->_gyro->newpointer(4); // fletch
 	}
 	
-	if (holdLeftMouse)
+	if (holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->dropsok)
 				_vm->_dropdown->updateMenu();
@@ -1105,6 +1105,7 @@ void Lucerna::checkclick() {
 				_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
 		} else if (!_vm->_gyro->dropsok)
 			_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
+	}
 }
 
 void Lucerna::mouse_init() {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index cd7a219..2578ce9 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1134,23 +1134,20 @@ bool Trip::overlaps_with_mouse() {
 }
 
 void Trip::getback() {
-	bool endangered;
-
-
-	endangered = false;
 	/* Super_Off;*/
 
 	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
 		getset[1 - _vm->_gyro->cp].recall(r);
 
-		/*
+#if 0
+		bool endangered = false;
 		if overlaps_with_mouse and not endangered then
 			begin
 				endangered:=true;
 				blitfix;
 				Super_Off;
 			end;
-		*/
+#endif
 
 		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}


Commit: 17033bdc2d1fb27e25342ad3afb69bb00750a4fc
    https://github.com/scummvm/scummvm/commit/17033bdc2d1fb27e25342ad3afb69bb00750a4fc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T16:30:56-07:00

Commit Message:
AVALANCHE: Fix uninitialized variable

Changed paths:
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index ae954d8..9202e82 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -249,9 +249,11 @@ Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
 	_vm = vm;
 
 	/* Needed becouse of Lucerna::load_also() */
-	for (int fv = 0; fv < 31; fv++)
+	for (int fv = 0; fv < 31; fv++) {
 		for (int ff = 0; ff < 2; ff++)
 			also[fv][ff] = 0;
+	}
+	dna.total_time = 0;
 }
 
 Gyro::~Gyro() {


Commit: d52c41011846c363e7507c723ef81b1b0b55909a
    https://github.com/scummvm/scummvm/commit/d52c41011846c363e7507c723ef81b1b0b55909a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T16:36:10-07:00

Commit Message:
AVALANCHE: Fix systematic typo in comments

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d614581..c6ca485 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -690,7 +690,7 @@ Common::Error AvalancheEngine::run() {
 
 	_zoomy = true; 
 	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
-	// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
+	// because zoomy's value is given there. Not sure yet what "zoomy" stands for.
 	if (!_zoomy)
 		callMenu();    /* Not run when zoomy. */
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 9202e82..e9740fc 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -48,7 +48,6 @@
 namespace Avalanche {
 
 const char *Gyro::vernum = "1.30";
-
 const char *Gyro::copyright = "1995";
 
 
@@ -185,8 +184,7 @@ const quasiped_type Gyro::quasipeds[16] = {
 
 const char Gyro::keys[] = "QWERTYUIOP[]";
 
-const uint16 Gyro::notes[12] =
-{196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+const uint16 Gyro::notes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
 
 const tunetype Gyro::tune = {
 	higher, higher, lower, same, higher, higher, lower, higher, higher, higher,
@@ -222,10 +220,6 @@ byte Gyro::whereis[29] = {
 	r__wisewomans  /* The Wise Woman. */
 };
 
-
-
-
-
 const Common::String Gyro::things[numobjs] = {
 	"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
 	"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
@@ -243,12 +237,10 @@ const Common::String Gyro::better[numobjs] = {
 
 const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 
-
-
 Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
 	_vm = vm;
 
-	/* Needed becouse of Lucerna::load_also() */
+	/* Needed because of Lucerna::load_also() */
 	for (int fv = 0; fv < 31; fv++) {
 		for (int ff = 0; ff < 2; ff++)
 			also[fv][ff] = 0;
@@ -404,7 +396,7 @@ bool Gyro::pennycheck(uint16 howmuchby) {
 		return true;
 }
 
-// There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
+// There'll may be problems with calling these functions because of the conversion of the arrays!!!
 // Keep an eye open!
 Common::String Gyro::getname(byte whose) { 
 	if (whose < 175)
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 2578ce9..47656f2 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -217,7 +217,7 @@ void triptype::walk() {
 		}
 
 		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl) - 1;
-		// -1  is becouse the modified array indexes of magics[] compared to Pascal .
+		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
 			switch (_tr->_vm->_gyro->magics[tc].op) {


Commit: 71af29e9794eb9bc4d597068a44e19e06d0bb28e
    https://github.com/scummvm/scummvm/commit/71af29e9794eb9bc4d597068a44e19e06d0bb28e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T16:48:16-07:00

Commit Message:
AVALANCHE: Remove dead code reported by CppCheck

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 6256aa9..28077f1 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1383,9 +1383,7 @@ void Acci::doThat() {
 				else if (isPersonHere())
 					_vm->_visa->talkto(_person);
 			}
-		} else if (_person == kPardon)
-			_vm->_scrolls->display("Talk to whom?");
-		else if (isPersonHere())
+		} else if (isPersonHere())
 			_vm->_visa->talkto(_person);
 		break;
 	case kVerbCodeGive:
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c6ca485..cd83d54 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -271,13 +271,15 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_gyro->dna.asked_dogfood_about_nim);
 
 
-	//for (byte groi = 0; groi < numtr; groi++) {
-	//	if (tr[groi].quick) {
-	//		blockwrite(f, groi, 1);
-	//		tr[groi].savedata(f);
-	//	}
-	//}
-	
+#if 0
+	for (byte groi = 0; groi < numtr; groi++) {
+		if (tr[groi].quick) {
+			blockwrite(f, groi, 1);
+			tr[groi].savedata(f);
+		}
+	}
+#endif
+
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
 		for (byte i = 0; i < _trip->numtr; i++) {


Commit: e5cc0fa49510880def04c30ce1f982c1c281b974
    https://github.com/scummvm/scummvm/commit/e5cc0fa49510880def04c30ce1f982c1c281b974
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T16:55:08-07:00

Commit Message:
AVALANCHE: Fix more warnings reported by CppCheck

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 54727e7..5fba992 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -494,15 +494,15 @@ void Dropdown::setupMenuObjects() {
 }
 
 void Dropdown::setupMenuWith() {
-	Common::String verb;
-	char vbchar;
-	
 	_activeMenuItem.reset();
 
 	if (_vm->_gyro->thinkthing) {
 		findWhatYouCanDoWithIt();
 
 		for (byte i = 0; i < _vm->_gyro->verbstr.size(); i++) {
+			char vbchar;
+			Common::String verb;
+
 			_vm->_acci->verbOpt(_vm->_gyro->verbstr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4159a88..3ad8f50 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -223,21 +223,25 @@ void Scrolls::music_scroll() {
 
 	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further. 
 	// For now we act like the player just played the right tone.
-	//if (they_match(played)) {
+#if 0
+	if (they_match(played)) {
+#endif
 		_vm->_gyro->screturn = true;
 		_vm->_gyro->off();
 		state(0);
 		_vm->_gyro->seescroll = false;
 
 		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->reason_jacques_waking_up);
+		warning("STUB: Scrolls::music_scroll()");
 		return;
-	//}
-	warning("STUB: Scrolls::music_scroll()");
-
+#if 0
+	}
+	
 	_vm->_gyro->screturn = false;
 	_vm->_gyro->off();
 	state(0);
 	_vm->_gyro->seescroll = false;
+#endif
 }
 
 /* ThatsAll, so put us back to */ /*$F-*/


Commit: dab29889477920b671f1f55085d802e72889bfe7
    https://github.com/scummvm/scummvm/commit/dab29889477920b671f1f55085d802e72889bfe7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T17:29:09-07:00

Commit Message:
AVALANCHE: Start replacing C-style comments by C++-style

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/roomnums.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 28077f1..386ce22 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -409,9 +409,9 @@ void Acci::storeInterrogation(byte interrogation) {
 		if (!_vm->_gyro->dna.spare_evening.empty())
 			_vm->_gyro->dna.spare_evening.clear();
 		_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
-		_vm->_visa->dixi('z', 5); /* His closing statement... */
-		_vm->_trip->tr[1].walkto(4); /* The end of the drawbridge */
-		_vm->_trip->tr[1].vanishifstill = true; /* Then go away! */
+		_vm->_visa->dixi('z', 5); // His closing statement...
+		_vm->_trip->tr[1].walkto(4); // The end of the drawbridge
+		_vm->_trip->tr[1].vanishifstill = true; // Then go away!
 		_vm->_gyro->magics[1].op = _vm->_gyro->nix;
 		_vm->_gyro->dna.cardiff_things = 5;
 		break;
@@ -522,7 +522,7 @@ void Acci::parse() {
 			_unknown.clear();
 	}
 	// Replace words' codes that mean the same.
-	replace(Common::String('\xFF'), 0); /* zap noise words */
+	replace(Common::String('\xFF'), 0); // zap noise words
 	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
 	replace(Common::String('\xD')  + '\xE4', 1); // "look in" = "examine"
 	replace(Common::String('\x4')  + '\xE6', 17); // "get up" = "stand" 
@@ -668,7 +668,7 @@ void Acci::exampers() {
 		if (_thing != _vm->_gyro->thinks)
 			_vm->_lucerna->thinkabout(_person, _vm->_gyro->a_person);
 		_person -= 149;
-		switch (_person) { /* Special cases */
+		switch (_person) { // Special cases
 		case 11:
 			if (_vm->_gyro->dna.wonnim) {
 				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
@@ -768,10 +768,10 @@ void Acci::inventory() {
 		_vm->_scrolls->display(".");
 }
 
-void Acci::swallow() {   /* Eat something. */
+void Acci::swallow() {   // Eat something.
 	switch (_thing) {
 	case Gyro::wine:
-		switch (_vm->_gyro->dna.winestate) { /* 4 is perfect */
+		switch (_vm->_gyro->dna.winestate) { // 4 is perfect
 		case 1:
 			if (_vm->_gyro->dna.teetotal)  {
 				_vm->_visa->dixi('D', 6);
@@ -787,7 +787,7 @@ void Acci::swallow() {   /* Eat something. */
 		case 2:
 		case 3:
 			_vm->_visa->dixi('d', 8);
-			break; /* You can't drink it! */
+			break; // You can't drink it!
 		}
 		break;
 	case Gyro::potion:
@@ -929,7 +929,9 @@ void Acci::openDoor() {
 				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
 				break;
 			case Gyro::transport:
-				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro->portals[fv].data) & 0x0F /*Low byte*/);
+				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8,  // High byte 
+					                 (_vm->_gyro->portals[fv].data) & 0x0F // Low byte
+									 );
 				break;
 			case Gyro::unfinished:
 				_vm->_trip->tr[0].bounce();
@@ -1504,12 +1506,12 @@ void Acci::doThat() {
 	case kVerbCodeBreak:
 		_vm->_scrolls->display("Vandalism is prohibited within this game!");
 		break;
-	case kVerbCodeQuit: /* quit */
+	case kVerbCodeQuit: // quit
 		if (_vm->_gyro->demo) {
 			warning("STUB: Acci::doThat() - case kVerbCodequit");
 		//	_vm->_visa->dixi('pos', 31);
 		//	close(demofile);
-		//	exit(0); /* Change this later!!! */
+		//	exit(0); // Change this later!!!
 		}
 		if (!_polite)
 			_vm->_scrolls->display("How about a `please\", Avvy?");
@@ -1552,7 +1554,7 @@ void Acci::doThat() {
 				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you\?\?!");
 				break;
 			case Gyro::clothes:
-			case Gyro::habit: { /* Change this! */
+			case Gyro::habit: { // Change this!
 					if (_vm->_gyro->dna.wearing != kNothing) {
 						if (_vm->_gyro->dna.wearing == _thing)
 							_vm->_scrolls->display("You're already wearing that.");
@@ -1868,7 +1870,7 @@ void Acci::doThat() {
 				_vm->_gyro->whereis[7] = 177;
 				break;
 			default:
-				_vm->_visa->dixi('Q', 10); /* Please try not to be so violent! */
+				_vm->_visa->dixi('Q', 10); // Please try not to be so violent!
 			}
 		} else
 			_vm->_visa->dixi('Q', 10);
@@ -1962,7 +1964,7 @@ void Acci::doThat() {
 					_vm->_gyro->dna.avvy_is_awake = true;
 					_vm->_lucerna->points(1);
 					_vm->_gyro->dna.avvy_in_bed = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Picture of Avvy, awake in bed. */
+					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->dna.teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index cd83d54..bd5ea8b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -587,7 +587,7 @@ void AvalancheEngine::explain(byte error) {
 
 //TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
 
-void AvalancheEngine::bFlight() {   /*interrupt;*/
+void AvalancheEngine::bFlight() {   //interrupt;
 	_storage._skellern++;
 }
 
@@ -694,14 +694,14 @@ Common::Error AvalancheEngine::run() {
 	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
 	// because zoomy's value is given there. Not sure yet what "zoomy" stands for.
 	if (!_zoomy)
-		callMenu();    /* Not run when zoomy. */
+		callMenu();    // Not run when zoomy.
 
 
 
 	do {
 		runAvalot();
 
-		//if (dosexitcode != 77)  quit(); /* Didn't stop for us. */
+		//if (dosexitcode != 77)  quit(); // Didn't stop for us.
 
 		switch (_storage._operation) {
 		case kRunShootemup:
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 5fba992..5f419d7 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -129,10 +129,10 @@ void MenuItem::displayOption(byte y, bool highlit) {
 
 void MenuItem::display() {
 	CursorMan.showMouse(false);
-	/*setactivepage(cp);
-	setvisualpage(cp);
-	setfillstyle(1, menu_b);
-	setcolor(menu_border);*/
+	//setactivepage(cp);
+	//setvisualpage(cp);
+	//setfillstyle(1, menu_b);
+	//setcolor(menu_border);
 	_firstlix = true;
 	_flx1 = _left - 2;
 	_flx2 = _left + _width;
@@ -201,9 +201,9 @@ void MenuItem::select(byte which) {
 	wipe();
 
 	if (_choiceNum == _optionNum)
-		_choiceNum--; /* Off the bottom. */
+		_choiceNum--; // Off the bottom.
 	if (_choiceNum > _optionNum)
-		_choiceNum = 0; /* Off the top, I suppose. */
+		_choiceNum = 0; // Off the top, I suppose.
 
 	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
 }
@@ -512,7 +512,7 @@ void Dropdown::setupMenuWith() {
 		
 		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing)
 			|| (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
-			_activeMenuItem.setupOption("Give to...", 'G', "", false); /* Not here. */
+			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeGive;
@@ -529,7 +529,7 @@ void Dropdown::setupMenuWith() {
 		}
 		break;
 		case Gyro::pdogfood: {
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); /* True if you HAVEN'T won. */
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); // True if you HAVEN'T won.
 			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodePlay;
 		}
 		break;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index e9740fc..62ffca8 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -148,39 +148,39 @@ const char Gyro::ladchar[] = "ASCDMTRwLfgeIyPu";
 const char Gyro::lasschar[] = "kG±o";
 
 const int32 Gyro::catamap[8][8] = {
-	/* Geida's room */
-	/*  1     2			3   | 4     5		6		7     8*/
+	// Geida's room
+	// 1     2			3   | 4     5		6		7     8
 	{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
 	{0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
 	{0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
-	{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, /* >> Oubliette */
+	{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, // >> Oubliette
 	{0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
 	{0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
-	{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, /* <<< In here */
+	{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, // <<< In here
 	{0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
 };
-/* vv Stairs trap. */
+// vv Stairs trap.
 
 const char Gyro::spludwick_order[3] = {onion, ink, mushroom};
 
 const quasiped_type Gyro::quasipeds[16] = {
-	{2, lightgray, 19, brown, pdogfood},                       /* A: Dogfood (screen 19). */
-	{3, green,     19, white, pibythneth},                         /* B: Ibythneth (screen 19). */
-	{3, white,     1, magenta, parkata},                        /* C: Arkata (screen 1). */
-	{3, black,     23, red, 177},                         /* D: Hawk (screen 23). */
-	{3, lightgreen, 50, brown, ptrader},                        /* E: Trader (screen 50). */
-	{6, yellow,    42, red, pavalot},                           /* F: Avvy, tied up (scr.42) */
-	{2, blue,      16, white, payles},                         /* G: Ayles (screen 16). */
-	{2, brown,     7, white, pjacques},                          /* H: Jacques (screen 7). */
-	{2, lightgreen, 47, green, pspurge},                        /* I: Spurge (screen 47). */
-	{3, yellow,    47, red, pavalot},                           /* J: Avalot (screen 47). */
-	{2, lightgray, 23, black, pdulustie},                         /* K: du Lustie (screen 23). */
-	{2, yellow,    27, red, pavalot},                           /* L: Avalot (screen 27). */
-	{3, white,     27, red, 177},                         /* M: Avaroid (screen 27). */
-	{4, lightgray, 19, darkgray, pmalagauche},                        /*N: Malagauche (screen 19). */
-	{5, lightmagenta, 47, red, pport},                           /* O: Port (screen 47). */
-	{2, lightgreen, 51, darkgray, pdrduck}
-};                         /*P: Duck (screen 51). */
+	{2, lightgray, 19, brown, pdogfood},                       // A: Dogfood (screen 19). 
+	{3, green,     19, white, pibythneth},                     // B: Ibythneth (screen 19).
+	{3, white,     1, magenta, parkata},                       // C: Arkata (screen 1).
+	{3, black,     23, red, 177},							   // D: Hawk (screen 23).
+	{3, lightgreen, 50, brown, ptrader},                       // E: Trader (screen 50).
+	{6, yellow,    42, red, pavalot},                          // F: Avvy, tied up (scr.42)
+	{2, blue,      16, white, payles},                         // G: Ayles (screen 16).
+	{2, brown,     7, white, pjacques},                        // H: Jacques (screen 7).
+	{2, lightgreen, 47, green, pspurge},                       // I: Spurge (screen 47).
+	{3, yellow,    47, red, pavalot},                          // J: Avalot (screen 47).
+	{2, lightgray, 23, black, pdulustie},                      // K: du Lustie (screen 23).
+	{2, yellow,    27, red, pavalot},                          // L: Avalot (screen 27).
+	{3, white,     27, red, 177},                              // M: Avaroid (screen 27).
+	{4, lightgray, 19, darkgray, pmalagauche},                 // N: Malagauche (screen 19).
+	{5, lightmagenta, 47, red, pport},                         // O: Port (screen 47).
+	{2, lightgreen, 51, darkgray, pdrduck}                     // P: Duck (screen 51).
+};
 
 const char Gyro::keys[] = "QWERTYUIOP[]";
 
@@ -194,30 +194,30 @@ const tunetype Gyro::tune = {
 };
 
 byte Gyro::whereis[29] = {
-	/* The Lads */
-	r__yours, /* Avvy */
-	r__spludwicks, /* Spludwick */
-	r__outsideyours, /* Crapulus */
-	r__ducks, /* Duck - r__DucksRoom's not defined yet. */
-	r__argentpub, /* Malagauche */
-	r__robins, /* Friar Tuck. */
-	177, /* Robin Hood - can't meet him at the start. */
-	r__brummieroad, /* Cwytalot */
-	r__lustiesroom, /* Baron du Lustie. */
-	r__outsidecardiffcastle, /* The Duke of Cardiff. */
-	r__argentpub, /* Dogfood */
-	r__outsideducks, /* Trader */
-	r__argentpub, /* Ibythneth */
-	r__aylesoffice, /* Ayles */
-	r__nottspub, /* Port */
-	r__nottspub, /* Spurge */
-	r__musicroom, /* Jacques */
+	// The Lads
+	r__yours, // Avvy
+	r__spludwicks, // Spludwick
+	r__outsideyours, // Crapulus
+	r__ducks, // Duck - r__DucksRoom's not defined yet.
+	r__argentpub, // Malagauche
+	r__robins, // Friar Tuck.
+	177, // Robin Hood - can't meet him at the start.
+	r__brummieroad, // Cwytalot
+	r__lustiesroom, // Baron du Lustie.
+	r__outsidecardiffcastle, // The Duke of Cardiff.
+	r__argentpub, // Dogfood
+	r__outsideducks, // Trader
+	r__argentpub, // Ibythneth
+	r__aylesoffice, // Ayles
+	r__nottspub, // Port
+	r__nottspub, // Spurge
+	r__musicroom, // Jacques
 	0, 0, 0, 0, 0, 0, 0, 0,
-	/* The Lasses */
-	r__yours, /* Arkata */
-	r__geidas, /* Geida */
-	177, /* nobody allocated here! */
-	r__wisewomans  /* The Wise Woman. */
+	// The Lasses
+	r__yours, // Arkata
+	r__geidas, // Geida
+	177, // nobody allocated here!
+	r__wisewomans  // The Wise Woman.
 };
 
 const Common::String Gyro::things[numobjs] = {
@@ -226,7 +226,7 @@ const Common::String Gyro::things[numobjs] = {
 	"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
 };
 
-const char Gyro::thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */
+const char Gyro::thingchar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
 
 const Common::String Gyro::better[numobjs] = {
 	"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
@@ -240,7 +240,7 @@ const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
 	_vm = vm;
 
-	/* Needed because of Lucerna::load_also() */
+	// Needed because of Lucerna::load_also()
 	for (int fv = 0; fv < 31; fv++) {
 		for (int ff = 0; ff < 2; ff++)
 			also[fv][ff] = 0;
@@ -316,14 +316,15 @@ void Gyro::newgame() {
 	alive = true;
 
 	score = 0;
-	/*for gd:=0 to 5 do which[gd]:=1;*/
+	//for gd:=0 to 5 do which[gd]:=1;
 	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
 	_vm->_scrolls->natural();
 	_vm->_lucerna->mousepage(0);
 	dna.spare_evening = "answer a questionnaire";
 	dna.like2drink = "beer";
 
-	dna.pence = 30; /* 2/6 */ dna.rw = stopped;
+	dna.pence = 30; // 2/6
+	dna.rw = stopped;
 	dna.wearing = clothes;
 	dna.obj[money - 1] = true;
 	dna.obj[bodkin - 1] = true;
@@ -338,11 +339,11 @@ void Gyro::newgame() {
 	ppos[0][1] = -177; 
 	_vm->_trip->tr[0].appear(300,117,right); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
-	/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
+	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	him = 254;
 	her = 254;
 	it = 254;
-	last_person = 254; /* = Pardon? */
+	last_person = 254; // = Pardon?
 	dna.pass_num = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	after_the_scroll = false;
 	dna.user_moves_avvy = false;
@@ -446,7 +447,7 @@ char Gyro::get_thingchar(byte which) {
 	switch (which) {
 	case wine:
 		if (dna.winestate == 3)
-			get_thingchar_result = 'V'; /* Vinegar */
+			get_thingchar_result = 'V'; // Vinegar
 		else
 			get_thingchar_result = thingchar[which - 1];
 		break;
@@ -521,7 +522,7 @@ Common::String Gyro::f5_does() {
 		break;
 	}
 
-	return Common::String(_vm->_acci->kPardon); /* If all else fails... */
+	return Common::String(_vm->_acci->kPardon); // If all else fails...
 }
 
 void Gyro::load_a_mouse(byte which) {
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index c8a2746..d453c77 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -43,10 +43,10 @@ namespace Avalanche {
 class AvalancheEngine;
 
 
-static const byte numobjs = 18; /* always preface with a # */
-static const int16 maxobjs = 12;  /* carry limit */
+static const byte numobjs = 18; // always preface with a #
+static const int16 maxobjs = 12;  // carry limit
 
-static const int16 numlockCode = 32;  /* Code for Num Lock */
+static const int16 numlockCode = 32;  // Code for Num Lock
 static const int16 mouse_size = 134;
 
 struct postype {
@@ -54,12 +54,12 @@ struct postype {
 	byte length;
 };
 
-struct mp { /* mouse-void **/
+struct mp { // mouse-void 
 	uint16 mask[2][16];
 	int16 horzhotspot, verthotspot;
 };
 
-struct dnatype { /* here goes... */ /* Ux, uy, & ww now all belong to Trip5 */
+struct dnatype { // here goes... Ux, uy, & ww now all belong to Trip5
 	byte rw; /* Realway- just for convenience! */
 	byte carrying; /* how many objects you're carrying... */
 	bool obj[numobjs]; /* ...and which ones they are. */
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index a21da00..4007504 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -43,12 +43,12 @@ const byte r__argentroad = 10;
 const byte r__wisewomans = 11;
 const byte r__spludwicks = 12;
 const byte r__insideabbey = 13;
-const byte r__outsideabbey = 14; /*{ assumed }*/
+const byte r__outsideabbey = 14; // assumed
 const byte r__avvysgarden = 15;
 const byte r__aylesoffice = 16;
 const byte r__argentpub = 19;
 const byte r__brummieroad = 20;
-const byte r__bridge = 21; /*{ ? not sure }*/
+const byte r__bridge = 21; // ? not sure
 const byte r__lusties = 22;
 const byte r__lustiesroom = 23;
 const byte r__westhall = 25;
@@ -76,11 +76,11 @@ const byte r__insidecardiffcastle = 71;
 
 //{ -------------- }
 
-/*{ place80 appears to be bogus }*/
+// place80 appears to be bogus
 
 //{ -------------- }
 
-const byte r__bosskey = 98; /*{ assumed }*/
+const byte r__bosskey = 98; // assumed 
 const byte r__map = 99;
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 3ad8f50..5a893a6 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -53,20 +53,20 @@ void Scrolls::init() {
 	resetscrolldriver();
 }
 
-void Scrolls::state(byte x) {     /* Sets "Ready" light to whatever */
+void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
 	if (_vm->_gyro->ledstatus == x)
-		return; /* Already like that! */
+		return; // Already like that!
 
 	byte color = black;
 	switch (x) {
 	case 0:
 		color = black;
-		break; /* Off */
+		break; // Off
 	case 1:
 	case 2:
 	case 3:
 		color = green;
-		break; /* Hit a key */
+		break; // Hit a key
 	}
 	warning("STUB: Scrolls::state()");
 
@@ -82,7 +82,7 @@ void Scrolls::easteregg() {
 	warning("STUB: Scrolls::easteregg()");
 }
 
-void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwriting */
+void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwriting
 	fontType itw;
 	byte lz = z.size();
 	
@@ -113,7 +113,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
 	}
 }
 
-/* Here are the procedures that Scroll calls */ /* So they must be... */ /*$F+*/
+// Here are the procedures that Scroll calls. So they must be... $F+*/
 
 void Scrolls::normscroll() {
 	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
@@ -149,7 +149,7 @@ void Scrolls::normscroll() {
 //	bool oktoexit;
 //	do {
 //		do {
-//			_vm->_gyro->check(); /* was "checkclick;" */
+//			_vm->_gyro->check(); // was "checkclick;"
 //
 //#ifdef RECORD slowdown(); basher::count += 1; #endif
 //
@@ -178,7 +178,7 @@ void Scrolls::normscroll() {
 //
 //#ifdef RECORD record_one(); #endif
 //
-//	_vm->_gyro->screturn = r == '#'; /* "back door" */
+//	_vm->_gyro->screturn = r == '#'; // "back door"
 
 	state(0);
 	_vm->_gyro->seescroll = false;
@@ -244,20 +244,18 @@ void Scrolls::music_scroll() {
 #endif
 }
 
-/* ThatsAll, so put us back to */ /*$F-*/
+// ThatsAll, so put us back to $F-
 
-void Scrolls::resetscrolldriver() {   /* phew */
+void Scrolls::resetscrolldriver() {   // phew
 	_vm->_gyro->scrollbells = 0;
 	cfont = roman;
 	use_icon = 0;
-	_vm->_gyro->interrogation = 0; /* always reset after a scroll comes up. */
+	_vm->_gyro->interrogation = 0; // always reset after a scroll comes up.
 }
 
-void Scrolls::dingdongbell() {   /* Pussy's in the well. Who put her in? Little... */
-	byte fv;
-
-	for (fv = 0; fv < _vm->_gyro->scrollbells; fv++)
-		_vm->_lucerna->errorled(); /* ring the bell "x" times */
+void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little...
+	for (byte fv = 0; fv < _vm->_gyro->scrollbells; fv++)
+		_vm->_lucerna->errorled(); // ring the bell "x" times
 }
 
 void Scrolls::dodgem() {     
@@ -330,7 +328,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
-	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
+	_vm->_gyro->oncandopageswap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
 
 	lx = 0;
 	ly = (_vm->_gyro->scrolln) * 6;
@@ -386,7 +384,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	switch (use_icon) {
 	case 0:
 		icon_indent = 0;
-		break; /* No icon. */
+		break; // No icon.
 	case 34: {
 		block_drop("about", 28, 76, 15);
 		icon_indent = 0;
@@ -453,12 +451,12 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	//setvisualpage(cp);
 	//mousepage(cp);
 	CursorMan.showMouse(false);
-	/* mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);*/
+	// mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);
 	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
 	//blitfix();
 	_vm->_gyro->oncandopageswap = true; // Normality again.
 	CursorMan.showMouse(true);
-	//settextjustify(0, 0); /*sink*/
+	//settextjustify(0, 0); // sink
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
 		_vm->_gyro->after_the_scroll = true;
@@ -469,13 +467,13 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 void Scrolls::bubble(func2 gotoit) {
 	int16 xl, yl, my, xw, yw;
 	Common::Point p[3];
-//	byte *rp1, *rp2; /* replace: 1=bubble, 2=pointer */
-	int16 xc; /* x correction */
+//	byte *rp1, *rp2; // replace: 1=bubble, 2=pointer
+	int16 xc; // x correction
 
-	/*setvisualpage(cp);
-	setactivepage(1 - cp);*/
-	_vm->_gyro->oncandopageswap = false;  /* On can now no longer swap pages. So we can do what we want without its interference! */
-	//mousepage(1 - cp); /* Mousepage */
+	//setvisualpage(cp);
+	//setactivepage(1 - cp);
+	_vm->_gyro->oncandopageswap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
+	//mousepage(1 - cp); // Mousepage
 
 	CursorMan.showMouse(false);
 
@@ -549,7 +547,7 @@ void Scrolls::bubble(func2 gotoit) {
 	_vm->_gyro->dropsok = true;
 
 	//setvisualpage(cp);
-	CursorMan.showMouse(true); /*sink;*/
+	CursorMan.showMouse(true); // sink;
 	_vm->_gyro->oncandopageswap = true;
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
@@ -568,7 +566,7 @@ void Scrolls::resetscroll() {
 			_vm->_gyro->scroll[j].clear();
 }
 
-void Scrolls::natural() {   /* Natural state of bubbles */
+void Scrolls::natural() {   // Natural state of bubbles
 	_vm->_gyro->talkx = 320;
 	_vm->_gyro->talky = 200;
 	_vm->_gyro->talkb = 8;
@@ -698,9 +696,9 @@ void Scrolls::calldrivers() {
 					} else
 						_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
 				else if ((10 <= param) && (param <= 36)) {
-					/* Quasi-peds. (This routine performs the same
-					thing with QPs as triptype.chatter does with the
-					sprites.) */
+					// Quasi-peds. (This routine performs the same
+					// thing with QPs as triptype.chatter does with the
+					// sprites.)
 					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].x;
 					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].y; // Position.
 		
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 47656f2..ed8cd13 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -43,11 +43,7 @@
 #include "common/textconsole.h"
 #include "common/file.h"
 
-/*#include "Dropdown.h"*/
-
-
 namespace Avalanche {
-
 	
 void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	_tr = tr;
@@ -58,7 +54,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	Common::File inf;
 
 	if (spritenum == 177)
-		return; /* Already running! */
+		return; // Already running!
 
 	Common::String filename;
 	filename = filename.format("sprite%d.avd", spritenum);
@@ -120,7 +116,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	}
 	totalnum++;
 
-	/* on; */
+	// on;
 	x = 0;
 	y = 0;
 	quick = true;
@@ -128,7 +124,7 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	xs = 3;
 	ys = 1;
 	if (spritenum == 1)
-		_tr->newspeed(); /* Just for the lights. */
+		_tr->newspeed(); // Just for the lights.
 
 	homing = false;
 	ix = 0;
@@ -296,7 +292,7 @@ void triptype::homestep() {
 	int16 temp;
 
 	if ((hx == x) && (hy == y)) {
-		/* touching the target */
+		// touching the target
 		stopwalk();
 		return;
 	}
@@ -326,9 +322,9 @@ void triptype::speed(int8 xx, int8 yy) {
 	ix = xx;
 	iy = yy;
 	if ((ix == 0) && (iy == 0))
-		return; /* no movement */
+		return; // no movement
 	if (ix == 0) {
-		/* No horz movement */
+		// No horz movement
 		if (iy < 0)
 			turn(_tr->up);
 		else
@@ -419,7 +415,7 @@ void triptype::load_data_from_mem(uint16 &where) {
 triptype *triptype::done() {
 	Common::String xx;
 
-	/*  nds:=num div seq;*/
+	//  nds:=num div seq;
 	totalnum--;
 	_info.xw = _info.xl / 8;
 	if ((_info.xl % 8) > 0)
@@ -436,7 +432,7 @@ triptype *triptype::done() {
 }
 
 getsettype *getsettype::init() {
-	numleft = 0; /* initialize array pointer */
+	numleft = 0; // initialize array pointer
 	return this;
 }
 
@@ -476,7 +472,7 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	byte a, c;
 	int16 fv, ff;
 
-	/* if not alive then begin checkfeet:=0; exit; end;*/
+	// if not alive then begin checkfeet:=0; exit; end;
 	a = 0;
 
 	//setactivepage(2);
@@ -529,8 +525,8 @@ void Trip::catamove(byte ped) {
 	uint16 xy_uint16;
 	byte fv;
 
-	/* XY_uint16 is cat_x+cat_y*256. Thus, every room in the
-		catacombs has a different number for it. */
+	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
+	// catacombs has a different number for it.
 
 
 		
@@ -538,11 +534,11 @@ void Trip::catamove(byte ped) {
 	_vm->_gyro->dna.geida_spin = 0;
 		
 	switch (xy_uint16) {
-	case 1801: /* Exit catacombs */
+	case 1801: // Exit catacombs
 		fliproom(r__lustiesroom, 4);
 		_vm->_scrolls->display("Phew! Nice to be out of there!");
 		return;
-	case 1033: /* Oubliette */
+	case 1033: // Oubliette
 		fliproom(r__oubliette, 1);
 		_vm->_scrolls->display(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 		return;
@@ -562,128 +558,128 @@ void Trip::catamove(byte ped) {
 		_vm->_lucerna->load(29);
 	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1];
 
-	switch (here & 0xf) { /* West. */
-	case 0: /* no connection (wall) */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
+	switch (here & 0xf) { // West.
+	case 0: // no connection (wall)
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
 		break;
-	case 0x1: /* no connection (wall + shield), */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); /* ...shield. */
+	case 0x1: // no connection (wall + shield),
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
-	case 0x2: /* wall with door */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door. */
+	case 0x2: // wall with door
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
 		break;
-	case 0x3: /* wall with door and shield */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); /* ...shield. */
+	case 0x3: // wall with door and shield
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
-	case 0x4: /* no connection (wall + window), */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  /* ...window. */
+	case 0x4: // no connection (wall + window),
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
 		break;
-	case 0x5: /* wall with door and window */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5); /* ...window. */
+	case 0x5: // wall with door and window
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
 		break;
-	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); /* ...torches. */
+	case 0x6: // no connection (wall + torches),
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // No door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
-	case 0x7: /* wall with door and torches */
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); /* ...door, and... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); /* ...torches. */
+	case 0x7: // wall with door and torches
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
-	case 0xf: /* straight-through corridor. */
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Sloping wall. */
-		_vm->_gyro->magics[2].op = _vm->_gyro->special; /* Straight wall. */
+	case 0xf: // straight-through corridor.
+		_vm->_gyro->magics[1].op = _vm->_gyro->nix; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->special; // Straight wall.
 		break;
 	}
 
 	/*  ---- */
 
-	switch ((here & 0xf0) >> 4) { /* East */
-	case 0: /* no connection (wall) */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
+	switch ((here & 0xf0) >> 4) { // East
+	case 0: // no connection (wall)
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
 		break;
-	case 0x1: /* no connection (wall + window), */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); /* ...window. */
+	case 0x1: // no connection (wall + window),
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
-	case 0x2: /* wall with door */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...door. */
+	case 0x2: // wall with door
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
 		break;
-	case 0x3: /* wall with door and window */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); /* ...door, and... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...window. */
+	case 0x3: // wall with door and window
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
 		break;
-	case 0x6: /* no connection (wall + torches), */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* No door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); /* ...torches. */
+	case 0x6: // no connection (wall + torches),
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // No door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
-	case 0x7: /* wall with door and torches */
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; /* Door. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); /* Wall, plus... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); /* ...door, and... */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); /* ...torches. */
+	case 0x7: // wall with door and torches
+		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
-	case 0xf: /* straight-through corridor. */
-		_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Sloping wall. */
-		_vm->_gyro->magics[5].op = _vm->_gyro->special; /* Straight wall. */
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; /* Door. */
+	case 0xf: // straight-through corridor.
+		_vm->_gyro->magics[4].op = _vm->_gyro->nix; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->special; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
 		break;
 	}
 
 	/*  ---- */
 
-	switch ((here & 0xf00) >> 8) { /* South */
-	case 0: /* No connection. */
+	switch ((here & 0xf00) >> 8) { // South
+	case 0: // No connection.
 		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
@@ -694,44 +690,45 @@ void Trip::catamove(byte ped) {
 		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
 			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
 		else
-			_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Right exit south. */
+			_vm->_gyro->magics[12].op = _vm->_gyro->special; // Right exit south.
 
 		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		break;
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->magics[6].op = _vm->_gyro->special; /* Middle exit south. */
+		_vm->_gyro->magics[6].op = _vm->_gyro->special; // Middle exit south.
 		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	case 0x3:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
-		_vm->_gyro->magics[11].op = _vm->_gyro->special; /* Left exit south. */
+		_vm->_gyro->magics[11].op = _vm->_gyro->special; // Left exit south.
 		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
 		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
 		break;
 	}
 
-	switch ((here & 0xf000) >> 12) { /* North */
-	case 0: /* No connection */
+	switch ((here & 0xf000) >> 12) { // North
+	case 0: // No connection
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
 		break;
 	// LEFT handles: 
-/*
+#if 0
 	case 0x1:
 		_vm->_celer->show_one(-1, -1, 4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
-*/
+#endif
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
 		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
-/*	case 0x3:
+#if 0
+	case 0x3:
 		_vm->_celer->show_one(-1, -1, 4);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
@@ -742,19 +739,19 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
-*/
+#endif
 	case 0x5:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; /* Middle exit north. */
-		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
-/*
+#if 0
 	case 0x6:
 		_vm->_celer->show_one(-1, -1, 3);
 		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
 		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
 		break;
-*/
+#endif
 	// ARCHWAYS:
 	case 0x7:
 	case 0x8:
@@ -766,41 +763,41 @@ void Trip::catamove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
 
-		_vm->_gyro->magics[0].op = _vm->_gyro->special; /* Middle arch north. */
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->special; // Middle arch north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
 	}
 	break;
-	/* DECORATIONS: */
-	case 0xd: /* No connection + WINDOW */
+	// DECORATIONS:
+	case 0xd: // No connection + WINDOW
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
 		break;
-	case 0xe: /* No connection + TORCH */
+	case 0xe: // No connection + TORCH
 		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; /* Door. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;
-	/* Recessed door: */
+	// Recessed door:
 	case 0xf:
-		_vm->_gyro->magics[0].op = _vm->_gyro->nix; /* Door to Geida's room. */
+		_vm->_gyro->magics[0].op = _vm->_gyro->nix; // Door to Geida's room.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->portals[3].op = _vm->_gyro->special; /* Door. */
+		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 17);
-		break;     /* [2,2] : "Art Gallery" sign over door. */
+		break;     // [2,2] : "Art Gallery" sign over door.
 	case 264:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
-		break;      /* [8,1] : "The Wrong Way!" sign. */
+		break;      // [8,1] : "The Wrong Way!" sign.
 	case 1797:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-		break;      /* [5,7] : "Ite Mingite" sign. */
+		break;      // [5,7] : "Ite Mingite" sign.
 	case 258:
-		for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
+		for (fv = 0; fv <= 2; fv++) { // [2,1] : Art gallery - pictures
 			_vm->_celer->drawBackgroundSprite(130 + fv * 120, 70, 15);
 			_vm->_celer->drawBackgroundSprite(184 + fv * 120, 78, 16);
 		}
@@ -808,22 +805,22 @@ void Trip::catamove(byte ped) {
 	case 1287:
 		for (fv = 10; fv <= 13; fv++)
 			_vm->_celer->drawBackgroundSprite(-1, -1, fv);
-		break; /* [7,5] : 4 candles. */
+		break; // [7,5] : 4 candles.
 	case 776:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-		break;     /* [8,3] : 1 candle. */
+		break;     // [8,3] : 1 candle.
 	case 2049:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
-		break;     /* [1,8] : another candle. */
+		break;     // [1,8] : another candle.
 	case 257:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
-		break; /* [1,1] : the other two. */
+		break; // [1,1] : the other two.
 	}
 
 	if ((_vm->_gyro->dna.geida_follows) && (ped > 0)) {
-		if (!tr[1].quick)  /* If we don't already have her... */
-			tr[1].init(5, true, this); /* ...Load Geida. */
+		if (!tr[1].quick)  // If we don't already have her...
+			tr[1].init(5, true, this); // ...Load Geida.
 		apped(2, geida_ped(ped));
 		tr[1].call_eachstep = true;
 		tr[1].eachstep = procgeida_procs;
@@ -832,14 +829,14 @@ void Trip::catamove(byte ped) {
 
 	
 
-/* This proc gets called whenever you touch a line defined as _vm->_gyro->special. */
+// This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Trip::dawndelay() {
 	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->reason_dawndelay);
 }
 
 void Trip::call_special(uint16 which) {
 	switch (which) {
-	case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
+	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->dna.brummie_stairs = 1;
 		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
@@ -847,94 +844,95 @@ void Trip::call_special(uint16 which) {
 		stopwalking();
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
-	case 2: /* _vm->_gyro->special 2: Room 22: bottom of stairs. */
+	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
 		_vm->_gyro->dna.brummie_stairs = 3;
 		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
 		_vm->_gyro->magics[11].op = _vm->_gyro->exclaim;
 		_vm->_gyro->magics[11].data = 5;
-		_vm->_gyro->magics[3].op = _vm->_gyro->bounces; /* Now works as planned! */
+		_vm->_gyro->magics[3].op = _vm->_gyro->bounces; // Now works as planned!
 		stopwalking();
 		_vm->_visa->dixi('q', 26);
 		_vm->_gyro->dna.user_moves_avvy = true;
 		break;
-	case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */
-		tr[0].bounce(); /* Must include that. */
+	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
+		tr[0].bounce(); // Must include that.
 
 		if (!_vm->_gyro->dna.arrow_triggered) {
 			_vm->_gyro->dna.arrow_triggered = true;
-			apped(2, 4); /* The dart starts at ped 4, and... */
-			tr[1].walkto(5); /* flies to ped 5. */
-			tr[1].face = 0; /* Only face. */
-			/* Should call some kind of Eachstep procedure which will deallocate
-				the sprite when it hits the wall, and replace it with the chunk
-				graphic of the arrow buried in the plaster. */
-			/* OK! */
+			apped(2, 4); // The dart starts at ped 4, and...
+			tr[1].walkto(5); // flies to ped 5.
+			tr[1].face = 0; // Only face.
+			// Should call some kind of Eachstep procedure which will deallocate
+			// the sprite when it hits the wall, and replace it with the chunk
+			// graphic of the arrow buried in the plaster. */
+			
+			// OK!
 			tr[1].call_eachstep = true;
 			tr[1].eachstep = procarrow_procs;
 		}
 		break;
-	case 4: /* This is the ghost room link. */
+	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
-		tr[0].turn(right); /* you'll see this after we get back from bootstrap */
+		tr[0].turn(right); // you'll see this after we get back from bootstrap
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
 		_vm->_enid->back_to_bootstrap(3);
 		break;
 	case 5:
 		if (_vm->_gyro->dna.friar_will_tie_you_up) {
-			/* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */
-			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */
+			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
+			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Boundary effect is now working again.
 			_vm->_visa->dixi('q', 35);
 			tr[0].done();
-			/*tr[1].vanishifstill:=true;*/
+			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->dixi('q', 36);
 			_vm->_gyro->dna.tied_up = true;
 			_vm->_gyro->dna.friar_will_tie_you_up = false;
 			tr[1].walkto(3);
 			tr[1].vanishifstill = true;
-			tr[1].check_me = true; /* One of them must have Check_Me switched on. */
-			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 177; /* Not here, then. */
+			tr[1].check_me = true; // One of them must have Check_Me switched on.
+			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 177; // Not here, then.
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
-	case 6: /* _vm->_gyro->special 6: fall down oubliette. */
+	case 6: // _vm->_gyro->special 6: fall down oubliette.
 		_vm->_gyro->dna.user_moves_avvy = false;
 		tr[0].ix = 3;
 		tr[0].iy = 0;
 		tr[0].face = right;
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
 		break;
-	case 7: /* _vm->_gyro->special 7: stop falling down oubliette. */
+	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0].visible = false;
 		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
-		/*_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
-		_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);*/
+		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
+		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
-	case 8:        /* _vm->_gyro->special 8: leave du Lustie's room. */
+	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
 			_vm->_visa->dixi('q', 63);
 			tr[1].turn(down);
 			tr[1].stopwalk();
-			tr[1].call_eachstep = false; /* Geida */
+			tr[1].call_eachstep = false; // Geida
 			_vm->_lucerna->gameover();
 		}
 		break;
-	case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */
+	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
 		if (!_vm->_gyro->dna.geida_follows)
-			return;   /* DOESN'T COUNT: no Geida. */
-		tr[1].call_eachstep = false; /* She no longer follows Avvy around. */
-		tr[1].walkto(4); /* She walks to somewhere... */
-		tr[0].done();     /* Lose Avvy. */
+			return;   // DOESN'T COUNT: no Geida.
+		tr[1].call_eachstep = false; // She no longer follows Avvy around.
+		tr[1].walkto(4); // She walks to somewhere...
+		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
 		break;
-	case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */
+	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
 		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
-			/* Into Geida's room. */
+			// Into Geida's room.
 			if (_vm->_gyro->dna.obj[_vm->_gyro->key - 1])
 				_vm->_visa->dixi('q', 62);
 			else {
@@ -961,7 +959,7 @@ void Trip::call_special(uint16 which) {
 		getback();
 		dawndelay();
 		break;
-	case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */
+	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_x++;
 		catamove(1);
@@ -972,7 +970,7 @@ void Trip::call_special(uint16 which) {
 		getback();
 		dawndelay();
 		break;
-	case 12: /* _vm->_gyro->special 12: transfer south in catacombs. */
+	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_y += 1;
 		catamove(2);
@@ -983,7 +981,7 @@ void Trip::call_special(uint16 which) {
 		getback();
 		dawndelay();
 		break;
-	case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */
+	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->dna.cat_x--;
 		catamove(3);
@@ -1000,9 +998,9 @@ void Trip::call_special(uint16 which) {
 	
 
 void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
-/* This slides the door open. (The data really ought to be saved in
-	the Also file, and will be next time. However, for now, they're
-	here.) */
+// This slides the door open. (The data really ought to be saved in
+// the Also file, and will be next time. However, for now, they're
+// here.)
 	switch (_vm->_gyro->dna.room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
@@ -1038,7 +1036,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 				return;
 			} else {
 				apped(1, 6);
-				tr[0].face = right; /* added by TT 12/3/1995 */
+				tr[0].face = right; // added by TT 12/3/1995
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(9);
 			}
@@ -1120,12 +1118,14 @@ void Trip::apped(byte trn, byte np) {
 
 
 
-/*   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
+#if 0
+   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
 	begin { By De Morgan's law: }
 	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
-	end;*/
-/* x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
-	x3,y3 = mx,my. x4,y4 = mx+16,my+16. */
+	end;
+#endif
+	//x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
+	//x3,y3 = mx,my. x4,y4 = mx+16,my+16.
 bool Trip::overlaps_with_mouse() {
 	bool overlaps_with_mouse_result;
 	overlaps_with_mouse_result =
@@ -1134,7 +1134,7 @@ bool Trip::overlaps_with_mouse() {
 }
 
 void Trip::getback() {
-	/* Super_Off;*/
+	// Super_Off;
 
 	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
 		getset[1 - _vm->_gyro->cp].recall(r);
@@ -1151,13 +1151,14 @@ void Trip::getback() {
 
 		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}
-	/*
+
+#if 0
 	if endangered then
 		Super_On;
-	*/
+#endif
 }
 
-/* Eachstep procedures: */
+// Eachstep procedures:
 void Trip::follow_avvy_y(byte tripnum) {
 	if (tr[0].face == left)
 		return;
@@ -1199,43 +1200,45 @@ void Trip::face_avvy(byte tripnum) {
 
 void Trip::arrow_procs(byte tripnum) {
 	if (tr[tripnum].homing) {
-		/* Arrow is still in flight. */
-		/* We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
-			This is so if: a) the bottom of the arrow is below Avvy's head,
-			b) the left of the arrow is left of the right of Avvy's head, and
-			c) the right of the arrow is right of the left of Avvy's head. */
-		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[0].y) /* A */
-				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info.xl)) /* B */
-				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[0].x)) { /* C */
-			/* OK, it's hit him... what now? */
-
-			tr[1].call_eachstep = false; /* prevent recursion. */
-			_vm->_visa->dixi('Q', 47); /* Complaint! */
-			tr[tripnum].done(); /* Deallocate the arrow. */
-			/*     tr[1].done; { Deallocate normal pic of Avvy. }
-
-					off;
-					for byte fv:=0 to 1 do
-					begin
-					cp:=1-cp;
-					getback;
-					end;
-					on;*/
+		// Arrow is still in flight.
+		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
+		// This is so if: a) the bottom of the arrow is below Avvy's head,
+		// b) the left of the arrow is left of the right of Avvy's head, and
+		// c) the right of the arrow is right of the left of Avvy's head.
+		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[0].y) // A
+				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info.xl)) // B
+				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[0].x)) { // C
+			// OK, it's hit him... what now?
+
+			tr[1].call_eachstep = false; // prevent recursion.
+			_vm->_visa->dixi('Q', 47); // Complaint!
+			tr[tripnum].done(); // Deallocate the arrow.
+#if 0
+			tr[1].done; { Deallocate normal pic of Avvy. }
 
+			off;
+			for byte fv:=0 to 1 do
+			begin
+			cp:=1-cp;
+			getback;
+			end;
+			on;
+#endif
 			_vm->_lucerna->gameover();
 
-			_vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */
+			_vm->_gyro->dna.user_moves_avvy = false; // Stop the user from moving him.
 			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
 		}
-	} else { /* Arrow has hit the wall! */
-		tr[tripnum].done(); /* Deallocate the arrow. */
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Show pic of arrow stuck into the door. */
-		_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
+	} else { // Arrow has hit the wall!
+		tr[tripnum].done(); // Deallocate the arrow.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
+		_vm->_gyro->dna.arrow_in_the_door = true; // So that we can pick it up.
 	}
 		
 }
 
-/*procedure Spludwick_procs(tripnum:byte);
+#if 0
+procedure Spludwick_procs(tripnum:byte);
 var fv:byte;
 begin
 	with tr[tripnum] do
@@ -1247,18 +1250,19 @@ begin
 	if DogfoodPos=8 then DogfoodPos:=1;
 	walkto(DogfoodPos);
 	end;
-end;*/
+end;
+#endif
 
-void Trip::grab_avvy(byte tripnum) {     /* For Friar Tuck, in Nottingham. */
+void Trip::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 tox = tr[0].x + 17;
 	int16 toy = tr[0].y - 1;
 	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
 		tr[tripnum].call_eachstep = false;
 		tr[tripnum].face = left;
 		tr[tripnum].stopwalk();
-		/* ... whatever ... */
+		// ... whatever ...
 	} else {
-		/* Still some way to go. */
+		// Still some way to go.
 		if (tr[tripnum].x < tox) {
 			tr[tripnum].x += 5;
 			if (tr[tripnum].x > tox)
@@ -1285,14 +1289,14 @@ void Trip::spin(byte whichway, byte &tripnum) {
 	if (tr[tripnum].face != whichway) {
 		tr[tripnum].face = whichway;
 		if (tr[tripnum].whichsprite == 2)
-			return; /* Not for Spludwick */
+			return; // Not for Spludwick
 
 		_vm->_gyro->dna.geida_spin += 1;
 		_vm->_gyro->dna.geida_time = 20;
 		if (_vm->_gyro->dna.geida_spin == 5) {
 			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
 			_vm->_gyro->dna.geida_spin = 0;
-			_vm->_gyro->dna.geida_time = 0; /* knock out records */
+			_vm->_gyro->dna.geida_time = 0; // knock out records
 		}
 	}
 }
@@ -1305,14 +1309,14 @@ void Trip::geida_procs(byte tripnum) {
 	}
 
 	if (tr[tripnum].y < (tr[0].y - 2)) {
-		/* Geida is further from the screen than Avvy. */
+		// Geida is further from the screen than Avvy.
 		spin(down, tripnum);
 		tr[tripnum].iy = 1;
 		tr[tripnum].ix = 0;
 		take_a_step(tripnum);
 		return;
 	} else if (tr[tripnum].y > (tr[0].y + 2)) {
-		/* Avvy is further from the screen than Geida. */
+		// Avvy is further from the screen than Geida.
 		spin(up, tripnum);
 		tr[tripnum].iy = -1;
 		tr[tripnum].ix = 0;
@@ -1335,7 +1339,7 @@ void Trip::geida_procs(byte tripnum) {
 		tr[tripnum].ix = 0;
 }
 
-/* That's all... */
+// That's all...
 
 void Trip::call_andexors() {
 	int8 order[5];
@@ -1355,7 +1359,7 @@ void Trip::call_andexors() {
 		for (fv = 0; fv < 4; fv++) {
 			if (((order[fv] != -1) && (order[fv + 1] != -1))
 					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
-				/* Swap them! */
+				// Swap them!
 				temp = order[fv];
 				order[fv] = order[fv + 1];
 				order[fv + 1] = temp;
@@ -1400,7 +1404,7 @@ void Trip::trippancy_link() {
 			case procarrow_procs :
 				arrow_procs(fv);
 				break;
-				/*    PROCSpludwick_procs : spludwick_procs(fv);*/
+				//    PROCSpludwick_procs : spludwick_procs(fv);
 			case procgrab_avvy :
 				grab_avvy(fv);
 				break;
@@ -1420,14 +1424,13 @@ void Trip::trippancy_link() {
 void Trip::get_back_loretta() {
 	byte fv;
 
-	/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
 	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick) {
 			getback();
 			return;
 		}
 	}
-	/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
+	// for fv:=0 to 1 do begin cp:=1-cp; getback; end;
 }
 
 void Trip::stopwalking() {
@@ -1457,7 +1460,7 @@ void Trip::hide_in_the_cupboard() {
 		else {
 			tr[0].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
-			apped(1, 3); /* Walk out of the cupboard. */
+			apped(1, 3); // Walk out of the cupboard.
 			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->dna.avvys_in_the_cupboard = false;
 			_vm->_sequence->first_show(8);
@@ -1465,7 +1468,7 @@ void Trip::hide_in_the_cupboard() {
 			_vm->_sequence->start_to_close();
 		}
 	} else {
-		/* Not hiding in the cupboard */
+		// Not hiding in the cupboard
 		tr[0].visible = false;
 		_vm->_gyro->dna.user_moves_avvy = false;
 		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
@@ -1489,9 +1492,9 @@ void Trip::fliproom(byte room, byte ped) {
 	byte fv;
 
 	if (!_vm->_gyro->alive) {
-		/* You can't leave the room if you're dead. */
+		// You can't leave the room if you're dead.
 		tr[0].ix = 0;
-		tr[0].iy = 0; /* Stop him from moving. */
+		tr[0].iy = 0; // Stop him from moving.
 		return;
 	}
 
@@ -1501,7 +1504,7 @@ void Trip::fliproom(byte room, byte ped) {
 	}
 
 	if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) {
-		/* You can't *jump* out of Cardiff Castle! */
+		// You can't *jump* out of Cardiff Castle!
 		tr[0].ix = 0;
 		return;
 	}
@@ -1518,7 +1521,7 @@ void Trip::fliproom(byte room, byte ped) {
 	for (fv = 1; fv < numtr; fv++) {
 		if (tr[fv].quick)
 			tr[fv].done();
-	} /* Deallocate sprite */
+	} // Deallocate sprite
 
 	if (_vm->_gyro->dna.room == r__lustiesroom)
 		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
@@ -1536,8 +1539,8 @@ void Trip::fliproom(byte room, byte ped) {
 	}
 	_vm->_lucerna->dawn();
 
-	/* Tidy up after mouse. I know it's a kludge... */
-	/*  tidy_after_mouse;*/
+	// Tidy up after mouse. I know it's a kludge...
+	//  tidy_after_mouse;
 }
 
 bool Trip::infield(byte which) {
@@ -1552,7 +1555,7 @@ bool Trip::infield(byte which) {
 
 bool Trip::neardoor() {
 	if (_vm->_gyro->numfields < 8) {
-		/* there ARE no doors here! */
+		// there ARE no doors here!
 		return false;
 	}
 		
@@ -1566,7 +1569,7 @@ bool Trip::neardoor() {
 	return nd;
 }
 
-void Trip::new_game_for_trippancy() {   /* Called by gyro.newgame */
+void Trip::new_game_for_trippancy() {   // Called by gyro.newgame
 	tr[0].visible = false;
 }
 


Commit: b690c9ad31730d63cc121e38d3496c2a5f0c34d4
    https://github.com/scummvm/scummvm/commit/b690c9ad31730d63cc121e38d3496c2a5f0c34d4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T22:47:40-07:00

Commit Message:
AVALANCHE: Finish replacing C-style comments by C++-style

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/parser.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3248629..b1b5fe8 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -44,8 +44,6 @@
 #include "avalanche/visa2.h"
 #include "avalanche/closing2.h"
 
-/*#include "Incline.h"*/
-
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "common/config-manager.h"
@@ -140,7 +138,7 @@ void Avalot::setup() {
 	_vm->_gyro->holdthedawn = true;
 	_vm->_lucerna->dusk();
 	_vm->_gyro->cmp = 177;
-	_vm->_lucerna->mouse_init();  /*on;*/
+	_vm->_lucerna->mouse_init();  // on;
 	_vm->_gyro->dropsok = true;
 	_vm->_gyro->ctrl = ckey;
 	_vm->_gyro->oldjw = 177;
@@ -154,7 +152,7 @@ void Avalot::setup() {
 	_vm->_parser->_quote = true;
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->defaultled = 2;
-	/* TSkellern:=0; { Replace with a more local variable sometime }*/
+	// TSkellern = 0; Replace with a more local variable sometime
 	_vm->_gyro->dna.rw = _vm->_gyro->stopped;
 	_vm->_gyro->enid_filename = ""; // Undefined.
 	_vm->_lucerna->toolbar();
@@ -214,16 +212,17 @@ void Avalot::run(Common::String arg) {
 
 
 
+#ifdef DEBUG
 		// ONLY FOR TESTING!!!
-		/*for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
-		_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
+			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
 
 		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-		if (_vm->_gyro->fields[i].x1 < 640)
-		_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
-		}*/
-		// ONYL FOR TESTING!!!
-
+			if (_vm->_gyro->fields[i].x1 < 640)
+				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+		}
+		// ONLY FOR TESTING!!!
+#endif
 
 
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index fe38ebe..a4cd0eb 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -71,7 +71,7 @@ private:
 	SpriteType _sprites[40];
 	bytefield _r;
 	Common::String _filename;
-	static const int16 kOnDisk; /* Value of memos[fv].x when it's not in memory. */
+	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
 
 	void drawSprite(int16 x, int16 y, const SpriteType &sprite);
 };
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 7a257d0..4477fe7 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -54,14 +54,14 @@ const char Enid::tab = '\t';
 const char Enid::eof_ = '\n';
 
 const Common::String Enid::ednafirst =
-	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + /*64*/
-	crlf + eof_ + crlf + crlf + /*7*/
-	tab + "Glory to God in the highest," + crlf + /*31*/
-	tab + "and on earth peace, goodwill toward men." + /*42*/
-	crlf + tab + tab + tab + tab + /*6*/
-	"Luke 2:14." + /*10*/
-	crlf + crlf + crlf + /* 6 */
-	"1234567890" +crlf; /*11*/
+	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + // 64
+	crlf + eof_ + crlf + crlf + // 7
+	tab + "Glory to God in the highest," + crlf + // 31
+	tab + "and on earth peace, goodwill toward men." + // 42
+	crlf + tab + tab + tab + tab + // 6
+	"Luke 2:14." + // 10
+	crlf + crlf + crlf + // 6
+	"1234567890" +crlf; // 11
 
 const Common::String Enid::ednaid = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
 
@@ -165,17 +165,19 @@ void Enid::showheader() {
 	_vm->_scrolls->display(Common::String("Dir: ") + path + "\r\r\4");
 }
 
-void Enid::dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
+void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
 	warning("STUB: Enid::dir()");
 }
 
-void Enid::avvy_background() {    /* Not really a filing procedure,
-	but it's only called just before edna_load, so I thought I'd put it
-	in Enid instead of, say, Lucerna. */
+void Enid::avvy_background() {    
+	// Not really a filing procedure,
+	// but it's only called just before edna_load, so I thought I'd put it
+	// in Enid instead of, say, Lucerna.
 	
-	/* port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }*/
-	/*
-		asm
+#if 0
+	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }
+
+	asm
 		mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
 		mov dx,$3ce; mov al,4; out dx,al; { register. }
 		mov dx,$3c5; mov al,1; out dx,al;
@@ -246,7 +248,7 @@ void Enid::avvy_background() {    /* Not really a filing procedure,
 
 		@the_end:
 		end;
-	*/
+#endif
 }
 
 void Enid::to_sundry(sundry &sund) {
@@ -274,8 +276,8 @@ void Enid::edna_reload() {
 
 	restore_dna();
 
-	_vm->_gyro->seescroll = true;  /* This prevents display of the new sprites before the
-	new picture is loaded. */
+	_vm->_gyro->seescroll = true;  // This prevents display of the new sprites before the
+								   // new picture is loaded.
 
 	_vm->_lucerna->major_redraw();
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 6fac687..2237d35 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -44,7 +44,7 @@ public:
 
 	void edna_load(Common::String name);
 
-	void edna_reload();    /* From Bootstrap's storage. */
+	void edna_reload();    // From Bootstrap's storage.
 
 	void dir(Common::String where);
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 35ccd5f..92bffc2 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -97,13 +97,13 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	/* First we make the pixels of the spirte blank. */
+	// First we make the pixels of the spirte blank.
 	for (byte j = 0; j < sprite.yl; j++)
 		for (byte i = 0; i < sprite.xl; i++)
 			if (((*sprite.sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
 				*getPixel(x + i, y + j) = 0;
 	
-	/* Then we draw the picture to the blank places. */
+	// Then we draw the picture to the blank places.
 	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
 
 	for (byte j = 0; j < sprite.yl; j++)
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 7f27186..4c812fb 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -41,17 +41,17 @@ typedef byte fontType[256][16]; // raw font type
 typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
 // Be aware!!!
 
-typedef byte siltype[51][11]; /* 35, 4 */
+typedef byte siltype[51][11]; // 35, 4
 
 class SpriteInfo {
 public:
-	byte xw; /* x-width in bytes */
-	byte xl, yl; /* x & y lengths of pictures */
+	byte xw; // x-width in bytes
+	byte xl, yl; // x & y lengths of pictures
 
 	manitype *mani[24];
 	siltype *sil[24];
 
-	uint16 size; /* the size of one picture */
+	uint16 size; // the size of one picture
 };
 
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index d453c77..d700727 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -60,108 +60,108 @@ struct mp { // mouse-void
 };
 
 struct dnatype { // here goes... Ux, uy, & ww now all belong to Trip5
-	byte rw; /* Realway- just for convenience! */
-	byte carrying; /* how many objects you're carrying... */
-	bool obj[numobjs]; /* ...and which ones they are. */
-	int16 score; /* your score, of course */
-	int32 pence; /* your current amount of dosh */
-	byte room; /* your current room */
-	byte wearing; /* what you're wearing */
-	byte swore; /* number of times you've sworn */
-	byte saves; /* number of times this game has been saved */
-	byte rooms[100]; /* Add one to each every time you enter a room */
-	byte alcohol; /* Your blood alcohol level. */
-	byte playednim; /* How many times you've played Nim. */
-	bool wonnim; /* Have you *won* Nim? (That's harder.) */
-	byte winestate; /* 0=good (Notts), 1=passable(Argent) ... 3=vinegar.*/
-	bool cwytalot_gone; /* Has Cwytalot rushed off to Jerusalem yet?*/
+	byte rw; // Realway- just for convenience!
+	byte carrying; // how many objects you're carrying...
+	bool obj[numobjs]; // ...and which ones they are.
+	int16 score; // your score, of course
+	int32 pence; // your current amount of dosh
+	byte room; // your current room
+	byte wearing; // what you're wearing
+	byte swore; // number of times you've sworn
+	byte saves; // number of times this game has been saved
+	byte rooms[100]; // Add one to each every time you enter a room
+	byte alcohol; // Your blood alcohol level.
+	byte playednim; // How many times you've played Nim.
+	bool wonnim; // Have you *won* Nim? (That's harder.)
+	byte winestate; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool cwytalot_gone; // Has Cwytalot rushed off to Jerusalem yet?
 
-	byte pass_num; /* Number of the passw for this game. */
-	bool ayles_is_awake; /* pretty obvious! */
-	byte drawbridge_open; /* Between 0 (shut) and 4 (open). */
-	byte avaricius_talk; /* How much Avaricius has said to you. */
-	bool bought_onion; /* Have you bought an onion yet? */
-	bool rotten_onion; /* And has it rotted? */
-	bool onion_in_vinegar; /* Is the onion in the vinegar? */
+	byte pass_num; // Number of the passw for this game.
+	bool ayles_is_awake; // pretty obvious!
+	byte drawbridge_open; // Between 0 (shut) and 4 (open).
+	byte avaricius_talk; // How much Avaricius has said to you.
+	bool bought_onion; // Have you bought an onion yet?
+	bool rotten_onion; // And has it rotted?
+	bool onion_in_vinegar; // Is the onion in the vinegar?
 
-	byte given2spludwick; /* 0 = nothing given, 1 = onion... */
-	byte brummie_stairs; /* Progression through the stairs trick. */
-	byte cardiff_things; /* Things you get asked in Cardiff. */
+	byte given2spludwick; // 0 = nothing given, 1 = onion...
+	byte brummie_stairs; // Progression through the stairs trick.
+	byte cardiff_things; // Things you get asked in Cardiff.
 
-	bool cwytalot_in_herts; /* Have you passed Cwytalot in Herts?*/
+	bool cwytalot_in_herts; // Have you passed Cwytalot in Herts?
 
-	bool avvy_is_awake; /* Well? Is Avvy awake? (Screen 1 only.) */
-	bool avvy_in_bed; /* True if Avvy's in bed, but awake. */
+	bool avvy_is_awake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool avvy_in_bed; // True if Avvy's in bed, but awake.
 
-	bool user_moves_avvy; /* If this is false, the user has no
-										control over Avvy's movements. */
+	bool user_moves_avvy; // If this is false, the user has no
+						  // control over Avvy's movements.
 
-	byte dogfoodpos; /* Which way Dogfood's looking in the pub. */
+	byte dogfoodpos; // Which way Dogfood's looking in the pub.
 
-	bool givenbadgetoiby; /* Have you given the badge to Iby yet? */
+	bool givenbadgetoiby; // Have you given the badge to Iby yet?
 
-	bool friar_will_tie_you_up; /* If you're going to get tied up. */
-	bool tied_up; /* You ARE tied up! */
+	bool friar_will_tie_you_up; // If you're going to get tied up.
+	bool tied_up; // You ARE tied up!
 
-	byte box_contents; /* 0 = money (sixpence), 254 = empty, any
-				other number implies the contents of the box. */
+	byte box_contents; // 0 = money (sixpence), 254 = empty, any
+					   // other number implies the contents of the box.
 
-	bool talked_to_crapulus; /* Pretty self-explanatory. */
+	bool talked_to_crapulus; // Pretty self-explanatory.
 
-	byte jacques_awake; /* 0=asleep, 1=awake, 2=gets up, 3=gone. */
+	byte jacques_awake; // 0=asleep, 1=awake, 2=gets up, 3=gone.
 
-	bool ringing_bells; /* Is Jacques ringing the bells? */
+	bool ringing_bells; // Is Jacques ringing the bells?
 
-	bool standing_on_dais; /* In room 71, inside Cardiff Castle. */
-	bool taken_pen; /* Have you taken the pen (in Cardiff?) */
-	bool arrow_triggered; /* And has the arrow been triggered? */
-	bool arrow_in_the_door;  /* Did the arrow hit the wall? */
+	bool standing_on_dais; // In room 71, inside Cardiff Castle.
+	bool taken_pen; // Have you taken the pen (in Cardiff?)
+	bool arrow_triggered; // And has the arrow been triggered?
+	bool arrow_in_the_door;  // Did the arrow hit the wall?
 
 	Common::String like2drink,
 					favourite_song,
 					worst_place_on_earth,
-					spare_evening;            /* Personalisation str's */
+					spare_evening;            // Personalisation str's
 
-	uint32 total_time; /* Your total time playing this game, in ticks.*/
+	uint32 total_time; // Your total time playing this game, in ticks.
 
-	byte jumpstatus; /* Fixes how high you're jumping. */
+	byte jumpstatus; // Fixes how high you're jumping.
 
-	bool mushroom_growing; /* Is the mushroom growing in 42? */
+	bool mushroom_growing; // Is the mushroom growing in 42? 
 
-	bool spludwicks_here; /* Is Spludwick at home? */
+	bool spludwicks_here; // Is Spludwick at home?
 
 	byte last_room;
 	byte last_room_not_map;
 
-	bool crapulus_will_tell; /* Will Crapulus tell you about
-						Spludwick being away? */
+	bool crapulus_will_tell; // Will Crapulus tell you about
+							 // Spludwick being away?
 
 	bool enter_catacombs_from_lusties_room;
-	bool teetotal; /* Are we touching any more drinks? */
-	byte malagauche; /* Position of Malagauche. See Celer for more info. */
-	char drinking; /* What's he getting you? */
+	bool teetotal; // Are we touching any more drinks?
+	byte malagauche; // Position of Malagauche. See Celer for more info.
+	char drinking; // What's he getting you?
 
 	bool entered_lusties_room_as_monk;
 
-	byte cat_x, cat_y;   /* XY coords in the catacombs. */
+	byte cat_x, cat_y;   // XY coords in the catacombs.
 
-	bool avvys_in_the_cupboard; /* On screen 22. */
+	bool avvys_in_the_cupboard; // On screen 22.
 
-	bool geida_follows; /* Is Geida following you? */
+	bool geida_follows; // Is Geida following you?
 
-	byte geida_spin, geida_time; /* For the making "Geida dizzy" joke. */
+	byte geida_spin, geida_time; // For the making "Geida dizzy" joke.
 
-	byte nextbell; /* For the ringing. */
+	byte nextbell; // For the ringing.
 
-	bool geida_given_potion; /* Does Geida have the potion? */
-	bool lustie_is_asleep; /* Is BDL asleep? */
+	bool geida_given_potion; // Does Geida have the potion?
+	bool lustie_is_asleep; // Is BDL asleep?
 
-	byte flip_to_where, flip_to_ped; /* For the sequencer. */
+	byte flip_to_where, flip_to_ped; // For the sequencer.
 
-	bool been_tied_up; /* In r__Robins. */
+	bool been_tied_up; // In r__Robins.
 
-	bool sitting_in_pub; /* Are you sitting down in the pub? */
-	byte spurge_talk; /* Count for talking to Spurge. */
+	bool sitting_in_pub; // Are you sitting down in the pub?
+	byte spurge_talk; // Count for talking to Spurge.
 
 	bool met_avaroid;
 
@@ -176,8 +176,8 @@ struct pedtype {
 };
 
 struct magictype {
-	byte op; /* one of the operations */
-	uint16 data; /* data for them */
+	byte op; // one of the operations
+	uint16 data; // data for them
 };
 
 class fieldtype {
@@ -198,9 +198,9 @@ enum controllers {cjoy, ckey};
 
 typedef Common::String previoustype[20];
 
-struct corridor_type { /* Decarations for the corridors. */
-	uint16 doors; /* Door styles are calc'ed from this uint16.
-					Assign a different number to each one! */
+struct corridor_type { // Decarations for the corridors.
+	uint16 doors; // Door styles are calc'ed from this uint16.
+				  // Assign a different number to each one!
 };
 
 struct demo_type {
@@ -223,7 +223,7 @@ struct PointType {
 	int16 x, y;
 };
 
-struct vmctype { /* Virtual Mouse Cursor */
+struct vmctype { // Virtual Mouse Cursor
 	byte *andpic, *xorpic;
 	byte *backpic[2];
 	PointType wherewas[2];
@@ -232,8 +232,7 @@ struct vmctype { /* Virtual Mouse Cursor */
 };
 
 struct sundry {
-	/* Things which must be saved over a backtobootstrap,
-						outside DNA. */
+	// Things which must be saved over a backtobootstrap, outside DNA.
 	Common::String qenid_filename;
 	bool qsoundfx;
 	char qthinks;
@@ -242,38 +241,38 @@ struct sundry {
 
 struct joysetup {
 	uint16 xmid, ymid, xmin, ymin, xmax, ymax;
-	byte centre; /* Size of centre in tenths */
+	byte centre; // Size of centre in tenths
 };
 
-struct ednahead { /* Edna header */
-	/* This header starts at byte offset 177 in the .ASG file. */
-	char id[9];   /* signature */
-	uint16 revision; /* EDNA revision, here 2 (1=dna256) */
-	Common::String game; /* Long name, eg Lord Avalot D'Argent */
-	Common::String shortname; /* Short name, eg Avalot */
-	uint16 number; /* Game's code number, here 2 */
-	uint16 ver; /* Version number as int16 (eg 1.00 = 100) */
-	Common::String verstr; /* Vernum as Common::String (eg 1.00 = "1.00" */
-	Common::String filename; /* Filename, eg AVALOT.EXE */
-	byte osbyte; /* Saving OS (here 1=DOS. See below for others.*/
-	Common::String os; /* Saving OS in text format. */
-
-	/* Info on this particular game */
-
-	Common::String fn; /* Filename (not extension ('cos that's .ASG)) */
-	byte d, m; /* D, M, Y are the Day, Month & Year this game was... */
-	uint16 y;  /* ...saved on. */
-	Common::String desc; /* Description of game (same as in Avaricius!) */
-	uint16 len; /* Length of DNA (it's not going to be above 65535!) */
-
-	/* Quick reference & miscellaneous */
-
-	uint16 saves; /* no. of times this game has been saved */
-	int16 cash; /* contents of your wallet in numerical form */
-	Common::String money; /* ditto in Common::String form (eg 5/-, or 1 denarius)*/
-	uint16 points; /* your score */
-
-	/* DNA values follow, then footer (which is ignored) */
+struct ednahead { // Edna header
+	// This header starts at byte offset 177 in the .ASG file.
+	char id[9];   // signature
+	uint16 revision; // EDNA revision, here 2 (1=dna256)
+	Common::String game; // Long name, eg Lord Avalot D'Argent
+	Common::String shortname; // Short name, eg Avalot
+	uint16 number; // Game's code number, here 2
+	uint16 ver; // Version number as int16 (eg 1.00 = 100)
+	Common::String verstr; // Vernum as Common::String (eg 1.00 = "1.00")
+	Common::String filename; // Filename, eg AVALOT.EXE
+	byte osbyte; // Saving OS (here 1=DOS. See below for others.
+	Common::String os; // Saving OS in text format.
+
+	// Info on this particular game
+
+	Common::String fn; // Filename (not extension ('cos that's .ASG))
+	byte d, m; // D, M, Y are the Day, Month & Year this game was...
+	uint16 y;  // ...saved on.
+	Common::String desc; // Description of game (same as in Avaricius!)
+	uint16 len; // Length of DNA (it's not going to be above 65535!)
+
+	// Quick reference & miscellaneous
+
+	uint16 saves; // no. of times this game has been saved
+	int16 cash; // contents of your wallet in numerical form
+	Common::String money; // ditto in Common::String form (eg 5/-, or 1 denarius)
+	uint16 points; // your score
+
+	// DNA values follow, then footer (which is ignored)
 };
 
 class Gyro {
@@ -281,10 +280,10 @@ public:
 	static const char *vernum;
 	static const char *copyright;
 	static const int16 thisvercode = 130;
-	/* as "vernum", but numerically & without the ".". */
-	static const int16 thisgamecode = 2; /* Avalot's code number */
+	// as "vernum", but numerically & without the ".".
+	static const int16 thisgamecode = 2; // Avalot's code number
 
-	/* Objects you can hold: */
+	// Objects you can hold:
 	static const char wine = 1;
 	static const char money = 2;
 	static const char bodkin = 3;
@@ -304,9 +303,9 @@ public:
 	static const char habit = 17;
 	static const char onion = 18;
 
-	/* People who hang around this game. */
+	// People who hang around this game.
 
-	/* Boys: */
+	// Boys:
 	static const uint16 pavalot = 150;
 	static const uint16 pspludwick = 151;
 	static const uint16 pcrapulus = 152;
@@ -325,13 +324,13 @@ public:
 	static const uint16 pspurge = 165;
 	static const uint16 pjacques = 166;
 
-	/* Girls: */
+	// Girls:
 	static const uint16 parkata = 175;
 	static const uint16 pgeida = 176;
 	static const uint16 pwisewoman = 178;
 
 	static const int16 xw = 30;
-	static const int16 yw = 36; /* x width & y whatsit */
+	static const int16 yw = 36; // x width & y whatsit
 
 	static const int16 margin = 5;
 
@@ -345,28 +344,28 @@ public:
 
 	static const char lasschar[];
 
-	static const int16 numtr = 2; /* current max no. of sprites */
+	static const int16 numtr = 2; // current max no. of sprites
 
 	static const bool a_thing = true;
-	static const bool a_person = false; /* for Thinkabout */
+	static const bool a_person = false; // for Thinkabout
 
-	/* Magic/portal commands are */
+	// Magic/portal commands are
 
-	/*N*/ static const int16 nix = 0; /* ignore it if this line is touched */
-	/*B*/ static const int16 bounces = 1; /* bounce off this line. Not valid for portals. */
-	/*E*/ static const int16 exclaim = 2; /* put up a chain of scrolls */
-	/*T*/ static const int16 transport = 3; /* enter new room */
-	/*U*/ static const int16 unfinished = 4; /* unfinished connection */
-	/*S*/ static const int16 special = 5; /* special function. */
-	/*O*/ static const int16 mopendoor = 6; /* opening door. */
+	/*N*/ static const int16 nix = 0; // ignore it if this line is touched
+	/*B*/ static const int16 bounces = 1; // bounce off this line. Not valid for portals.
+	/*E*/ static const int16 exclaim = 2; // put up a chain of scrolls
+	/*T*/ static const int16 transport = 3; // enter new room
+	/*U*/ static const int16 unfinished = 4; // unfinished connection
+	/*S*/ static const int16 special = 5; // special function.
+	/*O*/ static const int16 mopendoor = 6; // opening door.
 
-	/* These following static constants should be included in CFG when it's written. */
+	// These following static constants should be included in CFG when it's written.
 
-	static const bool slow_computer = false; /* stops walking when mouse touches toolbar */
+	static const bool slow_computer = false; // stops walking when mouse touches toolbar
 
 	/* --- */
 
-	static const int16 border = 1; /* size of border on shadowboxes */
+	static const int16 border = 1; // size of border on shadowboxes
 
 	static const int32 pagetop = 81920;
 
@@ -383,7 +382,7 @@ public:
 	static const int16 walk = 3;
 	static const int16 run = 5;
 
-	/* Art gallery at 2,1; notice about this at 2,2. */
+	// Art gallery at 2,1; notice about this at 2,2.
 
 	static const int32 catamap[8][8];
 
@@ -423,7 +422,7 @@ public:
 		7     = wall with door and candles,
 		F     = straight-through corridor. */
 
-	static const bool demo = false; /* If this is true, we're in a demo of the game. */
+	static const bool demo = false; // If this is true, we're in a demo of the game.
 
 	static const char spludwick_order[3];
 	 
@@ -438,7 +437,7 @@ public:
 
 	static const tunetype tune;
 
-	/* special run-time errors */
+	// special run-time errors
 
 	static const int16 runerr_getset_overflow = 50;
 
@@ -455,28 +454,28 @@ public:
 	static byte whereis[29];
 
 	bool oncandopageswap; 
-	/* Variable static constant for overriding the ability of On to switch pages.
-		* You may know better than On which page to switch to. */
+	// Variable static constant for overriding the ability of On to switch pages.
+	// You may know better than On which page to switch to.
 
 
 
-	/* previous:^previoustype;*/
+	// previous:^previoustype;
 	dnatype dna;
 	byte lineNum; // Number of lines.
-	linetype lines[50]; /* For Also. */
+	linetype lines[50]; // For Also.
 	int16 c;
 	//registers r; // http://www.freepascal.org/docs-html/rtl/dos/registers.html
 	enum { m_no , m_yes , m_virtual } visible;
 	bool dropsok, screturn, soundfx, cheat;
-	uint16 mx, my; /* mouse x & y now */
-	uint16 mpx, mpy; /* mouse x & y when pressed */
-	uint16 mrx, mry; /* mouse x & y when released */
-	byte mpress, mrelease; /* times left mouse button has been pressed/released */
-	byte keystatus; /* Mouse key status */
+	uint16 mx, my; // mouse x & y now
+	uint16 mpx, mpy; // mouse x & y when pressed
+	uint16 mrx, mry; // mouse x & y when released
+	byte mpress, mrelease; // times left mouse button has been pressed/released
+	byte keystatus; // Mouse key status
 	Common::String un[10];
 	byte unn;
 	Common::String mousetext;
-	/* which:array[0..5] of byte;*/
+	// which:array[0..5] of byte;
 	void *p;
 	bool weirdword;
 	byte to_do;
@@ -486,8 +485,8 @@ public:
 	byte thinks;
 	bool thinkthing;
 
-	/* pp:array[1..1000] of postype;
-	bb:array[1..9000] of byte;*/
+	// pp:array[1..1000] of postype;
+	// bb:array[1..9000] of byte;
 	uint16 pptr, bptr;
 	int16 ppos[1][2];
 	uint16 pozzes[24];
@@ -495,7 +494,7 @@ public:
 	void *copier;
 	int16 talkx, talky;
 	byte talkb, talkf;
-	byte scrollbells; /* no. of times to ring the bell */
+	byte scrollbells; // no. of times to ring the bell
 	bool ontoolbar, seescroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 
 	char objlist[10];
@@ -506,8 +505,8 @@ public:
 
 	byte oldrw;
 	int8 lastscore[3];
-	byte cmp; /* current mouse-void **/
-	Common::String verbstr; /* what you can do with your object. :-) */
+	byte cmp; // current mouse-void
+	Common::String verbstr; // what you can do with your object. :-)
 
 	Common::String *also[31][2];
 	pedtype peds[15];
@@ -520,7 +519,7 @@ public:
 
 	uint16 oh, onh, om, hour, minutes, seconds;
 
-	Common::String atkey; /* For XTs, set to "alt-". For ATs, set to "f1". */
+	Common::String atkey; // For XTs, set to "alt-". For ATs, set to "f1".
 
 	byte cp, ledstatus, defaultled;
 	fontType characters;
@@ -528,59 +527,58 @@ public:
 	byte buffer[2000];
 	uint16 bufsize;
 
-	byte oldjw; /* Old joystick-way */
+	byte oldjw; // Old joystick-way
 	controllers ctrl;
 
-	int16 underscroll; /* Y-coord of just under the scroll text. */
+	int16 underscroll; // Y-coord of just under the scroll text.
 
-	/* TSkellern is only temporary, and I'll replace it
-	with a local version when it's all fixed up. */
+	// TSkellern is only temporary, and I'll replace it
+	// with a local version when it's all fixed up.
 
-	/* tskellern:int32 absolute $0:244; { Over int $61 }*/
+	// tskellern:int32 absolute $0:244; { Over int $61 }
 
-	bool ddmnow; /* Kludge so we don't have to keep referring to Dropdown */
-	Common::String roomname; /* Name of this room */
+	bool ddmnow; // Kludge so we don't have to keep referring to Dropdown
+	Common::String roomname; // Name of this room
 
 	//text logfile; // http://wiki.freepascal.org/Text
 	bool log_epson;
 
 	bool cl_override;
 
-	byte locks; /*ABSOLUTE $40:$17;*/
+	byte locks; // ABSOLUTE $40:$17;
 
-	Common::String subject; /* What you're talking to them about. */
-	byte subjnumber; /* The same thing. */
+	Common::String subject; // What you're talking to them about.
+	byte subjnumber; // The same thing.
 
-	bool keyboardclick; /* Is a keyboard click noise wanted? */
+	bool keyboardclick; // Is a keyboard click noise wanted?
 
 	byte him, her, it;
-	int32 roomtime; /* Set to 0 when you enter a room, added to in every loop.*/
+	int32 roomtime; // Set to 0 when you enter a room, added to in every loop.
 
 	bool after_the_scroll;
 
-	/* For the demo: */
+	// For the demo:
 	demo_type demo_rec;
 	Common::File demofile; // of demo_type
 	Common::DumpFile demofile_save; // uruk added it - first use located in constructor of Basher
 
-	byte last_person; /* Last person to have been selected using the People
-						menu. */
+	byte last_person; // Last person to have been selected using the People menu.
 
-	bool doing_sprite_run; /* Only set to True if we're doing a sprite_run
-	at this moment. This stops the trippancy system from moving any of the
-	sprites. */
+	bool doing_sprite_run; // Only set to True if we're doing a sprite_run
+						   // at this moment. This stops the trippancy system
+						   // from moving any of the sprites.
 
 	vmctype vmc;
 	Common::String filetoload;
 
-	bool holdthedawn; /* If this is true, calling Dawn will do nothing.
-	It's used, for example, at the start, to stop Load from dawning. */
+	bool holdthedawn; // If this is true, calling Dawn will do nothing.
+					  // It's used, for example, at the start, to stop Load from dawning.
 
-	uint16 storage_seg, storage_ofs; /* Seg and ofs of the Storage area. */
-	uint16 skellern; /* Offset of the timer variable - 1 more than storage_OFS */
+	uint16 storage_seg, storage_ofs; // Seg and ofs of the Storage area.
+	uint16 skellern; // Offset of the timer variable - 1 more than storage_OFS
 	bool isLoaded; // Is it a loaded gamestate?
 
-	bool super_was_virtual, super_was_off; /* Used by Super_Off and Super_On */
+	bool super_was_virtual, super_was_off; // Used by Super_Off and Super_On
 
 	Common::String enid_filename;
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c5c8062..20e83e5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -60,10 +60,12 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 void Lucerna::init() {
 	_vm->_gyro->oh = 17717;
 	_vm->_gyro->om = 17717;
-	/*if (_vm->_enhanced->atbios)
+#if 0
+	if (_vm->_enhanced->atbios)
 		_vm->_gyro->atkey = "f1";
 	else
-		_vm->_gyro->atkey = "alt-";*/
+		_vm->_gyro->atkey = "alt-";
+#endif
 }
 	
 void Lucerna::callverb(byte n) {
@@ -210,7 +212,7 @@ void Lucerna::load_also(Common::String n) {
 		*_vm->_gyro->also[fv][0] = Common::String(',') + *_vm->_gyro->also[fv][0] + ',';
 }
 
-void Lucerna::load(byte n) {     /* Load2, actually */
+void Lucerna::load(byte n) {     // Load2, actually
 	Common::String xx;
 	
 	CursorMan.showMouse(false);
@@ -233,7 +235,7 @@ void Lucerna::load(byte n) {     /* Load2, actually */
 		if ((32 <= actChar) && (actChar <= 126))
 			_vm->_gyro->roomname += actChar;
 	}
-	/* Compression method byte follows this... */
+	// Compression method byte follows this...
 
 	f.seek(177);
 
@@ -270,17 +272,17 @@ void Lucerna::find_people(byte room) {
 void Lucerna::exitroom(byte x) {
 	//nosound();
 	_vm->_celer->forgetBackgroundSprites();
-	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
+	_vm->_gyro->seescroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
 	case r__spludwicks:
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_avariciustalks);
 		 _vm->_gyro->dna.avaricius_talk = 0;
-		/* He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. */       
+		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
 		if (_vm->_gyro->dna.drawbridge_open > 0) {
-			_vm->_gyro->dna.drawbridge_open = 4; /* Fully open. */
+			_vm->_gyro->dna.drawbridge_open = 4; // Fully open.
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_drawbridgefalls);
 		}
 		break;
@@ -292,24 +294,24 @@ void Lucerna::exitroom(byte x) {
 		break;
 	}
 
-	_vm->_gyro->interrogation = 0; /* Leaving the room cancels all the questions automatically. */
+	_vm->_gyro->interrogation = 0; // Leaving the room cancels all the questions automatically.
 
-	_vm->_gyro->seescroll = false; /* Now it can work again! */
+	_vm->_gyro->seescroll = false; // Now it can work again!
 
 	_vm->_gyro->dna.last_room = _vm->_gyro->dna.room;
 	if (_vm->_gyro->dna.room != r__map)
 		_vm->_gyro->dna.last_room_not_map = _vm->_gyro->dna.room;
 }
 
-void Lucerna::new_town() {   /* You've just entered a town from the map. */
+void Lucerna::new_town() {   // You've just entered a town from the map.
 	_vm->_dropdown->setupMenu();
 
 	switch (_vm->_gyro->dna.room) {
-	case r__outsidenottspub: /* Entry into Nottingham. */
+	case r__outsidenottspub: // Entry into Nottingham.
 		if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (!_vm->_gyro->dna.taken_mushroom))
 			_vm->_gyro->dna.mushroom_growing = true;
 		break;
-	case r__wisewomans: { /* Entry into Argent. */
+	case r__wisewomans: { // Entry into Argent.
 		if (_vm->_gyro->dna.talked_to_crapulus && (! _vm->_gyro->dna.lustie_is_asleep)) {
 			_vm->_gyro->dna.spludwicks_here = !((_vm->_gyro->dna.rooms[r__wisewomans] % 3) == 1);
 			_vm->_gyro->dna.crapulus_will_tell = ! _vm->_gyro->dna.spludwicks_here;
@@ -318,14 +320,14 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 			_vm->_gyro->dna.crapulus_will_tell = false;
 		}
 		if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine)
-			_vm->_gyro->dna.winestate = 3; /* Vinegar */
+			_vm->_gyro->dna.winestate = 3; // Vinegar
 	}
 	break;
 	}
 
 	if (_vm->_gyro->dna.room != r__outsideducks) {
 		if ((_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]) && !(_vm->_gyro->dna.onion_in_vinegar))
-			_vm->_gyro->dna.rotten_onion = true; /* You're holding the onion */
+			_vm->_gyro->dna.rotten_onion = true; // You're holding the onion
 	}
 }
 
@@ -334,14 +336,14 @@ void Lucerna::new_town() {   /* You've just entered a town from the map. */
 void Lucerna::put_geida_at(byte whichped, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_trip->tr[1].init(5, false, _vm->_trip); /* load Geida */
+	_vm->_trip->tr[1].init(5, false, _vm->_trip); // load Geida
 	_vm->_trip->apped(2, whichped);
 	_vm->_trip->tr[1].call_eachstep = true;
 	_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
 }
 
 void Lucerna::enterroom(byte x, byte ped) {
-	_vm->_gyro->seescroll = true;  /* This stops the trippancy system working over the length of this procedure. */
+	_vm->_gyro->seescroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	find_people(x);
 	_vm->_gyro->dna.room = x;
@@ -379,18 +381,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
 				_vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__outsideyours;
-				_vm->_trip->tr[1].init(8, false, _vm->_trip); /* load Crapulus */
+				_vm->_trip->tr[1].init(8, false, _vm->_trip); // load Crapulus
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
-					_vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
-					_vm->_trip->tr[1].walkto(5); /* Walks up to greet you. */
+					_vm->_trip->apped(2, 4); // Start on the right-hand side of the screen.
+					_vm->_trip->tr[1].walkto(5); // Walks up to greet you.
 				} else {
-					_vm->_trip->apped(2, 5); /* Starts where he was before. */
+					_vm->_trip->apped(2, 5); // Starts where he was before.
 					_vm->_trip->tr[1].face = 3;
 				}
 
 				_vm->_trip->tr[1].call_eachstep = true;
-				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
+				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // He always faces Avvy.
 
 			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__nowhere;
 
@@ -414,12 +416,12 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__spludwicks:
 		if (_vm->_gyro->dna.spludwicks_here) {
 			if (ped > 0) {
-				_vm->_trip->tr[1].init(2, false, _vm->_trip); /* load Spludwick */
+				_vm->_trip->tr[1].init(2, false, _vm->_trip); // load Spludwick
 				_vm->_trip->apped(2, 2);
 				_vm->_gyro->whereis[1] = r__spludwicks;
 			}
 
-			_vm->_gyro->dna.dogfoodpos = 0;  /* _vm->_gyro->also Spludwick pos. */
+			_vm->_gyro->dna.dogfoodpos = 0;  // _vm->_gyro->also Spludwick pos.
 
 			_vm->_trip->tr[1].call_eachstep = true;
 			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
@@ -435,17 +437,17 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot*/
+				_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
 				_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__brummieroad;
 
-				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
-					_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
-					_vm->_trip->tr[1].walkto(4); /* ...and he walks up... */
+				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { // First time here...
+					_vm->_trip->apped(2, 2); // He appears on the right of the screen...
+					_vm->_trip->tr[1].walkto(4); // ...and he walks up...
 				} else {
-					/* You've been here before. */
-					_vm->_trip->apped(2, 4); /* He's standing in your way straight away... */
+					// You've been here before.
+					_vm->_trip->apped(2, 4); // He's standing in your way straight away...
 					_vm->_trip->tr[1].face = _vm->_trip->left;
 				}
 			}
@@ -456,32 +458,32 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__argentroad: {
 		if ((_vm->_gyro->dna.cwytalot_gone) && (! _vm->_gyro->dna.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
-			_vm->_trip->tr[1].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
+			_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot again
 			_vm->_trip->apped(2, 1);
 			_vm->_trip->tr[1].walkto(2);
 			_vm->_trip->tr[1].vanishifstill = true;
 			_vm->_gyro->dna.cwytalot_in_herts = true;
-			/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
+			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
 		}
 	}
 	break;
 
 	case r__bridge: {
-		if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3); /* Position of drawbridge */
+		if (_vm->_gyro->dna.drawbridge_open == 4) { // open
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
+			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->dna.geida_follows)
-			put_geida_at(ped + 3, ped); /* load Geida */
+			put_geida_at(ped + 3, ped); // load Geida
 	}
 	break;
 
 	case r__robins: {
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.been_tied_up) {
-				/* A welcome party... or maybe not... */
+				// A welcome party... or maybe not...
 				_vm->_trip->tr[1].init(6, false, _vm->_trip);
 				_vm->_trip->apped(2, 2);
 				_vm->_trip->tr[1].walkto(3);
@@ -506,7 +508,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__outsidecardiffcastle: {
 		if (ped > 0)
 			switch (_vm->_gyro->dna.cardiff_things) {
-			case 0 : { /* You've answered NONE of his questions. */
+			case 0 : { // You've answered NONE of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
 				_vm->_trip->apped(2, 2);
 				_vm->_trip->tr[1].walkto(3);
@@ -515,8 +517,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			break;
 			case 5 :
 				_vm->_gyro->magics[1].op = _vm->_gyro->nix;
-				break; /* You've answered ALL his questions. => nothing happens. */
-			default: { /* You've answered SOME of his questions. */
+				break; // You've answered ALL his questions. => nothing happens.
+			default: { // You've answered SOME of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
 				_vm->_trip->apped(2, 3);
 				_vm->_trip->tr[1].face = _vm->_trip->right;
@@ -530,7 +532,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__map: {
-		/* You're entering the map. */
+		// You're entering the map.
 		dawn();
 		//setactivepage(cp);
 		if (ped > 0)
@@ -539,7 +541,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		{
 			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) {
-				_vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */
+				_vm->_visa->dixi('q', 9); // Don't want to waste the wine!
 				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
 				objectlist();
 			}
@@ -579,8 +581,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__argentpub: {
 		if (_vm->_gyro->dna.wonnim)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   /* No lute by the settle. */
-		_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
+		_vm->_gyro->dna.malagauche = 0; // Ready to boot Malagauche
 		if (_vm->_gyro->dna.givenbadgetoiby) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
@@ -590,11 +592,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 	break;
 
 	case r__lustiesroom: {
-		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
-		if (_vm->_trip->tr[0].whichsprite == 0) /* Avvy in his normal clothes */
+		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
+		if (_vm->_trip->tr[0].whichsprite == 0) // Avvy in his normal clothes
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
-		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
-			/* Presumably, Avvy dressed as a monk. */
+		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) // already
+			// Presumably, Avvy dressed as a monk.
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
 		if (_vm->_gyro->dna.geida_follows) {
@@ -653,21 +655,21 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__wisewomans: {
 		_vm->_trip->tr[1].init(11, false, _vm->_trip);
 		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_trip->apped(2, 2); /* Start on the right-hand side of the screen. */
-			_vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
+			_vm->_trip->apped(2, 2); // Start on the right-hand side of the screen.
+			_vm->_trip->tr[1].walkto(4); // Walks up to greet you.
 		} else {
-			_vm->_trip->apped(2, 4); /* Starts where she was before. */
+			_vm->_trip->apped(2, 4); // Starts where she was before.
 			_vm->_trip->tr[1].face = 3;
 		}
 
 		_vm->_trip->tr[1].call_eachstep = true;
-		_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; /* She always faces Avvy. */
+		_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // She always faces Avvy.
 	}
 	break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
-			_vm->_trip->tr[1].init(10, false, _vm->_trip); /* Define the dart. */
+			_vm->_trip->tr[1].init(10, false, _vm->_trip); // Define the dart.
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
@@ -705,11 +707,13 @@ void Lucerna::enterroom(byte x, byte ped) {
 	case r__insideabbey:
 	case r__yourhall:
 		if (ped == 2)  {
-			/* It was the original:
+#if 0
+			// It was the original:
 			_vm->_celer->show_one(-1, -1, 2);
 			_vm->_sequence->first_show(1);
 			_vm->_sequence->then_show(3);
-			_vm->_sequence->start_to_close();*/
+			_vm->_sequence->start_to_close();
+#endif
 
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
@@ -724,11 +728,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.ayles_is_awake)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
-		break; /* Ayles awake. */
+		break; // Ayles awake.
 
 	case r__geidas:
 		put_geida_at(2, ped);
-		break; /* load Geida */
+		break; // load Geida
 
 	case r__easthall:
 	case r__westhall:
@@ -743,13 +747,13 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__nottspub: {
 		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
+		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
 	}
 	break;
 
 	case r__outsideducks:
 		if (ped == 2) {
-			/* Shut the door */
+			// Shut the door
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(3);
@@ -762,16 +766,16 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__ducks:
 		_vm->_gyro->dna.dogfoodpos = 1;
-		break; /* Actually, Duck pos. */
+		break; // Actually, Duck pos.
 	}
 
-	_vm->_gyro->seescroll = false; /* Now it can work again! */
+	_vm->_gyro->seescroll = false; // Now it can work again!
 
 	if (_vm->_gyro->isLoaded)
 		_vm->_gyro->isLoaded = false;
 }
 
-void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! */
+void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 	const int16 picsize = 966;
 	const bytefield thinkspace = {25, 170, 32, 200};
 
@@ -795,7 +799,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 		if (z >= 25)
 			z -= 8;
 		if (z == 20) 
-			z--; /* Last time... */
+			z--; // Last time...
 
 	}
 
@@ -811,9 +815,11 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 
 	CursorMan.showMouse(false);
 
-	/*setactivepage(3);
+#if 0
+	setactivepage(3);
 	putimage(x, y, p, 0);
-	setactivepage(1 - cp);*/
+	setactivepage(1 - cp);
+#endif
 
 	for (byte fv = 0; fv <= 1; fv++)
 		_vm->_trip->getset[fv].remember(thinkspace);
@@ -822,7 +828,7 @@ void Lucerna::thinkabout(byte z, bool th) {     /* Hey!!! Get it and put it!!! *
 	_vm->_gyro->thinkthing = th;
 }
 
-void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
+void Lucerna::load_digits() {   // Load the scoring digits & rwlites
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
@@ -833,15 +839,23 @@ void Lucerna::load_digits() {   /* Load the scoring digits & rwlites */
 
 	for (byte fv = 0; fv < 10; fv++) {
 		f.seek(fv * digitsize);
-		/*_vm->_gyro->digit[fv] = new byte[digitsize];
-		f.read(_vm->_gyro->digit[fv], digitsize);*/
+		
+#if 0
+		_vm->_gyro->digit[fv] = new byte[digitsize];
+		f.read(_vm->_gyro->digit[fv], digitsize);
+#endif
+
 		_vm->_gyro->digit[fv] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
 	for (byte ff = 0; ff < 9; ff++) {
 		f.seek(10 * digitsize + ff * rwlitesize);
-		/*_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
-		f.read(_vm->_gyro->rwlite[ff], rwlitesize);*/
+		
+#if 0
+		_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
+		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
+#endif
+
 		_vm->_gyro->rwlite[ff] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
@@ -856,7 +870,7 @@ void Lucerna::toolbar() {
 
 	f.seek(40);
 	
-	/* off;*/
+	// off;
 
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
@@ -866,7 +880,7 @@ void Lucerna::toolbar() {
 
 	f.close();
 
-	/* on;*/
+	// on;
 
 	_vm->_gyro->oldrw = 177;
 	showrw();
@@ -908,13 +922,17 @@ void Lucerna::showscore() {
 		_vm->_gyro->lastscore[i] = numbers[i];
 }
 
-void Lucerna::points(byte num) {     /* Add on no. of points */
+void Lucerna::points(byte num) {     // Add on no. of points
 	for (byte q = 1; q <= num; q++) {
 		_vm->_gyro->dna.score++;
-		/*if (soundfx)
+
+#if 0
+		if (soundfx) {
 			for (byte fv = 1; fv <= 97; fv++)
 				sound(177 + dna.score * 3);
-		nosound;*/
+		}
+		nosound;
+#endif
 	}
 	warning("STUB: Lucerna::points()");
 
@@ -975,7 +993,7 @@ void Lucerna::fxtoggle() {
 void Lucerna::objectlist() {
 	_vm->_gyro->dna.carrying = 0;
 	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks - 1])
-		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */
+		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); // you always have money
 	for (byte fv = 0; fv < numobjs; fv++)
 		if (_vm->_gyro->dna.obj[fv]) {
 			_vm->_gyro->dna.carrying++;
@@ -1133,7 +1151,7 @@ int8 Lucerna::fades(int8 x) {
 		b--;
 
 	return (16 * r + 4 * g + b);
-	/* fades:=x-1;*/
+	// fades = x - 1;
 }
 
 
@@ -1166,10 +1184,12 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
 	CursorMan.showMouse(false);
 	
-	/*	for (byte page_ = 0; page_ <= 1; page_++) {
-	setactivepage(page_);
-	putimage(0, 161, rwlite[with.rw], 0);
-	}*/
+#if 0
+	for (byte page_ = 0; page_ <= 1; page_++) {
+		setactivepage(page_);
+		putimage(0, 161, rwlite[with.rw], 0);
+	}
+#endif
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
 
@@ -1208,7 +1228,7 @@ void Lucerna::refresh_hands() {
 }
 
 void Lucerna::plothands() {
-	/*   off;*/
+	//   off;
 	//setactivepage(3);
 	calchand(_vm->_gyro->onh, 14, ah, yellow);
 	calchand(_vm->_gyro->om * 6, 17, am, yellow);
@@ -1224,7 +1244,7 @@ void Lucerna::plothands() {
 
 	refresh_hands();
 
-	/*   on;*/
+	//   on;
 }
 
 void Lucerna::chime() {
@@ -1232,7 +1252,7 @@ void Lucerna::chime() {
 }
 
 void Lucerna::clock_lucerna() {
-	/* ...Clock. */
+	// ...Clock.
 	TimeDate t;
 	_vm->_system->getTimeAndDate(t);
 	_vm->_gyro->hour = t.tm_hour;
@@ -1291,7 +1311,7 @@ void Lucerna::gameover() {
 void Lucerna::minor_redraw() {
 	dusk();
 
-	enterroom(_vm->_gyro->dna.room, 0); /* Ped unknown or non-existant. */
+	enterroom(_vm->_gyro->dna.room, 0); // Ped unknown or non-existant.
 
 	for (byte fv = 0; fv <= 1; fv++) {
 		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
@@ -1299,7 +1319,7 @@ void Lucerna::minor_redraw() {
 	}
 	
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro->lastscore[i] = -1; /* impossible digits */
+		_vm->_gyro->lastscore[i] = -1; // impossible digits
 	showscore();
 	
 	dawn();
@@ -1312,17 +1332,19 @@ void Lucerna::major_redraw() {
 uint16 Lucerna::bearing(byte whichped) {
 	whichped--; // Different array indexes in Pascal and C.
 
-	const double rad2deg = 180 / 3.14 /*Pi*/;
+	const double rad2deg = 180 / 3.14; // Pi
 		
 	if (_vm->_trip->tr[0].x == _vm->_gyro->peds[whichped].x)
 		return 0;
-	else 
-		if (_vm->_trip->tr[0].x < _vm->_gyro->peds[whichped].x)
+	else {
+		if (_vm->_trip->tr[0].x < _vm->_gyro->peds[whichped].x) {
 			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
 					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 90;
-		else
+		} else {
 			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
 					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 270;
+		}
+	}
 }
 
 void Lucerna::sprite_run() {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index f20b0d0..d3e1bec 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -60,15 +60,15 @@ public:
 
 	void enterroom(byte x, byte ped);
 
-	void thinkabout(byte z, bool th);      /* Hey!!! Get it and put it!!! */
+	void thinkabout(byte z, bool th);      // Hey!!! Get it and put it!!!
 
-	void load_digits();    /* Load the scoring digits & rwlites */
+	void load_digits();    // Load the scoring digits & rwlites
 
 	void toolbar();
 
 	void showscore();
 
-	void points(byte num);      /* Add on no. of points */
+	void points(byte num);      // Add on no. of points
 
 	void mouseway(const Common::Point &cursorPos);
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 6ccacc0..737bf87 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -44,9 +44,9 @@ void Parser::init() {
 void Parser::handleInputText(const Common::Event &event) {
 	byte inChar = event.kbd.ascii;
 	warning("STUB: Parser::handleInputText()");
-	/*if (_vm->_dropdown->_activeMenuItem._activeNow) {
-		_vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd);
-	} else {*/
+//	if (_vm->_dropdown->_activeMenuItem._activeNow) {
+//		_vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd);
+//	} else {
 		if (_inputText.size() < 76) {
 			if ((inChar == '"') || (inChar == '`')) {
 				if (_quote)
@@ -61,7 +61,7 @@ void Parser::handleInputText(const Common::Event &event) {
 			plotText();
 		} else
 			_vm->_gyro->blip();
-	//}
+//	}
 }
 
 void Parser::handleBackspace() {
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 777a1c7..cc9592b 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -49,7 +49,8 @@ void Pingo::dplot(int16 x, int16 y, Common::String z) {
 }
 
 void Pingo::bosskey() {
-/*const
+#if 0
+const
 	months : array[0..11] of char = 'JFMAMJJASOND';
 	title = 'Net Profits';
 	fish = #224; { à }
@@ -78,20 +79,21 @@ begin;
 	dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
 	while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
 	dusk; setvisualpage(0); setactivepage(0); mousepage(0); dawn;
-	copy02;*/
+	copy02;
+#endif
 
 	warning("STUB: Pingo::bosskey()");
 }
 
-void Pingo::copy02() {   /* taken from Wobble (below) */
+void Pingo::copy02() {   // taken from Wobble (below)
 	warning("STUB: Pingo::copy02()");
 }
 
-void Pingo::copy03() {   /* taken from Wobble (below) */
+void Pingo::copy03() {   // taken from Wobble (below)
 	warning("STUB: Pingo::copy03()");
 }
 
-void Pingo::copypage(byte frp, byte top) { /* taken from Copy02 (above) */
+void Pingo::copypage(byte frp, byte top) { // taken from Copy02 (above)
 	warning("STUB: Pingo::copypage()");
 }
 
@@ -116,13 +118,16 @@ void Pingo::winning_pic() {
 		return;
 	}
 
-	/*for (byte bit = 0; bit <= 3; bit++) {
+#if 0
+	for (byte bit = 0; bit <= 3; bit++) {
 	port[0x3c4] = 2;
 	port[0x3ce] = 4;
 	port[0x3c5] = 1 << bit;
 	port[0x3cf] = bit;
 	blockread(f, mem[0xa000 * 0], 16000);
-	}*/
+	}
+#endif
+
 	warning("STUB: Pingo::winning_pic()");
 
 	f.close();
@@ -132,12 +137,15 @@ void Pingo::winning_pic() {
 
 	_vm->_lucerna->dawn();
 
-	/*do {
+#if 0
+	do {
 		_vm->_gyro->check();
 	} while (!(keypressed() || (mrelease > 0)));
 	while (keypressed())
 		char r = readkey();
-	major_redraw();*/
+	major_redraw();
+#endif
+
 	warning("STUB: Pingo::winning_pic()");
 }
 
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index c16d983..910285c 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -62,7 +62,7 @@ public:
 
 
 
-	bool aboutscroll; /* Is this the about box? */
+	bool aboutscroll; // Is this the about box?
 
 
 
@@ -70,9 +70,9 @@ public:
 	
 	void init();
 
-	void state(byte x);      /* Sets "Ready" light to whatever */
+	void state(byte x);      // Sets "Ready" light to whatever
 
-	void drawscroll(func2 gotoit);      /* This is one of the oldest funcs in the game. */
+	void drawscroll(func2 gotoit);      // This is one of the oldest funcs in the game.
 
 	void bubble(func2 gotoit);
 
@@ -88,7 +88,7 @@ public:
 
 	Common::String lsd();
 
-	void okay();    /* Says "Okay!" */
+	void okay();    // Says "Okay!"
 
 	void musical_scroll();
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index d5983c8..3156466 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -44,11 +44,11 @@ Sequence::Sequence(AvalancheEngine *vm) {
 }
 
 void Sequence::first_show(byte what) {
-	/* First, we need to blank out the entire array. */
+	// First, we need to blank out the entire array.
 	for (uint i = 0; i < sizeof(seq); i++)
 		seq[i] = 0;
 
-	/* Then it's just the same as then_show. */
+	// Then it's just the same as then_show.
 	then_show(what);
 
 }
@@ -75,16 +75,16 @@ void Sequence::start_to_close() {
 }
 
 void Sequence::start_to_open() {
-	_vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */
-	_vm->_trip->stopwalking(); /* And they're not moving now. */
-	start_to_close(); /* Apart from that, it's the same thing. */
+	_vm->_gyro->dna.user_moves_avvy = false; // They can't move.
+	_vm->_trip->stopwalking(); // And they're not moving now.
+	start_to_close(); // Apart from that, it's the same thing.
 }
 
 
 
-/* This PROC is called by Timeout when it's time to do another frame. */
+// This PROC is called by Timeout when it's time to do another frame.
 void Sequence::shove_left() {
-	memcpy(seq, seq+1, seq_length - 1); /* Shift everything to the left. */
+	memcpy(seq, seq+1, seq_length - 1); // Shift everything to the left.
 }
 
 void Sequence::call_sequencer() {
@@ -101,12 +101,12 @@ void Sequence::call_sequencer() {
 	}
 
 	if ((seq[0] >= 1) && (seq[0] <= 176)) {
-		/* Show a frame. */
+		// Show a frame.
 		_vm->_celer->drawBackgroundSprite(-1, -1, seq[0]);
 		shove_left();
 	}
 	
-	start_to_close(); /* Make sure this PROC gets called again. */
+	start_to_close(); // Make sure this PROC gets called again.
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 7979a8d..3a2271a 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -345,7 +345,7 @@ void Timeout::after_the_shootemup() {
 	_vm->_trip->fliproom(_vm->_gyro->dna.room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
-	_vm->_trip->tr[0].init(0, true, _vm->_trip); /* Avalot. */
+	_vm->_trip->tr[0].init(0, true, _vm->_trip); // Avalot.
 	_vm->_trip->apped(1, 2);
 	_vm->_gyro->dna.user_moves_avvy = true;
 	_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = true;
@@ -355,19 +355,21 @@ void Timeout::after_the_shootemup() {
 	_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
 		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
 
-	//byte shootscore, gain;
+#if 0
+	byte shootscore, gain;
 
-	//shootscore = mem[storage_seg * storage_ofs];
-	//gain = (shootscore + 5) / 10; /* Rounding up. */
+	shootscore = mem[storage_seg * storage_ofs];
+	gain = (shootscore + 5) / 10; // Rounding up.
 
-	//display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
-	//	strf(shootscore) + " ö 10) = " + strf(gain) + " points.");
+	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
+		strf(shootscore) + " ö 10) = " + strf(gain) + " points.");
 
-	//if (gain > 20) {
-	//	display("But we won't let you have more than 20 points!");
-	//	points(20);
-	//} else
-	//	points(gain);
+	if (gain > 20) {
+		display("But we won't let you have more than 20 points!");
+		points(20);
+	} else
+		points(gain);
+#endif
 
 	warning("STUB: Timeout::after_the_shootemup()");
 
@@ -621,10 +623,12 @@ void Timeout::winning() {
 
 	_vm->_pingo->winning_pic();
 	warning("STUB: Timeout::winning()");
-	/*do {
-	_vm->_lucerna->checkclick();
-	} while (!(_vm->_gyro->mrelease == 0));*/
-	// To be implemented with Pingo::winning_pic().
+#if 0
+	do {
+		_vm->_lucerna->checkclick();
+	} while (!(_vm->_gyro->mrelease == 0));
+#endif	
+	// TODO: To be implemented with Pingo::winning_pic().
 
 	_vm->_lucerna->callverb(_vm->_acci->kVerbCodeScore);
 	_vm->_scrolls->display(" T H E    E N D ");
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 9ad2c30..2bac5a0 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -37,7 +37,7 @@ class AvalancheEngine;
 
 class Timeout {
 public:
-	/* reason_ now runs between 1 and 28. */
+	// reason_ now runs between 1 and 28.
 
 	static const int16 reason_drawbridgefalls = 2;
 	static const int16 reason_avariciustalks = 3;
@@ -47,7 +47,7 @@ public:
 	static const int16 reason_cardiffsurvey = 7;
 	static const int16 reason_cwytalot_in_herts = 8;
 	static const int16 reason_getting_tied_up = 9;
-	static const int16 reason_hanging_around = 10; /* Tied to the tree in Nottingham. */
+	static const int16 reason_hanging_around = 10; // Tied to the tree in Nottingham.
 	static const int16 reason_jacques_waking_up = 11;
 	static const int16 reason_naughty_duke = 12;
 	static const int16 reason_jumping = 13;
@@ -68,7 +68,7 @@ public:
 	static const int16 reason_spludwalk = 27;
 	static const int16 reason_geida_sings = 28;
 
-	/* procx now runs between 1 and 41. */
+	// procx now runs between 1 and 41.
 
 	static const int16 procopen_drawbridge = 3;
 	static const int16 procavaricius_talks = 4;
@@ -103,7 +103,7 @@ public:
 	static const int16 procrobin_hood_and_geida = 2;
 	static const int16 procrobin_hood_and_geida_talk = 30;
 	static const int16 procavalot_returns = 31;
-	static const int16 procavvy_sit_down = 33; /* In Nottingham. */
+	static const int16 procavvy_sit_down = 33; // In Nottingham.
 	static const int16 procghost_room_phew = 34;
 	static const int16 procarkata_shouts = 35;
 	static const int16 procwinning = 36;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 1f2b83d..1c5c6db 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -39,13 +39,13 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-struct adxtype { /* Second revision of ADX type */
-	Common::String name/*[13]*/; /* name of character */ // uruk: Note to self: TRAILING /0 !!! Real size: 12
-	Common::String comment/*[17]*/; /* comment */ // uruk: Same here, but 16.
-	byte num; /* number of pictures */
-	byte seq; /* how many in one stride */
-	byte fgc, bgc; /* foreground & background bubble colors */
-	byte accinum; /* the number according to Acci (1=Avvy, etc.) */
+struct adxtype { // Second revision of ADX type
+	Common::String name; // [13] name of character // uruk: Note to self: TRAILING /0 !!! Real size: 12
+	Common::String comment; // [17] comment // uruk: Same here, but 16.
+	byte num; // number of pictures
+	byte seq; // how many in one stride
+	byte fgc, bgc; // foreground & background bubble colors
+	byte accinum; // the number according to Acci (1=Avvy, etc.)
 };
 
 struct trip_saver_type {
@@ -76,41 +76,41 @@ class triptype {
 public:
 	SpriteInfo _info;
 
-	adxtype a; /* vital statistics */
+	adxtype a; // vital statistics
 	byte face, step;
-	int16 x, y; /* current xy coords */
-	int16 ox[2], oy[2];  /* last xy coords */
-	int8 ix, iy; /* amount to move sprite by, each step */
+	int16 x, y; // current xy coords
+	int16 ox[2], oy[2];  // last xy coords
+	int8 ix, iy; // amount to move sprite by, each step
 	byte whichsprite;
 	bool quick, visible, homing, check_me;
-	int16 hx, hy; /* homing x & y coords */
-	byte count; /* counts before changing step */
-	byte xs, ys; /* x & y speed */
-	byte totalnum; /* total number of sprites */
-	bool vanishifstill; /* Do we show this sprite if it's still? */
+	int16 hx, hy; // homing x & y coords
+	byte count; // counts before changing step
+	byte xs, ys; // x & y speed
+	byte totalnum; // total number of sprites
+	bool vanishifstill; // Do we show this sprite if it's still?
 
-	bool call_eachstep; /* Do we call the eachstep procedure? */
+	bool call_eachstep; // Do we call the eachstep procedure?
 	byte eachstep;
 
 	void init(byte spritenum, bool do_check, Trip *tr);
-	/* loads & sets up the sprite */
-	void original();    /* just sets Quick to false */
-	void andexor();    /* drops sprite onto screen */
-	void turn(byte whichway);      /* turns him round */
-	void appear(int16 wx, int16 wy, byte wf); /* switches him on */
-	void bounce();    /* bounces off walls. */
-	void walk();    /* prepares for andexor, etc. */
-	void walkto(byte pednum);      /* home in on a point */
-	void stophoming();    /* self-explanatory */
-	void homestep();    /* calculates ix & iy for one homing step */
-	void speed(int8 xx, int8 yy); /* sets ix & iy, non-homing, etc */
-	void stopwalk();    /* Stops the sprite from moving */
-	void chatter();    /* Sets up talk vars */
+	// loads & sets up the sprite
+	void original();    // just sets Quick to false
+	void andexor();    // drops sprite onto screen
+	void turn(byte whichway);      // turns him round
+	void appear(int16 wx, int16 wy, byte wf); // switches him on
+	void bounce();    // bounces off walls.
+	void walk();    // prepares for andexor, etc.
+	void walkto(byte pednum);      // home in on a point
+	void stophoming();    // self-explanatory
+	void homestep();    // calculates ix & iy for one homing step
+	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
+	void stopwalk();    // Stops the sprite from moving
+	void chatter();    // Sets up talk vars
 	void set_up_saver(trip_saver_type &v);
 	void unload_saver(trip_saver_type v);
 
-	void savedata(Common::File &f); /* Self-explanatory, */
-	void loaddata(Common::File &f);  /* really. */
+	void savedata(Common::File &f); // Self-explanatory,
+	void loaddata(Common::File &f);  // really.
 
 	void save_data_to_mem(uint16 &where);
 	void load_data_from_mem(uint16 &where);
@@ -160,7 +160,7 @@ public:
 	static const int16 ul = 7;
 	static const int16 stopped = 8;
 
-	static const int16 numtr = 5; /* current max no. of sprites */
+	static const int16 numtr = 5; // current max no. of sprites
 
 
 
@@ -190,7 +190,7 @@ public:
 
 	void call_special(uint16 which);
 
-	void open_the_door(byte whither, byte ped, byte magicnum); /* Handles slidey-open doors. */
+	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
 
 	void catamove(byte ped);
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 0c005fa..1de48fd 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -112,7 +112,7 @@ void Visa::speech(byte who, byte subject) {
 	uint16 idx_offset, sez_offset, next_idx_offset;
 
 	if (subject == 0) {
-		/* No subject. */
+		// No subject.
 
 		bubbling = true;
 		report_dixi_errors = false;
@@ -120,9 +120,9 @@ void Visa::speech(byte who, byte subject) {
 		bubbling = false;
 		report_dixi_errors = true;
 	} else {
-		/* Subject given. */
+		// Subject given.
 
-		went_ok = false; /* Assume that until we know otherwise. */
+		went_ok = false; // Assume that until we know otherwise.
 
 		if (!indexfile.open("converse.avd")) {
 			warning("AVALANCHE: Visa: File not found: converse.avd");


Commit: 31bd1369d977e626713baa095359e43b2f1518f7
    https://github.com/scummvm/scummvm/commit/31bd1369d977e626713baa095359e43b2f1518f7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T23:02:25-07:00

Commit Message:
AVALANCHE: Add some brackets to improve readability

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 386ce22..9bf400f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -517,10 +517,9 @@ void Acci::parse() {
 
 	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) 
 		_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
-	else {
-		if (!_unknown.empty())
-			_unknown.clear();
-	}
+	else if (!_unknown.empty())
+		_unknown.clear();
+
 	// Replace words' codes that mean the same.
 	replace(Common::String('\xFF'), 0); // zap noise words
 	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 5a893a6..0d578c7 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -145,40 +145,42 @@ void Scrolls::normscroll() {
 
 
 
-//	char r;
-//	bool oktoexit;
-//	do {
-//		do {
-//			_vm->_gyro->check(); // was "checkclick;"
-//
+#if 0
+	char r;
+	bool oktoexit;
+	do {
+		do {
+			_vm->_gyro->check(); // was "checkclick;"
+
 //#ifdef RECORD slowdown(); basher::count += 1; #endif
-//
-//			if (_vm->_gyro->demo) {
-//				if (_vm->_basher->demo_ready())
-//					break;
-//				if (_vm->_enhanced->keypressede())
-//					return;
-//			} else if (_vm->_enhanced->keypressede())
-//				break;
-//		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
-//
-//
-//		if (mrelease == 0) {
-//			inkey();
-//			if (aboutscroll) {
-//				move(e[2 - 1], e[1 - 1], 7);
-//				e[8 - 1] = inchar;
-//				if (egg == e)  easteregg();
-//			}
-//			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
-//			if (! oktoexit)  errorled();
-//		}
-//
-//	} while (!((oktoexit) || (mrelease > 0)));
-//
+
+			if (_vm->_gyro->demo) {
+				if (_vm->_basher->demo_ready())
+					break;
+				if (_vm->_enhanced->keypressede())
+					return;
+			} else if (_vm->_enhanced->keypressede())
+				break;
+		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
+
+
+		if (mrelease == 0) {
+			inkey();
+			if (aboutscroll) {
+				move(e[2 - 1], e[1 - 1], 7);
+				e[8 - 1] = inchar;
+				if (egg == e)  easteregg();
+			}
+			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
+			if (! oktoexit)  errorled();
+		}
+
+	} while (!((oktoexit) || (mrelease > 0)));
+
 //#ifdef RECORD record_one(); #endif
-//
-//	_vm->_gyro->screturn = r == '#'; // "back door"
+
+	_vm->_gyro->screturn = r == '#'; // "back door"
+#endif
 
 	state(0);
 	_vm->_gyro->seescroll = false;
@@ -647,18 +649,17 @@ void Scrolls::calldrivers() {
 
 	uint16 size = _vm->_gyro->bufsize;
 
-	for (fv = 0; fv < size; fv++)
+	for (fv = 0; fv < size; fv++) {
 		if (mouthnext) {
 			if (_vm->_gyro->buffer[fv] == kControlRegister)
 				param = 0;
-			else
-				if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
-					param = _vm->_gyro->buffer[fv] - 48;
-				else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
-					param = _vm->_gyro->buffer[fv] - 55;
+			else if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
+				param = _vm->_gyro->buffer[fv] - 48;
+			else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
+				param = _vm->_gyro->buffer[fv] - 55;
 
 			mouthnext = false;
-		} else
+		} else {
 			switch (_vm->_gyro->buffer[fv]) {
 			case kControlParagraph: {
 				if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
@@ -689,13 +690,13 @@ void Scrolls::calldrivers() {
 
 				if (param == 0)
 					natural();
-				else if ((1 <= param) && (param <= 9))
+				else if ((1 <= param) && (param <= 9)) {
 					if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
 						_vm->_lucerna->errorled();
 						natural();
 					} else
 						_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
-				else if ((10 <= param) && (param <= 36)) {
+				} else if ((10 <= param) && (param <= 36)) {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
@@ -802,6 +803,8 @@ void Scrolls::calldrivers() {
 				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += _vm->_gyro->buffer[fv];
 				}
 			}
+		}
+	}
 }
 
 void Scrolls::display(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ed8cd13..0c320dd 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -480,20 +480,23 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 		x1 = 0;
 	if (x2 > 639)
 		x2 = 639;
-	if (oy < y)
-		for (fv = x1; fv <= x2; fv++)
+	if (oy < y) {
+		for (fv = x1; fv <= x2; fv++) {
 			for (ff = oy + yl; ff <= y + yl; ff++) {
 				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a) 
 					a = c;
 			}
-	else
-		for (fv = x1; fv <= x2; fv++)
+		}
+	} else {
+		for (fv = x1; fv <= x2; fv++) {
 			for (ff = y + yl; ff <= oy + yl; ff++) {
 				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
 				if (c > a)
 					a = c;
 			}
+		}
+	}
 
 	//setactivepage(1 - cp);
 	return a;
@@ -1581,7 +1584,7 @@ void Trip::handleMoveKey(const Common::Event &event) {
 
 	if (_vm->_dropdown->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
-	else
+	else {
 		switch (event.kbd.keycode) {
 		case Common::KEYCODE_UP:
 			if (_vm->_gyro->dna.rw != up) {
@@ -1645,6 +1648,7 @@ void Trip::handleMoveKey(const Common::Event &event) {
 		default:
 			break;
 		}
+	}
 }
 
 


Commit: 8011d24ee20f6942a8b153849413002740f3ff78
    https://github.com/scummvm/scummvm/commit/8011d24ee20f6942a8b153849413002740f3ff78
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T23:07:59-07:00

Commit Message:
AVALANCHE: Fix warnings reported by GCC

Changed paths:
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 0d578c7..ba0a6c4 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -620,7 +620,6 @@ void Scrolls::solidify(byte n) {
 void Scrolls::calldrivers() {
 	uint16 fv;
 	byte nn;
-	char nnn;
 	bool mouthnext;
 	bool call_spriterun; // Only call sprite_run the FIRST time.
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
@@ -760,7 +759,7 @@ void Scrolls::calldrivers() {
 					break;
 				case 11:
 					nn = 1;
-					for (nnn = 0; nnn < numobjs; nnn++) {
+					for (byte nnn = 0; nnn < numobjs; nnn++) {
 						if (_vm->_gyro->dna.obj[nnn]) {
 							nn++;
 							display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 0c320dd..790619e 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1119,11 +1119,9 @@ void Trip::apped(byte trn, byte np) {
 	rwsp(trn, _vm->_gyro->peds[np].dir);
 }
 
-
-
 #if 0
    function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
-	begin { By De Morgan's law: }
+	begin // By De Morgan's law:
 	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
 	end;
 #endif


Commit: c0d9677979c6fdc6272a49957f617f282363078a
    https://github.com/scummvm/scummvm/commit/c0d9677979c6fdc6272a49957f617f282363078a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-04T23:11:27-07:00

Commit Message:
AVALANCHE: Fix one more GCC warning

Changed paths:
    engines/avalanche/dropdown2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 5f419d7..fefdaa1 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -336,13 +336,15 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 		ander = 170;
 
 	fontType font;
-	for (byte i = 0; i < text.size(); i++)
+	for (byte i = 0; i < text.size(); i++) {
 		for (byte j = 0; j < 8; j++) {
-			font[text[i]][j] = _vm->_gyro->characters[text[i]][j] & ander; // Set the font.
+			byte idx = text[i];
+			font[idx][j] = _vm->_gyro->characters[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
 			for (byte k = 0; k < 8; k++)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
 		}
+	}
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
 	


Commit: 0c47dc858af4fda4f01939f67f6bb4fc746db674
    https://github.com/scummvm/scummvm/commit/0c47dc858af4fda4f01939f67f6bb4fc746db674
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T01:51:47-07:00

Commit Message:
AVALANCHE: Fix GCC warning.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 5c95aca..0094fa5 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -371,7 +371,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 
 
 
-void Celer::drawSprite(int16 x, int16 y, const SpriteType &sprite) {
+void Celer::drawSprite(int16 x, int16 y, SpriteType &sprite) {
 	_r.x1 = x;
 	_r.y1 = y;
 	_r.y2 = y + sprite._yl;
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index a4cd0eb..090eda2 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -73,7 +73,7 @@ private:
 	Common::String _filename;
 	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
 
-	void drawSprite(int16 x, int16 y, const SpriteType &sprite);
+	void drawSprite(int16 x, int16 y, SpriteType &sprite);
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 92bffc2..0546ca5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -39,7 +39,7 @@
 
 namespace Avalanche {
 
-const byte Graphics::_egaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
+const byte Graphics::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
 
 
 
@@ -57,7 +57,7 @@ void Graphics::init() {
 	}
 
 	for (byte i = 0; i < 16; i++)
-		g_system->getPaletteManager()->setPalette(_egaPalette[_egaPaletteIndex[i]], i, 1);
+		g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[i]], i, 1);
 
 	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 
@@ -309,7 +309,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	return picture;
 }
 
-void Graphics::drawPicture(const ::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++)
 		for (uint16 x = 0; x < picture.w; x++)
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 4c812fb..ac9e8bf 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -115,7 +115,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 
-	void drawPicture(const ::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 
 	void refreshScreen();
 
@@ -124,7 +124,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	static const byte _egaPaletteIndex[16];
+	static const byte kEgaPaletteIndex[16];
 
 	byte _egaPalette[64][3];
 };


Commit: 9740287721420c0ac2951124f9bfc76b8807113e
    https://github.com/scummvm/scummvm/commit/9740287721420c0ac2951124f9bfc76b8807113e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T02:05:03-07:00

Commit Message:
AVALANCHE: Fix some memory leak problems.

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index fefdaa1..a578288 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -813,6 +813,8 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 
 		}
 	}
+
+	backup.free();
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index ba0a6c4..3994f56 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -142,6 +142,7 @@ void Scrolls::normscroll() {
 	}
 
 	_vm->_graphics->_surface.copyFrom(temp);
+	temp.free();
 
 
 


Commit: a698a2a2f93e420ded9a7714cd759360d689f486
    https://github.com/scummvm/scummvm/commit/a698a2a2f93e420ded9a7714cd759360d689f486
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T03:31:29-07:00

Commit Message:
AVALANCHE: Repair another bunch of memory leaks.

Changed paths:
    engines/avalanche/celer2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 0094fa5..5d7dacf 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -359,6 +359,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		}
 		drawSprite(destX, destY, sprite);
 
+		sprite._picture.free();
 		f.close();
 	}
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 20e83e5..f225d02 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -57,6 +57,12 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 	_vm = vm;
 }
 
+Lucerna::~Lucerna() {
+	for (byte i = 0; i < 31; i++) 
+		for (byte j = 0; j < 2; j++)
+			delete _vm->_gyro->also[i][j];
+}
+
 void Lucerna::init() {
 	_vm->_gyro->oh = 17717;
 	_vm->_gyro->om = 17717;
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index d3e1bec..8e5897f 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -44,6 +44,8 @@ public:
 
 	Lucerna(AvalancheEngine *vm);
 
+	~Lucerna();
+
 	void init();
 
 	void callverb(byte n);


Commit: ce95f738be9bc4cdc1a32f538e7cfdd893d24e47
    https://github.com/scummvm/scummvm/commit/ce95f738be9bc4cdc1a32f538e7cfdd893d24e47
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T03:59:01-07:00

Commit Message:
AVALANCHE: Do renaming in Enid. (Keep the refactoring for the implementation of it.)

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 9bf400f..520b2a8 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1246,7 +1246,7 @@ void Acci::giveGeidaTheLute() {
 	_vm->_visa->dixi('q', 64); // She plays it.
 
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
-	_vm->_enid->back_to_bootstrap(4);
+	_vm->_enid->backToBootstrap(4);
 }
 
 void Acci::playHarp() {
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index a578288..282f2f8 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -221,8 +221,6 @@ void MenuItem::parseKey(char c) {
 		_dr->_vm->_gyro->blip();
 }
 
-
-
 void MenuBar::init(Dropdown *dr) {
 	_dr = dr;
 	_menuNum = 0;
@@ -282,8 +280,6 @@ void MenuBar::chooseMenuItem(int16 x) {
 	} while (i < _menuNum);
 }
 
-
-
 Dropdown::Dropdown(AvalancheEngine *vm) {
 	_vm = vm;
 	_activeMenuItem.init(this);
@@ -599,7 +595,7 @@ void Dropdown::runMenuFile() {
 		warning("STUB: Dropdown::runMenuFile()");
 		break;
 	case 4:
-		_vm->_enid->back_to_bootstrap(2);
+		_vm->_enid->backToBootstrap(2);
 		break;
 	case 5:
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeQuit);
@@ -710,8 +706,6 @@ void Dropdown::runMenuWith() {
 	_vm->_lucerna->callverb(_vm->_gyro->verbstr[_activeMenuItem._choiceNum]);
 }
 
-
-
 void Dropdown::setupMenu() {   
 	_menuBar.init(this);
 	_activeMenuItem.init(this);
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 8912e60..ad9dc77 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -42,12 +42,8 @@ class AvalancheEngine;
 
 class Dropdown;
 
-
-
 typedef void (Dropdown::*DropdownFunc)();
 
-
-
 class HeadType {
 public:
 	Common::String _title;
@@ -65,8 +61,6 @@ private:
 	Dropdown *_dr;
 };
 
-
-
 struct OptionType {
 	Common::String _title;
 	byte _trigger;
@@ -74,8 +68,6 @@ struct OptionType {
 	bool _valid;
 };
 
-
-
 class MenuItem {
 public:
 	OptionType _options[12];
@@ -104,8 +96,6 @@ private:
 	Dropdown *_dr;
 };
 
-
-
 class MenuBar {
 public:
 	HeadType _menuItems[8];
@@ -122,8 +112,6 @@ private:
 	Dropdown *_dr;
 };
 
-
-
 class Dropdown {
 public:
 	friend class HeadType;
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 4477fe7..e6b7bc3 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -39,53 +39,49 @@
 
 #include "common/textconsole.h"
 
-//#include "fileunit.h"
-//#include "basher.h"
-
-
 namespace Avalanche {
 
 Enid::Enid(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-const Common::String Enid::crlf = Common::String(char(15)) + Common::String(char(12));
-const char Enid::tab = '\t';
-const char Enid::eof_ = '\n';
+const Common::String Enid::kCrlf = Common::String(char(15)) + Common::String(char(12));
+const char Enid::kTab = '\t';
+const char Enid::kEof = '\n';
 
-const Common::String Enid::ednafirst =
+const Common::String Enid::kEdnaFirst =
 	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + // 64
-	crlf + eof_ + crlf + crlf + // 7
-	tab + "Glory to God in the highest," + crlf + // 31
-	tab + "and on earth peace, goodwill toward men." + // 42
-	crlf + tab + tab + tab + tab + // 6
+	kCrlf + kEof + kCrlf + kCrlf + // 7
+	kTab + "Glory to God in the highest," + kCrlf + // 31
+	kTab + "and on earth peace, goodwill toward men." + // 42
+	kCrlf + kTab + kTab + kTab + kTab + // 6
 	"Luke 2:14." + // 10
-	crlf + crlf + crlf + // 6
-	"1234567890" +crlf; // 11
+	kCrlf + kCrlf + kCrlf + // 6
+	"1234567890" +kCrlf; // 11
 
-const Common::String Enid::ednaid = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
+const Common::String Enid::kEdnaId = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
 
-const int16 Enid::ttage = 18;
-const Common::String Enid::ttwashere = "Thomas was here ";
+const int16 Enid::kAge = 18;
+const Common::String Enid::kWasHere = "Thomas was here ";
 
-const Enid::fourtype Enid::avaricius_file = "Avvy";
+const Enid::FourType Enid::kAvariciusFile = "Avvy";
 
 
 
 void Enid::addon(Common::String x) {
 	//month[0]--;
-	month = month + x;
+	_month = _month + x;
 }
 
-Common::String Enid::expanddate(byte d, byte m, uint16 y) {
+Common::String Enid::expandDate(byte d, byte m, uint16 y) {
 	const Common::String months[12] = {
 		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
 		"Septem*", "Octo*", "Novem*", "Decem*"		
 	};
 
 	Common::String expanddate_result;
-	month = months[m];
-	switch (month[month.size()]) {
+	_month = months[m];
+	switch (_month[_month.size()]) {
 	case '#':
 		addon("uary");
 		break;
@@ -94,34 +90,34 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
 		break;
 	}
 
-	day = _vm->_gyro->strf(d);
+	_day = _vm->_gyro->strf(d);
 
 	// d is always positive
 	if ((d <= 9) || ((d >= 21) && (d <= 31))) {
 		switch (d % 10) {
 		case 1:
-			day = day + "st";
+			_day = _day + "st";
 			break;
 		case 2:
-			day = day + "nd";
+			_day = _day + "nd";
 			break;
 		case 3:
-			day = day + "rd";
+			_day = _day + "rd";
 			break;
 		default:
-			day = day + "th";
+			_day = _day + "th";
 		}
 	}
 
-	expanddate_result = day + ' ' + month + ' ' + _vm->_gyro->strf(y);
+	expanddate_result = _day + ' ' + _month + ' ' + _vm->_gyro->strf(y);
 	return expanddate_result;
 }
 
-void Enid::show_bug(char icon, Common::String strn) {
+void Enid::showBug(char icon, Common::String strn) {
 	_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
 }
 
-bool Enid::test_bug(byte what) {
+bool Enid::testBug(byte what) {
 	bool test_bug_result;
 	if (what == 0)  {
 		test_bug_result = false;
@@ -129,47 +125,47 @@ bool Enid::test_bug(byte what) {
 	}
 	switch (what) {
 	case 2:
-		show_bug('7', "Error in filename!");
+		showBug('7', "Error in filename!");
 		break;
 	case 101:
-		show_bug('6', "Disk full!");
+		showBug('6', "Disk full!");
 		break;
 	case 150:
-		show_bug('4', "Disk is write-protected!");
+		showBug('4', "Disk is write-protected!");
 		break;
 	default:
-		show_bug('B', "Saving error!");
+		showBug('B', "Saving error!");
 	}
 	test_bug_result = true;
 	return test_bug_result;
 }
 
-void Enid::edna_save(Common::String name) {
-	warning("STUB: Enid::edna_save()");
+void Enid::ednaSave(Common::String name) {
+	warning("STUB: Enid::ednaSave()");
 }
 
-void Enid::loaderror(Common::String x, char icon) {
+void Enid::loadError(Common::String x, char icon) {
 	if (_vm->_gyro->holdthedawn) {
 		_vm->_gyro->holdthedawn = false;
 		_vm->_lucerna->dawn();
 	}
 	_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
-	bug = true;
+	_bug = true;
 }
 
-void Enid::edna_load(Common::String name) {
-	warning("STUB: Enid::edna_load()");
+void Enid::ednaLoad(Common::String name) {
+	warning("STUB: Enid::ednaLoad()");
 }
 
-void Enid::showheader() {
-	_vm->_scrolls->display(Common::String("Dir: ") + path + "\r\r\4");
+void Enid::showHeader() {
+	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
 }
 
 void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
 	warning("STUB: Enid::dir()");
 }
 
-void Enid::avvy_background() {    
+void Enid::avvyBackground() {    
 	// Not really a filing procedure,
 	// but it's only called just before edna_load, so I thought I'd put it
 	// in Enid instead of, say, Lucerna.
@@ -251,30 +247,30 @@ void Enid::avvy_background() {
 #endif
 }
 
-void Enid::to_sundry(sundry &sund) {
+void Enid::toSundry(sundry &sund) {
 	sund.qenid_filename = _vm->_gyro->enid_filename;
 	sund.qsoundfx = _vm->_gyro->soundfx;
 	sund.qthinks = _vm->_gyro->thinks;
 	sund.qthinkthing = _vm->_gyro->thinkthing;
 }
 
-void Enid::from_sundry(sundry sund) {
+void Enid::fromSundry(sundry sund) {
 	_vm->_gyro->enid_filename = sund.qenid_filename;
 	_vm->_gyro->soundfx = sund.qsoundfx;
 	_vm->_gyro->thinks = sund.qthinks;
 	_vm->_gyro->thinkthing = sund.qthinkthing;
 }
 
-void Enid::restore_dna() {
+void Enid::restoreDna() {
 //	uint16 here, fv;
 //	sundry sund;
 
-	warning("STUB: Enid::restore_dna()");
+	warning("STUB: Enid::restoreDna()");
 }
 
-void Enid::edna_reload() {
+void Enid::ednaReload() {
 
-	restore_dna();
+	restoreDna();
 
 	_vm->_gyro->seescroll = true;  // This prevents display of the new sprites before the
 								   // new picture is loaded.
@@ -293,12 +289,12 @@ void Enid::edna_reload() {
 	}
 }
 
-void Enid::back_to_bootstrap(byte what) {
+void Enid::backToBootstrap(byte what) {
 	warning("STUB: Enid::back_to_bootstrap()");
 }
 
-bool Enid::there_was_a_problem() {
-	return bug;
+bool Enid::thereWasAProblem() {
+	return _bug;
 }
 
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 2237d35..6f76a74 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -32,72 +32,48 @@
 
 #include "common/scummsys.h"
 
-
 namespace Avalanche {
 class AvalancheEngine;
 
 class Enid {
 public:
 	Enid(AvalancheEngine *vm);
-
-	void edna_save(Common::String name);
-
-	void edna_load(Common::String name);
-
-	void edna_reload();    // From Bootstrap's storage.
-
+	void ednaSave(Common::String name);
+	void ednaLoad(Common::String name);
+	void ednaReload(); // From Bootstrap's storage.
 	void dir(Common::String where);
-
-	void avvy_background();
-
-	void back_to_bootstrap(byte what);
-
-	bool there_was_a_problem();
+	void avvyBackground();
+	void backToBootstrap(byte what);
+	bool thereWasAProblem();
 
 private:
 	AvalancheEngine *_vm;
 
-	static const Common::String crlf;
-	static const char tab;
-	static const char eof_;
-
-	static const Common::String ednafirst;
-
-	static const Common::String ednaid;
-
-	static const int16 ttage;
-	static const Common::String ttwashere;
-
-	typedef char fourtype[5];
-	static const fourtype avaricius_file;
-
-
-
-	bool bug;
-
-	Common::String path, groi;
-
-	Common::String month;
-	Common::String day;
+	static const Common::String kCrlf;
+	static const char kTab, kEof;
+	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
+	static const int16 kAge;
 
+	typedef char FourType[5];
+	static const FourType kAvariciusFile;
 
+	bool _bug;
+	Common::String _path, _groi;
+	Common::String _month, _day;
 
 	void addon(Common::String x);
-	Common::String expanddate(byte d, byte m, uint16 y);
-
-	void show_bug(char icon, Common::String strn);
-	bool test_bug(byte what);
-
-	void loaderror(Common::String x, char icon);
+	Common::String expandDate(byte d, byte m, uint16 y);
 
-	void showheader();
+	void showBug(char icon, Common::String strn);
+	bool testBug(byte what);
 
-	void to_sundry(sundry &sund);
-	void from_sundry(sundry sund);
+	void loadError(Common::String x, char icon);
+	void showHeader();
 
-	void restore_dna();
+	void toSundry(sundry &sund);
+	void fromSundry(sundry sund);
 
-	
+	void restoreDna();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 3a2271a..078963a 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -337,7 +337,7 @@ void Timeout::hang_around2() {
 
 	_vm->_gyro->dna.tied_up = false;
 
-	_vm->_enid->back_to_bootstrap(1); // Call the shoot-'em-up.
+	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
 }
 
 void Timeout::after_the_shootemup() {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 790619e..7b13f13 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -878,7 +878,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_lucerna->dusk();
 		tr[0].turn(right); // you'll see this after we get back from bootstrap
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
-		_vm->_enid->back_to_bootstrap(3);
+		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
 		if (_vm->_gyro->dna.friar_will_tie_you_up) {


Commit: 390ecc6a6b1eb65a3c0e1ba68d907afaeb9778b7
    https://github.com/scummvm/scummvm/commit/390ecc6a6b1eb65a3c0e1ba68d907afaeb9778b7
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T04:20:03-07:00

Commit Message:
AVALANCHE: Do renaming/refactoring in Graphics.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index bd5ea8b..9af099b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -313,7 +313,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(_trip->tr[i].visible);
 		sz.syncAsByte(_trip->tr[i].homing);
 		sz.syncAsByte(_trip->tr[i].count);
-		sz.syncAsByte(_trip->tr[i]._info.xw);
+		sz.syncAsByte(_trip->tr[i]._info._xWidth);
 		sz.syncAsByte(_trip->tr[i].xs);
 		sz.syncAsByte(_trip->tr[i].ys);
 		sz.syncAsByte(_trip->tr[i].totalnum);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 5d7dacf..05065d5 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -304,7 +304,7 @@ void Celer::loadBackgroundSprites(byte number) {
 
 				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
 					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
-						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *_vm->_graphics->getPixel(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
+						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
 				}
 			} else {
 				_sprites[i]._size = sprite._size;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 282f2f8..5335769 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -236,7 +236,7 @@ void MenuBar::draw() {
 
 	//setactivepage(3);
 	
-	_dr->_vm->_graphics->drawBar(0, 0, 640, 10, _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
 	byte savecp = _dr->_vm->_gyro->cp;
 	_dr->_vm->_gyro->cp = 3;
@@ -331,7 +331,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 	else
 		ander = 170;
 
-	fontType font;
+	FontType font;
 	for (byte i = 0; i < text.size(); i++) {
 		for (byte j = 0; j < 8; j++) {
 			byte idx = text[i];
@@ -355,7 +355,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
 			if (pixelBit)
-				*_vm->_graphics->getPixel(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
 		}
 	}
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0546ca5..f7067c6 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -41,12 +41,18 @@ namespace Avalanche {
 
 const byte Graphics::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
 
-
-
 Graphics::Graphics(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+Graphics::~Graphics() {
+	_surface.free();
+	_magics.free();
+	_background.free();
+	_screen.free();
+	_scrolls.free();
+}
+
 void Graphics::init() {
 	initGraphics(kScreenWidth, kScreenHeight * 2, true); // Doubling the height.
 
@@ -60,63 +66,17 @@ void Graphics::init() {
 		g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[i]], i, 1);
 
 	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-
 	_magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-
 	_screen.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
-
 	_scrolls.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
-Graphics::~Graphics() {
-	_surface.free();
-	_magics.free();
-	_background.free();
-	_screen.free();
-	_scrolls.free();
-}
-
-
-void Graphics::flesh_colors()
+void Graphics::fleshColors()
 {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
 }
 
-
-byte *Graphics::getPixel(int16 x, int16 y) {
-	return (byte *)_surface.getBasePtr(x, y);
-}
-
-void Graphics::drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
-	_surface.frameRect(Common::Rect(x1, y1, x2, y2), color);
-}
-
-void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
-	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
-}
-
-void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	// First we make the pixels of the spirte blank.
-	for (byte j = 0; j < sprite.yl; j++)
-		for (byte i = 0; i < sprite.xl; i++)
-			if (((*sprite.sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
-				*getPixel(x + i, y + j) = 0;
-	
-	// Then we draw the picture to the blank places.
-	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
-
-	for (byte j = 0; j < sprite.yl; j++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 i = 0; i  < sprite.xl; i += 8) {
-				byte pixel = (*sprite.mani[picnum])[maniPos++];
-				for (byte bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*getPixel(x + i + 7 - bit, y + j) += (pixelBit << plane);
-				} 
-			}
-}
-
 Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
 	Common::Point endPoint;
 	const double pi = 3.14;
@@ -247,9 +207,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
 }
 
-
-
-void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, fontType font, byte fontHeight, int16 x, int16 y, byte color) {
+void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) {
 	for (byte i = 0; i < text.size(); i++)
 		for (byte j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];	
@@ -261,8 +219,6 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 		}
 }
 
-
-
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
@@ -309,6 +265,27 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	return picture;
 }
 
+void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+	// First we make the pixels of the spirte blank.
+	for (byte j = 0; j < sprite._yLength; j++)
+		for (byte i = 0; i < sprite._xLength; i++)
+			if (((*sprite._sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
+				*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
+
+	// Then we draw the picture to the blank places.
+	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
+
+	for (byte j = 0; j < sprite._yLength; j++)
+		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+			for (uint16 i = 0; i  < sprite._xLength; i += 8) {
+				byte pixel = (*sprite._mani[picnum])[maniPos++];
+				for (byte bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
+				} 
+			}
+}
+
 void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++)
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ac9e8bf..ad6a682 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -36,89 +36,57 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-typedef byte fontType[256][16]; // raw font type
+typedef byte FontType[256][16]; // raw font type
 
-typedef byte manitype[2049]; // manitype = array[5..2053] of byte; 
+typedef byte ManiType[2049]; // manitype = array[5..2053] of byte; 
 // Be aware!!!
 
-typedef byte siltype[51][11]; // 35, 4
+typedef byte SilType[51][11]; // 35, 4
 
 class SpriteInfo {
 public:
-	byte xw; // x-width in bytes
-	byte xl, yl; // x & y lengths of pictures
-
-	manitype *mani[24];
-	siltype *sil[24];
-
-	uint16 size; // the size of one picture
+	byte _xWidth;
+	byte _xLength, _yLength;
+	ManiType *_mani[24];
+	SilType *_sil[24];
+	uint16 _size; // The size of one picture.
 };
 
-
 class Graphics {
 public:
 	static const int16 kScreenWidth = 640;
 	static const int16 kScreenHeight = 200;
-
 	static const uint16 kBackgroundWidth = kScreenWidth;
-	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151
+	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151.
 	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
 
 	::Graphics::Surface _surface;
-
 	::Graphics::Surface _background;
-
-	::Graphics::Surface _magics;
-	// Lucerna::draw_also_lines() draws the "magical" lines here.
-	// Further information: https://github.com/urukgit/avalot/wiki/Also
-	
-	::Graphics::Surface _screen;
-
+	::Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
 	::Graphics::Surface _scrolls;
 
-
-
 	Graphics(AvalancheEngine *vm);
-
-	void init();
-
 	~Graphics();
-
-	void flesh_colors();
-
-	byte *getPixel(int16 x, int16 y);
-
-	void drawFrame(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
-
-	void drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
-
-	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-
-	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	void init();
+	void fleshColors();
+	
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
 	// TODO: Make it more accurate later.
-
+	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	
 	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
-
 	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color);
-
-
-
-	void drawText(::Graphics::Surface &surface, const Common::String &text, fontType font, byte fontHeight, int16 x, int16 y, byte color);
-
-
+	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color);
 
 	// The caller has to .free() the returned Surfaces!!!
+	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
-
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
-	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 
+	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 	void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
-
 	void refreshScreen();
-
 	void refreshBackground();
 
 private:
@@ -127,6 +95,7 @@ private:
 	static const byte kEgaPaletteIndex[16];
 
 	byte _egaPalette[64][3];
+	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index d700727..c11eb38 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -522,7 +522,7 @@ public:
 	Common::String atkey; // For XTs, set to "alt-". For ATs, set to "f1".
 
 	byte cp, ledstatus, defaultled;
-	fontType characters;
+	FontType characters;
 	bool alive;
 	byte buffer[2000];
 	uint16 bufsize;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f225d02..4673a5f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -223,7 +223,7 @@ void Lucerna::load(byte n) {     // Load2, actually
 	
 	CursorMan.showMouse(false);
 	
-	_vm->_graphics->flesh_colors();
+	_vm->_graphics->fleshColors();
 
 	xx = _vm->_gyro->strf(n);
 	Common::String filename;
@@ -1017,14 +1017,14 @@ void Lucerna::verte(Common::Point cursorPos) {
 	// _vm->_trip->tr[0] : that's the only one we're interested in here. (It's Avalot.)
 	if (cursorPos.x < _vm->_trip->tr[0].x) 
 		what = 1;
-	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info.xl)) 
+	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength)) 
 		what = 2;
 	else
 		what = 0; // On top
 
 	if (cursorPos.y < _vm->_trip->tr[0].y)
 		what += 3;
-	else if (cursorPos.y > (_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info.yl))
+	else if (cursorPos.y > (_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info._yLength))
 		what += 6;
 
 	switch (what) {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 737bf87..fc705ab 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -113,7 +113,7 @@ void Parser::plotText() {
 
 	cursorOff();
 
-	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
+	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), black); // Black out the line of the text.
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, white);
 
@@ -149,7 +149,7 @@ int16 Parser::pos(const Common::String &crit, const Common::String &src) {
 void Parser::drawCursor() {
 	// Draw the '_' character.
 	for (byte bit = 0; bit < 8; bit++)
-		*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 168) = white;
+		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = white;
 
 	bytefield bf;
 	bf.x1 = _inputTextPos + 1;
@@ -166,7 +166,7 @@ void Parser::wipeText() {
 
 	cursorOff();
 	
-	_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
+	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), black); // Black out the line of the text.
 
 	_quote = true;
 	_inputTextPos = 0;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 3994f56..143dd19 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -72,7 +72,7 @@ void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
 
 	CursorMan.showMouse(false);
 
-	_vm->_graphics->drawBar(419, 195, 438, 197, color);
+	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 
 	CursorMan.showMouse(true);
 	_vm->_gyro->ledstatus = x;
@@ -83,7 +83,7 @@ void Scrolls::easteregg() {
 }
 
 void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwriting
-	fontType itw;
+	FontType itw;
 	byte lz = z.size();
 	
 	bool offset = x % 8 == 4;
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 910285c..0238d33 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -92,7 +92,7 @@ public:
 
 	void musical_scroll();
 
-	fontType ch[2];
+	FontType ch[2];
 
 private:
 	AvalancheEngine *_vm;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7b13f13..3f9c66c 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -88,28 +88,28 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	inf.skip(16 - commentSize);
 
 	a.num = inf.readByte();
-	_info.xl = inf.readByte();
-	_info.yl = inf.readByte();
+	_info._xLength = inf.readByte();
+	_info._yLength = inf.readByte();
 	a.seq = inf.readByte();
-	_info.size = inf.readUint16LE();
+	_info._size = inf.readUint16LE();
 	a.fgc = inf.readByte();
 	a.bgc = inf.readByte();
 	a.accinum = inf.readByte();
 
 	totalnum = 0; // = 1;
-	_info.xw = _info.xl / 8;
-	if ((_info.xl % 8) > 0)
-		_info.xw++;
+	_info._xWidth = _info._xLength / 8;
+	if ((_info._xLength % 8) > 0)
+		_info._xWidth++;
 	for (byte aa = 0; aa < /*nds*seq*/a.num; aa++) {
 
-		_info.sil[totalnum] = new siltype[11 * (_info.yl + 1)];
+		_info._sil[totalnum] = new SilType[11 * (_info._yLength + 1)];
 		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
-		_info.mani[totalnum] = new manitype[_info.size - 6];
+		_info._mani[totalnum] = new ManiType[_info._size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
-		for (fv = 0; fv <= _info.yl; fv++)
-			inf.read((*_info.sil[totalnum])[fv], _info.xw);
+		for (fv = 0; fv <= _info._yLength; fv++)
+			inf.read((*_info._sil[totalnum])[fv], _info._xWidth);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
-		inf.read(*_info.mani[totalnum], _info.size - 6);
+		inf.read(*_info._mani[totalnum], _info._size - 6);
 		//blockread(inf, *mani[totalnum-1], a.size - 6);
 
 		totalnum++;
@@ -173,8 +173,8 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 bool triptype::collision_check() {
 	for (byte fv = 0; fv < _tr->numtr; fv++) 
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
-			((x + _info.xl) > _tr->tr[fv].x) &&
-			(x < (_tr->tr[fv].x + _tr->tr[fv]._info.xl)) &&
+			((x + _info._xLength) > _tr->tr[fv].x) &&
+			(x < (_tr->tr[fv].x + _tr->tr[fv]._info._xLength)) &&
 			(_tr->tr[fv].y == y)) 
 				return true;
 
@@ -191,8 +191,8 @@ void triptype::walk() {
 		if (r.x1 == 255)
 			r.x1 = 0;
 		r.y1 = y - 2;
-		r.x2 = ((x + _info.xl) / 8) + 1;
-		r.y2 = y + _info.yl + 2;
+		r.x2 = ((x + _info._xLength) / 8) + 1;
+		r.y2 = y + _info._yLength + 2;
 		
 		_tr->getset[1 - _tr->_vm->_gyro->cp].remember(r);
 	}
@@ -212,7 +212,7 @@ void triptype::walk() {
 			return;
 		}
 
-		tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl) - 1;
+		tc = _tr->checkfeet(x, x + _info._xLength, oy[_tr->_vm->_gyro->cp], y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
@@ -279,8 +279,8 @@ int8 triptype::sgn(int16 val) {
 void triptype::walkto(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
 	speed(sgn(_tr->_vm->_gyro->peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro->peds[pednum].y - y));
-	hx = _tr->_vm->_gyro->peds[pednum].x - _info.xl / 2;
-	hy = _tr->_vm->_gyro->peds[pednum].y - _info.yl;
+	hx = _tr->_vm->_gyro->peds[pednum].x - _info._xLength / 2;
+	hy = _tr->_vm->_gyro->peds[pednum].y - _info._yLength;
 	homing = true;
 }
 
@@ -344,7 +344,7 @@ void triptype::stopwalk() {
 }
 
 void triptype::chatter() {
-	_tr->_vm->_gyro->talkx = x + _info.xl / 2;
+	_tr->_vm->_gyro->talkx = x + _info._xLength / 2;
 	_tr->_vm->_gyro->talky = y;
 	_tr->_vm->_gyro->talkf = a.fgc;
 	_tr->_vm->_gyro->talkb = a.bgc;
@@ -362,7 +362,7 @@ void triptype::set_up_saver(trip_saver_type &v) {
 	v.homing = homing;
 	v.check_me = check_me;
 	v.count = count;
-	v.xw = _info.xw;
+	v.xw = _info._xWidth;
 	v.xs = xs;
 	v.ys = ys;
 	v.totalnum = totalnum;
@@ -385,7 +385,7 @@ void triptype::unload_saver(trip_saver_type v) {
 	homing = v.homing;
 	check_me = v.check_me;
 	count = v.count;
-	_info.xw = v.xw;
+	_info._xWidth = v.xw;
 	xs = v.xs;
 	ys = v.ys;
 	totalnum = v.totalnum;
@@ -417,13 +417,13 @@ triptype *triptype::done() {
 
 	//  nds:=num div seq;
 	totalnum--;
-	_info.xw = _info.xl / 8;
-	if ((_info.xl % 8) > 0)
-		_info.xw++;
+	_info._xWidth = _info._xLength / 8;
+	if ((_info._xLength % 8) > 0)
+		_info._xWidth++;
 	for (byte aa = 0; aa < /*nds*seq*/ a.num; aa++) {
 		totalnum--;
-		delete[] _info.mani[totalnum];
-		delete[] _info.sil[totalnum];
+		delete[] _info._mani[totalnum];
+		delete[] _info._sil[totalnum];
 	}
 
 	quick = false;
@@ -1115,7 +1115,7 @@ void Trip::rwsp(byte t, byte dir) {
 void Trip::apped(byte trn, byte np) {
 	trn--;
 	np--;
-	tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info.xl / 2, _vm->_gyro->peds[np].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
+	tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info._xLength / 2, _vm->_gyro->peds[np].y - tr[trn]._info._yLength, _vm->_gyro->peds[np].dir);
 	rwsp(trn, _vm->_gyro->peds[np].dir);
 }
 
@@ -1206,9 +1206,9 @@ void Trip::arrow_procs(byte tripnum) {
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((tr[tripnum].y + tr[tripnum]._info.yl) >= tr[0].y) // A
-				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info.xl)) // B
-				&& ((tr[tripnum].x + tr[tripnum]._info.xl) >= tr[0].x)) { // C
+		if (((tr[tripnum].y + tr[tripnum]._info._yLength) >= tr[0].y) // A
+				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info._xLength)) // B
+				&& ((tr[tripnum].x + tr[tripnum]._info._xLength) >= tr[0].x)) { // C
 			// OK, it's hit him... what now?
 
 			tr[1].call_eachstep = false; // prevent recursion.
@@ -1547,7 +1547,7 @@ void Trip::fliproom(byte room, byte ped) {
 bool Trip::infield(byte which) {
 	which--; // Pascal -> C: different array indexes.
 
-	int16 yy = tr[0].y + tr[0]._info.yl;
+	int16 yy = tr[0].y + tr[0]._info._yLength;
 
 	return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2)
 		&& (yy >= _vm->_gyro->fields[which].y1) && (yy <= _vm->_gyro->fields[which].y2);
@@ -1561,7 +1561,7 @@ bool Trip::neardoor() {
 	}
 		
 	int16 ux = tr[0].x;
-	int16 uy = tr[0].y + tr[0]._info.yl;
+	int16 uy = tr[0].y + tr[0]._info._yLength;
 	bool nd = false;
 	for (byte fv = 8; fv < _vm->_gyro->numfields; fv++)
 		if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)


Commit: 3de1b45b62168b39824a6311344ded0edcf04cf3
    https://github.com/scummvm/scummvm/commit/3de1b45b62168b39824a6311344ded0edcf04cf3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T04:29:16-07:00

Commit Message:
AVALANCHE: Repair memory leaks in Dropdown.

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 5335769..793fc91 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -762,6 +762,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
 								_vm->_lucerna->holdLeftMouse = false;
+								backup.free();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
 						} 
@@ -775,6 +776,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
 							_vm->_lucerna->holdLeftMouse = false;
+							backup.free();
 							return;
 						} else {
 							_vm->_lucerna->holdLeftMouse = true;
@@ -800,8 +802,10 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 
 						uint16 which = (cursorPos.y - 26) / 20;
 						_activeMenuItem.select(which);
-						if (_activeMenuItem._options[which]._valid) // If the menu item wasn't active, we do nothing.
+						if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
+							backup.free();
 							return;
+						}
 				}
 			}
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 4673a5f..4c9997e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -58,8 +58,8 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 }
 
 Lucerna::~Lucerna() {
-	for (byte i = 0; i < 31; i++) 
-		for (byte j = 0; j < 2; j++)
+	for (int i = 0; i < 31; i++) 
+		for (int j = 0; j < 2; j++)
 			delete _vm->_gyro->also[i][j];
 }
 


Commit: 2d99f5bfc6cd0aab348147f6ddfc4fc47a88af2b
    https://github.com/scummvm/scummvm/commit/2d99f5bfc6cd0aab348147f6ddfc4fc47a88af2b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T05:44:55-07:00

Commit Message:
AVALANCHE: Repair some initialization to silence Valgrind warnings.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index b1b5fe8..a51d9e6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -167,6 +167,7 @@ void Avalot::setup() {
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
+	_vm->_trip->tr[0].xs = _vm->_gyro->walk;
 	_vm->_trip->newspeed();
 
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 4c9997e..f026f04 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -64,8 +64,8 @@ Lucerna::~Lucerna() {
 }
 
 void Lucerna::init() {
-	_vm->_gyro->oh = 17717;
-	_vm->_gyro->om = 17717;
+	_vm->_gyro->oh = _vm->_gyro->onh = _vm->_gyro->om = 17717;
+
 #if 0
 	if (_vm->_enhanced->atbios)
 		_vm->_gyro->atkey = "f1";


Commit: 63d1d289a561c62e13747690096db6fbe8f828c8
    https://github.com/scummvm/scummvm/commit/63d1d289a561c62e13747690096db6fbe8f828c8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T06:09:13-07:00

Commit Message:
AVALANCHE: Silence more Valgrind warnings.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f026f04..2fce07f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -58,14 +58,21 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 }
 
 Lucerna::~Lucerna() {
-	for (int i = 0; i < 31; i++) 
-		for (int j = 0; j < 2; j++)
-			delete _vm->_gyro->also[i][j];
+	for (byte i = 0; i < 31; i++)
+		for (byte j = 0; j < 2; j++)
+			if (_vm->_gyro->also[i][j] != 0)  {
+				delete _vm->_gyro->also[i][j];
+				_vm->_gyro->also[i][j] = 0;
+			}
 }
 
 void Lucerna::init() {
 	_vm->_gyro->oh = _vm->_gyro->onh = _vm->_gyro->om = 17717;
 
+	for (byte i = 0; i < 31; i++)
+		for (byte j = 0; j < 2; j++)
+			_vm->_gyro->also[i][j] = 0;
+
 #if 0
 	if (_vm->_enhanced->atbios)
 		_vm->_gyro->atkey = "f1";


Commit: 3b10b079f7da6dab9a6d1f86aa46d33408ac5761
    https://github.com/scummvm/scummvm/commit/3b10b079f7da6dab9a6d1f86aa46d33408ac5761
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T06:48:30-07:00

Commit Message:
AVALANCHE: Silence Valgrind warnings.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 520b2a8..8f852dd 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1320,8 +1320,8 @@ void Acci::doThat() {
 
 
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
-	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir)
-	&& (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
+	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
+	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_gyro->alive) {
 			_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
 			return;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9af099b..605932b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -62,7 +62,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _parser;
 
 	delete _avalot;
-	delete _gyro;
 	delete _pingo;
 	delete _scrolls;
 	delete _visa;
@@ -75,6 +74,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _acci;
 	delete _dropdown;
 	delete _closing;
+	delete _gyro;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 793fc91..d15bebb 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -615,12 +615,14 @@ void Dropdown::runMenuAction() {
 	}
 	break;
 	case 1:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodePause);
 		break;
 	case 2:
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
 		break;
 	case 3:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeLook);
 		break;
 	case 4:
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 62ffca8..aa28f20 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -331,6 +331,7 @@ void Gyro::newgame() {
 	dna.obj[bell - 1] = true;
 	dna.obj[clothes - 1] = true;
 	
+	thinkthing = true;
 	thinks = 2;
 	_vm->_lucerna->objectlist();
 	ontoolbar = false;
@@ -383,8 +384,7 @@ bool Gyro::flagset(char x) {
 }
 
 void Gyro::force_numlock() {
-	if ((locks & numlockCode) > 0)
-		locks -= numlockCode;
+	warning("STUB: Gyro::force_numlock()");
 }
 
 bool Gyro::pennycheck(uint16 howmuchby) {
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 2fce07f..e7ef5a1 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1071,8 +1071,8 @@ void Lucerna::checkclick() {
 	Common::Point cursorPos = _vm->getMousePos();
 	_vm->_gyro->ontoolbar = _vm->_gyro->slow_computer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 	
-	if (_vm->_gyro->mrelease > 0)
-		_vm->_gyro->after_the_scroll = false;
+	/*if (_vm->_gyro->mrelease > 0)
+	_vm->_gyro->after_the_scroll = false;*/
 
 	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
 		_vm->_gyro->newpointer(1); // up arrow
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 143dd19..62b8b5e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -461,8 +461,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	CursorMan.showMouse(true);
 	//settextjustify(0, 0); // sink
 	resetscrolldriver();
-	if (_vm->_gyro->mpress > 0)
-		_vm->_gyro->after_the_scroll = true;
+	/*if (_vm->_gyro->mpress > 0)
+	_vm->_gyro->after_the_scroll = true;*/
 
 	warning("STUB: Scrolls::drawscroll()");
 }
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 3f9c66c..2444d43 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -460,6 +460,13 @@ Trip::Trip(AvalancheEngine *vm) {
 	mustexclaim = false;
 }
 
+Trip::~Trip() {
+	for (byte i = 0; i < numtr; i++) {
+		if (tr[i].quick)
+			tr[i].done();
+	}
+}
+
 void Trip::loadtrip() {
 	for (int16 gm = 0; gm < numtr; gm++)
 		tr[gm].original();
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 1c5c6db..e3ed44f 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -182,6 +182,8 @@ public:
 
 	Trip(AvalancheEngine *vm);
 
+	~Trip();
+
 	void trippancy_link();
 
 	void get_back_loretta();


Commit: f3377c67e0b5548801bbf2fa93af25e7b57ae438
    https://github.com/scummvm/scummvm/commit/f3377c67e0b5548801bbf2fa93af25e7b57ae438
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-05T10:47:55-07:00

Commit Message:
AVALANCHE: Fix initialization of kEdnaId

Changed paths:
    engines/avalanche/enid2.cpp



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index e6b7bc3..ef5a90d 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -59,7 +59,7 @@ const Common::String Enid::kEdnaFirst =
 	kCrlf + kCrlf + kCrlf + // 6
 	"1234567890" +kCrlf; // 11
 
-const Common::String Enid::kEdnaId = Common::String("TT") + char(261) + char(60) + char(1) + char(165) + char(261) + char(231) + char(261);
+const Common::String Enid::kEdnaId = Common::String("TT\xB1\x30\x01\x75\xB1\x99\xB1");
 
 const int16 Enid::kAge = 18;
 const Common::String Enid::kWasHere = "Thomas was here ";


Commit: 3f822be0ab155883eebfe16839044bce46dbecb3
    https://github.com/scummvm/scummvm/commit/3f822be0ab155883eebfe16839044bce46dbecb3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T12:45:07-07:00

Commit Message:
AVALANCHE: Silence Valgrind warnings.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 605932b..06ac30e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -701,22 +701,24 @@ Common::Error AvalancheEngine::run() {
 	do {
 		runAvalot();
 
+		// Needed for later implementation!!! Don't remove these comments!!!
+		
 		//if (dosexitcode != 77)  quit(); // Didn't stop for us.
 
-		switch (_storage._operation) {
-		case kRunShootemup:
-			run("seu.avx", kJsb, kBflight, kNormal);
-			break;
-		case kRunDosshell:
-			dosShell();
-			break;
-		case kRunGhostroom:
-			run("g-room.avx", kJsb, kNoBflight, kNormal);
-			break;
-		case kRunGolden:
-			run("golden.avx", kJsb, kBflight, kMusical);
-			break;
-		}
+		//switch (_storage._operation) {
+		//case kRunShootemup:
+		//	run("seu.avx", kJsb, kBflight, kNormal);
+		//	break;
+		//case kRunDosshell:
+		//	dosShell();
+		//	break;
+		//case kRunGhostroom:
+		//	run("g-room.avx", kJsb, kNoBflight, kNormal);
+		//	break;
+		//case kRunGolden:
+		//	run("golden.avx", kJsb, kBflight, kMusical);
+		//	break;
+		//}
 
 	} while (false);
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index f7067c6..eeb15dd 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -222,24 +222,24 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
-	uint16 pictureWidth = file.readUint16LE() + 1;
-	uint16 pictureHeight = file.readUint16LE() + 1;
+	uint16 width = file.readUint16LE() + 1;
+	uint16 height = file.readUint16LE() + 1;
 
 	::Graphics::Surface picture; // We make a Surface object for the picture itself.
-
-	picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
-	for (byte y = 0; y < pictureHeight; y++)
+	for (byte y = 0; y < height; y++) 
 		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
-			for (uint16 x = 0; x < pictureWidth; x += 8) {
+			for (uint16 x = 0; x < width; x += 8) {
 				byte pixel = file.readByte();
 				for (byte bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+					if (pixelBit != 0)
+						*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
 				} 
 			}
-
+		
 	return picture;
 }
 
@@ -249,7 +249,6 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	// and we read the picture plane-by-plane.
 
 	::Graphics::Surface picture;
-
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	for (byte plane = 0; plane < 4; plane++)


Commit: 77607ab6ed148ed4aaba767743e4b97ef253c7ea
    https://github.com/scummvm/scummvm/commit/77607ab6ed148ed4aaba767743e4b97ef253c7ea
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T12:45:47-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/enid2.cpp





Commit: c1bc8eee64fa683aa47d675c68783ae26a20d25b
    https://github.com/scummvm/scummvm/commit/c1bc8eee64fa683aa47d675c68783ae26a20d25b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T14:07:08-07:00

Commit Message:
AVALANCHE: Rename/refactor Colors.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/color.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a51d9e6..2bc3ce3 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -220,7 +220,7 @@ void Avalot::run(Common::String arg) {
 
 		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
 			if (_vm->_gyro->fields[i].x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), lightmagenta);
+				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), kColorLightmagenta);
 		}
 		// ONLY FOR TESTING!!!
 #endif
diff --git a/engines/avalanche/color.h b/engines/avalanche/color.h
index 1a8e69d..c0c348f 100644
--- a/engines/avalanche/color.h
+++ b/engines/avalanche/color.h
@@ -34,22 +34,24 @@
 
 namespace Avalanche {
 
-const byte black = 0;
-const byte blue = 1;
-const byte green = 2;
-const byte cyan = 3;
-const byte red = 4;
-const byte magenta = 5;
-const byte brown = 6;
-const byte lightgray = 7;
-const byte darkgray = 8;
-const byte lightblue = 9;
-const byte lightgreen = 10;
-const byte lightcyan = 11;
-const byte lightred = 12;
-const byte lightmagenta = 13;
-const byte yellow = 14;
-const byte white = 15;
+enum Color {
+	kColorBlack,
+	kColorBlue,
+	kColorGreen,
+	kColorCyan,
+	kColorRed,
+	kColorMagenta,
+	kColorBrown,
+	kColorLightgray,
+	kColorDarkgray,
+	kColorLightblue,
+	kColorLightgreen,
+	kColorLightcyan,
+	kColorLightred,
+	kColorLightmagenta,
+	kColorYellow,
+	kColorWhite
+};
 
 } // End of namespace Avalanche
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index d15bebb..d54e667 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -318,11 +318,11 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 	byte fontColor;
 	byte backgroundColor;
 	if (highlighted) {
-		fontColor = white;
-		backgroundColor = black;
+		fontColor = kColorWhite;
+		backgroundColor = kColorBlack;
 	} else {
-		fontColor = black;
-		backgroundColor = lightgray;
+		fontColor = kColorBlack;
+		backgroundColor = kColorLightgray;
 	}
 
 	byte ander;
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index ad9dc77..4122d3f 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -133,12 +133,12 @@ private:
 	static const byte kIndent = 5;
 	static const byte kSpacing = 10;
 
-	static const byte kMenuBackgroundColor = lightgray;
-	static const byte kMenuFontColor = black;
-	static const byte kMenuBorderColor = black;
-	static const byte kHighlightBackgroundColor = black;
-	static const byte kHighlightFontColor = white;
-	static const byte kDisabledColor = darkgray;
+	static const byte kMenuBackgroundColor = kColorLightgray;
+	static const byte kMenuFontColor = kColorBlack;
+	static const byte kMenuBorderColor = kColorBlack;
+	static const byte kHighlightBackgroundColor = kColorBlack;
+	static const byte kHighlightFontColor = kColorWhite;
+	static const byte kDisabledColor = kColorDarkgray;
 
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index aa28f20..58a38c7 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -164,22 +164,22 @@ const int32 Gyro::catamap[8][8] = {
 const char Gyro::spludwick_order[3] = {onion, ink, mushroom};
 
 const quasiped_type Gyro::quasipeds[16] = {
-	{2, lightgray, 19, brown, pdogfood},                       // A: Dogfood (screen 19). 
-	{3, green,     19, white, pibythneth},                     // B: Ibythneth (screen 19).
-	{3, white,     1, magenta, parkata},                       // C: Arkata (screen 1).
-	{3, black,     23, red, 177},							   // D: Hawk (screen 23).
-	{3, lightgreen, 50, brown, ptrader},                       // E: Trader (screen 50).
-	{6, yellow,    42, red, pavalot},                          // F: Avvy, tied up (scr.42)
-	{2, blue,      16, white, payles},                         // G: Ayles (screen 16).
-	{2, brown,     7, white, pjacques},                        // H: Jacques (screen 7).
-	{2, lightgreen, 47, green, pspurge},                       // I: Spurge (screen 47).
-	{3, yellow,    47, red, pavalot},                          // J: Avalot (screen 47).
-	{2, lightgray, 23, black, pdulustie},                      // K: du Lustie (screen 23).
-	{2, yellow,    27, red, pavalot},                          // L: Avalot (screen 27).
-	{3, white,     27, red, 177},                              // M: Avaroid (screen 27).
-	{4, lightgray, 19, darkgray, pmalagauche},                 // N: Malagauche (screen 19).
-	{5, lightmagenta, 47, red, pport},                         // O: Port (screen 47).
-	{2, lightgreen, 51, darkgray, pdrduck}                     // P: Duck (screen 51).
+	{2, kColorLightgray, 19, kColorBrown, pdogfood},                       // A: Dogfood (screen 19). 
+	{3, kColorGreen,     19, kColorWhite, pibythneth},                     // B: Ibythneth (screen 19).
+	{3, kColorWhite,     1, kColorMagenta, parkata},                       // C: Arkata (screen 1).
+	{3, kColorBlack,     23, kColorRed, 177},							   // D: Hawk (screen 23).
+	{3, kColorLightgreen, 50, kColorBrown, ptrader},                       // E: Trader (screen 50).
+	{6, kColorYellow,    42, kColorRed, pavalot},                          // F: Avvy, tied up (scr.42)
+	{2, kColorBlue,      16, kColorWhite, payles},                         // G: Ayles (screen 16).
+	{2, kColorBrown,     7, kColorWhite, pjacques},                        // H: Jacques (screen 7).
+	{2, kColorLightgreen, 47, kColorGreen, pspurge},                       // I: Spurge (screen 47).
+	{3, kColorYellow,    47, kColorRed, pavalot},                          // J: Avalot (screen 47).
+	{2, kColorLightgray, 23, kColorBlack, pdulustie},                      // K: du Lustie (screen 23).
+	{2, kColorYellow,    27, kColorRed, pavalot},                          // L: Avalot (screen 27).
+	{3, kColorWhite,     27, kColorRed, 177},                              // M: Avaroid (screen 27).
+	{4, kColorLightgray, 19, kColorDarkgray, pmalagauche},                 // N: Malagauche (screen 19).
+	{5, kColorLightmagenta, 47, kColorRed, pport},                         // O: Port (screen 47).
+	{2, kColorLightgreen, 51, kColorDarkgray, pdrduck}                     // P: Duck (screen 51).
 };
 
 const char Gyro::keys[] = "QWERTYUIOP[]";
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e7ef5a1..fe604cc 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -446,7 +446,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(5, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
-			_vm->_gyro->magics[lightred - 1].op = _vm->_gyro->nix;
+			_vm->_gyro->magics[kColorLightred - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
@@ -486,7 +486,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->magics[green - 1].op = _vm->_gyro->nix; // You may enter the drawbridge.
+			_vm->_gyro->magics[kColorGreen - 1].op = _vm->_gyro->nix; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(ped + 3, ped); // load Geida
@@ -628,7 +628,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-			_vm->_gyro->magics[brown - 1].op = _vm->_gyro->nix;
+			_vm->_gyro->magics[kColorBrown - 1].op = _vm->_gyro->nix;
 			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {
@@ -960,34 +960,34 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 	byte col = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
 
 	switch (col) {
-	case green: {
+	case kColorGreen: {
 			_vm->_gyro->dna.rw = _vm->_trip->up;
 			_vm->_trip->rwsp(0, _vm->_trip->up);
 			showrw();
 		}
 		break;
-	case brown: {
+	case kColorBrown: {
 			_vm->_gyro->dna.rw = _vm->_trip->down;
 			_vm->_trip->rwsp(0, _vm->_trip->down);
 			showrw();
 		}
 		break;
-	case cyan: {
+	case kColorCyan: {
 			_vm->_gyro->dna.rw = _vm->_trip->left;
 			_vm->_trip->rwsp(0, _vm->_trip->left);
 			showrw();
 		}
 		break;
-	case lightmagenta: {
+	case kColorLightmagenta: {
 			_vm->_gyro->dna.rw = _vm->_trip->right;
 			_vm->_trip->rwsp(0, _vm->_trip->right);
 			showrw();
 		}
 		break;
-	case red:
-	case white:
-	case lightcyan:
-	case yellow: { // Fall-throughs are intended.
+	case kColorRed:
+	case kColorWhite:
+	case kColorLightcyan:
+	case kColorYellow: { // Fall-throughs are intended.
 			_vm->_trip->stopwalking();
 			showrw();
 		}
@@ -1243,15 +1243,15 @@ void Lucerna::refresh_hands() {
 void Lucerna::plothands() {
 	//   off;
 	//setactivepage(3);
-	calchand(_vm->_gyro->onh, 14, ah, yellow);
-	calchand(_vm->_gyro->om * 6, 17, am, yellow);
-	hand(ah, brown);
-	hand(am, brown);
-
-	calchand(nh, 14, ah, brown);
-	calchand(_vm->_gyro->minutes * 6, 17, am, brown);
-	hand(ah, yellow);
-	hand(am, yellow);
+	calchand(_vm->_gyro->onh, 14, ah, kColorYellow);
+	calchand(_vm->_gyro->om * 6, 17, am, kColorYellow);
+	hand(ah, kColorBrown);
+	hand(am, kColorBrown);
+
+	calchand(nh, 14, ah, kColorBrown);
+	calchand(_vm->_gyro->minutes * 6, 17, am, kColorBrown);
+	hand(ah, kColorYellow);
+	hand(am, kColorYellow);
 
 	//setactivepage(1 - cp);
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index fc705ab..c45ddf9 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -113,9 +113,9 @@ void Parser::plotText() {
 
 	cursorOff();
 
-	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), black); // Black out the line of the text.
+	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, white);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);
@@ -149,7 +149,7 @@ int16 Parser::pos(const Common::String &crit, const Common::String &src) {
 void Parser::drawCursor() {
 	// Draw the '_' character.
 	for (byte bit = 0; bit < 8; bit++)
-		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = white;
+		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = kColorWhite;
 
 	bytefield bf;
 	bf.x1 = _inputTextPos + 1;
@@ -166,7 +166,7 @@ void Parser::wipeText() {
 
 	cursorOff();
 	
-	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), black); // Black out the line of the text.
+	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 
 	_quote = true;
 	_inputTextPos = 0;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 62b8b5e..147bc21 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -57,15 +57,15 @@ void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
 	if (_vm->_gyro->ledstatus == x)
 		return; // Already like that!
 
-	byte color = black;
+	byte color = kColorBlack;
 	switch (x) {
 	case 0:
-		color = black;
+		color = kColorBlack;
 		break; // Off
 	case 1:
 	case 2:
 	case 3:
-		color = green;
+		color = kColorGreen;
 		break; // Hit a key
 	}
 	warning("STUB: Scrolls::state()");
@@ -107,7 +107,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwrit
 			// We have to draw the characters one-by-one because of the accidental font changes.
 			i++;
 			Common::String chr(z[xx]);
-			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, black);
+			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, kColorBlack);
 			}
 		}
 	}
@@ -353,29 +353,29 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	CursorMan.showMouse(false);
 
 	// The right corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, lightgray);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, lightgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, red);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, red);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorLightgray);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
 	
 	// The body of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), lightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), lightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
 
 	// The left corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, darkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, red);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, red);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, darkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, red);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, red);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
 
 	// The rear borders of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), red);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
 
 	ex = mx - lx;
 //	int16 ey = my - ly;
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 2444d43..6a1aedd 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1074,14 +1074,14 @@ void Trip::newspeed() {
 	//setactivepage(3);
 
 	if (tr[0].xs == _vm->_gyro->run)
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, yellow);
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, yellow);
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
 
 	if (tr[0].xs == _vm->_gyro->run)
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, lightblue);
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, lightblue);
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
 
 	//setactivepage(1 - cp);
 


Commit: b6306976cfcf5c1bab9b6f83f05249b8a45865d9
    https://github.com/scummvm/scummvm/commit/b6306976cfcf5c1bab9b6f83f05249b8a45865d9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T14:57:58-07:00

Commit Message:
AVALANCHE: Start renaming in Gyro.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 8f852dd..05d4166 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -412,7 +412,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		_vm->_visa->dixi('z', 5); // His closing statement...
 		_vm->_trip->tr[1].walkto(4); // The end of the drawbridge
 		_vm->_trip->tr[1].vanishifstill = true; // Then go away!
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing;
 		_vm->_gyro->dna.cardiff_things = 5;
 		break;
 	case 99:
@@ -449,8 +449,8 @@ void Acci::parse() {
 	}
 
 	// Are we being interrogated right now?
-	if (_vm->_gyro->interrogation > 0) {
-		storeInterrogation(_vm->_gyro->interrogation);
+	if (_vm->_gyro->_interrogation > 0) {
+		storeInterrogation(_vm->_gyro->_interrogation);
 		_vm->_gyro->weirdword = true;
 		return;
 	}
@@ -623,7 +623,7 @@ void Acci::parse() {
 
 void Acci::examineObject() {   
 	if (_thing != _vm->_gyro->thinks)
-		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->a_thing);
+		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing);
 	switch (_thing) {
 	case Gyro::wine :
 		switch (_vm->_gyro->dna.winestate) {// 4 is perfect wine. 0 is not holding the wine.
@@ -650,7 +650,7 @@ void Acci::examineObject() {
 }
 
 bool Acci::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->whereis[_person - 150] == _vm->_gyro->dna.room))
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->dna.room))
 		return true;
 	else {
 		if (_person < 175)
@@ -665,7 +665,7 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 void Acci::exampers() {
 	if (isPersonHere()) {
 		if (_thing != _vm->_gyro->thinks)
-			_vm->_lucerna->thinkabout(_person, _vm->_gyro->a_person);
+			_vm->_lucerna->thinkabout(_person, _vm->_gyro->kPerson);
 		_person -= 149;
 		switch (_person) { // Special cases
 		case 11:
@@ -826,7 +826,7 @@ void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 	
 	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room)
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->dna.room)
 			numPeople++;
 	}
 
@@ -835,7 +835,7 @@ void Acci::peopleInRoom() {
 
 	byte actPerson = 0; // Actually listed people.
 	for (byte i = 1; i < 29; i++) {
-		if (_vm->_gyro->whereis[i] == _vm->_gyro->dna.room) {
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->dna.room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
 				_vm->_scrolls->display(_vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
@@ -923,23 +923,23 @@ void Acci::openDoor() {
 			fv -= 8;
 
 			switch (_vm->_gyro->portals[fv].op) {
-			case Gyro::exclaim:
+			case Gyro::kMagicExclaim:
 				_vm->_trip->tr[0].bounce();
 				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
 				break;
-			case Gyro::transport:
+			case Gyro::kMagicTransport:
 				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8,  // High byte 
 					                 (_vm->_gyro->portals[fv].data) & 0x0F // Low byte
 									 );
 				break;
-			case Gyro::unfinished:
+			case Gyro::kMagicUnfinished:
 				_vm->_trip->tr[0].bounce();
 				_vm->_scrolls->display("Sorry. This place is not available yet!");
 				break;
-			case Gyro::special:
+			case Gyro::kMagicSpecial:
 				_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
 				break;
-			case Gyro::mopendoor:
+			case Gyro::kMagicOpenDoor:
 				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv + 9);
 				break;
 			}
@@ -1038,7 +1038,7 @@ void Acci::putProc() {
 
 void Acci::notInOrder() {
 	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
-			+ _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick])
+			+ _vm->_gyro->get_better(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick])
 			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
 
@@ -1053,7 +1053,7 @@ void Acci::goToCauldron() {
  * @remarks	Originally called 'give2spludwick'
  */
 bool Acci::giveToSpludwick() { 
-	if (_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick] != _thing) {
+	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick] != _thing) {
 		notInOrder();
 		return false;
 	}
@@ -1142,7 +1142,7 @@ void Acci::standUp() {
 			_vm->_trip->tr[0].visible = true;
 			_vm->_gyro->dna.user_moves_avvy = true;
 			_vm->_trip->apped(1, 2);
-			_vm->_gyro->dna.rw = _vm->_gyro->left;
+			_vm->_gyro->dna.rw = _vm->_gyro->kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->points(1);
 			_vm->_gyro->dna.avvy_in_bed = false;
@@ -1267,13 +1267,13 @@ void Acci::winSequence() {
 
 void Acci::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->whereis[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
+		if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
 			_person = _vm->_gyro->her;
 		else
 			_person = _vm->_gyro->him;
 	}
 
-	if (_vm->_gyro->whereis[_person - 150] != _vm->_gyro->dna.room) {
+	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->dna.room) {
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
 		return;
 	}
@@ -1289,7 +1289,7 @@ void Acci::personSpeaks() {
 
 	if (!found) {
 		for (byte i = 0; i < 16; i++) {
-			if ((_vm->_gyro->quasipeds[i].who == _person) && (_vm->_gyro->quasipeds[i].room == _vm->_gyro->dna.room))
+			if ((_vm->_gyro->kQuasipeds[i].who == _person) && (_vm->_gyro->kQuasipeds[i].room == _vm->_gyro->dna.room))
 				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
 		}
 	}
@@ -1506,7 +1506,7 @@ void Acci::doThat() {
 		_vm->_scrolls->display("Vandalism is prohibited within this game!");
 		break;
 	case kVerbCodeQuit: // quit
-		if (_vm->_gyro->demo) {
+		if (_vm->_gyro->kDemo) {
 			warning("STUB: Acci::doThat() - case kVerbCodequit");
 		//	_vm->_visa->dixi('pos', 31);
 		//	close(demofile);
@@ -1632,10 +1632,10 @@ void Acci::doThat() {
 			case Gyro::lute :
 					_vm->_visa->dixi('U', 7);
 
-					if (_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
+					if (_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
 						_vm->_visa->dixi('U', 10);
 
-					if (_vm->_gyro->whereis[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room)
+					if (_vm->_gyro->_whereIs[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room)
 						_vm->_visa->dixi('U', 15);
 				break;
 			case 52:
@@ -1699,7 +1699,7 @@ void Acci::doThat() {
 		else {
 			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
 				_vm->_visa->dixi('q', 17);
-				if (_vm->_gyro->whereis[1] == 12)
+				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->dixi('q', 18);
 				else {
 					_vm->_trip->tr[1].init(1, false, _vm->_trip); // Avaricius
@@ -1842,7 +1842,7 @@ void Acci::doThat() {
 	case kVerbCodeAttack:
 		if ((_vm->_gyro->dna.room == r__brummieroad) &&
 				((_person == 157) || (_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
-				&& (_vm->_gyro->whereis[7] == _vm->_gyro->dna.room)) {
+				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->dna.room)) {
 			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
@@ -1861,12 +1861,12 @@ void Acci::doThat() {
 				_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = false;
 				_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = false;
 				_vm->_lucerna->objectlist();
-				_vm->_gyro->magics[11].op = _vm->_gyro->nix;
+				_vm->_gyro->magics[11].op = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->points(7);
 				_vm->_trip->tr[1].walkto(2);
 				_vm->_trip->tr[1].vanishifstill = true;
 				_vm->_trip->tr[1].call_eachstep = false;
-				_vm->_gyro->whereis[7] = 177;
+				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
 				_vm->_visa->dixi('Q', 10); // Please try not to be so violent!
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2bc3ce3..3f948c3 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -153,7 +153,7 @@ void Avalot::setup() {
 	_vm->_gyro->ledstatus = 177;
 	_vm->_gyro->defaultled = 2;
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_gyro->dna.rw = _vm->_gyro->stopped;
+	_vm->_gyro->dna.rw = _vm->_gyro->kDirectionStopped;
 	_vm->_gyro->enid_filename = ""; // Undefined.
 	_vm->_lucerna->toolbar();
 	_vm->_scrolls->state(2);
@@ -167,7 +167,7 @@ void Avalot::setup() {
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
-	_vm->_trip->tr[0].xs = _vm->_gyro->walk;
+	_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
 	_vm->_trip->newspeed();
 
 
@@ -175,7 +175,7 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {	
 		_vm->_gyro->thinks = 2; // You always have money.
-		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
+		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
@@ -184,7 +184,7 @@ void Avalot::setup() {
 
 		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
 		_vm->_lucerna->fxtoggle();
-		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
+		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->kThing);
 
 		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
 	}	
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index d54e667..a97aa1b 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -459,7 +459,7 @@ void Dropdown::setupMenuAction() {
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_trip->neardoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
+	if (_vm->_trip->tr[0].xs == _vm->_gyro->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -474,7 +474,7 @@ void Dropdown::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (byte i = 150; i <= 178; i++)
-		if (_vm->_gyro->whereis[i - 150] == _vm->_gyro->dna.room) {
+		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->dna.room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getname(i), _vm->_gyro->getnamechar(i), "", true);
 			people = people + i;
 		}
@@ -509,7 +509,7 @@ void Dropdown::setupMenuWith() {
 		// or (c), the _person you've selected is YOU!
 		
 		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing)
-			|| (_vm->_gyro->whereis[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
+			|| (_vm->_gyro->_whereIs[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
@@ -629,10 +629,10 @@ void Dropdown::runMenuAction() {
 		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
-		if (_vm->_trip->tr[0].xs == _vm->_gyro->walk)
-			_vm->_trip->tr[0].xs = _vm->_gyro->run;
+		if (_vm->_trip->tr[0].xs == _vm->_gyro->kWalk)
+			_vm->_trip->tr[0].xs = _vm->_gyro->kRun;
 		else
-			_vm->_trip->tr[0].xs = _vm->_gyro->walk;
+			_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
 		_vm->_trip->newspeed();
 	}
 	break;
@@ -640,11 +640,11 @@ void Dropdown::runMenuAction() {
 }
 
 void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[_activeMenuItem._choiceNum + 1], _vm->_gyro->a_thing);
+	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[_activeMenuItem._choiceNum + 1], _vm->_gyro->kThing);
 }
 
 void Dropdown::runMenuPeople() {
-	_vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->a_person);
+	_vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->kPerson);
 	_vm->_gyro->last_person = people[_activeMenuItem._choiceNum];
 }
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 58a38c7..d154bb0 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -51,103 +51,33 @@ const char *Gyro::vernum = "1.30";
 const char *Gyro::copyright = "1995";
 
 
-const mp Gyro::mps[9] = {
-	{
-		// 1 - up-arrow
-		{	{65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575},
-		{0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0}
-		},	
-			8,
-			0
-	},
-
-	{
-		// 2 - screwdriver
-		{	{8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523},
-		{0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0}
-		},
-			0,
-			0
-	},
-
-	{
-		// 3 - right-arrow
-		{	{65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535},
-		{0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0}	
-		},
-			15,
-			6
-	},
-
-	{
-		// 4 - fletch
-		{	{255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511},
-		{0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0}
-		},
-			0,
-			0
-	},
-
-	{
-		// 5 - hourglass
-		{	{0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0},
-		{0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0}
-		},
-			8,
-			7
-	},
-
-	{
-		// 6 - TTHand
-		{	{62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443},
-		{3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092}
-		},
-			4,
-			0
-	},
-
-	{
-		// 7- Mark's crosshairs
-		{	{65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535},
-		{0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0}
-		},
-			8,
-			5
-	},
-
-	{
-		// 8- I-beam
-		{	{65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535},
-		{0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0}
-		},
-			8,
-			7
-	},
-
-	{
-		// 9 - question mark
-		{	{511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695},
-		{65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840}
-		},
-			0,
-			0
-	}
+const MouseHotspotType Gyro::kMouseHotSpots[9] = {
+	{8,0}, // 1 - up-arrow
+	{0,0}, // 2 - screwdriver
+	{15,6}, // 3 - right-arrow
+	{0,0}, // 4 - fletch
+	{8,7}, // 5 - hourglass
+	{4,0}, // 6 - TTHand
+	{8,5}, // 7- Mark's crosshairs
+	{8,7}, // 8- I-beam
+	{0,0} // 9 - question mark
 };
 
-const Common::String Gyro::lads[17] = {
+const Common::String Gyro::kLads[17] = {
 	"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
 	"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
 	"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
 };
 
-const Common::String Gyro::lasses[4] =
+const Common::String Gyro::kLasses[4] =
 {"Arkata", "Geida", "±", "the Wise Woman"};
 
-const char Gyro::ladchar[] = "ASCDMTRwLfgeIyPu";
+const char Gyro::kLadChar[] = "ASCDMTRwLfgeIyPu";
 
-const char Gyro::lasschar[] = "kG±o";
+const char Gyro::kLassChar[] = "kG±o";
 
-const int32 Gyro::catamap[8][8] = {
+// Art gallery at 2,1; notice about this at 2,2.
+const int32 Gyro::kCatacombMap[8][8] = {
 	// Geida's room
 	// 1     2			3   | 4     5		6		7     8
 	{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
@@ -161,9 +91,45 @@ const int32 Gyro::catamap[8][8] = {
 };
 // vv Stairs trap.
 
-const char Gyro::spludwick_order[3] = {onion, ink, mushroom};
-
-const quasiped_type Gyro::quasipeds[16] = {
+/* Explanation: $NSEW.
+		Nibble N: North.
+		0     = no connection,
+		2     = (left,) middle(, right) door with left-hand handle,
+		5     = (left,) middle(, right) door with right-hand handle,
+		7     = arch,
+		8     = arch and 1 north of it,
+		9     = arch and 2 north of it,
+		D     = no connection + WINDOW,
+		E     = no connection + TORCH,
+		F     = recessed door (to Geida's room.)
+
+		Nibble S: South.
+		0     = no connection,
+		1,2,3 = left, middle, right door.
+
+		Nibble E: East.
+		0     = no connection (wall),
+		1     = no connection (wall + window),
+		2     = wall with door,
+		3     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor.
+
+		Nibble W: West.
+		0     = no connection (wall),
+		1     = no connection (wall + shield),
+		2     = wall with door,
+		3     = wall with door and shield,
+		4     = no connection (window),
+		5     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor. */
+
+const char Gyro::kSpludwicksOrder[3] = {onion, ink, mushroom};
+
+const QuasipedType Gyro::kQuasipeds[16] = {
 	{2, kColorLightgray, 19, kColorBrown, pdogfood},                       // A: Dogfood (screen 19). 
 	{3, kColorGreen,     19, kColorWhite, pibythneth},                     // B: Ibythneth (screen 19).
 	{3, kColorWhite,     1, kColorMagenta, parkata},                       // C: Arkata (screen 1).
@@ -182,18 +148,18 @@ const quasiped_type Gyro::quasipeds[16] = {
 	{2, kColorLightgreen, 51, kColorDarkgray, pdrduck}                     // P: Duck (screen 51).
 };
 
-const char Gyro::keys[] = "QWERTYUIOP[]";
+const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
 
-const uint16 Gyro::notes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+const uint16 Gyro::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
 
-const tunetype Gyro::tune = {
-	higher, higher, lower, same, higher, higher, lower, higher, higher, higher,
-	lower, higher, higher,
-	same, higher, lower, lower, lower, lower, higher, higher, lower, lower, lower,
-	lower, same, lower, higher, same, lower, higher
+const TuneType Gyro::kTune = {
+	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
+	kPitchLower, kPitchHigher, kPitchHigher,
+	kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher, kPitchHigher, kPitchLower, kPitchLower, kPitchLower,
+	kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
 };
 
-byte Gyro::whereis[29] = {
+byte Gyro::_whereIs[29] = {
 	// The Lads
 	r__yours, // Avvy
 	r__spludwicks, // Spludwick
@@ -237,7 +203,7 @@ const Common::String Gyro::better[numobjs] = {
 
 const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
 
-Gyro::Gyro(AvalancheEngine *vm) : interrogation(0), oncandopageswap(true) {
+Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	_vm = vm;
 
 	// Needed because of Lucerna::load_also()
@@ -306,7 +272,7 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 }
 
 void Gyro::newgame() { 
-	for (byte gm = 0; gm < numtr; gm++) {
+	for (byte gm = 0; gm < kMaxSprites; gm++) {
 		if (_vm->_trip->tr[gm].quick)
 			_vm->_trip->tr[gm].done();
 	}
@@ -324,7 +290,7 @@ void Gyro::newgame() {
 	dna.like2drink = "beer";
 
 	dna.pence = 30; // 2/6
-	dna.rw = stopped;
+	dna.rw = kDirectionStopped;
 	dna.wearing = clothes;
 	dna.obj[money - 1] = true;
 	dna.obj[bodkin - 1] = true;
@@ -338,7 +304,7 @@ void Gyro::newgame() {
 	seescroll = false;
 
 	ppos[0][1] = -177; 
-	_vm->_trip->tr[0].appear(300,117,right); // Needed to initialize Avalot.
+	_vm->_trip->tr[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	him = 254;
@@ -401,17 +367,17 @@ bool Gyro::pennycheck(uint16 howmuchby) {
 // Keep an eye open!
 Common::String Gyro::getname(byte whose) { 
 	if (whose < 175)
-		return lads[whose - 150];
+		return kLads[whose - 150];
 	else
-		return lasses[whose - 175];
+		return kLasses[whose - 175];
 }
 
 // Keep an eye open! ^
 byte Gyro::getnamechar(byte whose) {
 	if (whose < 175) 
-		return ladchar[whose - 150];
+		return kLadChar[whose - 150];
 	else
-		return lasschar[whose - 175];
+		return kLassChar[whose - 175];
 }
 
 // Keep an eye open! ^^
@@ -570,7 +536,7 @@ void Gyro::load_a_mouse(byte which) {
 
 
 
-	CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which - 1].horzhotspot, mps[which - 1].verthotspot * 2, 255, false);
+	CursorMan.replaceCursor(cursor.pixels, 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
 
 	cursor.free();
 }
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index c11eb38..5ae62d2 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -49,14 +49,8 @@ static const int16 maxobjs = 12;  // carry limit
 static const int16 numlockCode = 32;  // Code for Num Lock
 static const int16 mouse_size = 134;
 
-struct postype {
-	uint16 x, y, datapos;
-	byte length;
-};
-
-struct mp { // mouse-void 
-	uint16 mask[2][16];
-	int16 horzhotspot, verthotspot;
+struct MouseHotspotType { // mouse-void 
+	int16 _horizontal, _vertical;
 };
 
 struct dnatype { // here goes... Ux, uy, & ww now all belong to Trip5
@@ -208,7 +202,7 @@ struct demo_type {
 	char key, extd;
 };
 
-struct quasiped_type {
+struct QuasipedType {
 	byte whichped, fgc, room, bgc;
 	uint16 who;
 };
@@ -216,7 +210,7 @@ struct quasiped_type {
 	quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
 	that to context. */
 
-typedef byte tunetype[31];
+typedef byte TuneType[31];
 
 
 struct PointType {
@@ -334,126 +328,80 @@ public:
 
 	static const int16 margin = 5;
 
-	static const mp mps[9];
+	static const MouseHotspotType kMouseHotSpots[9];
 
-	static const Common::String lads[17];
+	static const Common::String kLads[17];
 
-	static const Common::String lasses[4];
+	static const Common::String kLasses[4];
 
-	static const char ladchar[];
+	static const char kLadChar[];
 
-	static const char lasschar[];
+	static const char kLassChar[];
 
-	static const int16 numtr = 2; // current max no. of sprites
+	static const int16 kMaxSprites = 2; // Current max no. of sprites.
 
-	static const bool a_thing = true;
-	static const bool a_person = false; // for Thinkabout
+	// For Thinkabout:
+	static const bool kThing = true;
+	static const bool kPerson = false; 
 
-	// Magic/portal commands are
+	// Magic/portal constants:
+	enum Magics {
+		kMagicNothing, // Ignore it if this line is touched.
+		kMagicBounce, // Bounce off this line. Not valid for portals.
+		kMagicExclaim, // Put up a chain of scrolls.
+		kMagicTransport, // Enter new room.
+		kMagicUnfinished, // Unfinished connection.
+		kMagicSpecial, // Special function.
+		kMagicOpenDoor // Opening door.
+	};
+	
+	// These following static constants should be included in CFG when it's written.
 
-	/*N*/ static const int16 nix = 0; // ignore it if this line is touched
-	/*B*/ static const int16 bounces = 1; // bounce off this line. Not valid for portals.
-	/*E*/ static const int16 exclaim = 2; // put up a chain of scrolls
-	/*T*/ static const int16 transport = 3; // enter new room
-	/*U*/ static const int16 unfinished = 4; // unfinished connection
-	/*S*/ static const int16 special = 5; // special function.
-	/*O*/ static const int16 mopendoor = 6; // opening door.
+	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
 
-	// These following static constants should be included in CFG when it's written.
+	static const int16 kBorder = 1; // size of border on shadowboxes
 
-	static const bool slow_computer = false; // stops walking when mouse touches toolbar
-
-	/* --- */
-
-	static const int16 border = 1; // size of border on shadowboxes
-
-	static const int32 pagetop = 81920;
-
-	static const int16 up = 0;
-	static const int16 right = 1;
-	static const int16 down = 2;
-	static const int16 left = 3;
-	static const int16 ur = 4;
-	static const int16 dr = 5;
-	static const int16 dl = 6;
-	static const int16 ul = 7;
-	static const int16 stopped = 8;
-
-	static const int16 walk = 3;
-	static const int16 run = 5;
-
-	// Art gallery at 2,1; notice about this at 2,2.
-
-	static const int32 catamap[8][8];
-
-	/* Explanation: $NSEW.
-		Nibble N: North.
-		0     = no connection,
-		2     = (left,) middle(, right) door with left-hand handle,
-		5     = (left,) middle(, right) door with right-hand handle,
-		7     = arch,
-		8     = arch and 1 north of it,
-		9     = arch and 2 north of it,
-		D     = no connection + WINDOW,
-		E     = no connection + TORCH,
-		F     = recessed door (to Geida's room.)
-
-		Nibble S: South.
-		0     = no connection,
-		1,2,3 = left, middle, right door.
-
-		Nibble E: East.
-		0     = no connection (wall),
-		1     = no connection (wall + window),
-		2     = wall with door,
-		3     = wall with door and window,
-		6     = wall with candles,
-		7     = wall with door and candles,
-		F     = straight-through corridor.
-
-		Nibble W: West.
-		0     = no connection (wall),
-		1     = no connection (wall + shield),
-		2     = wall with door,
-		3     = wall with door and shield,
-		4     = no connection (window),
-		5     = wall with door and window,
-		6     = wall with candles,
-		7     = wall with door and candles,
-		F     = straight-through corridor. */
-
-	static const bool demo = false; // If this is true, we're in a demo of the game.
-
-	static const char spludwick_order[3];
-	 
-	static const quasiped_type quasipeds[16];
+	enum Direction {
+		kDirectionUp, kDirectionRight, kDirectionDown, kDirectionLeft,
+		kDirectionUpRight, kDirectionDownRight, kDirectionDownLeft, kDirectionUpLeft,
+		kDirectionStopped
+	};
+
+	static const int16 kWalk = 3;
+	static const int16 kRun = 5;
+
+	static const int32 kCatacombMap[8][8];
 
-	static const int16 lower = 0;
-	static const int16 same = 1;
-	static const int16 higher = 2;
+	static const bool kDemo = false; // If this is true, we're in a demo of the game.
+
+	static const char kSpludwicksOrder[3];
+	 
+	static const QuasipedType kQuasipeds[16];
 
-	static const char keys[];
-	static const uint16 notes[12];
+	enum Pitch {
+		kPitchLower,
+		kPitchSame,
+		kPitchHigher
+	};
 
-	static const tunetype tune;
+	static const char kMusicKeys[];
+	static const uint16 kNotes[12];
 
-	// special run-time errors
+	static const TuneType kTune;
 
-	static const int16 runerr_getset_overflow = 50;
 
 
 
 
 
 
-	byte interrogation;
-	/* If this is greater than zero, the next line you type is stored in
-		the DNA in a position dictated by the value. If a scroll comes up,
-		or you leave the room, it's automatically set to zero. */
+	byte _interrogation;
+	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
+	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 
-	static byte whereis[29];
+	static byte _whereIs[29];
 
-	bool oncandopageswap; 
+	bool _onCanDoPageSwap; 
 	// Variable static constant for overriding the ability of On to switch pages.
 	// You may know better than On which page to switch to.
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index fe604cc..f4c5830 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -274,7 +274,7 @@ void Lucerna::zoomout(int16 x, int16 y) {
 
 void Lucerna::find_people(byte room) {
 	for (byte fv = 1; fv < 29; fv++)
-		if (_vm->_gyro->whereis[fv] == room) {
+		if (_vm->_gyro->_whereIs[fv] == room) {
 			if (fv < 25)
 				_vm->_gyro->him = fv + 150;
 			else
@@ -307,7 +307,7 @@ void Lucerna::exitroom(byte x) {
 		break;
 	}
 
-	_vm->_gyro->interrogation = 0; // Leaving the room cancels all the questions automatically.
+	_vm->_gyro->_interrogation = 0; // Leaving the room cancels all the questions automatically.
 
 	_vm->_gyro->seescroll = false; // Now it can work again!
 
@@ -368,10 +368,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 	if ((_vm->_gyro->dna.rooms[x] == 0) && (! _vm->_gyro->flagset('S')))
 		points(1);
 
-	_vm->_gyro->whereis[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
+	_vm->_gyro->_whereIs[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
 
 	if (_vm->_gyro->dna.geida_follows)
-		_vm->_gyro->whereis[_vm->_gyro->pgeida - 150] = x;
+		_vm->_gyro->_whereIs[_vm->_gyro->pgeida - 150] = x;
 
 	_vm->_gyro->roomtime = 0;
 
@@ -393,7 +393,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.talked_to_crapulus) {
 
-				_vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__outsideyours;
+				_vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = r__outsideyours;
 				_vm->_trip->tr[1].init(8, false, _vm->_trip); // load Crapulus
 
 				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
@@ -407,7 +407,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // He always faces Avvy.
 
-			} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = r__nowhere;
+			} else _vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->dna.crapulus_will_tell) {
 				_vm->_trip->tr[1].init(8, false, _vm->_trip);
@@ -431,7 +431,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(2, false, _vm->_trip); // load Spludwick
 				_vm->_trip->apped(2, 2);
-				_vm->_gyro->whereis[1] = r__spludwicks;
+				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
 			_vm->_gyro->dna.dogfoodpos = 0;  // _vm->_gyro->also Spludwick pos.
@@ -439,21 +439,21 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_trip->tr[1].call_eachstep = true;
 			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
 		} else
-			_vm->_gyro->whereis[1] = r__nowhere;
+			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
 
 	case r__brummieroad: {
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(5, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
-			_vm->_gyro->magics[kColorLightred - 1].op = _vm->_gyro->nix;
-			_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__nowhere;
+			_vm->_gyro->magics[kColorLightred - 1].op = _vm->_gyro->kMagicNothing;
+			_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
-				_vm->_gyro->whereis[_vm->_gyro->pcwytalot - 150] = r__brummieroad;
+				_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { // First time here...
 					_vm->_trip->apped(2, 2); // He appears on the right of the screen...
@@ -486,7 +486,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.drawbridge_open == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->magics[kColorGreen - 1].op = _vm->_gyro->nix; // You may enter the drawbridge.
+			_vm->_gyro->magics[kColorGreen - 1].op = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(ped + 3, ped); // load Geida
@@ -505,8 +505,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		if (_vm->_gyro->dna.been_tied_up) {
-			_vm->_gyro->whereis[_vm->_gyro->probinhood - 150] = 0;
-			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 0;
+			_vm->_gyro->_whereIs[_vm->_gyro->probinhood - 150] = 0;
+			_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = 0;
 		}
 
 		if (_vm->_gyro->dna.tied_up)
@@ -529,7 +529,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 			break;
 			case 5 :
-				_vm->_gyro->magics[1].op = _vm->_gyro->nix;
+				_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: { // You've answered SOME of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
@@ -539,8 +539,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 			}
 		if (_vm->_gyro->dna.cardiff_things < 5)
-			_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
-		else _vm->_gyro->interrogation = 0;
+			_vm->_gyro->_interrogation = _vm->_gyro->dna.cardiff_things;
+		else _vm->_gyro->_interrogation = 0;
 	}
 	break;
 
@@ -628,8 +628,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-			_vm->_gyro->magics[kColorBrown - 1].op = _vm->_gyro->nix;
-			_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0;
+			_vm->_gyro->magics[kColorBrown - 1].op = _vm->_gyro->kMagicNothing;
+			_vm->_gyro->_whereIs[_vm->_gyro->pjacques - 150] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
@@ -903,7 +903,7 @@ void Lucerna::showscore() {
 
 	const bytefield scorespace = {33, 177, 39, 200};
 
-	if (_vm->_gyro->demo)
+	if (_vm->_gyro->kDemo)
 		return;
 
 	uint16 score = _vm->_gyro->dna.score;
@@ -1006,7 +1006,7 @@ void Lucerna::fxtoggle() {
 void Lucerna::objectlist() {
 	_vm->_gyro->dna.carrying = 0;
 	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks - 1])
-		thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); // you always have money
+		thinkabout(_vm->_gyro->money, _vm->_gyro->kThing); // you always have money
 	for (byte fv = 0; fv < numobjs; fv++)
 		if (_vm->_gyro->dna.obj[fv]) {
 			_vm->_gyro->dna.carrying++;
@@ -1069,7 +1069,7 @@ void Lucerna::verte(Common::Point cursorPos) {
 
 void Lucerna::checkclick() {
 	Common::Point cursorPos = _vm->getMousePos();
-	_vm->_gyro->ontoolbar = _vm->_gyro->slow_computer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
+	_vm->_gyro->ontoolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 	
 	/*if (_vm->_gyro->mrelease > 0)
 	_vm->_gyro->after_the_scroll = false;*/
@@ -1125,10 +1125,10 @@ void Lucerna::checkclick() {
 
 				callverb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_trip->tr[0].xs = _vm->_gyro->walk;
+				_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
 				_vm->_trip->newspeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_trip->tr[0].xs = _vm->_gyro->run;
+				_vm->_trip->tr[0].xs = _vm->_gyro->kRun;
 				_vm->_trip->newspeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxtoggle();
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 078963a..4cab87a 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -227,7 +227,7 @@ void Timeout::open_drawbridge() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
 
 	if (_vm->_gyro->dna.drawbridge_open == 4)
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix; // You may enter the drawbridge.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 	else
 		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
@@ -267,9 +267,9 @@ void Timeout::stairs() {
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->dna.brummie_stairs = 2;
-	_vm->_gyro->magics[10].op = _vm->_gyro->special;
+	_vm->_gyro->magics[10].op = _vm->_gyro->kMagicSpecial;
 	_vm->_gyro->magics[10].data = 2; // Reached the bottom of the stairs.
-	_vm->_gyro->magics[3].op = _vm->_gyro->nix; // Stop them hitting the sides (or the game will hang.)
+	_vm->_gyro->magics[3].op = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timeout::cardiff_survey() {
@@ -280,7 +280,7 @@ void Timeout::cardiff_survey() {
 
 	_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
 
-	_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
+	_vm->_gyro->_interrogation = _vm->_gyro->dna.cardiff_things;
 
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
@@ -309,14 +309,14 @@ void Timeout::get_tied_up() {
 void Timeout::get_tied_up2() {
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_trip->tr[1].walkto(5);
-	_vm->_gyro->magics[3].op = _vm->_gyro->nix; // No effect when you touch the boundaries.
+	_vm->_gyro->magics[3].op = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->dna.friar_will_tie_you_up = true;
 }
 
 void Timeout::hang_around() {
 	_vm->_trip->tr[1].check_me = false;
 	_vm->_trip->tr[0].init(7, true, _vm->_trip); // Robin Hood
-	_vm->_gyro->whereis[_vm->_gyro->probinhood - 150] = r__robins;
+	_vm->_gyro->_whereIs[_vm->_gyro->probinhood - 150] = r__robins;
 	_vm->_trip->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
 	_vm->_trip->tr[0].walkto(7);
@@ -327,7 +327,7 @@ void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
 	_vm->_trip->tr[1].vanishifstill = false;
 	_vm->_trip->tr[1].walkto(4);
-	_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = r__robins;
+	_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
@@ -387,12 +387,12 @@ void Timeout::jacques_wakes_up() {
 	case 2 : // Going through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // You can't wake him up now.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
-		_vm->_gyro->whereis[_vm->_gyro->pjacques - 150] = 0; // Gone!
+		_vm->_gyro->_whereIs[_vm->_gyro->pjacques - 150] = 0; // Gone!
 		break;
 	}
 
@@ -529,7 +529,7 @@ void Timeout::greetsmonk() {
 }
 
 void Timeout::fall_down_oubliette() {
-	_vm->_gyro->magics[8].op = _vm->_gyro->nix;
+	_vm->_gyro->magics[8].op = _vm->_gyro->kMagicNothing;
 	_vm->_trip->tr[0].iy++; // Increments dx/dy!
 	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   // Dowwwn we go...
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 6a1aedd..0e16c77 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -217,27 +217,27 @@ void triptype::walk() {
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
 			switch (_tr->_vm->_gyro->magics[tc].op) {
-			case Gyro::exclaim: {
+			case Gyro::kMagicExclaim: {
 				bounce();
 				_tr->mustexclaim = true;
 				_tr->saywhat = _tr->_vm->_gyro->magics[tc].data;
 				}
 				break;
-			case Gyro::bounces:
+			case Gyro::kMagicBounce:
 				bounce();
 				break;
-			case Gyro::transport:
+			case Gyro::kMagicTransport:
 				_tr->fliproom(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff);
 				break;
-			case Gyro::unfinished: {
+			case Gyro::kMagicUnfinished: {
 				bounce();
 				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
-			case Gyro::special:
+			case Gyro::kMagicSpecial:
 				_tr->call_special(_tr->_vm->_gyro->magics[tc].data);
 				break;
-			case Gyro::mopendoor:
+			case Gyro::kMagicOpenDoor:
 				_tr->open_the_door(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff, tc);
 				break;
 			}
@@ -262,9 +262,9 @@ void triptype::bounce() {
 		_tr->stopwalking();
 	else
 		stopwalk();
-	_tr->_vm->_gyro->oncandopageswap = false;
+	_tr->_vm->_gyro->_onCanDoPageSwap = false;
 	_tr->_vm->_lucerna->showrw();
-	_tr->_vm->_gyro->oncandopageswap = true;
+	_tr->_vm->_gyro->_onCanDoPageSwap = true;
 }
 
 int8 triptype::sgn(int16 val) {
@@ -566,70 +566,70 @@ void Trip::catamove(byte ped) {
 
 	if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
 		_vm->_lucerna->load(29);
-	here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1];
+	here = _vm->_gyro->kCatacombMap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->nix; // No door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->magics[1].op = _vm->_gyro->nix; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->special; // Straight wall.
+		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -637,52 +637,52 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // No door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->nix; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->magics[4].op = _vm->_gyro->nix; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->special; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicSpecial; // Straight wall.
+		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
 		break;
 	}
 
@@ -690,39 +690,39 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 			
 		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
-			_vm->_gyro->magics[12].op = _vm->_gyro->exclaim;
+			_vm->_gyro->magics[12].op = _vm->_gyro->kMagicExclaim;
 		else
-			_vm->_gyro->magics[12].op = _vm->_gyro->special; // Right exit south.
+			_vm->_gyro->magics[12].op = _vm->_gyro->kMagicSpecial; // Right exit south.
 
-		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->magics[6].op = _vm->_gyro->special; // Middle exit south.
-		_vm->_gyro->magics[11].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicSpecial; // Middle exit south.
+		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
-		_vm->_gyro->magics[11].op = _vm->_gyro->special; // Left exit south.
-		_vm->_gyro->magics[6].op = _vm->_gyro->bounces;
-		_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
+		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicSpecial; // Left exit south.
+		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
 		break;
 	// LEFT handles: 
 #if 0
@@ -734,8 +734,8 @@ void Trip::catamove(byte ped) {
 #endif
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
@@ -752,8 +752,8 @@ void Trip::catamove(byte ped) {
 #endif
 	case 0x5:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces; // Middle exit north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
@@ -773,26 +773,26 @@ void Trip::catamove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
 
-		_vm->_gyro->magics[0].op = _vm->_gyro->special; // Middle arch north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicSpecial; // Middle arch north.
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
 	}
 	break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_gyro->magics[0].op = _vm->_gyro->bounces;
-		_vm->_gyro->portals[3].op = _vm->_gyro->nix; // Door.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_gyro->magics[0].op = _vm->_gyro->nix; // Door to Geida's room.
+		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicNothing; // Door to Geida's room.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->portals[3].op = _vm->_gyro->special; // Door.
+		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 	}
 
@@ -849,17 +849,17 @@ void Trip::call_special(uint16 which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->dna.brummie_stairs = 1;
-		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[9].op = _vm->_gyro->kMagicNothing;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
 		stopwalking();
 		_vm->_gyro->dna.user_moves_avvy = false;
 		break;
 	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
 		_vm->_gyro->dna.brummie_stairs = 3;
-		_vm->_gyro->magics[10].op = _vm->_gyro->nix;
-		_vm->_gyro->magics[11].op = _vm->_gyro->exclaim;
+		_vm->_gyro->magics[10].op = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicExclaim;
 		_vm->_gyro->magics[11].data = 5;
-		_vm->_gyro->magics[3].op = _vm->_gyro->bounces; // Now works as planned!
+		_vm->_gyro->magics[3].op = _vm->_gyro->kMagicBounce; // Now works as planned!
 		stopwalking();
 		_vm->_visa->dixi('q', 26);
 		_vm->_gyro->dna.user_moves_avvy = true;
@@ -890,7 +890,7 @@ void Trip::call_special(uint16 which) {
 	case 5:
 		if (_vm->_gyro->dna.friar_will_tie_you_up) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
-			_vm->_gyro->magics[4].op = _vm->_gyro->bounces; // Boundary effect is now working again.
+			_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->dixi('q', 35);
 			tr[0].done();
 			//tr[1].vanishifstill:=true;
@@ -901,7 +901,7 @@ void Trip::call_special(uint16 which) {
 			tr[1].walkto(3);
 			tr[1].vanishifstill = true;
 			tr[1].check_me = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->whereis[_vm->_gyro->pfriartuck - 150] = 177; // Not here, then.
+			_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = 177; // Not here, then.
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
@@ -914,7 +914,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0].visible = false;
-		_vm->_gyro->magics[9].op = _vm->_gyro->nix;
+		_vm->_gyro->magics[9].op = _vm->_gyro->kMagicNothing;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
@@ -956,7 +956,7 @@ void Trip::call_special(uint16 which) {
 		if (_vm->_gyro->dna.room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
-		switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1] & 0xf00) >> 8) {
+		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
 			break;
@@ -1073,12 +1073,12 @@ void Trip::newspeed() {
 
 	//setactivepage(3);
 
-	if (tr[0].xs == _vm->_gyro->run)
+	if (tr[0].xs == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
 
-	if (tr[0].xs == _vm->_gyro->run)
+	if (tr[0].xs == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);


Commit: 82484b139a6bf46d9e2293da0808ea989131579f
    https://github.com/scummvm/scummvm/commit/82484b139a6bf46d9e2293da0808ea989131579f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-05T14:58:32-07:00

Commit Message:
AVALANCHE: More renaming in Gyro.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 06ac30e..100f468 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -464,7 +464,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_dropdown->setupMenu();
 
-	_gyro->whereis[0] = _gyro->dna.room;
+	_gyro->_whereIs[0] = _gyro->dna.room;
 	
 	_gyro->alive = true;
 
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 05065d5..c9ad3cf 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -254,7 +254,7 @@ void Celer::updateBackgroundSprites() {
 			if (_vm->_gyro->dna.nextbell < 5)
 				_vm->_gyro->dna.nextbell = 12;
 			_vm->_gyro->dna.nextbell--;
-			_vm->_gyro->note(_vm->_gyro->notes[_vm->_gyro->dna.nextbell]);
+			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->dna.nextbell]);
 			break;
 		case 2:
 			//nosound();
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index ef5a90d..5642018 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -277,7 +277,7 @@ void Enid::ednaReload() {
 
 	_vm->_lucerna->major_redraw();
 
-	_vm->_gyro->whereis[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
+	_vm->_gyro->_whereIs[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
 
 	_vm->_gyro->alive = true;
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 147bc21..350e9f7 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -199,18 +199,18 @@ void Scrolls::dialogue() {
 
 
 
-void Scrolls::store_(byte what, tunetype &played) {
+void Scrolls::store_(byte what, TuneType &played) {
 	memcpy(played + 1, played + 2, sizeof(played) - 1);
 	played[30] = what;
 }
 
-bool Scrolls::they_match(tunetype &played) {
+bool Scrolls::they_match(TuneType &played) {
 	byte fv, mistakes;
 
 	mistakes = 0;
 
 	for (fv = 1; fv <= sizeof(played); fv++) {
-		if (played[fv] != _vm->_gyro->tune[fv]) {
+		if (played[fv] != _vm->_gyro->kTune[fv]) {
 			mistakes += 1;
 		}
 	}
@@ -253,7 +253,7 @@ void Scrolls::resetscrolldriver() {   // phew
 	_vm->_gyro->scrollbells = 0;
 	cfont = roman;
 	use_icon = 0;
-	_vm->_gyro->interrogation = 0; // always reset after a scroll comes up.
+	_vm->_gyro->_interrogation = 0; // always reset after a scroll comes up.
 }
 
 void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little...
@@ -331,7 +331,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
-	_vm->_gyro->oncandopageswap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
+	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
 
 	lx = 0;
 	ly = (_vm->_gyro->scrolln) * 6;
@@ -457,7 +457,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	// mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);
 	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
 	//blitfix();
-	_vm->_gyro->oncandopageswap = true; // Normality again.
+	_vm->_gyro->_onCanDoPageSwap = true; // Normality again.
 	CursorMan.showMouse(true);
 	//settextjustify(0, 0); // sink
 	resetscrolldriver();
@@ -475,7 +475,7 @@ void Scrolls::bubble(func2 gotoit) {
 
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
-	_vm->_gyro->oncandopageswap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
+	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
 	//mousepage(1 - cp); // Mousepage
 
 	CursorMan.showMouse(false);
@@ -539,7 +539,7 @@ void Scrolls::bubble(func2 gotoit) {
 
 	//setvisualpage(1 - cp);
 	dingdongbell();
-	_vm->_gyro->oncandopageswap = false;
+	_vm->_gyro->_onCanDoPageSwap = false;
 	CursorMan.showMouse(true);
 	_vm->_gyro->dropsok = false;
 
@@ -551,7 +551,7 @@ void Scrolls::bubble(func2 gotoit) {
 
 	//setvisualpage(cp);
 	CursorMan.showMouse(true); // sink;
-	_vm->_gyro->oncandopageswap = true;
+	_vm->_gyro->_onCanDoPageSwap = true;
 	resetscrolldriver();
 	if (_vm->_gyro->mpress > 0)
 		_vm->_gyro->after_the_scroll = true;
@@ -700,11 +700,11 @@ void Scrolls::calldrivers() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].x;
-					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->quasipeds[param - 10].whichped - 1].y; // Position.
+					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->kQuasipeds[param - 10].whichped - 1].x;
+					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->kQuasipeds[param - 10].whichped - 1].y; // Position.
 		
-					_vm->_gyro->talkf = _vm->_gyro->quasipeds[param - 10].fgc;
-					_vm->_gyro->talkb = _vm->_gyro->quasipeds[param - 10].bgc; // Colors.
+					_vm->_gyro->talkf = _vm->_gyro->kQuasipeds[param - 10].fgc;
+					_vm->_gyro->talkb = _vm->_gyro->kQuasipeds[param - 10].bgc; // Colors.
 				} else {
 					_vm->_lucerna->errorled(); // Not valid.
 					natural();
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 0238d33..362000b 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -123,9 +123,9 @@ private:
 
 	void dialogue();
 
-	void store_(byte what, tunetype &played);
+	void store_(byte what, TuneType &played);
 
-	bool they_match(tunetype &played);
+	bool they_match(TuneType &played);
 
 	void music_scroll();
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 1de48fd..fe31cc2 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -185,7 +185,7 @@ void Visa::talkto(byte whom) {
 					switch (_vm->_gyro->dna.given2spludwick) { 
 					case 1: // Falltrough is intended.
 					case 2:{
-						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->get_better(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 						return;
 						}
 						break;
@@ -281,7 +281,7 @@ void Visa::talkto(byte whom) {
 		dixi('q', 1); // Circular from Cardiff.
 		_vm->_gyro->dna.talked_to_crapulus = true;
 
-		_vm->_gyro->whereis[_vm->_gyro->pcrapulus - 150] = 177; // Crapulus walks off.
+		_vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_trip->tr[1].vanishifstill = true;
 		_vm->_trip->tr[1].walkto(3); // Walks away.


Commit: dd897be038e795612f756914253b0be9f7cedd00
    https://github.com/scummvm/scummvm/commit/dd897be038e795612f756914253b0be9f7cedd00
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-05T15:17:13-07:00

Commit Message:
AVALANCHE: Identify currently dead code in enid2

Changed paths:
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h



diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 5642018..be98b4e 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -45,6 +45,8 @@ Enid::Enid(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+//  CHECKME: useless?
+#if 0
 const Common::String Enid::kCrlf = Common::String(char(15)) + Common::String(char(12));
 const char Enid::kTab = '\t';
 const char Enid::kEof = '\n';
@@ -60,17 +62,16 @@ const Common::String Enid::kEdnaFirst =
 	"1234567890" +kCrlf; // 11
 
 const Common::String Enid::kEdnaId = Common::String("TT\xB1\x30\x01\x75\xB1\x99\xB1");
-
 const int16 Enid::kAge = 18;
 const Common::String Enid::kWasHere = "Thomas was here ";
-
 const Enid::FourType Enid::kAvariciusFile = "Avvy";
 
-
-
-void Enid::addon(Common::String x) {
-	//month[0]--;
-	_month = _month + x;
+/**
+ * Expand month name
+ * @remarks	Originally called 'addon'
+ */
+void Enid::expandMonthName(Common::String x) {
+	_month += x;
 }
 
 Common::String Enid::expandDate(byte d, byte m, uint16 y) {
@@ -83,10 +84,10 @@ Common::String Enid::expandDate(byte d, byte m, uint16 y) {
 	_month = months[m];
 	switch (_month[_month.size()]) {
 	case '#':
-		addon("uary");
+		expandMonthName("uary");
 		break;
 	case '*':
-		addon("ber");
+		expandMonthName("ber");
 		break;
 	}
 
@@ -161,10 +162,6 @@ void Enid::showHeader() {
 	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
 }
 
-void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
-	warning("STUB: Enid::dir()");
-}
-
 void Enid::avvyBackground() {    
 	// Not really a filing procedure,
 	// but it's only called just before edna_load, so I thought I'd put it
@@ -289,13 +286,17 @@ void Enid::ednaReload() {
 	}
 }
 
-void Enid::backToBootstrap(byte what) {
-	warning("STUB: Enid::back_to_bootstrap()");
-}
-
 bool Enid::thereWasAProblem() {
 	return _bug;
 }
 
+#endif
+
+void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
+	warning("STUB: Enid::dir()");
+}
+void Enid::backToBootstrap(byte what) {
+	warning("STUB: Enid::back_to_bootstrap()");
+}
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 6f76a74..1cf14d1 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -38,42 +38,39 @@ class AvalancheEngine;
 class Enid {
 public:
 	Enid(AvalancheEngine *vm);
-	void ednaSave(Common::String name);
-	void ednaLoad(Common::String name);
-	void ednaReload(); // From Bootstrap's storage.
 	void dir(Common::String where);
-	void avvyBackground();
 	void backToBootstrap(byte what);
-	bool thereWasAProblem();
 
 private:
 	AvalancheEngine *_vm;
 
-	static const Common::String kCrlf;
-	static const char kTab, kEof;
-	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
-	static const int16 kAge;
+//  CHECKME: useless?
+//	static const Common::String kCrlf;
+//	static const char kTab, kEof;
+//	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
+//	static const int16 kAge;
+//	void expandMonthName(Common::String x);
+//	Common::String expandDate(byte d, byte m, uint16 y);
+//	void ednaSave(Common::String name);
+//	void showBug(char icon, Common::String strn);
+//	bool testBug(byte what);
+//	void loadError(Common::String x, char icon);
+//	void ednaLoad(Common::String name);
+//	void showHeader();
+//	void toSundry(sundry &sund);
+//	void fromSundry(sundry sund);
+//	void avvyBackground();
+//	void ednaReload(); // From Bootstrap's storage.
+//	void restoreDna();
+//	bool thereWasAProblem();
+
+//	typedef char FourType[5];
+//	static const FourType kAvariciusFile;
+
+//	bool _bug;
+//	Common::String _path, _groi;
+//	Common::String _month, _day;
 
-	typedef char FourType[5];
-	static const FourType kAvariciusFile;
-
-	bool _bug;
-	Common::String _path, _groi;
-	Common::String _month, _day;
-
-	void addon(Common::String x);
-	Common::String expandDate(byte d, byte m, uint16 y);
-
-	void showBug(char icon, Common::String strn);
-	bool testBug(byte what);
-
-	void loadError(Common::String x, char icon);
-	void showHeader();
-
-	void toSundry(sundry &sund);
-	void fromSundry(sundry sund);
-
-	void restoreDna();
 };
 
 } // End of namespace Avalanche.


Commit: 56ce2398d8d20bbafe7659078fa6836a47520b15
    https://github.com/scummvm/scummvm/commit/56ce2398d8d20bbafe7659078fa6836a47520b15
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-05T15:22:05-07:00

Commit Message:
AVALANCHE: Remove 2 high-ascii characters

Changed paths:
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index d154bb0..a1efe5b 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -70,11 +70,11 @@ const Common::String Gyro::kLads[17] = {
 };
 
 const Common::String Gyro::kLasses[4] =
-{"Arkata", "Geida", "±", "the Wise Woman"};
+{"Arkata", "Geida", "\0xB1", "the Wise Woman"};
 
 const char Gyro::kLadChar[] = "ASCDMTRwLfgeIyPu";
 
-const char Gyro::kLassChar[] = "kG±o";
+const char Gyro::kLassChar[] = "kG\0xB1o";
 
 // Art gallery at 2,1; notice about this at 2,2.
 const int32 Gyro::kCatacombMap[8][8] = {


Commit: 95a4ccac510747409a42420992bd90884984f798
    https://github.com/scummvm/scummvm/commit/95a4ccac510747409a42420992bd90884984f798
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-05T22:52:02-07:00

Commit Message:
AVALANCHE: Some renaming in lucerna2

Changed paths:
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/parser.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index a97aa1b..c207fda 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -555,19 +555,19 @@ void Dropdown::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeHelp);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBoss);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBoss);
 		break;
 	case 2:
 		_vm->_lucerna->major_redraw();
 		break;
 	case 3:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeScore);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeInfo);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInfo);
 		break;
 	}
 }
@@ -576,18 +576,18 @@ void Dropdown::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeRestart);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeRestart);
 		break;
 	case 1: {
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeLoad);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeLoad);
 	}
 	break;
 	case 2: {
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeSave);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeSave);
 	}
 	break;
 	case 3:
@@ -598,7 +598,7 @@ void Dropdown::runMenuFile() {
 		_vm->_enid->backToBootstrap(2);
 		break;
 	case 5:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeQuit);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeQuit);
 		break;
 	}
 }
@@ -611,22 +611,22 @@ void Dropdown::runMenuAction() {
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
 		f5Does = _vm->_gyro->f5_does();
-		_vm->_lucerna->callverb(f5Does[0]);
+		_vm->_lucerna->callVerb(f5Does[0]);
 	}
 	break;
 	case 1:
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodePause);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodePause);
 		break;
 	case 2:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeOpen);
 		break;
 	case 3:
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeLook);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeInv);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
 		if (_vm->_trip->tr[0].xs == _vm->_gyro->kWalk)
@@ -664,37 +664,37 @@ void Dropdown::runMenuWith() {
 		switch (_vm->_gyro->verbstr[_activeMenuItem._choiceNum]) {
 		case 100: { // Beer
 			_vm->_acci->_thing = 100;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 101: { // Wine
 			_vm->_acci->_thing = 50;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 102: { // Whisky
 			_vm->_acci->_thing = 102;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 103: { // Cider
 			_vm->_acci->_thing = 103;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 104: { // Mead
 			_vm->_acci->_thing = 107;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
 		case 105: { // Onion (trader)
 			_vm->_acci->_thing = 67;
-			_vm->_lucerna->callverb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
 		break; 
@@ -705,7 +705,7 @@ void Dropdown::runMenuWith() {
 		}
 		}
 	}
-	_vm->_lucerna->callverb(_vm->_gyro->verbstr[_activeMenuItem._choiceNum]);
+	_vm->_lucerna->callVerb(_vm->_gyro->verbstr[_activeMenuItem._choiceNum]);
 }
 
 void Dropdown::setupMenu() {   
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index a1efe5b..3badc23 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -235,7 +235,11 @@ void Gyro::newpointer(byte id) {
 	load_a_mouse(id);
 }
 
-void Gyro::wait() {
+/**
+ * Set the mouse pointer to 'HourGlass"
+ * @remarks	Originally called 'wait'
+ */
+void Gyro::setMousePointerWait() {
 	newpointer(5);
 }
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 5ae62d2..bd2e9b1 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -543,7 +543,7 @@ public:
 
 	void newpointer(byte id);
 
-	void wait();    // Makes hourglass.
+	void setMousePointerWait();    // Makes hourglass.
 
 	void on();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index f4c5830..c4dc6fc 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -81,8 +81,12 @@ void Lucerna::init() {
 #endif
 }
 	
-void Lucerna::callverb(byte n) {
-	if (n == _vm->_acci->kPardon) {
+/**
+ * Call a given Verb
+ * @remarks	Originally called 'callverb'
+ */
+void Lucerna::callVerb(byte id) {
+	if (id == _vm->_acci->kPardon) {
 		_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
 			"situations. However, at the moment there is nothing " +
 			"assigned to it. You may press alt-A to see what the " +
@@ -90,7 +94,7 @@ void Lucerna::callverb(byte n) {
 	} else {
 		_vm->_gyro->weirdword = false;
 		_vm->_acci->_polite = true;
-		_vm->_acci->_verb = n;
+		_vm->_acci->_verb = id;
 		_vm->_acci->doThat();
 	}
 }
@@ -273,13 +277,14 @@ void Lucerna::zoomout(int16 x, int16 y) {
 }
 
 void Lucerna::find_people(byte room) {
-	for (byte fv = 1; fv < 29; fv++)
+	for (byte fv = 1; fv < 29; fv++) {
 		if (_vm->_gyro->_whereIs[fv] == room) {
 			if (fv < 25)
 				_vm->_gyro->him = fv + 150;
 			else
 				_vm->_gyro->her = fv + 150;
 		}
+	}
 }
 
 void Lucerna::exitroom(byte x) {
@@ -442,7 +447,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
 
-	case r__brummieroad: {
+	case r__brummieroad:
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(5, ped);
 		if (_vm->_gyro->dna.cwytalot_gone) {
@@ -465,10 +470,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 				}
 			}
 		}
-	}
-	break;
+		break;
 
-	case r__argentroad: {
+	case r__argentroad:
 		if ((_vm->_gyro->dna.cwytalot_gone) && (! _vm->_gyro->dna.cwytalot_in_herts) && (ped == 2) &&
 		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
 			_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot again
@@ -479,10 +483,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
 		}
-	}
-	break;
+		break;
 
-	case r__bridge: {
+	case r__bridge:
 		if (_vm->_gyro->dna.drawbridge_open == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
@@ -490,10 +493,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 		if (_vm->_gyro->dna.geida_follows)
 			put_geida_at(ped + 3, ped); // load Geida
-	}
-	break;
+		break;
 
-	case r__robins: {
+	case r__robins:
 		if (ped > 0) {
 			if (! _vm->_gyro->dna.been_tied_up) {
 				// A welcome party... or maybe not...
@@ -515,10 +517,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (!_vm->_gyro->dna.mushroom_growing) 
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
-	}
-	break;
+		break;
 
-	case r__outsidecardiffcastle: {
+	case r__outsidecardiffcastle:
 		if (ped > 0)
 			switch (_vm->_gyro->dna.cardiff_things) {
 			case 0 : { // You've answered NONE of his questions.
@@ -541,10 +542,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->dna.cardiff_things < 5)
 			_vm->_gyro->_interrogation = _vm->_gyro->dna.cardiff_things;
 		else _vm->_gyro->_interrogation = 0;
-	}
-	break;
+		break;
 
-	case r__map: {
+	case r__map:
 		// You're entering the map.
 		dawn();
 		//setactivepage(cp);
@@ -561,10 +561,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 
 		_vm->_visa->dixi('q', 69);
-	}
-	break;
+		break;
 
-	case r__catacombs: {
+	case r__catacombs:
 		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
 
 			switch (ped) {
@@ -589,10 +588,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_trip->catamove(ped);
 			_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
 		}
-	}
-	break;
+		break;
 
-	case r__argentpub: {
+	case r__argentpub:
 		if (_vm->_gyro->dna.wonnim)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
 		_vm->_gyro->dna.malagauche = 0; // Ready to boot Malagauche
@@ -601,10 +599,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		}
 		_vm->_graphics->refreshBackground();
-	}
-	break;
+		break;
 
-	case r__lustiesroom: {
+	case r__lustiesroom:
 		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
 		if (_vm->_trip->tr[0].whichsprite == 0) // Avvy in his normal clothes
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
@@ -619,10 +616,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_graphics->refreshBackground();
 			}
 		}
-	}
-	break;
+		break;
 
-	case r__musicroom: {
+	case r__musicroom:
 		if (_vm->_gyro->dna.jacques_awake > 0) {
 			_vm->_gyro->dna.jacques_awake = 5;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
@@ -639,8 +635,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_sequence->then_show(7);
 			_vm->_sequence->start_to_close();
 		}
-	}
-	break;
+		break;
 
 	case r__outsidenottspub:
 		if (ped == 2) {
@@ -665,7 +660,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		}
 		break;
 
-	case r__wisewomans: {
+	case r__wisewomans:
 		_vm->_trip->tr[1].init(11, false, _vm->_trip);
 		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_trip->apped(2, 2); // Start on the right-hand side of the screen.
@@ -677,8 +672,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 		_vm->_trip->tr[1].call_eachstep = true;
 		_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // She always faces Avvy.
-	}
-	break;
+		break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
@@ -758,11 +752,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 			put_geida_at(ped + 6, ped);
 		break;
 
-	case r__nottspub: {
+	case r__nottspub:
 		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
-	}
-	break;
+		break;
 
 	case r__outsideducks:
 		if (ped == 2) {
@@ -795,7 +788,7 @@ void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 	_vm->_gyro->thinks = z;
 	z--;
 
-	_vm->_gyro->wait();
+	_vm->_gyro->setMousePointerWait();
 
 	if (th) {
 		if (!f.open("thinks.avd")) {
@@ -1117,13 +1110,13 @@ void Lucerna::checkclick() {
 					_vm->_acci->_person = _vm->_gyro->thinks;
 					_vm->_acci->_thing = _vm->_acci->kPardon;
 				}
-				callverb(_vm->_acci->kVerbCodeExam);
+				callVerb(_vm->_acci->kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
 				} while (holdLeftMouse);
 
-				callverb(_vm->_acci->kVerbCodeScore);
+				callVerb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
 				_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
 				_vm->_trip->newspeed();
@@ -1140,7 +1133,7 @@ void Lucerna::checkclick() {
 }
 
 void Lucerna::mouse_init() {
-	_vm->_gyro->wait();
+	_vm->_gyro->setMousePointerWait();
 }
 
 void Lucerna::mousepage(uint16 page_) {
@@ -1223,14 +1216,14 @@ void Lucerna::calchand(uint16 ang, uint16 length, Common::Point &a, byte c) {
 		return;
 	}
 
-	a = _vm->_graphics->drawArc(_vm->_graphics->_surface, xm, ym, 449 - ang, 450 - ang, length, c);
+	a = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - ang, 450 - ang, length, c);
 }
 
 void Lucerna::hand(const Common::Point &a, byte c) {
 	if (a.x == 177)
 		return;
 
-	_vm->_graphics->_surface.drawLine(xm, ym, a.x, a.y, c);
+	_vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, a.x, a.y, c);
 }
 
 void Lucerna::refresh_hands() {
@@ -1283,7 +1276,7 @@ void Lucerna::clock_lucerna() {
 		plothands();
 
 	if ((_vm->_gyro->hour == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
-		_vm->_scrolls->display(Common::String("Good morning!") + 13 + 13 + "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
+		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
 	
 	_vm->_gyro->oh = _vm->_gyro->hour;
 	_vm->_gyro->onh = nh;
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 8e5897f..f337d97 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -40,74 +40,40 @@ class Lucerna {
 public:
 	bool holdLeftMouse;
 
-
-
 	Lucerna(AvalancheEngine *vm);
-
 	~Lucerna();
 
 	void init();
-
-	void callverb(byte n);
-
+	void callVerb(byte id);
 	void draw_also_lines();
-
 	void mouse_init();
-
 	void mousepage(uint16 page_);
-
 	void load(byte n);
-
 	void exitroom(byte x);
-
 	void enterroom(byte x, byte ped);
-
 	void thinkabout(byte z, bool th);      // Hey!!! Get it and put it!!!
-
 	void load_digits();    // Load the scoring digits & rwlites
-
 	void toolbar();
-
 	void showscore();
-
 	void points(byte num);      // Add on no. of points
-
 	void mouseway(const Common::Point &cursorPos);
-
 	void posxy();
-
 	void fxtoggle();
-
 	void objectlist();
-
 	void checkclick();
-
 	void errorled();
-
 	void dusk();
-
 	void dawn();
-
 	void showrw();
-
 	void clock_lucerna();
-
 	void delavvy();
-
 	void gameover();
-
 	void minor_redraw();
-
 	void major_redraw();
-
 	uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees.
-
 	void flesh_colors();
-
 	void sprite_run();
-
 	void fix_flashers();
-
 	void load_also(Common::String n);
 
 private:
@@ -125,8 +91,8 @@ private:
 	};
 
 	//Clock
-	static const int16 xm = 510;
-	static const int16 ym = 183;
+	static const int16 _clockCenterX = 510;
+	static const int16 _clockCenterY = 183;
 	Common::Point ah, am;
 	uint16 nh;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index c45ddf9..cecafcf 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -96,11 +96,11 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F5: {
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callverb(_vm->_gyro->f5_does()[0]);
+		_vm->_lucerna->callVerb(_vm->_gyro->f5_does()[0]);
 		}
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
+		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeOpen);
 		break;
 	default:
 		break;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 4cab87a..5c4b60b 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -630,7 +630,7 @@ void Timeout::winning() {
 #endif	
 	// TODO: To be implemented with Pingo::winning_pic().
 
-	_vm->_lucerna->callverb(_vm->_acci->kVerbCodeScore);
+	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
 	_vm->_scrolls->display(" T H E    E N D ");
 	_vm->_gyro->lmo = true;
 }


Commit: 200670d32703179a0cd2746981bdc1992a86d17b
    https://github.com/scummvm/scummvm/commit/200670d32703179a0cd2746981bdc1992a86d17b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-06T07:23:57-07:00

Commit Message:
AVALANCHE: More renaming in gyro2.h.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 05d4166..7b3e84f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -208,7 +208,7 @@ Acci::Acci(AvalancheEngine *vm) {
 }
 
 void Acci::init() {
-	_vm->_gyro->weirdword = false;
+	_vm->_gyro->_weirdWord = false;
 }
 
 void Acci::clearWords() {
@@ -252,7 +252,7 @@ void Acci::replace(Common::String oldChars, byte newChar) {
 
 Common::String Acci::rank() {
 	for (byte i = 0; i < 8; i++) {
-		if ((_vm->_gyro->dna.score >= kRanks[i]._score) && (_vm->_gyro->dna.score < kRanks[i + 1]._score)) {
+		if ((_vm->_gyro->_dna._score >= kRanks[i]._score) && (_vm->_gyro->_dna._score < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
 		}
 	}
@@ -264,7 +264,7 @@ Common::String Acci::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600; 
 	uint16 h, m, s;
 
-	h = _vm->_gyro->dna.total_time / ticksInOneSec; // No. of seconds.
+	h = _vm->_gyro->_dna._totalTime / ticksInOneSec; // No. of seconds.
 	h = floor((float)h);
 	m = h % 3600;
 	h = h / 3600;
@@ -273,10 +273,10 @@ Common::String Acci::totalTime() {
 
 	Common::String result = "You've been playing for ";
 	if (h > 0)
-		result = result + _vm->_gyro->strf(h) + " hours, ";
+		result = result + _vm->_gyro->intToStr(h) + " hours, ";
 	if ((m > 0) || (h != 0))
-		result = result + _vm->_gyro->strf(m) + " minutes and ";
-	return result + _vm->_gyro->strf(s) + " seconds.";
+		result = result + _vm->_gyro->intToStr(m) + " minutes and ";
+	return result + _vm->_gyro->intToStr(s) + " seconds.";
 }
 
 void Acci::cheatParse(Common::String codes) {
@@ -314,9 +314,9 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 			_vm->_scrolls->display("What?");
 	} else {
 		if (animate)
-			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getname(target) + " }");
+			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getName(target) + " }");
 		else {
-			Common::String z = _vm->_gyro->get_better(target);
+			Common::String z = _vm->_gyro->getItem(target);
 			if (z != "") 
 				_vm->_scrolls->display(Common::String("{ ") + z + " }");
 		}
@@ -330,18 +330,18 @@ bool Acci::doPronouns() {
 		byte wordCode = _thats[i];
 		switch (wordCode) {
 		case 200: {
-			displayWhat(_vm->_gyro->him, true, ambiguous);
-			_thats.setChar(_vm->_gyro->him, i);
+			displayWhat(_vm->_gyro->_him, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_him, i);
 			}
 			break;
 		case 201: {
-			displayWhat(_vm->_gyro->her, true, ambiguous);
-			_thats.setChar(_vm->_gyro->her, i);
+			displayWhat(_vm->_gyro->_her, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_her, i);
 			}
 			break;
 		case 202: {
-			displayWhat(_vm->_gyro->it, false, ambiguous);
-			_thats.setChar(_vm->_gyro->it, i);
+			displayWhat(_vm->_gyro->_it, false, ambiguous);
+			_thats.setChar(_vm->_gyro->_it, i);
 			}
 			break;
 		}
@@ -388,32 +388,32 @@ void Acci::storeInterrogation(byte interrogation) {
 	case 1:
 		_vm->_parser->_inputText.toLowercase();
 		sayIt();
-		_vm->_gyro->dna.like2drink = _vm->_parser->_inputText;
-		_vm->_gyro->dna.cardiff_things = 2;
+		_vm->_gyro->_dna._favouriteDrink = _vm->_parser->_inputText;
+		_vm->_gyro->_dna._cardiffQuestionNum = 2;
 		break;
 	case 2:
 		properNouns();
 		sayIt();
-		_vm->_gyro->dna.favourite_song = _vm->_parser->_inputText;
-		_vm->_gyro->dna.cardiff_things = 3;
+		_vm->_gyro->_dna._favouriteSong = _vm->_parser->_inputText;
+		_vm->_gyro->_dna._cardiffQuestionNum = 3;
 		break;
 	case 3:
 		properNouns();
 		sayIt();
-		_vm->_gyro->dna.worst_place_on_earth = _vm->_parser->_inputText;
-		_vm->_gyro->dna.cardiff_things = 4;
+		_vm->_gyro->_dna._worstPlaceOnEarth = _vm->_parser->_inputText;
+		_vm->_gyro->_dna._cardiffQuestionNum = 4;
 		break;
 	case 4:
 		_vm->_parser->_inputText.toLowercase();
 		sayIt();
-		if (!_vm->_gyro->dna.spare_evening.empty())
-			_vm->_gyro->dna.spare_evening.clear();
-		_vm->_gyro->dna.spare_evening = _vm->_parser->_inputText;
+		if (!_vm->_gyro->_dna._spareEvening.empty())
+			_vm->_gyro->_dna._spareEvening.clear();
+		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->dixi('z', 5); // His closing statement...
 		_vm->_trip->tr[1].walkto(4); // The end of the drawbridge
 		_vm->_trip->tr[1].vanishifstill = true; // Then go away!
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing;
-		_vm->_gyro->dna.cardiff_things = 5;
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_dna._cardiffQuestionNum = 5;
 		break;
 	case 99:
 		//store_high(_vm->_parser->_inputText);
@@ -451,7 +451,7 @@ void Acci::parse() {
 	// Are we being interrogated right now?
 	if (_vm->_gyro->_interrogation > 0) {
 		storeInterrogation(_vm->_gyro->_interrogation);
-		_vm->_gyro->weirdword = true;
+		_vm->_gyro->_weirdWord = true;
 		return;
 	}
 
@@ -483,7 +483,7 @@ void Acci::parse() {
 		// Check also[] first, which conatins words about the actual room.
 		if (!thisword.empty()) {
 			for (byte i = 0; i < 31; i++) {
-				if ((_vm->_gyro->also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->also[i][0]) > -1)) {
+				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
 					_thats = _thats + Common::String(99 + i);
 					notfound = false;
 				}
@@ -533,12 +533,12 @@ void Acci::parse() {
 	replace(Common::String('\x4')  + '\xE5', 20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
-	if (_vm->_gyro->dna.room == r__nottspub)
+	if (_vm->_gyro->_dna._room == r__nottspub)
 		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
 		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__aylesoffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;       
@@ -550,39 +550,39 @@ void Acci::parse() {
 	}
 	
 	if (doPronouns()) {
-		_vm->_gyro->weirdword = true;
+		_vm->_gyro->_weirdWord = true;
 		_thats = kNothing;
 		return;
 	}
 
 	// Second parsing.
-	if (!_vm->_gyro->subject.empty())
-		_vm->_gyro->subject.clear();
-	_vm->_gyro->subjnumber = 0; // Find subject of conversation.
+	if (!_vm->_gyro->_subject.empty())
+		_vm->_gyro->_subject.clear();
+	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
 	
 	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
 		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
-			_vm->_gyro->subjnumber = (byte)_thats[i];
+			_vm->_gyro->_subjectNum = (byte)_thats[i];
 			_thats.setChar(kMoved, i);
 			break;
 		}
 	}
 
-	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // Still not found.
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
 		}
 	}
 
-	if ((_vm->_gyro->subjnumber == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
-				_vm->_gyro->subjnumber = (byte)_thats[i + 1];
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
@@ -603,30 +603,30 @@ void Acci::parse() {
 
 	if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 			_vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
-			_vm->_gyro->weirdword = true;
+			_vm->_gyro->_weirdWord = true;
 	} else
-		_vm->_gyro->weirdword = false;
+		_vm->_gyro->_weirdWord = false;
 
 	if (_thats.empty())
 		_thats = kNothing;
 
 	if (_thing != kPardon)
-		_vm->_gyro->it = _thing;
+		_vm->_gyro->_it = _thing;
 
 	if (_person != kPardon) {
 		if (_person < 175)
-			_vm->_gyro->him = _person;
+			_vm->_gyro->_him = _person;
 		else
-			_vm->_gyro->her = _person;
+			_vm->_gyro->_her = _person;
 	}
 }
 
 void Acci::examineObject() {   
-	if (_thing != _vm->_gyro->thinks)
+	if (_thing != _vm->_gyro->_thinks)
 		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing);
 	switch (_thing) {
-	case Gyro::wine :
-		switch (_vm->_gyro->dna.winestate) {// 4 is perfect wine. 0 is not holding the wine.
+	case Gyro::kObjectWine :
+		switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_visa->dixi('t', 1); // Normal examine wine scroll
 			break; 
@@ -638,8 +638,8 @@ void Acci::examineObject() {
 			break;
 		}
 		break;
-	case Gyro::onion:
-		if (_vm->_gyro->dna.rotten_onion)
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_dna._rottenOnion)
 			_vm->_visa->dixi('q', 21); // Yucky onion.
 		else
 			_vm->_visa->dixi('t', 18);  // Normal onion scroll
@@ -650,7 +650,7 @@ void Acci::examineObject() {
 }
 
 bool Acci::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->dna.room))
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_dna._room))
 		return true;
 	else {
 		if (_person < 175)
@@ -664,18 +664,18 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 
 void Acci::exampers() {
 	if (isPersonHere()) {
-		if (_thing != _vm->_gyro->thinks)
+		if (_thing != _vm->_gyro->_thinks)
 			_vm->_lucerna->thinkabout(_person, _vm->_gyro->kPerson);
 		_person -= 149;
 		switch (_person) { // Special cases
 		case 11:
-			if (_vm->_gyro->dna.wonnim) {
+			if (_vm->_gyro->_dna._wonNim) {
 				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
 				return;
 			}
 			break;
 		case 99:
-			if (_vm->_gyro->dna.lustie_is_asleep) {
+			if (_vm->_gyro->_dna._lustieIsAsleep) {
 				_vm->_visa->dixi('Q', 65); // He's asleep. (65! Wow!)
 				return;
 			}
@@ -686,7 +686,7 @@ void Acci::exampers() {
 	} 
 	
 	// And afterwards...
-	if ((_person == 14) && (!_vm->_gyro->dna.ayles_is_awake))
+	if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake))
 		_vm->_visa->dixi('Q', 13);
 }
 
@@ -698,7 +698,7 @@ bool Acci::holding() {
 
 	if (_thing > 100)
 		_vm->_scrolls->display("Be reasonable!");
-	else if (!_vm->_gyro->dna.obj[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+	else if (!_vm->_gyro->_dna._objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_scrolls->display("You're not holding it, Avvy.");
 	else 
 		holdingResult = true;
@@ -707,7 +707,7 @@ bool Acci::holding() {
 }
 
 void Acci::openBox(bool isOpening) {
-	if ((_vm->_gyro->dna.room == r__yours) && (_thing == 54)) {
+	if ((_vm->_gyro->_dna._room == r__yours) && (_thing == 54)) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		_vm->_celer->updateBackgroundSprites();
@@ -734,7 +734,7 @@ void Acci::examine() {
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_scrolls->display(*_vm->_gyro->also[_thing - 50][1]);
+				_vm->_scrolls->display(*_vm->_gyro->_also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
@@ -748,20 +748,20 @@ void Acci::inventory() {
 	byte itemNum = 0;
 	_vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
 
-	for (byte i = 0; i < numobjs; i++) {
-		if (_vm->_gyro->dna.obj[i]) {
+	for (byte i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_gyro->dna.carrying)
+			if (itemNum == _vm->_gyro->_dna._carryNum)
 				_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-			_vm->_scrolls->display(_vm->_gyro->get_better(i + 1) + _vm->_scrolls->kControlToBuffer);
-			if ((i + 1) == _vm->_gyro->dna.wearing)
+			_vm->_scrolls->display(_vm->_gyro->getItem(i + 1) + _vm->_scrolls->kControlToBuffer);
+			if ((i + 1) == _vm->_gyro->_dna._wearing)
 				_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
-			if (itemNum < _vm->_gyro->dna.carrying)
+			if (itemNum < _vm->_gyro->_dna._carryNum)
 				_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
 		}
 	}
 
-	if (_vm->_gyro->dna.wearing == kNothing)
+	if (_vm->_gyro->_dna._wearing == kNothing)
 		_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
 	else
 		_vm->_scrolls->display(".");
@@ -769,17 +769,17 @@ void Acci::inventory() {
 
 void Acci::swallow() {   // Eat something.
 	switch (_thing) {
-	case Gyro::wine:
-		switch (_vm->_gyro->dna.winestate) { // 4 is perfect
+	case Gyro::kObjectWine:
+		switch (_vm->_gyro->_dna._wineState) { // 4 is perfect
 		case 1:
-			if (_vm->_gyro->dna.teetotal)  {
+			if (_vm->_gyro->_dna._teetotal)  {
 				_vm->_visa->dixi('D', 6);
 				return;
 			}
 			_vm->_visa->dixi('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_visa->dixi('U', 2);
-			_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
+			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 			_vm->_lucerna->objectlist();
 			drink();
 			break;
@@ -789,33 +789,33 @@ void Acci::swallow() {   // Eat something.
 			break; // You can't drink it!
 		}
 		break;
-	case Gyro::potion:
-		_vm->_gyro->background(4);
+	case Gyro::kObjectPotion:
+		_vm->_gyro->setBackgroundColor(4);
 		_vm->_visa->dixi('U', 3);
 		_vm->_lucerna->gameover();
-		_vm->_gyro->background(0);
+		_vm->_gyro->setBackgroundColor(0);
 		break;
-	case Gyro::ink:
+	case Gyro::kObjectInk:
 		_vm->_visa->dixi('U', 4);
 		break;
-	case Gyro::chastity:
+	case Gyro::kObjectChastity:
 		_vm->_visa->dixi('U', 5);
 		break;
-	case Gyro::mushroom:
+	case Gyro::kObjectMushroom:
 		_vm->_visa->dixi('U', 6);
 		_vm->_lucerna->gameover();
 		break;
-	case Gyro::onion:
-		if (_vm->_gyro->dna.rotten_onion)
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_dna._rottenOnion)
 			_vm->_visa->dixi('U', 11);
 		else {
 			_vm->_visa->dixi('U', 8);
-			_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
+			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
 			_vm->_lucerna->objectlist();
 		}
 		break;
 	default:
-		if ((_vm->_gyro->dna.room == r__argentpub) || (_vm->_gyro->dna.room == r__nottspub))
+		if ((_vm->_gyro->_dna._room == r__argentpub) || (_vm->_gyro->_dna._room == r__nottspub))
 			_vm->_scrolls->display("Try BUYing things before you drink them!");
 		else
 			_vm->_scrolls->display("The taste of it makes you retch!");
@@ -826,7 +826,7 @@ void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 	
 	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->dna.room)
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room)
 			numPeople++;
 	}
 
@@ -835,14 +835,14 @@ void Acci::peopleInRoom() {
 
 	byte actPerson = 0; // Actually listed people.
 	for (byte i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->dna.room) {
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				_vm->_scrolls->display(_vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->display(_vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 			else if (actPerson < numPeople) // The middle...
-				_vm->_scrolls->display(Common::String(", ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->display(Common::String(", ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 			else // The end.
-				_vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getname(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 		}
 	}
 
@@ -855,30 +855,30 @@ void Acci::peopleInRoom() {
 }
 
 void Acci::lookAround() {
-	_vm->_scrolls->display(*_vm->_gyro->also[0][1]);
-	switch (_vm->_gyro->dna.room) {
+	_vm->_scrolls->display(*_vm->_gyro->_also[0][1]);
+	switch (_vm->_gyro->_dna._room) {
 	case r__spludwicks:
-		if (_vm->_gyro->dna.avaricius_talk > 0)
+		if (_vm->_gyro->_dna._avariciusTalk > 0)
 			_vm->_visa->dixi('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case r__robins:
-		if (_vm->_gyro->dna.tied_up)
+		if (_vm->_gyro->_dna._tiedUp)
 			_vm->_visa->dixi('q', 38);
-		if (_vm->_gyro->dna.mushroom_growing)
+		if (_vm->_gyro->_dna._mushroomGrowing)
 			_vm->_visa->dixi('q', 55);
 		break;
 	case r__insidecardiffcastle:
-		if (!_vm->_gyro->dna.taken_pen)
+		if (!_vm->_gyro->_dna._takenPen)
 			_vm->_visa->dixi('q', 49);
 		break;
 	case r__lustiesroom:
-		if (_vm->_gyro->dna.lustie_is_asleep)
+		if (_vm->_gyro->_dna._lustieIsAsleep)
 			_vm->_visa->dixi('q', 65);
 		break;
 	case r__catacombs:
-		switch (_vm->_gyro->dna.cat_y * 256 + _vm->_gyro->dna.cat_x) {
+		switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) {
 		case 258 :
 			_vm->_visa->dixi('q', 80); // Inside art gallery.
 			break; 
@@ -897,7 +897,7 @@ void Acci::lookAround() {
 
 void Acci::openDoor() { 
 	// Special cases.
-	switch (_vm->_gyro->dna.room) {   
+	switch (_vm->_gyro->_dna._room) {   
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
 			// Opening the box.
@@ -915,21 +915,21 @@ void Acci::openDoor() {
 		break;
 	}
 
-	if ((!_vm->_gyro->dna.user_moves_avvy) && (_vm->_gyro->dna.room != r__lusties))
+	if ((!_vm->_gyro->_dna._userMovesAvvy) && (_vm->_gyro->_dna._room != r__lusties))
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte fv = 8; fv < 15; fv++) {
 		if (_vm->_trip->infield(fv + 1)) {
 			fv -= 8;
 
-			switch (_vm->_gyro->portals[fv].op) {
+			switch (_vm->_gyro->_portals[fv]._operation) {
 			case Gyro::kMagicExclaim:
 				_vm->_trip->tr[0].bounce();
-				_vm->_visa->dixi('x', _vm->_gyro->portals[fv].data);
+				_vm->_visa->dixi('x', _vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicTransport:
-				_vm->_trip->fliproom((_vm->_gyro->portals[fv].data) >> 8,  // High byte 
-					                 (_vm->_gyro->portals[fv].data) & 0x0F // Low byte
+				_vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte 
+					                 (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte
 									 );
 				break;
 			case Gyro::kMagicUnfinished:
@@ -937,10 +937,10 @@ void Acci::openDoor() {
 				_vm->_scrolls->display("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
-				_vm->_trip->call_special(_vm->_gyro->portals[fv].data);
+				_vm->_trip->call_special(_vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_vm->_trip->open_the_door((_vm->_gyro->portals[fv].data) >> 8, (_vm->_gyro->portals[fv].data) & 0x0F, fv + 9);
+				_vm->_trip->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
 				break;
 			}
 			
@@ -948,7 +948,7 @@ void Acci::openDoor() {
 		}
 	}
 
-	if (_vm->_gyro->dna.room == r__map)
+	if (_vm->_gyro->_dna._room == r__map)
 		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."));
 	else
@@ -974,16 +974,16 @@ void Acci::putProc() {
 
 	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
 	switch (_thing2) {
-	case Gyro::wine:
-		if (_thing == _vm->_gyro->onion) {
-			if (_vm->_gyro->dna.rotten_onion)
+	case Gyro::kObjectWine:
+		if (_thing == _vm->_gyro->kObjectOnion) {
+			if (_vm->_gyro->_dna._rottenOnion)
 				_vm->_scrolls->display("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
-				if (_vm->_gyro->dna.winestate != 3)
+				if (_vm->_gyro->_dna._wineState != 3)
 					_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Oignon au vin"
 					+ _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!");
 				else { // Put onion into vinegar! Yes!
-					_vm->_gyro->dna.onion_in_vinegar = true;
+					_vm->_gyro->_dna._onionInVinegar = true;
 					_vm->_lucerna->points(7);
 					_vm->_visa->dixi('u', 9);
 				}
@@ -993,31 +993,31 @@ void Acci::putProc() {
 		break;
 
 	case 54:
-		if (_vm->_gyro->dna.room == r__yours) { // Put something into the box.
-			if (_vm->_gyro->dna.box_contents != kNothing)
+		if (_vm->_gyro->_dna._room == r__yours) { // Put something into the box.
+			if (_vm->_gyro->_dna._boxContent != kNothing)
 				_vm->_scrolls->display("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
-				case Gyro::money:
+				case Gyro::kObjectMoney:
 					_vm->_scrolls->display("You'd better keep some ready cash on you!");
 					break;
-				case Gyro::bell:
+				case Gyro::kObjectBell:
 					_vm->_scrolls->display("That's a silly place to keep a bell.");
 					break;
-				case Gyro::bodkin:
+				case Gyro::kObjectBodkin:
 					_vm->_scrolls->display("But you might need it!");
 					break;
-				case Gyro::onion:
+				case Gyro::kObjectOnion:
 					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_gyro->dna.wearing == _thing)
-						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->get_better(_thing) + " off first!");
+					if (_vm->_gyro->_dna._wearing == _thing)
+						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->getItem(_thing) + " off first!");
 					else {
 						openBox(true); // Open box.
 
-						_vm->_gyro->dna.box_contents = _thing;
-						_vm->_gyro->dna.obj[_thing - 1] = false;
+						_vm->_gyro->_dna._boxContent = _thing;
+						_vm->_gyro->_dna._objects[_thing - 1] = false;
 						_vm->_lucerna->objectlist();
 						_vm->_scrolls->display("OK, it's in the box.");
 
@@ -1038,7 +1038,7 @@ void Acci::putProc() {
 
 void Acci::notInOrder() {
 	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
-			+ _vm->_gyro->get_better(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick])
+			+ _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick])
 			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
 
@@ -1053,39 +1053,39 @@ void Acci::goToCauldron() {
  * @remarks	Originally called 'give2spludwick'
  */
 bool Acci::giveToSpludwick() { 
-	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick] != _thing) {
+	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) {
 		notInOrder();
 		return false;
 	}
 
 	switch (_thing) {
-	case Gyro::onion:
-		_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false;
-		if (_vm->_gyro->dna.rotten_onion)
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
+		if (_vm->_gyro->_dna._rottenOnion)
 			_vm->_visa->dixi('q', 22);
 		else {
-			_vm->_gyro->dna.given2spludwick++;
+			_vm->_gyro->_dna._givenToSpludwick++;
 			_vm->_visa->dixi('q', 20);
 			goToCauldron();
 			_vm->_lucerna->points(3);
 		}
 		_vm->_lucerna->objectlist();
 		break;
-	case Gyro::ink:
-		_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false;
+	case Gyro::kObjectInk:
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = false;
 		_vm->_lucerna->objectlist();
-		_vm->_gyro->dna.given2spludwick++;
+		_vm->_gyro->_dna._givenToSpludwick++;
 		_vm->_visa->dixi('q', 24);
 		goToCauldron();
 		_vm->_lucerna->points(3);
 		break;
-	case Gyro::mushroom:
-		_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false;
+	case Gyro::kObjectMushroom:
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = false;
 		_vm->_visa->dixi('q', 25);
 		_vm->_lucerna->points(5);
-		_vm->_gyro->dna.given2spludwick++;
+		_vm->_gyro->_dna._givenToSpludwick++;
 		goToCauldron();
-		_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
 		_vm->_lucerna->objectlist();
 		break;
 	default:
@@ -1096,30 +1096,30 @@ bool Acci::giveToSpludwick() {
 }
 
 void Acci::drink() {
-	_vm->_gyro->dna.alcohol += 1;
-	if (_vm->_gyro->dna.alcohol == 5) {
-		_vm->_gyro->dna.obj[_vm->_gyro->key - 1] = true; // Get the key.
-		_vm->_gyro->dna.teetotal = true;
-		_vm->_gyro->dna.avvy_is_awake = false;
-		_vm->_gyro->dna.avvy_in_bed = true;
+	_vm->_gyro->_dna._alcoholLevel += 1;
+	if (_vm->_gyro->_dna._alcoholLevel == 5) {
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1] = true; // Get the key.
+		_vm->_gyro->_dna._teetotal = true;
+		_vm->_gyro->_dna._avvyIsAwake = false;
+		_vm->_gyro->_dna._avvyInBed = true;
 		_vm->_lucerna->objectlist();
 		_vm->_lucerna->dusk();
-		_vm->_gyro->hang_around_for_a_while();
+		_vm->_gyro->hangAroundForAWhile();
 		_vm->_trip->fliproom(1, 1);
-		_vm->_gyro->background(14);
+		_vm->_gyro->setBackgroundColor(14);
 		_vm->_trip->new_game_for_trippancy(); // Not really.
 	}
 }
 
 void Acci::cardiffClimbing() {
-	if (_vm->_gyro->dna.standing_on_dais) { // Clamber up.
+	if (_vm->_gyro->_dna._standingOnDais) { // Clamber up.
 		_vm->_scrolls->display("You climb down, back onto the floor.");
-		_vm->_gyro->dna.standing_on_dais = false;
+		_vm->_gyro->_dna._standingOnDais = false;
 		_vm->_trip->apped(1, 3);
 	} else { // Clamber down.
 		if (_vm->_trip->infield(1)) {
 			_vm->_scrolls->display("You clamber up onto the dais.");
-			_vm->_gyro->dna.standing_on_dais = true;
+			_vm->_gyro->_dna._standingOnDais = true;
 			_vm->_trip->apped(1, 2);
 		} else
 			_vm->_scrolls->display("Get a bit closer, Avvy.");
@@ -1131,21 +1131,21 @@ void Acci::already() {
 }
 
 void Acci::standUp() {
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__yours: // Avvy isn't asleep.
-		if (_vm->_gyro->dna.avvy_is_awake && _vm->_gyro->dna.avvy_in_bed) {  // But he's in bed.
-			if (_vm->_gyro->dna.teetotal) {
+		if (_vm->_gyro->_dna._avvyIsAwake && _vm->_gyro->_dna._avvyInBed) {  // But he's in bed.
+			if (_vm->_gyro->_dna._teetotal) {
 				_vm->_visa->dixi('d', 12);
-				_vm->_gyro->background(0);
+				_vm->_gyro->setBackgroundColor(0);
 				_vm->_visa->dixi('d', 14);
 			}
 			_vm->_trip->tr[0].visible = true;
-			_vm->_gyro->dna.user_moves_avvy = true;
+			_vm->_gyro->_dna._userMovesAvvy = true;
 			_vm->_trip->apped(1, 2);
-			_vm->_gyro->dna.rw = _vm->_gyro->kDirectionLeft;
+			_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->points(1);
-			_vm->_gyro->dna.avvy_in_bed = false;
+			_vm->_gyro->_dna._avvyInBed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
 		} else
 			already();
@@ -1156,12 +1156,12 @@ void Acci::standUp() {
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro->dna.sitting_in_pub)  {
+		if (_vm->_gyro->_dna._sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_trip->tr[0].visible = true; // But standing up.
 			_vm->_trip->apped(1, 4); // And walking away.
-			_vm->_gyro->dna.sitting_in_pub = false; // Really not sitting down.
-			_vm->_gyro->dna.user_moves_avvy = true; // And ambulant.
+			_vm->_gyro->_dna._sittingInPub = false; // Really not sitting down.
+			_vm->_gyro->_dna._userMovesAvvy = true; // And ambulant.
 		} else
 			already();
 		break;
@@ -1173,42 +1173,42 @@ void Acci::standUp() {
 
 
 void Acci::getProc(char thing) {
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
-			if (_vm->_gyro->dna.box_contents == thing) {
+			if (_vm->_gyro->_dna._boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->display("OK, I've got it.");
-				_vm->_gyro->dna.obj[thing - 1] = true;
+				_vm->_gyro->_dna._objects[thing - 1] = true;
 				_vm->_lucerna->objectlist();
-				_vm->_gyro->dna.box_contents = kNothing;
+				_vm->_gyro->_dna._boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else
-				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->get_better(thing) + " in the box.");
+				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->getItem(thing) + " in the box.");
 		} else
 			_vm->_visa->dixi('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
-		case Gyro::pen:
+		case Gyro::kObjectPen:
 			if (_vm->_trip->infield(2)) { // Standing on the dais.
-				if (_vm->_gyro->dna.taken_pen)
+				if (_vm->_gyro->_dna._takenPen)
 					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
 					_vm->_trip->call_special(3); // Zap!
-					_vm->_gyro->dna.taken_pen = true;
-					_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true;
+					_vm->_gyro->_dna._takenPen = true;
+					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
 					_vm->_lucerna->objectlist();
 					_vm->_scrolls->display("Taken.");
 				}
-			} else if (_vm->_gyro->dna.standing_on_dais)
+			} else if (_vm->_gyro->_dna._standingOnDais)
 				_vm->_visa->dixi('q', 53);
 			else
 				_vm->_visa->dixi('q', 51);
 			break;
-		case Gyro::bolt:
+		case Gyro::kObjectBolt:
 			_vm->_visa->dixi('q', 52);
 			break;
 		default:
@@ -1216,12 +1216,12 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro->mushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->dna.mushroom_growing)) {
+		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->display("Got it!");
-			_vm->_gyro->dna.mushroom_growing = false;
-			_vm->_gyro->dna.taken_mushroom = true;
-			_vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = true;
+			_vm->_gyro->_dna._mushroomGrowing = false;
+			_vm->_gyro->_dna._takenMushroom = true;
+			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = true;
 			_vm->_lucerna->objectlist();
 			_vm->_lucerna->points(3);
 		} else
@@ -1237,11 +1237,11 @@ void Acci::getProc(char thing) {
  * @remarks	Originally called 'give_Geida_the_lute'
  */
 void Acci::giveGeidaTheLute() {
-	if (_vm->_gyro->dna.room != r__lustiesroom) {
+	if (_vm->_gyro->_dna._room != r__lustiesroom) {
 		_vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	}
-	_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false;
+	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
 	_vm->_lucerna->objectlist();
 	_vm->_visa->dixi('q', 64); // She plays it.
 
@@ -1267,13 +1267,13 @@ void Acci::winSequence() {
 
 void Acci::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->him - 150] != _vm->_gyro->dna.room))
-			_person = _vm->_gyro->her;
+		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_dna._room))
+			_person = _vm->_gyro->_her;
 		else
-			_person = _vm->_gyro->him;
+			_person = _vm->_gyro->_him;
 	}
 
-	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->dna.room) {
+	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
 		return;
 	}
@@ -1289,7 +1289,7 @@ void Acci::personSpeaks() {
 
 	if (!found) {
 		for (byte i = 0; i < 16; i++) {
-			if ((_vm->_gyro->kQuasipeds[i].who == _person) && (_vm->_gyro->kQuasipeds[i].room == _vm->_gyro->dna.room))
+			if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
 				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
 		}
 	}
@@ -1297,7 +1297,7 @@ void Acci::personSpeaks() {
 void Acci::heyThanks() {
 	personSpeaks();
 	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
-	_vm->_gyro->dna.obj[_thing - 1] = false;
+	_vm->_gyro->_dna._objects[_thing - 1] = false;
 }
 
 /**
@@ -1312,7 +1312,7 @@ void Acci::doThat() {
 		return;
 	}
 
-	if (_vm->_gyro->weirdword)
+	if (_vm->_gyro->_weirdWord)
 		return;
 
 	if (_thing < 200)
@@ -1322,11 +1322,11 @@ void Acci::doThat() {
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
-		if (!_vm->_gyro->alive) {
+		if (!_vm->_gyro->_alive) {
 			_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
 			return;
 		}
-		if (!_vm->_gyro->dna.avvy_is_awake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+		if (!_vm->_gyro->_dna._avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
 			_vm->_scrolls->display("Talking in your sleep? Try waking up!");
 			return;
 		}
@@ -1345,7 +1345,7 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_gyro->dna.carrying >= maxobjs)
+			if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 				_vm->_scrolls->display("You can't carry any more!");
 			else
 				getProc(_thing);
@@ -1365,20 +1365,20 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
-			if (_vm->_gyro->subjnumber == 99) // They typed "say password".
+			if (_vm->_gyro->_subjectNum == 99) // They typed "say password".
 				_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
-			else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 249)) {
+			else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
 				for (byte i = 0; i < 10; i++)
 					_realWords[i] = _realWords[i + 1];
 
-				_verb = _vm->_gyro->subjnumber;
+				_verb = _vm->_gyro->_subjectNum;
 				doThat();
 				return;
 			} else {
-				_person = _vm->_gyro->subjnumber;
-				_vm->_gyro->subjnumber = 0;
+				_person = _vm->_gyro->_subjectNum;
+				_vm->_gyro->_subjectNum = 0;
 				if ((_person == 0) || (_person == kPardon))
 					_vm->_scrolls->display("Talk to whom?");
 				else if (isPersonHere())
@@ -1393,53 +1393,53 @@ void Acci::doThat() {
 				_vm->_scrolls->display("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
-				case Gyro::money :
+				case Gyro::kObjectMoney :
 					_vm->_scrolls->display("You can't bring yourself to give away your moneybag.");
 					break;
-				case Gyro::bodkin:
-				case Gyro::bell:
-				case Gyro::clothes:
-				case Gyro::habit :
+				case Gyro::kObjectBodkin:
+				case Gyro::kObjectBell:
+				case Gyro::kObjectClothes:
+				case Gyro::kObjectHabit :
 					_vm->_scrolls->display("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
-					case Gyro::pcrapulus:
-						if (_thing == _vm->_gyro->wine) {
+					case Gyro::kPeopleCrapulus:
+						if (_thing == _vm->_gyro->kObjectWine) {
 							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
+							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
-					case Gyro::pcwytalot:
-						if ((_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
+					case Gyro::kPeopleCwytalot:
+						if ((_thing == _vm->_gyro->kObjectCrossbow) || (_thing == _vm->_gyro->kObjectBolt))
 							_vm->_scrolls->display(Common::String("You might be able to influence Cwytalot more if you used it!"));
 						else
 							heyThanks();
 						break;
-					case Gyro::pspludwick:
+					case Gyro::kPeopleSpludwick:
 						if (giveToSpludwick())
 							heyThanks();
 						break;
-					case Gyro::pibythneth:
-						if (_thing == _vm->_gyro->badge) {
+					case Gyro::kPeopleIbythneth:
+						if (_thing == _vm->_gyro->kObjectBadge) {
 							_vm->_visa->dixi('q', 32); // Thanks! Wow!
 							_vm->_lucerna->points(3);
-							_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = false;
-							_vm->_gyro->dna.obj[_vm->_gyro->habit - 1] = true;
-							_vm->_gyro->dna.givenbadgetoiby = true;
+							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = false;
+							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectHabit - 1] = true;
+							_vm->_gyro->_dna._givenBadgeToIby = true;
 							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 						} else
 							heyThanks();
 						break;
-					case Gyro::payles:
-						if (_vm->_gyro->dna.ayles_is_awake) {
-							if (_thing == _vm->_gyro->pen) {
-								_vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = false;
+					case Gyro::kPeopleAyles:
+						if (_vm->_gyro->_dna._aylesIsAwake) {
+							if (_thing == _vm->_gyro->kObjectPen) {
+								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = false;
 								_vm->_visa->dixi('q', 54);
-								_vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = true;
-								_vm->_gyro->dna.given_pen_to_ayles = true;
+								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = true;
+								_vm->_gyro->_dna._givenPenToAyles = true;
 								_vm->_lucerna->objectlist();
 								_vm->_lucerna->points(2);
 							} else
@@ -1447,26 +1447,26 @@ void Acci::doThat() {
 						} else
 							_vm->_scrolls->display("But he's asleep!");
 						break;
-					case Gyro::pgeida:
+					case Gyro::kPeopleGeida:
 						switch (_thing) {
-						case Gyro::potion:
-							_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = false;
+						case Gyro::kObjectPotion:
+							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = false;
 							_vm->_visa->dixi('u', 16); // She drinks it.
 							_vm->_lucerna->points(2);
-							_vm->_gyro->dna.geida_given_potion = true;
+							_vm->_gyro->_dna._givenPotionToGeida = true;
 							_vm->_lucerna->objectlist();
 							break;
-						case Gyro::lute:
+						case Gyro::kObjectLute:
 							giveGeidaTheLute();
 							break;
 						default:
 							heyThanks();
 						}
 						break;
-					case Gyro::parkata:
+					case Gyro::kPeopleArkata:
 						switch (_thing) {
-						case Gyro::potion:
-							if (_vm->_gyro->dna.geida_given_potion)
+						case Gyro::kObjectPotion:
+							if (_vm->_gyro->_dna._givenPotionToGeida)
 								winSequence();
 							else
 								_vm->_visa->dixi('q', 77); // That Geida woman!
@@ -1515,7 +1515,7 @@ void Acci::doThat() {
 		if (!_polite)
 			_vm->_scrolls->display("How about a `please\", Avvy?");
 		else if (_vm->_scrolls->ask(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
-			_vm->_gyro->lmo = true;
+			_vm->_gyro->_letMeOut = true;
 		break;
 	case kVerbCodeGo:
 		_vm->_scrolls->display("Just use the arrow keys to walk there.");
@@ -1529,18 +1529,18 @@ void Acci::doThat() {
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
 			+ "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine
 			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "version " + _vm->_gyro->vernum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
-			+ _vm->_gyro->copyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
+			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
+			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
 		_vm->_scrolls->display(toDisplay);
 		_vm->_scrolls->aboutscroll = false;
 		}
 		break;
 	case kVerbCodeUndress:
-		if (_vm->_gyro->dna.wearing == kNothing)
+		if (_vm->_gyro->_dna._wearing == kNothing)
 			_vm->_scrolls->display("You're already stark naked!");
-		else if (_vm->_gyro->dna.avvys_in_the_cupboard) {
-			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->get_better(_vm->_gyro->dna.wearing) + '.');
-			_vm->_gyro->dna.wearing = kNothing;
+		else if (_vm->_gyro->_dna._avvysInTheCupboard) {
+			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.');
+			_vm->_gyro->_dna._wearing = kNothing;
 			_vm->_lucerna->objectlist();
 		} else
 			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
@@ -1548,25 +1548,25 @@ void Acci::doThat() {
 	case kVerbCodeWear:
 		if (holding()) { // Wear something.
 			switch (_thing) {
-			case Gyro::chastity:
+			case Gyro::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
 				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you\?\?!");
 				break;
-			case Gyro::clothes:
-			case Gyro::habit: { // Change this!
-					if (_vm->_gyro->dna.wearing != kNothing) {
-						if (_vm->_gyro->dna.wearing == _thing)
+			case Gyro::kObjectClothes:
+			case Gyro::kObjectHabit: { // Change this!
+					if (_vm->_gyro->_dna._wearing != kNothing) {
+						if (_vm->_gyro->_dna._wearing == _thing)
 							_vm->_scrolls->display("You're already wearing that.");
 						else
 							_vm->_scrolls->display("You'll be rather warm wearing two sets of clothes!");
 						return;
 					} else
-						_vm->_gyro->dna.wearing = _thing;
+						_vm->_gyro->_dna._wearing = _thing;
 
 					_vm->_lucerna->objectlist();
 
 					byte i;
-					if (_thing == _vm->_gyro->habit)
+					if (_thing == _vm->_gyro->kObjectHabit)
 						i = 3;
 					else
 						i = 0;
@@ -1587,35 +1587,35 @@ void Acci::doThat() {
 		break;
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
-			switch (_vm->_gyro->dna.room) { // They just typed "play"...
+			switch (_vm->_gyro->_dna._room) { // They just typed "play"...
 			case r__argentpub: { // ...in the pub, => play Nim.
 					warning("STUB: Acci::doThat() - case kVerbCodeplay");
 					// play_nim();
 					// The following parts are copied from play_nim().
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
-					if (_vm->_gyro->dna.wonnim) { // Already won the game.
+					if (_vm->_gyro->_dna._wonNim) { // Already won the game.
 						_vm->_visa->dixi('Q', 6);
 						return;
 					}
 
-					if (!_vm->_gyro->dna.asked_dogfood_about_nim) {
+					if (!_vm->_gyro->_dna._askedDogfoodAboutNim) {
 						_vm->_visa->dixi('q', 84);
 						return;
 					}
 
 					_vm->_visa->dixi('Q', 3);
-					_vm->_gyro->dna.playednim++;
+					_vm->_gyro->_dna._playedNim++;
 
 					// You won - strange!
 					_vm->_visa->dixi('Q', 7); // You won! Give us a lute!
-					_vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = true;
+					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = true;
 					_vm->_lucerna->objectlist();
-					_vm->_gyro->dna.wonnim = true;
+					_vm->_gyro->_dna._wonNim = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
 					_vm->_lucerna->points(7); // 7 points for winning!
 
-					if (_vm->_gyro->dna.playednim == 1)
+					if (_vm->_gyro->_dna._playedNim == 1)
 						_vm->_lucerna->points(3); // 3 points for playing your 1st game.
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
@@ -1629,23 +1629,23 @@ void Acci::doThat() {
 			}
 		} else if (holding()) {
 			switch (_thing) {
-			case Gyro::lute :
+			case Gyro::kObjectLute :
 					_vm->_visa->dixi('U', 7);
 
-					if (_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] == _vm->_gyro->dna.room)
+					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] == _vm->_gyro->_dna._room)
 						_vm->_visa->dixi('U', 10);
 
-					if (_vm->_gyro->_whereIs[_vm->_gyro->pdulustie - 150] == _vm->_gyro->dna.room)
+					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleDuLustie - 150] == _vm->_gyro->_dna._room)
 						_vm->_visa->dixi('U', 15);
 				break;
 			case 52:
-				if (_vm->_gyro->dna.room == r__musicroom)
+				if (_vm->_gyro->_dna._room == r__musicroom)
 					playHarp();
 				else
 					_vm->_scrolls->display(kWhat);
 				break;
 			case 55:
-				if (_vm->_gyro->dna.room == r__argentpub)
+				if (_vm->_gyro->_dna._room == r__argentpub)
 					// play_nim();
 					warning("STUB: Acci::doThat() - case kVerbCodeplay");
 				else
@@ -1658,9 +1658,9 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeRing:
 		if (holding()) {
-			if (_thing == _vm->_gyro->bell) {
+			if (_thing == _vm->_gyro->kObjectBell) {
 				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
+				if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
 					_vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)");
 			} else
@@ -1682,7 +1682,7 @@ void Acci::doThat() {
 		warning("STUB: Acci::doThat() - case kVerbCodeboss");
 		break;
 	case kVerbCodePee:
-		if (_vm->_gyro->flagset('P')) {
+		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->display("Hmm, I don't think anyone will notice...");
 			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
 		} else
@@ -1691,13 +1691,13 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeCheat:
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
-		_vm->_gyro->cheat = true;
+		_vm->_gyro->_cheat = true;
 		break;
 	case kVerbCodeMagic:
-		if (_vm->_gyro->dna.avaricius_talk > 0)
+		if (_vm->_gyro->_dna._avariciusTalk > 0)
 			_vm->_visa->dixi('q', 19);
 		else {
-			if ((_vm->_gyro->dna.room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_dna._room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
 				_vm->_visa->dixi('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->dixi('q', 18);
@@ -1707,7 +1707,7 @@ void Acci::doThat() {
 					_vm->_trip->tr[1].walkto(5);
 					_vm->_trip->tr[1].call_eachstep = true;
 					_vm->_trip->tr[1].eachstep = _vm->_trip->procback_and_forth;
-					_vm->_gyro->dna.avaricius_talk = 14;
+					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
 			} else
@@ -1718,7 +1718,7 @@ void Acci::doThat() {
 		_vm->_scrolls->display("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
-		switch (_vm->_gyro->dna.swore) {
+		switch (_vm->_gyro->_dna._sworeNum) {
 		case 0:
 			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!")
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(I shouldn't say it again, if I were you!)");
@@ -1733,18 +1733,18 @@ void Acci::doThat() {
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna->gameover();
 		}
-		_vm->_gyro->dna.swore++;
+		_vm->_gyro->_dna._sworeNum++;
 		break;
 	case kVerbCodeListen:
-		if ((_vm->_gyro->dna.ringing_bells) & (_vm->_gyro->flagset('B')))
+		if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 			_vm->_scrolls->display("All other noise is drowned out by the ringing of the bells.");
-		else if (_vm->_gyro->listen.empty())
+		else if (_vm->_gyro->_listen.empty())
 			_vm->_scrolls->display("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_scrolls->display(_vm->_gyro->listen);
+			_vm->_scrolls->display(_vm->_gyro->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_gyro->dna.room) {
+		switch (_vm->_gyro->_dna._room) {
 		case r__argentpub:
 			if (_vm->_trip->infield(6)) { // We're in a pub, and near the bar.
 				switch (_thing) {
@@ -1752,50 +1752,50 @@ void Acci::doThat() {
 				case 53:
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_gyro->dna.malagauche == 177) { // Already getting us one.
+					if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
 						_vm->_visa->dixi('D', 15);
 						return;
 					}
 
-					if (_vm->_gyro->dna.teetotal)  {
+					if (_vm->_gyro->_dna._teetotal)  {
 						_vm->_visa->dixi('D', 6);
 						return;
 					}
 
-					if (_vm->_gyro->dna.alcohol == 0)
+					if (_vm->_gyro->_dna._alcoholLevel == 0)
 						_vm->_lucerna->points(3);
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 					_vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
-					_vm->_gyro->dna.drinking = _thing;
+					_vm->_gyro->_dna._drinking = _thing;
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-					_vm->_gyro->dna.malagauche = 177;
+					_vm->_gyro->_dna._malagauche = 177;
 					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
 					break;
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
-				case Gyro::wine:
-					if (_vm->_gyro->dna.obj[_vm->_gyro->wine - 1])  // We've already got the wine!
+				case Gyro::kObjectWine:
+					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1])  // We've already got the wine!
 						_vm->_visa->dixi('D', 2); // 1 bottle's shufishent!
 					else {
-						if (_vm->_gyro->dna.malagauche == 177) { // Already getting us one.
+						if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
 							_vm->_visa->dixi('D', 15);
 							return;
 						}
 
-						if (_vm->_gyro->dna.carrying >= maxobjs) {
+						if (_vm->_gyro->_dna._carryNum >= kCarryLimit) {
 							_vm->_scrolls->display("Your hands are full.");
 							return;
 						}
 
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
-						if (_vm->_gyro->dna.alcohol == 0)
+						if (_vm->_gyro->_dna._alcoholLevel == 0)
 							_vm->_lucerna->points(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-						_vm->_gyro->dna.malagauche = 177;
+						_vm->_gyro->_dna._malagauche = 177;
 
 						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
 					}
@@ -1807,24 +1807,24 @@ void Acci::doThat() {
 
 		case r__outsideducks:
 			if (_vm->_trip->infield(6)) {
-				if (_thing == _vm->_gyro->onion) {
-					if (_vm->_gyro->dna.obj[_vm->_gyro->onion - 1])
+				if (_thing == _vm->_gyro->kObjectOnion) {
+					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
 						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_gyro->dna.carrying >= maxobjs)
+					else if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 						_vm->_scrolls->display("Before you ask, you remember that your hands are full.");
 					else {
-						if (_vm->_gyro->dna.bought_onion)
+						if (_vm->_gyro->_dna._boughtOnion)
 							_vm->_visa->dixi('D', 11);
 						else {
 							_vm->_visa->dixi('D', 9);
 							_vm->_lucerna->points(3);
 						}
-						_vm->_gyro->pennycheck(3); // It costs thruppence.
-						_vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = true;
+						_vm->_gyro->updateMoney(3); // It costs thruppence.
+						_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = true;
 						_vm->_lucerna->objectlist();
-						_vm->_gyro->dna.bought_onion = true;
-						_vm->_gyro->dna.rotten_onion = false; // It's OK when it leaves the stall!
-						_vm->_gyro->dna.onion_in_vinegar = false;
+						_vm->_gyro->_dna._boughtOnion = true;
+						_vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_gyro->_dna._onionInVinegar = false;
 					}
 				} else
 					_vm->_visa->dixi('D', 0);
@@ -1840,10 +1840,10 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeAttack:
-		if ((_vm->_gyro->dna.room == r__brummieroad) &&
-				((_person == 157) || (_thing == _vm->_gyro->crossbow) || (_thing == _vm->_gyro->bolt))
-				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->dna.room)) {
-			switch (_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] * 2) {
+		if ((_vm->_gyro->_dna._room == r__brummieroad) &&
+				((_person == 157) || (_thing == _vm->_gyro->kObjectCrossbow) || (_thing == _vm->_gyro->kObjectBolt))
+				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_dna._room)) {
+			switch (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] + _vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->dixi('Q', 10);
@@ -1857,11 +1857,11 @@ void Acci::doThat() {
 				break;
 			case 3:
 				_vm->_visa->dixi('Q', 11);
-				_vm->_gyro->dna.cwytalot_gone = true;
-				_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = false;
-				_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = false;
+				_vm->_gyro->_dna._cwytalotGone = true;
+				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = false;
+				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = false;
 				_vm->_lucerna->objectlist();
-				_vm->_gyro->magics[11].op = _vm->_gyro->kMagicNothing;
+				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->points(7);
 				_vm->_trip->tr[1].walkto(2);
 				_vm->_trip->tr[1].vanishifstill = true;
@@ -1875,27 +1875,27 @@ void Acci::doThat() {
 			_vm->_visa->dixi('Q', 10);
 		break;
 	case kVerbCodePasswd:
-		if (_vm->_gyro->dna.room != r__bridge)
+		if (_vm->_gyro->_dna._room != r__bridge)
 			_vm->_visa->dixi('Q', 12);
 		else {
 			bool ok = true;
 			for (byte i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				for (byte j = 0; j < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); j++) {
-					if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[j] != temp[j])
+				for (byte j = 0; j < kVocabulary[_vm->_gyro->_dna._passwordNum + kFirstPassword]._word.size(); j++) {
+					if (kVocabulary[_vm->_gyro->_dna._passwordNum + kFirstPassword]._word[j] != temp[j])
 						ok = false;
 				}
 			}
 
 			if (ok) {
-				if (_vm->_gyro->dna.drawbridge_open != 0)
+				if (_vm->_gyro->_dna._drawbridgeOpen != 0)
 					_vm->_scrolls->display("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
 					_vm->_lucerna->points(4);
 					_vm->_scrolls->display("The drawbridge opens!");
 					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
-					_vm->_gyro->dna.drawbridge_open = 1;
+					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
 				_vm->_visa->dixi('Q', 12);
@@ -1908,7 +1908,7 @@ void Acci::doThat() {
 		_vm->_lucerna->gameover();
 		break;
 	case kVerbCodeScore:
-		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->strf(_vm->_gyro->dna.score) + ',' + _vm->_scrolls->kControlCenter
+		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter
 			+ _vm->_scrolls->kControlNewLine + "out of a possible 128." + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totalTime());
 		break;
@@ -1923,13 +1923,13 @@ void Acci::doThat() {
 			_vm->_scrolls->display("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
-			case Gyro::parkata:
+			case Gyro::kPeopleArkata:
 				_vm->_visa->dixi('U', 12);
 				break;
-			case Gyro::pgeida:
+			case Gyro::kPeopleGeida:
 				_vm->_visa->dixi('U', 13);
 				break;
-			case Gyro::pwisewoman:
+			case Gyro::kPeopleWisewoman:
 				_vm->_visa->dixi('U', 14);
 				break;
 			default:
@@ -1940,14 +1940,14 @@ void Acci::doThat() {
 
 		break;
 	case kVerbCodeClimb:
-		if (_vm->_gyro->dna.room == r__insidecardiffcastle)
+		if (_vm->_gyro->_dna._room == r__insidecardiffcastle)
 			cardiffClimbing();
 		else // In the wrong room!
 			_vm->_scrolls->display("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
 		//	show_highs();
@@ -1957,23 +1957,23 @@ void Acci::doThat() {
 		if (isPersonHere())
 			switch (_person) {
 			case kPardon:
-			case Gyro::pavalot:
+			case Gyro::kPeopleAvalot:
 			case 0:
-				if (!_vm->_gyro->dna.avvy_is_awake) {
-					_vm->_gyro->dna.avvy_is_awake = true;
+				if (!_vm->_gyro->_dna._avvyIsAwake) {
+					_vm->_gyro->_dna._avvyIsAwake = true;
 					_vm->_lucerna->points(1);
-					_vm->_gyro->dna.avvy_in_bed = true;
+					_vm->_gyro->_dna._avvyInBed = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
-					if (_vm->_gyro->dna.teetotal)
+					if (_vm->_gyro->_dna._teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
 					_vm->_scrolls->display("You're already awake, Avvy!");
 				break;
-			case Gyro::payles:
-				if (!_vm->_gyro->dna.ayles_is_awake)
+			case Gyro::kPeopleAyles:
+				if (!_vm->_gyro->_dna._aylesIsAwake)
 					_vm->_scrolls->display("You can't seem to wake him by yourself.");
 				break;
-			case Gyro::pjacques:
+			case Gyro::kPeopleJacques:
 				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + 
 					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
@@ -1982,8 +1982,8 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeSit:
-		if (_vm->_gyro->dna.room == r__nottspub) {
-			if (_vm->_gyro->dna.sitting_in_pub)
+		if (_vm->_gyro->_dna._room == r__nottspub) {
+			if (_vm->_gyro->_dna._sittingInPub)
 				_vm->_scrolls->display("You're already sitting!");
 			else {
 				_vm->_trip->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
@@ -1991,7 +1991,7 @@ void Acci::doThat() {
 			}
 		} else { // Default doodah.
 			_vm->_lucerna->dusk();
-			_vm->_gyro->hang_around_for_a_while();
+			_vm->_gyro->hangAroundForAWhile();
 			_vm->_lucerna->dawn();
 			_vm->_scrolls->display(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
 		}
@@ -1999,7 +1999,7 @@ void Acci::doThat() {
 	case kVerbCodeRestart:
 		if (_vm->_scrolls->ask("Restart game and lose changes?"))  {
 			_vm->_lucerna->dusk();
-			_vm->_gyro->newgame();
+			_vm->_gyro->newGame();
 			_vm->_lucerna->dawn();
 		}
 		break;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 100f468..9347b77 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -129,146 +129,146 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
-	sz.syncAsByte(_gyro->dna.rw);
-	sz.syncAsByte(_gyro->dna.carrying);
-	for (byte i = 0; i < numobjs; i++)
-		sz.syncAsByte(_gyro->dna.obj[i]);
-	sz.syncAsSint16LE(_gyro->dna.score);
-	sz.syncAsSint32LE(_gyro->dna.pence);
-	sz.syncAsByte(_gyro->dna.room);
-	sz.syncAsByte(_gyro->dna.wearing);
-	sz.syncAsByte(_gyro->dna.swore);
-	sz.syncAsByte(_gyro->dna.saves);
-	sz.syncBytes(_gyro->dna.rooms, 100);
-	sz.syncAsByte(_gyro->dna.alcohol);
-	sz.syncAsByte(_gyro->dna.playednim);
-	sz.syncAsByte(_gyro->dna.wonnim);
-	sz.syncAsByte(_gyro->dna.winestate);
-	sz.syncAsByte(_gyro->dna.cwytalot_gone);
-	sz.syncAsByte(_gyro->dna.pass_num);
-	sz.syncAsByte(_gyro->dna.ayles_is_awake);
-	sz.syncAsByte(_gyro->dna.drawbridge_open);
-	sz.syncAsByte(_gyro->dna.avaricius_talk);
-	sz.syncAsByte(_gyro->dna.bought_onion);
-	sz.syncAsByte(_gyro->dna.rotten_onion);
-	sz.syncAsByte(_gyro->dna.onion_in_vinegar);
-	sz.syncAsByte(_gyro->dna.given2spludwick);
-	sz.syncAsByte(_gyro->dna.brummie_stairs);
-	sz.syncAsByte(_gyro->dna.cardiff_things);
-	sz.syncAsByte(_gyro->dna.cwytalot_in_herts);
-	sz.syncAsByte(_gyro->dna.avvy_is_awake);
-	sz.syncAsByte(_gyro->dna.avvy_in_bed);
-	sz.syncAsByte(_gyro->dna.user_moves_avvy);
-	sz.syncAsByte(_gyro->dna.dogfoodpos);
-	sz.syncAsByte(_gyro->dna.givenbadgetoiby);
-	sz.syncAsByte(_gyro->dna.friar_will_tie_you_up);
-	sz.syncAsByte(_gyro->dna.tied_up);
-	sz.syncAsByte(_gyro->dna.box_contents);
-	sz.syncAsByte(_gyro->dna.talked_to_crapulus);
-	sz.syncAsByte(_gyro->dna.jacques_awake);
-	sz.syncAsByte(_gyro->dna.ringing_bells);
-	sz.syncAsByte(_gyro->dna.standing_on_dais);
-	sz.syncAsByte(_gyro->dna.taken_pen);
-	sz.syncAsByte(_gyro->dna.arrow_triggered);
-	sz.syncAsByte(_gyro->dna.arrow_in_the_door);
+	sz.syncAsByte(_gyro->_dna._direction);
+	sz.syncAsByte(_gyro->_dna._carryNum);
+	for (byte i = 0; i < kObjectNum; i++)
+		sz.syncAsByte(_gyro->_dna._objects[i]);
+	sz.syncAsSint16LE(_gyro->_dna._score);
+	sz.syncAsSint32LE(_gyro->_dna._money);
+	sz.syncAsByte(_gyro->_dna._room);
+	sz.syncAsByte(_gyro->_dna._wearing);
+	sz.syncAsByte(_gyro->_dna._sworeNum);
+	sz.syncAsByte(_gyro->_dna._saveNum);
+	sz.syncBytes(_gyro->_dna._roomCount, 100);
+	sz.syncAsByte(_gyro->_dna._alcoholLevel);
+	sz.syncAsByte(_gyro->_dna._playedNim);
+	sz.syncAsByte(_gyro->_dna._wonNim);
+	sz.syncAsByte(_gyro->_dna._wineState);
+	sz.syncAsByte(_gyro->_dna._cwytalotGone);
+	sz.syncAsByte(_gyro->_dna._passwordNum);
+	sz.syncAsByte(_gyro->_dna._aylesIsAwake);
+	sz.syncAsByte(_gyro->_dna._drawbridgeOpen);
+	sz.syncAsByte(_gyro->_dna._avariciusTalk);
+	sz.syncAsByte(_gyro->_dna._boughtOnion);
+	sz.syncAsByte(_gyro->_dna._rottenOnion);
+	sz.syncAsByte(_gyro->_dna._onionInVinegar);
+	sz.syncAsByte(_gyro->_dna._givenToSpludwick);
+	sz.syncAsByte(_gyro->_dna._brummieStairs);
+	sz.syncAsByte(_gyro->_dna._cardiffQuestionNum);
+	sz.syncAsByte(_gyro->_dna._passedCwytalotInHerts);
+	sz.syncAsByte(_gyro->_dna._avvyIsAwake);
+	sz.syncAsByte(_gyro->_dna._avvyInBed);
+	sz.syncAsByte(_gyro->_dna._userMovesAvvy);
+	sz.syncAsByte(_gyro->_dna._dogFoodPos);
+	sz.syncAsByte(_gyro->_dna._givenBadgeToIby);
+	sz.syncAsByte(_gyro->_dna._friarWillTieYouUp);
+	sz.syncAsByte(_gyro->_dna._tiedUp);
+	sz.syncAsByte(_gyro->_dna._boxContent);
+	sz.syncAsByte(_gyro->_dna._talkedToCrapulus);
+	sz.syncAsByte(_gyro->_dna._jacquesState);
+	sz.syncAsByte(_gyro->_dna._bellsAreRinging);
+	sz.syncAsByte(_gyro->_dna._standingOnDais);
+	sz.syncAsByte(_gyro->_dna._takenPen);
+	sz.syncAsByte(_gyro->_dna._arrowTriggered);
+	sz.syncAsByte(_gyro->_dna._arrowInTheDoor);
 
 	if (sz.isSaving()) {
-		uint16 like2drinkSize = _gyro->dna.like2drink.size();
+		uint16 like2drinkSize = _gyro->_dna._favouriteDrink.size();
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
-			char actChr = _gyro->dna.like2drink[i];
+			char actChr = _gyro->_dna._favouriteDrink[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 favourite_songSize = _gyro->dna.favourite_song.size();
+		uint16 favourite_songSize = _gyro->_dna._favouriteSong.size();
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
-			char actChr = _gyro->dna.favourite_song[i];
+			char actChr = _gyro->_dna._favouriteSong[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 worst_place_on_earthSize = _gyro->dna.worst_place_on_earth.size();
+		uint16 worst_place_on_earthSize = _gyro->_dna._worstPlaceOnEarth.size();
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
-			char actChr = _gyro->dna.worst_place_on_earth[i];
+			char actChr = _gyro->_dna._worstPlaceOnEarth[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 spare_eveningSize = _gyro->dna.spare_evening.size();
+		uint16 spare_eveningSize = _gyro->_dna._spareEvening.size();
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
-			char actChr = _gyro->dna.spare_evening[i];
+			char actChr = _gyro->_dna._spareEvening[i];
 			sz.syncAsByte(actChr);
 		}
 	} else {
-		if (!_gyro->dna.like2drink.empty())
-			_gyro->dna.like2drink.clear();
+		if (!_gyro->_dna._favouriteDrink.empty())
+			_gyro->_dna._favouriteDrink.clear();
 		uint16 like2drinkSize = 0;
 		char actChr = ' ';
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->dna.like2drink += actChr;
+			_gyro->_dna._favouriteDrink += actChr;
 		}
 
-		if (!_gyro->dna.favourite_song.empty())
-			_gyro->dna.favourite_song.clear();
+		if (!_gyro->_dna._favouriteSong.empty())
+			_gyro->_dna._favouriteSong.clear();
 		uint16 favourite_songSize = 0;
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->dna.favourite_song += actChr;
+			_gyro->_dna._favouriteSong += actChr;
 		}
 
-		if (!_gyro->dna.worst_place_on_earth.empty())
-			_gyro->dna.worst_place_on_earth.clear();
+		if (!_gyro->_dna._worstPlaceOnEarth.empty())
+			_gyro->_dna._worstPlaceOnEarth.clear();
 		uint16 worst_place_on_earthSize = 0;
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->dna.worst_place_on_earth += actChr;
+			_gyro->_dna._worstPlaceOnEarth += actChr;
 		}
 
-		if (!_gyro->dna.spare_evening.empty())
-			_gyro->dna.spare_evening.clear();
+		if (!_gyro->_dna._spareEvening.empty())
+			_gyro->_dna._spareEvening.clear();
 		uint16 spare_eveningSize = 0;
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->dna.spare_evening += actChr;
+			_gyro->_dna._spareEvening += actChr;
 		}
 	}
 	
-	sz.syncAsSint32LE(_gyro->dna.total_time);
-	sz.syncAsByte(_gyro->dna.jumpstatus);
-	sz.syncAsByte(_gyro->dna.mushroom_growing);
-	sz.syncAsByte(_gyro->dna.spludwicks_here);
-	sz.syncAsByte(_gyro->dna.last_room);
-	sz.syncAsByte(_gyro->dna.last_room_not_map);
-	sz.syncAsByte(_gyro->dna.crapulus_will_tell);
-	sz.syncAsByte(_gyro->dna.enter_catacombs_from_lusties_room);
-	sz.syncAsByte(_gyro->dna.teetotal);
-	sz.syncAsByte(_gyro->dna.malagauche);
-	sz.syncAsByte(_gyro->dna.drinking);
-	sz.syncAsByte(_gyro->dna.entered_lusties_room_as_monk);
-	sz.syncAsByte(_gyro->dna.cat_x);
-	sz.syncAsByte(_gyro->dna.cat_y);
-	sz.syncAsByte(_gyro->dna.avvys_in_the_cupboard);
-	sz.syncAsByte(_gyro->dna.geida_follows);
-	sz.syncAsByte(_gyro->dna.geida_spin);
-	sz.syncAsByte(_gyro->dna.geida_time);
-	sz.syncAsByte(_gyro->dna.nextbell);
-	sz.syncAsByte(_gyro->dna.geida_given_potion);
-	sz.syncAsByte(_gyro->dna.lustie_is_asleep);
-	sz.syncAsByte(_gyro->dna.flip_to_where);
-	sz.syncAsByte(_gyro->dna.flip_to_ped);
-	sz.syncAsByte(_gyro->dna.been_tied_up);
-	sz.syncAsByte(_gyro->dna.sitting_in_pub);
-	sz.syncAsByte(_gyro->dna.spurge_talk);
-	sz.syncAsByte(_gyro->dna.met_avaroid);
-	sz.syncAsByte(_gyro->dna.taken_mushroom);
-	sz.syncAsByte(_gyro->dna.given_pen_to_ayles);
-	sz.syncAsByte(_gyro->dna.asked_dogfood_about_nim);
+	sz.syncAsSint32LE(_gyro->_dna._totalTime);
+	sz.syncAsByte(_gyro->_dna._jumpStatus);
+	sz.syncAsByte(_gyro->_dna._mushroomGrowing);
+	sz.syncAsByte(_gyro->_dna._spludwickAtHome);
+	sz.syncAsByte(_gyro->_dna._lastRoom);
+	sz.syncAsByte(_gyro->_dna._lastRoomNotMap);
+	sz.syncAsByte(_gyro->_dna._crapulusWillTell);
+	sz.syncAsByte(_gyro->_dna._enterCatacombsFromLustiesRoom);
+	sz.syncAsByte(_gyro->_dna._teetotal);
+	sz.syncAsByte(_gyro->_dna._malagauche);
+	sz.syncAsByte(_gyro->_dna._drinking);
+	sz.syncAsByte(_gyro->_dna._enteredLustiesRoomAsMonk);
+	sz.syncAsByte(_gyro->_dna._catacombX);
+	sz.syncAsByte(_gyro->_dna._catacombY);
+	sz.syncAsByte(_gyro->_dna._avvysInTheCupboard);
+	sz.syncAsByte(_gyro->_dna._geidaFollows);
+	sz.syncAsByte(_gyro->_dna._geidaSpin);
+	sz.syncAsByte(_gyro->_dna._geidaTime);
+	sz.syncAsByte(_gyro->_dna._nextBell);
+	sz.syncAsByte(_gyro->_dna._givenPotionToGeida);
+	sz.syncAsByte(_gyro->_dna._lustieIsAsleep);
+	sz.syncAsByte(_gyro->_dna._flipToWhere);
+	sz.syncAsByte(_gyro->_dna._flipToPed);
+	sz.syncAsByte(_gyro->_dna._beenTiedUp);
+	sz.syncAsByte(_gyro->_dna._sittingInPub);
+	sz.syncAsByte(_gyro->_dna._spurgeTalkCount);
+	sz.syncAsByte(_gyro->_dna._metAvaroid);
+	sz.syncAsByte(_gyro->_dna._takenMushroom);
+	sz.syncAsByte(_gyro->_dna._givenPenToAyles);
+	sz.syncAsByte(_gyro->_dna._askedDogfoodAboutNim);
 
 
 #if 0
@@ -345,7 +345,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
-	return (!_gyro->seescroll && _gyro->alive);
+	return (!_gyro->_seeScroll && _gyro->_alive);
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
@@ -398,7 +398,7 @@ Common::String AvalancheEngine::getSaveFileName(const int slot) {
 
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
-	return (!_gyro->seescroll);
+	return (!_gyro->_seeScroll);
 }
 
 Common::Error AvalancheEngine::loadGameState(int slot) {
@@ -451,10 +451,10 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_gyro->isLoaded = true;
 
-	_gyro->seescroll = true;  // This prevents display of the new sprites before the new picture is loaded.
+	_gyro->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
-	if (_gyro->holdthedawn) {
-		_gyro->holdthedawn = false;
+	if (_gyro->_holdTheDawn) {
+		_gyro->_holdTheDawn = false;
 		_lucerna->dawn();
 	}
 
@@ -464,9 +464,9 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_dropdown->setupMenu();
 
-	_gyro->_whereIs[0] = _gyro->dna.room;
+	_gyro->_whereIs[0] = _gyro->_dna._room;
 	
-	_gyro->alive = true;
+	_gyro->_alive = true;
 
 	_lucerna->objectlist();
 
@@ -474,18 +474,18 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->showrw();
 
-	_gyro->ontoolbar = false;
+	_gyro->_onToolbar = false;
 	_trip->trippancy_link();
 
 	_celer->updateBackgroundSprites();
 	
 	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
 		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
-		+ _gyro->roomname + _scrolls->kControlNewLine + _scrolls->kControlNewLine
+		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
 
 	if (_trip->tr[0].quick && _trip->tr[0].visible)
-		_trip->rwsp(0, _gyro->dna.rw); // We push Avvy in the right direction is he was moving.
+		_trip->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
@@ -497,7 +497,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 
 	Common::String month = months[m];
 
-	Common::String day = _gyro->strf(d);
+	Common::String day = _gyro->intToStr(d);
 
 	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
 		switch (d % 10) {
@@ -514,7 +514,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 			day = day + "th";
 		}
 
-	return day + ' ' + month + ' ' + _gyro->strf(y + 1900);
+	return day + ' ' + month + ' ' + _gyro->intToStr(y + 1900);
 }
 
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3f948c3..3d3a7a0 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -109,7 +109,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
-		if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake) {
+		if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) {
 			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
 			_vm->_lucerna->showrw();
 			return;
@@ -130,40 +130,36 @@ void Avalot::handleKeyDown(Common::Event &event) {
 
 
 void Avalot::setup() {
-	_vm->_gyro->visible = _vm->_gyro->m_no;
-	_vm->_gyro->to_do = 0;
-	_vm->_gyro->lmo = false;
+	_vm->_gyro->_mouse = _vm->_gyro->kMouseStateNo;
+	_vm->_gyro->_letMeOut = false;
 	_vm->_scrolls->resetscroll();
 	CursorMan.showMouse(true);
-	_vm->_gyro->holdthedawn = true;
+	_vm->_gyro->_holdTheDawn = true;
 	_vm->_lucerna->dusk();
-	_vm->_gyro->cmp = 177;
+	_vm->_gyro->_currentMouse = 177;
 	_vm->_lucerna->mouse_init();  // on;
-	_vm->_gyro->dropsok = true;
-	_vm->_gyro->ctrl = ckey;
-	_vm->_gyro->oldjw = 177;
-	_vm->_gyro->mousetext = "";
-	_vm->_gyro->c = 999;
-	_vm->_gyro->ddmnow = false;
+	_vm->_gyro->_dropsOk = true;
+	_vm->_gyro->_mouseText = "";
+	_vm->_gyro->_dropdownActive = false;
 	_vm->_lucerna->load_digits();
-	_vm->_gyro->cheat = false;
-	_vm->_gyro->cp = 0;
+	_vm->_gyro->_cheat = false;
+	_vm->_gyro->_cp = 0;
 	_vm->_parser->_inputTextPos = 0;
 	_vm->_parser->_quote = true;
-	_vm->_gyro->ledstatus = 177;
-	_vm->_gyro->defaultled = 2;
+	_vm->_gyro->_ledStatus = 177;
+	_vm->_gyro->_defaultLed = 2;
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_gyro->dna.rw = _vm->_gyro->kDirectionStopped;
-	_vm->_gyro->enid_filename = ""; // Undefined.
+	_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionStopped;
+	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->toolbar();
 	_vm->_scrolls->state(2);
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro->lastscore[i] = -1; // Impossible digits.
+		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
 	_vm->_trip->loadtrip();
 
 	_vm->_trip->get_back_loretta();
-	_vm->_gyro->holdthedawn = false;
+	_vm->_gyro->_holdTheDawn = false;
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
@@ -174,17 +170,17 @@ void Avalot::setup() {
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {	
-		_vm->_gyro->thinks = 2; // You always have money.
-		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->kThing);
+		_vm->_gyro->_thinks = 2; // You always have money.
+		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
 		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
-		_vm->_gyro->newgame(); // No game was requested- load the default.
+		_vm->_gyro->newGame(); // No game was requested- load the default.
 
-		_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
+		_vm->_gyro->_soundFx = ! _vm->_gyro->_soundFx;
 		_vm->_lucerna->fxtoggle();
-		_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->kThing);
+		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
 
 		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
 	}	
@@ -204,7 +200,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_lucerna->clock_lucerna();
 		_vm->_dropdown->updateMenu();
-		_vm->_gyro->force_numlock();
+		_vm->_gyro->forceNumlock();
 		_vm->_trip->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_trip->trippancy_link();
@@ -215,12 +211,12 @@ void Avalot::run(Common::String arg) {
 
 #ifdef DEBUG
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->lineNum; i++) 
-			_vm->_graphics->_surface.drawLine(_vm->_gyro->lines[i].x1, _vm->_gyro->lines[i].y1, _vm->_gyro->lines[i].x2, _vm->_gyro->lines[i].y2, _vm->_gyro->lines[i].col);
+		for (byte i = 0; i < _vm->_gyro->_lineNum; i++) 
+			_vm->_graphics->_surface.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i].col);
 
-		for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-			if (_vm->_gyro->fields[i].x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->fields[i].x1, _vm->_gyro->fields[i].y1, _vm->_gyro->fields[i].x2, _vm->_gyro->fields[i].y2), kColorLightmagenta);
+		for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
+			if (_vm->_gyro->_fields[i]._x1 < 640)
+				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->_fields[i]._x1, _vm->_gyro->_fields[i]._y1, _vm->_gyro->_fields[i]._x2, _vm->_gyro->_fields[i]._y2), kColorLightmagenta);
 		}
 		// ONLY FOR TESTING!!!
 #endif
@@ -231,7 +227,7 @@ void Avalot::run(Common::String arg) {
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
 		if (delay <= 55)
 			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
-	} while (! _vm->_gyro->lmo);
+	} while (! _vm->_gyro->_letMeOut);
 
 	//if (logging)
 	//	close(logfile);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index c9ad3cf..cd56ead 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -54,31 +54,31 @@ Celer::~Celer() {
  * @remarks	Originally called 'pics_link'
  */
 void Celer::updateBackgroundSprites() {
-	if (_vm->_gyro->ddmnow)
+	if (_vm->_gyro->_dropdownActive)
 		return; // No animation when the menus are up.
 
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__outsideargentpub:
-		if ((_vm->_gyro->roomtime % 12) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 4);
+		if ((_vm->_gyro->_roomTime % 12) == 0)
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
 		break;
 	case r__brummieroad:
-		if ((_vm->_gyro->roomtime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 2) % 4);
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
 	case r__bridge:
-		if ((_vm->_gyro->roomtime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->roomtime / 2) % 4);
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
 	case r__yours:
-		if ((!_vm->_gyro->dna.avvy_is_awake) && ((_vm->_gyro->roomtime % 4) == 0))
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 12) % 2);
+		if ((!_vm->_gyro->_dna._avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
 		break;
 	case r__argentpub:
-		if (((_vm->_gyro->roomtime % 7) == 1) && (_vm->_gyro->dna.malagauche != 177)) {
+		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_dna._malagauche != 177)) {
 			// Malagauche cycle.
-			_vm->_gyro->dna.malagauche += 1;
-			switch (_vm->_gyro->dna.malagauche) {
+			_vm->_gyro->_dna._malagauche += 1;
+			switch (_vm->_gyro->_dna._malagauche) {
 			case 1:
 			case 11:
 			case 21:
@@ -94,12 +94,12 @@ void Celer::updateBackgroundSprites() {
 				drawBackgroundSprite(-1, -1, 13); // Winks.
 				break; 
 			case 33:
-				_vm->_gyro->dna.malagauche = 0;
+				_vm->_gyro->_dna._malagauche = 0;
 				break;
 			}
 		}
 
-		switch (_vm->_gyro->roomtime % 200) {
+		switch (_vm->_gyro->_roomTime % 200) {
 		case 179:
 		case 197:
 			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
@@ -112,11 +112,11 @@ void Celer::updateBackgroundSprites() {
 			drawBackgroundSprite(-1, -1, 7);
 			break;
 		case 199:
-			_vm->_gyro->dna.dogfoodpos = 177; // Impossible value for this.
+			_vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this.
 			break; 
 		}
 
-		if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { // Normally.
+		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
 			byte direction = 0;
 			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
 				direction = 3;
@@ -125,15 +125,15 @@ void Celer::updateBackgroundSprites() {
 			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
 				direction = 4;
 
-			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->dna.dogfoodpos = direction;
+				_vm->_gyro->_dna._dogFoodPos = direction;
 			}
 		}
 		break;
 	case r__westhall:
-		if ((_vm->_gyro->roomtime % 3) == 0) {
-			switch ((_vm->_gyro->roomtime / int32(3)) % int32(6)) {
+		if ((_vm->_gyro->_roomTime % 3) == 0) {
+			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
 			case 4:
 				drawBackgroundSprite(-1, -1, 1);
 				break;
@@ -150,10 +150,10 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	case r__lustiesroom:
-		if (!(_vm->_gyro->dna.lustie_is_asleep)) {
+		if (!(_vm->_gyro->_dna._lustieIsAsleep)) {
 			byte direction = 0;
 			uint16 angle = _vm->_lucerna->bearing(2);
-			if ((_vm->_gyro->roomtime % 45) > 42)
+			if ((_vm->_gyro->_roomTime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
 			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
@@ -163,15 +163,15 @@ void Celer::updateBackgroundSprites() {
 			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
-			if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+				_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
 			}
 		}
 		break;
 	case r__aylesoffice:
-		if ((!_vm->_gyro->dna.ayles_is_awake) && (_vm->_gyro->roomtime % 14 == 0)) {
-			switch ((_vm->_gyro->roomtime / 14) % 2) {
+		if ((!_vm->_gyro->_dna._aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
+			switch ((_vm->_gyro->_roomTime / 14) % 2) {
 			case 0:
 				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
 				break;
@@ -182,8 +182,8 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	case r__robins:
-		if (_vm->_gyro->dna.tied_up) {
-			switch (_vm->_gyro->roomtime % 54) {
+		if (_vm->_gyro->_dna._tiedUp) {
+			switch (_vm->_gyro->_roomTime % 54) {
 			case 20:
 				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
 				break; 
@@ -204,15 +204,15 @@ void Celer::updateBackgroundSprites() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_gyro->roomtime % 60) > 57)
+		if ((_vm->_gyro->_roomTime % 60) > 57)
 			direction--; // Blinks.
 
-		if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
 		}
 
-		switch (_vm->_gyro->roomtime % 50) {
+		switch (_vm->_gyro->_roomTime % 50) {
 		case 45 :
 			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
 			break; 
@@ -223,8 +223,8 @@ void Celer::updateBackgroundSprites() {
 		break;
 	  }
 	case r__ducks: {
-		if ((_vm->_gyro->roomtime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->roomtime / 3) % 3);
+		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3);
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
@@ -236,25 +236,25 @@ void Celer::updateBackgroundSprites() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_gyro->roomtime % 45) > 42)
+		if ((_vm->_gyro->_roomTime % 45) > 42)
 			direction++; // Duck blinks.
 
-		if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->dna.dogfoodpos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
 		}
 		break;
 	   }
 	}
 
-	if ((_vm->_gyro->dna.ringing_bells) && (_vm->_gyro->flagset('B'))) {
+	if ((_vm->_gyro->_dna._bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
 		// They're ringing the bells.
-		switch (_vm->_gyro->roomtime % 4) {
+		switch (_vm->_gyro->_roomTime % 4) {
 		case 1:
-			if (_vm->_gyro->dna.nextbell < 5)
-				_vm->_gyro->dna.nextbell = 12;
-			_vm->_gyro->dna.nextbell--;
-			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->dna.nextbell]);
+			if (_vm->_gyro->_dna._nextBell < 5)
+				_vm->_gyro->_dna._nextBell = 12;
+			_vm->_gyro->_dna._nextBell--;
+			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_dna._nextBell]);
 			break;
 		case 2:
 			//nosound();
@@ -373,17 +373,17 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 
 
 void Celer::drawSprite(int16 x, int16 y, SpriteType &sprite) {
-	_r.x1 = x;
-	_r.y1 = y;
-	_r.y2 = y + sprite._yl;
+	_r._x1 = x;
+	_r._y1 = y;
+	_r._y2 = y + sprite._yl;
 
 	switch (sprite._type) {
 	case kNaturalImage: // Allow fallthrough on purpose.
 	case kBgi:
-		_r.x2 = x + sprite._xl + 1;
+		_r._x2 = x + sprite._xl + 1;
 		break;
 	case kEga:
-		_r.x2 = x + sprite._xl;
+		_r._x2 = x + sprite._xl;
 		break;
 	}
 
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 090eda2..674f6e1 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -69,7 +69,7 @@ private:
 	int32 _offsets[40];
 	byte _spriteNum;
 	SpriteType _sprites[40];
-	bytefield _r;
+	ByteField _r;
 	Common::String _filename;
 	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index c207fda..7424d82 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -70,10 +70,10 @@ void HeadType::highlight() {
 	
 	_dr->_activeMenuItem._left = _xpos;
 	_dr->_activeMenuItem._activeNow = true;
-	_dr->_vm->_gyro->ddmnow = true;
+	_dr->_vm->_gyro->_dropdownActive = true;
 	_dr->_activeMenuItem._activeNum = _position;
 	
-	_dr->_vm->_gyro->cmp = 177; // Force redraw of cursor.
+	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
 }
 
 bool HeadType::parseAltTrigger(char key) {
@@ -87,7 +87,7 @@ bool HeadType::parseAltTrigger(char key) {
 void MenuItem::init(Dropdown *dr) {
 	_dr = dr;
 	_activeNow = false;
-	_dr->_vm->_gyro->ddmnow = false;
+	_dr->_vm->_gyro->_dropdownActive = false;
 	_activeNum = 1;
 }
 
@@ -138,7 +138,7 @@ void MenuItem::display() {
 	_flx2 = _left + _width;
 	fly = 15 + _optionNum * 10;
 	_activeNow = true;
-	_dr->_vm->_gyro->ddmnow = true;
+	_dr->_vm->_gyro->_dropdownActive = true;
 
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, fly), _dr->kMenuBackgroundColor);
 	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
@@ -147,8 +147,8 @@ void MenuItem::display() {
 	for (byte y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 	
-	_dr->_vm->_gyro->defaultled = 1;
-	_dr->_vm->_gyro->cmp = 177;
+	_dr->_vm->_gyro->_defaultLed = 1;
+	_dr->_vm->_gyro->_currentMouse = 177;
 	//mousepage(cp);
 	CursorMan.showMouse(true); // 4 = fletch
 }
@@ -160,9 +160,9 @@ void MenuItem::wipe() {
 	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
 
 	_activeNow = false;
-	_dr->_vm->_gyro->ddmnow = false;
+	_dr->_vm->_gyro->_dropdownActive = false;
 	_firstlix = false;
-	_dr->_vm->_gyro->defaultled = 2;
+	_dr->_vm->_gyro->_defaultLed = 2;
 
 	CursorMan.showMouse(true); 
 }
@@ -232,14 +232,14 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Drop
 }
 
 void MenuBar::draw() {
-	const bytefield menuspace = {0, 0, 80, 9};
+	const ByteField menuspace = {0, 0, 80, 9};
 
 	//setactivepage(3);
 	
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
-	byte savecp = _dr->_vm->_gyro->cp;
-	_dr->_vm->_gyro->cp = 3;
+	byte savecp = _dr->_vm->_gyro->_cp;
+	_dr->_vm->_gyro->_cp = 3;
 
 	for (byte i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
@@ -247,7 +247,7 @@ void MenuBar::draw() {
 	for (byte page = 0; page <= 1; page++)
 		_dr->_vm->_trip->getset[page].remember(menuspace);
 
-	_dr->_vm->_gyro->cp = savecp;
+	_dr->_vm->_gyro->_cp = savecp;
 }
 
 void MenuBar::parseAltTrigger(char c) {
@@ -287,30 +287,30 @@ Dropdown::Dropdown(AvalancheEngine *vm) {
 }
 
 void Dropdown::findWhatYouCanDoWithIt() {
-	switch (_vm->_gyro->thinks) {
-	case Gyro::wine:
-	case Gyro::potion:
-	case Gyro::ink:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeDrink;
+	switch (_vm->_gyro->_thinks) {
+	case Gyro::kObjectWine:
+	case Gyro::kObjectPotion:
+	case Gyro::kObjectInk:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeDrink;
 		break;
-	case Gyro::bell:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeRing;
+	case Gyro::kObjectBell:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeRing;
 		break;
-	case Gyro::chastity:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
+	case Gyro::kObjectChastity:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
-	case Gyro::lute:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodePlay;
+	case Gyro::kObjectLute:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodePlay;
 		break;
-	case Gyro::mushroom:
-	case Gyro::onion:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeEat;
+	case Gyro::kObjectMushroom:
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeEat;
 		break;
-	case Gyro::clothes:
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
+	case Gyro::kObjectClothes:
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->verbstr = _vm->_acci->kVerbCodeExam; // Anything else.
+		_vm->_gyro->_verbStr = _vm->_acci->kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -335,7 +335,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 	for (byte i = 0; i < text.size(); i++) {
 		for (byte j = 0; j < 8; j++) {
 			byte idx = text[i];
-			font[idx][j] = _vm->_gyro->characters[idx][j] & ander; // Set the font.
+			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
 			for (byte k = 0; k < 8; k++)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
@@ -434,9 +434,9 @@ void Dropdown::setupMenuFile() {
 	_activeMenuItem.reset();
 	_activeMenuItem.setupOption("New game", 'N', "f4", true);
 	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
-	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->alive);
-	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->alive);
-	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->atkey + '1', true);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
 	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
 	_activeMenuItem.display();
 }
@@ -444,7 +444,7 @@ void Dropdown::setupMenuFile() {
 void Dropdown::setupMenuAction() {
 	_activeMenuItem.reset();
 
-	Common::String f5Does = _vm->_gyro->f5_does();
+	Common::String f5Does = _vm->_gyro->f5Does();
 	for (byte i = 0; i < 2; i++)
 		if (!f5Does.empty())
 			f5Does.deleteChar(0);
@@ -453,7 +453,7 @@ void Dropdown::setupMenuAction() {
 	else
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->dna.room == 99)
+	if (_vm->_gyro->_dna._room == 99)
 		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_trip->neardoor());
 	else
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_trip->neardoor());
@@ -474,8 +474,8 @@ void Dropdown::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (byte i = 150; i <= 178; i++)
-		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->dna.room) {
-			_activeMenuItem.setupOption(_vm->_gyro->getname(i), _vm->_gyro->getnamechar(i), "", true);
+		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_dna._room) {
+			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
 			people = people + i;
 		}
 
@@ -484,9 +484,9 @@ void Dropdown::setupMenuPeople() {
 
 void Dropdown::setupMenuObjects() {
 	_activeMenuItem.reset();
-	for (byte i = 0; i < numobjs; i++) {
-		if (_vm->_gyro->dna.obj[i])
-			_activeMenuItem.setupOption(_vm->_gyro->get_thing(i + 1), _vm->_gyro->get_thingchar(i + 1), "", true);
+	for (byte i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_dna._objects[i])
+			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
 	}
 	_activeMenuItem.display();
 }
@@ -494,56 +494,56 @@ void Dropdown::setupMenuObjects() {
 void Dropdown::setupMenuWith() {
 	_activeMenuItem.reset();
 
-	if (_vm->_gyro->thinkthing) {
+	if (_vm->_gyro->_thinkThing) {
 		findWhatYouCanDoWithIt();
 
-		for (byte i = 0; i < _vm->_gyro->verbstr.size(); i++) {
+		for (byte i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
 			char vbchar;
 			Common::String verb;
 
-			_vm->_acci->verbOpt(_vm->_gyro->verbstr[i], verb, vbchar);
+			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 		
-		if ((_vm->_gyro->last_person == _vm->_gyro->pavalot) || (_vm->_gyro->last_person == _vm->_acci->kNothing)
-			|| (_vm->_gyro->_whereIs[_vm->_gyro->last_person - 150] != _vm->_gyro->dna.room))
+		if ((_vm->_gyro->_lastPerson == _vm->_gyro->kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
+			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getname(_vm->_gyro->last_person), 'G', "", true);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeGive;
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
-		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->thinks), 'T', "", true);
-		_vm->_gyro->verbstr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
-		switch (_vm->_gyro->thinks) {
-		case Gyro::pgeida:
-		case Gyro::parkata: {
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
+		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
+		switch (_vm->_gyro->_thinks) {
+		case Gyro::kPeopleGeida:
+		case Gyro::kPeopleArkata: {
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodeKiss;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodeKiss;
 		}
 		break;
-		case Gyro::pdogfood: {
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->dna.wonnim); // True if you HAVEN'T won.
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + _vm->_acci->kVerbCodePlay;
+		case Gyro::kPeopleDogfood: {
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_dna._wonNim); // True if you HAVEN'T won.
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodePlay;
 		}
 		break;
-		case Gyro::pmalagauche: {
-			bool isSober = !_vm->_gyro->dna.teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]);
+		case Gyro::kPeopleMalagauche: {
+			bool isSober = !_vm->_gyro->_dna._teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
 			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + 101 + 100 + 102 + 103 + 104;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
 		}
 		break;
-		case Gyro::ptrader: {
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]);
-			_vm->_gyro->verbstr = _vm->_gyro->verbstr + 105;
+		case Gyro::kPeopleTrader: {
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1]);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
 		}
 		break;
 		}
@@ -610,7 +610,7 @@ void Dropdown::runMenuAction() {
 	case 0: {
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		f5Does = _vm->_gyro->f5_does();
+		f5Does = _vm->_gyro->f5Does();
 		_vm->_lucerna->callVerb(f5Does[0]);
 	}
 	break;
@@ -640,28 +640,28 @@ void Dropdown::runMenuAction() {
 }
 
 void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkabout(_vm->_gyro->objlist[_activeMenuItem._choiceNum + 1], _vm->_gyro->kThing);
+	_vm->_lucerna->thinkabout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], _vm->_gyro->kThing);
 }
 
 void Dropdown::runMenuPeople() {
 	_vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->kPerson);
-	_vm->_gyro->last_person = people[_activeMenuItem._choiceNum];
+	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
 }
 
 void Dropdown::runMenuWith() {
-	_vm->_acci->_thing = _vm->_gyro->thinks;
+	_vm->_acci->_thing = _vm->_gyro->_thinks;
 
-	if (_vm->_gyro->thinkthing) {
+	if (_vm->_gyro->_thinkThing) {
 
 		_vm->_acci->_thing += 49;
 
-		if (_vm->_gyro->verbstr[_activeMenuItem._choiceNum] == _vm->_acci->kVerbCodeGive)
-			_vm->_acci->_person = _vm->_gyro->last_person;
+		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == _vm->_acci->kVerbCodeGive)
+			_vm->_acci->_person = _vm->_gyro->_lastPerson;
 		else
 			_vm->_acci->_person = 254;
 
 	} else {
-		switch (_vm->_gyro->verbstr[_activeMenuItem._choiceNum]) {
+		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: { // Beer
 			_vm->_acci->_thing = 100;
 			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
@@ -701,11 +701,11 @@ void Dropdown::runMenuWith() {
 		default: {
 			_vm->_acci->_person = _vm->_acci->_thing;
 			_vm->_acci->_thing = 254;
-			_vm->_gyro->subjnumber = 0;
+			_vm->_gyro->_subjectNum = 0;
 		}
 		}
 	}
-	_vm->_lucerna->callVerb(_vm->_gyro->verbstr[_activeMenuItem._choiceNum]);
+	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Dropdown::setupMenu() {   
@@ -742,14 +742,14 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_gyro->newpointer(1); // Up arrow
+					_vm->_gyro->newMouse(1); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem.fly * 2 + 1))
-						_vm->_gyro->newpointer(3); // Right-arrow
+						_vm->_gyro->newMouse(3); // Right-arrow
 					else
-						_vm->_gyro->newpointer(4); // Fletch
+						_vm->_gyro->newMouse(4); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_gyro->newpointer(2); // Screwdriver
+					_vm->_gyro->newMouse(2); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index be98b4e..a22a205 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -244,18 +244,18 @@ void Enid::avvyBackground() {
 #endif
 }
 
-void Enid::toSundry(sundry &sund) {
-	sund.qenid_filename = _vm->_gyro->enid_filename;
-	sund.qsoundfx = _vm->_gyro->soundfx;
-	sund.qthinks = _vm->_gyro->thinks;
-	sund.qthinkthing = _vm->_gyro->thinkthing;
+void Enid::toSundry(Sundry &sund) {
+	sund._qEnidFilename = _vm->_gyro->_enidFilename;
+	sund._qSoundFx = _vm->_gyro->_soundFx;
+	sund._qThinks = _vm->_gyro->_thinks;
+	sund._qThinkThing = _vm->_gyro->_thinkThing;
 }
 
-void Enid::fromSundry(sundry sund) {
-	_vm->_gyro->enid_filename = sund.qenid_filename;
-	_vm->_gyro->soundfx = sund.qsoundfx;
-	_vm->_gyro->thinks = sund.qthinks;
-	_vm->_gyro->thinkthing = sund.qthinkthing;
+void Enid::fromSundry(Sundry sund) {
+	_vm->_gyro->_enidFilename = sund._qEnidFilename;
+	_vm->_gyro->_soundFx = sund._qSoundFx;
+	_vm->_gyro->_thinks = sund._qThinks;
+	_vm->_gyro->_thinkThing = sund._qThinkThing;
 }
 
 void Enid::restoreDna() {
@@ -269,19 +269,19 @@ void Enid::ednaReload() {
 
 	restoreDna();
 
-	_vm->_gyro->seescroll = true;  // This prevents display of the new sprites before the
+	_vm->_gyro->_seeScroll = true;  // This prevents display of the new sprites before the
 								   // new picture is loaded.
 
 	_vm->_lucerna->major_redraw();
 
-	_vm->_gyro->_whereIs[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
-	_vm->_gyro->alive = true;
+	_vm->_gyro->_alive = true;
 
 	_vm->_lucerna->objectlist();
 
-	if (_vm->_gyro->holdthedawn) {
-		_vm->_gyro->holdthedawn = false;
+	if (_vm->_gyro->_holdTheDawn) {
+		_vm->_gyro->_holdTheDawn = false;
 		_vm->_lucerna->dawn();
 	}
 }
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 3badc23..c0876f3 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -47,8 +47,8 @@
 
 namespace Avalanche {
 
-const char *Gyro::vernum = "1.30";
-const char *Gyro::copyright = "1995";
+const char *Gyro::kVersionNum = "1.30";
+const char *Gyro::kCopyright = "1995";
 
 
 const MouseHotspotType Gyro::kMouseHotSpots[9] = {
@@ -127,25 +127,27 @@ const int32 Gyro::kCatacombMap[8][8] = {
 		7     = wall with door and candles,
 		F     = straight-through corridor. */
 
-const char Gyro::kSpludwicksOrder[3] = {onion, ink, mushroom};
+const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
 
+// A quasiped defines how people who aren't sprites talk. For example, quasiped
+// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
 const QuasipedType Gyro::kQuasipeds[16] = {
-	{2, kColorLightgray, 19, kColorBrown, pdogfood},                       // A: Dogfood (screen 19). 
-	{3, kColorGreen,     19, kColorWhite, pibythneth},                     // B: Ibythneth (screen 19).
-	{3, kColorWhite,     1, kColorMagenta, parkata},                       // C: Arkata (screen 1).
+	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood},                       // A: Dogfood (screen 19). 
+	{3, kColorGreen,     19, kColorWhite, kPeopleIbythneth},                     // B: Ibythneth (screen 19).
+	{3, kColorWhite,     1, kColorMagenta, kPeopleArkata},                       // C: Arkata (screen 1).
 	{3, kColorBlack,     23, kColorRed, 177},							   // D: Hawk (screen 23).
-	{3, kColorLightgreen, 50, kColorBrown, ptrader},                       // E: Trader (screen 50).
-	{6, kColorYellow,    42, kColorRed, pavalot},                          // F: Avvy, tied up (scr.42)
-	{2, kColorBlue,      16, kColorWhite, payles},                         // G: Ayles (screen 16).
-	{2, kColorBrown,     7, kColorWhite, pjacques},                        // H: Jacques (screen 7).
-	{2, kColorLightgreen, 47, kColorGreen, pspurge},                       // I: Spurge (screen 47).
-	{3, kColorYellow,    47, kColorRed, pavalot},                          // J: Avalot (screen 47).
-	{2, kColorLightgray, 23, kColorBlack, pdulustie},                      // K: du Lustie (screen 23).
-	{2, kColorYellow,    27, kColorRed, pavalot},                          // L: Avalot (screen 27).
+	{3, kColorLightgreen, 50, kColorBrown, kPeopleTrader},                       // E: Trader (screen 50).
+	{6, kColorYellow,    42, kColorRed, kPeopleAvalot},                          // F: Avvy, tied up (scr.42)
+	{2, kColorBlue,      16, kColorWhite, kPeopleAyles},                         // G: Ayles (screen 16).
+	{2, kColorBrown,     7, kColorWhite, kPeopleJacques},                        // H: Jacques (screen 7).
+	{2, kColorLightgreen, 47, kColorGreen, kPeopleSpurge},                       // I: Spurge (screen 47).
+	{3, kColorYellow,    47, kColorRed, kPeopleAvalot},                          // J: Avalot (screen 47).
+	{2, kColorLightgray, 23, kColorBlack, kPeopleDuLustie},                      // K: du Lustie (screen 23).
+	{2, kColorYellow,    27, kColorRed, kPeopleAvalot},                          // L: Avalot (screen 27).
 	{3, kColorWhite,     27, kColorRed, 177},                              // M: Avaroid (screen 27).
-	{4, kColorLightgray, 19, kColorDarkgray, pmalagauche},                 // N: Malagauche (screen 19).
-	{5, kColorLightmagenta, 47, kColorRed, pport},                         // O: Port (screen 47).
-	{2, kColorLightgreen, 51, kColorDarkgray, pdrduck}                     // P: Duck (screen 51).
+	{4, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche},                 // N: Malagauche (screen 19).
+	{5, kColorLightmagenta, 47, kColorRed, kPeoplePort},                         // O: Port (screen 47).
+	{2, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck}                     // P: Duck (screen 51).
 };
 
 const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
@@ -186,22 +188,22 @@ byte Gyro::_whereIs[29] = {
 	r__wisewomans  // The Wise Woman.
 };
 
-const Common::String Gyro::things[numobjs] = {
+const Common::String Gyro::kThings[kObjectNum] = {
 	"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
 	"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
 	"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
 };
 
-const char Gyro::thingchar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+const char Gyro::kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
 
-const Common::String Gyro::better[numobjs] = {
+const Common::String Gyro::kItems[kObjectNum] = {
 	"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
 	"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
 	"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
 	"an onion"
 };
 
-const char Gyro::betterchar[] = "WMBParCLguKeSnIohn";
+const char Gyro::kItemsChar[] = "WMBParCLguKeSnIohn";
 
 Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	_vm = vm;
@@ -209,30 +211,30 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	// Needed because of Lucerna::load_also()
 	for (int fv = 0; fv < 31; fv++) {
 		for (int ff = 0; ff < 2; ff++)
-			also[fv][ff] = 0;
+			_also[fv][ff] = 0;
 	}
-	dna.total_time = 0;
+	_dna._totalTime = 0;
 }
 
 Gyro::~Gyro() {
 	for (byte i = 0; i < 9; i++) {
-		digit[i].free();
-		rwlite[i].free();
+		_digits[i].free();
+		_directions[i].free();
 	}
-	digit[9].free();
+	_digits[9].free();
 }
 
-Common::String Gyro::strf(int32 x) {
+Common::String Gyro::intToStr(int32 x) {
 	Common::String q = Common::String::format("%d", x);
 	return q;
 }
 
-void Gyro::newpointer(byte id) {
-	if (id == cmp)
+void Gyro::newMouse(byte id) {
+	if (id == _currentMouse)
 		return;
-	cmp = id;
+	_currentMouse = id;
 
-	load_a_mouse(id);
+	loadMouse(id);
 }
 
 /**
@@ -240,23 +242,7 @@ void Gyro::newpointer(byte id) {
  * @remarks	Originally called 'wait'
  */
 void Gyro::setMousePointerWait() {
-	newpointer(5);
-}
-
-void Gyro::on() {
-	warning("STUB: Gyro::on()");
-}
-
-void Gyro::off() {
-	warning("STUB: Gyro::off()");
-}
-
-void Gyro::xycheck() { 
-	warning("STUB: Gyro::xycheck()");
-}
-
-void Gyro::check() {
-	warning("STUB: Gyro::check()");
+	newMouse(5);
 }
 
 void Gyro::note(uint16 hertz) {
@@ -267,15 +253,15 @@ void Gyro::blip() {
 	warning("STUB: Gyro::blip()");
 }
 
-void Gyro::shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
+void Gyro::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
 	warning("STUB: Gyro::shadow()");
 }
 
-void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+void Gyro::shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 	warning("STUB: Gyro::shbox()");
 }
 
-void Gyro::newgame() { 
+void Gyro::newGame() { 
 	for (byte gm = 0; gm < kMaxSprites; gm++) {
 		if (_vm->_trip->tr[gm].quick)
 			_vm->_trip->tr[gm].done();
@@ -283,47 +269,45 @@ void Gyro::newgame() {
 	// Deallocate sprite. Sorry, beta testers!
 
 	_vm->_trip->tr[0].init(0, true, _vm->_trip);
-	alive = true;
+	_alive = true;
 
-	score = 0;
+	_score = 0;
 	//for gd:=0 to 5 do which[gd]:=1;
-	memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
+	memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
 	_vm->_scrolls->natural();
 	_vm->_lucerna->mousepage(0);
-	dna.spare_evening = "answer a questionnaire";
-	dna.like2drink = "beer";
-
-	dna.pence = 30; // 2/6
-	dna.rw = kDirectionStopped;
-	dna.wearing = clothes;
-	dna.obj[money - 1] = true;
-	dna.obj[bodkin - 1] = true;
-	dna.obj[bell - 1] = true;
-	dna.obj[clothes - 1] = true;
+	_dna._spareEvening = "answer a questionnaire";
+	_dna._favouriteDrink = "beer";
+
+	_dna._money = 30; // 2/6
+	_dna._direction = kDirectionStopped;
+	_dna._wearing = kObjectClothes;
+	_dna._objects[kObjectMoney - 1] = true;
+	_dna._objects[kObjectBodkin - 1] = true;
+	_dna._objects[kObjectBell - 1] = true;
+	_dna._objects[kObjectClothes - 1] = true;
 	
-	thinkthing = true;
-	thinks = 2;
+	_thinkThing = true;
+	_thinks = 2;
 	_vm->_lucerna->objectlist();
-	ontoolbar = false;
-	seescroll = false;
+	_onToolbar = false;
+	_seeScroll = false;
 
-	ppos[0][1] = -177; 
 	_vm->_trip->tr[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
-	him = 254;
-	her = 254;
-	it = 254;
-	last_person = 254; // = Pardon?
-	dna.pass_num = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
-	after_the_scroll = false;
-	dna.user_moves_avvy = false;
-	doing_sprite_run = false;
-	dna.avvy_in_bed = true;
-	enid_filename = "";
+	_him = 254;
+	_her = 254;
+	_it = 254;
+	_lastPerson = 254; // = Pardon?
+	_dna._passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_dna._userMovesAvvy = false;
+	_doingSpriteRun = false;
+	_dna._avvyInBed = true;
+	_enidFilename = "";
 
 	for (byte gd = 0; gd <= 1; gd++) {
-		cp = 1 - cp;
+		_cp = 1 - _cp;
 		_vm->_trip->getback();
 	}
 
@@ -340,26 +324,26 @@ void Gyro::click() {
 	warning("STUB: Gyro::click()");
 }
 
-void Gyro::slowdown() {
+void Gyro::slowDown() {
 	warning("STUB: Gyro::slowdown()");
 }
 
-bool Gyro::flagset(char x) {
-	for (uint16 i = 0; i < flags.size(); i++) {
-		if (flags[i] == x)
+bool Gyro::setFlag(char x) {
+	for (uint16 i = 0; i < _flags.size(); i++) {
+		if (_flags[i] == x)
 			return true;
 	}
 
 	return false;
 }
 
-void Gyro::force_numlock() {
+void Gyro::forceNumlock() {
 	warning("STUB: Gyro::force_numlock()");
 }
 
-bool Gyro::pennycheck(uint16 howmuchby) {
-	dna.pence -= howmuchby;
-	if (dna.pence < 0) {
+bool Gyro::updateMoney(uint16 howmuchby) {
+	_dna._money -= howmuchby;
+	if (_dna._money < 0) {
 		_vm->_visa->dixi('Q', 2); // "You are now denariusless!"
 		_vm->_lucerna->gameover();
 		return false;
@@ -369,7 +353,7 @@ bool Gyro::pennycheck(uint16 howmuchby) {
 
 // There'll may be problems with calling these functions because of the conversion of the arrays!!!
 // Keep an eye open!
-Common::String Gyro::getname(byte whose) { 
+Common::String Gyro::getName(byte whose) { 
 	if (whose < 175)
 		return kLads[whose - 150];
 	else
@@ -377,7 +361,7 @@ Common::String Gyro::getname(byte whose) {
 }
 
 // Keep an eye open! ^
-byte Gyro::getnamechar(byte whose) {
+byte Gyro::getNameChar(byte whose) {
 	if (whose < 175) 
 		return kLadChar[whose - 150];
 	else
@@ -385,78 +369,78 @@ byte Gyro::getnamechar(byte whose) {
 }
 
 // Keep an eye open! ^^
-Common::String Gyro::get_thing(byte which) {
+Common::String Gyro::getThing(byte which) {
 	Common::String get_thing_result;
 	switch (which) {
-	case wine:
-		switch (dna.winestate) {
+	case kObjectWine:
+		switch (_dna._wineState) {
 		case 1:
 		case 4:
-			get_thing_result = things[which - 1];
+			get_thing_result = kThings[which - 1];
 			break;
 		case 3:
 			get_thing_result = "Vinegar";
 			break;
 		}
 		break;
-	case onion:
-		if (dna.rotten_onion)
+	case kObjectOnion:
+		if (_dna._rottenOnion)
 			get_thing_result = "rotten onion";
 		else
-			get_thing_result = things[which - 1];
+			get_thing_result = kThings[which - 1];
 		break;
 	default:
-		get_thing_result = things[which - 1];
+		get_thing_result = kThings[which - 1];
 	}
 	return get_thing_result;
 }
 
 // Keep an eye open! ^^^
-char Gyro::get_thingchar(byte which) {
+char Gyro::getThingChar(byte which) {
 	char get_thingchar_result;
 	switch (which) {
-	case wine:
-		if (dna.winestate == 3)
+	case kObjectWine:
+		if (_dna._wineState == 3)
 			get_thingchar_result = 'V'; // Vinegar
 		else
-			get_thingchar_result = thingchar[which - 1];
+			get_thingchar_result = kThingsChar[which - 1];
 		break;
 	default:
-		get_thingchar_result = thingchar[which - 1];
+		get_thingchar_result = kThingsChar[which - 1];
 	}
 	return get_thingchar_result;
 }
 
 // Keep an eye open! ^^^^
-Common::String Gyro::get_better(byte which) {
+Common::String Gyro::getItem(byte which) {
 	Common::String get_better_result;
 	if (which > 150)
 		which -= 149;
 
 	switch (which) {
-	case wine:
-		switch (dna.winestate) {
+	case kObjectWine:
+		switch (_dna._wineState) {
 		case 0:
 		case 1:
 		case 4:
-			get_better_result = better[which - 1];
+			get_better_result = kItems[which - 1];
 			break;
 		case 3:
 			get_better_result = "some vinegar";
 			break;
 		}
 		break;
-	case onion:
-		if (dna.rotten_onion)
+	case kObjectOnion:
+		if (_dna._rottenOnion)
 			get_better_result = "a rotten onion";
-		else if (dna.onion_in_vinegar)
+		else if (_dna._onionInVinegar)
 			get_better_result = "a pickled onion (in the vinegar)";
 		else
-			get_better_result = better[which - 1];
+			get_better_result = kItems[which - 1];
 		break;
 	default:
-		if ((which < numobjs) && (which > 0))
-			get_better_result = better[which - 1];
+		if ((which < kObjectNum) && (which > 0))
+			get_better_result = kItems[which - 1];
 		else
 			get_better_result = "";
 	}
@@ -464,24 +448,24 @@ Common::String Gyro::get_better(byte which) {
 }
 
 
-Common::String Gyro::f5_does() {
+Common::String Gyro::f5Does() {
 	Common::String f5_does_result;
-	switch (dna.room) {
+	switch (_dna._room) {
 	case r__yours: {
-			if (!dna.avvy_is_awake)
+			if (!_dna._avvyIsAwake)
 				return Common::String(_vm->_acci->kVerbCodeWake) + "WWake up";
-			else if (dna.avvy_in_bed)
+			else if (_dna._avvyInBed)
 				return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up";
 		}
 		break;
 	case r__insidecardiffcastle: 
-		if (dna.standing_on_dais)
+		if (_dna._standingOnDais)
 			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down";
 		else
 			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb up";
 		break;
 	case r__nottspub:
-		if (dna.sitting_in_pub)
+		if (_dna._sittingInPub)
 			return Common::String(_vm->_acci->kVerbCodeStand) + "SStand up";
 		else
 			return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down";
@@ -495,7 +479,7 @@ Common::String Gyro::f5_does() {
 	return Common::String(_vm->_acci->kPardon); // If all else fails...
 }
 
-void Gyro::load_a_mouse(byte which) {
+void Gyro::loadMouse(byte which) {
 	Common::File f;
 
 	if (!f.open("mice.avd")) {
@@ -509,7 +493,7 @@ void Gyro::load_a_mouse(byte which) {
 
 
 	// The AND mask.
-	f.seek(mouse_size * 2 * (which - 1) + 134);
+	f.seek(kMouseSize * 2 * (which - 1) + 134);
 
 	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
 
@@ -522,7 +506,7 @@ void Gyro::load_a_mouse(byte which) {
 	mask.free();
 
 	// The OR mask.
-	f.seek(mouse_size * 2 * (which - 1) + 134 * 2);
+	f.seek(kMouseSize * 2 * (which - 1) + 134 * 2);
 
 	mask = _vm->_graphics->loadPictureGraphic(f);
 
@@ -545,17 +529,13 @@ void Gyro::load_a_mouse(byte which) {
 	cursor.free();
 }
 
-void Gyro::background(byte x) {
+void Gyro::setBackgroundColor(byte x) {
 	warning("STUB: Gyro::background()");
 }
 
-void Gyro::hang_around_for_a_while() {
+void Gyro::hangAroundForAWhile() {
 	for (byte i = 0; i < 28; i++)
-		slowdown();
-}
-
-bool Gyro::mouse_near_text() {
-	return (my > 144) && (my < 188);
+		slowDown();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index bd2e9b1..89346d7 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -43,201 +43,163 @@ namespace Avalanche {
 class AvalancheEngine;
 
 
-static const byte numobjs = 18; // always preface with a #
-static const int16 maxobjs = 12;  // carry limit
+static const byte kObjectNum = 18; // always preface with a #
+static const int16 kCarryLimit = 12;  // carry limit
 
-static const int16 numlockCode = 32;  // Code for Num Lock
-static const int16 mouse_size = 134;
+static const int16 kNumlockCode = 32;  // Code for Num Lock
+static const int16 kMouseSize = 134;
 
 struct MouseHotspotType { // mouse-void 
 	int16 _horizontal, _vertical;
 };
 
-struct dnatype { // here goes... Ux, uy, & ww now all belong to Trip5
-	byte rw; // Realway- just for convenience!
-	byte carrying; // how many objects you're carrying...
-	bool obj[numobjs]; // ...and which ones they are.
-	int16 score; // your score, of course
-	int32 pence; // your current amount of dosh
-	byte room; // your current room
-	byte wearing; // what you're wearing
-	byte swore; // number of times you've sworn
-	byte saves; // number of times this game has been saved
-	byte rooms[100]; // Add one to each every time you enter a room
-	byte alcohol; // Your blood alcohol level.
-	byte playednim; // How many times you've played Nim.
-	bool wonnim; // Have you *won* Nim? (That's harder.)
-	byte winestate; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
-	bool cwytalot_gone; // Has Cwytalot rushed off to Jerusalem yet?
+struct DnaType { // Ux, uy, & ww now all belong to Trip5
+	byte _direction; // The direction Avvy is currently facing.
+	byte _carryNum; // How many objects you're carrying...
+	bool _objects[kObjectNum]; // ...and which ones they are.
+	int16 _score; // your score, of course
+	int32 _money; // your current amount of dosh
+	byte _room; // your current room
+	byte _wearing; // what you're wearing
+	byte _sworeNum; // number of times you've sworn
+	byte _saveNum; // number of times this game has been saved
+	byte _roomCount[100]; // Add one to each every time you enter a room
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _wonNim; // Have you *won* Nim? (That's harder.)
+	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
 
-	byte pass_num; // Number of the passw for this game.
-	bool ayles_is_awake; // pretty obvious!
-	byte drawbridge_open; // Between 0 (shut) and 4 (open).
-	byte avaricius_talk; // How much Avaricius has said to you.
-	bool bought_onion; // Have you bought an onion yet?
-	bool rotten_onion; // And has it rotted?
-	bool onion_in_vinegar; // Is the onion in the vinegar?
+	byte _passwordNum; // Number of the passw for this game.
+	bool _aylesIsAwake; // pretty obvious!
+	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
+	byte _avariciusTalk; // How much Avaricius has said to you.
+	bool _boughtOnion; // Have you bought an onion yet?
+	bool _rottenOnion; // And has it rotted?
+	bool _onionInVinegar; // Is the onion in the vinegar?
 
-	byte given2spludwick; // 0 = nothing given, 1 = onion...
-	byte brummie_stairs; // Progression through the stairs trick.
-	byte cardiff_things; // Things you get asked in Cardiff.
+	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
+	byte _brummieStairs; // Progression through the stairs trick.
+	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
 
-	bool cwytalot_in_herts; // Have you passed Cwytalot in Herts?
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 
-	bool avvy_is_awake; // Well? Is Avvy awake? (Screen 1 only.)
-	bool avvy_in_bed; // True if Avvy's in bed, but awake.
+	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool _avvyInBed; // True if Avvy's in bed, but awake.
 
-	bool user_moves_avvy; // If this is false, the user has no
-						  // control over Avvy's movements.
+	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
 
-	byte dogfoodpos; // Which way Dogfood's looking in the pub.
+	byte _dogFoodPos; // Which way Dogfood's looking in the pub.
 
-	bool givenbadgetoiby; // Have you given the badge to Iby yet?
+	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
 
-	bool friar_will_tie_you_up; // If you're going to get tied up.
-	bool tied_up; // You ARE tied up!
+	bool _friarWillTieYouUp; // If you're going to get tied up.
+	bool _tiedUp; // You ARE tied up!
 
-	byte box_contents; // 0 = money (sixpence), 254 = empty, any
-					   // other number implies the contents of the box.
+	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
 
-	bool talked_to_crapulus; // Pretty self-explanatory.
+	bool _talkedToCrapulus; // Pretty self-explanatory.
 
-	byte jacques_awake; // 0=asleep, 1=awake, 2=gets up, 3=gone.
+	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
 
-	bool ringing_bells; // Is Jacques ringing the bells?
+	bool _bellsAreRinging; // Is Jacques ringing the bells?
 
-	bool standing_on_dais; // In room 71, inside Cardiff Castle.
-	bool taken_pen; // Have you taken the pen (in Cardiff?)
-	bool arrow_triggered; // And has the arrow been triggered?
-	bool arrow_in_the_door;  // Did the arrow hit the wall?
+	bool _standingOnDais; // In room 71, inside Cardiff Castle.
+	bool _takenPen; // Have you taken the pen (in Cardiff?)
+	bool _arrowTriggered; // And has the arrow been triggered?
+	bool _arrowInTheDoor;  // Did the arrow hit the wall?
 
-	Common::String like2drink,
-					favourite_song,
-					worst_place_on_earth,
-					spare_evening;            // Personalisation str's
+	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
 
-	uint32 total_time; // Your total time playing this game, in ticks.
+	uint32 _totalTime; // Your total time playing this game, in ticks.
 
-	byte jumpstatus; // Fixes how high you're jumping.
+	byte _jumpStatus; // Fixes how high you're jumping.
 
-	bool mushroom_growing; // Is the mushroom growing in 42? 
+	bool _mushroomGrowing; // Is the mushroom growing in 42? 
 
-	bool spludwicks_here; // Is Spludwick at home?
+	bool _spludwickAtHome; // Is Spludwick at home?
 
-	byte last_room;
-	byte last_room_not_map;
+	byte _lastRoom;
+	byte _lastRoomNotMap;
 
-	bool crapulus_will_tell; // Will Crapulus tell you about
-							 // Spludwick being away?
+	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
 
-	bool enter_catacombs_from_lusties_room;
-	bool teetotal; // Are we touching any more drinks?
-	byte malagauche; // Position of Malagauche. See Celer for more info.
-	char drinking; // What's he getting you?
+	bool _enterCatacombsFromLustiesRoom;
+	bool _teetotal; // Are we touching any more drinks?
+	byte _malagauche; // Position of Malagauche. See Celer for more info.
+	char _drinking; // What's he getting you?
 
-	bool entered_lusties_room_as_monk;
+	bool _enteredLustiesRoomAsMonk;
 
-	byte cat_x, cat_y;   // XY coords in the catacombs.
+	byte _catacombX, _catacombY;   // XY coords in the catacombs.
 
-	bool avvys_in_the_cupboard; // On screen 22.
+	bool _avvysInTheCupboard; // On screen 22.
 
-	bool geida_follows; // Is Geida following you?
+	bool _geidaFollows; // Is Geida following you?
 
-	byte geida_spin, geida_time; // For the making "Geida dizzy" joke.
+	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
 
-	byte nextbell; // For the ringing.
+	byte _nextBell; // For the ringing.
 
-	bool geida_given_potion; // Does Geida have the potion?
-	bool lustie_is_asleep; // Is BDL asleep?
+	bool _givenPotionToGeida; // Does Geida have the potion?
+	bool _lustieIsAsleep; // Is BDL asleep?
 
-	byte flip_to_where, flip_to_ped; // For the sequencer.
+	byte _flipToWhere, _flipToPed; // For the sequencer.
 
-	bool been_tied_up; // In r__Robins.
+	bool _beenTiedUp; // In r__Robins.
 
-	bool sitting_in_pub; // Are you sitting down in the pub?
-	byte spurge_talk; // Count for talking to Spurge.
+	bool _sittingInPub; // Are you sitting down in the pub?
+	byte _spurgeTalkCount; // Count for talking to Spurge.
 
-	bool met_avaroid;
+	bool _metAvaroid;
 
-	bool taken_mushroom,
-			given_pen_to_ayles,
-			asked_dogfood_about_nim;
+	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
 };
 
-struct pedtype {
-	int16 x, y;
-	byte dir;
+struct PedType {
+	int16 _x, _y;
+	byte _direction;
 };
 
-struct magictype {
-	byte op; // one of the operations
-	uint16 data; // data for them
+struct MagicType {
+	byte _operation; // one of the operations
+	uint16 _data; // data for them
 };
 
-class fieldtype {
+class FieldType {
 public:
-	int16 x1, y1, x2, y2;
+	int16 _x1, _y1, _x2, _y2;
 };
 
-struct bytefield {
-	byte x1, y1, x2, y2;
+struct ByteField {
+	byte _x1, _y1, _x2, _y2;
 };
 
-class linetype : public fieldtype {
+class LineType : public FieldType {
 public:
-	byte col;
+	byte _color;
 };
 
-enum controllers {cjoy, ckey};
-
-typedef Common::String previoustype[20];
-
-struct corridor_type { // Decarations for the corridors.
-	uint16 doors; // Door styles are calc'ed from this uint16.
-				  // Assign a different number to each one!
-};
-
-struct demo_type {
-	uint16 delay;
-	char key, extd;
+struct DemoType {
+	uint16 _delay;
+	char _key, _extd;
 };
 
 struct QuasipedType {
-	byte whichped, fgc, room, bgc;
-	uint16 who;
+	byte _whichPed, _foregroundColor, _room, _backgroundColor;
+	uint16 _who;
 };
-/* A quasiped defines how people who aren't sprites talk. For example,
-	quasiped "A" is Dogfood. The rooms aren't stored because I'm leaving
-	that to context. */
 
 typedef byte TuneType[31];
 
-
-struct PointType {
-	int16 x, y;
-};
-
-struct vmctype { // Virtual Mouse Cursor
-	byte *andpic, *xorpic;
-	byte *backpic[2];
-	PointType wherewas[2];
-	byte picnumber;
-	int8 ofsx, ofsy;
-};
-
-struct sundry {
-	// Things which must be saved over a backtobootstrap, outside DNA.
-	Common::String qenid_filename;
-	bool qsoundfx;
-	char qthinks;
-	bool qthinkthing;
-};
-
-struct joysetup {
-	uint16 xmid, ymid, xmin, ymin, xmax, ymax;
-	byte centre; // Size of centre in tenths
+struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA.
+	Common::String _qEnidFilename;
+	bool _qSoundFx;
+	byte _qThinks;
+	bool _qThinkThing;
 };
 
+#if 0
 struct ednahead { // Edna header
 	// This header starts at byte offset 177 in the .ASG file.
 	char id[9];   // signature
@@ -268,65 +230,67 @@ struct ednahead { // Edna header
 
 	// DNA values follow, then footer (which is ignored)
 };
+#endif
 
 class Gyro {
 public:
-	static const char *vernum;
-	static const char *copyright;
-	static const int16 thisvercode = 130;
-	// as "vernum", but numerically & without the ".".
-	static const int16 thisgamecode = 2; // Avalot's code number
+	static const char *kVersionNum;
+	static const char *kCopyright;
+	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
+	static const int16 kGameCode = 2; // Avalot's code number
 
 	// Objects you can hold:
-	static const char wine = 1;
-	static const char money = 2;
-	static const char bodkin = 3;
-	static const char potion = 4;
-	static const char chastity = 5;
-	static const char bolt = 6;
-	static const char crossbow = 7;
-	static const char lute = 8;
-	static const char badge = 9;
-	static const char mushroom = 10;
-	static const char key = 11;
-	static const char bell = 12;
-	static const char prescription = 13;
-	static const char pen = 14;
-	static const char ink = 15;
-	static const char clothes = 16;
-	static const char habit = 17;
-	static const char onion = 18;
+	enum Object {
+		kObjectWine = 1,
+		kObjectMoney,
+		kObjectBodkin,
+		kObjectPotion,
+		kObjectChastity,
+		kObjectBolt,
+		kObjectCrossbow,
+		kObjectLute,
+		kObjectBadge,
+		kObjectMushroom,
+		kObjectKey,
+		kObjectBell,
+		kObjectPrescription,
+		kObjectPen,
+		kObjectInk,
+		kObjectClothes,
+		kObjectHabit,
+		kObjectOnion
+	};
 
 	// People who hang around this game.
+	enum People {
+		// Boys:
+		kPeopleAvalot = 150,
+		kPeopleSpludwick = 151,
+		kPeopleCrapulus = 152,
+		kPeopleDrDuck = 153,
+		kPeopleMalagauche = 154,
+		kPeopleFriarTuck = 155,
+		kPeopleRobinHood = 156,
+		kPeopleCwytalot = 157,
+		kPeopleDuLustie = 158,
+		kPeopleDuke = 159,
+		kPeopleDogfood = 160,
+		kPeopleTrader = 161,
+		kPeopleIbythneth = 162,
+		kPeopleAyles = 163,
+		kPeoplePort = 164,
+		kPeopleSpurge = 165,
+		kPeopleJacques = 166,
+		// Girls:
+		kPeopleArkata = 175,
+		kPeopleGeida = 176,
+		kPeopleWisewoman = 178
+	};
+
+	static const int16 kXW = 30;
+	static const int16 kYW = 36; // x width & y whatsit
 
-	// Boys:
-	static const uint16 pavalot = 150;
-	static const uint16 pspludwick = 151;
-	static const uint16 pcrapulus = 152;
-	static const uint16 pdrduck = 153;
-	static const uint16 pmalagauche = 154;
-	static const uint16 pfriartuck = 155;
-	static const uint16 probinhood = 156;
-	static const uint16 pcwytalot = 157;
-	static const uint16 pdulustie = 158;
-	static const uint16 pduke = 159;
-	static const uint16 pdogfood = 160;
-	static const uint16 ptrader = 161;
-	static const uint16 pibythneth = 162;
-	static const uint16 payles = 163;
-	static const uint16 pport = 164;
-	static const uint16 pspurge = 165;
-	static const uint16 pjacques = 166;
-
-	// Girls:
-	static const uint16 parkata = 175;
-	static const uint16 pgeida = 176;
-	static const uint16 pwisewoman = 178;
-
-	static const int16 xw = 30;
-	static const int16 yw = 36; // x width & y whatsit
-
-	static const int16 margin = 5;
+	static const int16 kMargin = 5;
 
 	static const MouseHotspotType kMouseHotSpots[9];
 
@@ -394,215 +358,155 @@ public:
 
 
 
-
-	byte _interrogation;
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
-
+	byte _interrogation;
+	
 	static byte _whereIs[29];
 
-	bool _onCanDoPageSwap; 
 	// Variable static constant for overriding the ability of On to switch pages.
 	// You may know better than On which page to switch to.
+	bool _onCanDoPageSwap; 
+	
 
 
 
-	// previous:^previoustype;
-	dnatype dna;
-	byte lineNum; // Number of lines.
-	linetype lines[50]; // For Also.
-	int16 c;
-	//registers r; // http://www.freepascal.org/docs-html/rtl/dos/registers.html
-	enum { m_no , m_yes , m_virtual } visible;
-	bool dropsok, screturn, soundfx, cheat;
-	uint16 mx, my; // mouse x & y now
-	uint16 mpx, mpy; // mouse x & y when pressed
-	uint16 mrx, mry; // mouse x & y when released
-	byte mpress, mrelease; // times left mouse button has been pressed/released
-	byte keystatus; // Mouse key status
-	Common::String un[10];
-	byte unn;
-	Common::String mousetext;
-	// which:array[0..5] of byte;
-	void *p;
-	bool weirdword;
-	byte to_do;
-	bool lmo, mousemade;
-	Common::String scroll[15];
-	byte scrolln, score, whichwas;
-	byte thinks;
-	bool thinkthing;
-
-	// pp:array[1..1000] of postype;
-	// bb:array[1..9000] of byte;
-	uint16 pptr, bptr;
-	int16 ppos[1][2];
-	uint16 pozzes[24];
-	byte anim;
-	void *copier;
-	int16 talkx, talky;
-	byte talkb, talkf;
-	byte scrollbells; // no. of times to ring the bell
-	bool ontoolbar, seescroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
-
-	char objlist[10];
-
-	::Graphics::Surface digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
-	::Graphics::Surface rwlite[9]; // Maybe it will be needed to move them to the class itself instead.
-	// Called .free() for them in ~Gyro().
-
-	byte oldrw;
-	int8 lastscore[3];
-	byte cmp; // current mouse-void
-	Common::String verbstr; // what you can do with your object. :-)
-
-	Common::String *also[31][2];
-	pedtype peds[15];
-	magictype magics[15];
-	magictype portals[7];
-	fieldtype fields[30];
-	byte numfields;
-	Common::String flags;
-	Common::String listen;
-
-	uint16 oh, onh, om, hour, minutes, seconds;
-
-	Common::String atkey; // For XTs, set to "alt-". For ATs, set to "f1".
+	DnaType _dna;
+	byte _lineNum; // Number of lines.
+	LineType _lines[50]; // For Also.
+	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
+	bool _dropsOk, _scReturn, _soundFx, _cheat;
+	Common::String _mouseText;
+	bool _weirdWord;
+	bool _letMeOut;
+	Common::String _scroll[15];
+	byte _scrollNum, _score, _whichwas;
+	byte _thinks;
+	bool _thinkThing;
 
-	byte cp, ledstatus, defaultled;
-	FontType characters;
-	bool alive;
-	byte buffer[2000];
-	uint16 bufsize;
+	int16 _talkX, _talkY;
+	byte _talkBackgroundColor, _talkFontColor;
+	byte _scrollBells; // no. of times to ring the bell
+	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 
-	byte oldjw; // Old joystick-way
-	controllers ctrl;
+	char _objectList[10];
 
-	int16 underscroll; // Y-coord of just under the scroll text.
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	// Called .free() for them in ~Gyro().
 
-	// TSkellern is only temporary, and I'll replace it
-	// with a local version when it's all fixed up.
+	byte _oldDirection;
+	int8 _scoreToDisplay[3];
+	byte _currentMouse; // current mouse-void
+	Common::String _verbStr; // what you can do with your object. :-)
 
-	// tskellern:int32 absolute $0:244; { Over int $61 }
+	Common::String *_also[31][2];
+	PedType _peds[15];
+	MagicType _magics[15];
+	MagicType _portals[7];
+	FieldType _fields[30];
+	byte _fieldNum;
+	Common::String _flags;
+	Common::String _listen;
 
-	bool ddmnow; // Kludge so we don't have to keep referring to Dropdown
-	Common::String roomname; // Name of this room
+	uint16 _oh, _onh, _om, _hours, _minutes, _seconds;
 
-	//text logfile; // http://wiki.freepascal.org/Text
-	bool log_epson;
+	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
 
-	bool cl_override;
+	byte _cp, _ledStatus, _defaultLed;
+	FontType _font;
+	bool _alive;
+	byte _buffer[2000];
+	uint16 _bufSize;
 
-	byte locks; // ABSOLUTE $40:$17;
+	int16 _underScroll; // Y-coord of just under the scroll text.
 
-	Common::String subject; // What you're talking to them about.
-	byte subjnumber; // The same thing.
+	bool _dropdownActive; // Kludge so we don't have to keep referring to Dropdown
+	Common::String _roomnName; // Name of actual room
 
-	bool keyboardclick; // Is a keyboard click noise wanted?
+	Common::String _subject; // What you're talking to them about.
+	byte _subjectNum; // The same thing.
 
-	byte him, her, it;
-	int32 roomtime; // Set to 0 when you enter a room, added to in every loop.
+	bool _keyboardClick; // Is a keyboard click noise wanted?
 
-	bool after_the_scroll;
+	byte _him, _her, _it;
+	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
 	// For the demo:
-	demo_type demo_rec;
-	Common::File demofile; // of demo_type
-	Common::DumpFile demofile_save; // uruk added it - first use located in constructor of Basher
-
-	byte last_person; // Last person to have been selected using the People menu.
+	DemoType _demoRec;
+	Common::File _demoFile; // of demo_type
+	Common::DumpFile _demoFileSave; // uruk added it - first use located in constructor of Basher
 
-	bool doing_sprite_run; // Only set to True if we're doing a sprite_run
-						   // at this moment. This stops the trippancy system
-						   // from moving any of the sprites.
+	byte _lastPerson; // Last person to have been selected using the People menu.
 
-	vmctype vmc;
-	Common::String filetoload;
+	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 
-	bool holdthedawn; // If this is true, calling Dawn will do nothing.
-					  // It's used, for example, at the start, to stop Load from dawning.
+	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 
-	uint16 storage_seg, storage_ofs; // Seg and ofs of the Storage area.
-	uint16 skellern; // Offset of the timer variable - 1 more than storage_OFS
 	bool isLoaded; // Is it a loaded gamestate?
 
-	bool super_was_virtual, super_was_off; // Used by Super_Off and Super_On
+	Common::String _enidFilename;
 
-	Common::String enid_filename;
-
-	joysetup js;
-	uint16 cxmin, cxmax, cymin, cymax;
-	bool use_joy_a;
 
 
 	Gyro(AvalancheEngine *vm);
 
 	~Gyro();
 
-	Common::String strf(int32 x);
+	Common::String intToStr(int32 x);
 
-	void newpointer(byte id);
+	void newMouse(byte id);
 
 	void setMousePointerWait();    // Makes hourglass.
 
-	void on();
-
-	void off();
-
-	void xycheck(); // Only updates mx & my, not all other mouse vars.
-
-	void check();
-
 	void note(uint16 hertz);
 
 	void blip();
 
-	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
+	void shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
-	void newgame(); // This sets up the DNA for a completely new game.
+	void newGame(); // This sets up the DNA for a completely new game.
 
 	void click(); // "Audio keyboard feedback"
 
-	void slowdown();
-
-	bool flagset(char x);
+	void slowDown();
 
-	void force_numlock();
+	bool setFlag(char x);
 
-	bool pennycheck(uint16 howmuchby);
+	void forceNumlock();
 
-	Common::String getname(byte whose);
+	bool updateMoney(uint16 howmuchby); // Called pennycheck in the original.
 
-	byte getnamechar(byte whose);
+	Common::String getName(byte whose);
 
-	Common::String get_thing(byte which);
+	byte getNameChar(byte whose);
 
-	char get_thingchar(byte which);
+	Common::String getThing(byte which);
 
-	Common::String get_better(byte which);
+	char getThingChar(byte which);
 
-	Common::String f5_does(); // This procedure determines what f5 does.
+	Common::String getItem(byte which); // Called get_better in the original.
 
-	void load_a_mouse(byte which);
+	Common::String f5Does(); // This procedure determines what f5 does.
 
-	void background(byte x);
+	void loadMouse(byte which);
 
-	void hang_around_for_a_while();
+	void setBackgroundColor(byte x);
 
-	bool mouse_near_text();
+	void hangAroundForAWhile();
 
 private:
 	AvalancheEngine *_vm;
 	
-	static const Common::String things[numobjs];
+	static const Common::String kThings[kObjectNum];
 
-	static const char thingchar[];
+	static const char kThingsChar[];
 
-	static const Common::String better[numobjs];
+	static const Common::String kItems[kObjectNum]; // 'better' in the original.
 
-	static const char betterchar[];
+	static const char kItemsChar[]; // Similar as above.
 
-	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
+	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index c4dc6fc..425cab0 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -60,18 +60,18 @@ Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
 Lucerna::~Lucerna() {
 	for (byte i = 0; i < 31; i++)
 		for (byte j = 0; j < 2; j++)
-			if (_vm->_gyro->also[i][j] != 0)  {
-				delete _vm->_gyro->also[i][j];
-				_vm->_gyro->also[i][j] = 0;
+			if (_vm->_gyro->_also[i][j] != 0)  {
+				delete _vm->_gyro->_also[i][j];
+				_vm->_gyro->_also[i][j] = 0;
 			}
 }
 
 void Lucerna::init() {
-	_vm->_gyro->oh = _vm->_gyro->onh = _vm->_gyro->om = 17717;
+	_vm->_gyro->_oh = _vm->_gyro->_onh = _vm->_gyro->_om = 17717;
 
 	for (byte i = 0; i < 31; i++)
 		for (byte j = 0; j < 2; j++)
-			_vm->_gyro->also[i][j] = 0;
+			_vm->_gyro->_also[i][j] = 0;
 
 #if 0
 	if (_vm->_enhanced->atbios)
@@ -92,7 +92,7 @@ void Lucerna::callVerb(byte id) {
 			"assigned to it. You may press alt-A to see what the " +
 			"current setting of this key is.");
 	} else {
-		_vm->_gyro->weirdword = false;
+		_vm->_gyro->_weirdWord = false;
 		_vm->_acci->_polite = true;
 		_vm->_acci->_verb = id;
 		_vm->_acci->doThat();
@@ -107,11 +107,11 @@ void Lucerna::draw_also_lines() {
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
-	for (ff = 0; ff < _vm->_gyro->lineNum; ff++) {
+	for (ff = 0; ff < _vm->_gyro->_lineNum; ff++) {
 		// We had to check if the lines are within the borders of the screen.
-		if ((_vm->_gyro->lines[ff].x1 >= 0) && (_vm->_gyro->lines[ff].x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y1 >= 0) && (_vm->_gyro->lines[ff].y1 < _vm->_graphics->kScreenHeight)
-		 && (_vm->_gyro->lines[ff].x2 >= 0) && (_vm->_gyro->lines[ff].x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->lines[ff].y2 >= 0) && (_vm->_gyro->lines[ff].y2 < _vm->_graphics->kScreenHeight))
-			_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
+		if ((_vm->_gyro->_lines[ff]._x1 >= 0) && (_vm->_gyro->_lines[ff]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y1 >= 0) && (_vm->_gyro->_lines[ff]._y1 < _vm->_graphics->kScreenHeight)
+		 && (_vm->_gyro->_lines[ff]._x2 >= 0) && (_vm->_gyro->_lines[ff]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y2 >= 0) && (_vm->_gyro->_lines[ff]._y2 < _vm->_graphics->kScreenHeight))
+			_vm->_graphics->_magics.drawLine(_vm->_gyro->_lines[ff]._x1, _vm->_gyro->_lines[ff]._y1, _vm->_gyro->_lines[ff]._x2, _vm->_gyro->_lines[ff]._y2, _vm->_gyro->_lines[ff]._color);
 	}
 
 	CursorMan.showMouse(true);
@@ -137,10 +137,10 @@ void Lucerna::scram1(Common::String &x) {
 void Lucerna::unscramble() {
 	for (byte fv = 0; fv < 31; fv++)
 		for (byte ff = 0; ff < 2; ff++)
-			if (_vm->_gyro->also[fv][ff] != 0)
-				scram1(*_vm->_gyro->also[fv][ff]);
-	scram1(_vm->_gyro->listen);
-	scram1(_vm->_gyro->flags);
+			if (_vm->_gyro->_also[fv][ff] != 0)
+				scram1(*_vm->_gyro->_also[fv][ff]);
+	scram1(_vm->_gyro->_listen);
+	scram1(_vm->_gyro->_flags);
 }
 
 void Lucerna::load_also(Common::String n) {
@@ -148,9 +148,9 @@ void Lucerna::load_also(Common::String n) {
 	
 	for (fv = 0; fv < 31; fv++)
 		for (ff = 0; ff < 2; ff++)
-			if (_vm->_gyro->also[fv][ff] != 0)  {
-				delete _vm->_gyro->also[fv][ff];
-				_vm->_gyro->also[fv][ff] = 0;
+			if (_vm->_gyro->_also[fv][ff] != 0)  {
+				delete _vm->_gyro->_also[fv][ff];
+				_vm->_gyro->_also[fv][ff] = 0;
 			}
 
 	Common::String filename;
@@ -165,58 +165,58 @@ void Lucerna::load_also(Common::String n) {
 	byte minnames = f.readByte();
 	for (fv = 0; fv <= minnames; fv++) {
 		for (ff = 0; ff < 2; ff++) {
-			_vm->_gyro->also[fv][ff] = new Common::String;
-			*_vm->_gyro->also[fv][ff] = nextstring();
+			_vm->_gyro->_also[fv][ff] = new Common::String;
+			*_vm->_gyro->_also[fv][ff] = nextstring();
 		}
-		*_vm->_gyro->also[fv][0] = Common::String('\x9D') + *_vm->_gyro->also[fv][0] + Common::String('\x9D');
+		*_vm->_gyro->_also[fv][0] = Common::String('\x9D') + *_vm->_gyro->_also[fv][0] + Common::String('\x9D');
 	}
 	
-	memset(_vm->_gyro->lines, 0xFF, sizeof(_vm->_gyro->lines));
+	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
 	
 	//fv = getpixel(0, 0);
-	_vm->_gyro->lineNum = f.readByte();
-	for (byte i = 0; i < _vm->_gyro->lineNum; i++) {
-		_vm->_gyro->lines[i].x1 = f.readSint16LE();
-		_vm->_gyro->lines[i].y1 = f.readSint16LE();
-		_vm->_gyro->lines[i].x2 = f.readSint16LE();
-		_vm->_gyro->lines[i].y2 = f.readSint16LE();
-		_vm->_gyro->lines[i].col = f.readByte();
+	_vm->_gyro->_lineNum = f.readByte();
+	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
+		_vm->_gyro->_lines[i]._x1 = f.readSint16LE();
+		_vm->_gyro->_lines[i]._y1 = f.readSint16LE();
+		_vm->_gyro->_lines[i]._x2 = f.readSint16LE();
+		_vm->_gyro->_lines[i]._y2 = f.readSint16LE();
+		_vm->_gyro->_lines[i]._color = f.readByte();
 	}
 
-	memset(_vm->_gyro->peds, 177, sizeof(_vm->_gyro->peds));
+	memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds));
 	fv = f.readByte();
 	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro->peds[i].x = f.readSint16LE();
-		_vm->_gyro->peds[i].y = f.readSint16LE();
-		_vm->_gyro->peds[i].dir = f.readByte();
+		_vm->_gyro->_peds[i]._x = f.readSint16LE();
+		_vm->_gyro->_peds[i]._y = f.readSint16LE();
+		_vm->_gyro->_peds[i]._direction = f.readByte();
 	}
 
-	_vm->_gyro->numfields = f.readByte();
-	for (byte i = 0; i < _vm->_gyro->numfields; i++) {
-		_vm->_gyro->fields[i].x1 = f.readSint16LE();
-		_vm->_gyro->fields[i].y1 = f.readSint16LE();
-		_vm->_gyro->fields[i].x2 = f.readSint16LE();
-		_vm->_gyro->fields[i].y2 = f.readSint16LE();
+	_vm->_gyro->_fieldNum = f.readByte();
+	for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
+		_vm->_gyro->_fields[i]._x1 = f.readSint16LE();
+		_vm->_gyro->_fields[i]._y1 = f.readSint16LE();
+		_vm->_gyro->_fields[i]._x2 = f.readSint16LE();
+		_vm->_gyro->_fields[i]._y2 = f.readSint16LE();
 	}
 
 	for (byte i = 0; i < 15; i++) {
-		_vm->_gyro->magics[i].op = f.readByte();
-		_vm->_gyro->magics[i].data = f.readUint16LE();
+		_vm->_gyro->_magics[i]._operation = f.readByte();
+		_vm->_gyro->_magics[i]._data = f.readUint16LE();
 	}
 
 	for (byte i = 0; i < 7; i++) {
-		_vm->_gyro->portals[i].op = f.readByte();
-		_vm->_gyro->portals[i].data = f.readUint16LE();
+		_vm->_gyro->_portals[i]._operation = f.readByte();
+		_vm->_gyro->_portals[i]._data = f.readUint16LE();
 	}
 
-	_vm->_gyro->flags.clear();
+	_vm->_gyro->_flags.clear();
 	for (byte i = 0;  i < 26; i++)
-		_vm->_gyro->flags += f.readByte();
+		_vm->_gyro->_flags += f.readByte();
 
 	int16 listen_length = f.readByte();
-	_vm->_gyro->listen.clear();
+	_vm->_gyro->_listen.clear();
 	for (byte i = 0; i < listen_length; i++)
-		_vm->_gyro->listen += f.readByte();
+		_vm->_gyro->_listen += f.readByte();
 	
 	draw_also_lines();
 
@@ -226,7 +226,7 @@ void Lucerna::load_also(Common::String n) {
 	f.close();
 	unscramble();
 	for (fv = 0; fv <= minnames; fv++)
-		*_vm->_gyro->also[fv][0] = Common::String(',') + *_vm->_gyro->also[fv][0] + ',';
+		*_vm->_gyro->_also[fv][0] = Common::String(',') + *_vm->_gyro->_also[fv][0] + ',';
 }
 
 void Lucerna::load(byte n) {     // Load2, actually
@@ -236,7 +236,7 @@ void Lucerna::load(byte n) {     // Load2, actually
 	
 	_vm->_graphics->fleshColors();
 
-	xx = _vm->_gyro->strf(n);
+	xx = _vm->_gyro->intToStr(n);
 	Common::String filename;
 	filename = filename.format("place%s.avd", xx.c_str());
 	if (!f.open(filename)) {
@@ -245,12 +245,12 @@ void Lucerna::load(byte n) {     // Load2, actually
 	}
 
 	f.seek(146);
-	if (!_vm->_gyro->roomname.empty())
-		_vm->_gyro->roomname.clear();
+	if (!_vm->_gyro->_roomnName.empty())
+		_vm->_gyro->_roomnName.clear();
 	for (byte i = 0; i < 30; i++) {
 		char actChar = f.readByte();
 		if ((32 <= actChar) && (actChar <= 126))
-			_vm->_gyro->roomname += actChar;
+			_vm->_gyro->_roomnName += actChar;
 	}
 	// Compression method byte follows this...
 
@@ -280,9 +280,9 @@ void Lucerna::find_people(byte room) {
 	for (byte fv = 1; fv < 29; fv++) {
 		if (_vm->_gyro->_whereIs[fv] == room) {
 			if (fv < 25)
-				_vm->_gyro->him = fv + 150;
+				_vm->_gyro->_him = fv + 150;
 			else
-				_vm->_gyro->her = fv + 150;
+				_vm->_gyro->_her = fv + 150;
 		}
 	}
 }
@@ -290,17 +290,17 @@ void Lucerna::find_people(byte room) {
 void Lucerna::exitroom(byte x) {
 	//nosound();
 	_vm->_celer->forgetBackgroundSprites();
-	_vm->_gyro->seescroll = true;  // This stops the trippancy system working over the length of this procedure.
+	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
 	case r__spludwicks:
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_avariciustalks);
-		 _vm->_gyro->dna.avaricius_talk = 0;
+		 _vm->_gyro->_dna._avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
-		if (_vm->_gyro->dna.drawbridge_open > 0) {
-			_vm->_gyro->dna.drawbridge_open = 4; // Fully open.
+		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
+			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_drawbridgefalls);
 		}
 		break;
@@ -314,38 +314,38 @@ void Lucerna::exitroom(byte x) {
 
 	_vm->_gyro->_interrogation = 0; // Leaving the room cancels all the questions automatically.
 
-	_vm->_gyro->seescroll = false; // Now it can work again!
+	_vm->_gyro->_seeScroll = false; // Now it can work again!
 
-	_vm->_gyro->dna.last_room = _vm->_gyro->dna.room;
-	if (_vm->_gyro->dna.room != r__map)
-		_vm->_gyro->dna.last_room_not_map = _vm->_gyro->dna.room;
+	_vm->_gyro->_dna._lastRoom = _vm->_gyro->_dna._room;
+	if (_vm->_gyro->_dna._room != r__map)
+		_vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room;
 }
 
 void Lucerna::new_town() {   // You've just entered a town from the map.
 	_vm->_dropdown->setupMenu();
 
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__outsidenottspub: // Entry into Nottingham.
-		if ((_vm->_gyro->dna.rooms[r__robins] > 0) && (_vm->_gyro->dna.been_tied_up) && (!_vm->_gyro->dna.taken_mushroom))
-			_vm->_gyro->dna.mushroom_growing = true;
+		if ((_vm->_gyro->_dna._roomCount[r__robins] > 0) && (_vm->_gyro->_dna._beenTiedUp) && (!_vm->_gyro->_dna._takenMushroom))
+			_vm->_gyro->_dna._mushroomGrowing = true;
 		break;
 	case r__wisewomans: { // Entry into Argent.
-		if (_vm->_gyro->dna.talked_to_crapulus && (! _vm->_gyro->dna.lustie_is_asleep)) {
-			_vm->_gyro->dna.spludwicks_here = !((_vm->_gyro->dna.rooms[r__wisewomans] % 3) == 1);
-			_vm->_gyro->dna.crapulus_will_tell = ! _vm->_gyro->dna.spludwicks_here;
+		if (_vm->_gyro->_dna._talkedToCrapulus && (! _vm->_gyro->_dna._lustieIsAsleep)) {
+			_vm->_gyro->_dna._spludwickAtHome = !((_vm->_gyro->_dna._roomCount[r__wisewomans] % 3) == 1);
+			_vm->_gyro->_dna._crapulusWillTell = ! _vm->_gyro->_dna._spludwickAtHome;
 		} else {
-			_vm->_gyro->dna.spludwicks_here = true;
-			_vm->_gyro->dna.crapulus_will_tell = false;
+			_vm->_gyro->_dna._spludwickAtHome = true;
+			_vm->_gyro->_dna._crapulusWillTell = false;
 		}
-		if (_vm->_gyro->dna.box_contents == _vm->_gyro->wine)
-			_vm->_gyro->dna.winestate = 3; // Vinegar
+		if (_vm->_gyro->_dna._boxContent == _vm->_gyro->kObjectWine)
+			_vm->_gyro->_dna._wineState = 3; // Vinegar
 	}
 	break;
 	}
 
-	if (_vm->_gyro->dna.room != r__outsideducks) {
-		if ((_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]) && !(_vm->_gyro->dna.onion_in_vinegar))
-			_vm->_gyro->dna.rotten_onion = true; // You're holding the onion
+	if (_vm->_gyro->_dna._room != r__outsideducks) {
+		if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar))
+			_vm->_gyro->_dna._rottenOnion = true; // You're holding the onion
 	}
 }
 
@@ -361,33 +361,33 @@ void Lucerna::put_geida_at(byte whichped, byte &ped) {
 }
 
 void Lucerna::enterroom(byte x, byte ped) {
-	_vm->_gyro->seescroll = true;  // This stops the trippancy system working over the length of this procedure.
+	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	find_people(x);
-	_vm->_gyro->dna.room = x;
+	_vm->_gyro->_dna._room = x;
 	if (ped != 0)
-		_vm->_gyro->dna.rooms[x]++;
+		_vm->_gyro->_dna._roomCount[x]++;
 
 	load(x);
 
-	if ((_vm->_gyro->dna.rooms[x] == 0) && (! _vm->_gyro->flagset('S')))
+	if ((_vm->_gyro->_dna._roomCount[x] == 0) && (! _vm->_gyro->setFlag('S')))
 		points(1);
 
-	_vm->_gyro->_whereIs[_vm->_gyro->pavalot - 150] = _vm->_gyro->dna.room;
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
-	if (_vm->_gyro->dna.geida_follows)
-		_vm->_gyro->_whereIs[_vm->_gyro->pgeida - 150] = x;
+	if (_vm->_gyro->_dna._geidaFollows)
+		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = x;
 
-	_vm->_gyro->roomtime = 0;
+	_vm->_gyro->_roomTime = 0;
 
 	
-	if ((_vm->_gyro->dna.last_room == r__map) && (_vm->_gyro->dna.last_room_not_map != _vm->_gyro->dna.room))
+	if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room))
 		new_town();
 	
 
 	switch (x) {
 	case r__yours:
-		if (_vm->_gyro->dna.avvy_in_bed) {
+		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
@@ -396,12 +396,12 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__outsideyours:
 		if (ped > 0) {
-			if (! _vm->_gyro->dna.talked_to_crapulus) {
+			if (! _vm->_gyro->_dna._talkedToCrapulus) {
 
-				_vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = r__outsideyours;
+				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__outsideyours;
 				_vm->_trip->tr[1].init(8, false, _vm->_trip); // load Crapulus
 
-				if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
+				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
 					_vm->_trip->apped(2, 4); // Start on the right-hand side of the screen.
 					_vm->_trip->tr[1].walkto(5); // Walks up to greet you.
 				} else {
@@ -412,34 +412,34 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // He always faces Avvy.
 
-			} else _vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = r__nowhere;
+			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
 
-			if (_vm->_gyro->dna.crapulus_will_tell) {
+			if (_vm->_gyro->_dna._crapulusWillTell) {
 				_vm->_trip->tr[1].init(8, false, _vm->_trip);
 				_vm->_trip->apped(2, 2);
 				_vm->_trip->tr[1].walkto(4);
 				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
-				_vm->_gyro->dna.crapulus_will_tell = false;
+				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
 		}
 		break;
 
 	case r__outsidespludwicks:
-		if ((_vm->_gyro->dna.rooms[r__outsidespludwicks] == 1) && (ped == 1)) {
+		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->reason_explosion);
-			_vm->_gyro->dna.spludwicks_here = true;
+			_vm->_gyro->_dna._spludwickAtHome = true;
 		}
 		break;
 
 	case r__spludwicks:
-		if (_vm->_gyro->dna.spludwicks_here) {
+		if (_vm->_gyro->_dna._spludwickAtHome) {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(2, false, _vm->_trip); // load Spludwick
 				_vm->_trip->apped(2, 2);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
-			_vm->_gyro->dna.dogfoodpos = 0;  // _vm->_gyro->also Spludwick pos.
+			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
 			_vm->_trip->tr[1].call_eachstep = true;
 			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
@@ -448,19 +448,19 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__brummieroad:
-		if (_vm->_gyro->dna.geida_follows)
+		if (_vm->_gyro->_dna._geidaFollows)
 			put_geida_at(5, ped);
-		if (_vm->_gyro->dna.cwytalot_gone) {
-			_vm->_gyro->magics[kColorLightred - 1].op = _vm->_gyro->kMagicNothing;
-			_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] = r__nowhere;
+		if (_vm->_gyro->_dna._cwytalotGone) {
+			_vm->_gyro->_magics[kColorLightred - 1]._operation = _vm->_gyro->kMagicNothing;
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
 				_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot
 				_vm->_trip->tr[1].call_eachstep = true;
 				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
-				_vm->_gyro->_whereIs[_vm->_gyro->pcwytalot - 150] = r__brummieroad;
+				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
 
-				if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { // First time here...
+				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_trip->apped(2, 2); // He appears on the right of the screen...
 					_vm->_trip->tr[1].walkto(4); // ...and he walks up...
 				} else {
@@ -473,31 +473,31 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__argentroad:
-		if ((_vm->_gyro->dna.cwytalot_gone) && (! _vm->_gyro->dna.cwytalot_in_herts) && (ped == 2) &&
-		        (_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
+		if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) &&
+		        (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) {
 			_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot again
 			_vm->_trip->apped(2, 1);
 			_vm->_trip->tr[1].walkto(2);
 			_vm->_trip->tr[1].vanishifstill = true;
-			_vm->_gyro->dna.cwytalot_in_herts = true;
+			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
 		}
 		break;
 
 	case r__bridge:
-		if (_vm->_gyro->dna.drawbridge_open == 4) { // open
+		if (_vm->_gyro->_dna._drawbridgeOpen == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->magics[kColorGreen - 1].op = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+			_vm->_gyro->_magics[kColorGreen - 1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 		}
-		if (_vm->_gyro->dna.geida_follows)
+		if (_vm->_gyro->_dna._geidaFollows)
 			put_geida_at(ped + 3, ped); // load Geida
 		break;
 
 	case r__robins:
 		if (ped > 0) {
-			if (! _vm->_gyro->dna.been_tied_up) {
+			if (! _vm->_gyro->_dna._beenTiedUp) {
 				// A welcome party... or maybe not...
 				_vm->_trip->tr[1].init(6, false, _vm->_trip);
 				_vm->_trip->apped(2, 2);
@@ -506,22 +506,22 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 		}
 
-		if (_vm->_gyro->dna.been_tied_up) {
-			_vm->_gyro->_whereIs[_vm->_gyro->probinhood - 150] = 0;
-			_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = 0;
+		if (_vm->_gyro->_dna._beenTiedUp) {
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = 0;
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 0;
 		}
 
-		if (_vm->_gyro->dna.tied_up)
+		if (_vm->_gyro->_dna._tiedUp)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 
-		if (!_vm->_gyro->dna.mushroom_growing) 
+		if (!_vm->_gyro->_dna._mushroomGrowing) 
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
 		break;
 
 	case r__outsidecardiffcastle:
 		if (ped > 0)
-			switch (_vm->_gyro->dna.cardiff_things) {
+			switch (_vm->_gyro->_dna._cardiffQuestionNum) {
 			case 0 : { // You've answered NONE of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
 				_vm->_trip->apped(2, 2);
@@ -530,7 +530,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			}
 			break;
 			case 5 :
-				_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing;
+				_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: { // You've answered SOME of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
@@ -539,8 +539,8 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
-		if (_vm->_gyro->dna.cardiff_things < 5)
-			_vm->_gyro->_interrogation = _vm->_gyro->dna.cardiff_things;
+		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
+			_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
 		else _vm->_gyro->_interrogation = 0;
 		break;
 
@@ -549,13 +549,13 @@ void Lucerna::enterroom(byte x, byte ped) {
 		dawn();
 		//setactivepage(cp);
 		if (ped > 0)
-			zoomout(_vm->_gyro->peds[ped - 1].x, _vm->_gyro->peds[ped - 1].y);
+			zoomout(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y);
 		//setactivepage(1 - cp);
 
 		{
-			if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) {
+			if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
 				_vm->_visa->dixi('q', 9); // Don't want to waste the wine!
-				_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false;
+				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 				objectlist();
 			}
 		}
@@ -568,33 +568,33 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 			switch (ped) {
 			case 3: { // Enter from oubliette
-				_vm->_gyro->dna.cat_x = 8;
-				_vm->_gyro->dna.cat_y = 4;
+				_vm->_gyro->_dna._catacombX = 8;
+				_vm->_gyro->_dna._catacombY = 4;
 			}
 			break; 
 			case 5: { // Enter from du Lustie's
-				_vm->_gyro->dna.cat_x = 8;
-				_vm->_gyro->dna.cat_y = 7;
+				_vm->_gyro->_dna._catacombX = 8;
+				_vm->_gyro->_dna._catacombY = 7;
 			}
 			break; 
 			case 6: { // Enter from Geida's
-				_vm->_gyro->dna.cat_x = 4;
-				_vm->_gyro->dna.cat_y = 1;
+				_vm->_gyro->_dna._catacombX = 4;
+				_vm->_gyro->_dna._catacombY = 1;
 			}
 			break; 
 			}
 
-			_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
+			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
 			_vm->_trip->catamove(ped);
-			_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
+			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 		}
 		break;
 
 	case r__argentpub:
-		if (_vm->_gyro->dna.wonnim)
+		if (_vm->_gyro->_dna._wonNim)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
-		_vm->_gyro->dna.malagauche = 0; // Ready to boot Malagauche
-		if (_vm->_gyro->dna.givenbadgetoiby) {
+		_vm->_gyro->_dna._malagauche = 0; // Ready to boot Malagauche
+		if (_vm->_gyro->_dna._givenBadgeToIby) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		}
@@ -602,16 +602,16 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__lustiesroom:
-		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
+		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_trip->tr[0].whichsprite == 0) // Avvy in his normal clothes
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
-		else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) // already
+		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
-		if (_vm->_gyro->dna.geida_follows) {
+		if (_vm->_gyro->_dna._geidaFollows) {
 			put_geida_at(5, ped);
-			if (_vm->_gyro->dna.lustie_is_asleep) {
+			if (_vm->_gyro->_dna._lustieIsAsleep) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
 			}
@@ -619,13 +619,13 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__musicroom:
-		if (_vm->_gyro->dna.jacques_awake > 0) {
-			_vm->_gyro->dna.jacques_awake = 5;
+		if (_vm->_gyro->_dna._jacquesState > 0) {
+			_vm->_gyro->_dna._jacquesState = 5;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-			_vm->_gyro->magics[kColorBrown - 1].op = _vm->_gyro->kMagicNothing;
-			_vm->_gyro->_whereIs[_vm->_gyro->pjacques - 150] = 0;
+			_vm->_gyro->_magics[kColorBrown - 1]._operation = _vm->_gyro->kMagicNothing;
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
@@ -662,7 +662,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__wisewomans:
 		_vm->_trip->tr[1].init(11, false, _vm->_trip);
-		if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
+		if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_trip->apped(2, 2); // Start on the right-hand side of the screen.
 			_vm->_trip->tr[1].walkto(4); // Walks up to greet you.
 		} else {
@@ -680,18 +680,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
-			if (_vm->_gyro->dna.arrow_in_the_door)
+			if (_vm->_gyro->_dna._arrowInTheDoor)
 				_vm->_sequence->then_show(3);
 			else
 				_vm->_sequence->then_show(2);
 
-			if (_vm->_gyro->dna.taken_pen)
+			if (_vm->_gyro->_dna._takenPen)
 				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 
 			_vm->_sequence->start_to_close();
 		} else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-			if (_vm->_gyro->dna.arrow_in_the_door)
+			if (_vm->_gyro->_dna._arrowInTheDoor)
 				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			else
 				_vm->_celer->drawBackgroundSprite(-1, -1, 2);
@@ -732,7 +732,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__aylesoffice:
-		if (_vm->_gyro->dna.ayles_is_awake)
+		if (_vm->_gyro->_dna._aylesIsAwake)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
@@ -743,18 +743,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__easthall:
 	case r__westhall:
-		if (_vm->_gyro->dna.geida_follows)
+		if (_vm->_gyro->_dna._geidaFollows)
 			put_geida_at(ped + 2, ped);
 		break;
 
 	case r__lusties:
-		if (_vm->_gyro->dna.geida_follows)
+		if (_vm->_gyro->_dna._geidaFollows)
 			put_geida_at(ped + 6, ped);
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro->dna.sitting_in_pub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->dna.dogfoodpos = 1; // Actually, du Lustie pos.
+		if (_vm->_gyro->_dna._sittingInPub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		break;
 
 	case r__outsideducks:
@@ -771,11 +771,11 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break;
 
 	case r__ducks:
-		_vm->_gyro->dna.dogfoodpos = 1;
+		_vm->_gyro->_dna._dogFoodPos = 1;
 		break; // Actually, Duck pos.
 	}
 
-	_vm->_gyro->seescroll = false; // Now it can work again!
+	_vm->_gyro->_seeScroll = false; // Now it can work again!
 
 	if (_vm->_gyro->isLoaded)
 		_vm->_gyro->isLoaded = false;
@@ -783,9 +783,9 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 	const int16 picsize = 966;
-	const bytefield thinkspace = {25, 170, 32, 200};
+	const ByteField thinkspace = {25, 170, 32, 200};
 
-	_vm->_gyro->thinks = z;
+	_vm->_gyro->_thinks = z;
 	z--;
 
 	_vm->_gyro->setMousePointerWait();
@@ -831,7 +831,7 @@ void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 		_vm->_trip->getset[fv].remember(thinkspace);
 	
 	CursorMan.showMouse(true);
-	_vm->_gyro->thinkthing = th;
+	_vm->_gyro->_thinkThing = th;
 }
 
 void Lucerna::load_digits() {   // Load the scoring digits & rwlites
@@ -851,7 +851,7 @@ void Lucerna::load_digits() {   // Load the scoring digits & rwlites
 		f.read(_vm->_gyro->digit[fv], digitsize);
 #endif
 
-		_vm->_gyro->digit[fv] = _vm->_graphics->loadPictureGraphic(f);
+		_vm->_gyro->_digits[fv] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
 	for (byte ff = 0; ff < 9; ff++) {
@@ -862,7 +862,7 @@ void Lucerna::load_digits() {   // Load the scoring digits & rwlites
 		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
 #endif
 
-		_vm->_gyro->rwlite[ff] = _vm->_graphics->loadPictureGraphic(f);
+		_vm->_gyro->_directions[ff] = _vm->_graphics->loadPictureGraphic(f);
 	}
 
 	f.close();
@@ -888,18 +888,18 @@ void Lucerna::toolbar() {
 
 	// on;
 
-	_vm->_gyro->oldrw = 177;
+	_vm->_gyro->_oldDirection = 177;
 	showrw();
 }
 
 void Lucerna::showscore() {
 
-	const bytefield scorespace = {33, 177, 39, 200};
+	const ByteField scorespace = {33, 177, 39, 200};
 
 	if (_vm->_gyro->kDemo)
 		return;
 
-	uint16 score = _vm->_gyro->dna.score;
+	uint16 score = _vm->_gyro->_dna._score;
 	int8 numbers[3] = {0, 0, 0};
 	for (byte i = 0; i < 2; i++) {
 		byte divisor = 1;
@@ -915,8 +915,8 @@ void Lucerna::showscore() {
 	//setactivepage(3);
 
 	for (byte fv = 0; fv < 3; fv++)
-		if (_vm->_gyro->lastscore[fv] != numbers[fv]) 
-			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
+		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv]) 
+			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv++)
 		_vm->_trip->getset[fv].remember(scorespace);
@@ -925,12 +925,12 @@ void Lucerna::showscore() {
 
 	CursorMan.showMouse(true);
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro->lastscore[i] = numbers[i];
+		_vm->_gyro->_scoreToDisplay[i] = numbers[i];
 }
 
 void Lucerna::points(byte num) {     // Add on no. of points
 	for (byte q = 1; q <= num; q++) {
-		_vm->_gyro->dna.score++;
+		_vm->_gyro->_dna._score++;
 
 #if 0
 		if (soundfx) {
@@ -954,25 +954,25 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 
 	switch (col) {
 	case kColorGreen: {
-			_vm->_gyro->dna.rw = _vm->_trip->up;
+			_vm->_gyro->_dna._direction = _vm->_trip->up;
 			_vm->_trip->rwsp(0, _vm->_trip->up);
 			showrw();
 		}
 		break;
 	case kColorBrown: {
-			_vm->_gyro->dna.rw = _vm->_trip->down;
+			_vm->_gyro->_dna._direction = _vm->_trip->down;
 			_vm->_trip->rwsp(0, _vm->_trip->down);
 			showrw();
 		}
 		break;
 	case kColorCyan: {
-			_vm->_gyro->dna.rw = _vm->_trip->left;
+			_vm->_gyro->_dna._direction = _vm->_trip->left;
 			_vm->_trip->rwsp(0, _vm->_trip->left);
 			showrw();
 		}
 		break;
 	case kColorLightmagenta: {
-			_vm->_gyro->dna.rw = _vm->_trip->right;
+			_vm->_gyro->_dna._direction = _vm->_trip->right;
 			_vm->_trip->rwsp(0, _vm->_trip->right);
 			showrw();
 		}
@@ -997,18 +997,18 @@ void Lucerna::fxtoggle() {
 }
 
 void Lucerna::objectlist() {
-	_vm->_gyro->dna.carrying = 0;
-	if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks - 1])
-		thinkabout(_vm->_gyro->money, _vm->_gyro->kThing); // you always have money
-	for (byte fv = 0; fv < numobjs; fv++)
-		if (_vm->_gyro->dna.obj[fv]) {
-			_vm->_gyro->dna.carrying++;
-			_vm->_gyro->objlist[_vm->_gyro->dna.carrying] = fv + 1;
+	_vm->_gyro->_dna._carryNum = 0;
+	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1])
+		thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); // you always have money
+	for (byte fv = 0; fv < kObjectNum; fv++)
+		if (_vm->_gyro->_dna._objects[fv]) {
+			_vm->_gyro->_dna._carryNum++;
+			_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = fv + 1;
 		}
 }
 
 void Lucerna::verte(Common::Point cursorPos) {
-	if (! _vm->_gyro->dna.user_moves_avvy) 
+	if (! _vm->_gyro->_dna._userMovesAvvy) 
 		return;
 
 	cursorPos.y /= 2;
@@ -1062,28 +1062,28 @@ void Lucerna::verte(Common::Point cursorPos) {
 
 void Lucerna::checkclick() {
 	Common::Point cursorPos = _vm->getMousePos();
-	_vm->_gyro->ontoolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
+	_vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 	
 	/*if (_vm->_gyro->mrelease > 0)
 	_vm->_gyro->after_the_scroll = false;*/
 
 	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		_vm->_gyro->newpointer(1); // up arrow
+		_vm->_gyro->newMouse(1); // up arrow
 	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
-		_vm->_gyro->newpointer(8); //I-beam
+		_vm->_gyro->newMouse(8); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		_vm->_gyro->newpointer(2); // screwdriver
-	else if (!_vm->_gyro->ddmnow) { // Dropdown can handle its own pointers.
+		_vm->_gyro->newMouse(2); // screwdriver
+	else if (!_vm->_gyro->_dropdownActive) { // Dropdown can handle its own pointers.
 		if (holdLeftMouse) {
-			_vm->_gyro->newpointer(7); // Mark's crosshairs
+			_vm->_gyro->newMouse(7); // Mark's crosshairs
 			verte(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
-			_vm->_gyro->newpointer(4); // fletch
+			_vm->_gyro->newMouse(4); // fletch
 	}
 	
 	if (holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
-			if (_vm->_gyro->dropsok)
+			if (_vm->_gyro->_dropsOk)
 				_vm->_dropdown->updateMenu();
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
 			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
@@ -1095,19 +1095,19 @@ void Lucerna::checkclick() {
 			_vm->_parser->plotText();
 		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
 			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
-				if (_vm->_gyro->alive && _vm->_gyro->dna.avvy_is_awake)
+				if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake)
 					mouseway(cursorPos);
 			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
 					_vm->updateEvents();
 				} while (holdLeftMouse);
 
-				if (_vm->_gyro->thinkthing) {
-					_vm->_acci->_thing = _vm->_gyro->thinks;
+				if (_vm->_gyro->_thinkThing) {
+					_vm->_acci->_thing = _vm->_gyro->_thinks;
 					_vm->_acci->_thing += 49;
 					_vm->_acci->_person = _vm->_acci->kPardon;
 				} else {
-					_vm->_acci->_person = _vm->_gyro->thinks;
+					_vm->_acci->_person = _vm->_gyro->_thinks;
 					_vm->_acci->_thing = _vm->_acci->kPardon;
 				}
 				callVerb(_vm->_acci->kVerbCodeExam);
@@ -1126,9 +1126,9 @@ void Lucerna::checkclick() {
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxtoggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
-				_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
-		} else if (!_vm->_gyro->dropsok)
-			_vm->_gyro->mousetext = Common::String(13) + _vm->_gyro->mousetext;
+				_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
+		} else if (!_vm->_gyro->_dropsOk)
+			_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
 	}
 }
 
@@ -1185,9 +1185,9 @@ void Lucerna::dawn() {
 
 
 void Lucerna::showrw() { // It's data is loaded in load_digits().
-	if (_vm->_gyro->oldrw == _vm->_gyro->dna.rw) 
+	if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction) 
 		return;
-	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
+	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
 	CursorMan.showMouse(false);
 	
 #if 0
@@ -1197,7 +1197,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 	}
 #endif
 
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->rwlite[_vm->_gyro->dna.rw], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161);
 
 	CursorMan.showMouse(true);
 	//setactivepage(1 - cp);
@@ -1227,7 +1227,7 @@ void Lucerna::hand(const Common::Point &a, byte c) {
 }
 
 void Lucerna::refresh_hands() {
-	const bytefield clockspace = {61, 166, 66, 200};
+	const ByteField clockspace = {61, 166, 66, 200};
 
 	for (byte page_ = 0; page_ < 2; page_++)
 		_vm->_trip->getset[page_].remember(clockspace);
@@ -1236,13 +1236,13 @@ void Lucerna::refresh_hands() {
 void Lucerna::plothands() {
 	//   off;
 	//setactivepage(3);
-	calchand(_vm->_gyro->onh, 14, ah, kColorYellow);
-	calchand(_vm->_gyro->om * 6, 17, am, kColorYellow);
+	calchand(_vm->_gyro->_onh, 14, ah, kColorYellow);
+	calchand(_vm->_gyro->_om * 6, 17, am, kColorYellow);
 	hand(ah, kColorBrown);
 	hand(am, kColorBrown);
 
 	calchand(nh, 14, ah, kColorBrown);
-	calchand(_vm->_gyro->minutes * 6, 17, am, kColorBrown);
+	calchand(_vm->_gyro->_minutes * 6, 17, am, kColorBrown);
 	hand(ah, kColorYellow);
 	hand(am, kColorYellow);
 
@@ -1261,26 +1261,26 @@ void Lucerna::clock_lucerna() {
 	// ...Clock.
 	TimeDate t;
 	_vm->_system->getTimeAndDate(t);
-	_vm->_gyro->hour = t.tm_hour;
-	_vm->_gyro->minutes = t.tm_min;
-	_vm->_gyro->seconds = t.tm_sec;
+	_vm->_gyro->_hours = t.tm_hour;
+	_vm->_gyro->_minutes = t.tm_min;
+	_vm->_gyro->_seconds = t.tm_sec;
 
-	nh = (_vm->_gyro->hour % 12) * 30 + _vm->_gyro->minutes / 2;
+	nh = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2;
 
-	if (_vm->_gyro->oh != _vm->_gyro->hour)  {
+	if (_vm->_gyro->_oh != _vm->_gyro->_hours)  {
 		plothands();
 		chime();
 	}
 
-	if (_vm->_gyro->om != _vm->_gyro->minutes)
+	if (_vm->_gyro->_om != _vm->_gyro->_minutes)
 		plothands();
 
-	if ((_vm->_gyro->hour == 0) && (_vm->_gyro->oh != 0) && (_vm->_gyro->oh != 17717))
+	if ((_vm->_gyro->_hours == 0) && (_vm->_gyro->_oh != 0) && (_vm->_gyro->_oh != 17717))
 		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
 	
-	_vm->_gyro->oh = _vm->_gyro->hour;
-	_vm->_gyro->onh = nh;
-	_vm->_gyro->om = _vm->_gyro->minutes;
+	_vm->_gyro->_oh = _vm->_gyro->_hours;
+	_vm->_gyro->_onh = nh;
+	_vm->_gyro->_om = _vm->_gyro->_minutes;
 }
 
 
@@ -1296,7 +1296,7 @@ void Lucerna::delavvy() {
 }
 
 void Lucerna::gameover() {
-	_vm->_gyro->dna.user_moves_avvy = false;
+	_vm->_gyro->_dna._userMovesAvvy = false;
 
 	int16 sx = _vm->_trip->tr[0].x;
 	int16 sy = _vm->_trip->tr[0].y;
@@ -1308,7 +1308,7 @@ void Lucerna::gameover() {
 	
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
 
-	_vm->_gyro->alive = false;
+	_vm->_gyro->_alive = false;
 }
 
 /* OK. There are two kinds of redraw: Major and Minor. Minor is what happens
@@ -1317,15 +1317,15 @@ void Lucerna::gameover() {
 void Lucerna::minor_redraw() {
 	dusk();
 
-	enterroom(_vm->_gyro->dna.room, 0); // Ped unknown or non-existant.
+	enterroom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant.
 
 	for (byte fv = 0; fv <= 1; fv++) {
-		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
+		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
 		_vm->_trip->getback();
 	}
 	
 	for (byte i = 0; i < 3; i++)
-		_vm->_gyro->lastscore[i] = -1; // impossible digits
+		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
 	showscore();
 	
 	dawn();
@@ -1340,15 +1340,15 @@ uint16 Lucerna::bearing(byte whichped) {
 
 	const double rad2deg = 180 / 3.14; // Pi
 		
-	if (_vm->_trip->tr[0].x == _vm->_gyro->peds[whichped].x)
+	if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[whichped]._x)
 		return 0;
 	else {
-		if (_vm->_trip->tr[0].x < _vm->_gyro->peds[whichped].x) {
-			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
-					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 90;
+		if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[whichped]._x) {
+			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[whichped]._y))
+					/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[whichped]._x)) * rad2deg) + 90;
 		} else {
-			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->peds[whichped].y))
-					/ (_vm->_trip->tr[0].x - _vm->_gyro->peds[whichped].x)) * rad2deg) + 270;
+			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[whichped]._y))
+					/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[whichped]._x)) * rad2deg) + 270;
 		}
 	}
 }
@@ -1358,18 +1358,18 @@ void Lucerna::sprite_run() {
   sprites are still. It performs two fast cycles, only using a few of
   the links usually used, and without any extra animation. This should
   make the sprites the same on both pages. */
-	_vm->_gyro->doing_sprite_run = true;
+	_vm->_gyro->_doingSpriteRun = true;
 
 	_vm->_trip->get_back_loretta();
 	_vm->_trip->trippancy_link();
 
-	_vm->_gyro->doing_sprite_run = false;
+	_vm->_gyro->_doingSpriteRun = false;
 
 }
 
 void Lucerna::fix_flashers() {
-	_vm->_gyro->ledstatus = 177;
-	_vm->_gyro->oldrw = 177;
+	_vm->_gyro->_ledStatus = 177;
+	_vm->_gyro->_oldDirection = 177;
 	_vm->_scrolls->state(2);
 	showrw();
 }
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index cecafcf..5b72ee1 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -96,7 +96,7 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F5: {
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(_vm->_gyro->f5_does()[0]);
+		_vm->_lucerna->callVerb(_vm->_gyro->f5Does()[0]);
 		}
 		break;
 	case Common::KEYCODE_F7:
@@ -108,14 +108,13 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 }
 
 void Parser::plotText() {
-	if (_vm->_gyro->mouse_near_text())
-		CursorMan.showMouse(false);
+	CursorMan.showMouse(false);
 
 	cursorOff();
 
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, kColorWhite);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);
@@ -151,25 +150,24 @@ void Parser::drawCursor() {
 	for (byte bit = 0; bit < 8; bit++)
 		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = kColorWhite;
 
-	bytefield bf;
-	bf.x1 = _inputTextPos + 1;
-	bf.x2 = _inputTextPos + 2;
-	bf.y1 = 168;
-	bf.y2 = 168;
+	ByteField bf;
+	bf._x1 = _inputTextPos + 1;
+	bf._x2 = _inputTextPos + 2;
+	bf._y1 = 168;
+	bf._y2 = 168;
 	for (byte fv = 0; fv <= 1; fv++)
 		_vm->_trip->getset[fv].remember(bf);
 }
 
 void Parser::wipeText() {
-	if (_vm->_gyro->mouse_near_text())
-		CursorMan.showMouse(false);
-
+	CursorMan.showMouse(false);
 	cursorOff();
 	
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 
 	_quote = true;
 	_inputTextPos = 0;
+
 	cursorOn();
 	CursorMan.showMouse(true);
 }
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 350e9f7..1392454 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -54,7 +54,7 @@ void Scrolls::init() {
 }
 
 void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
-	if (_vm->_gyro->ledstatus == x)
+	if (_vm->_gyro->_ledStatus == x)
 		return; // Already like that!
 
 	byte color = kColorBlack;
@@ -75,7 +75,7 @@ void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
 	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 
 	CursorMan.showMouse(true);
-	_vm->_gyro->ledstatus = x;
+	_vm->_gyro->_ledStatus = x;
 }
 
 void Scrolls::easteregg() {
@@ -120,10 +120,10 @@ void Scrolls::normscroll() {
 	Common::String e = "(c) 1994";
 
 	state(3);
-	_vm->_gyro->seescroll = true;
+	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
-	_vm->_gyro->newpointer(4);
-	_vm->_lucerna->mousepage(1 - _vm->_gyro->cp);
+	_vm->_gyro->newMouse(4);
+	_vm->_lucerna->mousepage(1 - _vm->_gyro->_cp);
 
 
 
@@ -184,8 +184,8 @@ void Scrolls::normscroll() {
 #endif
 
 	state(0);
-	_vm->_gyro->seescroll = false;
-	_vm->_lucerna->mousepage(_vm->_gyro->cp);
+	_vm->_gyro->_seeScroll = false;
+	_vm->_lucerna->mousepage(_vm->_gyro->_cp);
 	CursorMan.showMouse(false);
 	_vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick().
 
@@ -220,19 +220,19 @@ bool Scrolls::they_match(TuneType &played) {
 
 void Scrolls::music_scroll() {
 	state(3);
-	_vm->_gyro->seescroll = true;
-	_vm->_gyro->on();
-	_vm->_gyro->newpointer(4);
+	_vm->_gyro->_seeScroll = true;
+	CursorMan.showMouse(true);
+	_vm->_gyro->newMouse(4);
 
 	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further. 
 	// For now we act like the player just played the right tone.
 #if 0
 	if (they_match(played)) {
 #endif
-		_vm->_gyro->screturn = true;
-		_vm->_gyro->off();
+		_vm->_gyro->_scReturn = true;
+		CursorMan.showMouse(false);
 		state(0);
-		_vm->_gyro->seescroll = false;
+		_vm->_gyro->_seeScroll = false;
 
 		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->reason_jacques_waking_up);
 		warning("STUB: Scrolls::music_scroll()");
@@ -241,7 +241,7 @@ void Scrolls::music_scroll() {
 	}
 	
 	_vm->_gyro->screturn = false;
-	_vm->_gyro->off();
+	CursorMan.showMouse(false);
 	state(0);
 	_vm->_gyro->seescroll = false;
 #endif
@@ -250,25 +250,25 @@ void Scrolls::music_scroll() {
 // ThatsAll, so put us back to $F-
 
 void Scrolls::resetscrolldriver() {   // phew
-	_vm->_gyro->scrollbells = 0;
+	_vm->_gyro->_scrollBells = 0;
 	cfont = roman;
 	use_icon = 0;
 	_vm->_gyro->_interrogation = 0; // always reset after a scroll comes up.
 }
 
 void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little...
-	for (byte fv = 0; fv < _vm->_gyro->scrollbells; fv++)
+	for (byte fv = 0; fv < _vm->_gyro->_scrollBells; fv++)
 		_vm->_lucerna->errorled(); // ring the bell "x" times
 }
 
 void Scrolls::dodgem() {     
 	dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(dodgeCoord.x, _vm->_gyro->underscroll); // Move the pointer off the scroll.
+	g_system->warpMouse(dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
 }
 
 void Scrolls::undodgem() {   
 	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->underscroll))
+	if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
 		g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
@@ -334,9 +334,9 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
 
 	lx = 0;
-	ly = (_vm->_gyro->scrolln) * 6;
-	for (b = 0; b < _vm->_gyro->scrolln; b++) {
-		ex = _vm->_gyro->scroll[b].size() * 8;
+	ly = (_vm->_gyro->_scrollNum) * 6;
+	for (b = 0; b < _vm->_gyro->_scrollNum; b++) {
+		ex = _vm->_gyro->_scroll[b].size() * 8;
 		if (lx < ex)
 			lx = ex;
 	}
@@ -406,51 +406,51 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	}
 
 
-	for (b = 0; b < _vm->_gyro->scrolln; b++) {
-		if (!_vm->_gyro->scroll[b].empty())
-			switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
+	for (b = 0; b < _vm->_gyro->_scrollNum; b++) {
+		if (!_vm->_gyro->_scroll[b].empty())
+			switch (_vm->_gyro->_scroll[b][_vm->_gyro->_scroll[b].size() - 1]) {
 			case kControlCenter: {
 				centre = true;
-				_vm->_gyro->scroll[b].deleteLastChar();
+				_vm->_gyro->_scroll[b].deleteLastChar();
 				}
 				break;
 			case kControlLeftJustified: {
 				centre = false;
-				_vm->_gyro->scroll[b].deleteLastChar();
+				_vm->_gyro->_scroll[b].deleteLastChar();
 				}
 				break;
 			case kControlQuestion: {
 				//settextjustify(1, 1);
 				dix = mx + lx;
 				diy = my + ly;
-				_vm->_gyro->scroll[b].setChar(' ', 0);
+				_vm->_gyro->_scroll[b].setChar(' ', 0);
 				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
-				_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
-				_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+				_vm->_gyro->shadowBox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
+				_vm->_gyro->shadowBox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
 				}
 				break;
 			}
 
 		if (centre)
-			say(320 - _vm->_gyro->scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->scroll[b]);
+			say(320 - _vm->_gyro->_scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->_scroll[b]);
 		else
-			say(mx + icon_indent, my, _vm->_gyro->scroll[b]);
+			say(mx + icon_indent, my, _vm->_gyro->_scroll[b]);
 
 		my += 12;
 	}
 
-	_vm->_gyro->underscroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	//my = getpixel(0, 0);
-	_vm->_gyro->dropsok = false;
+	_vm->_gyro->_dropsOk = false;
 	dodgem();
 
 	(this->*gotoit)();
 
 	undodgem();
-	_vm->_gyro->dropsok = true;
+	_vm->_gyro->_dropsOk = true;
 	//setvisualpage(cp);
 	//mousepage(cp);
 	CursorMan.showMouse(false);
@@ -481,9 +481,9 @@ void Scrolls::bubble(func2 gotoit) {
 	CursorMan.showMouse(false);
 
 	xl = 0;
-	yl = _vm->_gyro->scrolln * 5;
-	for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
-		uint16 textWidth = _vm->_gyro->scroll[fv].size() * 8;
+	yl = _vm->_gyro->_scrollNum * 5;
+	for (byte fv = 0; fv < _vm->_gyro->_scrollNum; fv++) {
+		uint16 textWidth = _vm->_gyro->_scroll[fv].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
 	}
@@ -494,36 +494,36 @@ void Scrolls::bubble(func2 gotoit) {
 	my = yw * 2 - 2;
 	xc = 0;
 
-	if ((_vm->_gyro->talkx - xw) < 0)
-		xc = -(_vm->_gyro->talkx - xw);
-	if ((_vm->_gyro->talkx + xw) > 639)
-		xc = 639 - (_vm->_gyro->talkx + xw);
+	if ((_vm->_gyro->_talkX - xw) < 0)
+		xc = -(_vm->_gyro->_talkX - xw);
+	if ((_vm->_gyro->_talkX + xw) > 639)
+		xc = 639 - (_vm->_gyro->_talkX + xw);
 
-	p[0].x = _vm->_gyro->talkx - 10;
+	p[0].x = _vm->_gyro->_talkX - 10;
 	p[0].y = yw;
-	p[1].x = _vm->_gyro->talkx + 10;
+	p[1].x = _vm->_gyro->_talkX + 10;
 	p[1].y = yw;
-	p[2].x = _vm->_gyro->talkx;
-	p[2].y = _vm->_gyro->talky;
+	p[2].x = _vm->_gyro->_talkX;
+	p[2].y = _vm->_gyro->_talkY;
 
 	// Backup the screen before drawing the bubble.
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	// The body of the bubble.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->talkx - xw + 9, 7, _vm->_gyro->talkx + xw - 8 + xc, my + 1), _vm->_gyro->talkb);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->talkx - xw - 1, 12, _vm->_gyro->talkx + xw + xc + 2, my - 4), _vm->_gyro->talkb);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw + 9, 7, _vm->_gyro->_talkX + xw - 8 + xc, my + 1), _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw - 1, 12, _vm->_gyro->_talkX + xw + xc + 2, my - 4), _vm->_gyro->_talkBackgroundColor);
 
 	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx + xw - 10, 11, 0, 90, 9, _vm->_gyro->talkb);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, 11, 0, 90, 9, _vm->_gyro->_talkBackgroundColor);
 	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->talkb);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->_talkBackgroundColor);
 	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx - xw + 10, 11, 90, 180, 9, _vm->_gyro->talkb);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, 11, 90, 180, 9, _vm->_gyro->_talkBackgroundColor);
 	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->talkx - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->talkb);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->_talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->talkb);
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->_talkBackgroundColor);
 
 	
 	yl -= 3;
@@ -531,30 +531,30 @@ void Scrolls::bubble(func2 gotoit) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (byte fv = 0; fv < _vm->_gyro->scrolln; fv++) {
-		int16 x = xc + _vm->_gyro->talkx - _vm->_gyro->scroll[fv].size() / 2 * 8;
-		bool offset = _vm->_gyro->scroll[fv].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->scroll[fv], _vm->_gyro->characters, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->talkf);
+	for (byte fv = 0; fv < _vm->_gyro->_scrollNum; fv++) {
+		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[fv].size() / 2 * 8;
+		bool offset = _vm->_gyro->_scroll[fv].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[fv], _vm->_gyro->_font, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->_talkFontColor);
 	}
 
 	//setvisualpage(1 - cp);
 	dingdongbell();
 	_vm->_gyro->_onCanDoPageSwap = false;
 	CursorMan.showMouse(true);
-	_vm->_gyro->dropsok = false;
+	_vm->_gyro->_dropsOk = false;
 
 	// This does the actual drawing to the screen.
 	(this->*gotoit)();
 
 	CursorMan.showMouse(false);
-	_vm->_gyro->dropsok = true;
+	_vm->_gyro->_dropsOk = true;
 
 	//setvisualpage(cp);
 	CursorMan.showMouse(true); // sink;
 	_vm->_gyro->_onCanDoPageSwap = true;
 	resetscrolldriver();
-	if (_vm->_gyro->mpress > 0)
-		_vm->_gyro->after_the_scroll = true;
+	/*if (_vm->_gyro->mpress > 0)
+	_vm->_gyro->after_the_scroll = true;*/
 }
 
 bool Scrolls::ask(Common::String question) {
@@ -563,35 +563,35 @@ bool Scrolls::ask(Common::String question) {
 }
 
 void Scrolls::resetscroll() {
-	_vm->_gyro->scrolln = 1;
+	_vm->_gyro->_scrollNum = 1;
 	for (int j = 0; j < 15; j++)
-		if (!_vm->_gyro->scroll[j].empty())
-			_vm->_gyro->scroll[j].clear();
+		if (!_vm->_gyro->_scroll[j].empty())
+			_vm->_gyro->_scroll[j].clear();
 }
 
 void Scrolls::natural() {   // Natural state of bubbles
-	_vm->_gyro->talkx = 320;
-	_vm->_gyro->talky = 200;
-	_vm->_gyro->talkb = 8;
-	_vm->_gyro->talkf = 15;
+	_vm->_gyro->_talkX = 320;
+	_vm->_gyro->_talkY = 200;
+	_vm->_gyro->_talkBackgroundColor = 8;
+	_vm->_gyro->_talkFontColor = 15;
 }
 
 Common::String Scrolls::lsd() {
 	Common::String x;
 
-	if (_vm->_gyro->dna.pence < 12) { // just pence
-		x = _vm->_gyro->strf(_vm->_gyro->dna.pence) + 'd';
-	} else if (_vm->_gyro->dna.pence < 240) { // shillings & pence
-		x = _vm->_gyro->strf(_vm->_gyro->dna.pence / 12) + '/';
-		if ((_vm->_gyro->dna.pence % 12) == 0)
+	if (_vm->_gyro->_dna._money < 12) { // just pence
+		x = _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + 'd';
+	} else if (_vm->_gyro->_dna._money < 240) { // shillings & pence
+		x = _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 12) + '/';
+		if ((_vm->_gyro->_dna._money % 12) == 0)
 			x = x + '-';
 		else
-			x = x + _vm->_gyro->strf(_vm->_gyro->dna.pence % 12);
+			x = x + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	} else // L, s & d
-		x = Common::String('œ') + _vm->_gyro->strf(_vm->_gyro->dna.pence / 240) + '.' + _vm->_gyro->strf((_vm->_gyro->dna.pence / 12) % 20)
-			+ '.' + _vm->_gyro->strf(_vm->_gyro->dna.pence % 12);
-	if (_vm->_gyro->dna.pence > 12)
-		x = x + " (that's " + _vm->_gyro->strf(_vm->_gyro->dna.pence) + "d)";
+		x = Common::String('œ') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
+			+ '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
+	if (_vm->_gyro->_dna._money > 12)
+		x = x + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";
 	
 	return x;
 }
@@ -606,16 +606,16 @@ void Scrolls::strip(Common::String &q) {
 }
 
 void Scrolls::solidify(byte n) {
-	if (!_vm->_gyro->scroll[n].contains(' '))
+	if (!_vm->_gyro->_scroll[n].contains(' '))
 		return; // No spaces.
 
 	// So there MUST be a space there, somewhere...
 	do {
-		_vm->_gyro->scroll[n + 1] = _vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] + _vm->_gyro->scroll[n + 1];
-		_vm->_gyro->scroll[n].deleteLastChar();
-	} while (_vm->_gyro->scroll[n][_vm->_gyro->scroll[n].size() - 1] != ' ');
+		_vm->_gyro->_scroll[n + 1] = _vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] + _vm->_gyro->_scroll[n + 1];
+		_vm->_gyro->_scroll[n].deleteLastChar();
+	} while (_vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] != ' ');
 
-	strip(_vm->_gyro->scroll[n]);
+	strip(_vm->_gyro->_scroll[n]);
 }
 
 void Scrolls::calldrivers() {
@@ -630,39 +630,39 @@ void Scrolls::calldrivers() {
 	warning("STUB: Scrolls::calldrivers()");
 
 	state(0);
-	_vm->_gyro->screturn = false;
+	_vm->_gyro->_scReturn = false;
 	mouthnext = false;
 	call_spriterun = true;
 
-	switch (_vm->_gyro->buffer[_vm->_gyro->bufsize - 1]) {
+	switch (_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1]) {
 	case kControlToBuffer:
-		_vm->_gyro->bufsize--;
+		_vm->_gyro->_bufSize--;
 		break; // ^D = (D)on't include pagebreak
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
 	default: {
-		_vm->_gyro->bufsize++;
-		_vm->_gyro->buffer[_vm->_gyro->bufsize - 1] = kControlParagraph;
+		_vm->_gyro->_bufSize++;
+		_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = kControlParagraph;
 		}
 	}
 
-	uint16 size = _vm->_gyro->bufsize;
+	uint16 size = _vm->_gyro->_bufSize;
 
 	for (fv = 0; fv < size; fv++) {
 		if (mouthnext) {
-			if (_vm->_gyro->buffer[fv] == kControlRegister)
+			if (_vm->_gyro->_buffer[fv] == kControlRegister)
 				param = 0;
-			else if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
-				param = _vm->_gyro->buffer[fv] - 48;
-			else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
-				param = _vm->_gyro->buffer[fv] - 55;
+			else if (('0' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= '9'))
+				param = _vm->_gyro->_buffer[fv] - 48;
+			else if (('A' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= 'Z'))
+				param = _vm->_gyro->_buffer[fv] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_vm->_gyro->buffer[fv]) {
+			switch (_vm->_gyro->_buffer[fv]) {
 			case kControlParagraph: {
-				if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
+				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -673,15 +673,15 @@ void Scrolls::calldrivers() {
 
 				resetscroll();
 
-				if (_vm->_gyro->screturn)
+				if (_vm->_gyro->_scReturn)
 					return;
 			}
 			break;
 			case kControlBell:
-				_vm->_gyro->scrollbells++;
+				_vm->_gyro->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble: {
-				if ((_vm->_gyro->scrolln == 1) && (_vm->_gyro->scroll[0].empty()))
+				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -700,11 +700,11 @@ void Scrolls::calldrivers() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					_vm->_gyro->talkx = _vm->_gyro->peds[_vm->_gyro->kQuasipeds[param - 10].whichped - 1].x;
-					_vm->_gyro->talky = _vm->_gyro->peds[_vm->_gyro->kQuasipeds[param - 10].whichped - 1].y; // Position.
+					_vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._x;
+					_vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._y; // Position.
 		
-					_vm->_gyro->talkf = _vm->_gyro->kQuasipeds[param - 10].fgc;
-					_vm->_gyro->talkb = _vm->_gyro->kQuasipeds[param - 10].bgc; // Colors.
+					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor;
+					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors.
 				} else {
 					_vm->_lucerna->errorled(); // Not valid.
 					natural();
@@ -714,7 +714,7 @@ void Scrolls::calldrivers() {
 
 				resetscroll();
 
-				if (_vm->_gyro->screturn)
+				if (_vm->_gyro->_scReturn)
 					return;
 			}
 			break;
@@ -724,29 +724,29 @@ void Scrolls::calldrivers() {
 					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break; 
 				case 2:
-					display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->dna.pass_num]._word + kControlToBuffer);
+					display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer);
 					break;
 				case 3:
-					display(_vm->_gyro->dna.like2drink + kControlToBuffer);
+					display(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer);
 					break;
 				case 4:
-					display(_vm->_gyro->dna.favourite_song + kControlToBuffer);
+					display(_vm->_gyro->_dna._favouriteSong + kControlToBuffer);
 					break;
 				case 5:
-					display(_vm->_gyro->dna.worst_place_on_earth + kControlToBuffer);
+					display(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer);
 					break;
 				case 6:
-					display(_vm->_gyro->dna.spare_evening + kControlToBuffer);
+					display(_vm->_gyro->_dna._spareEvening + kControlToBuffer);
 					break;
 				case 9:
-					display(_vm->_gyro->strf(_vm->_gyro->dna.cat_x) + ',' + _vm->_gyro->strf(_vm->_gyro->dna.cat_y) + kControlToBuffer);
+					display(_vm->_gyro->intToStr(_vm->_gyro->_dna._catacombX) + ',' + _vm->_gyro->intToStr(_vm->_gyro->_dna._catacombY) + kControlToBuffer);
 					break;
 				case 10:
-					switch (_vm->_gyro->dna.box_contents) {
+					switch (_vm->_gyro->_dna._boxContent) {
 					case 0: { // Sixpence.
 						_vm->_visa->dixi('q', 37); // You find the sixpence.
-						_vm->_gyro->dna.pence += 6;
-						_vm->_gyro->dna.box_contents = _vm->_acci->kNothing;
+						_vm->_gyro->_dna._money += 6;
+						_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing;
 						_vm->_lucerna->points(2);
 						return;
 					}
@@ -755,15 +755,15 @@ void Scrolls::calldrivers() {
 						display("nothing at all. It's completely empty.");
 						break;
 					default:
-						display(_vm->_gyro->get_better(_vm->_gyro->dna.box_contents) + '.');
+						display(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.');
 					}
 					break;
 				case 11:
 					nn = 1;
-					for (byte nnn = 0; nnn < numobjs; nnn++) {
-						if (_vm->_gyro->dna.obj[nnn]) {
+					for (byte nnn = 0; nnn < kObjectNum; nnn++) {
+						if (_vm->_gyro->_dna._objects[nnn]) {
 							nn++;
-							display(_vm->_gyro->get_better(nnn) + ", " + kControlToBuffer);
+							display(_vm->_gyro->getItem(nnn) + ", " + kControlToBuffer);
 						}
 					}
 					break;
@@ -773,15 +773,15 @@ void Scrolls::calldrivers() {
 				use_icon = param;
 				break;
 			case kControlNewLine:
-				_vm->_gyro->scrolln++;
+				_vm->_gyro->_scrollNum++;
 				break;
 			case kControlQuestion: {
 				if (call_spriterun)
 					_vm->_lucerna->sprite_run();
 				call_spriterun = false;
 
-				_vm->_gyro->scrolln++;
-				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] = kControlQuestion;
+				_vm->_gyro->_scrollNum++;
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] = kControlQuestion;
 
 				drawscroll(&Avalanche::Scrolls::dialogue);
 
@@ -793,14 +793,14 @@ void Scrolls::calldrivers() {
 				break;
 			case kControlInsertSpaces:
 				for (nn = 0; nn < 9; nn++)
-					_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += ' ';
+					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
 				break;
 			default: { // Add new char.
-				if (_vm->_gyro->scroll[_vm->_gyro->scrolln - 1].size() == 50) {
-					solidify(_vm->_gyro->scrolln - 1);
-					_vm->_gyro->scrolln++;
+				if (_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1].size() == 50) {
+					solidify(_vm->_gyro->_scrollNum - 1);
+					_vm->_gyro->_scrollNum++;
 				}
-				_vm->_gyro->scroll[_vm->_gyro->scrolln - 1] += _vm->_gyro->buffer[fv];
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[fv];
 				}
 			}
 		}
@@ -808,8 +808,8 @@ void Scrolls::calldrivers() {
 }
 
 void Scrolls::display(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_gyro->bufsize = z.size();
-	memcpy(_vm->_gyro->buffer, z.c_str(), _vm->_gyro->bufsize);
+	_vm->_gyro->_bufSize = z.size();
+	memcpy(_vm->_gyro->_buffer, z.c_str(), _vm->_gyro->_bufSize);
 	calldrivers();
 }
 
@@ -837,7 +837,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_vm->_gyro->characters[i],16);
+		f.read(_vm->_gyro->_font[i],16);
 	f.close();
 }
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 3156466..15759bd 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -65,8 +65,8 @@ void Sequence::then_show(byte what) {
 void Sequence::then_flip(byte where, byte ped) {
 	then_show(now_flip);
 
-	_vm->_gyro->dna.flip_to_where = where;
-	_vm->_gyro->dna.flip_to_ped = ped;
+	_vm->_gyro->_dna._flipToWhere = where;
+	_vm->_gyro->_dna._flipToPed = ped;
 }
 
 void Sequence::start_to_close() {
@@ -75,7 +75,7 @@ void Sequence::start_to_close() {
 }
 
 void Sequence::start_to_open() {
-	_vm->_gyro->dna.user_moves_avvy = false; // They can't move.
+	_vm->_gyro->_dna._userMovesAvvy = false; // They can't move.
 	_vm->_trip->stopwalking(); // And they're not moving now.
 	start_to_close(); // Apart from that, it's the same thing.
 }
@@ -93,8 +93,8 @@ void Sequence::call_sequencer() {
 		return; // No more routines.
 		break; 
 	case 177: // Flip room.
-		_vm->_gyro->dna.user_moves_avvy = true;
-		_vm->_trip->fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); 
+		_vm->_gyro->_dna._userMovesAvvy = true;
+		_vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); 
 		if (seq[0] == 177)
 			shove_left();
 		break;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 5c4b60b..dbb4f80 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -73,7 +73,7 @@ void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
 }
 
 void Timeout::one_tick() {
-	if (_vm->_gyro->ddmnow)
+	if (_vm->_gyro->_dropdownActive)
 		return;
 
 	for (byte fv = 0; fv < 7; fv++) {
@@ -209,8 +209,8 @@ void Timeout::one_tick() {
 			}
 		}
 	}
-	_vm->_gyro->roomtime++; // Cycles since you've been in this room.
-	_vm->_gyro->dna.total_time++; // Total amount of time for this game.
+	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
+	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
 }
 
 void Timeout::lose_timer(byte which) {
@@ -223,20 +223,20 @@ void Timeout::lose_timer(byte which) {
 }
 
 void Timeout::open_drawbridge() {
-	_vm->_gyro->dna.drawbridge_open++;
-	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->dna.drawbridge_open - 1);
+	_vm->_gyro->_dna._drawbridgeOpen++;
+	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
 
-	if (_vm->_gyro->dna.drawbridge_open == 4)
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 	else
 		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
 }
 
 void Timeout::avaricius_talks() {
-	_vm->_visa->dixi('q', _vm->_gyro->dna.avaricius_talk);
-	_vm->_gyro->dna.avaricius_talk++;
+	_vm->_visa->dixi('q', _vm->_gyro->_dna._avariciusTalk);
+	_vm->_gyro->_dna._avariciusTalk++;
 
-	if (_vm->_gyro->dna.avaricius_talk < 17)
+	if (_vm->_gyro->_dna._avariciusTalk < 17)
 		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
 	else
 		_vm->_lucerna->points(3);
@@ -266,21 +266,21 @@ void Timeout::stairs() {
 	_vm->_gyro->blip();
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-	_vm->_gyro->dna.brummie_stairs = 2;
-	_vm->_gyro->magics[10].op = _vm->_gyro->kMagicSpecial;
-	_vm->_gyro->magics[10].data = 2; // Reached the bottom of the stairs.
-	_vm->_gyro->magics[3].op = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+	_vm->_gyro->_dna._brummieStairs = 2;
+	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
+	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
+	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timeout::cardiff_survey() {
-	if (_vm->_gyro->dna.cardiff_things == 0) {
-		_vm->_gyro->dna.cardiff_things++;
+	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
+		_vm->_gyro->_dna._cardiffQuestionNum++;
 		_vm->_visa->dixi('q', 27);
 	}
 
-	_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
+	_vm->_visa->dixi('z', _vm->_gyro->_dna._cardiffQuestionNum);
 
-	_vm->_gyro->_interrogation = _vm->_gyro->dna.cardiff_things;
+	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
 
 	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
 }
@@ -296,8 +296,8 @@ void Timeout::cwytalot_in_herts() {
 
 void Timeout::get_tied_up() {
 	_vm->_visa->dixi('q', 34); // ...Trouble!
-	_vm->_gyro->dna.user_moves_avvy = false;
-	_vm->_gyro->dna.been_tied_up = true;
+	_vm->_gyro->_dna._userMovesAvvy = false;
+	_vm->_gyro->_dna._beenTiedUp = true;
 	_vm->_trip->stopwalking();
 	_vm->_trip->tr[1].stopwalk();
 	_vm->_trip->tr[1].stophoming();
@@ -309,14 +309,14 @@ void Timeout::get_tied_up() {
 void Timeout::get_tied_up2() {
 	_vm->_trip->tr[0].walkto(4);
 	_vm->_trip->tr[1].walkto(5);
-	_vm->_gyro->magics[3].op = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
-	_vm->_gyro->dna.friar_will_tie_you_up = true;
+	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
 
 void Timeout::hang_around() {
 	_vm->_trip->tr[1].check_me = false;
 	_vm->_trip->tr[0].init(7, true, _vm->_trip); // Robin Hood
-	_vm->_gyro->_whereIs[_vm->_gyro->probinhood - 150] = r__robins;
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
 	_vm->_trip->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
 	_vm->_trip->tr[0].walkto(7);
@@ -327,7 +327,7 @@ void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
 	_vm->_trip->tr[1].vanishifstill = false;
 	_vm->_trip->tr[1].walkto(4);
-	_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = r__robins;
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
@@ -335,20 +335,20 @@ void Timeout::hang_around2() {
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
 	// Immediately call the following proc (when you have a chance).
 
-	_vm->_gyro->dna.tied_up = false;
+	_vm->_gyro->_dna._tiedUp = false;
 
 	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
 }
 
 void Timeout::after_the_shootemup() {
 	
-	_vm->_trip->fliproom(_vm->_gyro->dna.room, 0);
+	_vm->_trip->fliproom(_vm->_gyro->_dna._room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
 	_vm->_trip->tr[0].init(0, true, _vm->_trip); // Avalot.
 	_vm->_trip->apped(1, 2);
-	_vm->_gyro->dna.user_moves_avvy = true;
-	_vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = true;
+	_vm->_gyro->_dna._userMovesAvvy = true;
+	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
 	_vm->_lucerna->objectlist();
 
 	// Same as the added line above: TODO: Remove it later!!!
@@ -377,9 +377,9 @@ void Timeout::after_the_shootemup() {
 }
 
 void Timeout::jacques_wakes_up() {
-	_vm->_gyro->dna.jacques_awake++;
+	_vm->_gyro->_dna._jacquesState++;
 
-	switch (_vm->_gyro->dna.jacques_awake) { // Additional pictures.
+	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
 		_vm->_visa->dixi('Q', 45);
@@ -387,22 +387,22 @@ void Timeout::jacques_wakes_up() {
 	case 2 : // Going through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // You can't wake him up now.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
-		_vm->_gyro->_whereIs[_vm->_gyro->pjacques - 150] = 0; // Gone!
+		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
 
-	if (_vm->_gyro->dna.jacques_awake == 5) {
-		_vm->_gyro->dna.ringing_bells = true;
-		_vm->_gyro->dna.ayles_is_awake = true;
+	if (_vm->_gyro->_dna._jacquesState == 5) {
+		_vm->_gyro->_dna._bellsAreRinging = true;
+		_vm->_gyro->_dna._aylesIsAwake = true;
 		_vm->_lucerna->points(2);
 	}
 
-	switch (_vm->_gyro->dna.jacques_awake) {
+	switch (_vm->_gyro->_dna._jacquesState) {
 	case 1:
 	case 2:
 	case 3:
@@ -441,9 +441,9 @@ void Timeout::naughty_duke3() {
 }
 
 void Timeout::jump() {
-	_vm->_gyro->dna.jumpstatus++;
+	_vm->_gyro->_dna._jumpStatus++;
 
-	switch (_vm->_gyro->dna.jumpstatus) {
+	switch (_vm->_gyro->_dna._jumpStatus) {
 	case 1:
 	case 2:
 	case 3:
@@ -462,24 +462,24 @@ void Timeout::jump() {
 		break;
 	}
 
-	if (_vm->_gyro->dna.jumpstatus == 20) { // End of jump.
-		_vm->_gyro->dna.user_moves_avvy = true;
-		_vm->_gyro->dna.jumpstatus = 0;
+	if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
+		_vm->_gyro->_dna._userMovesAvvy = true;
+		_vm->_gyro->_dna._jumpStatus = 0;
 	} else { // Still jumping.
 		set_up_timer(1, procjump, reason_jumping);
 	}
 
-	if ((_vm->_gyro->dna.jumpstatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
-			&& (_vm->_gyro->dna.arrow_in_the_door == true)
+	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
+			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
+			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
 			&& (_vm->_trip->infield(3))) { // Beside the wall
 		// Grab the arrow!
-		if (_vm->_gyro->dna.carrying >= maxobjs)
+		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_gyro->dna.arrow_in_the_door = false; // You've got it.
-			_vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true;
+			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
+			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
 			_vm->_lucerna->objectlist();
 			_vm->_visa->dixi('q', 50);
 			_vm->_lucerna->points(3);
@@ -489,32 +489,32 @@ void Timeout::jump() {
 
 void Timeout::crapulus_says_splud_out() {
 	_vm->_visa->dixi('q', 56);
-	_vm->_gyro->dna.crapulus_will_tell = false;
+	_vm->_gyro->_dna._crapulusWillTell = false;
 }
 
 void Timeout::buydrinks() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->dna.malagauche = 0;
+	_vm->_gyro->_dna._malagauche = 0;
 
-	_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); // Display message about it.
+	_vm->_visa->dixi('D', _vm->_gyro->_dna._drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
 	_vm->_visa->dixi('D', 1); // That'll be thruppence.
-	if (_vm->_gyro->pennycheck(3)) // Pay 3d.
+	if (_vm->_gyro->updateMoney(3)) // Pay 3d.
 		_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
 	_vm->_acci->drink();
 }
 
 void Timeout::buywine() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->dna.malagauche = 0;
+	_vm->_gyro->_dna._malagauche = 0;
 
 	_vm->_visa->dixi('D', 50); // You buy the wine.
 	_vm->_visa->dixi('D', 1); // It'll be thruppence.
-	if (_vm->_gyro->pennycheck(3)) {
+	if (_vm->_gyro->updateMoney(3)) {
 		_vm->_visa->dixi('D', 4); // You paid up.
-		_vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = true;
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
 		_vm->_lucerna->objectlist();
-		_vm->_gyro->dna.winestate = 1; // OK Wine.
+		_vm->_gyro->_dna._wineState = 1; // OK Wine.
 	}
 }
 
@@ -525,24 +525,24 @@ void Timeout::callsguards() {
 
 void Timeout::greetsmonk() {
 	_vm->_visa->dixi('Q', 59);
-	_vm->_gyro->dna.entered_lusties_room_as_monk = true;
+	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
 }
 
 void Timeout::fall_down_oubliette() {
-	_vm->_gyro->magics[8].op = _vm->_gyro->kMagicNothing;
+	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
 	_vm->_trip->tr[0].iy++; // Increments dx/dy!
 	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   // Dowwwn we go...
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
 void Timeout::meet_avaroid() {
-	if (_vm->_gyro->dna.met_avaroid) {
+	if (_vm->_gyro->_dna._metAvaroid) {
 		_vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
 		_vm->_lucerna->gameover();
 	} else {
 		_vm->_visa->dixi('Q', 60);
-		_vm->_gyro->dna.met_avaroid = true;
+		_vm->_gyro->_dna._metAvaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
 		_vm->_trip->tr[0].face = _vm->_trip->left;
@@ -550,7 +550,7 @@ void Timeout::meet_avaroid() {
 		_vm->_trip->tr[0].ix = -3;
 		_vm->_trip->tr[0].iy = -5;
 
-		_vm->_gyro->background(2);
+		_vm->_gyro->setBackgroundColor(2);
 	}
 }
 
@@ -561,7 +561,7 @@ void Timeout::rise_up_oubliette() {
 	if (_vm->_trip->tr[0].iy > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
-		_vm->_gyro->dna.user_moves_avvy = true;
+		_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
 void Timeout::robin_hood_and_geida() {
@@ -571,7 +571,7 @@ void Timeout::robin_hood_and_geida() {
 	_vm->_trip->tr[1].stopwalk();
 	_vm->_trip->tr[1].face = _vm->_trip->left;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
-	_vm->_gyro->dna.geida_follows = false;
+	_vm->_gyro->_dna._geidaFollows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
@@ -589,7 +589,7 @@ void Timeout::avalot_returns() {
 	_vm->_trip->tr[0].init(0, true, _vm->_trip);
 	_vm->_trip->apped(1, 1);
 	_vm->_visa->dixi('q', 67);
-	_vm->_gyro->dna.user_moves_avvy = true;
+	_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
 void Timeout::avvy_sit_down() {
@@ -598,8 +598,8 @@ void Timeout::avvy_sit_down() {
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->dna.sitting_in_pub = true;
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._sittingInPub = true;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_trip->tr[0].visible = false;
 	}
 }
@@ -610,7 +610,7 @@ void Timeout::ghost_room_phew() {
 }
 
 void Timeout::arkata_shouts() {
-	if (_vm->_gyro->dna.teetotal)
+	if (_vm->_gyro->_dna._teetotal)
 		return;
 
 	_vm->_visa->dixi('q', 76);
@@ -632,7 +632,7 @@ void Timeout::winning() {
 
 	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
 	_vm->_scrolls->display(" T H E    E N D ");
-	_vm->_gyro->lmo = true;
+	_vm->_gyro->_letMeOut = true;
 }
 
 void Timeout::avalot_falls() {
@@ -664,7 +664,7 @@ void Timeout::spludwick_leaves_cauldron() {
 void Timeout::give_lute_to_geida() { // Moved here from Acci.
 	_vm->_visa->dixi('Q', 86);
 	_vm->_lucerna->points(4);
-	_vm->_gyro->dna.lustie_is_asleep = true;
+	_vm->_gyro->_dna._lustieIsAsleep = true;
 	_vm->_sequence->first_show(5);
 	_vm->_sequence->then_show(6); // He falls asleep...
 	_vm->_sequence->start_to_close(); // Not really closing, but we're using the same procedure.
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 0e16c77..c514734 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -162,8 +162,8 @@ void triptype::turn(byte whichway) {
 void triptype::appear(int16 wx, int16 wy, byte wf) {
 	x = (wx / 8) * 8;
 	y = wy;
-	ox[_tr->_vm->_gyro->cp] = wx;
-	oy[_tr->_vm->_gyro->cp] = wy;
+	ox[_tr->_vm->_gyro->_cp] = wx;
+	oy[_tr->_vm->_gyro->_cp] = wy;
 	turn(wf);
 	visible = true;
 	ix = 0;
@@ -183,23 +183,23 @@ bool triptype::collision_check() {
 
 void triptype::walk() {
 	byte tc;
-	bytefield r;
+	ByteField r;
 
 
 	if (visible) {
-		r.x1 = (x / 8) - 1;
-		if (r.x1 == 255)
-			r.x1 = 0;
-		r.y1 = y - 2;
-		r.x2 = ((x + _info._xLength) / 8) + 1;
-		r.y2 = y + _info._yLength + 2;
+		r._x1 = (x / 8) - 1;
+		if (r._x1 == 255)
+			r._x1 = 0;
+		r._y1 = y - 2;
+		r._x2 = ((x + _info._xLength) / 8) + 1;
+		r._y2 = y + _info._yLength + 2;
 		
-		_tr->getset[1 - _tr->_vm->_gyro->cp].remember(r);
+		_tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r);
 	}
 
-	if (!_tr->_vm->_gyro->doing_sprite_run) {
-		ox[_tr->_vm->_gyro->cp] = x;
-		oy[_tr->_vm->_gyro->cp] = y;
+	if (!_tr->_vm->_gyro->_doingSpriteRun) {
+		ox[_tr->_vm->_gyro->_cp] = x;
+		oy[_tr->_vm->_gyro->_cp] = y;
 		if (homing)
 			homestep();
 		x = x + ix;
@@ -212,22 +212,22 @@ void triptype::walk() {
 			return;
 		}
 
-		tc = _tr->checkfeet(x, x + _info._xLength, oy[_tr->_vm->_gyro->cp], y, _info._yLength) - 1;
+		tc = _tr->checkfeet(x, x + _info._xLength, oy[_tr->_vm->_gyro->_cp], y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
-			switch (_tr->_vm->_gyro->magics[tc].op) {
+		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
+			switch (_tr->_vm->_gyro->_magics[tc]._operation) {
 			case Gyro::kMagicExclaim: {
 				bounce();
 				_tr->mustexclaim = true;
-				_tr->saywhat = _tr->_vm->_gyro->magics[tc].data;
+				_tr->saywhat = _tr->_vm->_gyro->_magics[tc]._data;
 				}
 				break;
 			case Gyro::kMagicBounce:
 				bounce();
 				break;
 			case Gyro::kMagicTransport:
-				_tr->fliproom(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff);
+				_tr->fliproom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
@@ -235,16 +235,16 @@ void triptype::walk() {
 				}
 				break;
 			case Gyro::kMagicSpecial:
-				_tr->call_special(_tr->_vm->_gyro->magics[tc].data);
+				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_tr->open_the_door(_tr->_vm->_gyro->magics[tc].data >> 8, _tr->_vm->_gyro->magics[tc].data & 0xff, tc);
+				_tr->open_the_door(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
 				break;
 			}
 		}
 	}
 
-	if (!_tr->_vm->_gyro->doing_sprite_run) {
+	if (!_tr->_vm->_gyro->_doingSpriteRun) {
 		count++;
 		if (((ix != 0) || (iy != 0)) && (count > 1)) {
 			step++;
@@ -256,8 +256,8 @@ void triptype::walk() {
 }
 
 void triptype::bounce() {
-	x = ox[_tr->_vm->_gyro->cp];
-	y = oy[_tr->_vm->_gyro->cp];
+	x = ox[_tr->_vm->_gyro->_cp];
+	y = oy[_tr->_vm->_gyro->_cp];
 	if (check_me)
 		_tr->stopwalking();
 	else
@@ -278,9 +278,9 @@ int8 triptype::sgn(int16 val) {
 
 void triptype::walkto(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
-	speed(sgn(_tr->_vm->_gyro->peds[pednum].x - x) * 4, sgn(_tr->_vm->_gyro->peds[pednum].y - y));
-	hx = _tr->_vm->_gyro->peds[pednum].x - _info._xLength / 2;
-	hy = _tr->_vm->_gyro->peds[pednum].y - _info._yLength;
+	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - y));
+	hx = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
+	hy = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
 	homing = true;
 }
 
@@ -344,10 +344,10 @@ void triptype::stopwalk() {
 }
 
 void triptype::chatter() {
-	_tr->_vm->_gyro->talkx = x + _info._xLength / 2;
-	_tr->_vm->_gyro->talky = y;
-	_tr->_vm->_gyro->talkf = a.fgc;
-	_tr->_vm->_gyro->talkb = a.bgc;
+	_tr->_vm->_gyro->_talkX = x + _info._xLength / 2;
+	_tr->_vm->_gyro->_talkY = y;
+	_tr->_vm->_gyro->_talkFontColor = a.fgc;
+	_tr->_vm->_gyro->_talkBackgroundColor = a.bgc;
 }
 
 void triptype::set_up_saver(trip_saver_type &v) {
@@ -436,14 +436,14 @@ getsettype *getsettype::init() {
 	return this;
 }
 
-void getsettype::remember(bytefield r) {
+void getsettype::remember(ByteField r) {
 	numleft++;
 	//if (numleft > maxgetset)
 	//	error("Trip::remember() : runerr_Getset_Overflow");
 	gs[numleft] = r;
 }
 
-void getsettype::recall(bytefield &r) {
+void getsettype::recall(ByteField &r) {
 	r = gs[numleft];
 	numleft--;
 }
@@ -540,8 +540,8 @@ void Trip::catamove(byte ped) {
 
 
 		
-	xy_uint16 = _vm->_gyro->dna.cat_x + _vm->_gyro->dna.cat_y * 256;
-	_vm->_gyro->dna.geida_spin = 0;
+	xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256;
+	_vm->_gyro->_dna._geidaSpin = 0;
 		
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
@@ -558,78 +558,78 @@ void Trip::catamove(byte ped) {
 	case 2307:
 		fliproom(r__lusties, 5);
 		_vm->_scrolls->display("Oh no... here we go again...");
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		tr[0].iy = 1;
 		tr[0].ix = 0;
 		return;
 	}
 
-	if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
+	if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom)
 		_vm->_lucerna->load(29);
-	here = _vm->_gyro->kCatacombMap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1];
+	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[4].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->magics[1].op = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->magics[2].op = _vm->_gyro->kMagicSpecial; // Straight wall.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -637,52 +637,52 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->magics[4].op = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->magics[5].op = _vm->_gyro->kMagicSpecial; // Straight wall.
-		_vm->_gyro->portals[6].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
 		break;
 	}
 
@@ -690,39 +690,39 @@ void Trip::catamove(byte ped) {
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 			
-		if ((xy_uint16 == 2051) && (_vm->_gyro->dna.geida_follows))
-			_vm->_gyro->magics[12].op = _vm->_gyro->kMagicExclaim;
+		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
+			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim;
 		else
-			_vm->_gyro->magics[12].op = _vm->_gyro->kMagicSpecial; // Right exit south.
+			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicSpecial; // Right exit south.
 
-		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicSpecial; // Middle exit south.
-		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicSpecial; // Middle exit south.
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
-		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicSpecial; // Left exit south.
-		_vm->_gyro->magics[6].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->magics[12].op = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicSpecial; // Left exit south.
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
 		break;
 	// LEFT handles: 
 #if 0
@@ -734,8 +734,8 @@ void Trip::catamove(byte ped) {
 #endif
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
@@ -752,8 +752,8 @@ void Trip::catamove(byte ped) {
 #endif
 	case 0x5:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
@@ -773,26 +773,26 @@ void Trip::catamove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
 
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicSpecial; // Middle arch north.
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicSpecial; // Middle arch north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
 	}
 	break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_gyro->magics[0].op = _vm->_gyro->kMagicNothing; // Door to Geida's room.
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicNothing; // Door to Geida's room.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->portals[3].op = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
 		break;
 	}
 
@@ -828,7 +828,7 @@ void Trip::catamove(byte ped) {
 		break; // [1,1] : the other two.
 	}
 
-	if ((_vm->_gyro->dna.geida_follows) && (ped > 0)) {
+	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
 		if (!tr[1].quick)  // If we don't already have her...
 			tr[1].init(5, true, this); // ...Load Geida.
 		apped(2, geida_ped(ped));
@@ -848,27 +848,27 @@ void Trip::call_special(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->dna.brummie_stairs = 1;
-		_vm->_gyro->magics[9].op = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_dna._brummieStairs = 1;
+		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
 		stopwalking();
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
-		_vm->_gyro->dna.brummie_stairs = 3;
-		_vm->_gyro->magics[10].op = _vm->_gyro->kMagicNothing;
-		_vm->_gyro->magics[11].op = _vm->_gyro->kMagicExclaim;
-		_vm->_gyro->magics[11].data = 5;
-		_vm->_gyro->magics[3].op = _vm->_gyro->kMagicBounce; // Now works as planned!
+		_vm->_gyro->_dna._brummieStairs = 3;
+		_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicExclaim;
+		_vm->_gyro->_magics[11]._data = 5;
+		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
 		stopwalking();
 		_vm->_visa->dixi('q', 26);
-		_vm->_gyro->dna.user_moves_avvy = true;
+		_vm->_gyro->_dna._userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
 		tr[0].bounce(); // Must include that.
 
-		if (!_vm->_gyro->dna.arrow_triggered) {
-			_vm->_gyro->dna.arrow_triggered = true;
+		if (!_vm->_gyro->_dna._arrowTriggered) {
+			_vm->_gyro->_dna._arrowTriggered = true;
 			apped(2, 4); // The dart starts at ped 4, and...
 			tr[1].walkto(5); // flies to ped 5.
 			tr[1].face = 0; // Only face.
@@ -888,25 +888,25 @@ void Trip::call_special(uint16 which) {
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
-		if (_vm->_gyro->dna.friar_will_tie_you_up) {
+		if (_vm->_gyro->_dna._friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
-			_vm->_gyro->magics[4].op = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
+			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->dixi('q', 35);
 			tr[0].done();
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->dixi('q', 36);
-			_vm->_gyro->dna.tied_up = true;
-			_vm->_gyro->dna.friar_will_tie_you_up = false;
+			_vm->_gyro->_dna._tiedUp = true;
+			_vm->_gyro->_dna._friarWillTieYouUp = false;
 			tr[1].walkto(3);
 			tr[1].vanishifstill = true;
 			tr[1].check_me = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->_whereIs[_vm->_gyro->pfriartuck - 150] = 177; // Not here, then.
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		tr[0].ix = 3;
 		tr[0].iy = 0;
 		tr[0].face = right;
@@ -914,7 +914,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0].visible = false;
-		_vm->_gyro->magics[9].op = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		stopwalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
@@ -923,7 +923,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
-		if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
+		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
 			_vm->_visa->dixi('q', 63);
 			tr[1].turn(down);
 			tr[1].stopwalk();
@@ -932,18 +932,18 @@ void Trip::call_special(uint16 which) {
 		}
 		break;
 	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
-		if (!_vm->_gyro->dna.geida_follows)
+		if (!_vm->_gyro->_dna._geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		tr[1].call_eachstep = false; // She no longer follows Avvy around.
 		tr[1].walkto(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
-		if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
+		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_gyro->dna.obj[_vm->_gyro->key - 1])
+			if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1])
 				_vm->_visa->dixi('q', 62);
 			else {
 				_vm->_visa->dixi('q', 61);
@@ -951,12 +951,12 @@ void Trip::call_special(uint16 which) {
 			}
 		}
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_y--;
+		_vm->_gyro->_dna._catacombY--;
 		catamove(4);
-		if (_vm->_gyro->dna.room != r__catacombs)
+		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
-		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->dna.cat_y - 1][_vm->_gyro->dna.cat_x - 1] & 0xf00) >> 8) {
+		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
 			break;
@@ -971,9 +971,9 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_x++;
+		_vm->_gyro->_dna._catacombX++;
 		catamove(1);
-		if (_vm->_gyro->dna.room != r__catacombs)
+		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
 		apped(1, 1);
@@ -982,9 +982,9 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_y += 1;
+		_vm->_gyro->_dna._catacombY += 1;
 		catamove(2);
-		if (_vm->_gyro->dna.room != r__catacombs)
+		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
 		apped(1, 2);
@@ -993,9 +993,9 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->dna.cat_x--;
+		_vm->_gyro->_dna._catacombX--;
 		catamove(3);
-		if (_vm->_gyro->dna.room != r__catacombs)
+		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		_vm->_lucerna->delavvy();
 		apped(1, 3);
@@ -1011,7 +1011,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 // This slides the door open. (The data really ought to be saved in
 // the Also file, and will be next time. However, for now, they're
 // here.)
-	switch (_vm->_gyro->dna.room) {
+	switch (_vm->_gyro->_dna._room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
 	case r__outsideducks:
@@ -1038,7 +1038,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
-			if (_vm->_gyro->dna.avvys_in_the_cupboard) {
+			if (_vm->_gyro->_dna._avvysInTheCupboard) {
 				hide_in_the_cupboard();
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(7);
@@ -1066,7 +1066,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 
 void Trip::newspeed() {
 	// Given that you've just changed the speed in triptype.xs, this adjusts ix.
-	const bytefield lightspace = {40, 199, 47, 199};
+	const ByteField lightspace = {40, 199, 47, 199};
 	byte page_;
 
 	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
@@ -1122,8 +1122,8 @@ void Trip::rwsp(byte t, byte dir) {
 void Trip::apped(byte trn, byte np) {
 	trn--;
 	np--;
-	tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info._xLength / 2, _vm->_gyro->peds[np].y - tr[trn]._info._yLength, _vm->_gyro->peds[np].dir);
-	rwsp(trn, _vm->_gyro->peds[np].dir);
+	tr[trn].appear(_vm->_gyro->_peds[np]._x - tr[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - tr[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
+	rwsp(trn, _vm->_gyro->_peds[np]._direction);
 }
 
 #if 0
@@ -1134,20 +1134,14 @@ void Trip::apped(byte trn, byte np) {
 #endif
 	//x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
 	//x3,y3 = mx,my. x4,y4 = mx+16,my+16.
-bool Trip::overlaps_with_mouse() {
-	bool overlaps_with_mouse_result;
-	overlaps_with_mouse_result =
-		(r.x2 * 8 >= _vm->_gyro->mx) && (_vm->_gyro->mx + 16 >= r.x1 * 8) && (r.y2 >= _vm->_gyro->my) && (_vm->_gyro->my + 16 >= r.y1);
-	return overlaps_with_mouse_result;
-}
 
 void Trip::getback() {
 	// Super_Off;
-
+#if 0
 	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
 		getset[1 - _vm->_gyro->cp].recall(r);
 
-#if 0
+
 		bool endangered = false;
 		if overlaps_with_mouse and not endangered then
 			begin
@@ -1155,12 +1149,10 @@ void Trip::getback() {
 				blitfix;
 				Super_Off;
 			end;
-#endif
 
 		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
 	}
 
-#if 0
 	if endangered then
 		Super_On;
 #endif
@@ -1234,13 +1226,13 @@ void Trip::arrow_procs(byte tripnum) {
 #endif
 			_vm->_lucerna->gameover();
 
-			_vm->_gyro->dna.user_moves_avvy = false; // Stop the user from moving him.
+			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
 			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
 		}
 	} else { // Arrow has hit the wall!
 		tr[tripnum].done(); // Deallocate the arrow.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
-		_vm->_gyro->dna.arrow_in_the_door = true; // So that we can pick it up.
+		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
 	}
 		
 }
@@ -1299,21 +1291,21 @@ void Trip::spin(byte whichway, byte &tripnum) {
 		if (tr[tripnum].whichsprite == 2)
 			return; // Not for Spludwick
 
-		_vm->_gyro->dna.geida_spin += 1;
-		_vm->_gyro->dna.geida_time = 20;
-		if (_vm->_gyro->dna.geida_spin == 5) {
+		_vm->_gyro->_dna._geidaSpin += 1;
+		_vm->_gyro->_dna._geidaTime = 20;
+		if (_vm->_gyro->_dna._geidaSpin == 5) {
 			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_gyro->dna.geida_spin = 0;
-			_vm->_gyro->dna.geida_time = 0; // knock out records
+			_vm->_gyro->_dna._geidaSpin = 0;
+			_vm->_gyro->_dna._geidaTime = 0; // knock out records
 		}
 	}
 }
 
 void Trip::geida_procs(byte tripnum) {
-	if (_vm->_gyro->dna.geida_time > 0) {
-		_vm->_gyro->dna.geida_time--;
-		if (_vm->_gyro->dna.geida_time == 0)
-			_vm->_gyro->dna.geida_spin = 0;
+	if (_vm->_gyro->_dna._geidaTime > 0) {
+		_vm->_gyro->_dna._geidaTime--;
+		if (_vm->_gyro->_dna._geidaTime == 0)
+			_vm->_gyro->_dna._geidaSpin = 0;
 	}
 
 	if (tr[tripnum].y < (tr[0].y - 2)) {
@@ -1388,7 +1380,7 @@ void Trip::call_andexors() {
 void Trip::trippancy_link() {
 	byte fv;
 
-	if (_vm->_gyro->ddmnow | _vm->_gyro->ontoolbar | _vm->_gyro->seescroll)
+	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
 	for (fv = 0; fv < numtr; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
@@ -1443,8 +1435,8 @@ void Trip::get_back_loretta() {
 
 void Trip::stopwalking() {
 	tr[0].stopwalk();
-	_vm->_gyro->dna.rw = stopped;
-	if (_vm->_gyro->alive)
+	_vm->_gyro->_dna._direction = stopped;
+	if (_vm->_gyro->_alive)
 		tr[0].step = 1;
 }
 
@@ -1462,15 +1454,15 @@ void Trip::getsetclear() {
 }
 
 void Trip::hide_in_the_cupboard() {
-	if (_vm->_gyro->dna.avvys_in_the_cupboard) {
-		if (_vm->_gyro->dna.wearing == Acci::kNothing)
+	if (_vm->_gyro->_dna._avvysInTheCupboard) {
+		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
 		else {
 			tr[0].visible = true;
-			_vm->_gyro->dna.user_moves_avvy = true;
+			_vm->_gyro->_dna._userMovesAvvy = true;
 			apped(1, 3); // Walk out of the cupboard.
 			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
-			_vm->_gyro->dna.avvys_in_the_cupboard = false;
+			_vm->_gyro->_dna._avvysInTheCupboard = false;
 			_vm->_sequence->first_show(8);
 			_vm->_sequence->then_show(7);
 			_vm->_sequence->start_to_close();
@@ -1478,50 +1470,36 @@ void Trip::hide_in_the_cupboard() {
 	} else {
 		// Not hiding in the cupboard
 		tr[0].visible = false;
-		_vm->_gyro->dna.user_moves_avvy = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
 			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
-		_vm->_gyro->dna.avvys_in_the_cupboard = true;
+		_vm->_gyro->_dna._avvysInTheCupboard = true;
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 	}
 }
 
-void Trip::tidy_up(int16 a, int16 b, int16 c, int16 d) {
-	warning("STUB: Trip::tidy_up()");
-}
-
-void Trip::tidy_after_mouse() {
-	tidy_up(beforex, beforey, beforex + 15, beforey + 15);
-	_vm->_gyro->xycheck();
-	tidy_up(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->mx + 15, _vm->_gyro->my + 15);
-}
-
 void Trip::fliproom(byte room, byte ped) {
 	byte fv;
 
-	if (!_vm->_gyro->alive) {
+	if (!_vm->_gyro->_alive) {
 		// You can't leave the room if you're dead.
 		tr[0].ix = 0;
 		tr[0].iy = 0; // Stop him from moving.
 		return;
 	}
 
-	if ((room == 177) && (_vm->_gyro->dna.room == r__lusties)) {
+	if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) {
 		hide_in_the_cupboard();
 		return;
 	}
 
-	if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) {
+	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
 		// You can't *jump* out of Cardiff Castle!
 		tr[0].ix = 0;
 		return;
 	}
 
-	_vm->_gyro->xycheck();
-	beforex = _vm->_gyro->mx;
-	beforey = _vm->_gyro->my;
-
-	_vm->_lucerna->exitroom(_vm->_gyro->dna.room);
+	_vm->_lucerna->exitroom(_vm->_gyro->_dna._room);
 	_vm->_lucerna->dusk();
 	getsetclear();
 
@@ -1531,18 +1509,18 @@ void Trip::fliproom(byte room, byte ped) {
 			tr[fv].done();
 	} // Deallocate sprite
 
-	if (_vm->_gyro->dna.room == r__lustiesroom)
-		_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
+	if (_vm->_gyro->_dna._room == r__lustiesroom)
+		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterroom(room, ped);
 	apped(1, ped);
-	_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
-	_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
-	_vm->_gyro->dna.rw = tr[0].face;
+	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
+	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
+	_vm->_gyro->_dna._direction = tr[0].face;
 	_vm->_lucerna->showrw();
 
 	for (fv = 0; fv <= 1; fv++) {
-		_vm->_gyro->cp = 1 - _vm->_gyro->cp;
+		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
 		getback();
 	}
 	_vm->_lucerna->dawn();
@@ -1556,13 +1534,13 @@ bool Trip::infield(byte which) {
 
 	int16 yy = tr[0].y + tr[0]._info._yLength;
 
-	return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2)
-		&& (yy >= _vm->_gyro->fields[which].y1) && (yy <= _vm->_gyro->fields[which].y2);
+	return (tr[0].x >= _vm->_gyro->_fields[which]._x1) && (tr[0].x <= _vm->_gyro->_fields[which]._x2)
+		&& (yy >= _vm->_gyro->_fields[which]._y1) && (yy <= _vm->_gyro->_fields[which]._y2);
 
 }
 
 bool Trip::neardoor() {
-	if (_vm->_gyro->numfields < 8) {
+	if (_vm->_gyro->_fieldNum < 8) {
 		// there ARE no doors here!
 		return false;
 	}
@@ -1570,9 +1548,9 @@ bool Trip::neardoor() {
 	int16 ux = tr[0].x;
 	int16 uy = tr[0].y + tr[0]._info._yLength;
 	bool nd = false;
-	for (byte fv = 8; fv < _vm->_gyro->numfields; fv++)
-		if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
-			&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2)) 
+	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
+		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
+			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2)) 
 			nd = true;
 	return nd;
 }
@@ -1584,7 +1562,7 @@ void Trip::new_game_for_trippancy() {   // Called by gyro.newgame
 
 
 void Trip::handleMoveKey(const Common::Event &event) { 
-	if (!_vm->_gyro->dna.user_moves_avvy)
+	if (!_vm->_gyro->_dna._userMovesAvvy)
 		return;
 
 	if (_vm->_dropdown->_activeMenuItem._activeNow)
@@ -1592,58 +1570,58 @@ void Trip::handleMoveKey(const Common::Event &event) {
 	else {
 		switch (event.kbd.keycode) {
 		case Common::KEYCODE_UP:
-			if (_vm->_gyro->dna.rw != up) {
-				_vm->_gyro->dna.rw = up;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != up) {
+				_vm->_gyro->_dna._direction = up;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_DOWN:
-			if (_vm->_gyro->dna.rw != down) {
-				_vm->_gyro->dna.rw = down;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != down) {
+				_vm->_gyro->_dna._direction = down;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_LEFT:
-			if (_vm->_gyro->dna.rw != left) {
-				_vm->_gyro->dna.rw = left;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != left) {
+				_vm->_gyro->_dna._direction = left;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_RIGHT:
-			if (_vm->_gyro->dna.rw != right) {
-				_vm->_gyro->dna.rw = right;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != right) {
+				_vm->_gyro->_dna._direction = right;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
-			if (_vm->_gyro->dna.rw != ur) {
-				_vm->_gyro->dna.rw = ur;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != ur) {
+				_vm->_gyro->_dna._direction = ur;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
-			if (_vm->_gyro->dna.rw != dr) {
-				_vm->_gyro->dna.rw = dr;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != dr) {
+				_vm->_gyro->_dna._direction = dr;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_END:
-			if (_vm->_gyro->dna.rw != dl) {
-				_vm->_gyro->dna.rw = dl;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != dl) {
+				_vm->_gyro->_dna._direction = dl;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_HOME:
-			if (_vm->_gyro->dna.rw != ul) {
-				_vm->_gyro->dna.rw = ul;
-				rwsp(0, _vm->_gyro->dna.rw);
+			if (_vm->_gyro->_dna._direction != ul) {
+				_vm->_gyro->_dna._direction = ul;
+				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index e3ed44f..4deebbc 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -130,12 +130,12 @@ const int16 maxgetset = 35;
 
 class getsettype {
 public:
-	bytefield gs[maxgetset];
+	ByteField gs[maxgetset];
 	byte numleft;
 
 	getsettype *init();
-	void remember(bytefield r);
-	void recall(bytefield &r);
+	void remember(ByteField r);
+	void recall(ByteField &r);
 };
 
 
@@ -235,7 +235,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	bytefield r;
+	ByteField r;
 
 	int16 beforex, beforey;
 
@@ -247,8 +247,6 @@ private:
 
 	void hide_in_the_cupboard();
 
-	bool overlaps_with_mouse();
-
 	void follow_avvy_y(byte tripnum);
 
 	void back_and_forth(byte tripnum);
@@ -266,10 +264,6 @@ private:
 	void call_andexors();
 
 	void getsetclear();
-
-	void tidy_up(int16 a, int16 b, int16 c, int16 d);
-
-	void tidy_after_mouse();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index fe31cc2..4cdbe5a 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -49,13 +49,13 @@ bool Visa::bubbling = false;
 bool Visa::report_dixi_errors = true;
 
 void Visa::unskrimble() {
-	for (uint16  fv = 0; fv < _vm->_gyro->bufsize; fv++) 
-		_vm->_gyro->buffer[fv] = (~(_vm->_gyro->buffer[fv] - (fv + 1))) % 256;
+	for (uint16  fv = 0; fv < _vm->_gyro->_bufSize; fv++) 
+		_vm->_gyro->_buffer[fv] = (~(_vm->_gyro->_buffer[fv] - (fv + 1))) % 256;
 }
 
 void Visa::do_the_bubble() {
-	_vm->_gyro->bufsize++;
-	_vm->_gyro->buffer[_vm->_gyro->bufsize - 1] = 2;
+	_vm->_gyro->_bufSize++;
+	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
 }
 
 void Visa::dixi(char block, byte point) {
@@ -85,7 +85,7 @@ void Visa::dixi(char block, byte point) {
 	if (error) {
 		if (report_dixi_errors) {
 			Common::String todisplay;
-			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
+			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->intToStr(point).c_str());
 			_vm->_scrolls->display(todisplay);
 		}
 		return;
@@ -96,8 +96,8 @@ void Visa::dixi(char block, byte point) {
 		return;
 	}
 	sezfile.seek(sez_offset);
-	_vm->_gyro->bufsize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
 	sezfile.close();
 	unskrimble();
 
@@ -146,8 +146,8 @@ void Visa::speech(byte who, byte subject) {
 			return;
 		}
 		sezfile.seek(sez_offset);
-		_vm->_gyro->bufsize = sezfile.readUint16LE();
-		sezfile.read(_vm->_gyro->buffer, _vm->_gyro->bufsize);
+		_vm->_gyro->_bufSize = sezfile.readUint16LE();
+		sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
 		sezfile.close();
 
 		unskrimble();
@@ -165,27 +165,27 @@ void Visa::talkto(byte whom) {
 	bool no_matches;
 
 	if (_vm->_acci->_person == _vm->_acci->kPardon) {
-		_vm->_acci->_person = _vm->_gyro->subjnumber;
-		_vm->_gyro->subjnumber = 0;
+		_vm->_acci->_person = _vm->_gyro->_subjectNum;
+		_vm->_gyro->_subjectNum = 0;
 	}
 
-	if (_vm->_gyro->subjnumber == 0)
+	if (_vm->_gyro->_subjectNum == 0)
 		switch (whom) {
-		case Gyro::pspludwick:
-			if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion - 1])) {
+		case Gyro::kPeopleSpludwick:
+			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) {
 				dixi('q', 68);
-				_vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true;
+				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
 				_vm->_lucerna->objectlist();
 				_vm->_lucerna->points(3);
 				return;
 			} else {
-				if (_vm->_gyro->dna.talked_to_crapulus)
+				if (_vm->_gyro->_dna._talkedToCrapulus)
 					// Spludwick - what does he need?
 					// 0 - let it through to use normal routine.
-					switch (_vm->_gyro->dna.given2spludwick) { 
+					switch (_vm->_gyro->_dna._givenToSpludwick) { 
 					case 1: // Falltrough is intended.
 					case 2:{
-						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->get_better(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->dna.given2spludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 						return;
 						}
 						break;
@@ -201,57 +201,57 @@ void Visa::talkto(byte whom) {
 				}
 			}
 			break;
-		case Gyro::pibythneth:
-			if (_vm->_gyro->dna.givenbadgetoiby) {
+		case Gyro::kPeopleIbythneth:
+			if (_vm->_gyro->_dna._givenBadgeToIby) {
 				dixi('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
-		case Gyro::pdogfood:
-			if (_vm->_gyro->dna.wonnim) { // We've won the game.
+		case Gyro::kPeopleDogfood:
+			if (_vm->_gyro->_dna._wonNim) { // We've won the game.
 				dixi('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
-				_vm->_gyro->dna.asked_dogfood_about_nim = true;
+				_vm->_gyro->_dna._askedDogfoodAboutNim = true;
 			break;
-		case Gyro::payles:
-			if (!_vm->_gyro->dna.ayles_is_awake) {
+		case Gyro::kPeopleAyles:
+			if (!_vm->_gyro->_dna._aylesIsAwake) {
 				dixi('q', 43); // He's fast asleep!
 				return;
-			} else if (!_vm->_gyro->dna.given_pen_to_ayles) {
+			} else if (!_vm->_gyro->_dna._givenPenToAyles) {
 				dixi('q', 44); // Can you get me a pen, Avvy?
 				return;
 			}
 			break;
 
-		case Gyro::pjacques: {
+		case Gyro::kPeopleJacques: {
 			dixi('q', 43);
 			return;
 			}
-		case Gyro::pgeida:
-			if (_vm->_gyro->dna.geida_given_potion)
-				_vm->_gyro->dna.geida_follows = true;
+		case Gyro::kPeopleGeida:
+			if (_vm->_gyro->_dna._givenPotionToGeida)
+				_vm->_gyro->_dna._geidaFollows = true;
 			else {
 				dixi('u', 17);
 				return;
 			}
 			break;
-		case Gyro::pspurge:
-			if (!_vm->_gyro->dna.sitting_in_pub) {
+		case Gyro::kPeopleSpurge:
+			if (!_vm->_gyro->_dna._sittingInPub) {
 				dixi('q', 71); // Try going over and sitting down.
 				return;
 			} else {
-				if (_vm->_gyro->dna.spurge_talk < 5)
-					_vm->_gyro->dna.spurge_talk++;
-				if (_vm->_gyro->dna.spurge_talk > 1) { // no. 1 falls through
-					dixi('q', 70 + _vm->_gyro->dna.spurge_talk);
+				if (_vm->_gyro->_dna._spurgeTalkCount < 5)
+					_vm->_gyro->_dna._spurgeTalkCount++;
+				if (_vm->_gyro->_dna._spurgeTalkCount > 1) { // no. 1 falls through
+					dixi('q', 70 + _vm->_gyro->_dna._spurgeTalkCount);
 					return;
 				}
 			}
 			break;
 	}
 	// On a subject. Is there any reason to block it?
-	else if ((whom == _vm->_gyro->payles) && (!_vm->_gyro->dna.ayles_is_awake)) { 
+	else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) { 
 			dixi('q', 43); // He's fast asleep!
 			return;
 		}
@@ -270,18 +270,18 @@ void Visa::talkto(byte whom) {
 	if (no_matches)
 		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
 
-	speech(whom, _vm->_gyro->subjnumber);
+	speech(whom, _vm->_gyro->_subjectNum);
 
 	if (!went_ok)
 		dixi('n', whom); // File not found!
 
-	if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = true;
+	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = true;
 		_vm->_lucerna->objectlist();
 		dixi('q', 1); // Circular from Cardiff.
-		_vm->_gyro->dna.talked_to_crapulus = true;
+		_vm->_gyro->_dna._talkedToCrapulus = true;
 
-		_vm->_gyro->_whereIs[_vm->_gyro->pcrapulus - 150] = 177; // Crapulus walks off.
+		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_trip->tr[1].vanishifstill = true;
 		_vm->_trip->tr[1].walkto(3); // Walks away.


Commit: f1bac0f193c7fe39d0241e0c3db60bc10642edfc
    https://github.com/scummvm/scummvm/commit/f1bac0f193c7fe39d0241e0c3db60bc10642edfc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-06T15:03:59-07:00

Commit Message:
AVALANCHE: (Hopefully) fix some warnings reported by GCC and Clang

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 7b3e84f..1661ad2 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1527,9 +1527,9 @@ void Acci::doThat() {
 		for (byte i = 0; i < 7; i++)
 			toDisplay += _vm->_scrolls->kControlNewLine;
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
-			+ "The medi‘val descendant of" + _vm->_scrolls->kControlNewLine
+			+ "The medi\x91val descendant of" + _vm->_scrolls->kControlNewLine
 			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright ï "
+			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright \XEF "
 			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
 		_vm->_scrolls->display(toDisplay);
 		_vm->_scrolls->aboutscroll = false;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 7424d82..10cefa1 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -349,7 +349,8 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 		return;
 	else {
 		byte i;
-		for (i = 0; text[i] != trigger; i++); // Search for the character in the string.
+		for (i = 0; text[i] != trigger; i++)
+			; // Search for the character in the string.
 	
 		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index eeb15dd..df31050 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -91,8 +91,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 		yRadius++;
 
 	// Check for an ellipse with negligable x and y radius.
-	if ((xRadius <= 1) && (yRadius <= 1)) 
-	{
+	if ((xRadius <= 1) && (yRadius <= 1)) {
 		*(byte *)_scrolls.getBasePtr(x, y) = color;
 		endPoint.x = x;
 		endPoint.y = y;
@@ -104,15 +103,14 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	endAngle = endAngle % 361;
 
 	// If impossible angles, then swap them! 
-	if (endAngle < stAngle) 
-	{
+	if (endAngle < stAngle) {
 		uint16 tmpAngle=endAngle;
 		endAngle=stAngle;
 		stAngle=tmpAngle;
 	}
 
 	// Approximate the number of pixels required by using the circumference equation of an ellipse.                                              
-	uint16 numOfPixels=floor(sqrt(3.0)*sqrt(pow(double(xRadius), 2)+pow(double(yRadius), 2)) + 0.5);
+	uint16 numOfPixels = (uint16)floor(sqrt(3.0) * sqrt(pow(double(xRadius), 2) + pow(double(yRadius), 2)) + 0.5);
 
 	// Calculate the angle precision required.
 	double delta = 90.0 / numOfPixels;
@@ -127,8 +125,8 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 
 	// Set the end point.
 	double tempTerm = endAngle * convfac;
-	endPoint.x = floor(xRadius * cos(tempTerm) + 0.5) + x;
-	endPoint.y = floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
+	endPoint.x = (int16)floor(xRadius * cos(tempTerm) + 0.5) + x;
+	endPoint.y = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
 
 	// Calculate points. 
 	int16 xNext = xRadius;
@@ -139,8 +137,8 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 		// This is used by both sin and cos.
 		tempTerm = (j + delta) * convfac;
 		
-		xNext = floor(xRadius*cos(tempTerm) + 0.5);
-		yNext = floor(yRadius*sin(tempTerm + pi) + 0.5);
+		xNext = (int16)floor(xRadius * cos(tempTerm) + 0.5);
+		yNext = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5);
 
 		int16 xp = x + xTemp;
 		int16 xm = x - xTemp;
@@ -208,7 +206,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 }
 
 void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) {
-	for (byte i = 0; i < text.size(); i++)
+	for (byte i = 0; i < text.size(); i++) {
 		for (byte j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];	
 			for (byte bit = 0; bit < 8; bit++) {
@@ -217,6 +215,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 					*(byte *)surface.getBasePtr(x + i * 8 + 7 - bit, y + j) = color;
 			}
 		}
+	}
 }
 
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
@@ -229,8 +228,8 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
-	for (byte y = 0; y < height; y++) 
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+	for (byte y = 0; y < height; y++) {
+		for (int8 plane = 3; plane >= 0; plane--) { // The planes are in the opposite way.
 			for (uint16 x = 0; x < width; x += 8) {
 				byte pixel = file.readByte();
 				for (byte bit = 0; bit < 8; bit++) {
@@ -239,7 +238,8 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 						*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
 				} 
 			}
-		
+		}
+	}
 	return picture;
 }
 
@@ -251,8 +251,8 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	::Graphics::Surface picture;
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
-	for (byte plane = 0; plane < 4; plane++)
-		for (uint16 y = 0; y < height; y++)
+	for (byte plane = 0; plane < 4; plane++) {
+		for (uint16 y = 0; y < height; y++) {
 			for (uint16 x = 0; x < width; x += 8) {
 				byte pixel = file.readByte();
 				for (byte i = 0; i < 8; i++) {
@@ -260,22 +260,26 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
 				}	
 			}
+		}
+	}
 
 	return picture;
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the spirte blank.
-	for (byte j = 0; j < sprite._yLength; j++)
-		for (byte i = 0; i < sprite._xLength; i++)
+	for (byte j = 0; j < sprite._yLength; j++) {
+		for (byte i = 0; i < sprite._xLength; i++) {
 			if (((*sprite._sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
 				*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
+		}
+	}
 
 	// Then we draw the picture to the blank places.
 	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
 
-	for (byte j = 0; j < sprite._yLength; j++)
-		for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way.
+	for (byte j = 0; j < sprite._yLength; j++) {
+		for (int8 plane = 3; plane >= 0; plane--) { // The planes are in the opposite way.
 			for (uint16 i = 0; i  < sprite._xLength; i += 8) {
 				byte pixel = (*sprite._mani[picnum])[maniPos++];
 				for (byte bit = 0; bit < 8; bit++) {
@@ -283,22 +287,27 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
 				} 
 			}
+		}
+	}
 }
 
 void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
-	for (uint16 y = 0; y < picture.h; y++)
-		for (uint16 x = 0; x < picture.w; x++)
-			*(byte *)target.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);		
+	for (uint16 y = 0; y < picture.h; y++) {
+		for (uint16 x = 0; x < picture.w; x++) {
+			*(byte *)target.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);
+		}
+	}
 }
 
 void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
-	for (uint16 y = 0; y < _screen.h / 2; y++)
-		for (uint16 x = 0; x < _screen.w; x++)
+	for (uint16 y = 0; y < _screen.h / 2; y++) {
+		for (uint16 x = 0; x < _screen.w; x++) {
 			for (byte j = 0; j < 2; j++) 
 				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
-
+		}
+	}
 	// Now we copy the stretched picture to the screen.
 	g_system->copyRectToScreen(_screen.pixels, _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
 	g_system->updateScreen();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 425cab0..81dc458 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1336,20 +1336,18 @@ void Lucerna::major_redraw() {
 }
 
 uint16 Lucerna::bearing(byte whichped) {
-	whichped--; // Different array indexes in Pascal and C.
+	byte pedId = whichped - 1; // Different array indexes in Pascal and C.
 
 	const double rad2deg = 180 / 3.14; // Pi
 		
-	if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[whichped]._x)
+	if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[pedId]._x)
 		return 0;
-	else {
-		if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[whichped]._x) {
-			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[whichped]._y))
-					/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[whichped]._x)) * rad2deg) + 90;
-		} else {
-			return (atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[whichped]._y))
-					/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[whichped]._x)) * rad2deg) + 270;
-		}
+	else if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[pedId]._x) {
+		return (uint16)((atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
+	} else {
+		return (uint16)((atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
 	}
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1392454..531794c 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -588,7 +588,7 @@ Common::String Scrolls::lsd() {
 		else
 			x = x + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	} else // L, s & d
-		x = Common::String('œ') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
+		x = Common::String('\x9C') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
 			+ '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	if (_vm->_gyro->_dna._money > 12)
 		x = x + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";


Commit: e34076739532a808a98afe15ee30f09841b3283f
    https://github.com/scummvm/scummvm/commit/e34076739532a808a98afe15ee30f09841b3283f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-06T15:32:08-07:00

Commit Message:
AVALANCHE: Move some static arrays to function bodies

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1661ad2..64c2d67 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1529,7 +1529,7 @@ void Acci::doThat() {
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
 			+ "The medi\x91val descendant of" + _vm->_scrolls->kControlNewLine
 			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright \XEF "
+			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright \xEF "
 			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
 		_vm->_scrolls->display(toDisplay);
 		_vm->_scrolls->aboutscroll = false;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c0876f3..326713e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -63,19 +63,6 @@ const MouseHotspotType Gyro::kMouseHotSpots[9] = {
 	{0,0} // 9 - question mark
 };
 
-const Common::String Gyro::kLads[17] = {
-	"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
-	"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
-	"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
-};
-
-const Common::String Gyro::kLasses[4] =
-{"Arkata", "Geida", "\0xB1", "the Wise Woman"};
-
-const char Gyro::kLadChar[] = "ASCDMTRwLfgeIyPu";
-
-const char Gyro::kLassChar[] = "kG\0xB1o";
-
 // Art gallery at 2,1; notice about this at 2,2.
 const int32 Gyro::kCatacombMap[8][8] = {
 	// Geida's room
@@ -188,21 +175,6 @@ byte Gyro::_whereIs[29] = {
 	r__wisewomans  // The Wise Woman.
 };
 
-const Common::String Gyro::kThings[kObjectNum] = {
-	"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
-	"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
-	"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
-};
-
-const char Gyro::kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
-
-const Common::String Gyro::kItems[kObjectNum] = {
-	"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
-	"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
-	"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
-	"an onion"
-};
-
 const char Gyro::kItemsChar[] = "WMBParCLguKeSnIohn";
 
 Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
@@ -354,6 +326,16 @@ bool Gyro::updateMoney(uint16 howmuchby) {
 // There'll may be problems with calling these functions because of the conversion of the arrays!!!
 // Keep an eye open!
 Common::String Gyro::getName(byte whose) { 
+	static const Common::String kLads[17] = {
+		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
+		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
+		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+	};
+
+	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
+
+	assert((whose > 150) && (whose < 179));
+
 	if (whose < 175)
 		return kLads[whose - 150];
 	else
@@ -362,6 +344,11 @@ Common::String Gyro::getName(byte whose) {
 
 // Keep an eye open! ^
 byte Gyro::getNameChar(byte whose) {
+	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
+	static const char kLassChar[] = "kG\0xB1o";
+
+	assert((whose > 150) && (whose < 179));
+
 	if (whose < 175) 
 		return kLadChar[whose - 150];
 	else
@@ -370,6 +357,12 @@ byte Gyro::getNameChar(byte whose) {
 
 // Keep an eye open! ^^
 Common::String Gyro::getThing(byte which) {
+	static const Common::String kThings[kObjectNum] = {
+		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+	};
+
 	Common::String get_thing_result;
 	switch (which) {
 	case kObjectWine:
@@ -397,6 +390,8 @@ Common::String Gyro::getThing(byte which) {
 
 // Keep an eye open! ^^^
 char Gyro::getThingChar(byte which) {
+	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+
 	char get_thingchar_result;
 	switch (which) {
 	case kObjectWine:
@@ -413,6 +408,13 @@ char Gyro::getThingChar(byte which) {
 
 // Keep an eye open! ^^^^
 Common::String Gyro::getItem(byte which) {
+	static const Common::String kItems[kObjectNum] = {
+		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
+		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
+		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
+		"an onion"
+	};
+
 	Common::String get_better_result;
 	if (which > 150)
 		which -= 149;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 89346d7..0dd9078 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -294,14 +294,6 @@ public:
 
 	static const MouseHotspotType kMouseHotSpots[9];
 
-	static const Common::String kLads[17];
-
-	static const Common::String kLasses[4];
-
-	static const char kLadChar[];
-
-	static const char kLassChar[];
-
 	static const int16 kMaxSprites = 2; // Current max no. of sprites.
 
 	// For Thinkabout:
@@ -498,14 +490,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 	
-	static const Common::String kThings[kObjectNum];
-
-	static const char kThingsChar[];
-
-	static const Common::String kItems[kObjectNum]; // 'better' in the original.
-
 	static const char kItemsChar[]; // Similar as above.
-
 	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 


Commit: c537d2f1e5c96e29622d7c9ae272c2a9e7b8a1a8
    https://github.com/scummvm/scummvm/commit/c537d2f1e5c96e29622d7c9ae272c2a9e7b8a1a8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-06T15:34:38-07:00

Commit Message:
AVALANCHE: Comment out some dead code

Changed paths:
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 326713e..398e4a8 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -175,7 +175,8 @@ byte Gyro::_whereIs[29] = {
 	r__wisewomans  // The Wise Woman.
 };
 
-const char Gyro::kItemsChar[] = "WMBParCLguKeSnIohn";
+// CHECKME: Useless?
+// const char Gyro::kItemsChar[] = "WMBParCLguKeSnIohn";
 
 Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	_vm = vm;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 0dd9078..75dc50c 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -490,7 +490,8 @@ public:
 private:
 	AvalancheEngine *_vm;
 	
-	static const char kItemsChar[]; // Similar as above.
+	// CHECKME: Useless?
+	// static const char kItemsChar[];
 	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 


Commit: 73afd0d8e1771110a6e7b3744acacd00fc6ca1b6
    https://github.com/scummvm/scummvm/commit/73afd0d8e1771110a6e7b3744acacd00fc6ca1b6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-06T15:41:39-07:00

Commit Message:
AVALANCHE: Fix some more warnings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 64c2d67..2df42e4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -192,17 +192,6 @@ const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
 	{255, "THIS"},      {255, "SENTINEL"} // for "Ken SENT Me"
 };        
 
-const char Acci::kWhat[] = "That's not possible!";
-
-const Acci::RankType Acci::kRanks[9] = {
-	{0, "Beginner"},     {10, "Novice"},
-	{20, "Improving"},   {35, "Not bad"},
-	{50, "Passable"},    {65, "Good"},
-	{80, "Experienced"}, {108, "The BEST!"},
-	{32767, "copyright'93"}
-};
-
-
 Acci::Acci(AvalancheEngine *vm) {
 	_vm = vm;
 }
@@ -251,6 +240,14 @@ void Acci::replace(Common::String oldChars, byte newChar) {
 }
 
 Common::String Acci::rank() {
+	static const RankType kRanks[9] = {
+		{0, "Beginner"},     {10, "Novice"},
+		{20, "Improving"},   {35, "Not bad"},
+		{50, "Passable"},    {65, "Good"},
+		{80, "Experienced"}, {108, "The BEST!"},
+		{32767, "copyright'93"}
+	};
+
 	for (byte i = 0; i < 8; i++) {
 		if ((_vm->_gyro->_dna._score >= kRanks[i]._score) && (_vm->_gyro->_dna._score < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
@@ -1304,7 +1301,8 @@ void Acci::heyThanks() {
  * @remarks	Originally called 'do_that'
  */
 void Acci::doThat() {
-	const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	static const char kWhat[] = "That's not possible!";
 
 	if (_thats == Common::String(kNothing))  {
 		if (!_thats.empty())
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 2f03663..9004fc6 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -82,9 +82,6 @@ private:
 		Common::String _title;
 	};
 
-	static const RankType kRanks[9];
-	static const char kWhat[];
-
 	Common::String _thats;
 	Common::String _unknown;
 


Commit: 7be84e9d52cb90bd14a84926bbad34da707ea5d6
    https://github.com/scummvm/scummvm/commit/7be84e9d52cb90bd14a84926bbad34da707ea5d6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-06T16:26:28-07:00

Commit Message:
AVALANCHE: Fix some more Clang warnings

Changed paths:
    engines/avalanche/trip6.h



diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 4deebbc..655adae 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -235,9 +235,9 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	ByteField r;
-
-	int16 beforex, beforey;
+	// CHECKME: Useless?
+	// ByteField r;
+	// int16 beforex, beforey;
 
 	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
 


Commit: e859e17e3b7753fdae839cd78f04a9370b85bb40
    https://github.com/scummvm/scummvm/commit/e859e17e3b7753fdae839cd78f04a9370b85bb40
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T00:00:34-07:00

Commit Message:
AVALANCHE: Janitorial - Remove trailing spaces, fix define names

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/celer2.cpp
    engines/avalanche/celer2.h
    engines/avalanche/closing2.h
    engines/avalanche/color.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/dropdown2.h
    engines/avalanche/enid2.cpp
    engines/avalanche/enid2.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/pingo2.h
    engines/avalanche/roomnums.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2df42e4..882fc3d 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -190,7 +190,7 @@ const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
 	{255, "SOME"},      {255, "AND"},       {255, "THAT"},
 	{255, "POCUS"},     {255, "HIS"},
 	{255, "THIS"},      {255, "SENTINEL"} // for "Ken SENT Me"
-};        
+};
 
 Acci::Acci(AvalancheEngine *vm) {
 	_vm = vm;
@@ -210,7 +210,7 @@ void Acci::clearWords() {
 byte Acci::wordNum(Common::String word) {
 	if (word.empty())
 		return 0;
-	
+
 	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
 		if (kVocabulary[i]._word == word)
 			return kVocabulary[i]._number;
@@ -258,7 +258,7 @@ Common::String Acci::rank() {
 
 Common::String Acci::totalTime() {
 	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	const double ticksInOneSec = (double)(65535) / 3600; 
+	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
 	h = _vm->_gyro->_dna._totalTime / ticksInOneSec; // No. of seconds.
@@ -302,7 +302,7 @@ void Acci::stripPunctuation(Common::String &word) {
 
 
 
-void Acci::displayWhat(byte target, bool animate, bool &ambiguous) { 
+void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 	if (target == kPardon) {
 		ambiguous = true;
 		if (animate)
@@ -314,7 +314,7 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getName(target) + " }");
 		else {
 			Common::String z = _vm->_gyro->getItem(target);
-			if (z != "") 
+			if (z != "")
 				_vm->_scrolls->display(Common::String("{ ") + z + " }");
 		}
 	}
@@ -357,7 +357,7 @@ void Acci::properNouns() {
 		if (_vm->_parser->_inputText[i] == ' ')
 			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
 	}
-	
+
 	// And the first character as well.
 	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
 }
@@ -365,7 +365,7 @@ void Acci::properNouns() {
 void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
-	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x 
+	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x
 		+ '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2');
 }
 
@@ -378,7 +378,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		_vm->_parser->_inputText.deleteChar(0);
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
-	
+
 	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
@@ -428,7 +428,7 @@ void Acci::parse() {
 	// First parsing - word identification
 	if (!_thats.empty())
 		_thats.clear();
-	
+
 	byte n = 0;
 	_polite = false;
 	_verb = kPardon;
@@ -512,7 +512,7 @@ void Acci::parse() {
 		}
 	}
 
-	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1) 
+	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1)
 		_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
 	else if (!_unknown.empty())
 		_unknown.clear();
@@ -521,7 +521,7 @@ void Acci::parse() {
 	replace(Common::String('\xFF'), 0); // zap noise words
 	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
 	replace(Common::String('\xD')  + '\xE4', 1); // "look in" = "examine"
-	replace(Common::String('\x4')  + '\xE6', 17); // "get up" = "stand" 
+	replace(Common::String('\x4')  + '\xE6', 17); // "get up" = "stand"
 	replace(Common::String('\x4')  + '\xE7', 17); // "get down" = "stand"... well, why not?
 	replace(Common::String('\x12') + '\xE4', 2); // "go in" = "open [door]"
 	replace(Common::String('\x1C') + '\xE5', 253); // "P' off" is a swear word
@@ -538,14 +538,14 @@ void Acci::parse() {
 	switch (_vm->_gyro->_dna._room) {
 	case r__aylesoffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
-		break;       
+		break;
 	case r__musicroom:
 		replace(Common::String('\xCB'), 166); // Monk = Jacques
-		break;          
+		break;
 	default:
 		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
 	}
-	
+
 	if (doPronouns()) {
 		_vm->_gyro->_weirdWord = true;
 		_thats = kNothing;
@@ -556,7 +556,7 @@ void Acci::parse() {
 	if (!_vm->_gyro->_subject.empty())
 		_vm->_gyro->_subject.clear();
 	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
-	
+
 	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
 		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
 			_vm->_gyro->_subjectNum = (byte)_thats[i];
@@ -618,7 +618,7 @@ void Acci::parse() {
 	}
 }
 
-void Acci::examineObject() {   
+void Acci::examineObject() {
 	if (_thing != _vm->_gyro->_thinks)
 		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing);
 	switch (_thing) {
@@ -626,7 +626,7 @@ void Acci::examineObject() {
 		switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_visa->dixi('t', 1); // Normal examine wine scroll
-			break; 
+			break;
 		case 2:
 			_vm->_visa->dixi('d', 6); // Bad wine
 			break;
@@ -640,7 +640,7 @@ void Acci::examineObject() {
 			_vm->_visa->dixi('q', 21); // Yucky onion.
 		else
 			_vm->_visa->dixi('t', 18);  // Normal onion scroll
-		break;       
+		break;
 	default:
 		_vm->_visa->dixi('t', _thing); // <<< Ordinarily
 	}
@@ -680,8 +680,8 @@ void Acci::exampers() {
 		}
 		// Otherwise...
 		_vm->_visa->dixi('p', _person);
-	} 
-	
+	}
+
 	// And afterwards...
 	if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake))
 		_vm->_visa->dixi('Q', 13);
@@ -697,7 +697,7 @@ bool Acci::holding() {
 		_vm->_scrolls->display("Be reasonable!");
 	else if (!_vm->_gyro->_dna._objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_scrolls->display("You're not holding it, Avvy.");
-	else 
+	else
 		holdingResult = true;
 
 	return holdingResult;
@@ -821,7 +821,7 @@ void Acci::swallow() {   // Eat something.
 
 void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
-	
+
 	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room)
 			numPeople++;
@@ -878,13 +878,13 @@ void Acci::lookAround() {
 		switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) {
 		case 258 :
 			_vm->_visa->dixi('q', 80); // Inside art gallery.
-			break; 
+			break;
 		case 514 :
 			_vm->_visa->dixi('q', 81); // Outside ditto.
 			break;
 		case 260 :
 			_vm->_visa->dixi('q', 82); // Outside Geida's room.
-			break; 
+			break;
 		}
 		break;
 	default:
@@ -892,9 +892,9 @@ void Acci::lookAround() {
 	}
 }
 
-void Acci::openDoor() { 
+void Acci::openDoor() {
 	// Special cases.
-	switch (_vm->_gyro->_dna._room) {   
+	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
 		if (_vm->_trip->infield(2)) {
 			// Opening the box.
@@ -925,7 +925,7 @@ void Acci::openDoor() {
 				_vm->_visa->dixi('x', _vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicTransport:
-				_vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte 
+				_vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
 					                 (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte
 									 );
 				break;
@@ -940,7 +940,7 @@ void Acci::openDoor() {
 				_vm->_trip->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
 				break;
 			}
-			
+
 			return;
 		}
 	}
@@ -1049,7 +1049,7 @@ void Acci::goToCauldron() {
  * Check is it's possible to give something to Spludwick
  * @remarks	Originally called 'give2spludwick'
  */
-bool Acci::giveToSpludwick() { 
+bool Acci::giveToSpludwick() {
 	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) {
 		notInOrder();
 		return false;
@@ -1468,7 +1468,7 @@ void Acci::doThat() {
 								winSequence();
 							else
 								_vm->_visa->dixi('q', 77); // That Geida woman!
-							break;            
+							break;
 						default:
 							heyThanks();
 						}
@@ -1620,7 +1620,7 @@ void Acci::doThat() {
 					_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
 						+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
 				}
-				break; 
+				break;
 			case r__musicroom:
 				playHarp();
 				break;
@@ -1801,7 +1801,7 @@ void Acci::doThat() {
 				}
 			} else
 				_vm->_visa->dixi('D', 5); // Go to the bar!
-			break;                
+			break;
 
 		case r__outsideducks:
 			if (_vm->_trip->infield(6)) {
@@ -1832,7 +1832,7 @@ void Acci::doThat() {
 
 		case r__nottspub:
 			_vm->_visa->dixi('n', 15); // Can't sell to southerners.
-			break; 
+			break;
 		default:
 			_vm->_visa->dixi('D', 0); // Can't buy that.
 		}
@@ -1972,7 +1972,7 @@ void Acci::doThat() {
 					_vm->_scrolls->display("You can't seem to wake him by yourself.");
 				break;
 			case Gyro::kPeopleJacques:
-				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' + 
+				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' +
 					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
 			default:
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 9004fc6..ed44a75 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -27,8 +27,8 @@
 
 /* ACCIDENCE II		The parser. */
 
-#ifndef ACCI2_H
-#define ACCI2_H
+#ifndef AVALANCHE_ACCI2_H
+#define AVALANCHE_ACCI2_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -132,4 +132,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // ACCI2_H
+#endif // AVALANCHE_ACCI2_H
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9347b77..9fd802d 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -51,7 +51,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	_console = new AvalancheConsole(this);
 
 	_rnd = new Common::RandomSource("avalanche");
-	_rnd->setSeed(42);     
+	_rnd->setSeed(42);
 }
 
 AvalancheEngine::~AvalancheEngine() {
@@ -238,7 +238,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 			_gyro->_dna._spareEvening += actChr;
 		}
 	}
-	
+
 	sz.syncAsSint32LE(_gyro->_dna._totalTime);
 	sz.syncAsByte(_gyro->_dna._jumpStatus);
 	sz.syncAsByte(_gyro->_dna._mushroomGrowing);
@@ -288,7 +288,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		}
 	}
 	sz.syncAsByte(spriteNum);
-	
+
 	if (sz.isLoading()) {
 		for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites.
 			if (_trip->tr[i].quick)
@@ -299,8 +299,8 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	for (byte i = 0; i < spriteNum; i++) {
 		sz.syncAsByte(_trip->tr[i].whichsprite);
 		sz.syncAsByte(_trip->tr[i].check_me);
-		
-	
+
+
 		if (sz.isLoading()) {
 			_trip->tr[i].quick = true;
 			_trip->tr[i].init(_trip->tr[i].whichsprite, _trip->tr[i].check_me, _trip);
@@ -379,7 +379,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 	Common::Serializer sz(NULL, f);
 
 	synchronize(sz);
-	
+
 	f->finalize();
 
 	delete f;
@@ -465,7 +465,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_dropdown->setupMenu();
 
 	_gyro->_whereIs[0] = _gyro->_dna._room;
-	
+
 	_gyro->_alive = true;
 
 	_lucerna->objectlist();
@@ -478,7 +478,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_trip->trippancy_link();
 
 	_celer->updateBackgroundSprites();
-	
+
 	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
 		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
@@ -618,14 +618,14 @@ Common::String AvalancheEngine::elmToStr(Elm how) {
 }
 
 void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
-	warning("STUB: run(%s)", what.c_str()); 
+	warning("STUB: run(%s)", what.c_str());
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 }
 
 void AvalancheEngine::getArguments() {
 	// This function should mess around with command line arguments,
 	// but I am not sure if there'll be use of these arguments at all...
-	warning("STUB: getArguments()"); 
+	warning("STUB: getArguments()");
 }
 
 void AvalancheEngine::getSlope() {
@@ -646,7 +646,7 @@ void AvalancheEngine::dosShell() {
 }
 
 // Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
-bool AvalancheEngine::keyPressed() {	
+bool AvalancheEngine::keyPressed() {
 	warning("STUB: keyPressed()");
 	return false;
 }
@@ -663,7 +663,7 @@ void AvalancheEngine::demo() {
 
 
 
-	
+
 void AvalancheEngine::runAvalot() {
 	bFlightOn();
 
@@ -681,7 +681,7 @@ Common::Error AvalancheEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-	
+
 
 	// From bootstrp:
 
@@ -690,7 +690,7 @@ Common::Error AvalancheEngine::run() {
 	getArguments();
 	getSlope();
 
-	_zoomy = true; 
+	_zoomy = true;
 	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
 	// because zoomy's value is given there. Not sure yet what "zoomy" stands for.
 	if (!_zoomy)
@@ -702,7 +702,7 @@ Common::Error AvalancheEngine::run() {
 		runAvalot();
 
 		// Needed for later implementation!!! Don't remove these comments!!!
-		
+
 		//if (dosexitcode != 77)  quit(); // Didn't stop for us.
 
 		//switch (_storage._operation) {
@@ -727,6 +727,6 @@ Common::Error AvalancheEngine::run() {
 	return Common::kNoError;
 }
 
-	
+
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 839618d..639f4cc 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#ifndef AVALANCHE_H
-#define AVALANCHE_H
+#ifndef AVALANCHE_AVALANCHE_H
+#define AVALANCHE_AVALANCHE_H
 
 #include "avalanche/console.h"
 
@@ -90,11 +90,11 @@ public:
 	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
 	~AvalancheEngine();
 
-	Common::ErrorCode initialize(); 
+	Common::ErrorCode initialize();
 	GUI::Debugger *getDebugger();
 
 	Common::RandomSource *_rnd;
-	
+
 	const AvalancheGameDescription *_gameDescription;
 	uint32 getFeatures() const;
 	const char *getGameId() const;
@@ -172,4 +172,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // AVALANCHE_H
+#endif // AVALANCHE_AVALANCHE_H
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3d3a7a0..a84d67a 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -61,9 +61,9 @@ Avalot::Avalot(AvalancheEngine *vm) {
 void Avalot::handleKeyDown(Common::Event &event) {
 	//if (keyboardclick)
 	//	click();
-	//	
+	//
 	// To be implemented later with the sounds, I assume.
-	
+
 
 	if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15))
 		_vm->_parser->handleFunctionKey(event);
@@ -169,7 +169,7 @@ void Avalot::setup() {
 
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
-	if (loadSlot >= 0) {	
+	if (loadSlot >= 0) {
 		_vm->_gyro->_thinks = 2; // You always have money.
 		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
 
@@ -182,8 +182,8 @@ void Avalot::setup() {
 		_vm->_lucerna->fxtoggle();
 		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
 
-		_vm->_visa->dixi('q', 83); // Info on the game, etc. 
-	}	
+		_vm->_visa->dixi('q', 83); // Info on the game, etc.
+	}
 }
 
 
@@ -211,7 +211,7 @@ void Avalot::run(Common::String arg) {
 
 #ifdef DEBUG
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->_lineNum; i++) 
+		for (byte i = 0; i < _vm->_gyro->_lineNum; i++)
 			_vm->_graphics->_surface.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i].col);
 
 		for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 00f2edc..34a9d9f 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -27,8 +27,8 @@
 
 /* AVALOT		The kernel of the program. */
 
-#ifndef AVALOT_H
-#define AVALOT_H
+#ifndef AVALANCHE_AVALOT_H
+#define AVALANCHE_AVALOT_H
 
 #include "common/events.h"
 #include "common/system.h"
@@ -50,4 +50,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // AVALOT_H
+#endif // AVALANCHE_AVALOT_H
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index cd56ead..8e1b13a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -83,16 +83,16 @@ void Celer::updateBackgroundSprites() {
 			case 11:
 			case 21:
 				drawBackgroundSprite(-1, -1, 12); // Looks forwards.
-				break; 
+				break;
 			case 8:
 			case 18:
 			case 28:
 			case 32:
 				drawBackgroundSprite(-1, -1, 11); // Looks at you.
-				break; 
+				break;
 			case 30:
 				drawBackgroundSprite(-1, -1, 13); // Winks.
-				break; 
+				break;
 			case 33:
 				_vm->_gyro->_dna._malagauche = 0;
 				break;
@@ -103,7 +103,7 @@ void Celer::updateBackgroundSprites() {
 		case 179:
 		case 197:
 			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
-			break; 
+			break;
 		case 182:
 		case 194:
 			drawBackgroundSprite(-1, -1, 6);
@@ -113,7 +113,7 @@ void Celer::updateBackgroundSprites() {
 			break;
 		case 199:
 			_vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this.
-			break; 
+			break;
 		}
 
 		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
@@ -177,7 +177,7 @@ void Celer::updateBackgroundSprites() {
 				break;
 			case 1:
 				drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural.
-				break; 
+				break;
 			}
 		}
 		break;
@@ -186,10 +186,10 @@ void Celer::updateBackgroundSprites() {
 			switch (_vm->_gyro->_roomTime % 54) {
 			case 20:
 				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
-				break; 
+				break;
 			case 23:
 				drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal.
-				break; 
+				break;
 			}
 		}
 		break;
@@ -215,7 +215,7 @@ void Celer::updateBackgroundSprites() {
 		switch (_vm->_gyro->_roomTime % 50) {
 		case 45 :
 			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
-			break; 
+			break;
 		case 49 :
 			drawBackgroundSprite(-1, -1, 10);
 			break;
@@ -279,7 +279,7 @@ void Celer::loadBackgroundSprites(byte number) {
 
 	for (byte i = 0; i < _spriteNum; i++) {
 		f.seek(_offsets[i]);
-		
+
 		SpriteType sprite;
 		sprite._type = PictureType(f.readByte());
 		sprite._x = f.readSint16LE();
@@ -289,7 +289,7 @@ void Celer::loadBackgroundSprites(byte number) {
 		sprite._size = f.readSint32LE();
 		bool natural = f.readByte();
 		bool memorize = f.readByte();
-				
+
 		if (memorize) {
 			_sprites[i]._x = sprite._x;
 			_sprites[i]._xl = sprite._xl;
@@ -299,7 +299,7 @@ void Celer::loadBackgroundSprites(byte number) {
 
 			if (natural) {
 				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
-				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1; 
+				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
 				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
 
 				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
index 674f6e1..47a11bf 100644
--- a/engines/avalanche/celer2.h
+++ b/engines/avalanche/celer2.h
@@ -27,8 +27,8 @@
 
 /* CELER	The unit for updating the screen pics. */
 
-#ifndef CELER2_H
-#define CELER2_H
+#ifndef AVALANCHE_CELER2_H
+#define AVALANCHE_CELER2_H
 
 #include "common/scummsys.h"
 #include "common/file.h"
@@ -78,4 +78,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // CELER2_H
+#endif // AVALANCHE_CELER2_H
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
index 89e2d73..e1bf8b2 100644
--- a/engines/avalanche/closing2.h
+++ b/engines/avalanche/closing2.h
@@ -27,8 +27,8 @@
 
 /* CLOSING		The closing screen and error handler. */
 
-#ifndef CLOSING2_H
-#define CLOSING2_H
+#ifndef AVALANCHE_CLOSING2_H
+#define AVALANCHE_CLOSING2_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -68,4 +68,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // CLOSING2_H
+#endif // AVALANCHE_CLOSING2_H
diff --git a/engines/avalanche/color.h b/engines/avalanche/color.h
index c0c348f..e9f9c46 100644
--- a/engines/avalanche/color.h
+++ b/engines/avalanche/color.h
@@ -27,8 +27,8 @@
 
 // Color constants replacing the colors from the CRT unit of Pascal
 
-#ifndef COLOR_H
-#define COLOR_H
+#ifndef AVALANCHE_COLOR_H
+#define AVALANCHE_COLOR_H
 
 #include "common/system.h"
 
@@ -55,4 +55,4 @@ enum Color {
 
 } // End of namespace Avalanche
 
-#endif // COLOR_H
+#endif // AVALANCHE_COLOR_H
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 10cefa1..1d3a023 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -54,7 +54,7 @@ void HeadType::init(char trig, char altTrig, Common::String title, byte pos, Dro
 }
 
 void HeadType::draw() {
-	CursorMan.showMouse(false); 
+	CursorMan.showMouse(false);
 	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
 	CursorMan.showMouse(true);
 }
@@ -67,17 +67,17 @@ void HeadType::highlight() {
 	warning("STUB: Dropdown::headytpe::highlight()");
 
 	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
-	
+
 	_dr->_activeMenuItem._left = _xpos;
 	_dr->_activeMenuItem._activeNow = true;
 	_dr->_vm->_gyro->_dropdownActive = true;
 	_dr->_activeMenuItem._activeNum = _position;
-	
+
 	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
 }
 
 bool HeadType::parseAltTrigger(char key) {
-	if (key != _altTrigger)  
+	if (key != _altTrigger)
 		return true;
 	return false;
 }
@@ -118,7 +118,7 @@ void MenuItem::displayOption(byte y, bool highlit) {
 	else
 		backgroundColor = 7;
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
-	
+
 	Common::String text = _options[y]._title;
 	while (text.size() + _options[y]._shortcut.size() < _width)
 		text += ' '; // Pad _options[y] with spaces.
@@ -146,7 +146,7 @@ void MenuItem::display() {
 	displayOption(0, true);
 	for (byte y = 1; y < _optionNum; y++)
 		displayOption(y, false);
-	
+
 	_dr->_vm->_gyro->_defaultLed = 1;
 	_dr->_vm->_gyro->_currentMouse = 177;
 	//mousepage(cp);
@@ -155,8 +155,8 @@ void MenuItem::display() {
 
 void MenuItem::wipe() {
 	//setactivepage(cp);
-	CursorMan.showMouse(false); 
-	
+	CursorMan.showMouse(false);
+
 	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
 
 	_activeNow = false;
@@ -164,7 +164,7 @@ void MenuItem::wipe() {
 	_firstlix = false;
 	_dr->_vm->_gyro->_defaultLed = 2;
 
-	CursorMan.showMouse(true); 
+	CursorMan.showMouse(true);
 }
 
 void MenuItem::moveHighlight(int8 inc) {
@@ -176,15 +176,15 @@ void MenuItem::moveHighlight(int8 inc) {
 		_highlightNum = highlightNum;
 	}
 	//setactivepage(cp);
-	CursorMan.showMouse(false); 
+	CursorMan.showMouse(false);
 	displayOption(_oldY, false);
 	displayOption(_highlightNum, true);
 	//setactivepage(1 - cp);
 	_oldY = _highlightNum;
-	CursorMan.showMouse(true); 
+	CursorMan.showMouse(true);
 }
 
-void MenuItem::lightUp(Common::Point cursorPos) { 
+void MenuItem::lightUp(Common::Point cursorPos) {
 	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
 		return;
 	_highlightNum = (cursorPos.y - 26) / 20;
@@ -193,7 +193,7 @@ void MenuItem::lightUp(Common::Point cursorPos) {
 	moveHighlight(0);
 }
 
-void MenuItem::select(byte which) {    
+void MenuItem::select(byte which) {
 	if (!_options[which]._valid)
 		return;
 
@@ -235,7 +235,7 @@ void MenuBar::draw() {
 	const ByteField menuspace = {0, 0, 80, 9};
 
 	//setactivepage(3);
-	
+
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
 	byte savecp = _dr->_vm->_gyro->_cp;
@@ -343,7 +343,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 	}
 
 	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
-	
+
 	// Underline the selected character.
 	if (!text.contains(trigger))
 		return;
@@ -351,7 +351,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 		byte i;
 		for (i = 0; text[i] != trigger; i++)
 			; // Search for the character in the string.
-	
+
 		byte pixel = ander;
 		for (byte bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
@@ -508,7 +508,7 @@ void Dropdown::setupMenuWith() {
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
-		
+
 		if ((_vm->_gyro->_lastPerson == _vm->_gyro->kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
 			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
@@ -680,25 +680,25 @@ void Dropdown::runMenuWith() {
 			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
-		break; 
+		break;
 		case 103: { // Cider
 			_vm->_acci->_thing = 103;
 			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
-		break; 
+		break;
 		case 104: { // Mead
 			_vm->_acci->_thing = 107;
 			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
-		break; 
+		break;
 		case 105: { // Onion (trader)
 			_vm->_acci->_thing = 67;
 			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
 			return;
 		}
-		break; 
+		break;
 		default: {
 			_vm->_acci->_person = _vm->_acci->_thing;
 			_vm->_acci->_thing = 254;
@@ -709,7 +709,7 @@ void Dropdown::runMenuWith() {
 	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
 }
 
-void Dropdown::setupMenu() {   
+void Dropdown::setupMenu() {
 	_menuBar.init(this);
 	_activeMenuItem.init(this);
 
@@ -730,13 +730,13 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 
 	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) {
 		_menuBar.chooseMenuItem(cursorPos.x);
-		do 
+		do
 			_vm->updateEvents();
 		while (_vm->_lucerna->holdLeftMouse);
-	
+
 
 		while (!_vm->shouldQuit()) {
-			do { 
+			do {
 				_vm->updateEvents();
 
 				// We updadte the cursor's picture.
@@ -768,14 +768,14 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 								backup.free();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
-						} 
+						}
 				} else {
 					// Clicked on menu bar.
 					if (_activeMenuItem._activeNow) {
 						_activeMenuItem.wipe();
 						_vm->_graphics->_surface.copyFrom(backup);
 						_vm->_graphics->refreshScreen();
-						
+
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
 							_vm->_lucerna->holdLeftMouse = false;
@@ -787,7 +787,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 						}
 					}
 				}
-	
+
 				// NOT clicked button...
 				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
 					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) {
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
index 4122d3f..95e258e 100644
--- a/engines/avalanche/dropdown2.h
+++ b/engines/avalanche/dropdown2.h
@@ -27,8 +27,8 @@
 
 /* DROPDOWN	A customised version of Oopmenu (qv). */
 
-#ifndef DROPDOWN2_H
-#define DROPDOWN2_H
+#ifndef AVALANCHE_DROPDOWN2_H
+#define AVALANCHE_DROPDOWN2_H
 
 #include "avalanche/color.h"
 
@@ -164,4 +164,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // DROPDOWN2_H
+#endif // AVALANCHE_DROPDOWN2_H
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index a22a205..7cf4075 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -77,7 +77,7 @@ void Enid::expandMonthName(Common::String x) {
 Common::String Enid::expandDate(byte d, byte m, uint16 y) {
 	const Common::String months[12] = {
 		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
-		"Septem*", "Octo*", "Novem*", "Decem*"		
+		"Septem*", "Octo*", "Novem*", "Decem*"
 	};
 
 	Common::String expanddate_result;
@@ -162,11 +162,11 @@ void Enid::showHeader() {
 	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
 }
 
-void Enid::avvyBackground() {    
+void Enid::avvyBackground() {
 	// Not really a filing procedure,
 	// but it's only called just before edna_load, so I thought I'd put it
 	// in Enid instead of, say, Lucerna.
-	
+
 #if 0
 	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }
 
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
index 1cf14d1..97e249e 100644
--- a/engines/avalanche/enid2.h
+++ b/engines/avalanche/enid2.h
@@ -27,8 +27,8 @@
 
 /* ENID		Edna's manager. Loads/saves files. */
 
-#ifndef ENID2_H
-#define ENID2_H
+#ifndef AVALANCHE_ENID2_H
+#define AVALANCHE_ENID2_H
 
 #include "common/scummsys.h"
 
@@ -75,4 +75,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // ENID2_H
+#endif // AVALANCHE_ENID2_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index df31050..6058b00 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -102,25 +102,25 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	stAngle = stAngle % 361;
 	endAngle = endAngle % 361;
 
-	// If impossible angles, then swap them! 
+	// If impossible angles, then swap them!
 	if (endAngle < stAngle) {
 		uint16 tmpAngle=endAngle;
 		endAngle=stAngle;
 		stAngle=tmpAngle;
 	}
 
-	// Approximate the number of pixels required by using the circumference equation of an ellipse.                                              
+	// Approximate the number of pixels required by using the circumference equation of an ellipse.
 	uint16 numOfPixels = (uint16)floor(sqrt(3.0) * sqrt(pow(double(xRadius), 2) + pow(double(yRadius), 2)) + 0.5);
 
 	// Calculate the angle precision required.
 	double delta = 90.0 / numOfPixels;
 
-	// Always just go over the first 90 degrees. Could be optimized a   
-	// bit if startAngle and endAngle lie in the same quadrant, left as an 
-	// exercise for the reader. :)                             
+	// Always just go over the first 90 degrees. Could be optimized a
+	// bit if startAngle and endAngle lie in the same quadrant, left as an
+	// exercise for the reader. :)
 	double j = 0;
 
-	// Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn.                            
+	// Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn.
 	uint16 deltaEnd = 91;
 
 	// Set the end point.
@@ -128,7 +128,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	endPoint.x = (int16)floor(xRadius * cos(tempTerm) + 0.5) + x;
 	endPoint.y = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
 
-	// Calculate points. 
+	// Calculate points.
 	int16 xNext = xRadius;
 	int16 yNext = 0;
 	do {
@@ -136,7 +136,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 		int16 yTemp = yNext;
 		// This is used by both sin and cos.
 		tempTerm = (j + delta) * convfac;
-		
+
 		xNext = (int16)floor(xRadius * cos(tempTerm) + 0.5);
 		yNext = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5);
 
@@ -145,18 +145,18 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 		int16 yp = y + yTemp;
 		int16 ym = y - yTemp;
 
-		if ((j >= stAngle) && (j <= endAngle)) 
+		if ((j >= stAngle) && (j <= endAngle))
 			*(byte *)_scrolls.getBasePtr(xp,yp) = color;
 
-		if (((180-j) >= stAngle) && ((180-j) <= endAngle)) 
+		if (((180-j) >= stAngle) && ((180-j) <= endAngle))
 			*(byte *)_scrolls.getBasePtr(xm,yp) = color;
 
-		if (((j+180) >= stAngle) && ((j+180) <= endAngle)) 
+		if (((j+180) >= stAngle) && ((j+180) <= endAngle))
 			*(byte *)_scrolls.getBasePtr(xm,ym) = color;
 
-		if (((360-j) >= stAngle) && ((360-j) <= endAngle)) 
+		if (((360-j) >= stAngle) && ((360-j) <= endAngle))
 			*(byte *)_scrolls.getBasePtr(xp,ym) = color;
-		
+
 		j += delta;
 	} while (j <= deltaEnd);
 
@@ -208,7 +208,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) {
 	for (byte i = 0; i < text.size(); i++) {
 		for (byte j = 0; j < fontHeight; j++) {
-			byte pixel = font[(byte)text[i]][j];	
+			byte pixel = font[(byte)text[i]][j];
 			for (byte bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit)
@@ -236,7 +236,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 					byte pixelBit = (pixel >> bit) & 1;
 					if (pixelBit != 0)
 						*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
-				} 
+				}
 			}
 		}
 	}
@@ -258,7 +258,7 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 				for (byte i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
 					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
-				}	
+				}
 			}
 		}
 	}
@@ -285,7 +285,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 				for (byte bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
 					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
-				} 
+				}
 			}
 		}
 	}
@@ -304,8 +304,8 @@ void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
 		for (uint16 x = 0; x < _screen.w; x++) {
-			for (byte j = 0; j < 2; j++) 
-				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);	
+			for (byte j = 0; j < 2; j++)
+				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);
 		}
 	}
 	// Now we copy the stretched picture to the screen.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ad6a682..a94ed77 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#ifndef GRAPHICS_H
-#define GRAPHICS_H
+#ifndef AVALANCHE_GRAPHICS_H
+#define AVALANCHE_GRAPHICS_H
 
 #include "common/file.h"
 
@@ -38,7 +38,7 @@ class AvalancheEngine;
 
 typedef byte FontType[256][16]; // raw font type
 
-typedef byte ManiType[2049]; // manitype = array[5..2053] of byte; 
+typedef byte ManiType[2049]; // manitype = array[5..2053] of byte;
 // Be aware!!!
 
 typedef byte SilType[51][11]; // 35, 4
@@ -69,12 +69,12 @@ public:
 	~Graphics();
 	void init();
 	void fleshColors();
-	
+
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
 	// TODO: Make it more accurate later.
 	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
-	
+
 	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
 	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color);
 	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color);
@@ -100,4 +100,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // GRAPHICS_H
+#endif // AVALANCHE_GRAPHICS_H
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 398e4a8..1fd906d 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -119,7 +119,7 @@ const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroo
 // A quasiped defines how people who aren't sprites talk. For example, quasiped
 // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
 const QuasipedType Gyro::kQuasipeds[16] = {
-	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood},                       // A: Dogfood (screen 19). 
+	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood},                       // A: Dogfood (screen 19).
 	{3, kColorGreen,     19, kColorWhite, kPeopleIbythneth},                     // B: Ibythneth (screen 19).
 	{3, kColorWhite,     1, kColorMagenta, kPeopleArkata},                       // C: Arkata (screen 1).
 	{3, kColorBlack,     23, kColorRed, 177},							   // D: Hawk (screen 23).
@@ -234,7 +234,7 @@ void Gyro::shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 	warning("STUB: Gyro::shbox()");
 }
 
-void Gyro::newGame() { 
+void Gyro::newGame() {
 	for (byte gm = 0; gm < kMaxSprites; gm++) {
 		if (_vm->_trip->tr[gm].quick)
 			_vm->_trip->tr[gm].done();
@@ -259,7 +259,7 @@ void Gyro::newGame() {
 	_dna._objects[kObjectBodkin - 1] = true;
 	_dna._objects[kObjectBell - 1] = true;
 	_dna._objects[kObjectClothes - 1] = true;
-	
+
 	_thinkThing = true;
 	_thinks = 2;
 	_vm->_lucerna->objectlist();
@@ -293,7 +293,7 @@ void Gyro::newGame() {
 	_vm->_lucerna->sprite_run();
 }
 
-void Gyro::click() { 
+void Gyro::click() {
 	warning("STUB: Gyro::click()");
 }
 
@@ -326,7 +326,7 @@ bool Gyro::updateMoney(uint16 howmuchby) {
 
 // There'll may be problems with calling these functions because of the conversion of the arrays!!!
 // Keep an eye open!
-Common::String Gyro::getName(byte whose) { 
+Common::String Gyro::getName(byte whose) {
 	static const Common::String kLads[17] = {
 		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
 		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
@@ -350,7 +350,7 @@ byte Gyro::getNameChar(byte whose) {
 
 	assert((whose > 150) && (whose < 179));
 
-	if (whose < 175) 
+	if (whose < 175)
 		return kLadChar[whose - 150];
 	else
 		return kLassChar[whose - 175];
@@ -461,7 +461,7 @@ Common::String Gyro::f5Does() {
 				return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up";
 		}
 		break;
-	case r__insidecardiffcastle: 
+	case r__insidecardiffcastle:
 		if (_dna._standingOnDais)
 			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down";
 		else
@@ -505,7 +505,7 @@ void Gyro::loadMouse(byte which) {
 			for (byte k = 0; k < 2; k++)
 				if (*(byte *)mask.getBasePtr(i, j) == 0)
 					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
-	
+
 	mask.free();
 
 	// The OR mask.
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 75dc50c..ca367cd 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -27,8 +27,8 @@
 
 /* GYRO		It all revolves around this bit! */
 
-#ifndef GYRO2_H
-#define GYRO2_H
+#ifndef AVALANCHE_GYRO2_H
+#define AVALANCHE_GYRO2_H
 
 #include "common/str.h"
 #include "common/scummsys.h"
@@ -49,7 +49,7 @@ static const int16 kCarryLimit = 12;  // carry limit
 static const int16 kNumlockCode = 32;  // Code for Num Lock
 static const int16 kMouseSize = 134;
 
-struct MouseHotspotType { // mouse-void 
+struct MouseHotspotType { // mouse-void
 	int16 _horizontal, _vertical;
 };
 
@@ -115,7 +115,7 @@ struct DnaType { // Ux, uy, & ww now all belong to Trip5
 
 	byte _jumpStatus; // Fixes how high you're jumping.
 
-	bool _mushroomGrowing; // Is the mushroom growing in 42? 
+	bool _mushroomGrowing; // Is the mushroom growing in 42?
 
 	bool _spludwickAtHome; // Is Spludwick at home?
 
@@ -298,7 +298,7 @@ public:
 
 	// For Thinkabout:
 	static const bool kThing = true;
-	static const bool kPerson = false; 
+	static const bool kPerson = false;
 
 	// Magic/portal constants:
 	enum Magics {
@@ -310,7 +310,7 @@ public:
 		kMagicSpecial, // Special function.
 		kMagicOpenDoor // Opening door.
 	};
-	
+
 	// These following static constants should be included in CFG when it's written.
 
 	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
@@ -331,7 +331,7 @@ public:
 	static const bool kDemo = false; // If this is true, we're in a demo of the game.
 
 	static const char kSpludwicksOrder[3];
-	 
+
 	static const QuasipedType kQuasipeds[16];
 
 	enum Pitch {
@@ -353,13 +353,13 @@ public:
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 	byte _interrogation;
-	
+
 	static byte _whereIs[29];
 
 	// Variable static constant for overriding the ability of On to switch pages.
 	// You may know better than On which page to switch to.
-	bool _onCanDoPageSwap; 
-	
+	bool _onCanDoPageSwap;
+
 
 
 
@@ -489,7 +489,7 @@ public:
 
 private:
 	AvalancheEngine *_vm;
-	
+
 	// CHECKME: Useless?
 	// static const char kItemsChar[];
 	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
@@ -497,4 +497,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // GYRO2_H
+#endif // AVALANCHE_GYRO2_H
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 81dc458..47f8382 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -80,7 +80,7 @@ void Lucerna::init() {
 		_vm->_gyro->atkey = "alt-";
 #endif
 }
-	
+
 /**
  * Call a given Verb
  * @remarks	Originally called 'callverb'
@@ -101,7 +101,7 @@ void Lucerna::callVerb(byte id) {
 
 void Lucerna::draw_also_lines() {
 	byte ff;
-	
+
 	CursorMan.showMouse(false);
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
@@ -119,7 +119,7 @@ void Lucerna::draw_also_lines() {
 
 
 
-// nextstring, scram1 and unscrable are only used in load_also 
+// nextstring, scram1 and unscrable are only used in load_also
 
 Common::String Lucerna::nextstring() {
 	Common::String str;
@@ -145,7 +145,7 @@ void Lucerna::unscramble() {
 
 void Lucerna::load_also(Common::String n) {
 	byte ff, fv;
-	
+
 	for (fv = 0; fv < 31; fv++)
 		for (ff = 0; ff < 2; ff++)
 			if (_vm->_gyro->_also[fv][ff] != 0)  {
@@ -170,9 +170,9 @@ void Lucerna::load_also(Common::String n) {
 		}
 		*_vm->_gyro->_also[fv][0] = Common::String('\x9D') + *_vm->_gyro->_also[fv][0] + Common::String('\x9D');
 	}
-	
+
 	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
-	
+
 	//fv = getpixel(0, 0);
 	_vm->_gyro->_lineNum = f.readByte();
 	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
@@ -217,7 +217,7 @@ void Lucerna::load_also(Common::String n) {
 	_vm->_gyro->_listen.clear();
 	for (byte i = 0; i < listen_length; i++)
 		_vm->_gyro->_listen += f.readByte();
-	
+
 	draw_also_lines();
 
 	//setactivepage(1);
@@ -231,9 +231,9 @@ void Lucerna::load_also(Common::String n) {
 
 void Lucerna::load(byte n) {     // Load2, actually
 	Common::String xx;
-	
+
 	CursorMan.showMouse(false);
-	
+
 	_vm->_graphics->fleshColors();
 
 	xx = _vm->_gyro->intToStr(n);
@@ -380,10 +380,10 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	_vm->_gyro->_roomTime = 0;
 
-	
+
 	if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room))
 		new_town();
-	
+
 
 	switch (x) {
 	case r__yours:
@@ -514,7 +514,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 		if (_vm->_gyro->_dna._tiedUp)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 
-		if (!_vm->_gyro->_dna._mushroomGrowing) 
+		if (!_vm->_gyro->_dna._mushroomGrowing)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
 		break;
@@ -571,17 +571,17 @@ void Lucerna::enterroom(byte x, byte ped) {
 				_vm->_gyro->_dna._catacombX = 8;
 				_vm->_gyro->_dna._catacombY = 4;
 			}
-			break; 
+			break;
 			case 5: { // Enter from du Lustie's
 				_vm->_gyro->_dna._catacombX = 8;
 				_vm->_gyro->_dna._catacombY = 7;
 			}
-			break; 
+			break;
 			case 6: { // Enter from Geida's
 				_vm->_gyro->_dna._catacombX = 4;
 				_vm->_gyro->_dna._catacombY = 1;
 			}
-			break; 
+			break;
 			}
 
 			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
@@ -709,7 +709,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_sequence->start_to_close();
 		}
 		break;
-	
+
 	case r__entrancehall:
 	case r__insideabbey:
 	case r__yourhall:
@@ -804,19 +804,19 @@ void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 		z = z - 149;
 		if (z >= 25)
 			z -= 8;
-		if (z == 20) 
+		if (z == 20)
 			z--; // Last time...
 
 	}
 
 	f.seek(z * picsize + 65);
-	
+
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
 
 	picture.free();
-	
+
 	f.close();
 
 	CursorMan.showMouse(false);
@@ -829,7 +829,7 @@ void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 
 	for (byte fv = 0; fv <= 1; fv++)
 		_vm->_trip->getset[fv].remember(thinkspace);
-	
+
 	CursorMan.showMouse(true);
 	_vm->_gyro->_thinkThing = th;
 }
@@ -845,7 +845,7 @@ void Lucerna::load_digits() {   // Load the scoring digits & rwlites
 
 	for (byte fv = 0; fv < 10; fv++) {
 		f.seek(fv * digitsize);
-		
+
 #if 0
 		_vm->_gyro->digit[fv] = new byte[digitsize];
 		f.read(_vm->_gyro->digit[fv], digitsize);
@@ -856,7 +856,7 @@ void Lucerna::load_digits() {   // Load the scoring digits & rwlites
 
 	for (byte ff = 0; ff < 9; ff++) {
 		f.seek(10 * digitsize + ff * rwlitesize);
-		
+
 #if 0
 		_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
 		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
@@ -875,7 +875,7 @@ void Lucerna::toolbar() {
 	}
 
 	f.seek(40);
-	
+
 	// off;
 
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
@@ -915,7 +915,7 @@ void Lucerna::showscore() {
 	//setactivepage(3);
 
 	for (byte fv = 0; fv < 3; fv++)
-		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv]) 
+		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv])
 			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
 	for (byte fv = 0; fv < 2; fv++)
@@ -1008,16 +1008,16 @@ void Lucerna::objectlist() {
 }
 
 void Lucerna::verte(Common::Point cursorPos) {
-	if (! _vm->_gyro->_dna._userMovesAvvy) 
+	if (! _vm->_gyro->_dna._userMovesAvvy)
 		return;
 
 	cursorPos.y /= 2;
 	byte what;
 
 	// _vm->_trip->tr[0] : that's the only one we're interested in here. (It's Avalot.)
-	if (cursorPos.x < _vm->_trip->tr[0].x) 
+	if (cursorPos.x < _vm->_trip->tr[0].x)
 		what = 1;
-	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength)) 
+	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength))
 		what = 2;
 	else
 		what = 0; // On top
@@ -1063,7 +1063,7 @@ void Lucerna::verte(Common::Point cursorPos) {
 void Lucerna::checkclick() {
 	Common::Point cursorPos = _vm->getMousePos();
 	_vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
-	
+
 	/*if (_vm->_gyro->mrelease > 0)
 	_vm->_gyro->after_the_scroll = false;*/
 
@@ -1080,7 +1080,7 @@ void Lucerna::checkclick() {
 		} else
 			_vm->_gyro->newMouse(4); // fletch
 	}
-	
+
 	if (holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->_dropsOk)
@@ -1185,11 +1185,11 @@ void Lucerna::dawn() {
 
 
 void Lucerna::showrw() { // It's data is loaded in load_digits().
-	if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction) 
+	if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction)
 		return;
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
 	CursorMan.showMouse(false);
-	
+
 #if 0
 	for (byte page_ = 0; page_ <= 1; page_++) {
 		setactivepage(page_);
@@ -1201,7 +1201,7 @@ void Lucerna::showrw() { // It's data is loaded in load_digits().
 
 	CursorMan.showMouse(true);
 	//setactivepage(1 - cp);
-	
+
 	warning("STUB: Lucerna::showrw()");
 }
 
@@ -1277,7 +1277,7 @@ void Lucerna::clock_lucerna() {
 
 	if ((_vm->_gyro->_hours == 0) && (_vm->_gyro->_oh != 0) && (_vm->_gyro->_oh != 17717))
 		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
-	
+
 	_vm->_gyro->_oh = _vm->_gyro->_hours;
 	_vm->_gyro->_onh = nh;
 	_vm->_gyro->_om = _vm->_gyro->_minutes;
@@ -1287,11 +1287,11 @@ void Lucerna::clock_lucerna() {
 
 void Lucerna::delavvy() {
 	CursorMan.showMouse(false);
-	
+
 //	triptype &with = _vm->_trip->tr[0];
 //	for (byte page_ = 0; page_ <= 1; page_++)
 //		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
-	
+
 	CursorMan.showMouse(true);
 }
 
@@ -1300,12 +1300,12 @@ void Lucerna::gameover() {
 
 	int16 sx = _vm->_trip->tr[0].x;
 	int16 sy = _vm->_trip->tr[0].y;
-	
+
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls
 	_vm->_trip->tr[0].step = 0;
 	_vm->_trip->tr[0].appear(sx, sy, 0);
-	
+
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
 
 	_vm->_gyro->_alive = false;
@@ -1323,11 +1323,11 @@ void Lucerna::minor_redraw() {
 		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
 		_vm->_trip->getback();
 	}
-	
+
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
 	showscore();
-	
+
 	dawn();
 }
 
@@ -1339,7 +1339,7 @@ uint16 Lucerna::bearing(byte whichped) {
 	byte pedId = whichped - 1; // Different array indexes in Pascal and C.
 
 	const double rad2deg = 180 / 3.14; // Pi
-		
+
 	if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[pedId]._x)
 		return 0;
 	else if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[pedId]._x) {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index f337d97..1436e38 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -27,8 +27,8 @@
 
 /* LUCERNA		The screen, [keyboard] and mouse handler.*/
 
-#ifndef LUCERNA2_H
-#define LUCERNA2_H
+#ifndef AVALANCHE_LUCERNA2_H
+#define AVALANCHE_LUCERNA2_H
 
 #include "common/scummsys.h"
 #include "common/file.h"
@@ -139,4 +139,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // LUCERNA2_H
+#endif // AVALANCHE_LUCERNA2_H
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 5b72ee1..073fdfd 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -134,7 +134,7 @@ void Parser::cursorOff() {
 	_cursorState = false;
 }
 
-void Parser::tryDropdown() { 
+void Parser::tryDropdown() {
 	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown.
 }
 
@@ -162,7 +162,7 @@ void Parser::drawCursor() {
 void Parser::wipeText() {
 	CursorMan.showMouse(false);
 	cursorOff();
-	
+
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 
 	_quote = true;
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index e16df6d..70a87b6 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#ifndef PARSER_H
-#define PARSER_H
+#ifndef AVALANCHE_PARSER_H
+#define AVALANCHE_PARSER_H
 
 #include "common/events.h"
 
@@ -41,7 +41,7 @@ public:
 	bool _quote; // 66 or 99 next?
 	byte _leftMargin;
 	bool _cursorState;
-	
+
 
 
 	Parser(AvalancheEngine *vm);
@@ -77,4 +77,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // PARSER_H
+#endif // AVALANCHE_PARSER_H
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index 9625236..1228ab2 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -27,8 +27,8 @@
 
 /* PINGO	Full-screen sub-parts of the game. */
 
-#ifndef PINGO2_H
-#define PINGO2_H
+#ifndef AVALANCHE_PINGO2_H
+#define AVALANCHE_PINGO2_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -64,4 +64,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // PINGO2_H
+#endif // AVALANCHE_PINGO2_H
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index 4007504..e623c27 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#ifndef ROOMNUMS_H
-#define ROOMNUMS_H
+#ifndef AVALANCHE_ROOMNUMS_H
+#define AVALANCHE_ROOMNUMS_H
 
 #include "common/system.h"
 
@@ -80,9 +80,9 @@ const byte r__insidecardiffcastle = 71;
 
 //{ -------------- }
 
-const byte r__bosskey = 98; // assumed 
+const byte r__bosskey = 98; // assumed
 const byte r__map = 99;
 
 } // End of namespace Avalanche
 
-#endif // ROOMNUMS_H
+#endif // AVALANCHE_ROOMNUMS_H
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 531794c..d3f76b5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -85,7 +85,7 @@ void Scrolls::easteregg() {
 void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwriting
 	FontType itw;
 	byte lz = z.size();
-	
+
 	bool offset = x % 8 == 4;
 	x = x / 8;
 	y++;
@@ -130,7 +130,7 @@ void Scrolls::normscroll() {
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
 	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
-	
+
 	Common::Event event;
 	while (!_vm->shouldQuit()) {
 		_vm->_graphics->refreshScreen();
@@ -224,7 +224,7 @@ void Scrolls::music_scroll() {
 	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(4);
 
-	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further. 
+	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further.
 	// For now we act like the player just played the right tone.
 #if 0
 	if (they_match(played)) {
@@ -239,7 +239,7 @@ void Scrolls::music_scroll() {
 		return;
 #if 0
 	}
-	
+
 	_vm->_gyro->screturn = false;
 	CursorMan.showMouse(false);
 	state(0);
@@ -261,12 +261,12 @@ void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little.
 		_vm->_lucerna->errorled(); // ring the bell "x" times
 }
 
-void Scrolls::dodgem() {     
+void Scrolls::dodgem() {
 	dodgeCoord = _vm->getMousePos();
 	g_system->warpMouse(dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
 }
 
-void Scrolls::undodgem() {   
+void Scrolls::undodgem() {
 	Common::Point actCoord = _vm->getMousePos();
 	if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
 		g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position.
@@ -357,7 +357,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
-	
+
 	// The body of the scroll.
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
@@ -381,7 +381,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 //	int16 ey = my - ly;
 	mx -= lx;
 	my -= ly + 2;
-	
+
 	centre = false;
 
 	switch (use_icon) {
@@ -525,7 +525,7 @@ void Scrolls::bubble(func2 gotoit) {
 	// "Tail" of the speech bubble.
 	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->_talkBackgroundColor);
 
-	
+
 	yl -= 3;
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
@@ -592,7 +592,7 @@ Common::String Scrolls::lsd() {
 			+ '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	if (_vm->_gyro->_dna._money > 12)
 		x = x + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";
-	
+
 	return x;
 }
 
@@ -702,7 +702,7 @@ void Scrolls::calldrivers() {
 					// sprites.)
 					_vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._x;
 					_vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._y; // Position.
-		
+
 					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor;
 					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors.
 				} else {
@@ -722,7 +722,7 @@ void Scrolls::calldrivers() {
 				switch (param) {
 				case 1:
 					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
-					break; 
+					break;
 				case 2:
 					display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer);
 					break;
@@ -831,7 +831,7 @@ void Scrolls::loadfont() {
 	for (int16 i = 0; i < 256; i++)
 		f.read(ch[1][i], 16);
 	f.close();
-	
+
 	if (!f.open("ttsmall.fnt")) {
 		warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
 		return;
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 362000b..3c1efc9 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -27,8 +27,8 @@
 
  /* SCROLLS		The scroll driver. */
 
-#ifndef SCROLLS2_H
-#define SCROLLS2_H
+#ifndef AVALANCHE_SCROLLS2_H
+#define AVALANCHE_SCROLLS2_H
 
 #include "common/system.h"
 
@@ -67,7 +67,7 @@ public:
 
 
 	Scrolls(AvalancheEngine *vm);
-	
+
 	void init();
 
 	void state(byte x);      // Sets "Ready" light to whatever
@@ -105,7 +105,7 @@ private:
 
 
 	int16 dix, diy;
-	
+
 	byte cfont; // Current font
 
 	Common::Point dodgeCoord;
@@ -150,4 +150,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif // SCROLLS2_H
+#endif // AVALANCHE_SCROLLS2_H
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 15759bd..4e51cf9 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -91,10 +91,10 @@ void Sequence::call_sequencer() {
 	switch (seq[0]) {
 	case 0:
 		return; // No more routines.
-		break; 
+		break;
 	case 177: // Flip room.
 		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); 
+		_vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
 		if (seq[0] == 177)
 			shove_left();
 		break;
@@ -105,7 +105,7 @@ void Sequence::call_sequencer() {
 		_vm->_celer->drawBackgroundSprite(-1, -1, seq[0]);
 		shove_left();
 	}
-	
+
 	start_to_close(); // Make sure this PROC gets called again.
 }
 
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
index d93cf42..7fcb646 100644
--- a/engines/avalanche/sequence2.h
+++ b/engines/avalanche/sequence2.h
@@ -27,8 +27,8 @@
 
 /* SEQUENCE		The sequencer. */
 
-#ifndef SEQUENCE2_H
-#define SEQUENCE2_H
+#ifndef AVALANCHE_SEQUENCE2_H
+#define AVALANCHE_SEQUENCE2_H
 
 #include "common/scummsys.h"
 
@@ -68,4 +68,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // SEQUENCE2_H
+#endif // AVALANCHE_SEQUENCE2_H
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index dbb4f80..59c7ed4 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -332,7 +332,7 @@ void Timeout::hang_around2() {
 	_vm->_trip->tr[0].done();
 	_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
-	set_up_timer(1, procafter_the_shootemup, reason_hanging_around); 
+	set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
 	// Immediately call the following proc (when you have a chance).
 
 	_vm->_gyro->_dna._tiedUp = false;
@@ -341,7 +341,7 @@ void Timeout::hang_around2() {
 }
 
 void Timeout::after_the_shootemup() {
-	
+
 	_vm->_trip->fliproom(_vm->_gyro->_dna._room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
@@ -614,7 +614,7 @@ void Timeout::arkata_shouts() {
 		return;
 
 	_vm->_visa->dixi('q', 76);
-	
+
 	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
 }
 
@@ -627,7 +627,7 @@ void Timeout::winning() {
 	do {
 		_vm->_lucerna->checkclick();
 	} while (!(_vm->_gyro->mrelease == 0));
-#endif	
+#endif
 	// TODO: To be implemented with Pingo::winning_pic().
 
 	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 2bac5a0..0e7be33 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -27,8 +27,8 @@
 
 /* TIMEOUT	The scheduling unit. */
 
-#ifndef TIMEOUT2_H
-#define TIMEOUT2_H
+#ifndef AVALANCHE_TIMEOUT2_H
+#define AVALANCHE_TIMEOUT2_H
 
 #include "common/scummsys.h"
 
@@ -121,11 +121,11 @@ public:
 
 
 	timetype times[7];
-	
+
 	bool timerLost; // Is the timer "lost"? (Because of using lose_timer())
 
 
-	
+
 	Timeout(AvalancheEngine *vm);
 
 	void setParent(AvalancheEngine *vm);
@@ -222,4 +222,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // TIMEOUT2_H
+#endif // AVALANCHE_TIMEOUT2_H
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index c514734..ccaba83 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -44,7 +44,7 @@
 #include "common/file.h"
 
 namespace Avalanche {
-	
+
 void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	_tr = tr;
 
@@ -73,14 +73,14 @@ void triptype::init(byte spritenum, bool do_check, Trip *tr) {
 	}
 
 	inf.skip(2); // Replace variable named 'soa' in the original code.
-	
+
 	if (!a.name.empty())
 		a.name.clear();
 	byte nameSize = inf.readByte();
-	for (byte i = 0; i < nameSize; i++) 
+	for (byte i = 0; i < nameSize; i++)
 		a.name += inf.readByte();
 	inf.skip(12 - nameSize);
-	
+
 	//inf.skip(1); // Same as above.
 	byte commentSize = inf.readByte();
 	for (byte i = 0; i < commentSize; i++)
@@ -147,9 +147,9 @@ void triptype::original() {
 void triptype::andexor() {
 	if ((vanishifstill) && (ix == 0) && (iy == 0))
 		return;
-	byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1). 
+	byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
 
-	_tr->_vm->_graphics->drawSprite(_info, picnum, x, y);	
+	_tr->_vm->_graphics->drawSprite(_info, picnum, x, y);
 }
 
 void triptype::turn(byte whichway) {
@@ -171,11 +171,11 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 }
 
 bool triptype::collision_check() {
-	for (byte fv = 0; fv < _tr->numtr; fv++) 
+	for (byte fv = 0; fv < _tr->numtr; fv++)
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + _info._xLength) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv]._info._xLength)) &&
-			(_tr->tr[fv].y == y)) 
+			(_tr->tr[fv].y == y))
 				return true;
 
 	return false;
@@ -193,7 +193,7 @@ void triptype::walk() {
 		r._y1 = y - 2;
 		r._x2 = ((x + _info._xLength) / 8) + 1;
 		r._y2 = y + _info._yLength + 2;
-		
+
 		_tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r);
 	}
 
@@ -470,7 +470,7 @@ Trip::~Trip() {
 void Trip::loadtrip() {
 	for (int16 gm = 0; gm < numtr; gm++)
 		tr[gm].original();
-	
+
 	for (uint16 i = 0; i < sizeof(aa); i++)
 		aa[i] = 0;
 }
@@ -491,7 +491,7 @@ byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 		for (fv = x1; fv <= x2; fv++) {
 			for (ff = oy + yl; ff <= y + yl; ff++) {
 				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
-				if (c > a) 
+				if (c > a)
 					a = c;
 			}
 		}
@@ -520,7 +520,7 @@ byte Trip::geida_ped(byte which) {
 	case 5:
 		return 9;
 	case 4:
-		return 10;	
+		return 10;
 	default:
 		return 0;
 	}
@@ -539,10 +539,10 @@ void Trip::catamove(byte ped) {
 	// catacombs has a different number for it.
 
 
-		
+
 	xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256;
 	_vm->_gyro->_dna._geidaSpin = 0;
-		
+
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
 		fliproom(r__lustiesroom, 4);
@@ -696,7 +696,7 @@ void Trip::catamove(byte ped) {
 		break;
 	case 0x1:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
-			
+
 		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
 			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim;
 		else
@@ -724,7 +724,7 @@ void Trip::catamove(byte ped) {
 		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
 		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
 		break;
-	// LEFT handles: 
+	// LEFT handles:
 #if 0
 	case 0x1:
 		_vm->_celer->show_one(-1, -1, 4);
@@ -837,7 +837,7 @@ void Trip::catamove(byte ped) {
 	}
 }
 
-	
+
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Trip::dawndelay() {
@@ -875,7 +875,7 @@ void Trip::call_special(uint16 which) {
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
 			// graphic of the arrow buried in the plaster. */
-			
+
 			// OK!
 			tr[1].call_eachstep = true;
 			tr[1].eachstep = procarrow_procs;
@@ -1005,7 +1005,7 @@ void Trip::call_special(uint16 which) {
 	}
 }
 
-	
+
 
 void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 // This slides the door open. (The data really ought to be saved in
@@ -1087,7 +1087,7 @@ void Trip::newspeed() {
 
 	for (page_ = 0; page_ <= 1; page_++)
 		getset[page_].remember(lightspace);
-	
+
 }
 
 void Trip::rwsp(byte t, byte dir) {
@@ -1234,7 +1234,7 @@ void Trip::arrow_procs(byte tripnum) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
 		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
 	}
-		
+
 }
 
 #if 0
@@ -1368,7 +1368,7 @@ void Trip::call_andexors() {
 		}
 	} while (!ok);
 
-	
+
 	_vm->_graphics->refreshBackground();
 
 	for (fv = 0; fv < 5; fv++) {
@@ -1544,13 +1544,13 @@ bool Trip::neardoor() {
 		// there ARE no doors here!
 		return false;
 	}
-		
+
 	int16 ux = tr[0].x;
 	int16 uy = tr[0].y + tr[0]._info._yLength;
 	bool nd = false;
 	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
 		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
-			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2)) 
+			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2))
 			nd = true;
 	return nd;
 }
@@ -1561,7 +1561,7 @@ void Trip::new_game_for_trippancy() {   // Called by gyro.newgame
 
 
 
-void Trip::handleMoveKey(const Common::Event &event) { 
+void Trip::handleMoveKey(const Common::Event &event) {
 	if (!_vm->_gyro->_dna._userMovesAvvy)
 		return;
 
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index 655adae..e701464 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -28,8 +28,8 @@
 /* TRIP5	Trippancy V - the sprite animation subsystem */
 
 
-#ifndef TRIP6_H
-#define TRIP6_H
+#ifndef AVALANCHE_TRIP6_H
+#define AVALANCHE_TRIP6_H
 
 #include "avalanche/graphics.h"
 
@@ -120,12 +120,9 @@ private:
 	Trip *_tr;
 
 	bool collision_check();
-
 	int8 sgn(int16 val);
 };
 
-
-
 const int16 maxgetset = 35;
 
 class getsettype {
@@ -138,18 +135,11 @@ public:
 	void recall(ByteField &r);
 };
 
-
-
-
-
-
 class Trip {
 public:
 	friend class triptype;
 	friend class getsettype;
 
-
-
 	static const int16 up = 0;
 	static const int16 right = 1;
 	static const int16 down = 2;
@@ -162,69 +152,37 @@ public:
 
 	static const int16 numtr = 5; // current max no. of sprites
 
-
-
 	static const int16 procfollow_avvy_y = 1;
-
 	static const int16 procback_and_forth = 2;
-
 	static const int16 procface_avvy = 3;
-
 	static const int16 procarrow_procs = 4;
-
 	static const int16 procspludwick_procs = 5;
-
 	static const int16 procgrab_avvy = 6;
-
 	static const int16 procgeida_procs = 7;
 
-
-
 	Trip(AvalancheEngine *vm);
-
 	~Trip();
 
 	void trippancy_link();
-
 	void get_back_loretta();
-
 	void loadtrip();
-
 	void call_special(uint16 which);
-
 	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
-
 	void catamove(byte ped);
-
 	void stopwalking();
-
 	void tripkey(char dir);
-
 	void rwsp(byte t, byte dir);
-
 	void apped(byte trn, byte np);
-
 	void getback();
-
 	void fliproom(byte room, byte ped);
-
 	bool infield(byte which); // Returns true if you're within field "which".
-
 	bool neardoor(); // Returns True if you're near a door.
-
 	void readstick();
-
 	void newspeed();
-
 	void new_game_for_trippancy();
-
 	void take_a_step(byte &tripnum);
-
-
-
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
-
 	triptype tr[numtr];
 	getsettype getset[2];
 	byte aa[1600];
@@ -240,32 +198,20 @@ private:
 	// int16 beforex, beforey;
 
 	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
-
 	byte geida_ped(byte which);
-
 	void dawndelay();
-
 	void hide_in_the_cupboard();
-
 	void follow_avvy_y(byte tripnum);
-
 	void back_and_forth(byte tripnum);
-
 	void face_avvy(byte tripnum);
-
 	void arrow_procs(byte tripnum);
-
 	void grab_avvy(byte tripnum);
-
 	void spin(byte whichway, byte &tripnum);
-
 	void geida_procs(byte tripnum);
-
 	void call_andexors();
-
 	void getsetclear();
 };
 
 } // End of namespace Avalanche.
 
-#endif // TRIP6_H
+#endif // AVALANCHE_TRIP6_H
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 4cdbe5a..f612365 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -49,7 +49,7 @@ bool Visa::bubbling = false;
 bool Visa::report_dixi_errors = true;
 
 void Visa::unskrimble() {
-	for (uint16  fv = 0; fv < _vm->_gyro->_bufSize; fv++) 
+	for (uint16  fv = 0; fv < _vm->_gyro->_bufSize; fv++)
 		_vm->_gyro->_buffer[fv] = (~(_vm->_gyro->_buffer[fv] - (fv + 1))) % 256;
 }
 
@@ -182,7 +182,7 @@ void Visa::talkto(byte whom) {
 				if (_vm->_gyro->_dna._talkedToCrapulus)
 					// Spludwick - what does he need?
 					// 0 - let it through to use normal routine.
-					switch (_vm->_gyro->_dna._givenToSpludwick) { 
+					switch (_vm->_gyro->_dna._givenToSpludwick) {
 					case 1: // Falltrough is intended.
 					case 2:{
 						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
@@ -251,7 +251,7 @@ void Visa::talkto(byte whom) {
 			break;
 	}
 	// On a subject. Is there any reason to block it?
-	else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) { 
+	else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
 			dixi('q', 43); // He's fast asleep!
 			return;
 		}
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index c3aa3f6..37cb177 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -27,8 +27,8 @@
 
 /* VISA		The new Sez handler. (Replaces Access.) */
 
-#ifndef VISA2_H
-#define VISA2_H
+#ifndef AVALANCHE_VISA2_H
+#define AVALANCHE_VISA2_H
 
 #include "common/scummsys.h"
 
@@ -60,4 +60,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // VISA2_H
+#endif // AVALANCHE_VISA2_H


Commit: 5d2547c8f04d1b80a2f711472ad525dde657eb53
    https://github.com/scummvm/scummvm/commit/5d2547c8f04d1b80a2f711472ad525dde657eb53
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T00:14:14-07:00

Commit Message:
AVALANCHE: Rename some constants in trip6

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/trip6.h
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 882fc3d..30f5a4b 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1277,7 +1277,7 @@ void Acci::personSpeaks() {
 
 	bool found = false; // The _person we're looking for's code is in _person.
 
-	for (byte i = 0; i < _vm->_trip->numtr; i++) {
+	for (byte i = 0; i < _vm->_trip->kSpriteNumbMax; i++) {
 		if (_vm->_trip->tr[i].quick && ((_vm->_trip->tr[i].a.accinum + 149) == _person)) {
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
@@ -1573,7 +1573,7 @@ void Acci::doThat() {
 						int16 y = _vm->_trip->tr[0].y;
 						_vm->_trip->tr[0].done();
 						_vm->_trip->tr[0].init(i, true, _vm->_trip);
-						_vm->_trip->tr[0].appear(x, y, _vm->_trip->left);
+						_vm->_trip->tr[0].appear(x, y, _vm->_trip->kDirLeft);
 						_vm->_trip->tr[0].visible = false;
 					}
 				}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9fd802d..4e3bbba 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -282,7 +282,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		for (byte i = 0; i < _trip->numtr; i++) {
+		for (byte i = 0; i < _trip->kSpriteNumbMax; i++) {
 			if (_trip->tr[i].quick)
 				spriteNum++;
 		}
@@ -290,7 +290,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(spriteNum);
 
 	if (sz.isLoading()) {
-		for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites.
+		for (byte i = 0; i < _trip->kSpriteNumbMax; i++) { // Deallocate sprites.
 			if (_trip->tr[i].quick)
 				_trip->tr[i].done();
 		}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 47f8382..a2df1fa 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -466,7 +466,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 				} else {
 					// You've been here before.
 					_vm->_trip->apped(2, 4); // He's standing in your way straight away...
-					_vm->_trip->tr[1].face = _vm->_trip->left;
+					_vm->_trip->tr[1].face = _vm->_trip->kDirLeft;
 				}
 			}
 		}
@@ -535,7 +535,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			default: { // You've answered SOME of his questions.
 				_vm->_trip->tr[1].init(9, false, _vm->_trip);
 				_vm->_trip->apped(2, 3);
-				_vm->_trip->tr[1].face = _vm->_trip->right;
+				_vm->_trip->tr[1].face = _vm->_trip->kDirRight;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
@@ -954,26 +954,26 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 
 	switch (col) {
 	case kColorGreen: {
-			_vm->_gyro->_dna._direction = _vm->_trip->up;
-			_vm->_trip->rwsp(0, _vm->_trip->up);
+			_vm->_gyro->_dna._direction = _vm->_trip->kDirUp;
+			_vm->_trip->rwsp(0, _vm->_trip->kDirUp);
 			showrw();
 		}
 		break;
 	case kColorBrown: {
-			_vm->_gyro->_dna._direction = _vm->_trip->down;
-			_vm->_trip->rwsp(0, _vm->_trip->down);
+			_vm->_gyro->_dna._direction = _vm->_trip->kDirDown;
+			_vm->_trip->rwsp(0, _vm->_trip->kDirDown);
 			showrw();
 		}
 		break;
 	case kColorCyan: {
-			_vm->_gyro->_dna._direction = _vm->_trip->left;
-			_vm->_trip->rwsp(0, _vm->_trip->left);
+			_vm->_gyro->_dna._direction = _vm->_trip->kDirLeft;
+			_vm->_trip->rwsp(0, _vm->_trip->kDirLeft);
 			showrw();
 		}
 		break;
 	case kColorLightmagenta: {
-			_vm->_gyro->_dna._direction = _vm->_trip->right;
-			_vm->_trip->rwsp(0, _vm->_trip->right);
+			_vm->_gyro->_dna._direction = _vm->_trip->kDirRight;
+			_vm->_trip->rwsp(0, _vm->_trip->kDirRight);
 			showrw();
 		}
 		break;
@@ -1032,28 +1032,28 @@ void Lucerna::verte(Common::Point cursorPos) {
 		_vm->_trip->stopwalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_trip->rwsp(0, _vm->_trip->left);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirLeft);
 		break;
 	case 2:
-		_vm->_trip->rwsp(0, _vm->_trip->right);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirRight);
 		break;
 	case 3:
-		_vm->_trip->rwsp(0, _vm->_trip->up);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirUp);
 		break;
 	case 4:
-		_vm->_trip->rwsp(0, _vm->_trip->ul);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirUpLeft);
 		break;
 	case 5:
-		_vm->_trip->rwsp(0, _vm->_trip->ur);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirUpRight);
 		break;
 	case 6:
-		_vm->_trip->rwsp(0, _vm->_trip->down);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirDown);
 		break;
 	case 7:
-		_vm->_trip->rwsp(0, _vm->_trip->dl);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirDownLeft);
 		break;
 	case 8:
-		_vm->_trip->rwsp(0, _vm->_trip->dr);
+		_vm->_trip->rwsp(0, _vm->_trip->kDirDownRight);
 		break;
 	}    // No other values are possible.
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d3f76b5..4105c16 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -691,7 +691,7 @@ void Scrolls::calldrivers() {
 				if (param == 0)
 					natural();
 				else if ((1 <= param) && (param <= 9)) {
-					if ((param > _vm->_trip->numtr) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
+					if ((param > _vm->_trip->kSpriteNumbMax) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
 						_vm->_lucerna->errorled();
 						natural();
 					} else
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 59c7ed4..9155643 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -243,7 +243,7 @@ void Timeout::avaricius_talks() {
 }
 
 void Timeout::urinate() {
-	_vm->_trip->tr[0].turn(_vm->_trip->up);
+	_vm->_trip->tr[0].turn(_vm->_trip->kDirUp);
 	_vm->_trip->stopwalking();
 	_vm->_lucerna->showrw();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
@@ -545,7 +545,7 @@ void Timeout::meet_avaroid() {
 		_vm->_gyro->_dna._metAvaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
-		_vm->_trip->tr[0].face = _vm->_trip->left;
+		_vm->_trip->tr[0].face = _vm->_trip->kDirLeft;
 		_vm->_trip->tr[0].x = 151;
 		_vm->_trip->tr[0].ix = -3;
 		_vm->_trip->tr[0].iy = -5;
@@ -569,7 +569,7 @@ void Timeout::robin_hood_and_geida() {
 	_vm->_trip->apped(1, 7);
 	_vm->_trip->tr[0].walkto(6);
 	_vm->_trip->tr[1].stopwalk();
-	_vm->_trip->tr[1].face = _vm->_trip->left;
+	_vm->_trip->tr[1].face = _vm->_trip->kDirLeft;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index ccaba83..c74efb5 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -171,7 +171,7 @@ void triptype::appear(int16 wx, int16 wy, byte wf) {
 }
 
 bool triptype::collision_check() {
-	for (byte fv = 0; fv < _tr->numtr; fv++)
+	for (byte fv = 0; fv < _tr->kSpriteNumbMax; fv++)
 		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
 			((x + _info._xLength) > _tr->tr[fv].x) &&
 			(x < (_tr->tr[fv].x + _tr->tr[fv]._info._xLength)) &&
@@ -326,14 +326,14 @@ void triptype::speed(int8 xx, int8 yy) {
 	if (ix == 0) {
 		// No horz movement
 		if (iy < 0)
-			turn(_tr->up);
+			turn(_tr->kDirUp);
 		else
-			turn(_tr->down);
+			turn(_tr->kDirDown);
 	} else {
 		if (ix < 0)
-			turn(_tr->left);
+			turn(_tr->kDirLeft);
 		else
-			turn(_tr->right);
+			turn(_tr->kDirRight);
 	}
 }
 
@@ -461,14 +461,14 @@ Trip::Trip(AvalancheEngine *vm) {
 }
 
 Trip::~Trip() {
-	for (byte i = 0; i < numtr; i++) {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
 		if (tr[i].quick)
 			tr[i].done();
 	}
 }
 
 void Trip::loadtrip() {
-	for (int16 gm = 0; gm < numtr; gm++)
+	for (int16 gm = 0; gm < kSpriteNumbMax; gm++)
 		tr[gm].original();
 
 	for (uint16 i = 0; i < sizeof(aa); i++)
@@ -883,7 +883,7 @@ void Trip::call_special(uint16 which) {
 		break;
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
-		tr[0].turn(right); // you'll see this after we get back from bootstrap
+		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
 		_vm->_enid->backToBootstrap(3);
 		break;
@@ -909,7 +909,7 @@ void Trip::call_special(uint16 which) {
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		tr[0].ix = 3;
 		tr[0].iy = 0;
-		tr[0].face = right;
+		tr[0].face = kDirRight;
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
@@ -925,7 +925,7 @@ void Trip::call_special(uint16 which) {
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
 			_vm->_visa->dixi('q', 63);
-			tr[1].turn(down);
+			tr[1].turn(kDirDown);
 			tr[1].stopwalk();
 			tr[1].call_eachstep = false; // Geida
 			_vm->_lucerna->gameover();
@@ -1046,7 +1046,7 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
 				return;
 			} else {
 				apped(1, 6);
-				tr[0].face = right; // added by TT 12/3/1995
+				tr[0].face = kDirRight; // added by TT 12/3/1995
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(9);
 			}
@@ -1092,28 +1092,28 @@ void Trip::newspeed() {
 
 void Trip::rwsp(byte t, byte dir) {
 	switch (dir) {
-	case up:
+	case kDirUp:
 		tr[t].speed(0, -tr[t].ys);
 		break;
-	case down:
+	case kDirDown:
 		tr[t].speed(0, tr[t].ys);
 		break;
-	case left:
+	case kDirLeft:
 		tr[t].speed(-tr[t].xs,  0);
 		break;
-	case right:
+	case kDirRight:
 		tr[t].speed(tr[t].xs,  0);
 		break;
-	case ul:
+	case kDirUpLeft:
 		tr[t].speed(-tr[t].xs, -tr[t].ys);
 		break;
-	case ur:
+	case kDirUpRight:
 		tr[t].speed(tr[t].xs, -tr[t].ys);
 		break;
-	case dl:
+	case kDirDownLeft:
 		tr[t].speed(-tr[t].xs, tr[t].ys);
 		break;
-	case dr:
+	case kDirDownRight:
 		tr[t].speed(tr[t].xs, tr[t].ys);
 		break;
 	}
@@ -1160,7 +1160,7 @@ void Trip::getback() {
 
 // Eachstep procedures:
 void Trip::follow_avvy_y(byte tripnum) {
-	if (tr[0].face == left)
+	if (tr[0].face == kDirLeft)
 		return;
 	if (tr[tripnum].homing)
 		tr[tripnum].hy = tr[1].y;
@@ -1182,7 +1182,7 @@ void Trip::follow_avvy_y(byte tripnum) {
 
 void Trip::back_and_forth(byte tripnum) {
 	if (!tr[tripnum].homing) {
-		if (tr[tripnum].face == right)
+		if (tr[tripnum].face == kDirRight)
 			tr[tripnum].walkto(4);
 		else
 			tr[tripnum].walkto(5);
@@ -1192,9 +1192,9 @@ void Trip::back_and_forth(byte tripnum) {
 void Trip::face_avvy(byte tripnum) {
 	if (!tr[tripnum].homing) {
 		if (tr[0].x >= tr[tripnum].x)
-			tr[tripnum].face = right;
+			tr[tripnum].face = kDirRight;
 		else
-			tr[tripnum].face = left;
+			tr[tripnum].face = kDirLeft;
 	}
 }
 
@@ -1258,7 +1258,7 @@ void Trip::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 toy = tr[0].y - 1;
 	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
 		tr[tripnum].call_eachstep = false;
-		tr[tripnum].face = left;
+		tr[tripnum].face = kDirLeft;
 		tr[tripnum].stopwalk();
 		// ... whatever ...
 	} else {
@@ -1310,14 +1310,14 @@ void Trip::geida_procs(byte tripnum) {
 
 	if (tr[tripnum].y < (tr[0].y - 2)) {
 		// Geida is further from the screen than Avvy.
-		spin(down, tripnum);
+		spin(kDirDown, tripnum);
 		tr[tripnum].iy = 1;
 		tr[tripnum].ix = 0;
 		take_a_step(tripnum);
 		return;
 	} else if (tr[tripnum].y > (tr[0].y + 2)) {
 		// Avvy is further from the screen than Geida.
-		spin(up, tripnum);
+		spin(kDirUp, tripnum);
 		tr[tripnum].iy = -1;
 		tr[tripnum].ix = 0;
 		take_a_step(tripnum);
@@ -1329,11 +1329,11 @@ void Trip::geida_procs(byte tripnum) {
 	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
 	if (tr[tripnum].x < tr[0].x - tr[0].xs * 8 - 12) {
 		tr[tripnum].ix = tr[0].xs;
-		spin(right, tripnum);
+		spin(kDirRight, tripnum);
 		take_a_step(tripnum);
 	} else if (tr[tripnum].x > tr[0].x + tr[0].xs * 8 + 12) {
 		tr[tripnum].ix = -tr[0].xs;
-		spin(left, tripnum);
+		spin(kDirLeft, tripnum);
 		take_a_step(tripnum);
 	} else
 		tr[tripnum].ix = 0;
@@ -1349,7 +1349,7 @@ void Trip::call_andexors() {
 	for (int i = 0; i < 5; i++)
 		order[i] = -1;
 
-	for (fv = 0; fv < numtr; fv++) {
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
 			order[fv] = fv;
 	}
@@ -1382,14 +1382,14 @@ void Trip::trippancy_link() {
 
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
-	for (fv = 0; fv < numtr; fv++) {
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick && tr[fv].visible)
 			tr[fv].walk();
 	}
 
 	call_andexors();
 
-	for (fv = 0; fv < numtr; fv++) {
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick && tr[fv].call_eachstep) {
 			switch (tr[fv].eachstep) {
 			case procfollow_avvy_y :
@@ -1424,7 +1424,7 @@ void Trip::trippancy_link() {
 void Trip::get_back_loretta() {
 	byte fv;
 
-	for (fv = 0; fv < numtr; fv++) {
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick) {
 			getback();
 			return;
@@ -1435,7 +1435,7 @@ void Trip::get_back_loretta() {
 
 void Trip::stopwalking() {
 	tr[0].stopwalk();
-	_vm->_gyro->_dna._direction = stopped;
+	_vm->_gyro->_dna._direction = kDirStopped;
 	if (_vm->_gyro->_alive)
 		tr[0].step = 1;
 }
@@ -1504,7 +1504,7 @@ void Trip::fliproom(byte room, byte ped) {
 	getsetclear();
 
 
-	for (fv = 1; fv < numtr; fv++) {
+	for (fv = 1; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick)
 			tr[fv].done();
 	} // Deallocate sprite
@@ -1570,57 +1570,57 @@ void Trip::handleMoveKey(const Common::Event &event) {
 	else {
 		switch (event.kbd.keycode) {
 		case Common::KEYCODE_UP:
-			if (_vm->_gyro->_dna._direction != up) {
-				_vm->_gyro->_dna._direction = up;
+			if (_vm->_gyro->_dna._direction != kDirUp) {
+				_vm->_gyro->_dna._direction = kDirUp;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_DOWN:
-			if (_vm->_gyro->_dna._direction != down) {
-				_vm->_gyro->_dna._direction = down;
+			if (_vm->_gyro->_dna._direction != kDirDown) {
+				_vm->_gyro->_dna._direction = kDirDown;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_LEFT:
-			if (_vm->_gyro->_dna._direction != left) {
-				_vm->_gyro->_dna._direction = left;
+			if (_vm->_gyro->_dna._direction != kDirLeft) {
+				_vm->_gyro->_dna._direction = kDirLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_RIGHT:
-			if (_vm->_gyro->_dna._direction != right) {
-				_vm->_gyro->_dna._direction = right;
+			if (_vm->_gyro->_dna._direction != kDirRight) {
+				_vm->_gyro->_dna._direction = kDirRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
-			if (_vm->_gyro->_dna._direction != ur) {
-				_vm->_gyro->_dna._direction = ur;
+			if (_vm->_gyro->_dna._direction != kDirUpRight) {
+				_vm->_gyro->_dna._direction = kDirUpRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
-			if (_vm->_gyro->_dna._direction != dr) {
-				_vm->_gyro->_dna._direction = dr;
+			if (_vm->_gyro->_dna._direction != kDirDownRight) {
+				_vm->_gyro->_dna._direction = kDirDownRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_END:
-			if (_vm->_gyro->_dna._direction != dl) {
-				_vm->_gyro->_dna._direction = dl;
+			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
+				_vm->_gyro->_dna._direction = kDirDownLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
 			break;
 		case Common::KEYCODE_HOME:
-			if (_vm->_gyro->_dna._direction != ul) {
-				_vm->_gyro->_dna._direction = ul;
+			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
+				_vm->_gyro->_dna._direction = kDirUpLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
 				stopwalking();
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
index e701464..76b435b 100644
--- a/engines/avalanche/trip6.h
+++ b/engines/avalanche/trip6.h
@@ -140,17 +140,17 @@ public:
 	friend class triptype;
 	friend class getsettype;
 
-	static const int16 up = 0;
-	static const int16 right = 1;
-	static const int16 down = 2;
-	static const int16 left = 3;
-	static const int16 ur = 4;
-	static const int16 dr = 5;
-	static const int16 dl = 6;
-	static const int16 ul = 7;
-	static const int16 stopped = 8;
-
-	static const int16 numtr = 5; // current max no. of sprites
+	static const int16 kDirUp = 0;
+	static const int16 kDirRight = 1;
+	static const int16 kDirDown = 2;
+	static const int16 kDirLeft = 3;
+	static const int16 kDirUpRight = 4;
+	static const int16 kDirDownRight = 5;
+	static const int16 kDirDownLeft = 6;
+	static const int16 kDirUpLeft = 7;
+	static const int16 kDirStopped = 8;
+
+	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
 
 	static const int16 procfollow_avvy_y = 1;
 	static const int16 procback_and_forth = 2;
@@ -183,7 +183,7 @@ public:
 	void take_a_step(byte &tripnum);
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
-	triptype tr[numtr];
+	triptype tr[kSpriteNumbMax];
 	getsettype getset[2];
 	byte aa[1600];
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index f612365..2f438ba 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -260,7 +260,7 @@ void Visa::talkto(byte whom) {
 		whom -= 149;
 
 	no_matches = true;
-	for (fv = 0; fv <= _vm->_trip->numtr; fv++)
+	for (fv = 0; fv <= _vm->_trip->kSpriteNumbMax; fv++)
 		if (_vm->_trip->tr[fv].a.accinum == whom) {
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
 			no_matches = false;


Commit: cb05ea9bc6d04952e6cfc84ea9325b6a5e89bba1
    https://github.com/scummvm/scummvm/commit/cb05ea9bc6d04952e6cfc84ea9325b6a5e89bba1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T03:35:44-07:00

Commit Message:
AVALANCHE: Finish renaming/refactoring in Gyro.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 30f5a4b..8300873 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1817,7 +1817,7 @@ void Acci::doThat() {
 							_vm->_visa->dixi('D', 9);
 							_vm->_lucerna->points(3);
 						}
-						_vm->_gyro->updateMoney(3); // It costs thruppence.
+						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
 						_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = true;
 						_vm->_lucerna->objectlist();
 						_vm->_gyro->_dna._boughtOnion = true;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 1fd906d..879cc15 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -37,20 +37,15 @@
 #include "avalanche/acci2.h"
 #include "avalanche/trip6.h"
 
-#include "common/textconsole.h"
 #include "common/file.h"
-
 #include "common/random.h"
-
-//#include "dropdown.h"
-//#include "basher.h"
+#include "common/textconsole.h"
 
 namespace Avalanche {
 
 const char *Gyro::kVersionNum = "1.30";
 const char *Gyro::kCopyright = "1995";
 
-
 const MouseHotspotType Gyro::kMouseHotSpots[9] = {
 	{8,0}, // 1 - up-arrow
 	{0,0}, // 2 - screwdriver
@@ -66,15 +61,15 @@ const MouseHotspotType Gyro::kMouseHotSpots[9] = {
 // Art gallery at 2,1; notice about this at 2,2.
 const int32 Gyro::kCatacombMap[8][8] = {
 	// Geida's room
-	// 1     2			3   | 4     5		6		7     8
-	{0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
-	{0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
-	{0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
-	{0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, // >> Oubliette
-	{0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
-	{0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
-	{0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, // <<< In here
-	{0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
+	// 1       2	   3     | 4	   5	   6	   7       8
+	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
+	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
+	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
+	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
+	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
+	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
+	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
+	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
 };
 // vv Stairs trap.
 
@@ -119,22 +114,22 @@ const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroo
 // A quasiped defines how people who aren't sprites talk. For example, quasiped
 // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
 const QuasipedType Gyro::kQuasipeds[16] = {
-	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood},                       // A: Dogfood (screen 19).
-	{3, kColorGreen,     19, kColorWhite, kPeopleIbythneth},                     // B: Ibythneth (screen 19).
-	{3, kColorWhite,     1, kColorMagenta, kPeopleArkata},                       // C: Arkata (screen 1).
-	{3, kColorBlack,     23, kColorRed, 177},							   // D: Hawk (screen 23).
-	{3, kColorLightgreen, 50, kColorBrown, kPeopleTrader},                       // E: Trader (screen 50).
-	{6, kColorYellow,    42, kColorRed, kPeopleAvalot},                          // F: Avvy, tied up (scr.42)
-	{2, kColorBlue,      16, kColorWhite, kPeopleAyles},                         // G: Ayles (screen 16).
-	{2, kColorBrown,     7, kColorWhite, kPeopleJacques},                        // H: Jacques (screen 7).
-	{2, kColorLightgreen, 47, kColorGreen, kPeopleSpurge},                       // I: Spurge (screen 47).
-	{3, kColorYellow,    47, kColorRed, kPeopleAvalot},                          // J: Avalot (screen 47).
-	{2, kColorLightgray, 23, kColorBlack, kPeopleDuLustie},                      // K: du Lustie (screen 23).
-	{2, kColorYellow,    27, kColorRed, kPeopleAvalot},                          // L: Avalot (screen 27).
-	{3, kColorWhite,     27, kColorRed, 177},                              // M: Avaroid (screen 27).
-	{4, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche},                 // N: Malagauche (screen 19).
-	{5, kColorLightmagenta, 47, kColorRed, kPeoplePort},                         // O: Port (screen 47).
-	{2, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck}                     // P: Duck (screen 51).
+	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
+	{3, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{3, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
+	{3, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23).
+	{3, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
+	{6, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
+	{2, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
+	{2, kColorBrown, 7, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
+	{2, kColorLightgreen, 47, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
+	{3, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
+	{2, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
+	{2, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
+	{3, kColorWhite, 27, kColorRed, 177}, // M: Avaroid (screen 27).
+	{4, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
+	{5, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
+	{2, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
 };
 
 const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
@@ -143,9 +138,8 @@ const uint16 Gyro::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 49
 
 const TuneType Gyro::kTune = {
 	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
-	kPitchLower, kPitchHigher, kPitchHigher,
-	kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher, kPitchHigher, kPitchLower, kPitchLower, kPitchLower,
-	kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
+	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
+	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
 };
 
 byte Gyro::_whereIs[29] = {
@@ -175,9 +169,6 @@ byte Gyro::_whereIs[29] = {
 	r__wisewomans  // The Wise Woman.
 };
 
-// CHECKME: Useless?
-// const char Gyro::kItemsChar[] = "WMBParCLguKeSnIohn";
-
 Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	_vm = vm;
 
@@ -186,6 +177,7 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 		for (int ff = 0; ff < 2; ff++)
 			_also[fv][ff] = 0;
 	}
+
 	_dna._totalTime = 0;
 }
 
@@ -197,9 +189,9 @@ Gyro::~Gyro() {
 	_digits[9].free();
 }
 
-Common::String Gyro::intToStr(int32 x) {
-	Common::String q = Common::String::format("%d", x);
-	return q;
+Common::String Gyro::intToStr(int32 num) {
+	Common::String result = Common::String::format("%d", num);
+	return result;
 }
 
 void Gyro::newMouse(byte id) {
@@ -230,28 +222,28 @@ void Gyro::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc)
 	warning("STUB: Gyro::shadow()");
 }
 
-void Gyro::shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
 	warning("STUB: Gyro::shbox()");
 }
 
 void Gyro::newGame() {
-	for (byte gm = 0; gm < kMaxSprites; gm++) {
-		if (_vm->_trip->tr[gm].quick)
-			_vm->_trip->tr[gm].done();
+	for (byte i = 0; i < kMaxSprites; i++) {
+		if (_vm->_trip->tr[i].quick)
+			_vm->_trip->tr[i].done();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
 	_vm->_trip->tr[0].init(0, true, _vm->_trip);
-	_alive = true;
 
+	_alive = true;
 	_score = 0;
-	//for gd:=0 to 5 do which[gd]:=1;
 	memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
+
 	_vm->_scrolls->natural();
 	_vm->_lucerna->mousepage(0);
+
 	_dna._spareEvening = "answer a questionnaire";
 	_dna._favouriteDrink = "beer";
-
 	_dna._money = 30; // 2/6
 	_dna._direction = kDirectionStopped;
 	_dna._wearing = kObjectClothes;
@@ -279,7 +271,7 @@ void Gyro::newGame() {
 	_dna._avvyInBed = true;
 	_enidFilename = "";
 
-	for (byte gd = 0; gd <= 1; gd++) {
+	for (byte i = 0; i <= 1; i++) {
 		_cp = 1 - _cp;
 		_vm->_trip->getback();
 	}
@@ -287,7 +279,6 @@ void Gyro::newGame() {
 	_vm->_lucerna->enterroom(1, 1);
 	_vm->_trip->new_game_for_trippancy();
 	_vm->_lucerna->showscore();
-
 	_vm->_dropdown->setupMenu();
 	_vm->_lucerna->clock_lucerna();
 	_vm->_lucerna->sprite_run();
@@ -314,7 +305,7 @@ void Gyro::forceNumlock() {
 	warning("STUB: Gyro::force_numlock()");
 }
 
-bool Gyro::updateMoney(uint16 howmuchby) {
+bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_dna._money -= howmuchby;
 	if (_dna._money < 0) {
 		_vm->_visa->dixi('Q', 2); // "You are now denariusless!"
@@ -324,8 +315,6 @@ bool Gyro::updateMoney(uint16 howmuchby) {
 		return true;
 }
 
-// There'll may be problems with calling these functions because of the conversion of the arrays!!!
-// Keep an eye open!
 Common::String Gyro::getName(byte whose) {
 	static const Common::String kLads[17] = {
 		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
@@ -335,28 +324,22 @@ Common::String Gyro::getName(byte whose) {
 
 	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
 
-	assert((whose > 150) && (whose < 179));
-
 	if (whose < 175)
 		return kLads[whose - 150];
 	else
 		return kLasses[whose - 175];
 }
 
-// Keep an eye open! ^
 byte Gyro::getNameChar(byte whose) {
 	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
 	static const char kLassChar[] = "kG\0xB1o";
 
-	assert((whose > 150) && (whose < 179));
-
 	if (whose < 175)
 		return kLadChar[whose - 150];
 	else
 		return kLassChar[whose - 175];
 }
 
-// Keep an eye open! ^^
 Common::String Gyro::getThing(byte which) {
 	static const Common::String kThings[kObjectNum] = {
 		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
@@ -389,7 +372,6 @@ Common::String Gyro::getThing(byte which) {
 	return get_thing_result;
 }
 
-// Keep an eye open! ^^^
 char Gyro::getThingChar(byte which) {
 	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
 
@@ -407,7 +389,6 @@ char Gyro::getThingChar(byte which) {
 	return get_thingchar_result;
 }
 
-// Keep an eye open! ^^^^
 Common::String Gyro::getItem(byte which) {
 	static const Common::String kItems[kObjectNum] = {
 		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
@@ -522,13 +503,9 @@ void Gyro::loadMouse(byte which) {
 			}
 
 	mask.free();
-
 	f.close();
 
-
-
 	CursorMan.replaceCursor(cursor.pixels, 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
-
 	cursor.free();
 }
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index ca367cd..e1ce464 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -69,7 +69,6 @@ struct DnaType { // Ux, uy, & ww now all belong to Trip5
 	bool _wonNim; // Have you *won* Nim? (That's harder.)
 	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
 	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
-
 	byte _passwordNum; // Number of the passw for this game.
 	bool _aylesIsAwake; // pretty obvious!
 	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
@@ -77,82 +76,50 @@ struct DnaType { // Ux, uy, & ww now all belong to Trip5
 	bool _boughtOnion; // Have you bought an onion yet?
 	bool _rottenOnion; // And has it rotted?
 	bool _onionInVinegar; // Is the onion in the vinegar?
-
 	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
 	byte _brummieStairs; // Progression through the stairs trick.
 	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
-
 	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
-
 	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
 	bool _avvyInBed; // True if Avvy's in bed, but awake.
-
 	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
-
 	byte _dogFoodPos; // Which way Dogfood's looking in the pub.
-
 	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
-
 	bool _friarWillTieYouUp; // If you're going to get tied up.
 	bool _tiedUp; // You ARE tied up!
-
 	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
-
 	bool _talkedToCrapulus; // Pretty self-explanatory.
-
 	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
-
 	bool _bellsAreRinging; // Is Jacques ringing the bells?
-
 	bool _standingOnDais; // In room 71, inside Cardiff Castle.
 	bool _takenPen; // Have you taken the pen (in Cardiff?)
 	bool _arrowTriggered; // And has the arrow been triggered?
 	bool _arrowInTheDoor;  // Did the arrow hit the wall?
-
 	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
-
 	uint32 _totalTime; // Your total time playing this game, in ticks.
-
 	byte _jumpStatus; // Fixes how high you're jumping.
-
 	bool _mushroomGrowing; // Is the mushroom growing in 42?
-
 	bool _spludwickAtHome; // Is Spludwick at home?
-
 	byte _lastRoom;
 	byte _lastRoomNotMap;
-
 	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
-
 	bool _enterCatacombsFromLustiesRoom;
 	bool _teetotal; // Are we touching any more drinks?
 	byte _malagauche; // Position of Malagauche. See Celer for more info.
 	char _drinking; // What's he getting you?
-
 	bool _enteredLustiesRoomAsMonk;
-
 	byte _catacombX, _catacombY;   // XY coords in the catacombs.
-
 	bool _avvysInTheCupboard; // On screen 22.
-
 	bool _geidaFollows; // Is Geida following you?
-
 	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
-
 	byte _nextBell; // For the ringing.
-
 	bool _givenPotionToGeida; // Does Geida have the potion?
 	bool _lustieIsAsleep; // Is BDL asleep?
-
 	byte _flipToWhere, _flipToPed; // For the sequencer.
-
 	bool _beenTiedUp; // In r__Robins.
-
 	bool _sittingInPub; // Are you sitting down in the pub?
 	byte _spurgeTalkCount; // Count for talking to Spurge.
-
 	bool _metAvaroid;
-
 	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
 };
 
@@ -347,9 +314,6 @@ public:
 
 
 
-
-
-
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 	byte _interrogation;
@@ -360,9 +324,6 @@ public:
 	// You may know better than On which page to switch to.
 	bool _onCanDoPageSwap;
 
-
-
-
 	DnaType _dna;
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
@@ -375,23 +336,18 @@ public:
 	byte _scrollNum, _score, _whichwas;
 	byte _thinks;
 	bool _thinkThing;
-
 	int16 _talkX, _talkY;
 	byte _talkBackgroundColor, _talkFontColor;
 	byte _scrollBells; // no. of times to ring the bell
 	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
-
 	char _objectList[10];
-
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	// Called .free() for them in ~Gyro().
-
 	byte _oldDirection;
 	int8 _scoreToDisplay[3];
 	byte _currentMouse; // current mouse-void
 	Common::String _verbStr; // what you can do with your object. :-)
-
 	Common::String *_also[31][2];
 	PedType _peds[15];
 	MagicType _magics[15];
@@ -400,27 +356,19 @@ public:
 	byte _fieldNum;
 	Common::String _flags;
 	Common::String _listen;
-
-	uint16 _oh, _onh, _om, _hours, _minutes, _seconds;
-
+	uint16 _oh, _onh, _om, _hours, _minutes, _seconds; // For Timeout. TODO: Move them into it.
 	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
-
 	byte _cp, _ledStatus, _defaultLed;
 	FontType _font;
 	bool _alive;
 	byte _buffer[2000];
 	uint16 _bufSize;
-
 	int16 _underScroll; // Y-coord of just under the scroll text.
-
 	bool _dropdownActive; // Kludge so we don't have to keep referring to Dropdown
 	Common::String _roomnName; // Name of actual room
-
 	Common::String _subject; // What you're talking to them about.
 	byte _subjectNum; // The same thing.
-
 	bool _keyboardClick; // Is a keyboard click noise wanted?
-
 	byte _him, _her, _it;
 	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
@@ -430,68 +378,45 @@ public:
 	Common::DumpFile _demoFileSave; // uruk added it - first use located in constructor of Basher
 
 	byte _lastPerson; // Last person to have been selected using the People menu.
-
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
-
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
-
 	bool isLoaded; // Is it a loaded gamestate?
-
 	Common::String _enidFilename;
 
 
 
 	Gyro(AvalancheEngine *vm);
-
 	~Gyro();
 
-	Common::String intToStr(int32 x);
-
+	Common::String intToStr(int32 num);
 	void newMouse(byte id);
-
 	void setMousePointerWait();    // Makes hourglass.
+	void loadMouse(byte which);
 
 	void note(uint16 hertz);
-
 	void blip();
+	void click(); // "Audio keyboard feedback"
 
-	void shadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
+	void setBackgroundColor(byte x);
+	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
 	void newGame(); // This sets up the DNA for a completely new game.
-
-	void click(); // "Audio keyboard feedback"
-
 	void slowDown();
-
 	bool setFlag(char x);
-
 	void forceNumlock();
-
-	bool updateMoney(uint16 howmuchby); // Called pennycheck in the original.
-
+	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
+	void hangAroundForAWhile();
+	
 	Common::String getName(byte whose);
-
 	byte getNameChar(byte whose);
-
 	Common::String getThing(byte which);
-
 	char getThingChar(byte which);
-
 	Common::String getItem(byte which); // Called get_better in the original.
-
 	Common::String f5Does(); // This procedure determines what f5 does.
 
-	void loadMouse(byte which);
-
-	void setBackgroundColor(byte x);
-
-	void hangAroundForAWhile();
-
 private:
 	AvalancheEngine *_vm;
 
-	// CHECKME: Useless?
-	// static const char kItemsChar[];
 	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 9155643..085df26 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -499,7 +499,7 @@ void Timeout::buydrinks() {
 	_vm->_visa->dixi('D', _vm->_gyro->_dna._drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
 	_vm->_visa->dixi('D', 1); // That'll be thruppence.
-	if (_vm->_gyro->updateMoney(3)) // Pay 3d.
+	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
 		_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
 	_vm->_acci->drink();
 }
@@ -510,7 +510,7 @@ void Timeout::buywine() {
 
 	_vm->_visa->dixi('D', 50); // You buy the wine.
 	_vm->_visa->dixi('D', 1); // It'll be thruppence.
-	if (_vm->_gyro->updateMoney(3)) {
+	if (_vm->_gyro->decreaseMoney(3)) {
 		_vm->_visa->dixi('D', 4); // You paid up.
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
 		_vm->_lucerna->objectlist();


Commit: cfd7d06539e32ca088f01cd13e8b328aef801e24
    https://github.com/scummvm/scummvm/commit/cfd7d06539e32ca088f01cd13e8b328aef801e24
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T03:48:15-07:00

Commit Message:
AVALANCHE: Fix bug due to unsaved changes.

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4105c16..67247a4 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -426,8 +426,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 				_vm->_gyro->_scroll[b].setChar(' ', 0);
 				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
-				_vm->_gyro->shadowBox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
-				_vm->_gyro->shadowBox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+				_vm->_gyro->drawShadowBox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
+				_vm->_gyro->drawShadowBox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
 				}
 				break;
 			}


Commit: 2bed64b447516f1f702fd70952a9886fac454b0d
    https://github.com/scummvm/scummvm/commit/2bed64b447516f1f702fd70952a9886fac454b0d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T06:58:02-07:00

Commit Message:
AVALANCHE: Do renaming/refactoring in Lucerna.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/trip6.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 8300873..0712fd0 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -620,7 +620,7 @@ void Acci::parse() {
 
 void Acci::examineObject() {
 	if (_thing != _vm->_gyro->_thinks)
-		_vm->_lucerna->thinkabout(_thing, _vm->_gyro->kThing);
+		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
 	switch (_thing) {
 	case Gyro::kObjectWine :
 		switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine.
@@ -662,7 +662,7 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 void Acci::exampers() {
 	if (isPersonHere()) {
 		if (_thing != _vm->_gyro->_thinks)
-			_vm->_lucerna->thinkabout(_person, _vm->_gyro->kPerson);
+			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
 		_person -= 149;
 		switch (_person) { // Special cases
 		case 11:
@@ -777,7 +777,7 @@ void Acci::swallow() {   // Eat something.
 			_vm->_pingo->wobble();
 			_vm->_visa->dixi('U', 2);
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
-			_vm->_lucerna->objectlist();
+			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
 		case 2:
@@ -789,7 +789,7 @@ void Acci::swallow() {   // Eat something.
 	case Gyro::kObjectPotion:
 		_vm->_gyro->setBackgroundColor(4);
 		_vm->_visa->dixi('U', 3);
-		_vm->_lucerna->gameover();
+		_vm->_lucerna->gameOver();
 		_vm->_gyro->setBackgroundColor(0);
 		break;
 	case Gyro::kObjectInk:
@@ -800,7 +800,7 @@ void Acci::swallow() {   // Eat something.
 		break;
 	case Gyro::kObjectMushroom:
 		_vm->_visa->dixi('U', 6);
-		_vm->_lucerna->gameover();
+		_vm->_lucerna->gameOver();
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_dna._rottenOnion)
@@ -808,7 +808,7 @@ void Acci::swallow() {   // Eat something.
 		else {
 			_vm->_visa->dixi('U', 8);
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
-			_vm->_lucerna->objectlist();
+			_vm->_lucerna->refreshObjectList();
 		}
 		break;
 	default:
@@ -981,7 +981,7 @@ void Acci::putProc() {
 					+ _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!");
 				else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_dna._onionInVinegar = true;
-					_vm->_lucerna->points(7);
+					_vm->_lucerna->incScore(7);
 					_vm->_visa->dixi('u', 9);
 				}
 			}
@@ -1015,7 +1015,7 @@ void Acci::putProc() {
 
 						_vm->_gyro->_dna._boxContent = _thing;
 						_vm->_gyro->_dna._objects[_thing - 1] = false;
-						_vm->_lucerna->objectlist();
+						_vm->_lucerna->refreshObjectList();
 						_vm->_scrolls->display("OK, it's in the box.");
 
 						openBox(false); // Shut box.
@@ -1064,26 +1064,26 @@ bool Acci::giveToSpludwick() {
 			_vm->_gyro->_dna._givenToSpludwick++;
 			_vm->_visa->dixi('q', 20);
 			goToCauldron();
-			_vm->_lucerna->points(3);
+			_vm->_lucerna->incScore(3);
 		}
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		break;
 	case Gyro::kObjectInk:
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = false;
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._givenToSpludwick++;
 		_vm->_visa->dixi('q', 24);
 		goToCauldron();
-		_vm->_lucerna->points(3);
+		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = false;
 		_vm->_visa->dixi('q', 25);
-		_vm->_lucerna->points(5);
+		_vm->_lucerna->incScore(5);
 		_vm->_gyro->_dna._givenToSpludwick++;
 		goToCauldron();
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		break;
 	default:
 		return true;
@@ -1099,7 +1099,7 @@ void Acci::drink() {
 		_vm->_gyro->_dna._teetotal = true;
 		_vm->_gyro->_dna._avvyIsAwake = false;
 		_vm->_gyro->_dna._avvyInBed = true;
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		_vm->_lucerna->dusk();
 		_vm->_gyro->hangAroundForAWhile();
 		_vm->_trip->fliproom(1, 1);
@@ -1141,7 +1141,7 @@ void Acci::standUp() {
 			_vm->_trip->apped(1, 2);
 			_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
-			_vm->_lucerna->points(1);
+			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
 			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
 		} else
@@ -1177,7 +1177,7 @@ void Acci::getProc(char thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->display("OK, I've got it.");
 				_vm->_gyro->_dna._objects[thing - 1] = true;
-				_vm->_lucerna->objectlist();
+				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_dna._boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else
@@ -1197,7 +1197,7 @@ void Acci::getProc(char thing) {
 					_vm->_trip->call_special(3); // Zap!
 					_vm->_gyro->_dna._takenPen = true;
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
-					_vm->_lucerna->objectlist();
+					_vm->_lucerna->refreshObjectList();
 					_vm->_scrolls->display("Taken.");
 				}
 			} else if (_vm->_gyro->_dna._standingOnDais)
@@ -1219,8 +1219,8 @@ void Acci::getProc(char thing) {
 			_vm->_gyro->_dna._mushroomGrowing = false;
 			_vm->_gyro->_dna._takenMushroom = true;
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = true;
-			_vm->_lucerna->objectlist();
-			_vm->_lucerna->points(3);
+			_vm->_lucerna->refreshObjectList();
+			_vm->_lucerna->incScore(3);
 		} else
 			_vm->_visa->dixi('q', 57);
 		break;
@@ -1239,7 +1239,7 @@ void Acci::giveGeidaTheLute() {
 		return;
 	}
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
-	_vm->_lucerna->objectlist();
+	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->dixi('q', 64); // She plays it.
 
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
@@ -1422,7 +1422,7 @@ void Acci::doThat() {
 					case Gyro::kPeopleIbythneth:
 						if (_thing == _vm->_gyro->kObjectBadge) {
 							_vm->_visa->dixi('q', 32); // Thanks! Wow!
-							_vm->_lucerna->points(3);
+							_vm->_lucerna->incScore(3);
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = false;
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectHabit - 1] = true;
 							_vm->_gyro->_dna._givenBadgeToIby = true;
@@ -1438,8 +1438,8 @@ void Acci::doThat() {
 								_vm->_visa->dixi('q', 54);
 								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = true;
 								_vm->_gyro->_dna._givenPenToAyles = true;
-								_vm->_lucerna->objectlist();
-								_vm->_lucerna->points(2);
+								_vm->_lucerna->refreshObjectList();
+								_vm->_lucerna->incScore(2);
 							} else
 								heyThanks();
 						} else
@@ -1450,9 +1450,9 @@ void Acci::doThat() {
 						case Gyro::kObjectPotion:
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = false;
 							_vm->_visa->dixi('u', 16); // She drinks it.
-							_vm->_lucerna->points(2);
+							_vm->_lucerna->incScore(2);
 							_vm->_gyro->_dna._givenPotionToGeida = true;
-							_vm->_lucerna->objectlist();
+							_vm->_lucerna->refreshObjectList();
 							break;
 						case Gyro::kObjectLute:
 							giveGeidaTheLute();
@@ -1478,7 +1478,7 @@ void Acci::doThat() {
 					}
 				}
 			}
-			_vm->_lucerna->objectlist(); // Just in case...
+			_vm->_lucerna->refreshObjectList(); // Just in case...
 		}
 		break;
 
@@ -1539,7 +1539,7 @@ void Acci::doThat() {
 		else if (_vm->_gyro->_dna._avvysInTheCupboard) {
 			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.');
 			_vm->_gyro->_dna._wearing = kNothing;
-			_vm->_lucerna->objectlist();
+			_vm->_lucerna->refreshObjectList();
 		} else
 			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
 		break;
@@ -1561,7 +1561,7 @@ void Acci::doThat() {
 					} else
 						_vm->_gyro->_dna._wearing = _thing;
 
-					_vm->_lucerna->objectlist();
+					_vm->_lucerna->refreshObjectList();
 
 					byte i;
 					if (_thing == _vm->_gyro->kObjectHabit)
@@ -1608,13 +1608,13 @@ void Acci::doThat() {
 					// You won - strange!
 					_vm->_visa->dixi('Q', 7); // You won! Give us a lute!
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = true;
-					_vm->_lucerna->objectlist();
+					_vm->_lucerna->refreshObjectList();
 					_vm->_gyro->_dna._wonNim = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
-					_vm->_lucerna->points(7); // 7 points for winning!
+					_vm->_lucerna->incScore(7); // 7 points for winning!
 
 					if (_vm->_gyro->_dna._playedNim == 1)
-						_vm->_lucerna->points(3); // 3 points for playing your 1st game.
+						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 					_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
@@ -1729,7 +1729,7 @@ void Acci::doThat() {
 			_vm->_pingo->zonk();
 			_vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, and fries you.")
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
-			_vm->_lucerna->gameover();
+			_vm->_lucerna->gameOver();
 		}
 		_vm->_gyro->_dna._sworeNum++;
 		break;
@@ -1761,7 +1761,7 @@ void Acci::doThat() {
 					}
 
 					if (_vm->_gyro->_dna._alcoholLevel == 0)
-						_vm->_lucerna->points(3);
+						_vm->_lucerna->incScore(3);
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 					_vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
@@ -1791,7 +1791,7 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->_dna._alcoholLevel == 0)
-							_vm->_lucerna->points(3);
+							_vm->_lucerna->incScore(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->_dna._malagauche = 177;
 
@@ -1815,11 +1815,11 @@ void Acci::doThat() {
 							_vm->_visa->dixi('D', 11);
 						else {
 							_vm->_visa->dixi('D', 9);
-							_vm->_lucerna->points(3);
+							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
 						_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = true;
-						_vm->_lucerna->objectlist();
+						_vm->_lucerna->refreshObjectList();
 						_vm->_gyro->_dna._boughtOnion = true;
 						_vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall!
 						_vm->_gyro->_dna._onionInVinegar = false;
@@ -1858,9 +1858,9 @@ void Acci::doThat() {
 				_vm->_gyro->_dna._cwytalotGone = true;
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = false;
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = false;
-				_vm->_lucerna->objectlist();
+				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
-				_vm->_lucerna->points(7);
+				_vm->_lucerna->incScore(7);
 				_vm->_trip->tr[1].walkto(2);
 				_vm->_trip->tr[1].vanishifstill = true;
 				_vm->_trip->tr[1].call_eachstep = false;
@@ -1890,7 +1890,7 @@ void Acci::doThat() {
 				if (_vm->_gyro->_dna._drawbridgeOpen != 0)
 					_vm->_scrolls->display("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
-					_vm->_lucerna->points(4);
+					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->display("The drawbridge opens!");
 					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
@@ -1903,7 +1903,7 @@ void Acci::doThat() {
 		_vm->_enid->dir(_realWords[1]);
 		break;
 	case kVerbCodeDie:
-		_vm->_lucerna->gameover();
+		_vm->_lucerna->gameOver();
 		break;
 	case kVerbCodeScore:
 		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter
@@ -1959,7 +1959,7 @@ void Acci::doThat() {
 			case 0:
 				if (!_vm->_gyro->_dna._avvyIsAwake) {
 					_vm->_gyro->_dna._avvyIsAwake = true;
-					_vm->_lucerna->points(1);
+					_vm->_lucerna->incScore(1);
 					_vm->_gyro->_dna._avvyInBed = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_dna._teetotal)
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 4e3bbba..fbdeb25 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -460,7 +460,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_celer->forgetBackgroundSprites();
 
-	_lucerna->minor_redraw();
+	_lucerna->minorRedraw();
 
 	_dropdown->setupMenu();
 
@@ -468,11 +468,11 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_gyro->_alive = true;
 
-	_lucerna->objectlist();
+	_lucerna->refreshObjectList();
 
 	_trip->newspeed();
 
-	_lucerna->showrw();
+	_lucerna->drawDirection();
 
 	_gyro->_onToolbar = false;
 	_trip->trippancy_link();
@@ -720,7 +720,7 @@ Common::Error AvalancheEngine::run() {
 		//	break;
 		//}
 
-	} while (false);
+	} while (!shouldQuit());
 
 
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a84d67a..ff8a5aa 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -111,7 +111,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_KP5:
 		if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) {
 			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
-			_vm->_lucerna->showrw();
+			_vm->_lucerna->drawDirection();
 			return;
 		}
 	case Common::KEYCODE_BACKSPACE:
@@ -124,7 +124,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 		break;
 	}
 
-	_vm->_lucerna->showrw();
+	_vm->_lucerna->drawDirection();
 }
 
 
@@ -137,11 +137,11 @@ void Avalot::setup() {
 	_vm->_gyro->_holdTheDawn = true;
 	_vm->_lucerna->dusk();
 	_vm->_gyro->_currentMouse = 177;
-	_vm->_lucerna->mouse_init();  // on;
+	_vm->_gyro->setMousePointerWait();
 	_vm->_gyro->_dropsOk = true;
 	_vm->_gyro->_mouseText = "";
 	_vm->_gyro->_dropdownActive = false;
-	_vm->_lucerna->load_digits();
+	_vm->_lucerna->loadDigits();
 	_vm->_gyro->_cheat = false;
 	_vm->_gyro->_cp = 0;
 	_vm->_parser->_inputTextPos = 0;
@@ -151,7 +151,7 @@ void Avalot::setup() {
 	// TSkellern = 0; Replace with a more local variable sometime
 	_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionStopped;
 	_vm->_gyro->_enidFilename = ""; // Undefined.
-	_vm->_lucerna->toolbar();
+	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->state(2);
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
@@ -171,7 +171,7 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_vm->_gyro->_thinks = 2; // You always have money.
-		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
+		_vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
@@ -179,8 +179,8 @@ void Avalot::setup() {
 		_vm->_gyro->newGame(); // No game was requested- load the default.
 
 		_vm->_gyro->_soundFx = ! _vm->_gyro->_soundFx;
-		_vm->_lucerna->fxtoggle();
-		_vm->_lucerna->thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing);
+		_vm->_lucerna->fxToggle();
+		_vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing);
 
 		_vm->_visa->dixi('q', 83); // Info on the game, etc.
 	}
@@ -198,13 +198,13 @@ void Avalot::run(Common::String arg) {
 
 
 
-		_vm->_lucerna->clock_lucerna();
+		_vm->_lucerna->updateClock();
 		_vm->_dropdown->updateMenu();
 		_vm->_gyro->forceNumlock();
 		_vm->_trip->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_trip->trippancy_link();
-		_vm->_lucerna->checkclick();
+		_vm->_lucerna->checkClick();
 		_vm->_timeout->one_tick();
 
 
@@ -227,7 +227,7 @@ void Avalot::run(Common::String arg) {
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
 		if (delay <= 55)
 			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
-	} while (! _vm->_gyro->_letMeOut);
+	} while (!_vm->_gyro->_letMeOut && !_vm->shouldQuit());
 
 	//if (logging)
 	//	close(logfile);
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 1d3a023..b0b3b2f 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -562,7 +562,7 @@ void Dropdown::runMenuGame() {
 		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBoss);
 		break;
 	case 2:
-		_vm->_lucerna->major_redraw();
+		_vm->_lucerna->majorRedraw();
 		break;
 	case 3:
 		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
@@ -641,11 +641,11 @@ void Dropdown::runMenuAction() {
 }
 
 void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkabout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], _vm->_gyro->kThing);
+	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing);
 }
 
 void Dropdown::runMenuPeople() {
-	_vm->_lucerna->thinkabout(people[_activeMenuItem._choiceNum], _vm->_gyro->kPerson);
+	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
 	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
 }
 
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index 7cf4075..d942177 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -272,13 +272,13 @@ void Enid::ednaReload() {
 	_vm->_gyro->_seeScroll = true;  // This prevents display of the new sprites before the
 								   // new picture is loaded.
 
-	_vm->_lucerna->major_redraw();
+	_vm->_lucerna->majorRedraw();
 
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
 	_vm->_gyro->_alive = true;
 
-	_vm->_lucerna->objectlist();
+	_vm->_lucerna->refreshObjectList();
 
 	if (_vm->_gyro->_holdTheDawn) {
 		_vm->_gyro->_holdTheDawn = false;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 879cc15..cc62417 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -240,7 +240,6 @@ void Gyro::newGame() {
 	memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
 
 	_vm->_scrolls->natural();
-	_vm->_lucerna->mousepage(0);
 
 	_dna._spareEvening = "answer a questionnaire";
 	_dna._favouriteDrink = "beer";
@@ -254,7 +253,7 @@ void Gyro::newGame() {
 
 	_thinkThing = true;
 	_thinks = 2;
-	_vm->_lucerna->objectlist();
+	_vm->_lucerna->refreshObjectList();
 	_onToolbar = false;
 	_seeScroll = false;
 
@@ -276,12 +275,12 @@ void Gyro::newGame() {
 		_vm->_trip->getback();
 	}
 
-	_vm->_lucerna->enterroom(1, 1);
+	_vm->_lucerna->enterRoom(1, 1);
 	_vm->_trip->new_game_for_trippancy();
-	_vm->_lucerna->showscore();
+	_vm->_lucerna->drawScore();
 	_vm->_dropdown->setupMenu();
-	_vm->_lucerna->clock_lucerna();
-	_vm->_lucerna->sprite_run();
+	_vm->_lucerna->updateClock();
+	_vm->_lucerna->spriteRun();
 }
 
 void Gyro::click() {
@@ -309,7 +308,7 @@ bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_dna._money -= howmuchby;
 	if (_dna._money < 0) {
 		_vm->_visa->dixi('Q', 2); // "You are now denariusless!"
-		_vm->_lucerna->gameover();
+		_vm->_lucerna->gameOver();
 		return false;
 	} else
 		return true;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a2df1fa..76b2836 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -47,13 +47,9 @@
 
 #include "graphics/palette.h"
 
-//#include "dropdown.h"
-//#include "basher.h"
-
-
 namespace Avalanche {
 
-Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
+Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false) {
 	_vm = vm;
 }
 
@@ -99,19 +95,17 @@ void Lucerna::callVerb(byte id) {
 	}
 }
 
-void Lucerna::draw_also_lines() {
-	byte ff;
-
+void Lucerna::drawAlsoLines() {
 	CursorMan.showMouse(false);
 
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
-	for (ff = 0; ff < _vm->_gyro->_lineNum; ff++) {
+	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
 		// We had to check if the lines are within the borders of the screen.
-		if ((_vm->_gyro->_lines[ff]._x1 >= 0) && (_vm->_gyro->_lines[ff]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y1 >= 0) && (_vm->_gyro->_lines[ff]._y1 < _vm->_graphics->kScreenHeight)
-		 && (_vm->_gyro->_lines[ff]._x2 >= 0) && (_vm->_gyro->_lines[ff]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[ff]._y2 >= 0) && (_vm->_gyro->_lines[ff]._y2 < _vm->_graphics->kScreenHeight))
-			_vm->_graphics->_magics.drawLine(_vm->_gyro->_lines[ff]._x1, _vm->_gyro->_lines[ff]._y1, _vm->_gyro->_lines[ff]._x2, _vm->_gyro->_lines[ff]._y2, _vm->_gyro->_lines[ff]._color);
+		if ((_vm->_gyro->_lines[i]._x1 >= 0) && (_vm->_gyro->_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y1 >= 0) && (_vm->_gyro->_lines[i]._y1 < _vm->_graphics->kScreenHeight)
+		 && (_vm->_gyro->_lines[i]._x2 >= 0) && (_vm->_gyro->_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y2 >= 0) && (_vm->_gyro->_lines[i]._y2 < _vm->_graphics->kScreenHeight))
+			_vm->_graphics->_magics.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i]._color);
 	}
 
 	CursorMan.showMouse(true);
@@ -121,173 +115,160 @@ void Lucerna::draw_also_lines() {
 
 // nextstring, scram1 and unscrable are only used in load_also
 
-Common::String Lucerna::nextstring() {
+Common::String Lucerna::readAlsoStringFromFile() {
 	Common::String str;
-	byte length = f.readByte();
+	byte length = file.readByte();
 	for (int i = 0; i < length; i++)
-		str += f.readByte();
+		str += file.readByte();
 	return str;
 }
 
-void Lucerna::scram1(Common::String &x) {
-	for (uint fz = 0; fz < x.size(); fz++)
-		x.setChar(x[fz] ^ 177, fz);
+void Lucerna::scram(Common::String &str) {
+	for (uint i = 0; i < str.size(); i++)
+		str.setChar(str[i] ^ 177, i);
 }
 
-void Lucerna::unscramble() {
-	for (byte fv = 0; fv < 31; fv++)
-		for (byte ff = 0; ff < 2; ff++)
-			if (_vm->_gyro->_also[fv][ff] != 0)
-				scram1(*_vm->_gyro->_also[fv][ff]);
-	scram1(_vm->_gyro->_listen);
-	scram1(_vm->_gyro->_flags);
+void Lucerna::unScramble() {
+	for (byte i = 0; i < 31; i++)
+		for (byte j = 0; j < 2; j++)
+			if (_vm->_gyro->_also[i][j] != 0)
+				scram(*_vm->_gyro->_also[i][j]);
+	scram(_vm->_gyro->_listen);
+	scram(_vm->_gyro->_flags);
 }
 
-void Lucerna::load_also(Common::String n) {
-	byte ff, fv;
-
-	for (fv = 0; fv < 31; fv++)
-		for (ff = 0; ff < 2; ff++)
-			if (_vm->_gyro->_also[fv][ff] != 0)  {
-				delete _vm->_gyro->_also[fv][ff];
-				_vm->_gyro->_also[fv][ff] = 0;
+void Lucerna::loadAlso(byte num) {
+	for (byte i = 0; i < 31; i++)
+		for (byte j = 0; j < 2; j++)
+			if (_vm->_gyro->_also[i][j] != 0)  {
+				delete _vm->_gyro->_also[i][j];
+				_vm->_gyro->_also[i][j] = 0;
 			}
 
 	Common::String filename;
-	filename = filename.format("also%s.avd", n.c_str());
-	if (!f.open(filename)) {
+	filename = filename.format("also%d.avd", num);
+	if (!file.open(filename)) {
 		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 		return;
 	}
 
-	f.seek(128);
+	file.seek(128);
 
-	byte minnames = f.readByte();
-	for (fv = 0; fv <= minnames; fv++) {
-		for (ff = 0; ff < 2; ff++) {
-			_vm->_gyro->_also[fv][ff] = new Common::String;
-			*_vm->_gyro->_also[fv][ff] = nextstring();
+	byte alsoNum = file.readByte();
+	for (byte i = 0; i <= alsoNum; i++) {
+		for (byte j = 0; j < 2; j++) {
+			_vm->_gyro->_also[i][j] = new Common::String;
+			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
 		}
-		*_vm->_gyro->_also[fv][0] = Common::String('\x9D') + *_vm->_gyro->_also[fv][0] + Common::String('\x9D');
+		*_vm->_gyro->_also[i][0] = Common::String('\x9D') + *_vm->_gyro->_also[i][0] + Common::String('\x9D');
 	}
 
 	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
 
-	//fv = getpixel(0, 0);
-	_vm->_gyro->_lineNum = f.readByte();
+	_vm->_gyro->_lineNum = file.readByte();
 	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
-		_vm->_gyro->_lines[i]._x1 = f.readSint16LE();
-		_vm->_gyro->_lines[i]._y1 = f.readSint16LE();
-		_vm->_gyro->_lines[i]._x2 = f.readSint16LE();
-		_vm->_gyro->_lines[i]._y2 = f.readSint16LE();
-		_vm->_gyro->_lines[i]._color = f.readByte();
+		_vm->_gyro->_lines[i]._x1 = file.readSint16LE();
+		_vm->_gyro->_lines[i]._y1 = file.readSint16LE();
+		_vm->_gyro->_lines[i]._x2 = file.readSint16LE();
+		_vm->_gyro->_lines[i]._y2 = file.readSint16LE();
+		_vm->_gyro->_lines[i]._color = file.readByte();
 	}
 
 	memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds));
-	fv = f.readByte();
-	for (byte i = 0; i < fv; i++) {
-		_vm->_gyro->_peds[i]._x = f.readSint16LE();
-		_vm->_gyro->_peds[i]._y = f.readSint16LE();
-		_vm->_gyro->_peds[i]._direction = f.readByte();
+	byte pedNum = file.readByte();
+	for (byte i = 0; i < pedNum; i++) {
+		_vm->_gyro->_peds[i]._x = file.readSint16LE();
+		_vm->_gyro->_peds[i]._y = file.readSint16LE();
+		_vm->_gyro->_peds[i]._direction = file.readByte();
 	}
 
-	_vm->_gyro->_fieldNum = f.readByte();
+	_vm->_gyro->_fieldNum = file.readByte();
 	for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
-		_vm->_gyro->_fields[i]._x1 = f.readSint16LE();
-		_vm->_gyro->_fields[i]._y1 = f.readSint16LE();
-		_vm->_gyro->_fields[i]._x2 = f.readSint16LE();
-		_vm->_gyro->_fields[i]._y2 = f.readSint16LE();
+		_vm->_gyro->_fields[i]._x1 = file.readSint16LE();
+		_vm->_gyro->_fields[i]._y1 = file.readSint16LE();
+		_vm->_gyro->_fields[i]._x2 = file.readSint16LE();
+		_vm->_gyro->_fields[i]._y2 = file.readSint16LE();
 	}
 
 	for (byte i = 0; i < 15; i++) {
-		_vm->_gyro->_magics[i]._operation = f.readByte();
-		_vm->_gyro->_magics[i]._data = f.readUint16LE();
+		_vm->_gyro->_magics[i]._operation = file.readByte();
+		_vm->_gyro->_magics[i]._data = file.readUint16LE();
 	}
 
 	for (byte i = 0; i < 7; i++) {
-		_vm->_gyro->_portals[i]._operation = f.readByte();
-		_vm->_gyro->_portals[i]._data = f.readUint16LE();
+		_vm->_gyro->_portals[i]._operation = file.readByte();
+		_vm->_gyro->_portals[i]._data = file.readUint16LE();
 	}
 
 	_vm->_gyro->_flags.clear();
 	for (byte i = 0;  i < 26; i++)
-		_vm->_gyro->_flags += f.readByte();
+		_vm->_gyro->_flags += file.readByte();
 
-	int16 listen_length = f.readByte();
+	int16 listen_length = file.readByte();
 	_vm->_gyro->_listen.clear();
 	for (byte i = 0; i < listen_length; i++)
-		_vm->_gyro->_listen += f.readByte();
-
-	draw_also_lines();
+		_vm->_gyro->_listen += file.readByte();
 
-	//setactivepage(1);
-	warning("STUB: Lucerna::load_also()");
+	drawAlsoLines();
 
-	f.close();
-	unscramble();
-	for (fv = 0; fv <= minnames; fv++)
-		*_vm->_gyro->_also[fv][0] = Common::String(',') + *_vm->_gyro->_also[fv][0] + ',';
+	file.close();
+	unScramble();
+	for (byte i = 0; i <= alsoNum; i++)
+		*_vm->_gyro->_also[i][0] = Common::String(',') + *_vm->_gyro->_also[i][0] + ',';
 }
 
-void Lucerna::load(byte n) {     // Load2, actually
-	Common::String xx;
-
+void Lucerna::loadRoom(byte num) {
 	CursorMan.showMouse(false);
 
 	_vm->_graphics->fleshColors();
 
-	xx = _vm->_gyro->intToStr(n);
 	Common::String filename;
-	filename = filename.format("place%s.avd", xx.c_str());
-	if (!f.open(filename)) {
+	filename = filename.format("place%d.avd", num);
+	if (!file.open(filename)) {
 		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 		return;
 	}
 
-	f.seek(146);
+	file.seek(146);
 	if (!_vm->_gyro->_roomnName.empty())
 		_vm->_gyro->_roomnName.clear();
 	for (byte i = 0; i < 30; i++) {
-		char actChar = f.readByte();
+		char actChar = file.readByte();
 		if ((32 <= actChar) && (actChar <= 126))
 			_vm->_gyro->_roomnName += actChar;
 	}
 	// Compression method byte follows this...
 
-	f.seek(177);
+	file.seek(177);
 
-	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
+	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(file, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
 	_vm->_graphics->refreshBackground();
 
-	f.close();
+	file.close();
 
-	load_also(xx);
-	_vm->_celer->loadBackgroundSprites(n);
-	// byte bit = *_vm->_graphics->getPixel(0,0);
+	loadAlso(num);
+	_vm->_celer->loadBackgroundSprites(num);
 	CursorMan.showMouse(true);
 }
 
 
 
-void Lucerna::zoomout(int16 x, int16 y) {
-//	int16 x1, y1, x2, y2;
-//	byte fv;
-
+void Lucerna::zoomOut(int16 x, int16 y) {
 	warning("STUB: Lucerna::zoomout()");
 }
 
-void Lucerna::find_people(byte room) {
-	for (byte fv = 1; fv < 29; fv++) {
-		if (_vm->_gyro->_whereIs[fv] == room) {
-			if (fv < 25)
-				_vm->_gyro->_him = fv + 150;
+void Lucerna::findPeople(byte room) {
+	for (byte i = 1; i < 29; i++) {
+		if (_vm->_gyro->_whereIs[i] == room) {
+			if (i < 25)
+				_vm->_gyro->_him = i + 150;
 			else
-				_vm->_gyro->_her = fv + 150;
+				_vm->_gyro->_her = i + 150;
 		}
 	}
 }
 
-void Lucerna::exitroom(byte x) {
+void Lucerna::exitRoom(byte x) {
 	//nosound();
 	_vm->_celer->forgetBackgroundSprites();
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
@@ -321,7 +302,7 @@ void Lucerna::exitroom(byte x) {
 		_vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room;
 }
 
-void Lucerna::new_town() {   // You've just entered a town from the map.
+void Lucerna::enterNewTown() {
 	_vm->_dropdown->setupMenu();
 
 	switch (_vm->_gyro->_dna._room) {
@@ -351,41 +332,41 @@ void Lucerna::new_town() {   // You've just entered a town from the map.
 
 
 
-void Lucerna::put_geida_at(byte whichped, byte &ped) {
+void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	if (ped == 0)
 		return;
 	_vm->_trip->tr[1].init(5, false, _vm->_trip); // load Geida
-	_vm->_trip->apped(2, whichped);
+	_vm->_trip->apped(2, whichPed);
 	_vm->_trip->tr[1].call_eachstep = true;
 	_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
 }
 
-void Lucerna::enterroom(byte x, byte ped) {
+void Lucerna::enterRoom(byte room, byte ped) {
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
-	find_people(x);
-	_vm->_gyro->_dna._room = x;
+	findPeople(room);
+	_vm->_gyro->_dna._room = room;
 	if (ped != 0)
-		_vm->_gyro->_dna._roomCount[x]++;
+		_vm->_gyro->_dna._roomCount[room]++;
 
-	load(x);
+	loadRoom(room);
 
-	if ((_vm->_gyro->_dna._roomCount[x] == 0) && (! _vm->_gyro->setFlag('S')))
-		points(1);
+	if ((_vm->_gyro->_dna._roomCount[room] == 0) && (! _vm->_gyro->setFlag('S')))
+		incScore(1);
 
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
 	if (_vm->_gyro->_dna._geidaFollows)
-		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = x;
+		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = room;
 
 	_vm->_gyro->_roomTime = 0;
 
 
 	if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room))
-		new_town();
+		enterNewTown();
 
 
-	switch (x) {
+	switch (room) {
 	case r__yours:
 		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
@@ -449,7 +430,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 
 	case r__brummieroad:
 		if (_vm->_gyro->_dna._geidaFollows)
-			put_geida_at(5, ped);
+			putGeidaAt(5, ped);
 		if (_vm->_gyro->_dna._cwytalotGone) {
 			_vm->_gyro->_magics[kColorLightred - 1]._operation = _vm->_gyro->kMagicNothing;
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere;
@@ -492,7 +473,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_gyro->_magics[kColorGreen - 1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->_dna._geidaFollows)
-			put_geida_at(ped + 3, ped); // load Geida
+			putGeidaAt(ped + 3, ped); // load Geida
 		break;
 
 	case r__robins:
@@ -549,14 +530,14 @@ void Lucerna::enterroom(byte x, byte ped) {
 		dawn();
 		//setactivepage(cp);
 		if (ped > 0)
-			zoomout(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y);
+			zoomOut(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y);
 		//setactivepage(1 - cp);
 
 		{
 			if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
 				_vm->_visa->dixi('q', 9); // Don't want to waste the wine!
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
-				objectlist();
+				refreshObjectList();
 			}
 		}
 
@@ -610,7 +591,7 @@ void Lucerna::enterroom(byte x, byte ped) {
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
 
 		if (_vm->_gyro->_dna._geidaFollows) {
-			put_geida_at(5, ped);
+			putGeidaAt(5, ped);
 			if (_vm->_gyro->_dna._lustieIsAsleep) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
@@ -738,18 +719,18 @@ void Lucerna::enterroom(byte x, byte ped) {
 		break; // Ayles awake.
 
 	case r__geidas:
-		put_geida_at(2, ped);
+		putGeidaAt(2, ped);
 		break; // load Geida
 
 	case r__easthall:
 	case r__westhall:
 		if (_vm->_gyro->_dna._geidaFollows)
-			put_geida_at(ped + 2, ped);
+			putGeidaAt(ped + 2, ped);
 		break;
 
 	case r__lusties:
 		if (_vm->_gyro->_dna._geidaFollows)
-			put_geida_at(ped + 6, ped);
+			putGeidaAt(ped + 6, ped);
 		break;
 
 	case r__nottspub:
@@ -781,43 +762,45 @@ void Lucerna::enterroom(byte x, byte ped) {
 		_vm->_gyro->isLoaded = false;
 }
 
-void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
-	const int16 picsize = 966;
-	const ByteField thinkspace = {25, 170, 32, 200};
+void Lucerna::thinkAbout(byte object, bool type) {
+	const int16 picSize = 966;
 
-	_vm->_gyro->_thinks = z;
-	z--;
+	_vm->_gyro->_thinks = object;
+	object--;
 
 	_vm->_gyro->setMousePointerWait();
 
-	if (th) {
-		if (!f.open("thinks.avd")) {
+	switch (type) {
+	case Gyro::kThing:
+		if (!file.open("thinks.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
 			return;
 		}
-	} else {
-		if (!f.open("folk.avd")) {
+		break;
+	case Gyro::kPerson:
+		if (!file.open("folk.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: folk.avd");
 			return;
 		}
 
-		z = z - 149;
-		if (z >= 25)
-			z -= 8;
-		if (z == 20)
-			z--; // Last time...
+		object = object - 149;
+		if (object >= 25)
+			object -= 8;
+		if (object == 20)
+			object--; // Last time...
 
+		break;
 	}
 
-	f.seek(z * picsize + 65);
+	file.seek(object * picSize + 65);
 
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
 
 	picture.free();
 
-	f.close();
+	file.close();
 
 	CursorMan.showMouse(false);
 
@@ -827,75 +810,57 @@ void Lucerna::thinkabout(byte z, bool th) {     // Hey!!! Get it and put it!!!
 	setactivepage(1 - cp);
 #endif
 
-	for (byte fv = 0; fv <= 1; fv++)
-		_vm->_trip->getset[fv].remember(thinkspace);
-
 	CursorMan.showMouse(true);
-	_vm->_gyro->_thinkThing = th;
+	_vm->_gyro->_thinkThing = type;
 }
 
-void Lucerna::load_digits() {   // Load the scoring digits & rwlites
+void Lucerna::loadDigits() {   // Load the scoring digits & rwlites
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
-	if (!f.open("digit.avd")) {
+	if (!file.open("digit.avd")) {
 		warning("AVALANCHE: Lucerna: File not found: digit.avd");
 		return;
 	}
 
-	for (byte fv = 0; fv < 10; fv++) {
-		f.seek(fv * digitsize);
-
-#if 0
-		_vm->_gyro->digit[fv] = new byte[digitsize];
-		f.read(_vm->_gyro->digit[fv], digitsize);
-#endif
-
-		_vm->_gyro->_digits[fv] = _vm->_graphics->loadPictureGraphic(f);
+	for (byte i = 0; i < 10; i++) {
+		file.seek(i * digitsize);
+		_vm->_gyro->_digits[i] = _vm->_graphics->loadPictureGraphic(file);
 	}
 
-	for (byte ff = 0; ff < 9; ff++) {
-		f.seek(10 * digitsize + ff * rwlitesize);
-
-#if 0
-		_vm->_gyro->rwlite[ff] = new byte[rwlitesize];
-		f.read(_vm->_gyro->rwlite[ff], rwlitesize);
-#endif
-
-		_vm->_gyro->_directions[ff] = _vm->_graphics->loadPictureGraphic(f);
+	for (byte i = 0; i < 9; i++) {
+		file.seek(10 * digitsize + i * rwlitesize);
+		_vm->_gyro->_directions[i] = _vm->_graphics->loadPictureGraphic(file);
 	}
 
-	f.close();
+	file.close();
 }
 
-void Lucerna::toolbar() {
-	if (!f.open("useful.avd")) {
+void Lucerna::drawToolbar() {
+	if (!file.open("useful.avd")) {
 		warning("AVALANCHE: Lucerna: File not found: useful.avd");
 		return;
 	}
 
-	f.seek(40);
+	file.seek(40);
 
-	// off;
+	CursorMan.showMouse(false);
 
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(f);
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
 
 	picture.free();
 
-	f.close();
+	file.close();
 
-	// on;
+	CursorMan.showMouse(true);
 
 	_vm->_gyro->_oldDirection = 177;
-	showrw();
+	drawDirection();
 }
 
-void Lucerna::showscore() {
-
-	const ByteField scorespace = {33, 177, 39, 200};
-
+void Lucerna::drawScore() {
 	if (_vm->_gyro->kDemo)
 		return;
 
@@ -912,23 +877,17 @@ void Lucerna::showscore() {
 
 	CursorMan.showMouse(false);
 
-	//setactivepage(3);
-
 	for (byte fv = 0; fv < 3; fv++)
 		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv])
 			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177);
 
-	for (byte fv = 0; fv < 2; fv++)
-		_vm->_trip->getset[fv].remember(scorespace);
-
-	//setactivepage(1 - cp);
-
 	CursorMan.showMouse(true);
+
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = numbers[i];
 }
 
-void Lucerna::points(byte num) {     // Add on no. of points
+void Lucerna::incScore(byte num) {     // Add on no. of points
 	for (byte q = 1; q <= num; q++) {
 		_vm->_gyro->_dna._score++;
 
@@ -942,39 +901,35 @@ void Lucerna::points(byte num) {     // Add on no. of points
 	}
 	warning("STUB: Lucerna::points()");
 
-	showscore();
+	drawScore();
 }
 
-void Lucerna::topcheck(Common::Point cursorPos) {
-	_vm->_dropdown->_menuBar.chooseMenuItem(cursorPos.x);
-}
-
-void Lucerna::mouseway(const Common::Point &cursorPos) {
-	byte col = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
+void Lucerna::useCompass(const Common::Point &cursorPos) {
+	byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
 
-	switch (col) {
+	switch (color) {
 	case kColorGreen: {
 			_vm->_gyro->_dna._direction = _vm->_trip->kDirUp;
 			_vm->_trip->rwsp(0, _vm->_trip->kDirUp);
-			showrw();
+			drawDirection();
 		}
 		break;
 	case kColorBrown: {
 			_vm->_gyro->_dna._direction = _vm->_trip->kDirDown;
 			_vm->_trip->rwsp(0, _vm->_trip->kDirDown);
-			showrw();
+			drawDirection();
 		}
 		break;
 	case kColorCyan: {
 			_vm->_gyro->_dna._direction = _vm->_trip->kDirLeft;
 			_vm->_trip->rwsp(0, _vm->_trip->kDirLeft);
-			showrw();
+			drawDirection();
 		}
 		break;
 	case kColorLightmagenta: {
 			_vm->_gyro->_dna._direction = _vm->_trip->kDirRight;
 			_vm->_trip->rwsp(0, _vm->_trip->kDirRight);
-			showrw();
+			drawDirection();
 		}
 		break;
 	case kColorRed:
@@ -982,32 +937,28 @@ void Lucerna::mouseway(const Common::Point &cursorPos) {
 	case kColorLightcyan:
 	case kColorYellow: { // Fall-throughs are intended.
 			_vm->_trip->stopwalking();
-			showrw();
+			drawDirection();
 		}
 		break;
 	}
 }
 
-void Lucerna::posxy() {
-	warning("STUB: Lucerna::posxy()");
-}
-
-void Lucerna::fxtoggle() {
+void Lucerna::fxToggle() {
 	warning("STUB: Lucerna::fxtoggle()");
 }
 
-void Lucerna::objectlist() {
+void Lucerna::refreshObjectList() {
 	_vm->_gyro->_dna._carryNum = 0;
 	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1])
-		thinkabout(_vm->_gyro->kObjectMoney, _vm->_gyro->kThing); // you always have money
-	for (byte fv = 0; fv < kObjectNum; fv++)
-		if (_vm->_gyro->_dna._objects[fv]) {
+		thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); // you always have money
+	for (byte i = 0; i < kObjectNum; i++)
+		if (_vm->_gyro->_dna._objects[i]) {
 			_vm->_gyro->_dna._carryNum++;
-			_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = fv + 1;
+			_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1;
 		}
 }
 
-void Lucerna::verte(Common::Point cursorPos) {
+void Lucerna::guideAvvy(Common::Point cursorPos) {
 	if (! _vm->_gyro->_dna._userMovesAvvy)
 		return;
 
@@ -1057,10 +1008,10 @@ void Lucerna::verte(Common::Point cursorPos) {
 		break;
 	}    // No other values are possible.
 
-	showrw();
+	drawDirection();
 }
 
-void Lucerna::checkclick() {
+void Lucerna::checkClick() {
 	Common::Point cursorPos = _vm->getMousePos();
 	_vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 
@@ -1076,7 +1027,7 @@ void Lucerna::checkclick() {
 	else if (!_vm->_gyro->_dropdownActive) { // Dropdown can handle its own pointers.
 		if (holdLeftMouse) {
 			_vm->_gyro->newMouse(7); // Mark's crosshairs
-			verte(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
+			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
 			_vm->_gyro->newMouse(4); // fletch
 	}
@@ -1096,7 +1047,7 @@ void Lucerna::checkclick() {
 		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
 			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
 				if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake)
-					mouseway(cursorPos);
+					useCompass(cursorPos);
 			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
 					_vm->updateEvents();
@@ -1124,7 +1075,7 @@ void Lucerna::checkclick() {
 				_vm->_trip->tr[0].xs = _vm->_gyro->kRun;
 				_vm->_trip->newspeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
-				fxtoggle();
+				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
 				_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
 		} else if (!_vm->_gyro->_dropsOk)
@@ -1132,170 +1083,102 @@ void Lucerna::checkclick() {
 	}
 }
 
-void Lucerna::mouse_init() {
-	_vm->_gyro->setMousePointerWait();
-}
-
-void Lucerna::mousepage(uint16 page_) {
-	warning("STUB: Lucerna::mousepage()");
-}
-
-void Lucerna::errorled() {
+void Lucerna::errorLed() {
 	warning("STUB: Lucerna::errorled()");
 }
 
 int8 Lucerna::fades(int8 x) {
-	byte r = x / 16;
-	x = x % 16;
-	byte g = x / 4;
-	byte b = x % 4;
-	if (r > 0)
-		r--;
-	if (g > 0)
-		g--;
-	if (b > 0)
-		b--;
-
-	return (16 * r + 4 * g + b);
-	// fades = x - 1;
+	warning("STUB: Lucerna::fades()");
+	return 0;
 }
 
-
-
-
-void Lucerna::fadeout(byte n) {
-	warning("STUB: Lucerna::fadeout()"); // I'll bother with colors later.
+void Lucerna::fadeOut(byte n) {
+	warning("STUB: Lucerna::fadeOut()");
 }
 
 void Lucerna::dusk() {
-	warning("STUB: Lucerna::dusk()"); // I'll bother with colors later.
+	warning("STUB: Lucerna::dusk()");
 }
 
-
-
-
-void Lucerna::fadein(byte n) {
-	warning("STUB: Lucerna::fadein()");
+void Lucerna::fadeIn(byte n) {
+	warning("STUB: Lucerna::fadeIn()");
 }
 
 void Lucerna::dawn() {
 	warning("STUB: Lucerna::dawn()");
 }
 
-
-
-void Lucerna::showrw() { // It's data is loaded in load_digits().
+void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 	if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction)
 		return;
+
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
-	CursorMan.showMouse(false);
 
-#if 0
-	for (byte page_ = 0; page_ <= 1; page_++) {
-		setactivepage(page_);
-		putimage(0, 161, rwlite[with.rw], 0);
-	}
-#endif
+	CursorMan.showMouse(false);
 
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161);
 
 	CursorMan.showMouse(true);
-	//setactivepage(1 - cp);
-
-	warning("STUB: Lucerna::showrw()");
 }
 
-
-
-
-
-
-void Lucerna::calchand(uint16 ang, uint16 length, Common::Point &a, byte c) {
-	if (ang > 900) {
-		a.x = 177;
+void Lucerna::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
+	if (angle > 900) {
+		endPoint.x = 177;
 		return;
 	}
 
-	a = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - ang, 450 - ang, length, c);
+	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - angle, 450 - angle, length, color);
 }
 
-void Lucerna::hand(const Common::Point &a, byte c) {
-	if (a.x == 177)
+void Lucerna::drawHand(const Common::Point &endPoint, byte color) {
+	if (endPoint.x == 177)
 		return;
 
-	_vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, a.x, a.y, c);
-}
-
-void Lucerna::refresh_hands() {
-	const ByteField clockspace = {61, 166, 66, 200};
-
-	for (byte page_ = 0; page_ < 2; page_++)
-		_vm->_trip->getset[page_].remember(clockspace);
+	_vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, endPoint.x, endPoint.y, color);
 }
 
-void Lucerna::plothands() {
-	//   off;
-	//setactivepage(3);
-	calchand(_vm->_gyro->_onh, 14, ah, kColorYellow);
-	calchand(_vm->_gyro->_om * 6, 17, am, kColorYellow);
-	hand(ah, kColorBrown);
-	hand(am, kColorBrown);
-
-	calchand(nh, 14, ah, kColorBrown);
-	calchand(_vm->_gyro->_minutes * 6, 17, am, kColorBrown);
-	hand(ah, kColorYellow);
-	hand(am, kColorYellow);
-
-	//setactivepage(1 - cp);
+void Lucerna::plotHands() {
+	calcHand(_vm->_gyro->_onh, 14, _clockHandHour, kColorYellow);
+	calcHand(_vm->_gyro->_om * 6, 17, _clockHandMinute, kColorYellow);
+	drawHand(_clockHandHour, kColorBrown);
+	drawHand(_clockHandMinute, kColorBrown);
 
-	refresh_hands();
-
-	//   on;
+	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
+	calcHand(_vm->_gyro->_minutes * 6, 17, _clockHandMinute, kColorBrown);
+	drawHand(_clockHandHour, kColorYellow);
+	drawHand(_clockHandMinute, kColorYellow);
 }
 
 void Lucerna::chime() {
 	warning("STUB: Lucerna::chime()");
 }
 
-void Lucerna::clock_lucerna() {
-	// ...Clock.
+void Lucerna::updateClock() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
 	TimeDate t;
 	_vm->_system->getTimeAndDate(t);
 	_vm->_gyro->_hours = t.tm_hour;
 	_vm->_gyro->_minutes = t.tm_min;
 	_vm->_gyro->_seconds = t.tm_sec;
 
-	nh = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2;
+	_hourAngle = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2;
 
 	if (_vm->_gyro->_oh != _vm->_gyro->_hours)  {
-		plothands();
+		plotHands();
 		chime();
 	}
 
 	if (_vm->_gyro->_om != _vm->_gyro->_minutes)
-		plothands();
+		plotHands();
 
 	if ((_vm->_gyro->_hours == 0) && (_vm->_gyro->_oh != 0) && (_vm->_gyro->_oh != 17717))
 		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
 
 	_vm->_gyro->_oh = _vm->_gyro->_hours;
-	_vm->_gyro->_onh = nh;
+	_vm->_gyro->_onh = _hourAngle;
 	_vm->_gyro->_om = _vm->_gyro->_minutes;
 }
 
-
-
-void Lucerna::delavvy() {
-	CursorMan.showMouse(false);
-
-//	triptype &with = _vm->_trip->tr[0];
-//	for (byte page_ = 0; page_ <= 1; page_++)
-//		mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
-
-	CursorMan.showMouse(true);
-}
-
-void Lucerna::gameover() {
+void Lucerna::gameOver() {
 	_vm->_gyro->_dna._userMovesAvvy = false;
 
 	int16 sx = _vm->_trip->tr[0].x;
@@ -1307,36 +1190,32 @@ void Lucerna::gameover() {
 	_vm->_trip->tr[0].appear(sx, sy, 0);
 
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
-
 	_vm->_gyro->_alive = false;
 }
 
-/* OK. There are two kinds of redraw: Major and Minor. Minor is what happens
-  when you load a game, etc. Major redraws EVERYTHING. */
-
-void Lucerna::minor_redraw() {
+void Lucerna::minorRedraw() {
 	dusk();
 
-	enterroom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant.
+	enterRoom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant.
 
-	for (byte fv = 0; fv <= 1; fv++) {
+	for (byte i = 0; i <= 1; i++) {
 		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
 		_vm->_trip->getback();
 	}
 
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
-	showscore();
+	drawScore();
 
 	dawn();
 }
 
-void Lucerna::major_redraw() {
+void Lucerna::majorRedraw() {
 	warning("STUB: Lucerna::major_redraw()");
 }
 
-uint16 Lucerna::bearing(byte whichped) {
-	byte pedId = whichped - 1; // Different array indexes in Pascal and C.
+uint16 Lucerna::bearing(byte whichPed) {
+	byte pedId = whichPed - 1; // Different array indexes in Pascal and C.
 
 	const double rad2deg = 180 / 3.14; // Pi
 
@@ -1351,25 +1230,20 @@ uint16 Lucerna::bearing(byte whichped) {
 	}
 }
 
-void Lucerna::sprite_run() {
-/* A sprite run is performed before displaying a scroll, if not all the
-  sprites are still. It performs two fast cycles, only using a few of
-  the links usually used, and without any extra animation. This should
-  make the sprites the same on both pages. */
+void Lucerna::spriteRun() {
 	_vm->_gyro->_doingSpriteRun = true;
 
 	_vm->_trip->get_back_loretta();
 	_vm->_trip->trippancy_link();
 
 	_vm->_gyro->_doingSpriteRun = false;
-
 }
 
-void Lucerna::fix_flashers() {
+void Lucerna::fixFlashers() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_gyro->_oldDirection = 177;
 	_vm->_scrolls->state(2);
-	showrw();
+	drawDirection();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 1436e38..6835fe0 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -45,94 +45,69 @@ public:
 
 	void init();
 	void callVerb(byte id);
-	void draw_also_lines();
-	void mouse_init();
-	void mousepage(uint16 page_);
-	void load(byte n);
-	void exitroom(byte x);
-	void enterroom(byte x, byte ped);
-	void thinkabout(byte z, bool th);      // Hey!!! Get it and put it!!!
-	void load_digits();    // Load the scoring digits & rwlites
-	void toolbar();
-	void showscore();
-	void points(byte num);      // Add on no. of points
-	void mouseway(const Common::Point &cursorPos);
-	void posxy();
-	void fxtoggle();
-	void objectlist();
-	void checkclick();
-	void errorled();
+	void drawAlsoLines();
+	void loadRoom(byte num);
+	void exitRoom(byte x);
+	void enterRoom(byte room, byte ped);
+	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
+	void loadDigits(); // Load the scoring digits & rwlites
+	void drawToolbar();
+	void drawScore();
+	void incScore(byte num); // Add on no. of points
+	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
+	void fxToggle();
+	void refreshObjectList();
+	void checkClick();
+	void errorLed();
 	void dusk();
 	void dawn();
-	void showrw();
-	void clock_lucerna();
-	void delavvy();
-	void gameover();
-	void minor_redraw();
-	void major_redraw();
-	uint16 bearing(byte whichped); // Returns the bearing from ped Whichped to Avvy, in degrees.
-	void flesh_colors();
-	void sprite_run();
-	void fix_flashers();
-	void load_also(Common::String n);
+	void drawDirection(); // Draws the little icon at the left end of the text input field.
+	void updateClock();
+	void gameOver();
+	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
+	void fixFlashers();
+	void loadAlso(byte num);
 
-private:
-	AvalancheEngine *_vm;
+	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
+	void minorRedraw();
+	void majorRedraw();
 
-	struct rgbrec {
-		int16 red;
-		int16 green;
-		int16 blue;
-	};
+	// A sprite run is performed before displaying a scroll, if not all the sprites are still. It performs two fast cycles, only using a few of
+	// the links usually used, and without any extra animation. This should make the sprites the same on both pages.
+	void spriteRun();
 
-	struct palettetype {
-		int32 size;
-		rgbrec colors[256];
-	};
+private:
+	AvalancheEngine *_vm;
 
 	//Clock
 	static const int16 _clockCenterX = 510;
 	static const int16 _clockCenterY = 183;
-	Common::Point ah, am;
-	uint16 nh;
-
-
-	palettetype fxpal[4];
-
-	bool fxhidden;
-
-	Common::File f;
+	Common::Point _clockHandHour, _clockHandMinute; // ah and am in the original.
+	uint16 _hourAngle; // nh in the original.
 
+	bool _fxHidden; // Will de used in dust() and dawn().
 
+	Common::File file;
 
+	Common::String readAlsoStringFromFile(); // 'nexstring' in the original.
+	void scram(Common::String &str);
+	void unScramble();
 
-	Common::String nextstring();
-	void scram1(Common::String &x);
-	void unscramble();
-
-	void zoomout(int16 x, int16 y);
-
-	void find_people(byte room);
-
-	void new_town();
-
-	void put_geida_at(byte whichped, byte &ped);
-
-	void topcheck(Common::Point cursorPos);
-
-	void verte(Common::Point cursorPos);
+	void zoomOut(int16 x, int16 y); // Only used when entering the map.
+	void enterNewTown(); // Onyl when entering a NEW town! Not returning to the last one, but choosing another from the map.
+	void findPeople(byte room);
+	void putGeidaAt(byte whichPed, byte &ped);
+	void guideAvvy(Common::Point cursorPos); // 'verte' in the original.
 
+	// Used in dusk() and dawn().
 	int8 fades(int8 x);
+	void fadeOut(byte n);
+	void fadeIn(byte n);
 
-	void fadeout(byte n);
-
-	void fadein(byte n);
-
-	// clock_lucerna
-	void calchand(uint16 ang, uint16 length, Common::Point &a, byte c);
-	void hand(const Common::Point &a, byte c);
-	void refresh_hands();
-	void plothands();
+	// Clock
+	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
+	void drawHand(const Common::Point &endPoint, byte color);
+	void plotHands();
 	void chime();
 
 };
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 67247a4..16e0fb1 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -123,7 +123,6 @@ void Scrolls::normscroll() {
 	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(4);
-	_vm->_lucerna->mousepage(1 - _vm->_gyro->_cp);
 
 
 
@@ -185,7 +184,6 @@ void Scrolls::normscroll() {
 
 	state(0);
 	_vm->_gyro->_seeScroll = false;
-	_vm->_lucerna->mousepage(_vm->_gyro->_cp);
 	CursorMan.showMouse(false);
 	_vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick().
 
@@ -258,7 +256,7 @@ void Scrolls::resetscrolldriver() {   // phew
 
 void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little...
 	for (byte fv = 0; fv < _vm->_gyro->_scrollBells; fv++)
-		_vm->_lucerna->errorled(); // ring the bell "x" times
+		_vm->_lucerna->errorLed(); // ring the bell "x" times
 }
 
 void Scrolls::dodgem() {
@@ -666,7 +664,7 @@ void Scrolls::calldrivers() {
 					break;
 
 				if (call_spriterun)
-					_vm->_lucerna->sprite_run();
+					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
 				drawscroll(&Avalanche::Scrolls::normscroll);
@@ -685,14 +683,14 @@ void Scrolls::calldrivers() {
 					break;
 
 				if (call_spriterun)
-					_vm->_lucerna->sprite_run();
+					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
 				if (param == 0)
 					natural();
 				else if ((1 <= param) && (param <= 9)) {
 					if ((param > _vm->_trip->kSpriteNumbMax) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
-						_vm->_lucerna->errorled();
+						_vm->_lucerna->errorLed();
 						natural();
 					} else
 						_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
@@ -706,7 +704,7 @@ void Scrolls::calldrivers() {
 					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor;
 					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors.
 				} else {
-					_vm->_lucerna->errorled(); // Not valid.
+					_vm->_lucerna->errorLed(); // Not valid.
 					natural();
 				}
 
@@ -747,7 +745,7 @@ void Scrolls::calldrivers() {
 						_vm->_visa->dixi('q', 37); // You find the sixpence.
 						_vm->_gyro->_dna._money += 6;
 						_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing;
-						_vm->_lucerna->points(2);
+						_vm->_lucerna->incScore(2);
 						return;
 					}
 					break;
@@ -777,7 +775,7 @@ void Scrolls::calldrivers() {
 				break;
 			case kControlQuestion: {
 				if (call_spriterun)
-					_vm->_lucerna->sprite_run();
+					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
 				_vm->_gyro->_scrollNum++;
@@ -850,7 +848,7 @@ void Scrolls::musical_scroll() {
 		+ kControlInsertSpaces + "Q W E R T Y U I O P [ ]" + kControlNewLine + kControlNewLine + "Or press Enter to stop playing."
 		+ kControlToBuffer);
 
-	_vm->_lucerna->sprite_run();
+	_vm->_lucerna->spriteRun();
 
 	drawscroll(&Avalanche::Scrolls::music_scroll);
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 085df26..2383d02 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -239,13 +239,13 @@ void Timeout::avaricius_talks() {
 	if (_vm->_gyro->_dna._avariciusTalk < 17)
 		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
 	else
-		_vm->_lucerna->points(3);
+		_vm->_lucerna->incScore(3);
 }
 
 void Timeout::urinate() {
 	_vm->_trip->tr[0].turn(_vm->_trip->kDirUp);
 	_vm->_trip->stopwalking();
-	_vm->_lucerna->showrw();
+	_vm->_lucerna->drawDirection();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
 }
 
@@ -349,7 +349,7 @@ void Timeout::after_the_shootemup() {
 	_vm->_trip->apped(1, 2);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
-	_vm->_lucerna->objectlist();
+	_vm->_lucerna->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
 	_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
@@ -399,7 +399,7 @@ void Timeout::jacques_wakes_up() {
 	if (_vm->_gyro->_dna._jacquesState == 5) {
 		_vm->_gyro->_dna._bellsAreRinging = true;
 		_vm->_gyro->_dna._aylesIsAwake = true;
-		_vm->_lucerna->points(2);
+		_vm->_lucerna->incScore(2);
 	}
 
 	switch (_vm->_gyro->_dna._jacquesState) {
@@ -480,9 +480,9 @@ void Timeout::jump() {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
-			_vm->_lucerna->objectlist();
+			_vm->_lucerna->refreshObjectList();
 			_vm->_visa->dixi('q', 50);
-			_vm->_lucerna->points(3);
+			_vm->_lucerna->incScore(3);
 		}
 	}
 }
@@ -513,14 +513,14 @@ void Timeout::buywine() {
 	if (_vm->_gyro->decreaseMoney(3)) {
 		_vm->_visa->dixi('D', 4); // You paid up.
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._wineState = 1; // OK Wine.
 	}
 }
 
 void Timeout::callsguards() {
 	_vm->_visa->dixi('Q', 58); // "GUARDS!!!"
-	_vm->_lucerna->gameover();
+	_vm->_lucerna->gameOver();
 }
 
 void Timeout::greetsmonk() {
@@ -539,7 +539,7 @@ void Timeout::meet_avaroid() {
 	if (_vm->_gyro->_dna._metAvaroid) {
 		_vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
-		_vm->_lucerna->gameover();
+		_vm->_lucerna->gameOver();
 	} else {
 		_vm->_visa->dixi('Q', 60);
 		_vm->_gyro->_dna._metAvaroid = true;
@@ -663,7 +663,7 @@ void Timeout::spludwick_leaves_cauldron() {
 
 void Timeout::give_lute_to_geida() { // Moved here from Acci.
 	_vm->_visa->dixi('Q', 86);
-	_vm->_lucerna->points(4);
+	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_dna._lustieIsAsleep = true;
 	_vm->_sequence->first_show(5);
 	_vm->_sequence->then_show(6); // He falls asleep...
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index c74efb5..b94697f 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -263,7 +263,7 @@ void triptype::bounce() {
 	else
 		stopwalk();
 	_tr->_vm->_gyro->_onCanDoPageSwap = false;
-	_tr->_vm->_lucerna->showrw();
+	_tr->_vm->_lucerna->drawDirection();
 	_tr->_vm->_gyro->_onCanDoPageSwap = true;
 }
 
@@ -565,7 +565,7 @@ void Trip::catamove(byte ped) {
 	}
 
 	if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom)
-		_vm->_lucerna->load(29);
+		_vm->_lucerna->loadRoom(29);
 	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1];
 
 	switch (here & 0xf) { // West.
@@ -928,7 +928,7 @@ void Trip::call_special(uint16 which) {
 			tr[1].turn(kDirDown);
 			tr[1].stopwalk();
 			tr[1].call_eachstep = false; // Geida
-			_vm->_lucerna->gameover();
+			_vm->_lucerna->gameOver();
 		}
 		break;
 	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
@@ -955,7 +955,6 @@ void Trip::call_special(uint16 which) {
 		catamove(4);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		_vm->_lucerna->delavvy();
 		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			apped(1, 12);
@@ -975,7 +974,6 @@ void Trip::call_special(uint16 which) {
 		catamove(1);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		_vm->_lucerna->delavvy();
 		apped(1, 1);
 		getback();
 		dawndelay();
@@ -986,7 +984,6 @@ void Trip::call_special(uint16 which) {
 		catamove(2);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		_vm->_lucerna->delavvy();
 		apped(1, 2);
 		getback();
 		dawndelay();
@@ -997,7 +994,6 @@ void Trip::call_special(uint16 which) {
 		catamove(3);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		_vm->_lucerna->delavvy();
 		apped(1, 3);
 		getback();
 		dawndelay();
@@ -1224,7 +1220,7 @@ void Trip::arrow_procs(byte tripnum) {
 			end;
 			on;
 #endif
-			_vm->_lucerna->gameover();
+			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
 			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
@@ -1499,7 +1495,7 @@ void Trip::fliproom(byte room, byte ped) {
 		return;
 	}
 
-	_vm->_lucerna->exitroom(_vm->_gyro->_dna._room);
+	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
 	_vm->_lucerna->dusk();
 	getsetclear();
 
@@ -1512,12 +1508,12 @@ void Trip::fliproom(byte room, byte ped) {
 	if (_vm->_gyro->_dna._room == r__lustiesroom)
 		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
 
-	_vm->_lucerna->enterroom(room, ped);
+	_vm->_lucerna->enterRoom(room, ped);
 	apped(1, ped);
 	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
 	_vm->_gyro->_dna._direction = tr[0].face;
-	_vm->_lucerna->showrw();
+	_vm->_lucerna->drawDirection();
 
 	for (fv = 0; fv <= 1; fv++) {
 		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 2f438ba..bcdf7b7 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -175,8 +175,8 @@ void Visa::talkto(byte whom) {
 			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) {
 				dixi('q', 68);
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
-				_vm->_lucerna->objectlist();
-				_vm->_lucerna->points(3);
+				_vm->_lucerna->refreshObjectList();
+				_vm->_lucerna->incScore(3);
 				return;
 			} else {
 				if (_vm->_gyro->_dna._talkedToCrapulus)
@@ -277,7 +277,7 @@ void Visa::talkto(byte whom) {
 
 	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = true;
-		_vm->_lucerna->objectlist();
+		_vm->_lucerna->refreshObjectList();
 		dixi('q', 1); // Circular from Cardiff.
 		_vm->_gyro->_dna._talkedToCrapulus = true;
 
@@ -286,7 +286,7 @@ void Visa::talkto(byte whom) {
 		_vm->_trip->tr[1].vanishifstill = true;
 		_vm->_trip->tr[1].walkto(3); // Walks away.
 
-		_vm->_lucerna->points(2);
+		_vm->_lucerna->incScore(2);
 	}
 }
 


Commit: 467a7b1cce55680bddbae18fe655b386a4f3d051
    https://github.com/scummvm/scummvm/commit/467a7b1cce55680bddbae18fe655b386a4f3d051
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T09:00:00-07:00

Commit Message:
AVALANCHE: Introduce a new class: Clock.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index fbdeb25..27cfdd1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -525,10 +525,10 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
+			_lucerna->_holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
 			break;
 		case Common::EVENT_LBUTTONUP:
-			_lucerna->holdLeftMouse = false; // Same as above.
+			_lucerna->_holdLeftMouse = false; // Same as above.
 			break;
 		case Common::EVENT_KEYDOWN:
 			_avalot->handleKeyDown(event);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ff8a5aa..814de63 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -198,7 +198,7 @@ void Avalot::run(Common::String arg) {
 
 
 
-		_vm->_lucerna->updateClock();
+		_vm->_lucerna->_clock.update();
 		_vm->_dropdown->updateMenu();
 		_vm->_gyro->forceNumlock();
 		_vm->_trip->get_back_loretta();
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index b0b3b2f..9894769 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -728,11 +728,11 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 	::Graphics::Surface backup;
 	backup.copyFrom(_vm->_graphics->_surface);
 
-	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->holdLeftMouse) {
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
 		_menuBar.chooseMenuItem(cursorPos.x);
 		do
 			_vm->updateEvents();
-		while (_vm->_lucerna->holdLeftMouse);
+		while (_vm->_lucerna->_holdLeftMouse);
 
 
 		while (!_vm->shouldQuit()) {
@@ -755,16 +755,16 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 				_activeMenuItem.lightUp(cursorPos);
 
 				_vm->_graphics->refreshScreen();
-			} while (!_vm->_lucerna->holdLeftMouse);
+			} while (!_vm->_lucerna->_holdLeftMouse);
 
-			if (_vm->_lucerna->holdLeftMouse) {
+			if (_vm->_lucerna->_holdLeftMouse) {
 				if (cursorPos.y > 21) {
 					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
 						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1))))) {
 							// Clicked OUTSIDE the menu.
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
-								_vm->_lucerna->holdLeftMouse = false;
+								_vm->_lucerna->_holdLeftMouse = false;
 								backup.free();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
@@ -778,11 +778,11 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
-							_vm->_lucerna->holdLeftMouse = false;
+							_vm->_lucerna->_holdLeftMouse = false;
 							backup.free();
 							return;
 						} else {
-							_vm->_lucerna->holdLeftMouse = true;
+							_vm->_lucerna->_holdLeftMouse = true;
 							break;
 						}
 					}
@@ -799,7 +799,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 							_vm->_graphics->refreshScreen();
 
 							_vm->updateEvents();
-							if (!_vm->_lucerna->holdLeftMouse)
+							if (!_vm->_lucerna->_holdLeftMouse)
 								break;
 						}
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index cc62417..fd36ade 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -279,7 +279,7 @@ void Gyro::newGame() {
 	_vm->_trip->new_game_for_trippancy();
 	_vm->_lucerna->drawScore();
 	_vm->_dropdown->setupMenu();
-	_vm->_lucerna->updateClock();
+	_vm->_lucerna->_clock.update();
 	_vm->_lucerna->spriteRun();
 }
 
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index e1ce464..21ea9da 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -356,7 +356,6 @@ public:
 	byte _fieldNum;
 	Common::String _flags;
 	Common::String _listen;
-	uint16 _oh, _onh, _om, _hours, _minutes, _seconds; // For Timeout. TODO: Move them into it.
 	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
 	byte _cp, _ledStatus, _defaultLed;
 	FontType _font;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 76b2836..5ecd009 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -49,7 +49,71 @@
 
 namespace Avalanche {
 
-Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false) {
+const Common::Point Clock::kCenter(510,183);
+
+Clock::Clock(AvalancheEngine *vm) {
+	_vm = vm;
+	_oldHour = _oldHourAngle = _oldMinute = 17717;
+}
+
+void Clock::update() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
+	TimeDate t;
+	_vm->_system->getTimeAndDate(t);
+	_hour = t.tm_hour;
+	_minute = t.tm_min;
+	_second = t.tm_sec;
+
+	_hourAngle = (_hour % 12) * 30 + _minute / 2;
+
+	if (_oldHour != _hour)  {
+		plotHands();
+		chime();
+	}
+
+	if (_oldMinute != _minute)
+		plotHands();
+
+	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717))
+		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
+
+	_oldHour = _hour;
+	_oldHourAngle = _hourAngle;
+	_oldMinute = _minute;
+}
+
+void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
+	if (angle > 900) {
+		endPoint.x = 177;
+		return;
+	}
+
+	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenter.x, kCenter.y, 449 - angle, 450 - angle, length, color);
+}
+
+void Clock::drawHand(const Common::Point &endPoint, byte color) {
+	if (endPoint.x == 177)
+		return;
+
+	_vm->_graphics->_surface.drawLine(kCenter.x, kCenter.y, endPoint.x, endPoint.y, color);
+}
+
+void Clock::plotHands() {
+	calcHand(_oldHourAngle, 14, _clockHandHour, kColorYellow);
+	calcHand(_oldMinute * 6, 17, _clockHandMinute, kColorYellow);
+	drawHand(_clockHandHour, kColorBrown);
+	drawHand(_clockHandMinute, kColorBrown);
+
+	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
+	calcHand(_minute * 6, 17, _clockHandMinute, kColorBrown);
+	drawHand(_clockHandHour, kColorYellow);
+	drawHand(_clockHandMinute, kColorYellow);
+}
+
+void Clock::chime() {
+	warning("STUB: Lucerna::chime()");
+}
+
+Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false), _clock(vm) {
 	_vm = vm;
 }
 
@@ -63,8 +127,6 @@ Lucerna::~Lucerna() {
 }
 
 void Lucerna::init() {
-	_vm->_gyro->_oh = _vm->_gyro->_onh = _vm->_gyro->_om = 17717;
-
 	for (byte i = 0; i < 31; i++)
 		for (byte j = 0; j < 2; j++)
 			_vm->_gyro->_also[i][j] = 0;
@@ -111,9 +173,7 @@ void Lucerna::drawAlsoLines() {
 	CursorMan.showMouse(true);
 }
 
-
-
-// nextstring, scram1 and unscrable are only used in load_also
+// readAlsoStringFromFile, scram and unScramble are only used in loadAlso
 
 Common::String Lucerna::readAlsoStringFromFile() {
 	Common::String str;
@@ -1025,14 +1085,14 @@ void Lucerna::checkClick() {
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
 		_vm->_gyro->newMouse(2); // screwdriver
 	else if (!_vm->_gyro->_dropdownActive) { // Dropdown can handle its own pointers.
-		if (holdLeftMouse) {
+		if (_holdLeftMouse) {
 			_vm->_gyro->newMouse(7); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
 			_vm->_gyro->newMouse(4); // fletch
 	}
 
-	if (holdLeftMouse) {
+	if (_holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->_dropsOk)
 				_vm->_dropdown->updateMenu();
@@ -1051,7 +1111,7 @@ void Lucerna::checkClick() {
 			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
 					_vm->updateEvents();
-				} while (holdLeftMouse);
+				} while (_holdLeftMouse);
 
 				if (_vm->_gyro->_thinkThing) {
 					_vm->_acci->_thing = _vm->_gyro->_thinks;
@@ -1065,7 +1125,7 @@ void Lucerna::checkClick() {
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
-				} while (holdLeftMouse);
+				} while (_holdLeftMouse);
 
 				callVerb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
@@ -1121,62 +1181,6 @@ void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 	CursorMan.showMouse(true);
 }
 
-void Lucerna::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
-	if (angle > 900) {
-		endPoint.x = 177;
-		return;
-	}
-
-	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, _clockCenterX, _clockCenterY, 449 - angle, 450 - angle, length, color);
-}
-
-void Lucerna::drawHand(const Common::Point &endPoint, byte color) {
-	if (endPoint.x == 177)
-		return;
-
-	_vm->_graphics->_surface.drawLine(_clockCenterX, _clockCenterY, endPoint.x, endPoint.y, color);
-}
-
-void Lucerna::plotHands() {
-	calcHand(_vm->_gyro->_onh, 14, _clockHandHour, kColorYellow);
-	calcHand(_vm->_gyro->_om * 6, 17, _clockHandMinute, kColorYellow);
-	drawHand(_clockHandHour, kColorBrown);
-	drawHand(_clockHandMinute, kColorBrown);
-
-	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
-	calcHand(_vm->_gyro->_minutes * 6, 17, _clockHandMinute, kColorBrown);
-	drawHand(_clockHandHour, kColorYellow);
-	drawHand(_clockHandMinute, kColorYellow);
-}
-
-void Lucerna::chime() {
-	warning("STUB: Lucerna::chime()");
-}
-
-void Lucerna::updateClock() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
-	TimeDate t;
-	_vm->_system->getTimeAndDate(t);
-	_vm->_gyro->_hours = t.tm_hour;
-	_vm->_gyro->_minutes = t.tm_min;
-	_vm->_gyro->_seconds = t.tm_sec;
-
-	_hourAngle = (_vm->_gyro->_hours % 12) * 30 + _vm->_gyro->_minutes / 2;
-
-	if (_vm->_gyro->_oh != _vm->_gyro->_hours)  {
-		plotHands();
-		chime();
-	}
-
-	if (_vm->_gyro->_om != _vm->_gyro->_minutes)
-		plotHands();
-
-	if ((_vm->_gyro->_hours == 0) && (_vm->_gyro->_oh != 0) && (_vm->_gyro->_oh != 17717))
-		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
-
-	_vm->_gyro->_oh = _vm->_gyro->_hours;
-	_vm->_gyro->_onh = _hourAngle;
-	_vm->_gyro->_om = _vm->_gyro->_minutes;
-}
 
 void Lucerna::gameOver() {
 	_vm->_gyro->_dna._userMovesAvvy = false;
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 6835fe0..2260c46 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -36,10 +36,32 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-class Lucerna {
+class Clock {
 public:
-	bool holdLeftMouse;
+	Clock(AvalancheEngine *vm);
+
+	void update();
+	
+private:
+	static const Common::Point kCenter;
+
+	AvalancheEngine *_vm;
+
+	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle; // hourAngle = nh in the original.
+	Common::Point _clockHandHour, _clockHandMinute; // ah and am in the original.
+
+	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
+	void drawHand(const Common::Point &endPoint, byte color);
+	void plotHands();
+	void chime();
 
+};
+
+class Lucerna {
+public:
+	bool _holdLeftMouse;
+	Clock _clock;
+	
 	Lucerna(AvalancheEngine *vm);
 	~Lucerna();
 
@@ -62,7 +84,6 @@ public:
 	void dusk();
 	void dawn();
 	void drawDirection(); // Draws the little icon at the left end of the text input field.
-	void updateClock();
 	void gameOver();
 	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
 	void fixFlashers();
@@ -79,12 +100,6 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	//Clock
-	static const int16 _clockCenterX = 510;
-	static const int16 _clockCenterY = 183;
-	Common::Point _clockHandHour, _clockHandMinute; // ah and am in the original.
-	uint16 _hourAngle; // nh in the original.
-
 	bool _fxHidden; // Will de used in dust() and dawn().
 
 	Common::File file;
@@ -104,12 +119,6 @@ private:
 	void fadeOut(byte n);
 	void fadeIn(byte n);
 
-	// Clock
-	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
-	void drawHand(const Common::Point &endPoint, byte color);
-	void plotHands();
-	void chime();
-
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 16e0fb1..56f605a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -185,7 +185,7 @@ void Scrolls::normscroll() {
 	state(0);
 	_vm->_gyro->_seeScroll = false;
 	CursorMan.showMouse(false);
-	_vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick().
+	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
 
 	warning("STUB: Scrolls::normscroll()");
 }


Commit: 00a963b840c7d0cbb227cc4ac9f8e3ddaa2e9d42
    https://github.com/scummvm/scummvm/commit/00a963b840c7d0cbb227cc4ac9f8e3ddaa2e9d42
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T09:03:36-07:00

Commit Message:
AVALANCHE: Do renaming/refactoring in Parser.

Changed paths:
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 073fdfd..fc505e4 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -135,7 +135,7 @@ void Parser::cursorOff() {
 }
 
 void Parser::tryDropdown() {
-	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown.
+	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown's keyboard handling.
 }
 
 int16 Parser::pos(const Common::String &crit, const Common::String &src) {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 70a87b6..b6ee046 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -42,35 +42,23 @@ public:
 	byte _leftMargin;
 	bool _cursorState;
 
-
-
 	Parser(AvalancheEngine *vm);
 
 	void init();
-
 	void handleInputText(const Common::Event &event);
-
 	void handleBackspace();
-
 	void handleReturn();
-
 	void handleFunctionKey(const Common::Event &event);
-
 	void plotText();
-
 	void cursorOn();
-
 	void cursorOff();
-
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
-
 	int16 pos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
 
 private:
 	AvalancheEngine *_vm;
 
 	void drawCursor();
-
 	void wipeText();
 
 };


Commit: 0fa45b0fd260dde0650f9d96a1eab084be332d54
    https://github.com/scummvm/scummvm/commit/0fa45b0fd260dde0650f9d96a1eab084be332d54
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T09:18:25-07:00

Commit Message:
AVALANCHE: Do renaming in Pingo.

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/pingo2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5ecd009..1f968db 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -74,7 +74,8 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 		plotHands();
 
 	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717))
-		_vm->_scrolls->display(Common::String("Good morning!\n\nYes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!"));
+		_vm->_scrolls->display(Common::String("Good morning!") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+		+ "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
 
 	_oldHour = _hour;
 	_oldHourAngle = _hourAngle;
@@ -110,7 +111,7 @@ void Clock::plotHands() {
 }
 
 void Clock::chime() {
-	warning("STUB: Lucerna::chime()");
+	warning("STUB: Clock::chime()");
 }
 
 Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false), _clock(vm) {
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index cc9592b..c61b6bb 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -44,11 +44,11 @@ Pingo::Pingo(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-void Pingo::dplot(int16 x, int16 y, Common::String z) {
-	warning("STUB: Pingo::dplot()");
+void Pingo::dPlot(int16 x, int16 y, Common::String z) {
+	warning("STUB: Pingo::dPlot()");
 }
 
-void Pingo::bosskey() {
+void Pingo::bossKey() {
 #if 0
 const
 	months : array[0..11] of char = 'JFMAMJJASOND';
@@ -82,7 +82,7 @@ begin;
 	copy02;
 #endif
 
-	warning("STUB: Pingo::bosskey()");
+	warning("STUB: Pingo::bossKey()");
 }
 
 void Pingo::copy02() {   // taken from Wobble (below)
@@ -93,8 +93,8 @@ void Pingo::copy03() {   // taken from Wobble (below)
 	warning("STUB: Pingo::copy03()");
 }
 
-void Pingo::copypage(byte frp, byte top) { // taken from Copy02 (above)
-	warning("STUB: Pingo::copypage()");
+void Pingo::copyPage(byte frp, byte top) { // taken from Copy02 (above)
+	warning("STUB: Pingo::copyPage()");
 }
 
 void Pingo::wobble() {
@@ -109,7 +109,7 @@ void Pingo::zonk() {
 	warning("STUB: Pingo::zonk()");
 }
 
-void Pingo::winning_pic() {
+void Pingo::winningPic() {
 	Common::File f;
 	_vm->_lucerna->dusk();
 
@@ -128,12 +128,12 @@ void Pingo::winning_pic() {
 	}
 #endif
 
-	warning("STUB: Pingo::winning_pic()");
+	warning("STUB: Pingo::winningPic()");
 
 	f.close();
 
 	//setvisualpage(0);
-	warning("STUB: Pingo::winning_pic()");
+	warning("STUB: Pingo::winningPic()");
 
 	_vm->_lucerna->dawn();
 
@@ -146,7 +146,7 @@ void Pingo::winning_pic() {
 	major_redraw();
 #endif
 
-	warning("STUB: Pingo::winning_pic()");
+	warning("STUB: Pingo::winningPic()");
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/pingo2.h b/engines/avalanche/pingo2.h
index 1228ab2..ee4fb58 100644
--- a/engines/avalanche/pingo2.h
+++ b/engines/avalanche/pingo2.h
@@ -40,25 +40,18 @@ class Pingo {
 public:
 	Pingo(AvalancheEngine *vm);
 
-	void bosskey();
-
+	void bossKey();
 	void copy02();
-
-	void copy03(); // Should always be replaced with _vm->_graph.refreshScreen(); - See Avalot::setup();
-
-	void copypage(byte frp, byte top);
-
+	void copy03();
+	void copyPage(byte frp, byte top);
 	void wobble();
-
 	void zonk();
-
-	void winning_pic();
+	void winningPic();
 
 private:
 	AvalancheEngine *_vm;
 
-	void dplot(int16 x, int16 y, Common::String z);
-
+	void dPlot(int16 x, int16 y, Common::String z);
 	void zl(int16 x1, int16 y1, int16 x2, int16 y2);
 };
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 2383d02..bc5a534 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -621,14 +621,14 @@ void Timeout::arkata_shouts() {
 void Timeout::winning() {
 	_vm->_visa->dixi('q', 79);
 
-	_vm->_pingo->winning_pic();
+	_vm->_pingo->winningPic();
 	warning("STUB: Timeout::winning()");
 #if 0
 	do {
 		_vm->_lucerna->checkclick();
 	} while (!(_vm->_gyro->mrelease == 0));
 #endif
-	// TODO: To be implemented with Pingo::winning_pic().
+	// TODO: To be implemented with Pingo::winningPic().
 
 	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
 	_vm->_scrolls->display(" T H E    E N D ");


Commit: 0ad51df7d92857d7b526a09b6d1558e34e01f959
    https://github.com/scummvm/scummvm/commit/0ad51df7d92857d7b526a09b6d1558e34e01f959
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T09:23:50-07:00

Commit Message:
AVALANCHE: Remove 2 variables from Visa2

Changed paths:
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index bcdf7b7..635e14d 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -45,9 +45,6 @@ Visa::Visa(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-bool Visa::bubbling = false;
-bool Visa::report_dixi_errors = true;
-
 void Visa::unskrimble() {
 	for (uint16  fv = 0; fv < _vm->_gyro->_bufSize; fv++)
 		_vm->_gyro->_buffer[fv] = (~(_vm->_gyro->_buffer[fv] - (fv + 1))) % 256;
@@ -58,7 +55,7 @@ void Visa::do_the_bubble() {
 	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
 }
 
-void Visa::dixi(char block, byte point) {
+void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 	Common::File indexfile, sezfile;
 	uint16 idx_offset, sez_offset;
 	bool error = false;
@@ -83,7 +80,7 @@ void Visa::dixi(char block, byte point) {
 	went_ok = !error;
 
 	if (error) {
-		if (report_dixi_errors) {
+		if (report) {
 			Common::String todisplay;
 			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->intToStr(point).c_str());
 			_vm->_scrolls->display(todisplay);
@@ -113,12 +110,7 @@ void Visa::speech(byte who, byte subject) {
 
 	if (subject == 0) {
 		// No subject.
-
-		bubbling = true;
-		report_dixi_errors = false;
-		dixi('s', who);
-		bubbling = false;
-		report_dixi_errors = true;
+		dixi('s', who, false, true);
 	} else {
 		// Subject given.
 
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index 37cb177..9d26d7a 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -38,23 +38,15 @@ class AvalancheEngine;
 class Visa {
 public:
 	Visa(AvalancheEngine *vm);
-
-	void dixi(char block, byte point);
-
+	void dixi(char block, byte point, bool report = true, bool bubbling = false);
 	void talkto(byte whom);
 
 private:
 	AvalancheEngine *_vm;
 
-	static bool bubbling;
-	static bool report_dixi_errors;
-
 	bool went_ok;
-
 	void unskrimble();
-
 	void do_the_bubble();
-
 	void speech(byte who, byte subject);
 };
 


Commit: 9097e801537e0e80f2d7df7938f79d145ee362df
    https://github.com/scummvm/scummvm/commit/9097e801537e0e80f2d7df7938f79d145ee362df
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T09:40:15-07:00

Commit Message:
AVALANCHE: Minor cosmetic fixes in Lucerna.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1f968db..0c2e01a 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1020,13 +1020,13 @@ void Lucerna::refreshObjectList() {
 }
 
 void Lucerna::guideAvvy(Common::Point cursorPos) {
-	if (! _vm->_gyro->_dna._userMovesAvvy)
+	if (!_vm->_gyro->_dna._userMovesAvvy)
 		return;
 
 	cursorPos.y /= 2;
 	byte what;
 
-	// _vm->_trip->tr[0] : that's the only one we're interested in here. (It's Avalot.)
+	// _vm->_trip->tr[0] is Avalot.)
 	if (cursorPos.x < _vm->_trip->tr[0].x)
 		what = 1;
 	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength))


Commit: d96555406ec215f390904d15c729ab6528f8b28f
    https://github.com/scummvm/scummvm/commit/d96555406ec215f390904d15c729ab6528f8b28f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T10:11:34-07:00

Commit Message:
AVALANCHE: Rename trip into animation, some more renaming

Changed paths:
  A engines/avalanche/animation.cpp
  A engines/avalanche/animation.h
  R engines/avalanche/trip6.cpp
  R engines/avalanche/trip6.h
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 0712fd0..407bffb 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -35,7 +35,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/pingo2.h"
@@ -407,8 +407,8 @@ void Acci::storeInterrogation(byte interrogation) {
 			_vm->_gyro->_dna._spareEvening.clear();
 		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->dixi('z', 5); // His closing statement...
-		_vm->_trip->tr[1].walkto(4); // The end of the drawbridge
-		_vm->_trip->tr[1].vanishifstill = true; // Then go away!
+		_vm->_animation->tr[1].walkto(4); // The end of the drawbridge
+		_vm->_animation->tr[1].vanishifstill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_gyro->_dna._cardiffQuestionNum = 5;
 		break;
@@ -708,7 +708,7 @@ void Acci::openBox(bool isOpening) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		_vm->_celer->updateBackgroundSprites();
-		_vm->_trip->trippancy_link();
+		_vm->_animation->trippancy_link();
 		_vm->_graphics->refreshScreen();
 
 		_vm->_system->delayMillis(55);
@@ -716,7 +716,7 @@ void Acci::openBox(bool isOpening) {
 		if (!isOpening) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_celer->updateBackgroundSprites();
-			_vm->_trip->trippancy_link();
+			_vm->_animation->trippancy_link();
 			_vm->_graphics->refreshScreen();
 		}
 	}
@@ -896,7 +896,7 @@ void Acci::openDoor() {
 	// Special cases.
 	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
-		if (_vm->_trip->infield(2)) {
+		if (_vm->_animation->infield(2)) {
 			// Opening the box.
 			_thing = 54; // The box.
 			_person = kPardon;
@@ -916,28 +916,28 @@ void Acci::openDoor() {
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte fv = 8; fv < 15; fv++) {
-		if (_vm->_trip->infield(fv + 1)) {
+		if (_vm->_animation->infield(fv + 1)) {
 			fv -= 8;
 
 			switch (_vm->_gyro->_portals[fv]._operation) {
 			case Gyro::kMagicExclaim:
-				_vm->_trip->tr[0].bounce();
+				_vm->_animation->tr[0].bounce();
 				_vm->_visa->dixi('x', _vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicTransport:
-				_vm->_trip->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
+				_vm->_animation->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
 					                 (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte
 									 );
 				break;
 			case Gyro::kMagicUnfinished:
-				_vm->_trip->tr[0].bounce();
+				_vm->_animation->tr[0].bounce();
 				_vm->_scrolls->display("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
-				_vm->_trip->call_special(_vm->_gyro->_portals[fv]._data);
+				_vm->_animation->call_special(_vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_vm->_trip->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
+				_vm->_animation->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
 				break;
 			}
 
@@ -1040,9 +1040,9 @@ void Acci::notInOrder() {
 }
 
 void Acci::goToCauldron() {
-	_vm->_trip->tr[1].call_eachstep = false; // Stops Geida_Procs.
+	_vm->_animation->tr[1].call_eachstep = false; // Stops Geida_Procs.
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
-	_vm->_trip->tr[1].walkto(2);
+	_vm->_animation->tr[1].walkto(2);
 }
 
 /**
@@ -1102,9 +1102,9 @@ void Acci::drink() {
 		_vm->_lucerna->refreshObjectList();
 		_vm->_lucerna->dusk();
 		_vm->_gyro->hangAroundForAWhile();
-		_vm->_trip->fliproom(1, 1);
+		_vm->_animation->fliproom(1, 1);
 		_vm->_gyro->setBackgroundColor(14);
-		_vm->_trip->new_game_for_trippancy(); // Not really.
+		_vm->_animation->new_game_for_trippancy(); // Not really.
 	}
 }
 
@@ -1112,12 +1112,12 @@ void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_dna._standingOnDais) { // Clamber up.
 		_vm->_scrolls->display("You climb down, back onto the floor.");
 		_vm->_gyro->_dna._standingOnDais = false;
-		_vm->_trip->apped(1, 3);
+		_vm->_animation->apped(1, 3);
 	} else { // Clamber down.
-		if (_vm->_trip->infield(1)) {
+		if (_vm->_animation->infield(1)) {
 			_vm->_scrolls->display("You clamber up onto the dais.");
 			_vm->_gyro->_dna._standingOnDais = true;
-			_vm->_trip->apped(1, 2);
+			_vm->_animation->apped(1, 2);
 		} else
 			_vm->_scrolls->display("Get a bit closer, Avvy.");
 	}
@@ -1136,9 +1136,9 @@ void Acci::standUp() {
 				_vm->_gyro->setBackgroundColor(0);
 				_vm->_visa->dixi('d', 14);
 			}
-			_vm->_trip->tr[0].visible = true;
+			_vm->_animation->tr[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
-			_vm->_trip->apped(1, 2);
+			_vm->_animation->apped(1, 2);
 			_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
@@ -1155,8 +1155,8 @@ void Acci::standUp() {
 	case r__nottspub:
 		if (_vm->_gyro->_dna._sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
-			_vm->_trip->tr[0].visible = true; // But standing up.
-			_vm->_trip->apped(1, 4); // And walking away.
+			_vm->_animation->tr[0]._visible = true; // But standing up.
+			_vm->_animation->apped(1, 4); // And walking away.
 			_vm->_gyro->_dna._sittingInPub = false; // Really not sitting down.
 			_vm->_gyro->_dna._userMovesAvvy = true; // And ambulant.
 		} else
@@ -1172,7 +1172,7 @@ void Acci::standUp() {
 void Acci::getProc(char thing) {
 	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
-		if (_vm->_trip->infield(2)) {
+		if (_vm->_animation->infield(2)) {
 			if (_vm->_gyro->_dna._boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->display("OK, I've got it.");
@@ -1188,13 +1188,13 @@ void Acci::getProc(char thing) {
 	case r__insidecardiffcastle:
 		switch (thing) {
 		case Gyro::kObjectPen:
-			if (_vm->_trip->infield(2)) { // Standing on the dais.
+			if (_vm->_animation->infield(2)) { // Standing on the dais.
 				if (_vm->_gyro->_dna._takenPen)
 					_vm->_scrolls->display("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
-					_vm->_trip->call_special(3); // Zap!
+					_vm->_animation->call_special(3); // Zap!
 					_vm->_gyro->_dna._takenPen = true;
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
@@ -1213,7 +1213,7 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_trip->infield(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
+		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_animation->infield(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->display("Got it!");
 			_vm->_gyro->_dna._mushroomGrowing = false;
@@ -1247,7 +1247,7 @@ void Acci::giveGeidaTheLute() {
 }
 
 void Acci::playHarp() {
-	if (_vm->_trip->infield(7))
+	if (_vm->_animation->infield(7))
 		_vm->_scrolls->musical_scroll();
 	else
 		_vm->_scrolls->display("Get a bit closer to it, Avvy!");
@@ -1277,8 +1277,8 @@ void Acci::personSpeaks() {
 
 	bool found = false; // The _person we're looking for's code is in _person.
 
-	for (byte i = 0; i < _vm->_trip->kSpriteNumbMax; i++) {
-		if (_vm->_trip->tr[i].quick && ((_vm->_trip->tr[i].a.accinum + 149) == _person)) {
+	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->tr[i].quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
@@ -1568,13 +1568,13 @@ void Acci::doThat() {
 						i = 3;
 					else
 						i = 0;
-					if (_vm->_trip->tr[0].whichsprite != i) {
-						int16 x = _vm->_trip->tr[0].x;
-						int16 y = _vm->_trip->tr[0].y;
-						_vm->_trip->tr[0].done();
-						_vm->_trip->tr[0].init(i, true, _vm->_trip);
-						_vm->_trip->tr[0].appear(x, y, _vm->_trip->kDirLeft);
-						_vm->_trip->tr[0].visible = false;
+					if (_vm->_animation->tr[0].whichsprite != i) {
+						int16 x = _vm->_animation->tr[0]._x;
+						int16 y = _vm->_animation->tr[0]._y;
+						_vm->_animation->tr[0].done();
+						_vm->_animation->tr[0].init(i, true, _vm->_animation);
+						_vm->_animation->tr[0].appear(x, y, Animation::kDirLeft);
+						_vm->_animation->tr[0]._visible = false;
 					}
 				}
 				break;
@@ -1695,16 +1695,16 @@ void Acci::doThat() {
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
 			_vm->_visa->dixi('q', 19);
 		else {
-			if ((_vm->_gyro->_dna._room == 12) & (_vm->_trip->infield(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->infield(2))) { // Avaricius appears!
 				_vm->_visa->dixi('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->dixi('q', 18);
 				else {
-					_vm->_trip->tr[1].init(1, false, _vm->_trip); // Avaricius
-					_vm->_trip->apped(2, 4);
-					_vm->_trip->tr[1].walkto(5);
-					_vm->_trip->tr[1].call_eachstep = true;
-					_vm->_trip->tr[1].eachstep = _vm->_trip->procback_and_forth;
+					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius
+					_vm->_animation->apped(2, 4);
+					_vm->_animation->tr[1].walkto(5);
+					_vm->_animation->tr[1].call_eachstep = true;
+					_vm->_animation->tr[1].eachstep = _vm->_animation->procback_and_forth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
@@ -1744,7 +1744,7 @@ void Acci::doThat() {
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_dna._room) {
 		case r__argentpub:
-			if (_vm->_trip->infield(6)) { // We're in a pub, and near the bar.
+			if (_vm->_animation->infield(6)) { // We're in a pub, and near the bar.
 				switch (_thing) {
 				case 51:
 				case 53:
@@ -1804,7 +1804,7 @@ void Acci::doThat() {
 			break;
 
 		case r__outsideducks:
-			if (_vm->_trip->infield(6)) {
+			if (_vm->_animation->infield(6)) {
 				if (_thing == _vm->_gyro->kObjectOnion) {
 					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
 						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
@@ -1861,9 +1861,9 @@ void Acci::doThat() {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->incScore(7);
-				_vm->_trip->tr[1].walkto(2);
-				_vm->_trip->tr[1].vanishifstill = true;
-				_vm->_trip->tr[1].call_eachstep = false;
+				_vm->_animation->tr[1].walkto(2);
+				_vm->_animation->tr[1].vanishifstill = true;
+				_vm->_animation->tr[1].call_eachstep = false;
 				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
@@ -1984,7 +1984,7 @@ void Acci::doThat() {
 			if (_vm->_gyro->_dna._sittingInPub)
 				_vm->_scrolls->display("You're already sitting!");
 			else {
-				_vm->_trip->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
+				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
 				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
 			}
 		} else { // Default doodah.
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
new file mode 100644
index 0000000..5679e1b
--- /dev/null
+++ b/engines/avalanche/animation.cpp
@@ -0,0 +1,1632 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* TRIP5	Trippancy V - the sprite animation subsystem */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/animation.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/visa2.h"
+#include "avalanche/gyro2.h"
+#include "avalanche/celer2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/timeout2.h"
+#include "avalanche/enid2.h"
+
+#include "common/scummsys.h"
+#include "common/textconsole.h"
+#include "common/file.h"
+
+namespace Avalanche {
+
+void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
+	_tr = tr;
+
+	const int32 idshould = -1317732048;
+	byte fv;
+	int32 id;
+	Common::File inf;
+
+	if (spritenum == 177)
+		return; // Already running!
+
+	Common::String filename;
+	filename = filename.format("sprite%d.avd", spritenum);
+	if (!inf.open(filename)) {
+		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
+		return;
+	}
+
+	inf.seek(177);
+
+	id = inf.readSint32LE();
+	if (id != idshould) {
+		//output << '\7';
+		inf.close();
+		return;
+	}
+
+	inf.skip(2); // Replace variable named 'soa' in the original code.
+
+	if (!_stat._name.empty())
+		_stat._name.clear();
+	byte nameSize = inf.readByte();
+	for (byte i = 0; i < nameSize; i++)
+		_stat._name += inf.readByte();
+	inf.skip(12 - nameSize);
+
+	//inf.skip(1); // Same as above.
+	byte commentSize = inf.readByte();
+	for (byte i = 0; i < commentSize; i++)
+		_stat._comment += inf.readByte();
+	inf.skip(16 - commentSize);
+
+	_stat._frameNum = inf.readByte();
+	_info._xLength = inf.readByte();
+	_info._yLength = inf.readByte();
+	_stat.seq = inf.readByte();
+	_info._size = inf.readUint16LE();
+	_stat._fgBubbleCol = inf.readByte();
+	_stat._bgBubbleCol = inf.readByte();
+	_stat.accinum = inf.readByte();
+
+	totalnum = 0; // = 1;
+	_info._xWidth = _info._xLength / 8;
+	if ((_info._xLength % 8) > 0)
+		_info._xWidth++;
+	for (byte aa = 0; aa < _stat._frameNum; aa++) {
+
+		_info._sil[totalnum] = new SilType[11 * (_info._yLength + 1)];
+		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
+		_info._mani[totalnum] = new ManiType[_info._size - 6];
+		//getmem(mani[totalnum-1], a.size - 6);
+		for (fv = 0; fv <= _info._yLength; fv++)
+			inf.read((*_info._sil[totalnum])[fv], _info._xWidth);
+			//blockread(inf, (*sil[totalnum-1])[fv], xw);
+		inf.read(*_info._mani[totalnum], _info._size - 6);
+		//blockread(inf, *mani[totalnum-1], a.size - 6);
+
+		totalnum++;
+	}
+	totalnum++;
+
+	// on;
+	_x = 0;
+	_y = 0;
+	quick = true;
+	_visible = false;
+	xs = 3;
+	ys = 1;
+	if (spritenum == 1)
+		_tr->newspeed(); // Just for the lights.
+
+	homing = false;
+	ix = 0;
+	iy = 0;
+	step = 0;
+	check_me = do_check;
+	count = 0;
+	whichsprite = spritenum;
+	vanishifstill = false;
+	call_eachstep = false;
+
+	inf.close();
+}
+
+void AnimationType::original() {
+	quick = false;
+	whichsprite = 177;
+}
+
+void AnimationType::andexor() {
+	if ((vanishifstill) && (ix == 0) && (iy == 0))
+		return;
+	byte picnum = face * _stat.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
+
+	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
+}
+
+void AnimationType::turn(byte whichway) {
+	if (whichway == 8)
+		face = Animation::kDirUp;
+	else
+		face = whichway;
+}
+
+void AnimationType::appear(int16 wx, int16 wy, byte wf) {
+	_x = (wx / 8) * 8;
+	_y = wy;
+	_oldX[_tr->_vm->_gyro->_cp] = wx;
+	_oldY[_tr->_vm->_gyro->_cp] = wy;
+	turn(wf);
+	_visible = true;
+	ix = 0;
+	iy = 0;
+}
+
+bool AnimationType::collision_check() {
+	for (byte fv = 0; fv < _tr->kSpriteNumbMax; fv++)
+		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
+			((_x + _info._xLength) > _tr->tr[fv]._x) &&
+			(_x < (_tr->tr[fv]._x + _tr->tr[fv]._info._xLength)) &&
+			(_tr->tr[fv]._y == _y))
+				return true;
+
+	return false;
+}
+
+void AnimationType::walk() {
+	byte tc;
+	ByteField r;
+
+
+	if (_visible) {
+		r._x1 = (_x / 8) - 1;
+		if (r._x1 == 255)
+			r._x1 = 0;
+		r._y1 = _y - 2;
+		r._x2 = ((_x + _info._xLength) / 8) + 1;
+		r._y2 = _y + _info._yLength + 2;
+
+		_tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r);
+	}
+
+	if (!_tr->_vm->_gyro->_doingSpriteRun) {
+		_oldX[_tr->_vm->_gyro->_cp] = _x;
+		_oldY[_tr->_vm->_gyro->_cp] = _y;
+		if (homing)
+			homestep();
+		_x = _x + ix;
+		_y = _y + iy;
+	}
+
+	if (check_me) {
+		if (collision_check()) {
+			bounce();
+			return;
+		}
+
+		tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		// -1  is because the modified array indexes of magics[] compared to Pascal .
+
+		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
+			switch (_tr->_vm->_gyro->_magics[tc]._operation) {
+			case Gyro::kMagicExclaim: {
+				bounce();
+				_tr->mustexclaim = true;
+				_tr->saywhat = _tr->_vm->_gyro->_magics[tc]._data;
+				}
+				break;
+			case Gyro::kMagicBounce:
+				bounce();
+				break;
+			case Gyro::kMagicTransport:
+				_tr->fliproom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
+				break;
+			case Gyro::kMagicUnfinished: {
+				bounce();
+				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
+				}
+				break;
+			case Gyro::kMagicSpecial:
+				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);
+				break;
+			case Gyro::kMagicOpenDoor:
+				_tr->open_the_door(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
+				break;
+			}
+		}
+	}
+
+	if (!_tr->_vm->_gyro->_doingSpriteRun) {
+		count++;
+		if (((ix != 0) || (iy != 0)) && (count > 1)) {
+			step++;
+			if (step == _stat.seq)
+				step = 0;
+			count = 0;
+		}
+	}
+}
+
+void AnimationType::bounce() {
+	_x = _oldX[_tr->_vm->_gyro->_cp];
+	_y = _oldY[_tr->_vm->_gyro->_cp];
+	if (check_me)
+		_tr->stopwalking();
+	else
+		stopwalk();
+	_tr->_vm->_gyro->_onCanDoPageSwap = false;
+	_tr->_vm->_lucerna->drawDirection();
+	_tr->_vm->_gyro->_onCanDoPageSwap = true;
+}
+
+int8 AnimationType::sgn(int16 val) {
+	if (val > 0)
+		return 1;
+	else if (val < 0)
+		return -1;
+	else
+		return 0;
+}
+
+void AnimationType::walkto(byte pednum) {
+	pednum--; // Pascal -> C conversion: different array indexes.
+	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
+	hx = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
+	hy = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
+	homing = true;
+}
+
+void AnimationType::stophoming() {
+	homing = false;
+}
+
+void AnimationType::homestep() {
+	int16 temp;
+
+	if ((hx == _x) && (hy == _y)) {
+		// touching the target
+		stopwalk();
+		return;
+	}
+	ix = 0;
+	iy = 0;
+	if (hy != _y) {
+		temp = hy - _y;
+		if (temp > 4)
+			iy = 4;
+		else if (temp < -4)
+			iy = -4;
+		else
+			iy = temp;
+	}
+	if (hx != _x) {
+		temp = hx - _x;
+		if (temp > 4)
+			ix = 4;
+		else if (temp < -4)
+			ix = -4;
+		else
+			ix = temp;
+	}
+}
+
+void AnimationType::speed(int8 xx, int8 yy) {
+	ix = xx;
+	iy = yy;
+	if ((ix == 0) && (iy == 0))
+		return; // no movement
+	if (ix == 0) {
+		// No horz movement
+		if (iy < 0)
+			turn(_tr->kDirUp);
+		else
+			turn(_tr->kDirDown);
+	} else {
+		if (ix < 0)
+			turn(_tr->kDirLeft);
+		else
+			turn(_tr->kDirRight);
+	}
+}
+
+void AnimationType::stopwalk() {
+	ix = 0;
+	iy = 0;
+	homing = false;
+}
+
+void AnimationType::chatter() {
+	_tr->_vm->_gyro->_talkX = _x + _info._xLength / 2;
+	_tr->_vm->_gyro->_talkY = _y;
+	_tr->_vm->_gyro->_talkFontColor = _stat._fgBubbleCol;
+	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
+}
+
+void AnimationType::set_up_saver(trip_saver_type &v) {
+	v.whichsprite = whichsprite;
+	v.face = face;
+	v.step = step;
+	v.x = _x;
+	v.y = _y;
+	v.ix = ix;
+	v.iy = iy;
+	v.visible = _visible;
+	v.homing = homing;
+	v.check_me = check_me;
+	v.count = count;
+	v.xw = _info._xWidth;
+	v.xs = xs;
+	v.ys = ys;
+	v.totalnum = totalnum;
+	v.hx = hx;
+	v.hy = hy;
+	v.call_eachstep = call_eachstep;
+	v.eachstep = eachstep;
+	v.vanishifstill = vanishifstill;
+}
+
+void AnimationType::unload_saver(trip_saver_type v) {
+	whichsprite = v.whichsprite;
+	face = v.face;
+	step = v.step;
+	_x = v.x;
+	_y = v.y;
+	ix = v.ix;
+	iy = v.iy;
+	_visible = v.visible;
+	homing = v.homing;
+	check_me = v.check_me;
+	count = v.count;
+	_info._xWidth = v.xw;
+	xs = v.xs;
+	ys = v.ys;
+	totalnum = v.totalnum;
+	hx = v.hx;
+	hy = v.hy;
+	call_eachstep = v.call_eachstep;
+	eachstep = v.eachstep;
+	vanishifstill = v.vanishifstill;
+}
+
+void AnimationType::savedata(Common::File &f) {
+	warning("STUB: triptype::savedata()");
+}
+
+void AnimationType::loaddata(Common::File &f) {
+	warning("STUB: triptype::loaddata()");
+}
+
+void AnimationType::save_data_to_mem(uint16 &where) {
+	warning("STUB: triptype::save_data_to_mem()");
+}
+
+void AnimationType::load_data_from_mem(uint16 &where) {
+	warning("STUB: triptype::load_data_from_mem()");
+}
+
+AnimationType *AnimationType::done() {
+	Common::String xx;
+
+	//  nds:=num div seq;
+	totalnum--;
+	_info._xWidth = _info._xLength / 8;
+	if ((_info._xLength % 8) > 0)
+		_info._xWidth++;
+	for (byte aa = 0; aa < _stat._frameNum; aa++) {
+		totalnum--;
+		delete[] _info._mani[totalnum];
+		delete[] _info._sil[totalnum];
+	}
+
+	quick = false;
+	whichsprite = 177;
+	return this;
+}
+
+getsettype *getsettype::init() {
+	numleft = 0; // initialize array pointer
+	return this;
+}
+
+void getsettype::remember(ByteField r) {
+	numleft++;
+	//if (numleft > maxgetset)
+	//	error("Trip::remember() : runerr_Getset_Overflow");
+	gs[numleft] = r;
+}
+
+void getsettype::recall(ByteField &r) {
+	r = gs[numleft];
+	numleft--;
+}
+
+
+
+
+
+
+Animation::Animation(AvalancheEngine *vm) {
+	_vm = vm;
+
+	getsetclear();
+	mustexclaim = false;
+}
+
+Animation::~Animation() {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick)
+			tr[i].done();
+	}
+}
+
+void Animation::loadtrip() {
+	for (int16 gm = 0; gm < kSpriteNumbMax; gm++)
+		tr[gm].original();
+
+	for (uint16 i = 0; i < sizeof(aa); i++)
+		aa[i] = 0;
+}
+
+byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
+	byte a, c;
+	int16 fv, ff;
+
+	// if not alive then begin checkfeet:=0; exit; end;
+	a = 0;
+
+	//setactivepage(2);
+	if (x1 < 0)
+		x1 = 0;
+	if (x2 > 639)
+		x2 = 639;
+	if (oy < y) {
+		for (fv = x1; fv <= x2; fv++) {
+			for (ff = oy + yl; ff <= y + yl; ff++) {
+				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
+				if (c > a)
+					a = c;
+			}
+		}
+	} else {
+		for (fv = x1; fv <= x2; fv++) {
+			for (ff = y + yl; ff <= oy + yl; ff++) {
+				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
+				if (c > a)
+					a = c;
+			}
+		}
+	}
+
+	//setactivepage(1 - cp);
+	return a;
+}
+
+byte Animation::geida_ped(byte which) {
+	switch (which) {
+	case 1:
+		return 7;
+	case 2:
+	case 6:
+		return 8;
+	case 3:
+	case 5:
+		return 9;
+	case 4:
+		return 10;
+	default:
+		return 0;
+	}
+}
+
+void Animation::catamove(byte ped) {
+/* When you enter a new position in the catacombs, this procedure should
+	be called. It changes the Also codes so that they may match the picture
+	on the screen. (Coming soon: It draws up the screen, too.) */
+
+	int32 here;
+	uint16 xy_uint16;
+	byte fv;
+
+	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
+	// catacombs has a different number for it.
+
+
+
+	xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256;
+	_vm->_gyro->_dna._geidaSpin = 0;
+
+	switch (xy_uint16) {
+	case 1801: // Exit catacombs
+		fliproom(r__lustiesroom, 4);
+		_vm->_scrolls->display("Phew! Nice to be out of there!");
+		return;
+	case 1033: // Oubliette
+		fliproom(r__oubliette, 1);
+		_vm->_scrolls->display(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+		return;
+	case 4:
+		fliproom(r__geidas, 1);
+		return;
+	case 2307:
+		fliproom(r__lusties, 5);
+		_vm->_scrolls->display("Oh no... here we go again...");
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		tr[0].iy = 1;
+		tr[0].ix = 0;
+		return;
+	}
+
+	if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom)
+		_vm->_lucerna->loadRoom(29);
+	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1];
+
+	switch (here & 0xf) { // West.
+	case 0: // no connection (wall)
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
+		break;
+	case 0x1: // no connection (wall + shield),
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
+		break;
+	case 0x2: // wall with door
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
+		break;
+	case 0x3: // wall with door and shield
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
+		break;
+	case 0x4: // no connection (wall + window),
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
+		break;
+	case 0x5: // wall with door and window
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
+		break;
+	case 0x6: // no connection (wall + torches),
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
+		break;
+	case 0x7: // wall with door and torches
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
+		break;
+	case 0xf: // straight-through corridor.
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
+		break;
+	}
+
+	/*  ---- */
+
+	switch ((here & 0xf0) >> 4) { // East
+	case 0: // no connection (wall)
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
+		break;
+	case 0x1: // no connection (wall + window),
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
+		break;
+	case 0x2: // wall with door
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
+		break;
+	case 0x3: // wall with door and window
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
+		break;
+	case 0x6: // no connection (wall + torches),
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
+		break;
+	case 0x7: // wall with door and torches
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
+		break;
+	case 0xf: // straight-through corridor.
+		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		break;
+	}
+
+	/*  ---- */
+
+	switch ((here & 0xf00) >> 8) { // South
+	case 0: // No connection.
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		break;
+	case 0x1:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
+
+		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
+			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim;
+		else
+			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicSpecial; // Right exit south.
+
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		break;
+	case 0x2:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicSpecial; // Middle exit south.
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		break;
+	case 0x3:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicSpecial; // Left exit south.
+		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		break;
+	}
+
+	switch ((here & 0xf000) >> 12) { // North
+	case 0: // No connection
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		break;
+	// LEFT handles:
+#if 0
+	case 0x1:
+		_vm->_celer->show_one(-1, -1, 4);
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		break;
+#endif
+	case 0x2:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		break;
+#if 0
+	case 0x3:
+		_vm->_celer->show_one(-1, -1, 4);
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		break;
+	// RIGHT handles:
+	case 0x4:
+		_vm->_celer->show_one(-1, -1, 3);
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		break;
+#endif
+	case 0x5:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		break;
+#if 0
+	case 0x6:
+		_vm->_celer->show_one(-1, -1, 3);
+		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
+		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		break;
+#endif
+	// ARCHWAYS:
+	case 0x7:
+	case 0x8:
+	case 0x9: {
+		_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+
+		if (((here & 0xf000) >> 12) > 0x7)
+			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
+		if (((here & 0xf000) >> 12) == 0x9)
+			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
+
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicSpecial; // Middle arch north.
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+	}
+	break;
+	// DECORATIONS:
+	case 0xd: // No connection + WINDOW
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
+		break;
+	case 0xe: // No connection + TORCH
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+		break;
+	// Recessed door:
+	case 0xf:
+		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicNothing; // Door to Geida's room.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		break;
+	}
+
+	switch (xy_uint16) {
+	case 514:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 17);
+		break;     // [2,2] : "Art Gallery" sign over door.
+	case 264:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+		break;      // [8,1] : "The Wrong Way!" sign.
+	case 1797:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+		break;      // [5,7] : "Ite Mingite" sign.
+	case 258:
+		for (fv = 0; fv <= 2; fv++) { // [2,1] : Art gallery - pictures
+			_vm->_celer->drawBackgroundSprite(130 + fv * 120, 70, 15);
+			_vm->_celer->drawBackgroundSprite(184 + fv * 120, 78, 16);
+		}
+		break;
+	case 1287:
+		for (fv = 10; fv <= 13; fv++)
+			_vm->_celer->drawBackgroundSprite(-1, -1, fv);
+		break; // [7,5] : 4 candles.
+	case 776:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+		break;     // [8,3] : 1 candle.
+	case 2049:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
+		break;     // [1,8] : another candle.
+	case 257:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
+		break; // [1,1] : the other two.
+	}
+
+	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
+		if (!tr[1].quick)  // If we don't already have her...
+			tr[1].init(5, true, this); // ...Load Geida.
+		apped(2, geida_ped(ped));
+		tr[1].call_eachstep = true;
+		tr[1].eachstep = procgeida_procs;
+	}
+}
+
+
+
+// This proc gets called whenever you touch a line defined as _vm->_gyro->special.
+void Animation::dawndelay() {
+	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->reason_dawndelay);
+}
+
+void Animation::call_special(uint16 which) {
+	switch (which) {
+	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+		_vm->_gyro->_dna._brummieStairs = 1;
+		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
+		stopwalking();
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		break;
+	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
+		_vm->_gyro->_dna._brummieStairs = 3;
+		_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicExclaim;
+		_vm->_gyro->_magics[11]._data = 5;
+		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
+		stopwalking();
+		_vm->_visa->dixi('q', 26);
+		_vm->_gyro->_dna._userMovesAvvy = true;
+		break;
+	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
+		tr[0].bounce(); // Must include that.
+
+		if (!_vm->_gyro->_dna._arrowTriggered) {
+			_vm->_gyro->_dna._arrowTriggered = true;
+			apped(2, 4); // The dart starts at ped 4, and...
+			tr[1].walkto(5); // flies to ped 5.
+			tr[1].face = kDirUp; // Only face.
+			// Should call some kind of Eachstep procedure which will deallocate
+			// the sprite when it hits the wall, and replace it with the chunk
+			// graphic of the arrow buried in the plaster. */
+
+			// OK!
+			tr[1].call_eachstep = true;
+			tr[1].eachstep = procarrow_procs;
+		}
+		break;
+	case 4: // This is the ghost room link.
+		_vm->_lucerna->dusk();
+		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
+		_vm->_enid->backToBootstrap(3);
+		break;
+	case 5:
+		if (_vm->_gyro->_dna._friarWillTieYouUp) {
+			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
+			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
+			_vm->_visa->dixi('q', 35);
+			tr[0].done();
+			//tr[1].vanishifstill:=true;
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_visa->dixi('q', 36);
+			_vm->_gyro->_dna._tiedUp = true;
+			_vm->_gyro->_dna._friarWillTieYouUp = false;
+			tr[1].walkto(3);
+			tr[1].vanishifstill = true;
+			tr[1].check_me = true; // One of them must have Check_Me switched on.
+			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
+			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
+		}
+		break;
+	case 6: // _vm->_gyro->special 6: fall down oubliette.
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		tr[0].ix = 3;
+		tr[0].iy = 0;
+		tr[0].face = kDirRight;
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
+		break;
+	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
+		tr[0]._visible = false;
+		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
+		stopwalking();
+		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
+		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
+		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
+		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
+		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
+		break;
+	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
+		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
+			_vm->_visa->dixi('q', 63);
+			tr[1].turn(kDirDown);
+			tr[1].stopwalk();
+			tr[1].call_eachstep = false; // Geida
+			_vm->_lucerna->gameOver();
+		}
+		break;
+	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
+		if (!_vm->_gyro->_dna._geidaFollows)
+			return;   // DOESN'T COUNT: no Geida.
+		tr[1].call_eachstep = false; // She no longer follows Avvy around.
+		tr[1].walkto(4); // She walks to somewhere...
+		tr[0].done();     // Lose Avvy.
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
+		break;
+	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
+		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
+			// Into Geida's room.
+			if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1])
+				_vm->_visa->dixi('q', 62);
+			else {
+				_vm->_visa->dixi('q', 61);
+				return;
+			}
+		}
+		_vm->_lucerna->dusk();
+		_vm->_gyro->_dna._catacombY--;
+		catamove(4);
+		if (_vm->_gyro->_dna._room != r__catacombs)
+			return;
+		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
+		case 0x1:
+			apped(1, 12);
+			break;
+		case 0x3:
+			apped(1, 11);
+			break;
+		default:
+			apped(1, 4);
+		}
+		getback();
+		dawndelay();
+		break;
+	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
+		_vm->_lucerna->dusk();
+		_vm->_gyro->_dna._catacombX++;
+		catamove(1);
+		if (_vm->_gyro->_dna._room != r__catacombs)
+			return;
+		apped(1, 1);
+		getback();
+		dawndelay();
+		break;
+	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
+		_vm->_lucerna->dusk();
+		_vm->_gyro->_dna._catacombY += 1;
+		catamove(2);
+		if (_vm->_gyro->_dna._room != r__catacombs)
+			return;
+		apped(1, 2);
+		getback();
+		dawndelay();
+		break;
+	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
+		_vm->_lucerna->dusk();
+		_vm->_gyro->_dna._catacombX--;
+		catamove(3);
+		if (_vm->_gyro->_dna._room != r__catacombs)
+			return;
+		apped(1, 3);
+		getback();
+		dawndelay();
+		break;
+	}
+}
+
+
+
+void Animation::open_the_door(byte whither, byte ped, byte magicnum) {
+// This slides the door open. (The data really ought to be saved in
+// the Also file, and will be next time. However, for now, they're
+// here.)
+	switch (_vm->_gyro->_dna._room) {
+	case r__outsideyours:
+	case r__outsidenottspub:
+	case r__outsideducks:
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(2);
+		_vm->_sequence->then_show(3);
+		break;
+	case r__insidecardiffcastle:
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(5);
+		break;
+	case r__avvysgarden:
+	case r__entrancehall:
+	case r__insideabbey:
+	case r__yourhall:
+		_vm->_sequence->first_show(1);
+		_vm->_sequence->then_show(2);
+		break;
+	case r__musicroom:
+	case r__outsideargentpub:
+		_vm->_sequence->first_show(5);
+		_vm->_sequence->then_show(6);
+		break;
+	case r__lusties:
+		switch (magicnum) {
+		case 14:
+			if (_vm->_gyro->_dna._avvysInTheCupboard) {
+				hide_in_the_cupboard();
+				_vm->_sequence->first_show(8);
+				_vm->_sequence->then_show(7);
+				_vm->_sequence->start_to_close();
+				return;
+			} else {
+				apped(1, 6);
+				tr[0].face = kDirRight; // added by TT 12/3/1995
+				_vm->_sequence->first_show(8);
+				_vm->_sequence->then_show(9);
+			}
+			break;
+		case 12:
+			_vm->_sequence->first_show(4);
+			_vm->_sequence->then_show(5);
+			_vm->_sequence->then_show(6);
+			break;
+		}
+		break;
+	}
+
+	_vm->_sequence->then_flip(whither, ped);
+	_vm->_sequence->start_to_open();
+}
+
+void Animation::newspeed() {
+	// Given that you've just changed the speed in triptype.xs, this adjusts ix.
+	const ByteField lightspace = {40, 199, 47, 199};
+	byte page_;
+
+	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
+
+	//setactivepage(3);
+
+	if (tr[0].xs == _vm->_gyro->kRun)
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
+	else
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
+
+	if (tr[0].xs == _vm->_gyro->kRun)
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
+	else
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
+
+	//setactivepage(1 - cp);
+
+	for (page_ = 0; page_ <= 1; page_++)
+		getset[page_].remember(lightspace);
+
+}
+
+void Animation::rwsp(byte t, byte dir) {
+	switch (dir) {
+	case kDirUp:
+		tr[t].speed(0, -tr[t].ys);
+		break;
+	case kDirDown:
+		tr[t].speed(0, tr[t].ys);
+		break;
+	case kDirLeft:
+		tr[t].speed(-tr[t].xs,  0);
+		break;
+	case kDirRight:
+		tr[t].speed(tr[t].xs,  0);
+		break;
+	case kDirUpLeft:
+		tr[t].speed(-tr[t].xs, -tr[t].ys);
+		break;
+	case kDirUpRight:
+		tr[t].speed(tr[t].xs, -tr[t].ys);
+		break;
+	case kDirDownLeft:
+		tr[t].speed(-tr[t].xs, tr[t].ys);
+		break;
+	case kDirDownRight:
+		tr[t].speed(tr[t].xs, tr[t].ys);
+		break;
+	}
+}
+
+void Animation::apped(byte trn, byte np) {
+	trn--;
+	np--;
+	tr[trn].appear(_vm->_gyro->_peds[np]._x - tr[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - tr[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
+	rwsp(trn, _vm->_gyro->_peds[np]._direction);
+}
+
+#if 0
+   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
+	begin // By De Morgan's law:
+	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
+	end;
+#endif
+	//x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
+	//x3,y3 = mx,my. x4,y4 = mx+16,my+16.
+
+void Animation::getback() {
+	// Super_Off;
+#if 0
+	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
+		getset[1 - _vm->_gyro->cp].recall(r);
+
+
+		bool endangered = false;
+		if overlaps_with_mouse and not endangered then
+			begin
+				endangered:=true;
+				blitfix;
+				Super_Off;
+			end;
+
+		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
+	}
+
+	if endangered then
+		Super_On;
+#endif
+}
+
+// Eachstep procedures:
+void Animation::follow_avvy_y(byte tripnum) {
+	if (tr[0].face == kDirLeft)
+		return;
+	if (tr[tripnum].homing)
+		tr[tripnum].hy = tr[1]._y;
+	else {
+		if (tr[tripnum]._y < tr[1]._y)
+			tr[tripnum]._y += 1;
+		else if (tr[tripnum]._y > tr[1]._y)
+			tr[tripnum]._y -= 1;
+		else
+			return;
+		if (tr[tripnum].ix == 0)  {
+			tr[tripnum].step += 1;
+			if (tr[tripnum].step == tr[tripnum]._stat.seq)
+				tr[tripnum].step = 0;
+			tr[tripnum].count = 0;
+		}
+	}
+}
+
+void Animation::back_and_forth(byte tripnum) {
+	if (!tr[tripnum].homing) {
+		if (tr[tripnum].face == kDirRight)
+			tr[tripnum].walkto(4);
+		else
+			tr[tripnum].walkto(5);
+	}
+}
+
+void Animation::face_avvy(byte tripnum) {
+	if (!tr[tripnum].homing) {
+		if (tr[0]._x >= tr[tripnum]._x)
+			tr[tripnum].face = kDirRight;
+		else
+			tr[tripnum].face = kDirLeft;
+	}
+}
+
+void Animation::arrow_procs(byte tripnum) {
+	if (tr[tripnum].homing) {
+		// Arrow is still in flight.
+		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
+		// This is so if: a) the bottom of the arrow is below Avvy's head,
+		// b) the left of the arrow is left of the right of Avvy's head, and
+		// c) the right of the arrow is right of the left of Avvy's head.
+		if (((tr[tripnum]._y + tr[tripnum]._info._yLength) >= tr[0]._y) // A
+				&& (tr[tripnum]._x <= (tr[0]._x + tr[0]._info._xLength)) // B
+				&& ((tr[tripnum]._x + tr[tripnum]._info._xLength) >= tr[0]._x)) { // C
+			// OK, it's hit him... what now?
+
+			tr[1].call_eachstep = false; // prevent recursion.
+			_vm->_visa->dixi('Q', 47); // Complaint!
+			tr[tripnum].done(); // Deallocate the arrow.
+#if 0
+			tr[1].done; { Deallocate normal pic of Avvy. }
+
+			off;
+			for byte fv:=0 to 1 do
+			begin
+			cp:=1-cp;
+			getback;
+			end;
+			on;
+#endif
+			_vm->_lucerna->gameOver();
+
+			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
+			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
+		}
+	} else { // Arrow has hit the wall!
+		tr[tripnum].done(); // Deallocate the arrow.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
+		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
+	}
+
+}
+
+#if 0
+procedure Spludwick_procs(tripnum:byte);
+var fv:byte;
+begin
+	with tr[tripnum] do
+	if not homing then { We only need to do anything if Spludwick *stops*
+						walking. }
+	with _vm->_gyro->dna do
+	begin
+	inc(DogfoodPos);
+	if DogfoodPos=8 then DogfoodPos:=1;
+	walkto(DogfoodPos);
+	end;
+end;
+#endif
+
+void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
+	int16 tox = tr[0]._x + 17;
+	int16 toy = tr[0]._y - 1;
+	if ((tr[tripnum]._x == tox) && (tr[tripnum]._y == toy)) {
+		tr[tripnum].call_eachstep = false;
+		tr[tripnum].face = kDirLeft;
+		tr[tripnum].stopwalk();
+		// ... whatever ...
+	} else {
+		// Still some way to go.
+		if (tr[tripnum]._x < tox) {
+			tr[tripnum]._x += 5;
+			if (tr[tripnum]._x > tox)
+				tr[tripnum]._x = tox;
+		}
+		if (tr[tripnum]._y < toy)
+			tr[tripnum]._y++;
+		tr[tripnum].step++;
+		if (tr[tripnum].step == tr[tripnum]._stat.seq)
+			tr[tripnum].step = 0;
+	}
+}
+
+void Animation::take_a_step(byte &tripnum) {
+	if (tr[tripnum].ix == 0) {
+		tr[tripnum].step++;
+		if (tr[tripnum].step == tr[tripnum]._stat.seq)
+			tr[tripnum].step = 0;
+		tr[tripnum].count = 0;
+	}
+}
+
+void Animation::spin(byte whichway, byte &tripnum) {
+	if (tr[tripnum].face != whichway) {
+		tr[tripnum].face = whichway;
+		if (tr[tripnum].whichsprite == 2)
+			return; // Not for Spludwick
+
+		_vm->_gyro->_dna._geidaSpin += 1;
+		_vm->_gyro->_dna._geidaTime = 20;
+		if (_vm->_gyro->_dna._geidaSpin == 5) {
+			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
+			_vm->_gyro->_dna._geidaSpin = 0;
+			_vm->_gyro->_dna._geidaTime = 0; // knock out records
+		}
+	}
+}
+
+void Animation::geida_procs(byte tripnum) {
+	if (_vm->_gyro->_dna._geidaTime > 0) {
+		_vm->_gyro->_dna._geidaTime--;
+		if (_vm->_gyro->_dna._geidaTime == 0)
+			_vm->_gyro->_dna._geidaSpin = 0;
+	}
+
+	if (tr[tripnum]._y < (tr[0]._y - 2)) {
+		// Geida is further from the screen than Avvy.
+		spin(kDirDown, tripnum);
+		tr[tripnum].iy = 1;
+		tr[tripnum].ix = 0;
+		take_a_step(tripnum);
+		return;
+	} else if (tr[tripnum]._y > (tr[0]._y + 2)) {
+		// Avvy is further from the screen than Geida.
+		spin(kDirUp, tripnum);
+		tr[tripnum].iy = -1;
+		tr[tripnum].ix = 0;
+		take_a_step(tripnum);
+		return;
+	}
+
+	tr[tripnum].iy = 0;
+	// These 12-s are not in the original, I added them to make the following method more "smooth".
+	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
+	if (tr[tripnum]._x < tr[0]._x - tr[0].xs * 8 - 12) {
+		tr[tripnum].ix = tr[0].xs;
+		spin(kDirRight, tripnum);
+		take_a_step(tripnum);
+	} else if (tr[tripnum]._x > tr[0]._x + tr[0].xs * 8 + 12) {
+		tr[tripnum].ix = -tr[0].xs;
+		spin(kDirLeft, tripnum);
+		take_a_step(tripnum);
+	} else
+		tr[tripnum].ix = 0;
+}
+
+// That's all...
+
+void Animation::call_andexors() {
+	int8 order[5];
+	byte fv, temp;
+	bool ok;
+
+	for (int i = 0; i < 5; i++)
+		order[i] = -1;
+
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
+		if (tr[fv].quick && tr[fv]._visible)
+			order[fv] = fv;
+	}
+
+	do {
+		ok = true;
+		for (fv = 0; fv < 4; fv++) {
+			if (((order[fv] != -1) && (order[fv + 1] != -1))
+					&& (tr[order[fv]]._y > tr[order[fv + 1]]._y)) {
+				// Swap them!
+				temp = order[fv];
+				order[fv] = order[fv + 1];
+				order[fv + 1] = temp;
+				ok = false;
+			}
+		}
+	} while (!ok);
+
+
+	_vm->_graphics->refreshBackground();
+
+	for (fv = 0; fv < 5; fv++) {
+		if (order[fv] > -1)
+			tr[order[fv]].andexor();
+	}
+}
+
+void Animation::trippancy_link() {
+	byte fv;
+
+	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
+		return;
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
+		if (tr[fv].quick && tr[fv]._visible)
+			tr[fv].walk();
+	}
+
+	call_andexors();
+
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
+		if (tr[fv].quick && tr[fv].call_eachstep) {
+			switch (tr[fv].eachstep) {
+			case procfollow_avvy_y :
+				follow_avvy_y(fv);
+				break;
+			case procback_and_forth :
+				back_and_forth(fv);
+				break;
+			case procface_avvy :
+				face_avvy(fv);
+				break;
+			case procarrow_procs :
+				arrow_procs(fv);
+				break;
+				//    PROCSpludwick_procs : spludwick_procs(fv);
+			case procgrab_avvy :
+				grab_avvy(fv);
+				break;
+			case procgeida_procs :
+				geida_procs(fv);
+				break;
+			}
+		}
+	}
+
+	if (mustexclaim) {
+		mustexclaim = false;
+		_vm->_visa->dixi('x', saywhat);
+	}
+}
+
+void Animation::get_back_loretta() {
+	byte fv;
+
+	for (fv = 0; fv < kSpriteNumbMax; fv++) {
+		if (tr[fv].quick) {
+			getback();
+			return;
+		}
+	}
+	// for fv:=0 to 1 do begin cp:=1-cp; getback; end;
+}
+
+void Animation::stopwalking() {
+	tr[0].stopwalk();
+	_vm->_gyro->_dna._direction = kDirStopped;
+	if (_vm->_gyro->_alive)
+		tr[0].step = 1;
+}
+
+void Animation::tripkey(char dir) {
+	warning("Replaced by Trip::handleMoveKey!");
+}
+
+void Animation::readstick() {
+	warning("STUB: Trip::readstick()");
+}
+
+void Animation::getsetclear() {
+	for (byte fv = 0; fv <= 1; fv++)
+		getset[fv].init();
+}
+
+void Animation::hide_in_the_cupboard() {
+	if (_vm->_gyro->_dna._avvysInTheCupboard) {
+		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
+			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
+		else {
+			tr[0]._visible = true;
+			_vm->_gyro->_dna._userMovesAvvy = true;
+			apped(1, 3); // Walk out of the cupboard.
+			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
+			_vm->_gyro->_dna._avvysInTheCupboard = false;
+			_vm->_sequence->first_show(8);
+			_vm->_sequence->then_show(7);
+			_vm->_sequence->start_to_close();
+		}
+	} else {
+		// Not hiding in the cupboard
+		tr[0]._visible = false;
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
+			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
+		_vm->_gyro->_dna._avvysInTheCupboard = true;
+		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+	}
+}
+
+void Animation::fliproom(byte room, byte ped) {
+	byte fv;
+
+	if (!_vm->_gyro->_alive) {
+		// You can't leave the room if you're dead.
+		tr[0].ix = 0;
+		tr[0].iy = 0; // Stop him from moving.
+		return;
+	}
+
+	if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) {
+		hide_in_the_cupboard();
+		return;
+	}
+
+	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
+		// You can't *jump* out of Cardiff Castle!
+		tr[0].ix = 0;
+		return;
+	}
+
+	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
+	_vm->_lucerna->dusk();
+	getsetclear();
+
+
+	for (fv = 1; fv < kSpriteNumbMax; fv++) {
+		if (tr[fv].quick)
+			tr[fv].done();
+	} // Deallocate sprite
+
+	if (_vm->_gyro->_dna._room == r__lustiesroom)
+		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
+
+	_vm->_lucerna->enterRoom(room, ped);
+	apped(1, ped);
+	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
+	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
+	_vm->_gyro->_dna._direction = tr[0].face;
+	_vm->_lucerna->drawDirection();
+
+	for (fv = 0; fv <= 1; fv++) {
+		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
+		getback();
+	}
+	_vm->_lucerna->dawn();
+
+	// Tidy up after mouse. I know it's a kludge...
+	//  tidy_after_mouse;
+}
+
+bool Animation::infield(byte which) {
+	which--; // Pascal -> C: different array indexes.
+
+	int16 yy = tr[0]._y + tr[0]._info._yLength;
+
+	return (tr[0]._x >= _vm->_gyro->_fields[which]._x1) && (tr[0]._x <= _vm->_gyro->_fields[which]._x2)
+		&& (yy >= _vm->_gyro->_fields[which]._y1) && (yy <= _vm->_gyro->_fields[which]._y2);
+
+}
+
+bool Animation::neardoor() {
+	if (_vm->_gyro->_fieldNum < 8) {
+		// there ARE no doors here!
+		return false;
+	}
+
+	int16 ux = tr[0]._x;
+	int16 uy = tr[0]._y + tr[0]._info._yLength;
+	bool nd = false;
+	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
+		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
+			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2))
+			nd = true;
+	return nd;
+}
+
+void Animation::new_game_for_trippancy() {   // Called by gyro.newgame
+	tr[0]._visible = false;
+}
+
+void Animation::handleMoveKey(const Common::Event &event) {
+	if (!_vm->_gyro->_dna._userMovesAvvy)
+		return;
+
+	if (_vm->_dropdown->_activeMenuItem._activeNow)
+		_vm->_parser->tryDropdown();
+	else {
+		switch (event.kbd.keycode) {
+		case Common::KEYCODE_UP:
+			if (_vm->_gyro->_dna._direction != kDirUp) {
+				_vm->_gyro->_dna._direction = kDirUp;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_DOWN:
+			if (_vm->_gyro->_dna._direction != kDirDown) {
+				_vm->_gyro->_dna._direction = kDirDown;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_LEFT:
+			if (_vm->_gyro->_dna._direction != kDirLeft) {
+				_vm->_gyro->_dna._direction = kDirLeft;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_RIGHT:
+			if (_vm->_gyro->_dna._direction != kDirRight) {
+				_vm->_gyro->_dna._direction = kDirRight;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_PAGEUP:
+			if (_vm->_gyro->_dna._direction != kDirUpRight) {
+				_vm->_gyro->_dna._direction = kDirUpRight;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_PAGEDOWN:
+			if (_vm->_gyro->_dna._direction != kDirDownRight) {
+				_vm->_gyro->_dna._direction = kDirDownRight;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_END:
+			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
+				_vm->_gyro->_dna._direction = kDirDownLeft;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_HOME:
+			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
+				_vm->_gyro->_dna._direction = kDirUpLeft;
+				rwsp(0, _vm->_gyro->_dna._direction);
+			} else
+				stopwalking();
+			break;
+		case Common::KEYCODE_KP5:
+			stopwalking();
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
new file mode 100644
index 0000000..b8ae547
--- /dev/null
+++ b/engines/avalanche/animation.h
@@ -0,0 +1,217 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Original name TRIP5 / Trippancy V - the sprite animation subsystem */
+
+#ifndef AVALANCHE_ANIMATION_H
+#define AVALANCHE_ANIMATION_H
+
+#include "avalanche/graphics.h"
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+struct adxtype { // Second revision of ADX type
+	// CHECKME: Useless?
+	Common::String _name; // name of character
+	Common::String _comment; // comment
+	//
+	byte _frameNum; // number of pictures
+	byte seq; // how many in one stride
+	byte _fgBubbleCol, _bgBubbleCol; // foreground & background bubble colors
+	byte accinum; // the number according to Acci (1=Avvy, etc.)
+};
+
+struct trip_saver_type {
+	byte whichsprite;
+	byte face;
+	byte step;
+	int16 x;
+	int16 y;
+	int8 ix;
+	int8 iy;
+	bool visible;
+	bool homing;
+	bool check_me;
+	byte count;
+	byte xw, xs, ys;
+	byte totalnum;
+	int16 hx;
+	int16 hy;
+	bool call_eachstep;
+	byte eachstep;
+	bool vanishifstill;
+};
+
+class Animation;
+
+class AnimationType {
+public:
+	SpriteInfo _info;
+
+	adxtype _stat; // vital statistics
+	byte face, step;
+	int16 _x, _y; // current xy coords
+	int16 _oldX[2], _oldY[2];  // last xy coords
+	int8 ix, iy; // amount to move sprite by, each step
+	byte whichsprite;
+	bool quick, _visible, homing, check_me;
+	int16 hx, hy; // homing x & y coords
+	byte count; // counts before changing step
+	byte xs, ys; // x & y speed
+	byte totalnum; // total number of sprites
+	bool vanishifstill; // Do we show this sprite if it's still?
+
+	bool call_eachstep; // Do we call the eachstep procedure?
+	byte eachstep;
+
+	void init(byte spritenum, bool do_check, Animation *tr);
+	// loads & sets up the sprite
+	void original();    // just sets Quick to false
+	void andexor();    // drops sprite onto screen
+	void turn(byte whichway);      // turns him round
+	void appear(int16 wx, int16 wy, byte wf); // switches him on
+	void bounce();    // bounces off walls.
+	void walk();    // prepares for andexor, etc.
+	void walkto(byte pednum);      // home in on a point
+	void stophoming();    // self-explanatory
+	void homestep();    // calculates ix & iy for one homing step
+	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
+	void stopwalk();    // Stops the sprite from moving
+	void chatter();    // Sets up talk vars
+	void set_up_saver(trip_saver_type &v);
+	void unload_saver(trip_saver_type v);
+
+	void savedata(Common::File &f); // Self-explanatory,
+	void loaddata(Common::File &f);  // really.
+
+	void save_data_to_mem(uint16 &where);
+	void load_data_from_mem(uint16 &where);
+	AnimationType *done();
+
+private:
+	Animation *_tr;
+
+	bool collision_check();
+	int8 sgn(int16 val);
+};
+
+const int16 maxgetset = 35;
+
+class getsettype {
+public:
+	ByteField gs[maxgetset];
+	byte numleft;
+
+	getsettype *init();
+	void remember(ByteField r);
+	void recall(ByteField &r);
+};
+
+class Animation {
+public:
+	friend class AnimationType;
+	friend class getsettype;
+
+	static const int16 kDirUp = 0;
+	static const int16 kDirRight = 1;
+	static const int16 kDirDown = 2;
+	static const int16 kDirLeft = 3;
+	static const int16 kDirUpRight = 4;
+	static const int16 kDirDownRight = 5;
+	static const int16 kDirDownLeft = 6;
+	static const int16 kDirUpLeft = 7;
+	static const int16 kDirStopped = 8;
+
+	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
+
+	static const int16 procfollow_avvy_y = 1;
+	static const int16 procback_and_forth = 2;
+	static const int16 procface_avvy = 3;
+	static const int16 procarrow_procs = 4;
+	static const int16 procspludwick_procs = 5;
+	static const int16 procgrab_avvy = 6;
+	static const int16 procgeida_procs = 7;
+
+	Animation(AvalancheEngine *vm);
+	~Animation();
+
+	void trippancy_link();
+	void get_back_loretta();
+	void loadtrip();
+	void call_special(uint16 which);
+	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
+	void catamove(byte ped);
+	void stopwalking();
+	void tripkey(char dir);
+	void rwsp(byte t, byte dir);
+	void apped(byte trn, byte np);
+	void getback();
+	void fliproom(byte room, byte ped);
+	bool infield(byte which); // Returns true if you're within field "which".
+	bool neardoor(); // Returns True if you're near a door.
+	void readstick();
+	void newspeed();
+	void new_game_for_trippancy();
+	void take_a_step(byte &tripnum);
+	void handleMoveKey(const Common::Event &event); // To replace tripkey().
+
+	AnimationType tr[kSpriteNumbMax];
+	getsettype getset[2];
+	byte aa[1600];
+
+	bool mustexclaim;
+	uint16 saywhat;
+
+private:
+	AvalancheEngine *_vm;
+
+	// CHECKME: Useless?
+	// ByteField r;
+	// int16 beforex, beforey;
+
+	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
+	byte geida_ped(byte which);
+	void dawndelay();
+	void hide_in_the_cupboard();
+	void follow_avvy_y(byte tripnum);
+	void back_and_forth(byte tripnum);
+	void face_avvy(byte tripnum);
+	void arrow_procs(byte tripnum);
+	void grab_avvy(byte tripnum);
+	void spin(byte whichway, byte &tripnum);
+	void geida_procs(byte tripnum);
+	void call_andexors();
+	void getsetclear();
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_ANIMATION_H
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 27cfdd1..a7c8ea6 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -70,7 +70,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _celer;
 	delete _sequence;
 	delete _timeout;
-	delete _trip;
+	delete _animation;
 	delete _acci;
 	delete _dropdown;
 	delete _closing;
@@ -91,7 +91,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_celer = new Celer(this);
 	_sequence = new Sequence(this);
 	_timeout = new Timeout(this);
-	_trip = new Trip(this);
+	_animation = new Animation(this);
 	_acci = new Acci(this);
 	_dropdown = new Dropdown(this);
 	_closing = new Closing(this);
@@ -282,52 +282,52 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		for (byte i = 0; i < _trip->kSpriteNumbMax; i++) {
-			if (_trip->tr[i].quick)
+		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) {
+			if (_animation->tr[i].quick)
 				spriteNum++;
 		}
 	}
 	sz.syncAsByte(spriteNum);
 
 	if (sz.isLoading()) {
-		for (byte i = 0; i < _trip->kSpriteNumbMax; i++) { // Deallocate sprites.
-			if (_trip->tr[i].quick)
-				_trip->tr[i].done();
+		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
+			if (_animation->tr[i].quick)
+				_animation->tr[i].done();
 		}
 	}
 
 	for (byte i = 0; i < spriteNum; i++) {
-		sz.syncAsByte(_trip->tr[i].whichsprite);
-		sz.syncAsByte(_trip->tr[i].check_me);
+		sz.syncAsByte(_animation->tr[i].whichsprite);
+		sz.syncAsByte(_animation->tr[i].check_me);
 
 
 		if (sz.isLoading()) {
-			_trip->tr[i].quick = true;
-			_trip->tr[i].init(_trip->tr[i].whichsprite, _trip->tr[i].check_me, _trip);
+			_animation->tr[i].quick = true;
+			_animation->tr[i].init(_animation->tr[i].whichsprite, _animation->tr[i].check_me, _animation);
 		}
 
-		sz.syncAsByte(_trip->tr[i].ix);
-		sz.syncAsByte(_trip->tr[i].iy);
-		sz.syncAsByte(_trip->tr[i].face);
-		sz.syncAsByte(_trip->tr[i].step);
-		sz.syncAsByte(_trip->tr[i].visible);
-		sz.syncAsByte(_trip->tr[i].homing);
-		sz.syncAsByte(_trip->tr[i].count);
-		sz.syncAsByte(_trip->tr[i]._info._xWidth);
-		sz.syncAsByte(_trip->tr[i].xs);
-		sz.syncAsByte(_trip->tr[i].ys);
-		sz.syncAsByte(_trip->tr[i].totalnum);
-		sz.syncAsSint16LE(_trip->tr[i].hx);
-		sz.syncAsSint16LE(_trip->tr[i].hy);
-		sz.syncAsByte(_trip->tr[i].call_eachstep);
-		sz.syncAsByte(_trip->tr[i].eachstep);
-		sz.syncAsByte(_trip->tr[i].vanishifstill);
-
-		sz.syncAsSint16LE(_trip->tr[i].x);
-		sz.syncAsSint16LE(_trip->tr[i].y);
-
-		if (sz.isLoading() && _trip->tr[i].visible)
-			_trip->tr[i].appear(_trip->tr[i].x, _trip->tr[i].y, _trip->tr[i].face);
+		sz.syncAsByte(_animation->tr[i].ix);
+		sz.syncAsByte(_animation->tr[i].iy);
+		sz.syncAsByte(_animation->tr[i].face);
+		sz.syncAsByte(_animation->tr[i].step);
+		sz.syncAsByte(_animation->tr[i]._visible);
+		sz.syncAsByte(_animation->tr[i].homing);
+		sz.syncAsByte(_animation->tr[i].count);
+		sz.syncAsByte(_animation->tr[i]._info._xWidth);
+		sz.syncAsByte(_animation->tr[i].xs);
+		sz.syncAsByte(_animation->tr[i].ys);
+		sz.syncAsByte(_animation->tr[i].totalnum);
+		sz.syncAsSint16LE(_animation->tr[i].hx);
+		sz.syncAsSint16LE(_animation->tr[i].hy);
+		sz.syncAsByte(_animation->tr[i].call_eachstep);
+		sz.syncAsByte(_animation->tr[i].eachstep);
+		sz.syncAsByte(_animation->tr[i].vanishifstill);
+
+		sz.syncAsSint16LE(_animation->tr[i]._x);
+		sz.syncAsSint16LE(_animation->tr[i]._y);
+
+		if (sz.isLoading() && _animation->tr[i]._visible)
+			_animation->tr[i].appear(_animation->tr[i]._x, _animation->tr[i]._y, _animation->tr[i].face);
 	}
 
 	//groi = 177;
@@ -470,12 +470,12 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->refreshObjectList();
 
-	_trip->newspeed();
+	_animation->newspeed();
 
 	_lucerna->drawDirection();
 
 	_gyro->_onToolbar = false;
-	_trip->trippancy_link();
+	_animation->trippancy_link();
 
 	_celer->updateBackgroundSprites();
 
@@ -484,8 +484,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
 
-	if (_trip->tr[0].quick && _trip->tr[0].visible)
-		_trip->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
+	if (_animation->tr[0].quick && _animation->tr[0]._visible)
+		_animation->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 639f4cc..1973f9b 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -43,7 +43,7 @@
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
 #include "avalanche/timeout2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/acci2.h"
 #include "avalanche/dropdown2.h"
 #include "avalanche/closing2.h"
@@ -80,7 +80,7 @@ public:
 	Celer *_celer;
 	Sequence *_sequence;
 	Timeout *_timeout;
-	Trip *_trip;
+	Animation *_animation;
 	Acci *_acci;
 	Dropdown *_dropdown;
 	Closing *_closing;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 814de63..c7ebb21 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/graphics.h"
 #include "avalanche/avalot.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/scrolls2.h"
@@ -110,7 +110,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
 		if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) {
-			_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
+			_vm->_animation->handleMoveKey(event); // Fallthroughs are intended.
 			_vm->_lucerna->drawDirection();
 			return;
 		}
@@ -156,15 +156,15 @@ void Avalot::setup() {
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
-	_vm->_trip->loadtrip();
+	_vm->_animation->loadtrip();
 
-	_vm->_trip->get_back_loretta();
+	_vm->_animation->get_back_loretta();
 	_vm->_gyro->_holdTheDawn = false;
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
-	_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
-	_vm->_trip->newspeed();
+	_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+	_vm->_animation->newspeed();
 
 
 
@@ -201,9 +201,9 @@ void Avalot::run(Common::String arg) {
 		_vm->_lucerna->_clock.update();
 		_vm->_dropdown->updateMenu();
 		_vm->_gyro->forceNumlock();
-		_vm->_trip->get_back_loretta();
+		_vm->_animation->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
-		_vm->_trip->trippancy_link();
+		_vm->_animation->trippancy_link();
 		_vm->_lucerna->checkClick();
 		_vm->_timeout->one_tick();
 
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 8e1b13a..a261311 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -30,7 +30,7 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/celer2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/roomnums.h"
@@ -367,7 +367,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 	warning("STUB: Celer::show_one()");
 
 	for (byte i = 0; i < 2; i++)
-		_vm->_trip->getset[i].remember(_r);
+		_vm->_animation->getset[i].remember(_r);
 }
 
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 9894769..3c26496 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/acci2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/enid2.h"
 
 #include "common/textconsole.h"
@@ -245,7 +245,7 @@ void MenuBar::draw() {
 		_menuItems[i].draw();
 
 	for (byte page = 0; page <= 1; page++)
-		_dr->_vm->_trip->getset[page].remember(menuspace);
+		_dr->_vm->_animation->getset[page].remember(menuspace);
 
 	_dr->_vm->_gyro->_cp = savecp;
 }
@@ -455,12 +455,12 @@ void Dropdown::setupMenuAction() {
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
 	if (_vm->_gyro->_dna._room == 99)
-		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_trip->neardoor());
+		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->neardoor());
 	else
-		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_trip->neardoor());
+		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->neardoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_trip->tr[0].xs == _vm->_gyro->kWalk)
+	if (_vm->_animation->tr[0].xs == _vm->_gyro->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -630,11 +630,11 @@ void Dropdown::runMenuAction() {
 		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
-		if (_vm->_trip->tr[0].xs == _vm->_gyro->kWalk)
-			_vm->_trip->tr[0].xs = _vm->_gyro->kRun;
+		if (_vm->_animation->tr[0].xs == _vm->_gyro->kWalk)
+			_vm->_animation->tr[0].xs = _vm->_gyro->kRun;
 		else
-			_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
-		_vm->_trip->newspeed();
+			_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+		_vm->_animation->newspeed();
 	}
 	break;
 	}
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index d942177..c3a195e 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/enid2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index fd36ade..4ea4de7 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -35,7 +35,7 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/acci2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 
 #include "common/file.h"
 #include "common/random.h"
@@ -228,12 +228,12 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
-		if (_vm->_trip->tr[i].quick)
-			_vm->_trip->tr[i].done();
+		if (_vm->_animation->tr[i].quick)
+			_vm->_animation->tr[i].done();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
-	_vm->_trip->tr[0].init(0, true, _vm->_trip);
+	_vm->_animation->tr[0].init(0, true, _vm->_animation);
 
 	_alive = true;
 	_score = 0;
@@ -257,7 +257,7 @@ void Gyro::newGame() {
 	_onToolbar = false;
 	_seeScroll = false;
 
-	_vm->_trip->tr[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
+	_vm->_animation->tr[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	_him = 254;
@@ -272,11 +272,11 @@ void Gyro::newGame() {
 
 	for (byte i = 0; i <= 1; i++) {
 		_cp = 1 - _cp;
-		_vm->_trip->getback();
+		_vm->_animation->getback();
 	}
 
 	_vm->_lucerna->enterRoom(1, 1);
-	_vm->_trip->new_game_for_trippancy();
+	_vm->_animation->new_game_for_trippancy();
 	_vm->_lucerna->drawScore();
 	_vm->_dropdown->setupMenu();
 	_vm->_lucerna->_clock.update();
@@ -454,7 +454,7 @@ Common::String Gyro::f5Does() {
 			return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down";
 		break;
 	case r__musicroom:
-		if (_vm->_trip->infield(7))
+		if (_vm->_animation->infield(7))
 			return Common::String(_vm->_acci->kVerbCodePlay) + "PPlay the harp";
 		break;
 	}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 0c2e01a..a034ace 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -34,7 +34,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/pingo2.h"
@@ -396,10 +396,10 @@ void Lucerna::enterNewTown() {
 void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_trip->tr[1].init(5, false, _vm->_trip); // load Geida
-	_vm->_trip->apped(2, whichPed);
-	_vm->_trip->tr[1].call_eachstep = true;
-	_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
+	_vm->_animation->tr[1].init(5, false, _vm->_animation); // load Geida
+	_vm->_animation->apped(2, whichPed);
+	_vm->_animation->tr[1].call_eachstep = true;
+	_vm->_animation->tr[1].eachstep = _vm->_animation->procgeida_procs;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -441,25 +441,25 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (! _vm->_gyro->_dna._talkedToCrapulus) {
 
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__outsideyours;
-				_vm->_trip->tr[1].init(8, false, _vm->_trip); // load Crapulus
+				_vm->_animation->tr[1].init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
-					_vm->_trip->apped(2, 4); // Start on the right-hand side of the screen.
-					_vm->_trip->tr[1].walkto(5); // Walks up to greet you.
+					_vm->_animation->apped(2, 4); // Start on the right-hand side of the screen.
+					_vm->_animation->tr[1].walkto(5); // Walks up to greet you.
 				} else {
-					_vm->_trip->apped(2, 5); // Starts where he was before.
-					_vm->_trip->tr[1].face = 3;
+					_vm->_animation->apped(2, 5); // Starts where he was before.
+					_vm->_animation->tr[1].face = Animation::kDirLeft;
 				}
 
-				_vm->_trip->tr[1].call_eachstep = true;
-				_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // He always faces Avvy.
+				_vm->_animation->tr[1].call_eachstep = true;
+				_vm->_animation->tr[1].eachstep = _vm->_animation->procface_avvy; // He always faces Avvy.
 
 			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->_dna._crapulusWillTell) {
-				_vm->_trip->tr[1].init(8, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[1].walkto(4);
+				_vm->_animation->tr[1].init(8, false, _vm->_animation);
+				_vm->_animation->apped(2, 2);
+				_vm->_animation->tr[1].walkto(4);
 				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
@@ -476,15 +476,15 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__spludwicks:
 		if (_vm->_gyro->_dna._spludwickAtHome) {
 			if (ped > 0) {
-				_vm->_trip->tr[1].init(2, false, _vm->_trip); // load Spludwick
-				_vm->_trip->apped(2, 2);
+				_vm->_animation->tr[1].init(2, false, _vm->_animation); // load Spludwick
+				_vm->_animation->apped(2, 2);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
 			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
-			_vm->_trip->tr[1].call_eachstep = true;
-			_vm->_trip->tr[1].eachstep = _vm->_trip->procgeida_procs;
+			_vm->_animation->tr[1].call_eachstep = true;
+			_vm->_animation->tr[1].eachstep = _vm->_animation->procgeida_procs;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -497,18 +497,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot
-				_vm->_trip->tr[1].call_eachstep = true;
-				_vm->_trip->tr[1].eachstep = _vm->_trip->procfollow_avvy_y;
+				_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot
+				_vm->_animation->tr[1].call_eachstep = true;
+				_vm->_animation->tr[1].eachstep = _vm->_animation->procfollow_avvy_y;
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
-					_vm->_trip->apped(2, 2); // He appears on the right of the screen...
-					_vm->_trip->tr[1].walkto(4); // ...and he walks up...
+					_vm->_animation->apped(2, 2); // He appears on the right of the screen...
+					_vm->_animation->tr[1].walkto(4); // ...and he walks up...
 				} else {
 					// You've been here before.
-					_vm->_trip->apped(2, 4); // He's standing in your way straight away...
-					_vm->_trip->tr[1].face = _vm->_trip->kDirLeft;
+					_vm->_animation->apped(2, 4); // He's standing in your way straight away...
+					_vm->_animation->tr[1].face = Animation::kDirLeft;
 				}
 			}
 		}
@@ -517,10 +517,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__argentroad:
 		if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) &&
 		        (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) {
-			_vm->_trip->tr[1].init(4, false, _vm->_trip); // 4 = Cwytalot again
-			_vm->_trip->apped(2, 1);
-			_vm->_trip->tr[1].walkto(2);
-			_vm->_trip->tr[1].vanishifstill = true;
+			_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
+			_vm->_animation->apped(2, 1);
+			_vm->_animation->tr[1].walkto(2);
+			_vm->_animation->tr[1].vanishifstill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
@@ -541,9 +541,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->_dna._beenTiedUp) {
 				// A welcome party... or maybe not...
-				_vm->_trip->tr[1].init(6, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[1].walkto(3);
+				_vm->_animation->tr[1].init(6, false, _vm->_animation);
+				_vm->_animation->apped(2, 2);
+				_vm->_animation->tr[1].walkto(3);
 				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
 			}
 		}
@@ -565,9 +565,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0)
 			switch (_vm->_gyro->_dna._cardiffQuestionNum) {
 			case 0 : { // You've answered NONE of his questions.
-				_vm->_trip->tr[1].init(9, false, _vm->_trip);
-				_vm->_trip->apped(2, 2);
-				_vm->_trip->tr[1].walkto(3);
+				_vm->_animation->tr[1].init(9, false, _vm->_animation);
+				_vm->_animation->apped(2, 2);
+				_vm->_animation->tr[1].walkto(3);
 				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
 			}
 			break;
@@ -575,9 +575,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: { // You've answered SOME of his questions.
-				_vm->_trip->tr[1].init(9, false, _vm->_trip);
-				_vm->_trip->apped(2, 3);
-				_vm->_trip->tr[1].face = _vm->_trip->kDirRight;
+				_vm->_animation->tr[1].init(9, false, _vm->_animation);
+				_vm->_animation->apped(2, 3);
+				_vm->_animation->tr[1].face = Animation::kDirRight;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
@@ -627,7 +627,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			}
 
 			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
-			_vm->_trip->catamove(ped);
+			_vm->_animation->catamove(ped);
 			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 		}
 		break;
@@ -645,7 +645,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
-		if (_vm->_trip->tr[0].whichsprite == 0) // Avvy in his normal clothes
+		if (_vm->_animation->tr[0].whichsprite == 0) // Avvy in his normal clothes
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
@@ -703,22 +703,22 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__wisewomans:
-		_vm->_trip->tr[1].init(11, false, _vm->_trip);
+		_vm->_animation->tr[1].init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_trip->apped(2, 2); // Start on the right-hand side of the screen.
-			_vm->_trip->tr[1].walkto(4); // Walks up to greet you.
+			_vm->_animation->apped(2, 2); // Start on the right-hand side of the screen.
+			_vm->_animation->tr[1].walkto(4); // Walks up to greet you.
 		} else {
-			_vm->_trip->apped(2, 4); // Starts where she was before.
-			_vm->_trip->tr[1].face = 3;
+			_vm->_animation->apped(2, 4); // Starts where she was before.
+			_vm->_animation->tr[1].face = Animation::kDirLeft;
 		}
 
-		_vm->_trip->tr[1].call_eachstep = true;
-		_vm->_trip->tr[1].eachstep = _vm->_trip->procface_avvy; // She always faces Avvy.
+		_vm->_animation->tr[1].call_eachstep = true;
+		_vm->_animation->tr[1].eachstep = _vm->_animation->procface_avvy; // She always faces Avvy.
 		break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
-			_vm->_trip->tr[1].init(10, false, _vm->_trip); // Define the dart.
+			_vm->_animation->tr[1].init(10, false, _vm->_animation); // Define the dart.
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->first_show(1);
@@ -969,37 +969,32 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
 	byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
 
 	switch (color) {
-	case kColorGreen: {
-			_vm->_gyro->_dna._direction = _vm->_trip->kDirUp;
-			_vm->_trip->rwsp(0, _vm->_trip->kDirUp);
-			drawDirection();
-		}
+	case kColorGreen:
+		_vm->_gyro->_dna._direction = Animation::kDirUp;
+		_vm->_animation->rwsp(0, Animation::kDirUp);
+		drawDirection();
 		break;
-	case kColorBrown: {
-			_vm->_gyro->_dna._direction = _vm->_trip->kDirDown;
-			_vm->_trip->rwsp(0, _vm->_trip->kDirDown);
-			drawDirection();
-		}
+	case kColorBrown:
+		_vm->_gyro->_dna._direction = Animation::kDirDown;
+		_vm->_animation->rwsp(0, Animation::kDirDown);
+		drawDirection();
 		break;
-	case kColorCyan: {
-			_vm->_gyro->_dna._direction = _vm->_trip->kDirLeft;
-			_vm->_trip->rwsp(0, _vm->_trip->kDirLeft);
-			drawDirection();
-		}
+	case kColorCyan:
+		_vm->_gyro->_dna._direction = Animation::kDirLeft;
+		_vm->_animation->rwsp(0, Animation::kDirLeft);
+		drawDirection();
 		break;
-	case kColorLightmagenta: {
-			_vm->_gyro->_dna._direction = _vm->_trip->kDirRight;
-			_vm->_trip->rwsp(0, _vm->_trip->kDirRight);
-			drawDirection();
-		}
+	case kColorLightmagenta:
+		_vm->_gyro->_dna._direction = Animation::kDirRight;
+		_vm->_animation->rwsp(0, Animation::kDirRight);
+		drawDirection();
 		break;
 	case kColorRed:
 	case kColorWhite:
 	case kColorLightcyan:
-	case kColorYellow: { // Fall-throughs are intended.
-			_vm->_trip->stopwalking();
-			drawDirection();
-		}
+	case kColorYellow: // Fall-throughs are intended.
+		_vm->_animation->stopwalking();
+		drawDirection();
 		break;
 	}
 }
@@ -1026,46 +1021,46 @@ void Lucerna::guideAvvy(Common::Point cursorPos) {
 	cursorPos.y /= 2;
 	byte what;
 
-	// _vm->_trip->tr[0] is Avalot.)
-	if (cursorPos.x < _vm->_trip->tr[0].x)
+	// _vm->_animation->tr[0] is Avalot.)
+	if (cursorPos.x < _vm->_animation->tr[0]._x)
 		what = 1;
-	else if (cursorPos.x > (_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info._xLength))
+	else if (cursorPos.x > (_vm->_animation->tr[0]._x + _vm->_animation->tr[0]._info._xLength))
 		what = 2;
 	else
 		what = 0; // On top
 
-	if (cursorPos.y < _vm->_trip->tr[0].y)
+	if (cursorPos.y < _vm->_animation->tr[0]._y)
 		what += 3;
-	else if (cursorPos.y > (_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info._yLength))
+	else if (cursorPos.y > (_vm->_animation->tr[0]._y + _vm->_animation->tr[0]._info._yLength))
 		what += 6;
 
 	switch (what) {
 	case 0:
-		_vm->_trip->stopwalking();
+		_vm->_animation->stopwalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirLeft);
+		_vm->_animation->rwsp(0, Animation::kDirLeft);
 		break;
 	case 2:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirRight);
+		_vm->_animation->rwsp(0, Animation::kDirRight);
 		break;
 	case 3:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirUp);
+		_vm->_animation->rwsp(0, Animation::kDirUp);
 		break;
 	case 4:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirUpLeft);
+		_vm->_animation->rwsp(0, Animation::kDirUpLeft);
 		break;
 	case 5:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirUpRight);
+		_vm->_animation->rwsp(0, Animation::kDirUpRight);
 		break;
 	case 6:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirDown);
+		_vm->_animation->rwsp(0, Animation::kDirDown);
 		break;
 	case 7:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirDownLeft);
+		_vm->_animation->rwsp(0, Animation::kDirDownLeft);
 		break;
 	case 8:
-		_vm->_trip->rwsp(0, _vm->_trip->kDirDownRight);
+		_vm->_animation->rwsp(0, Animation::kDirDownRight);
 		break;
 	}    // No other values are possible.
 
@@ -1130,11 +1125,11 @@ void Lucerna::checkClick() {
 
 				callVerb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_trip->tr[0].xs = _vm->_gyro->kWalk;
-				_vm->_trip->newspeed();
+				_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+				_vm->_animation->newspeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_trip->tr[0].xs = _vm->_gyro->kRun;
-				_vm->_trip->newspeed();
+				_vm->_animation->tr[0].xs = _vm->_gyro->kRun;
+				_vm->_animation->newspeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
@@ -1186,13 +1181,13 @@ void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 void Lucerna::gameOver() {
 	_vm->_gyro->_dna._userMovesAvvy = false;
 
-	int16 sx = _vm->_trip->tr[0].x;
-	int16 sy = _vm->_trip->tr[0].y;
+	int16 sx = _vm->_animation->tr[0]._x;
+	int16 sy = _vm->_animation->tr[0]._y;
 
-	_vm->_trip->tr[0].done();
-	_vm->_trip->tr[0].init(12, true, _vm->_trip); // 12 = Avalot falls
-	_vm->_trip->tr[0].step = 0;
-	_vm->_trip->tr[0].appear(sx, sy, 0);
+	_vm->_animation->tr[0].done();
+	_vm->_animation->tr[0].init(12, true, _vm->_animation); // 12 = Avalot falls
+	_vm->_animation->tr[0].step = 0;
+	_vm->_animation->tr[0].appear(sx, sy, 0);
 
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
 	_vm->_gyro->_alive = false;
@@ -1205,7 +1200,7 @@ void Lucerna::minorRedraw() {
 
 	for (byte i = 0; i <= 1; i++) {
 		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
-		_vm->_trip->getback();
+		_vm->_animation->getback();
 	}
 
 	for (byte i = 0; i < 3; i++)
@@ -1224,22 +1219,22 @@ uint16 Lucerna::bearing(byte whichPed) {
 
 	const double rad2deg = 180 / 3.14; // Pi
 
-	if (_vm->_trip->tr[0].x == _vm->_gyro->_peds[pedId]._x)
+	if (_vm->_animation->tr[0]._x == _vm->_gyro->_peds[pedId]._x)
 		return 0;
-	else if (_vm->_trip->tr[0].x < _vm->_gyro->_peds[pedId]._x) {
-		return (uint16)((atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
+	else if (_vm->_animation->tr[0]._x < _vm->_gyro->_peds[pedId]._x) {
+		return (uint16)((atan(double((_vm->_animation->tr[0]._y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_animation->tr[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
 	} else {
-		return (uint16)((atan(double((_vm->_trip->tr[0].y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_trip->tr[0].x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
+		return (uint16)((atan(double((_vm->_animation->tr[0]._y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_animation->tr[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
 	}
 }
 
 void Lucerna::spriteRun() {
 	_vm->_gyro->_doingSpriteRun = true;
 
-	_vm->_trip->get_back_loretta();
-	_vm->_trip->trippancy_link();
+	_vm->_animation->get_back_loretta();
+	_vm->_animation->trippancy_link();
 
 	_vm->_gyro->_doingSpriteRun = false;
 }
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 993e1ca..c46f8e2 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -16,7 +16,7 @@ MODULE_OBJS = \
 	celer2.o \
 	sequence2.o \
 	timeout2.o \
-	trip6.o \
+	animation.o \
 	acci2.o \
 	dropdown2.o \
 	closing2.o
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index fc505e4..e20413b 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -156,7 +156,7 @@ void Parser::drawCursor() {
 	bf._y1 = 168;
 	bf._y2 = 168;
 	for (byte fv = 0; fv <= 1; fv++)
-		_vm->_trip->getset[fv].remember(bf);
+		_vm->_animation->getset[fv].remember(bf);
 }
 
 void Parser::wipeText() {
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index c61b6bb..e522254 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/pingo2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/scrolls2.h"
 
 #include "common/textconsole.h"
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 56f605a..c445a7e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/acci2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/timeout2.h"
@@ -689,11 +689,11 @@ void Scrolls::calldrivers() {
 				if (param == 0)
 					natural();
 				else if ((1 <= param) && (param <= 9)) {
-					if ((param > _vm->_trip->kSpriteNumbMax) || (!_vm->_trip->tr[param - 1].quick)) { // Not valid.
+					if ((param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[param - 1].quick)) { // Not valid.
 						_vm->_lucerna->errorLed();
 						natural();
 					} else
-						_vm->_trip->tr[param - 1].chatter(); // Normal sprite talking routine.
+						_vm->_animation->tr[param - 1].chatter(); // Normal sprite talking routine.
 				} else if ((10 <= param) && (param <= 36)) {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 4e51cf9..8e64dbc 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/timeout2.h"
 #include "avalanche/celer2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 
 #include "common/scummsys.h"
 
@@ -76,7 +76,7 @@ void Sequence::start_to_close() {
 
 void Sequence::start_to_open() {
 	_vm->_gyro->_dna._userMovesAvvy = false; // They can't move.
-	_vm->_trip->stopwalking(); // And they're not moving now.
+	_vm->_animation->stopwalking(); // And they're not moving now.
 	start_to_close(); // Apart from that, it's the same thing.
 }
 
@@ -94,7 +94,7 @@ void Sequence::call_sequencer() {
 		break;
 	case 177: // Flip room.
 		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_trip->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
+		_vm->_animation->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
 		if (seq[0] == 177)
 			shove_left();
 		break;
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index bc5a534..38f276b 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/timeout2.h"
 #include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/acci2.h"
 #include "avalanche/sequence2.h"
@@ -243,8 +243,8 @@ void Timeout::avaricius_talks() {
 }
 
 void Timeout::urinate() {
-	_vm->_trip->tr[0].turn(_vm->_trip->kDirUp);
-	_vm->_trip->stopwalking();
+	_vm->_animation->tr[0].turn(Animation::kDirUp);
+	_vm->_animation->stopwalking();
 	_vm->_lucerna->drawDirection();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
 }
@@ -264,7 +264,7 @@ void Timeout::bang2() {
 
 void Timeout::stairs() {
 	_vm->_gyro->blip();
-	_vm->_trip->tr[0].walkto(4);
+	_vm->_animation->tr[0].walkto(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->_dna._brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
@@ -298,39 +298,39 @@ void Timeout::get_tied_up() {
 	_vm->_visa->dixi('q', 34); // ...Trouble!
 	_vm->_gyro->_dna._userMovesAvvy = false;
 	_vm->_gyro->_dna._beenTiedUp = true;
-	_vm->_trip->stopwalking();
-	_vm->_trip->tr[1].stopwalk();
-	_vm->_trip->tr[1].stophoming();
-	_vm->_trip->tr[1].call_eachstep = true;
-	_vm->_trip->tr[1].eachstep = _vm->_trip->procgrab_avvy;
+	_vm->_animation->stopwalking();
+	_vm->_animation->tr[1].stopwalk();
+	_vm->_animation->tr[1].stophoming();
+	_vm->_animation->tr[1].call_eachstep = true;
+	_vm->_animation->tr[1].eachstep = _vm->_animation->procgrab_avvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 
 void Timeout::get_tied_up2() {
-	_vm->_trip->tr[0].walkto(4);
-	_vm->_trip->tr[1].walkto(5);
+	_vm->_animation->tr[0].walkto(4);
+	_vm->_animation->tr[1].walkto(5);
 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
 
 void Timeout::hang_around() {
-	_vm->_trip->tr[1].check_me = false;
-	_vm->_trip->tr[0].init(7, true, _vm->_trip); // Robin Hood
+	_vm->_animation->tr[1].check_me = false;
+	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
-	_vm->_trip->apped(1, 2);
+	_vm->_animation->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
-	_vm->_trip->tr[0].walkto(7);
+	_vm->_animation->tr[0].walkto(7);
 	set_up_timer(55, prochang_around2, reason_hanging_around);
 }
 
 void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
-	_vm->_trip->tr[1].vanishifstill = false;
-	_vm->_trip->tr[1].walkto(4);
+	_vm->_animation->tr[1].vanishifstill = false;
+	_vm->_animation->tr[1].walkto(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
-	_vm->_trip->tr[0].done();
-	_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
+	_vm->_animation->tr[0].done();
+	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
 	set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
 	// Immediately call the following proc (when you have a chance).
@@ -342,11 +342,11 @@ void Timeout::hang_around2() {
 
 void Timeout::after_the_shootemup() {
 
-	_vm->_trip->fliproom(_vm->_gyro->_dna._room, 0);
+	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
-	_vm->_trip->tr[0].init(0, true, _vm->_trip); // Avalot.
-	_vm->_trip->apped(1, 2);
+	_vm->_animation->tr[0].init(0, true, _vm->_animation); // Avalot.
+	_vm->_animation->apped(1, 2);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
@@ -415,9 +415,9 @@ void Timeout::jacques_wakes_up() {
 }
 
 void Timeout::naughty_duke() { // This is when the Duke comes in and takes your money.
-	_vm->_trip->tr[1].init(9, false, _vm->_trip); // Here comes the Duke.
-	_vm->_trip->apped(2, 1); // He starts at the door...
-	_vm->_trip->tr[1].walkto(3); // He walks over to you.
+	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
+	_vm->_animation->apped(2, 1); // He starts at the door...
+	_vm->_animation->tr[1].walkto(3); // He walks over to you.
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -429,8 +429,8 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 
 void Timeout::naughty_duke2() {
 	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
-	_vm->_trip->tr[1].walkto(1); // Walk to the door.
-	_vm->_trip->tr[1].vanishifstill = true; // Then go away!
+	_vm->_animation->tr[1].walkto(1); // Walk to the door.
+	_vm->_animation->tr[1].vanishifstill = true; // Then go away!
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
@@ -450,7 +450,7 @@ void Timeout::jump() {
 	case 5:
 	case 7:
 	case 9:
-		_vm->_trip->tr[0].y--;
+		_vm->_animation->tr[0]._y--;
 		break;
 	case 12:
 	case 13:
@@ -458,7 +458,7 @@ void Timeout::jump() {
 	case 16:
 	case 18:
 	case 19:
-		_vm->_trip->tr[0].y++;
+		_vm->_animation->tr[0]._y++;
 		break;
 	}
 
@@ -472,7 +472,7 @@ void Timeout::jump() {
 	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
 			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
 			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
-			&& (_vm->_trip->infield(3))) { // Beside the wall
+			&& (_vm->_animation->infield(3))) { // Beside the wall
 		// Grab the arrow!
 		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
@@ -530,8 +530,8 @@ void Timeout::greetsmonk() {
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
-	_vm->_trip->tr[0].iy++; // Increments dx/dy!
-	_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy;   // Dowwwn we go...
+	_vm->_animation->tr[0].iy++; // Increments dx/dy!
+	_vm->_animation->tr[0]._y += _vm->_animation->tr[0].iy;   // Dowwwn we go...
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
@@ -545,62 +545,62 @@ void Timeout::meet_avaroid() {
 		_vm->_gyro->_dna._metAvaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
-		_vm->_trip->tr[0].face = _vm->_trip->kDirLeft;
-		_vm->_trip->tr[0].x = 151;
-		_vm->_trip->tr[0].ix = -3;
-		_vm->_trip->tr[0].iy = -5;
+		_vm->_animation->tr[0].face = Animation::kDirLeft;
+		_vm->_animation->tr[0]._x = 151;
+		_vm->_animation->tr[0].ix = -3;
+		_vm->_animation->tr[0].iy = -5;
 
 		_vm->_gyro->setBackgroundColor(2);
 	}
 }
 
 void Timeout::rise_up_oubliette() {
-	_vm->_trip->tr[0].visible = true;
-	_vm->_trip->tr[0].iy++; // Decrements dx/dy!
-	_vm->_trip->tr[0].y -= _vm->_trip->tr[0].iy; // Uuuupppp we go...
-	if (_vm->_trip->tr[0].iy > 0)
+	_vm->_animation->tr[0]._visible = true;
+	_vm->_animation->tr[0].iy++; // Decrements dx/dy!
+	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0].iy; // Uuuupppp we go...
+	if (_vm->_animation->tr[0].iy > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
 		_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
 void Timeout::robin_hood_and_geida() {
-	_vm->_trip->tr[0].init(7, true, _vm->_trip);
-	_vm->_trip->apped(1, 7);
-	_vm->_trip->tr[0].walkto(6);
-	_vm->_trip->tr[1].stopwalk();
-	_vm->_trip->tr[1].face = _vm->_trip->kDirLeft;
+	_vm->_animation->tr[0].init(7, true, _vm->_animation);
+	_vm->_animation->apped(1, 7);
+	_vm->_animation->tr[0].walkto(6);
+	_vm->_animation->tr[1].stopwalk();
+	_vm->_animation->tr[1].face = Animation::kDirLeft;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
 
 void Timeout::robin_hood_and_geida_talk() {
 	_vm->_visa->dixi('q', 66);
-	_vm->_trip->tr[0].walkto(2);
-	_vm->_trip->tr[1].walkto(2);
-	_vm->_trip->tr[0].vanishifstill = true;
-	_vm->_trip->tr[1].vanishifstill = true;
+	_vm->_animation->tr[0].walkto(2);
+	_vm->_animation->tr[1].walkto(2);
+	_vm->_animation->tr[0].vanishifstill = true;
+	_vm->_animation->tr[1].vanishifstill = true;
 	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
 }
 
 void Timeout::avalot_returns() {
-	_vm->_trip->tr[0].done();
-	_vm->_trip->tr[1].done();
-	_vm->_trip->tr[0].init(0, true, _vm->_trip);
-	_vm->_trip->apped(1, 1);
+	_vm->_animation->tr[0].done();
+	_vm->_animation->tr[1].done();
+	_vm->_animation->tr[0].init(0, true, _vm->_animation);
+	_vm->_animation->apped(1, 1);
 	_vm->_visa->dixi('q', 67);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
 void Timeout::avvy_sit_down() {
 // This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
-	if (_vm->_trip->tr[0].homing)    // Still walking.
+	if (_vm->_animation->tr[0].homing)    // Still walking.
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_dna._sittingInPub = true;
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_trip->tr[0].visible = false;
+		_vm->_animation->tr[0]._visible = false;
 	}
 }
 
@@ -636,8 +636,8 @@ void Timeout::winning() {
 }
 
 void Timeout::avalot_falls() {
-	if (_vm->_trip->tr[0].step < 5) {
-		_vm->_trip->tr[0].step++;
+	if (_vm->_animation->tr[0].step < 5) {
+		_vm->_animation->tr[0].step++;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
 	} else {
 		Common::String toDisplay;
@@ -651,14 +651,14 @@ void Timeout::avalot_falls() {
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
-	if (_vm->_trip->tr[1].homing)
+	if (_vm->_animation->tr[1].homing)
 		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
 	else
 		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	_vm->_trip->tr[1].call_eachstep = true; // So that normal procs will continue.
+	_vm->_animation->tr[1].call_eachstep = true; // So that normal procs will continue.
 }
 
 void Timeout::give_lute_to_geida() { // Moved here from Acci.
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
deleted file mode 100644
index b94697f..0000000
--- a/engines/avalanche/trip6.cpp
+++ /dev/null
@@ -1,1634 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* TRIP5	Trippancy V - the sprite animation subsystem */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/trip6.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/visa2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/celer2.h"
-#include "avalanche/sequence2.h"
-#include "avalanche/timeout2.h"
-#include "avalanche/enid2.h"
-
-#include "common/scummsys.h"
-#include "common/textconsole.h"
-#include "common/file.h"
-
-namespace Avalanche {
-
-void triptype::init(byte spritenum, bool do_check, Trip *tr) {
-	_tr = tr;
-
-	const int32 idshould = -1317732048;
-	byte fv;
-	int32 id;
-	Common::File inf;
-
-	if (spritenum == 177)
-		return; // Already running!
-
-	Common::String filename;
-	filename = filename.format("sprite%d.avd", spritenum);
-	if (!inf.open(filename)) {
-		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
-		return;
-	}
-
-	inf.seek(177);
-
-	id = inf.readSint32LE();
-	if (id != idshould) {
-		//output << '\7';
-		inf.close();
-		return;
-	}
-
-	inf.skip(2); // Replace variable named 'soa' in the original code.
-
-	if (!a.name.empty())
-		a.name.clear();
-	byte nameSize = inf.readByte();
-	for (byte i = 0; i < nameSize; i++)
-		a.name += inf.readByte();
-	inf.skip(12 - nameSize);
-
-	//inf.skip(1); // Same as above.
-	byte commentSize = inf.readByte();
-	for (byte i = 0; i < commentSize; i++)
-		a.comment += inf.readByte();
-	inf.skip(16 - commentSize);
-
-	a.num = inf.readByte();
-	_info._xLength = inf.readByte();
-	_info._yLength = inf.readByte();
-	a.seq = inf.readByte();
-	_info._size = inf.readUint16LE();
-	a.fgc = inf.readByte();
-	a.bgc = inf.readByte();
-	a.accinum = inf.readByte();
-
-	totalnum = 0; // = 1;
-	_info._xWidth = _info._xLength / 8;
-	if ((_info._xLength % 8) > 0)
-		_info._xWidth++;
-	for (byte aa = 0; aa < /*nds*seq*/a.num; aa++) {
-
-		_info._sil[totalnum] = new SilType[11 * (_info._yLength + 1)];
-		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
-		_info._mani[totalnum] = new ManiType[_info._size - 6];
-		//getmem(mani[totalnum-1], a.size - 6);
-		for (fv = 0; fv <= _info._yLength; fv++)
-			inf.read((*_info._sil[totalnum])[fv], _info._xWidth);
-			//blockread(inf, (*sil[totalnum-1])[fv], xw);
-		inf.read(*_info._mani[totalnum], _info._size - 6);
-		//blockread(inf, *mani[totalnum-1], a.size - 6);
-
-		totalnum++;
-	}
-	totalnum++;
-
-	// on;
-	x = 0;
-	y = 0;
-	quick = true;
-	visible = false;
-	xs = 3;
-	ys = 1;
-	if (spritenum == 1)
-		_tr->newspeed(); // Just for the lights.
-
-	homing = false;
-	ix = 0;
-	iy = 0;
-	step = 0;
-	check_me = do_check;
-	count = 0;
-	whichsprite = spritenum;
-	vanishifstill = false;
-	call_eachstep = false;
-
-	inf.close();
-}
-
-void triptype::original() {
-	quick = false;
-	whichsprite = 177;
-}
-
-void triptype::andexor() {
-	if ((vanishifstill) && (ix == 0) && (iy == 0))
-		return;
-	byte picnum = face * a.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
-
-	_tr->_vm->_graphics->drawSprite(_info, picnum, x, y);
-}
-
-void triptype::turn(byte whichway) {
-	if (whichway == 8)
-		face = 0;
-	else
-		face = whichway;
-}
-
-void triptype::appear(int16 wx, int16 wy, byte wf) {
-	x = (wx / 8) * 8;
-	y = wy;
-	ox[_tr->_vm->_gyro->_cp] = wx;
-	oy[_tr->_vm->_gyro->_cp] = wy;
-	turn(wf);
-	visible = true;
-	ix = 0;
-	iy = 0;
-}
-
-bool triptype::collision_check() {
-	for (byte fv = 0; fv < _tr->kSpriteNumbMax; fv++)
-		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
-			((x + _info._xLength) > _tr->tr[fv].x) &&
-			(x < (_tr->tr[fv].x + _tr->tr[fv]._info._xLength)) &&
-			(_tr->tr[fv].y == y))
-				return true;
-
-	return false;
-}
-
-void triptype::walk() {
-	byte tc;
-	ByteField r;
-
-
-	if (visible) {
-		r._x1 = (x / 8) - 1;
-		if (r._x1 == 255)
-			r._x1 = 0;
-		r._y1 = y - 2;
-		r._x2 = ((x + _info._xLength) / 8) + 1;
-		r._y2 = y + _info._yLength + 2;
-
-		_tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r);
-	}
-
-	if (!_tr->_vm->_gyro->_doingSpriteRun) {
-		ox[_tr->_vm->_gyro->_cp] = x;
-		oy[_tr->_vm->_gyro->_cp] = y;
-		if (homing)
-			homestep();
-		x = x + ix;
-		y = y + iy;
-	}
-
-	if (check_me) {
-		if (collision_check()) {
-			bounce();
-			return;
-		}
-
-		tc = _tr->checkfeet(x, x + _info._xLength, oy[_tr->_vm->_gyro->_cp], y, _info._yLength) - 1;
-		// -1  is because the modified array indexes of magics[] compared to Pascal .
-
-		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
-			switch (_tr->_vm->_gyro->_magics[tc]._operation) {
-			case Gyro::kMagicExclaim: {
-				bounce();
-				_tr->mustexclaim = true;
-				_tr->saywhat = _tr->_vm->_gyro->_magics[tc]._data;
-				}
-				break;
-			case Gyro::kMagicBounce:
-				bounce();
-				break;
-			case Gyro::kMagicTransport:
-				_tr->fliproom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
-				break;
-			case Gyro::kMagicUnfinished: {
-				bounce();
-				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
-				}
-				break;
-			case Gyro::kMagicSpecial:
-				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);
-				break;
-			case Gyro::kMagicOpenDoor:
-				_tr->open_the_door(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
-				break;
-			}
-		}
-	}
-
-	if (!_tr->_vm->_gyro->_doingSpriteRun) {
-		count++;
-		if (((ix != 0) || (iy != 0)) && (count > 1)) {
-			step++;
-			if (step == a.seq)
-				step = 0;
-			count = 0;
-		}
-	}
-}
-
-void triptype::bounce() {
-	x = ox[_tr->_vm->_gyro->_cp];
-	y = oy[_tr->_vm->_gyro->_cp];
-	if (check_me)
-		_tr->stopwalking();
-	else
-		stopwalk();
-	_tr->_vm->_gyro->_onCanDoPageSwap = false;
-	_tr->_vm->_lucerna->drawDirection();
-	_tr->_vm->_gyro->_onCanDoPageSwap = true;
-}
-
-int8 triptype::sgn(int16 val) {
-	if (val > 0)
-		return 1;
-	else if (val < 0)
-		return -1;
-	else
-		return 0;
-}
-
-void triptype::walkto(byte pednum) {
-	pednum--; // Pascal -> C conversion: different array indexes.
-	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - y));
-	hx = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
-	hy = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
-	homing = true;
-}
-
-void triptype::stophoming() {
-	homing = false;
-}
-
-void triptype::homestep() {
-	int16 temp;
-
-	if ((hx == x) && (hy == y)) {
-		// touching the target
-		stopwalk();
-		return;
-	}
-	ix = 0;
-	iy = 0;
-	if (hy != y) {
-		temp = hy - y;
-		if (temp > 4)
-			iy = 4;
-		else if (temp < -4)
-			iy = -4;
-		else
-			iy = temp;
-	}
-	if (hx != x) {
-		temp = hx - x;
-		if (temp > 4)
-			ix = 4;
-		else if (temp < -4)
-			ix = -4;
-		else
-			ix = temp;
-	}
-}
-
-void triptype::speed(int8 xx, int8 yy) {
-	ix = xx;
-	iy = yy;
-	if ((ix == 0) && (iy == 0))
-		return; // no movement
-	if (ix == 0) {
-		// No horz movement
-		if (iy < 0)
-			turn(_tr->kDirUp);
-		else
-			turn(_tr->kDirDown);
-	} else {
-		if (ix < 0)
-			turn(_tr->kDirLeft);
-		else
-			turn(_tr->kDirRight);
-	}
-}
-
-void triptype::stopwalk() {
-	ix = 0;
-	iy = 0;
-	homing = false;
-}
-
-void triptype::chatter() {
-	_tr->_vm->_gyro->_talkX = x + _info._xLength / 2;
-	_tr->_vm->_gyro->_talkY = y;
-	_tr->_vm->_gyro->_talkFontColor = a.fgc;
-	_tr->_vm->_gyro->_talkBackgroundColor = a.bgc;
-}
-
-void triptype::set_up_saver(trip_saver_type &v) {
-	v.whichsprite = whichsprite;
-	v.face = face;
-	v.step = step;
-	v.x = x;
-	v.y = y;
-	v.ix = ix;
-	v.iy = iy;
-	v.visible = visible;
-	v.homing = homing;
-	v.check_me = check_me;
-	v.count = count;
-	v.xw = _info._xWidth;
-	v.xs = xs;
-	v.ys = ys;
-	v.totalnum = totalnum;
-	v.hx = hx;
-	v.hy = hy;
-	v.call_eachstep = call_eachstep;
-	v.eachstep = eachstep;
-	v.vanishifstill = vanishifstill;
-}
-
-void triptype::unload_saver(trip_saver_type v) {
-	whichsprite = v.whichsprite;
-	face = v.face;
-	step = v.step;
-	x = v.x;
-	y = v.y;
-	ix = v.ix;
-	iy = v.iy;
-	visible = v.visible;
-	homing = v.homing;
-	check_me = v.check_me;
-	count = v.count;
-	_info._xWidth = v.xw;
-	xs = v.xs;
-	ys = v.ys;
-	totalnum = v.totalnum;
-	hx = v.hx;
-	hy = v.hy;
-	call_eachstep = v.call_eachstep;
-	eachstep = v.eachstep;
-	vanishifstill = v.vanishifstill;
-}
-
-void triptype::savedata(Common::File &f) {
-	warning("STUB: triptype::savedata()");
-}
-
-void triptype::loaddata(Common::File &f) {
-	warning("STUB: triptype::loaddata()");
-}
-
-void triptype::save_data_to_mem(uint16 &where) {
-	warning("STUB: triptype::save_data_to_mem()");
-}
-
-void triptype::load_data_from_mem(uint16 &where) {
-	warning("STUB: triptype::load_data_from_mem()");
-}
-
-triptype *triptype::done() {
-	Common::String xx;
-
-	//  nds:=num div seq;
-	totalnum--;
-	_info._xWidth = _info._xLength / 8;
-	if ((_info._xLength % 8) > 0)
-		_info._xWidth++;
-	for (byte aa = 0; aa < /*nds*seq*/ a.num; aa++) {
-		totalnum--;
-		delete[] _info._mani[totalnum];
-		delete[] _info._sil[totalnum];
-	}
-
-	quick = false;
-	whichsprite = 177;
-	return this;
-}
-
-getsettype *getsettype::init() {
-	numleft = 0; // initialize array pointer
-	return this;
-}
-
-void getsettype::remember(ByteField r) {
-	numleft++;
-	//if (numleft > maxgetset)
-	//	error("Trip::remember() : runerr_Getset_Overflow");
-	gs[numleft] = r;
-}
-
-void getsettype::recall(ByteField &r) {
-	r = gs[numleft];
-	numleft--;
-}
-
-
-
-
-
-
-Trip::Trip(AvalancheEngine *vm) {
-	_vm = vm;
-
-	getsetclear();
-	mustexclaim = false;
-}
-
-Trip::~Trip() {
-	for (byte i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick)
-			tr[i].done();
-	}
-}
-
-void Trip::loadtrip() {
-	for (int16 gm = 0; gm < kSpriteNumbMax; gm++)
-		tr[gm].original();
-
-	for (uint16 i = 0; i < sizeof(aa); i++)
-		aa[i] = 0;
-}
-
-byte Trip::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	byte a, c;
-	int16 fv, ff;
-
-	// if not alive then begin checkfeet:=0; exit; end;
-	a = 0;
-
-	//setactivepage(2);
-	if (x1 < 0)
-		x1 = 0;
-	if (x2 > 639)
-		x2 = 639;
-	if (oy < y) {
-		for (fv = x1; fv <= x2; fv++) {
-			for (ff = oy + yl; ff <= y + yl; ff++) {
-				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
-				if (c > a)
-					a = c;
-			}
-		}
-	} else {
-		for (fv = x1; fv <= x2; fv++) {
-			for (ff = y + yl; ff <= oy + yl; ff++) {
-				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
-				if (c > a)
-					a = c;
-			}
-		}
-	}
-
-	//setactivepage(1 - cp);
-	return a;
-}
-
-byte Trip::geida_ped(byte which) {
-	switch (which) {
-	case 1:
-		return 7;
-	case 2:
-	case 6:
-		return 8;
-	case 3:
-	case 5:
-		return 9;
-	case 4:
-		return 10;
-	default:
-		return 0;
-	}
-}
-
-void Trip::catamove(byte ped) {
-/* When you enter a new position in the catacombs, this procedure should
-	be called. It changes the Also codes so that they may match the picture
-	on the screen. (Coming soon: It draws up the screen, too.) */
-
-	int32 here;
-	uint16 xy_uint16;
-	byte fv;
-
-	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
-	// catacombs has a different number for it.
-
-
-
-	xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256;
-	_vm->_gyro->_dna._geidaSpin = 0;
-
-	switch (xy_uint16) {
-	case 1801: // Exit catacombs
-		fliproom(r__lustiesroom, 4);
-		_vm->_scrolls->display("Phew! Nice to be out of there!");
-		return;
-	case 1033: // Oubliette
-		fliproom(r__oubliette, 1);
-		_vm->_scrolls->display(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
-		return;
-	case 4:
-		fliproom(r__geidas, 1);
-		return;
-	case 2307:
-		fliproom(r__lusties, 5);
-		_vm->_scrolls->display("Oh no... here we go again...");
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0].iy = 1;
-		tr[0].ix = 0;
-		return;
-	}
-
-	if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom)
-		_vm->_lucerna->loadRoom(29);
-	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1];
-
-	switch (here & 0xf) { // West.
-	case 0: // no connection (wall)
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
-		break;
-	case 0x1: // no connection (wall + shield),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
-		break;
-	case 0x2: // wall with door
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
-		break;
-	case 0x3: // wall with door and shield
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
-		break;
-	case 0x4: // no connection (wall + window),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
-		break;
-	case 0x5: // wall with door and window
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
-		break;
-	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
-		break;
-	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
-		break;
-	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
-		break;
-	}
-
-	/*  ---- */
-
-	switch ((here & 0xf0) >> 4) { // East
-	case 0: // no connection (wall)
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
-		break;
-	case 0x1: // no connection (wall + window),
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
-		break;
-	case 0x2: // wall with door
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
-		break;
-	case 0x3: // wall with door and window
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
-		break;
-	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
-		break;
-	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
-		break;
-	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
-		break;
-	}
-
-	/*  ---- */
-
-	switch ((here & 0xf00) >> 8) { // South
-	case 0: // No connection.
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
-		break;
-	case 0x1:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
-
-		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
-			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim;
-		else
-			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicSpecial; // Right exit south.
-
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
-		break;
-	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicSpecial; // Middle exit south.
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
-		break;
-	case 0x3:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicSpecial; // Left exit south.
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
-		break;
-	}
-
-	switch ((here & 0xf000) >> 12) { // North
-	case 0: // No connection
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
-		break;
-	// LEFT handles:
-#if 0
-	case 0x1:
-		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
-		break;
-#endif
-	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		break;
-#if 0
-	case 0x3:
-		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
-		break;
-	// RIGHT handles:
-	case 0x4:
-		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
-		break;
-#endif
-	case 0x5:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		break;
-#if 0
-	case 0x6:
-		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
-		break;
-#endif
-	// ARCHWAYS:
-	case 0x7:
-	case 0x8:
-	case 0x9: {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 6);
-
-		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
-		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
-
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicSpecial; // Middle arch north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
-	}
-	break;
-	// DECORATIONS:
-	case 0xd: // No connection + WINDOW
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
-		break;
-	case 0xe: // No connection + TORCH
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
-		break;
-	// Recessed door:
-	case 0xf:
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicNothing; // Door to Geida's room.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
-		break;
-	}
-
-	switch (xy_uint16) {
-	case 514:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 17);
-		break;     // [2,2] : "Art Gallery" sign over door.
-	case 264:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
-		break;      // [8,1] : "The Wrong Way!" sign.
-	case 1797:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-		break;      // [5,7] : "Ite Mingite" sign.
-	case 258:
-		for (fv = 0; fv <= 2; fv++) { // [2,1] : Art gallery - pictures
-			_vm->_celer->drawBackgroundSprite(130 + fv * 120, 70, 15);
-			_vm->_celer->drawBackgroundSprite(184 + fv * 120, 78, 16);
-		}
-		break;
-	case 1287:
-		for (fv = 10; fv <= 13; fv++)
-			_vm->_celer->drawBackgroundSprite(-1, -1, fv);
-		break; // [7,5] : 4 candles.
-	case 776:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-		break;     // [8,3] : 1 candle.
-	case 2049:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
-		break;     // [1,8] : another candle.
-	case 257:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
-		break; // [1,1] : the other two.
-	}
-
-	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
-		if (!tr[1].quick)  // If we don't already have her...
-			tr[1].init(5, true, this); // ...Load Geida.
-		apped(2, geida_ped(ped));
-		tr[1].call_eachstep = true;
-		tr[1].eachstep = procgeida_procs;
-	}
-}
-
-
-
-// This proc gets called whenever you touch a line defined as _vm->_gyro->special.
-void Trip::dawndelay() {
-	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->reason_dawndelay);
-}
-
-void Trip::call_special(uint16 which) {
-	switch (which) {
-	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->_dna._brummieStairs = 1;
-		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
-		stopwalking();
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		break;
-	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
-		_vm->_gyro->_dna._brummieStairs = 3;
-		_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicExclaim;
-		_vm->_gyro->_magics[11]._data = 5;
-		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
-		stopwalking();
-		_vm->_visa->dixi('q', 26);
-		_vm->_gyro->_dna._userMovesAvvy = true;
-		break;
-	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
-		tr[0].bounce(); // Must include that.
-
-		if (!_vm->_gyro->_dna._arrowTriggered) {
-			_vm->_gyro->_dna._arrowTriggered = true;
-			apped(2, 4); // The dart starts at ped 4, and...
-			tr[1].walkto(5); // flies to ped 5.
-			tr[1].face = 0; // Only face.
-			// Should call some kind of Eachstep procedure which will deallocate
-			// the sprite when it hits the wall, and replace it with the chunk
-			// graphic of the arrow buried in the plaster. */
-
-			// OK!
-			tr[1].call_eachstep = true;
-			tr[1].eachstep = procarrow_procs;
-		}
-		break;
-	case 4: // This is the ghost room link.
-		_vm->_lucerna->dusk();
-		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
-		_vm->_enid->backToBootstrap(3);
-		break;
-	case 5:
-		if (_vm->_gyro->_dna._friarWillTieYouUp) {
-			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
-			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
-			_vm->_visa->dixi('q', 35);
-			tr[0].done();
-			//tr[1].vanishifstill:=true;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_visa->dixi('q', 36);
-			_vm->_gyro->_dna._tiedUp = true;
-			_vm->_gyro->_dna._friarWillTieYouUp = false;
-			tr[1].walkto(3);
-			tr[1].vanishifstill = true;
-			tr[1].check_me = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
-			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
-		}
-		break;
-	case 6: // _vm->_gyro->special 6: fall down oubliette.
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0].ix = 3;
-		tr[0].iy = 0;
-		tr[0].face = kDirRight;
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
-		break;
-	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
-		tr[0].visible = false;
-		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		stopwalking();
-		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
-		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
-		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
-		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
-		break;
-	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
-		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
-			_vm->_visa->dixi('q', 63);
-			tr[1].turn(kDirDown);
-			tr[1].stopwalk();
-			tr[1].call_eachstep = false; // Geida
-			_vm->_lucerna->gameOver();
-		}
-		break;
-	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
-		if (!_vm->_gyro->_dna._geidaFollows)
-			return;   // DOESN'T COUNT: no Geida.
-		tr[1].call_eachstep = false; // She no longer follows Avvy around.
-		tr[1].walkto(4); // She walks to somewhere...
-		tr[0].done();     // Lose Avvy.
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
-		break;
-	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
-		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
-			// Into Geida's room.
-			if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1])
-				_vm->_visa->dixi('q', 62);
-			else {
-				_vm->_visa->dixi('q', 61);
-				return;
-			}
-		}
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombY--;
-		catamove(4);
-		if (_vm->_gyro->_dna._room != r__catacombs)
-			return;
-		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
-		case 0x1:
-			apped(1, 12);
-			break;
-		case 0x3:
-			apped(1, 11);
-			break;
-		default:
-			apped(1, 4);
-		}
-		getback();
-		dawndelay();
-		break;
-	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombX++;
-		catamove(1);
-		if (_vm->_gyro->_dna._room != r__catacombs)
-			return;
-		apped(1, 1);
-		getback();
-		dawndelay();
-		break;
-	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombY += 1;
-		catamove(2);
-		if (_vm->_gyro->_dna._room != r__catacombs)
-			return;
-		apped(1, 2);
-		getback();
-		dawndelay();
-		break;
-	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombX--;
-		catamove(3);
-		if (_vm->_gyro->_dna._room != r__catacombs)
-			return;
-		apped(1, 3);
-		getback();
-		dawndelay();
-		break;
-	}
-}
-
-
-
-void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
-// This slides the door open. (The data really ought to be saved in
-// the Also file, and will be next time. However, for now, they're
-// here.)
-	switch (_vm->_gyro->_dna._room) {
-	case r__outsideyours:
-	case r__outsidenottspub:
-	case r__outsideducks:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(2);
-		_vm->_sequence->then_show(3);
-		break;
-	case r__insidecardiffcastle:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(5);
-		break;
-	case r__avvysgarden:
-	case r__entrancehall:
-	case r__insideabbey:
-	case r__yourhall:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(2);
-		break;
-	case r__musicroom:
-	case r__outsideargentpub:
-		_vm->_sequence->first_show(5);
-		_vm->_sequence->then_show(6);
-		break;
-	case r__lusties:
-		switch (magicnum) {
-		case 14:
-			if (_vm->_gyro->_dna._avvysInTheCupboard) {
-				hide_in_the_cupboard();
-				_vm->_sequence->first_show(8);
-				_vm->_sequence->then_show(7);
-				_vm->_sequence->start_to_close();
-				return;
-			} else {
-				apped(1, 6);
-				tr[0].face = kDirRight; // added by TT 12/3/1995
-				_vm->_sequence->first_show(8);
-				_vm->_sequence->then_show(9);
-			}
-			break;
-		case 12:
-			_vm->_sequence->first_show(4);
-			_vm->_sequence->then_show(5);
-			_vm->_sequence->then_show(6);
-			break;
-		}
-		break;
-	}
-
-	_vm->_sequence->then_flip(whither, ped);
-	_vm->_sequence->start_to_open();
-}
-
-void Trip::newspeed() {
-	// Given that you've just changed the speed in triptype.xs, this adjusts ix.
-	const ByteField lightspace = {40, 199, 47, 199};
-	byte page_;
-
-	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
-
-	//setactivepage(3);
-
-	if (tr[0].xs == _vm->_gyro->kRun)
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
-	else
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
-
-	if (tr[0].xs == _vm->_gyro->kRun)
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
-	else
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
-
-	//setactivepage(1 - cp);
-
-	for (page_ = 0; page_ <= 1; page_++)
-		getset[page_].remember(lightspace);
-
-}
-
-void Trip::rwsp(byte t, byte dir) {
-	switch (dir) {
-	case kDirUp:
-		tr[t].speed(0, -tr[t].ys);
-		break;
-	case kDirDown:
-		tr[t].speed(0, tr[t].ys);
-		break;
-	case kDirLeft:
-		tr[t].speed(-tr[t].xs,  0);
-		break;
-	case kDirRight:
-		tr[t].speed(tr[t].xs,  0);
-		break;
-	case kDirUpLeft:
-		tr[t].speed(-tr[t].xs, -tr[t].ys);
-		break;
-	case kDirUpRight:
-		tr[t].speed(tr[t].xs, -tr[t].ys);
-		break;
-	case kDirDownLeft:
-		tr[t].speed(-tr[t].xs, tr[t].ys);
-		break;
-	case kDirDownRight:
-		tr[t].speed(tr[t].xs, tr[t].ys);
-		break;
-	}
-}
-
-void Trip::apped(byte trn, byte np) {
-	trn--;
-	np--;
-	tr[trn].appear(_vm->_gyro->_peds[np]._x - tr[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - tr[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
-	rwsp(trn, _vm->_gyro->_peds[np]._direction);
-}
-
-#if 0
-   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
-	begin // By De Morgan's law:
-	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
-	end;
-#endif
-	//x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
-	//x3,y3 = mx,my. x4,y4 = mx+16,my+16.
-
-void Trip::getback() {
-	// Super_Off;
-#if 0
-	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
-		getset[1 - _vm->_gyro->cp].recall(r);
-
-
-		bool endangered = false;
-		if overlaps_with_mouse and not endangered then
-			begin
-				endangered:=true;
-				blitfix;
-				Super_Off;
-			end;
-
-		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
-	}
-
-	if endangered then
-		Super_On;
-#endif
-}
-
-// Eachstep procedures:
-void Trip::follow_avvy_y(byte tripnum) {
-	if (tr[0].face == kDirLeft)
-		return;
-	if (tr[tripnum].homing)
-		tr[tripnum].hy = tr[1].y;
-	else {
-		if (tr[tripnum].y < tr[1].y)
-			tr[tripnum].y += 1;
-		else if (tr[tripnum].y > tr[1].y)
-			tr[tripnum].y -= 1;
-		else
-			return;
-		if (tr[tripnum].ix == 0)  {
-			tr[tripnum].step += 1;
-			if (tr[tripnum].step == tr[tripnum].a.seq)
-				tr[tripnum].step = 0;
-			tr[tripnum].count = 0;
-		}
-	}
-}
-
-void Trip::back_and_forth(byte tripnum) {
-	if (!tr[tripnum].homing) {
-		if (tr[tripnum].face == kDirRight)
-			tr[tripnum].walkto(4);
-		else
-			tr[tripnum].walkto(5);
-	}
-}
-
-void Trip::face_avvy(byte tripnum) {
-	if (!tr[tripnum].homing) {
-		if (tr[0].x >= tr[tripnum].x)
-			tr[tripnum].face = kDirRight;
-		else
-			tr[tripnum].face = kDirLeft;
-	}
-}
-
-void Trip::arrow_procs(byte tripnum) {
-	if (tr[tripnum].homing) {
-		// Arrow is still in flight.
-		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
-		// This is so if: a) the bottom of the arrow is below Avvy's head,
-		// b) the left of the arrow is left of the right of Avvy's head, and
-		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((tr[tripnum].y + tr[tripnum]._info._yLength) >= tr[0].y) // A
-				&& (tr[tripnum].x <= (tr[0].x + tr[0]._info._xLength)) // B
-				&& ((tr[tripnum].x + tr[tripnum]._info._xLength) >= tr[0].x)) { // C
-			// OK, it's hit him... what now?
-
-			tr[1].call_eachstep = false; // prevent recursion.
-			_vm->_visa->dixi('Q', 47); // Complaint!
-			tr[tripnum].done(); // Deallocate the arrow.
-#if 0
-			tr[1].done; { Deallocate normal pic of Avvy. }
-
-			off;
-			for byte fv:=0 to 1 do
-			begin
-			cp:=1-cp;
-			getback;
-			end;
-			on;
-#endif
-			_vm->_lucerna->gameOver();
-
-			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
-			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
-		}
-	} else { // Arrow has hit the wall!
-		tr[tripnum].done(); // Deallocate the arrow.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
-		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
-	}
-
-}
-
-#if 0
-procedure Spludwick_procs(tripnum:byte);
-var fv:byte;
-begin
-	with tr[tripnum] do
-	if not homing then { We only need to do anything if Spludwick *stops*
-						walking. }
-	with _vm->_gyro->dna do
-	begin
-	inc(DogfoodPos);
-	if DogfoodPos=8 then DogfoodPos:=1;
-	walkto(DogfoodPos);
-	end;
-end;
-#endif
-
-void Trip::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
-	int16 tox = tr[0].x + 17;
-	int16 toy = tr[0].y - 1;
-	if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) {
-		tr[tripnum].call_eachstep = false;
-		tr[tripnum].face = kDirLeft;
-		tr[tripnum].stopwalk();
-		// ... whatever ...
-	} else {
-		// Still some way to go.
-		if (tr[tripnum].x < tox) {
-			tr[tripnum].x += 5;
-			if (tr[tripnum].x > tox)
-				tr[tripnum].x = tox;
-		}
-		if (tr[tripnum].y < toy)
-			tr[tripnum].y++;
-		tr[tripnum].step++;
-		if (tr[tripnum].step == tr[tripnum].a.seq)
-			tr[tripnum].step = 0;
-	}
-}
-
-void Trip::take_a_step(byte &tripnum) {
-	if (tr[tripnum].ix == 0) {
-		tr[tripnum].step++;
-		if (tr[tripnum].step == tr[tripnum].a.seq)
-			tr[tripnum].step = 0;
-		tr[tripnum].count = 0;
-	}
-}
-
-void Trip::spin(byte whichway, byte &tripnum) {
-	if (tr[tripnum].face != whichway) {
-		tr[tripnum].face = whichway;
-		if (tr[tripnum].whichsprite == 2)
-			return; // Not for Spludwick
-
-		_vm->_gyro->_dna._geidaSpin += 1;
-		_vm->_gyro->_dna._geidaTime = 20;
-		if (_vm->_gyro->_dna._geidaSpin == 5) {
-			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_gyro->_dna._geidaSpin = 0;
-			_vm->_gyro->_dna._geidaTime = 0; // knock out records
-		}
-	}
-}
-
-void Trip::geida_procs(byte tripnum) {
-	if (_vm->_gyro->_dna._geidaTime > 0) {
-		_vm->_gyro->_dna._geidaTime--;
-		if (_vm->_gyro->_dna._geidaTime == 0)
-			_vm->_gyro->_dna._geidaSpin = 0;
-	}
-
-	if (tr[tripnum].y < (tr[0].y - 2)) {
-		// Geida is further from the screen than Avvy.
-		spin(kDirDown, tripnum);
-		tr[tripnum].iy = 1;
-		tr[tripnum].ix = 0;
-		take_a_step(tripnum);
-		return;
-	} else if (tr[tripnum].y > (tr[0].y + 2)) {
-		// Avvy is further from the screen than Geida.
-		spin(kDirUp, tripnum);
-		tr[tripnum].iy = -1;
-		tr[tripnum].ix = 0;
-		take_a_step(tripnum);
-		return;
-	}
-
-	tr[tripnum].iy = 0;
-	// These 12-s are not in the original, I added them to make the following method more "smooth".
-	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
-	if (tr[tripnum].x < tr[0].x - tr[0].xs * 8 - 12) {
-		tr[tripnum].ix = tr[0].xs;
-		spin(kDirRight, tripnum);
-		take_a_step(tripnum);
-	} else if (tr[tripnum].x > tr[0].x + tr[0].xs * 8 + 12) {
-		tr[tripnum].ix = -tr[0].xs;
-		spin(kDirLeft, tripnum);
-		take_a_step(tripnum);
-	} else
-		tr[tripnum].ix = 0;
-}
-
-// That's all...
-
-void Trip::call_andexors() {
-	int8 order[5];
-	byte fv, temp;
-	bool ok;
-
-	for (int i = 0; i < 5; i++)
-		order[i] = -1;
-
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv].visible)
-			order[fv] = fv;
-	}
-
-	do {
-		ok = true;
-		for (fv = 0; fv < 4; fv++) {
-			if (((order[fv] != -1) && (order[fv + 1] != -1))
-					&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
-				// Swap them!
-				temp = order[fv];
-				order[fv] = order[fv + 1];
-				order[fv + 1] = temp;
-				ok = false;
-			}
-		}
-	} while (!ok);
-
-
-	_vm->_graphics->refreshBackground();
-
-	for (fv = 0; fv < 5; fv++) {
-		if (order[fv] > -1)
-			tr[order[fv]].andexor();
-	}
-}
-
-void Trip::trippancy_link() {
-	byte fv;
-
-	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
-		return;
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv].visible)
-			tr[fv].walk();
-	}
-
-	call_andexors();
-
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv].call_eachstep) {
-			switch (tr[fv].eachstep) {
-			case procfollow_avvy_y :
-				follow_avvy_y(fv);
-				break;
-			case procback_and_forth :
-				back_and_forth(fv);
-				break;
-			case procface_avvy :
-				face_avvy(fv);
-				break;
-			case procarrow_procs :
-				arrow_procs(fv);
-				break;
-				//    PROCSpludwick_procs : spludwick_procs(fv);
-			case procgrab_avvy :
-				grab_avvy(fv);
-				break;
-			case procgeida_procs :
-				geida_procs(fv);
-				break;
-			}
-		}
-	}
-
-	if (mustexclaim) {
-		mustexclaim = false;
-		_vm->_visa->dixi('x', saywhat);
-	}
-}
-
-void Trip::get_back_loretta() {
-	byte fv;
-
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick) {
-			getback();
-			return;
-		}
-	}
-	// for fv:=0 to 1 do begin cp:=1-cp; getback; end;
-}
-
-void Trip::stopwalking() {
-	tr[0].stopwalk();
-	_vm->_gyro->_dna._direction = kDirStopped;
-	if (_vm->_gyro->_alive)
-		tr[0].step = 1;
-}
-
-void Trip::tripkey(char dir) {
-	warning("Replaced by Trip::handleMoveKey!");
-}
-
-void Trip::readstick() {
-	warning("STUB: Trip::readstick()");
-}
-
-void Trip::getsetclear() {
-	for (byte fv = 0; fv <= 1; fv++)
-		getset[fv].init();
-}
-
-void Trip::hide_in_the_cupboard() {
-	if (_vm->_gyro->_dna._avvysInTheCupboard) {
-		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
-			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
-		else {
-			tr[0].visible = true;
-			_vm->_gyro->_dna._userMovesAvvy = true;
-			apped(1, 3); // Walk out of the cupboard.
-			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
-			_vm->_gyro->_dna._avvysInTheCupboard = false;
-			_vm->_sequence->first_show(8);
-			_vm->_sequence->then_show(7);
-			_vm->_sequence->start_to_close();
-		}
-	} else {
-		// Not hiding in the cupboard
-		tr[0].visible = false;
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
-			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
-		_vm->_gyro->_dna._avvysInTheCupboard = true;
-		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
-	}
-}
-
-void Trip::fliproom(byte room, byte ped) {
-	byte fv;
-
-	if (!_vm->_gyro->_alive) {
-		// You can't leave the room if you're dead.
-		tr[0].ix = 0;
-		tr[0].iy = 0; // Stop him from moving.
-		return;
-	}
-
-	if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) {
-		hide_in_the_cupboard();
-		return;
-	}
-
-	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
-		// You can't *jump* out of Cardiff Castle!
-		tr[0].ix = 0;
-		return;
-	}
-
-	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
-	_vm->_lucerna->dusk();
-	getsetclear();
-
-
-	for (fv = 1; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick)
-			tr[fv].done();
-	} // Deallocate sprite
-
-	if (_vm->_gyro->_dna._room == r__lustiesroom)
-		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
-
-	_vm->_lucerna->enterRoom(room, ped);
-	apped(1, ped);
-	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
-	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
-	_vm->_gyro->_dna._direction = tr[0].face;
-	_vm->_lucerna->drawDirection();
-
-	for (fv = 0; fv <= 1; fv++) {
-		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
-		getback();
-	}
-	_vm->_lucerna->dawn();
-
-	// Tidy up after mouse. I know it's a kludge...
-	//  tidy_after_mouse;
-}
-
-bool Trip::infield(byte which) {
-	which--; // Pascal -> C: different array indexes.
-
-	int16 yy = tr[0].y + tr[0]._info._yLength;
-
-	return (tr[0].x >= _vm->_gyro->_fields[which]._x1) && (tr[0].x <= _vm->_gyro->_fields[which]._x2)
-		&& (yy >= _vm->_gyro->_fields[which]._y1) && (yy <= _vm->_gyro->_fields[which]._y2);
-
-}
-
-bool Trip::neardoor() {
-	if (_vm->_gyro->_fieldNum < 8) {
-		// there ARE no doors here!
-		return false;
-	}
-
-	int16 ux = tr[0].x;
-	int16 uy = tr[0].y + tr[0]._info._yLength;
-	bool nd = false;
-	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
-		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
-			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2))
-			nd = true;
-	return nd;
-}
-
-void Trip::new_game_for_trippancy() {   // Called by gyro.newgame
-	tr[0].visible = false;
-}
-
-
-
-void Trip::handleMoveKey(const Common::Event &event) {
-	if (!_vm->_gyro->_dna._userMovesAvvy)
-		return;
-
-	if (_vm->_dropdown->_activeMenuItem._activeNow)
-		_vm->_parser->tryDropdown();
-	else {
-		switch (event.kbd.keycode) {
-		case Common::KEYCODE_UP:
-			if (_vm->_gyro->_dna._direction != kDirUp) {
-				_vm->_gyro->_dna._direction = kDirUp;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_DOWN:
-			if (_vm->_gyro->_dna._direction != kDirDown) {
-				_vm->_gyro->_dna._direction = kDirDown;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_LEFT:
-			if (_vm->_gyro->_dna._direction != kDirLeft) {
-				_vm->_gyro->_dna._direction = kDirLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_RIGHT:
-			if (_vm->_gyro->_dna._direction != kDirRight) {
-				_vm->_gyro->_dna._direction = kDirRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_PAGEUP:
-			if (_vm->_gyro->_dna._direction != kDirUpRight) {
-				_vm->_gyro->_dna._direction = kDirUpRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_PAGEDOWN:
-			if (_vm->_gyro->_dna._direction != kDirDownRight) {
-				_vm->_gyro->_dna._direction = kDirDownRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_END:
-			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
-				_vm->_gyro->_dna._direction = kDirDownLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_HOME:
-			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
-				_vm->_gyro->_dna._direction = kDirUpLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
-			} else
-				stopwalking();
-			break;
-		case Common::KEYCODE_KP5:
-			stopwalking();
-			break;
-		default:
-			break;
-		}
-	}
-}
-
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/trip6.h b/engines/avalanche/trip6.h
deleted file mode 100644
index 76b435b..0000000
--- a/engines/avalanche/trip6.h
+++ /dev/null
@@ -1,217 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* TRIP5	Trippancy V - the sprite animation subsystem */
-
-
-#ifndef AVALANCHE_TRIP6_H
-#define AVALANCHE_TRIP6_H
-
-#include "avalanche/graphics.h"
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-struct adxtype { // Second revision of ADX type
-	Common::String name; // [13] name of character // uruk: Note to self: TRAILING /0 !!! Real size: 12
-	Common::String comment; // [17] comment // uruk: Same here, but 16.
-	byte num; // number of pictures
-	byte seq; // how many in one stride
-	byte fgc, bgc; // foreground & background bubble colors
-	byte accinum; // the number according to Acci (1=Avvy, etc.)
-};
-
-struct trip_saver_type {
-	byte whichsprite;
-	byte face;
-	byte step;
-	int16 x;
-	int16 y;
-	int8 ix;
-	int8 iy;
-	bool visible;
-	bool homing;
-	bool check_me;
-	byte count;
-	byte xw, xs, ys;
-	byte totalnum;
-	int16 hx;
-	int16 hy;
-	bool call_eachstep;
-	byte eachstep;
-	bool vanishifstill;
-};
-
-
-class Trip;
-
-class triptype {
-public:
-	SpriteInfo _info;
-
-	adxtype a; // vital statistics
-	byte face, step;
-	int16 x, y; // current xy coords
-	int16 ox[2], oy[2];  // last xy coords
-	int8 ix, iy; // amount to move sprite by, each step
-	byte whichsprite;
-	bool quick, visible, homing, check_me;
-	int16 hx, hy; // homing x & y coords
-	byte count; // counts before changing step
-	byte xs, ys; // x & y speed
-	byte totalnum; // total number of sprites
-	bool vanishifstill; // Do we show this sprite if it's still?
-
-	bool call_eachstep; // Do we call the eachstep procedure?
-	byte eachstep;
-
-	void init(byte spritenum, bool do_check, Trip *tr);
-	// loads & sets up the sprite
-	void original();    // just sets Quick to false
-	void andexor();    // drops sprite onto screen
-	void turn(byte whichway);      // turns him round
-	void appear(int16 wx, int16 wy, byte wf); // switches him on
-	void bounce();    // bounces off walls.
-	void walk();    // prepares for andexor, etc.
-	void walkto(byte pednum);      // home in on a point
-	void stophoming();    // self-explanatory
-	void homestep();    // calculates ix & iy for one homing step
-	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
-	void stopwalk();    // Stops the sprite from moving
-	void chatter();    // Sets up talk vars
-	void set_up_saver(trip_saver_type &v);
-	void unload_saver(trip_saver_type v);
-
-	void savedata(Common::File &f); // Self-explanatory,
-	void loaddata(Common::File &f);  // really.
-
-	void save_data_to_mem(uint16 &where);
-	void load_data_from_mem(uint16 &where);
-	triptype *done();
-
-private:
-	Trip *_tr;
-
-	bool collision_check();
-	int8 sgn(int16 val);
-};
-
-const int16 maxgetset = 35;
-
-class getsettype {
-public:
-	ByteField gs[maxgetset];
-	byte numleft;
-
-	getsettype *init();
-	void remember(ByteField r);
-	void recall(ByteField &r);
-};
-
-class Trip {
-public:
-	friend class triptype;
-	friend class getsettype;
-
-	static const int16 kDirUp = 0;
-	static const int16 kDirRight = 1;
-	static const int16 kDirDown = 2;
-	static const int16 kDirLeft = 3;
-	static const int16 kDirUpRight = 4;
-	static const int16 kDirDownRight = 5;
-	static const int16 kDirDownLeft = 6;
-	static const int16 kDirUpLeft = 7;
-	static const int16 kDirStopped = 8;
-
-	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
-
-	static const int16 procfollow_avvy_y = 1;
-	static const int16 procback_and_forth = 2;
-	static const int16 procface_avvy = 3;
-	static const int16 procarrow_procs = 4;
-	static const int16 procspludwick_procs = 5;
-	static const int16 procgrab_avvy = 6;
-	static const int16 procgeida_procs = 7;
-
-	Trip(AvalancheEngine *vm);
-	~Trip();
-
-	void trippancy_link();
-	void get_back_loretta();
-	void loadtrip();
-	void call_special(uint16 which);
-	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
-	void catamove(byte ped);
-	void stopwalking();
-	void tripkey(char dir);
-	void rwsp(byte t, byte dir);
-	void apped(byte trn, byte np);
-	void getback();
-	void fliproom(byte room, byte ped);
-	bool infield(byte which); // Returns true if you're within field "which".
-	bool neardoor(); // Returns True if you're near a door.
-	void readstick();
-	void newspeed();
-	void new_game_for_trippancy();
-	void take_a_step(byte &tripnum);
-	void handleMoveKey(const Common::Event &event); // To replace tripkey().
-
-	triptype tr[kSpriteNumbMax];
-	getsettype getset[2];
-	byte aa[1600];
-
-	bool mustexclaim;
-	uint16 saywhat;
-
-private:
-	AvalancheEngine *_vm;
-
-	// CHECKME: Useless?
-	// ByteField r;
-	// int16 beforex, beforey;
-
-	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
-	byte geida_ped(byte which);
-	void dawndelay();
-	void hide_in_the_cupboard();
-	void follow_avvy_y(byte tripnum);
-	void back_and_forth(byte tripnum);
-	void face_avvy(byte tripnum);
-	void arrow_procs(byte tripnum);
-	void grab_avvy(byte tripnum);
-	void spin(byte whichway, byte &tripnum);
-	void geida_procs(byte tripnum);
-	void call_andexors();
-	void getsetclear();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_TRIP6_H
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 635e14d..f3288dd 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -34,7 +34,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/acci2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/trip6.h"
+#include "avalanche/animation.h"
 
 #include "common/textconsole.h"
 
@@ -252,8 +252,8 @@ void Visa::talkto(byte whom) {
 		whom -= 149;
 
 	no_matches = true;
-	for (fv = 0; fv <= _vm->_trip->kSpriteNumbMax; fv++)
-		if (_vm->_trip->tr[fv].a.accinum == whom) {
+	for (fv = 0; fv <= _vm->_animation->kSpriteNumbMax; fv++)
+		if (_vm->_animation->tr[fv]._stat.accinum == whom) {
 			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
 			no_matches = false;
 			break;
@@ -275,8 +275,8 @@ void Visa::talkto(byte whom) {
 
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
-		_vm->_trip->tr[1].vanishifstill = true;
-		_vm->_trip->tr[1].walkto(3); // Walks away.
+		_vm->_animation->tr[1].vanishifstill = true;
+		_vm->_animation->tr[1].walkto(3); // Walks away.
 
 		_vm->_lucerna->incScore(2);
 	}


Commit: 9198b166f7b99b9beedf833e0f2e573420db73fc
    https://github.com/scummvm/scummvm/commit/9198b166f7b99b9beedf833e0f2e573420db73fc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T11:02:14-07:00

Commit Message:
AVALANCHE: Some more renaming in Animation

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 407bffb..5d09d05 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -708,7 +708,7 @@ void Acci::openBox(bool isOpening) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		_vm->_celer->updateBackgroundSprites();
-		_vm->_animation->trippancy_link();
+		_vm->_animation->animLink();
 		_vm->_graphics->refreshScreen();
 
 		_vm->_system->delayMillis(55);
@@ -716,7 +716,7 @@ void Acci::openBox(bool isOpening) {
 		if (!isOpening) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_celer->updateBackgroundSprites();
-			_vm->_animation->trippancy_link();
+			_vm->_animation->animLink();
 			_vm->_graphics->refreshScreen();
 		}
 	}
@@ -1704,7 +1704,7 @@ void Acci::doThat() {
 					_vm->_animation->apped(2, 4);
 					_vm->_animation->tr[1].walkto(5);
 					_vm->_animation->tr[1].call_eachstep = true;
-					_vm->_animation->tr[1].eachstep = _vm->_animation->procback_and_forth;
+					_vm->_animation->tr[1].eachstep = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5679e1b..7b34c39 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -170,13 +170,18 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
 	iy = 0;
 }
 
-bool AnimationType::collision_check() {
-	for (byte fv = 0; fv < _tr->kSpriteNumbMax; fv++)
-		if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
-			((_x + _info._xLength) > _tr->tr[fv]._x) &&
-			(_x < (_tr->tr[fv]._x + _tr->tr[fv]._info._xLength)) &&
-			(_tr->tr[fv]._y == _y))
+/**
+ * Check collision
+ * @remarks	Originally called 'collision_check'
+ */
+bool AnimationType::checkCollision() {
+	for (byte i = 0; i < _tr->kSpriteNumbMax; i++) {
+		if (_tr->tr[i].quick && (_tr->tr[i].whichsprite != whichsprite) &&
+			((_x + _info._xLength) > _tr->tr[i]._x) &&
+			(_x < (_tr->tr[i]._x + _tr->tr[i]._info._xLength)) &&
+			(_tr->tr[i]._y == _y))
 				return true;
+	}
 
 	return false;
 }
@@ -207,7 +212,7 @@ void AnimationType::walk() {
 	}
 
 	if (check_me) {
-		if (collision_check()) {
+		if (checkCollision()) {
 			bounce();
 			return;
 		}
@@ -833,7 +838,7 @@ void Animation::catamove(byte ped) {
 			tr[1].init(5, true, this); // ...Load Geida.
 		apped(2, geida_ped(ped));
 		tr[1].call_eachstep = true;
-		tr[1].eachstep = procgeida_procs;
+		tr[1].eachstep = kProcGeida;
 	}
 }
 
@@ -878,7 +883,7 @@ void Animation::call_special(uint16 which) {
 
 			// OK!
 			tr[1].call_eachstep = true;
-			tr[1].eachstep = procarrow_procs;
+			tr[1].eachstep = kProcArrow;
 		}
 		break;
 	case 4: // This is the ghost room link.
@@ -1373,7 +1378,11 @@ void Animation::call_andexors() {
 	}
 }
 
-void Animation::trippancy_link() {
+/**
+ * Animation links
+ * @remarks	Originally called 'trippancy_link'
+ */
+void Animation::animLink() {
 	byte fv;
 
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
@@ -1388,23 +1397,23 @@ void Animation::trippancy_link() {
 	for (fv = 0; fv < kSpriteNumbMax; fv++) {
 		if (tr[fv].quick && tr[fv].call_eachstep) {
 			switch (tr[fv].eachstep) {
-			case procfollow_avvy_y :
+			case kProcFollowAvvyY :
 				follow_avvy_y(fv);
 				break;
-			case procback_and_forth :
+			case kProcBackAndForth :
 				back_and_forth(fv);
 				break;
-			case procface_avvy :
+			case kProcFaceAvvy :
 				face_avvy(fv);
 				break;
-			case procarrow_procs :
+			case kProcArrow :
 				arrow_procs(fv);
 				break;
 				//    PROCSpludwick_procs : spludwick_procs(fv);
-			case procgrab_avvy :
+			case kProcGrabAvvy :
 				grab_avvy(fv);
 				break;
-			case procgeida_procs :
+			case kProcGeida :
 				geida_procs(fv);
 				break;
 			}
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index b8ae547..91837f1 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -119,7 +119,7 @@ public:
 private:
 	Animation *_tr;
 
-	bool collision_check();
+	bool checkCollision();
 	int8 sgn(int16 val);
 };
 
@@ -152,18 +152,18 @@ public:
 
 	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
 
-	static const int16 procfollow_avvy_y = 1;
-	static const int16 procback_and_forth = 2;
-	static const int16 procface_avvy = 3;
-	static const int16 procarrow_procs = 4;
-	static const int16 procspludwick_procs = 5;
-	static const int16 procgrab_avvy = 6;
-	static const int16 procgeida_procs = 7;
+	static const int16 kProcFollowAvvyY = 1;
+	static const int16 kProcBackAndForth = 2;
+	static const int16 kProcFaceAvvy = 3;
+	static const int16 kProcArrow = 4;
+	static const int16 kProcsPludwick = 5; // Unused
+	static const int16 kProcGrabAvvy = 6;
+	static const int16 kProcGeida = 7;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
 
-	void trippancy_link();
+	void animLink();
 	void get_back_loretta();
 	void loadtrip();
 	void call_special(uint16 which);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a7c8ea6..0c9fdd2 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -475,7 +475,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_lucerna->drawDirection();
 
 	_gyro->_onToolbar = false;
-	_animation->trippancy_link();
+	_animation->animLink();
 
 	_celer->updateBackgroundSprites();
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c7ebb21..54a1c22 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -203,7 +203,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_gyro->forceNumlock();
 		_vm->_animation->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
-		_vm->_animation->trippancy_link();
+		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
 		_vm->_timeout->one_tick();
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a034ace..1c191cb 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -399,7 +399,7 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	_vm->_animation->tr[1].init(5, false, _vm->_animation); // load Geida
 	_vm->_animation->apped(2, whichPed);
 	_vm->_animation->tr[1].call_eachstep = true;
-	_vm->_animation->tr[1].eachstep = _vm->_animation->procgeida_procs;
+	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -452,7 +452,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				}
 
 				_vm->_animation->tr[1].call_eachstep = true;
-				_vm->_animation->tr[1].eachstep = _vm->_animation->procface_avvy; // He always faces Avvy.
+				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
 
 			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
 
@@ -484,7 +484,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
 			_vm->_animation->tr[1].call_eachstep = true;
-			_vm->_animation->tr[1].eachstep = _vm->_animation->procgeida_procs;
+			_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -499,7 +499,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (ped > 0) {
 				_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot
 				_vm->_animation->tr[1].call_eachstep = true;
-				_vm->_animation->tr[1].eachstep = _vm->_animation->procfollow_avvy_y;
+				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
@@ -713,7 +713,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 
 		_vm->_animation->tr[1].call_eachstep = true;
-		_vm->_animation->tr[1].eachstep = _vm->_animation->procface_avvy; // She always faces Avvy.
+		_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
 		break;
 
 	case r__insidecardiffcastle:
@@ -1234,7 +1234,7 @@ void Lucerna::spriteRun() {
 	_vm->_gyro->_doingSpriteRun = true;
 
 	_vm->_animation->get_back_loretta();
-	_vm->_animation->trippancy_link();
+	_vm->_animation->animLink();
 
 	_vm->_gyro->_doingSpriteRun = false;
 }
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 38f276b..7ba2136 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -302,7 +302,7 @@ void Timeout::get_tied_up() {
 	_vm->_animation->tr[1].stopwalk();
 	_vm->_animation->tr[1].stophoming();
 	_vm->_animation->tr[1].call_eachstep = true;
-	_vm->_animation->tr[1].eachstep = _vm->_animation->procgrab_avvy;
+	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGrabAvvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 


Commit: c087998a8a65717f0353e8b8a708b4c4229e8f0b
    https://github.com/scummvm/scummvm/commit/c087998a8a65717f0353e8b8a708b4c4229e8f0b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T11:37:42-07:00

Commit Message:
AVALANCHE: Do renaming in scrolls2.h.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 5d09d05..55f1e13 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -306,16 +306,16 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 	if (target == kPardon) {
 		ambiguous = true;
 		if (animate)
-			_vm->_scrolls->display("Whom?");
+			_vm->_scrolls->displayText("Whom?");
 		else
-			_vm->_scrolls->display("What?");
+			_vm->_scrolls->displayText("What?");
 	} else {
 		if (animate)
-			_vm->_scrolls->display(Common::String("{ ") + _vm->_gyro->getName(target) + " }");
+			_vm->_scrolls->displayText(Common::String("{ ") + _vm->_gyro->getName(target) + " }");
 		else {
 			Common::String z = _vm->_gyro->getItem(target);
 			if (z != "")
-				_vm->_scrolls->display(Common::String("{ ") + z + " }");
+				_vm->_scrolls->displayText(Common::String("{ ") + z + " }");
 		}
 	}
 }
@@ -365,7 +365,7 @@ void Acci::properNouns() {
 void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
-	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + x
+	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + '1' + x
 		+ '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2');
 }
 
@@ -599,7 +599,7 @@ void Acci::parse() {
 	}
 
 	if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-			_vm->_scrolls->display(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
+			_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
 			_vm->_gyro->_weirdWord = true;
 	} else
 		_vm->_gyro->_weirdWord = false;
@@ -651,10 +651,10 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 		return true;
 	else {
 		if (_person < 175)
-			_vm->_scrolls->display(Common::String('H') + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->displayText(Common::String('H') + _vm->_scrolls->kControlToBuffer);
 		else
-			_vm->_scrolls->display(Common::String("Sh") + _vm->_scrolls->kControlToBuffer);
-		_vm->_scrolls->display("e isn't around at the moment.");
+			_vm->_scrolls->displayText(Common::String("Sh") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText("e isn't around at the moment.");
 		return false;
 	}
 }
@@ -694,9 +694,9 @@ bool Acci::holding() {
 	bool holdingResult = false;
 
 	if (_thing > 100)
-		_vm->_scrolls->display("Be reasonable!");
+		_vm->_scrolls->displayText("Be reasonable!");
 	else if (!_vm->_gyro->_dna._objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
-		_vm->_scrolls->display("You're not holding it, Avvy.");
+		_vm->_scrolls->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
 
@@ -731,37 +731,37 @@ void Acci::examine() {
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_scrolls->display(*_vm->_gyro->_also[_thing - 50][1]);
+				_vm->_scrolls->displayText(*_vm->_gyro->_also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
 	} else if (_person != kPardon)
 		exampers();
 	else
-		_vm->_scrolls->display("It's just as it looks on the picture.");  // Don't know: guess.
+		_vm->_scrolls->displayText("It's just as it looks on the picture.");  // Don't know: guess.
 }
 
 void Acci::inventory() {
 	byte itemNum = 0;
-	_vm->_scrolls->display(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
+	_vm->_scrolls->displayText(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
 			if (itemNum == _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-			_vm->_scrolls->display(_vm->_gyro->getItem(i + 1) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->displayText(_vm->_gyro->getItem(i + 1) + _vm->_scrolls->kControlToBuffer);
 			if ((i + 1) == _vm->_gyro->_dna._wearing)
-				_vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
 			if (itemNum < _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
 		}
 	}
 
 	if (_vm->_gyro->_dna._wearing == kNothing)
-		_vm->_scrolls->display(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
+		_vm->_scrolls->displayText(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
 	else
-		_vm->_scrolls->display(".");
+		_vm->_scrolls->displayText(".");
 }
 
 void Acci::swallow() {   // Eat something.
@@ -813,9 +813,9 @@ void Acci::swallow() {   // Eat something.
 		break;
 	default:
 		if ((_vm->_gyro->_dna._room == r__argentpub) || (_vm->_gyro->_dna._room == r__nottspub))
-			_vm->_scrolls->display("Try BUYing things before you drink them!");
+			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
 		else
-			_vm->_scrolls->display("The taste of it makes you retch!");
+			_vm->_scrolls->displayText("The taste of it makes you retch!");
 	}
 }
 
@@ -835,24 +835,24 @@ void Acci::peopleInRoom() {
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				_vm->_scrolls->display(_vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 			else if (actPerson < numPeople) // The middle...
-				_vm->_scrolls->display(Common::String(", ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 			else // The end.
-				_vm->_scrolls->display(Common::String(" and ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(" and ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
 		}
 	}
 
 	if (numPeople == 1)
-		_vm->_scrolls->display(Common::String(" is") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText(Common::String(" is") + _vm->_scrolls->kControlToBuffer);
 	else
-		_vm->_scrolls->display(Common::String(" are") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText(Common::String(" are") + _vm->_scrolls->kControlToBuffer);
 
-	_vm->_scrolls->display(" here."); // End and display it.
+	_vm->_scrolls->displayText(" here."); // End and display it.
 }
 
 void Acci::lookAround() {
-	_vm->_scrolls->display(*_vm->_gyro->_also[0][1]);
+	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
 	switch (_vm->_gyro->_dna._room) {
 	case r__spludwicks:
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
@@ -931,7 +931,7 @@ void Acci::openDoor() {
 				break;
 			case Gyro::kMagicUnfinished:
 				_vm->_animation->tr[0].bounce();
-				_vm->_scrolls->display("Sorry. This place is not available yet!");
+				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
 				_vm->_animation->call_special(_vm->_gyro->_portals[fv]._data);
@@ -946,16 +946,16 @@ void Acci::openDoor() {
 	}
 
 	if (_vm->_gyro->_dna._room == r__map)
-		_vm->_scrolls->display(Common::String("Avvy, you can complete the whole game without ever going "
+		_vm->_scrolls->displayText(Common::String("Avvy, you can complete the whole game without ever going "
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."));
 	else
-		_vm->_scrolls->display("Door? What door?");
+		_vm->_scrolls->displayText("Door? What door?");
 }
 
 
 
 void Acci::silly() {
-	_vm->_scrolls->display("Don't be silly!");
+	_vm->_scrolls->displayText("Don't be silly!");
 }
 
 void Acci::putProc() {
@@ -974,10 +974,10 @@ void Acci::putProc() {
 	case Gyro::kObjectWine:
 		if (_thing == _vm->_gyro->kObjectOnion) {
 			if (_vm->_gyro->_dna._rottenOnion)
-				_vm->_scrolls->display("That's a bit like shutting the stable door after the horse has bolted!");
+				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
 				if (_vm->_gyro->_dna._wineState != 3)
-					_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Oignon au vin"
+					_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "Oignon au vin"
 					+ _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!");
 				else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_dna._onionInVinegar = true;
@@ -992,31 +992,31 @@ void Acci::putProc() {
 	case 54:
 		if (_vm->_gyro->_dna._room == r__yours) { // Put something into the box.
 			if (_vm->_gyro->_dna._boxContent != kNothing)
-				_vm->_scrolls->display("There's something in the box already, Avvy. Try taking that out first.");
+				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
 				case Gyro::kObjectMoney:
-					_vm->_scrolls->display("You'd better keep some ready cash on you!");
+					_vm->_scrolls->displayText("You'd better keep some ready cash on you!");
 					break;
 				case Gyro::kObjectBell:
-					_vm->_scrolls->display("That's a silly place to keep a bell.");
+					_vm->_scrolls->displayText("That's a silly place to keep a bell.");
 					break;
 				case Gyro::kObjectBodkin:
-					_vm->_scrolls->display("But you might need it!");
+					_vm->_scrolls->displayText("But you might need it!");
 					break;
 				case Gyro::kObjectOnion:
-					_vm->_scrolls->display("Just give it to Spludwick, Avvy!");
+					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
 					if (_vm->_gyro->_dna._wearing == _thing)
-						_vm->_scrolls->display(Common::String("You'd better take ") + _vm->_gyro->getItem(_thing) + " off first!");
+						_vm->_scrolls->displayText(Common::String("You'd better take ") + _vm->_gyro->getItem(_thing) + " off first!");
 					else {
 						openBox(true); // Open box.
 
 						_vm->_gyro->_dna._boxContent = _thing;
 						_vm->_gyro->_dna._objects[_thing - 1] = false;
 						_vm->_lucerna->refreshObjectList();
-						_vm->_scrolls->display("OK, it's in the box.");
+						_vm->_scrolls->displayText("OK, it's in the box.");
 
 						openBox(false); // Shut box.
 					}
@@ -1034,7 +1034,7 @@ void Acci::putProc() {
 
 
 void Acci::notInOrder() {
-	_vm->_scrolls->display(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
+	_vm->_scrolls->displayText(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
 			+ _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick])
 			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
@@ -1110,21 +1110,21 @@ void Acci::drink() {
 
 void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_dna._standingOnDais) { // Clamber up.
-		_vm->_scrolls->display("You climb down, back onto the floor.");
+		_vm->_scrolls->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_dna._standingOnDais = false;
 		_vm->_animation->apped(1, 3);
 	} else { // Clamber down.
 		if (_vm->_animation->infield(1)) {
-			_vm->_scrolls->display("You clamber up onto the dais.");
+			_vm->_scrolls->displayText("You clamber up onto the dais.");
 			_vm->_gyro->_dna._standingOnDais = true;
 			_vm->_animation->apped(1, 2);
 		} else
-			_vm->_scrolls->display("Get a bit closer, Avvy.");
+			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
 	}
 }
 
 void Acci::already() {
-	_vm->_scrolls->display("You're already standing!");
+	_vm->_scrolls->displayText("You're already standing!");
 }
 
 void Acci::standUp() {
@@ -1175,13 +1175,13 @@ void Acci::getProc(char thing) {
 		if (_vm->_animation->infield(2)) {
 			if (_vm->_gyro->_dna._boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
-				_vm->_scrolls->display("OK, I've got it.");
+				_vm->_scrolls->displayText("OK, I've got it.");
 				_vm->_gyro->_dna._objects[thing - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_dna._boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else
-				_vm->_scrolls->display(Common::String("I can't see ") + _vm->_gyro->getItem(thing) + " in the box.");
+				_vm->_scrolls->displayText(Common::String("I can't see ") + _vm->_gyro->getItem(thing) + " in the box.");
 		} else
 			_vm->_visa->dixi('q', 57);
 		break;
@@ -1190,7 +1190,7 @@ void Acci::getProc(char thing) {
 		case Gyro::kObjectPen:
 			if (_vm->_animation->infield(2)) { // Standing on the dais.
 				if (_vm->_gyro->_dna._takenPen)
-					_vm->_scrolls->display("It's not there, Avvy.");
+					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
@@ -1198,7 +1198,7 @@ void Acci::getProc(char thing) {
 					_vm->_gyro->_dna._takenPen = true;
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
-					_vm->_scrolls->display("Taken.");
+					_vm->_scrolls->displayText("Taken.");
 				}
 			} else if (_vm->_gyro->_dna._standingOnDais)
 				_vm->_visa->dixi('q', 53);
@@ -1215,7 +1215,7 @@ void Acci::getProc(char thing) {
 	case r__robins:
 		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_animation->infield(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-			_vm->_scrolls->display("Got it!");
+			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_dna._mushroomGrowing = false;
 			_vm->_gyro->_dna._takenMushroom = true;
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = true;
@@ -1235,7 +1235,7 @@ void Acci::getProc(char thing) {
  */
 void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->_dna._room != r__lustiesroom) {
-		_vm->_scrolls->display(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	}
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
@@ -1248,9 +1248,9 @@ void Acci::giveGeidaTheLute() {
 
 void Acci::playHarp() {
 	if (_vm->_animation->infield(7))
-		_vm->_scrolls->musical_scroll();
+		_vm->_scrolls->musicalScroll();
 	else
-		_vm->_scrolls->display("Get a bit closer to it, Avvy!");
+		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
 }
 
 void Acci::winSequence() {
@@ -1271,7 +1271,7 @@ void Acci::personSpeaks() {
 	}
 
 	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
-		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
+		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
 		return;
 	}
 
@@ -1279,7 +1279,7 @@ void Acci::personSpeaks() {
 
 	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->tr[i].quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
-			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
 	}
@@ -1287,13 +1287,13 @@ void Acci::personSpeaks() {
 	if (!found) {
 		for (byte i = 0; i < 16; i++) {
 			if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
-				_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
 		}
 	}
 }
 void Acci::heyThanks() {
 	personSpeaks();
-	_vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
+	_vm->_scrolls->displayText(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
 	_vm->_gyro->_dna._objects[_thing - 1] = false;
 }
 
@@ -1321,11 +1321,11 @@ void Acci::doThat() {
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_gyro->_alive) {
-			_vm->_scrolls->display(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
+			_vm->_scrolls->displayText(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
 			return;
 		}
 		if (!_vm->_gyro->_dna._avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
-			_vm->_scrolls->display("Talking in your sleep? Try waking up!");
+			_vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
 			return;
 		}
 	}
@@ -1338,24 +1338,24 @@ void Acci::doThat() {
 		openDoor();
 		break;
 	case kVerbCodePause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		_vm->_scrolls->display(Common::String("Game paused.") + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+		_vm->_scrolls->displayText(Common::String("Game paused.") + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 			+ "Press Enter, Esc, or click the mouse on the \"O.K.\" box to continue.");
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
 			if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
-				_vm->_scrolls->display("You can't carry any more!");
+				_vm->_scrolls->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
 		} else { // Not... ditto.
 			if (_person != kPardon)
-				_vm->_scrolls->display("You can't sweep folk off their feet!");
+				_vm->_scrolls->displayText("You can't sweep folk off their feet!");
 			else
-				_vm->_scrolls->display("I assure you, you don't need it.");
+				_vm->_scrolls->displayText("I assure you, you don't need it.");
 		}
 		break;
 	case kVerbCodeDrop:
-		_vm->_scrolls->display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
+		_vm->_scrolls->displayText(Common::String("Two years ago you dropped a florin in the street. Three days ") +
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
 	case kVerbCodeInv:
@@ -1364,7 +1364,7 @@ void Acci::doThat() {
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
 			if (_vm->_gyro->_subjectNum == 99) // They typed "say password".
-				_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
+				_vm->_scrolls->displayText(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
 			else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
@@ -1378,7 +1378,7 @@ void Acci::doThat() {
 				_person = _vm->_gyro->_subjectNum;
 				_vm->_gyro->_subjectNum = 0;
 				if ((_person == 0) || (_person == kPardon))
-					_vm->_scrolls->display("Talk to whom?");
+					_vm->_scrolls->displayText("Talk to whom?");
 				else if (isPersonHere())
 					_vm->_visa->talkto(_person);
 			}
@@ -1388,30 +1388,30 @@ void Acci::doThat() {
 	case kVerbCodeGive:
 		if (holding()) {
 			if (_person == kPardon)
-				_vm->_scrolls->display("Give to whom?");
+				_vm->_scrolls->displayText("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
 				case Gyro::kObjectMoney :
-					_vm->_scrolls->display("You can't bring yourself to give away your moneybag.");
+					_vm->_scrolls->displayText("You can't bring yourself to give away your moneybag.");
 					break;
 				case Gyro::kObjectBodkin:
 				case Gyro::kObjectBell:
 				case Gyro::kObjectClothes:
 				case Gyro::kObjectHabit :
-					_vm->_scrolls->display("Don't give it away, it might be useful!");
+					_vm->_scrolls->displayText("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
 					case Gyro::kPeopleCrapulus:
 						if (_thing == _vm->_gyro->kObjectWine) {
-							_vm->_scrolls->display("Crapulus grabs the wine and gulps it down.");
+							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
 					case Gyro::kPeopleCwytalot:
 						if ((_thing == _vm->_gyro->kObjectCrossbow) || (_thing == _vm->_gyro->kObjectBolt))
-							_vm->_scrolls->display(Common::String("You might be able to influence Cwytalot more if you used it!"));
+							_vm->_scrolls->displayText(Common::String("You might be able to influence Cwytalot more if you used it!"));
 						else
 							heyThanks();
 						break;
@@ -1443,7 +1443,7 @@ void Acci::doThat() {
 							} else
 								heyThanks();
 						} else
-							_vm->_scrolls->display("But he's asleep!");
+							_vm->_scrolls->displayText("But he's asleep!");
 						break;
 					case Gyro::kPeopleGeida:
 						switch (_thing) {
@@ -1495,13 +1495,13 @@ void Acci::doThat() {
 	// We don't handle these two because we use ScummVM's save/load system.
 
 	case kVerbCodePay:
-		_vm->_scrolls->display("No money need change hands.");
+		_vm->_scrolls->displayText("No money need change hands.");
 		break;
 	case kVerbCodeLook:
 		lookAround();
 		break;
 	case kVerbCodeBreak:
-		_vm->_scrolls->display("Vandalism is prohibited within this game!");
+		_vm->_scrolls->displayText("Vandalism is prohibited within this game!");
 		break;
 	case kVerbCodeQuit: // quit
 		if (_vm->_gyro->kDemo) {
@@ -1511,15 +1511,15 @@ void Acci::doThat() {
 		//	exit(0); // Change this later!!!
 		}
 		if (!_polite)
-			_vm->_scrolls->display("How about a `please\", Avvy?");
-		else if (_vm->_scrolls->ask(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
+			_vm->_scrolls->displayText("How about a `please\", Avvy?");
+		else if (_vm->_scrolls->displayQuestion(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
 			_vm->_gyro->_letMeOut = true;
 		break;
 	case kVerbCodeGo:
-		_vm->_scrolls->display("Just use the arrow keys to walk there.");
+		_vm->_scrolls->displayText("Just use the arrow keys to walk there.");
 		break;
 	case kVerbCodeInfo: {
-		_vm->_scrolls->aboutscroll = true;
+		_vm->_scrolls->_aboutScroll = true;
 
 		Common::String toDisplay;
 		for (byte i = 0; i < 7; i++)
@@ -1529,34 +1529,34 @@ void Acci::doThat() {
 			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright \xEF "
 			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
-		_vm->_scrolls->display(toDisplay);
-		_vm->_scrolls->aboutscroll = false;
+		_vm->_scrolls->displayText(toDisplay);
+		_vm->_scrolls->_aboutScroll = false;
 		}
 		break;
 	case kVerbCodeUndress:
 		if (_vm->_gyro->_dna._wearing == kNothing)
-			_vm->_scrolls->display("You're already stark naked!");
+			_vm->_scrolls->displayText("You're already stark naked!");
 		else if (_vm->_gyro->_dna._avvysInTheCupboard) {
-			_vm->_scrolls->display(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.');
+			_vm->_scrolls->displayText(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.');
 			_vm->_gyro->_dna._wearing = kNothing;
 			_vm->_lucerna->refreshObjectList();
 		} else
-			_vm->_scrolls->display("Hadn't you better find somewhere more private, Avvy?");
+			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case kVerbCodeWear:
 		if (holding()) { // Wear something.
 			switch (_thing) {
 			case Gyro::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
-				_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you\?\?!");
+				_vm->_scrolls->displayText("Hey, kWhat kind of a weirdo are you\?\?!");
 				break;
 			case Gyro::kObjectClothes:
 			case Gyro::kObjectHabit: { // Change this!
 					if (_vm->_gyro->_dna._wearing != kNothing) {
 						if (_vm->_gyro->_dna._wearing == _thing)
-							_vm->_scrolls->display("You're already wearing that.");
+							_vm->_scrolls->displayText("You're already wearing that.");
 						else
-							_vm->_scrolls->display("You'll be rather warm wearing two sets of clothes!");
+							_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
 						return;
 					} else
 						_vm->_gyro->_dna._wearing = _thing;
@@ -1579,7 +1579,7 @@ void Acci::doThat() {
 				}
 				break;
 			default:
-				_vm->_scrolls->display(kWhat);
+				_vm->_scrolls->displayText(kWhat);
 			}
 		}
 		break;
@@ -1617,7 +1617,7 @@ void Acci::doThat() {
 						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-					_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+					_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
 						+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
 				}
 				break;
@@ -1640,29 +1640,29 @@ void Acci::doThat() {
 				if (_vm->_gyro->_dna._room == r__musicroom)
 					playHarp();
 				else
-					_vm->_scrolls->display(kWhat);
+					_vm->_scrolls->displayText(kWhat);
 				break;
 			case 55:
 				if (_vm->_gyro->_dna._room == r__argentpub)
 					// play_nim();
 					warning("STUB: Acci::doThat() - case kVerbCodeplay");
 				else
-					_vm->_scrolls->display(kWhat);
+					_vm->_scrolls->displayText(kWhat);
 				break;
 			default:
-				_vm->_scrolls->display(kWhat);
+				_vm->_scrolls->displayText(kWhat);
 			}
 		}
 		break;
 	case kVerbCodeRing:
 		if (holding()) {
 			if (_thing == _vm->_gyro->kObjectBell) {
-				_vm->_scrolls->display("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
-					_vm->_scrolls->display("(Are you trying to join in, Avvy\?\?!)");
+					_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
-				_vm->_scrolls->display(kWhat);
+				_vm->_scrolls->displayText(kWhat);
 		}
 		break;
 	case kVerbCodeHelp:
@@ -1670,10 +1670,10 @@ void Acci::doThat() {
 		warning("STUB: Acci::doThat() - case kVerbCodehelp");
 		break;
 	case kVerbCodeLarrypass:
-		_vm->_scrolls->display("Wrong game!");
+		_vm->_scrolls->displayText("Wrong game!");
 		break;
 	case kVerbCodePhaon:
-		_vm->_scrolls->display("Hello, Phaon!");
+		_vm->_scrolls->displayText("Hello, Phaon!");
 		break;
 	case kVerbCodeBoss:
 		// bosskey();
@@ -1681,14 +1681,14 @@ void Acci::doThat() {
 		break;
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
-			_vm->_scrolls->display("Hmm, I don't think anyone will notice...");
+			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
 		} else
-			_vm->_scrolls->display(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
+			_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
 			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
 		break;
 	case kVerbCodeCheat:
-		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
+		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
 		_vm->_gyro->_cheat = true;
 		break;
 	case kVerbCodeMagic:
@@ -1709,25 +1709,25 @@ void Acci::doThat() {
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
 			} else
-				_vm->_scrolls->display("Nothing appears to happen...");
+				_vm->_scrolls->displayText("Nothing appears to happen...");
 		}
 		break;
 	case kVerbCodeSmartAlec:
-		_vm->_scrolls->display("Listen, smart alec, that was just rhetoric.");
+		_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
 		switch (_vm->_gyro->_dna._sworeNum) {
 		case 0:
-			_vm->_scrolls->display(Common::String("Avvy! Do you mind? There might be kids playing!")
+			_vm->_scrolls->displayText(Common::String("Avvy! Do you mind? There might be kids playing!")
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(I shouldn't say it again, if I were you!)");
 			break;
 		case 1:
-			_vm->_scrolls->display(Common::String("You hear a distant rumble of thunder. Must you always do things I tell you not to?")
+			_vm->_scrolls->displayText(Common::String("You hear a distant rumble of thunder. Must you always do things I tell you not to?")
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Don't do it again!");
 			break;
 		default:
 			_vm->_pingo->zonk();
-			_vm->_scrolls->display(Common::String("A crack of lightning shoots from the sky, and fries you.")
+			_vm->_scrolls->displayText(Common::String("A crack of lightning shoots from the sky, and fries you.")
 				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna->gameOver();
 		}
@@ -1735,11 +1735,11 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeListen:
 		if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-			_vm->_scrolls->display("All other noise is drowned out by the ringing of the bells.");
+			_vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
 		else if (_vm->_gyro->_listen.empty())
-			_vm->_scrolls->display("You can't hear anything much at the moment, Avvy.");
+			_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_scrolls->display(_vm->_gyro->_listen);
+			_vm->_scrolls->displayText(_vm->_gyro->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_dna._room) {
@@ -1764,7 +1764,7 @@ void Acci::doThat() {
 						_vm->_lucerna->incScore(3);
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-					_vm->_scrolls->display(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 					_vm->_gyro->_dna._drinking = _thing;
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -1784,12 +1784,12 @@ void Acci::doThat() {
 						}
 
 						if (_vm->_gyro->_dna._carryNum >= kCarryLimit) {
-							_vm->_scrolls->display("Your hands are full.");
+							_vm->_scrolls->displayText("Your hands are full.");
 							return;
 						}
 
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-						_vm->_scrolls->display(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->displayText(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 						if (_vm->_gyro->_dna._alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -1809,7 +1809,7 @@ void Acci::doThat() {
 					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
 						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
-						_vm->_scrolls->display("Before you ask, you remember that your hands are full.");
+						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
 					else {
 						if (_vm->_gyro->_dna._boughtOnion)
 							_vm->_visa->dixi('D', 11);
@@ -1845,13 +1845,13 @@ void Acci::doThat() {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->dixi('Q', 10);
-				_vm->_scrolls->display("(At the very least, don't use your bare hands!)");
+				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_scrolls->display("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
+				_vm->_scrolls->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
 				break;
 			case 2:
-				_vm->_scrolls->display("Come on, Avvy! You're not going to get very far with only a crossbow!");
+				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
 				_vm->_visa->dixi('Q', 11);
@@ -1888,10 +1888,10 @@ void Acci::doThat() {
 
 			if (ok) {
 				if (_vm->_gyro->_dna._drawbridgeOpen != 0)
-					_vm->_scrolls->display("Contrary to your expectations, the drawbridge fails to close again.");
+					_vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
 					_vm->_lucerna->incScore(4);
-					_vm->_scrolls->display("The drawbridge opens!");
+					_vm->_scrolls->displayText("The drawbridge opens!");
 					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
@@ -1906,7 +1906,7 @@ void Acci::doThat() {
 		_vm->_lucerna->gameOver();
 		break;
 	case kVerbCodeScore:
-		_vm->_scrolls->display(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter
+		_vm->_scrolls->displayText(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter
 			+ _vm->_scrolls->kControlNewLine + "out of a possible 128." + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totalTime());
 		break;
@@ -1918,7 +1918,7 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeKiss:
 		if (_person == kPardon)
-			_vm->_scrolls->display("Kiss whom?");
+			_vm->_scrolls->displayText("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
 			case Gyro::kPeopleArkata:
@@ -1934,14 +1934,14 @@ void Acci::doThat() {
 				_vm->_visa->dixi('U', 5); // You WHAT?
 			}
 		} else if ((150 <= _person) && (_person <= 174))
-			_vm->_scrolls->display("Hey, kWhat kind of a weirdo are you??");
+			_vm->_scrolls->displayText("Hey, kWhat kind of a weirdo are you??");
 
 		break;
 	case kVerbCodeClimb:
 		if (_vm->_gyro->_dna._room == r__insidecardiffcastle)
 			cardiffClimbing();
 		else // In the wrong room!
-			_vm->_scrolls->display("Not with your head for heights, Avvy!");
+			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
@@ -1965,24 +1965,24 @@ void Acci::doThat() {
 					if (_vm->_gyro->_dna._teetotal)
 						_vm->_visa->dixi('d', 13);
 				} else
-					_vm->_scrolls->display("You're already awake, Avvy!");
+					_vm->_scrolls->displayText("You're already awake, Avvy!");
 				break;
 			case Gyro::kPeopleAyles:
 				if (!_vm->_gyro->_dna._aylesIsAwake)
-					_vm->_scrolls->display("You can't seem to wake him by yourself.");
+					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
 				break;
 			case Gyro::kPeopleJacques:
-				_vm->_scrolls->display(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' +
+				_vm->_scrolls->displayText(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' +
 					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
 			default:
-				_vm->_scrolls->display("It's difficult to awaken people who aren't asleep...!");
+				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
 		}
 		break;
 	case kVerbCodeSit:
 		if (_vm->_gyro->_dna._room == r__nottspub) {
 			if (_vm->_gyro->_dna._sittingInPub)
-				_vm->_scrolls->display("You're already sitting!");
+				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
 				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
@@ -1991,29 +1991,29 @@ void Acci::doThat() {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->hangAroundForAWhile();
 			_vm->_lucerna->dawn();
-			_vm->_scrolls->display(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
+			_vm->_scrolls->displayText(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
 		}
 		break;
 	case kVerbCodeRestart:
-		if (_vm->_scrolls->ask("Restart game and lose changes?"))  {
+		if (_vm->_scrolls->displayQuestion("Restart game and lose changes?"))  {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->newGame();
 			_vm->_lucerna->dawn();
 		}
 		break;
 	case kPardon:
-		_vm->_scrolls->display("Hey, a _verb would be helpful!");
+		_vm->_scrolls->displayText("Hey, a _verb would be helpful!");
 		break;
 	case kVerbCodeHello:
 		personSpeaks();
-		_vm->_scrolls->display(Common::String("Hello.") + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("Hello.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
 	case kVerbCodeThanks:
 		personSpeaks();
-		_vm->_scrolls->display(Common::String("That's OK.") + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("That's OK.") + _vm->_scrolls->kControlSpeechBubble);
 		break;
 	default:
-		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlBell) + "Parser bug!");
+		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlBell) + "Parser bug!");
 	}
 }
 
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 7b34c39..598ae7d 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -236,7 +236,7 @@ void AnimationType::walk() {
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
-				_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
+				_tr->_vm->_scrolls->displayText("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
 			case Gyro::kMagicSpecial:
@@ -551,18 +551,18 @@ void Animation::catamove(byte ped) {
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
 		fliproom(r__lustiesroom, 4);
-		_vm->_scrolls->display("Phew! Nice to be out of there!");
+		_vm->_scrolls->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033: // Oubliette
 		fliproom(r__oubliette, 1);
-		_vm->_scrolls->display(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	case 4:
 		fliproom(r__geidas, 1);
 		return;
 	case 2307:
 		fliproom(r__lusties, 5);
-		_vm->_scrolls->display("Oh no... here we go again...");
+		_vm->_scrolls->displayText("Oh no... here we go again...");
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		tr[0].iy = 1;
 		tr[0].ix = 0;
@@ -924,7 +924,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
-		_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
+		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
@@ -1295,7 +1295,7 @@ void Animation::spin(byte whichway, byte &tripnum) {
 		_vm->_gyro->_dna._geidaSpin += 1;
 		_vm->_gyro->_dna._geidaTime = 20;
 		if (_vm->_gyro->_dna._geidaSpin == 5) {
-			_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
+			_vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
 			_vm->_gyro->_dna._geidaSpin = 0;
 			_vm->_gyro->_dna._geidaTime = 0; // knock out records
 		}
@@ -1461,12 +1461,12 @@ void Animation::getsetclear() {
 void Animation::hide_in_the_cupboard() {
 	if (_vm->_gyro->_dna._avvysInTheCupboard) {
 		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
-			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
+			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
 		else {
 			tr[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
 			apped(1, 3); // Walk out of the cupboard.
-			_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
+			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_dna._avvysInTheCupboard = false;
 			_vm->_sequence->first_show(8);
 			_vm->_sequence->then_show(7);
@@ -1476,7 +1476,7 @@ void Animation::hide_in_the_cupboard() {
 		// Not hiding in the cupboard
 		tr[0]._visible = false;
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_scrolls->display(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
+		_vm->_scrolls->displayText(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
 			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
 		_vm->_gyro->_dna._avvysInTheCupboard = true;
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0c9fdd2..9b04f64 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -479,7 +479,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_celer->updateBackgroundSprites();
 
-	_scrolls->display(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
+	_scrolls->displayText(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
 		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 54a1c22..72cb1d6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -132,7 +132,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 void Avalot::setup() {
 	_vm->_gyro->_mouse = _vm->_gyro->kMouseStateNo;
 	_vm->_gyro->_letMeOut = false;
-	_vm->_scrolls->resetscroll();
+	_vm->_scrolls->resetScroll();
 	CursorMan.showMouse(true);
 	_vm->_gyro->_holdTheDawn = true;
 	_vm->_lucerna->dusk();
@@ -152,7 +152,7 @@ void Avalot::setup() {
 	_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionStopped;
 	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
-	_vm->_scrolls->state(2);
+	_vm->_scrolls->setReadyLight(2);
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 4ea4de7..6fa91cf 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -239,7 +239,7 @@ void Gyro::newGame() {
 	_score = 0;
 	memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
 
-	_vm->_scrolls->natural();
+	_vm->_scrolls->setBubbleStateNatural();
 
 	_dna._spareEvening = "answer a questionnaire";
 	_dna._favouriteDrink = "beer";
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1c191cb..e56250f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -74,7 +74,7 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 		plotHands();
 
 	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717))
-		_vm->_scrolls->display(Common::String("Good morning!") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+		_vm->_scrolls->displayText(Common::String("Good morning!") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
 		+ "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
 
 	_oldHour = _hour;
@@ -146,7 +146,7 @@ void Lucerna::init() {
  */
 void Lucerna::callVerb(byte id) {
 	if (id == _vm->_acci->kPardon) {
-		_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
+		_vm->_scrolls->displayText(Common::String("The f5 key lets you do a particular action in certain ") +
 			"situations. However, at the moment there is nothing " +
 			"assigned to it. You may press alt-A to see what the " +
 			"current setting of this key is.");
@@ -1242,7 +1242,7 @@ void Lucerna::spriteRun() {
 void Lucerna::fixFlashers() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_gyro->_oldDirection = 177;
-	_vm->_scrolls->state(2);
+	_vm->_scrolls->setReadyLight(2);
 	drawDirection();
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index c445a7e..444762b 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -49,11 +49,11 @@ Scrolls::Scrolls(AvalancheEngine *vm) {
 }
 
 void Scrolls::init() {
-	loadfont();
-	resetscrolldriver();
+	loadFont();
+	resetScrollDriver();
 }
 
-void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
+void Scrolls::setReadyLight(byte x) {     // Sets "Ready" light to whatever
 	if (_vm->_gyro->_ledStatus == x)
 		return; // Already like that!
 
@@ -78,7 +78,7 @@ void Scrolls::state(byte x) {     // Sets "Ready" light to whatever
 	_vm->_gyro->_ledStatus = x;
 }
 
-void Scrolls::easteregg() {
+void Scrolls::easterEgg() {
 	warning("STUB: Scrolls::easteregg()");
 }
 
@@ -93,16 +93,16 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwrit
 	for (byte xx = 0; xx < lz; xx++) {
 		switch (z[xx]) {
 		case kControlRoman: {
-			cfont = roman;
+			_currentFont = kFontStyleRoman;
 			}
 			break;
 		case kControlItalic: {
-			cfont = italic;
+			_currentFont = kFontStyleItalic;
 			}
 			break;
 		default: {
 			for (byte yy = 0; yy < 12; yy++)
-				itw[(byte)z[xx]][yy] = ch[cfont][(byte)z[xx]][yy + 2];
+				itw[(byte)z[xx]][yy] = _scrollFonts[_currentFont][(byte)z[xx]][yy + 2];
 
 			// We have to draw the characters one-by-one because of the accidental font changes.
 			i++;
@@ -115,11 +115,11 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwrit
 
 // Here are the procedures that Scroll calls. So they must be... $F+*/
 
-void Scrolls::normscroll() {
+void Scrolls::scrollModeNormal() {
 	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
 	Common::String e = "(c) 1994";
 
-	state(3);
+	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(4);
@@ -182,7 +182,7 @@ void Scrolls::normscroll() {
 	_vm->_gyro->screturn = r == '#'; // "back door"
 #endif
 
-	state(0);
+	setReadyLight(0);
 	_vm->_gyro->_seeScroll = false;
 	CursorMan.showMouse(false);
 	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
@@ -190,19 +190,19 @@ void Scrolls::normscroll() {
 	warning("STUB: Scrolls::normscroll()");
 }
 
-void Scrolls::dialogue() {
+void Scrolls::scrollModeDialogue() {
 	warning("STUB: Scrolls::dialogue()");
 }
 
 
 
 
-void Scrolls::store_(byte what, TuneType &played) {
+void Scrolls::store(byte what, TuneType &played) {
 	memcpy(played + 1, played + 2, sizeof(played) - 1);
 	played[30] = what;
 }
 
-bool Scrolls::they_match(TuneType &played) {
+bool Scrolls::theyMatch(TuneType &played) {
 	byte fv, mistakes;
 
 	mistakes = 0;
@@ -216,8 +216,8 @@ bool Scrolls::they_match(TuneType &played) {
 	return mistakes < 5;
 }
 
-void Scrolls::music_scroll() {
-	state(3);
+void Scrolls::scrollModeMusic() {
+	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(4);
@@ -229,7 +229,7 @@ void Scrolls::music_scroll() {
 #endif
 		_vm->_gyro->_scReturn = true;
 		CursorMan.showMouse(false);
-		state(0);
+		setReadyLight(0);
 		_vm->_gyro->_seeScroll = false;
 
 		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->reason_jacques_waking_up);
@@ -247,30 +247,30 @@ void Scrolls::music_scroll() {
 
 // ThatsAll, so put us back to $F-
 
-void Scrolls::resetscrolldriver() {   // phew
+void Scrolls::resetScrollDriver() {   // phew
 	_vm->_gyro->_scrollBells = 0;
-	cfont = roman;
-	use_icon = 0;
+	_currentFont = kFontStyleRoman;
+	_useIcon = 0;
 	_vm->_gyro->_interrogation = 0; // always reset after a scroll comes up.
 }
 
-void Scrolls::dingdongbell() {   // Pussy's in the well. Who put her in? Little...
+void Scrolls::ringBell() {   // Pussy's in the well. Who put her in? Little...
 	for (byte fv = 0; fv < _vm->_gyro->_scrollBells; fv++)
 		_vm->_lucerna->errorLed(); // ring the bell "x" times
 }
 
 void Scrolls::dodgem() {
-	dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
+	_dodgeCoord = _vm->getMousePos();
+	g_system->warpMouse(_dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
 }
 
-void Scrolls::undodgem() {
+void Scrolls::unDodgem() {
 	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
-		g_system->warpMouse(dodgeCoord.x, dodgeCoord.y); // No change, so restore the pointer's original position.
+	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
+		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
-void Scrolls::geticon(int16 x, int16 y, byte which) {
+void Scrolls::getIcon(int16 x, int16 y, byte which) {
 	Common::File f;
 	byte *p;
 
@@ -292,7 +292,7 @@ void Scrolls::geticon(int16 x, int16 y, byte which) {
 	f.close();
 }
 
-void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
+void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File f;
 
 	Common::String filename;
@@ -321,7 +321,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
 	f.close();
 }
 
-void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in the game.
+void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the oldest procs in the game.
 	byte b;
 	int16 lx, ly, mx, my, ex;
 	bool centre;
@@ -343,8 +343,8 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	lx = lx / 2;
 	ly -= 2;
 
-	if ((1 <= use_icon) && (use_icon <= 34))
-		lx += halficonwidth;
+	if ((1 <= _useIcon) && (_useIcon <= 34))
+		lx += kHalfIconWidth;
 
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
@@ -382,24 +382,24 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	centre = false;
 
-	switch (use_icon) {
+	switch (_useIcon) {
 	case 0:
 		icon_indent = 0;
 		break; // No icon.
 	case 34: {
-		block_drop("about", 28, 76, 15);
+		drawSign("about", 28, 76, 15);
 		icon_indent = 0;
 		}
 		break;
 	case 35: {
-		block_drop("gameover", 52, 59, 71);
+		drawSign("gameover", 52, 59, 71);
 		icon_indent = 0;
 		}
 		break;
 	}
 
-	if ((1 <= use_icon) && (use_icon <= 33)) { // Standard icon.
-		geticon(mx, my + ly / 2, use_icon);
+	if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon.
+		getIcon(mx, my + ly / 2, _useIcon);
 		icon_indent = 53;
 	}
 
@@ -419,13 +419,13 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 				break;
 			case kControlQuestion: {
 				//settextjustify(1, 1);
-				dix = mx + lx;
-				diy = my + ly;
+				_shadowBoxX = mx + lx;
+				_shadowBoxY = my + ly;
 				_vm->_gyro->_scroll[b].setChar(' ', 0);
 				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
-				_vm->_gyro->drawShadowBox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
-				_vm->_gyro->drawShadowBox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
+				_vm->_gyro->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				}
 				break;
 			}
@@ -440,14 +440,14 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 
 	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	//setvisualpage(1 - cp);
-	dingdongbell();
+	ringBell();
 	//my = getpixel(0, 0);
 	_vm->_gyro->_dropsOk = false;
 	dodgem();
 
 	(this->*gotoit)();
 
-	undodgem();
+	unDodgem();
 	_vm->_gyro->_dropsOk = true;
 	//setvisualpage(cp);
 	//mousepage(cp);
@@ -458,14 +458,14 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
 	_vm->_gyro->_onCanDoPageSwap = true; // Normality again.
 	CursorMan.showMouse(true);
 	//settextjustify(0, 0); // sink
-	resetscrolldriver();
+	resetScrollDriver();
 	/*if (_vm->_gyro->mpress > 0)
 	_vm->_gyro->after_the_scroll = true;*/
 
 	warning("STUB: Scrolls::drawscroll()");
 }
 
-void Scrolls::bubble(func2 gotoit) {
+void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 	int16 xl, yl, my, xw, yw;
 	Common::Point p[3];
 //	byte *rp1, *rp2; // replace: 1=bubble, 2=pointer
@@ -536,7 +536,7 @@ void Scrolls::bubble(func2 gotoit) {
 	}
 
 	//setvisualpage(1 - cp);
-	dingdongbell();
+	ringBell();
 	_vm->_gyro->_onCanDoPageSwap = false;
 	CursorMan.showMouse(true);
 	_vm->_gyro->_dropsOk = false;
@@ -550,31 +550,31 @@ void Scrolls::bubble(func2 gotoit) {
 	//setvisualpage(cp);
 	CursorMan.showMouse(true); // sink;
 	_vm->_gyro->_onCanDoPageSwap = true;
-	resetscrolldriver();
+	resetScrollDriver();
 	/*if (_vm->_gyro->mpress > 0)
 	_vm->_gyro->after_the_scroll = true;*/
 }
 
-bool Scrolls::ask(Common::String question) {
+bool Scrolls::displayQuestion(Common::String question) {
 	warning("STUB: Scrolls::ask()");
 	return true;
 }
 
-void Scrolls::resetscroll() {
+void Scrolls::resetScroll() {
 	_vm->_gyro->_scrollNum = 1;
 	for (int j = 0; j < 15; j++)
 		if (!_vm->_gyro->_scroll[j].empty())
 			_vm->_gyro->_scroll[j].clear();
 }
 
-void Scrolls::natural() {   // Natural state of bubbles
+void Scrolls::setBubbleStateNatural() {
 	_vm->_gyro->_talkX = 320;
 	_vm->_gyro->_talkY = 200;
 	_vm->_gyro->_talkBackgroundColor = 8;
 	_vm->_gyro->_talkFontColor = 15;
 }
 
-Common::String Scrolls::lsd() {
+Common::String Scrolls::displayMoney() {
 	Common::String x;
 
 	if (_vm->_gyro->_dna._money < 12) { // just pence
@@ -597,7 +597,7 @@ Common::String Scrolls::lsd() {
 
 
 
-void Scrolls::strip(Common::String &q) {
+void Scrolls::stripTrailingSpaces(Common::String &q) {
 	while (q[q.size() - 1] == ' ') {
 		q.deleteLastChar();
 	}
@@ -613,10 +613,10 @@ void Scrolls::solidify(byte n) {
 		_vm->_gyro->_scroll[n].deleteLastChar();
 	} while (_vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] != ' ');
 
-	strip(_vm->_gyro->_scroll[n]);
+	stripTrailingSpaces(_vm->_gyro->_scroll[n]);
 }
 
-void Scrolls::calldrivers() {
+void Scrolls::callScrollDriver() {
 	uint16 fv;
 	byte nn;
 	bool mouthnext;
@@ -627,7 +627,7 @@ void Scrolls::calldrivers() {
 	//nosound();
 	warning("STUB: Scrolls::calldrivers()");
 
-	state(0);
+	setReadyLight(0);
 	_vm->_gyro->_scReturn = false;
 	mouthnext = false;
 	call_spriterun = true;
@@ -650,11 +650,11 @@ void Scrolls::calldrivers() {
 	for (fv = 0; fv < size; fv++) {
 		if (mouthnext) {
 			if (_vm->_gyro->_buffer[fv] == kControlRegister)
-				param = 0;
+				_param = 0;
 			else if (('0' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= '9'))
-				param = _vm->_gyro->_buffer[fv] - 48;
+				_param = _vm->_gyro->_buffer[fv] - 48;
 			else if (('A' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= 'Z'))
-				param = _vm->_gyro->_buffer[fv] - 55;
+				_param = _vm->_gyro->_buffer[fv] - 55;
 
 			mouthnext = false;
 		} else {
@@ -667,9 +667,9 @@ void Scrolls::calldrivers() {
 					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
-				drawscroll(&Avalanche::Scrolls::normscroll);
+				drawScroll(&Avalanche::Scrolls::scrollModeNormal);
 
-				resetscroll();
+				resetScroll();
 
 				if (_vm->_gyro->_scReturn)
 					return;
@@ -686,58 +686,58 @@ void Scrolls::calldrivers() {
 					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
-				if (param == 0)
-					natural();
-				else if ((1 <= param) && (param <= 9)) {
-					if ((param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[param - 1].quick)) { // Not valid.
+				if (_param == 0)
+					setBubbleStateNatural();
+				else if ((1 <= _param) && (_param <= 9)) {
+					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1].quick)) { // Not valid.
 						_vm->_lucerna->errorLed();
-						natural();
+						setBubbleStateNatural();
 					} else
-						_vm->_animation->tr[param - 1].chatter(); // Normal sprite talking routine.
-				} else if ((10 <= param) && (param <= 36)) {
+						_vm->_animation->tr[_param - 1].chatter(); // Normal sprite talking routine.
+				} else if ((10 <= _param) && (_param <= 36)) {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					_vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._x;
-					_vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[param - 10]._whichPed - 1]._y; // Position.
+					_vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1]._x;
+					_vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1]._y; // Position.
 
-					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[param - 10]._foregroundColor;
-					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[param - 10]._backgroundColor; // Colors.
+					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[_param - 10]._foregroundColor;
+					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[_param - 10]._backgroundColor; // Colors.
 				} else {
 					_vm->_lucerna->errorLed(); // Not valid.
-					natural();
+					setBubbleStateNatural();
 				}
 
-				bubble(&Avalanche::Scrolls::normscroll);
+				drawBubble(&Avalanche::Scrolls::scrollModeNormal);
 
-				resetscroll();
+				resetScroll();
 
 				if (_vm->_gyro->_scReturn)
 					return;
 			}
 			break;
 			case kControlNegative:
-				switch (param) {
+				switch (_param) {
 				case 1:
-					display(lsd() + kControlToBuffer); // Insert cash balance. (Recursion)
+					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
 				case 2:
-					display(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer);
+					displayText(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer);
 					break;
 				case 3:
-					display(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer);
+					displayText(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer);
 					break;
 				case 4:
-					display(_vm->_gyro->_dna._favouriteSong + kControlToBuffer);
+					displayText(_vm->_gyro->_dna._favouriteSong + kControlToBuffer);
 					break;
 				case 5:
-					display(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer);
+					displayText(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer);
 					break;
 				case 6:
-					display(_vm->_gyro->_dna._spareEvening + kControlToBuffer);
+					displayText(_vm->_gyro->_dna._spareEvening + kControlToBuffer);
 					break;
 				case 9:
-					display(_vm->_gyro->intToStr(_vm->_gyro->_dna._catacombX) + ',' + _vm->_gyro->intToStr(_vm->_gyro->_dna._catacombY) + kControlToBuffer);
+					displayText(_vm->_gyro->intToStr(_vm->_gyro->_dna._catacombX) + ',' + _vm->_gyro->intToStr(_vm->_gyro->_dna._catacombY) + kControlToBuffer);
 					break;
 				case 10:
 					switch (_vm->_gyro->_dna._boxContent) {
@@ -750,10 +750,10 @@ void Scrolls::calldrivers() {
 					}
 					break;
 					case Acci::kNothing:
-						display("nothing at all. It's completely empty.");
+						displayText("nothing at all. It's completely empty.");
 						break;
 					default:
-						display(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.');
+						displayText(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.');
 					}
 					break;
 				case 11:
@@ -761,14 +761,14 @@ void Scrolls::calldrivers() {
 					for (byte nnn = 0; nnn < kObjectNum; nnn++) {
 						if (_vm->_gyro->_dna._objects[nnn]) {
 							nn++;
-							display(_vm->_gyro->getItem(nnn) + ", " + kControlToBuffer);
+							displayText(_vm->_gyro->getItem(nnn) + ", " + kControlToBuffer);
 						}
 					}
 					break;
 				}
 				break;
 			case kControlIcon:
-				use_icon = param;
+				_useIcon = _param;
 				break;
 			case kControlNewLine:
 				_vm->_gyro->_scrollNum++;
@@ -781,9 +781,9 @@ void Scrolls::calldrivers() {
 				_vm->_gyro->_scrollNum++;
 				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] = kControlQuestion;
 
-				drawscroll(&Avalanche::Scrolls::dialogue);
+				drawScroll(&Avalanche::Scrolls::scrollModeDialogue);
 
-				resetscroll();
+				resetScroll();
 				}
 				break;
 			case kControlRegister:
@@ -805,13 +805,13 @@ void Scrolls::calldrivers() {
 	}
 }
 
-void Scrolls::display(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
+void Scrolls::displayText(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
 	_vm->_gyro->_bufSize = z.size();
 	memcpy(_vm->_gyro->_buffer, z.c_str(), _vm->_gyro->_bufSize);
-	calldrivers();
+	callScrollDriver();
 }
 
-void Scrolls::loadfont() {
+void Scrolls::loadFont() {
 	Common::File f;
 
 	if (!f.open("avalot.fnt")) {
@@ -819,7 +819,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(ch[0][i], 16);
+		f.read(_scrollFonts[0][i], 16);
 	f.close();
 
 	if (!f.open("avitalic.fnt")) {
@@ -827,7 +827,7 @@ void Scrolls::loadfont() {
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(ch[1][i], 16);
+		f.read(_scrollFonts[1][i], 16);
 	f.close();
 
 	if (!f.open("ttsmall.fnt")) {
@@ -839,20 +839,16 @@ void Scrolls::loadfont() {
 	f.close();
 }
 
-void Scrolls::okay() {
-	display("Okay!");
-}
-
-void Scrolls::musical_scroll() {
-	display(Common::String("To play the harp...") + kControlNewLine + kControlNewLine + "Use these keys:" + + kControlNewLine
+void Scrolls::musicalScroll() {
+	displayText(Common::String("To play the harp...") + kControlNewLine + kControlNewLine + "Use these keys:" + + kControlNewLine
 		+ kControlInsertSpaces + "Q W E R T Y U I O P [ ]" + kControlNewLine + kControlNewLine + "Or press Enter to stop playing."
 		+ kControlToBuffer);
 
 	_vm->_lucerna->spriteRun();
 
-	drawscroll(&Avalanche::Scrolls::music_scroll);
+	drawScroll(&Avalanche::Scrolls::scrollModeMusic);
 
-	resetscroll();
+	resetScroll();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 3c1efc9..c043e4a 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -37,115 +37,85 @@ class AvalancheEngine;
 
 class Scrolls;
 
-typedef void (Scrolls::*func2)();
+typedef void (Scrolls::*ScrollsFunctionType)();
 
 class Scrolls {
 public:
 	// Constants to replace the command characters from Pascal.
 	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
-
-	static const char kControlSpeechBubble = 2; // ^B
-	static const char kControlCenter = 3; // ^C
-	static const char kControlToBuffer = 4; // ^D
-	static const char kControlItalic = 6; // ^F
-	static const char kControlBell = 7; // ^G
-	static const char kControlBackspace = 8; // ^H
-	static const char kControlInsertSpaces = 9; // ^I
-	static const char kControlLeftJustified = 12; // ^L
-	static const char kControlNewLine = 13; // ^M
-	static const char kControlParagraph = 16; // ^P
-	static const char kControlQuestion = 17; // ^Q
-	static const char kControlRoman = 18; // ^R
-	static const char kControlRegister = 19; // ^S
-	static const char kControlNegative = 21; // ^U
-	static const char kControlIcon = 22; // ^V
-
-
-
-	bool aboutscroll; // Is this the about box?
-
-
+	enum ControlCharacter {
+		kControlSpeechBubble = 2, // ^B
+		kControlCenter = 3, // ^C
+		kControlToBuffer = 4, // ^D
+		kControlItalic = 6, // ^F
+		kControlBell = 7, // ^G
+		kControlBackspace = 8, // ^H
+		kControlInsertSpaces = 9, // ^I
+		kControlLeftJustified = 12, // ^L
+		kControlNewLine = 13, // ^M
+		kControlParagraph = 16, // ^P
+		kControlQuestion = 17, // ^Q
+		kControlRoman = 18, // ^R
+		kControlRegister = 19, // ^S
+		kControlNegative = 21, // ^U
+		kControlIcon = 22 // ^V
+	};
+
+	bool _aboutScroll; // Is this the about box?
+	FontType _scrollFonts[2];
 
 	Scrolls(AvalancheEngine *vm);
 
 	void init();
-
-	void state(byte x);      // Sets "Ready" light to whatever
-
-	void drawscroll(func2 gotoit);      // This is one of the oldest funcs in the game.
-
-	void bubble(func2 gotoit);
-
-	void resetscroll();
-
-	void calldrivers();
-
-	void display(Common::String z);
-
-	bool ask(Common::String question);
-
-	void natural();
-
-	Common::String lsd();
-
-	void okay();    // Says "Okay!"
-
-	void musical_scroll();
-
-	FontType ch[2];
+	void setReadyLight(byte x); // Sets "Ready" light to whatever.
+	void drawScroll(ScrollsFunctionType modeFunc);
+	void drawBubble(ScrollsFunctionType modeFunc);
+	void resetScroll();
+	void callScrollDriver();
+	void displayText(Common::String text);
+	bool displayQuestion(Common::String question);
+	void setBubbleStateNatural(); // Natural state of bubbles
+	Common::String displayMoney();
+	void musicalScroll(); // Practically this one is a mini-game which called when you play the harp in the monastery.
 
 private:
 	AvalancheEngine *_vm;
 
-	static const int16 roman = 0;
-	static const int16 italic = 1;
-
-	static const int16 halficonwidth = 19; // Half the width of an icon.
-
+	enum FontStyle {
+		kFontStyleRoman,
+		kFontStyleItalic
+	};
 
+	static const int16 kHalfIconWidth = 19; // Half the width of an icon.
 
-	int16 dix, diy;
+	int16 _shadowBoxX, _shadowBoxY;
+	byte _currentFont; // Current font
+	Common::Point _dodgeCoord;
+	byte _param; // For using arguments code
+	byte _useIcon;
 
-	byte cfont; // Current font
+	// These 3 functions are always passed as ScrollsFunctionType parameters.
+	void scrollModeNormal();
+	void scrollModeDialogue();
+	void scrollModeMusic();
 
-	Common::Point dodgeCoord;
-	byte param; // For using arguments code
-
-	byte use_icon;
-
-
-
-	void easteregg();
-
-	void say(int16 x, int16 y, Common::String z);
-
-	void normscroll();
-
-	void dialogue();
-
-	void store_(byte what, TuneType &played);
-
-	bool they_match(TuneType &played);
-
-	void music_scroll();
-
-	void resetscrolldriver();
-
-	void dingdongbell();
-
-	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
-
-	void undodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
-
-	void geticon(int16 x, int16 y, byte which);
-
-	void block_drop(Common::String fn, int16 xl, int16 yl, int16 y);
-
-	void strip(Common::String &q); // Strip trailing spaces.
+	// These 2 are used only in musicalScroll().
+	void store(byte what, TuneType &played);
+	bool theyMatch(TuneType &played);
 
+	void stripTrailingSpaces(Common::String &str); // Original: strip.
 	void solidify(byte n); // Does the word wrapping.
 
-	void loadfont();
+	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
+	void unDodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
+
+	void easterEgg();
+	void say(int16 x, int16 y, Common::String text);
+	void resetScrollDriver();
+	void ringBell(); // Original: dingdongbell
+	void getIcon(int16 x, int16 y, byte which);
+	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
+	void loadFont();
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 7ba2136..69f6cce 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -250,16 +250,16 @@ void Timeout::urinate() {
 }
 
 void Timeout::toilet2() {
-	_vm->_scrolls->display("That's better!");
+	_vm->_scrolls->displayText("That's better!");
 }
 
 void Timeout::bang() {
-	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
+	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
 	set_up_timer(30, procbang2, reason_explosion);
 }
 
 void Timeout::bang2() {
-	_vm->_scrolls->display("Hmm... sounds like Spludwick's up to something...");
+	_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
 }
 
 void Timeout::stairs() {
@@ -352,7 +352,7 @@ void Timeout::after_the_shootemup() {
 	_vm->_lucerna->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
-	_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
 		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
 
 #if 0
@@ -475,7 +475,7 @@ void Timeout::jump() {
 			&& (_vm->_animation->infield(3))) { // Beside the wall
 		// Grab the arrow!
 		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
-			_vm->_scrolls->display("You fail to grab it, because your hands are full.");
+			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
@@ -537,7 +537,7 @@ void Timeout::fall_down_oubliette() {
 
 void Timeout::meet_avaroid() {
 	if (_vm->_gyro->_dna._metAvaroid) {
-		_vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
 		_vm->_lucerna->gameOver();
 	} else {
@@ -605,7 +605,7 @@ void Timeout::avvy_sit_down() {
 }
 
 void Timeout::ghost_room_phew() {
-	_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
 		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
 }
 
@@ -631,7 +631,7 @@ void Timeout::winning() {
 	// TODO: To be implemented with Pingo::winningPic().
 
 	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
-	_vm->_scrolls->display(" T H E    E N D ");
+	_vm->_scrolls->displayText(" T H E    E N D ");
 	_vm->_gyro->_letMeOut = true;
 }
 
@@ -646,7 +646,7 @@ void Timeout::avalot_falls() {
 		for (byte i = 0; i < 6; i++)
 			toDisplay += _vm->_scrolls->kControlInsertSpaces;
 		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
-		_vm->_scrolls->display(toDisplay);
+		_vm->_scrolls->displayText(toDisplay);
 	}
 }
 
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index f3288dd..c657a4a 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -83,7 +83,7 @@ void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 		if (report) {
 			Common::String todisplay;
 			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->intToStr(point).c_str());
-			_vm->_scrolls->display(todisplay);
+			_vm->_scrolls->displayText(todisplay);
 		}
 		return;
 	}
@@ -101,7 +101,7 @@ void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 	if (bubbling)
 		do_the_bubble();
 
-	_vm->_scrolls->calldrivers();
+	_vm->_scrolls->callScrollDriver();
 }
 
 void Visa::speech(byte who, byte subject) {
@@ -145,7 +145,7 @@ void Visa::speech(byte who, byte subject) {
 		unskrimble();
 		do_the_bubble();
 
-		_vm->_scrolls->calldrivers();
+		_vm->_scrolls->callScrollDriver();
 		went_ok = true;
 	}
 
@@ -177,7 +177,7 @@ void Visa::talkto(byte whom) {
 					switch (_vm->_gyro->_dna._givenToSpludwick) {
 					case 1: // Falltrough is intended.
 					case 2:{
-						_vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->displayText(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
 						return;
 						}
 						break;
@@ -254,13 +254,13 @@ void Visa::talkto(byte whom) {
 	no_matches = true;
 	for (fv = 0; fv <= _vm->_animation->kSpriteNumbMax; fv++)
 		if (_vm->_animation->tr[fv]._stat.accinum == whom) {
-			_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
 			no_matches = false;
 			break;
 		}
 
 	if (no_matches)
-		_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
 
 	speech(whom, _vm->_gyro->_subjectNum);
 


Commit: 347d9706343d894a4cebb471ab293afd5c881060
    https://github.com/scummvm/scummvm/commit/347d9706343d894a4cebb471ab293afd5c881060
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T12:37:54-07:00

Commit Message:
AVALANCHE: Fix Clang warnings

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index e56250f..b51632e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -49,8 +49,6 @@
 
 namespace Avalanche {
 
-const Common::Point Clock::kCenter(510,183);
-
 Clock::Clock(AvalancheEngine *vm) {
 	_vm = vm;
 	_oldHour = _oldHourAngle = _oldMinute = 17717;
@@ -88,14 +86,14 @@ void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte
 		return;
 	}
 
-	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenter.x, kCenter.y, 449 - angle, 450 - angle, length, color);
+	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color);
 }
 
 void Clock::drawHand(const Common::Point &endPoint, byte color) {
 	if (endPoint.x == 177)
 		return;
 
-	_vm->_graphics->_surface.drawLine(kCenter.x, kCenter.y, endPoint.x, endPoint.y, color);
+	_vm->_graphics->_surface.drawLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
 }
 
 void Clock::plotHands() {
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 2260c46..b7b4acf 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -43,7 +43,8 @@ public:
 	void update();
 	
 private:
-	static const Common::Point kCenter;
+	static const int kCenterX = 510;
+	static const int kCenterY = 183;
 
 	AvalancheEngine *_vm;
 


Commit: f1e699199b194dcb15f991c6a2a6805f153a985a
    https://github.com/scummvm/scummvm/commit/f1e699199b194dcb15f991c6a2a6805f153a985a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T12:38:25-07:00

Commit Message:
AVALANCHE: Some more renaming in Animation

Changed paths:
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 91837f1..f94fc22 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -82,8 +82,8 @@ public:
 	int16 _oldX[2], _oldY[2];  // last xy coords
 	int8 ix, iy; // amount to move sprite by, each step
 	byte whichsprite;
-	bool quick, _visible, homing, check_me;
-	int16 hx, hy; // homing x & y coords
+	bool quick, _visible, _homing, check_me;
+	int16 _homingX, _homingY; // homing x & y coords
 	byte count; // counts before changing step
 	byte xs, ys; // x & y speed
 	byte totalnum; // total number of sprites
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9b04f64..f0f2bc1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -311,14 +311,14 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(_animation->tr[i].face);
 		sz.syncAsByte(_animation->tr[i].step);
 		sz.syncAsByte(_animation->tr[i]._visible);
-		sz.syncAsByte(_animation->tr[i].homing);
+		sz.syncAsByte(_animation->tr[i]._homing);
 		sz.syncAsByte(_animation->tr[i].count);
 		sz.syncAsByte(_animation->tr[i]._info._xWidth);
 		sz.syncAsByte(_animation->tr[i].xs);
 		sz.syncAsByte(_animation->tr[i].ys);
 		sz.syncAsByte(_animation->tr[i].totalnum);
-		sz.syncAsSint16LE(_animation->tr[i].hx);
-		sz.syncAsSint16LE(_animation->tr[i].hy);
+		sz.syncAsSint16LE(_animation->tr[i]._homingX);
+		sz.syncAsSint16LE(_animation->tr[i]._homingY);
 		sz.syncAsByte(_animation->tr[i].call_eachstep);
 		sz.syncAsByte(_animation->tr[i].eachstep);
 		sz.syncAsByte(_animation->tr[i].vanishifstill);
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 69f6cce..69f85b3 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -594,7 +594,7 @@ void Timeout::avalot_returns() {
 
 void Timeout::avvy_sit_down() {
 // This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
-	if (_vm->_animation->tr[0].homing)    // Still walking.
+	if (_vm->_animation->tr[0]._homing)    // Still walking.
 		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
@@ -651,7 +651,7 @@ void Timeout::avalot_falls() {
 }
 
 void Timeout::spludwick_goes_to_cauldron() {
-	if (_vm->_animation->tr[1].homing)
+	if (_vm->_animation->tr[1]._homing)
 		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
 	else
 		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);


Commit: c158abc3139de4e746e5a1ea09c7cdca0baa93fe
    https://github.com/scummvm/scummvm/commit/c158abc3139de4e746e5a1ea09c7cdca0baa93fe
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T12:46:01-07:00

Commit Message:
AVALANCHE: Add some missing brackets in Lucerna

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index b51632e..653d3ca 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -117,18 +117,21 @@ Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false), _clock(vm) {
 }
 
 Lucerna::~Lucerna() {
-	for (byte i = 0; i < 31; i++)
-		for (byte j = 0; j < 2; j++)
+	for (byte i = 0; i < 31; i++) {
+		for (byte j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)  {
 				delete _vm->_gyro->_also[i][j];
 				_vm->_gyro->_also[i][j] = 0;
 			}
+		}
+	}
 }
 
 void Lucerna::init() {
-	for (byte i = 0; i < 31; i++)
+	for (byte i = 0; i < 31; i++) {
 		for (byte j = 0; j < 2; j++)
 			_vm->_gyro->_also[i][j] = 0;
+	}
 
 #if 0
 	if (_vm->_enhanced->atbios)
@@ -188,22 +191,25 @@ void Lucerna::scram(Common::String &str) {
 }
 
 void Lucerna::unScramble() {
-	for (byte i = 0; i < 31; i++)
-		for (byte j = 0; j < 2; j++)
+	for (byte i = 0; i < 31; i++) {
+		for (byte j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)
 				scram(*_vm->_gyro->_also[i][j]);
+		}
+	}
 	scram(_vm->_gyro->_listen);
 	scram(_vm->_gyro->_flags);
 }
 
 void Lucerna::loadAlso(byte num) {
-	for (byte i = 0; i < 31; i++)
-		for (byte j = 0; j < 2; j++)
+	for (byte i = 0; i < 31; i++) {
+		for (byte j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)  {
 				delete _vm->_gyro->_also[i][j];
 				_vm->_gyro->_also[i][j] = 0;
 			}
-
+		}
+	}
 	Common::String filename;
 	filename = filename.format("also%d.avd", num);
 	if (!file.open(filename)) {
@@ -936,9 +942,10 @@ void Lucerna::drawScore() {
 
 	CursorMan.showMouse(false);
 
-	for (byte fv = 0; fv < 3; fv++)
+	for (byte fv = 0; fv < 3; fv++) {
 		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv])
 			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177);
+	}
 
 	CursorMan.showMouse(true);
 
@@ -1005,11 +1012,13 @@ void Lucerna::refreshObjectList() {
 	_vm->_gyro->_dna._carryNum = 0;
 	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1])
 		thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); // you always have money
-	for (byte i = 0; i < kObjectNum; i++)
+
+	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			_vm->_gyro->_dna._carryNum++;
 			_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1;
 		}
+	}
 }
 
 void Lucerna::guideAvvy(Common::Point cursorPos) {


Commit: fcd32da8654c1308f3f77d886b3bc899bf6fd85c
    https://github.com/scummvm/scummvm/commit/fcd32da8654c1308f3f77d886b3bc899bf6fd85c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T12:50:37-07:00

Commit Message:
AVALANCHE: Missing file from previous commit

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 598ae7d..2a83e93 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -126,7 +126,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 	if (spritenum == 1)
 		_tr->newspeed(); // Just for the lights.
 
-	homing = false;
+	_homing = false;
 	ix = 0;
 	iy = 0;
 	step = 0;
@@ -205,7 +205,7 @@ void AnimationType::walk() {
 	if (!_tr->_vm->_gyro->_doingSpriteRun) {
 		_oldX[_tr->_vm->_gyro->_cp] = _x;
 		_oldY[_tr->_vm->_gyro->_cp] = _y;
-		if (homing)
+		if (_homing)
 			homestep();
 		_x = _x + ix;
 		_y = _y + iy;
@@ -284,27 +284,27 @@ int8 AnimationType::sgn(int16 val) {
 void AnimationType::walkto(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
 	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
-	hx = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
-	hy = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
-	homing = true;
+	_homingX = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
+	_homingY = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
+	_homing = true;
 }
 
 void AnimationType::stophoming() {
-	homing = false;
+	_homing = false;
 }
 
 void AnimationType::homestep() {
 	int16 temp;
 
-	if ((hx == _x) && (hy == _y)) {
+	if ((_homingX == _x) && (_homingY == _y)) {
 		// touching the target
 		stopwalk();
 		return;
 	}
 	ix = 0;
 	iy = 0;
-	if (hy != _y) {
-		temp = hy - _y;
+	if (_homingY != _y) {
+		temp = _homingY - _y;
 		if (temp > 4)
 			iy = 4;
 		else if (temp < -4)
@@ -312,8 +312,8 @@ void AnimationType::homestep() {
 		else
 			iy = temp;
 	}
-	if (hx != _x) {
-		temp = hx - _x;
+	if (_homingX != _x) {
+		temp = _homingX - _x;
 		if (temp > 4)
 			ix = 4;
 		else if (temp < -4)
@@ -345,7 +345,7 @@ void AnimationType::speed(int8 xx, int8 yy) {
 void AnimationType::stopwalk() {
 	ix = 0;
 	iy = 0;
-	homing = false;
+	_homing = false;
 }
 
 void AnimationType::chatter() {
@@ -364,15 +364,15 @@ void AnimationType::set_up_saver(trip_saver_type &v) {
 	v.ix = ix;
 	v.iy = iy;
 	v.visible = _visible;
-	v.homing = homing;
+	v.homing = _homing;
 	v.check_me = check_me;
 	v.count = count;
 	v.xw = _info._xWidth;
 	v.xs = xs;
 	v.ys = ys;
 	v.totalnum = totalnum;
-	v.hx = hx;
-	v.hy = hy;
+	v.hx = _homingX;
+	v.hy = _homingY;
 	v.call_eachstep = call_eachstep;
 	v.eachstep = eachstep;
 	v.vanishifstill = vanishifstill;
@@ -387,15 +387,15 @@ void AnimationType::unload_saver(trip_saver_type v) {
 	ix = v.ix;
 	iy = v.iy;
 	_visible = v.visible;
-	homing = v.homing;
+	_homing = v.homing;
 	check_me = v.check_me;
 	count = v.count;
 	_info._xWidth = v.xw;
 	xs = v.xs;
 	ys = v.ys;
 	totalnum = v.totalnum;
-	hx = v.hx;
-	hy = v.hy;
+	_homingX = v.hx;
+	_homingY = v.hy;
 	call_eachstep = v.call_eachstep;
 	eachstep = v.eachstep;
 	vanishifstill = v.vanishifstill;
@@ -1163,8 +1163,8 @@ void Animation::getback() {
 void Animation::follow_avvy_y(byte tripnum) {
 	if (tr[0].face == kDirLeft)
 		return;
-	if (tr[tripnum].homing)
-		tr[tripnum].hy = tr[1]._y;
+	if (tr[tripnum]._homing)
+		tr[tripnum]._homingY = tr[1]._y;
 	else {
 		if (tr[tripnum]._y < tr[1]._y)
 			tr[tripnum]._y += 1;
@@ -1182,7 +1182,7 @@ void Animation::follow_avvy_y(byte tripnum) {
 }
 
 void Animation::back_and_forth(byte tripnum) {
-	if (!tr[tripnum].homing) {
+	if (!tr[tripnum]._homing) {
 		if (tr[tripnum].face == kDirRight)
 			tr[tripnum].walkto(4);
 		else
@@ -1191,7 +1191,7 @@ void Animation::back_and_forth(byte tripnum) {
 }
 
 void Animation::face_avvy(byte tripnum) {
-	if (!tr[tripnum].homing) {
+	if (!tr[tripnum]._homing) {
 		if (tr[0]._x >= tr[tripnum]._x)
 			tr[tripnum].face = kDirRight;
 		else
@@ -1200,7 +1200,7 @@ void Animation::face_avvy(byte tripnum) {
 }
 
 void Animation::arrow_procs(byte tripnum) {
-	if (tr[tripnum].homing) {
+	if (tr[tripnum]._homing) {
 		// Arrow is still in flight.
 		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
 		// This is so if: a) the bottom of the arrow is below Avvy's head,


Commit: 6383c7397d221bc77d79351d04afa8c7b7daa007
    https://github.com/scummvm/scummvm/commit/6383c7397d221bc77d79351d04afa8c7b7daa007
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T12:51:00-07:00

Commit Message:
AVALANCHE: Fix one more Clang warning

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 653d3ca..1170ad3 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -835,26 +835,22 @@ void Lucerna::thinkAbout(byte object, bool type) {
 
 	_vm->_gyro->setMousePointerWait();
 
-	switch (type) {
-	case Gyro::kThing:
+	if (type == Gyro::kThing) {
 		if (!file.open("thinks.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
 			return;
 		}
-		break;
-	case Gyro::kPerson:
+	} else { // Gyro::kPerson
 		if (!file.open("folk.avd")) {
 			warning("AVALANCHE: Lucerna: File not found: folk.avd");
 			return;
 		}
 
-		object = object - 149;
+		object -= 149;
 		if (object >= 25)
 			object -= 8;
 		if (object == 20)
 			object--; // Last time...
-
-		break;
 	}
 
 	file.seek(object * picSize + 65);


Commit: 5c00d5fe34ea5d8d0d27a9bb559c85a06d7693ed
    https://github.com/scummvm/scummvm/commit/5c00d5fe34ea5d8d0d27a9bb559c85a06d7693ed
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T14:03:27-07:00

Commit Message:
AVALANCHE: More renaming, use int16 for loops based on kSpriteNumbMax

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 55f1e13..370ba87 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1277,7 +1277,7 @@ void Acci::personSpeaks() {
 
 	bool found = false; // The _person we're looking for's code is in _person.
 
-	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->tr[i].quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
@@ -1568,7 +1568,7 @@ void Acci::doThat() {
 						i = 3;
 					else
 						i = 0;
-					if (_vm->_animation->tr[0].whichsprite != i) {
+					if (_vm->_animation->tr[0]._id != i) {
 						int16 x = _vm->_animation->tr[0]._x;
 						int16 y = _vm->_animation->tr[0]._y;
 						_vm->_animation->tr[0].done();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 2a83e93..739c884 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -96,43 +96,43 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 	_stat._bgBubbleCol = inf.readByte();
 	_stat.accinum = inf.readByte();
 
-	totalnum = 0; // = 1;
+	_animCount = 0; // = 1;
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
 	for (byte aa = 0; aa < _stat._frameNum; aa++) {
 
-		_info._sil[totalnum] = new SilType[11 * (_info._yLength + 1)];
+		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
 		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
-		_info._mani[totalnum] = new ManiType[_info._size - 6];
+		_info._mani[_animCount] = new ManiType[_info._size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
 		for (fv = 0; fv <= _info._yLength; fv++)
-			inf.read((*_info._sil[totalnum])[fv], _info._xWidth);
+			inf.read((*_info._sil[_animCount])[fv], _info._xWidth);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
-		inf.read(*_info._mani[totalnum], _info._size - 6);
+		inf.read(*_info._mani[_animCount], _info._size - 6);
 		//blockread(inf, *mani[totalnum-1], a.size - 6);
 
-		totalnum++;
+		_animCount++;
 	}
-	totalnum++;
+	_animCount++;
 
 	// on;
 	_x = 0;
 	_y = 0;
 	quick = true;
 	_visible = false;
-	xs = 3;
-	ys = 1;
+	_speedX = 3;
+	_speedY = 1;
 	if (spritenum == 1)
 		_tr->newspeed(); // Just for the lights.
 
 	_homing = false;
-	ix = 0;
-	iy = 0;
+	_moveX = 0;
+	_moveY = 0;
 	step = 0;
 	check_me = do_check;
 	count = 0;
-	whichsprite = spritenum;
+	_id = spritenum;
 	vanishifstill = false;
 	call_eachstep = false;
 
@@ -141,22 +141,22 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 
 void AnimationType::original() {
 	quick = false;
-	whichsprite = 177;
+	_id = 177;
 }
 
 void AnimationType::andexor() {
-	if ((vanishifstill) && (ix == 0) && (iy == 0))
+	if ((vanishifstill) && (_moveX == 0) && (_moveY == 0))
 		return;
-	byte picnum = face * _stat.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
+	byte picnum = _facingDir * _stat.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
 
 	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
 
 void AnimationType::turn(byte whichway) {
 	if (whichway == 8)
-		face = Animation::kDirUp;
+		_facingDir = Animation::kDirUp;
 	else
-		face = whichway;
+		_facingDir = whichway;
 }
 
 void AnimationType::appear(int16 wx, int16 wy, byte wf) {
@@ -166,8 +166,8 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
 	_oldY[_tr->_vm->_gyro->_cp] = wy;
 	turn(wf);
 	_visible = true;
-	ix = 0;
-	iy = 0;
+	_moveX = 0;
+	_moveY = 0;
 }
 
 /**
@@ -175,8 +175,8 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  * @remarks	Originally called 'collision_check'
  */
 bool AnimationType::checkCollision() {
-	for (byte i = 0; i < _tr->kSpriteNumbMax; i++) {
-		if (_tr->tr[i].quick && (_tr->tr[i].whichsprite != whichsprite) &&
+	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) {
+		if (_tr->tr[i].quick && (_tr->tr[i]._id != _id) &&
 			((_x + _info._xLength) > _tr->tr[i]._x) &&
 			(_x < (_tr->tr[i]._x + _tr->tr[i]._info._xLength)) &&
 			(_tr->tr[i]._y == _y))
@@ -207,8 +207,8 @@ void AnimationType::walk() {
 		_oldY[_tr->_vm->_gyro->_cp] = _y;
 		if (_homing)
 			homestep();
-		_x = _x + ix;
-		_y = _y + iy;
+		_x = _x + _moveX;
+		_y = _y + _moveY;
 	}
 
 	if (check_me) {
@@ -251,7 +251,7 @@ void AnimationType::walk() {
 
 	if (!_tr->_vm->_gyro->_doingSpriteRun) {
 		count++;
-		if (((ix != 0) || (iy != 0)) && (count > 1)) {
+		if (((_moveX != 0) || (_moveY != 0)) && (count > 1)) {
 			step++;
 			if (step == _stat.seq)
 				step = 0;
@@ -264,9 +264,9 @@ void AnimationType::bounce() {
 	_x = _oldX[_tr->_vm->_gyro->_cp];
 	_y = _oldY[_tr->_vm->_gyro->_cp];
 	if (check_me)
-		_tr->stopwalking();
+		_tr->stopWalking();
 	else
-		stopwalk();
+		stopWalk();
 	_tr->_vm->_gyro->_onCanDoPageSwap = false;
 	_tr->_vm->_lucerna->drawDirection();
 	_tr->_vm->_gyro->_onCanDoPageSwap = true;
@@ -298,53 +298,53 @@ void AnimationType::homestep() {
 
 	if ((_homingX == _x) && (_homingY == _y)) {
 		// touching the target
-		stopwalk();
+		stopWalk();
 		return;
 	}
-	ix = 0;
-	iy = 0;
+	_moveX = 0;
+	_moveY = 0;
 	if (_homingY != _y) {
 		temp = _homingY - _y;
 		if (temp > 4)
-			iy = 4;
+			_moveY = 4;
 		else if (temp < -4)
-			iy = -4;
+			_moveY = -4;
 		else
-			iy = temp;
+			_moveY = temp;
 	}
 	if (_homingX != _x) {
 		temp = _homingX - _x;
 		if (temp > 4)
-			ix = 4;
+			_moveX = 4;
 		else if (temp < -4)
-			ix = -4;
+			_moveX = -4;
 		else
-			ix = temp;
+			_moveX = temp;
 	}
 }
 
 void AnimationType::speed(int8 xx, int8 yy) {
-	ix = xx;
-	iy = yy;
-	if ((ix == 0) && (iy == 0))
+	_moveX = xx;
+	_moveY = yy;
+	if ((_moveX == 0) && (_moveY == 0))
 		return; // no movement
-	if (ix == 0) {
+	if (_moveX == 0) {
 		// No horz movement
-		if (iy < 0)
+		if (_moveY < 0)
 			turn(_tr->kDirUp);
 		else
 			turn(_tr->kDirDown);
 	} else {
-		if (ix < 0)
+		if (_moveX < 0)
 			turn(_tr->kDirLeft);
 		else
 			turn(_tr->kDirRight);
 	}
 }
 
-void AnimationType::stopwalk() {
-	ix = 0;
-	iy = 0;
+void AnimationType::stopWalk() {
+	_moveX = 0;
+	_moveY = 0;
 	_homing = false;
 }
 
@@ -356,21 +356,21 @@ void AnimationType::chatter() {
 }
 
 void AnimationType::set_up_saver(trip_saver_type &v) {
-	v.whichsprite = whichsprite;
-	v.face = face;
+	v.whichsprite = _id;
+	v.face = _facingDir;
 	v.step = step;
 	v.x = _x;
 	v.y = _y;
-	v.ix = ix;
-	v.iy = iy;
+	v.ix = _moveX;
+	v.iy = _moveY;
 	v.visible = _visible;
 	v.homing = _homing;
 	v.check_me = check_me;
 	v.count = count;
 	v.xw = _info._xWidth;
-	v.xs = xs;
-	v.ys = ys;
-	v.totalnum = totalnum;
+	v.xs = _speedX;
+	v.ys = _speedY;
+	v.totalnum = _animCount;
 	v.hx = _homingX;
 	v.hy = _homingY;
 	v.call_eachstep = call_eachstep;
@@ -379,21 +379,21 @@ void AnimationType::set_up_saver(trip_saver_type &v) {
 }
 
 void AnimationType::unload_saver(trip_saver_type v) {
-	whichsprite = v.whichsprite;
-	face = v.face;
+	_id = v.whichsprite;
+	_facingDir = v.face;
 	step = v.step;
 	_x = v.x;
 	_y = v.y;
-	ix = v.ix;
-	iy = v.iy;
+	_moveX = v.ix;
+	_moveY = v.iy;
 	_visible = v.visible;
 	_homing = v.homing;
 	check_me = v.check_me;
 	count = v.count;
 	_info._xWidth = v.xw;
-	xs = v.xs;
-	ys = v.ys;
-	totalnum = v.totalnum;
+	_speedX = v.xs;
+	_speedY = v.ys;
+	_animCount = v.totalnum;
 	_homingX = v.hx;
 	_homingY = v.hy;
 	call_eachstep = v.call_eachstep;
@@ -418,21 +418,19 @@ void AnimationType::load_data_from_mem(uint16 &where) {
 }
 
 AnimationType *AnimationType::done() {
-	Common::String xx;
-
-	//  nds:=num div seq;
-	totalnum--;
+	_animCount--;
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (byte aa = 0; aa < _stat._frameNum; aa++) {
-		totalnum--;
-		delete[] _info._mani[totalnum];
-		delete[] _info._sil[totalnum];
+	for (byte i = 0; i < _stat._frameNum; i++) {
+		_animCount--;
+		assert(_animCount >= 0);
+		delete[] _info._mani[_animCount];
+		delete[] _info._sil[_animCount];
 	}
 
 	quick = false;
-	whichsprite = 177;
+	_id = 177;
 	return this;
 }
 
@@ -453,11 +451,6 @@ void getsettype::recall(ByteField &r) {
 	numleft--;
 }
 
-
-
-
-
-
 Animation::Animation(AvalancheEngine *vm) {
 	_vm = vm;
 
@@ -466,15 +459,15 @@ Animation::Animation(AvalancheEngine *vm) {
 }
 
 Animation::~Animation() {
-	for (byte i = 0; i < kSpriteNumbMax; i++) {
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (tr[i].quick)
 			tr[i].done();
 	}
 }
 
 void Animation::loadtrip() {
-	for (int16 gm = 0; gm < kSpriteNumbMax; gm++)
-		tr[gm].original();
+	for (int16 i = 0; i < kSpriteNumbMax; i++)
+		tr[i].original();
 
 	for (uint16 i = 0; i < sizeof(aa); i++)
 		aa[i] = 0;
@@ -564,8 +557,8 @@ void Animation::catamove(byte ped) {
 		fliproom(r__lusties, 5);
 		_vm->_scrolls->displayText("Oh no... here we go again...");
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0].iy = 1;
-		tr[0].ix = 0;
+		tr[0]._moveY = 1;
+		tr[0]._moveX = 0;
 		return;
 	}
 
@@ -856,7 +849,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_gyro->_dna._brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
-		stopwalking();
+		stopWalking();
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
@@ -865,7 +858,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicExclaim;
 		_vm->_gyro->_magics[11]._data = 5;
 		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
-		stopwalking();
+		stopWalking();
 		_vm->_visa->dixi('q', 26);
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		break;
@@ -876,7 +869,7 @@ void Animation::call_special(uint16 which) {
 			_vm->_gyro->_dna._arrowTriggered = true;
 			apped(2, 4); // The dart starts at ped 4, and...
 			tr[1].walkto(5); // flies to ped 5.
-			tr[1].face = kDirUp; // Only face.
+			tr[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
 			// graphic of the arrow buried in the plaster. */
@@ -912,15 +905,15 @@ void Animation::call_special(uint16 which) {
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0].ix = 3;
-		tr[0].iy = 0;
-		tr[0].face = kDirRight;
+		tr[0]._moveX = 3;
+		tr[0]._moveY = 0;
+		tr[0]._facingDir = kDirRight;
 		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0]._visible = false;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		stopwalking();
+		stopWalking();
 		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
@@ -931,7 +924,7 @@ void Animation::call_special(uint16 which) {
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
 			_vm->_visa->dixi('q', 63);
 			tr[1].turn(kDirDown);
-			tr[1].stopwalk();
+			tr[1].stopWalk();
 			tr[1].call_eachstep = false; // Geida
 			_vm->_lucerna->gameOver();
 		}
@@ -1040,14 +1033,14 @@ void Animation::open_the_door(byte whither, byte ped, byte magicnum) {
 		switch (magicnum) {
 		case 14:
 			if (_vm->_gyro->_dna._avvysInTheCupboard) {
-				hide_in_the_cupboard();
+				hideInCupboard();
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(7);
 				_vm->_sequence->start_to_close();
 				return;
 			} else {
 				apped(1, 6);
-				tr[0].face = kDirRight; // added by TT 12/3/1995
+				tr[0]._facingDir = kDirRight; // added by TT 12/3/1995
 				_vm->_sequence->first_show(8);
 				_vm->_sequence->then_show(9);
 			}
@@ -1070,16 +1063,16 @@ void Animation::newspeed() {
 	const ByteField lightspace = {40, 199, 47, 199};
 	byte page_;
 
-	tr[0].ix = (tr[0].ix / 3) * tr[0].xs;
+	tr[0]._moveX = (tr[0]._moveX / 3) * tr[0]._speedX;
 
 	//setactivepage(3);
 
-	if (tr[0].xs == _vm->_gyro->kRun)
+	if (tr[0]._speedX == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
 
-	if (tr[0].xs == _vm->_gyro->kRun)
+	if (tr[0]._speedX == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
@@ -1094,28 +1087,28 @@ void Animation::newspeed() {
 void Animation::rwsp(byte t, byte dir) {
 	switch (dir) {
 	case kDirUp:
-		tr[t].speed(0, -tr[t].ys);
+		tr[t].speed(0, -tr[t]._speedY);
 		break;
 	case kDirDown:
-		tr[t].speed(0, tr[t].ys);
+		tr[t].speed(0, tr[t]._speedY);
 		break;
 	case kDirLeft:
-		tr[t].speed(-tr[t].xs,  0);
+		tr[t].speed(-tr[t]._speedX,  0);
 		break;
 	case kDirRight:
-		tr[t].speed(tr[t].xs,  0);
+		tr[t].speed(tr[t]._speedX,  0);
 		break;
 	case kDirUpLeft:
-		tr[t].speed(-tr[t].xs, -tr[t].ys);
+		tr[t].speed(-tr[t]._speedX, -tr[t]._speedY);
 		break;
 	case kDirUpRight:
-		tr[t].speed(tr[t].xs, -tr[t].ys);
+		tr[t].speed(tr[t]._speedX, -tr[t]._speedY);
 		break;
 	case kDirDownLeft:
-		tr[t].speed(-tr[t].xs, tr[t].ys);
+		tr[t].speed(-tr[t]._speedX, tr[t]._speedY);
 		break;
 	case kDirDownRight:
-		tr[t].speed(tr[t].xs, tr[t].ys);
+		tr[t].speed(tr[t]._speedX, tr[t]._speedY);
 		break;
 	}
 }
@@ -1161,7 +1154,7 @@ void Animation::getback() {
 
 // Eachstep procedures:
 void Animation::follow_avvy_y(byte tripnum) {
-	if (tr[0].face == kDirLeft)
+	if (tr[0]._facingDir == kDirLeft)
 		return;
 	if (tr[tripnum]._homing)
 		tr[tripnum]._homingY = tr[1]._y;
@@ -1172,7 +1165,7 @@ void Animation::follow_avvy_y(byte tripnum) {
 			tr[tripnum]._y -= 1;
 		else
 			return;
-		if (tr[tripnum].ix == 0)  {
+		if (tr[tripnum]._moveX == 0)  {
 			tr[tripnum].step += 1;
 			if (tr[tripnum].step == tr[tripnum]._stat.seq)
 				tr[tripnum].step = 0;
@@ -1183,7 +1176,7 @@ void Animation::follow_avvy_y(byte tripnum) {
 
 void Animation::back_and_forth(byte tripnum) {
 	if (!tr[tripnum]._homing) {
-		if (tr[tripnum].face == kDirRight)
+		if (tr[tripnum]._facingDir == kDirRight)
 			tr[tripnum].walkto(4);
 		else
 			tr[tripnum].walkto(5);
@@ -1193,9 +1186,9 @@ void Animation::back_and_forth(byte tripnum) {
 void Animation::face_avvy(byte tripnum) {
 	if (!tr[tripnum]._homing) {
 		if (tr[0]._x >= tr[tripnum]._x)
-			tr[tripnum].face = kDirRight;
+			tr[tripnum]._facingDir = kDirRight;
 		else
-			tr[tripnum].face = kDirLeft;
+			tr[tripnum]._facingDir = kDirLeft;
 	}
 }
 
@@ -1259,8 +1252,8 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 toy = tr[0]._y - 1;
 	if ((tr[tripnum]._x == tox) && (tr[tripnum]._y == toy)) {
 		tr[tripnum].call_eachstep = false;
-		tr[tripnum].face = kDirLeft;
-		tr[tripnum].stopwalk();
+		tr[tripnum]._facingDir = kDirLeft;
+		tr[tripnum].stopWalk();
 		// ... whatever ...
 	} else {
 		// Still some way to go.
@@ -1278,7 +1271,7 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 }
 
 void Animation::take_a_step(byte &tripnum) {
-	if (tr[tripnum].ix == 0) {
+	if (tr[tripnum]._moveX == 0) {
 		tr[tripnum].step++;
 		if (tr[tripnum].step == tr[tripnum]._stat.seq)
 			tr[tripnum].step = 0;
@@ -1287,9 +1280,9 @@ void Animation::take_a_step(byte &tripnum) {
 }
 
 void Animation::spin(byte whichway, byte &tripnum) {
-	if (tr[tripnum].face != whichway) {
-		tr[tripnum].face = whichway;
-		if (tr[tripnum].whichsprite == 2)
+	if (tr[tripnum]._facingDir != whichway) {
+		tr[tripnum]._facingDir = whichway;
+		if (tr[tripnum]._id == 2)
 			return; // Not for Spludwick
 
 		_vm->_gyro->_dna._geidaSpin += 1;
@@ -1312,58 +1305,58 @@ void Animation::geida_procs(byte tripnum) {
 	if (tr[tripnum]._y < (tr[0]._y - 2)) {
 		// Geida is further from the screen than Avvy.
 		spin(kDirDown, tripnum);
-		tr[tripnum].iy = 1;
-		tr[tripnum].ix = 0;
+		tr[tripnum]._moveY = 1;
+		tr[tripnum]._moveX = 0;
 		take_a_step(tripnum);
 		return;
 	} else if (tr[tripnum]._y > (tr[0]._y + 2)) {
 		// Avvy is further from the screen than Geida.
 		spin(kDirUp, tripnum);
-		tr[tripnum].iy = -1;
-		tr[tripnum].ix = 0;
+		tr[tripnum]._moveY = -1;
+		tr[tripnum]._moveX = 0;
 		take_a_step(tripnum);
 		return;
 	}
 
-	tr[tripnum].iy = 0;
+	tr[tripnum]._moveY = 0;
 	// These 12-s are not in the original, I added them to make the following method more "smooth".
 	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
-	if (tr[tripnum]._x < tr[0]._x - tr[0].xs * 8 - 12) {
-		tr[tripnum].ix = tr[0].xs;
+	if (tr[tripnum]._x < tr[0]._x - tr[0]._speedX * 8 - 12) {
+		tr[tripnum]._moveX = tr[0]._speedX;
 		spin(kDirRight, tripnum);
 		take_a_step(tripnum);
-	} else if (tr[tripnum]._x > tr[0]._x + tr[0].xs * 8 + 12) {
-		tr[tripnum].ix = -tr[0].xs;
+	} else if (tr[tripnum]._x > tr[0]._x + tr[0]._speedX * 8 + 12) {
+		tr[tripnum]._moveX = -tr[0]._speedX;
 		spin(kDirLeft, tripnum);
 		take_a_step(tripnum);
 	} else
-		tr[tripnum].ix = 0;
+		tr[tripnum]._moveX = 0;
 }
 
 // That's all...
 
 void Animation::call_andexors() {
 	int8 order[5];
-	byte fv, temp;
+	byte temp;
 	bool ok;
 
 	for (int i = 0; i < 5; i++)
 		order[i] = -1;
 
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv]._visible)
-			order[fv] = fv;
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick && tr[i]._visible)
+			order[i] = i;
 	}
 
 	do {
 		ok = true;
-		for (fv = 0; fv < 4; fv++) {
-			if (((order[fv] != -1) && (order[fv + 1] != -1))
-					&& (tr[order[fv]]._y > tr[order[fv + 1]]._y)) {
+		for (byte i = 0; i < 4; i++) {
+			if (((order[i] != -1) && (order[i + 1] != -1))
+					&& (tr[order[i]]._y > tr[order[i + 1]]._y)) {
 				// Swap them!
-				temp = order[fv];
-				order[fv] = order[fv + 1];
-				order[fv + 1] = temp;
+				temp = order[i];
+				order[i] = order[i + 1];
+				order[i + 1] = temp;
 				ok = false;
 			}
 		}
@@ -1372,9 +1365,9 @@ void Animation::call_andexors() {
 
 	_vm->_graphics->refreshBackground();
 
-	for (fv = 0; fv < 5; fv++) {
-		if (order[fv] > -1)
-			tr[order[fv]].andexor();
+	for (byte i = 0; i < 5; i++) {
+		if (order[i] > -1)
+			tr[order[i]].andexor();
 	}
 }
 
@@ -1383,38 +1376,36 @@ void Animation::call_andexors() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	byte fv;
-
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv]._visible)
-			tr[fv].walk();
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick && tr[i]._visible)
+			tr[i].walk();
 	}
 
 	call_andexors();
 
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick && tr[fv].call_eachstep) {
-			switch (tr[fv].eachstep) {
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick && tr[i].call_eachstep) {
+			switch (tr[i].eachstep) {
 			case kProcFollowAvvyY :
-				follow_avvy_y(fv);
+				follow_avvy_y(i);
 				break;
 			case kProcBackAndForth :
-				back_and_forth(fv);
+				back_and_forth(i);
 				break;
 			case kProcFaceAvvy :
-				face_avvy(fv);
+				face_avvy(i);
 				break;
 			case kProcArrow :
-				arrow_procs(fv);
+				arrow_procs(i);
 				break;
 				//    PROCSpludwick_procs : spludwick_procs(fv);
 			case kProcGrabAvvy :
-				grab_avvy(fv);
+				grab_avvy(i);
 				break;
 			case kProcGeida :
-				geida_procs(fv);
+				geida_procs(i);
 				break;
 			}
 		}
@@ -1427,10 +1418,8 @@ void Animation::animLink() {
 }
 
 void Animation::get_back_loretta() {
-	byte fv;
-
-	for (fv = 0; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick) {
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick) {
 			getback();
 			return;
 		}
@@ -1438,8 +1427,8 @@ void Animation::get_back_loretta() {
 	// for fv:=0 to 1 do begin cp:=1-cp; getback; end;
 }
 
-void Animation::stopwalking() {
-	tr[0].stopwalk();
+void Animation::stopWalking() {
+	tr[0].stopWalk();
 	_vm->_gyro->_dna._direction = kDirStopped;
 	if (_vm->_gyro->_alive)
 		tr[0].step = 1;
@@ -1458,7 +1447,11 @@ void Animation::getsetclear() {
 		getset[fv].init();
 }
 
-void Animation::hide_in_the_cupboard() {
+/**
+ * Hide in the cupboard
+ * @remarks	Originally called 'hide_in_the_cupboard'
+ */
+void Animation::hideInCupboard() {
 	if (_vm->_gyro->_dna._avvysInTheCupboard) {
 		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
@@ -1484,23 +1477,21 @@ void Animation::hide_in_the_cupboard() {
 }
 
 void Animation::fliproom(byte room, byte ped) {
-	byte fv;
-
 	if (!_vm->_gyro->_alive) {
 		// You can't leave the room if you're dead.
-		tr[0].ix = 0;
-		tr[0].iy = 0; // Stop him from moving.
+		tr[0]._moveX = 0;
+		tr[0]._moveY = 0; // Stop him from moving.
 		return;
 	}
 
 	if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) {
-		hide_in_the_cupboard();
+		hideInCupboard();
 		return;
 	}
 
 	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
 		// You can't *jump* out of Cardiff Castle!
-		tr[0].ix = 0;
+		tr[0]._moveX = 0;
 		return;
 	}
 
@@ -1508,10 +1499,9 @@ void Animation::fliproom(byte room, byte ped) {
 	_vm->_lucerna->dusk();
 	getsetclear();
 
-
-	for (fv = 1; fv < kSpriteNumbMax; fv++) {
-		if (tr[fv].quick)
-			tr[fv].done();
+	for (int16 i = 1; i < kSpriteNumbMax; i++) {
+		if (tr[i].quick)
+			tr[i].done();
 	} // Deallocate sprite
 
 	if (_vm->_gyro->_dna._room == r__lustiesroom)
@@ -1521,10 +1511,10 @@ void Animation::fliproom(byte room, byte ped) {
 	apped(1, ped);
 	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
-	_vm->_gyro->_dna._direction = tr[0].face;
+	_vm->_gyro->_dna._direction = tr[0]._facingDir;
 	_vm->_lucerna->drawDirection();
 
-	for (fv = 0; fv <= 1; fv++) {
+	for (byte i = 0; i <= 1; i++) {
 		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
 		getback();
 	}
@@ -1577,59 +1567,59 @@ void Animation::handleMoveKey(const Common::Event &event) {
 				_vm->_gyro->_dna._direction = kDirUp;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_DOWN:
 			if (_vm->_gyro->_dna._direction != kDirDown) {
 				_vm->_gyro->_dna._direction = kDirDown;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_LEFT:
 			if (_vm->_gyro->_dna._direction != kDirLeft) {
 				_vm->_gyro->_dna._direction = kDirLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_RIGHT:
 			if (_vm->_gyro->_dna._direction != kDirRight) {
 				_vm->_gyro->_dna._direction = kDirRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
 			if (_vm->_gyro->_dna._direction != kDirUpRight) {
 				_vm->_gyro->_dna._direction = kDirUpRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
 			if (_vm->_gyro->_dna._direction != kDirDownRight) {
 				_vm->_gyro->_dna._direction = kDirDownRight;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_END:
 			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
 				_vm->_gyro->_dna._direction = kDirDownLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_HOME:
 			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
 				_vm->_gyro->_dna._direction = kDirUpLeft;
 				rwsp(0, _vm->_gyro->_dna._direction);
 			} else
-				stopwalking();
+				stopWalking();
 			break;
 		case Common::KEYCODE_KP5:
-			stopwalking();
+			stopWalking();
 			break;
 		default:
 			break;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index f94fc22..5e33934 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -77,16 +77,16 @@ public:
 	SpriteInfo _info;
 
 	adxtype _stat; // vital statistics
-	byte face, step;
+	byte _facingDir, step;
 	int16 _x, _y; // current xy coords
 	int16 _oldX[2], _oldY[2];  // last xy coords
-	int8 ix, iy; // amount to move sprite by, each step
-	byte whichsprite;
+	int8 _moveX, _moveY; // amount to move sprite by, each step
+	byte _id;
 	bool quick, _visible, _homing, check_me;
 	int16 _homingX, _homingY; // homing x & y coords
 	byte count; // counts before changing step
-	byte xs, ys; // x & y speed
-	byte totalnum; // total number of sprites
+	byte _speedX, _speedY; // x & y speed
+	byte _animCount; // total number of sprites
 	bool vanishifstill; // Do we show this sprite if it's still?
 
 	bool call_eachstep; // Do we call the eachstep procedure?
@@ -104,7 +104,7 @@ public:
 	void stophoming();    // self-explanatory
 	void homestep();    // calculates ix & iy for one homing step
 	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
-	void stopwalk();    // Stops the sprite from moving
+	void stopWalk();    // Stops the sprite from moving
 	void chatter();    // Sets up talk vars
 	void set_up_saver(trip_saver_type &v);
 	void unload_saver(trip_saver_type v);
@@ -169,7 +169,7 @@ public:
 	void call_special(uint16 which);
 	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
 	void catamove(byte ped);
-	void stopwalking();
+	void stopWalking();
 	void tripkey(char dir);
 	void rwsp(byte t, byte dir);
 	void apped(byte trn, byte np);
@@ -200,7 +200,7 @@ private:
 	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
 	byte geida_ped(byte which);
 	void dawndelay();
-	void hide_in_the_cupboard();
+	void hideInCupboard();
 	void follow_avvy_y(byte tripnum);
 	void back_and_forth(byte tripnum);
 	void face_avvy(byte tripnum);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f0f2bc1..50b451a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -282,7 +282,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) {
+		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) {
 			if (_animation->tr[i].quick)
 				spriteNum++;
 		}
@@ -290,33 +290,33 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(spriteNum);
 
 	if (sz.isLoading()) {
-		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
+		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
 			if (_animation->tr[i].quick)
 				_animation->tr[i].done();
 		}
 	}
 
 	for (byte i = 0; i < spriteNum; i++) {
-		sz.syncAsByte(_animation->tr[i].whichsprite);
+		sz.syncAsByte(_animation->tr[i]._id);
 		sz.syncAsByte(_animation->tr[i].check_me);
 
 
 		if (sz.isLoading()) {
 			_animation->tr[i].quick = true;
-			_animation->tr[i].init(_animation->tr[i].whichsprite, _animation->tr[i].check_me, _animation);
+			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i].check_me, _animation);
 		}
 
-		sz.syncAsByte(_animation->tr[i].ix);
-		sz.syncAsByte(_animation->tr[i].iy);
-		sz.syncAsByte(_animation->tr[i].face);
+		sz.syncAsByte(_animation->tr[i]._moveX);
+		sz.syncAsByte(_animation->tr[i]._moveY);
+		sz.syncAsByte(_animation->tr[i]._facingDir);
 		sz.syncAsByte(_animation->tr[i].step);
 		sz.syncAsByte(_animation->tr[i]._visible);
 		sz.syncAsByte(_animation->tr[i]._homing);
 		sz.syncAsByte(_animation->tr[i].count);
 		sz.syncAsByte(_animation->tr[i]._info._xWidth);
-		sz.syncAsByte(_animation->tr[i].xs);
-		sz.syncAsByte(_animation->tr[i].ys);
-		sz.syncAsByte(_animation->tr[i].totalnum);
+		sz.syncAsByte(_animation->tr[i]._speedX);
+		sz.syncAsByte(_animation->tr[i]._speedY);
+		sz.syncAsByte(_animation->tr[i]._animCount);
 		sz.syncAsSint16LE(_animation->tr[i]._homingX);
 		sz.syncAsSint16LE(_animation->tr[i]._homingY);
 		sz.syncAsByte(_animation->tr[i].call_eachstep);
@@ -327,7 +327,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsSint16LE(_animation->tr[i]._y);
 
 		if (sz.isLoading() && _animation->tr[i]._visible)
-			_animation->tr[i].appear(_animation->tr[i]._x, _animation->tr[i]._y, _animation->tr[i].face);
+			_animation->tr[i].appear(_animation->tr[i]._x, _animation->tr[i]._y, _animation->tr[i]._facingDir);
 	}
 
 	//groi = 177;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 72cb1d6..ee805ef 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -163,7 +163,7 @@ void Avalot::setup() {
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
-	_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+	_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
 	_vm->_animation->newspeed();
 
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 3c26496..74d0a25 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -460,7 +460,7 @@ void Dropdown::setupMenuAction() {
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->neardoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->tr[0].xs == _vm->_gyro->kWalk)
+	if (_vm->_animation->tr[0]._speedX == _vm->_gyro->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -630,10 +630,10 @@ void Dropdown::runMenuAction() {
 		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
-		if (_vm->_animation->tr[0].xs == _vm->_gyro->kWalk)
-			_vm->_animation->tr[0].xs = _vm->_gyro->kRun;
+		if (_vm->_animation->tr[0]._speedX == _vm->_gyro->kWalk)
+			_vm->_animation->tr[0]._speedX = _vm->_gyro->kRun;
 		else
-			_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+			_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
 		_vm->_animation->newspeed();
 	}
 	break;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 21ea9da..faab64c 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -152,13 +152,14 @@ struct DemoType {
 	char _key, _extd;
 };
 
+typedef byte TuneType[31];
+
 struct QuasipedType {
 	byte _whichPed, _foregroundColor, _room, _backgroundColor;
 	uint16 _who;
 };
 
-typedef byte TuneType[31];
-
+#if 0
 struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA.
 	Common::String _qEnidFilename;
 	bool _qSoundFx;
@@ -166,7 +167,6 @@ struct Sundry { // Things which must be saved over a backtobootstrap, outside DN
 	bool _qThinkThing;
 };
 
-#if 0
 struct ednahead { // Edna header
 	// This header starts at byte offset 177 in the .ASG file.
 	char id[9];   // signature
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 1170ad3..94a58fa 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -452,7 +452,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 					_vm->_animation->tr[1].walkto(5); // Walks up to greet you.
 				} else {
 					_vm->_animation->apped(2, 5); // Starts where he was before.
-					_vm->_animation->tr[1].face = Animation::kDirLeft;
+					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 				}
 
 				_vm->_animation->tr[1].call_eachstep = true;
@@ -512,7 +512,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				} else {
 					// You've been here before.
 					_vm->_animation->apped(2, 4); // He's standing in your way straight away...
-					_vm->_animation->tr[1].face = Animation::kDirLeft;
+					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 				}
 			}
 		}
@@ -581,7 +581,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			default: { // You've answered SOME of his questions.
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 3);
-				_vm->_animation->tr[1].face = Animation::kDirRight;
+				_vm->_animation->tr[1]._facingDir = Animation::kDirRight;
 				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
 			}
 			}
@@ -649,7 +649,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
-		if (_vm->_animation->tr[0].whichsprite == 0) // Avvy in his normal clothes
+		if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
@@ -713,7 +713,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1].walkto(4); // Walks up to greet you.
 		} else {
 			_vm->_animation->apped(2, 4); // Starts where she was before.
-			_vm->_animation->tr[1].face = Animation::kDirLeft;
+			_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 		}
 
 		_vm->_animation->tr[1].call_eachstep = true;
@@ -994,7 +994,7 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
 	case kColorWhite:
 	case kColorLightcyan:
 	case kColorYellow: // Fall-throughs are intended.
-		_vm->_animation->stopwalking();
+		_vm->_animation->stopWalking();
 		drawDirection();
 		break;
 	}
@@ -1039,7 +1039,7 @@ void Lucerna::guideAvvy(Common::Point cursorPos) {
 
 	switch (what) {
 	case 0:
-		_vm->_animation->stopwalking();
+		_vm->_animation->stopWalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
 		_vm->_animation->rwsp(0, Animation::kDirLeft);
@@ -1128,10 +1128,10 @@ void Lucerna::checkClick() {
 
 				callVerb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_animation->tr[0].xs = _vm->_gyro->kWalk;
+				_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
 				_vm->_animation->newspeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_animation->tr[0].xs = _vm->_gyro->kRun;
+				_vm->_animation->tr[0]._speedX = _vm->_gyro->kRun;
 				_vm->_animation->newspeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
@@ -1174,9 +1174,7 @@ void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
 
 	CursorMan.showMouse(false);
-
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161);
-
 	CursorMan.showMouse(true);
 }
 
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index b7b4acf..ad0e4a2 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -101,7 +101,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	bool _fxHidden; // Will de used in dust() and dawn().
+	bool _fxHidden; // Will de used in dusk() and dawn().
 
 	Common::File file;
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 8e64dbc..f2d4241 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -76,7 +76,7 @@ void Sequence::start_to_close() {
 
 void Sequence::start_to_open() {
 	_vm->_gyro->_dna._userMovesAvvy = false; // They can't move.
-	_vm->_animation->stopwalking(); // And they're not moving now.
+	_vm->_animation->stopWalking(); // And they're not moving now.
 	start_to_close(); // Apart from that, it's the same thing.
 }
 
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 69f85b3..2b95490 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -244,7 +244,7 @@ void Timeout::avaricius_talks() {
 
 void Timeout::urinate() {
 	_vm->_animation->tr[0].turn(Animation::kDirUp);
-	_vm->_animation->stopwalking();
+	_vm->_animation->stopWalking();
 	_vm->_lucerna->drawDirection();
 	set_up_timer(14, proctoilet2, reason_gototoilet);
 }
@@ -298,8 +298,8 @@ void Timeout::get_tied_up() {
 	_vm->_visa->dixi('q', 34); // ...Trouble!
 	_vm->_gyro->_dna._userMovesAvvy = false;
 	_vm->_gyro->_dna._beenTiedUp = true;
-	_vm->_animation->stopwalking();
-	_vm->_animation->tr[1].stopwalk();
+	_vm->_animation->stopWalking();
+	_vm->_animation->tr[1].stopWalk();
 	_vm->_animation->tr[1].stophoming();
 	_vm->_animation->tr[1].call_eachstep = true;
 	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGrabAvvy;
@@ -530,8 +530,8 @@ void Timeout::greetsmonk() {
 
 void Timeout::fall_down_oubliette() {
 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
-	_vm->_animation->tr[0].iy++; // Increments dx/dy!
-	_vm->_animation->tr[0]._y += _vm->_animation->tr[0].iy;   // Dowwwn we go...
+	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
+	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
 	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
 }
 
@@ -545,10 +545,10 @@ void Timeout::meet_avaroid() {
 		_vm->_gyro->_dna._metAvaroid = true;
 		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
 
-		_vm->_animation->tr[0].face = Animation::kDirLeft;
+		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
 		_vm->_animation->tr[0]._x = 151;
-		_vm->_animation->tr[0].ix = -3;
-		_vm->_animation->tr[0].iy = -5;
+		_vm->_animation->tr[0]._moveX = -3;
+		_vm->_animation->tr[0]._moveY = -5;
 
 		_vm->_gyro->setBackgroundColor(2);
 	}
@@ -556,9 +556,9 @@ void Timeout::meet_avaroid() {
 
 void Timeout::rise_up_oubliette() {
 	_vm->_animation->tr[0]._visible = true;
-	_vm->_animation->tr[0].iy++; // Decrements dx/dy!
-	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0].iy; // Uuuupppp we go...
-	if (_vm->_animation->tr[0].iy > 0)
+	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
+	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
+	if (_vm->_animation->tr[0]._moveY > 0)
 		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
 	else
 		_vm->_gyro->_dna._userMovesAvvy = true;
@@ -568,8 +568,8 @@ void Timeout::robin_hood_and_geida() {
 	_vm->_animation->tr[0].init(7, true, _vm->_animation);
 	_vm->_animation->apped(1, 7);
 	_vm->_animation->tr[0].walkto(6);
-	_vm->_animation->tr[1].stopwalk();
-	_vm->_animation->tr[1].face = Animation::kDirLeft;
+	_vm->_animation->tr[1].stopWalk();
+	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index c657a4a..1fd7405 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -153,7 +153,6 @@ void Visa::speech(byte who, byte subject) {
 }
 
 void Visa::talkto(byte whom) {
-	byte fv;
 	bool no_matches;
 
 	if (_vm->_acci->_person == _vm->_acci->kPardon) {
@@ -252,9 +251,9 @@ void Visa::talkto(byte whom) {
 		whom -= 149;
 
 	no_matches = true;
-	for (fv = 0; fv <= _vm->_animation->kSpriteNumbMax; fv++)
-		if (_vm->_animation->tr[fv]._stat.accinum == whom) {
-			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer);
+	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
+		if (_vm->_animation->tr[i]._stat.accinum == whom) {
+			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
 			no_matches = false;
 			break;
 		}


Commit: f59892b45e63fa1db1e9505279d9010071ed1074
    https://github.com/scummvm/scummvm/commit/f59892b45e63fa1db1e9505279d9010071ed1074
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-07T14:42:34-07:00

Commit Message:
AVALANCHE: More renaming in animation

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 370ba87..24d74b5 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -408,7 +408,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->dixi('z', 5); // His closing statement...
 		_vm->_animation->tr[1].walkto(4); // The end of the drawbridge
-		_vm->_animation->tr[1].vanishifstill = true; // Then go away!
+		_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_gyro->_dna._cardiffQuestionNum = 5;
 		break;
@@ -937,7 +937,7 @@ void Acci::openDoor() {
 				_vm->_animation->call_special(_vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_vm->_animation->open_the_door((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
+				_vm->_animation->openDoor((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
 				break;
 			}
 
@@ -1040,7 +1040,7 @@ void Acci::notInOrder() {
 }
 
 void Acci::goToCauldron() {
-	_vm->_animation->tr[1].call_eachstep = false; // Stops Geida_Procs.
+	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
 	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
 	_vm->_animation->tr[1].walkto(2);
 }
@@ -1278,7 +1278,7 @@ void Acci::personSpeaks() {
 	bool found = false; // The _person we're looking for's code is in _person.
 
 	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->tr[i].quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
+		if (_vm->_animation->tr[i]._quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
@@ -1703,8 +1703,8 @@ void Acci::doThat() {
 					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius
 					_vm->_animation->apped(2, 4);
 					_vm->_animation->tr[1].walkto(5);
-					_vm->_animation->tr[1].call_eachstep = true;
-					_vm->_animation->tr[1].eachstep = _vm->_animation->kProcBackAndForth;
+					_vm->_animation->tr[1]._callEachStepFl = true;
+					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
 				}
@@ -1862,8 +1862,8 @@ void Acci::doThat() {
 				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->incScore(7);
 				_vm->_animation->tr[1].walkto(2);
-				_vm->_animation->tr[1].vanishifstill = true;
-				_vm->_animation->tr[1].call_eachstep = false;
+				_vm->_animation->tr[1]._vanishIfStill = true;
+				_vm->_animation->tr[1]._callEachStepFl = false;
 				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 739c884..a4b129b 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -45,18 +45,16 @@
 
 namespace Avalanche {
 
-void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
+void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {
 	_tr = tr;
 
 	const int32 idshould = -1317732048;
-	byte fv;
-	int32 id;
-	Common::File inf;
 
 	if (spritenum == 177)
 		return; // Already running!
 
 	Common::String filename;
+	Common::File inf;
 	filename = filename.format("sprite%d.avd", spritenum);
 	if (!inf.open(filename)) {
 		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
@@ -65,7 +63,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 
 	inf.seek(177);
 
-	id = inf.readSint32LE();
+	int32 id = inf.readSint32LE();
 	if (id != idshould) {
 		//output << '\7';
 		inf.close();
@@ -100,14 +98,13 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (byte aa = 0; aa < _stat._frameNum; aa++) {
-
+	for (byte i = 0; i < _stat._frameNum; i++) {
 		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
 		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
 		_info._mani[_animCount] = new ManiType[_info._size - 6];
 		//getmem(mani[totalnum-1], a.size - 6);
-		for (fv = 0; fv <= _info._yLength; fv++)
-			inf.read((*_info._sil[_animCount])[fv], _info._xWidth);
+		for (byte j = 0; j <= _info._yLength; j++)
+			inf.read((*_info._sil[_animCount])[j], _info._xWidth);
 			//blockread(inf, (*sil[totalnum-1])[fv], xw);
 		inf.read(*_info._mani[_animCount], _info._size - 6);
 		//blockread(inf, *mani[totalnum-1], a.size - 6);
@@ -119,7 +116,7 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 	// on;
 	_x = 0;
 	_y = 0;
-	quick = true;
+	_quick = true;
 	_visible = false;
 	_speedX = 3;
 	_speedY = 1;
@@ -129,25 +126,25 @@ void AnimationType::init(byte spritenum, bool do_check, Animation *tr) {
 	_homing = false;
 	_moveX = 0;
 	_moveY = 0;
-	step = 0;
-	check_me = do_check;
-	count = 0;
+	_stepNum = 0;
+	_doCheck = doCheck;
+	_count = 0;
 	_id = spritenum;
-	vanishifstill = false;
-	call_eachstep = false;
+	_vanishIfStill = false;
+	_callEachStepFl = false;
 
 	inf.close();
 }
 
 void AnimationType::original() {
-	quick = false;
+	_quick = false;
 	_id = 177;
 }
 
 void AnimationType::andexor() {
-	if ((vanishifstill) && (_moveX == 0) && (_moveY == 0))
+	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
-	byte picnum = _facingDir * _stat.seq + step; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
+	byte picnum = _facingDir * _stat.seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
 
 	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
@@ -176,7 +173,7 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  */
 bool AnimationType::checkCollision() {
 	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) {
-		if (_tr->tr[i].quick && (_tr->tr[i]._id != _id) &&
+		if (_tr->tr[i]._quick && (_tr->tr[i]._id != _id) &&
 			((_x + _info._xLength) > _tr->tr[i]._x) &&
 			(_x < (_tr->tr[i]._x + _tr->tr[i]._info._xLength)) &&
 			(_tr->tr[i]._y == _y))
@@ -211,7 +208,7 @@ void AnimationType::walk() {
 		_y = _y + _moveY;
 	}
 
-	if (check_me) {
+	if (_doCheck) {
 		if (checkCollision()) {
 			bounce();
 			return;
@@ -243,19 +240,19 @@ void AnimationType::walk() {
 				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_tr->open_the_door(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
+				_tr->openDoor(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
 				break;
 			}
 		}
 	}
 
 	if (!_tr->_vm->_gyro->_doingSpriteRun) {
-		count++;
-		if (((_moveX != 0) || (_moveY != 0)) && (count > 1)) {
-			step++;
-			if (step == _stat.seq)
-				step = 0;
-			count = 0;
+		_count++;
+		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
+			_stepNum++;
+			if (_stepNum == _stat.seq)
+				_stepNum = 0;
+			_count = 0;
 		}
 	}
 }
@@ -263,7 +260,7 @@ void AnimationType::walk() {
 void AnimationType::bounce() {
 	_x = _oldX[_tr->_vm->_gyro->_cp];
 	_y = _oldY[_tr->_vm->_gyro->_cp];
-	if (check_me)
+	if (_doCheck)
 		_tr->stopWalking();
 	else
 		stopWalk();
@@ -355,50 +352,54 @@ void AnimationType::chatter() {
 	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
-void AnimationType::set_up_saver(trip_saver_type &v) {
-	v.whichsprite = _id;
-	v.face = _facingDir;
-	v.step = step;
-	v.x = _x;
-	v.y = _y;
-	v.ix = _moveX;
-	v.iy = _moveY;
-	v.visible = _visible;
-	v.homing = _homing;
-	v.check_me = check_me;
-	v.count = count;
-	v.xw = _info._xWidth;
-	v.xs = _speedX;
-	v.ys = _speedY;
-	v.totalnum = _animCount;
-	v.hx = _homingX;
-	v.hy = _homingY;
-	v.call_eachstep = call_eachstep;
-	v.eachstep = eachstep;
-	v.vanishifstill = vanishifstill;
+/**
+ * Init Saver structure
+ * @remarks	Originally called 'set_up_saver'
+ */
+void AnimationType::setupSaver(AnimationSaver &sav) {
+	sav._id = _id;
+	sav._facingDir = _facingDir;
+	sav._stepNum = _stepNum;
+	sav._x = _x;
+	sav._y = _y;
+	sav._moveX = _moveX;
+	sav._moveY = _moveY;
+	sav._visible = _visible;
+	sav._homing = _homing;
+	sav._doCheck = _doCheck;
+	sav._count = _count;
+	sav._xWidth = _info._xWidth;
+	sav._speedX = _speedX;
+	sav._speedY = _speedY;
+	sav._animCount = _animCount;
+	sav._homingX = _homingX;
+	sav._homingY = _homingY;
+	sav._callEachStepFl = _callEachStepFl;
+	sav._eachStepProc = _eachStepProc;
+	sav._vanishIfStill = _vanishIfStill;
 }
 
-void AnimationType::unload_saver(trip_saver_type v) {
-	_id = v.whichsprite;
-	_facingDir = v.face;
-	step = v.step;
-	_x = v.x;
-	_y = v.y;
-	_moveX = v.ix;
-	_moveY = v.iy;
-	_visible = v.visible;
-	_homing = v.homing;
-	check_me = v.check_me;
-	count = v.count;
-	_info._xWidth = v.xw;
-	_speedX = v.xs;
-	_speedY = v.ys;
-	_animCount = v.totalnum;
-	_homingX = v.hx;
-	_homingY = v.hy;
-	call_eachstep = v.call_eachstep;
-	eachstep = v.eachstep;
-	vanishifstill = v.vanishifstill;
+void AnimationType::unload_saver(AnimationSaver sav) {
+	_id = sav._id;
+	_facingDir = sav._facingDir;
+	_stepNum = sav._stepNum;
+	_x = sav._x;
+	_y = sav._y;
+	_moveX = sav._moveX;
+	_moveY = sav._moveY;
+	_visible = sav._visible;
+	_homing = sav._homing;
+	_doCheck = sav._doCheck;
+	_count = sav._count;
+	_info._xWidth = sav._xWidth;
+	_speedX = sav._speedX;
+	_speedY = sav._speedY;
+	_animCount = sav._animCount;
+	_homingX = sav._homingX;
+	_homingY = sav._homingY;
+	_callEachStepFl = sav._callEachStepFl;
+	_eachStepProc = sav._eachStepProc;
+	_vanishIfStill = sav._vanishIfStill;
 }
 
 void AnimationType::savedata(Common::File &f) {
@@ -429,7 +430,7 @@ AnimationType *AnimationType::done() {
 		delete[] _info._sil[_animCount];
 	}
 
-	quick = false;
+	_quick = false;
 	_id = 177;
 	return this;
 }
@@ -460,7 +461,7 @@ Animation::Animation(AvalancheEngine *vm) {
 
 Animation::~Animation() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick)
+		if (tr[i]._quick)
 			tr[i].done();
 	}
 }
@@ -827,11 +828,11 @@ void Animation::catamove(byte ped) {
 	}
 
 	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
-		if (!tr[1].quick)  // If we don't already have her...
+		if (!tr[1]._quick)  // If we don't already have her...
 			tr[1].init(5, true, this); // ...Load Geida.
 		apped(2, geida_ped(ped));
-		tr[1].call_eachstep = true;
-		tr[1].eachstep = kProcGeida;
+		tr[1]._callEachStepFl = true;
+		tr[1]._eachStepProc = kProcGeida;
 	}
 }
 
@@ -875,8 +876,8 @@ void Animation::call_special(uint16 which) {
 			// graphic of the arrow buried in the plaster. */
 
 			// OK!
-			tr[1].call_eachstep = true;
-			tr[1].eachstep = kProcArrow;
+			tr[1]._callEachStepFl = true;
+			tr[1]._eachStepProc = kProcArrow;
 		}
 		break;
 	case 4: // This is the ghost room link.
@@ -897,8 +898,8 @@ void Animation::call_special(uint16 which) {
 			_vm->_gyro->_dna._tiedUp = true;
 			_vm->_gyro->_dna._friarWillTieYouUp = false;
 			tr[1].walkto(3);
-			tr[1].vanishifstill = true;
-			tr[1].check_me = true; // One of them must have Check_Me switched on.
+			tr[1]._vanishIfStill = true;
+			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
 			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
 		}
@@ -925,14 +926,14 @@ void Animation::call_special(uint16 which) {
 			_vm->_visa->dixi('q', 63);
 			tr[1].turn(kDirDown);
 			tr[1].stopWalk();
-			tr[1].call_eachstep = false; // Geida
+			tr[1]._callEachStepFl = false; // Geida
 			_vm->_lucerna->gameOver();
 		}
 		break;
 	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
 		if (!_vm->_gyro->_dna._geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
-		tr[1].call_eachstep = false; // She no longer follows Avvy around.
+		tr[1]._callEachStepFl = false; // She no longer follows Avvy around.
 		tr[1].walkto(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
@@ -999,12 +1000,14 @@ void Animation::call_special(uint16 which) {
 	}
 }
 
-
-
-void Animation::open_the_door(byte whither, byte ped, byte magicnum) {
-// This slides the door open. (The data really ought to be saved in
-// the Also file, and will be next time. However, for now, they're
-// here.)
+/**
+ * Open the Door.
+ * This slides the door open. The data really ought to be saved in
+ * the Also file, and will be next time. However, for now, they're
+ * here.
+ * @remarks	Originally called 'open_the_door'
+ */
+void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	switch (_vm->_gyro->_dna._room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
@@ -1059,9 +1062,8 @@ void Animation::open_the_door(byte whither, byte ped, byte magicnum) {
 }
 
 void Animation::newspeed() {
-	// Given that you've just changed the speed in triptype.xs, this adjusts ix.
+	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.
 	const ByteField lightspace = {40, 199, 47, 199};
-	byte page_;
 
 	tr[0]._moveX = (tr[0]._moveX / 3) * tr[0]._speedX;
 
@@ -1079,8 +1081,8 @@ void Animation::newspeed() {
 
 	//setactivepage(1 - cp);
 
-	for (page_ = 0; page_ <= 1; page_++)
-		getset[page_].remember(lightspace);
+	for (byte i = 0; i <= 1; i++)
+		getset[i].remember(lightspace);
 
 }
 
@@ -1166,10 +1168,10 @@ void Animation::follow_avvy_y(byte tripnum) {
 		else
 			return;
 		if (tr[tripnum]._moveX == 0)  {
-			tr[tripnum].step += 1;
-			if (tr[tripnum].step == tr[tripnum]._stat.seq)
-				tr[tripnum].step = 0;
-			tr[tripnum].count = 0;
+			tr[tripnum]._stepNum += 1;
+			if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+				tr[tripnum]._stepNum = 0;
+			tr[tripnum]._count = 0;
 		}
 	}
 }
@@ -1204,7 +1206,7 @@ void Animation::arrow_procs(byte tripnum) {
 				&& ((tr[tripnum]._x + tr[tripnum]._info._xLength) >= tr[0]._x)) { // C
 			// OK, it's hit him... what now?
 
-			tr[1].call_eachstep = false; // prevent recursion.
+			tr[1]._callEachStepFl = false; // prevent recursion.
 			_vm->_visa->dixi('Q', 47); // Complaint!
 			tr[tripnum].done(); // Deallocate the arrow.
 #if 0
@@ -1251,7 +1253,7 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 tox = tr[0]._x + 17;
 	int16 toy = tr[0]._y - 1;
 	if ((tr[tripnum]._x == tox) && (tr[tripnum]._y == toy)) {
-		tr[tripnum].call_eachstep = false;
+		tr[tripnum]._callEachStepFl = false;
 		tr[tripnum]._facingDir = kDirLeft;
 		tr[tripnum].stopWalk();
 		// ... whatever ...
@@ -1264,18 +1266,18 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 		}
 		if (tr[tripnum]._y < toy)
 			tr[tripnum]._y++;
-		tr[tripnum].step++;
-		if (tr[tripnum].step == tr[tripnum]._stat.seq)
-			tr[tripnum].step = 0;
+		tr[tripnum]._stepNum++;
+		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+			tr[tripnum]._stepNum = 0;
 	}
 }
 
 void Animation::take_a_step(byte &tripnum) {
 	if (tr[tripnum]._moveX == 0) {
-		tr[tripnum].step++;
-		if (tr[tripnum].step == tr[tripnum]._stat.seq)
-			tr[tripnum].step = 0;
-		tr[tripnum].count = 0;
+		tr[tripnum]._stepNum++;
+		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+			tr[tripnum]._stepNum = 0;
+		tr[tripnum]._count = 0;
 	}
 }
 
@@ -1344,7 +1346,7 @@ void Animation::call_andexors() {
 		order[i] = -1;
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick && tr[i]._visible)
+		if (tr[i]._quick && tr[i]._visible)
 			order[i] = i;
 	}
 
@@ -1379,15 +1381,15 @@ void Animation::animLink() {
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick && tr[i]._visible)
+		if (tr[i]._quick && tr[i]._visible)
 			tr[i].walk();
 	}
 
 	call_andexors();
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick && tr[i].call_eachstep) {
-			switch (tr[i].eachstep) {
+		if (tr[i]._quick && tr[i]._callEachStepFl) {
+			switch (tr[i]._eachStepProc) {
 			case kProcFollowAvvyY :
 				follow_avvy_y(i);
 				break;
@@ -1419,7 +1421,7 @@ void Animation::animLink() {
 
 void Animation::get_back_loretta() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick) {
+		if (tr[i]._quick) {
 			getback();
 			return;
 		}
@@ -1431,7 +1433,7 @@ void Animation::stopWalking() {
 	tr[0].stopWalk();
 	_vm->_gyro->_dna._direction = kDirStopped;
 	if (_vm->_gyro->_alive)
-		tr[0].step = 1;
+		tr[0]._stepNum = 1;
 }
 
 void Animation::tripkey(char dir) {
@@ -1500,7 +1502,7 @@ void Animation::fliproom(byte room, byte ped) {
 	getsetclear();
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
-		if (tr[i].quick)
+		if (tr[i]._quick)
 			tr[i].done();
 	} // Deallocate sprite
 
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 5e33934..72c86a4 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -49,25 +49,25 @@ struct adxtype { // Second revision of ADX type
 	byte accinum; // the number according to Acci (1=Avvy, etc.)
 };
 
-struct trip_saver_type {
-	byte whichsprite;
-	byte face;
-	byte step;
-	int16 x;
-	int16 y;
-	int8 ix;
-	int8 iy;
-	bool visible;
-	bool homing;
-	bool check_me;
-	byte count;
-	byte xw, xs, ys;
-	byte totalnum;
-	int16 hx;
-	int16 hy;
-	bool call_eachstep;
-	byte eachstep;
-	bool vanishifstill;
+struct AnimationSaver {
+	byte _id;
+	byte _facingDir;
+	byte _stepNum;
+	int16 _x;
+	int16 _y;
+	int8 _moveX;
+	int8 _moveY;
+	bool _visible;
+	bool _homing;
+	bool _doCheck;
+	byte _count;
+	byte _xWidth, _speedX, _speedY;
+	byte _animCount;
+	int16 _homingX;
+	int16 _homingY;
+	bool _callEachStepFl;
+	byte _eachStepProc;
+	bool _vanishIfStill;
 };
 
 class Animation;
@@ -77,22 +77,22 @@ public:
 	SpriteInfo _info;
 
 	adxtype _stat; // vital statistics
-	byte _facingDir, step;
+	byte _facingDir, _stepNum;
 	int16 _x, _y; // current xy coords
 	int16 _oldX[2], _oldY[2];  // last xy coords
 	int8 _moveX, _moveY; // amount to move sprite by, each step
 	byte _id;
-	bool quick, _visible, _homing, check_me;
+	bool _quick, _visible, _homing, _doCheck;
 	int16 _homingX, _homingY; // homing x & y coords
-	byte count; // counts before changing step
+	byte _count; // counts before changing step
 	byte _speedX, _speedY; // x & y speed
 	byte _animCount; // total number of sprites
-	bool vanishifstill; // Do we show this sprite if it's still?
+	bool _vanishIfStill; // Do we show this sprite if it's still?
 
-	bool call_eachstep; // Do we call the eachstep procedure?
-	byte eachstep;
+	bool _callEachStepFl; // Do we call the eachstep procedure?
+	byte _eachStepProc;
 
-	void init(byte spritenum, bool do_check, Animation *tr);
+	void init(byte spritenum, bool doCheck, Animation *tr);
 	// loads & sets up the sprite
 	void original();    // just sets Quick to false
 	void andexor();    // drops sprite onto screen
@@ -106,8 +106,8 @@ public:
 	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
 	void stopWalk();    // Stops the sprite from moving
 	void chatter();    // Sets up talk vars
-	void set_up_saver(trip_saver_type &v);
-	void unload_saver(trip_saver_type v);
+	void setupSaver(AnimationSaver &sav);
+	void unload_saver(AnimationSaver sav);
 
 	void savedata(Common::File &f); // Self-explanatory,
 	void loaddata(Common::File &f);  // really.
@@ -140,25 +140,25 @@ public:
 	friend class AnimationType;
 	friend class getsettype;
 
-	static const int16 kDirUp = 0;
-	static const int16 kDirRight = 1;
-	static const int16 kDirDown = 2;
-	static const int16 kDirLeft = 3;
-	static const int16 kDirUpRight = 4;
-	static const int16 kDirDownRight = 5;
-	static const int16 kDirDownLeft = 6;
-	static const int16 kDirUpLeft = 7;
-	static const int16 kDirStopped = 8;
+	static const byte kDirUp = 0;
+	static const byte kDirRight = 1;
+	static const byte kDirDown = 2;
+	static const byte kDirLeft = 3;
+	static const byte kDirUpRight = 4;
+	static const byte kDirDownRight = 5;
+	static const byte kDirDownLeft = 6;
+	static const byte kDirUpLeft = 7;
+	static const byte kDirStopped = 8;
 
 	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
 
-	static const int16 kProcFollowAvvyY = 1;
-	static const int16 kProcBackAndForth = 2;
-	static const int16 kProcFaceAvvy = 3;
-	static const int16 kProcArrow = 4;
-	static const int16 kProcsPludwick = 5; // Unused
-	static const int16 kProcGrabAvvy = 6;
-	static const int16 kProcGeida = 7;
+	static const byte kProcFollowAvvyY = 1;
+	static const byte kProcBackAndForth = 2;
+	static const byte kProcFaceAvvy = 3;
+	static const byte kProcArrow = 4;
+	static const byte kProcsPludwick = 5; // Unused
+	static const byte kProcGrabAvvy = 6;
+	static const byte kProcGeida = 7;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
@@ -167,7 +167,7 @@ public:
 	void get_back_loretta();
 	void loadtrip();
 	void call_special(uint16 which);
-	void open_the_door(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
+	void openDoor(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
 	void catamove(byte ped);
 	void stopWalking();
 	void tripkey(char dir);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 50b451a..7462268 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -283,7 +283,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
 		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) {
-			if (_animation->tr[i].quick)
+			if (_animation->tr[i]._quick)
 				spriteNum++;
 		}
 	}
@@ -291,37 +291,37 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	if (sz.isLoading()) {
 		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
-			if (_animation->tr[i].quick)
+			if (_animation->tr[i]._quick)
 				_animation->tr[i].done();
 		}
 	}
 
 	for (byte i = 0; i < spriteNum; i++) {
 		sz.syncAsByte(_animation->tr[i]._id);
-		sz.syncAsByte(_animation->tr[i].check_me);
+		sz.syncAsByte(_animation->tr[i]._doCheck);
 
 
 		if (sz.isLoading()) {
-			_animation->tr[i].quick = true;
-			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i].check_me, _animation);
+			_animation->tr[i]._quick = true;
+			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i]._doCheck, _animation);
 		}
 
 		sz.syncAsByte(_animation->tr[i]._moveX);
 		sz.syncAsByte(_animation->tr[i]._moveY);
 		sz.syncAsByte(_animation->tr[i]._facingDir);
-		sz.syncAsByte(_animation->tr[i].step);
+		sz.syncAsByte(_animation->tr[i]._stepNum);
 		sz.syncAsByte(_animation->tr[i]._visible);
 		sz.syncAsByte(_animation->tr[i]._homing);
-		sz.syncAsByte(_animation->tr[i].count);
+		sz.syncAsByte(_animation->tr[i]._count);
 		sz.syncAsByte(_animation->tr[i]._info._xWidth);
 		sz.syncAsByte(_animation->tr[i]._speedX);
 		sz.syncAsByte(_animation->tr[i]._speedY);
 		sz.syncAsByte(_animation->tr[i]._animCount);
 		sz.syncAsSint16LE(_animation->tr[i]._homingX);
 		sz.syncAsSint16LE(_animation->tr[i]._homingY);
-		sz.syncAsByte(_animation->tr[i].call_eachstep);
-		sz.syncAsByte(_animation->tr[i].eachstep);
-		sz.syncAsByte(_animation->tr[i].vanishifstill);
+		sz.syncAsByte(_animation->tr[i]._callEachStepFl);
+		sz.syncAsByte(_animation->tr[i]._eachStepProc);
+		sz.syncAsByte(_animation->tr[i]._vanishIfStill);
 
 		sz.syncAsSint16LE(_animation->tr[i]._x);
 		sz.syncAsSint16LE(_animation->tr[i]._y);
@@ -484,14 +484,14 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
 
-	if (_animation->tr[0].quick && _animation->tr[0]._visible)
+	if (_animation->tr[0]._quick && _animation->tr[0]._visible)
 		_animation->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
 
 Common::String AvalancheEngine::expandDate(int d, int m, int y) {
-	const Common::String months[12] = {
+	static const Common::String months[12] = {
 		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
 	};
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 6fa91cf..f7e917e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -228,7 +228,7 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
-		if (_vm->_animation->tr[i].quick)
+		if (_vm->_animation->tr[i]._quick)
 			_vm->_animation->tr[i].done();
 	}
 	// Deallocate sprite. Sorry, beta testers!
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 94a58fa..3464a7c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -402,8 +402,8 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 		return;
 	_vm->_animation->tr[1].init(5, false, _vm->_animation); // load Geida
 	_vm->_animation->apped(2, whichPed);
-	_vm->_animation->tr[1].call_eachstep = true;
-	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida;
+	_vm->_animation->tr[1]._callEachStepFl = true;
+	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -455,8 +455,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 				}
 
-				_vm->_animation->tr[1].call_eachstep = true;
-				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
+				_vm->_animation->tr[1]._callEachStepFl = true;
+				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
 
 			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
 
@@ -487,8 +487,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
-			_vm->_animation->tr[1].call_eachstep = true;
-			_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGeida;
+			_vm->_animation->tr[1]._callEachStepFl = true;
+			_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -502,8 +502,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		} else {
 			if (ped > 0) {
 				_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot
-				_vm->_animation->tr[1].call_eachstep = true;
-				_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFollowAvvyY;
+				_vm->_animation->tr[1]._callEachStepFl = true;
+				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
@@ -524,7 +524,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->apped(2, 1);
 			_vm->_animation->tr[1].walkto(2);
-			_vm->_animation->tr[1].vanishifstill = true;
+			_vm->_animation->tr[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
@@ -716,8 +716,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 		}
 
-		_vm->_animation->tr[1].call_eachstep = true;
-		_vm->_animation->tr[1].eachstep = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
+		_vm->_animation->tr[1]._callEachStepFl = true;
+		_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
 		break;
 
 	case r__insidecardiffcastle:
@@ -1187,7 +1187,7 @@ void Lucerna::gameOver() {
 
 	_vm->_animation->tr[0].done();
 	_vm->_animation->tr[0].init(12, true, _vm->_animation); // 12 = Avalot falls
-	_vm->_animation->tr[0].step = 0;
+	_vm->_animation->tr[0]._stepNum = 0;
 	_vm->_animation->tr[0].appear(sx, sy, 0);
 
 	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 444762b..5e41ab2 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -689,7 +689,7 @@ void Scrolls::callScrollDriver() {
 				if (_param == 0)
 					setBubbleStateNatural();
 				else if ((1 <= _param) && (_param <= 9)) {
-					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1].quick)) { // Not valid.
+					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1]._quick)) { // Not valid.
 						_vm->_lucerna->errorLed();
 						setBubbleStateNatural();
 					} else
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 2b95490..842a7dc 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -301,8 +301,8 @@ void Timeout::get_tied_up() {
 	_vm->_animation->stopWalking();
 	_vm->_animation->tr[1].stopWalk();
 	_vm->_animation->tr[1].stophoming();
-	_vm->_animation->tr[1].call_eachstep = true;
-	_vm->_animation->tr[1].eachstep = _vm->_animation->kProcGrabAvvy;
+	_vm->_animation->tr[1]._callEachStepFl = true;
+	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
 	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
 }
 
@@ -314,7 +314,7 @@ void Timeout::get_tied_up2() {
 }
 
 void Timeout::hang_around() {
-	_vm->_animation->tr[1].check_me = false;
+	_vm->_animation->tr[1]._doCheck = false;
 	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->apped(1, 2);
@@ -325,7 +325,7 @@ void Timeout::hang_around() {
 
 void Timeout::hang_around2() {
 	_vm->_visa->dixi('q', 40);
-	_vm->_animation->tr[1].vanishifstill = false;
+	_vm->_animation->tr[1]._vanishIfStill = false;
 	_vm->_animation->tr[1].walkto(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->dixi('q', 41);
@@ -430,7 +430,7 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 void Timeout::naughty_duke2() {
 	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
 	_vm->_animation->tr[1].walkto(1); // Walk to the door.
-	_vm->_animation->tr[1].vanishifstill = true; // Then go away!
+	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
 }
 
@@ -578,8 +578,8 @@ void Timeout::robin_hood_and_geida_talk() {
 	_vm->_visa->dixi('q', 66);
 	_vm->_animation->tr[0].walkto(2);
 	_vm->_animation->tr[1].walkto(2);
-	_vm->_animation->tr[0].vanishifstill = true;
-	_vm->_animation->tr[1].vanishifstill = true;
+	_vm->_animation->tr[0]._vanishIfStill = true;
+	_vm->_animation->tr[1]._vanishIfStill = true;
 	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
 }
 
@@ -636,8 +636,8 @@ void Timeout::winning() {
 }
 
 void Timeout::avalot_falls() {
-	if (_vm->_animation->tr[0].step < 5) {
-		_vm->_animation->tr[0].step++;
+	if (_vm->_animation->tr[0]._stepNum < 5) {
+		_vm->_animation->tr[0]._stepNum++;
 		set_up_timer(3, procavalot_falls, reason_falling_over);
 	} else {
 		Common::String toDisplay;
@@ -658,7 +658,7 @@ void Timeout::spludwick_goes_to_cauldron() {
 }
 
 void Timeout::spludwick_leaves_cauldron() {
-	_vm->_animation->tr[1].call_eachstep = true; // So that normal procs will continue.
+	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
 }
 
 void Timeout::give_lute_to_geida() { // Moved here from Acci.
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 1fd7405..66f1faf 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -274,7 +274,7 @@ void Visa::talkto(byte whom) {
 
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
-		_vm->_animation->tr[1].vanishifstill = true;
+		_vm->_animation->tr[1]._vanishIfStill = true;
 		_vm->_animation->tr[1].walkto(3); // Walks away.
 
 		_vm->_lucerna->incScore(2);


Commit: d2b554ab419f7ed088dd52e64759329a408b4968
    https://github.com/scummvm/scummvm/commit/d2b554ab419f7ed088dd52e64759329a408b4968
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T14:48:48-07:00

Commit Message:
AVALANCHE: More renaming in Lucerna. Fix accidentally modified strings in Acci.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 370ba87..5fa2992 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -599,7 +599,7 @@ void Acci::parse() {
 	}
 
 	if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-			_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea kWhat \"") + _unknown + "\" means. Can you rephrase it?");
+			_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea what \"") + _unknown + "\" means. Can you rephrase it?");
 			_vm->_gyro->_weirdWord = true;
 	} else
 		_vm->_gyro->_weirdWord = false;
@@ -1548,7 +1548,7 @@ void Acci::doThat() {
 			switch (_thing) {
 			case Gyro::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
-				_vm->_scrolls->displayText("Hey, kWhat kind of a weirdo are you\?\?!");
+				_vm->_scrolls->displayText("Hey, what kind of a weirdo are you\?\?!");
 				break;
 			case Gyro::kObjectClothes:
 			case Gyro::kObjectHabit: { // Change this!
@@ -1934,7 +1934,7 @@ void Acci::doThat() {
 				_vm->_visa->dixi('U', 5); // You WHAT?
 			}
 		} else if ((150 <= _person) && (_person <= 174))
-			_vm->_scrolls->displayText("Hey, kWhat kind of a weirdo are you??");
+			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
 
 		break;
 	case kVerbCodeClimb:
@@ -2002,7 +2002,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kPardon:
-		_vm->_scrolls->displayText("Hey, a _verb would be helpful!");
+		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
 		break;
 	case kVerbCodeHello:
 		personSpeaks();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 444762b..8c88675 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -40,8 +40,6 @@
 #include "common/textconsole.h"
 #include "common/file.h"
 
-//#include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
-
 namespace Avalanche {
 
 Scrolls::Scrolls(AvalancheEngine *vm) {
@@ -53,12 +51,12 @@ void Scrolls::init() {
 	resetScrollDriver();
 }
 
-void Scrolls::setReadyLight(byte x) {     // Sets "Ready" light to whatever
-	if (_vm->_gyro->_ledStatus == x)
+void Scrolls::setReadyLight(byte state) {     // Sets "Ready" light to whatever
+	if (_vm->_gyro->_ledStatus == state)
 		return; // Already like that!
 
 	byte color = kColorBlack;
-	switch (x) {
+	switch (state) {
 	case 0:
 		color = kColorBlack;
 		break; // Off
@@ -75,14 +73,14 @@ void Scrolls::setReadyLight(byte x) {     // Sets "Ready" light to whatever
 	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 
 	CursorMan.showMouse(true);
-	_vm->_gyro->_ledStatus = x;
+	_vm->_gyro->_ledStatus = state;
 }
 
 void Scrolls::easterEgg() {
-	warning("STUB: Scrolls::easteregg()");
+	warning("STUB: Scrolls::easterEgg()");
 }
 
-void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwriting
+void Scrolls::say(int16 x, int16 y, Common::String z) {
 	FontType itw;
 	byte lz = z.size();
 
@@ -113,8 +111,6 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { // Fancy FAST screenwrit
 	}
 }
 
-// Here are the procedures that Scroll calls. So they must be... $F+*/
-
 void Scrolls::scrollModeNormal() {
 	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
 	Common::String e = "(c) 1994";
@@ -124,8 +120,6 @@ void Scrolls::scrollModeNormal() {
 	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(4);
 
-
-
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
 	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
@@ -143,8 +137,6 @@ void Scrolls::scrollModeNormal() {
 	_vm->_graphics->_surface.copyFrom(temp);
 	temp.free();
 
-
-
 #if 0
 	char r;
 	bool oktoexit;
@@ -187,28 +179,23 @@ void Scrolls::scrollModeNormal() {
 	CursorMan.showMouse(false);
 	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
 
-	warning("STUB: Scrolls::normscroll()");
+	warning("STUB: Scrolls::scrollModeNormal()");
 }
 
 void Scrolls::scrollModeDialogue() {
-	warning("STUB: Scrolls::dialogue()");
+	warning("STUB: Scrolls::scrollModeDialogue()");
 }
 
-
-
-
 void Scrolls::store(byte what, TuneType &played) {
 	memcpy(played + 1, played + 2, sizeof(played) - 1);
 	played[30] = what;
 }
 
 bool Scrolls::theyMatch(TuneType &played) {
-	byte fv, mistakes;
+	byte mistakes = 0;
 
-	mistakes = 0;
-
-	for (fv = 1; fv <= sizeof(played); fv++) {
-		if (played[fv] != _vm->_gyro->kTune[fv]) {
+	for (byte i = 0; i < sizeof(played); i++) {
+		if (played[i] != _vm->_gyro->kTune[i]) {
 			mistakes += 1;
 		}
 	}
@@ -245,18 +232,16 @@ void Scrolls::scrollModeMusic() {
 #endif
 }
 
-// ThatsAll, so put us back to $F-
-
-void Scrolls::resetScrollDriver() {   // phew
+void Scrolls::resetScrollDriver() {
 	_vm->_gyro->_scrollBells = 0;
 	_currentFont = kFontStyleRoman;
 	_useIcon = 0;
-	_vm->_gyro->_interrogation = 0; // always reset after a scroll comes up.
+	_vm->_gyro->_interrogation = 0; // Always reset after a scroll comes up.
 }
 
 void Scrolls::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (byte fv = 0; fv < _vm->_gyro->_scrollBells; fv++)
-		_vm->_lucerna->errorLed(); // ring the bell "x" times
+	for (byte i = 0; i < _vm->_gyro->_scrollBells; i++)
+		_vm->_lucerna->errorLed(); // Ring the bell "x" times.
 }
 
 void Scrolls::dodgem() {
@@ -271,33 +256,32 @@ void Scrolls::unDodgem() {
 }
 
 void Scrolls::getIcon(int16 x, int16 y, byte which) {
-	Common::File f;
-	byte *p;
+	Common::File file;
 
-	if (!f.open("icons.avd")) {
+	if (!file.open("icons.avd")) {
 		warning("AVALANCHE: Scrolls: File not found: icons.avd");
 		return;
 	}
 
 	which--;
-	f.seek(which * 426);
+	file.seek(which * 426);
 
-	p = new byte[426];
-	f.read(p, 426);
+	byte *p = new byte[426];
+	file.read(p, 426);
 
 	//putimage(x, y, p, 0);
-	warning("STUB: Scrolls::geticon()");
+	warning("STUB: Scrolls::getIcon()");
 
 	delete[] p;
-	f.close();
+	file.close();
 }
 
 void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
-	Common::File f;
+	Common::File file;
 
 	Common::String filename;
 	filename = filename.format("%s.avd", fn.c_str());
-	if (!f.open(filename)) {
+	if (!file.open(filename)) {
 		warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 		return;
 	}
@@ -316,30 +300,27 @@ void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	bit = getpixel(0, 0);
 #endif
 
-	warning("STUB: Scrolls::block_drop()");
+	warning("STUB: Scrolls::drawSign()");
 
-	f.close();
+	file.close();
 }
 
-void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the oldest procs in the game.
-	byte b;
-	int16 lx, ly, mx, my, ex;
-	bool centre;
-	byte icon_indent = 0;
+void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
+	int16 ex;
 
 	//setvisualpage(cp);
 	//setactivepage(1 - cp);
 	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
 
-	lx = 0;
-	ly = (_vm->_gyro->_scrollNum) * 6;
-	for (b = 0; b < _vm->_gyro->_scrollNum; b++) {
-		ex = _vm->_gyro->_scroll[b].size() * 8;
+	int16 lx = 0;
+	int16 ly = (_vm->_gyro->_scrollNum) * 6;
+	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		ex = _vm->_gyro->_scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
 	}
-	mx = 320;
-	my = 100; // Getmaxx & getmaxy div 2, both.
+	int16 mx = 320;
+	int16 my = 100; // Getmaxx & getmaxy div 2, both.
 	lx = lx / 2;
 	ly -= 2;
 
@@ -380,48 +361,49 @@ void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the old
 	mx -= lx;
 	my -= ly + 2;
 
-	centre = false;
+	bool centre = false;
 
+	byte iconIndent = 0;
 	switch (_useIcon) {
 	case 0:
-		icon_indent = 0;
+		iconIndent = 0;
 		break; // No icon.
 	case 34: {
 		drawSign("about", 28, 76, 15);
-		icon_indent = 0;
+		iconIndent = 0;
 		}
 		break;
 	case 35: {
 		drawSign("gameover", 52, 59, 71);
-		icon_indent = 0;
+		iconIndent = 0;
 		}
 		break;
 	}
 
 	if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon.
 		getIcon(mx, my + ly / 2, _useIcon);
-		icon_indent = 53;
+		iconIndent = 53;
 	}
 
 
-	for (b = 0; b < _vm->_gyro->_scrollNum; b++) {
-		if (!_vm->_gyro->_scroll[b].empty())
-			switch (_vm->_gyro->_scroll[b][_vm->_gyro->_scroll[b].size() - 1]) {
+	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		if (!_vm->_gyro->_scroll[i].empty())
+			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
 			case kControlCenter: {
 				centre = true;
-				_vm->_gyro->_scroll[b].deleteLastChar();
+				_vm->_gyro->_scroll[i].deleteLastChar();
 				}
 				break;
 			case kControlLeftJustified: {
 				centre = false;
-				_vm->_gyro->_scroll[b].deleteLastChar();
+				_vm->_gyro->_scroll[i].deleteLastChar();
 				}
 				break;
 			case kControlQuestion: {
 				//settextjustify(1, 1);
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
-				_vm->_gyro->_scroll[b].setChar(' ', 0);
+				_vm->_gyro->_scroll[i].setChar(' ', 0);
 				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
 				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
@@ -431,9 +413,9 @@ void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the old
 			}
 
 		if (centre)
-			say(320 - _vm->_gyro->_scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->_scroll[b]);
+			say(320 - _vm->_gyro->_scroll[i].size() * 4 + iconIndent, my, _vm->_gyro->_scroll[i]);
 		else
-			say(mx + icon_indent, my, _vm->_gyro->_scroll[b]);
+			say(mx + iconIndent, my, _vm->_gyro->_scroll[i]);
 
 		my += 12;
 	}
@@ -445,7 +427,7 @@ void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the old
 	_vm->_gyro->_dropsOk = false;
 	dodgem();
 
-	(this->*gotoit)();
+	(this->*modeFunc)();
 
 	unDodgem();
 	_vm->_gyro->_dropsOk = true;
@@ -462,12 +444,11 @@ void Scrolls::drawScroll(ScrollsFunctionType gotoit) { // This is one of the old
 	/*if (_vm->_gyro->mpress > 0)
 	_vm->_gyro->after_the_scroll = true;*/
 
-	warning("STUB: Scrolls::drawscroll()");
+	warning("STUB: Scrolls::drawScroll()");
 }
 
-void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
-	int16 xl, yl, my, xw, yw;
-	Common::Point p[3];
+void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
+	Common::Point points[3];
 //	byte *rp1, *rp2; // replace: 1=bubble, 2=pointer
 	int16 xc; // x correction
 
@@ -478,18 +459,18 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 
 	CursorMan.showMouse(false);
 
-	xl = 0;
-	yl = _vm->_gyro->_scrollNum * 5;
-	for (byte fv = 0; fv < _vm->_gyro->_scrollNum; fv++) {
-		uint16 textWidth = _vm->_gyro->_scroll[fv].size() * 8;
+	int16 xl = 0;
+	int16 yl = _vm->_gyro->_scrollNum * 5;
+	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		uint16 textWidth = _vm->_gyro->_scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
 	}
 	xl = xl / 2;
 
-	xw = xl + 18;
-	yw = yl + 7;
-	my = yw * 2 - 2;
+	int16 xw = xl + 18;
+	int16 yw = yl + 7;
+	int16 my = yw * 2 - 2;
 	xc = 0;
 
 	if ((_vm->_gyro->_talkX - xw) < 0)
@@ -497,12 +478,12 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 	if ((_vm->_gyro->_talkX + xw) > 639)
 		xc = 639 - (_vm->_gyro->_talkX + xw);
 
-	p[0].x = _vm->_gyro->_talkX - 10;
-	p[0].y = yw;
-	p[1].x = _vm->_gyro->_talkX + 10;
-	p[1].y = yw;
-	p[2].x = _vm->_gyro->_talkX;
-	p[2].y = _vm->_gyro->_talkY;
+	points[0].x = _vm->_gyro->_talkX - 10;
+	points[0].y = yw;
+	points[1].x = _vm->_gyro->_talkX + 10;
+	points[1].y = yw;
+	points[2].x = _vm->_gyro->_talkX;
+	points[2].y = _vm->_gyro->_talkY;
 
 	// Backup the screen before drawing the bubble.
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
@@ -521,7 +502,7 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->_talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, p, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
 
 
 	yl -= 3;
@@ -529,10 +510,10 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (byte fv = 0; fv < _vm->_gyro->_scrollNum; fv++) {
-		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[fv].size() / 2 * 8;
-		bool offset = _vm->_gyro->_scroll[fv].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[fv], _vm->_gyro->_font, 8, x - offset * 4, (fv * 10) + 12, _vm->_gyro->_talkFontColor);
+	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[i].size() / 2 * 8;
+		bool offset = _vm->_gyro->_scroll[i].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
 	}
 
 	//setvisualpage(1 - cp);
@@ -542,7 +523,7 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 	_vm->_gyro->_dropsOk = false;
 
 	// This does the actual drawing to the screen.
-	(this->*gotoit)();
+	(this->*modeFunc)();
 
 	CursorMan.showMouse(false);
 	_vm->_gyro->_dropsOk = true;
@@ -556,15 +537,15 @@ void Scrolls::drawBubble(ScrollsFunctionType gotoit) {
 }
 
 bool Scrolls::displayQuestion(Common::String question) {
-	warning("STUB: Scrolls::ask()");
+	warning("STUB: Scrolls::displayQuestion()");
 	return true;
 }
 
 void Scrolls::resetScroll() {
 	_vm->_gyro->_scrollNum = 1;
-	for (int j = 0; j < 15; j++)
-		if (!_vm->_gyro->_scroll[j].empty())
-			_vm->_gyro->_scroll[j].clear();
+	for (int i = 0; i < 15; i++)
+		if (!_vm->_gyro->_scroll[i].empty())
+			_vm->_gyro->_scroll[i].clear();
 }
 
 void Scrolls::setBubbleStateNatural() {
@@ -575,31 +556,28 @@ void Scrolls::setBubbleStateNatural() {
 }
 
 Common::String Scrolls::displayMoney() {
-	Common::String x;
+	Common::String result;
 
 	if (_vm->_gyro->_dna._money < 12) { // just pence
-		x = _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + 'd';
+		result = _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + 'd';
 	} else if (_vm->_gyro->_dna._money < 240) { // shillings & pence
-		x = _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 12) + '/';
+		result = _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 12) + '/';
 		if ((_vm->_gyro->_dna._money % 12) == 0)
-			x = x + '-';
+			result = result + '-';
 		else
-			x = x + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
+			result = result + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	} else // L, s & d
-		x = Common::String('\x9C') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
+		result = Common::String('\x9C') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
 			+ '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
 	if (_vm->_gyro->_dna._money > 12)
-		x = x + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";
+		result = result + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";
 
-	return x;
+	return result;
 }
 
-
-
-
-void Scrolls::stripTrailingSpaces(Common::String &q) {
-	while (q[q.size() - 1] == ' ') {
-		q.deleteLastChar();
+void Scrolls::stripTrailingSpaces(Common::String &str) {
+	while (str[str.size() - 1] == ' ') {
+		str.deleteLastChar();
 	}
 }
 
@@ -617,10 +595,6 @@ void Scrolls::solidify(byte n) {
 }
 
 void Scrolls::callScrollDriver() {
-	uint16 fv;
-	byte nn;
-	bool mouthnext;
-	bool call_spriterun; // Only call sprite_run the FIRST time.
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
 
 
@@ -629,8 +603,8 @@ void Scrolls::callScrollDriver() {
 
 	setReadyLight(0);
 	_vm->_gyro->_scReturn = false;
-	mouthnext = false;
-	call_spriterun = true;
+	bool mouthnext = false;
+	bool call_spriterun = true; // Only call sprite_run the FIRST time.
 
 	switch (_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1]) {
 	case kControlToBuffer:
@@ -647,18 +621,18 @@ void Scrolls::callScrollDriver() {
 
 	uint16 size = _vm->_gyro->_bufSize;
 
-	for (fv = 0; fv < size; fv++) {
+	for (uint16 i = 0; i < size; i++) {
 		if (mouthnext) {
-			if (_vm->_gyro->_buffer[fv] == kControlRegister)
+			if (_vm->_gyro->_buffer[i] == kControlRegister)
 				_param = 0;
-			else if (('0' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= '9'))
-				_param = _vm->_gyro->_buffer[fv] - 48;
-			else if (('A' <= _vm->_gyro->_buffer[fv]) && (_vm->_gyro->_buffer[fv] <= 'Z'))
-				_param = _vm->_gyro->_buffer[fv] - 55;
+			else if (('0' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= '9'))
+				_param = _vm->_gyro->_buffer[i] - 48;
+			else if (('A' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= 'Z'))
+				_param = _vm->_gyro->_buffer[i] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_vm->_gyro->_buffer[fv]) {
+			switch (_vm->_gyro->_buffer[i]) {
 			case kControlParagraph: {
 				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
 					break;
@@ -757,12 +731,9 @@ void Scrolls::callScrollDriver() {
 					}
 					break;
 				case 11:
-					nn = 1;
-					for (byte nnn = 0; nnn < kObjectNum; nnn++) {
-						if (_vm->_gyro->_dna._objects[nnn]) {
-							nn++;
-							displayText(_vm->_gyro->getItem(nnn) + ", " + kControlToBuffer);
-						}
+					for (byte j = 0; j < kObjectNum; j++) {
+						if (_vm->_gyro->_dna._objects[j]) 
+							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
 					}
 					break;
 				}
@@ -790,7 +761,7 @@ void Scrolls::callScrollDriver() {
 				mouthnext = true;
 				break;
 			case kControlInsertSpaces:
-				for (nn = 0; nn < 9; nn++)
+				for (byte j = 0; j < 9; j++)
 					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
 				break;
 			default: { // Add new char.
@@ -798,45 +769,45 @@ void Scrolls::callScrollDriver() {
 					solidify(_vm->_gyro->_scrollNum - 1);
 					_vm->_gyro->_scrollNum++;
 				}
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[fv];
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[i];
 				}
 			}
 		}
 	}
 }
 
-void Scrolls::displayText(Common::String z) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_gyro->_bufSize = z.size();
-	memcpy(_vm->_gyro->_buffer, z.c_str(), _vm->_gyro->_bufSize);
+void Scrolls::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
+	_vm->_gyro->_bufSize = text.size();
+	memcpy(_vm->_gyro->_buffer, text.c_str(), _vm->_gyro->_bufSize);
 	callScrollDriver();
 }
 
 void Scrolls::loadFont() {
-	Common::File f;
+	Common::File file;
 
-	if (!f.open("avalot.fnt")) {
+	if (!file.open("avalot.fnt")) {
 		warning("AVALANCHE: Scrolls: File not found: avalot.fnt");
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_scrollFonts[0][i], 16);
-	f.close();
+		file.read(_scrollFonts[0][i], 16);
+	file.close();
 
-	if (!f.open("avitalic.fnt")) {
+	if (!file.open("avitalic.fnt")) {
 		warning("AVALANCHE: Scrolls: File not found: avitalic.fnt");
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_scrollFonts[1][i], 16);
-	f.close();
+		file.read(_scrollFonts[1][i], 16);
+	file.close();
 
-	if (!f.open("ttsmall.fnt")) {
+	if (!file.open("ttsmall.fnt")) {
 		warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
 		return;
 	}
 	for (int16 i = 0; i < 256; i++)
-		f.read(_vm->_gyro->_font[i],16);
-	f.close();
+		file.read(_vm->_gyro->_font[i],16);
+	file.close();
 }
 
 void Scrolls::musicalScroll() {
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index c043e4a..026c588 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -67,7 +67,7 @@ public:
 	Scrolls(AvalancheEngine *vm);
 
 	void init();
-	void setReadyLight(byte x); // Sets "Ready" light to whatever.
+	void setReadyLight(byte state); // Sets "Ready" light to whatever.
 	void drawScroll(ScrollsFunctionType modeFunc);
 	void drawBubble(ScrollsFunctionType modeFunc);
 	void resetScroll();


Commit: e5d014d29d9be2dbe2905b5a11aeffed1516622e
    https://github.com/scummvm/scummvm/commit/e5d014d29d9be2dbe2905b5a11aeffed1516622e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T14:49:19-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp





Commit: 93013b5c76a0417b5f314f5da1a238b7357bb43f
    https://github.com/scummvm/scummvm/commit/93013b5c76a0417b5f314f5da1a238b7357bb43f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T15:02:20-07:00

Commit Message:
AVALANCHE: Do renaming in Sequence.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index cf4e20f..4938aaa 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1255,10 +1255,10 @@ void Acci::playHarp() {
 
 void Acci::winSequence() {
 	_vm->_visa->dixi('q', 78);
-	_vm->_sequence->first_show(7);
-	_vm->_sequence->then_show(8);
-	_vm->_sequence->then_show(9);
-	_vm->_sequence->start_to_close();
+	_vm->_sequence->firstShow(7);
+	_vm->_sequence->thenShow(8);
+	_vm->_sequence->thenShow(9);
+	_vm->_sequence->startToClose();
 	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning);
 }
 
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index a4b129b..c71ecd6 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1012,53 +1012,53 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	case r__outsideyours:
 	case r__outsidenottspub:
 	case r__outsideducks:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(2);
-		_vm->_sequence->then_show(3);
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(2);
+		_vm->_sequence->thenShow(3);
 		break;
 	case r__insidecardiffcastle:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(5);
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(5);
 		break;
 	case r__avvysgarden:
 	case r__entrancehall:
 	case r__insideabbey:
 	case r__yourhall:
-		_vm->_sequence->first_show(1);
-		_vm->_sequence->then_show(2);
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(2);
 		break;
 	case r__musicroom:
 	case r__outsideargentpub:
-		_vm->_sequence->first_show(5);
-		_vm->_sequence->then_show(6);
+		_vm->_sequence->firstShow(5);
+		_vm->_sequence->thenShow(6);
 		break;
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
 			if (_vm->_gyro->_dna._avvysInTheCupboard) {
 				hideInCupboard();
-				_vm->_sequence->first_show(8);
-				_vm->_sequence->then_show(7);
-				_vm->_sequence->start_to_close();
+				_vm->_sequence->firstShow(8);
+				_vm->_sequence->thenShow(7);
+				_vm->_sequence->startToClose();
 				return;
 			} else {
 				apped(1, 6);
 				tr[0]._facingDir = kDirRight; // added by TT 12/3/1995
-				_vm->_sequence->first_show(8);
-				_vm->_sequence->then_show(9);
+				_vm->_sequence->firstShow(8);
+				_vm->_sequence->thenShow(9);
 			}
 			break;
 		case 12:
-			_vm->_sequence->first_show(4);
-			_vm->_sequence->then_show(5);
-			_vm->_sequence->then_show(6);
+			_vm->_sequence->firstShow(4);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(6);
 			break;
 		}
 		break;
 	}
 
-	_vm->_sequence->then_flip(whither, ped);
-	_vm->_sequence->start_to_open();
+	_vm->_sequence->thenFlip(whither, ped);
+	_vm->_sequence->startToOpen();
 }
 
 void Animation::newspeed() {
@@ -1463,9 +1463,9 @@ void Animation::hideInCupboard() {
 			apped(1, 3); // Walk out of the cupboard.
 			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_dna._avvysInTheCupboard = false;
-			_vm->_sequence->first_show(8);
-			_vm->_sequence->then_show(7);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(8);
+			_vm->_sequence->thenShow(7);
+			_vm->_sequence->startToClose();
 		}
 	} else {
 		// Not hiding in the cupboard
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7462268..3439165 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -341,7 +341,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	}
 
 	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
-	sz.syncBytes(_sequence->seq, _sequence->seq_length);
+	sz.syncBytes(_sequence->_seq, _sequence->kSeqLength);
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3464a7c..30d88e5 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -676,10 +676,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped != 0) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(6);
-			_vm->_sequence->then_show(5);
-			_vm->_sequence->then_show(7);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(6);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(7);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
@@ -687,11 +687,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped == 2) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(3);
-			_vm->_sequence->then_show(2);
-			_vm->_sequence->then_show(1);
-			_vm->_sequence->then_show(4);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(3);
+			_vm->_sequence->thenShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(4);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
@@ -699,10 +699,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped == 2)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(6);
-			_vm->_sequence->then_show(5);
-			_vm->_sequence->then_show(7);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(6);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(7);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
@@ -725,16 +725,16 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1].init(10, false, _vm->_animation); // Define the dart.
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(1);
+			_vm->_sequence->firstShow(1);
 			if (_vm->_gyro->_dna._arrowInTheDoor)
-				_vm->_sequence->then_show(3);
+				_vm->_sequence->thenShow(3);
 			else
-				_vm->_sequence->then_show(2);
+				_vm->_sequence->thenShow(2);
 
 			if (_vm->_gyro->_dna._takenPen)
 				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->startToClose();
 		} else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			if (_vm->_gyro->_dna._arrowInTheDoor)
@@ -749,10 +749,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped == 1)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(2);
-			_vm->_sequence->then_show(1);
-			_vm->_sequence->then_show(3);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(3);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
@@ -770,10 +770,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(2);
-			_vm->_sequence->then_show(1);
-			_vm->_sequence->then_show(3);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(3);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
@@ -808,11 +808,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			// Shut the door
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->first_show(3);
-			_vm->_sequence->first_show(2);
-			_vm->_sequence->then_show(1);
-			_vm->_sequence->then_show(4);
-			_vm->_sequence->start_to_close();
+			_vm->_sequence->firstShow(3);
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(4);
+			_vm->_sequence->startToClose();
 		}
 		break;
 
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index f2d4241..66a9519 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -43,70 +43,66 @@ Sequence::Sequence(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-void Sequence::first_show(byte what) {
+void Sequence::firstShow(byte what) {
 	// First, we need to blank out the entire array.
-	for (uint i = 0; i < sizeof(seq); i++)
-		seq[i] = 0;
-
-	// Then it's just the same as then_show.
-	then_show(what);
+	for (uint i = 0; i < sizeof(_seq); i++)
+		_seq[i] = 0;
 
+	// Then it's just the same as thenShow.
+	thenShow(what);
 }
 
-void Sequence::then_show(byte what) {
-	for (int16 fv = 0; fv < seq_length; fv++) {
-		if (seq[fv] == 0) {
-			seq[fv] = what;
+void Sequence::thenShow(byte what) {
+	for (int16 i = 0; i < kSeqLength; i++) {
+		if (_seq[i] == 0) {
+			_seq[i] = what;
 			return;
 		}
 	}
 }
 
-void Sequence::then_flip(byte where, byte ped) {
-	then_show(now_flip);
+void Sequence::thenFlip(byte where, byte ped) {
+	thenShow(kNowFlip);
 
 	_vm->_gyro->_dna._flipToWhere = where;
 	_vm->_gyro->_dna._flipToPed = ped;
 }
 
-void Sequence::start_to_close() {
+void Sequence::startToClose() {
 	_vm->_timeout->lose_timer(_vm->_timeout->reason_sequencer);
 	_vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->reason_sequencer);
 }
 
-void Sequence::start_to_open() {
+void Sequence::startToOpen() {
 	_vm->_gyro->_dna._userMovesAvvy = false; // They can't move.
 	_vm->_animation->stopWalking(); // And they're not moving now.
-	start_to_close(); // Apart from that, it's the same thing.
+	startToClose(); // Apart from that, it's the same thing.
 }
 
-
-
-// This PROC is called by Timeout when it's time to do another frame.
-void Sequence::shove_left() {
-	memcpy(seq, seq+1, seq_length - 1); // Shift everything to the left.
+void Sequence::shoveLeft() {
+	memcpy(_seq, _seq+1, kSeqLength - 1); // Shift everything to the left.
 }
 
-void Sequence::call_sequencer() {
-	switch (seq[0]) {
+void Sequence::callSequencer() {
+	switch (_seq[0]) {
 	case 0:
 		return; // No more routines.
 		break;
 	case 177: // Flip room.
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		_vm->_animation->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
-		if (seq[0] == 177)
-			shove_left();
+		if (_seq[0] == 177)
+			shoveLeft();
 		break;
 	}
 
-	if ((seq[0] >= 1) && (seq[0] <= 176)) {
+	if ((_seq[0] >= 1) && (_seq[0] <= 176)) {
 		// Show a frame.
-		_vm->_celer->drawBackgroundSprite(-1, -1, seq[0]);
-		shove_left();
+		_vm->_celer->drawBackgroundSprite(-1, -1, _seq[0]);
+		shoveLeft();
 	}
 
-	start_to_close(); // Make sure this PROC gets called again.
+	startToClose(); // Make sure this PROC gets called again.
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
index 7fcb646..07c90b4 100644
--- a/engines/avalanche/sequence2.h
+++ b/engines/avalanche/sequence2.h
@@ -37,33 +37,24 @@ class AvalancheEngine;
 
 class Sequence {
 public:
-	static const int16 now_flip = 177;
-
-	static const int16 seq_length = 10;
-
-
-
-	byte seq[seq_length];
+	static const int16 kNowFlip = 177;
+	static const int16 kSeqLength = 10;
 
+	byte _seq[kSeqLength];
 
 	Sequence(AvalancheEngine *vm);
 
-	void first_show(byte what);
-
-	void then_show(byte what);
-
-	void then_flip(byte where, byte ped);
-
-	void start_to_close();
-
-	void start_to_open();
-
-	void call_sequencer();
+	void firstShow(byte what);
+	void thenShow(byte what);
+	void thenFlip(byte where, byte ped);
+	void startToClose();
+	void startToOpen();
+	void callSequencer();
 
 private:
 	AvalancheEngine *_vm;
 
-	void shove_left();
+	void shoveLeft(); // This PROC is called by Timeout when it's time to do another frame.
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 842a7dc..bd136d5 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -143,7 +143,7 @@ void Timeout::one_tick() {
 					jump();
 					break;
 				case procsequence:
-					_vm->_sequence->call_sequencer();
+					_vm->_sequence->callSequencer();
 					break;
 				case proccrapulus_splud_out:
 					crapulus_says_splud_out();
@@ -421,8 +421,8 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-	_vm->_sequence->first_show(2);
-	_vm->_sequence->start_to_close();
+	_vm->_sequence->firstShow(2);
+	_vm->_sequence->startToClose();
 
 	set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
 }
@@ -436,8 +436,8 @@ void Timeout::naughty_duke2() {
 
 void Timeout::naughty_duke3() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-	_vm->_sequence->first_show(2);
-	_vm->_sequence->start_to_close();
+	_vm->_sequence->firstShow(2);
+	_vm->_sequence->startToClose();
 }
 
 void Timeout::jump() {
@@ -665,9 +665,9 @@ void Timeout::give_lute_to_geida() { // Moved here from Acci.
 	_vm->_visa->dixi('Q', 86);
 	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_dna._lustieIsAsleep = true;
-	_vm->_sequence->first_show(5);
-	_vm->_sequence->then_show(6); // He falls asleep...
-	_vm->_sequence->start_to_close(); // Not really closing, but we're using the same procedure.
+	_vm->_sequence->firstShow(5);
+	_vm->_sequence->thenShow(6); // He falls asleep...
+	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
 }
 
 } // End of namespace Avalanche.


Commit: 1847a0ddbf582603da854938b8d1b774ff03749c
    https://github.com/scummvm/scummvm/commit/1847a0ddbf582603da854938b8d1b774ff03749c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T15:24:59-07:00

Commit Message:
AVALANCHE: Start renaming in Timeout.

Changed paths:
    engines/avalanche/timeout2.h



diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 0e7be33..8536fef 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -37,36 +37,37 @@ class AvalancheEngine;
 
 class Timeout {
 public:
-	// reason_ now runs between 1 and 28.
-
-	static const int16 reason_drawbridgefalls = 2;
-	static const int16 reason_avariciustalks = 3;
-	static const int16 reason_gototoilet = 4;
-	static const int16 reason_explosion = 5;
-	static const int16 reason_brummiestairs = 6;
-	static const int16 reason_cardiffsurvey = 7;
-	static const int16 reason_cwytalot_in_herts = 8;
-	static const int16 reason_getting_tied_up = 9;
-	static const int16 reason_hanging_around = 10; // Tied to the tree in Nottingham.
-	static const int16 reason_jacques_waking_up = 11;
-	static const int16 reason_naughty_duke = 12;
-	static const int16 reason_jumping = 13;
-	static const int16 reason_sequencer = 14;
-	static const int16 reason_crapulus_says_spludwick_out = 15;
-	static const int16 reason_dawndelay = 16;
-	static const int16 reason_drinks = 17;
-	static const int16 reason_du_lustie_talks = 18;
-	static const int16 reason_falling_down_oubliette = 19;
-	static const int16 reason_meeting_avaroid = 20;
-	static const int16 reason_rising_up_oubliette = 21;
-	static const int16 reason_robin_hood_and_geida = 22;
-	static const int16 reason_sitting_down = 23;
-	static const int16 reason_ghost_room_phew = 1;
-	static const int16 reason_arkata_shouts = 24;
-	static const int16 reason_winning = 25;
-	static const int16 reason_falling_over = 26;
-	static const int16 reason_spludwalk = 27;
-	static const int16 reason_geida_sings = 28;
+	// Reason runs between 1 and 28.
+	enum Reason {
+		kReasonDrawbridgeFalls = 2,
+		kReasonAvariciusTalks = 3,
+		kReasonGoToToilet = 4,
+		kReasonExplosion = 5,
+		kReasonBrummieStairs = 6,
+		kReasonCardiffsurvey = 7,
+		kReasonCwytalotInHerts = 8,
+		kReasonGettingTiedUp = 9,
+		kReasonHangingAround = 10, // Tied to the tree in Nottingham.
+		kReasonJacquesWakingUp = 11,
+		kReasonNaughtyDuke = 12,
+		kReasonJumping = 13,
+		kReasonSequencer = 14,
+		kReasonCrapulusSaysSpludwickOut = 15,
+		kReasonDawndelay = 16,
+		kReasonDrinks = 17,
+		kReasonDuLustieTalks = 18,
+		kReasonFallingDownOubliette = 19,
+		kReasonMeetingAvaroid = 20,
+		kReasonRisingUpOubliette = 21,
+		kReasonRobinHoodAndGeida = 22,
+		kReasonSittingDown = 23,
+		kReasonGhostRoomPhew = 1,
+		kReasonArkataShouts = 24,
+		kReasonWinning = 25,
+		kReasonFallingOver = 26,
+		kReasonSpludWalk = 27,
+		kReasonGeidaSings = 28
+	};
 
 	// procx now runs between 1 and 41.
 


Commit: 3f2ed1c803d36842b01320da28d4e68592317781
    https://github.com/scummvm/scummvm/commit/3f2ed1c803d36842b01320da28d4e68592317781
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-07T15:26:16-07:00

Commit Message:
AVALANCHE: Everything that is missing from the last commit...

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 4938aaa..bdbb617 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -379,7 +379,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
 
-	_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey); // If you want to use any other timer, put this into the case statement.
+	_vm->_timeout->lose_timer(_vm->_timeout->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
 	case 1:
@@ -1041,7 +1041,7 @@ void Acci::notInOrder() {
 
 void Acci::goToCauldron() {
 	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->reason_spludwalk);
+	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->kReasonSpludWalk);
 	_vm->_animation->tr[1].walkto(2);
 }
 
@@ -1143,7 +1143,7 @@ void Acci::standUp() {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
-			_vm->_timeout->lose_timer(_vm->_timeout->reason_arkata_shouts);
+			_vm->_timeout->lose_timer(_vm->_timeout->kReasonArkataShouts);
 		} else
 			already();
 		break;
@@ -1242,7 +1242,7 @@ void Acci::giveGeidaTheLute() {
 	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->dixi('q', 64); // She plays it.
 
-	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->reason_geida_sings);
+	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
 }
 
@@ -1259,7 +1259,7 @@ void Acci::winSequence() {
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
 	_vm->_sequence->startToClose();
-	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->reason_winning);
+	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->kReasonWinning);
 }
 
 void Acci::personSpeaks() {
@@ -1682,7 +1682,7 @@ void Acci::doThat() {
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->reason_gototoilet);
+			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->kReasonGoToToilet);
 		} else
 			_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
 			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
@@ -1706,7 +1706,7 @@ void Acci::doThat() {
 					_vm->_animation->tr[1]._callEachStepFl = true;
 					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
-					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->reason_avariciustalks);
+					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->kReasonAvariciusTalks);
 				}
 			} else
 				_vm->_scrolls->displayText("Nothing appears to happen...");
@@ -1769,7 +1769,7 @@ void Acci::doThat() {
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 					_vm->_gyro->_dna._malagauche = 177;
-					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->reason_drinks);
+					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->kReasonDrinks);
 					break;
 				case 52:
 					examine();
@@ -1795,7 +1795,7 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->_dna._malagauche = 177;
 
-						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->reason_drinks);
+						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->kReasonDrinks);
 					}
 					break;
 				}
@@ -1892,7 +1892,7 @@ void Acci::doThat() {
 				else {
 					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->displayText("The drawbridge opens!");
-					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->reason_drawbridgefalls);
+					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->kReasonDrawbridgeFalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
@@ -1944,7 +1944,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->reason_jumping);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->kReasonJumping);
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
@@ -1985,7 +1985,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
-				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->reason_sitting_down);
+				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->kReasonSittingDown);
 			}
 		} else { // Default doodah.
 			_vm->_lucerna->dusk();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index c71ecd6..127fbf9 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -840,7 +840,7 @@ void Animation::catamove(byte ped) {
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Animation::dawndelay() {
-	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->reason_dawndelay);
+	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->kReasonDawndelay);
 }
 
 void Animation::call_special(uint16 which) {
@@ -849,7 +849,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->_dna._brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
+		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->kReasonBrummieStairs);
 		stopWalking();
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
@@ -883,7 +883,7 @@ void Animation::call_special(uint16 which) {
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
 		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->kReasonGhostRoomPhew);
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
@@ -901,7 +901,7 @@ void Animation::call_special(uint16 which) {
 			tr[1]._vanishIfStill = true;
 			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
-			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->reason_hanging_around);
+			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
@@ -909,17 +909,17 @@ void Animation::call_special(uint16 which) {
 		tr[0]._moveX = 3;
 		tr[0]._moveY = 0;
 		tr[0]._facingDir = kDirRight;
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->reason_falling_down_oubliette);
+		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0]._visible = false;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		stopWalking();
-		_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
+		_vm->_timeout->lose_timer(_vm->_timeout->kReasonFallingDownOubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
+		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
@@ -937,7 +937,7 @@ void Animation::call_special(uint16 which) {
 		tr[1].walkto(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->reason_robin_hood_and_geida);
+		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->kReasonRobinHoodAndGeida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
 		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
@@ -1223,7 +1223,7 @@ void Animation::arrow_procs(byte tripnum) {
 			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
-			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
+			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		tr[tripnum].done(); // Deallocate the arrow.
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 30d88e5..a6c6286 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -340,21 +340,21 @@ void Lucerna::exitRoom(byte x) {
 
 	switch (x) {
 	case r__spludwicks:
-		_vm->_timeout->lose_timer(_vm->_timeout->reason_avariciustalks);
+		_vm->_timeout->lose_timer(_vm->_timeout->kReasonAvariciusTalks);
 		 _vm->_gyro->_dna._avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
 		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
 			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
-			_vm->_timeout->lose_timer(_vm->_timeout->reason_drawbridgefalls);
+			_vm->_timeout->lose_timer(_vm->_timeout->kReasonDrawbridgeFalls);
 		}
 		break;
 	case r__outsidecardiffcastle:
-		_vm->_timeout->lose_timer(_vm->_timeout->reason_cardiffsurvey);
+		_vm->_timeout->lose_timer(_vm->_timeout->kReasonCardiffsurvey);
 		break;
 	case r__robins:
-		_vm->_timeout->lose_timer(_vm->_timeout->reason_getting_tied_up);
+		_vm->_timeout->lose_timer(_vm->_timeout->kReasonGettingTiedUp);
 		break;
 	}
 
@@ -436,7 +436,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
+			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->kReasonArkataShouts);
 		}
 		break;
 
@@ -464,7 +464,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(8, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(4);
-				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
+				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
 		}
@@ -472,7 +472,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsidespludwicks:
 		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
-			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->reason_explosion);
+			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->kReasonExplosion);
 			_vm->_gyro->_dna._spludwickAtHome = true;
 		}
 		break;
@@ -527,7 +527,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
+			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->kReasonCwytalotInHerts);
 		}
 		break;
 
@@ -548,7 +548,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(6, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
+				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->kReasonGettingTiedUp);
 			}
 		}
 
@@ -572,7 +572,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
+				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->kReasonCardiffsurvey);
 			}
 			break;
 			case 5 :
@@ -582,7 +582,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 3);
 				_vm->_animation->tr[1]._facingDir = Animation::kDirRight;
-				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
+				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->kReasonCardiffsurvey);
 			}
 			}
 		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
@@ -650,10 +650,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
+			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->kReasonDuLustieTalks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
-			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->reason_du_lustie_talks);
+			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->kReasonDuLustieTalks);
 
 		if (_vm->_gyro->_dna._geidaFollows) {
 			putGeidaAt(5, ped);
@@ -1190,7 +1190,7 @@ void Lucerna::gameOver() {
 	_vm->_animation->tr[0]._stepNum = 0;
 	_vm->_animation->tr[0].appear(sx, sy, 0);
 
-	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
+	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->kReasonFallingOver);
 	_vm->_gyro->_alive = false;
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 133372d..62f2fe3 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -219,7 +219,7 @@ void Scrolls::scrollModeMusic() {
 		setReadyLight(0);
 		_vm->_gyro->_seeScroll = false;
 
-		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->reason_jacques_waking_up);
+		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->kReasonJacquesWakingUp);
 		warning("STUB: Scrolls::music_scroll()");
 		return;
 #if 0
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 66a9519..e233b13 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -69,8 +69,8 @@ void Sequence::thenFlip(byte where, byte ped) {
 }
 
 void Sequence::startToClose() {
-	_vm->_timeout->lose_timer(_vm->_timeout->reason_sequencer);
-	_vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->reason_sequencer);
+	_vm->_timeout->lose_timer(_vm->_timeout->kReasonSequencer);
+	_vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->kReasonSequencer);
 }
 
 void Sequence::startToOpen() {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index bd136d5..df2ba94 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -229,7 +229,7 @@ void Timeout::open_drawbridge() {
 	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 	else
-		set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
+		set_up_timer(7, procopen_drawbridge, kReasonDrawbridgeFalls);
 }
 
 void Timeout::avaricius_talks() {
@@ -237,7 +237,7 @@ void Timeout::avaricius_talks() {
 	_vm->_gyro->_dna._avariciusTalk++;
 
 	if (_vm->_gyro->_dna._avariciusTalk < 17)
-		set_up_timer(177, procavaricius_talks, reason_avariciustalks);
+		set_up_timer(177, procavaricius_talks, kReasonAvariciusTalks);
 	else
 		_vm->_lucerna->incScore(3);
 }
@@ -246,7 +246,7 @@ void Timeout::urinate() {
 	_vm->_animation->tr[0].turn(Animation::kDirUp);
 	_vm->_animation->stopWalking();
 	_vm->_lucerna->drawDirection();
-	set_up_timer(14, proctoilet2, reason_gototoilet);
+	set_up_timer(14, proctoilet2, kReasonGoToToilet);
 }
 
 void Timeout::toilet2() {
@@ -255,7 +255,7 @@ void Timeout::toilet2() {
 
 void Timeout::bang() {
 	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
-	set_up_timer(30, procbang2, reason_explosion);
+	set_up_timer(30, procbang2, kReasonExplosion);
 }
 
 void Timeout::bang2() {
@@ -282,7 +282,7 @@ void Timeout::cardiff_survey() {
 
 	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
 
-	set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
+	set_up_timer(182, proccardiffsurvey, kReasonCardiffsurvey);
 }
 
 void Timeout::cardiff_return() {
@@ -303,7 +303,7 @@ void Timeout::get_tied_up() {
 	_vm->_animation->tr[1].stophoming();
 	_vm->_animation->tr[1]._callEachStepFl = true;
 	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
-	set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
+	set_up_timer(70, procget_tied_up2, kReasonGettingTiedUp);
 }
 
 void Timeout::get_tied_up2() {
@@ -320,7 +320,7 @@ void Timeout::hang_around() {
 	_vm->_animation->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
 	_vm->_animation->tr[0].walkto(7);
-	set_up_timer(55, prochang_around2, reason_hanging_around);
+	set_up_timer(55, prochang_around2, kReasonHangingAround);
 }
 
 void Timeout::hang_around2() {
@@ -332,7 +332,7 @@ void Timeout::hang_around2() {
 	_vm->_animation->tr[0].done();
 	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
-	set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
+	set_up_timer(1, procafter_the_shootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
 
 	_vm->_gyro->_dna._tiedUp = false;
@@ -406,10 +406,10 @@ void Timeout::jacques_wakes_up() {
 	case 1:
 	case 2:
 	case 3:
-		set_up_timer(12, procjacques_wakes_up, reason_jacques_waking_up);
+		set_up_timer(12, procjacques_wakes_up, kReasonJacquesWakingUp);
 		break;
 	case 4:
-		set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
+		set_up_timer(24, procjacques_wakes_up, kReasonJacquesWakingUp);
 		break;
 	}
 }
@@ -424,14 +424,14 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 
-	set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
+	set_up_timer(50, procnaughty_duke2, kReasonNaughtyDuke);
 }
 
 void Timeout::naughty_duke2() {
 	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
 	_vm->_animation->tr[1].walkto(1); // Walk to the door.
 	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
-	set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
+	set_up_timer(32, procnaughty_duke3, kReasonNaughtyDuke);
 }
 
 void Timeout::naughty_duke3() {
@@ -466,7 +466,7 @@ void Timeout::jump() {
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		_vm->_gyro->_dna._jumpStatus = 0;
 	} else { // Still jumping.
-		set_up_timer(1, procjump, reason_jumping);
+		set_up_timer(1, procjump, kReasonJumping);
 	}
 
 	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
@@ -532,7 +532,7 @@ void Timeout::fall_down_oubliette() {
 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
 	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
 	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
-	set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
+	set_up_timer(3, procfall_down_oubliette, kReasonFallingDownOubliette);
 }
 
 void Timeout::meet_avaroid() {
@@ -543,7 +543,7 @@ void Timeout::meet_avaroid() {
 	} else {
 		_vm->_visa->dixi('Q', 60);
 		_vm->_gyro->_dna._metAvaroid = true;
-		set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
+		set_up_timer(1, procrise_up_oubliette, kReasonRisingUpOubliette);
 
 		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
 		_vm->_animation->tr[0]._x = 151;
@@ -559,7 +559,7 @@ void Timeout::rise_up_oubliette() {
 	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
 	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
 	if (_vm->_animation->tr[0]._moveY > 0)
-		set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
+		set_up_timer(3, procrise_up_oubliette, kReasonRisingUpOubliette);
 	else
 		_vm->_gyro->_dna._userMovesAvvy = true;
 }
@@ -570,7 +570,7 @@ void Timeout::robin_hood_and_geida() {
 	_vm->_animation->tr[0].walkto(6);
 	_vm->_animation->tr[1].stopWalk();
 	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
-	set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
+	set_up_timer(20, procrobin_hood_and_geida_talk, kReasonRobinHoodAndGeida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
 
@@ -580,7 +580,7 @@ void Timeout::robin_hood_and_geida_talk() {
 	_vm->_animation->tr[1].walkto(2);
 	_vm->_animation->tr[0]._vanishIfStill = true;
 	_vm->_animation->tr[1]._vanishIfStill = true;
-	set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
+	set_up_timer(162, procavalot_returns, kReasonRobinHoodAndGeida);
 }
 
 void Timeout::avalot_returns() {
@@ -595,7 +595,7 @@ void Timeout::avalot_returns() {
 void Timeout::avvy_sit_down() {
 // This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
 	if (_vm->_animation->tr[0]._homing)    // Still walking.
-		set_up_timer(1, procavvy_sit_down, reason_sitting_down);
+		set_up_timer(1, procavvy_sit_down, kReasonSittingDown);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_dna._sittingInPub = true;
@@ -615,7 +615,7 @@ void Timeout::arkata_shouts() {
 
 	_vm->_visa->dixi('q', 76);
 
-	set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
+	set_up_timer(160, procarkata_shouts, kReasonArkataShouts);
 }
 
 void Timeout::winning() {
@@ -638,7 +638,7 @@ void Timeout::winning() {
 void Timeout::avalot_falls() {
 	if (_vm->_animation->tr[0]._stepNum < 5) {
 		_vm->_animation->tr[0]._stepNum++;
-		set_up_timer(3, procavalot_falls, reason_falling_over);
+		set_up_timer(3, procavalot_falls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay;
 		for (byte i = 0; i < 6; i++)
@@ -652,9 +652,9 @@ void Timeout::avalot_falls() {
 
 void Timeout::spludwick_goes_to_cauldron() {
 	if (_vm->_animation->tr[1]._homing)
-		set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
+		set_up_timer(1, procspludwick_goes_to_cauldron, kReasonSpludWalk);
 	else
-		set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
+		set_up_timer(17, procspludwick_leaves_cauldron, kReasonSpludWalk);
 }
 
 void Timeout::spludwick_leaves_cauldron() {


Commit: f783f2c28a13e9513ec6a0fc0fccac22d3502d2d
    https://github.com/scummvm/scummvm/commit/f783f2c28a13e9513ec6a0fc0fccac22d3502d2d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T01:31:54-07:00

Commit Message:
AVALANCHE: Silent some CppCheck warnings, rename some loop variables

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 127fbf9..6b6138c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -184,11 +184,8 @@ bool AnimationType::checkCollision() {
 }
 
 void AnimationType::walk() {
-	byte tc;
-	ByteField r;
-
-
 	if (_visible) {
+		ByteField r;
 		r._x1 = (_x / 8) - 1;
 		if (r._x1 == 255)
 			r._x1 = 0;
@@ -204,8 +201,8 @@ void AnimationType::walk() {
 		_oldY[_tr->_vm->_gyro->_cp] = _y;
 		if (_homing)
 			homestep();
-		_x = _x + _moveX;
-		_y = _y + _moveY;
+		_x += _moveX;
+		_y += _moveY;
 	}
 
 	if (_doCheck) {
@@ -214,7 +211,7 @@ void AnimationType::walk() {
 			return;
 		}
 
-		tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		byte tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
@@ -475,11 +472,8 @@ void Animation::loadtrip() {
 }
 
 byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	byte a, c;
-	int16 fv, ff;
-
 	// if not alive then begin checkfeet:=0; exit; end;
-	a = 0;
+	byte a = 0;
 
 	//setactivepage(2);
 	if (x1 < 0)
@@ -487,17 +481,17 @@ byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	if (x2 > 639)
 		x2 = 639;
 	if (oy < y) {
-		for (fv = x1; fv <= x2; fv++) {
-			for (ff = oy + yl; ff <= y + yl; ff++) {
-				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
+		for (int16 i = x1; i <= x2; i++) {
+			for (int16 j = oy + yl; j <= y + yl; j++) {
+				byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
 				if (c > a)
 					a = c;
 			}
 		}
 	} else {
-		for (fv = x1; fv <= x2; fv++) {
-			for (ff = y + yl; ff <= oy + yl; ff++) {
-				c = *(byte *)_vm->_graphics->_magics.getBasePtr(fv, ff);
+		for (int16 i = x1; i <= x2; i++) {
+			for (int16 j = y + yl; j <= oy + yl; j++) {
+				byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
 				if (c > a)
 					a = c;
 			}
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 39c6f08..97b823e 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -117,13 +117,12 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 
 	SaveStateList saveList;
 	char slot[3];
-	int slotNum = 0;
 	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
 		slot[0] = filename->c_str()[filename->size() - 6];
 		slot[1] = filename->c_str()[filename->size() - 5];
 		slot[2] = '\0';
 		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
-		slotNum = atoi(slot);
+		int slotNum = atoi(slot);
 		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
 			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
 			if (file) {
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 74d0a25..33a2671 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -168,9 +168,8 @@ void MenuItem::wipe() {
 }
 
 void MenuItem::moveHighlight(int8 inc) {
-	int8 highlightNum;
 	if (inc != 0) {
-		highlightNum = _highlightNum + inc;
+		int8 highlightNum = _highlightNum + inc;
 		if ((highlightNum < 0) || (highlightNum >= _optionNum))
 			return;
 		_highlightNum = highlightNum;
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index e522254..3ebb47e 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -53,7 +53,7 @@ void Pingo::bossKey() {
 const
 	months : array[0..11] of char = 'JFMAMJJASOND';
 	title = 'Net Profits';
-	fish = #224; { à }
+	fish = 224; // 'à'
 var fv:byte; gd,gm:int16; r:char;
 begin;
 	dusk; delavvy;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 62f2fe3..c79002a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -356,7 +356,8 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
 
-	ex = mx - lx;
+//	CHECKME: unused?
+//	ex = mx - lx;
 //	int16 ey = my - ly;
 	mx -= lx;
 	my -= ly + 2;
@@ -466,7 +467,7 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 		if (textWidth > xl)
 			xl = textWidth;
 	}
-	xl = xl / 2;
+	xl /= 2;
 
 	int16 xw = xl + 18;
 	int16 yw = yl + 7;
@@ -505,7 +506,8 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
 
 
-	yl -= 3;
+	// CHECKME: Unused?
+	// yl -= 3;
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 66f1faf..b31b64b 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -43,6 +43,7 @@ namespace Avalanche {
 
 Visa::Visa(AvalancheEngine *vm) {
 	_vm = vm;
+	noError = true;
 }
 
 void Visa::unskrimble() {
@@ -77,7 +78,7 @@ void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 
 	indexfile.close();
 
-	went_ok = !error;
+	noError = !error;
 
 	if (error) {
 		if (report) {
@@ -106,7 +107,6 @@ void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 
 void Visa::speech(byte who, byte subject) {
 	Common::File indexfile, sezfile;
-	uint16 idx_offset, sez_offset, next_idx_offset;
 
 	if (subject == 0) {
 		// No subject.
@@ -114,7 +114,7 @@ void Visa::speech(byte who, byte subject) {
 	} else {
 		// Subject given.
 
-		went_ok = false; // Assume that until we know otherwise.
+		noError = false; // Assume that until we know otherwise.
 
 		if (!indexfile.open("converse.avd")) {
 			warning("AVALANCHE: Visa: File not found: converse.avd");
@@ -122,13 +122,14 @@ void Visa::speech(byte who, byte subject) {
 		}
 
 		indexfile.seek(who * 2 - 2);
-		idx_offset = indexfile.readUint16LE();
-		next_idx_offset = indexfile.readUint16LE();
+		uint16 idx_offset = indexfile.readUint16LE();
+		uint16 next_idx_offset = indexfile.readUint16LE();
 
-		if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))  return;
+		if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
+			return;
 
 		indexfile.seek(idx_offset + subject * 2);
-		sez_offset = indexfile.readUint16LE();
+		uint16 sez_offset = indexfile.readUint16LE();
 		if ((sez_offset == 0) || (indexfile.err()))
 			return;
 		indexfile.close();
@@ -146,7 +147,7 @@ void Visa::speech(byte who, byte subject) {
 		do_the_bubble();
 
 		_vm->_scrolls->callScrollDriver();
-		went_ok = true;
+		noError = true;
 	}
 
 	warning("STUB: Visa::speech()");
@@ -263,7 +264,7 @@ void Visa::talkto(byte whom) {
 
 	speech(whom, _vm->_gyro->_subjectNum);
 
-	if (!went_ok)
+	if (!noError)
 		dixi('n', whom); // File not found!
 
 	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index 9d26d7a..2d12e33 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -44,7 +44,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	bool went_ok;
+	bool noError;
 	void unskrimble();
 	void do_the_bubble();
 	void speech(byte who, byte subject);


Commit: 8a4a5b3c56d86e846617f03703a8003dba2936ef
    https://github.com/scummvm/scummvm/commit/8a4a5b3c56d86e846617f03703a8003dba2936ef
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T01:48:22-07:00

Commit Message:
AVALANCHE: Renaming in timeout2.h

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index bdbb617..2b223b7 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -379,7 +379,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
 
-	_vm->_timeout->lose_timer(_vm->_timeout->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
+	_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
 	case 1:
@@ -419,7 +419,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	}
 
 	if (interrogation < 4)
-		_vm->_timeout->cardiff_survey();
+		_vm->_timeout->cardiffSurvey();
 }
 
 
@@ -1041,7 +1041,7 @@ void Acci::notInOrder() {
 
 void Acci::goToCauldron() {
 	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timeout->set_up_timer(1, _vm->_timeout->procspludwick_goes_to_cauldron, _vm->_timeout->kReasonSpludWalk);
+	_vm->_timeout->addTimer(1, _vm->_timeout->kProcSpludwickGoesToCauldron, _vm->_timeout->kReasonSpludWalk);
 	_vm->_animation->tr[1].walkto(2);
 }
 
@@ -1143,7 +1143,7 @@ void Acci::standUp() {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
-			_vm->_timeout->lose_timer(_vm->_timeout->kReasonArkataShouts);
+			_vm->_timeout->loseTimer(_vm->_timeout->kReasonArkataShouts);
 		} else
 			already();
 		break;
@@ -1242,7 +1242,7 @@ void Acci::giveGeidaTheLute() {
 	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->dixi('q', 64); // She plays it.
 
-	_vm->_timeout->set_up_timer(1, _vm->_timeout->procgive_lute_to_geida, _vm->_timeout->kReasonGeidaSings);
+	_vm->_timeout->addTimer(1, _vm->_timeout->kProcGiveLuteToGeida, _vm->_timeout->kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
 }
 
@@ -1259,7 +1259,7 @@ void Acci::winSequence() {
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
 	_vm->_sequence->startToClose();
-	_vm->_timeout->set_up_timer(30, _vm->_timeout->procwinning, _vm->_timeout->kReasonWinning);
+	_vm->_timeout->addTimer(30, _vm->_timeout->kProcWinning, _vm->_timeout->kReasonWinning);
 }
 
 void Acci::personSpeaks() {
@@ -1682,7 +1682,7 @@ void Acci::doThat() {
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timeout->set_up_timer(4, _vm->_timeout->procurinate, _vm->_timeout->kReasonGoToToilet);
+			_vm->_timeout->addTimer(4, _vm->_timeout->kProcUrinate, _vm->_timeout->kReasonGoToToilet);
 		} else
 			_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
 			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
@@ -1706,7 +1706,7 @@ void Acci::doThat() {
 					_vm->_animation->tr[1]._callEachStepFl = true;
 					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
-					_vm->_timeout->set_up_timer(177, _vm->_timeout->procavaricius_talks, _vm->_timeout->kReasonAvariciusTalks);
+					_vm->_timeout->addTimer(177, _vm->_timeout->kProcAvariciusTalks, _vm->_timeout->kReasonAvariciusTalks);
 				}
 			} else
 				_vm->_scrolls->displayText("Nothing appears to happen...");
@@ -1769,7 +1769,7 @@ void Acci::doThat() {
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 					_vm->_gyro->_dna._malagauche = 177;
-					_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuydrinks, _vm->_timeout->kReasonDrinks);
+					_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyDrinks, _vm->_timeout->kReasonDrinks);
 					break;
 				case 52:
 					examine();
@@ -1795,7 +1795,7 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->_dna._malagauche = 177;
 
-						_vm->_timeout->set_up_timer(27, _vm->_timeout->procbuywine, _vm->_timeout->kReasonDrinks);
+						_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyWine, _vm->_timeout->kReasonDrinks);
 					}
 					break;
 				}
@@ -1892,7 +1892,7 @@ void Acci::doThat() {
 				else {
 					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->displayText("The drawbridge opens!");
-					_vm->_timeout->set_up_timer(7, _vm->_timeout->procopen_drawbridge, _vm->_timeout->kReasonDrawbridgeFalls);
+					_vm->_timeout->addTimer(7, _vm->_timeout->kProcOpenDrawbridge, _vm->_timeout->kReasonDrawbridgeFalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
@@ -1944,7 +1944,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procjump, _vm->_timeout->kReasonJumping);
+		_vm->_timeout->addTimer(1, _vm->_timeout->kProcJump, _vm->_timeout->kReasonJumping);
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
@@ -1985,7 +1985,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
-				_vm->_timeout->set_up_timer(1, _vm->_timeout->procavvy_sit_down, _vm->_timeout->kReasonSittingDown);
+				_vm->_timeout->addTimer(1, _vm->_timeout->kProcAvvySitDown, _vm->_timeout->kReasonSittingDown);
 			}
 		} else { // Default doodah.
 			_vm->_lucerna->dusk();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 127fbf9..7fbcf89 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -840,7 +840,7 @@ void Animation::catamove(byte ped) {
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Animation::dawndelay() {
-	_vm->_timeout->set_up_timer(2, _vm->_timeout->procdawn_delay, _vm->_timeout->kReasonDawndelay);
+	_vm->_timeout->addTimer(2, _vm->_timeout->kProcDawnDelay, _vm->_timeout->kReasonDawndelay);
 }
 
 void Animation::call_special(uint16 which) {
@@ -849,7 +849,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->_dna._brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->kReasonBrummieStairs);
+		_vm->_timeout->addTimer(10, _vm->_timeout->kProcStairs, _vm->_timeout->kReasonBrummieStairs);
 		stopWalking();
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
@@ -883,7 +883,7 @@ void Animation::call_special(uint16 which) {
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
 		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->kReasonGhostRoomPhew);
+		_vm->_timeout->addTimer(1, _vm->_timeout->kProcGhostRoomPhew, _vm->_timeout->kReasonGhostRoomPhew);
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
@@ -901,7 +901,7 @@ void Animation::call_special(uint16 which) {
 			tr[1]._vanishIfStill = true;
 			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
-			_vm->_timeout->set_up_timer(364, _vm->_timeout->prochang_around, _vm->_timeout->kReasonHangingAround);
+			_vm->_timeout->addTimer(364, _vm->_timeout->kProcHangAround, _vm->_timeout->kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
@@ -909,17 +909,17 @@ void Animation::call_special(uint16 which) {
 		tr[0]._moveX = 3;
 		tr[0]._moveY = 0;
 		tr[0]._facingDir = kDirRight;
-		_vm->_timeout->set_up_timer(1, _vm->_timeout->procfall_down_oubliette, _vm->_timeout->kReasonFallingDownOubliette);
+		_vm->_timeout->addTimer(1, _vm->_timeout->kProcFallDownOubliette, _vm->_timeout->kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0]._visible = false;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		stopWalking();
-		_vm->_timeout->lose_timer(_vm->_timeout->kReasonFallingDownOubliette);
+		_vm->_timeout->loseTimer(_vm->_timeout->kReasonFallingDownOubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->kReasonMeetingAvaroid);
+		_vm->_timeout->addTimer(200, _vm->_timeout->kProcMeetAvaroid, _vm->_timeout->kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
@@ -937,7 +937,7 @@ void Animation::call_special(uint16 which) {
 		tr[1].walkto(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_timeout->set_up_timer(40, _vm->_timeout->procrobin_hood_and_geida, _vm->_timeout->kReasonRobinHoodAndGeida);
+		_vm->_timeout->addTimer(40, _vm->_timeout->kProcRobinHoodAndGeida, _vm->_timeout->kReasonRobinHoodAndGeida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
 		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
@@ -1223,7 +1223,7 @@ void Animation::arrow_procs(byte tripnum) {
 			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
-			_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->kReasonNaughtyDuke);
+			_vm->_timeout->addTimer(55, _vm->_timeout->kProcNaughtyDuke, _vm->_timeout->kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		tr[tripnum].done(); // Deallocate the arrow.
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3439165..6d921ce 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -335,9 +335,9 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
 	for (byte i = 0; i < 7; i++) {
-		sz.syncAsSint32LE(_timeout->times[i].time_left);
-		sz.syncAsByte(_timeout->times[i].then_where);
-		sz.syncAsByte(_timeout->times[i].what_for);
+		sz.syncAsSint32LE(_timeout->_times[i]._timeLeft);
+		sz.syncAsByte(_timeout->_times[i]._thenWhere);
+		sz.syncAsByte(_timeout->_times[i]._whatFor);
 	}
 
 	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ee805ef..052619c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -205,7 +205,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
-		_vm->_timeout->one_tick();
+		_vm->_timeout->updateTimer();
 
 
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a6c6286..07fe6b4 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -340,21 +340,21 @@ void Lucerna::exitRoom(byte x) {
 
 	switch (x) {
 	case r__spludwicks:
-		_vm->_timeout->lose_timer(_vm->_timeout->kReasonAvariciusTalks);
+		_vm->_timeout->loseTimer(_vm->_timeout->kReasonAvariciusTalks);
 		 _vm->_gyro->_dna._avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
 		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
 			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
-			_vm->_timeout->lose_timer(_vm->_timeout->kReasonDrawbridgeFalls);
+			_vm->_timeout->loseTimer(_vm->_timeout->kReasonDrawbridgeFalls);
 		}
 		break;
 	case r__outsidecardiffcastle:
-		_vm->_timeout->lose_timer(_vm->_timeout->kReasonCardiffsurvey);
+		_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey);
 		break;
 	case r__robins:
-		_vm->_timeout->lose_timer(_vm->_timeout->kReasonGettingTiedUp);
+		_vm->_timeout->loseTimer(_vm->_timeout->kReasonGettingTiedUp);
 		break;
 	}
 
@@ -436,7 +436,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->kReasonArkataShouts);
+			_vm->_timeout->addTimer(100, _vm->_timeout->kProcArkataShouts, _vm->_timeout->kReasonArkataShouts);
 		}
 		break;
 
@@ -464,7 +464,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(8, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(4);
-				_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
+				_vm->_timeout->addTimer(20, _vm->_timeout->kProcCrapulusSpludOut, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
 		}
@@ -472,7 +472,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsidespludwicks:
 		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
-			_vm->_timeout->set_up_timer(20, _vm->_timeout->procbang, _vm->_timeout->kReasonExplosion);
+			_vm->_timeout->addTimer(20, _vm->_timeout->kProcBang, _vm->_timeout->kReasonExplosion);
 			_vm->_gyro->_dna._spludwickAtHome = true;
 		}
 		break;
@@ -527,7 +527,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->kReasonCwytalotInHerts);
+			_vm->_timeout->addTimer(20, _vm->_timeout->kProcCwytalotInHerts, _vm->_timeout->kReasonCwytalotInHerts);
 		}
 		break;
 
@@ -548,7 +548,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(6, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->kReasonGettingTiedUp);
+				_vm->_timeout->addTimer(36, _vm->_timeout->kProcGetTiedUp, _vm->_timeout->kReasonGettingTiedUp);
 			}
 		}
 
@@ -572,7 +572,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->kReasonCardiffsurvey);
+				_vm->_timeout->addTimer(47, _vm->_timeout->kProcCardiffSurvey, _vm->_timeout->kReasonCardiffsurvey);
 			}
 			break;
 			case 5 :
@@ -582,7 +582,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 3);
 				_vm->_animation->tr[1]._facingDir = Animation::kDirRight;
-				_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->kReasonCardiffsurvey);
+				_vm->_timeout->addTimer(3, _vm->_timeout->kProcCardiffReturn, _vm->_timeout->kReasonCardiffsurvey);
 			}
 			}
 		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
@@ -650,10 +650,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->kReasonDuLustieTalks);
+			_vm->_timeout->addTimer(3, _vm->_timeout->kProcCallsGuards, _vm->_timeout->kReasonDuLustieTalks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
-			_vm->_timeout->set_up_timer(3, _vm->_timeout->procgreetsmonk, _vm->_timeout->kReasonDuLustieTalks);
+			_vm->_timeout->addTimer(3, _vm->_timeout->kProcGreetsMonk, _vm->_timeout->kReasonDuLustieTalks);
 
 		if (_vm->_gyro->_dna._geidaFollows) {
 			putGeidaAt(5, ped);
@@ -1190,7 +1190,7 @@ void Lucerna::gameOver() {
 	_vm->_animation->tr[0]._stepNum = 0;
 	_vm->_animation->tr[0].appear(sx, sy, 0);
 
-	_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->kReasonFallingOver);
+	_vm->_timeout->addTimer(3, _vm->_timeout->kProcAvalotFalls, _vm->_timeout->kReasonFallingOver);
 	_vm->_gyro->_alive = false;
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 62f2fe3..3c9fbef 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -219,7 +219,7 @@ void Scrolls::scrollModeMusic() {
 		setReadyLight(0);
 		_vm->_gyro->_seeScroll = false;
 
-		_vm->_timeout->set_up_timer(8, _vm->_timeout->procjacques_wakes_up, _vm->_timeout->kReasonJacquesWakingUp);
+		_vm->_timeout->addTimer(8, _vm->_timeout->kProcJacquesWakesUp, _vm->_timeout->kReasonJacquesWakingUp);
 		warning("STUB: Scrolls::music_scroll()");
 		return;
 #if 0
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index e233b13..8f8a3db 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -69,8 +69,8 @@ void Sequence::thenFlip(byte where, byte ped) {
 }
 
 void Sequence::startToClose() {
-	_vm->_timeout->lose_timer(_vm->_timeout->kReasonSequencer);
-	_vm->_timeout->set_up_timer(7, _vm->_timeout->procsequence, _vm->_timeout->kReasonSequencer);
+	_vm->_timeout->loseTimer(_vm->_timeout->kReasonSequencer);
+	_vm->_timeout->addTimer(7, _vm->_timeout->kProcSequence, _vm->_timeout->kReasonSequencer);
 }
 
 void Sequence::startToOpen() {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index df2ba94..5a73db2 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -47,163 +47,163 @@ Timeout::Timeout(AvalancheEngine *vm) {
 	_vm = vm;
 
 	for (byte i = 0; i < 7; i++) {
-		times[i].time_left = 0;
-		times[i].then_where = 0;
-		times[i].what_for = 0;
+		_times[i]._timeLeft = 0;
+		_times[i]._thenWhere = 0;
+		_times[i]._whatFor = 0;
 	}
 }
 
-void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
-	if ((_vm->_gyro->isLoaded == false) || (timerLost == true)) {
+void Timeout::addTimer(int32 howlong, byte whither, byte why) {
+	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
 		byte i = 0;
-		while ((i < 7) && (times[i].time_left != 0))
+		while ((i < 7) && (_times[i]._timeLeft != 0))
 			i++;
 
 		if (i == 7)
 			return; // Oh dear...
 
 		// Everything's OK here!
-		times[i].time_left = howlong;
-		times[i].then_where = whither;
-		times[i].what_for = why;
+		_times[i]._timeLeft = howlong;
+		_times[i]._thenWhere = whither;
+		_times[i]._whatFor = why;
 	} else {
 		_vm->_gyro->isLoaded = false;
 		return;
 	}
 }
 
-void Timeout::one_tick() {
+void Timeout::updateTimer() {
 	if (_vm->_gyro->_dropdownActive)
 		return;
 
 	for (byte fv = 0; fv < 7; fv++) {
-		if (times[fv].time_left > 0) {
-			times[fv].time_left--;
+		if (_times[fv]._timeLeft > 0) {
+			_times[fv]._timeLeft--;
 
-			if (times[fv].time_left == 0) {
-				switch (times[fv].then_where) {
-				case procopen_drawbridge :
-					open_drawbridge();
+			if (_times[fv]._timeLeft == 0) {
+				switch (_times[fv]._thenWhere) {
+				case kProcOpenDrawbridge :
+					openDrawbridge();
 					break;
-				case procavaricius_talks :
-					avaricius_talks();
+				case kProcAvariciusTalks :
+					avariciusTalks();
 					break;
-				case procurinate :
+				case kProcUrinate :
 					urinate();
 					break;
-				case proctoilet2 :
-					toilet2();
+				case kProcToilet :
+					toilet();
 					break;
-				case procbang:
+				case kProcBang:
 					bang();
 					break;
-				case procbang2:
+				case kProcBang2:
 					bang2();
 					break;
-				case procstairs:
+				case kProcStairs:
 					stairs();
 					break;
-				case proccardiffsurvey:
-					cardiff_survey();
+				case kProcCardiffSurvey:
+					cardiffSurvey();
 					break;
-				case proccardiff_return:
-					cardiff_return();
+				case kProcCardiffReturn:
+					cardiffReturn();
 					break;
-				case proc_cwytalot_in_herts:
-					cwytalot_in_herts();
+				case kProcCwytalotInHerts:
+					cwytalotInHerts();
 					break;
-				case procget_tied_up:
-					get_tied_up();
+				case kProcGetTiedUp:
+					getTiedUp();
 					break;
-				case procget_tied_up2:
-					get_tied_up2();
+				case kProcGetTiedUp2:
+					getTiedUp2();
 					break;
-				case prochang_around:
-					hang_around();
+				case kProcHangAround:
+					hangAround();
 					break;
-				case prochang_around2:
-					hang_around2();
+				case kProcHangAround2:
+					hangAround2();
 					break;
-				case procafter_the_shootemup:
-					after_the_shootemup();
+				case kProcAfterTheShootemup:
+					afterTheShootemup();
 					break;
-				case procjacques_wakes_up:
-					jacques_wakes_up();
+				case kProcJacquesWakesUp:
+					jacquesWakesUp();
 					break;
-				case procnaughty_duke:
-					naughty_duke();
+				case kProcNaughtyDuke:
+					naughtyDuke();
 					break;
-				case procnaughty_duke2:
-					naughty_duke2();
+				case kProcNaughtyDuke2:
+					naughtyDuke2();
 					break;
-				case procnaughty_duke3:
-					naughty_duke3();
+				case kProcNaughtyDuke3:
+					naughtyDuke3();
 					break;
-				case procjump:
+				case kProcJump:
 					jump();
 					break;
-				case procsequence:
+				case kProcSequence:
 					_vm->_sequence->callSequencer();
 					break;
-				case proccrapulus_splud_out:
-					crapulus_says_splud_out();
+				case kProcCrapulusSpludOut:
+					crapulusSaysSpludOut();
 					break;
-				case procdawn_delay:
+				case kProcDawnDelay:
 					_vm->_lucerna->dawn();
 					break;
-				case procbuydrinks:
-					buydrinks();
+				case kProcBuyDrinks:
+					buyDrinks();
 					break;
-				case procbuywine:
-					buywine();
+				case kProcBuyWine:
+					buyWine();
 					break;
-				case proccallsguards:
-					callsguards();
+				case kProcCallsGuards:
+					callsGuards();
 					break;
-				case procgreetsmonk:
-					greetsmonk();
+				case kProcGreetsMonk:
+					greetsMonk();
 					break;
-				case procfall_down_oubliette:
-					fall_down_oubliette();
+				case kProcFallDownOubliette:
+					fallDownOubliette();
 					break;
-				case procmeet_avaroid:
-					meet_avaroid();
+				case kProcMeetAvaroid:
+					meetAvaroid();
 					break;
-				case procrise_up_oubliette:
-					rise_up_oubliette();
+				case kProcRiseUpOubliette:
+					riseUpOubliette();
 					break;
-				case procrobin_hood_and_geida:
-					robin_hood_and_geida();
+				case kProcRobinHoodAndGeida:
+					robinHoodAndGeida();
 					break;
-				case procrobin_hood_and_geida_talk:
-					robin_hood_and_geida_talk();
+				case kProcRobinHoodAndGeidaTalk:
+					robinHoodAndGeidaTalk();
 					break;
-				case procavalot_returns:
-					avalot_returns();
+				case kProcAvalotReturns:
+					avalotReturns();
 					break;
-				case procavvy_sit_down:
-					avvy_sit_down();
+				case kProcAvvySitDown:
+					avvySitDown();
 					break;
-				case procghost_room_phew:
-					ghost_room_phew();
+				case kProcGhostRoomPhew:
+					ghostRoomPhew();
 					break;
-				case procarkata_shouts:
-					arkata_shouts();
+				case kProcArkataShouts:
+					arkataShouts();
 					break;
-				case procwinning:
+				case kProcWinning:
 					winning();
 					break;
-				case procavalot_falls:
-					avalot_falls();
+				case kProcAvalotFalls:
+					avalotFalls();
 					break;
-				case procspludwick_goes_to_cauldron:
-					spludwick_goes_to_cauldron();
+				case kProcSpludwickGoesToCauldron:
+					spludwickGoesToCauldron();
 					break;
-				case procspludwick_leaves_cauldron:
-					spludwick_leaves_cauldron();
+				case kProcSpludwickLeavesCauldron:
+					spludwickLeavesCauldron();
 					break;
-				case procgive_lute_to_geida:
-					give_lute_to_geida();
+				case kProcGiveLuteToGeida:
+					giveLuteToGeida();
 					break;
 				}
 			}
@@ -213,31 +213,31 @@ void Timeout::one_tick() {
 	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
 }
 
-void Timeout::lose_timer(byte which) {
+void Timeout::loseTimer(byte which) {
 	for (byte fv = 0; fv < 7; fv++) {
-		if (times[fv].what_for == which)
-			times[fv].time_left = 0; // Cancel this one!
+		if (_times[fv]._whatFor == which)
+			_times[fv]._timeLeft = 0; // Cancel this one!
 	}
 
-	timerLost = true;
+	_timerLost = true;
 }
 
-void Timeout::open_drawbridge() {
+void Timeout::openDrawbridge() {
 	_vm->_gyro->_dna._drawbridgeOpen++;
 	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
 
 	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
 	else
-		set_up_timer(7, procopen_drawbridge, kReasonDrawbridgeFalls);
+		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
 
-void Timeout::avaricius_talks() {
+void Timeout::avariciusTalks() {
 	_vm->_visa->dixi('q', _vm->_gyro->_dna._avariciusTalk);
 	_vm->_gyro->_dna._avariciusTalk++;
 
 	if (_vm->_gyro->_dna._avariciusTalk < 17)
-		set_up_timer(177, procavaricius_talks, kReasonAvariciusTalks);
+		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
 	else
 		_vm->_lucerna->incScore(3);
 }
@@ -246,16 +246,16 @@ void Timeout::urinate() {
 	_vm->_animation->tr[0].turn(Animation::kDirUp);
 	_vm->_animation->stopWalking();
 	_vm->_lucerna->drawDirection();
-	set_up_timer(14, proctoilet2, kReasonGoToToilet);
+	addTimer(14, kProcToilet, kReasonGoToToilet);
 }
 
-void Timeout::toilet2() {
+void Timeout::toilet() {
 	_vm->_scrolls->displayText("That's better!");
 }
 
 void Timeout::bang() {
 	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
-	set_up_timer(30, procbang2, kReasonExplosion);
+	addTimer(30, kProcBang2, kReasonExplosion);
 }
 
 void Timeout::bang2() {
@@ -272,7 +272,7 @@ void Timeout::stairs() {
 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
-void Timeout::cardiff_survey() {
+void Timeout::cardiffSurvey() {
 	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
 		_vm->_gyro->_dna._cardiffQuestionNum++;
 		_vm->_visa->dixi('q', 27);
@@ -282,19 +282,19 @@ void Timeout::cardiff_survey() {
 
 	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
 
-	set_up_timer(182, proccardiffsurvey, kReasonCardiffsurvey);
+	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
-void Timeout::cardiff_return() {
+void Timeout::cardiffReturn() {
 	_vm->_visa->dixi('q', 28);
-	cardiff_survey(); // Add end of question.
+	cardiffSurvey(); // Add end of question.
 }
 
-void Timeout::cwytalot_in_herts() {
+void Timeout::cwytalotInHerts() {
 	_vm->_visa->dixi('q', 29);
 }
 
-void Timeout::get_tied_up() {
+void Timeout::getTiedUp() {
 	_vm->_visa->dixi('q', 34); // ...Trouble!
 	_vm->_gyro->_dna._userMovesAvvy = false;
 	_vm->_gyro->_dna._beenTiedUp = true;
@@ -303,27 +303,27 @@ void Timeout::get_tied_up() {
 	_vm->_animation->tr[1].stophoming();
 	_vm->_animation->tr[1]._callEachStepFl = true;
 	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
-	set_up_timer(70, procget_tied_up2, kReasonGettingTiedUp);
+	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
 }
 
-void Timeout::get_tied_up2() {
+void Timeout::getTiedUp2() {
 	_vm->_animation->tr[0].walkto(4);
 	_vm->_animation->tr[1].walkto(5);
 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
 
-void Timeout::hang_around() {
+void Timeout::hangAround() {
 	_vm->_animation->tr[1]._doCheck = false;
 	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->apped(1, 2);
 	_vm->_visa->dixi('q', 39);
 	_vm->_animation->tr[0].walkto(7);
-	set_up_timer(55, prochang_around2, kReasonHangingAround);
+	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
-void Timeout::hang_around2() {
+void Timeout::hangAround2() {
 	_vm->_visa->dixi('q', 40);
 	_vm->_animation->tr[1]._vanishIfStill = false;
 	_vm->_animation->tr[1].walkto(4);
@@ -332,7 +332,7 @@ void Timeout::hang_around2() {
 	_vm->_animation->tr[0].done();
 	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
-	set_up_timer(1, procafter_the_shootemup, kReasonHangingAround);
+	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
 
 	_vm->_gyro->_dna._tiedUp = false;
@@ -340,7 +340,7 @@ void Timeout::hang_around2() {
 	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
 }
 
-void Timeout::after_the_shootemup() {
+void Timeout::afterTheShootemup() {
 
 	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
@@ -376,7 +376,7 @@ void Timeout::after_the_shootemup() {
 	_vm->_visa->dixi('q', 70);
 }
 
-void Timeout::jacques_wakes_up() {
+void Timeout::jacquesWakesUp() {
 	_vm->_gyro->_dna._jacquesState++;
 
 	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
@@ -406,15 +406,15 @@ void Timeout::jacques_wakes_up() {
 	case 1:
 	case 2:
 	case 3:
-		set_up_timer(12, procjacques_wakes_up, kReasonJacquesWakingUp);
+		addTimer(12, kProcJacquesWakesUp, kReasonJacquesWakingUp);
 		break;
 	case 4:
-		set_up_timer(24, procjacques_wakes_up, kReasonJacquesWakingUp);
+		addTimer(24, kProcJacquesWakesUp, kReasonJacquesWakingUp);
 		break;
 	}
 }
 
-void Timeout::naughty_duke() { // This is when the Duke comes in and takes your money.
+void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your money.
 	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
 	_vm->_animation->apped(2, 1); // He starts at the door...
 	_vm->_animation->tr[1].walkto(3); // He walks over to you.
@@ -424,17 +424,17 @@ void Timeout::naughty_duke() { // This is when the Duke comes in and takes your
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 
-	set_up_timer(50, procnaughty_duke2, kReasonNaughtyDuke);
+	addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
 }
 
-void Timeout::naughty_duke2() {
+void Timeout::naughtyDuke2() {
 	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
 	_vm->_animation->tr[1].walkto(1); // Walk to the door.
 	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
-	set_up_timer(32, procnaughty_duke3, kReasonNaughtyDuke);
+	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
 
-void Timeout::naughty_duke3() {
+void Timeout::naughtyDuke3() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
@@ -466,7 +466,7 @@ void Timeout::jump() {
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		_vm->_gyro->_dna._jumpStatus = 0;
 	} else { // Still jumping.
-		set_up_timer(1, procjump, kReasonJumping);
+		addTimer(1, kProcJump, kReasonJumping);
 	}
 
 	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
@@ -487,12 +487,12 @@ void Timeout::jump() {
 	}
 }
 
-void Timeout::crapulus_says_splud_out() {
+void Timeout::crapulusSaysSpludOut() {
 	_vm->_visa->dixi('q', 56);
 	_vm->_gyro->_dna._crapulusWillTell = false;
 }
 
-void Timeout::buydrinks() {
+void Timeout::buyDrinks() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_dna._malagauche = 0;
 
@@ -504,7 +504,7 @@ void Timeout::buydrinks() {
 	_vm->_acci->drink();
 }
 
-void Timeout::buywine() {
+void Timeout::buyWine() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_dna._malagauche = 0;
 
@@ -518,24 +518,24 @@ void Timeout::buywine() {
 	}
 }
 
-void Timeout::callsguards() {
+void Timeout::callsGuards() {
 	_vm->_visa->dixi('Q', 58); // "GUARDS!!!"
 	_vm->_lucerna->gameOver();
 }
 
-void Timeout::greetsmonk() {
+void Timeout::greetsMonk() {
 	_vm->_visa->dixi('Q', 59);
 	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
 }
 
-void Timeout::fall_down_oubliette() {
+void Timeout::fallDownOubliette() {
 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
 	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
 	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
-	set_up_timer(3, procfall_down_oubliette, kReasonFallingDownOubliette);
+	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
 }
 
-void Timeout::meet_avaroid() {
+void Timeout::meetAvaroid() {
 	if (_vm->_gyro->_dna._metAvaroid) {
 		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
@@ -543,7 +543,7 @@ void Timeout::meet_avaroid() {
 	} else {
 		_vm->_visa->dixi('Q', 60);
 		_vm->_gyro->_dna._metAvaroid = true;
-		set_up_timer(1, procrise_up_oubliette, kReasonRisingUpOubliette);
+		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
 		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
 		_vm->_animation->tr[0]._x = 151;
@@ -554,36 +554,36 @@ void Timeout::meet_avaroid() {
 	}
 }
 
-void Timeout::rise_up_oubliette() {
+void Timeout::riseUpOubliette() {
 	_vm->_animation->tr[0]._visible = true;
 	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
 	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
 	if (_vm->_animation->tr[0]._moveY > 0)
-		set_up_timer(3, procrise_up_oubliette, kReasonRisingUpOubliette);
+		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
 		_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
-void Timeout::robin_hood_and_geida() {
+void Timeout::robinHoodAndGeida() {
 	_vm->_animation->tr[0].init(7, true, _vm->_animation);
 	_vm->_animation->apped(1, 7);
 	_vm->_animation->tr[0].walkto(6);
 	_vm->_animation->tr[1].stopWalk();
 	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
-	set_up_timer(20, procrobin_hood_and_geida_talk, kReasonRobinHoodAndGeida);
+	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
 
-void Timeout::robin_hood_and_geida_talk() {
+void Timeout::robinHoodAndGeidaTalk() {
 	_vm->_visa->dixi('q', 66);
 	_vm->_animation->tr[0].walkto(2);
 	_vm->_animation->tr[1].walkto(2);
 	_vm->_animation->tr[0]._vanishIfStill = true;
 	_vm->_animation->tr[1]._vanishIfStill = true;
-	set_up_timer(162, procavalot_returns, kReasonRobinHoodAndGeida);
+	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
 }
 
-void Timeout::avalot_returns() {
+void Timeout::avalotReturns() {
 	_vm->_animation->tr[0].done();
 	_vm->_animation->tr[1].done();
 	_vm->_animation->tr[0].init(0, true, _vm->_animation);
@@ -592,10 +592,10 @@ void Timeout::avalot_returns() {
 	_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
-void Timeout::avvy_sit_down() {
+void Timeout::avvySitDown() {
 // This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
 	if (_vm->_animation->tr[0]._homing)    // Still walking.
-		set_up_timer(1, procavvy_sit_down, kReasonSittingDown);
+		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_dna._sittingInPub = true;
@@ -604,18 +604,18 @@ void Timeout::avvy_sit_down() {
 	}
 }
 
-void Timeout::ghost_room_phew() {
+void Timeout::ghostRoomPhew() {
 	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
 		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
 }
 
-void Timeout::arkata_shouts() {
+void Timeout::arkataShouts() {
 	if (_vm->_gyro->_dna._teetotal)
 		return;
 
 	_vm->_visa->dixi('q', 76);
 
-	set_up_timer(160, procarkata_shouts, kReasonArkataShouts);
+	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
 }
 
 void Timeout::winning() {
@@ -635,10 +635,10 @@ void Timeout::winning() {
 	_vm->_gyro->_letMeOut = true;
 }
 
-void Timeout::avalot_falls() {
+void Timeout::avalotFalls() {
 	if (_vm->_animation->tr[0]._stepNum < 5) {
 		_vm->_animation->tr[0]._stepNum++;
-		set_up_timer(3, procavalot_falls, kReasonFallingOver);
+		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay;
 		for (byte i = 0; i < 6; i++)
@@ -650,18 +650,18 @@ void Timeout::avalot_falls() {
 	}
 }
 
-void Timeout::spludwick_goes_to_cauldron() {
+void Timeout::spludwickGoesToCauldron() {
 	if (_vm->_animation->tr[1]._homing)
-		set_up_timer(1, procspludwick_goes_to_cauldron, kReasonSpludWalk);
+		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
 	else
-		set_up_timer(17, procspludwick_leaves_cauldron, kReasonSpludWalk);
+		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
 }
 
-void Timeout::spludwick_leaves_cauldron() {
+void Timeout::spludwickLeavesCauldron() {
 	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
 }
 
-void Timeout::give_lute_to_geida() { // Moved here from Acci.
+void Timeout::giveLuteToGeida() { // Moved here from Acci.
 	_vm->_visa->dixi('Q', 86);
 	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_dna._lustieIsAsleep = true;
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index 8536fef..a2223e7 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -69,156 +69,110 @@ public:
 		kReasonGeidaSings = 28
 	};
 
-	// procx now runs between 1 and 41.
-
-	static const int16 procopen_drawbridge = 3;
-	static const int16 procavaricius_talks = 4;
-	static const int16 procurinate = 5;
-	static const int16 proctoilet2 = 6;
-	static const int16 procbang = 7;
-	static const int16 procbang2 = 8;
-	static const int16 procstairs = 9;
-	static const int16 proccardiffsurvey = 10;
-	static const int16 proccardiff_return = 11;
-	static const int16 proc_cwytalot_in_herts = 12;
-	static const int16 procget_tied_up = 13;
-	static const int16 procget_tied_up2 = 1;
-	static const int16 prochang_around = 14;
-	static const int16 prochang_around2 = 15;
-	static const int16 procafter_the_shootemup = 32;
-	static const int16 procjacques_wakes_up = 16;
-	static const int16 procnaughty_duke = 17;
-	static const int16 procnaughty_duke2 = 18;
-	static const int16 procnaughty_duke3 = 38;
-	static const int16 procjump = 19;
-	static const int16 procsequence = 20;
-	static const int16 proccrapulus_splud_out = 21;
-	static const int16 procdawn_delay = 22;
-	static const int16 procbuydrinks = 23;
-	static const int16 procbuywine = 24;
-	static const int16 proccallsguards = 25;
-	static const int16 procgreetsmonk = 26;
-	static const int16 procfall_down_oubliette = 27;
-	static const int16 procmeet_avaroid = 28;
-	static const int16 procrise_up_oubliette = 29;
-	static const int16 procrobin_hood_and_geida = 2;
-	static const int16 procrobin_hood_and_geida_talk = 30;
-	static const int16 procavalot_returns = 31;
-	static const int16 procavvy_sit_down = 33; // In Nottingham.
-	static const int16 procghost_room_phew = 34;
-	static const int16 procarkata_shouts = 35;
-	static const int16 procwinning = 36;
-	static const int16 procavalot_falls = 37;
-	static const int16 procspludwick_goes_to_cauldron = 39;
-	static const int16 procspludwick_leaves_cauldron = 40;
-	static const int16 procgive_lute_to_geida = 41;
-
-	struct timetype {
-		int32 time_left;
-		byte then_where;
-		byte what_for;
+	// Proc runs between 1 and 41.
+	enum Proc {
+		kProcOpenDrawbridge = 3,
+		kProcAvariciusTalks = 4,
+		kProcUrinate = 5,
+		kProcToilet = 6,
+		kProcBang = 7,
+		kProcBang2 = 8,
+		kProcStairs = 9,
+		kProcCardiffSurvey = 10,
+		kProcCardiffReturn = 11,
+		kProcCwytalotInHerts = 12,
+		kProcGetTiedUp = 13,
+		kProcGetTiedUp2 = 1,
+		kProcHangAround = 14,
+		kProcHangAround2 = 15,
+		kProcAfterTheShootemup = 32,
+		kProcJacquesWakesUp = 16,
+		kProcNaughtyDuke = 17,
+		kProcNaughtyDuke2 = 18,
+		kProcNaughtyDuke3 = 38,
+		kProcJump = 19,
+		kProcSequence = 20,
+		kProcCrapulusSpludOut = 21,
+		kProcDawnDelay = 22,
+		kProcBuyDrinks = 23,
+		kProcBuyWine = 24,
+		kProcCallsGuards = 25,
+		kProcGreetsMonk = 26,
+		kProcFallDownOubliette = 27,
+		kProcMeetAvaroid = 28,
+		kProcRiseUpOubliette = 29,
+		kProcRobinHoodAndGeida = 2,
+		kProcRobinHoodAndGeidaTalk = 30,
+		kProcAvalotReturns = 31,
+		kProcAvvySitDown = 33, // In Nottingham.
+		kProcGhostRoomPhew = 34,
+		kProcArkataShouts = 35,
+		kProcWinning = 36,
+		kProcAvalotFalls = 37,
+		kProcSpludwickGoesToCauldron = 39,
+		kProcSpludwickLeavesCauldron = 40,
+		kProcGiveLuteToGeida = 41
 	};
 
+	struct TimeType {
+		int32 _timeLeft;
+		byte _thenWhere;
+		byte _whatFor;
+	};
 
-
-	timetype times[7];
-
-	bool timerLost; // Is the timer "lost"? (Because of using lose_timer())
-
-
+	TimeType _times[7];
+	bool _timerLost; // Is the timer "lost"? (Because of using loseTimer())
 
 	Timeout(AvalancheEngine *vm);
 
-	void setParent(AvalancheEngine *vm);
-
-	void set_up_timer(int32 howlong, byte whither, byte why);
-
-	void one_tick();
-
-	void lose_timer(byte which);
+	void addTimer(int32 howlong, byte whither, byte why); // Original: set_up_timer()
+	void updateTimer(); // Original: one_tick()
+	void loseTimer(byte which);
 
 	// Procedures to do things at the end of amounts of time:
-
-	void open_drawbridge();
-
-	void avaricius_talks();
-
+	void openDrawbridge();
+	void avariciusTalks();
 	void urinate();
-
-	void toilet2();
-
+	void toilet();
 	void bang();
-
 	void bang2();
-
 	void stairs();
-
-	void cardiff_survey();
-
-	void cardiff_return();
-
-	void cwytalot_in_herts();
-
-	void get_tied_up();
-
-	void get_tied_up2();
-
-	void hang_around();
-
-	void hang_around2();
-
-	void after_the_shootemup();
-
-	void jacques_wakes_up();
-
-	void naughty_duke();
-
-	void naughty_duke2();
-
-	void naughty_duke3();
-
+	void cardiffSurvey();
+	void cardiffReturn();
+	void cwytalotInHerts();
+	void getTiedUp();
+	void getTiedUp2();
+	void hangAround();
+	void hangAround2();
+	void afterTheShootemup();
+	void jacquesWakesUp();
+	void naughtyDuke();
+	void naughtyDuke2();
+	void naughtyDuke3();
 	void jump();
-
-	void crapulus_says_splud_out();
-
-	void buydrinks();
-
-	void buywine();
-
-	void callsguards();
-
-	void greetsmonk();
-
-	void fall_down_oubliette();
-
-	void meet_avaroid();
-
-	void rise_up_oubliette();
-
-	void robin_hood_and_geida();
-
-	void robin_hood_and_geida_talk();
-
-	void avalot_returns();
-
-	void avvy_sit_down();
-
-	void ghost_room_phew();
-
-	void arkata_shouts();
-
+	void crapulusSaysSpludOut();
+	void buyDrinks();
+	void buyWine();
+	void callsGuards();
+	void greetsMonk();
+	void fallDownOubliette();
+	void meetAvaroid();
+	void riseUpOubliette();
+	void robinHoodAndGeida();
+	void robinHoodAndGeidaTalk();
+	void avalotReturns();
+	void avvySitDown();
+	void ghostRoomPhew();
+	void arkataShouts();
 	void winning();
-
-	void avalot_falls();
-
-	void spludwick_goes_to_cauldron();
-
-	void spludwick_leaves_cauldron();
-
-	void give_lute_to_geida();
+	void avalotFalls();
+	void spludwickGoesToCauldron();
+	void spludwickLeavesCauldron();
+	void giveLuteToGeida();
 
 private:
 	AvalancheEngine *_vm;
+
 };
 
 } // End of namespace Avalanche.


Commit: db6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9
    https://github.com/scummvm/scummvm/commit/db6fcd5e9b61af93e89d4147d9b75ac5bae3cdf9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T01:49:01-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h





Commit: 21ff074fda6d6c3e2f62a9dc0993fd0ef0c375c7
    https://github.com/scummvm/scummvm/commit/21ff074fda6d6c3e2f62a9dc0993fd0ef0c375c7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T01:53:33-07:00

Commit Message:
AVALANCHE: Fix uninitialized variable in TimeOut

Changed paths:
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 5a73db2..fe1bba5 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -51,6 +51,7 @@ Timeout::Timeout(AvalancheEngine *vm) {
 		_times[i]._thenWhere = 0;
 		_times[i]._whatFor = 0;
 	}
+	_timerLost = false;
 }
 
 void Timeout::addTimer(int32 howlong, byte whither, byte why) {


Commit: 26099360a9cb39dc7670585dc927e86c7078e5bd
    https://github.com/scummvm/scummvm/commit/26099360a9cb39dc7670585dc927e86c7078e5bd
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T01:57:44-07:00

Commit Message:
AVALANCHE: Renaming/refactoring in Visa.

Changed paths:
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index b31b64b..8eaa1da 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -38,7 +38,6 @@
 
 #include "common/textconsole.h"
 
-
 namespace Avalanche {
 
 Visa::Visa(AvalancheEngine *vm) {
@@ -46,17 +45,17 @@ Visa::Visa(AvalancheEngine *vm) {
 	noError = true;
 }
 
-void Visa::unskrimble() {
-	for (uint16  fv = 0; fv < _vm->_gyro->_bufSize; fv++)
-		_vm->_gyro->_buffer[fv] = (~(_vm->_gyro->_buffer[fv] - (fv + 1))) % 256;
+void Visa::unSkrimble() {
+	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
+		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
 }
 
-void Visa::do_the_bubble() {
+void Visa::doTheBubble() {
 	_vm->_gyro->_bufSize++;
 	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
 }
 
-void Visa::dixi(char block, byte point, bool report, bool bubbling) {
+void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling) {
 	Common::File indexfile, sezfile;
 	uint16 idx_offset, sez_offset;
 	bool error = false;
@@ -97,23 +96,20 @@ void Visa::dixi(char block, byte point, bool report, bool bubbling) {
 	_vm->_gyro->_bufSize = sezfile.readUint16LE();
 	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
 	sezfile.close();
-	unskrimble();
+	unSkrimble();
 
 	if (bubbling)
-		do_the_bubble();
+		doTheBubble();
 
 	_vm->_scrolls->callScrollDriver();
 }
 
-void Visa::speech(byte who, byte subject) {
+void Visa::speak(byte who, byte subject) {
 	Common::File indexfile, sezfile;
 
-	if (subject == 0) {
-		// No subject.
-		dixi('s', who, false, true);
-	} else {
-		// Subject given.
-
+	if (subject == 0) { // No subject.
+		displayScrollChain('s', who, false, true);
+	} else { // Subject given.
 		noError = false; // Assume that until we know otherwise.
 
 		if (!indexfile.open("converse.avd")) {
@@ -143,19 +139,15 @@ void Visa::speech(byte who, byte subject) {
 		sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
 		sezfile.close();
 
-		unskrimble();
-		do_the_bubble();
+		unSkrimble();
+		doTheBubble();
 
 		_vm->_scrolls->callScrollDriver();
 		noError = true;
 	}
-
-	warning("STUB: Visa::speech()");
 }
 
-void Visa::talkto(byte whom) {
-	bool no_matches;
-
+void Visa::talkTo(byte whom) {
 	if (_vm->_acci->_person == _vm->_acci->kPardon) {
 		_vm->_acci->_person = _vm->_gyro->_subjectNum;
 		_vm->_gyro->_subjectNum = 0;
@@ -165,7 +157,7 @@ void Visa::talkto(byte whom) {
 		switch (whom) {
 		case Gyro::kPeopleSpludwick:
 			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) {
-				dixi('q', 68);
+				displayScrollChain('q', 68);
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_lucerna->incScore(3);
@@ -182,61 +174,61 @@ void Visa::talkto(byte whom) {
 						}
 						break;
 					case 3: {
-						dixi('q', 30); // Need any help with the game?
+						displayScrollChain('q', 30); // Need any help with the game?
 						return;
 						}
 						break;
 				}
 				else {
-					dixi('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+					displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
 					return;
 				}
 			}
 			break;
 		case Gyro::kPeopleIbythneth:
 			if (_vm->_gyro->_dna._givenBadgeToIby) {
-				dixi('q', 33); // Thanks a lot!
+				displayScrollChain('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
 		case Gyro::kPeopleDogfood:
 			if (_vm->_gyro->_dna._wonNim) { // We've won the game.
-				dixi('q', 6); // "I'm Not Playing!"
+				displayScrollChain('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
 				_vm->_gyro->_dna._askedDogfoodAboutNim = true;
 			break;
 		case Gyro::kPeopleAyles:
 			if (!_vm->_gyro->_dna._aylesIsAwake) {
-				dixi('q', 43); // He's fast asleep!
+				displayScrollChain('q', 43); // He's fast asleep!
 				return;
 			} else if (!_vm->_gyro->_dna._givenPenToAyles) {
-				dixi('q', 44); // Can you get me a pen, Avvy?
+				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
 				return;
 			}
 			break;
 
 		case Gyro::kPeopleJacques: {
-			dixi('q', 43);
+			displayScrollChain('q', 43);
 			return;
 			}
 		case Gyro::kPeopleGeida:
 			if (_vm->_gyro->_dna._givenPotionToGeida)
 				_vm->_gyro->_dna._geidaFollows = true;
 			else {
-				dixi('u', 17);
+				displayScrollChain('u', 17);
 				return;
 			}
 			break;
 		case Gyro::kPeopleSpurge:
 			if (!_vm->_gyro->_dna._sittingInPub) {
-				dixi('q', 71); // Try going over and sitting down.
+				displayScrollChain('q', 71); // Try going over and sitting down.
 				return;
 			} else {
 				if (_vm->_gyro->_dna._spurgeTalkCount < 5)
 					_vm->_gyro->_dna._spurgeTalkCount++;
 				if (_vm->_gyro->_dna._spurgeTalkCount > 1) { // no. 1 falls through
-					dixi('q', 70 + _vm->_gyro->_dna._spurgeTalkCount);
+					displayScrollChain('q', 70 + _vm->_gyro->_dna._spurgeTalkCount);
 					return;
 				}
 			}
@@ -244,33 +236,33 @@ void Visa::talkto(byte whom) {
 	}
 	// On a subject. Is there any reason to block it?
 	else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
-			dixi('q', 43); // He's fast asleep!
+			displayScrollChain('q', 43); // He's fast asleep!
 			return;
 		}
 
 	if (whom > 149)
 		whom -= 149;
 
-	no_matches = true;
+	bool noMatches = true;
 	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
 		if (_vm->_animation->tr[i]._stat.accinum == whom) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
-			no_matches = false;
+			noMatches = false;
 			break;
 		}
 
-	if (no_matches)
+	if (noMatches)
 		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
 
-	speech(whom, _vm->_gyro->_subjectNum);
+	speak(whom, _vm->_gyro->_subjectNum);
 
 	if (!noError)
-		dixi('n', whom); // File not found!
+		displayScrollChain('n', whom); // File not found!
 
 	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = true;
 		_vm->_lucerna->refreshObjectList();
-		dixi('q', 1); // Circular from Cardiff.
+		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_gyro->_dna._talkedToCrapulus = true;
 
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index 2d12e33..7a1597c 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -38,16 +38,17 @@ class AvalancheEngine;
 class Visa {
 public:
 	Visa(AvalancheEngine *vm);
-	void dixi(char block, byte point, bool report = true, bool bubbling = false);
-	void talkto(byte whom);
+
+	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false); // Original: dixi().
+	void talkTo(byte whom);
 
 private:
 	AvalancheEngine *_vm;
 
 	bool noError;
-	void unskrimble();
-	void do_the_bubble();
-	void speech(byte who, byte subject);
+	void unSkrimble();
+	void doTheBubble();
+	void speak(byte who, byte subject); // Original: speech().
 };
 
 } // End of namespace Avalanche.


Commit: b9c14ccb087801c6d40ee568e51921e62f8a1db2
    https://github.com/scummvm/scummvm/commit/b9c14ccb087801c6d40ee568e51921e62f8a1db2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T02:14:00-07:00

Commit Message:
AVALANCHE: Some more renaming in Timeout. Add some Doxygen comments

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/timeout2.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6d921ce..2e7b7f3 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -336,8 +336,8 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
 	for (byte i = 0; i < 7; i++) {
 		sz.syncAsSint32LE(_timeout->_times[i]._timeLeft);
-		sz.syncAsByte(_timeout->_times[i]._thenWhere);
-		sz.syncAsByte(_timeout->_times[i]._whatFor);
+		sz.syncAsByte(_timeout->_times[i]._action);
+		sz.syncAsByte(_timeout->_times[i]._reason);
 	}
 
 	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index fe1bba5..fb73ce5 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -48,165 +48,174 @@ Timeout::Timeout(AvalancheEngine *vm) {
 
 	for (byte i = 0; i < 7; i++) {
 		_times[i]._timeLeft = 0;
-		_times[i]._thenWhere = 0;
-		_times[i]._whatFor = 0;
+		_times[i]._action = 0;
+		_times[i]._reason = 0;
 	}
 	_timerLost = false;
 }
 
-void Timeout::addTimer(int32 howlong, byte whither, byte why) {
+/**
+ * Add a nex timer
+ * @remarks	Originally called 'set_up_timer'
+ */
+void Timeout::addTimer(int32 duration, byte action, byte reason) {
 	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
 		byte i = 0;
 		while ((i < 7) && (_times[i]._timeLeft != 0))
 			i++;
 
 		if (i == 7)
-			return; // Oh dear...
+			return; // Oh dear... No timer left
 
 		// Everything's OK here!
-		_times[i]._timeLeft = howlong;
-		_times[i]._thenWhere = whither;
-		_times[i]._whatFor = why;
+		_times[i]._timeLeft = duration;
+		_times[i]._action = action;
+		_times[i]._reason = reason;
 	} else {
 		_vm->_gyro->isLoaded = false;
 		return;
 	}
 }
 
+/**
+ * Update the timers
+ * @remarks	Originally called 'one_tick'
+ */
 void Timeout::updateTimer() {
 	if (_vm->_gyro->_dropdownActive)
 		return;
 
-	for (byte fv = 0; fv < 7; fv++) {
-		if (_times[fv]._timeLeft > 0) {
-			_times[fv]._timeLeft--;
-
-			if (_times[fv]._timeLeft == 0) {
-				switch (_times[fv]._thenWhere) {
-				case kProcOpenDrawbridge :
-					openDrawbridge();
-					break;
-				case kProcAvariciusTalks :
-					avariciusTalks();
-					break;
-				case kProcUrinate :
-					urinate();
-					break;
-				case kProcToilet :
-					toilet();
-					break;
-				case kProcBang:
-					bang();
-					break;
-				case kProcBang2:
-					bang2();
-					break;
-				case kProcStairs:
-					stairs();
-					break;
-				case kProcCardiffSurvey:
-					cardiffSurvey();
-					break;
-				case kProcCardiffReturn:
-					cardiffReturn();
-					break;
-				case kProcCwytalotInHerts:
-					cwytalotInHerts();
-					break;
-				case kProcGetTiedUp:
-					getTiedUp();
-					break;
-				case kProcGetTiedUp2:
-					getTiedUp2();
-					break;
-				case kProcHangAround:
-					hangAround();
-					break;
-				case kProcHangAround2:
-					hangAround2();
-					break;
-				case kProcAfterTheShootemup:
-					afterTheShootemup();
-					break;
-				case kProcJacquesWakesUp:
-					jacquesWakesUp();
-					break;
-				case kProcNaughtyDuke:
-					naughtyDuke();
-					break;
-				case kProcNaughtyDuke2:
-					naughtyDuke2();
-					break;
-				case kProcNaughtyDuke3:
-					naughtyDuke3();
-					break;
-				case kProcJump:
-					jump();
-					break;
-				case kProcSequence:
-					_vm->_sequence->callSequencer();
-					break;
-				case kProcCrapulusSpludOut:
-					crapulusSaysSpludOut();
-					break;
-				case kProcDawnDelay:
-					_vm->_lucerna->dawn();
-					break;
-				case kProcBuyDrinks:
-					buyDrinks();
-					break;
-				case kProcBuyWine:
-					buyWine();
-					break;
-				case kProcCallsGuards:
-					callsGuards();
-					break;
-				case kProcGreetsMonk:
-					greetsMonk();
-					break;
-				case kProcFallDownOubliette:
-					fallDownOubliette();
-					break;
-				case kProcMeetAvaroid:
-					meetAvaroid();
-					break;
-				case kProcRiseUpOubliette:
-					riseUpOubliette();
-					break;
-				case kProcRobinHoodAndGeida:
-					robinHoodAndGeida();
-					break;
-				case kProcRobinHoodAndGeidaTalk:
-					robinHoodAndGeidaTalk();
-					break;
-				case kProcAvalotReturns:
-					avalotReturns();
-					break;
-				case kProcAvvySitDown:
-					avvySitDown();
-					break;
-				case kProcGhostRoomPhew:
-					ghostRoomPhew();
-					break;
-				case kProcArkataShouts:
-					arkataShouts();
-					break;
-				case kProcWinning:
-					winning();
-					break;
-				case kProcAvalotFalls:
-					avalotFalls();
-					break;
-				case kProcSpludwickGoesToCauldron:
-					spludwickGoesToCauldron();
-					break;
-				case kProcSpludwickLeavesCauldron:
-					spludwickLeavesCauldron();
-					break;
-				case kProcGiveLuteToGeida:
-					giveLuteToGeida();
-					break;
-				}
+	for (byte i = 0; i < 7; i++) {
+		if (_times[i]._timeLeft <= 0)
+			continue;
+
+		_times[i]._timeLeft--;
+
+		if (_times[i]._timeLeft == 0) {
+			switch (_times[i]._action) {
+			case kProcOpenDrawbridge :
+				openDrawbridge();
+				break;
+			case kProcAvariciusTalks :
+				avariciusTalks();
+				break;
+			case kProcUrinate :
+				urinate();
+				break;
+			case kProcToilet :
+				toilet();
+				break;
+			case kProcBang:
+				bang();
+				break;
+			case kProcBang2:
+				bang2();
+				break;
+			case kProcStairs:
+				stairs();
+				break;
+			case kProcCardiffSurvey:
+				cardiffSurvey();
+				break;
+			case kProcCardiffReturn:
+				cardiffReturn();
+				break;
+			case kProcCwytalotInHerts:
+				cwytalotInHerts();
+				break;
+			case kProcGetTiedUp:
+				getTiedUp();
+				break;
+			case kProcGetTiedUp2:
+				getTiedUp2();
+				break;
+			case kProcHangAround:
+				hangAround();
+				break;
+			case kProcHangAround2:
+				hangAround2();
+				break;
+			case kProcAfterTheShootemup:
+				afterTheShootemup();
+				break;
+			case kProcJacquesWakesUp:
+				jacquesWakesUp();
+				break;
+			case kProcNaughtyDuke:
+				naughtyDuke();
+				break;
+			case kProcNaughtyDuke2:
+				naughtyDuke2();
+				break;
+			case kProcNaughtyDuke3:
+				naughtyDuke3();
+				break;
+			case kProcJump:
+				jump();
+				break;
+			case kProcSequence:
+				_vm->_sequence->callSequencer();
+				break;
+			case kProcCrapulusSpludOut:
+				crapulusSaysSpludOut();
+				break;
+			case kProcDawnDelay:
+				_vm->_lucerna->dawn();
+				break;
+			case kProcBuyDrinks:
+				buyDrinks();
+				break;
+			case kProcBuyWine:
+				buyWine();
+				break;
+			case kProcCallsGuards:
+				callsGuards();
+				break;
+			case kProcGreetsMonk:
+				greetsMonk();
+				break;
+			case kProcFallDownOubliette:
+				fallDownOubliette();
+				break;
+			case kProcMeetAvaroid:
+				meetAvaroid();
+				break;
+			case kProcRiseUpOubliette:
+				riseUpOubliette();
+				break;
+			case kProcRobinHoodAndGeida:
+				robinHoodAndGeida();
+				break;
+			case kProcRobinHoodAndGeidaTalk:
+				robinHoodAndGeidaTalk();
+				break;
+			case kProcAvalotReturns:
+				avalotReturns();
+				break;
+			case kProcAvvySitDown:
+				avvySitDown();
+				break;
+			case kProcGhostRoomPhew:
+				ghostRoomPhew();
+				break;
+			case kProcArkataShouts:
+				arkataShouts();
+				break;
+			case kProcWinning:
+				winning();
+				break;
+			case kProcAvalotFalls:
+				avalotFalls();
+				break;
+			case kProcSpludwickGoesToCauldron:
+				spludwickGoesToCauldron();
+				break;
+			case kProcSpludwickLeavesCauldron:
+				spludwickLeavesCauldron();
+				break;
+			case kProcGiveLuteToGeida:
+				giveLuteToGeida();
+				break;
 			}
 		}
 	}
@@ -215,9 +224,9 @@ void Timeout::updateTimer() {
 }
 
 void Timeout::loseTimer(byte which) {
-	for (byte fv = 0; fv < 7; fv++) {
-		if (_times[fv]._whatFor == which)
-			_times[fv]._timeLeft = 0; // Cancel this one!
+	for (byte i = 0; i < 7; i++) {
+		if (_times[i]._reason == which)
+			_times[i]._timeLeft = 0; // Cancel this one!
 	}
 
 	_timerLost = true;
@@ -280,9 +289,7 @@ void Timeout::cardiffSurvey() {
 	}
 
 	_vm->_visa->dixi('z', _vm->_gyro->_dna._cardiffQuestionNum);
-
 	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
-
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
@@ -363,7 +370,7 @@ void Timeout::afterTheShootemup() {
 	gain = (shootscore + 5) / 10; // Rounding up.
 
 	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
-		strf(shootscore) + " ö 10) = " + strf(gain) + " points.");
+		strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points.");
 
 	if (gain > 20) {
 		display("But we won't let you have more than 20 points!");
@@ -593,8 +600,12 @@ void Timeout::avalotReturns() {
 	_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
+/**
+ * This is used when you sit down in the pub in Notts. It loops around
+ * so that it will happen when Avvy stops walking.
+ * @remarks	Originally called 'avvy_sit_down'
+ */
 void Timeout::avvySitDown() {
-// This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
 	if (_vm->_animation->tr[0]._homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
@@ -615,14 +626,13 @@ void Timeout::arkataShouts() {
 		return;
 
 	_vm->_visa->dixi('q', 76);
-
 	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
 }
 
 void Timeout::winning() {
 	_vm->_visa->dixi('q', 79);
-
 	_vm->_pingo->winningPic();
+
 	warning("STUB: Timeout::winning()");
 #if 0
 	do {
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
index a2223e7..5f1769a 100644
--- a/engines/avalanche/timeout2.h
+++ b/engines/avalanche/timeout2.h
@@ -116,8 +116,8 @@ public:
 
 	struct TimeType {
 		int32 _timeLeft;
-		byte _thenWhere;
-		byte _whatFor;
+		byte _action;
+		byte _reason;
 	};
 
 	TimeType _times[7];
@@ -125,8 +125,8 @@ public:
 
 	Timeout(AvalancheEngine *vm);
 
-	void addTimer(int32 howlong, byte whither, byte why); // Original: set_up_timer()
-	void updateTimer(); // Original: one_tick()
+	void addTimer(int32 duration, byte action, byte reason);
+	void updateTimer();
 	void loseTimer(byte which);
 
 	// Procedures to do things at the end of amounts of time:


Commit: 1b25defe3417d8ff526a37b5448fe96b415626a5
    https://github.com/scummvm/scummvm/commit/1b25defe3417d8ff526a37b5448fe96b415626a5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T02:20:37-07:00

Commit Message:
AVALANCHE: Missing files from last commit...

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timeout2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2b223b7..3691ae9 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -406,7 +406,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		if (!_vm->_gyro->_dna._spareEvening.empty())
 			_vm->_gyro->_dna._spareEvening.clear();
 		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
-		_vm->_visa->dixi('z', 5); // His closing statement...
+		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->tr[1].walkto(4); // The end of the drawbridge
 		_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
@@ -625,24 +625,24 @@ void Acci::examineObject() {
 	case Gyro::kObjectWine :
 		switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
-			_vm->_visa->dixi('t', 1); // Normal examine wine scroll
+			_vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
 		case 2:
-			_vm->_visa->dixi('d', 6); // Bad wine
+			_vm->_visa->displayScrollChain('d', 6); // Bad wine
 			break;
 		case 3:
-			_vm->_visa->dixi('d', 7); // Vinegar
+			_vm->_visa->displayScrollChain('d', 7); // Vinegar
 			break;
 		}
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_dna._rottenOnion)
-			_vm->_visa->dixi('q', 21); // Yucky onion.
+			_vm->_visa->displayScrollChain('q', 21); // Yucky onion.
 		else
-			_vm->_visa->dixi('t', 18);  // Normal onion scroll
+			_vm->_visa->displayScrollChain('t', 18);  // Normal onion scroll
 		break;
 	default:
-		_vm->_visa->dixi('t', _thing); // <<< Ordinarily
+		_vm->_visa->displayScrollChain('t', _thing); // <<< Ordinarily
 	}
 }
 
@@ -667,24 +667,24 @@ void Acci::exampers() {
 		switch (_person) { // Special cases
 		case 11:
 			if (_vm->_gyro->_dna._wonNim) {
-				_vm->_visa->dixi('Q', 8); // "I'm Not Playing!"
+				_vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!"
 				return;
 			}
 			break;
 		case 99:
 			if (_vm->_gyro->_dna._lustieIsAsleep) {
-				_vm->_visa->dixi('Q', 65); // He's asleep. (65! Wow!)
+				_vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
 				return;
 			}
 			break;
 		}
 		// Otherwise...
-		_vm->_visa->dixi('p', _person);
+		_vm->_visa->displayScrollChain('p', _person);
 	}
 
 	// And afterwards...
 	if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake))
-		_vm->_visa->dixi('Q', 13);
+		_vm->_visa->displayScrollChain('Q', 13);
 }
 
 bool Acci::holding() {
@@ -770,43 +770,43 @@ void Acci::swallow() {   // Eat something.
 		switch (_vm->_gyro->_dna._wineState) { // 4 is perfect
 		case 1:
 			if (_vm->_gyro->_dna._teetotal)  {
-				_vm->_visa->dixi('D', 6);
+				_vm->_visa->displayScrollChain('D', 6);
 				return;
 			}
-			_vm->_visa->dixi('U', 1);
+			_vm->_visa->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
-			_vm->_visa->dixi('U', 2);
+			_vm->_visa->displayScrollChain('U', 2);
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
 		case 2:
 		case 3:
-			_vm->_visa->dixi('d', 8);
+			_vm->_visa->displayScrollChain('d', 8);
 			break; // You can't drink it!
 		}
 		break;
 	case Gyro::kObjectPotion:
 		_vm->_gyro->setBackgroundColor(4);
-		_vm->_visa->dixi('U', 3);
+		_vm->_visa->displayScrollChain('U', 3);
 		_vm->_lucerna->gameOver();
 		_vm->_gyro->setBackgroundColor(0);
 		break;
 	case Gyro::kObjectInk:
-		_vm->_visa->dixi('U', 4);
+		_vm->_visa->displayScrollChain('U', 4);
 		break;
 	case Gyro::kObjectChastity:
-		_vm->_visa->dixi('U', 5);
+		_vm->_visa->displayScrollChain('U', 5);
 		break;
 	case Gyro::kObjectMushroom:
-		_vm->_visa->dixi('U', 6);
+		_vm->_visa->displayScrollChain('U', 6);
 		_vm->_lucerna->gameOver();
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_dna._rottenOnion)
-			_vm->_visa->dixi('U', 11);
+			_vm->_visa->displayScrollChain('U', 11);
 		else {
-			_vm->_visa->dixi('U', 8);
+			_vm->_visa->displayScrollChain('U', 8);
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 		}
@@ -856,34 +856,34 @@ void Acci::lookAround() {
 	switch (_vm->_gyro->_dna._room) {
 	case r__spludwicks:
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
-			_vm->_visa->dixi('q', 23);
+			_vm->_visa->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case r__robins:
 		if (_vm->_gyro->_dna._tiedUp)
-			_vm->_visa->dixi('q', 38);
+			_vm->_visa->displayScrollChain('q', 38);
 		if (_vm->_gyro->_dna._mushroomGrowing)
-			_vm->_visa->dixi('q', 55);
+			_vm->_visa->displayScrollChain('q', 55);
 		break;
 	case r__insidecardiffcastle:
 		if (!_vm->_gyro->_dna._takenPen)
-			_vm->_visa->dixi('q', 49);
+			_vm->_visa->displayScrollChain('q', 49);
 		break;
 	case r__lustiesroom:
 		if (_vm->_gyro->_dna._lustieIsAsleep)
-			_vm->_visa->dixi('q', 65);
+			_vm->_visa->displayScrollChain('q', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) {
 		case 258 :
-			_vm->_visa->dixi('q', 80); // Inside art gallery.
+			_vm->_visa->displayScrollChain('q', 80); // Inside art gallery.
 			break;
 		case 514 :
-			_vm->_visa->dixi('q', 81); // Outside ditto.
+			_vm->_visa->displayScrollChain('q', 81); // Outside ditto.
 			break;
 		case 260 :
-			_vm->_visa->dixi('q', 82); // Outside Geida's room.
+			_vm->_visa->displayScrollChain('q', 82); // Outside Geida's room.
 			break;
 		}
 		break;
@@ -906,7 +906,7 @@ void Acci::openDoor() {
 		break;
 	case r__spludwicks:
 		if (_thing == 61) {
-			_vm->_visa->dixi('q', 85);
+			_vm->_visa->displayScrollChain('q', 85);
 			return;
 		}
 		break;
@@ -922,7 +922,7 @@ void Acci::openDoor() {
 			switch (_vm->_gyro->_portals[fv]._operation) {
 			case Gyro::kMagicExclaim:
 				_vm->_animation->tr[0].bounce();
-				_vm->_visa->dixi('x', _vm->_gyro->_portals[fv]._data);
+				_vm->_visa->displayScrollChain('x', _vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicTransport:
 				_vm->_animation->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
@@ -982,7 +982,7 @@ void Acci::putProc() {
 				else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_dna._onionInVinegar = true;
 					_vm->_lucerna->incScore(7);
-					_vm->_visa->dixi('u', 9);
+					_vm->_visa->displayScrollChain('u', 9);
 				}
 			}
 		} else
@@ -1059,10 +1059,10 @@ bool Acci::giveToSpludwick() {
 	case Gyro::kObjectOnion:
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
 		if (_vm->_gyro->_dna._rottenOnion)
-			_vm->_visa->dixi('q', 22);
+			_vm->_visa->displayScrollChain('q', 22);
 		else {
 			_vm->_gyro->_dna._givenToSpludwick++;
-			_vm->_visa->dixi('q', 20);
+			_vm->_visa->displayScrollChain('q', 20);
 			goToCauldron();
 			_vm->_lucerna->incScore(3);
 		}
@@ -1072,13 +1072,13 @@ bool Acci::giveToSpludwick() {
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = false;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._givenToSpludwick++;
-		_vm->_visa->dixi('q', 24);
+		_vm->_visa->displayScrollChain('q', 24);
 		goToCauldron();
 		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = false;
-		_vm->_visa->dixi('q', 25);
+		_vm->_visa->displayScrollChain('q', 25);
 		_vm->_lucerna->incScore(5);
 		_vm->_gyro->_dna._givenToSpludwick++;
 		goToCauldron();
@@ -1132,9 +1132,9 @@ void Acci::standUp() {
 	case r__yours: // Avvy isn't asleep.
 		if (_vm->_gyro->_dna._avvyIsAwake && _vm->_gyro->_dna._avvyInBed) {  // But he's in bed.
 			if (_vm->_gyro->_dna._teetotal) {
-				_vm->_visa->dixi('d', 12);
+				_vm->_visa->displayScrollChain('d', 12);
 				_vm->_gyro->setBackgroundColor(0);
-				_vm->_visa->dixi('d', 14);
+				_vm->_visa->displayScrollChain('d', 14);
 			}
 			_vm->_animation->tr[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
@@ -1183,7 +1183,7 @@ void Acci::getProc(char thing) {
 			} else
 				_vm->_scrolls->displayText(Common::String("I can't see ") + _vm->_gyro->getItem(thing) + " in the box.");
 		} else
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->displayScrollChain('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
@@ -1201,15 +1201,15 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->displayText("Taken.");
 				}
 			} else if (_vm->_gyro->_dna._standingOnDais)
-				_vm->_visa->dixi('q', 53);
+				_vm->_visa->displayScrollChain('q', 53);
 			else
-				_vm->_visa->dixi('q', 51);
+				_vm->_visa->displayScrollChain('q', 51);
 			break;
 		case Gyro::kObjectBolt:
-			_vm->_visa->dixi('q', 52);
+			_vm->_visa->displayScrollChain('q', 52);
 			break;
 		default:
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->displayScrollChain('q', 57);
 		}
 		break;
 	case r__robins:
@@ -1222,10 +1222,10 @@ void Acci::getProc(char thing) {
 			_vm->_lucerna->refreshObjectList();
 			_vm->_lucerna->incScore(3);
 		} else
-			_vm->_visa->dixi('q', 57);
+			_vm->_visa->displayScrollChain('q', 57);
 		break;
 	default:
-		_vm->_visa->dixi('q', 57);
+		_vm->_visa->displayScrollChain('q', 57);
 	}
 }
 
@@ -1240,7 +1240,7 @@ void Acci::giveGeidaTheLute() {
 	}
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
 	_vm->_lucerna->refreshObjectList();
-	_vm->_visa->dixi('q', 64); // She plays it.
+	_vm->_visa->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timeout->addTimer(1, _vm->_timeout->kProcGiveLuteToGeida, _vm->_timeout->kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
@@ -1254,7 +1254,7 @@ void Acci::playHarp() {
 }
 
 void Acci::winSequence() {
-	_vm->_visa->dixi('q', 78);
+	_vm->_visa->displayScrollChain('q', 78);
 	_vm->_sequence->firstShow(7);
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
@@ -1380,10 +1380,10 @@ void Acci::doThat() {
 				if ((_person == 0) || (_person == kPardon))
 					_vm->_scrolls->displayText("Talk to whom?");
 				else if (isPersonHere())
-					_vm->_visa->talkto(_person);
+					_vm->_visa->talkTo(_person);
 			}
 		} else if (isPersonHere())
-			_vm->_visa->talkto(_person);
+			_vm->_visa->talkTo(_person);
 		break;
 	case kVerbCodeGive:
 		if (holding()) {
@@ -1421,7 +1421,7 @@ void Acci::doThat() {
 						break;
 					case Gyro::kPeopleIbythneth:
 						if (_thing == _vm->_gyro->kObjectBadge) {
-							_vm->_visa->dixi('q', 32); // Thanks! Wow!
+							_vm->_visa->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_lucerna->incScore(3);
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = false;
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectHabit - 1] = true;
@@ -1435,7 +1435,7 @@ void Acci::doThat() {
 						if (_vm->_gyro->_dna._aylesIsAwake) {
 							if (_thing == _vm->_gyro->kObjectPen) {
 								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = false;
-								_vm->_visa->dixi('q', 54);
+								_vm->_visa->displayScrollChain('q', 54);
 								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = true;
 								_vm->_gyro->_dna._givenPenToAyles = true;
 								_vm->_lucerna->refreshObjectList();
@@ -1449,7 +1449,7 @@ void Acci::doThat() {
 						switch (_thing) {
 						case Gyro::kObjectPotion:
 							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = false;
-							_vm->_visa->dixi('u', 16); // She drinks it.
+							_vm->_visa->displayScrollChain('u', 16); // She drinks it.
 							_vm->_lucerna->incScore(2);
 							_vm->_gyro->_dna._givenPotionToGeida = true;
 							_vm->_lucerna->refreshObjectList();
@@ -1467,7 +1467,7 @@ void Acci::doThat() {
 							if (_vm->_gyro->_dna._givenPotionToGeida)
 								winSequence();
 							else
-								_vm->_visa->dixi('q', 77); // That Geida woman!
+								_vm->_visa->displayScrollChain('q', 77); // That Geida woman!
 							break;
 						default:
 							heyThanks();
@@ -1593,20 +1593,20 @@ void Acci::doThat() {
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
 					if (_vm->_gyro->_dna._wonNim) { // Already won the game.
-						_vm->_visa->dixi('Q', 6);
+						_vm->_visa->displayScrollChain('Q', 6);
 						return;
 					}
 
 					if (!_vm->_gyro->_dna._askedDogfoodAboutNim) {
-						_vm->_visa->dixi('q', 84);
+						_vm->_visa->displayScrollChain('q', 84);
 						return;
 					}
 
-					_vm->_visa->dixi('Q', 3);
+					_vm->_visa->displayScrollChain('Q', 3);
 					_vm->_gyro->_dna._playedNim++;
 
 					// You won - strange!
-					_vm->_visa->dixi('Q', 7); // You won! Give us a lute!
+					_vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute!
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = true;
 					_vm->_lucerna->refreshObjectList();
 					_vm->_gyro->_dna._wonNim = true;
@@ -1628,13 +1628,13 @@ void Acci::doThat() {
 		} else if (holding()) {
 			switch (_thing) {
 			case Gyro::kObjectLute :
-					_vm->_visa->dixi('U', 7);
+					_vm->_visa->displayScrollChain('U', 7);
 
 					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] == _vm->_gyro->_dna._room)
-						_vm->_visa->dixi('U', 10);
+						_vm->_visa->displayScrollChain('U', 10);
 
 					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleDuLustie - 150] == _vm->_gyro->_dna._room)
-						_vm->_visa->dixi('U', 15);
+						_vm->_visa->displayScrollChain('U', 15);
 				break;
 			case 52:
 				if (_vm->_gyro->_dna._room == r__musicroom)
@@ -1693,12 +1693,12 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeMagic:
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
-			_vm->_visa->dixi('q', 19);
+			_vm->_visa->displayScrollChain('q', 19);
 		else {
 			if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->infield(2))) { // Avaricius appears!
-				_vm->_visa->dixi('q', 17);
+				_vm->_visa->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
-					_vm->_visa->dixi('q', 18);
+					_vm->_visa->displayScrollChain('q', 18);
 				else {
 					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius
 					_vm->_animation->apped(2, 4);
@@ -1751,12 +1751,12 @@ void Acci::doThat() {
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
 					if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
-						_vm->_visa->dixi('D', 15);
+						_vm->_visa->displayScrollChain('D', 15);
 						return;
 					}
 
 					if (_vm->_gyro->_dna._teetotal)  {
-						_vm->_visa->dixi('D', 6);
+						_vm->_visa->displayScrollChain('D', 6);
 						return;
 					}
 
@@ -1776,10 +1776,10 @@ void Acci::doThat() {
 					break; // We have a right one here - buy Pepsi??!
 				case Gyro::kObjectWine:
 					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1])  // We've already got the wine!
-						_vm->_visa->dixi('D', 2); // 1 bottle's shufishent!
+						_vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
-							_vm->_visa->dixi('D', 15);
+							_vm->_visa->displayScrollChain('D', 15);
 							return;
 						}
 
@@ -1800,21 +1800,21 @@ void Acci::doThat() {
 					break;
 				}
 			} else
-				_vm->_visa->dixi('D', 5); // Go to the bar!
+				_vm->_visa->displayScrollChain('D', 5); // Go to the bar!
 			break;
 
 		case r__outsideducks:
 			if (_vm->_animation->infield(6)) {
 				if (_thing == _vm->_gyro->kObjectOnion) {
 					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
-						_vm->_visa->dixi('D', 10); // Not planning to juggle with the things!
+						_vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
 					else {
 						if (_vm->_gyro->_dna._boughtOnion)
-							_vm->_visa->dixi('D', 11);
+							_vm->_visa->displayScrollChain('D', 11);
 						else {
-							_vm->_visa->dixi('D', 9);
+							_vm->_visa->displayScrollChain('D', 9);
 							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
@@ -1825,16 +1825,16 @@ void Acci::doThat() {
 						_vm->_gyro->_dna._onionInVinegar = false;
 					}
 				} else
-					_vm->_visa->dixi('D', 0);
+					_vm->_visa->displayScrollChain('D', 0);
 			} else
-				_vm->_visa->dixi('D', 0);
+				_vm->_visa->displayScrollChain('D', 0);
 			break;
 
 		case r__nottspub:
-			_vm->_visa->dixi('n', 15); // Can't sell to southerners.
+			_vm->_visa->displayScrollChain('n', 15); // Can't sell to southerners.
 			break;
 		default:
-			_vm->_visa->dixi('D', 0); // Can't buy that.
+			_vm->_visa->displayScrollChain('D', 0); // Can't buy that.
 		}
 		break;
 	case kVerbCodeAttack:
@@ -1844,7 +1844,7 @@ void Acci::doThat() {
 			switch (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] + _vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
-				_vm->_visa->dixi('Q', 10);
+				_vm->_visa->displayScrollChain('Q', 10);
 				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
@@ -1854,7 +1854,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
-				_vm->_visa->dixi('Q', 11);
+				_vm->_visa->displayScrollChain('Q', 11);
 				_vm->_gyro->_dna._cwytalotGone = true;
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = false;
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = false;
@@ -1867,14 +1867,14 @@ void Acci::doThat() {
 				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
-				_vm->_visa->dixi('Q', 10); // Please try not to be so violent!
+				_vm->_visa->displayScrollChain('Q', 10); // Please try not to be so violent!
 			}
 		} else
-			_vm->_visa->dixi('Q', 10);
+			_vm->_visa->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
 		if (_vm->_gyro->_dna._room != r__bridge)
-			_vm->_visa->dixi('Q', 12);
+			_vm->_visa->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (byte i = 0; i < _thats.size(); i++) {
@@ -1896,7 +1896,7 @@ void Acci::doThat() {
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
-				_vm->_visa->dixi('Q', 12);
+				_vm->_visa->displayScrollChain('Q', 12);
 		}
 		break;
 	case kVerbCodeDir:
@@ -1922,16 +1922,16 @@ void Acci::doThat() {
 		else if (isPersonHere()) {
 			switch (_person) {
 			case Gyro::kPeopleArkata:
-				_vm->_visa->dixi('U', 12);
+				_vm->_visa->displayScrollChain('U', 12);
 				break;
 			case Gyro::kPeopleGeida:
-				_vm->_visa->dixi('U', 13);
+				_vm->_visa->displayScrollChain('U', 13);
 				break;
 			case Gyro::kPeopleWisewoman:
-				_vm->_visa->dixi('U', 14);
+				_vm->_visa->displayScrollChain('U', 14);
 				break;
 			default:
-				_vm->_visa->dixi('U', 5); // You WHAT?
+				_vm->_visa->displayScrollChain('U', 5); // You WHAT?
 			}
 		} else if ((150 <= _person) && (_person <= 174))
 			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
@@ -1963,7 +1963,7 @@ void Acci::doThat() {
 					_vm->_gyro->_dna._avvyInBed = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_dna._teetotal)
-						_vm->_visa->dixi('d', 13);
+						_vm->_visa->displayScrollChain('d', 13);
 				} else
 					_vm->_scrolls->displayText("You're already awake, Avvy!");
 				break;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 68f59de..68266f3 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -854,7 +854,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_gyro->_magics[11]._data = 5;
 		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
 		stopWalking();
-		_vm->_visa->dixi('q', 26);
+		_vm->_visa->displayScrollChain('q', 26);
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
@@ -884,11 +884,11 @@ void Animation::call_special(uint16 which) {
 		if (_vm->_gyro->_dna._friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
-			_vm->_visa->dixi('q', 35);
+			_vm->_visa->displayScrollChain('q', 35);
 			tr[0].done();
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_visa->dixi('q', 36);
+			_vm->_visa->displayScrollChain('q', 36);
 			_vm->_gyro->_dna._tiedUp = true;
 			_vm->_gyro->_dna._friarWillTieYouUp = false;
 			tr[1].walkto(3);
@@ -917,7 +917,7 @@ void Animation::call_special(uint16 which) {
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
-			_vm->_visa->dixi('q', 63);
+			_vm->_visa->displayScrollChain('q', 63);
 			tr[1].turn(kDirDown);
 			tr[1].stopWalk();
 			tr[1]._callEachStepFl = false; // Geida
@@ -937,9 +937,9 @@ void Animation::call_special(uint16 which) {
 		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
 			// Into Geida's room.
 			if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1])
-				_vm->_visa->dixi('q', 62);
+				_vm->_visa->displayScrollChain('q', 62);
 			else {
-				_vm->_visa->dixi('q', 61);
+				_vm->_visa->displayScrollChain('q', 61);
 				return;
 			}
 		}
@@ -1201,7 +1201,7 @@ void Animation::arrow_procs(byte tripnum) {
 			// OK, it's hit him... what now?
 
 			tr[1]._callEachStepFl = false; // prevent recursion.
-			_vm->_visa->dixi('Q', 47); // Complaint!
+			_vm->_visa->displayScrollChain('Q', 47); // Complaint!
 			tr[tripnum].done(); // Deallocate the arrow.
 #if 0
 			tr[1].done; { Deallocate normal pic of Avvy. }
@@ -1409,7 +1409,7 @@ void Animation::animLink() {
 
 	if (mustexclaim) {
 		mustexclaim = false;
-		_vm->_visa->dixi('x', saywhat);
+		_vm->_visa->displayScrollChain('x', saywhat);
 	}
 }
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 052619c..e0e0514 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -182,7 +182,7 @@ void Avalot::setup() {
 		_vm->_lucerna->fxToggle();
 		_vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing);
 
-		_vm->_visa->dixi('q', 83); // Info on the game, etc.
+		_vm->_visa->displayScrollChain('q', 83); // Info on the game, etc.
 	}
 }
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index f7e917e..3f29ca4 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -307,7 +307,7 @@ void Gyro::forceNumlock() {
 bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_dna._money -= howmuchby;
 	if (_dna._money < 0) {
-		_vm->_visa->dixi('Q', 2); // "You are now denariusless!"
+		_vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!"
 		_vm->_lucerna->gameOver();
 		return false;
 	} else
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 07fe6b4..598ff63 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -600,13 +600,13 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 		{
 			if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
-				_vm->_visa->dixi('q', 9); // Don't want to waste the wine!
+				_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
 				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
 				refreshObjectList();
 			}
 		}
 
-		_vm->_visa->dixi('q', 69);
+		_vm->_visa->displayScrollChain('q', 69);
 		break;
 
 	case r__catacombs:
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 6c05d7a..01c61be 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -718,7 +718,7 @@ void Scrolls::callScrollDriver() {
 				case 10:
 					switch (_vm->_gyro->_dna._boxContent) {
 					case 0: { // Sixpence.
-						_vm->_visa->dixi('q', 37); // You find the sixpence.
+						_vm->_visa->displayScrollChain('q', 37); // You find the sixpence.
 						_vm->_gyro->_dna._money += 6;
 						_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing;
 						_vm->_lucerna->incScore(2);
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index fb73ce5..0f484fc 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -243,7 +243,7 @@ void Timeout::openDrawbridge() {
 }
 
 void Timeout::avariciusTalks() {
-	_vm->_visa->dixi('q', _vm->_gyro->_dna._avariciusTalk);
+	_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
 	_vm->_gyro->_dna._avariciusTalk++;
 
 	if (_vm->_gyro->_dna._avariciusTalk < 17)
@@ -285,25 +285,25 @@ void Timeout::stairs() {
 void Timeout::cardiffSurvey() {
 	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
 		_vm->_gyro->_dna._cardiffQuestionNum++;
-		_vm->_visa->dixi('q', 27);
+		_vm->_visa->displayScrollChain('q', 27);
 	}
 
-	_vm->_visa->dixi('z', _vm->_gyro->_dna._cardiffQuestionNum);
+	_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum);
 	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
 void Timeout::cardiffReturn() {
-	_vm->_visa->dixi('q', 28);
+	_vm->_visa->displayScrollChain('q', 28);
 	cardiffSurvey(); // Add end of question.
 }
 
 void Timeout::cwytalotInHerts() {
-	_vm->_visa->dixi('q', 29);
+	_vm->_visa->displayScrollChain('q', 29);
 }
 
 void Timeout::getTiedUp() {
-	_vm->_visa->dixi('q', 34); // ...Trouble!
+	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
 	_vm->_gyro->_dna._userMovesAvvy = false;
 	_vm->_gyro->_dna._beenTiedUp = true;
 	_vm->_animation->stopWalking();
@@ -326,17 +326,17 @@ void Timeout::hangAround() {
 	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->apped(1, 2);
-	_vm->_visa->dixi('q', 39);
+	_vm->_visa->displayScrollChain('q', 39);
 	_vm->_animation->tr[0].walkto(7);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timeout::hangAround2() {
-	_vm->_visa->dixi('q', 40);
+	_vm->_visa->displayScrollChain('q', 40);
 	_vm->_animation->tr[1]._vanishIfStill = false;
 	_vm->_animation->tr[1].walkto(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
-	_vm->_visa->dixi('q', 41);
+	_vm->_visa->displayScrollChain('q', 41);
 	_vm->_animation->tr[0].done();
 	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
@@ -381,7 +381,7 @@ void Timeout::afterTheShootemup() {
 
 	warning("STUB: Timeout::after_the_shootemup()");
 
-	_vm->_visa->dixi('q', 70);
+	_vm->_visa->displayScrollChain('q', 70);
 }
 
 void Timeout::jacquesWakesUp() {
@@ -390,7 +390,7 @@ void Timeout::jacquesWakesUp() {
 	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
-		_vm->_visa->dixi('Q', 45);
+		_vm->_visa->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
@@ -436,7 +436,7 @@ void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your m
 }
 
 void Timeout::naughtyDuke2() {
-	_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
+	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 	_vm->_animation->tr[1].walkto(1); // Walk to the door.
 	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
@@ -489,14 +489,14 @@ void Timeout::jump() {
 			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
-			_vm->_visa->dixi('q', 50);
+			_vm->_visa->displayScrollChain('q', 50);
 			_vm->_lucerna->incScore(3);
 		}
 	}
 }
 
 void Timeout::crapulusSaysSpludOut() {
-	_vm->_visa->dixi('q', 56);
+	_vm->_visa->displayScrollChain('q', 56);
 	_vm->_gyro->_dna._crapulusWillTell = false;
 }
 
@@ -504,11 +504,11 @@ void Timeout::buyDrinks() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_dna._malagauche = 0;
 
-	_vm->_visa->dixi('D', _vm->_gyro->_dna._drinking); // Display message about it.
+	_vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
-	_vm->_visa->dixi('D', 1); // That'll be thruppence.
+	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
-		_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
+		_vm->_visa->displayScrollChain('D', 3); // Tell 'em you paid up.
 	_vm->_acci->drink();
 }
 
@@ -516,10 +516,10 @@ void Timeout::buyWine() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_dna._malagauche = 0;
 
-	_vm->_visa->dixi('D', 50); // You buy the wine.
-	_vm->_visa->dixi('D', 1); // It'll be thruppence.
+	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
+	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) {
-		_vm->_visa->dixi('D', 4); // You paid up.
+		_vm->_visa->displayScrollChain('D', 4); // You paid up.
 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._wineState = 1; // OK Wine.
@@ -527,12 +527,12 @@ void Timeout::buyWine() {
 }
 
 void Timeout::callsGuards() {
-	_vm->_visa->dixi('Q', 58); // "GUARDS!!!"
+	_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
 	_vm->_lucerna->gameOver();
 }
 
 void Timeout::greetsMonk() {
-	_vm->_visa->dixi('Q', 59);
+	_vm->_visa->displayScrollChain('Q', 59);
 	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
 }
 
@@ -549,7 +549,7 @@ void Timeout::meetAvaroid() {
 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
 		_vm->_lucerna->gameOver();
 	} else {
-		_vm->_visa->dixi('Q', 60);
+		_vm->_visa->displayScrollChain('Q', 60);
 		_vm->_gyro->_dna._metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
@@ -583,7 +583,7 @@ void Timeout::robinHoodAndGeida() {
 }
 
 void Timeout::robinHoodAndGeidaTalk() {
-	_vm->_visa->dixi('q', 66);
+	_vm->_visa->displayScrollChain('q', 66);
 	_vm->_animation->tr[0].walkto(2);
 	_vm->_animation->tr[1].walkto(2);
 	_vm->_animation->tr[0]._vanishIfStill = true;
@@ -596,7 +596,7 @@ void Timeout::avalotReturns() {
 	_vm->_animation->tr[1].done();
 	_vm->_animation->tr[0].init(0, true, _vm->_animation);
 	_vm->_animation->apped(1, 1);
-	_vm->_visa->dixi('q', 67);
+	_vm->_visa->displayScrollChain('q', 67);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
@@ -625,12 +625,12 @@ void Timeout::arkataShouts() {
 	if (_vm->_gyro->_dna._teetotal)
 		return;
 
-	_vm->_visa->dixi('q', 76);
+	_vm->_visa->displayScrollChain('q', 76);
 	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
 }
 
 void Timeout::winning() {
-	_vm->_visa->dixi('q', 79);
+	_vm->_visa->displayScrollChain('q', 79);
 	_vm->_pingo->winningPic();
 
 	warning("STUB: Timeout::winning()");
@@ -673,7 +673,7 @@ void Timeout::spludwickLeavesCauldron() {
 }
 
 void Timeout::giveLuteToGeida() { // Moved here from Acci.
-	_vm->_visa->dixi('Q', 86);
+	_vm->_visa->displayScrollChain('Q', 86);
 	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_dna._lustieIsAsleep = true;
 	_vm->_sequence->firstShow(5);


Commit: f42f29d8f8e1cc39b02cf1827318ff8fb59d3dd7
    https://github.com/scummvm/scummvm/commit/f42f29d8f8e1cc39b02cf1827318ff8fb59d3dd7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T02:30:23-07:00

Commit Message:
AVALANCHE: Rename Timeout into Timer

Changed paths:
  A engines/avalanche/timer.cpp
  A engines/avalanche/timer.h
  R engines/avalanche/timeout2.cpp
  R engines/avalanche/timeout2.h
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 3691ae9..fe72967 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -34,7 +34,7 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
@@ -379,7 +379,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
 
-	_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
+	_vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
 	case 1:
@@ -419,7 +419,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	}
 
 	if (interrogation < 4)
-		_vm->_timeout->cardiffSurvey();
+		_vm->_timer->cardiffSurvey();
 }
 
 
@@ -1041,7 +1041,7 @@ void Acci::notInOrder() {
 
 void Acci::goToCauldron() {
 	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timeout->addTimer(1, _vm->_timeout->kProcSpludwickGoesToCauldron, _vm->_timeout->kReasonSpludWalk);
+	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludWalk);
 	_vm->_animation->tr[1].walkto(2);
 }
 
@@ -1143,7 +1143,7 @@ void Acci::standUp() {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
-			_vm->_timeout->loseTimer(_vm->_timeout->kReasonArkataShouts);
+			_vm->_timer->loseTimer(_vm->_timer->kReasonArkataShouts);
 		} else
 			already();
 		break;
@@ -1242,7 +1242,7 @@ void Acci::giveGeidaTheLute() {
 	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->displayScrollChain('q', 64); // She plays it.
 
-	_vm->_timeout->addTimer(1, _vm->_timeout->kProcGiveLuteToGeida, _vm->_timeout->kReasonGeidaSings);
+	_vm->_timer->addTimer(1, _vm->_timer->kProcGiveLuteToGeida, _vm->_timer->kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
 }
 
@@ -1259,7 +1259,7 @@ void Acci::winSequence() {
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
 	_vm->_sequence->startToClose();
-	_vm->_timeout->addTimer(30, _vm->_timeout->kProcWinning, _vm->_timeout->kReasonWinning);
+	_vm->_timer->addTimer(30, _vm->_timer->kProcWinning, _vm->_timer->kReasonWinning);
 }
 
 void Acci::personSpeaks() {
@@ -1506,7 +1506,7 @@ void Acci::doThat() {
 	case kVerbCodeQuit: // quit
 		if (_vm->_gyro->kDemo) {
 			warning("STUB: Acci::doThat() - case kVerbCodequit");
-		//	_vm->_visa->dixi('pos', 31);
+		//	_vm->_visa->displayScrollChain('pos', 31);
 		//	close(demofile);
 		//	exit(0); // Change this later!!!
 		}
@@ -1682,7 +1682,7 @@ void Acci::doThat() {
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timeout->addTimer(4, _vm->_timeout->kProcUrinate, _vm->_timeout->kReasonGoToToilet);
+			_vm->_timer->addTimer(4, _vm->_timer->kProcUrinate, _vm->_timer->kReasonGoToToilet);
 		} else
 			_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
 			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
@@ -1706,7 +1706,7 @@ void Acci::doThat() {
 					_vm->_animation->tr[1]._callEachStepFl = true;
 					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
-					_vm->_timeout->addTimer(177, _vm->_timeout->kProcAvariciusTalks, _vm->_timeout->kReasonAvariciusTalks);
+					_vm->_timer->addTimer(177, _vm->_timer->kProcAvariciusTalks, _vm->_timer->kReasonAvariciusTalks);
 				}
 			} else
 				_vm->_scrolls->displayText("Nothing appears to happen...");
@@ -1769,7 +1769,7 @@ void Acci::doThat() {
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 					_vm->_gyro->_dna._malagauche = 177;
-					_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyDrinks, _vm->_timeout->kReasonDrinks);
+					_vm->_timer->addTimer(27, _vm->_timer->kProcBuyDrinks, _vm->_timer->kReasonDrinks);
 					break;
 				case 52:
 					examine();
@@ -1795,7 +1795,7 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->_dna._malagauche = 177;
 
-						_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyWine, _vm->_timeout->kReasonDrinks);
+						_vm->_timer->addTimer(27, _vm->_timer->kProcBuyWine, _vm->_timer->kReasonDrinks);
 					}
 					break;
 				}
@@ -1892,7 +1892,7 @@ void Acci::doThat() {
 				else {
 					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->displayText("The drawbridge opens!");
-					_vm->_timeout->addTimer(7, _vm->_timeout->kProcOpenDrawbridge, _vm->_timeout->kReasonDrawbridgeFalls);
+					_vm->_timer->addTimer(7, _vm->_timer->kProcOpenDrawbridge, _vm->_timer->kReasonDrawbridgeFalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
@@ -1944,7 +1944,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
-		_vm->_timeout->addTimer(1, _vm->_timeout->kProcJump, _vm->_timeout->kReasonJumping);
+		_vm->_timer->addTimer(1, _vm->_timer->kProcJump, _vm->_timer->kReasonJumping);
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
@@ -1985,7 +1985,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
-				_vm->_timeout->addTimer(1, _vm->_timeout->kProcAvvySitDown, _vm->_timeout->kReasonSittingDown);
+				_vm->_timer->addTimer(1, _vm->_timer->kProcAvvySitDown, _vm->_timer->kReasonSittingDown);
 			}
 		} else { // Default doodah.
 			_vm->_lucerna->dusk();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 68266f3..df8724f 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -36,7 +36,7 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/enid2.h"
 
 #include "common/scummsys.h"
@@ -834,7 +834,7 @@ void Animation::catamove(byte ped) {
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Animation::dawndelay() {
-	_vm->_timeout->addTimer(2, _vm->_timeout->kProcDawnDelay, _vm->_timeout->kReasonDawndelay);
+	_vm->_timer->addTimer(2, _vm->_timer->kProcDawnDelay, _vm->_timer->kReasonDawndelay);
 }
 
 void Animation::call_special(uint16 which) {
@@ -843,7 +843,7 @@ void Animation::call_special(uint16 which) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->_dna._brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_timeout->addTimer(10, _vm->_timeout->kProcStairs, _vm->_timeout->kReasonBrummieStairs);
+		_vm->_timer->addTimer(10, _vm->_timer->kProcStairs, _vm->_timer->kReasonBrummieStairs);
 		stopWalking();
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
@@ -877,7 +877,7 @@ void Animation::call_special(uint16 which) {
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
 		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
-		_vm->_timeout->addTimer(1, _vm->_timeout->kProcGhostRoomPhew, _vm->_timeout->kReasonGhostRoomPhew);
+		_vm->_timer->addTimer(1, _vm->_timer->kProcGhostRoomPhew, _vm->_timer->kReasonGhostRoomPhew);
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
@@ -895,7 +895,7 @@ void Animation::call_special(uint16 which) {
 			tr[1]._vanishIfStill = true;
 			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
-			_vm->_timeout->addTimer(364, _vm->_timeout->kProcHangAround, _vm->_timeout->kReasonHangingAround);
+			_vm->_timer->addTimer(364, _vm->_timer->kProcHangAround, _vm->_timer->kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
@@ -903,17 +903,17 @@ void Animation::call_special(uint16 which) {
 		tr[0]._moveX = 3;
 		tr[0]._moveY = 0;
 		tr[0]._facingDir = kDirRight;
-		_vm->_timeout->addTimer(1, _vm->_timeout->kProcFallDownOubliette, _vm->_timeout->kReasonFallingDownOubliette);
+		_vm->_timer->addTimer(1, _vm->_timer->kProcFallDownOubliette, _vm->_timer->kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		tr[0]._visible = false;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		stopWalking();
-		_vm->_timeout->loseTimer(_vm->_timeout->kReasonFallingDownOubliette);
+		_vm->_timer->loseTimer(_vm->_timer->kReasonFallingDownOubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timeout->addTimer(200, _vm->_timeout->kProcMeetAvaroid, _vm->_timeout->kReasonMeetingAvaroid);
+		_vm->_timer->addTimer(200, _vm->_timer->kProcMeetAvaroid, _vm->_timer->kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
@@ -931,7 +931,7 @@ void Animation::call_special(uint16 which) {
 		tr[1].walkto(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_timeout->addTimer(40, _vm->_timeout->kProcRobinHoodAndGeida, _vm->_timeout->kReasonRobinHoodAndGeida);
+		_vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
 		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
@@ -1217,7 +1217,7 @@ void Animation::arrow_procs(byte tripnum) {
 			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
-			_vm->_timeout->addTimer(55, _vm->_timeout->kProcNaughtyDuke, _vm->_timeout->kReasonNaughtyDuke);
+			_vm->_timer->addTimer(55, _vm->_timer->kProcNaughtyDuke, _vm->_timer->kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		tr[tripnum].done(); // Deallocate the arrow.
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 72c86a4..b820d2d 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* Original name TRIP5 / Trippancy V - the sprite animation subsystem */
+/* Original name: TRIP5 / Trippancy V - the sprite animation subsystem */
 
 #ifndef AVALANCHE_ANIMATION_H
 #define AVALANCHE_ANIMATION_H
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 2e7b7f3..b28fe7f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -69,7 +69,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _enid;
 	delete _celer;
 	delete _sequence;
-	delete _timeout;
+	delete _timer;
 	delete _animation;
 	delete _acci;
 	delete _dropdown;
@@ -90,7 +90,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_enid = new Enid(this);
 	_celer = new Celer(this);
 	_sequence = new Sequence(this);
-	_timeout = new Timeout(this);
+	_timer = new Timer(this);
 	_animation = new Animation(this);
 	_acci = new Acci(this);
 	_dropdown = new Dropdown(this);
@@ -335,9 +335,9 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
 	for (byte i = 0; i < 7; i++) {
-		sz.syncAsSint32LE(_timeout->_times[i]._timeLeft);
-		sz.syncAsByte(_timeout->_times[i]._action);
-		sz.syncAsByte(_timeout->_times[i]._reason);
+		sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
+		sz.syncAsByte(_timer->_times[i]._action);
+		sz.syncAsByte(_timer->_times[i]._reason);
 	}
 
 	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 1973f9b..998363a 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -42,7 +42,7 @@
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/acci2.h"
 #include "avalanche/dropdown2.h"
@@ -79,7 +79,7 @@ public:
 	Enid *_enid;
 	Celer *_celer;
 	Sequence *_sequence;
-	Timeout *_timeout;
+	Timer *_timer;
 	Animation *_animation;
 	Acci *_acci;
 	Dropdown *_dropdown;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e0e0514..a439238 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -38,7 +38,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/dropdown2.h"
 #include "avalanche/pingo2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/celer2.h"
 #include "avalanche/enid2.h"
 #include "avalanche/visa2.h"
@@ -205,7 +205,7 @@ void Avalot::run(Common::String arg) {
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
-		_vm->_timeout->updateTimer();
+		_vm->_timer->updateTimer();
 
 
 
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index c3a195e..f6e22df 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/animation.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 598ff63..1cf7b3e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/visa2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
@@ -340,21 +340,21 @@ void Lucerna::exitRoom(byte x) {
 
 	switch (x) {
 	case r__spludwicks:
-		_vm->_timeout->loseTimer(_vm->_timeout->kReasonAvariciusTalks);
+		_vm->_timer->loseTimer(_vm->_timer->kReasonAvariciusTalks);
 		 _vm->_gyro->_dna._avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
 		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
 			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
-			_vm->_timeout->loseTimer(_vm->_timeout->kReasonDrawbridgeFalls);
+			_vm->_timer->loseTimer(_vm->_timer->kReasonDrawbridgeFalls);
 		}
 		break;
 	case r__outsidecardiffcastle:
-		_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey);
+		_vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey);
 		break;
 	case r__robins:
-		_vm->_timeout->loseTimer(_vm->_timeout->kReasonGettingTiedUp);
+		_vm->_timer->loseTimer(_vm->_timer->kReasonGettingTiedUp);
 		break;
 	}
 
@@ -436,7 +436,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_timeout->addTimer(100, _vm->_timeout->kProcArkataShouts, _vm->_timeout->kReasonArkataShouts);
+			_vm->_timer->addTimer(100, _vm->_timer->kProcArkataShouts, _vm->_timer->kReasonArkataShouts);
 		}
 		break;
 
@@ -464,7 +464,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(8, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(4);
-				_vm->_timeout->addTimer(20, _vm->_timeout->kProcCrapulusSpludOut, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
+				_vm->_timer->addTimer(20, _vm->_timer->kProcCrapulusSpludOut, _vm->_timer->kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
 		}
@@ -472,7 +472,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsidespludwicks:
 		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
-			_vm->_timeout->addTimer(20, _vm->_timeout->kProcBang, _vm->_timeout->kReasonExplosion);
+			_vm->_timer->addTimer(20, _vm->_timer->kProcBang, _vm->_timer->kReasonExplosion);
 			_vm->_gyro->_dna._spludwickAtHome = true;
 		}
 		break;
@@ -527,7 +527,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->tr[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timeout->addTimer(20, _vm->_timeout->kProcCwytalotInHerts, _vm->_timeout->kReasonCwytalotInHerts);
+			_vm->_timer->addTimer(20, _vm->_timer->kProcCwytalotInHerts, _vm->_timer->kReasonCwytalotInHerts);
 		}
 		break;
 
@@ -548,7 +548,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(6, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->addTimer(36, _vm->_timeout->kProcGetTiedUp, _vm->_timeout->kReasonGettingTiedUp);
+				_vm->_timer->addTimer(36, _vm->_timer->kProcGetTiedUp, _vm->_timer->kReasonGettingTiedUp);
 			}
 		}
 
@@ -572,7 +572,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
 				_vm->_animation->tr[1].walkto(3);
-				_vm->_timeout->addTimer(47, _vm->_timeout->kProcCardiffSurvey, _vm->_timeout->kReasonCardiffsurvey);
+				_vm->_timer->addTimer(47, _vm->_timer->kProcCardiffSurvey, _vm->_timer->kReasonCardiffsurvey);
 			}
 			break;
 			case 5 :
@@ -582,7 +582,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 3);
 				_vm->_animation->tr[1]._facingDir = Animation::kDirRight;
-				_vm->_timeout->addTimer(3, _vm->_timeout->kProcCardiffReturn, _vm->_timeout->kReasonCardiffsurvey);
+				_vm->_timer->addTimer(3, _vm->_timer->kProcCardiffReturn, _vm->_timer->kReasonCardiffsurvey);
 			}
 			}
 		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
@@ -650,10 +650,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timeout->addTimer(3, _vm->_timeout->kProcCallsGuards, _vm->_timeout->kReasonDuLustieTalks);
+			_vm->_timer->addTimer(3, _vm->_timer->kProcCallsGuards, _vm->_timer->kReasonDuLustieTalks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
-			_vm->_timeout->addTimer(3, _vm->_timeout->kProcGreetsMonk, _vm->_timeout->kReasonDuLustieTalks);
+			_vm->_timer->addTimer(3, _vm->_timer->kProcGreetsMonk, _vm->_timer->kReasonDuLustieTalks);
 
 		if (_vm->_gyro->_dna._geidaFollows) {
 			putGeidaAt(5, ped);
@@ -1190,7 +1190,7 @@ void Lucerna::gameOver() {
 	_vm->_animation->tr[0]._stepNum = 0;
 	_vm->_animation->tr[0].appear(sx, sy, 0);
 
-	_vm->_timeout->addTimer(3, _vm->_timeout->kProcAvalotFalls, _vm->_timeout->kReasonFallingOver);
+	_vm->_timer->addTimer(3, _vm->_timer->kProcAvalotFalls, _vm->_timer->kReasonFallingOver);
 	_vm->_gyro->_alive = false;
 }
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index c46f8e2..0f1722a 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -15,7 +15,7 @@ MODULE_OBJS = \
 	enid2.o \
 	celer2.o \
 	sequence2.o \
-	timeout2.o \
+	timer.o \
 	animation.o \
 	acci2.o \
 	dropdown2.o \
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 01c61be..f8972d5 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -35,7 +35,7 @@
 #include "avalanche/animation.h"
 #include "avalanche/acci2.h"
 #include "avalanche/visa2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 
 #include "common/textconsole.h"
 #include "common/file.h"
@@ -219,7 +219,7 @@ void Scrolls::scrollModeMusic() {
 		setReadyLight(0);
 		_vm->_gyro->_seeScroll = false;
 
-		_vm->_timeout->addTimer(8, _vm->_timeout->kProcJacquesWakesUp, _vm->_timeout->kReasonJacquesWakingUp);
+		_vm->_timer->addTimer(8, _vm->_timer->kProcJacquesWakesUp, _vm->_timer->kReasonJacquesWakingUp);
 		warning("STUB: Scrolls::music_scroll()");
 		return;
 #if 0
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 8f8a3db..48b8017 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -31,7 +31,7 @@
 
 #include "avalanche/sequence2.h"
 #include "avalanche/gyro2.h"
-#include "avalanche/timeout2.h"
+#include "avalanche/timer.h"
 #include "avalanche/celer2.h"
 #include "avalanche/animation.h"
 
@@ -69,8 +69,8 @@ void Sequence::thenFlip(byte where, byte ped) {
 }
 
 void Sequence::startToClose() {
-	_vm->_timeout->loseTimer(_vm->_timeout->kReasonSequencer);
-	_vm->_timeout->addTimer(7, _vm->_timeout->kProcSequence, _vm->_timeout->kReasonSequencer);
+	_vm->_timer->loseTimer(_vm->_timer->kReasonSequencer);
+	_vm->_timer->addTimer(7, _vm->_timer->kProcSequence, _vm->_timer->kReasonSequencer);
 }
 
 void Sequence::startToOpen() {
diff --git a/engines/avalanche/sequence2.h b/engines/avalanche/sequence2.h
index 07c90b4..67650d5 100644
--- a/engines/avalanche/sequence2.h
+++ b/engines/avalanche/sequence2.h
@@ -54,7 +54,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	void shoveLeft(); // This PROC is called by Timeout when it's time to do another frame.
+	void shoveLeft(); // This PROC is called by Timer when it's time to do another frame.
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
deleted file mode 100644
index 0f484fc..0000000
--- a/engines/avalanche/timeout2.cpp
+++ /dev/null
@@ -1,684 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* TIMEOUT	The scheduling unit. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/timeout2.h"
-#include "avalanche/visa2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/animation.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/acci2.h"
-#include "avalanche/sequence2.h"
-#include "avalanche/enid2.h"
-#include "avalanche/pingo2.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-Timeout::Timeout(AvalancheEngine *vm) {
-	_vm = vm;
-
-	for (byte i = 0; i < 7; i++) {
-		_times[i]._timeLeft = 0;
-		_times[i]._action = 0;
-		_times[i]._reason = 0;
-	}
-	_timerLost = false;
-}
-
-/**
- * Add a nex timer
- * @remarks	Originally called 'set_up_timer'
- */
-void Timeout::addTimer(int32 duration, byte action, byte reason) {
-	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
-		byte i = 0;
-		while ((i < 7) && (_times[i]._timeLeft != 0))
-			i++;
-
-		if (i == 7)
-			return; // Oh dear... No timer left
-
-		// Everything's OK here!
-		_times[i]._timeLeft = duration;
-		_times[i]._action = action;
-		_times[i]._reason = reason;
-	} else {
-		_vm->_gyro->isLoaded = false;
-		return;
-	}
-}
-
-/**
- * Update the timers
- * @remarks	Originally called 'one_tick'
- */
-void Timeout::updateTimer() {
-	if (_vm->_gyro->_dropdownActive)
-		return;
-
-	for (byte i = 0; i < 7; i++) {
-		if (_times[i]._timeLeft <= 0)
-			continue;
-
-		_times[i]._timeLeft--;
-
-		if (_times[i]._timeLeft == 0) {
-			switch (_times[i]._action) {
-			case kProcOpenDrawbridge :
-				openDrawbridge();
-				break;
-			case kProcAvariciusTalks :
-				avariciusTalks();
-				break;
-			case kProcUrinate :
-				urinate();
-				break;
-			case kProcToilet :
-				toilet();
-				break;
-			case kProcBang:
-				bang();
-				break;
-			case kProcBang2:
-				bang2();
-				break;
-			case kProcStairs:
-				stairs();
-				break;
-			case kProcCardiffSurvey:
-				cardiffSurvey();
-				break;
-			case kProcCardiffReturn:
-				cardiffReturn();
-				break;
-			case kProcCwytalotInHerts:
-				cwytalotInHerts();
-				break;
-			case kProcGetTiedUp:
-				getTiedUp();
-				break;
-			case kProcGetTiedUp2:
-				getTiedUp2();
-				break;
-			case kProcHangAround:
-				hangAround();
-				break;
-			case kProcHangAround2:
-				hangAround2();
-				break;
-			case kProcAfterTheShootemup:
-				afterTheShootemup();
-				break;
-			case kProcJacquesWakesUp:
-				jacquesWakesUp();
-				break;
-			case kProcNaughtyDuke:
-				naughtyDuke();
-				break;
-			case kProcNaughtyDuke2:
-				naughtyDuke2();
-				break;
-			case kProcNaughtyDuke3:
-				naughtyDuke3();
-				break;
-			case kProcJump:
-				jump();
-				break;
-			case kProcSequence:
-				_vm->_sequence->callSequencer();
-				break;
-			case kProcCrapulusSpludOut:
-				crapulusSaysSpludOut();
-				break;
-			case kProcDawnDelay:
-				_vm->_lucerna->dawn();
-				break;
-			case kProcBuyDrinks:
-				buyDrinks();
-				break;
-			case kProcBuyWine:
-				buyWine();
-				break;
-			case kProcCallsGuards:
-				callsGuards();
-				break;
-			case kProcGreetsMonk:
-				greetsMonk();
-				break;
-			case kProcFallDownOubliette:
-				fallDownOubliette();
-				break;
-			case kProcMeetAvaroid:
-				meetAvaroid();
-				break;
-			case kProcRiseUpOubliette:
-				riseUpOubliette();
-				break;
-			case kProcRobinHoodAndGeida:
-				robinHoodAndGeida();
-				break;
-			case kProcRobinHoodAndGeidaTalk:
-				robinHoodAndGeidaTalk();
-				break;
-			case kProcAvalotReturns:
-				avalotReturns();
-				break;
-			case kProcAvvySitDown:
-				avvySitDown();
-				break;
-			case kProcGhostRoomPhew:
-				ghostRoomPhew();
-				break;
-			case kProcArkataShouts:
-				arkataShouts();
-				break;
-			case kProcWinning:
-				winning();
-				break;
-			case kProcAvalotFalls:
-				avalotFalls();
-				break;
-			case kProcSpludwickGoesToCauldron:
-				spludwickGoesToCauldron();
-				break;
-			case kProcSpludwickLeavesCauldron:
-				spludwickLeavesCauldron();
-				break;
-			case kProcGiveLuteToGeida:
-				giveLuteToGeida();
-				break;
-			}
-		}
-	}
-	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
-	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
-}
-
-void Timeout::loseTimer(byte which) {
-	for (byte i = 0; i < 7; i++) {
-		if (_times[i]._reason == which)
-			_times[i]._timeLeft = 0; // Cancel this one!
-	}
-
-	_timerLost = true;
-}
-
-void Timeout::openDrawbridge() {
-	_vm->_gyro->_dna._drawbridgeOpen++;
-	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
-
-	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
-	else
-		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
-}
-
-void Timeout::avariciusTalks() {
-	_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
-	_vm->_gyro->_dna._avariciusTalk++;
-
-	if (_vm->_gyro->_dna._avariciusTalk < 17)
-		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
-	else
-		_vm->_lucerna->incScore(3);
-}
-
-void Timeout::urinate() {
-	_vm->_animation->tr[0].turn(Animation::kDirUp);
-	_vm->_animation->stopWalking();
-	_vm->_lucerna->drawDirection();
-	addTimer(14, kProcToilet, kReasonGoToToilet);
-}
-
-void Timeout::toilet() {
-	_vm->_scrolls->displayText("That's better!");
-}
-
-void Timeout::bang() {
-	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
-	addTimer(30, kProcBang2, kReasonExplosion);
-}
-
-void Timeout::bang2() {
-	_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
-}
-
-void Timeout::stairs() {
-	_vm->_gyro->blip();
-	_vm->_animation->tr[0].walkto(4);
-	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-	_vm->_gyro->_dna._brummieStairs = 2;
-	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
-	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
-	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
-}
-
-void Timeout::cardiffSurvey() {
-	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
-		_vm->_gyro->_dna._cardiffQuestionNum++;
-		_vm->_visa->displayScrollChain('q', 27);
-	}
-
-	_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum);
-	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
-	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
-}
-
-void Timeout::cardiffReturn() {
-	_vm->_visa->displayScrollChain('q', 28);
-	cardiffSurvey(); // Add end of question.
-}
-
-void Timeout::cwytalotInHerts() {
-	_vm->_visa->displayScrollChain('q', 29);
-}
-
-void Timeout::getTiedUp() {
-	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
-	_vm->_gyro->_dna._userMovesAvvy = false;
-	_vm->_gyro->_dna._beenTiedUp = true;
-	_vm->_animation->stopWalking();
-	_vm->_animation->tr[1].stopWalk();
-	_vm->_animation->tr[1].stophoming();
-	_vm->_animation->tr[1]._callEachStepFl = true;
-	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
-	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
-}
-
-void Timeout::getTiedUp2() {
-	_vm->_animation->tr[0].walkto(4);
-	_vm->_animation->tr[1].walkto(5);
-	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
-	_vm->_gyro->_dna._friarWillTieYouUp = true;
-}
-
-void Timeout::hangAround() {
-	_vm->_animation->tr[1]._doCheck = false;
-	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
-	_vm->_animation->apped(1, 2);
-	_vm->_visa->displayScrollChain('q', 39);
-	_vm->_animation->tr[0].walkto(7);
-	addTimer(55, kProcHangAround2, kReasonHangingAround);
-}
-
-void Timeout::hangAround2() {
-	_vm->_visa->displayScrollChain('q', 40);
-	_vm->_animation->tr[1]._vanishIfStill = false;
-	_vm->_animation->tr[1].walkto(4);
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
-	_vm->_visa->displayScrollChain('q', 41);
-	_vm->_animation->tr[0].done();
-	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
-
-	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
-	// Immediately call the following proc (when you have a chance).
-
-	_vm->_gyro->_dna._tiedUp = false;
-
-	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
-}
-
-void Timeout::afterTheShootemup() {
-
-	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
-	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
-
-	_vm->_animation->tr[0].init(0, true, _vm->_animation); // Avalot.
-	_vm->_animation->apped(1, 2);
-	_vm->_gyro->_dna._userMovesAvvy = true;
-	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
-	_vm->_lucerna->refreshObjectList();
-
-	// Same as the added line above: TODO: Remove it later!!!
-	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
-		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
-
-#if 0
-	byte shootscore, gain;
-
-	shootscore = mem[storage_seg * storage_ofs];
-	gain = (shootscore + 5) / 10; // Rounding up.
-
-	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
-		strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points.");
-
-	if (gain > 20) {
-		display("But we won't let you have more than 20 points!");
-		points(20);
-	} else
-		points(gain);
-#endif
-
-	warning("STUB: Timeout::after_the_shootemup()");
-
-	_vm->_visa->displayScrollChain('q', 70);
-}
-
-void Timeout::jacquesWakesUp() {
-	_vm->_gyro->_dna._jacquesState++;
-
-	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
-	case 1 :
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
-		_vm->_visa->displayScrollChain('Q', 45);
-		break;
-	case 2 : // Going through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
-		break;
-	case 3 :  // Gone through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
-		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
-		break;
-	}
-
-	if (_vm->_gyro->_dna._jacquesState == 5) {
-		_vm->_gyro->_dna._bellsAreRinging = true;
-		_vm->_gyro->_dna._aylesIsAwake = true;
-		_vm->_lucerna->incScore(2);
-	}
-
-	switch (_vm->_gyro->_dna._jacquesState) {
-	case 1:
-	case 2:
-	case 3:
-		addTimer(12, kProcJacquesWakesUp, kReasonJacquesWakingUp);
-		break;
-	case 4:
-		addTimer(24, kProcJacquesWakesUp, kReasonJacquesWakingUp);
-		break;
-	}
-}
-
-void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your money.
-	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
-	_vm->_animation->apped(2, 1); // He starts at the door...
-	_vm->_animation->tr[1].walkto(3); // He walks over to you.
-
-	// Let's get the door opening.
-	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-	_vm->_sequence->firstShow(2);
-	_vm->_sequence->startToClose();
-
-	addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
-}
-
-void Timeout::naughtyDuke2() {
-	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
-	_vm->_animation->tr[1].walkto(1); // Walk to the door.
-	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
-	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
-}
-
-void Timeout::naughtyDuke3() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-	_vm->_sequence->firstShow(2);
-	_vm->_sequence->startToClose();
-}
-
-void Timeout::jump() {
-	_vm->_gyro->_dna._jumpStatus++;
-
-	switch (_vm->_gyro->_dna._jumpStatus) {
-	case 1:
-	case 2:
-	case 3:
-	case 5:
-	case 7:
-	case 9:
-		_vm->_animation->tr[0]._y--;
-		break;
-	case 12:
-	case 13:
-	case 14:
-	case 16:
-	case 18:
-	case 19:
-		_vm->_animation->tr[0]._y++;
-		break;
-	}
-
-	if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
-		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_gyro->_dna._jumpStatus = 0;
-	} else { // Still jumping.
-		addTimer(1, kProcJump, kReasonJumping);
-	}
-
-	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
-			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
-			&& (_vm->_animation->infield(3))) { // Beside the wall
-		// Grab the arrow!
-		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
-			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
-		else {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
-			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
-			_vm->_lucerna->refreshObjectList();
-			_vm->_visa->displayScrollChain('q', 50);
-			_vm->_lucerna->incScore(3);
-		}
-	}
-}
-
-void Timeout::crapulusSaysSpludOut() {
-	_vm->_visa->displayScrollChain('q', 56);
-	_vm->_gyro->_dna._crapulusWillTell = false;
-}
-
-void Timeout::buyDrinks() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->_dna._malagauche = 0;
-
-	_vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it.
-	_vm->_pingo->wobble(); // Do the special effects.
-	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
-	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
-		_vm->_visa->displayScrollChain('D', 3); // Tell 'em you paid up.
-	_vm->_acci->drink();
-}
-
-void Timeout::buyWine() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->_dna._malagauche = 0;
-
-	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
-	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
-	if (_vm->_gyro->decreaseMoney(3)) {
-		_vm->_visa->displayScrollChain('D', 4); // You paid up.
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_dna._wineState = 1; // OK Wine.
-	}
-}
-
-void Timeout::callsGuards() {
-	_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
-	_vm->_lucerna->gameOver();
-}
-
-void Timeout::greetsMonk() {
-	_vm->_visa->displayScrollChain('Q', 59);
-	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
-}
-
-void Timeout::fallDownOubliette() {
-	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
-	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
-	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
-	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
-}
-
-void Timeout::meetAvaroid() {
-	if (_vm->_gyro->_dna._metAvaroid) {
-		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
-			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
-		_vm->_lucerna->gameOver();
-	} else {
-		_vm->_visa->displayScrollChain('Q', 60);
-		_vm->_gyro->_dna._metAvaroid = true;
-		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
-
-		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
-		_vm->_animation->tr[0]._x = 151;
-		_vm->_animation->tr[0]._moveX = -3;
-		_vm->_animation->tr[0]._moveY = -5;
-
-		_vm->_gyro->setBackgroundColor(2);
-	}
-}
-
-void Timeout::riseUpOubliette() {
-	_vm->_animation->tr[0]._visible = true;
-	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
-	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
-	if (_vm->_animation->tr[0]._moveY > 0)
-		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
-	else
-		_vm->_gyro->_dna._userMovesAvvy = true;
-}
-
-void Timeout::robinHoodAndGeida() {
-	_vm->_animation->tr[0].init(7, true, _vm->_animation);
-	_vm->_animation->apped(1, 7);
-	_vm->_animation->tr[0].walkto(6);
-	_vm->_animation->tr[1].stopWalk();
-	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
-	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
-	_vm->_gyro->_dna._geidaFollows = false;
-}
-
-void Timeout::robinHoodAndGeidaTalk() {
-	_vm->_visa->displayScrollChain('q', 66);
-	_vm->_animation->tr[0].walkto(2);
-	_vm->_animation->tr[1].walkto(2);
-	_vm->_animation->tr[0]._vanishIfStill = true;
-	_vm->_animation->tr[1]._vanishIfStill = true;
-	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
-}
-
-void Timeout::avalotReturns() {
-	_vm->_animation->tr[0].done();
-	_vm->_animation->tr[1].done();
-	_vm->_animation->tr[0].init(0, true, _vm->_animation);
-	_vm->_animation->apped(1, 1);
-	_vm->_visa->displayScrollChain('q', 67);
-	_vm->_gyro->_dna._userMovesAvvy = true;
-}
-
-/**
- * This is used when you sit down in the pub in Notts. It loops around
- * so that it will happen when Avvy stops walking.
- * @remarks	Originally called 'avvy_sit_down'
- */
-void Timeout::avvySitDown() {
-	if (_vm->_animation->tr[0]._homing)    // Still walking.
-		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
-	else {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_dna._sittingInPub = true;
-		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_animation->tr[0]._visible = false;
-	}
-}
-
-void Timeout::ghostRoomPhew() {
-	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
-		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
-}
-
-void Timeout::arkataShouts() {
-	if (_vm->_gyro->_dna._teetotal)
-		return;
-
-	_vm->_visa->displayScrollChain('q', 76);
-	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
-}
-
-void Timeout::winning() {
-	_vm->_visa->displayScrollChain('q', 79);
-	_vm->_pingo->winningPic();
-
-	warning("STUB: Timeout::winning()");
-#if 0
-	do {
-		_vm->_lucerna->checkclick();
-	} while (!(_vm->_gyro->mrelease == 0));
-#endif
-	// TODO: To be implemented with Pingo::winningPic().
-
-	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
-	_vm->_scrolls->displayText(" T H E    E N D ");
-	_vm->_gyro->_letMeOut = true;
-}
-
-void Timeout::avalotFalls() {
-	if (_vm->_animation->tr[0]._stepNum < 5) {
-		_vm->_animation->tr[0]._stepNum++;
-		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
-	} else {
-		Common::String toDisplay;
-		for (byte i = 0; i < 6; i++)
-			toDisplay += _vm->_scrolls->kControlNewLine;
-		for (byte i = 0; i < 6; i++)
-			toDisplay += _vm->_scrolls->kControlInsertSpaces;
-		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
-		_vm->_scrolls->displayText(toDisplay);
-	}
-}
-
-void Timeout::spludwickGoesToCauldron() {
-	if (_vm->_animation->tr[1]._homing)
-		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
-	else
-		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
-}
-
-void Timeout::spludwickLeavesCauldron() {
-	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
-}
-
-void Timeout::giveLuteToGeida() { // Moved here from Acci.
-	_vm->_visa->displayScrollChain('Q', 86);
-	_vm->_lucerna->incScore(4);
-	_vm->_gyro->_dna._lustieIsAsleep = true;
-	_vm->_sequence->firstShow(5);
-	_vm->_sequence->thenShow(6); // He falls asleep...
-	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/timeout2.h b/engines/avalanche/timeout2.h
deleted file mode 100644
index 5f1769a..0000000
--- a/engines/avalanche/timeout2.h
+++ /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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* TIMEOUT	The scheduling unit. */
-
-#ifndef AVALANCHE_TIMEOUT2_H
-#define AVALANCHE_TIMEOUT2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Timeout {
-public:
-	// Reason runs between 1 and 28.
-	enum Reason {
-		kReasonDrawbridgeFalls = 2,
-		kReasonAvariciusTalks = 3,
-		kReasonGoToToilet = 4,
-		kReasonExplosion = 5,
-		kReasonBrummieStairs = 6,
-		kReasonCardiffsurvey = 7,
-		kReasonCwytalotInHerts = 8,
-		kReasonGettingTiedUp = 9,
-		kReasonHangingAround = 10, // Tied to the tree in Nottingham.
-		kReasonJacquesWakingUp = 11,
-		kReasonNaughtyDuke = 12,
-		kReasonJumping = 13,
-		kReasonSequencer = 14,
-		kReasonCrapulusSaysSpludwickOut = 15,
-		kReasonDawndelay = 16,
-		kReasonDrinks = 17,
-		kReasonDuLustieTalks = 18,
-		kReasonFallingDownOubliette = 19,
-		kReasonMeetingAvaroid = 20,
-		kReasonRisingUpOubliette = 21,
-		kReasonRobinHoodAndGeida = 22,
-		kReasonSittingDown = 23,
-		kReasonGhostRoomPhew = 1,
-		kReasonArkataShouts = 24,
-		kReasonWinning = 25,
-		kReasonFallingOver = 26,
-		kReasonSpludWalk = 27,
-		kReasonGeidaSings = 28
-	};
-
-	// Proc runs between 1 and 41.
-	enum Proc {
-		kProcOpenDrawbridge = 3,
-		kProcAvariciusTalks = 4,
-		kProcUrinate = 5,
-		kProcToilet = 6,
-		kProcBang = 7,
-		kProcBang2 = 8,
-		kProcStairs = 9,
-		kProcCardiffSurvey = 10,
-		kProcCardiffReturn = 11,
-		kProcCwytalotInHerts = 12,
-		kProcGetTiedUp = 13,
-		kProcGetTiedUp2 = 1,
-		kProcHangAround = 14,
-		kProcHangAround2 = 15,
-		kProcAfterTheShootemup = 32,
-		kProcJacquesWakesUp = 16,
-		kProcNaughtyDuke = 17,
-		kProcNaughtyDuke2 = 18,
-		kProcNaughtyDuke3 = 38,
-		kProcJump = 19,
-		kProcSequence = 20,
-		kProcCrapulusSpludOut = 21,
-		kProcDawnDelay = 22,
-		kProcBuyDrinks = 23,
-		kProcBuyWine = 24,
-		kProcCallsGuards = 25,
-		kProcGreetsMonk = 26,
-		kProcFallDownOubliette = 27,
-		kProcMeetAvaroid = 28,
-		kProcRiseUpOubliette = 29,
-		kProcRobinHoodAndGeida = 2,
-		kProcRobinHoodAndGeidaTalk = 30,
-		kProcAvalotReturns = 31,
-		kProcAvvySitDown = 33, // In Nottingham.
-		kProcGhostRoomPhew = 34,
-		kProcArkataShouts = 35,
-		kProcWinning = 36,
-		kProcAvalotFalls = 37,
-		kProcSpludwickGoesToCauldron = 39,
-		kProcSpludwickLeavesCauldron = 40,
-		kProcGiveLuteToGeida = 41
-	};
-
-	struct TimeType {
-		int32 _timeLeft;
-		byte _action;
-		byte _reason;
-	};
-
-	TimeType _times[7];
-	bool _timerLost; // Is the timer "lost"? (Because of using loseTimer())
-
-	Timeout(AvalancheEngine *vm);
-
-	void addTimer(int32 duration, byte action, byte reason);
-	void updateTimer();
-	void loseTimer(byte which);
-
-	// Procedures to do things at the end of amounts of time:
-	void openDrawbridge();
-	void avariciusTalks();
-	void urinate();
-	void toilet();
-	void bang();
-	void bang2();
-	void stairs();
-	void cardiffSurvey();
-	void cardiffReturn();
-	void cwytalotInHerts();
-	void getTiedUp();
-	void getTiedUp2();
-	void hangAround();
-	void hangAround2();
-	void afterTheShootemup();
-	void jacquesWakesUp();
-	void naughtyDuke();
-	void naughtyDuke2();
-	void naughtyDuke3();
-	void jump();
-	void crapulusSaysSpludOut();
-	void buyDrinks();
-	void buyWine();
-	void callsGuards();
-	void greetsMonk();
-	void fallDownOubliette();
-	void meetAvaroid();
-	void riseUpOubliette();
-	void robinHoodAndGeida();
-	void robinHoodAndGeidaTalk();
-	void avalotReturns();
-	void avvySitDown();
-	void ghostRoomPhew();
-	void arkataShouts();
-	void winning();
-	void avalotFalls();
-	void spludwickGoesToCauldron();
-	void spludwickLeavesCauldron();
-	void giveLuteToGeida();
-
-private:
-	AvalancheEngine *_vm;
-
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_TIMEOUT2_H
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
new file mode 100644
index 0000000..2656aea
--- /dev/null
+++ b/engines/avalanche/timer.cpp
@@ -0,0 +1,684 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Original name: TIMEOUT	The scheduling unit. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/timer.h"
+#include "avalanche/visa2.h"
+#include "avalanche/lucerna2.h"
+#include "avalanche/animation.h"
+#include "avalanche/scrolls2.h"
+#include "avalanche/acci2.h"
+#include "avalanche/sequence2.h"
+#include "avalanche/enid2.h"
+#include "avalanche/pingo2.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+Timer::Timer(AvalancheEngine *vm) {
+	_vm = vm;
+
+	for (byte i = 0; i < 7; i++) {
+		_times[i]._timeLeft = 0;
+		_times[i]._action = 0;
+		_times[i]._reason = 0;
+	}
+	_timerLost = false;
+}
+
+/**
+ * Add a nex timer
+ * @remarks	Originally called 'set_up_timer'
+ */
+void Timer::addTimer(int32 duration, byte action, byte reason) {
+	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
+		byte i = 0;
+		while ((i < 7) && (_times[i]._timeLeft != 0))
+			i++;
+
+		if (i == 7)
+			return; // Oh dear... No timer left
+
+		// Everything's OK here!
+		_times[i]._timeLeft = duration;
+		_times[i]._action = action;
+		_times[i]._reason = reason;
+	} else {
+		_vm->_gyro->isLoaded = false;
+		return;
+	}
+}
+
+/**
+ * Update the timers
+ * @remarks	Originally called 'one_tick'
+ */
+void Timer::updateTimer() {
+	if (_vm->_gyro->_dropdownActive)
+		return;
+
+	for (byte i = 0; i < 7; i++) {
+		if (_times[i]._timeLeft <= 0)
+			continue;
+
+		_times[i]._timeLeft--;
+
+		if (_times[i]._timeLeft == 0) {
+			switch (_times[i]._action) {
+			case kProcOpenDrawbridge :
+				openDrawbridge();
+				break;
+			case kProcAvariciusTalks :
+				avariciusTalks();
+				break;
+			case kProcUrinate :
+				urinate();
+				break;
+			case kProcToilet :
+				toilet();
+				break;
+			case kProcBang:
+				bang();
+				break;
+			case kProcBang2:
+				bang2();
+				break;
+			case kProcStairs:
+				stairs();
+				break;
+			case kProcCardiffSurvey:
+				cardiffSurvey();
+				break;
+			case kProcCardiffReturn:
+				cardiffReturn();
+				break;
+			case kProcCwytalotInHerts:
+				cwytalotInHerts();
+				break;
+			case kProcGetTiedUp:
+				getTiedUp();
+				break;
+			case kProcGetTiedUp2:
+				getTiedUp2();
+				break;
+			case kProcHangAround:
+				hangAround();
+				break;
+			case kProcHangAround2:
+				hangAround2();
+				break;
+			case kProcAfterTheShootemup:
+				afterTheShootemup();
+				break;
+			case kProcJacquesWakesUp:
+				jacquesWakesUp();
+				break;
+			case kProcNaughtyDuke:
+				naughtyDuke();
+				break;
+			case kProcNaughtyDuke2:
+				naughtyDuke2();
+				break;
+			case kProcNaughtyDuke3:
+				naughtyDuke3();
+				break;
+			case kProcJump:
+				jump();
+				break;
+			case kProcSequence:
+				_vm->_sequence->callSequencer();
+				break;
+			case kProcCrapulusSpludOut:
+				crapulusSaysSpludOut();
+				break;
+			case kProcDawnDelay:
+				_vm->_lucerna->dawn();
+				break;
+			case kProcBuyDrinks:
+				buyDrinks();
+				break;
+			case kProcBuyWine:
+				buyWine();
+				break;
+			case kProcCallsGuards:
+				callsGuards();
+				break;
+			case kProcGreetsMonk:
+				greetsMonk();
+				break;
+			case kProcFallDownOubliette:
+				fallDownOubliette();
+				break;
+			case kProcMeetAvaroid:
+				meetAvaroid();
+				break;
+			case kProcRiseUpOubliette:
+				riseUpOubliette();
+				break;
+			case kProcRobinHoodAndGeida:
+				robinHoodAndGeida();
+				break;
+			case kProcRobinHoodAndGeidaTalk:
+				robinHoodAndGeidaTalk();
+				break;
+			case kProcAvalotReturns:
+				avalotReturns();
+				break;
+			case kProcAvvySitDown:
+				avvySitDown();
+				break;
+			case kProcGhostRoomPhew:
+				ghostRoomPhew();
+				break;
+			case kProcArkataShouts:
+				arkataShouts();
+				break;
+			case kProcWinning:
+				winning();
+				break;
+			case kProcAvalotFalls:
+				avalotFalls();
+				break;
+			case kProcSpludwickGoesToCauldron:
+				spludwickGoesToCauldron();
+				break;
+			case kProcSpludwickLeavesCauldron:
+				spludwickLeavesCauldron();
+				break;
+			case kProcGiveLuteToGeida:
+				giveLuteToGeida();
+				break;
+			}
+		}
+	}
+	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
+	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
+}
+
+void Timer::loseTimer(byte which) {
+	for (byte i = 0; i < 7; i++) {
+		if (_times[i]._reason == which)
+			_times[i]._timeLeft = 0; // Cancel this one!
+	}
+
+	_timerLost = true;
+}
+
+void Timer::openDrawbridge() {
+	_vm->_gyro->_dna._drawbridgeOpen++;
+	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
+
+	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
+		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+	else
+		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
+}
+
+void Timer::avariciusTalks() {
+	_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
+	_vm->_gyro->_dna._avariciusTalk++;
+
+	if (_vm->_gyro->_dna._avariciusTalk < 17)
+		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
+	else
+		_vm->_lucerna->incScore(3);
+}
+
+void Timer::urinate() {
+	_vm->_animation->tr[0].turn(Animation::kDirUp);
+	_vm->_animation->stopWalking();
+	_vm->_lucerna->drawDirection();
+	addTimer(14, kProcToilet, kReasonGoToToilet);
+}
+
+void Timer::toilet() {
+	_vm->_scrolls->displayText("That's better!");
+}
+
+void Timer::bang() {
+	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
+	addTimer(30, kProcBang2, kReasonExplosion);
+}
+
+void Timer::bang2() {
+	_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
+}
+
+void Timer::stairs() {
+	_vm->_gyro->blip();
+	_vm->_animation->tr[0].walkto(4);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+	_vm->_gyro->_dna._brummieStairs = 2;
+	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
+	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
+	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+}
+
+void Timer::cardiffSurvey() {
+	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
+		_vm->_gyro->_dna._cardiffQuestionNum++;
+		_vm->_visa->displayScrollChain('q', 27);
+	}
+
+	_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum);
+	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
+	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
+}
+
+void Timer::cardiffReturn() {
+	_vm->_visa->displayScrollChain('q', 28);
+	cardiffSurvey(); // Add end of question.
+}
+
+void Timer::cwytalotInHerts() {
+	_vm->_visa->displayScrollChain('q', 29);
+}
+
+void Timer::getTiedUp() {
+	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
+	_vm->_gyro->_dna._userMovesAvvy = false;
+	_vm->_gyro->_dna._beenTiedUp = true;
+	_vm->_animation->stopWalking();
+	_vm->_animation->tr[1].stopWalk();
+	_vm->_animation->tr[1].stophoming();
+	_vm->_animation->tr[1]._callEachStepFl = true;
+	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
+	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
+}
+
+void Timer::getTiedUp2() {
+	_vm->_animation->tr[0].walkto(4);
+	_vm->_animation->tr[1].walkto(5);
+	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_gyro->_dna._friarWillTieYouUp = true;
+}
+
+void Timer::hangAround() {
+	_vm->_animation->tr[1]._doCheck = false;
+	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
+	_vm->_animation->apped(1, 2);
+	_vm->_visa->displayScrollChain('q', 39);
+	_vm->_animation->tr[0].walkto(7);
+	addTimer(55, kProcHangAround2, kReasonHangingAround);
+}
+
+void Timer::hangAround2() {
+	_vm->_visa->displayScrollChain('q', 40);
+	_vm->_animation->tr[1]._vanishIfStill = false;
+	_vm->_animation->tr[1].walkto(4);
+	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
+	_vm->_visa->displayScrollChain('q', 41);
+	_vm->_animation->tr[0].done();
+	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
+
+	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
+	// Immediately call the following proc (when you have a chance).
+
+	_vm->_gyro->_dna._tiedUp = false;
+
+	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
+}
+
+void Timer::afterTheShootemup() {
+
+	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
+	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
+
+	_vm->_animation->tr[0].init(0, true, _vm->_animation); // Avalot.
+	_vm->_animation->apped(1, 2);
+	_vm->_gyro->_dna._userMovesAvvy = true;
+	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
+	_vm->_lucerna->refreshObjectList();
+
+	// Same as the added line above: TODO: Remove it later!!!
+	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+
+#if 0
+	byte shootscore, gain;
+
+	shootscore = mem[storage_seg * storage_ofs];
+	gain = (shootscore + 5) / 10; // Rounding up.
+
+	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
+		strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points.");
+
+	if (gain > 20) {
+		display("But we won't let you have more than 20 points!");
+		points(20);
+	} else
+		points(gain);
+#endif
+
+	warning("STUB: Timer::after_the_shootemup()");
+
+	_vm->_visa->displayScrollChain('q', 70);
+}
+
+void Timer::jacquesWakesUp() {
+	_vm->_gyro->_dna._jacquesState++;
+
+	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
+	case 1 :
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
+		_vm->_visa->displayScrollChain('Q', 45);
+		break;
+	case 2 : // Going through the door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
+		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
+		break;
+	case 3 :  // Gone through the door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
+		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
+		break;
+	}
+
+	if (_vm->_gyro->_dna._jacquesState == 5) {
+		_vm->_gyro->_dna._bellsAreRinging = true;
+		_vm->_gyro->_dna._aylesIsAwake = true;
+		_vm->_lucerna->incScore(2);
+	}
+
+	switch (_vm->_gyro->_dna._jacquesState) {
+	case 1:
+	case 2:
+	case 3:
+		addTimer(12, kProcJacquesWakesUp, kReasonJacquesWakingUp);
+		break;
+	case 4:
+		addTimer(24, kProcJacquesWakesUp, kReasonJacquesWakingUp);
+		break;
+	}
+}
+
+void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
+	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
+	_vm->_animation->apped(2, 1); // He starts at the door...
+	_vm->_animation->tr[1].walkto(3); // He walks over to you.
+
+	// Let's get the door opening.
+	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+	_vm->_sequence->firstShow(2);
+	_vm->_sequence->startToClose();
+
+	addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
+}
+
+void Timer::naughtyDuke2() {
+	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
+	_vm->_animation->tr[1].walkto(1); // Walk to the door.
+	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
+	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
+}
+
+void Timer::naughtyDuke3() {
+	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+	_vm->_sequence->firstShow(2);
+	_vm->_sequence->startToClose();
+}
+
+void Timer::jump() {
+	_vm->_gyro->_dna._jumpStatus++;
+
+	switch (_vm->_gyro->_dna._jumpStatus) {
+	case 1:
+	case 2:
+	case 3:
+	case 5:
+	case 7:
+	case 9:
+		_vm->_animation->tr[0]._y--;
+		break;
+	case 12:
+	case 13:
+	case 14:
+	case 16:
+	case 18:
+	case 19:
+		_vm->_animation->tr[0]._y++;
+		break;
+	}
+
+	if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
+		_vm->_gyro->_dna._userMovesAvvy = true;
+		_vm->_gyro->_dna._jumpStatus = 0;
+	} else { // Still jumping.
+		addTimer(1, kProcJump, kReasonJumping);
+	}
+
+	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
+			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
+			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
+			&& (_vm->_animation->infield(3))) { // Beside the wall
+		// Grab the arrow!
+		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
+			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
+		else {
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
+			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
+			_vm->_lucerna->refreshObjectList();
+			_vm->_visa->displayScrollChain('q', 50);
+			_vm->_lucerna->incScore(3);
+		}
+	}
+}
+
+void Timer::crapulusSaysSpludOut() {
+	_vm->_visa->displayScrollChain('q', 56);
+	_vm->_gyro->_dna._crapulusWillTell = false;
+}
+
+void Timer::buyDrinks() {
+	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+	_vm->_gyro->_dna._malagauche = 0;
+
+	_vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it.
+	_vm->_pingo->wobble(); // Do the special effects.
+	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
+	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
+		_vm->_visa->displayScrollChain('D', 3); // Tell 'em you paid up.
+	_vm->_acci->drink();
+}
+
+void Timer::buyWine() {
+	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+	_vm->_gyro->_dna._malagauche = 0;
+
+	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
+	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
+	if (_vm->_gyro->decreaseMoney(3)) {
+		_vm->_visa->displayScrollChain('D', 4); // You paid up.
+		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
+		_vm->_lucerna->refreshObjectList();
+		_vm->_gyro->_dna._wineState = 1; // OK Wine.
+	}
+}
+
+void Timer::callsGuards() {
+	_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
+	_vm->_lucerna->gameOver();
+}
+
+void Timer::greetsMonk() {
+	_vm->_visa->displayScrollChain('Q', 59);
+	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
+}
+
+void Timer::fallDownOubliette() {
+	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
+	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
+	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
+	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
+}
+
+void Timer::meetAvaroid() {
+	if (_vm->_gyro->_dna._metAvaroid) {
+		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
+		_vm->_lucerna->gameOver();
+	} else {
+		_vm->_visa->displayScrollChain('Q', 60);
+		_vm->_gyro->_dna._metAvaroid = true;
+		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
+
+		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
+		_vm->_animation->tr[0]._x = 151;
+		_vm->_animation->tr[0]._moveX = -3;
+		_vm->_animation->tr[0]._moveY = -5;
+
+		_vm->_gyro->setBackgroundColor(2);
+	}
+}
+
+void Timer::riseUpOubliette() {
+	_vm->_animation->tr[0]._visible = true;
+	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
+	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
+	if (_vm->_animation->tr[0]._moveY > 0)
+		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
+	else
+		_vm->_gyro->_dna._userMovesAvvy = true;
+}
+
+void Timer::robinHoodAndGeida() {
+	_vm->_animation->tr[0].init(7, true, _vm->_animation);
+	_vm->_animation->apped(1, 7);
+	_vm->_animation->tr[0].walkto(6);
+	_vm->_animation->tr[1].stopWalk();
+	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
+	_vm->_gyro->_dna._geidaFollows = false;
+}
+
+void Timer::robinHoodAndGeidaTalk() {
+	_vm->_visa->displayScrollChain('q', 66);
+	_vm->_animation->tr[0].walkto(2);
+	_vm->_animation->tr[1].walkto(2);
+	_vm->_animation->tr[0]._vanishIfStill = true;
+	_vm->_animation->tr[1]._vanishIfStill = true;
+	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
+}
+
+void Timer::avalotReturns() {
+	_vm->_animation->tr[0].done();
+	_vm->_animation->tr[1].done();
+	_vm->_animation->tr[0].init(0, true, _vm->_animation);
+	_vm->_animation->apped(1, 1);
+	_vm->_visa->displayScrollChain('q', 67);
+	_vm->_gyro->_dna._userMovesAvvy = true;
+}
+
+/**
+ * This is used when you sit down in the pub in Notts. It loops around
+ * so that it will happen when Avvy stops walking.
+ * @remarks	Originally called 'avvy_sit_down'
+ */
+void Timer::avvySitDown() {
+	if (_vm->_animation->tr[0]._homing)    // Still walking.
+		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
+	else {
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_gyro->_dna._sittingInPub = true;
+		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_animation->tr[0]._visible = false;
+	}
+}
+
+void Timer::ghostRoomPhew() {
+	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
+}
+
+void Timer::arkataShouts() {
+	if (_vm->_gyro->_dna._teetotal)
+		return;
+
+	_vm->_visa->displayScrollChain('q', 76);
+	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
+}
+
+void Timer::winning() {
+	_vm->_visa->displayScrollChain('q', 79);
+	_vm->_pingo->winningPic();
+
+	warning("STUB: Timer::winning()");
+#if 0
+	do {
+		_vm->_lucerna->checkclick();
+	} while (!(_vm->_gyro->mrelease == 0));
+#endif
+	// TODO: To be implemented with Pingo::winningPic().
+
+	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
+	_vm->_scrolls->displayText(" T H E    E N D ");
+	_vm->_gyro->_letMeOut = true;
+}
+
+void Timer::avalotFalls() {
+	if (_vm->_animation->tr[0]._stepNum < 5) {
+		_vm->_animation->tr[0]._stepNum++;
+		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
+	} else {
+		Common::String toDisplay;
+		for (byte i = 0; i < 6; i++)
+			toDisplay += _vm->_scrolls->kControlNewLine;
+		for (byte i = 0; i < 6; i++)
+			toDisplay += _vm->_scrolls->kControlInsertSpaces;
+		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
+		_vm->_scrolls->displayText(toDisplay);
+	}
+}
+
+void Timer::spludwickGoesToCauldron() {
+	if (_vm->_animation->tr[1]._homing)
+		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
+	else
+		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
+}
+
+void Timer::spludwickLeavesCauldron() {
+	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
+}
+
+void Timer::giveLuteToGeida() { // Moved here from Acci.
+	_vm->_visa->displayScrollChain('Q', 86);
+	_vm->_lucerna->incScore(4);
+	_vm->_gyro->_dna._lustieIsAsleep = true;
+	_vm->_sequence->firstShow(5);
+	_vm->_sequence->thenShow(6); // He falls asleep...
+	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h
new file mode 100644
index 0000000..c8b664b
--- /dev/null
+++ b/engines/avalanche/timer.h
@@ -0,0 +1,180 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* Original name: TIMEOUT	The scheduling unit. */
+
+#ifndef AVALANCHE_TIMER_H
+#define AVALANCHE_TIMER_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Timer {
+public:
+	// Reason runs between 1 and 28.
+	enum Reason {
+		kReasonDrawbridgeFalls = 2,
+		kReasonAvariciusTalks = 3,
+		kReasonGoToToilet = 4,
+		kReasonExplosion = 5,
+		kReasonBrummieStairs = 6,
+		kReasonCardiffsurvey = 7,
+		kReasonCwytalotInHerts = 8,
+		kReasonGettingTiedUp = 9,
+		kReasonHangingAround = 10, // Tied to the tree in Nottingham.
+		kReasonJacquesWakingUp = 11,
+		kReasonNaughtyDuke = 12,
+		kReasonJumping = 13,
+		kReasonSequencer = 14,
+		kReasonCrapulusSaysSpludwickOut = 15,
+		kReasonDawndelay = 16,
+		kReasonDrinks = 17,
+		kReasonDuLustieTalks = 18,
+		kReasonFallingDownOubliette = 19,
+		kReasonMeetingAvaroid = 20,
+		kReasonRisingUpOubliette = 21,
+		kReasonRobinHoodAndGeida = 22,
+		kReasonSittingDown = 23,
+		kReasonGhostRoomPhew = 1,
+		kReasonArkataShouts = 24,
+		kReasonWinning = 25,
+		kReasonFallingOver = 26,
+		kReasonSpludWalk = 27,
+		kReasonGeidaSings = 28
+	};
+
+	// Proc runs between 1 and 41.
+	enum Proc {
+		kProcOpenDrawbridge = 3,
+		kProcAvariciusTalks = 4,
+		kProcUrinate = 5,
+		kProcToilet = 6,
+		kProcBang = 7,
+		kProcBang2 = 8,
+		kProcStairs = 9,
+		kProcCardiffSurvey = 10,
+		kProcCardiffReturn = 11,
+		kProcCwytalotInHerts = 12,
+		kProcGetTiedUp = 13,
+		kProcGetTiedUp2 = 1,
+		kProcHangAround = 14,
+		kProcHangAround2 = 15,
+		kProcAfterTheShootemup = 32,
+		kProcJacquesWakesUp = 16,
+		kProcNaughtyDuke = 17,
+		kProcNaughtyDuke2 = 18,
+		kProcNaughtyDuke3 = 38,
+		kProcJump = 19,
+		kProcSequence = 20,
+		kProcCrapulusSpludOut = 21,
+		kProcDawnDelay = 22,
+		kProcBuyDrinks = 23,
+		kProcBuyWine = 24,
+		kProcCallsGuards = 25,
+		kProcGreetsMonk = 26,
+		kProcFallDownOubliette = 27,
+		kProcMeetAvaroid = 28,
+		kProcRiseUpOubliette = 29,
+		kProcRobinHoodAndGeida = 2,
+		kProcRobinHoodAndGeidaTalk = 30,
+		kProcAvalotReturns = 31,
+		kProcAvvySitDown = 33, // In Nottingham.
+		kProcGhostRoomPhew = 34,
+		kProcArkataShouts = 35,
+		kProcWinning = 36,
+		kProcAvalotFalls = 37,
+		kProcSpludwickGoesToCauldron = 39,
+		kProcSpludwickLeavesCauldron = 40,
+		kProcGiveLuteToGeida = 41
+	};
+
+	struct TimerType {
+		int32 _timeLeft;
+		byte _action;
+		byte _reason;
+	};
+
+	TimerType _times[7];
+	bool _timerLost; // Is the timer "lost"? (Because of using loseTimer())
+
+	Timer(AvalancheEngine *vm);
+
+	void addTimer(int32 duration, byte action, byte reason);
+	void updateTimer();
+	void loseTimer(byte which);
+
+	// Procedures to do things at the end of amounts of time:
+	void openDrawbridge();
+	void avariciusTalks();
+	void urinate();
+	void toilet();
+	void bang();
+	void bang2();
+	void stairs();
+	void cardiffSurvey();
+	void cardiffReturn();
+	void cwytalotInHerts();
+	void getTiedUp();
+	void getTiedUp2();
+	void hangAround();
+	void hangAround2();
+	void afterTheShootemup();
+	void jacquesWakesUp();
+	void naughtyDuke();
+	void naughtyDuke2();
+	void naughtyDuke3();
+	void jump();
+	void crapulusSaysSpludOut();
+	void buyDrinks();
+	void buyWine();
+	void callsGuards();
+	void greetsMonk();
+	void fallDownOubliette();
+	void meetAvaroid();
+	void riseUpOubliette();
+	void robinHoodAndGeida();
+	void robinHoodAndGeidaTalk();
+	void avalotReturns();
+	void avvySitDown();
+	void ghostRoomPhew();
+	void arkataShouts();
+	void winning();
+	void avalotFalls();
+	void spludwickGoesToCauldron();
+	void spludwickLeavesCauldron();
+	void giveLuteToGeida();
+
+private:
+	AvalancheEngine *_vm;
+
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_TIMER_H


Commit: aafaaef37f76f9deb6d34c2ef76da87d103e7b52
    https://github.com/scummvm/scummvm/commit/aafaaef37f76f9deb6d34c2ef76da87d103e7b52
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T02:34:21-07:00

Commit Message:
AVALANCHE: Some renaming in Animation.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/timeout2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 3691ae9..3861a77 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -407,7 +407,7 @@ void Acci::storeInterrogation(byte interrogation) {
 			_vm->_gyro->_dna._spareEvening.clear();
 		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->tr[1].walkto(4); // The end of the drawbridge
+		_vm->_animation->tr[1].walkTo(4); // The end of the drawbridge
 		_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_gyro->_dna._cardiffQuestionNum = 5;
@@ -1042,7 +1042,7 @@ void Acci::notInOrder() {
 void Acci::goToCauldron() {
 	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
 	_vm->_timeout->addTimer(1, _vm->_timeout->kProcSpludwickGoesToCauldron, _vm->_timeout->kReasonSpludWalk);
-	_vm->_animation->tr[1].walkto(2);
+	_vm->_animation->tr[1].walkTo(2);
 }
 
 /**
@@ -1702,7 +1702,7 @@ void Acci::doThat() {
 				else {
 					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius
 					_vm->_animation->apped(2, 4);
-					_vm->_animation->tr[1].walkto(5);
+					_vm->_animation->tr[1].walkTo(5);
 					_vm->_animation->tr[1]._callEachStepFl = true;
 					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
@@ -1861,7 +1861,7 @@ void Acci::doThat() {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->incScore(7);
-				_vm->_animation->tr[1].walkto(2);
+				_vm->_animation->tr[1].walkTo(2);
 				_vm->_animation->tr[1]._vanishIfStill = true;
 				_vm->_animation->tr[1]._callEachStepFl = false;
 				_vm->_gyro->_whereIs[7] = 177;
@@ -1984,7 +1984,7 @@ void Acci::doThat() {
 			if (_vm->_gyro->_dna._sittingInPub)
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
-				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
+				_vm->_animation->tr[0].walkTo(4); // Move Avvy to the place, and sit him down.
 				_vm->_timeout->addTimer(1, _vm->_timeout->kProcAvvySitDown, _vm->_timeout->kReasonSittingDown);
 			}
 		} else { // Default doodah.
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 68266f3..83ff5d6 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -192,15 +192,13 @@ void AnimationType::walk() {
 		r._y1 = _y - 2;
 		r._x2 = ((_x + _info._xLength) / 8) + 1;
 		r._y2 = _y + _info._yLength + 2;
-
-		_tr->getset[1 - _tr->_vm->_gyro->_cp].remember(r);
 	}
 
 	if (!_tr->_vm->_gyro->_doingSpriteRun) {
 		_oldX[_tr->_vm->_gyro->_cp] = _x;
 		_oldY[_tr->_vm->_gyro->_cp] = _y;
 		if (_homing)
-			homestep();
+			homeStep();
 		_x += _moveX;
 		_y += _moveY;
 	}
@@ -275,7 +273,7 @@ int8 AnimationType::sgn(int16 val) {
 		return 0;
 }
 
-void AnimationType::walkto(byte pednum) {
+void AnimationType::walkTo(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
 	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
 	_homingX = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
@@ -287,7 +285,7 @@ void AnimationType::stophoming() {
 	_homing = false;
 }
 
-void AnimationType::homestep() {
+void AnimationType::homeStep() {
 	int16 temp;
 
 	if ((_homingX == _x) && (_homingY == _y)) {
@@ -349,73 +347,7 @@ void AnimationType::chatter() {
 	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
-/**
- * Init Saver structure
- * @remarks	Originally called 'set_up_saver'
- */
-void AnimationType::setupSaver(AnimationSaver &sav) {
-	sav._id = _id;
-	sav._facingDir = _facingDir;
-	sav._stepNum = _stepNum;
-	sav._x = _x;
-	sav._y = _y;
-	sav._moveX = _moveX;
-	sav._moveY = _moveY;
-	sav._visible = _visible;
-	sav._homing = _homing;
-	sav._doCheck = _doCheck;
-	sav._count = _count;
-	sav._xWidth = _info._xWidth;
-	sav._speedX = _speedX;
-	sav._speedY = _speedY;
-	sav._animCount = _animCount;
-	sav._homingX = _homingX;
-	sav._homingY = _homingY;
-	sav._callEachStepFl = _callEachStepFl;
-	sav._eachStepProc = _eachStepProc;
-	sav._vanishIfStill = _vanishIfStill;
-}
-
-void AnimationType::unload_saver(AnimationSaver sav) {
-	_id = sav._id;
-	_facingDir = sav._facingDir;
-	_stepNum = sav._stepNum;
-	_x = sav._x;
-	_y = sav._y;
-	_moveX = sav._moveX;
-	_moveY = sav._moveY;
-	_visible = sav._visible;
-	_homing = sav._homing;
-	_doCheck = sav._doCheck;
-	_count = sav._count;
-	_info._xWidth = sav._xWidth;
-	_speedX = sav._speedX;
-	_speedY = sav._speedY;
-	_animCount = sav._animCount;
-	_homingX = sav._homingX;
-	_homingY = sav._homingY;
-	_callEachStepFl = sav._callEachStepFl;
-	_eachStepProc = sav._eachStepProc;
-	_vanishIfStill = sav._vanishIfStill;
-}
-
-void AnimationType::savedata(Common::File &f) {
-	warning("STUB: triptype::savedata()");
-}
-
-void AnimationType::loaddata(Common::File &f) {
-	warning("STUB: triptype::loaddata()");
-}
-
-void AnimationType::save_data_to_mem(uint16 &where) {
-	warning("STUB: triptype::save_data_to_mem()");
-}
-
-void AnimationType::load_data_from_mem(uint16 &where) {
-	warning("STUB: triptype::load_data_from_mem()");
-}
-
-AnimationType *AnimationType::done() {
+void AnimationType::done() {
 	_animCount--;
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
@@ -429,30 +361,11 @@ AnimationType *AnimationType::done() {
 
 	_quick = false;
 	_id = 177;
-	return this;
-}
-
-getsettype *getsettype::init() {
-	numleft = 0; // initialize array pointer
-	return this;
-}
-
-void getsettype::remember(ByteField r) {
-	numleft++;
-	//if (numleft > maxgetset)
-	//	error("Trip::remember() : runerr_Getset_Overflow");
-	gs[numleft] = r;
-}
-
-void getsettype::recall(ByteField &r) {
-	r = gs[numleft];
-	numleft--;
 }
 
 Animation::Animation(AvalancheEngine *vm) {
 	_vm = vm;
 
-	getsetclear();
 	mustexclaim = false;
 }
 
@@ -863,7 +776,7 @@ void Animation::call_special(uint16 which) {
 		if (!_vm->_gyro->_dna._arrowTriggered) {
 			_vm->_gyro->_dna._arrowTriggered = true;
 			apped(2, 4); // The dart starts at ped 4, and...
-			tr[1].walkto(5); // flies to ped 5.
+			tr[1].walkTo(5); // flies to ped 5.
 			tr[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
@@ -891,7 +804,7 @@ void Animation::call_special(uint16 which) {
 			_vm->_visa->displayScrollChain('q', 36);
 			_vm->_gyro->_dna._tiedUp = true;
 			_vm->_gyro->_dna._friarWillTieYouUp = false;
-			tr[1].walkto(3);
+			tr[1].walkTo(3);
 			tr[1]._vanishIfStill = true;
 			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
@@ -928,7 +841,7 @@ void Animation::call_special(uint16 which) {
 		if (!_vm->_gyro->_dna._geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		tr[1]._callEachStepFl = false; // She no longer follows Avvy around.
-		tr[1].walkto(4); // She walks to somewhere...
+		tr[1].walkTo(4); // She walks to somewhere...
 		tr[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_timeout->addTimer(40, _vm->_timeout->kProcRobinHoodAndGeida, _vm->_timeout->kReasonRobinHoodAndGeida);
@@ -1074,10 +987,6 @@ void Animation::newspeed() {
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
 
 	//setactivepage(1 - cp);
-
-	for (byte i = 0; i <= 1; i++)
-		getset[i].remember(lightspace);
-
 }
 
 void Animation::rwsp(byte t, byte dir) {
@@ -1173,9 +1082,9 @@ void Animation::follow_avvy_y(byte tripnum) {
 void Animation::back_and_forth(byte tripnum) {
 	if (!tr[tripnum]._homing) {
 		if (tr[tripnum]._facingDir == kDirRight)
-			tr[tripnum].walkto(4);
+			tr[tripnum].walkTo(4);
 		else
-			tr[tripnum].walkto(5);
+			tr[tripnum].walkTo(5);
 	}
 }
 
@@ -1438,11 +1347,6 @@ void Animation::readstick() {
 	warning("STUB: Trip::readstick()");
 }
 
-void Animation::getsetclear() {
-	for (byte fv = 0; fv <= 1; fv++)
-		getset[fv].init();
-}
-
 /**
  * Hide in the cupboard
  * @remarks	Originally called 'hide_in_the_cupboard'
@@ -1493,7 +1397,6 @@ void Animation::fliproom(byte room, byte ped) {
 
 	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
 	_vm->_lucerna->dusk();
-	getsetclear();
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
 		if (tr[i]._quick)
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 72c86a4..99ed6e2 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -76,45 +76,35 @@ class AnimationType {
 public:
 	SpriteInfo _info;
 
-	adxtype _stat; // vital statistics
+	adxtype _stat; // Vital statistics.
 	byte _facingDir, _stepNum;
-	int16 _x, _y; // current xy coords
-	int16 _oldX[2], _oldY[2];  // last xy coords
-	int8 _moveX, _moveY; // amount to move sprite by, each step
+	int16 _x, _y; // Current xy coords.
+	int16 _oldX[2], _oldY[2];  // Last xy coords.
+	int8 _moveX, _moveY; // Amount to move sprite by, each step.
 	byte _id;
 	bool _quick, _visible, _homing, _doCheck;
-	int16 _homingX, _homingY; // homing x & y coords
-	byte _count; // counts before changing step
-	byte _speedX, _speedY; // x & y speed
-	byte _animCount; // total number of sprites
+	int16 _homingX, _homingY; // Homing x & y coords.
+	byte _count; // Counts before changing step.
+	byte _speedX, _speedY; // x & y speed.
+	byte _animCount; // Total number of sprites.
 	bool _vanishIfStill; // Do we show this sprite if it's still?
-
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
 
-	void init(byte spritenum, bool doCheck, Animation *tr);
-	// loads & sets up the sprite
-	void original();    // just sets Quick to false
-	void andexor();    // drops sprite onto screen
-	void turn(byte whichway);      // turns him round
-	void appear(int16 wx, int16 wy, byte wf); // switches him on
-	void bounce();    // bounces off walls.
-	void walk();    // prepares for andexor, etc.
-	void walkto(byte pednum);      // home in on a point
-	void stophoming();    // self-explanatory
-	void homestep();    // calculates ix & iy for one homing step
-	void speed(int8 xx, int8 yy); // sets ix & iy, non-homing, etc
-	void stopWalk();    // Stops the sprite from moving
-	void chatter();    // Sets up talk vars
-	void setupSaver(AnimationSaver &sav);
-	void unload_saver(AnimationSaver sav);
-
-	void savedata(Common::File &f); // Self-explanatory,
-	void loaddata(Common::File &f);  // really.
-
-	void save_data_to_mem(uint16 &where);
-	void load_data_from_mem(uint16 &where);
-	AnimationType *done();
+	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
+	void original(); // Just sets 'quick' to false.
+	void andexor(); // Drops sprite onto screen.
+	void turn(byte whichway); // Turns character round.
+	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
+	void bounce(); // Bounces off walls.
+	void walk(); // Prepares for andexor, etc.
+	void walkTo(byte pednum); // Home in on a point.
+	void stophoming(); // Self-explanatory.
+	void homeStep(); // Calculates ix & iy for one homing step.
+	void speed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
+	void stopWalk(); // Stops the sprite from moving.
+	void chatter();  // Sets up talk vars.
+	void done();
 
 private:
 	Animation *_tr;
@@ -123,18 +113,6 @@ private:
 	int8 sgn(int16 val);
 };
 
-const int16 maxgetset = 35;
-
-class getsettype {
-public:
-	ByteField gs[maxgetset];
-	byte numleft;
-
-	getsettype *init();
-	void remember(ByteField r);
-	void recall(ByteField &r);
-};
-
 class Animation {
 public:
 	friend class AnimationType;
@@ -184,7 +162,6 @@ public:
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
 	AnimationType tr[kSpriteNumbMax];
-	getsettype getset[2];
 	byte aa[1600];
 
 	bool mustexclaim;
@@ -209,7 +186,6 @@ private:
 	void spin(byte whichway, byte &tripnum);
 	void geida_procs(byte tripnum);
 	void call_andexors();
-	void getsetclear();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index a261311..5069a92 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -365,9 +365,6 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 
 	//setactivepage(1 - cp);
 	warning("STUB: Celer::show_one()");
-
-	for (byte i = 0; i < 2; i++)
-		_vm->_animation->getset[i].remember(_r);
 }
 
 
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 33a2671..ef44815 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -243,9 +243,6 @@ void MenuBar::draw() {
 	for (byte i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
 
-	for (byte page = 0; page <= 1; page++)
-		_dr->_vm->_animation->getset[page].remember(menuspace);
-
 	_dr->_vm->_gyro->_cp = savecp;
 }
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 598ff63..0fcdbca 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -449,7 +449,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
 					_vm->_animation->apped(2, 4); // Start on the right-hand side of the screen.
-					_vm->_animation->tr[1].walkto(5); // Walks up to greet you.
+					_vm->_animation->tr[1].walkTo(5); // Walks up to greet you.
 				} else {
 					_vm->_animation->apped(2, 5); // Starts where he was before.
 					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
@@ -463,7 +463,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (_vm->_gyro->_dna._crapulusWillTell) {
 				_vm->_animation->tr[1].init(8, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkto(4);
+				_vm->_animation->tr[1].walkTo(4);
 				_vm->_timeout->addTimer(20, _vm->_timeout->kProcCrapulusSpludOut, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
@@ -508,7 +508,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_animation->apped(2, 2); // He appears on the right of the screen...
-					_vm->_animation->tr[1].walkto(4); // ...and he walks up...
+					_vm->_animation->tr[1].walkTo(4); // ...and he walks up...
 				} else {
 					// You've been here before.
 					_vm->_animation->apped(2, 4); // He's standing in your way straight away...
@@ -523,7 +523,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		        (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) {
 			_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->apped(2, 1);
-			_vm->_animation->tr[1].walkto(2);
+			_vm->_animation->tr[1].walkTo(2);
 			_vm->_animation->tr[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
@@ -547,7 +547,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				// A welcome party... or maybe not...
 				_vm->_animation->tr[1].init(6, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkto(3);
+				_vm->_animation->tr[1].walkTo(3);
 				_vm->_timeout->addTimer(36, _vm->_timeout->kProcGetTiedUp, _vm->_timeout->kReasonGettingTiedUp);
 			}
 		}
@@ -571,7 +571,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			case 0 : { // You've answered NONE of his questions.
 				_vm->_animation->tr[1].init(9, false, _vm->_animation);
 				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkto(3);
+				_vm->_animation->tr[1].walkTo(3);
 				_vm->_timeout->addTimer(47, _vm->_timeout->kProcCardiffSurvey, _vm->_timeout->kReasonCardiffsurvey);
 			}
 			break;
@@ -710,7 +710,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		_vm->_animation->tr[1].init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_animation->apped(2, 2); // Start on the right-hand side of the screen.
-			_vm->_animation->tr[1].walkto(4); // Walks up to greet you.
+			_vm->_animation->tr[1].walkTo(4); // Walks up to greet you.
 		} else {
 			_vm->_animation->apped(2, 4); // Starts where she was before.
 			_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e20413b..a378b0d 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -155,8 +155,6 @@ void Parser::drawCursor() {
 	bf._x2 = _inputTextPos + 2;
 	bf._y1 = 168;
 	bf._y2 = 168;
-	for (byte fv = 0; fv <= 1; fv++)
-		_vm->_animation->getset[fv].remember(bf);
 }
 
 void Parser::wipeText() {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 0f484fc..25ca585 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -274,7 +274,7 @@ void Timeout::bang2() {
 
 void Timeout::stairs() {
 	_vm->_gyro->blip();
-	_vm->_animation->tr[0].walkto(4);
+	_vm->_animation->tr[0].walkTo(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->_dna._brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
@@ -315,8 +315,8 @@ void Timeout::getTiedUp() {
 }
 
 void Timeout::getTiedUp2() {
-	_vm->_animation->tr[0].walkto(4);
-	_vm->_animation->tr[1].walkto(5);
+	_vm->_animation->tr[0].walkTo(4);
+	_vm->_animation->tr[1].walkTo(5);
 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
@@ -327,14 +327,14 @@ void Timeout::hangAround() {
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->apped(1, 2);
 	_vm->_visa->displayScrollChain('q', 39);
-	_vm->_animation->tr[0].walkto(7);
+	_vm->_animation->tr[0].walkTo(7);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timeout::hangAround2() {
 	_vm->_visa->displayScrollChain('q', 40);
 	_vm->_animation->tr[1]._vanishIfStill = false;
-	_vm->_animation->tr[1].walkto(4);
+	_vm->_animation->tr[1].walkTo(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->displayScrollChain('q', 41);
 	_vm->_animation->tr[0].done();
@@ -425,7 +425,7 @@ void Timeout::jacquesWakesUp() {
 void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your money.
 	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
 	_vm->_animation->apped(2, 1); // He starts at the door...
-	_vm->_animation->tr[1].walkto(3); // He walks over to you.
+	_vm->_animation->tr[1].walkTo(3); // He walks over to you.
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -437,7 +437,7 @@ void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your m
 
 void Timeout::naughtyDuke2() {
 	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
-	_vm->_animation->tr[1].walkto(1); // Walk to the door.
+	_vm->_animation->tr[1].walkTo(1); // Walk to the door.
 	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
@@ -575,7 +575,7 @@ void Timeout::riseUpOubliette() {
 void Timeout::robinHoodAndGeida() {
 	_vm->_animation->tr[0].init(7, true, _vm->_animation);
 	_vm->_animation->apped(1, 7);
-	_vm->_animation->tr[0].walkto(6);
+	_vm->_animation->tr[0].walkTo(6);
 	_vm->_animation->tr[1].stopWalk();
 	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
@@ -584,8 +584,8 @@ void Timeout::robinHoodAndGeida() {
 
 void Timeout::robinHoodAndGeidaTalk() {
 	_vm->_visa->displayScrollChain('q', 66);
-	_vm->_animation->tr[0].walkto(2);
-	_vm->_animation->tr[1].walkto(2);
+	_vm->_animation->tr[0].walkTo(2);
+	_vm->_animation->tr[1].walkTo(2);
 	_vm->_animation->tr[0]._vanishIfStill = true;
 	_vm->_animation->tr[1]._vanishIfStill = true;
 	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 8eaa1da..98a1e22 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -268,7 +268,7 @@ void Visa::talkTo(byte whom) {
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_animation->tr[1]._vanishIfStill = true;
-		_vm->_animation->tr[1].walkto(3); // Walks away.
+		_vm->_animation->tr[1].walkTo(3); // Walks away.
 
 		_vm->_lucerna->incScore(2);
 	}


Commit: f7de651560578e95db4c5fa4c67a50488d4658ef
    https://github.com/scummvm/scummvm/commit/f7de651560578e95db4c5fa4c67a50488d4658ef
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T02:35:26-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/acci2.cpp
	engines/avalanche/lucerna2.cpp
	engines/avalanche/timer.cpp

Changed paths:
  A engines/avalanche/timer.cpp
  A engines/avalanche/timer.h
  R engines/avalanche/timeout2.cpp
  R engines/avalanche/timeout2.h
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/sequence2.h



diff --cc engines/avalanche/acci2.cpp
index 3861a77,fe72967..aa99517
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@@ -1041,8 -1041,8 +1041,8 @@@ void Acci::notInOrder() 
  
  void Acci::goToCauldron() {
  	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
- 	_vm->_timeout->addTimer(1, _vm->_timeout->kProcSpludwickGoesToCauldron, _vm->_timeout->kReasonSpludWalk);
+ 	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludWalk);
 -	_vm->_animation->tr[1].walkto(2);
 +	_vm->_animation->tr[1].walkTo(2);
  }
  
  /**
@@@ -1984,8 -1984,8 +1984,8 @@@ void Acci::doThat() 
  			if (_vm->_gyro->_dna._sittingInPub)
  				_vm->_scrolls->displayText("You're already sitting!");
  			else {
 -				_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
 +				_vm->_animation->tr[0].walkTo(4); // Move Avvy to the place, and sit him down.
- 				_vm->_timeout->addTimer(1, _vm->_timeout->kProcAvvySitDown, _vm->_timeout->kReasonSittingDown);
+ 				_vm->_timer->addTimer(1, _vm->_timer->kProcAvvySitDown, _vm->_timer->kReasonSittingDown);
  			}
  		} else { // Default doodah.
  			_vm->_lucerna->dusk();
diff --cc engines/avalanche/animation.cpp
index 83ff5d6,df8724f..9aee7db
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@@ -841,10 -928,10 +841,10 @@@ void Animation::call_special(uint16 whi
  		if (!_vm->_gyro->_dna._geidaFollows)
  			return;   // DOESN'T COUNT: no Geida.
  		tr[1]._callEachStepFl = false; // She no longer follows Avvy around.
 -		tr[1].walkto(4); // She walks to somewhere...
 +		tr[1].walkTo(4); // She walks to somewhere...
  		tr[0].done();     // Lose Avvy.
  		_vm->_gyro->_dna._userMovesAvvy = false;
- 		_vm->_timeout->addTimer(40, _vm->_timeout->kProcRobinHoodAndGeida, _vm->_timeout->kReasonRobinHoodAndGeida);
+ 		_vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
  		break;
  	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
  		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
diff --cc engines/avalanche/lucerna2.cpp
index 0fcdbca,1cf7b3e..8398439
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@@ -463,8 -463,8 +463,8 @@@ void Lucerna::enterRoom(byte room, byt
  			if (_vm->_gyro->_dna._crapulusWillTell) {
  				_vm->_animation->tr[1].init(8, false, _vm->_animation);
  				_vm->_animation->apped(2, 2);
 -				_vm->_animation->tr[1].walkto(4);
 +				_vm->_animation->tr[1].walkTo(4);
- 				_vm->_timeout->addTimer(20, _vm->_timeout->kProcCrapulusSpludOut, _vm->_timeout->kReasonCrapulusSaysSpludwickOut);
+ 				_vm->_timer->addTimer(20, _vm->_timer->kProcCrapulusSpludOut, _vm->_timer->kReasonCrapulusSaysSpludwickOut);
  				_vm->_gyro->_dna._crapulusWillTell = false;
  			}
  		}
@@@ -547,8 -547,8 +547,8 @@@
  				// A welcome party... or maybe not...
  				_vm->_animation->tr[1].init(6, false, _vm->_animation);
  				_vm->_animation->apped(2, 2);
 -				_vm->_animation->tr[1].walkto(3);
 +				_vm->_animation->tr[1].walkTo(3);
- 				_vm->_timeout->addTimer(36, _vm->_timeout->kProcGetTiedUp, _vm->_timeout->kReasonGettingTiedUp);
+ 				_vm->_timer->addTimer(36, _vm->_timer->kProcGetTiedUp, _vm->_timer->kReasonGettingTiedUp);
  			}
  		}
  
@@@ -571,8 -571,8 +571,8 @@@
  			case 0 : { // You've answered NONE of his questions.
  				_vm->_animation->tr[1].init(9, false, _vm->_animation);
  				_vm->_animation->apped(2, 2);
 -				_vm->_animation->tr[1].walkto(3);
 +				_vm->_animation->tr[1].walkTo(3);
- 				_vm->_timeout->addTimer(47, _vm->_timeout->kProcCardiffSurvey, _vm->_timeout->kReasonCardiffsurvey);
+ 				_vm->_timer->addTimer(47, _vm->_timer->kProcCardiffSurvey, _vm->_timer->kReasonCardiffsurvey);
  			}
  			break;
  			case 5 :
diff --cc engines/avalanche/timer.cpp
index 0000000,2656aea..928ea25
mode 000000,100644..100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@@ -1,0 -1,684 +1,684 @@@
+ /* 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.
+  *
+  */
+ 
+ /*
+  * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+  */
+ 
+ /* Original name: TIMEOUT	The scheduling unit. */
+ 
+ #include "avalanche/avalanche.h"
+ 
+ #include "avalanche/timer.h"
+ #include "avalanche/visa2.h"
+ #include "avalanche/lucerna2.h"
+ #include "avalanche/animation.h"
+ #include "avalanche/scrolls2.h"
+ #include "avalanche/acci2.h"
+ #include "avalanche/sequence2.h"
+ #include "avalanche/enid2.h"
+ #include "avalanche/pingo2.h"
+ 
+ #include "common/textconsole.h"
+ 
+ namespace Avalanche {
+ 
+ Timer::Timer(AvalancheEngine *vm) {
+ 	_vm = vm;
+ 
+ 	for (byte i = 0; i < 7; i++) {
+ 		_times[i]._timeLeft = 0;
+ 		_times[i]._action = 0;
+ 		_times[i]._reason = 0;
+ 	}
+ 	_timerLost = false;
+ }
+ 
+ /**
+  * Add a nex timer
+  * @remarks	Originally called 'set_up_timer'
+  */
+ void Timer::addTimer(int32 duration, byte action, byte reason) {
+ 	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
+ 		byte i = 0;
+ 		while ((i < 7) && (_times[i]._timeLeft != 0))
+ 			i++;
+ 
+ 		if (i == 7)
+ 			return; // Oh dear... No timer left
+ 
+ 		// Everything's OK here!
+ 		_times[i]._timeLeft = duration;
+ 		_times[i]._action = action;
+ 		_times[i]._reason = reason;
+ 	} else {
+ 		_vm->_gyro->isLoaded = false;
+ 		return;
+ 	}
+ }
+ 
+ /**
+  * Update the timers
+  * @remarks	Originally called 'one_tick'
+  */
+ void Timer::updateTimer() {
+ 	if (_vm->_gyro->_dropdownActive)
+ 		return;
+ 
+ 	for (byte i = 0; i < 7; i++) {
+ 		if (_times[i]._timeLeft <= 0)
+ 			continue;
+ 
+ 		_times[i]._timeLeft--;
+ 
+ 		if (_times[i]._timeLeft == 0) {
+ 			switch (_times[i]._action) {
+ 			case kProcOpenDrawbridge :
+ 				openDrawbridge();
+ 				break;
+ 			case kProcAvariciusTalks :
+ 				avariciusTalks();
+ 				break;
+ 			case kProcUrinate :
+ 				urinate();
+ 				break;
+ 			case kProcToilet :
+ 				toilet();
+ 				break;
+ 			case kProcBang:
+ 				bang();
+ 				break;
+ 			case kProcBang2:
+ 				bang2();
+ 				break;
+ 			case kProcStairs:
+ 				stairs();
+ 				break;
+ 			case kProcCardiffSurvey:
+ 				cardiffSurvey();
+ 				break;
+ 			case kProcCardiffReturn:
+ 				cardiffReturn();
+ 				break;
+ 			case kProcCwytalotInHerts:
+ 				cwytalotInHerts();
+ 				break;
+ 			case kProcGetTiedUp:
+ 				getTiedUp();
+ 				break;
+ 			case kProcGetTiedUp2:
+ 				getTiedUp2();
+ 				break;
+ 			case kProcHangAround:
+ 				hangAround();
+ 				break;
+ 			case kProcHangAround2:
+ 				hangAround2();
+ 				break;
+ 			case kProcAfterTheShootemup:
+ 				afterTheShootemup();
+ 				break;
+ 			case kProcJacquesWakesUp:
+ 				jacquesWakesUp();
+ 				break;
+ 			case kProcNaughtyDuke:
+ 				naughtyDuke();
+ 				break;
+ 			case kProcNaughtyDuke2:
+ 				naughtyDuke2();
+ 				break;
+ 			case kProcNaughtyDuke3:
+ 				naughtyDuke3();
+ 				break;
+ 			case kProcJump:
+ 				jump();
+ 				break;
+ 			case kProcSequence:
+ 				_vm->_sequence->callSequencer();
+ 				break;
+ 			case kProcCrapulusSpludOut:
+ 				crapulusSaysSpludOut();
+ 				break;
+ 			case kProcDawnDelay:
+ 				_vm->_lucerna->dawn();
+ 				break;
+ 			case kProcBuyDrinks:
+ 				buyDrinks();
+ 				break;
+ 			case kProcBuyWine:
+ 				buyWine();
+ 				break;
+ 			case kProcCallsGuards:
+ 				callsGuards();
+ 				break;
+ 			case kProcGreetsMonk:
+ 				greetsMonk();
+ 				break;
+ 			case kProcFallDownOubliette:
+ 				fallDownOubliette();
+ 				break;
+ 			case kProcMeetAvaroid:
+ 				meetAvaroid();
+ 				break;
+ 			case kProcRiseUpOubliette:
+ 				riseUpOubliette();
+ 				break;
+ 			case kProcRobinHoodAndGeida:
+ 				robinHoodAndGeida();
+ 				break;
+ 			case kProcRobinHoodAndGeidaTalk:
+ 				robinHoodAndGeidaTalk();
+ 				break;
+ 			case kProcAvalotReturns:
+ 				avalotReturns();
+ 				break;
+ 			case kProcAvvySitDown:
+ 				avvySitDown();
+ 				break;
+ 			case kProcGhostRoomPhew:
+ 				ghostRoomPhew();
+ 				break;
+ 			case kProcArkataShouts:
+ 				arkataShouts();
+ 				break;
+ 			case kProcWinning:
+ 				winning();
+ 				break;
+ 			case kProcAvalotFalls:
+ 				avalotFalls();
+ 				break;
+ 			case kProcSpludwickGoesToCauldron:
+ 				spludwickGoesToCauldron();
+ 				break;
+ 			case kProcSpludwickLeavesCauldron:
+ 				spludwickLeavesCauldron();
+ 				break;
+ 			case kProcGiveLuteToGeida:
+ 				giveLuteToGeida();
+ 				break;
+ 			}
+ 		}
+ 	}
+ 	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
+ 	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
+ }
+ 
+ void Timer::loseTimer(byte which) {
+ 	for (byte i = 0; i < 7; i++) {
+ 		if (_times[i]._reason == which)
+ 			_times[i]._timeLeft = 0; // Cancel this one!
+ 	}
+ 
+ 	_timerLost = true;
+ }
+ 
+ void Timer::openDrawbridge() {
+ 	_vm->_gyro->_dna._drawbridgeOpen++;
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
+ 
+ 	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
+ 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+ 	else
+ 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
+ }
+ 
+ void Timer::avariciusTalks() {
+ 	_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
+ 	_vm->_gyro->_dna._avariciusTalk++;
+ 
+ 	if (_vm->_gyro->_dna._avariciusTalk < 17)
+ 		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
+ 	else
+ 		_vm->_lucerna->incScore(3);
+ }
+ 
+ void Timer::urinate() {
+ 	_vm->_animation->tr[0].turn(Animation::kDirUp);
+ 	_vm->_animation->stopWalking();
+ 	_vm->_lucerna->drawDirection();
+ 	addTimer(14, kProcToilet, kReasonGoToToilet);
+ }
+ 
+ void Timer::toilet() {
+ 	_vm->_scrolls->displayText("That's better!");
+ }
+ 
+ void Timer::bang() {
+ 	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
+ 	addTimer(30, kProcBang2, kReasonExplosion);
+ }
+ 
+ void Timer::bang2() {
+ 	_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
+ }
+ 
+ void Timer::stairs() {
+ 	_vm->_gyro->blip();
 -	_vm->_animation->tr[0].walkto(4);
++	_vm->_animation->tr[0].walkTo(4);
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+ 	_vm->_gyro->_dna._brummieStairs = 2;
+ 	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
+ 	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
+ 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+ }
+ 
+ void Timer::cardiffSurvey() {
+ 	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
+ 		_vm->_gyro->_dna._cardiffQuestionNum++;
+ 		_vm->_visa->displayScrollChain('q', 27);
+ 	}
+ 
+ 	_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum);
+ 	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
+ 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
+ }
+ 
+ void Timer::cardiffReturn() {
+ 	_vm->_visa->displayScrollChain('q', 28);
+ 	cardiffSurvey(); // Add end of question.
+ }
+ 
+ void Timer::cwytalotInHerts() {
+ 	_vm->_visa->displayScrollChain('q', 29);
+ }
+ 
+ void Timer::getTiedUp() {
+ 	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
+ 	_vm->_gyro->_dna._userMovesAvvy = false;
+ 	_vm->_gyro->_dna._beenTiedUp = true;
+ 	_vm->_animation->stopWalking();
+ 	_vm->_animation->tr[1].stopWalk();
+ 	_vm->_animation->tr[1].stophoming();
+ 	_vm->_animation->tr[1]._callEachStepFl = true;
+ 	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
+ 	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
+ }
+ 
+ void Timer::getTiedUp2() {
 -	_vm->_animation->tr[0].walkto(4);
 -	_vm->_animation->tr[1].walkto(5);
++	_vm->_animation->tr[0].walkTo(4);
++	_vm->_animation->tr[1].walkTo(5);
+ 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
+ 	_vm->_gyro->_dna._friarWillTieYouUp = true;
+ }
+ 
+ void Timer::hangAround() {
+ 	_vm->_animation->tr[1]._doCheck = false;
+ 	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
+ 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
+ 	_vm->_animation->apped(1, 2);
+ 	_vm->_visa->displayScrollChain('q', 39);
 -	_vm->_animation->tr[0].walkto(7);
++	_vm->_animation->tr[0].walkTo(7);
+ 	addTimer(55, kProcHangAround2, kReasonHangingAround);
+ }
+ 
+ void Timer::hangAround2() {
+ 	_vm->_visa->displayScrollChain('q', 40);
+ 	_vm->_animation->tr[1]._vanishIfStill = false;
 -	_vm->_animation->tr[1].walkto(4);
++	_vm->_animation->tr[1].walkTo(4);
+ 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
+ 	_vm->_visa->displayScrollChain('q', 41);
+ 	_vm->_animation->tr[0].done();
+ 	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
+ 
+ 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
+ 	// Immediately call the following proc (when you have a chance).
+ 
+ 	_vm->_gyro->_dna._tiedUp = false;
+ 
+ 	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
+ }
+ 
+ void Timer::afterTheShootemup() {
+ 
+ 	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
+ 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
+ 
+ 	_vm->_animation->tr[0].init(0, true, _vm->_animation); // Avalot.
+ 	_vm->_animation->apped(1, 2);
+ 	_vm->_gyro->_dna._userMovesAvvy = true;
+ 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
+ 	_vm->_lucerna->refreshObjectList();
+ 
+ 	// Same as the added line above: TODO: Remove it later!!!
+ 	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+ 		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+ 
+ #if 0
+ 	byte shootscore, gain;
+ 
+ 	shootscore = mem[storage_seg * storage_ofs];
+ 	gain = (shootscore + 5) / 10; // Rounding up.
+ 
+ 	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
+ 		strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points.");
+ 
+ 	if (gain > 20) {
+ 		display("But we won't let you have more than 20 points!");
+ 		points(20);
+ 	} else
+ 		points(gain);
+ #endif
+ 
+ 	warning("STUB: Timer::after_the_shootemup()");
+ 
+ 	_vm->_visa->displayScrollChain('q', 70);
+ }
+ 
+ void Timer::jacquesWakesUp() {
+ 	_vm->_gyro->_dna._jacquesState++;
+ 
+ 	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
+ 	case 1 :
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
+ 		_vm->_visa->displayScrollChain('Q', 45);
+ 		break;
+ 	case 2 : // Going through the door.
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
+ 		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
+ 		break;
+ 	case 3 :  // Gone through the door.
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
+ 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
+ 		break;
+ 	}
+ 
+ 	if (_vm->_gyro->_dna._jacquesState == 5) {
+ 		_vm->_gyro->_dna._bellsAreRinging = true;
+ 		_vm->_gyro->_dna._aylesIsAwake = true;
+ 		_vm->_lucerna->incScore(2);
+ 	}
+ 
+ 	switch (_vm->_gyro->_dna._jacquesState) {
+ 	case 1:
+ 	case 2:
+ 	case 3:
+ 		addTimer(12, kProcJacquesWakesUp, kReasonJacquesWakingUp);
+ 		break;
+ 	case 4:
+ 		addTimer(24, kProcJacquesWakesUp, kReasonJacquesWakingUp);
+ 		break;
+ 	}
+ }
+ 
+ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
+ 	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
+ 	_vm->_animation->apped(2, 1); // He starts at the door...
 -	_vm->_animation->tr[1].walkto(3); // He walks over to you.
++	_vm->_animation->tr[1].walkTo(3); // He walks over to you.
+ 
+ 	// Let's get the door opening.
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+ 	_vm->_sequence->firstShow(2);
+ 	_vm->_sequence->startToClose();
+ 
+ 	addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
+ }
+ 
+ void Timer::naughtyDuke2() {
+ 	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 -	_vm->_animation->tr[1].walkto(1); // Walk to the door.
++	_vm->_animation->tr[1].walkTo(1); // Walk to the door.
+ 	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
+ 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
+ }
+ 
+ void Timer::naughtyDuke3() {
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+ 	_vm->_sequence->firstShow(2);
+ 	_vm->_sequence->startToClose();
+ }
+ 
+ void Timer::jump() {
+ 	_vm->_gyro->_dna._jumpStatus++;
+ 
+ 	switch (_vm->_gyro->_dna._jumpStatus) {
+ 	case 1:
+ 	case 2:
+ 	case 3:
+ 	case 5:
+ 	case 7:
+ 	case 9:
+ 		_vm->_animation->tr[0]._y--;
+ 		break;
+ 	case 12:
+ 	case 13:
+ 	case 14:
+ 	case 16:
+ 	case 18:
+ 	case 19:
+ 		_vm->_animation->tr[0]._y++;
+ 		break;
+ 	}
+ 
+ 	if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
+ 		_vm->_gyro->_dna._userMovesAvvy = true;
+ 		_vm->_gyro->_dna._jumpStatus = 0;
+ 	} else { // Still jumping.
+ 		addTimer(1, kProcJump, kReasonJumping);
+ 	}
+ 
+ 	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
+ 			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
+ 			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
+ 			&& (_vm->_animation->infield(3))) { // Beside the wall
+ 		// Grab the arrow!
+ 		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
+ 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
+ 		else {
+ 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+ 			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
+ 			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
+ 			_vm->_lucerna->refreshObjectList();
+ 			_vm->_visa->displayScrollChain('q', 50);
+ 			_vm->_lucerna->incScore(3);
+ 		}
+ 	}
+ }
+ 
+ void Timer::crapulusSaysSpludOut() {
+ 	_vm->_visa->displayScrollChain('q', 56);
+ 	_vm->_gyro->_dna._crapulusWillTell = false;
+ }
+ 
+ void Timer::buyDrinks() {
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+ 	_vm->_gyro->_dna._malagauche = 0;
+ 
+ 	_vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it.
+ 	_vm->_pingo->wobble(); // Do the special effects.
+ 	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
+ 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
+ 		_vm->_visa->displayScrollChain('D', 3); // Tell 'em you paid up.
+ 	_vm->_acci->drink();
+ }
+ 
+ void Timer::buyWine() {
+ 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+ 	_vm->_gyro->_dna._malagauche = 0;
+ 
+ 	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
+ 	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
+ 	if (_vm->_gyro->decreaseMoney(3)) {
+ 		_vm->_visa->displayScrollChain('D', 4); // You paid up.
+ 		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
+ 		_vm->_lucerna->refreshObjectList();
+ 		_vm->_gyro->_dna._wineState = 1; // OK Wine.
+ 	}
+ }
+ 
+ void Timer::callsGuards() {
+ 	_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
+ 	_vm->_lucerna->gameOver();
+ }
+ 
+ void Timer::greetsMonk() {
+ 	_vm->_visa->displayScrollChain('Q', 59);
+ 	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
+ }
+ 
+ void Timer::fallDownOubliette() {
+ 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
+ 	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
+ 	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
+ 	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
+ }
+ 
+ void Timer::meetAvaroid() {
+ 	if (_vm->_gyro->_dna._metAvaroid) {
+ 		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+ 			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
+ 		_vm->_lucerna->gameOver();
+ 	} else {
+ 		_vm->_visa->displayScrollChain('Q', 60);
+ 		_vm->_gyro->_dna._metAvaroid = true;
+ 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
+ 
+ 		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
+ 		_vm->_animation->tr[0]._x = 151;
+ 		_vm->_animation->tr[0]._moveX = -3;
+ 		_vm->_animation->tr[0]._moveY = -5;
+ 
+ 		_vm->_gyro->setBackgroundColor(2);
+ 	}
+ }
+ 
+ void Timer::riseUpOubliette() {
+ 	_vm->_animation->tr[0]._visible = true;
+ 	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
+ 	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
+ 	if (_vm->_animation->tr[0]._moveY > 0)
+ 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
+ 	else
+ 		_vm->_gyro->_dna._userMovesAvvy = true;
+ }
+ 
+ void Timer::robinHoodAndGeida() {
+ 	_vm->_animation->tr[0].init(7, true, _vm->_animation);
+ 	_vm->_animation->apped(1, 7);
 -	_vm->_animation->tr[0].walkto(6);
++	_vm->_animation->tr[0].walkTo(6);
+ 	_vm->_animation->tr[1].stopWalk();
+ 	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+ 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
+ 	_vm->_gyro->_dna._geidaFollows = false;
+ }
+ 
+ void Timer::robinHoodAndGeidaTalk() {
+ 	_vm->_visa->displayScrollChain('q', 66);
 -	_vm->_animation->tr[0].walkto(2);
 -	_vm->_animation->tr[1].walkto(2);
++	_vm->_animation->tr[0].walkTo(2);
++	_vm->_animation->tr[1].walkTo(2);
+ 	_vm->_animation->tr[0]._vanishIfStill = true;
+ 	_vm->_animation->tr[1]._vanishIfStill = true;
+ 	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
+ }
+ 
+ void Timer::avalotReturns() {
+ 	_vm->_animation->tr[0].done();
+ 	_vm->_animation->tr[1].done();
+ 	_vm->_animation->tr[0].init(0, true, _vm->_animation);
+ 	_vm->_animation->apped(1, 1);
+ 	_vm->_visa->displayScrollChain('q', 67);
+ 	_vm->_gyro->_dna._userMovesAvvy = true;
+ }
+ 
+ /**
+  * This is used when you sit down in the pub in Notts. It loops around
+  * so that it will happen when Avvy stops walking.
+  * @remarks	Originally called 'avvy_sit_down'
+  */
+ void Timer::avvySitDown() {
+ 	if (_vm->_animation->tr[0]._homing)    // Still walking.
+ 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
+ 	else {
+ 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+ 		_vm->_gyro->_dna._sittingInPub = true;
+ 		_vm->_gyro->_dna._userMovesAvvy = false;
+ 		_vm->_animation->tr[0]._visible = false;
+ 	}
+ }
+ 
+ void Timer::ghostRoomPhew() {
+ 	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+ 		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
+ }
+ 
+ void Timer::arkataShouts() {
+ 	if (_vm->_gyro->_dna._teetotal)
+ 		return;
+ 
+ 	_vm->_visa->displayScrollChain('q', 76);
+ 	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
+ }
+ 
+ void Timer::winning() {
+ 	_vm->_visa->displayScrollChain('q', 79);
+ 	_vm->_pingo->winningPic();
+ 
+ 	warning("STUB: Timer::winning()");
+ #if 0
+ 	do {
+ 		_vm->_lucerna->checkclick();
+ 	} while (!(_vm->_gyro->mrelease == 0));
+ #endif
+ 	// TODO: To be implemented with Pingo::winningPic().
+ 
+ 	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
+ 	_vm->_scrolls->displayText(" T H E    E N D ");
+ 	_vm->_gyro->_letMeOut = true;
+ }
+ 
+ void Timer::avalotFalls() {
+ 	if (_vm->_animation->tr[0]._stepNum < 5) {
+ 		_vm->_animation->tr[0]._stepNum++;
+ 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
+ 	} else {
+ 		Common::String toDisplay;
+ 		for (byte i = 0; i < 6; i++)
+ 			toDisplay += _vm->_scrolls->kControlNewLine;
+ 		for (byte i = 0; i < 6; i++)
+ 			toDisplay += _vm->_scrolls->kControlInsertSpaces;
+ 		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
+ 		_vm->_scrolls->displayText(toDisplay);
+ 	}
+ }
+ 
+ void Timer::spludwickGoesToCauldron() {
+ 	if (_vm->_animation->tr[1]._homing)
+ 		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
+ 	else
+ 		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
+ }
+ 
+ void Timer::spludwickLeavesCauldron() {
+ 	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
+ }
+ 
+ void Timer::giveLuteToGeida() { // Moved here from Acci.
+ 	_vm->_visa->displayScrollChain('Q', 86);
+ 	_vm->_lucerna->incScore(4);
+ 	_vm->_gyro->_dna._lustieIsAsleep = true;
+ 	_vm->_sequence->firstShow(5);
+ 	_vm->_sequence->thenShow(6); // He falls asleep...
+ 	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
+ }
+ 
+ } // End of namespace Avalanche.


Commit: 8f152c083394a877db1d2576e6654cdbdee5999e
    https://github.com/scummvm/scummvm/commit/8f152c083394a877db1d2576e6654cdbdee5999e
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T02:40:35-07:00

Commit Message:
AVALANCHE: Renaming/refactoring in Animation.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/dropdown2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index aa99517..d30b659 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1278,7 +1278,7 @@ void Acci::personSpeaks() {
 	bool found = false; // The _person we're looking for's code is in _person.
 
 	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->tr[i]._quick && ((_vm->_animation->tr[i]._stat.accinum + 149) == _person)) {
+		if (_vm->_animation->tr[i]._quick && ((_vm->_animation->tr[i]._stat._acciNum + 149) == _person)) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 9aee7db..bdf2bb4 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -88,11 +88,11 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {
 	_stat._frameNum = inf.readByte();
 	_info._xLength = inf.readByte();
 	_info._yLength = inf.readByte();
-	_stat.seq = inf.readByte();
+	_stat._seq = inf.readByte();
 	_info._size = inf.readUint16LE();
 	_stat._fgBubbleCol = inf.readByte();
 	_stat._bgBubbleCol = inf.readByte();
-	_stat.accinum = inf.readByte();
+	_stat._acciNum = inf.readByte();
 
 	_animCount = 0; // = 1;
 	_info._xWidth = _info._xLength / 8;
@@ -144,7 +144,7 @@ void AnimationType::original() {
 void AnimationType::andexor() {
 	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
-	byte picnum = _facingDir * _stat.seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
+	byte picnum = _facingDir * _stat._seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
 
 	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
@@ -245,7 +245,7 @@ void AnimationType::walk() {
 		_count++;
 		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
 			_stepNum++;
-			if (_stepNum == _stat.seq)
+			if (_stepNum == _stat._seq)
 				_stepNum = 0;
 			_count = 0;
 		}
@@ -970,7 +970,6 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 
 void Animation::newspeed() {
 	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.
-	const ByteField lightspace = {40, 199, 47, 199};
 
 	tr[0]._moveX = (tr[0]._moveX / 3) * tr[0]._speedX;
 
@@ -1072,7 +1071,7 @@ void Animation::follow_avvy_y(byte tripnum) {
 			return;
 		if (tr[tripnum]._moveX == 0)  {
 			tr[tripnum]._stepNum += 1;
-			if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+			if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
 				tr[tripnum]._stepNum = 0;
 			tr[tripnum]._count = 0;
 		}
@@ -1170,7 +1169,7 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 		if (tr[tripnum]._y < toy)
 			tr[tripnum]._y++;
 		tr[tripnum]._stepNum++;
-		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+		if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
 			tr[tripnum]._stepNum = 0;
 	}
 }
@@ -1178,7 +1177,7 @@ void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 void Animation::take_a_step(byte &tripnum) {
 	if (tr[tripnum]._moveX == 0) {
 		tr[tripnum]._stepNum++;
-		if (tr[tripnum]._stepNum == tr[tripnum]._stat.seq)
+		if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
 			tr[tripnum]._stepNum = 0;
 		tr[tripnum]._count = 0;
 	}
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 00f1154..7cb8e12 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -37,46 +37,23 @@
 
 namespace Avalanche {
 class AvalancheEngine;
+class Animation;
 
-struct adxtype { // Second revision of ADX type
-	// CHECKME: Useless?
-	Common::String _name; // name of character
-	Common::String _comment; // comment
+struct StatType {
+	Common::String _name; // Name of character.
+	Common::String _comment; // Comment.
 	//
-	byte _frameNum; // number of pictures
-	byte seq; // how many in one stride
-	byte _fgBubbleCol, _bgBubbleCol; // foreground & background bubble colors
-	byte accinum; // the number according to Acci (1=Avvy, etc.)
-};
-
-struct AnimationSaver {
-	byte _id;
-	byte _facingDir;
-	byte _stepNum;
-	int16 _x;
-	int16 _y;
-	int8 _moveX;
-	int8 _moveY;
-	bool _visible;
-	bool _homing;
-	bool _doCheck;
-	byte _count;
-	byte _xWidth, _speedX, _speedY;
-	byte _animCount;
-	int16 _homingX;
-	int16 _homingY;
-	bool _callEachStepFl;
-	byte _eachStepProc;
-	bool _vanishIfStill;
+	byte _frameNum; // Number of pictures.
+	byte _seq; // How many in one stride.
+	byte _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
+	byte _acciNum; // The number according to Acci. (1=Avvy, etc.)
 };
 
-class Animation;
-
 class AnimationType {
 public:
 	SpriteInfo _info;
 
-	adxtype _stat; // Vital statistics.
+	StatType _stat; // Vital statistics.
 	byte _facingDir, _stepNum;
 	int16 _x, _y; // Current xy coords.
 	int16 _oldX[2], _oldY[2];  // Last xy coords.
@@ -116,7 +93,6 @@ private:
 class Animation {
 public:
 	friend class AnimationType;
-	friend class getsettype;
 
 	static const byte kDirUp = 0;
 	static const byte kDirRight = 1;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index ef44815..2d6d272 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -231,8 +231,6 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Drop
 }
 
 void MenuBar::draw() {
-	const ByteField menuspace = {0, 0, 80, 9};
-
 	//setactivepage(3);
 
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 98a1e22..b0be188 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -245,7 +245,7 @@ void Visa::talkTo(byte whom) {
 
 	bool noMatches = true;
 	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
-		if (_vm->_animation->tr[i]._stat.accinum == whom) {
+		if (_vm->_animation->tr[i]._stat._acciNum == whom) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
 			noMatches = false;
 			break;


Commit: 3cc438171a55d21dbbe7644dcbb2317b2b4041fb
    https://github.com/scummvm/scummvm/commit/3cc438171a55d21dbbe7644dcbb2317b2b4041fb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T02:47:00-07:00

Commit Message:
AVALANCHE: Review variable scope in Visa2, add some doxygen comments

Changed paths:
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index b0be188..9904e94 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -42,7 +42,7 @@ namespace Avalanche {
 
 Visa::Visa(AvalancheEngine *vm) {
 	_vm = vm;
-	noError = true;
+	_noError = true;
 }
 
 void Visa::unSkrimble() {
@@ -55,29 +55,32 @@ void Visa::doTheBubble() {
 	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
 }
 
+/**
+ * Display a string in a scroll
+ * @remarks	Originally called 'dixi'
+ */
 void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling) {
-	Common::File indexfile, sezfile;
-	uint16 idx_offset, sez_offset;
-	bool error = false;
-
+	Common::File indexfile;
 	if (!indexfile.open("avalot.idx")) {
 		warning("AVALANCHE: Visa: File not found: avalot.idx");
 		return;
 	}
 
+	bool error = false;
+
 	indexfile.seek((toupper(block) - 65) * 2);
-	idx_offset = indexfile.readUint16LE();
+	uint16 idx_offset = indexfile.readUint16LE();
 	if (idx_offset == 0)
 		error = true;
 
 	indexfile.seek(idx_offset + point * 2);
-	sez_offset = indexfile.readUint16LE();
+	uint16 sez_offset = indexfile.readUint16LE();
 	if (sez_offset == 0)
 		error = true;
 
 	indexfile.close();
 
-	noError = !error;
+	_noError = !error;
 
 	if (error) {
 		if (report) {
@@ -88,6 +91,7 @@ void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling
 		return;
 	}
 
+	Common::File sezfile;
 	if (!sezfile.open("avalot.sez")) {
 		warning("AVALANCHE: Visa: File not found: avalot.sez");
 		return;
@@ -104,47 +108,53 @@ void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling
 	_vm->_scrolls->callScrollDriver();
 }
 
+/**
+ * Start speech
+ * @remarks	Originally called 'speech'
+ */
 void Visa::speak(byte who, byte subject) {
-	Common::File indexfile, sezfile;
-
 	if (subject == 0) { // No subject.
 		displayScrollChain('s', who, false, true);
-	} else { // Subject given.
-		noError = false; // Assume that until we know otherwise.
-
-		if (!indexfile.open("converse.avd")) {
-			warning("AVALANCHE: Visa: File not found: converse.avd");
-			return;
-		}
+		return;
+	}
 
-		indexfile.seek(who * 2 - 2);
-		uint16 idx_offset = indexfile.readUint16LE();
-		uint16 next_idx_offset = indexfile.readUint16LE();
+	// Subject given.
+	_noError = false; // Assume that until we know otherwise.
 
-		if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
-			return;
+	Common::File indexfile;
+	if (!indexfile.open("converse.avd")) {
+		warning("AVALANCHE: Visa: File not found: converse.avd");
+		return;
+	}
 
-		indexfile.seek(idx_offset + subject * 2);
-		uint16 sez_offset = indexfile.readUint16LE();
-		if ((sez_offset == 0) || (indexfile.err()))
-			return;
-		indexfile.close();
+	indexfile.seek(who * 2 - 2);
+	uint16 idx_offset = indexfile.readUint16LE();
+	uint16 next_idx_offset = indexfile.readUint16LE();
 
-		if (!sezfile.open("avalot.sez")) {
-			warning("AVALANCHE: Visa: File not found: avalot.sez");
-			return;
-		}
-		sezfile.seek(sez_offset);
-		_vm->_gyro->_bufSize = sezfile.readUint16LE();
-		sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
-		sezfile.close();
+	if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
+		return;
 
-		unSkrimble();
-		doTheBubble();
+	indexfile.seek(idx_offset + subject * 2);
+	uint16 sez_offset = indexfile.readUint16LE();
+	if ((sez_offset == 0) || (indexfile.err()))
+		return;
+	indexfile.close();
 
-		_vm->_scrolls->callScrollDriver();
-		noError = true;
+	Common::File sezfile;
+	if (!sezfile.open("avalot.sez")) {
+		warning("AVALANCHE: Visa: File not found: avalot.sez");
+		return;
 	}
+	sezfile.seek(sez_offset);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	sezfile.close();
+
+	unSkrimble();
+	doTheBubble();
+
+	_vm->_scrolls->callScrollDriver();
+	_noError = true;
 }
 
 void Visa::talkTo(byte whom) {
@@ -153,7 +163,7 @@ void Visa::talkTo(byte whom) {
 		_vm->_gyro->_subjectNum = 0;
 	}
 
-	if (_vm->_gyro->_subjectNum == 0)
+	if (_vm->_gyro->_subjectNum == 0) {
 		switch (whom) {
 		case Gyro::kPeopleSpludwick:
 			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) {
@@ -162,27 +172,21 @@ void Visa::talkTo(byte whom) {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_lucerna->incScore(3);
 				return;
-			} else {
-				if (_vm->_gyro->_dna._talkedToCrapulus)
-					// Spludwick - what does he need?
-					// 0 - let it through to use normal routine.
-					switch (_vm->_gyro->_dna._givenToSpludwick) {
-					case 1: // Falltrough is intended.
-					case 2:{
-						_vm->_scrolls->displayText(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
-						return;
-						}
-						break;
-					case 3: {
-						displayScrollChain('q', 30); // Need any help with the game?
-						return;
-						}
-						break;
-				}
-				else {
-					displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+			} else if (_vm->_gyro->_dna._talkedToCrapulus) {
+				// Spludwick - what does he need?
+				// 0 - let it through to use normal routine.
+				switch (_vm->_gyro->_dna._givenToSpludwick) {
+				case 1: // Fallthrough is intended.
+				case 2:
+					_vm->_scrolls->displayText(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+					return;
+				case 3:
+					displayScrollChain('q', 30); // Need any help with the game?
 					return;
 				}
+			} else {
+				displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+				return;
 			}
 			break;
 		case Gyro::kPeopleIbythneth:
@@ -208,10 +212,10 @@ void Visa::talkTo(byte whom) {
 			}
 			break;
 
-		case Gyro::kPeopleJacques: {
+		case Gyro::kPeopleJacques:
 			displayScrollChain('q', 43);
 			return;
-			}
+
 		case Gyro::kPeopleGeida:
 			if (_vm->_gyro->_dna._givenPotionToGeida)
 				_vm->_gyro->_dna._geidaFollows = true;
@@ -233,30 +237,31 @@ void Visa::talkTo(byte whom) {
 				}
 			}
 			break;
-	}
-	// On a subject. Is there any reason to block it?
-	else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
-			displayScrollChain('q', 43); // He's fast asleep!
-			return;
 		}
+	// On a subject. Is there any reason to block it?
+	} else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
+		displayScrollChain('q', 43); // He's fast asleep!
+		return;
+	}
 
 	if (whom > 149)
 		whom -= 149;
 
 	bool noMatches = true;
-	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
+	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->tr[i]._stat._acciNum == whom) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
 			noMatches = false;
 			break;
 		}
+	}
 
 	if (noMatches)
 		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
 
 	speak(whom, _vm->_gyro->_subjectNum);
 
-	if (!noError)
+	if (!_noError)
 		displayScrollChain('n', whom); // File not found!
 
 	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
@@ -264,7 +269,6 @@ void Visa::talkTo(byte whom) {
 		_vm->_lucerna->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_gyro->_dna._talkedToCrapulus = true;
-
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_animation->tr[1]._vanishIfStill = true;
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
index 7a1597c..c811053 100644
--- a/engines/avalanche/visa2.h
+++ b/engines/avalanche/visa2.h
@@ -39,16 +39,16 @@ class Visa {
 public:
 	Visa(AvalancheEngine *vm);
 
-	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false); // Original: dixi().
+	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
 	void talkTo(byte whom);
 
 private:
 	AvalancheEngine *_vm;
 
-	bool noError;
+	bool _noError;
 	void unSkrimble();
 	void doTheBubble();
-	void speak(byte who, byte subject); // Original: speech().
+	void speak(byte who, byte subject);
 };
 
 } // End of namespace Avalanche.


Commit: c0243036a293430b7872b3450735c9cc9e68930a
    https://github.com/scummvm/scummvm/commit/c0243036a293430b7872b3450735c9cc9e68930a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:06:08-07:00

Commit Message:
AVALANCHE: Renaming/refactoring in Animation.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timer.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index d30b659..10b32cf 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -407,8 +407,8 @@ void Acci::storeInterrogation(byte interrogation) {
 			_vm->_gyro->_dna._spareEvening.clear();
 		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->tr[1].walkTo(4); // The end of the drawbridge
-		_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
+		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
+		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 		_vm->_gyro->_dna._cardiffQuestionNum = 5;
 		break;
@@ -896,7 +896,7 @@ void Acci::openDoor() {
 	// Special cases.
 	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
-		if (_vm->_animation->infield(2)) {
+		if (_vm->_animation->inField(2)) {
 			// Opening the box.
 			_thing = 54; // The box.
 			_person = kPardon;
@@ -916,25 +916,25 @@ void Acci::openDoor() {
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte fv = 8; fv < 15; fv++) {
-		if (_vm->_animation->infield(fv + 1)) {
+		if (_vm->_animation->inField(fv + 1)) {
 			fv -= 8;
 
 			switch (_vm->_gyro->_portals[fv]._operation) {
 			case Gyro::kMagicExclaim:
-				_vm->_animation->tr[0].bounce();
+				_vm->_animation->_sprites[0].bounce();
 				_vm->_visa->displayScrollChain('x', _vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicTransport:
-				_vm->_animation->fliproom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
+				_vm->_animation->flipRoom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
 					                 (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte
 									 );
 				break;
 			case Gyro::kMagicUnfinished:
-				_vm->_animation->tr[0].bounce();
+				_vm->_animation->_sprites[0].bounce();
 				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
-				_vm->_animation->call_special(_vm->_gyro->_portals[fv]._data);
+				_vm->_animation->callSpecial(_vm->_gyro->_portals[fv]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
 				_vm->_animation->openDoor((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
@@ -1040,9 +1040,9 @@ void Acci::notInOrder() {
 }
 
 void Acci::goToCauldron() {
-	_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
+	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
 	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludWalk);
-	_vm->_animation->tr[1].walkTo(2);
+	_vm->_animation->_sprites[1].walkTo(2);
 }
 
 /**
@@ -1102,9 +1102,9 @@ void Acci::drink() {
 		_vm->_lucerna->refreshObjectList();
 		_vm->_lucerna->dusk();
 		_vm->_gyro->hangAroundForAWhile();
-		_vm->_animation->fliproom(1, 1);
+		_vm->_animation->flipRoom(1, 1);
 		_vm->_gyro->setBackgroundColor(14);
-		_vm->_animation->new_game_for_trippancy(); // Not really.
+		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
 
@@ -1112,12 +1112,12 @@ void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_dna._standingOnDais) { // Clamber up.
 		_vm->_scrolls->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_dna._standingOnDais = false;
-		_vm->_animation->apped(1, 3);
+		_vm->_animation->appearPed(1, 3);
 	} else { // Clamber down.
-		if (_vm->_animation->infield(1)) {
+		if (_vm->_animation->inField(1)) {
 			_vm->_scrolls->displayText("You clamber up onto the dais.");
 			_vm->_gyro->_dna._standingOnDais = true;
-			_vm->_animation->apped(1, 2);
+			_vm->_animation->appearPed(1, 2);
 		} else
 			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
 	}
@@ -1136,9 +1136,9 @@ void Acci::standUp() {
 				_vm->_gyro->setBackgroundColor(0);
 				_vm->_visa->displayScrollChain('d', 14);
 			}
-			_vm->_animation->tr[0]._visible = true;
+			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
-			_vm->_animation->apped(1, 2);
+			_vm->_animation->appearPed(1, 2);
 			_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
@@ -1155,8 +1155,8 @@ void Acci::standUp() {
 	case r__nottspub:
 		if (_vm->_gyro->_dna._sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
-			_vm->_animation->tr[0]._visible = true; // But standing up.
-			_vm->_animation->apped(1, 4); // And walking away.
+			_vm->_animation->_sprites[0]._visible = true; // But standing up.
+			_vm->_animation->appearPed(1, 4); // And walking away.
 			_vm->_gyro->_dna._sittingInPub = false; // Really not sitting down.
 			_vm->_gyro->_dna._userMovesAvvy = true; // And ambulant.
 		} else
@@ -1172,7 +1172,7 @@ void Acci::standUp() {
 void Acci::getProc(char thing) {
 	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
-		if (_vm->_animation->infield(2)) {
+		if (_vm->_animation->inField(2)) {
 			if (_vm->_gyro->_dna._boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->displayText("OK, I've got it.");
@@ -1188,13 +1188,13 @@ void Acci::getProc(char thing) {
 	case r__insidecardiffcastle:
 		switch (thing) {
 		case Gyro::kObjectPen:
-			if (_vm->_animation->infield(2)) { // Standing on the dais.
+			if (_vm->_animation->inField(2)) { // Standing on the dais.
 				if (_vm->_gyro->_dna._takenPen)
 					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
-					_vm->_animation->call_special(3); // Zap!
+					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_gyro->_dna._takenPen = true;
 					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
@@ -1213,7 +1213,7 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_animation->infield(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
+		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_dna._mushroomGrowing = false;
@@ -1247,7 +1247,7 @@ void Acci::giveGeidaTheLute() {
 }
 
 void Acci::playHarp() {
-	if (_vm->_animation->infield(7))
+	if (_vm->_animation->inField(7))
 		_vm->_scrolls->musicalScroll();
 	else
 		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
@@ -1278,7 +1278,7 @@ void Acci::personSpeaks() {
 	bool found = false; // The _person we're looking for's code is in _person.
 
 	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->tr[i]._quick && ((_vm->_animation->tr[i]._stat._acciNum + 149) == _person)) {
+		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
 		}
@@ -1568,13 +1568,13 @@ void Acci::doThat() {
 						i = 3;
 					else
 						i = 0;
-					if (_vm->_animation->tr[0]._id != i) {
-						int16 x = _vm->_animation->tr[0]._x;
-						int16 y = _vm->_animation->tr[0]._y;
-						_vm->_animation->tr[0].done();
-						_vm->_animation->tr[0].init(i, true, _vm->_animation);
-						_vm->_animation->tr[0].appear(x, y, Animation::kDirLeft);
-						_vm->_animation->tr[0]._visible = false;
+					if (_vm->_animation->_sprites[0]._id != i) {
+						int16 x = _vm->_animation->_sprites[0]._x;
+						int16 y = _vm->_animation->_sprites[0]._y;
+						_vm->_animation->_sprites[0].done();
+						_vm->_animation->_sprites[0].init(i, true, _vm->_animation);
+						_vm->_animation->_sprites[0].appear(x, y, Animation::kDirLeft);
+						_vm->_animation->_sprites[0]._visible = false;
 					}
 				}
 				break;
@@ -1695,16 +1695,16 @@ void Acci::doThat() {
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
 			_vm->_visa->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->infield(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
 				_vm->_visa->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->displayScrollChain('q', 18);
 				else {
-					_vm->_animation->tr[1].init(1, false, _vm->_animation); // Avaricius
-					_vm->_animation->apped(2, 4);
-					_vm->_animation->tr[1].walkTo(5);
-					_vm->_animation->tr[1]._callEachStepFl = true;
-					_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
+					_vm->_animation->_sprites[1].init(1, false, _vm->_animation); // Avaricius
+					_vm->_animation->appearPed(2, 4);
+					_vm->_animation->_sprites[1].walkTo(5);
+					_vm->_animation->_sprites[1]._callEachStepFl = true;
+					_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timer->addTimer(177, _vm->_timer->kProcAvariciusTalks, _vm->_timer->kReasonAvariciusTalks);
 				}
@@ -1744,7 +1744,7 @@ void Acci::doThat() {
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_dna._room) {
 		case r__argentpub:
-			if (_vm->_animation->infield(6)) { // We're in a pub, and near the bar.
+			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
 				switch (_thing) {
 				case 51:
 				case 53:
@@ -1804,7 +1804,7 @@ void Acci::doThat() {
 			break;
 
 		case r__outsideducks:
-			if (_vm->_animation->infield(6)) {
+			if (_vm->_animation->inField(6)) {
 				if (_thing == _vm->_gyro->kObjectOnion) {
 					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
 						_vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things!
@@ -1861,9 +1861,9 @@ void Acci::doThat() {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
 				_vm->_lucerna->incScore(7);
-				_vm->_animation->tr[1].walkTo(2);
-				_vm->_animation->tr[1]._vanishIfStill = true;
-				_vm->_animation->tr[1]._callEachStepFl = false;
+				_vm->_animation->_sprites[1].walkTo(2);
+				_vm->_animation->_sprites[1]._vanishIfStill = true;
+				_vm->_animation->_sprites[1]._callEachStepFl = false;
 				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
@@ -1984,7 +1984,7 @@ void Acci::doThat() {
 			if (_vm->_gyro->_dna._sittingInPub)
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
-				_vm->_animation->tr[0].walkTo(4); // Move Avvy to the place, and sit him down.
+				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
 				_vm->_timer->addTimer(1, _vm->_timer->kProcAvvySitDown, _vm->_timer->kReasonSittingDown);
 			}
 		} else { // Default doodah.
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index bdf2bb4..f83173e 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -121,7 +121,7 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {
 	_speedX = 3;
 	_speedY = 1;
 	if (spritenum == 1)
-		_tr->newspeed(); // Just for the lights.
+		_tr->updateSpeed(); // Just for the lights.
 
 	_homing = false;
 	_moveX = 0;
@@ -173,10 +173,10 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  */
 bool AnimationType::checkCollision() {
 	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) {
-		if (_tr->tr[i]._quick && (_tr->tr[i]._id != _id) &&
-			((_x + _info._xLength) > _tr->tr[i]._x) &&
-			(_x < (_tr->tr[i]._x + _tr->tr[i]._info._xLength)) &&
-			(_tr->tr[i]._y == _y))
+		if (_tr->_sprites[i]._quick && (_tr->_sprites[i]._id != _id) &&
+			((_x + _info._xLength) > _tr->_sprites[i]._x) &&
+			(_x < (_tr->_sprites[i]._x + _tr->_sprites[i]._info._xLength)) &&
+			(_tr->_sprites[i]._y == _y))
 				return true;
 	}
 
@@ -209,22 +209,22 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte tc = _tr->checkfeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		byte tc = _tr->checkFeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
 			switch (_tr->_vm->_gyro->_magics[tc]._operation) {
 			case Gyro::kMagicExclaim: {
 				bounce();
-				_tr->mustexclaim = true;
-				_tr->saywhat = _tr->_vm->_gyro->_magics[tc]._data;
+				_tr->_mustExclaim = true;
+				_tr->_sayWhat = _tr->_vm->_gyro->_magics[tc]._data;
 				}
 				break;
 			case Gyro::kMagicBounce:
 				bounce();
 				break;
 			case Gyro::kMagicTransport:
-				_tr->fliproom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
+				_tr->flipRoom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
@@ -232,7 +232,7 @@ void AnimationType::walk() {
 				}
 				break;
 			case Gyro::kMagicSpecial:
-				_tr->call_special(_tr->_vm->_gyro->_magics[tc]._data);
+				_tr->callSpecial(_tr->_vm->_gyro->_magics[tc]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
 				_tr->openDoor(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
@@ -366,25 +366,22 @@ void AnimationType::done() {
 Animation::Animation(AvalancheEngine *vm) {
 	_vm = vm;
 
-	mustexclaim = false;
+	_mustExclaim = false;
 }
 
 Animation::~Animation() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick)
-			tr[i].done();
+		if (_sprites[i]._quick)
+			_sprites[i].done();
 	}
 }
 
-void Animation::loadtrip() {
+void Animation::loadAnims() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++)
-		tr[i].original();
-
-	for (uint16 i = 0; i < sizeof(aa); i++)
-		aa[i] = 0;
+		_sprites[i].original();
 }
 
-byte Animation::checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
+byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	// if not alive then begin checkfeet:=0; exit; end;
 	byte a = 0;
 
@@ -432,11 +429,7 @@ byte Animation::geida_ped(byte which) {
 	}
 }
 
-void Animation::catamove(byte ped) {
-/* When you enter a new position in the catacombs, this procedure should
-	be called. It changes the Also codes so that they may match the picture
-	on the screen. (Coming soon: It draws up the screen, too.) */
-
+void Animation::catacombMove(byte ped) {
 	int32 here;
 	uint16 xy_uint16;
 	byte fv;
@@ -451,22 +444,22 @@ void Animation::catamove(byte ped) {
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
-		fliproom(r__lustiesroom, 4);
+		flipRoom(r__lustiesroom, 4);
 		_vm->_scrolls->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033: // Oubliette
-		fliproom(r__oubliette, 1);
+		flipRoom(r__oubliette, 1);
 		_vm->_scrolls->displayText(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
 		return;
 	case 4:
-		fliproom(r__geidas, 1);
+		flipRoom(r__geidas, 1);
 		return;
 	case 2307:
-		fliproom(r__lusties, 5);
+		flipRoom(r__lusties, 5);
 		_vm->_scrolls->displayText("Oh no... here we go again...");
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0]._moveY = 1;
-		tr[0]._moveX = 0;
+		_sprites[0]._moveY = 1;
+		_sprites[0]._moveX = 0;
 		return;
 	}
 
@@ -735,11 +728,11 @@ void Animation::catamove(byte ped) {
 	}
 
 	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
-		if (!tr[1]._quick)  // If we don't already have her...
-			tr[1].init(5, true, this); // ...Load Geida.
-		apped(2, geida_ped(ped));
-		tr[1]._callEachStepFl = true;
-		tr[1]._eachStepProc = kProcGeida;
+		if (!_sprites[1]._quick)  // If we don't already have her...
+			_sprites[1].init(5, true, this); // ...Load Geida.
+		appearPed(2, geida_ped(ped));
+		_sprites[1]._callEachStepFl = true;
+		_sprites[1]._eachStepProc = kProcGeida;
 	}
 }
 
@@ -750,7 +743,7 @@ void Animation::dawndelay() {
 	_vm->_timer->addTimer(2, _vm->_timer->kProcDawnDelay, _vm->_timer->kReasonDawndelay);
 }
 
-void Animation::call_special(uint16 which) {
+void Animation::callSpecial(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -771,25 +764,25 @@ void Animation::call_special(uint16 which) {
 		_vm->_gyro->_dna._userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
-		tr[0].bounce(); // Must include that.
+		_sprites[0].bounce(); // Must include that.
 
 		if (!_vm->_gyro->_dna._arrowTriggered) {
 			_vm->_gyro->_dna._arrowTriggered = true;
-			apped(2, 4); // The dart starts at ped 4, and...
-			tr[1].walkTo(5); // flies to ped 5.
-			tr[1]._facingDir = kDirUp; // Only face.
+			appearPed(2, 4); // The dart starts at ped 4, and...
+			_sprites[1].walkTo(5); // flies to ped 5.
+			_sprites[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
 			// graphic of the arrow buried in the plaster. */
 
 			// OK!
-			tr[1]._callEachStepFl = true;
-			tr[1]._eachStepProc = kProcArrow;
+			_sprites[1]._callEachStepFl = true;
+			_sprites[1]._eachStepProc = kProcArrow;
 		}
 		break;
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
-		tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
+		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, _vm->_timer->kProcGhostRoomPhew, _vm->_timer->kReasonGhostRoomPhew);
 		_vm->_enid->backToBootstrap(3);
 		break;
@@ -798,28 +791,28 @@ void Animation::call_special(uint16 which) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->displayScrollChain('q', 35);
-			tr[0].done();
+			_sprites[0].done();
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->displayScrollChain('q', 36);
 			_vm->_gyro->_dna._tiedUp = true;
 			_vm->_gyro->_dna._friarWillTieYouUp = false;
-			tr[1].walkTo(3);
-			tr[1]._vanishIfStill = true;
-			tr[1]._doCheck = true; // One of them must have Check_Me switched on.
+			_sprites[1].walkTo(3);
+			_sprites[1]._vanishIfStill = true;
+			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
 			_vm->_timer->addTimer(364, _vm->_timer->kProcHangAround, _vm->_timer->kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		tr[0]._moveX = 3;
-		tr[0]._moveY = 0;
-		tr[0]._facingDir = kDirRight;
+		_sprites[0]._moveX = 3;
+		_sprites[0]._moveY = 0;
+		_sprites[0]._facingDir = kDirRight;
 		_vm->_timer->addTimer(1, _vm->_timer->kProcFallDownOubliette, _vm->_timer->kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
-		tr[0]._visible = false;
+		_sprites[0]._visible = false;
 		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
 		stopWalking();
 		_vm->_timer->loseTimer(_vm->_timer->kReasonFallingDownOubliette);
@@ -831,18 +824,18 @@ void Animation::call_special(uint16 which) {
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
 			_vm->_visa->displayScrollChain('q', 63);
-			tr[1].turn(kDirDown);
-			tr[1].stopWalk();
-			tr[1]._callEachStepFl = false; // Geida
+			_sprites[1].turn(kDirDown);
+			_sprites[1].stopWalk();
+			_sprites[1]._callEachStepFl = false; // Geida
 			_vm->_lucerna->gameOver();
 		}
 		break;
 	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
 		if (!_vm->_gyro->_dna._geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
-		tr[1]._callEachStepFl = false; // She no longer follows Avvy around.
-		tr[1].walkTo(4); // She walks to somewhere...
-		tr[0].done();     // Lose Avvy.
+		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
+		_sprites[1].walkTo(4); // She walks to somewhere...
+		_sprites[0].done();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
 		break;
@@ -858,50 +851,46 @@ void Animation::call_special(uint16 which) {
 		}
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_dna._catacombY--;
-		catamove(4);
+		catacombMove(4);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
-			apped(1, 12);
+			appearPed(1, 12);
 			break;
 		case 0x3:
-			apped(1, 11);
+			appearPed(1, 11);
 			break;
 		default:
-			apped(1, 4);
+			appearPed(1, 4);
 		}
-		getback();
 		dawndelay();
 		break;
 	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_dna._catacombX++;
-		catamove(1);
+		catacombMove(1);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		apped(1, 1);
-		getback();
+		appearPed(1, 1);
 		dawndelay();
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_dna._catacombY += 1;
-		catamove(2);
+		catacombMove(2);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		apped(1, 2);
-		getback();
+		appearPed(1, 2);
 		dawndelay();
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_dna._catacombX--;
-		catamove(3);
+		catacombMove(3);
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
-		apped(1, 3);
-		getback();
+		appearPed(1, 3);
 		dawndelay();
 		break;
 	}
@@ -949,8 +938,8 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 				_vm->_sequence->startToClose();
 				return;
 			} else {
-				apped(1, 6);
-				tr[0]._facingDir = kDirRight; // added by TT 12/3/1995
+				appearPed(1, 6);
+				_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
 				_vm->_sequence->firstShow(8);
 				_vm->_sequence->thenShow(9);
 			}
@@ -968,19 +957,19 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	_vm->_sequence->startToOpen();
 }
 
-void Animation::newspeed() {
+void Animation::updateSpeed() {
 	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.
 
-	tr[0]._moveX = (tr[0]._moveX / 3) * tr[0]._speedX;
+	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
 
 	//setactivepage(3);
 
-	if (tr[0]._speedX == _vm->_gyro->kRun)
+	if (_sprites[0]._speedX == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
 
-	if (tr[0]._speedX == _vm->_gyro->kRun)
+	if (_sprites[0]._speedX == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
@@ -988,129 +977,97 @@ void Animation::newspeed() {
 	//setactivepage(1 - cp);
 }
 
-void Animation::rwsp(byte t, byte dir) {
+void Animation::changeDirection(byte t, byte dir) {
 	switch (dir) {
 	case kDirUp:
-		tr[t].speed(0, -tr[t]._speedY);
+		_sprites[t].speed(0, -_sprites[t]._speedY);
 		break;
 	case kDirDown:
-		tr[t].speed(0, tr[t]._speedY);
+		_sprites[t].speed(0, _sprites[t]._speedY);
 		break;
 	case kDirLeft:
-		tr[t].speed(-tr[t]._speedX,  0);
+		_sprites[t].speed(-_sprites[t]._speedX,  0);
 		break;
 	case kDirRight:
-		tr[t].speed(tr[t]._speedX,  0);
+		_sprites[t].speed(_sprites[t]._speedX,  0);
 		break;
 	case kDirUpLeft:
-		tr[t].speed(-tr[t]._speedX, -tr[t]._speedY);
+		_sprites[t].speed(-_sprites[t]._speedX, -_sprites[t]._speedY);
 		break;
 	case kDirUpRight:
-		tr[t].speed(tr[t]._speedX, -tr[t]._speedY);
+		_sprites[t].speed(_sprites[t]._speedX, -_sprites[t]._speedY);
 		break;
 	case kDirDownLeft:
-		tr[t].speed(-tr[t]._speedX, tr[t]._speedY);
+		_sprites[t].speed(-_sprites[t]._speedX, _sprites[t]._speedY);
 		break;
 	case kDirDownRight:
-		tr[t].speed(tr[t]._speedX, tr[t]._speedY);
+		_sprites[t].speed(_sprites[t]._speedX, _sprites[t]._speedY);
 		break;
 	}
 }
 
-void Animation::apped(byte trn, byte np) {
+void Animation::appearPed(byte trn, byte np) {
 	trn--;
 	np--;
-	tr[trn].appear(_vm->_gyro->_peds[np]._x - tr[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - tr[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
-	rwsp(trn, _vm->_gyro->_peds[np]._direction);
-}
-
-#if 0
-   function overlap(x1,y1,x2,y2,x3,y3,x4,y4:uint16):bool;
-	begin // By De Morgan's law:
-	overlap:=(x2>=x3) and (x4>=x1) and (y2>=y3) and (y4>=y1);
-	end;
-#endif
-	//x1,x2 - as _vm->_gyro->bytefield, but *8. y1,y2 - as _vm->_gyro->bytefield.
-	//x3,y3 = mx,my. x4,y4 = mx+16,my+16.
-
-void Animation::getback() {
-	// Super_Off;
-#if 0
-	while (getset[1 - _vm->_gyro->cp].numleft > 0) {
-		getset[1 - _vm->_gyro->cp].recall(r);
-
-
-		bool endangered = false;
-		if overlaps_with_mouse and not endangered then
-			begin
-				endangered:=true;
-				blitfix;
-				Super_Off;
-			end;
-
-		//_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
-	}
-
-	if endangered then
-		Super_On;
-#endif
+	_sprites[trn].appear(_vm->_gyro->_peds[np]._x - _sprites[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - _sprites[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
+	changeDirection(trn, _vm->_gyro->_peds[np]._direction);
 }
 
 // Eachstep procedures:
 void Animation::follow_avvy_y(byte tripnum) {
-	if (tr[0]._facingDir == kDirLeft)
+	if (_sprites[0]._facingDir == kDirLeft)
 		return;
-	if (tr[tripnum]._homing)
-		tr[tripnum]._homingY = tr[1]._y;
+	if (_sprites[tripnum]._homing)
+		_sprites[tripnum]._homingY = _sprites[1]._y;
 	else {
-		if (tr[tripnum]._y < tr[1]._y)
-			tr[tripnum]._y += 1;
-		else if (tr[tripnum]._y > tr[1]._y)
-			tr[tripnum]._y -= 1;
+		if (_sprites[tripnum]._y < _sprites[1]._y)
+			_sprites[tripnum]._y += 1;
+		else if (_sprites[tripnum]._y > _sprites[1]._y)
+			_sprites[tripnum]._y -= 1;
 		else
 			return;
-		if (tr[tripnum]._moveX == 0)  {
-			tr[tripnum]._stepNum += 1;
-			if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
-				tr[tripnum]._stepNum = 0;
-			tr[tripnum]._count = 0;
+		if (_sprites[tripnum]._moveX == 0)  {
+			_sprites[tripnum]._stepNum += 1;
+			if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
+				_sprites[tripnum]._stepNum = 0;
+			_sprites[tripnum]._count = 0;
 		}
 	}
 }
 
 void Animation::back_and_forth(byte tripnum) {
-	if (!tr[tripnum]._homing) {
-		if (tr[tripnum]._facingDir == kDirRight)
-			tr[tripnum].walkTo(4);
+	if (!_sprites[tripnum]._homing) {
+		if (_sprites[tripnum]._facingDir == kDirRight)
+			_sprites[tripnum].walkTo(4);
 		else
-			tr[tripnum].walkTo(5);
+			_sprites[tripnum].walkTo(5);
 	}
 }
 
 void Animation::face_avvy(byte tripnum) {
-	if (!tr[tripnum]._homing) {
-		if (tr[0]._x >= tr[tripnum]._x)
-			tr[tripnum]._facingDir = kDirRight;
+	if (!_sprites[tripnum]._homing) {
+		if (_sprites[0]._x >= _sprites[tripnum]._x)
+			_sprites[tripnum]._facingDir = kDirRight;
 		else
-			tr[tripnum]._facingDir = kDirLeft;
+			_sprites[tripnum]._facingDir = kDirLeft;
 	}
 }
 
 void Animation::arrow_procs(byte tripnum) {
-	if (tr[tripnum]._homing) {
+	if (_sprites[tripnum]._homing) {
 		// Arrow is still in flight.
 		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((tr[tripnum]._y + tr[tripnum]._info._yLength) >= tr[0]._y) // A
-				&& (tr[tripnum]._x <= (tr[0]._x + tr[0]._info._xLength)) // B
-				&& ((tr[tripnum]._x + tr[tripnum]._info._xLength) >= tr[0]._x)) { // C
+		if (((_sprites[tripnum]._y + _sprites[tripnum]._info._yLength) >= _sprites[0]._y) // A
+				&& (_sprites[tripnum]._x <= (_sprites[0]._x + _sprites[0]._info._xLength)) // B
+				&& ((_sprites[tripnum]._x + _sprites[tripnum]._info._xLength) >= _sprites[0]._x)) { // C
 			// OK, it's hit him... what now?
 
-			tr[1]._callEachStepFl = false; // prevent recursion.
+			_sprites[1]._callEachStepFl = false; // prevent recursion.
 			_vm->_visa->displayScrollChain('Q', 47); // Complaint!
-			tr[tripnum].done(); // Deallocate the arrow.
+			_sprites[tripnum].done(); // Deallocate the arrow.
 #if 0
 			tr[1].done; { Deallocate normal pic of Avvy. }
 
@@ -1128,7 +1085,7 @@ void Animation::arrow_procs(byte tripnum) {
 			_vm->_timer->addTimer(55, _vm->_timer->kProcNaughtyDuke, _vm->_timer->kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
-		tr[tripnum].done(); // Deallocate the arrow.
+		_sprites[tripnum].done(); // Deallocate the arrow.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
 		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
 	}
@@ -1152,41 +1109,41 @@ end;
 #endif
 
 void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
-	int16 tox = tr[0]._x + 17;
-	int16 toy = tr[0]._y - 1;
-	if ((tr[tripnum]._x == tox) && (tr[tripnum]._y == toy)) {
-		tr[tripnum]._callEachStepFl = false;
-		tr[tripnum]._facingDir = kDirLeft;
-		tr[tripnum].stopWalk();
+	int16 tox = _sprites[0]._x + 17;
+	int16 toy = _sprites[0]._y - 1;
+	if ((_sprites[tripnum]._x == tox) && (_sprites[tripnum]._y == toy)) {
+		_sprites[tripnum]._callEachStepFl = false;
+		_sprites[tripnum]._facingDir = kDirLeft;
+		_sprites[tripnum].stopWalk();
 		// ... whatever ...
 	} else {
 		// Still some way to go.
-		if (tr[tripnum]._x < tox) {
-			tr[tripnum]._x += 5;
-			if (tr[tripnum]._x > tox)
-				tr[tripnum]._x = tox;
+		if (_sprites[tripnum]._x < tox) {
+			_sprites[tripnum]._x += 5;
+			if (_sprites[tripnum]._x > tox)
+				_sprites[tripnum]._x = tox;
 		}
-		if (tr[tripnum]._y < toy)
-			tr[tripnum]._y++;
-		tr[tripnum]._stepNum++;
-		if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
-			tr[tripnum]._stepNum = 0;
+		if (_sprites[tripnum]._y < toy)
+			_sprites[tripnum]._y++;
+		_sprites[tripnum]._stepNum++;
+		if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
+			_sprites[tripnum]._stepNum = 0;
 	}
 }
 
-void Animation::take_a_step(byte &tripnum) {
-	if (tr[tripnum]._moveX == 0) {
-		tr[tripnum]._stepNum++;
-		if (tr[tripnum]._stepNum == tr[tripnum]._stat._seq)
-			tr[tripnum]._stepNum = 0;
-		tr[tripnum]._count = 0;
+void Animation::takeAStep(byte &tripnum) {
+	if (_sprites[tripnum]._moveX == 0) {
+		_sprites[tripnum]._stepNum++;
+		if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
+			_sprites[tripnum]._stepNum = 0;
+		_sprites[tripnum]._count = 0;
 	}
 }
 
 void Animation::spin(byte whichway, byte &tripnum) {
-	if (tr[tripnum]._facingDir != whichway) {
-		tr[tripnum]._facingDir = whichway;
-		if (tr[tripnum]._id == 2)
+	if (_sprites[tripnum]._facingDir != whichway) {
+		_sprites[tripnum]._facingDir = whichway;
+		if (_sprites[tripnum]._id == 2)
 			return; // Not for Spludwick
 
 		_vm->_gyro->_dna._geidaSpin += 1;
@@ -1206,35 +1163,35 @@ void Animation::geida_procs(byte tripnum) {
 			_vm->_gyro->_dna._geidaSpin = 0;
 	}
 
-	if (tr[tripnum]._y < (tr[0]._y - 2)) {
+	if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
 		// Geida is further from the screen than Avvy.
 		spin(kDirDown, tripnum);
-		tr[tripnum]._moveY = 1;
-		tr[tripnum]._moveX = 0;
-		take_a_step(tripnum);
+		_sprites[tripnum]._moveY = 1;
+		_sprites[tripnum]._moveX = 0;
+		takeAStep(tripnum);
 		return;
-	} else if (tr[tripnum]._y > (tr[0]._y + 2)) {
+	} else if (_sprites[tripnum]._y > (_sprites[0]._y + 2)) {
 		// Avvy is further from the screen than Geida.
 		spin(kDirUp, tripnum);
-		tr[tripnum]._moveY = -1;
-		tr[tripnum]._moveX = 0;
-		take_a_step(tripnum);
+		_sprites[tripnum]._moveY = -1;
+		_sprites[tripnum]._moveX = 0;
+		takeAStep(tripnum);
 		return;
 	}
 
-	tr[tripnum]._moveY = 0;
+	_sprites[tripnum]._moveY = 0;
 	// These 12-s are not in the original, I added them to make the following method more "smooth".
 	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
-	if (tr[tripnum]._x < tr[0]._x - tr[0]._speedX * 8 - 12) {
-		tr[tripnum]._moveX = tr[0]._speedX;
+	if (_sprites[tripnum]._x < _sprites[0]._x - _sprites[0]._speedX * 8 - 12) {
+		_sprites[tripnum]._moveX = _sprites[0]._speedX;
 		spin(kDirRight, tripnum);
-		take_a_step(tripnum);
-	} else if (tr[tripnum]._x > tr[0]._x + tr[0]._speedX * 8 + 12) {
-		tr[tripnum]._moveX = -tr[0]._speedX;
+		takeAStep(tripnum);
+	} else if (_sprites[tripnum]._x > _sprites[0]._x + _sprites[0]._speedX * 8 + 12) {
+		_sprites[tripnum]._moveX = -_sprites[0]._speedX;
 		spin(kDirLeft, tripnum);
-		take_a_step(tripnum);
+		takeAStep(tripnum);
 	} else
-		tr[tripnum]._moveX = 0;
+		_sprites[tripnum]._moveX = 0;
 }
 
 // That's all...
@@ -1248,7 +1205,7 @@ void Animation::call_andexors() {
 		order[i] = -1;
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick && tr[i]._visible)
+		if (_sprites[i]._quick && _sprites[i]._visible)
 			order[i] = i;
 	}
 
@@ -1256,7 +1213,7 @@ void Animation::call_andexors() {
 		ok = true;
 		for (byte i = 0; i < 4; i++) {
 			if (((order[i] != -1) && (order[i + 1] != -1))
-					&& (tr[order[i]]._y > tr[order[i + 1]]._y)) {
+					&& (_sprites[order[i]]._y > _sprites[order[i + 1]]._y)) {
 				// Swap them!
 				temp = order[i];
 				order[i] = order[i + 1];
@@ -1271,7 +1228,7 @@ void Animation::call_andexors() {
 
 	for (byte i = 0; i < 5; i++) {
 		if (order[i] > -1)
-			tr[order[i]].andexor();
+			_sprites[order[i]].andexor();
 	}
 }
 
@@ -1283,15 +1240,15 @@ void Animation::animLink() {
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick && tr[i]._visible)
-			tr[i].walk();
+		if (_sprites[i]._quick && _sprites[i]._visible)
+			_sprites[i].walk();
 	}
 
 	call_andexors();
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick && tr[i]._callEachStepFl) {
-			switch (tr[i]._eachStepProc) {
+		if (_sprites[i]._quick && _sprites[i]._callEachStepFl) {
+			switch (_sprites[i]._eachStepProc) {
 			case kProcFollowAvvyY :
 				follow_avvy_y(i);
 				break;
@@ -1315,35 +1272,17 @@ void Animation::animLink() {
 		}
 	}
 
-	if (mustexclaim) {
-		mustexclaim = false;
-		_vm->_visa->displayScrollChain('x', saywhat);
-	}
-}
-
-void Animation::get_back_loretta() {
-	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick) {
-			getback();
-			return;
-		}
+	if (_mustExclaim) {
+		_mustExclaim = false;
+		_vm->_visa->displayScrollChain('x', _sayWhat);
 	}
-	// for fv:=0 to 1 do begin cp:=1-cp; getback; end;
 }
 
 void Animation::stopWalking() {
-	tr[0].stopWalk();
+	_sprites[0].stopWalk();
 	_vm->_gyro->_dna._direction = kDirStopped;
 	if (_vm->_gyro->_alive)
-		tr[0]._stepNum = 1;
-}
-
-void Animation::tripkey(char dir) {
-	warning("Replaced by Trip::handleMoveKey!");
-}
-
-void Animation::readstick() {
-	warning("STUB: Trip::readstick()");
+		_sprites[0]._stepNum = 1;
 }
 
 /**
@@ -1355,9 +1294,9 @@ void Animation::hideInCupboard() {
 		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
 		else {
-			tr[0]._visible = true;
+			_sprites[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
-			apped(1, 3); // Walk out of the cupboard.
+			appearPed(1, 3); // Walk out of the cupboard.
 			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_dna._avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
@@ -1366,7 +1305,7 @@ void Animation::hideInCupboard() {
 		}
 	} else {
 		// Not hiding in the cupboard
-		tr[0]._visible = false;
+		_sprites[0]._visible = false;
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_scrolls->displayText(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
 			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
@@ -1375,11 +1314,11 @@ void Animation::hideInCupboard() {
 	}
 }
 
-void Animation::fliproom(byte room, byte ped) {
+void Animation::flipRoom(byte room, byte ped) {
 	if (!_vm->_gyro->_alive) {
 		// You can't leave the room if you're dead.
-		tr[0]._moveX = 0;
-		tr[0]._moveY = 0; // Stop him from moving.
+		_sprites[0]._moveX = 0;
+		_sprites[0]._moveY = 0; // Stop him from moving.
 		return;
 	}
 
@@ -1390,7 +1329,7 @@ void Animation::fliproom(byte room, byte ped) {
 
 	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
 		// You can't *jump* out of Cardiff Castle!
-		tr[0]._moveX = 0;
+		_sprites[0]._moveX = 0;
 		return;
 	}
 
@@ -1398,48 +1337,44 @@ void Animation::fliproom(byte room, byte ped) {
 	_vm->_lucerna->dusk();
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
-		if (tr[i]._quick)
-			tr[i].done();
+		if (_sprites[i]._quick)
+			_sprites[i].done();
 	} // Deallocate sprite
 
 	if (_vm->_gyro->_dna._room == r__lustiesroom)
 		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterRoom(room, ped);
-	apped(1, ped);
+	appearPed(1, ped);
 	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
-	_vm->_gyro->_dna._direction = tr[0]._facingDir;
+	_vm->_gyro->_dna._direction = _sprites[0]._facingDir;
 	_vm->_lucerna->drawDirection();
 
-	for (byte i = 0; i <= 1; i++) {
-		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
-		getback();
-	}
 	_vm->_lucerna->dawn();
 
 	// Tidy up after mouse. I know it's a kludge...
 	//  tidy_after_mouse;
 }
 
-bool Animation::infield(byte which) {
+bool Animation::inField(byte which) {
 	which--; // Pascal -> C: different array indexes.
 
-	int16 yy = tr[0]._y + tr[0]._info._yLength;
+	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
 
-	return (tr[0]._x >= _vm->_gyro->_fields[which]._x1) && (tr[0]._x <= _vm->_gyro->_fields[which]._x2)
+	return (_sprites[0]._x >= _vm->_gyro->_fields[which]._x1) && (_sprites[0]._x <= _vm->_gyro->_fields[which]._x2)
 		&& (yy >= _vm->_gyro->_fields[which]._y1) && (yy <= _vm->_gyro->_fields[which]._y2);
 
 }
 
-bool Animation::neardoor() {
+bool Animation::nearDoor() {
 	if (_vm->_gyro->_fieldNum < 8) {
 		// there ARE no doors here!
 		return false;
 	}
 
-	int16 ux = tr[0]._x;
-	int16 uy = tr[0]._y + tr[0]._info._yLength;
+	int16 ux = _sprites[0]._x;
+	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
 	bool nd = false;
 	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
 		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
@@ -1448,10 +1383,6 @@ bool Animation::neardoor() {
 	return nd;
 }
 
-void Animation::new_game_for_trippancy() {   // Called by gyro.newgame
-	tr[0]._visible = false;
-}
-
 void Animation::handleMoveKey(const Common::Event &event) {
 	if (!_vm->_gyro->_dna._userMovesAvvy)
 		return;
@@ -1463,56 +1394,56 @@ void Animation::handleMoveKey(const Common::Event &event) {
 		case Common::KEYCODE_UP:
 			if (_vm->_gyro->_dna._direction != kDirUp) {
 				_vm->_gyro->_dna._direction = kDirUp;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_DOWN:
 			if (_vm->_gyro->_dna._direction != kDirDown) {
 				_vm->_gyro->_dna._direction = kDirDown;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_LEFT:
 			if (_vm->_gyro->_dna._direction != kDirLeft) {
 				_vm->_gyro->_dna._direction = kDirLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_RIGHT:
 			if (_vm->_gyro->_dna._direction != kDirRight) {
 				_vm->_gyro->_dna._direction = kDirRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
 			if (_vm->_gyro->_dna._direction != kDirUpRight) {
 				_vm->_gyro->_dna._direction = kDirUpRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
 			if (_vm->_gyro->_dna._direction != kDirDownRight) {
 				_vm->_gyro->_dna._direction = kDirDownRight;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_END:
 			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
 				_vm->_gyro->_dna._direction = kDirDownLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_HOME:
 			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
 				_vm->_gyro->_dna._direction = kDirUpLeft;
-				rwsp(0, _vm->_gyro->_dna._direction);
+				changeDirection(0, _vm->_gyro->_dna._direction);
 			} else
 				stopWalking();
 			break;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 7cb8e12..cfb1cfe 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -118,39 +118,28 @@ public:
 	~Animation();
 
 	void animLink();
-	void get_back_loretta();
-	void loadtrip();
-	void call_special(uint16 which);
+	void loadAnims(); // Original: loadtrip().
+	void callSpecial(uint16 which);
 	void openDoor(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
-	void catamove(byte ped);
+	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
 	void stopWalking();
-	void tripkey(char dir);
-	void rwsp(byte t, byte dir);
-	void apped(byte trn, byte np);
-	void getback();
-	void fliproom(byte room, byte ped);
-	bool infield(byte which); // Returns true if you're within field "which".
-	bool neardoor(); // Returns True if you're near a door.
-	void readstick();
-	void newspeed();
-	void new_game_for_trippancy();
-	void take_a_step(byte &tripnum);
+	void changeDirection(byte t, byte dir);
+	void appearPed(byte trn, byte np);
+	void flipRoom(byte room, byte ped);
+	bool inField(byte which); // Returns true if you're within field "which".
+	bool nearDoor(); // Returns True if you're near a door.
+	void updateSpeed();
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
-	AnimationType tr[kSpriteNumbMax];
-	byte aa[1600];
+	AnimationType _sprites[kSpriteNumbMax];
 
-	bool mustexclaim;
-	uint16 saywhat;
+	bool _mustExclaim;
+	uint16 _sayWhat;
 
 private:
 	AvalancheEngine *_vm;
 
-	// CHECKME: Useless?
-	// ByteField r;
-	// int16 beforex, beforey;
-
-	byte checkfeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
+	byte checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
 	byte geida_ped(byte which);
 	void dawndelay();
 	void hideInCupboard();
@@ -160,7 +149,10 @@ private:
 	void arrow_procs(byte tripnum);
 	void grab_avvy(byte tripnum);
 	void spin(byte whichway, byte &tripnum);
+
+	void takeAStep(byte &tripnum);
 	void geida_procs(byte tripnum);
+
 	void call_andexors();
 };
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b28fe7f..195ddef 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -283,7 +283,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
 		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) {
-			if (_animation->tr[i]._quick)
+			if (_animation->_sprites[i]._quick)
 				spriteNum++;
 		}
 	}
@@ -291,43 +291,43 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	if (sz.isLoading()) {
 		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
-			if (_animation->tr[i]._quick)
-				_animation->tr[i].done();
+			if (_animation->_sprites[i]._quick)
+				_animation->_sprites[i].done();
 		}
 	}
 
 	for (byte i = 0; i < spriteNum; i++) {
-		sz.syncAsByte(_animation->tr[i]._id);
-		sz.syncAsByte(_animation->tr[i]._doCheck);
+		sz.syncAsByte(_animation->_sprites[i]._id);
+		sz.syncAsByte(_animation->_sprites[i]._doCheck);
 
 
 		if (sz.isLoading()) {
-			_animation->tr[i]._quick = true;
-			_animation->tr[i].init(_animation->tr[i]._id, _animation->tr[i]._doCheck, _animation);
+			_animation->_sprites[i]._quick = true;
+			_animation->_sprites[i].init(_animation->_sprites[i]._id, _animation->_sprites[i]._doCheck, _animation);
 		}
 
-		sz.syncAsByte(_animation->tr[i]._moveX);
-		sz.syncAsByte(_animation->tr[i]._moveY);
-		sz.syncAsByte(_animation->tr[i]._facingDir);
-		sz.syncAsByte(_animation->tr[i]._stepNum);
-		sz.syncAsByte(_animation->tr[i]._visible);
-		sz.syncAsByte(_animation->tr[i]._homing);
-		sz.syncAsByte(_animation->tr[i]._count);
-		sz.syncAsByte(_animation->tr[i]._info._xWidth);
-		sz.syncAsByte(_animation->tr[i]._speedX);
-		sz.syncAsByte(_animation->tr[i]._speedY);
-		sz.syncAsByte(_animation->tr[i]._animCount);
-		sz.syncAsSint16LE(_animation->tr[i]._homingX);
-		sz.syncAsSint16LE(_animation->tr[i]._homingY);
-		sz.syncAsByte(_animation->tr[i]._callEachStepFl);
-		sz.syncAsByte(_animation->tr[i]._eachStepProc);
-		sz.syncAsByte(_animation->tr[i]._vanishIfStill);
-
-		sz.syncAsSint16LE(_animation->tr[i]._x);
-		sz.syncAsSint16LE(_animation->tr[i]._y);
-
-		if (sz.isLoading() && _animation->tr[i]._visible)
-			_animation->tr[i].appear(_animation->tr[i]._x, _animation->tr[i]._y, _animation->tr[i]._facingDir);
+		sz.syncAsByte(_animation->_sprites[i]._moveX);
+		sz.syncAsByte(_animation->_sprites[i]._moveY);
+		sz.syncAsByte(_animation->_sprites[i]._facingDir);
+		sz.syncAsByte(_animation->_sprites[i]._stepNum);
+		sz.syncAsByte(_animation->_sprites[i]._visible);
+		sz.syncAsByte(_animation->_sprites[i]._homing);
+		sz.syncAsByte(_animation->_sprites[i]._count);
+		sz.syncAsByte(_animation->_sprites[i]._info._xWidth);
+		sz.syncAsByte(_animation->_sprites[i]._speedX);
+		sz.syncAsByte(_animation->_sprites[i]._speedY);
+		sz.syncAsByte(_animation->_sprites[i]._animCount);
+		sz.syncAsSint16LE(_animation->_sprites[i]._homingX);
+		sz.syncAsSint16LE(_animation->_sprites[i]._homingY);
+		sz.syncAsByte(_animation->_sprites[i]._callEachStepFl);
+		sz.syncAsByte(_animation->_sprites[i]._eachStepProc);
+		sz.syncAsByte(_animation->_sprites[i]._vanishIfStill);
+
+		sz.syncAsSint16LE(_animation->_sprites[i]._x);
+		sz.syncAsSint16LE(_animation->_sprites[i]._y);
+
+		if (sz.isLoading() && _animation->_sprites[i]._visible)
+			_animation->_sprites[i].appear(_animation->_sprites[i]._x, _animation->_sprites[i]._y, _animation->_sprites[i]._facingDir);
 	}
 
 	//groi = 177;
@@ -470,7 +470,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_lucerna->refreshObjectList();
 
-	_animation->newspeed();
+	_animation->updateSpeed();
 
 	_lucerna->drawDirection();
 
@@ -484,8 +484,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
 		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
 
-	if (_animation->tr[0]._quick && _animation->tr[0]._visible)
-		_animation->rwsp(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
+	if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible)
+		_animation->changeDirection(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a439238..99c3950 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -156,15 +156,14 @@ void Avalot::setup() {
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
-	_vm->_animation->loadtrip();
+	_vm->_animation->loadAnims();
 
-	_vm->_animation->get_back_loretta();
 	_vm->_gyro->_holdTheDawn = false;
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
-	_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
-	_vm->_animation->newspeed();
+	_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
+	_vm->_animation->updateSpeed();
 
 
 
@@ -201,7 +200,6 @@ void Avalot::run(Common::String arg) {
 		_vm->_lucerna->_clock.update();
 		_vm->_dropdown->updateMenu();
 		_vm->_gyro->forceNumlock();
-		_vm->_animation->get_back_loretta();
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 2d6d272..12af639 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -449,12 +449,12 @@ void Dropdown::setupMenuAction() {
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
 	if (_vm->_gyro->_dna._room == 99)
-		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->neardoor());
+		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
 	else
-		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->neardoor());
+		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->tr[0]._speedX == _vm->_gyro->kWalk)
+	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -624,11 +624,11 @@ void Dropdown::runMenuAction() {
 		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInv);
 		break;
 	case 5: {
-		if (_vm->_animation->tr[0]._speedX == _vm->_gyro->kWalk)
-			_vm->_animation->tr[0]._speedX = _vm->_gyro->kRun;
+		if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
+			_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kRun;
 		else
-			_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
-		_vm->_animation->newspeed();
+			_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
+		_vm->_animation->updateSpeed();
 	}
 	break;
 	}
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 3f29ca4..c80ac4b 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -228,12 +228,12 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
-		if (_vm->_animation->tr[i]._quick)
-			_vm->_animation->tr[i].done();
+		if (_vm->_animation->_sprites[i]._quick)
+			_vm->_animation->_sprites[i].done();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
-	_vm->_animation->tr[0].init(0, true, _vm->_animation);
+	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
 
 	_alive = true;
 	_score = 0;
@@ -257,7 +257,7 @@ void Gyro::newGame() {
 	_onToolbar = false;
 	_seeScroll = false;
 
-	_vm->_animation->tr[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
+	_vm->_animation->_sprites[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	_him = 254;
@@ -270,13 +270,8 @@ void Gyro::newGame() {
 	_dna._avvyInBed = true;
 	_enidFilename = "";
 
-	for (byte i = 0; i <= 1; i++) {
-		_cp = 1 - _cp;
-		_vm->_animation->getback();
-	}
-
 	_vm->_lucerna->enterRoom(1, 1);
-	_vm->_animation->new_game_for_trippancy();
+	_vm->_animation->_sprites[0]._visible = false;
 	_vm->_lucerna->drawScore();
 	_vm->_dropdown->setupMenu();
 	_vm->_lucerna->_clock.update();
@@ -454,7 +449,7 @@ Common::String Gyro::f5Does() {
 			return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down";
 		break;
 	case r__musicroom:
-		if (_vm->_animation->infield(7))
+		if (_vm->_animation->inField(7))
 			return Common::String(_vm->_acci->kVerbCodePlay) + "PPlay the harp";
 		break;
 	}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 8398439..5782ac9 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -400,10 +400,10 @@ void Lucerna::enterNewTown() {
 void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_animation->tr[1].init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->apped(2, whichPed);
-	_vm->_animation->tr[1]._callEachStepFl = true;
-	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;
+	_vm->_animation->_sprites[1].init(5, false, _vm->_animation); // load Geida
+	_vm->_animation->appearPed(2, whichPed);
+	_vm->_animation->_sprites[1]._callEachStepFl = true;
+	_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGeida;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -445,25 +445,25 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (! _vm->_gyro->_dna._talkedToCrapulus) {
 
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__outsideyours;
-				_vm->_animation->tr[1].init(8, false, _vm->_animation); // load Crapulus
+				_vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
-					_vm->_animation->apped(2, 4); // Start on the right-hand side of the screen.
-					_vm->_animation->tr[1].walkTo(5); // Walks up to greet you.
+					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
+					_vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you.
 				} else {
-					_vm->_animation->apped(2, 5); // Starts where he was before.
-					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+					_vm->_animation->appearPed(2, 5); // Starts where he was before.
+					_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
 				}
 
-				_vm->_animation->tr[1]._callEachStepFl = true;
-				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
+				_vm->_animation->_sprites[1]._callEachStepFl = true;
+				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
 
 			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->_dna._crapulusWillTell) {
-				_vm->_animation->tr[1].init(8, false, _vm->_animation);
-				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkTo(4);
+				_vm->_animation->_sprites[1].init(8, false, _vm->_animation);
+				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->_sprites[1].walkTo(4);
 				_vm->_timer->addTimer(20, _vm->_timer->kProcCrapulusSpludOut, _vm->_timer->kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
@@ -480,15 +480,15 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__spludwicks:
 		if (_vm->_gyro->_dna._spludwickAtHome) {
 			if (ped > 0) {
-				_vm->_animation->tr[1].init(2, false, _vm->_animation); // load Spludwick
-				_vm->_animation->apped(2, 2);
+				_vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick
+				_vm->_animation->appearPed(2, 2);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
 			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
-			_vm->_animation->tr[1]._callEachStepFl = true;
-			_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGeida;
+			_vm->_animation->_sprites[1]._callEachStepFl = true;
+			_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGeida;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -501,18 +501,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot
-				_vm->_animation->tr[1]._callEachStepFl = true;
-				_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;
+				_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot
+				_vm->_animation->_sprites[1]._callEachStepFl = true;
+				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
-					_vm->_animation->apped(2, 2); // He appears on the right of the screen...
-					_vm->_animation->tr[1].walkTo(4); // ...and he walks up...
+					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
+					_vm->_animation->_sprites[1].walkTo(4); // ...and he walks up...
 				} else {
 					// You've been here before.
-					_vm->_animation->apped(2, 4); // He's standing in your way straight away...
-					_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+					_vm->_animation->appearPed(2, 4); // He's standing in your way straight away...
+					_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
 				}
 			}
 		}
@@ -521,10 +521,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__argentroad:
 		if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) &&
 		        (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) {
-			_vm->_animation->tr[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
-			_vm->_animation->apped(2, 1);
-			_vm->_animation->tr[1].walkTo(2);
-			_vm->_animation->tr[1]._vanishIfStill = true;
+			_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
+			_vm->_animation->appearPed(2, 1);
+			_vm->_animation->_sprites[1].walkTo(2);
+			_vm->_animation->_sprites[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timer->addTimer(20, _vm->_timer->kProcCwytalotInHerts, _vm->_timer->kReasonCwytalotInHerts);
@@ -545,9 +545,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->_dna._beenTiedUp) {
 				// A welcome party... or maybe not...
-				_vm->_animation->tr[1].init(6, false, _vm->_animation);
-				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkTo(3);
+				_vm->_animation->_sprites[1].init(6, false, _vm->_animation);
+				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->_sprites[1].walkTo(3);
 				_vm->_timer->addTimer(36, _vm->_timer->kProcGetTiedUp, _vm->_timer->kReasonGettingTiedUp);
 			}
 		}
@@ -569,9 +569,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0)
 			switch (_vm->_gyro->_dna._cardiffQuestionNum) {
 			case 0 : { // You've answered NONE of his questions.
-				_vm->_animation->tr[1].init(9, false, _vm->_animation);
-				_vm->_animation->apped(2, 2);
-				_vm->_animation->tr[1].walkTo(3);
+				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
+				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->_sprites[1].walkTo(3);
 				_vm->_timer->addTimer(47, _vm->_timer->kProcCardiffSurvey, _vm->_timer->kReasonCardiffsurvey);
 			}
 			break;
@@ -579,9 +579,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: { // You've answered SOME of his questions.
-				_vm->_animation->tr[1].init(9, false, _vm->_animation);
-				_vm->_animation->apped(2, 3);
-				_vm->_animation->tr[1]._facingDir = Animation::kDirRight;
+				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
+				_vm->_animation->appearPed(2, 3);
+				_vm->_animation->_sprites[1]._facingDir = Animation::kDirRight;
 				_vm->_timer->addTimer(3, _vm->_timer->kProcCardiffReturn, _vm->_timer->kReasonCardiffsurvey);
 			}
 			}
@@ -631,7 +631,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			}
 
 			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
-			_vm->_animation->catamove(ped);
+			_vm->_animation->catacombMove(ped);
 			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
 		}
 		break;
@@ -649,7 +649,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
-		if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
+		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timer->addTimer(3, _vm->_timer->kProcCallsGuards, _vm->_timer->kReasonDuLustieTalks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
@@ -707,22 +707,22 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__wisewomans:
-		_vm->_animation->tr[1].init(11, false, _vm->_animation);
+		_vm->_animation->_sprites[1].init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_animation->apped(2, 2); // Start on the right-hand side of the screen.
-			_vm->_animation->tr[1].walkTo(4); // Walks up to greet you.
+			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
+			_vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you.
 		} else {
-			_vm->_animation->apped(2, 4); // Starts where she was before.
-			_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+			_vm->_animation->appearPed(2, 4); // Starts where she was before.
+			_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
 		}
 
-		_vm->_animation->tr[1]._callEachStepFl = true;
-		_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
+		_vm->_animation->_sprites[1]._callEachStepFl = true;
+		_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
 		break;
 
 	case r__insidecardiffcastle:
 		if (ped > 0) {
-			_vm->_animation->tr[1].init(10, false, _vm->_animation); // Define the dart.
+			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(1);
@@ -972,22 +972,22 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
 	switch (color) {
 	case kColorGreen:
 		_vm->_gyro->_dna._direction = Animation::kDirUp;
-		_vm->_animation->rwsp(0, Animation::kDirUp);
+		_vm->_animation->changeDirection(0, Animation::kDirUp);
 		drawDirection();
 		break;
 	case kColorBrown:
 		_vm->_gyro->_dna._direction = Animation::kDirDown;
-		_vm->_animation->rwsp(0, Animation::kDirDown);
+		_vm->_animation->changeDirection(0, Animation::kDirDown);
 		drawDirection();
 		break;
 	case kColorCyan:
 		_vm->_gyro->_dna._direction = Animation::kDirLeft;
-		_vm->_animation->rwsp(0, Animation::kDirLeft);
+		_vm->_animation->changeDirection(0, Animation::kDirLeft);
 		drawDirection();
 		break;
 	case kColorLightmagenta:
 		_vm->_gyro->_dna._direction = Animation::kDirRight;
-		_vm->_animation->rwsp(0, Animation::kDirRight);
+		_vm->_animation->changeDirection(0, Animation::kDirRight);
 		drawDirection();
 		break;
 	case kColorRed:
@@ -1025,16 +1025,16 @@ void Lucerna::guideAvvy(Common::Point cursorPos) {
 	byte what;
 
 	// _vm->_animation->tr[0] is Avalot.)
-	if (cursorPos.x < _vm->_animation->tr[0]._x)
+	if (cursorPos.x < _vm->_animation->_sprites[0]._x)
 		what = 1;
-	else if (cursorPos.x > (_vm->_animation->tr[0]._x + _vm->_animation->tr[0]._info._xLength))
+	else if (cursorPos.x > (_vm->_animation->_sprites[0]._x + _vm->_animation->_sprites[0]._info._xLength))
 		what = 2;
 	else
 		what = 0; // On top
 
-	if (cursorPos.y < _vm->_animation->tr[0]._y)
+	if (cursorPos.y < _vm->_animation->_sprites[0]._y)
 		what += 3;
-	else if (cursorPos.y > (_vm->_animation->tr[0]._y + _vm->_animation->tr[0]._info._yLength))
+	else if (cursorPos.y > (_vm->_animation->_sprites[0]._y + _vm->_animation->_sprites[0]._info._yLength))
 		what += 6;
 
 	switch (what) {
@@ -1042,28 +1042,28 @@ void Lucerna::guideAvvy(Common::Point cursorPos) {
 		_vm->_animation->stopWalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_animation->rwsp(0, Animation::kDirLeft);
+		_vm->_animation->changeDirection(0, Animation::kDirLeft);
 		break;
 	case 2:
-		_vm->_animation->rwsp(0, Animation::kDirRight);
+		_vm->_animation->changeDirection(0, Animation::kDirRight);
 		break;
 	case 3:
-		_vm->_animation->rwsp(0, Animation::kDirUp);
+		_vm->_animation->changeDirection(0, Animation::kDirUp);
 		break;
 	case 4:
-		_vm->_animation->rwsp(0, Animation::kDirUpLeft);
+		_vm->_animation->changeDirection(0, Animation::kDirUpLeft);
 		break;
 	case 5:
-		_vm->_animation->rwsp(0, Animation::kDirUpRight);
+		_vm->_animation->changeDirection(0, Animation::kDirUpRight);
 		break;
 	case 6:
-		_vm->_animation->rwsp(0, Animation::kDirDown);
+		_vm->_animation->changeDirection(0, Animation::kDirDown);
 		break;
 	case 7:
-		_vm->_animation->rwsp(0, Animation::kDirDownLeft);
+		_vm->_animation->changeDirection(0, Animation::kDirDownLeft);
 		break;
 	case 8:
-		_vm->_animation->rwsp(0, Animation::kDirDownRight);
+		_vm->_animation->changeDirection(0, Animation::kDirDownRight);
 		break;
 	}    // No other values are possible.
 
@@ -1128,11 +1128,11 @@ void Lucerna::checkClick() {
 
 				callVerb(_vm->_acci->kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_animation->tr[0]._speedX = _vm->_gyro->kWalk;
-				_vm->_animation->newspeed();
+				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
+				_vm->_animation->updateSpeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_animation->tr[0]._speedX = _vm->_gyro->kRun;
-				_vm->_animation->newspeed();
+				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kRun;
+				_vm->_animation->updateSpeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
@@ -1182,13 +1182,13 @@ void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 void Lucerna::gameOver() {
 	_vm->_gyro->_dna._userMovesAvvy = false;
 
-	int16 sx = _vm->_animation->tr[0]._x;
-	int16 sy = _vm->_animation->tr[0]._y;
+	int16 sx = _vm->_animation->_sprites[0]._x;
+	int16 sy = _vm->_animation->_sprites[0]._y;
 
-	_vm->_animation->tr[0].done();
-	_vm->_animation->tr[0].init(12, true, _vm->_animation); // 12 = Avalot falls
-	_vm->_animation->tr[0]._stepNum = 0;
-	_vm->_animation->tr[0].appear(sx, sy, 0);
+	_vm->_animation->_sprites[0].done();
+	_vm->_animation->_sprites[0].init(12, true, _vm->_animation); // 12 = Avalot falls
+	_vm->_animation->_sprites[0]._stepNum = 0;
+	_vm->_animation->_sprites[0].appear(sx, sy, 0);
 
 	_vm->_timer->addTimer(3, _vm->_timer->kProcAvalotFalls, _vm->_timer->kReasonFallingOver);
 	_vm->_gyro->_alive = false;
@@ -1199,11 +1199,6 @@ void Lucerna::minorRedraw() {
 
 	enterRoom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant.
 
-	for (byte i = 0; i <= 1; i++) {
-		_vm->_gyro->_cp = 1 - _vm->_gyro->_cp;
-		_vm->_animation->getback();
-	}
-
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
 	drawScore();
@@ -1220,23 +1215,20 @@ uint16 Lucerna::bearing(byte whichPed) {
 
 	const double rad2deg = 180 / 3.14; // Pi
 
-	if (_vm->_animation->tr[0]._x == _vm->_gyro->_peds[pedId]._x)
+	if (_vm->_animation->_sprites[0]._x == _vm->_gyro->_peds[pedId]._x)
 		return 0;
-	else if (_vm->_animation->tr[0]._x < _vm->_gyro->_peds[pedId]._x) {
-		return (uint16)((atan(double((_vm->_animation->tr[0]._y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_animation->tr[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
+	else if (_vm->_animation->_sprites[0]._x < _vm->_gyro->_peds[pedId]._x) {
+		return (uint16)((atan(double((_vm->_animation->_sprites[0]._y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_animation->_sprites[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
 	} else {
-		return (uint16)((atan(double((_vm->_animation->tr[0]._y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_animation->tr[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
+		return (uint16)((atan(double((_vm->_animation->_sprites[0]._y - _vm->_gyro->_peds[pedId]._y))
+			/ (_vm->_animation->_sprites[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
 	}
 }
 
 void Lucerna::spriteRun() {
 	_vm->_gyro->_doingSpriteRun = true;
-
-	_vm->_animation->get_back_loretta();
 	_vm->_animation->animLink();
-
 	_vm->_gyro->_doingSpriteRun = false;
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index f8972d5..30e5bc4 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -665,11 +665,11 @@ void Scrolls::callScrollDriver() {
 				if (_param == 0)
 					setBubbleStateNatural();
 				else if ((1 <= _param) && (_param <= 9)) {
-					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->tr[_param - 1]._quick)) { // Not valid.
+					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->_sprites[_param - 1]._quick)) { // Not valid.
 						_vm->_lucerna->errorLed();
 						setBubbleStateNatural();
 					} else
-						_vm->_animation->tr[_param - 1].chatter(); // Normal sprite talking routine.
+						_vm->_animation->_sprites[_param - 1].chatter(); // Normal sprite talking routine.
 				} else if ((10 <= _param) && (_param <= 36)) {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 48b8017..600a3ca 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -90,7 +90,7 @@ void Sequence::callSequencer() {
 		break;
 	case 177: // Flip room.
 		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_animation->fliproom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
+		_vm->_animation->flipRoom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
 		if (_seq[0] == 177)
 			shoveLeft();
 		break;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 928ea25..cb765e1 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -253,7 +253,7 @@ void Timer::avariciusTalks() {
 }
 
 void Timer::urinate() {
-	_vm->_animation->tr[0].turn(Animation::kDirUp);
+	_vm->_animation->_sprites[0].turn(Animation::kDirUp);
 	_vm->_animation->stopWalking();
 	_vm->_lucerna->drawDirection();
 	addTimer(14, kProcToilet, kReasonGoToToilet);
@@ -274,7 +274,7 @@ void Timer::bang2() {
 
 void Timer::stairs() {
 	_vm->_gyro->blip();
-	_vm->_animation->tr[0].walkTo(4);
+	_vm->_animation->_sprites[0].walkTo(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->_dna._brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
@@ -307,38 +307,38 @@ void Timer::getTiedUp() {
 	_vm->_gyro->_dna._userMovesAvvy = false;
 	_vm->_gyro->_dna._beenTiedUp = true;
 	_vm->_animation->stopWalking();
-	_vm->_animation->tr[1].stopWalk();
-	_vm->_animation->tr[1].stophoming();
-	_vm->_animation->tr[1]._callEachStepFl = true;
-	_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
+	_vm->_animation->_sprites[1].stopWalk();
+	_vm->_animation->_sprites[1].stophoming();
+	_vm->_animation->_sprites[1]._callEachStepFl = true;
+	_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
 	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
 }
 
 void Timer::getTiedUp2() {
-	_vm->_animation->tr[0].walkTo(4);
-	_vm->_animation->tr[1].walkTo(5);
+	_vm->_animation->_sprites[0].walkTo(4);
+	_vm->_animation->_sprites[1].walkTo(5);
 	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
-	_vm->_animation->tr[1]._doCheck = false;
-	_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
+	_vm->_animation->_sprites[1]._doCheck = false;
+	_vm->_animation->_sprites[0].init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
-	_vm->_animation->apped(1, 2);
+	_vm->_animation->appearPed(1, 2);
 	_vm->_visa->displayScrollChain('q', 39);
-	_vm->_animation->tr[0].walkTo(7);
+	_vm->_animation->_sprites[0].walkTo(7);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timer::hangAround2() {
 	_vm->_visa->displayScrollChain('q', 40);
-	_vm->_animation->tr[1]._vanishIfStill = false;
-	_vm->_animation->tr[1].walkTo(4);
+	_vm->_animation->_sprites[1]._vanishIfStill = false;
+	_vm->_animation->_sprites[1].walkTo(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->displayScrollChain('q', 41);
-	_vm->_animation->tr[0].done();
-	_vm->_animation->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
+	_vm->_animation->_sprites[0].done();
+	_vm->_animation->_sprites[1].done(); // Get rid of Robin Hood and Friar Tuck.
 
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
@@ -350,11 +350,11 @@ void Timer::hangAround2() {
 
 void Timer::afterTheShootemup() {
 
-	_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
+	_vm->_animation->flipRoom(_vm->_gyro->_dna._room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
-	_vm->_animation->tr[0].init(0, true, _vm->_animation); // Avalot.
-	_vm->_animation->apped(1, 2);
+	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
+	_vm->_animation->appearPed(1, 2);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
@@ -423,9 +423,9 @@ void Timer::jacquesWakesUp() {
 }
 
 void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
-	_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
-	_vm->_animation->apped(2, 1); // He starts at the door...
-	_vm->_animation->tr[1].walkTo(3); // He walks over to you.
+	_vm->_animation->_sprites[1].init(9, false, _vm->_animation); // Here comes the Duke.
+	_vm->_animation->appearPed(2, 1); // He starts at the door...
+	_vm->_animation->_sprites[1].walkTo(3); // He walks over to you.
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -437,8 +437,8 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 
 void Timer::naughtyDuke2() {
 	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
-	_vm->_animation->tr[1].walkTo(1); // Walk to the door.
-	_vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
+	_vm->_animation->_sprites[1].walkTo(1); // Walk to the door.
+	_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
 
@@ -458,7 +458,7 @@ void Timer::jump() {
 	case 5:
 	case 7:
 	case 9:
-		_vm->_animation->tr[0]._y--;
+		_vm->_animation->_sprites[0]._y--;
 		break;
 	case 12:
 	case 13:
@@ -466,7 +466,7 @@ void Timer::jump() {
 	case 16:
 	case 18:
 	case 19:
-		_vm->_animation->tr[0]._y++;
+		_vm->_animation->_sprites[0]._y++;
 		break;
 	}
 
@@ -480,7 +480,7 @@ void Timer::jump() {
 	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
 			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
 			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
-			&& (_vm->_animation->infield(3))) { // Beside the wall
+			&& (_vm->_animation->inField(3))) { // Beside the wall
 		// Grab the arrow!
 		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
@@ -538,8 +538,8 @@ void Timer::greetsMonk() {
 
 void Timer::fallDownOubliette() {
 	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
-	_vm->_animation->tr[0]._moveY++; // Increments dx/dy!
-	_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY;   // Dowwwn we go...
+	_vm->_animation->_sprites[0]._moveY++; // Increments dx/dy!
+	_vm->_animation->_sprites[0]._y += _vm->_animation->_sprites[0]._moveY;   // Dowwwn we go...
 	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
 }
 
@@ -553,49 +553,49 @@ void Timer::meetAvaroid() {
 		_vm->_gyro->_dna._metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
-		_vm->_animation->tr[0]._facingDir = Animation::kDirLeft;
-		_vm->_animation->tr[0]._x = 151;
-		_vm->_animation->tr[0]._moveX = -3;
-		_vm->_animation->tr[0]._moveY = -5;
+		_vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft;
+		_vm->_animation->_sprites[0]._x = 151;
+		_vm->_animation->_sprites[0]._moveX = -3;
+		_vm->_animation->_sprites[0]._moveY = -5;
 
 		_vm->_gyro->setBackgroundColor(2);
 	}
 }
 
 void Timer::riseUpOubliette() {
-	_vm->_animation->tr[0]._visible = true;
-	_vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
-	_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
-	if (_vm->_animation->tr[0]._moveY > 0)
+	_vm->_animation->_sprites[0]._visible = true;
+	_vm->_animation->_sprites[0]._moveY++; // Decrements dx/dy!
+	_vm->_animation->_sprites[0]._y -= _vm->_animation->_sprites[0]._moveY; // Uuuupppp we go...
+	if (_vm->_animation->_sprites[0]._moveY > 0)
 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
 		_vm->_gyro->_dna._userMovesAvvy = true;
 }
 
 void Timer::robinHoodAndGeida() {
-	_vm->_animation->tr[0].init(7, true, _vm->_animation);
-	_vm->_animation->apped(1, 7);
-	_vm->_animation->tr[0].walkTo(6);
-	_vm->_animation->tr[1].stopWalk();
-	_vm->_animation->tr[1]._facingDir = Animation::kDirLeft;
+	_vm->_animation->_sprites[0].init(7, true, _vm->_animation);
+	_vm->_animation->appearPed(1, 7);
+	_vm->_animation->_sprites[0].walkTo(6);
+	_vm->_animation->_sprites[1].stopWalk();
+	_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
 	_vm->_gyro->_dna._geidaFollows = false;
 }
 
 void Timer::robinHoodAndGeidaTalk() {
 	_vm->_visa->displayScrollChain('q', 66);
-	_vm->_animation->tr[0].walkTo(2);
-	_vm->_animation->tr[1].walkTo(2);
-	_vm->_animation->tr[0]._vanishIfStill = true;
-	_vm->_animation->tr[1]._vanishIfStill = true;
+	_vm->_animation->_sprites[0].walkTo(2);
+	_vm->_animation->_sprites[1].walkTo(2);
+	_vm->_animation->_sprites[0]._vanishIfStill = true;
+	_vm->_animation->_sprites[1]._vanishIfStill = true;
 	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
 }
 
 void Timer::avalotReturns() {
-	_vm->_animation->tr[0].done();
-	_vm->_animation->tr[1].done();
-	_vm->_animation->tr[0].init(0, true, _vm->_animation);
-	_vm->_animation->apped(1, 1);
+	_vm->_animation->_sprites[0].done();
+	_vm->_animation->_sprites[1].done();
+	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
+	_vm->_animation->appearPed(1, 1);
 	_vm->_visa->displayScrollChain('q', 67);
 	_vm->_gyro->_dna._userMovesAvvy = true;
 }
@@ -606,13 +606,13 @@ void Timer::avalotReturns() {
  * @remarks	Originally called 'avvy_sit_down'
  */
 void Timer::avvySitDown() {
-	if (_vm->_animation->tr[0]._homing)    // Still walking.
+	if (_vm->_animation->_sprites[0]._homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_dna._sittingInPub = true;
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_animation->tr[0]._visible = false;
+		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
 
@@ -647,8 +647,8 @@ void Timer::winning() {
 }
 
 void Timer::avalotFalls() {
-	if (_vm->_animation->tr[0]._stepNum < 5) {
-		_vm->_animation->tr[0]._stepNum++;
+	if (_vm->_animation->_sprites[0]._stepNum < 5) {
+		_vm->_animation->_sprites[0]._stepNum++;
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay;
@@ -662,14 +662,14 @@ void Timer::avalotFalls() {
 }
 
 void Timer::spludwickGoesToCauldron() {
-	if (_vm->_animation->tr[1]._homing)
+	if (_vm->_animation->_sprites[1]._homing)
 		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
 	else
 		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
 }
 
 void Timer::spludwickLeavesCauldron() {
-	_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
+	_vm->_animation->_sprites[1]._callEachStepFl = true; // So that normal procs will continue.
 }
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index b0be188..edea123 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -245,7 +245,7 @@ void Visa::talkTo(byte whom) {
 
 	bool noMatches = true;
 	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
-		if (_vm->_animation->tr[i]._stat._acciNum == whom) {
+		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
 			noMatches = false;
 			break;
@@ -267,8 +267,8 @@ void Visa::talkTo(byte whom) {
 
 		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
-		_vm->_animation->tr[1]._vanishIfStill = true;
-		_vm->_animation->tr[1].walkTo(3); // Walks away.
+		_vm->_animation->_sprites[1]._vanishIfStill = true;
+		_vm->_animation->_sprites[1].walkTo(3); // Walks away.
 
 		_vm->_lucerna->incScore(2);
 	}


Commit: b8d16e894c05aaec679125e25e83abf959608123
    https://github.com/scummvm/scummvm/commit/b8d16e894c05aaec679125e25e83abf959608123
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:06:43-07:00

Commit Message:
AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/visa2.cpp

Changed paths:
    engines/avalanche/visa2.cpp
    engines/avalanche/visa2.h



diff --cc engines/avalanche/visa2.cpp
index edea123,9904e94..d7e1563
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@@ -244,8 -248,8 +248,8 @@@ void Visa::talkTo(byte whom) 
  		whom -= 149;
  
  	bool noMatches = true;
- 	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++)
+ 	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 -		if (_vm->_animation->tr[i]._stat._acciNum == whom) {
 +		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
  			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
  			noMatches = false;
  			break;
@@@ -264,11 -269,10 +269,10 @@@
  		_vm->_lucerna->refreshObjectList();
  		displayScrollChain('q', 1); // Circular from Cardiff.
  		_vm->_gyro->_dna._talkedToCrapulus = true;
- 
  		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
  
 -		_vm->_animation->tr[1]._vanishIfStill = true;
 -		_vm->_animation->tr[1].walkTo(3); // Walks away.
 +		_vm->_animation->_sprites[1]._vanishIfStill = true;
 +		_vm->_animation->_sprites[1].walkTo(3); // Walks away.
  
  		_vm->_lucerna->incScore(2);
  	}


Commit: 55d64e1ed10a5921836c49cb29f6d2a9d61a31be
    https://github.com/scummvm/scummvm/commit/55d64e1ed10a5921836c49cb29f6d2a9d61a31be
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T03:11:20-07:00

Commit Message:
AVALANCHE: Add some doxygen comments in Lucerna

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 5782ac9..2ec32b2 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -177,6 +177,10 @@ void Lucerna::drawAlsoLines() {
 
 // readAlsoStringFromFile, scram and unScramble are only used in loadAlso
 
+/**
+ * Check is it's possible to give something to Spludwick
+ * @remarks	Originally called 'nextstring'
+ */
 Common::String Lucerna::readAlsoStringFromFile() {
 	Common::String str;
 	byte length = file.readByte();
@@ -367,6 +371,12 @@ void Lucerna::exitRoom(byte x) {
 		_vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room;
 }
 
+
+/**
+ * Only when entering a NEW town! Not returning to the last one,
+ * but choosing another from the map.
+ * @remarks	Originally called 'new_town'
+ */
 void Lucerna::enterNewTown() {
 	_vm->_dropdown->setupMenu();
 
@@ -1017,6 +1027,9 @@ void Lucerna::refreshObjectList() {
 	}
 }
 
+/**
+ * @remarks	Originally called 'verte'
+ */
 void Lucerna::guideAvvy(Common::Point cursorPos) {
 	if (!_vm->_gyro->_dna._userMovesAvvy)
 		return;
@@ -1226,6 +1239,13 @@ uint16 Lucerna::bearing(byte whichPed) {
 	}
 }
 
+/** 
+ * A sprite run is performed before displaying a scroll, if not all the
+ * sprites are still. It performs two fast cycles, only using a few of
+ * the links usually used, and without any extra animation. This should
+ * make the sprites the same on both pages.
+ * @remarks	Originally called 'sprite_run'
+ */
 void Lucerna::spriteRun() {
 	_vm->_gyro->_doingSpriteRun = true;
 	_vm->_animation->animLink();
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index ad0e4a2..9c1cc6c 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -48,14 +48,13 @@ private:
 
 	AvalancheEngine *_vm;
 
-	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle; // hourAngle = nh in the original.
-	Common::Point _clockHandHour, _clockHandMinute; // ah and am in the original.
+	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
+	Common::Point _clockHandHour, _clockHandMinute;
 
 	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
 	void drawHand(const Common::Point &endPoint, byte color);
 	void plotHands();
 	void chime();
-
 };
 
 class Lucerna {
@@ -94,28 +93,26 @@ public:
 	void minorRedraw();
 	void majorRedraw();
 
-	// A sprite run is performed before displaying a scroll, if not all the sprites are still. It performs two fast cycles, only using a few of
-	// the links usually used, and without any extra animation. This should make the sprites the same on both pages.
 	void spriteRun();
 
 private:
 	AvalancheEngine *_vm;
 
-	bool _fxHidden; // Will de used in dusk() and dawn().
-
 	Common::File file;
 
-	Common::String readAlsoStringFromFile(); // 'nexstring' in the original.
+	Common::String readAlsoStringFromFile();
 	void scram(Common::String &str);
 	void unScramble();
 
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
-	void enterNewTown(); // Onyl when entering a NEW town! Not returning to the last one, but choosing another from the map.
+	void enterNewTown();
 	void findPeople(byte room);
 	void putGeidaAt(byte whichPed, byte &ped);
-	void guideAvvy(Common::Point cursorPos); // 'verte' in the original.
+	void guideAvvy(Common::Point cursorPos);
+
+	// Will be used in dusk() and dawn().
+	bool _fxHidden;
 
-	// Used in dusk() and dawn().
 	int8 fades(int8 x);
 	void fadeOut(byte n);
 	void fadeIn(byte n);


Commit: b7844c3548a7e911262d35d8ee0a122a5decca7a
    https://github.com/scummvm/scummvm/commit/b7844c3548a7e911262d35d8ee0a122a5decca7a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:21:02-07:00

Commit Message:
AVALANCHE: More renaming/refactoring in Animation.

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f83173e..204121b 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -141,7 +141,7 @@ void AnimationType::original() {
 	_id = 177;
 }
 
-void AnimationType::andexor() {
+void AnimationType::draw() {
 	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
 	byte picnum = _facingDir * _stat._seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
@@ -412,7 +412,7 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	return a;
 }
 
-byte Animation::geida_ped(byte which) {
+byte Animation::geidaPed(byte which) {
 	switch (which) {
 	case 1:
 		return 7;
@@ -730,7 +730,7 @@ void Animation::catacombMove(byte ped) {
 	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
-		appearPed(2, geida_ped(ped));
+		appearPed(2, geidaPed(ped));
 		_sprites[1]._callEachStepFl = true;
 		_sprites[1]._eachStepProc = kProcGeida;
 	}
@@ -739,7 +739,7 @@ void Animation::catacombMove(byte ped) {
 
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
-void Animation::dawndelay() {
+void Animation::dawnDelay() {
 	_vm->_timer->addTimer(2, _vm->_timer->kProcDawnDelay, _vm->_timer->kReasonDawndelay);
 }
 
@@ -864,7 +864,7 @@ void Animation::callSpecial(uint16 which) {
 		default:
 			appearPed(1, 4);
 		}
-		dawndelay();
+		dawnDelay();
 		break;
 	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
 		_vm->_lucerna->dusk();
@@ -873,7 +873,7 @@ void Animation::callSpecial(uint16 which) {
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		appearPed(1, 1);
-		dawndelay();
+		dawnDelay();
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
 		_vm->_lucerna->dusk();
@@ -882,7 +882,7 @@ void Animation::callSpecial(uint16 which) {
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		appearPed(1, 2);
-		dawndelay();
+		dawnDelay();
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
 		_vm->_lucerna->dusk();
@@ -891,7 +891,7 @@ void Animation::callSpecial(uint16 which) {
 		if (_vm->_gyro->_dna._room != r__catacombs)
 			return;
 		appearPed(1, 3);
-		dawndelay();
+		dawnDelay();
 		break;
 	}
 }
@@ -1014,7 +1014,7 @@ void Animation::appearPed(byte trn, byte np) {
 }
 
 // Eachstep procedures:
-void Animation::follow_avvy_y(byte tripnum) {
+void Animation::followAvalotY(byte tripnum) {
 	if (_sprites[0]._facingDir == kDirLeft)
 		return;
 	if (_sprites[tripnum]._homing)
@@ -1035,7 +1035,7 @@ void Animation::follow_avvy_y(byte tripnum) {
 	}
 }
 
-void Animation::back_and_forth(byte tripnum) {
+void Animation::backAndForth(byte tripnum) {
 	if (!_sprites[tripnum]._homing) {
 		if (_sprites[tripnum]._facingDir == kDirRight)
 			_sprites[tripnum].walkTo(4);
@@ -1044,7 +1044,7 @@ void Animation::back_and_forth(byte tripnum) {
 	}
 }
 
-void Animation::face_avvy(byte tripnum) {
+void Animation::faceAvvy(byte tripnum) {
 	if (!_sprites[tripnum]._homing) {
 		if (_sprites[0]._x >= _sprites[tripnum]._x)
 			_sprites[tripnum]._facingDir = kDirRight;
@@ -1053,7 +1053,7 @@ void Animation::face_avvy(byte tripnum) {
 	}
 }
 
-void Animation::arrow_procs(byte tripnum) {
+void Animation::arrowProcs(byte tripnum) {
 	if (_sprites[tripnum]._homing) {
 		// Arrow is still in flight.
 		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
@@ -1108,7 +1108,7 @@ begin
 end;
 #endif
 
-void Animation::grab_avvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
+void Animation::grabAvvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 tox = _sprites[0]._x + 17;
 	int16 toy = _sprites[0]._y - 1;
 	if ((_sprites[tripnum]._x == tox) && (_sprites[tripnum]._y == toy)) {
@@ -1156,7 +1156,7 @@ void Animation::spin(byte whichway, byte &tripnum) {
 	}
 }
 
-void Animation::geida_procs(byte tripnum) {
+void Animation::geidaProcs(byte tripnum) {
 	if (_vm->_gyro->_dna._geidaTime > 0) {
 		_vm->_gyro->_dna._geidaTime--;
 		if (_vm->_gyro->_dna._geidaTime == 0)
@@ -1196,7 +1196,7 @@ void Animation::geida_procs(byte tripnum) {
 
 // That's all...
 
-void Animation::call_andexors() {
+void Animation::drawSprites() {
 	int8 order[5];
 	byte temp;
 	bool ok;
@@ -1228,7 +1228,7 @@ void Animation::call_andexors() {
 
 	for (byte i = 0; i < 5; i++) {
 		if (order[i] > -1)
-			_sprites[order[i]].andexor();
+			_sprites[order[i]].draw();
 	}
 }
 
@@ -1244,29 +1244,29 @@ void Animation::animLink() {
 			_sprites[i].walk();
 	}
 
-	call_andexors();
+	drawSprites();
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._callEachStepFl) {
 			switch (_sprites[i]._eachStepProc) {
 			case kProcFollowAvvyY :
-				follow_avvy_y(i);
+				followAvalotY(i);
 				break;
 			case kProcBackAndForth :
-				back_and_forth(i);
+				backAndForth(i);
 				break;
 			case kProcFaceAvvy :
-				face_avvy(i);
+				faceAvvy(i);
 				break;
 			case kProcArrow :
-				arrow_procs(i);
+				arrowProcs(i);
 				break;
 				//    PROCSpludwick_procs : spludwick_procs(fv);
 			case kProcGrabAvvy :
-				grab_avvy(i);
+				grabAvvy(i);
 				break;
 			case kProcGeida :
-				geida_procs(i);
+				geidaProcs(i);
 				break;
 			}
 		}
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index cfb1cfe..d6a87dc 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -42,7 +42,6 @@ class Animation;
 struct StatType {
 	Common::String _name; // Name of character.
 	Common::String _comment; // Comment.
-	//
 	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
 	byte _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
@@ -52,7 +51,6 @@ struct StatType {
 class AnimationType {
 public:
 	SpriteInfo _info;
-
 	StatType _stat; // Vital statistics.
 	byte _facingDir, _stepNum;
 	int16 _x, _y; // Current xy coords.
@@ -70,7 +68,7 @@ public:
 
 	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
 	void original(); // Just sets 'quick' to false.
-	void andexor(); // Drops sprite onto screen.
+	void draw(); // Drops sprite onto screen. Original: andexor().
 	void turn(byte whichway); // Turns character round.
 	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
 	void bounce(); // Bounces off walls.
@@ -94,25 +92,27 @@ class Animation {
 public:
 	friend class AnimationType;
 
-	static const byte kDirUp = 0;
-	static const byte kDirRight = 1;
-	static const byte kDirDown = 2;
-	static const byte kDirLeft = 3;
-	static const byte kDirUpRight = 4;
-	static const byte kDirDownRight = 5;
-	static const byte kDirDownLeft = 6;
-	static const byte kDirUpLeft = 7;
-	static const byte kDirStopped = 8;
+	enum Direction {
+		kDirUp, kDirRight, kDirDown, kDirLeft,
+		kDirUpRight, kDirDownRight, kDirDownLeft, kDirUpLeft,
+		kDirStopped
+	};
 
 	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
 
-	static const byte kProcFollowAvvyY = 1;
-	static const byte kProcBackAndForth = 2;
-	static const byte kProcFaceAvvy = 3;
-	static const byte kProcArrow = 4;
-	static const byte kProcsPludwick = 5; // Unused
-	static const byte kProcGrabAvvy = 6;
-	static const byte kProcGeida = 7;
+	enum Proc {
+		kProcFollowAvvyY = 1,
+		kProcBackAndForth,
+		kProcFaceAvvy,
+		kProcArrow,
+		kProcSpludwick, // Unused
+		kProcGrabAvvy,
+		kProcGeida // Spludwick uses it as well for homing! TODO: Unify it with kProcSpludwick.
+	};
+
+	AnimationType _sprites[kSpriteNumbMax];
+	bool _mustExclaim;
+	uint16 _sayWhat;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
@@ -131,29 +131,28 @@ public:
 	void updateSpeed();
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
-	AnimationType _sprites[kSpriteNumbMax];
-
-	bool _mustExclaim;
-	uint16 _sayWhat;
-
 private:
 	AvalancheEngine *_vm;
 
 	byte checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
-	byte geida_ped(byte which);
-	void dawndelay();
+	byte geidaPed(byte which);
+	void dawnDelay();
+
+	void grabAvvy(byte tripnum);
+	void arrowProcs(byte tripnum);
 	void hideInCupboard();
-	void follow_avvy_y(byte tripnum);
-	void back_and_forth(byte tripnum);
-	void face_avvy(byte tripnum);
-	void arrow_procs(byte tripnum);
-	void grab_avvy(byte tripnum);
-	void spin(byte whichway, byte &tripnum);
 
+	// Different movements for NPCs:
+	void followAvalotY(byte tripnum); // Original: follow_avvy_y().
+	void backAndForth(byte tripnum);
+	void faceAvvy(byte tripnum);
+	
+	// Movements for Homing NPCs: Spludwick and Geida.
+	void spin(byte whichway, byte &tripnum);
 	void takeAStep(byte &tripnum);
-	void geida_procs(byte tripnum);
+	void geidaProcs(byte tripnum);
 
-	void call_andexors();
+	void drawSprites(); // Original: call_andexors().
 };
 
 } // End of namespace Avalanche.


Commit: 0f20e7fe37f1b9db18e6ba25d879a7c794c4c719
    https://github.com/scummvm/scummvm/commit/0f20e7fe37f1b9db18e6ba25d879a7c794c4c719
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:21:27-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/lucerna2.cpp
    engines/avalanche/lucerna2.h





Commit: 2eb4002e365ab79870f68f09c030770e632c1166
    https://github.com/scummvm/scummvm/commit/2eb4002e365ab79870f68f09c030770e632c1166
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T03:23:48-07:00

Commit Message:
AVALANCHE: Check function scope in Animation, set a function private

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 10b32cf..939f50f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1571,7 +1571,7 @@ void Acci::doThat() {
 					if (_vm->_animation->_sprites[0]._id != i) {
 						int16 x = _vm->_animation->_sprites[0]._x;
 						int16 y = _vm->_animation->_sprites[0]._y;
-						_vm->_animation->_sprites[0].done();
+						_vm->_animation->_sprites[0].remove();
 						_vm->_animation->_sprites[0].init(i, true, _vm->_animation);
 						_vm->_animation->_sprites[0].appear(x, y, Animation::kDirLeft);
 						_vm->_animation->_sprites[0]._visible = false;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f83173e..d70b6c8 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -264,7 +264,7 @@ void AnimationType::bounce() {
 	_tr->_vm->_gyro->_onCanDoPageSwap = true;
 }
 
-int8 AnimationType::sgn(int16 val) {
+int8 AnimationType::getSign(int16 val) {
 	if (val > 0)
 		return 1;
 	else if (val < 0)
@@ -275,13 +275,13 @@ int8 AnimationType::sgn(int16 val) {
 
 void AnimationType::walkTo(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
-	speed(sgn(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, sgn(_tr->_vm->_gyro->_peds[pednum]._y - _y));
+	setSpeed(getSign(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, getSign(_tr->_vm->_gyro->_peds[pednum]._y - _y));
 	_homingX = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
 	_homingY = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
 	_homing = true;
 }
 
-void AnimationType::stophoming() {
+void AnimationType::stopHoming() {
 	_homing = false;
 }
 
@@ -315,7 +315,7 @@ void AnimationType::homeStep() {
 	}
 }
 
-void AnimationType::speed(int8 xx, int8 yy) {
+void AnimationType::setSpeed(int8 xx, int8 yy) {
 	_moveX = xx;
 	_moveY = yy;
 	if ((_moveX == 0) && (_moveY == 0))
@@ -347,7 +347,7 @@ void AnimationType::chatter() {
 	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
-void AnimationType::done() {
+void AnimationType::remove() {
 	_animCount--;
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
@@ -372,7 +372,7 @@ Animation::Animation(AvalancheEngine *vm) {
 Animation::~Animation() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick)
-			_sprites[i].done();
+			_sprites[i].remove();
 	}
 }
 
@@ -791,7 +791,7 @@ void Animation::callSpecial(uint16 which) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->displayScrollChain('q', 35);
-			_sprites[0].done();
+			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->displayScrollChain('q', 36);
@@ -835,7 +835,7 @@ void Animation::callSpecial(uint16 which) {
 			return;   // DOESN'T COUNT: no Geida.
 		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
 		_sprites[1].walkTo(4); // She walks to somewhere...
-		_sprites[0].done();     // Lose Avvy.
+		_sprites[0].remove();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		_vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
 		break;
@@ -980,28 +980,28 @@ void Animation::updateSpeed() {
 void Animation::changeDirection(byte t, byte dir) {
 	switch (dir) {
 	case kDirUp:
-		_sprites[t].speed(0, -_sprites[t]._speedY);
+		_sprites[t].setSpeed(0, -_sprites[t]._speedY);
 		break;
 	case kDirDown:
-		_sprites[t].speed(0, _sprites[t]._speedY);
+		_sprites[t].setSpeed(0, _sprites[t]._speedY);
 		break;
 	case kDirLeft:
-		_sprites[t].speed(-_sprites[t]._speedX,  0);
+		_sprites[t].setSpeed(-_sprites[t]._speedX,  0);
 		break;
 	case kDirRight:
-		_sprites[t].speed(_sprites[t]._speedX,  0);
+		_sprites[t].setSpeed(_sprites[t]._speedX,  0);
 		break;
 	case kDirUpLeft:
-		_sprites[t].speed(-_sprites[t]._speedX, -_sprites[t]._speedY);
+		_sprites[t].setSpeed(-_sprites[t]._speedX, -_sprites[t]._speedY);
 		break;
 	case kDirUpRight:
-		_sprites[t].speed(_sprites[t]._speedX, -_sprites[t]._speedY);
+		_sprites[t].setSpeed(_sprites[t]._speedX, -_sprites[t]._speedY);
 		break;
 	case kDirDownLeft:
-		_sprites[t].speed(-_sprites[t]._speedX, _sprites[t]._speedY);
+		_sprites[t].setSpeed(-_sprites[t]._speedX, _sprites[t]._speedY);
 		break;
 	case kDirDownRight:
-		_sprites[t].speed(_sprites[t]._speedX, _sprites[t]._speedY);
+		_sprites[t].setSpeed(_sprites[t]._speedX, _sprites[t]._speedY);
 		break;
 	}
 }
@@ -1067,7 +1067,7 @@ void Animation::arrow_procs(byte tripnum) {
 
 			_sprites[1]._callEachStepFl = false; // prevent recursion.
 			_vm->_visa->displayScrollChain('Q', 47); // Complaint!
-			_sprites[tripnum].done(); // Deallocate the arrow.
+			_sprites[tripnum].remove(); // Deallocate the arrow.
 #if 0
 			tr[1].done; { Deallocate normal pic of Avvy. }
 
@@ -1085,7 +1085,7 @@ void Animation::arrow_procs(byte tripnum) {
 			_vm->_timer->addTimer(55, _vm->_timer->kProcNaughtyDuke, _vm->_timer->kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
-		_sprites[tripnum].done(); // Deallocate the arrow.
+		_sprites[tripnum].remove(); // Deallocate the arrow.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
 		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
 	}
@@ -1338,7 +1338,7 @@ void Animation::flipRoom(byte room, byte ped) {
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick)
-			_sprites[i].done();
+			_sprites[i].remove();
 	} // Deallocate sprite
 
 	if (_vm->_gyro->_dna._room == r__lustiesroom)
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index cfb1cfe..3c0be92 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -42,7 +42,7 @@ class Animation;
 struct StatType {
 	Common::String _name; // Name of character.
 	Common::String _comment; // Comment.
-	//
+
 	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
 	byte _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
@@ -68,26 +68,26 @@ public:
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
 
-	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
-	void original(); // Just sets 'quick' to false.
 	void andexor(); // Drops sprite onto screen.
-	void turn(byte whichway); // Turns character round.
 	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
 	void bounce(); // Bounces off walls.
+	void chatter();  // Sets up talk vars.
+	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
+	void original(); // Just sets 'quick' to false.
+	void remove();
+	void setSpeed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
+	void stopHoming(); // Self-explanatory.
+	void stopWalk(); // Stops the sprite from moving.
+	void turn(byte whichway); // Turns character round.
 	void walk(); // Prepares for andexor, etc.
 	void walkTo(byte pednum); // Home in on a point.
-	void stophoming(); // Self-explanatory.
-	void homeStep(); // Calculates ix & iy for one homing step.
-	void speed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
-	void stopWalk(); // Stops the sprite from moving.
-	void chatter();  // Sets up talk vars.
-	void done();
 
 private:
 	Animation *_tr;
 
 	bool checkCollision();
-	int8 sgn(int16 val);
+	int8 getSign(int16 val);
+	void homeStep(); // Calculates ix & iy for one homing step.
 };
 
 class Animation {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 195ddef..d59c18b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -292,7 +292,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	if (sz.isLoading()) {
 		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
 			if (_animation->_sprites[i]._quick)
-				_animation->_sprites[i].done();
+				_animation->_sprites[i].remove();
 		}
 	}
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c80ac4b..513052f 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -229,7 +229,7 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
 		if (_vm->_animation->_sprites[i]._quick)
-			_vm->_animation->_sprites[i].done();
+			_vm->_animation->_sprites[i].remove();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 2ec32b2..390c13b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1198,7 +1198,7 @@ void Lucerna::gameOver() {
 	int16 sx = _vm->_animation->_sprites[0]._x;
 	int16 sy = _vm->_animation->_sprites[0]._y;
 
-	_vm->_animation->_sprites[0].done();
+	_vm->_animation->_sprites[0].remove();
 	_vm->_animation->_sprites[0].init(12, true, _vm->_animation); // 12 = Avalot falls
 	_vm->_animation->_sprites[0]._stepNum = 0;
 	_vm->_animation->_sprites[0].appear(sx, sy, 0);
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index cb765e1..7eee3fc 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -308,7 +308,7 @@ void Timer::getTiedUp() {
 	_vm->_gyro->_dna._beenTiedUp = true;
 	_vm->_animation->stopWalking();
 	_vm->_animation->_sprites[1].stopWalk();
-	_vm->_animation->_sprites[1].stophoming();
+	_vm->_animation->_sprites[1].stopHoming();
 	_vm->_animation->_sprites[1]._callEachStepFl = true;
 	_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
 	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
@@ -337,8 +337,8 @@ void Timer::hangAround2() {
 	_vm->_animation->_sprites[1].walkTo(4);
 	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->displayScrollChain('q', 41);
-	_vm->_animation->_sprites[0].done();
-	_vm->_animation->_sprites[1].done(); // Get rid of Robin Hood and Friar Tuck.
+	_vm->_animation->_sprites[0].remove();
+	_vm->_animation->_sprites[1].remove(); // Get rid of Robin Hood and Friar Tuck.
 
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
@@ -592,8 +592,8 @@ void Timer::robinHoodAndGeidaTalk() {
 }
 
 void Timer::avalotReturns() {
-	_vm->_animation->_sprites[0].done();
-	_vm->_animation->_sprites[1].done();
+	_vm->_animation->_sprites[0].remove();
+	_vm->_animation->_sprites[1].remove();
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 1);
 	_vm->_visa->displayScrollChain('q', 67);


Commit: c6183993f2dc0732d5b480f502355f3843c5588c
    https://github.com/scummvm/scummvm/commit/c6183993f2dc0732d5b480f502355f3843c5588c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:39:33-07:00

Commit Message:
AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/animation.h

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timer.cpp



diff --cc engines/avalanche/animation.h
index d6a87dc,3c0be92..7b00bc9
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@@ -66,26 -68,26 +66,26 @@@ public
  	bool _callEachStepFl; // Do we call the eachstep procedure?
  	byte _eachStepProc;
  
 -	void andexor(); // Drops sprite onto screen.
 -	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
 -	void bounce(); // Bounces off walls.
 -	void chatter();  // Sets up talk vars.
  	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
  	void original(); // Just sets 'quick' to false.
 -	void remove();
 -	void setSpeed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
 -	void stopHoming(); // Self-explanatory.
 -	void stopWalk(); // Stops the sprite from moving.
 +	void draw(); // Drops sprite onto screen. Original: andexor().
  	void turn(byte whichway); // Turns character round.
 +	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
 +	void bounce(); // Bounces off walls.
  	void walk(); // Prepares for andexor, etc.
  	void walkTo(byte pednum); // Home in on a point.
- 	void stophoming(); // Self-explanatory.
++	void stopHoming(); // Self-explanatory.
 +	void homeStep(); // Calculates ix & iy for one homing step.
- 	void speed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
++	void setSpeed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
 +	void stopWalk(); // Stops the sprite from moving.
 +	void chatter();  // Sets up talk vars.
- 	void done();
++	void remove();
  
  private:
  	Animation *_tr;
  
  	bool checkCollision();
- 	int8 sgn(int16 val);
+ 	int8 getSign(int16 val);
 -	void homeStep(); // Calculates ix & iy for one homing step.
  };
  
  class Animation {


Commit: e6956a994b980e81cd83784b67b7feb0d2250a75
    https://github.com/scummvm/scummvm/commit/e6956a994b980e81cd83784b67b7feb0d2250a75
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T03:47:04-07:00

Commit Message:
AVALANCHE: Change type of kSpriteNumbMax to byte

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 939f50f..384d274 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1277,7 +1277,7 @@ void Acci::personSpeaks() {
 
 	bool found = false; // The _person we're looking for's code is in _person.
 
-	for (int16 i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
 			found = true;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 15e8bd7..9b51ee8 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -172,7 +172,7 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  * @remarks	Originally called 'collision_check'
  */
 bool AnimationType::checkCollision() {
-	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) {
+	for (byte i = 0; i < _tr->kSpriteNumbMax; i++) {
 		if (_tr->_sprites[i]._quick && (_tr->_sprites[i]._id != _id) &&
 			((_x + _info._xLength) > _tr->_sprites[i]._x) &&
 			(_x < (_tr->_sprites[i]._x + _tr->_sprites[i]._info._xLength)) &&
@@ -370,14 +370,14 @@ Animation::Animation(AvalancheEngine *vm) {
 }
 
 Animation::~Animation() {
-	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick)
 			_sprites[i].remove();
 	}
 }
 
 void Animation::loadAnims() {
-	for (int16 i = 0; i < kSpriteNumbMax; i++)
+	for (byte i = 0; i < kSpriteNumbMax; i++)
 		_sprites[i].original();
 }
 
@@ -1204,7 +1204,7 @@ void Animation::drawSprites() {
 	for (int i = 0; i < 5; i++)
 		order[i] = -1;
 
-	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
 			order[i] = i;
 	}
@@ -1239,14 +1239,14 @@ void Animation::drawSprites() {
 void Animation::animLink() {
 	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
-	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
 			_sprites[i].walk();
 	}
 
 	drawSprites();
 
-	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+	for (byte i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._callEachStepFl) {
 			switch (_sprites[i]._eachStepProc) {
 			case kProcFollowAvvyY :
@@ -1336,7 +1336,7 @@ void Animation::flipRoom(byte room, byte ped) {
 	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
 	_vm->_lucerna->dusk();
 
-	for (int16 i = 1; i < kSpriteNumbMax; i++) {
+	for (byte i = 1; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick)
 			_sprites[i].remove();
 	} // Deallocate sprite
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 7b00bc9..1193057 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -98,7 +98,7 @@ public:
 		kDirStopped
 	};
 
-	static const int16 kSpriteNumbMax = 5; // current max no. of sprites
+	static const byte kSpriteNumbMax = 5; // current max no. of sprites
 
 	enum Proc {
 		kProcFollowAvvyY = 1,
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d59c18b..d2e9a8d 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -282,7 +282,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) {
+		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) {
 			if (_animation->_sprites[i]._quick)
 				spriteNum++;
 		}
@@ -290,7 +290,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(spriteNum);
 
 	if (sz.isLoading()) {
-		for (int16 i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
+		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
 			if (_animation->_sprites[i]._quick)
 				_animation->_sprites[i].remove();
 		}
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index d7e1563..81e4671 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -248,7 +248,7 @@ void Visa::talkTo(byte whom) {
 		whom -= 149;
 
 	bool noMatches = true;
-	for (int16 i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
+	for (byte i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
 			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
 			noMatches = false;


Commit: 48f2a79ed2adefbc9b3fe79ef1dc54e052871d83
    https://github.com/scummvm/scummvm/commit/48f2a79ed2adefbc9b3fe79ef1dc54e052871d83
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:53:19-07:00

Commit Message:
AVALANCHE: Rename _tr to _anim.

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 15e8bd7..0875dd2 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -45,8 +45,8 @@
 
 namespace Avalanche {
 
-void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {
-	_tr = tr;
+void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
+	_anim = anim;
 
 	const int32 idshould = -1317732048;
 
@@ -121,7 +121,7 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *tr) {
 	_speedX = 3;
 	_speedY = 1;
 	if (spritenum == 1)
-		_tr->updateSpeed(); // Just for the lights.
+		_anim->updateSpeed(); // Just for the lights.
 
 	_homing = false;
 	_moveX = 0;
@@ -146,7 +146,7 @@ void AnimationType::draw() {
 		return;
 	byte picnum = _facingDir * _stat._seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
 
-	_tr->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
+	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
 
 void AnimationType::turn(byte whichway) {
@@ -159,8 +159,8 @@ void AnimationType::turn(byte whichway) {
 void AnimationType::appear(int16 wx, int16 wy, byte wf) {
 	_x = (wx / 8) * 8;
 	_y = wy;
-	_oldX[_tr->_vm->_gyro->_cp] = wx;
-	_oldY[_tr->_vm->_gyro->_cp] = wy;
+	_oldX[_anim->_vm->_gyro->_cp] = wx;
+	_oldY[_anim->_vm->_gyro->_cp] = wy;
 	turn(wf);
 	_visible = true;
 	_moveX = 0;
@@ -172,11 +172,11 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  * @remarks	Originally called 'collision_check'
  */
 bool AnimationType::checkCollision() {
-	for (int16 i = 0; i < _tr->kSpriteNumbMax; i++) {
-		if (_tr->_sprites[i]._quick && (_tr->_sprites[i]._id != _id) &&
-			((_x + _info._xLength) > _tr->_sprites[i]._x) &&
-			(_x < (_tr->_sprites[i]._x + _tr->_sprites[i]._info._xLength)) &&
-			(_tr->_sprites[i]._y == _y))
+	for (int16 i = 0; i < _anim->kSpriteNumbMax; i++) {
+		if (_anim->_sprites[i]._quick && (_anim->_sprites[i]._id != _id) &&
+			((_x + _info._xLength) > _anim->_sprites[i]._x) &&
+			(_x < (_anim->_sprites[i]._x + _anim->_sprites[i]._info._xLength)) &&
+			(_anim->_sprites[i]._y == _y))
 				return true;
 	}
 
@@ -194,9 +194,9 @@ void AnimationType::walk() {
 		r._y2 = _y + _info._yLength + 2;
 	}
 
-	if (!_tr->_vm->_gyro->_doingSpriteRun) {
-		_oldX[_tr->_vm->_gyro->_cp] = _x;
-		_oldY[_tr->_vm->_gyro->_cp] = _y;
+	if (!_anim->_vm->_gyro->_doingSpriteRun) {
+		_oldX[_anim->_vm->_gyro->_cp] = _x;
+		_oldY[_anim->_vm->_gyro->_cp] = _y;
 		if (_homing)
 			homeStep();
 		_x += _moveX;
@@ -209,39 +209,39 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte tc = _tr->checkFeet(_x, _x + _info._xLength, _oldY[_tr->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		byte tc = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((tc != 255) & (!_tr->_vm->_gyro->_doingSpriteRun)) {
-			switch (_tr->_vm->_gyro->_magics[tc]._operation) {
+		if ((tc != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
+			switch (_anim->_vm->_gyro->_magics[tc]._operation) {
 			case Gyro::kMagicExclaim: {
 				bounce();
-				_tr->_mustExclaim = true;
-				_tr->_sayWhat = _tr->_vm->_gyro->_magics[tc]._data;
+				_anim->_mustExclaim = true;
+				_anim->_sayWhat = _anim->_vm->_gyro->_magics[tc]._data;
 				}
 				break;
 			case Gyro::kMagicBounce:
 				bounce();
 				break;
 			case Gyro::kMagicTransport:
-				_tr->flipRoom(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff);
+				_anim->flipRoom(_anim->_vm->_gyro->_magics[tc]._data >> 8, _anim->_vm->_gyro->_magics[tc]._data & 0xff);
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
-				_tr->_vm->_scrolls->displayText("\7Sorry.\3\rThis place is not available yet!");
+				_anim->_vm->_scrolls->displayText("\7Sorry.\3\rThis place is not available yet!");
 				}
 				break;
 			case Gyro::kMagicSpecial:
-				_tr->callSpecial(_tr->_vm->_gyro->_magics[tc]._data);
+				_anim->callSpecial(_anim->_vm->_gyro->_magics[tc]._data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_tr->openDoor(_tr->_vm->_gyro->_magics[tc]._data >> 8, _tr->_vm->_gyro->_magics[tc]._data & 0xff, tc);
+				_anim->openDoor(_anim->_vm->_gyro->_magics[tc]._data >> 8, _anim->_vm->_gyro->_magics[tc]._data & 0xff, tc);
 				break;
 			}
 		}
 	}
 
-	if (!_tr->_vm->_gyro->_doingSpriteRun) {
+	if (!_anim->_vm->_gyro->_doingSpriteRun) {
 		_count++;
 		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
 			_stepNum++;
@@ -253,15 +253,15 @@ void AnimationType::walk() {
 }
 
 void AnimationType::bounce() {
-	_x = _oldX[_tr->_vm->_gyro->_cp];
-	_y = _oldY[_tr->_vm->_gyro->_cp];
+	_x = _oldX[_anim->_vm->_gyro->_cp];
+	_y = _oldY[_anim->_vm->_gyro->_cp];
 	if (_doCheck)
-		_tr->stopWalking();
+		_anim->stopWalking();
 	else
 		stopWalk();
-	_tr->_vm->_gyro->_onCanDoPageSwap = false;
-	_tr->_vm->_lucerna->drawDirection();
-	_tr->_vm->_gyro->_onCanDoPageSwap = true;
+	_anim->_vm->_gyro->_onCanDoPageSwap = false;
+	_anim->_vm->_lucerna->drawDirection();
+	_anim->_vm->_gyro->_onCanDoPageSwap = true;
 }
 
 int8 AnimationType::getSign(int16 val) {
@@ -275,9 +275,9 @@ int8 AnimationType::getSign(int16 val) {
 
 void AnimationType::walkTo(byte pednum) {
 	pednum--; // Pascal -> C conversion: different array indexes.
-	setSpeed(getSign(_tr->_vm->_gyro->_peds[pednum]._x - _x) * 4, getSign(_tr->_vm->_gyro->_peds[pednum]._y - _y));
-	_homingX = _tr->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
-	_homingY = _tr->_vm->_gyro->_peds[pednum]._y - _info._yLength;
+	setSpeed(getSign(_anim->_vm->_gyro->_peds[pednum]._x - _x) * 4, getSign(_anim->_vm->_gyro->_peds[pednum]._y - _y));
+	_homingX = _anim->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
+	_homingY = _anim->_vm->_gyro->_peds[pednum]._y - _info._yLength;
 	_homing = true;
 }
 
@@ -323,14 +323,14 @@ void AnimationType::setSpeed(int8 xx, int8 yy) {
 	if (_moveX == 0) {
 		// No horz movement
 		if (_moveY < 0)
-			turn(_tr->kDirUp);
+			turn(_anim->kDirUp);
 		else
-			turn(_tr->kDirDown);
+			turn(_anim->kDirDown);
 	} else {
 		if (_moveX < 0)
-			turn(_tr->kDirLeft);
+			turn(_anim->kDirLeft);
 		else
-			turn(_tr->kDirRight);
+			turn(_anim->kDirRight);
 	}
 }
 
@@ -341,10 +341,10 @@ void AnimationType::stopWalk() {
 }
 
 void AnimationType::chatter() {
-	_tr->_vm->_gyro->_talkX = _x + _info._xLength / 2;
-	_tr->_vm->_gyro->_talkY = _y;
-	_tr->_vm->_gyro->_talkFontColor = _stat._fgBubbleCol;
-	_tr->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
+	_anim->_vm->_gyro->_talkX = _x + _info._xLength / 2;
+	_anim->_vm->_gyro->_talkY = _y;
+	_anim->_vm->_gyro->_talkFontColor = _stat._fgBubbleCol;
+	_anim->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
 void AnimationType::remove() {
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 7b00bc9..f78d0b1 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -66,7 +66,7 @@ public:
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
 
-	void init(byte spritenum, bool doCheck, Animation *tr); // Loads & sets up the sprite.
+	void init(byte spritenum, bool doCheck, Animation *anim); // Loads & sets up the sprite.
 	void original(); // Just sets 'quick' to false.
 	void draw(); // Drops sprite onto screen. Original: andexor().
 	void turn(byte whichway); // Turns character round.
@@ -82,7 +82,7 @@ public:
 	void remove();
 
 private:
-	Animation *_tr;
+	Animation *_anim;
 
 	bool checkCollision();
 	int8 getSign(int16 val);


Commit: 3950c871f220be48da65e44c87362016af8af340
    https://github.com/scummvm/scummvm/commit/3950c871f220be48da65e44c87362016af8af340
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-08T03:57:34-07:00

Commit Message:
AVALANCHE: Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/animation.cpp

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/visa2.cpp



diff --cc engines/avalanche/animation.cpp
index 0875dd2,9b51ee8..006ed5a
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@@ -172,11 -172,11 +172,11 @@@ void AnimationType::appear(int16 wx, in
   * @remarks	Originally called 'collision_check'
   */
  bool AnimationType::checkCollision() {
- 	for (int16 i = 0; i < _anim->kSpriteNumbMax; i++) {
 -	for (byte i = 0; i < _tr->kSpriteNumbMax; i++) {
 -		if (_tr->_sprites[i]._quick && (_tr->_sprites[i]._id != _id) &&
 -			((_x + _info._xLength) > _tr->_sprites[i]._x) &&
 -			(_x < (_tr->_sprites[i]._x + _tr->_sprites[i]._info._xLength)) &&
 -			(_tr->_sprites[i]._y == _y))
++	for (byte i = 0; i < _anim->kSpriteNumbMax; i++) {
 +		if (_anim->_sprites[i]._quick && (_anim->_sprites[i]._id != _id) &&
 +			((_x + _info._xLength) > _anim->_sprites[i]._x) &&
 +			(_x < (_anim->_sprites[i]._x + _anim->_sprites[i]._info._xLength)) &&
 +			(_anim->_sprites[i]._y == _y))
  				return true;
  	}
  


Commit: 7df4c94aeb6c1408d26d6ada58d728b6eac17717
    https://github.com/scummvm/scummvm/commit/7df4c94aeb6c1408d26d6ada58d728b6eac17717
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T05:11:32-07:00

Commit Message:
AVALANCHE: Some renaming in Timer and Acci2, add some doxygen comments

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/timer.cpp
    engines/avalanche/timer.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 384d274..1c10a36 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -300,8 +300,6 @@ void Acci::stripPunctuation(Common::String &word) {
 	}
 }
 
-
-
 void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 	if (target == kPardon) {
 		ambiguous = true;
@@ -347,8 +345,6 @@ bool Acci::doPronouns() {
 	return ambiguous;
 }
 
-
-
 void Acci::properNouns() {
 	_vm->_parser->_inputText.toLowercase();
 
@@ -512,10 +508,11 @@ void Acci::parse() {
 		}
 	}
 
+	Common::String unkString;
 	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1)
-		_unknown = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
-	else if (!_unknown.empty())
-		_unknown.clear();
+		unkString = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
+	else
+		unkString.clear();
 
 	// Replace words' codes that mean the same.
 	replace(Common::String('\xFF'), 0); // zap noise words
@@ -598,9 +595,9 @@ void Acci::parse() {
 			_polite = true;
 	}
 
-	if ((!_unknown.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-			_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea what \"") + _unknown + "\" means. Can you rephrase it?");
-			_vm->_gyro->_weirdWord = true;
+	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+		_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea what \"") + unkString + "\" means. Can you rephrase it?");
+		_vm->_gyro->_weirdWord = true;
 	} else
 		_vm->_gyro->_weirdWord = false;
 
@@ -687,7 +684,11 @@ void Acci::exampers() {
 		_vm->_visa->displayScrollChain('Q', 13);
 }
 
-bool Acci::holding() {
+/**
+ * Return whether Avvy is holding an object or not
+ * @remarks	Originally called 'holding'
+ */
+bool Acci::isHolding() {
 	if ((51 <= _thing) && (_thing <= 99)) // Also.
 		return true;
 
@@ -725,7 +726,7 @@ void Acci::openBox(bool isOpening) {
 void Acci::examine() {
 	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
 	if ((_person == kPardon) && (_thing != kPardon)) {
-		if (holding()) {
+		if (isHolding()) {
 			// Remember: it's been Slipped! Ie subtract 49.
 			if ((1 <= _thing) && (_thing <= 49)) // Standard object
 				examineObject();
@@ -959,13 +960,13 @@ void Acci::silly() {
 }
 
 void Acci::putProc() {
-	if (!holding())
+	if (!isHolding())
 		return;
 
 	_thing2 -= 49; // Slip the second object.
 	char temp = _thing;
 	_thing = _thing2;
-	if (!holding())
+	if (!isHolding())
 		return;
 	_thing = temp;
 
@@ -1031,17 +1032,23 @@ void Acci::putProc() {
 	}
 }
 
-
-
+/**
+ * Display text when ingredients are not in the right order
+ * @remarks	Originally called 'not_in_order'
+ */
 void Acci::notInOrder() {
 	_vm->_scrolls->displayText(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
 			+ _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick])
 			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
 }
 
+/**
+ * Move Spludwick to cauldron
+ * @remarks	Originally called 'go_to_cauldron'
+ */
 void Acci::goToCauldron() {
 	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludWalk);
+	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludwickWalk);
 	_vm->_animation->_sprites[1].walkTo(2);
 }
 
@@ -1386,7 +1393,7 @@ void Acci::doThat() {
 			_vm->_visa->talkTo(_person);
 		break;
 	case kVerbCodeGive:
-		if (holding()) {
+		if (isHolding()) {
 			if (_person == kPardon)
 				_vm->_scrolls->displayText("Give to whom?");
 			else if (isPersonHere()) {
@@ -1484,7 +1491,7 @@ void Acci::doThat() {
 
 	case kVerbCodeEat:
 	case kVerbCodeDrink:
-		if (holding())
+		if (isHolding())
 			swallow();
 		break;
 
@@ -1544,7 +1551,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case kVerbCodeWear:
-		if (holding()) { // Wear something.
+		if (isHolding()) { // Wear something.
 			switch (_thing) {
 			case Gyro::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
@@ -1625,7 +1632,7 @@ void Acci::doThat() {
 				playHarp();
 				break;
 			}
-		} else if (holding()) {
+		} else if (isHolding()) {
 			switch (_thing) {
 			case Gyro::kObjectLute :
 					_vm->_visa->displayScrollChain('U', 7);
@@ -1655,7 +1662,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeRing:
-		if (holding()) {
+		if (isHolding()) {
 			if (_thing == _vm->_gyro->kObjectBell) {
 				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
@@ -2022,7 +2029,7 @@ void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
 	case kVerbCodeExam:
 		answer = "Examine";
 		ansKey = 'x';
-		break; // The ubiqutous one.
+		break; // The ubiquitous one.
 	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
 	case kVerbCodeDrink:
 		answer = "Drink";
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index ed44a75..55ad64e 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -83,8 +83,6 @@ private:
 	};
 
 	Common::String _thats;
-	Common::String _unknown;
-
 	byte _thing2;
 
 	AvalancheEngine *_vm;
@@ -108,7 +106,7 @@ private:
 	void examineObject(); // Examine a standard object-thing
 	bool isPersonHere();
 	void exampers();
-	bool holding();
+	bool isHolding();
 	void openBox(bool isOpening);
 	void examine();
 	void inventory();
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 7eee3fc..883e1a2 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -663,9 +663,9 @@ void Timer::avalotFalls() {
 
 void Timer::spludwickGoesToCauldron() {
 	if (_vm->_animation->_sprites[1]._homing)
-		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
+		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludwickWalk);
 	else
-		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
+		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludwickWalk);
 }
 
 void Timer::spludwickLeavesCauldron() {
diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h
index c8b664b..134a4dc 100644
--- a/engines/avalanche/timer.h
+++ b/engines/avalanche/timer.h
@@ -65,7 +65,7 @@ public:
 		kReasonArkataShouts = 24,
 		kReasonWinning = 25,
 		kReasonFallingOver = 26,
-		kReasonSpludWalk = 27,
+		kReasonSpludwickWalk = 27,
 		kReasonGeidaSings = 28
 	};
 


Commit: 599d2eeb06c937a4479cc751f4f9f5e94795c43b
    https://github.com/scummvm/scummvm/commit/599d2eeb06c937a4479cc751f4f9f5e94795c43b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T05:49:34-07:00

Commit Message:
Merge branch 'master' into avalanche

Changed paths:
  A backends/mixer/nullmixer/nullsdl-mixer.cpp
  A backends/mixer/nullmixer/nullsdl-mixer.h
  A backends/platform/tizen/README.TXT
  A backends/platform/tizen/application.cpp
  A backends/platform/tizen/application.h
  A backends/platform/tizen/audio.cpp
  A backends/platform/tizen/audio.h
  A backends/platform/tizen/form.cpp
  A backends/platform/tizen/form.h
  A backends/platform/tizen/fs.cpp
  A backends/platform/tizen/fs.h
  A backends/platform/tizen/graphics.cpp
  A backends/platform/tizen/graphics.h
  A backends/platform/tizen/main.cpp
  A backends/platform/tizen/missing.cpp
  A backends/platform/tizen/portdefs.h
  A backends/platform/tizen/sscanf.cpp
  A backends/platform/tizen/system.cpp
  A backends/platform/tizen/system.h
  A backends/platform/tizen/tizen.mk
  A backends/saves/recorder/recorder-saves.cpp
  A backends/saves/recorder/recorder-saves.h
  A backends/timer/tizen/timer.cpp
  A backends/timer/tizen/timer.h
  A common/ini-file.cpp
  A common/ini-file.h
  A common/recorderfile.cpp
  A common/recorderfile.h
  A devtools/create_mortdat/create_mortdat.cpp
  A devtools/create_mortdat/create_mortdat.h
  A devtools/create_mortdat/enginetext.h
  A devtools/create_mortdat/gametext.h
  A devtools/create_mortdat/menudata.h
  A devtools/create_mortdat/module.mk
  A devtools/create_neverhood/md5.cpp
  A devtools/create_neverhood/md5.h
  A devtools/create_project/msvc12/create_project.sln
  A devtools/create_project/msvc12/create_project.vcxproj
  A devtools/create_project/msvc12/create_project.vcxproj.filters
  A devtools/extract_mort/extract_mort.cpp
  A devtools/extract_mort/module.mk
  A dists/engine-data/mort.dat
  A dists/msvc12/create_msvc12.bat
  A dists/msvc12/readme.txt
  A engines/mortevielle/actions.cpp
  A engines/mortevielle/debugger.cpp
  A engines/mortevielle/debugger.h
  A engines/mortevielle/detection.cpp
  A engines/mortevielle/detection_tables.h
  A engines/mortevielle/dialogs.cpp
  A engines/mortevielle/dialogs.h
  A engines/mortevielle/graphics.cpp
  A engines/mortevielle/graphics.h
  A engines/mortevielle/menu.cpp
  A engines/mortevielle/menu.h
  A engines/mortevielle/module.mk
  A engines/mortevielle/mortevielle.cpp
  A engines/mortevielle/mortevielle.h
  A engines/mortevielle/mouse.cpp
  A engines/mortevielle/mouse.h
  A engines/mortevielle/outtext.cpp
  A engines/mortevielle/outtext.h
  A engines/mortevielle/saveload.cpp
  A engines/mortevielle/saveload.h
  A engines/mortevielle/sound.cpp
  A engines/mortevielle/sound.h
  A engines/mortevielle/utils.cpp
  A engines/neverhood/console.cpp
  A engines/neverhood/console.h
  A engines/wintermute/graphics/transform_struct.cpp
  A engines/wintermute/graphics/transform_struct.h
  A engines/wintermute/graphics/transform_tools.cpp
  A engines/wintermute/graphics/transform_tools.h
  A engines/wintermute/math/floatpoint.h
  A gui/EventRecorder.cpp
  A gui/EventRecorder.h
  A gui/editrecorddialog.cpp
  A gui/editrecorddialog.h
  A gui/onscreendialog.cpp
  A gui/onscreendialog.h
  A gui/recorderdialog.cpp
  A gui/recorderdialog.h
  A gui/themes/scummmodern/editbtn.bmp
  A gui/themes/scummmodern/editbtn_small.bmp
  A gui/themes/scummmodern/fastreplay.bmp
  A gui/themes/scummmodern/fastreplay_small.bmp
  A gui/themes/scummmodern/stopbtn.bmp
  A gui/themes/scummmodern/stopbtn_small.bmp
  A gui/themes/scummmodern/switchbtn.bmp
  A gui/themes/scummmodern/switchbtn_small.bmp
  A test/common/hash-str.h
  A test/common/huffman.h
  A test/common/rendermode.h
  A test/common/util.h
  A video/codecs/mpeg.cpp
  A video/codecs/mpeg.h
  R backends/platform/bada/bada.mk
  R backends/platform/bada/form.cpp
  R backends/platform/bada/form.h
  R backends/platform/bada/README.TXT
  R backends/platform/bada/application.cpp
  R backends/platform/bada/audio.cpp
  R backends/platform/bada/audio.h
  R backends/platform/bada/fs.cpp
  R backends/platform/bada/fs.h
  R backends/platform/bada/graphics.cpp
  R backends/platform/bada/graphics.h
  R backends/platform/bada/main.cpp
  R backends/platform/bada/missing.cpp
  R backends/platform/bada/portdefs.h
  R backends/platform/bada/sscanf.cpp
  R backends/platform/bada/system.cpp
  R backends/platform/bada/system.h
  R backends/timer/bada/timer.cpp
  R backends/timer/bada/timer.h
  R common/EventRecorder.cpp
  R common/EventRecorder.h
  R common/config-file.cpp
  R common/config-file.h
  R backends/platform/bada/application.h
  R engines/neverhood/todo.txt
    .gitignore
    AUTHORS
    Makefile
    Makefile.common
    NEWS
    audio/mixer.cpp
    audio/softsynth/fluidsynth.cpp
    audio/softsynth/mt32.cpp
    audio/softsynth/mt32/Part.cpp
    audio/softsynth/mt32/Partial.cpp
    audio/softsynth/mt32/Synth.cpp
    audio/softsynth/mt32/Synth.h
    audio/softsynth/mt32/TVA.cpp
    backends/base-backend.cpp
    backends/events/default/default-events.cpp
    backends/events/sdl/sdl-events.cpp
    backends/graphics/opengl/gltexture.h
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.h
    backends/midi/timidity.cpp
    backends/modular-backend.cpp
    backends/module.mk
    backends/mutex/sdl/sdl-mutex.cpp
    backends/platform/android/android.cpp
    backends/platform/android/android.h
    backends/platform/android/gfx.cpp
    backends/platform/android/texture.cpp
    backends/platform/dc/dc.h
    backends/platform/dc/display.cpp
    backends/platform/dc/selector.cpp
    backends/platform/dc/time.cpp
    backends/platform/ds/arm9/source/dsmain.cpp
    backends/platform/ds/arm9/source/dsmain.h
    backends/platform/ds/arm9/source/osystem_ds.cpp
    backends/platform/ds/arm9/source/osystem_ds.h
    backends/platform/iphone/iphone_video.mm
    backends/platform/iphone/osys_main.cpp
    backends/platform/iphone/osys_main.h
    backends/platform/iphone/osys_video.mm
    backends/platform/n64/osys_n64.h
    backends/platform/n64/osys_n64_base.cpp
    backends/platform/null/null.cpp
    backends/platform/ps2/Gs2dScreen.cpp
    backends/platform/ps2/systemps2.cpp
    backends/platform/ps2/systemps2.h
    backends/platform/psp/default_display_client.cpp
    backends/platform/psp/osys_psp.cpp
    backends/platform/psp/osys_psp.h
    backends/platform/psp/rtc.cpp
    backends/platform/psp/rtc.h
    backends/platform/sdl/sdl-sys.h
    backends/platform/sdl/sdl.cpp
    backends/platform/sdl/sdl.h
    backends/platform/wii/osystem.cpp
    backends/platform/wii/osystem.h
    backends/platform/wii/osystem_gfx.cpp
    backends/timer/default/default-timer.cpp
    backends/vkeybd/virtual-keyboard-gui.cpp
    backends/vkeybd/virtual-keyboard-gui.h
    backends/vkeybd/virtual-keyboard.h
    base/commandLine.cpp
    base/main.cpp
    common/EventDispatcher.cpp
    common/config-manager.h
    common/debug.h
    common/events.h
    common/macresman.cpp
    common/macresman.h
    common/math.h
    common/memstream.h
    common/module.mk
    common/random.cpp
    common/scummsys.h
    common/str.cpp
    common/str.h
    common/system.cpp
    common/system.h
    common/util.h
    common/winexe.cpp
    common/winexe_ne.cpp
    common/winexe_ne.h
    configure
    devtools/README
    devtools/create_kyradat/create_kyradat.cpp
    devtools/create_kyradat/pak.cpp
    devtools/create_lure/process_actions.cpp
    devtools/create_neverhood/create_neverhood.cpp
    devtools/create_neverhood/module.mk
    devtools/create_neverhood/tables.h
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/msbuild.cpp
    devtools/create_project/msvc.cpp
    devtools/create_project/msvc.h
    devtools/create_project/visualstudio.cpp
    devtools/create_teenagent/static_tables.h
    devtools/credits.pl
    devtools/scumm-md5.txt
    devtools/skycpt/cptcompiler.cpp
    dists/engine-data/README
    dists/msvc10/create_msvc10.bat
    dists/msvc11/create_msvc11.bat
    dists/msvc8/create_msvc8.bat
    dists/msvc9/create_msvc9.bat
    dists/scummvm.rc
    dists/scummvm.rc.in
    engines/advancedDetector.cpp
    engines/advancedDetector.h
    engines/agi/agi.cpp
    engines/agi/preagi_troll.cpp
    engines/agi/preagi_winnie.cpp
    engines/agos/animation.cpp
    engines/agos/charset-fontdata.cpp
    engines/agos/charset.cpp
    engines/agos/draw.cpp
    engines/agos/event.cpp
    engines/agos/gfx.cpp
    engines/agos/icons.cpp
    engines/agos/menus.cpp
    engines/agos/verb.cpp
    engines/agos/vga.cpp
    engines/agos/vga_e2.cpp
    engines/agos/vga_pn.cpp
    engines/agos/vga_s2.cpp
    engines/agos/vga_ww.cpp
    engines/agos/window.cpp
    engines/cge/cge.cpp
    engines/cge/cge_main.cpp
    engines/cge/detection.cpp
    engines/cge/snail.cpp
    engines/cge/vga13h.cpp
    engines/composer/composer.h
    engines/composer/graphics.cpp
    engines/configure.engines
    engines/cruise/cruise.h
    engines/cruise/detection.cpp
    engines/draci/screen.cpp
    engines/draci/surface.cpp
    engines/drascula/drascula.h
    engines/drascula/graphics.cpp
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/monitor.cpp
    engines/dreamweb/print.cpp
    engines/engines.mk
    engines/gob/iniconfig.cpp
    engines/gob/iniconfig.h
    engines/gob/surface.cpp
    engines/gob/videoplayer.cpp
    engines/groovie/graphics.cpp
    engines/groovie/roq.cpp
    engines/groovie/script.cpp
    engines/groovie/stuffit.cpp
    engines/groovie/vdx.cpp
    engines/hopkins/computer.cpp
    engines/hopkins/computer.h
    engines/hopkins/detection.cpp
    engines/hopkins/dialogs.cpp
    engines/hopkins/globals.cpp
    engines/hopkins/graphics.cpp
    engines/hopkins/graphics.h
    engines/hopkins/hopkins.cpp
    engines/hopkins/hopkins.h
    engines/hopkins/saveload.cpp
    engines/hopkins/saveload.h
    engines/hopkins/script.cpp
    engines/hugo/dialogs.cpp
    engines/hugo/hugo.cpp
    engines/hugo/intro.cpp
    engines/kyra/gui_mr.cpp
    engines/kyra/kyra_rpg.cpp
    engines/kyra/scene_mr.cpp
    engines/kyra/screen.cpp
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/graphics.cpp
    engines/lure/hotspots.cpp
    engines/made/graphics.cpp
    engines/made/pmvplayer.cpp
    engines/made/screen.cpp
    engines/made/screenfx.cpp
    engines/made/scriptfuncs.cpp
    engines/mohawk/bitmap.cpp
    engines/mohawk/cursors.cpp
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks.h
    engines/mohawk/livingbooks_lbx.cpp
    engines/mohawk/riven_graphics.cpp
    engines/mohawk/video.cpp
    engines/neverhood/background.cpp
    engines/neverhood/blbarchive.cpp
    engines/neverhood/detection.cpp
    engines/neverhood/diskplayerscene.cpp
    engines/neverhood/diskplayerscene.h
    engines/neverhood/entity.cpp
    engines/neverhood/entity.h
    engines/neverhood/gamemodule.cpp
    engines/neverhood/gamemodule.h
    engines/neverhood/gamevars.cpp
    engines/neverhood/gamevars.h
    engines/neverhood/graphics.cpp
    engines/neverhood/graphics.h
    engines/neverhood/klaymen.cpp
    engines/neverhood/klaymen.h
    engines/neverhood/menumodule.cpp
    engines/neverhood/menumodule.h
    engines/neverhood/module.cpp
    engines/neverhood/module.h
    engines/neverhood/module.mk
    engines/neverhood/modules/module1000.cpp
    engines/neverhood/modules/module1000.h
    engines/neverhood/modules/module1100.cpp
    engines/neverhood/modules/module1200.cpp
    engines/neverhood/modules/module1300.cpp
    engines/neverhood/modules/module1400.cpp
    engines/neverhood/modules/module1500.cpp
    engines/neverhood/modules/module1600.cpp
    engines/neverhood/modules/module1600.h
    engines/neverhood/modules/module1700.cpp
    engines/neverhood/modules/module1700.h
    engines/neverhood/modules/module1800.cpp
    engines/neverhood/modules/module1900.cpp
    engines/neverhood/modules/module2000.cpp
    engines/neverhood/modules/module2100.cpp
    engines/neverhood/modules/module2100.h
    engines/neverhood/modules/module2200.cpp
    engines/neverhood/modules/module2200.h
    engines/neverhood/modules/module2300.cpp
    engines/neverhood/modules/module2400.cpp
    engines/neverhood/modules/module2500.cpp
    engines/neverhood/modules/module2600.cpp
    engines/neverhood/modules/module2700.cpp
    engines/neverhood/modules/module2700.h
    engines/neverhood/modules/module2800.cpp
    engines/neverhood/modules/module2800.h
    engines/neverhood/modules/module2900.cpp
    engines/neverhood/modules/module2900.h
    engines/neverhood/modules/module3000.cpp
    engines/neverhood/modules/module3000.h
    engines/neverhood/mouse.cpp
    engines/neverhood/mouse.h
    engines/neverhood/navigationscene.cpp
    engines/neverhood/navigationscene.h
    engines/neverhood/neverhood.cpp
    engines/neverhood/neverhood.h
    engines/neverhood/palette.cpp
    engines/neverhood/resource.cpp
    engines/neverhood/resource.h
    engines/neverhood/resourceman.cpp
    engines/neverhood/saveload.cpp
    engines/neverhood/scene.cpp
    engines/neverhood/scene.h
    engines/neverhood/screen.cpp
    engines/neverhood/smackerplayer.cpp
    engines/neverhood/smackerplayer.h
    engines/neverhood/smackerscene.cpp
    engines/neverhood/sound.cpp
    engines/neverhood/sound.h
    engines/neverhood/sprite.cpp
    engines/neverhood/staticdata.cpp
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/exec_ns.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/input.cpp
    engines/parallaction/inventory.h
    engines/pegasus/cursor.cpp
    engines/pegasus/graphics.cpp
    engines/pegasus/neighborhood/caldoria/caldoria.cpp
    engines/pegasus/neighborhood/neighborhood.cpp
    engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp
    engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
    engines/pegasus/neighborhood/norad/norad.cpp
    engines/pegasus/pegasus.cpp
    engines/pegasus/timers.cpp
    engines/pegasus/transition.cpp
    engines/plugins_table.h
    engines/saga/animation.cpp
    engines/saga/gfx.h
    engines/saga/introproc_ihnm.cpp
    engines/saga/introproc_saga2.cpp
    engines/saga/music.cpp
    engines/saga/scene.cpp
    engines/saga/shorten.cpp
    engines/saga/sndres.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/kstring.cpp
    engines/sci/engine/kvideo.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/maciconbar.cpp
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/screen.cpp
    engines/sci/sound/midiparser_sci.cpp
    engines/sci/sound/midiparser_sci.h
    engines/sci/sound/soundcmd.cpp
    engines/sci/video/robot_decoder.cpp
    engines/sci/video/seq_decoder.cpp
    engines/scumm/actor.cpp
    engines/scumm/akos.cpp
    engines/scumm/base-costume.cpp
    engines/scumm/bomp.cpp
    engines/scumm/charset.cpp
    engines/scumm/costume.cpp
    engines/scumm/cursor.cpp
    engines/scumm/debugger.cpp
    engines/scumm/detection_tables.h
    engines/scumm/gfx.cpp
    engines/scumm/gfx_towns.cpp
    engines/scumm/he/animation_he.cpp
    engines/scumm/he/logic/moonbase.cpp
    engines/scumm/he/script_v100he.cpp
    engines/scumm/he/script_v70he.cpp
    engines/scumm/he/script_v72he.cpp
    engines/scumm/he/script_v80he.cpp
    engines/scumm/imuse/imuse.cpp
    engines/scumm/input.cpp
    engines/scumm/insane/insane_enemy.cpp
    engines/scumm/nut_renderer.cpp
    engines/scumm/object.cpp
    engines/scumm/player_mac.cpp
    engines/scumm/player_v3m.cpp
    engines/scumm/script_v6.cpp
    engines/scumm/scumm-md5.h
    engines/scumm/scumm.h
    engines/scumm/vars.cpp
    engines/sky/sky.cpp
    engines/sword1/animation.cpp
    engines/sword1/animation.h
    engines/sword2/animation.cpp
    engines/sword2/animation.h
    engines/sword25/fmv/movieplayer.cpp
    engines/sword25/gfx/dynamicbitmap.cpp
    engines/sword25/gfx/image/image.h
    engines/sword25/gfx/image/imgloader.cpp
    engines/sword25/gfx/image/renderedimage.cpp
    engines/sword25/gfx/image/renderedimage.h
    engines/sword25/gfx/panel.cpp
    engines/sword25/gfx/renderobject.cpp
    engines/sword25/gfx/renderobject.h
    engines/sword25/gfx/renderobjectmanager.cpp
    engines/sword25/gfx/screenshot.cpp
    engines/sword25/gfx/staticbitmap.cpp
    engines/sword25/util/pluto/pluto.cpp
    engines/teenagent/callbacks.cpp
    engines/teenagent/dialog.cpp
    engines/teenagent/font.cpp
    engines/teenagent/resources.cpp
    engines/teenagent/scene.cpp
    engines/teenagent/teenagent.cpp
    engines/testbed/config.cpp
    engines/testbed/config.h
    engines/testbed/graphics.cpp
    engines/tinsel/bmv.cpp
    engines/tinsel/graphics.cpp
    engines/tinsel/handle.cpp
    engines/tinsel/rince.cpp
    engines/tinsel/scene.cpp
    engines/tinsel/tinsel.cpp
    engines/tinsel/tinsel.h
    engines/toltecs/menu.cpp
    engines/toltecs/screen.cpp
    engines/toltecs/segmap.cpp
    engines/tony/detection.cpp
    engines/tony/detection_tables.h
    engines/tony/game.cpp
    engines/tony/gfxcore.cpp
    engines/tony/gfxcore.h
    engines/tony/mpal/mpal.cpp
    engines/tony/mpal/mpal.h
    engines/tony/sound.cpp
    engines/tony/window.cpp
    engines/toon/anim.cpp
    engines/toon/character.cpp
    engines/toon/character.h
    engines/toon/movie.cpp
    engines/toon/picture.cpp
    engines/toon/toon.cpp
    engines/tsage/blue_force/blueforce_scenes9.cpp
    engines/tsage/converse.cpp
    engines/tsage/converse.h
    engines/tsage/core.cpp
    engines/tsage/core.h
    engines/tsage/dialogs.cpp
    engines/tsage/events.cpp
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp
    engines/tsage/graphics.h
    engines/tsage/ringworld/ringworld_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_logic.h
    engines/tsage/ringworld2/ringworld2_scenes0.cpp
    engines/tsage/ringworld2/ringworld2_scenes0.h
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.h
    engines/tsage/ringworld2/ringworld2_scenes2.cpp
    engines/tsage/ringworld2/ringworld2_scenes2.h
    engines/tsage/ringworld2/ringworld2_scenes3.cpp
    engines/tsage/ringworld2/ringworld2_scenes3.h
    engines/tsage/ringworld2/ringworld2_speakers.cpp
    engines/tsage/ringworld2/ringworld2_speakers.h
    engines/tsage/saveload.cpp
    engines/tsage/saveload.h
    engines/tsage/user_interface.cpp
    engines/tucker/sequences.cpp
    engines/tucker/tucker.cpp
    engines/wintermute/ad/ad_actor.cpp
    engines/wintermute/ad/ad_actor.h
    engines/wintermute/ad/ad_entity.cpp
    engines/wintermute/ad/ad_entity.h
    engines/wintermute/ad/ad_game.cpp
    engines/wintermute/ad/ad_game.h
    engines/wintermute/ad/ad_inventory.cpp
    engines/wintermute/ad/ad_inventory.h
    engines/wintermute/ad/ad_inventory_box.cpp
    engines/wintermute/ad/ad_inventory_box.h
    engines/wintermute/ad/ad_item.cpp
    engines/wintermute/ad/ad_item.h
    engines/wintermute/ad/ad_layer.cpp
    engines/wintermute/ad/ad_layer.h
    engines/wintermute/ad/ad_node_state.cpp
    engines/wintermute/ad/ad_node_state.h
    engines/wintermute/ad/ad_object.cpp
    engines/wintermute/ad/ad_object.h
    engines/wintermute/ad/ad_path.cpp
    engines/wintermute/ad/ad_path.h
    engines/wintermute/ad/ad_path_point.cpp
    engines/wintermute/ad/ad_path_point.h
    engines/wintermute/ad/ad_region.cpp
    engines/wintermute/ad/ad_region.h
    engines/wintermute/ad/ad_response.cpp
    engines/wintermute/ad/ad_response.h
    engines/wintermute/ad/ad_response_box.cpp
    engines/wintermute/ad/ad_response_box.h
    engines/wintermute/ad/ad_response_context.cpp
    engines/wintermute/ad/ad_response_context.h
    engines/wintermute/ad/ad_rot_level.cpp
    engines/wintermute/ad/ad_rot_level.h
    engines/wintermute/ad/ad_scale_level.cpp
    engines/wintermute/ad/ad_scale_level.h
    engines/wintermute/ad/ad_scene.cpp
    engines/wintermute/ad/ad_scene.h
    engines/wintermute/ad/ad_scene_node.cpp
    engines/wintermute/ad/ad_scene_state.cpp
    engines/wintermute/ad/ad_scene_state.h
    engines/wintermute/ad/ad_sentence.cpp
    engines/wintermute/ad/ad_sentence.h
    engines/wintermute/ad/ad_sprite_set.cpp
    engines/wintermute/ad/ad_sprite_set.h
    engines/wintermute/ad/ad_talk_def.cpp
    engines/wintermute/ad/ad_talk_def.h
    engines/wintermute/ad/ad_talk_holder.cpp
    engines/wintermute/ad/ad_talk_holder.h
    engines/wintermute/ad/ad_talk_node.cpp
    engines/wintermute/ad/ad_talk_node.h
    engines/wintermute/ad/ad_types.h
    engines/wintermute/ad/ad_waypoint_group.cpp
    engines/wintermute/ad/ad_waypoint_group.h
    engines/wintermute/base/base.cpp
    engines/wintermute/base/base.h
    engines/wintermute/base/base_active_rect.cpp
    engines/wintermute/base/base_active_rect.h
    engines/wintermute/base/base_dynamic_buffer.cpp
    engines/wintermute/base/base_dynamic_buffer.h
    engines/wintermute/base/base_engine.cpp
    engines/wintermute/base/base_engine.h
    engines/wintermute/base/base_fader.cpp
    engines/wintermute/base/base_fader.h
    engines/wintermute/base/base_file_manager.cpp
    engines/wintermute/base/base_file_manager.h
    engines/wintermute/base/base_frame.cpp
    engines/wintermute/base/base_frame.h
    engines/wintermute/base/base_game.cpp
    engines/wintermute/base/base_game.h
    engines/wintermute/base/base_game_music.cpp
    engines/wintermute/base/base_game_music.h
    engines/wintermute/base/base_game_settings.cpp
    engines/wintermute/base/base_game_settings.h
    engines/wintermute/base/base_keyboard_state.cpp
    engines/wintermute/base/base_keyboard_state.h
    engines/wintermute/base/base_named_object.cpp
    engines/wintermute/base/base_named_object.h
    engines/wintermute/base/base_object.cpp
    engines/wintermute/base/base_object.h
    engines/wintermute/base/base_parser.cpp
    engines/wintermute/base/base_parser.h
    engines/wintermute/base/base_persistence_manager.cpp
    engines/wintermute/base/base_persistence_manager.h
    engines/wintermute/base/base_point.cpp
    engines/wintermute/base/base_point.h
    engines/wintermute/base/base_quick_msg.cpp
    engines/wintermute/base/base_quick_msg.h
    engines/wintermute/base/base_region.cpp
    engines/wintermute/base/base_region.h
    engines/wintermute/base/base_script_holder.cpp
    engines/wintermute/base/base_script_holder.h
    engines/wintermute/base/base_scriptable.cpp
    engines/wintermute/base/base_scriptable.h
    engines/wintermute/base/base_sprite.cpp
    engines/wintermute/base/base_sprite.h
    engines/wintermute/base/base_string_table.cpp
    engines/wintermute/base/base_string_table.h
    engines/wintermute/base/base_sub_frame.cpp
    engines/wintermute/base/base_sub_frame.h
    engines/wintermute/base/base_surface_storage.cpp
    engines/wintermute/base/base_surface_storage.h
    engines/wintermute/base/base_transition_manager.cpp
    engines/wintermute/base/base_transition_manager.h
    engines/wintermute/base/base_viewport.cpp
    engines/wintermute/base/base_viewport.h
    engines/wintermute/base/file/base_disk_file.cpp
    engines/wintermute/base/file/base_disk_file.h
    engines/wintermute/base/file/base_file.cpp
    engines/wintermute/base/file/base_file.h
    engines/wintermute/base/file/base_file_entry.cpp
    engines/wintermute/base/file/base_file_entry.h
    engines/wintermute/base/file/base_package.cpp
    engines/wintermute/base/file/base_package.h
    engines/wintermute/base/file/base_save_thumb_file.cpp
    engines/wintermute/base/file/base_save_thumb_file.h
    engines/wintermute/base/file/dcpackage.h
    engines/wintermute/base/font/base_font.cpp
    engines/wintermute/base/font/base_font.h
    engines/wintermute/base/font/base_font_bitmap.cpp
    engines/wintermute/base/font/base_font_bitmap.h
    engines/wintermute/base/font/base_font_storage.cpp
    engines/wintermute/base/font/base_font_storage.h
    engines/wintermute/base/font/base_font_truetype.cpp
    engines/wintermute/base/font/base_font_truetype.h
    engines/wintermute/base/gfx/base_image.cpp
    engines/wintermute/base/gfx/base_image.h
    engines/wintermute/base/gfx/base_renderer.cpp
    engines/wintermute/base/gfx/base_renderer.h
    engines/wintermute/base/gfx/base_surface.cpp
    engines/wintermute/base/gfx/base_surface.h
    engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
    engines/wintermute/base/gfx/osystem/base_render_osystem.h
    engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
    engines/wintermute/base/gfx/osystem/base_surface_osystem.h
    engines/wintermute/base/gfx/osystem/render_ticket.cpp
    engines/wintermute/base/gfx/osystem/render_ticket.h
    engines/wintermute/base/particles/part_emitter.cpp
    engines/wintermute/base/particles/part_emitter.h
    engines/wintermute/base/particles/part_force.cpp
    engines/wintermute/base/particles/part_force.h
    engines/wintermute/base/particles/part_particle.cpp
    engines/wintermute/base/particles/part_particle.h
    engines/wintermute/base/save_thumb_helper.cpp
    engines/wintermute/base/save_thumb_helper.h
    engines/wintermute/base/saveload.cpp
    engines/wintermute/base/saveload.h
    engines/wintermute/base/scriptables/dcscript.h
    engines/wintermute/base/scriptables/script.cpp
    engines/wintermute/base/scriptables/script.h
    engines/wintermute/base/scriptables/script_engine.cpp
    engines/wintermute/base/scriptables/script_engine.h
    engines/wintermute/base/scriptables/script_ext_array.cpp
    engines/wintermute/base/scriptables/script_ext_array.h
    engines/wintermute/base/scriptables/script_ext_date.cpp
    engines/wintermute/base/scriptables/script_ext_date.h
    engines/wintermute/base/scriptables/script_ext_file.cpp
    engines/wintermute/base/scriptables/script_ext_file.h
    engines/wintermute/base/scriptables/script_ext_math.cpp
    engines/wintermute/base/scriptables/script_ext_math.h
    engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
    engines/wintermute/base/scriptables/script_ext_mem_buffer.h
    engines/wintermute/base/scriptables/script_ext_object.cpp
    engines/wintermute/base/scriptables/script_ext_object.h
    engines/wintermute/base/scriptables/script_ext_string.cpp
    engines/wintermute/base/scriptables/script_ext_string.h
    engines/wintermute/base/scriptables/script_stack.cpp
    engines/wintermute/base/scriptables/script_stack.h
    engines/wintermute/base/scriptables/script_value.cpp
    engines/wintermute/base/scriptables/script_value.h
    engines/wintermute/base/sound/base_sound.cpp
    engines/wintermute/base/sound/base_sound.h
    engines/wintermute/base/sound/base_sound_buffer.cpp
    engines/wintermute/base/sound/base_sound_buffer.h
    engines/wintermute/base/sound/base_sound_manager.cpp
    engines/wintermute/base/sound/base_sound_manager.h
    engines/wintermute/base/timer.cpp
    engines/wintermute/base/timer.h
    engines/wintermute/coll_templ.h
    engines/wintermute/dctypes.h
    engines/wintermute/debugger.cpp
    engines/wintermute/debugger.h
    engines/wintermute/detection.cpp
    engines/wintermute/detection_tables.h
    engines/wintermute/graphics/transparent_surface.cpp
    engines/wintermute/graphics/transparent_surface.h
    engines/wintermute/math/math_util.cpp
    engines/wintermute/math/math_util.h
    engines/wintermute/math/matrix4.cpp
    engines/wintermute/math/matrix4.h
    engines/wintermute/math/rect32.h
    engines/wintermute/math/vector2.cpp
    engines/wintermute/math/vector2.h
    engines/wintermute/module.mk
    engines/wintermute/persistent.h
    engines/wintermute/platform_osystem.cpp
    engines/wintermute/platform_osystem.h
    engines/wintermute/system/sys_class.cpp
    engines/wintermute/system/sys_class.h
    engines/wintermute/system/sys_class_registry.cpp
    engines/wintermute/system/sys_class_registry.h
    engines/wintermute/system/sys_instance.cpp
    engines/wintermute/system/sys_instance.h
    engines/wintermute/ui/ui_button.cpp
    engines/wintermute/ui/ui_button.h
    engines/wintermute/ui/ui_edit.cpp
    engines/wintermute/ui/ui_edit.h
    engines/wintermute/ui/ui_entity.cpp
    engines/wintermute/ui/ui_entity.h
    engines/wintermute/ui/ui_object.cpp
    engines/wintermute/ui/ui_object.h
    engines/wintermute/ui/ui_text.cpp
    engines/wintermute/ui/ui_text.h
    engines/wintermute/ui/ui_tiled_image.cpp
    engines/wintermute/ui/ui_tiled_image.h
    engines/wintermute/ui/ui_window.cpp
    engines/wintermute/ui/ui_window.h
    engines/wintermute/utils/crc.cpp
    engines/wintermute/utils/path_util.cpp
    engines/wintermute/utils/path_util.h
    engines/wintermute/utils/string_util.cpp
    engines/wintermute/utils/string_util.h
    engines/wintermute/utils/utils.cpp
    engines/wintermute/utils/utils.h
    engines/wintermute/video/video_player.cpp
    engines/wintermute/video/video_player.h
    engines/wintermute/video/video_theora_player.cpp
    engines/wintermute/video/video_theora_player.h
    engines/wintermute/wintermute.cpp
    engines/wintermute/wintypes.h
    graphics/VectorRenderer.h
    graphics/VectorRendererSpec.cpp
    graphics/cursorman.cpp
    graphics/cursorman.h
    graphics/decoders/bmp.cpp
    graphics/decoders/iff.cpp
    graphics/decoders/jpeg.cpp
    graphics/decoders/pcx.cpp
    graphics/decoders/pict.cpp
    graphics/decoders/png.cpp
    graphics/decoders/tga.cpp
    graphics/fonts/bdf.cpp
    graphics/fonts/ttf.cpp
    graphics/scaler/thumbnail_intern.cpp
    graphics/surface.cpp
    graphics/surface.h
    graphics/thumbnail.cpp
    graphics/thumbnail.h
    graphics/yuv_to_rgb.cpp
    graphics/yuv_to_rgb.h
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/about.cpp
    gui/chooser.cpp
    gui/credits.h
    gui/dialog.h
    gui/gui-manager.cpp
    gui/gui-manager.h
    gui/launcher.cpp
    gui/launcher.h
    gui/module.mk
    gui/saveload-dialog.cpp
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/scummmodern_gfx.stx
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/themes/scummtheme.py
    gui/widget.cpp
    gui/widgets/edittext.cpp
    po/POTFILES
    ports.mk
    test/audio/raw.h
    test/common/str.h
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/codecs/cdtoons.cpp
    video/codecs/cinepak.cpp
    video/codecs/codec.h
    video/codecs/indeo3.cpp
    video/codecs/msrle.cpp
    video/codecs/msvideo1.cpp
    video/codecs/qtrle.cpp
    video/codecs/rpza.cpp
    video/codecs/smc.cpp
    video/coktel_decoder.cpp
    video/dxa_decoder.cpp
    video/flic_decoder.cpp
    video/module.mk
    video/smk_decoder.cpp
    video/theora_decoder.cpp
    video/video_decoder.cpp
    video/video_decoder.h





Commit: b60767fce8100f04828128948f1b1e30e69f4257
    https://github.com/scummvm/scummvm/commit/b60767fce8100f04828128948f1b1e30e69f4257
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T06:20:41-07:00

Commit Message:
AVALANCHE: Do not set pixels directly

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 6058b00..8f51f74 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -309,7 +309,7 @@ void Graphics::refreshScreen() {
 		}
 	}
 	// Now we copy the stretched picture to the screen.
-	g_system->copyRectToScreen(_screen.pixels, _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
+	g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
 	g_system->updateScreen();
 }
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 513052f..ab1b9d8 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -499,7 +499,7 @@ void Gyro::loadMouse(byte which) {
 	mask.free();
 	f.close();
 
-	CursorMan.replaceCursor(cursor.pixels, 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
 	cursor.free();
 }
 


Commit: 78417de0d119e940243c6499be01f2aebf669f2e
    https://github.com/scummvm/scummvm/commit/78417de0d119e940243c6499be01f2aebf669f2e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T09:50:47-07:00

Commit Message:
AVALANCHE: Start simplifying String use

Changed paths:
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 81e4671..a186306 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -177,8 +177,11 @@ void Visa::talkTo(byte whom) {
 				// 0 - let it through to use normal routine.
 				switch (_vm->_gyro->_dna._givenToSpludwick) {
 				case 1: // Fallthrough is intended.
-				case 2:
-					_vm->_scrolls->displayText(Common::String("Can you get me ") + _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+				case 2: {
+					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]);
+					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+					_vm->_scrolls->displayText(tmpStr);
+					}
 					return;
 				case 3:
 					displayScrollChain('q', 30); // Need any help with the game?
@@ -250,14 +253,17 @@ void Visa::talkTo(byte whom) {
 	bool noMatches = true;
 	for (byte i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
-			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + (i + 49) + _vm->_scrolls->kControlToBuffer);
+			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, i + 49, Scrolls::kControlToBuffer);
+			_vm->_scrolls->displayText(tmpStr);
 			noMatches = false;
 			break;
 		}
 	}
 
-	if (noMatches)
-		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer);
+	if (noMatches) {
+		Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, Scrolls::kControlRegister, Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr);
+	}
 
 	speak(whom, _vm->_gyro->_subjectNum);
 


Commit: f33ba719245a8da967ef5de414ecaa35d39df7e1
    https://github.com/scummvm/scummvm/commit/f33ba719245a8da967ef5de414ecaa35d39df7e1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T09:52:40-07:00

Commit Message:
AVALANCHE: Fix bug in Visa2

Changed paths:
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index a186306..b356aef 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -84,8 +84,7 @@ void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling
 
 	if (error) {
 		if (report) {
-			Common::String todisplay;
-			todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->intToStr(point).c_str());
+			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Scrolls::kControlBell, block, point);
 			_vm->_scrolls->displayText(todisplay);
 		}
 		return;


Commit: cb66911ed2d9c0c19bf2ecec3eb71d398e5a94b7
    https://github.com/scummvm/scummvm/commit/cb66911ed2d9c0c19bf2ecec3eb71d398e5a94b7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T11:24:09-07:00

Commit Message:
AVALANCHE: Rework more strings in Scroll2

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 30e5bc4..d4cd5b1 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -561,18 +561,20 @@ Common::String Scrolls::displayMoney() {
 	Common::String result;
 
 	if (_vm->_gyro->_dna._money < 12) { // just pence
-		result = _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + 'd';
+		result = Common::String::format("%dd", _vm->_gyro->_dna._money);
 	} else if (_vm->_gyro->_dna._money < 240) { // shillings & pence
-		result = _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 12) + '/';
 		if ((_vm->_gyro->_dna._money % 12) == 0)
-			result = result + '-';
+			result = Common::String::format("%d/-", _vm->_gyro->_dna._money / 12);
 		else
-			result = result + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
-	} else // L, s & d
-		result = Common::String('\x9C') + _vm->_gyro->intToStr(_vm->_gyro->_dna._money / 240) + '.' + _vm->_gyro->intToStr((_vm->_gyro->_dna._money / 12) % 20)
-			+ '.' + _vm->_gyro->intToStr(_vm->_gyro->_dna._money % 12);
-	if (_vm->_gyro->_dna._money > 12)
-		result = result + " (that's " + _vm->_gyro->intToStr(_vm->_gyro->_dna._money) + "d)";
+			result = Common::String::format("%d/%d", _vm->_gyro->_dna._money / 12, _vm->_gyro->_dna._money % 12);
+	} else { // L, s & d
+		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_dna._money / 240, (_vm->_gyro->_dna._money / 12) % 20, 
+		                _vm->_gyro->_dna._money % 12);
+	}
+	if (_vm->_gyro->_dna._money > 12) {
+		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_dna._money);
+		result += extraStr;
+	}
 
 	return result;
 }
@@ -813,14 +815,12 @@ void Scrolls::loadFont() {
 }
 
 void Scrolls::musicalScroll() {
-	displayText(Common::String("To play the harp...") + kControlNewLine + kControlNewLine + "Use these keys:" + + kControlNewLine
-		+ kControlInsertSpaces + "Q W E R T Y U I O P [ ]" + kControlNewLine + kControlNewLine + "Or press Enter to stop playing."
-		+ kControlToBuffer);
+	Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c", 
+		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
+	displayText(tmpStr);
 
 	_vm->_lucerna->spriteRun();
-
 	drawScroll(&Avalanche::Scrolls::scrollModeMusic);
-
 	resetScroll();
 }
 


Commit: e77db05208bede59f9a3aa33ba8c3b175e48b0fc
    https://github.com/scummvm/scummvm/commit/e77db05208bede59f9a3aa33ba8c3b175e48b0fc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T13:23:58-07:00

Commit Message:
AVALANCHE: Rework some more string uses

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 006ed5a..d3f66ed 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -53,9 +53,8 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	if (spritenum == 177)
 		return; // Already running!
 
-	Common::String filename;
 	Common::File inf;
-	filename = filename.format("sprite%d.avd", spritenum);
+	Common::String filename = Common::String::format("sprite%d.avd", spritenum);
 	if (!inf.open(filename)) {
 		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
 		return;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index ab1b9d8..70c2150 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -190,8 +190,7 @@ Gyro::~Gyro() {
 }
 
 Common::String Gyro::intToStr(int32 num) {
-	Common::String result = Common::String::format("%d", num);
-	return result;
+	return Common::String::format("%d", num);
 }
 
 void Gyro::newMouse(byte id) {
@@ -427,34 +426,32 @@ Common::String Gyro::getItem(byte which) {
 
 
 Common::String Gyro::f5Does() {
-	Common::String f5_does_result;
 	switch (_dna._room) {
-	case r__yours: {
-			if (!_dna._avvyIsAwake)
-				return Common::String(_vm->_acci->kVerbCodeWake) + "WWake up";
-			else if (_dna._avvyInBed)
-				return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up";
-		}
+	case r__yours:
+		if (!_dna._avvyIsAwake)
+			return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
+		else if (_dna._avvyInBed)
+			return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
 		break;
 	case r__insidecardiffcastle:
 		if (_dna._standingOnDais)
-			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down";
+			return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
 		else
-			return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb up";
+			return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
 		break;
 	case r__nottspub:
 		if (_dna._sittingInPub)
-			return Common::String(_vm->_acci->kVerbCodeStand) + "SStand up";
+			return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
 		else
-			return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down";
+			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
 		break;
 	case r__musicroom:
 		if (_vm->_animation->inField(7))
-			return Common::String(_vm->_acci->kVerbCodePlay) + "PPlay the harp";
+			return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay);
 		break;
 	}
 
-	return Common::String(_vm->_acci->kPardon); // If all else fails...
+	return Common::String::format("%c", _vm->_acci->kPardon); // If all else fails...
 }
 
 void Gyro::loadMouse(byte which) {
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d4cd5b1..ab895a1 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -85,7 +85,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 	byte lz = z.size();
 
 	bool offset = x % 8 == 4;
-	x = x / 8;
+	x /= 8;
 	y++;
 	int16 i = 0;
 	for (byte xx = 0; xx < lz; xx++) {
@@ -112,7 +112,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 }
 
 void Scrolls::scrollModeNormal() {
-	Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***";
+	Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
 	Common::String e = "(c) 1994";
 
 	setReadyLight(3);
@@ -161,7 +161,8 @@ void Scrolls::scrollModeNormal() {
 			if (aboutscroll) {
 				move(e[2 - 1], e[1 - 1], 7);
 				e[8 - 1] = inchar;
-				if (egg == e)  easteregg();
+				if (egg == e)
+					easteregg();
 			}
 			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
 			if (! oktoexit)  errorled();
@@ -278,9 +279,8 @@ void Scrolls::getIcon(int16 x, int16 y, byte which) {
 
 void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File file;
+	Common::String filename = Common::String::format("%s.avd", fn.c_str());
 
-	Common::String filename;
-	filename = filename.format("%s.avd", fn.c_str());
 	if (!file.open(filename)) {
 		warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 		return;


Commit: f7bce3bede1c48efcb92aee26ff7e26158fa99ab
    https://github.com/scummvm/scummvm/commit/f7bce3bede1c48efcb92aee26ff7e26158fa99ab
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T14:13:58-07:00

Commit Message:
AVALANCHE: Rework some more strings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1c10a36..b10a6bc 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -270,9 +270,9 @@ Common::String Acci::totalTime() {
 
 	Common::String result = "You've been playing for ";
 	if (h > 0)
-		result = result + _vm->_gyro->intToStr(h) + " hours, ";
+		result += _vm->_gyro->intToStr(h) + " hours, ";
 	if ((m > 0) || (h != 0))
-		result = result + _vm->_gyro->intToStr(m) + " minutes and ";
+		result += _vm->_gyro->intToStr(m) + " minutes and ";
 	return result + _vm->_gyro->intToStr(s) + " seconds.";
 }
 
@@ -308,12 +308,15 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 		else
 			_vm->_scrolls->displayText("What?");
 	} else {
-		if (animate)
-			_vm->_scrolls->displayText(Common::String("{ ") + _vm->_gyro->getName(target) + " }");
-		else {
+		if (animate) {
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
+			_vm->_scrolls->displayText(tmpStr);
+		} else {
 			Common::String z = _vm->_gyro->getItem(target);
-			if (z != "")
-				_vm->_scrolls->displayText(Common::String("{ ") + z + " }");
+			if (z != "") {
+				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
+				_vm->_scrolls->displayText(tmpStr);
+			}
 		}
 	}
 }
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index d3f66ed..9b7b067 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -446,9 +446,11 @@ void Animation::catacombMove(byte ped) {
 		flipRoom(r__lustiesroom, 4);
 		_vm->_scrolls->displayText("Phew! Nice to be out of there!");
 		return;
-	case 1033: // Oubliette
+	case 1033:{ // Oubliette
 		flipRoom(r__oubliette, 1);
-		_vm->_scrolls->displayText(Common::String("Oh, NO!") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		}
 		return;
 	case 4:
 		flipRoom(r__geidas, 1);
@@ -1290,9 +1292,10 @@ void Animation::stopWalking() {
  */
 void Animation::hideInCupboard() {
 	if (_vm->_gyro->_dna._avvysInTheCupboard) {
-		if (_vm->_gyro->_dna._wearing == Acci::kNothing)
-			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
-		else {
+		if (_vm->_gyro->_dna._wearing == Acci::kNothing) {
+			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+			_vm->_scrolls->displayText(tmpStr);
+		} else {
 			_sprites[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
 			appearPed(1, 3); // Walk out of the cupboard.
@@ -1306,8 +1309,9 @@ void Animation::hideInCupboard() {
 		// Not hiding in the cupboard
 		_sprites[0]._visible = false;
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_scrolls->displayText(Common::String("You walk into the room...") + _vm->_scrolls->kControlParagraph
-			+ "It seems to be an empty, but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.");
+		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
+			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
+		_vm->_scrolls->displayText(tmpStr);
 		_vm->_gyro->_dna._avvysInTheCupboard = true;
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 	}
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 883e1a2..eaa2211 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -264,7 +264,8 @@ void Timer::toilet() {
 }
 
 void Timer::bang() {
-	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
+	Common::String tmpStr = Common::String::format("%c< BANG! >", Scrolls::kControlItalic);
+	_vm->_scrolls->displayText(tmpStr);
 	addTimer(30, kProcBang2, kReasonExplosion);
 }
 
@@ -545,8 +546,8 @@ void Timer::fallDownOubliette() {
 
 void Timer::meetAvaroid() {
 	if (_vm->_gyro->_dna._metAvaroid) {
-		_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
-			+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
+		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+		_vm->_scrolls->displayText(tmpStr);
 		_vm->_lucerna->gameOver();
 	} else {
 		_vm->_visa->displayScrollChain('Q', 60);
@@ -617,8 +618,8 @@ void Timer::avvySitDown() {
 }
 
 void Timer::ghostRoomPhew() {
-	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
-		+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
+	Common::String tmpStr = Common::String::format("%cPHEW!%c You're glad to get out of %cthere!", Scrolls::kControlItalic, Scrolls::kControlRoman, Scrolls::kControlItalic);
+	_vm->_scrolls->displayText(tmpStr);
 }
 
 void Timer::arkataShouts() {
@@ -656,7 +657,7 @@ void Timer::avalotFalls() {
 			toDisplay += _vm->_scrolls->kControlNewLine;
 		for (byte i = 0; i < 6; i++)
 			toDisplay += _vm->_scrolls->kControlInsertSpaces;
-		toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
+		toDisplay += _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
 		_vm->_scrolls->displayText(toDisplay);
 	}
 }


Commit: 2d2ce624a9aa9d2b6c0a5e6d2e505510607cf956
    https://github.com/scummvm/scummvm/commit/2d2ce624a9aa9d2b6c0a5e6d2e505510607cf956
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T14:37:13-07:00

Commit Message:
AVALANCHE: Rework some more strings

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index b10a6bc..cc2d5c4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -364,8 +364,8 @@ void Acci::properNouns() {
 void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
-	_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + '1' + x
-		+ '.' + _vm->_scrolls->kControlSpeechBubble + _vm->_scrolls->kControlRegister + '2');
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
+	_vm->_scrolls->displayText(tmpStr);
 }
 
 void Acci::storeInterrogation(byte interrogation) {
@@ -480,7 +480,7 @@ void Acci::parse() {
 		if (!thisword.empty()) {
 			for (byte i = 0; i < 31; i++) {
 				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
-					_thats = _thats + Common::String(99 + i);
+					_thats += Common::String(99 + i);
 					notfound = false;
 				}
 			}
@@ -599,7 +599,8 @@ void Acci::parse() {
 	}
 
 	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-		_vm->_scrolls->displayText(Common::String("Sorry, but I have no idea what \"") + unkString + "\" means. Can you rephrase it?");
+		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
+		_vm->_scrolls->displayText(tmpStr);
 		_vm->_gyro->_weirdWord = true;
 	} else
 		_vm->_gyro->_weirdWord = false;
@@ -650,11 +651,12 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_dna._room))
 		return true;
 	else {
+		Common::String tmpStr;
 		if (_person < 175)
-			_vm->_scrolls->displayText(Common::String('H') + _vm->_scrolls->kControlToBuffer);
+			tmpStr = Common::String::format("H%ce isn't around at the moment.", Scrolls::kControlToBuffer);
 		else
-			_vm->_scrolls->displayText(Common::String("Sh") + _vm->_scrolls->kControlToBuffer);
-		_vm->_scrolls->displayText("e isn't around at the moment.");
+			tmpStr = Common::String::format("Sh%ce isn't around at the moment.", Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr);
 		return false;
 	}
 }
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 9b7b067..9e73ea7 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -213,11 +213,10 @@ void AnimationType::walk() {
 
 		if ((tc != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
 			switch (_anim->_vm->_gyro->_magics[tc]._operation) {
-			case Gyro::kMagicExclaim: {
+			case Gyro::kMagicExclaim:
 				bounce();
 				_anim->_mustExclaim = true;
 				_anim->_sayWhat = _anim->_vm->_gyro->_magics[tc]._data;
-				}
 				break;
 			case Gyro::kMagicBounce:
 				bounce();
@@ -227,7 +226,8 @@ void AnimationType::walk() {
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
-				_anim->_vm->_scrolls->displayText("\7Sorry.\3\rThis place is not available yet!");
+				Common::String tmpStr = Common::String::format("%cSorry.%cThis place is not available yet!", Scrolls::kControlBell, Scrolls::kControlCenter, Scrolls::kControlRoman);
+				_anim->_vm->_scrolls->displayText(tmpStr);
 				}
 				break;
 			case Gyro::kMagicSpecial:
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 390c13b..a99e74b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -71,10 +71,12 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 	if (_oldMinute != _minute)
 		plotHands();
 
-	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717))
-		_vm->_scrolls->displayText(Common::String("Good morning!") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-		+ "Yes, it's just past midnight. Are you having an all-night Avvy session? Glad you like the game that much!");
-
+	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
+		Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
+			"midnight. Are you having an all-night Avvy session? Glad you like the game that much!", 
+			Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+		_vm->_scrolls->displayText(tmpStr);
+	}
 	_oldHour = _hour;
 	_oldHourAngle = _hourAngle;
 	_oldMinute = _minute;
@@ -147,10 +149,10 @@ void Lucerna::init() {
  */
 void Lucerna::callVerb(byte id) {
 	if (id == _vm->_acci->kPardon) {
-		_vm->_scrolls->displayText(Common::String("The f5 key lets you do a particular action in certain ") +
-			"situations. However, at the moment there is nothing " +
-			"assigned to it. You may press alt-A to see what the " +
-			"current setting of this key is.");
+		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
+			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
+			"what the current setting of this key is.");
+		_vm->_scrolls->displayText(tmpStr);
 	} else {
 		_vm->_gyro->_weirdWord = false;
 		_vm->_acci->_polite = true;


Commit: 524edfcbc358432dea7e8e96f4646dfe94b03596
    https://github.com/scummvm/scummvm/commit/524edfcbc358432dea7e8e96f4646dfe94b03596
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-08T22:20:25-07:00

Commit Message:
AVALANCHE: Rework more strings (still WIP)

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index cc2d5c4..34768b4 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1917,10 +1917,10 @@ void Acci::doThat() {
 	case kVerbCodeDie:
 		_vm->_lucerna->gameOver();
 		break;
-	case kVerbCodeScore:
-		_vm->_scrolls->displayText(Common::String("Your score is ") + _vm->_gyro->intToStr(_vm->_gyro->_dna._score) + ',' + _vm->_scrolls->kControlCenter
-			+ _vm->_scrolls->kControlNewLine + "out of a possible 128." + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "This gives you a rank of " + rank() + '.' + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + totalTime());
+	case kVerbCodeScore: {
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dna._score, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
+		_vm->_scrolls->displayText(tmpStr);
+		}
 		break;
 	case kVerbCodePut:
 		putProc();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a99e74b..a10c5e1 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -293,8 +293,7 @@ void Lucerna::loadRoom(byte num) {
 
 	_vm->_graphics->fleshColors();
 
-	Common::String filename;
-	filename = filename.format("place%d.avd", num);
+	Common::String filename = Common::String::format("place%d.avd", num);
 	if (!file.open(filename)) {
 		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 		return;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index ab895a1..abc6ebd 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -714,8 +714,10 @@ void Scrolls::callScrollDriver() {
 				case 6:
 					displayText(_vm->_gyro->_dna._spareEvening + kControlToBuffer);
 					break;
-				case 9:
-					displayText(_vm->_gyro->intToStr(_vm->_gyro->_dna._catacombX) + ',' + _vm->_gyro->intToStr(_vm->_gyro->_dna._catacombY) + kControlToBuffer);
+				case 9: {
+					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_dna._catacombX, _vm->_gyro->_dna._catacombY, kControlToBuffer);
+					displayText(tmpStr);
+					}
 					break;
 				case 10:
 					switch (_vm->_gyro->_dna._boxContent) {


Commit: e12e0eb2ff324c3032f8375162b4275c71f9a9e8
    https://github.com/scummvm/scummvm/commit/e12e0eb2ff324c3032f8375162b4275c71f9a9e8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-09T14:00:24-07:00

Commit Message:
AVALANCHE: Rework some more strings, identify some dead code in avalanche.cpp

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 34768b4..0db9db7 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -512,8 +512,9 @@ void Acci::parse() {
 	}
 
 	Common::String unkString;
-	if (_vm->_parser->pos(Common::String('\xFE'), _thats) > -1)
-		unkString = _realWords[_vm->_parser->pos(Common::String('\xFE'), _thats)];
+	int16 pos = _vm->_parser->pos(Common::String('\xFE'), _thats);
+	if (pos > -1)
+		unkString = _realWords[pos];
 	else
 		unkString.clear();
 
@@ -982,10 +983,10 @@ void Acci::putProc() {
 			if (_vm->_gyro->_dna._rottenOnion)
 				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
-				if (_vm->_gyro->_dna._wineState != 3)
-					_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "Oignon au vin"
-					+ _vm->_scrolls->kControlRoman + " is a bit too strong for your tastes!");
-				else { // Put onion into vinegar! Yes!
+				if (_vm->_gyro->_dna._wineState != 3) {
+					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+					_vm->_scrolls->displayText(tmpStr);
+				} else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_dna._onionInVinegar = true;
 					_vm->_lucerna->incScore(7);
 					_vm->_visa->displayScrollChain('u', 9);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d2e9a8d..3a95219 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -97,7 +97,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_closing = new Closing(this);
 
 	_graphics->init();
-
 	_scrolls->init();
 	_lucerna->init();
 	_acci->init();
@@ -106,7 +105,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	return Common::kNoError;
 }
 
-
 GUI::Debugger *AvalancheEngine::getDebugger() {
 	return _console;
 }
@@ -115,8 +113,6 @@ Common::Platform AvalancheEngine::getPlatform() const {
 	return _platform;
 }
 
-
-
 bool AvalancheEngine::hasFeature(EngineFeature f) const {
 	return (f == kSupportsSavingDuringRuntime) || (f == kSupportsLoadingDuringRuntime);
 }
@@ -125,8 +121,6 @@ const char *AvalancheEngine::getCopyrightString() const {
 	return "Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.";
 }
 
-
-
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
 	sz.syncAsByte(_gyro->_dna._direction);
@@ -300,7 +294,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(_animation->_sprites[i]._id);
 		sz.syncAsByte(_animation->_sprites[i]._doCheck);
 
-
 		if (sz.isLoading()) {
 			_animation->_sprites[i]._quick = true;
 			_animation->_sprites[i].init(_animation->_sprites[i]._id, _animation->_sprites[i]._doCheck, _animation);
@@ -322,7 +315,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(_animation->_sprites[i]._callEachStepFl);
 		sz.syncAsByte(_animation->_sprites[i]._eachStepProc);
 		sz.syncAsByte(_animation->_sprites[i]._vanishIfStill);
-
 		sz.syncAsSint16LE(_animation->_sprites[i]._x);
 		sz.syncAsSint16LE(_animation->_sprites[i]._y);
 
@@ -377,26 +369,19 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 	f->writeSint16LE(t.tm_year);
 
 	Common::Serializer sz(NULL, f);
-
 	synchronize(sz);
-
 	f->finalize();
-
 	delete f;
 
 	return true;
 }
 
-
-
 Common::String AvalancheEngine::getSaveFileName(const int slot) {
 	Common::String upperName = _targetName;
 	upperName.toUppercase();
 	return upperName+ Common::String::format("-%02d.SAV", slot);
 }
 
-
-
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
 	return (!_gyro->_seeScroll);
 }
@@ -433,8 +418,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		char actChar = f->readByte();
 		description += actChar;
 	}
-	description.toUppercase();
 
+	description.toUppercase();
 	::Graphics::skipThumbnail(*f);
 
 	// Read the time the game was saved.
@@ -444,13 +429,10 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	t.tm_year = f->readSint16LE();
 
 	Common::Serializer sz(f, NULL);
-
 	synchronize(sz);
-
 	delete f;
 
 	_gyro->isLoaded = true;
-
 	_gyro->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
 	if (_gyro->_holdTheDawn) {
@@ -459,30 +441,22 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	}
 
 	_celer->forgetBackgroundSprites();
-
 	_lucerna->minorRedraw();
-
 	_dropdown->setupMenu();
-
 	_gyro->_whereIs[0] = _gyro->_dna._room;
-
 	_gyro->_alive = true;
-
 	_lucerna->refreshObjectList();
-
 	_animation->updateSpeed();
-
 	_lucerna->drawDirection();
-
 	_gyro->_onToolbar = false;
 	_animation->animLink();
-
 	_celer->updateBackgroundSprites();
 
-	_scrolls->displayText(Common::String(_scrolls->kControlItalic) + "Loaded: " + _scrolls->kControlRoman + description + ".ASG"
-		+ _scrolls->kControlCenter + _scrolls->kControlNewLine + _scrolls->kControlNewLine
-		+ _gyro->_roomnName + _scrolls->kControlNewLine + _scrolls->kControlNewLine
-		+ "saved on " + expandDate(t.tm_mday, t.tm_mon, t.tm_year) + '.');
+	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
+		Scrolls::kControlItalic, Scrolls::kControlRoman, description.c_str(), Scrolls::kControlCenter, 
+		Scrolls::kControlNewLine, Scrolls::kControlNewLine, _gyro->_roomnName, Scrolls::kControlNewLine, 
+		Scrolls::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
+	_scrolls->displayText(tmpStr);
 
 	if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible)
 		_animation->changeDirection(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
@@ -496,29 +470,26 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 	};
 
 	Common::String month = months[m];
-
 	Common::String day = _gyro->intToStr(d);
 
 	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
 		switch (d % 10) {
 		case 1:
-			day = day + "st";
+			day += "st";
 			break;
 		case 2:
-			day = day + "nd";
+			day += "nd";
 			break;
 		case 3:
-			day = day + "rd";
+			day += "rd";
 			break;
 		default:
-			day = day + "th";
+			day += "th";
 		}
 
 	return day + ' ' + month + ' ' + _gyro->intToStr(y + 1900);
 }
 
-
-
 void AvalancheEngine::updateEvents() {
 	Common::Event event;
 
@@ -547,76 +518,13 @@ Common::Point AvalancheEngine::getMousePos() {
 	return _eventMan->getMousePos();
 }
 
-
-
-
-
 // From Bootstrp:
-
 const char AvalancheEngine::kRuncodes[2][3] = {"et", "Go"};
 
-
-
-// The original ones were all commented out, so porbably there's no need
-// of these two cursor functions at all. TODO: Remove later.
-void AvalancheEngine::cursorOff() {
-	warning("STUB: cursorOff()");
-}
-
-void AvalancheEngine::cursorOn() {
-	warning("STUB: cursorOn()");
-}
-
-// Needed later.
-void AvalancheEngine::quit() {
-	cursorOn();
-}
-
-// Needed in dos_shell(). TODO: Remove later.
-Common::String AvalancheEngine::commandCom() {
-	warning("STUB: commandCom()");
-	return ("STUB: commandCom()");
-}
-
-// Needed for run_avalot()'s errors. TODO: Remove later.
-void AvalancheEngine::explain(byte error) {
-	warning("STUB: explain()");
-}
-
-
-
-//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
-
-void AvalancheEngine::bFlight() {   //interrupt;
-	_storage._skellern++;
-}
-
 void AvalancheEngine::bFlightOn() {
 	_storage._skellern = kReset;
 	// setintvec(0x1c, &b_flight);
 }
-
-void AvalancheEngine::bFlightOff() {
-	// setintvec(0x1c, old_1c);
-}
-
-
-
-Common::String AvalancheEngine::elmToStr(Elm how) {
-	switch (how) {
-	case kNormal:
-	case kMusical:
-		return Common::String("jsb");
-	case kRegi:
-		return Common::String("REGI");
-	case kElmpoyten:
-		return Common::String("ELMPOYTEN");
-	// Useless, but silent a warning
-	default:
-		return Common::String("");
-	}
-}
-
 void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
 	warning("STUB: run(%s)", what.c_str());
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
@@ -637,54 +545,22 @@ void AvalancheEngine::callMenu() {
 	warning("STUB: callMenu()");
 }
 
-void AvalancheEngine::runDemo() {
-	warning("STUB: runDemo()");
-}
-
-void AvalancheEngine::dosShell() {
-	warning("STUB: dosShell()");
-}
-
-// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
-bool AvalancheEngine::keyPressed() {
-	warning("STUB: keyPressed()");
-	return false;
-}
-
-// Same as keypressed1().
-void AvalancheEngine::flushBuffer() {
-	warning("STUB: flushBuffer()");
-}
-
-// Same as keypressed1().
-void AvalancheEngine::demo() {
-	warning("STUB: demo()");
-}
-
-
-
-
 void AvalancheEngine::runAvalot() {
 	bFlightOn();
 
 	_avalot->run(Common::String(kRuncodes[_firstTime]) + _arguments);
-	// TODO: Check if parameteres are ever used (probably not) and eventually remove them.
-	// If there's an error initalizing avalot, i'll handle it in there, not here
+	// TODO: Check if parameters are ever used (probably not) and eventually remove them.
+	// If there's an error initializing avalot, i'll handle it in there, not here
 
 	_firstTime = false;
 }
 
-
-
 Common::Error AvalancheEngine::run() {
 	Common::ErrorCode err = initialize();
 	if (err != Common::kNoError)
 		return err;
 
-
-
 	// From bootstrp:
-
 	_firstTime = true;
 
 	getArguments();
@@ -696,8 +572,6 @@ Common::Error AvalancheEngine::run() {
 	if (!_zoomy)
 		callMenu();    // Not run when zoomy.
 
-
-
 	do {
 		runAvalot();
 
@@ -722,11 +596,84 @@ Common::Error AvalancheEngine::run() {
 
 	} while (!shouldQuit());
 
+	return Common::kNoError;
+}
 
+#if 0
+void AvalancheEngine::bFlightOff() {
+	// setintvec(0x1c, old_1c);
+}
 
-	return Common::kNoError;
+Common::String AvalancheEngine::elmToStr(Elm how) {
+	switch (how) {
+	case kNormal:
+	case kMusical:
+		return Common::String("jsb");
+	case kRegi:
+		return Common::String("REGI");
+	case kElmpoyten:
+		return Common::String("ELMPOYTEN");
+		// Useless, but silent a warning
+	default:
+		return Common::String("");
+	}
+}
+
+// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
+bool AvalancheEngine::keyPressed() {
+	warning("STUB: keyPressed()");
+	return false;
+}
+
+// Same as keypressed1().
+void AvalancheEngine::flushBuffer() {
+	warning("STUB: flushBuffer()");
+}
+
+// Same as keypressed1().
+void AvalancheEngine::demo() {
+	warning("STUB: demo()");
+}
+
+void AvalancheEngine::runDemo() {
+	warning("STUB: runDemo()");
+}
+
+void AvalancheEngine::dosShell() {
+	warning("STUB: dosShell()");
+}
+
+//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
+void AvalancheEngine::bFlight() {   //interrupt;
+	_storage._skellern++;
 }
 
+// Needed in dos_shell(). TODO: Remove later.
+Common::String AvalancheEngine::commandCom() {
+	warning("STUB: commandCom()");
+	return ("STUB: commandCom()");
+}
 
+// Needed for run_avalot()'s errors. TODO: Remove later.
+void AvalancheEngine::explain(byte error) {
+	warning("STUB: explain()");
+}
+
+// The original ones were all commented out, so probably there's no need
+// of these two cursor functions at all. TODO: Remove later.
+void AvalancheEngine::cursorOff() {
+	warning("STUB: cursorOff()");
+}
+
+void AvalancheEngine::cursorOn() {
+	warning("STUB: cursorOn()");
+}
+
+// Needed later.
+void AvalancheEngine::quit() {
+	cursorOn();
+}
+
+#endif
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 998363a..d632752 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -141,33 +141,38 @@ private:
 		byte _contents[1000];
 	} _storage;
 
-	Common::String _arguments, _demoArgs, _argsWithNoFilename;
+	Common::String _arguments;
 	bool _firstTime;
-	byte _originalMode;
-	byte *_old1c;
-	Common::String _segofs;
 	bool _zoomy;
-	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
 
-	void cursorOff();
-	void cursorOn();
-	void quit();
-	Common::String commandCom();
-	void explain(byte error);
-	void bFlight();
 	void bFlightOn();
-	void bFlightOff();
-	Common::String elmToStr(Elm how);
 	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
 	void getArguments();
 	void getSlope();
 	void callMenu();
 	void runAvalot();
-	void runDemo();
-	void dosShell();
+
+#if 0
+	Common::String _demoArgs, _argsWithNoFilename;
+	byte _originalMode;
+	byte *_old1c;
+	Common::String _segofs;
+	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
+
+	void bFlightOff();
+	Common::String elmToStr(Elm how);
 	bool keyPressed();
 	void flushBuffer();
 	void demo();
+	void runDemo();
+	void dosShell();
+	void bFlight();
+	Common::String commandCom();
+	void explain(byte error);
+	void cursorOff();
+	void cursorOn();
+	void quit();
+#endif
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 99c3950..287f844 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -185,8 +185,6 @@ void Avalot::setup() {
 	}
 }
 
-
-
 void Avalot::run(Common::String arg) {
 	setup();
 
@@ -195,8 +193,6 @@ void Avalot::run(Common::String arg) {
 
 		_vm->updateEvents(); // The event handler.
 
-
-
 		_vm->_lucerna->_clock.update();
 		_vm->_dropdown->updateMenu();
 		_vm->_gyro->forceNumlock();
@@ -205,8 +201,6 @@ void Avalot::run(Common::String arg) {
 		_vm->_lucerna->checkClick();
 		_vm->_timer->updateTimer();
 
-
-
 #ifdef DEBUG
 		// ONLY FOR TESTING!!!
 		for (byte i = 0; i < _vm->_gyro->_lineNum; i++)
@@ -219,7 +213,6 @@ void Avalot::run(Common::String arg) {
 		// ONLY FOR TESTING!!!
 #endif
 
-
 		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a10c5e1..041236c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -217,7 +217,7 @@ void Lucerna::loadAlso(byte num) {
 		}
 	}
 	Common::String filename;
-	filename = filename.format("also%d.avd", num);
+	filename = Common::String::format("also%d.avd", num);
 	if (!file.open(filename)) {
 		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 		return;
@@ -226,12 +226,14 @@ void Lucerna::loadAlso(byte num) {
 	file.seek(128);
 
 	byte alsoNum = file.readByte();
+	Common::String tmpStr;
 	for (byte i = 0; i <= alsoNum; i++) {
 		for (byte j = 0; j < 2; j++) {
 			_vm->_gyro->_also[i][j] = new Common::String;
 			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
 		}
-		*_vm->_gyro->_also[i][0] = Common::String('\x9D') + *_vm->_gyro->_also[i][0] + Common::String('\x9D');
+		tmpStr = Common::String::format("\x9D%s\x9D", *_vm->_gyro->_also[i][0]);
+		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
 
 	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
@@ -284,8 +286,10 @@ void Lucerna::loadAlso(byte num) {
 
 	file.close();
 	unScramble();
-	for (byte i = 0; i <= alsoNum; i++)
-		*_vm->_gyro->_also[i][0] = Common::String(',') + *_vm->_gyro->_also[i][0] + ',';
+	for (byte i = 0; i <= alsoNum; i++) {
+		tmpStr = Common::String::format(",%s,", *_vm->_gyro->_also[i][0]);
+		*_vm->_gyro->_also[i][0] = tmpStr;
+	}
 }
 
 void Lucerna::loadRoom(byte num) {
@@ -1150,7 +1154,7 @@ void Lucerna::checkClick() {
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
-				_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
+				_vm->_gyro->_mouseText.insertChar(Scrolls::kControlNewLine, 0);
 		} else if (!_vm->_gyro->_dropsOk)
 			_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
 	}
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index eaa2211..cb6f10a 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -652,12 +652,12 @@ void Timer::avalotFalls() {
 		_vm->_animation->_sprites[0]._stepNum++;
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
-		Common::String toDisplay;
-		for (byte i = 0; i < 6; i++)
-			toDisplay += _vm->_scrolls->kControlNewLine;
-		for (byte i = 0; i < 6; i++)
-			toDisplay += _vm->_scrolls->kControlInsertSpaces;
-		toDisplay += _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
+		Common::String toDisplay = Common::String::format("%c%c%c%c%c%c%c%c%c%c%c%c%cZ%c",
+			Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine,
+			Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine,
+			Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces,
+			Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces,
+			Scrolls::kControlRegister, Scrolls::kControlIcon);
 		_vm->_scrolls->displayText(toDisplay);
 	}
 }


Commit: 1ca62e51b9a66711fd1b266bed1432509c489f8f
    https://github.com/scummvm/scummvm/commit/1ca62e51b9a66711fd1b266bed1432509c489f8f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-09T14:16:48-07:00

Commit Message:
AVALANCHE: refactor the way ControlCharacter enum is accessed

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 0db9db7..59a8ed8 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -750,23 +750,23 @@ void Acci::examine() {
 
 void Acci::inventory() {
 	byte itemNum = 0;
-	_vm->_scrolls->displayText(Common::String("You're carrying ") + _vm->_scrolls->kControlToBuffer);
+	_vm->_scrolls->displayText(Common::String("You're carrying ") + Scrolls::kControlToBuffer);
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
 			if (itemNum == _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->displayText(Common::String("and ") + _vm->_scrolls->kControlToBuffer);
-			_vm->_scrolls->displayText(_vm->_gyro->getItem(i + 1) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String("and ") + Scrolls::kControlToBuffer);
+			_vm->_scrolls->displayText(_vm->_gyro->getItem(i + 1) + Scrolls::kControlToBuffer);
 			if ((i + 1) == _vm->_gyro->_dna._wearing)
-				_vm->_scrolls->displayText(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", which you're wearing") + Scrolls::kControlToBuffer);
 			if (itemNum < _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->displayText(Common::String(", ") + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", ") + Scrolls::kControlToBuffer);
 		}
 	}
 
 	if (_vm->_gyro->_dna._wearing == kNothing)
-		_vm->_scrolls->displayText(Common::String("...") + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "...and you're stark naked!");
+		_vm->_scrolls->displayText(Common::String("...") + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "...and you're stark naked!");
 	else
 		_vm->_scrolls->displayText(".");
 }
@@ -842,18 +842,18 @@ void Acci::peopleInRoom() {
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
 			else if (actPerson < numPeople) // The middle...
-				_vm->_scrolls->displayText(Common::String(", ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(", ") + _vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
 			else // The end.
-				_vm->_scrolls->displayText(Common::String(" and ") + _vm->_gyro->getName(i + 150) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(" and ") + _vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
 		}
 	}
 
 	if (numPeople == 1)
-		_vm->_scrolls->displayText(Common::String(" is") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText(Common::String(" is") + Scrolls::kControlToBuffer);
 	else
-		_vm->_scrolls->displayText(Common::String(" are") + _vm->_scrolls->kControlToBuffer);
+		_vm->_scrolls->displayText(Common::String(" are") + Scrolls::kControlToBuffer);
 
 	_vm->_scrolls->displayText(" here."); // End and display it.
 }
@@ -1015,9 +1015,10 @@ void Acci::putProc() {
 					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_gyro->_dna._wearing == _thing)
-						_vm->_scrolls->displayText(Common::String("You'd better take ") + _vm->_gyro->getItem(_thing) + " off first!");
-					else {
+					if (_vm->_gyro->_dna._wearing == _thing) {
+						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
+						_vm->_scrolls->displayText(tmpStr);
+					} else {
 						openBox(true); // Open box.
 
 						_vm->_gyro->_dna._boxContent = _thing;
@@ -1043,9 +1044,10 @@ void Acci::putProc() {
  * @remarks	Originally called 'not_in_order'
  */
 void Acci::notInOrder() {
-	_vm->_scrolls->displayText(Common::String("Sorry, I need the ingredients in the right order for this potion. What I need next is ")
-			+ _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick])
-			+ _vm->_scrolls->kControlRegister + 2 + _vm->_scrolls->kControlSpeechBubble);
+	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
+		"What I need next is %s%c2%c", _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]),
+		Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+	_vm->_scrolls->displayText(tmpStr);
 }
 
 /**
@@ -1180,8 +1182,6 @@ void Acci::standUp() {
 	}
 }
 
-
-
 void Acci::getProc(char thing) {
 	switch (_vm->_gyro->_dna._room) {
 	case r__yours:
@@ -1193,8 +1193,10 @@ void Acci::getProc(char thing) {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_dna._boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
-			} else
-				_vm->_scrolls->displayText(Common::String("I can't see ") + _vm->_gyro->getItem(thing) + " in the box.");
+			} else {
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing));
+				_vm->_scrolls->displayText(tmpStr);
+			}
 		} else
 			_vm->_visa->displayScrollChain('q', 57);
 		break;
@@ -1248,7 +1250,7 @@ void Acci::getProc(char thing) {
  */
 void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->_dna._room != r__lustiesroom) {
-		_vm->_scrolls->displayText(Common::String("Not yet. Try later!") + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("Not yet. Try later!") + Scrolls::kControlRegister + '2' + Scrolls::kControlSpeechBubble);
 		return;
 	}
 	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
@@ -1284,7 +1286,7 @@ void Acci::personSpeaks() {
 	}
 
 	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
-		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + '1' + _vm->_scrolls->kControlToBuffer); // Avvy himself!
+		_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + '1' + Scrolls::kControlToBuffer); // Avvy himself!
 		return;
 	}
 
@@ -1292,7 +1294,7 @@ void Acci::personSpeaks() {
 
 	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 49) + _vm->_scrolls->kControlToBuffer);
+			_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + byte(i + 49) + Scrolls::kControlToBuffer);
 			found = true;
 		}
 	}
@@ -1300,13 +1302,13 @@ void Acci::personSpeaks() {
 	if (!found) {
 		for (byte i = 0; i < 16; i++) {
 			if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
-				_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlRegister) + byte(i + 65) + _vm->_scrolls->kControlToBuffer);
+				_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + byte(i + 65) + Scrolls::kControlToBuffer);
 		}
 	}
 }
 void Acci::heyThanks() {
 	personSpeaks();
-	_vm->_scrolls->displayText(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)");
+	_vm->_scrolls->displayText(Common::String("Hey, thanks!") + Scrolls::kControlSpeechBubble + "(But now, you've lost it!)");
 	_vm->_gyro->_dna._objects[_thing - 1] = false;
 }
 
@@ -1351,7 +1353,7 @@ void Acci::doThat() {
 		openDoor();
 		break;
 	case kVerbCodePause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		_vm->_scrolls->displayText(Common::String("Game paused.") + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
+		_vm->_scrolls->displayText(Common::String("Game paused.") + Scrolls::kControlCenter + Scrolls::kControlNewLine + Scrolls::kControlNewLine
 			+ "Press Enter, Esc, or click the mouse on the \"O.K.\" box to continue.");
 		break;
 	case kVerbCodeGet:
@@ -1377,7 +1379,7 @@ void Acci::doThat() {
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
 			if (_vm->_gyro->_subjectNum == 99) // They typed "say password".
-				_vm->_scrolls->displayText(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
+				_vm->_scrolls->displayText(Common::String("Yes, but what ") + Scrolls::kControlItalic + "is" + Scrolls::kControlRoman + " the password?");
 			else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
@@ -1525,7 +1527,7 @@ void Acci::doThat() {
 		}
 		if (!_polite)
 			_vm->_scrolls->displayText("How about a `please\", Avvy?");
-		else if (_vm->_scrolls->displayQuestion(Common::String(_vm->_scrolls->kControlRegister) + 'C' + _vm->_scrolls->kControlIcon + "Do you really want to quit?"))
+		else if (_vm->_scrolls->displayQuestion(Common::String(Scrolls::kControlRegister) + 'C' + Scrolls::kControlIcon + "Do you really want to quit?"))
 			_vm->_gyro->_letMeOut = true;
 		break;
 	case kVerbCodeGo:
@@ -1536,12 +1538,12 @@ void Acci::doThat() {
 
 		Common::String toDisplay;
 		for (byte i = 0; i < 7; i++)
-			toDisplay += _vm->_scrolls->kControlNewLine;
-		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + _vm->_scrolls->kControlCenter + _vm->_scrolls->kControlNewLine
-			+ "The medi\x91val descendant of" + _vm->_scrolls->kControlNewLine
-			+ "Denarius Avaricius Sextus" + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Copyright \xEF "
-			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + _vm->_scrolls->kControlRegister + 'Y' + _vm->_scrolls->kControlIcon;
+			toDisplay += Scrolls::kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Scrolls::kControlCenter + Scrolls::kControlNewLine
+			+ "The medi\x91val descendant of" + Scrolls::kControlNewLine
+			+ "Denarius Avaricius Sextus" + Scrolls::kControlNewLine + Scrolls::kControlNewLine
+			+ "version " + _vm->_gyro->kVersionNum + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Copyright \xEF "
+			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Scrolls::kControlRegister + 'Y' + Scrolls::kControlIcon;
 		_vm->_scrolls->displayText(toDisplay);
 		_vm->_scrolls->_aboutScroll = false;
 		}
@@ -1631,7 +1633,7 @@ void Acci::doThat() {
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 					_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-						+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+						+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
 				}
 				break;
 			case r__musicroom:
@@ -1697,11 +1699,11 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, _vm->_timer->kProcUrinate, _vm->_timer->kReasonGoToToilet);
 		} else
-			_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
-			+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
+			_vm->_scrolls->displayText(Common::String("It would be ") + Scrolls::kControlItalic + "VERY"
+			+ Scrolls::kControlRoman + " unwise to do that here, Avvy!");
 		break;
 	case kVerbCodeCheat:
-		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "Cheat mode now enabled.");
+		_vm->_scrolls->displayText(Common::String(Scrolls::kControlItalic) + "Cheat mode now enabled.");
 		_vm->_gyro->_cheat = true;
 		break;
 	case kVerbCodeMagic:
@@ -1732,16 +1734,16 @@ void Acci::doThat() {
 		switch (_vm->_gyro->_dna._sworeNum) {
 		case 0:
 			_vm->_scrolls->displayText(Common::String("Avvy! Do you mind? There might be kids playing!")
-				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(I shouldn't say it again, if I were you!)");
+				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "(I shouldn't say it again, if I were you!)");
 			break;
 		case 1:
 			_vm->_scrolls->displayText(Common::String("You hear a distant rumble of thunder. Must you always do things I tell you not to?")
-				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Don't do it again!");
+				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Don't do it again!");
 			break;
 		default:
 			_vm->_pingo->zonk();
 			_vm->_scrolls->displayText(Common::String("A crack of lightning shoots from the sky, and fries you.")
-				+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
+				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
 			_vm->_lucerna->gameOver();
 		}
 		_vm->_gyro->_dna._sworeNum++;
@@ -1777,7 +1779,7 @@ void Acci::doThat() {
 						_vm->_lucerna->incScore(3);
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
 					_vm->_gyro->_dna._drinking = _thing;
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -1802,7 +1804,7 @@ void Acci::doThat() {
 						}
 
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-						_vm->_scrolls->displayText(Common::String("Wine, please.") + _vm->_scrolls->kControlRegister + '1' + _vm->_scrolls->kControlSpeechBubble);
+						_vm->_scrolls->displayText(Common::String("Wine, please.") + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
 						if (_vm->_gyro->_dna._alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -1985,8 +1987,8 @@ void Acci::doThat() {
 					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
 				break;
 			case Gyro::kPeopleJacques:
-				_vm->_scrolls->displayText(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + _vm->_scrolls->kControlRegister + '1' +
-					_vm->_scrolls->kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
+				_vm->_scrolls->displayText(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + Scrolls::kControlRegister + '1' +
+					Scrolls::kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
 				break;
 			default:
 				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
@@ -2004,7 +2006,7 @@ void Acci::doThat() {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->hangAroundForAWhile();
 			_vm->_lucerna->dawn();
-			_vm->_scrolls->displayText(Common::String("A few hours later...") + _vm->_scrolls->kControlParagraph + "nothing much has happened...");
+			_vm->_scrolls->displayText(Common::String("A few hours later...") + Scrolls::kControlParagraph + "nothing much has happened...");
 		}
 		break;
 	case kVerbCodeRestart:
@@ -2019,14 +2021,14 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeHello:
 		personSpeaks();
-		_vm->_scrolls->displayText(Common::String("Hello.") + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("Hello.") + Scrolls::kControlSpeechBubble);
 		break;
 	case kVerbCodeThanks:
 		personSpeaks();
-		_vm->_scrolls->displayText(Common::String("That's OK.") + _vm->_scrolls->kControlSpeechBubble);
+		_vm->_scrolls->displayText(Common::String("That's OK.") + Scrolls::kControlSpeechBubble);
 		break;
 	default:
-		_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlBell) + "Parser bug!");
+		_vm->_scrolls->displayText(Common::String(Scrolls::kControlBell) + "Parser bug!");
 	}
 }
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index cb6f10a..973b1d3 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -362,7 +362,7 @@ void Timer::afterTheShootemup() {
 
 	// Same as the added line above: TODO: Remove it later!!!
 	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
-		+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
+		+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
 
 #if 0
 	byte shootscore, gain;


Commit: bc64dcf276f15fe9bd808d087762e100fb7d931d
    https://github.com/scummvm/scummvm/commit/bc64dcf276f15fe9bd808d087762e100fb7d931d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-09T14:34:12-07:00

Commit Message:
AVALANCHE: harmonize the use of constants for kMagic, kProc, kObject, kPeople

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timer.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 59a8ed8..cec9c42 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -378,7 +378,7 @@ void Acci::storeInterrogation(byte interrogation) {
 	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
 		_vm->_parser->_inputText.deleteLastChar();
 
-	_vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
+	_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
 
 	switch (interrogation) {
 	case 1:
@@ -408,7 +408,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
 		_vm->_gyro->_dna._cardiffQuestionNum = 5;
 		break;
 	case 99:
@@ -783,7 +783,7 @@ void Acci::swallow() {   // Eat something.
 			_vm->_visa->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_visa->displayScrollChain('U', 2);
-			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
+			_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
@@ -814,7 +814,7 @@ void Acci::swallow() {   // Eat something.
 			_vm->_visa->displayScrollChain('U', 11);
 		else {
 			_vm->_visa->displayScrollChain('U', 8);
-			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
+			_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 		}
 		break;
@@ -979,7 +979,7 @@ void Acci::putProc() {
 	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
 	switch (_thing2) {
 	case Gyro::kObjectWine:
-		if (_thing == _vm->_gyro->kObjectOnion) {
+		if (_thing == Gyro::kObjectOnion) {
 			if (_vm->_gyro->_dna._rottenOnion)
 				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
@@ -1056,7 +1056,7 @@ void Acci::notInOrder() {
  */
 void Acci::goToCauldron() {
 	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludwickWalk);
+	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
 	_vm->_animation->_sprites[1].walkTo(2);
 }
 
@@ -1072,7 +1072,7 @@ bool Acci::giveToSpludwick() {
 
 	switch (_thing) {
 	case Gyro::kObjectOnion:
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = false;
+		_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false;
 		if (_vm->_gyro->_dna._rottenOnion)
 			_vm->_visa->displayScrollChain('q', 22);
 		else {
@@ -1084,7 +1084,7 @@ bool Acci::giveToSpludwick() {
 		_vm->_lucerna->refreshObjectList();
 		break;
 	case Gyro::kObjectInk:
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = false;
+		_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = false;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._givenToSpludwick++;
 		_vm->_visa->displayScrollChain('q', 24);
@@ -1092,12 +1092,12 @@ bool Acci::giveToSpludwick() {
 		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = false;
+		_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = false;
 		_vm->_visa->displayScrollChain('q', 25);
 		_vm->_lucerna->incScore(5);
 		_vm->_gyro->_dna._givenToSpludwick++;
 		goToCauldron();
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
+		_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		break;
 	default:
@@ -1110,7 +1110,7 @@ bool Acci::giveToSpludwick() {
 void Acci::drink() {
 	_vm->_gyro->_dna._alcoholLevel += 1;
 	if (_vm->_gyro->_dna._alcoholLevel == 5) {
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1] = true; // Get the key.
+		_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1] = true; // Get the key.
 		_vm->_gyro->_dna._teetotal = true;
 		_vm->_gyro->_dna._avvyIsAwake = false;
 		_vm->_gyro->_dna._avvyInBed = true;
@@ -1158,7 +1158,7 @@ void Acci::standUp() {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
-			_vm->_timer->loseTimer(_vm->_timer->kReasonArkataShouts);
+			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
 		} else
 			already();
 		break;
@@ -1211,7 +1211,7 @@ void Acci::getProc(char thing) {
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_gyro->_dna._takenPen = true;
-					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = true;
+					_vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
 					_vm->_scrolls->displayText("Taken.");
 				}
@@ -1228,12 +1228,12 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == _vm->_gyro->kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
+		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_dna._mushroomGrowing = false;
 			_vm->_gyro->_dna._takenMushroom = true;
-			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectMushroom - 1] = true;
+			_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = true;
 			_vm->_lucerna->refreshObjectList();
 			_vm->_lucerna->incScore(3);
 		} else
@@ -1253,11 +1253,11 @@ void Acci::giveGeidaTheLute() {
 		_vm->_scrolls->displayText(Common::String("Not yet. Try later!") + Scrolls::kControlRegister + '2' + Scrolls::kControlSpeechBubble);
 		return;
 	}
-	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = false;
+	_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = false;
 	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->displayScrollChain('q', 64); // She plays it.
 
-	_vm->_timer->addTimer(1, _vm->_timer->kProcGiveLuteToGeida, _vm->_timer->kReasonGeidaSings);
+	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
 }
 
@@ -1274,7 +1274,7 @@ void Acci::winSequence() {
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
 	_vm->_sequence->startToClose();
-	_vm->_timer->addTimer(30, _vm->_timer->kProcWinning, _vm->_timer->kReasonWinning);
+	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
 }
 
 void Acci::personSpeaks() {
@@ -1418,14 +1418,14 @@ void Acci::doThat() {
 				default:
 					switch (_person) {
 					case Gyro::kPeopleCrapulus:
-						if (_thing == _vm->_gyro->kObjectWine) {
+						if (_thing == Gyro::kObjectWine) {
 							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
+							_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
 					case Gyro::kPeopleCwytalot:
-						if ((_thing == _vm->_gyro->kObjectCrossbow) || (_thing == _vm->_gyro->kObjectBolt))
+						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
 							_vm->_scrolls->displayText(Common::String("You might be able to influence Cwytalot more if you used it!"));
 						else
 							heyThanks();
@@ -1435,11 +1435,11 @@ void Acci::doThat() {
 							heyThanks();
 						break;
 					case Gyro::kPeopleIbythneth:
-						if (_thing == _vm->_gyro->kObjectBadge) {
+						if (_thing == Gyro::kObjectBadge) {
 							_vm->_visa->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_lucerna->incScore(3);
-							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = false;
-							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectHabit - 1] = true;
+							_vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = false;
+							_vm->_gyro->_dna._objects[Gyro::kObjectHabit - 1] = true;
 							_vm->_gyro->_dna._givenBadgeToIby = true;
 							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
@@ -1448,10 +1448,10 @@ void Acci::doThat() {
 						break;
 					case Gyro::kPeopleAyles:
 						if (_vm->_gyro->_dna._aylesIsAwake) {
-							if (_thing == _vm->_gyro->kObjectPen) {
-								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPen - 1] = false;
+							if (_thing == Gyro::kObjectPen) {
+								_vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = false;
 								_vm->_visa->displayScrollChain('q', 54);
-								_vm->_gyro->_dna._objects[_vm->_gyro->kObjectInk - 1] = true;
+								_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = true;
 								_vm->_gyro->_dna._givenPenToAyles = true;
 								_vm->_lucerna->refreshObjectList();
 								_vm->_lucerna->incScore(2);
@@ -1463,7 +1463,7 @@ void Acci::doThat() {
 					case Gyro::kPeopleGeida:
 						switch (_thing) {
 						case Gyro::kObjectPotion:
-							_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = false;
+							_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = false;
 							_vm->_visa->displayScrollChain('u', 16); // She drinks it.
 							_vm->_lucerna->incScore(2);
 							_vm->_gyro->_dna._givenPotionToGeida = true;
@@ -1579,7 +1579,7 @@ void Acci::doThat() {
 					_vm->_lucerna->refreshObjectList();
 
 					byte i;
-					if (_thing == _vm->_gyro->kObjectHabit)
+					if (_thing == Gyro::kObjectHabit)
 						i = 3;
 					else
 						i = 0;
@@ -1622,7 +1622,7 @@ void Acci::doThat() {
 
 					// You won - strange!
 					_vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute!
-					_vm->_gyro->_dna._objects[_vm->_gyro->kObjectLute - 1] = true;
+					_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = true;
 					_vm->_lucerna->refreshObjectList();
 					_vm->_gyro->_dna._wonNim = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
@@ -1645,10 +1645,10 @@ void Acci::doThat() {
 			case Gyro::kObjectLute :
 					_vm->_visa->displayScrollChain('U', 7);
 
-					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] == _vm->_gyro->_dna._room)
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_dna._room)
 						_vm->_visa->displayScrollChain('U', 10);
 
-					if (_vm->_gyro->_whereIs[_vm->_gyro->kPeopleDuLustie - 150] == _vm->_gyro->_dna._room)
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_dna._room)
 						_vm->_visa->displayScrollChain('U', 15);
 				break;
 			case 52:
@@ -1671,7 +1671,7 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeRing:
 		if (isHolding()) {
-			if (_thing == _vm->_gyro->kObjectBell) {
+			if (_thing == Gyro::kObjectBell) {
 				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
@@ -1697,7 +1697,7 @@ void Acci::doThat() {
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timer->addTimer(4, _vm->_timer->kProcUrinate, _vm->_timer->kReasonGoToToilet);
+			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else
 			_vm->_scrolls->displayText(Common::String("It would be ") + Scrolls::kControlItalic + "VERY"
 			+ Scrolls::kControlRoman + " unwise to do that here, Avvy!");
@@ -1721,7 +1721,7 @@ void Acci::doThat() {
 					_vm->_animation->_sprites[1]._callEachStepFl = true;
 					_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
-					_vm->_timer->addTimer(177, _vm->_timer->kProcAvariciusTalks, _vm->_timer->kReasonAvariciusTalks);
+					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
 			} else
 				_vm->_scrolls->displayText("Nothing appears to happen...");
@@ -1784,13 +1784,13 @@ void Acci::doThat() {
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 					_vm->_gyro->_dna._malagauche = 177;
-					_vm->_timer->addTimer(27, _vm->_timer->kProcBuyDrinks, _vm->_timer->kReasonDrinks);
+					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
 				case Gyro::kObjectWine:
-					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1])  // We've already got the wine!
+					if (_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1])  // We've already got the wine!
 						_vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
@@ -1810,7 +1810,7 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 						_vm->_gyro->_dna._malagauche = 177;
 
-						_vm->_timer->addTimer(27, _vm->_timer->kProcBuyWine, _vm->_timer->kReasonDrinks);
+						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
 					}
 					break;
 				}
@@ -1820,8 +1820,8 @@ void Acci::doThat() {
 
 		case r__outsideducks:
 			if (_vm->_animation->inField(6)) {
-				if (_thing == _vm->_gyro->kObjectOnion) {
-					if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1])
+				if (_thing == Gyro::kObjectOnion) {
+					if (_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1])
 						_vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
 						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
@@ -1833,7 +1833,7 @@ void Acci::doThat() {
 							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
-						_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1] = true;
+						_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = true;
 						_vm->_lucerna->refreshObjectList();
 						_vm->_gyro->_dna._boughtOnion = true;
 						_vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall!
@@ -1854,9 +1854,9 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeAttack:
 		if ((_vm->_gyro->_dna._room == r__brummieroad) &&
-				((_person == 157) || (_thing == _vm->_gyro->kObjectCrossbow) || (_thing == _vm->_gyro->kObjectBolt))
+				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
 				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_dna._room)) {
-			switch (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] + _vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] * 2) {
+			switch (_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->displayScrollChain('Q', 10);
@@ -1871,10 +1871,10 @@ void Acci::doThat() {
 			case 3:
 				_vm->_visa->displayScrollChain('Q', 11);
 				_vm->_gyro->_dna._cwytalotGone = true;
-				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = false;
-				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = false;
+				_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = false;
+				_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = false;
 				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicNothing;
+				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
 				_vm->_lucerna->incScore(7);
 				_vm->_animation->_sprites[1].walkTo(2);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
@@ -1907,7 +1907,7 @@ void Acci::doThat() {
 				else {
 					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->displayText("The drawbridge opens!");
-					_vm->_timer->addTimer(7, _vm->_timer->kProcOpenDrawbridge, _vm->_timer->kReasonDrawbridgeFalls);
+					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
 					_vm->_gyro->_dna._drawbridgeOpen = 1;
 				}
 			} else
@@ -1959,7 +1959,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
-		_vm->_timer->addTimer(1, _vm->_timer->kProcJump, _vm->_timer->kReasonJumping);
+		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
@@ -2000,7 +2000,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
-				_vm->_timer->addTimer(1, _vm->_timer->kProcAvvySitDown, _vm->_timer->kReasonSittingDown);
+				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else { // Default doodah.
 			_vm->_lucerna->dusk();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 9e73ea7..747f014 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -470,66 +470,66 @@ void Animation::catacombMove(byte ped) {
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[2]._operation = Gyro::kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -537,52 +537,52 @@ void Animation::catacombMove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // No door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // No door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
 		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicSpecial; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[4]._operation = Gyro::kMagicNothing; // Sloping wall.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicSpecial; // Straight wall.
+		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
 		break;
 	}
 
@@ -590,39 +590,39 @@ void Animation::catacombMove(byte ped) {
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 
 		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
-			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicExclaim;
+			_vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
 		else
-			_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicSpecial; // Right exit south.
+			_vm->_gyro->_magics[12]._operation = Gyro::kMagicSpecial; // Right exit south.
 
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicSpecial; // Middle exit south.
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[6]._operation = Gyro::kMagicSpecial; // Middle exit south.
+		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicSpecial; // Left exit south.
-		_vm->_gyro->_magics[6]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = _vm->_gyro->kMagicBounce;
+		_vm->_gyro->_magics[11]._operation = Gyro::kMagicSpecial; // Left exit south.
+		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
 		break;
 	// LEFT handles:
 #if 0
@@ -634,8 +634,8 @@ void Animation::catacombMove(byte ped) {
 #endif
 	case 0x2:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
@@ -652,8 +652,8 @@ void Animation::catacombMove(byte ped) {
 #endif
 	case 0x5:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
@@ -673,26 +673,26 @@ void Animation::catacombMove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
 
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicSpecial; // Middle arch north.
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north.
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
 	}
 	break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicNothing; // Door.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_gyro->_magics[0]._operation = _vm->_gyro->kMagicNothing; // Door to Geida's room.
+		_vm->_gyro->_magics[0]._operation = Gyro::kMagicNothing; // Door to Geida's room.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->_portals[3]._operation = _vm->_gyro->kMagicSpecial; // Door.
+		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
 	}
 
@@ -741,7 +741,7 @@ void Animation::catacombMove(byte ped) {
 
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Animation::dawnDelay() {
-	_vm->_timer->addTimer(2, _vm->_timer->kProcDawnDelay, _vm->_timer->kReasonDawndelay);
+	_vm->_timer->addTimer(2, Timer::kProcDawnDelay, Timer::kReasonDawndelay);
 }
 
 void Animation::callSpecial(uint16 which) {
@@ -749,17 +749,17 @@ void Animation::callSpecial(uint16 which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_gyro->_dna._brummieStairs = 1;
-		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_timer->addTimer(10, _vm->_timer->kProcStairs, _vm->_timer->kReasonBrummieStairs);
+		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
+		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
 		stopWalking();
 		_vm->_gyro->_dna._userMovesAvvy = false;
 		break;
 	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
 		_vm->_gyro->_dna._brummieStairs = 3;
-		_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicNothing;
-		_vm->_gyro->_magics[11]._operation = _vm->_gyro->kMagicExclaim;
+		_vm->_gyro->_magics[10]._operation = Gyro::kMagicNothing;
+		_vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim;
 		_vm->_gyro->_magics[11]._data = 5;
-		_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicBounce; // Now works as planned!
+		_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
 		stopWalking();
 		_vm->_visa->displayScrollChain('q', 26);
 		_vm->_gyro->_dna._userMovesAvvy = true;
@@ -784,13 +784,13 @@ void Animation::callSpecial(uint16 which) {
 	case 4: // This is the ghost room link.
 		_vm->_lucerna->dusk();
 		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
-		_vm->_timer->addTimer(1, _vm->_timer->kProcGhostRoomPhew, _vm->_timer->kReasonGhostRoomPhew);
+		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
 		if (_vm->_gyro->_dna._friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
-			_vm->_gyro->_magics[4]._operation = _vm->_gyro->kMagicBounce; // Boundary effect is now working again.
+			_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
@@ -801,8 +801,8 @@ void Animation::callSpecial(uint16 which) {
 			_sprites[1].walkTo(3);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
-			_vm->_timer->addTimer(364, _vm->_timer->kProcHangAround, _vm->_timer->kReasonHangingAround);
+			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 177; // Not here, then.
+			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
@@ -810,17 +810,17 @@ void Animation::callSpecial(uint16 which) {
 		_sprites[0]._moveX = 3;
 		_sprites[0]._moveY = 0;
 		_sprites[0]._facingDir = kDirRight;
-		_vm->_timer->addTimer(1, _vm->_timer->kProcFallDownOubliette, _vm->_timer->kReasonFallingDownOubliette);
+		_vm->_timer->addTimer(1, Timer::kProcFallDownOubliette, Timer::kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
 		_sprites[0]._visible = false;
-		_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
+		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
 		stopWalking();
-		_vm->_timer->loseTimer(_vm->_timer->kReasonFallingDownOubliette);
+		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
-		_vm->_timer->addTimer(200, _vm->_timer->kProcMeetAvaroid, _vm->_timer->kReasonMeetingAvaroid);
+		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
@@ -838,12 +838,12 @@ void Animation::callSpecial(uint16 which) {
 		_sprites[1].walkTo(4); // She walks to somewhere...
 		_sprites[0].remove();     // Lose Avvy.
 		_vm->_gyro->_dna._userMovesAvvy = false;
-		_vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
+		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
 		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_gyro->_dna._objects[_vm->_gyro->kObjectKey - 1])
+			if (_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1])
 				_vm->_visa->displayScrollChain('q', 62);
 			else {
 				_vm->_visa->displayScrollChain('q', 61);
@@ -1083,7 +1083,7 @@ void Animation::arrowProcs(byte tripnum) {
 			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
-			_vm->_timer->addTimer(55, _vm->_timer->kProcNaughtyDuke, _vm->_timer->kReasonNaughtyDuke);
+			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3a95219..cdd6b7c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -525,10 +525,6 @@ void AvalancheEngine::bFlightOn() {
 	_storage._skellern = kReset;
 	// setintvec(0x1c, &b_flight);
 }
-void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
-	warning("STUB: run(%s)", what.c_str());
-	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
-}
 
 void AvalancheEngine::getArguments() {
 	// This function should mess around with command line arguments,
@@ -600,6 +596,11 @@ Common::Error AvalancheEngine::run() {
 }
 
 #if 0
+void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
+	warning("STUB: run(%s)", what.c_str());
+	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
+}
+
 void AvalancheEngine::bFlightOff() {
 	// setintvec(0x1c, old_1c);
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index d632752..69c157f 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -126,10 +126,6 @@ private:
 	AvalancheConsole *_console;
 	Common::Platform _platform;
 
-	// From bootstrp:
-
-	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
-
 	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
 	static const char kRuncodes[2][3];
 	static const int16 kReset = 0;
@@ -146,19 +142,22 @@ private:
 	bool _zoomy;
 
 	void bFlightOn();
-	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
 	void getArguments();
 	void getSlope();
 	void callMenu();
 	void runAvalot();
 
 #if 0
+	// From bootstrp:
+	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
+
 	Common::String _demoArgs, _argsWithNoFilename;
 	byte _originalMode;
 	byte *_old1c;
 	Common::String _segofs;
 	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
 
+	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
 	void bFlightOff();
 	Common::String elmToStr(Elm how);
 	bool keyPressed();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 287f844..af00790 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -170,7 +170,7 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_vm->_gyro->_thinks = 2; // You always have money.
-		_vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing);
+		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
@@ -179,7 +179,7 @@ void Avalot::setup() {
 
 		_vm->_gyro->_soundFx = ! _vm->_gyro->_soundFx;
 		_vm->_lucerna->fxToggle();
-		_vm->_lucerna->thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing);
+		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
 
 		_vm->_visa->displayScrollChain('q', 83); // Info on the game, etc.
 	}
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 12af639..0a5fe9f 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -503,7 +503,7 @@ void Dropdown::setupMenuWith() {
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_gyro->_lastPerson == _vm->_gyro->kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
+		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
 			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
@@ -528,7 +528,7 @@ void Dropdown::setupMenuWith() {
 		break;
 		case Gyro::kPeopleMalagauche: {
 			bool isSober = !_vm->_gyro->_dna._teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]);
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
@@ -537,7 +537,7 @@ void Dropdown::setupMenuWith() {
 		}
 		break;
 		case Gyro::kPeopleTrader: {
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1]);
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]);
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
 		}
 		break;
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index f6e22df..a59db04 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -274,7 +274,7 @@ void Enid::ednaReload() {
 
 	_vm->_lucerna->majorRedraw();
 
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
+	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
 	_vm->_gyro->_alive = true;
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 041236c..ccb85b4 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -349,21 +349,21 @@ void Lucerna::exitRoom(byte x) {
 
 	switch (x) {
 	case r__spludwicks:
-		_vm->_timer->loseTimer(_vm->_timer->kReasonAvariciusTalks);
+		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
 		 _vm->_gyro->_dna._avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
 		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
 			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
-			_vm->_timer->loseTimer(_vm->_timer->kReasonDrawbridgeFalls);
+			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
 		}
 		break;
 	case r__outsidecardiffcastle:
-		_vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey);
+		_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey);
 		break;
 	case r__robins:
-		_vm->_timer->loseTimer(_vm->_timer->kReasonGettingTiedUp);
+		_vm->_timer->loseTimer(Timer::kReasonGettingTiedUp);
 		break;
 	}
 
@@ -398,14 +398,14 @@ void Lucerna::enterNewTown() {
 			_vm->_gyro->_dna._spludwickAtHome = true;
 			_vm->_gyro->_dna._crapulusWillTell = false;
 		}
-		if (_vm->_gyro->_dna._boxContent == _vm->_gyro->kObjectWine)
+		if (_vm->_gyro->_dna._boxContent == Gyro::kObjectWine)
 			_vm->_gyro->_dna._wineState = 3; // Vinegar
 	}
 	break;
 	}
 
 	if (_vm->_gyro->_dna._room != r__outsideducks) {
-		if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar))
+		if ((_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar))
 			_vm->_gyro->_dna._rottenOnion = true; // You're holding the onion
 	}
 }
@@ -434,10 +434,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	if ((_vm->_gyro->_dna._roomCount[room] == 0) && (! _vm->_gyro->setFlag('S')))
 		incScore(1);
 
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
+	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
 
 	if (_vm->_gyro->_dna._geidaFollows)
-		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleGeida - 150] = room;
+		_vm->_gyro->_whereIs[Gyro::kPeopleGeida - 150] = room;
 
 	_vm->_gyro->_roomTime = 0;
 
@@ -451,7 +451,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
-			_vm->_timer->addTimer(100, _vm->_timer->kProcArkataShouts, _vm->_timer->kReasonArkataShouts);
+			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
 		}
 		break;
 
@@ -459,7 +459,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->_dna._talkedToCrapulus) {
 
-				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__outsideyours;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
 				_vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
@@ -473,13 +473,13 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->_sprites[1]._callEachStepFl = true;
 				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
 
-			} else _vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = r__nowhere;
+			} else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->_dna._crapulusWillTell) {
 				_vm->_animation->_sprites[1].init(8, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
 				_vm->_animation->_sprites[1].walkTo(4);
-				_vm->_timer->addTimer(20, _vm->_timer->kProcCrapulusSpludOut, _vm->_timer->kReasonCrapulusSaysSpludwickOut);
+				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_dna._crapulusWillTell = false;
 			}
 		}
@@ -487,7 +487,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsidespludwicks:
 		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
-			_vm->_timer->addTimer(20, _vm->_timer->kProcBang, _vm->_timer->kReasonExplosion);
+			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
 			_vm->_gyro->_dna._spludwickAtHome = true;
 		}
 		break;
@@ -512,14 +512,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._geidaFollows)
 			putGeidaAt(5, ped);
 		if (_vm->_gyro->_dna._cwytalotGone) {
-			_vm->_gyro->_magics[kColorLightred - 1]._operation = _vm->_gyro->kMagicNothing;
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__nowhere;
+			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
+			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
 				_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot
 				_vm->_animation->_sprites[1]._callEachStepFl = true;
 				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;
-				_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCwytalot - 150] = r__brummieroad;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
@@ -542,7 +542,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_animation->_sprites[1]._vanishIfStill = true;
 			_vm->_gyro->_dna._passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timer->addTimer(20, _vm->_timer->kProcCwytalotInHerts, _vm->_timer->kReasonCwytalotInHerts);
+			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
 		}
 		break;
 
@@ -550,7 +550,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_dna._drawbridgeOpen == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
-			_vm->_gyro->_magics[kColorGreen - 1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->_dna._geidaFollows)
 			putGeidaAt(ped + 3, ped); // load Geida
@@ -563,13 +563,13 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->_sprites[1].init(6, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
 				_vm->_animation->_sprites[1].walkTo(3);
-				_vm->_timer->addTimer(36, _vm->_timer->kProcGetTiedUp, _vm->_timer->kReasonGettingTiedUp);
+				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 			}
 		}
 
 		if (_vm->_gyro->_dna._beenTiedUp) {
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = 0;
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 0;
+			_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = 0;
+			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0;
 		}
 
 		if (_vm->_gyro->_dna._tiedUp)
@@ -587,17 +587,17 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
 				_vm->_animation->_sprites[1].walkTo(3);
-				_vm->_timer->addTimer(47, _vm->_timer->kProcCardiffSurvey, _vm->_timer->kReasonCardiffsurvey);
+				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
 			}
 			break;
 			case 5 :
-				_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing;
+				_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: { // You've answered SOME of his questions.
 				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 3);
 				_vm->_animation->_sprites[1]._facingDir = Animation::kDirRight;
-				_vm->_timer->addTimer(3, _vm->_timer->kProcCardiffReturn, _vm->_timer->kReasonCardiffsurvey);
+				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
 			}
 		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
@@ -614,9 +614,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		//setactivepage(1 - cp);
 
 		{
-			if ((_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
+			if ((_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
 				_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
-				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = false;
+				_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
 				refreshObjectList();
 			}
 		}
@@ -665,10 +665,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__lustiesroom:
 		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timer->addTimer(3, _vm->_timer->kProcCallsGuards, _vm->_timer->kReasonDuLustieTalks);
+			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
 		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
-			_vm->_timer->addTimer(3, _vm->_timer->kProcGreetsMonk, _vm->_timer->kReasonDuLustieTalks);
+			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
 
 		if (_vm->_gyro->_dna._geidaFollows) {
 			putGeidaAt(5, ped);
@@ -685,8 +685,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
-			_vm->_gyro->_magics[kColorBrown - 1]._operation = _vm->_gyro->kMagicNothing;
-			_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0;
+			_vm->_gyro->_magics[kColorBrown - 1]._operation = Gyro::kMagicNothing;
+			_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0;
 		}
 		if (ped != 0) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
@@ -1022,7 +1022,7 @@ void Lucerna::fxToggle() {
 void Lucerna::refreshObjectList() {
 	_vm->_gyro->_dna._carryNum = 0;
 	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1])
-		thinkAbout(_vm->_gyro->kObjectMoney, Gyro::kThing); // you always have money
+		thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
@@ -1208,7 +1208,7 @@ void Lucerna::gameOver() {
 	_vm->_animation->_sprites[0]._stepNum = 0;
 	_vm->_animation->_sprites[0].appear(sx, sy, 0);
 
-	_vm->_timer->addTimer(3, _vm->_timer->kProcAvalotFalls, _vm->_timer->kReasonFallingOver);
+	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
 	_vm->_gyro->_alive = false;
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index abc6ebd..1fd2617 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -220,7 +220,7 @@ void Scrolls::scrollModeMusic() {
 		setReadyLight(0);
 		_vm->_gyro->_seeScroll = false;
 
-		_vm->_timer->addTimer(8, _vm->_timer->kProcJacquesWakesUp, _vm->_timer->kReasonJacquesWakingUp);
+		_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
 		warning("STUB: Scrolls::music_scroll()");
 		return;
 #if 0
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 600a3ca..b5eb6a4 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -69,8 +69,8 @@ void Sequence::thenFlip(byte where, byte ped) {
 }
 
 void Sequence::startToClose() {
-	_vm->_timer->loseTimer(_vm->_timer->kReasonSequencer);
-	_vm->_timer->addTimer(7, _vm->_timer->kProcSequence, _vm->_timer->kReasonSequencer);
+	_vm->_timer->loseTimer(Timer::kReasonSequencer);
+	_vm->_timer->addTimer(7, Timer::kProcSequence, Timer::kReasonSequencer);
 }
 
 void Sequence::startToOpen() {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 973b1d3..c2fa073 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -237,7 +237,7 @@ void Timer::openDrawbridge() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
 
 	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
-		_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 	else
 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
@@ -278,9 +278,9 @@ void Timer::stairs() {
 	_vm->_animation->_sprites[0].walkTo(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->_dna._brummieStairs = 2;
-	_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
+	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
 	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
-	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timer::cardiffSurvey() {
@@ -318,14 +318,14 @@ void Timer::getTiedUp() {
 void Timer::getTiedUp2() {
 	_vm->_animation->_sprites[0].walkTo(4);
 	_vm->_animation->_sprites[1].walkTo(5);
-	_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_dna._friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
 	_vm->_animation->_sprites[1]._doCheck = false;
 	_vm->_animation->_sprites[0].init(7, true, _vm->_animation); // Robin Hood
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
+	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->appearPed(1, 2);
 	_vm->_visa->displayScrollChain('q', 39);
 	_vm->_animation->_sprites[0].walkTo(7);
@@ -336,7 +336,7 @@ void Timer::hangAround2() {
 	_vm->_visa->displayScrollChain('q', 40);
 	_vm->_animation->_sprites[1]._vanishIfStill = false;
 	_vm->_animation->_sprites[1].walkTo(4);
-	_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
+	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	_vm->_animation->_sprites[1].remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -357,7 +357,7 @@ void Timer::afterTheShootemup() {
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(1, 2);
 	_vm->_gyro->_dna._userMovesAvvy = true;
-	_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
+	_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
@@ -396,12 +396,12 @@ void Timer::jacquesWakesUp() {
 	case 2 : // Going through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
-		_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
+		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
-		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
+		_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
 
@@ -488,7 +488,7 @@ void Timer::jump() {
 		else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
-			_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
+			_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
 			_vm->_visa->displayScrollChain('q', 50);
 			_vm->_lucerna->incScore(3);
@@ -521,7 +521,7 @@ void Timer::buyWine() {
 	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) {
 		_vm->_visa->displayScrollChain('D', 4); // You paid up.
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
+		_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_dna._wineState = 1; // OK Wine.
 	}
@@ -538,7 +538,7 @@ void Timer::greetsMonk() {
 }
 
 void Timer::fallDownOubliette() {
-	_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
+	_vm->_gyro->_magics[8]._operation = Gyro::kMagicNothing;
 	_vm->_animation->_sprites[0]._moveY++; // Increments dx/dy!
 	_vm->_animation->_sprites[0]._y += _vm->_animation->_sprites[0]._moveY;   // Dowwwn we go...
 	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index b356aef..dfc99d4 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -165,9 +165,9 @@ void Visa::talkTo(byte whom) {
 	if (_vm->_gyro->_subjectNum == 0) {
 		switch (whom) {
 		case Gyro::kPeopleSpludwick:
-			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1])) {
+			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1])) {
 				displayScrollChain('q', 68);
-				_vm->_gyro->_dna._objects[_vm->_gyro->kObjectPotion - 1] = true;
+				_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_lucerna->incScore(3);
 				return;
@@ -241,7 +241,7 @@ void Visa::talkTo(byte whom) {
 			break;
 		}
 	// On a subject. Is there any reason to block it?
-	} else if ((whom == _vm->_gyro->kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
+	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
 		displayScrollChain('q', 43); // He's fast asleep!
 		return;
 	}
@@ -269,12 +269,12 @@ void Visa::talkTo(byte whom) {
 	if (!_noError)
 		displayScrollChain('n', whom); // File not found!
 
-	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == _vm->_gyro->kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBadge - 1] = true;
+	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_gyro->_dna._talkedToCrapulus = true;
-		_vm->_gyro->_whereIs[_vm->_gyro->kPeopleCrapulus - 150] = 177; // Crapulus walks off.
+		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_animation->_sprites[1]._vanishIfStill = true;
 		_vm->_animation->_sprites[1].walkTo(3); // Walks away.


Commit: 1cb0c0ec5ef639fe5ad083125db509ad32fdf738
    https://github.com/scummvm/scummvm/commit/1cb0c0ec5ef639fe5ad083125db509ad32fdf738
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-09T14:48:36-07:00

Commit Message:
AVALANCHE: harmonize the use of constants for kDir, kDirection, kVerbs

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index cec9c42..ffcc8e5 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1154,7 +1154,7 @@ void Acci::standUp() {
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_dna._userMovesAvvy = true;
 			_vm->_animation->appearPed(1, 2);
-			_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionLeft;
+			_vm->_gyro->_dna._direction = Gyro::kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_dna._avvyInBed = false;
@@ -1719,7 +1719,7 @@ void Acci::doThat() {
 					_vm->_animation->appearPed(2, 4);
 					_vm->_animation->_sprites[1].walkTo(5);
 					_vm->_animation->_sprites[1]._callEachStepFl = true;
-					_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
+					_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth;
 					_vm->_gyro->_dna._avariciusTalk = 14;
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 747f014..5bff123 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -322,14 +322,14 @@ void AnimationType::setSpeed(int8 xx, int8 yy) {
 	if (_moveX == 0) {
 		// No horz movement
 		if (_moveY < 0)
-			turn(_anim->kDirUp);
+			turn(Animation::kDirUp);
 		else
-			turn(_anim->kDirDown);
+			turn(Animation::kDirDown);
 	} else {
 		if (_moveX < 0)
-			turn(_anim->kDirLeft);
+			turn(Animation::kDirLeft);
 		else
-			turn(_anim->kDirRight);
+			turn(Animation::kDirRight);
 	}
 }
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index af00790..f6fb1ed 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -149,7 +149,7 @@ void Avalot::setup() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_gyro->_defaultLed = 2;
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_gyro->_dna._direction = _vm->_gyro->kDirectionStopped;
+	_vm->_gyro->_dna._direction = Gyro::kDirectionStopped;
 	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 0a5fe9f..a934ed0 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -285,26 +285,26 @@ void Dropdown::findWhatYouCanDoWithIt() {
 	case Gyro::kObjectWine:
 	case Gyro::kObjectPotion:
 	case Gyro::kObjectInk:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeDrink;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
 		break;
 	case Gyro::kObjectBell:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeRing;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
 		break;
 	case Gyro::kObjectChastity:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
 		break;
 	case Gyro::kObjectLute:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodePlay;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
 		break;
 	case Gyro::kObjectMushroom:
 	case Gyro::kObjectOnion:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeEat;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
 		break;
 	case Gyro::kObjectClothes:
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeWear;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->_verbStr = _vm->_acci->kVerbCodeExam; // Anything else.
+		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -508,22 +508,22 @@ void Dropdown::setupMenuWith() {
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodeGive;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
 		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
-		_vm->_gyro->_verbStr = Common::String(_vm->_acci->kVerbCodeExam) + _vm->_acci->kVerbCodeTalk;
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
 		switch (_vm->_gyro->_thinks) {
 		case Gyro::kPeopleGeida:
 		case Gyro::kPeopleArkata: {
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodeKiss;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
 		}
 		break;
 		case Gyro::kPeopleDogfood: {
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_dna._wonNim); // True if you HAVEN'T won.
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + _vm->_acci->kVerbCodePlay;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
 		}
 		break;
 		case Gyro::kPeopleMalagauche: {
@@ -550,19 +550,19 @@ void Dropdown::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeHelp);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBoss);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
 		break;
 	case 2:
 		_vm->_lucerna->majorRedraw();
 		break;
 	case 3:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInfo);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
 		break;
 	}
 }
@@ -571,18 +571,18 @@ void Dropdown::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeRestart);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
 		break;
 	case 1: {
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeLoad);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
 	}
 	break;
 	case 2: {
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeSave);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
 	}
 	break;
 	case 3:
@@ -593,7 +593,7 @@ void Dropdown::runMenuFile() {
 		_vm->_enid->backToBootstrap(2);
 		break;
 	case 5:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeQuit);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
 		break;
 	}
 }
@@ -611,17 +611,17 @@ void Dropdown::runMenuAction() {
 	break;
 	case 1:
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodePause);
+		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
 		break;
 	case 2:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeOpen);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
 		break;
 	case 3:
 		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeLook);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeInv);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
 		break;
 	case 5: {
 		if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
@@ -650,7 +650,7 @@ void Dropdown::runMenuWith() {
 
 		_vm->_acci->_thing += 49;
 
-		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == _vm->_acci->kVerbCodeGive)
+		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
 			_vm->_acci->_person = _vm->_gyro->_lastPerson;
 		else
 			_vm->_acci->_person = 254;
@@ -659,37 +659,37 @@ void Dropdown::runMenuWith() {
 		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: { // Beer
 			_vm->_acci->_thing = 100;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 101: { // Wine
 			_vm->_acci->_thing = 50;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 102: { // Whisky
 			_vm->_acci->_thing = 102;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 103: { // Cider
 			_vm->_acci->_thing = 103;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 104: { // Mead
 			_vm->_acci->_thing = 107;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
 		case 105: { // Onion (trader)
 			_vm->_acci->_thing = 67;
-			_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeBuy);
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
 		}
 		break;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index ccb85b4..3fe9560 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -418,7 +418,7 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	_vm->_animation->_sprites[1].init(5, false, _vm->_animation); // load Geida
 	_vm->_animation->appearPed(2, whichPed);
 	_vm->_animation->_sprites[1]._callEachStepFl = true;
-	_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGeida;
+	_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -471,7 +471,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				}
 
 				_vm->_animation->_sprites[1]._callEachStepFl = true;
-				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // He always faces Avvy.
+				_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
 
 			} else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
 
@@ -503,7 +503,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
 			_vm->_animation->_sprites[1]._callEachStepFl = true;
-			_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGeida;
+			_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -518,7 +518,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (ped > 0) {
 				_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot
 				_vm->_animation->_sprites[1]._callEachStepFl = true;
-				_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFollowAvvyY;
+				_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
@@ -732,7 +732,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 
 		_vm->_animation->_sprites[1]._callEachStepFl = true;
-		_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcFaceAvvy; // She always faces Avvy.
+		_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFaceAvvy; // She always faces Avvy.
 		break;
 
 	case r__insidecardiffcastle:
@@ -1138,13 +1138,13 @@ void Lucerna::checkClick() {
 					_vm->_acci->_person = _vm->_gyro->_thinks;
 					_vm->_acci->_thing = _vm->_acci->kPardon;
 				}
-				callVerb(_vm->_acci->kVerbCodeExam);
+				callVerb(Acci::kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
 				} while (_holdLeftMouse);
 
-				callVerb(_vm->_acci->kVerbCodeScore);
+				callVerb(Acci::kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
 				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
 				_vm->_animation->updateSpeed();
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index a378b0d..9be66ef 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -100,7 +100,7 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 		}
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeOpen);
+		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
 		break;
 	default:
 		break;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index c2fa073..b88c53d 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -311,7 +311,7 @@ void Timer::getTiedUp() {
 	_vm->_animation->_sprites[1].stopWalk();
 	_vm->_animation->_sprites[1].stopHoming();
 	_vm->_animation->_sprites[1]._callEachStepFl = true;
-	_vm->_animation->_sprites[1]._eachStepProc = _vm->_animation->kProcGrabAvvy;
+	_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGrabAvvy;
 	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
 }
 
@@ -642,7 +642,7 @@ void Timer::winning() {
 #endif
 	// TODO: To be implemented with Pingo::winningPic().
 
-	_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
+	_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
 	_vm->_scrolls->displayText(" T H E    E N D ");
 	_vm->_gyro->_letMeOut = true;
 }


Commit: 94b98ac5f682fda44e28b9f231878966e2077623
    https://github.com/scummvm/scummvm/commit/94b98ac5f682fda44e28b9f231878966e2077623
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-09T23:12:06-07:00

Commit Message:
AVALANCHE: Various cleanup

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ffcc8e5..de36039 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -364,7 +364,8 @@ void Acci::properNouns() {
 void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
-	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), 
+		                                           Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
 	_vm->_scrolls->displayText(tmpStr);
 }
 
@@ -476,7 +477,7 @@ void Acci::parse() {
 
 		bool notfound = true;
 
-		// Check also[] first, which conatins words about the actual room.
+		// Check also[] first, which contains words about the actual room.
 		if (!thisword.empty()) {
 			for (byte i = 0; i < 31; i++) {
 				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
@@ -519,16 +520,16 @@ void Acci::parse() {
 		unkString.clear();
 
 	// Replace words' codes that mean the same.
-	replace(Common::String('\xFF'), 0); // zap noise words
-	replace(Common::String('\xD')  + '\xE2', 1); // "look at" = "examine"
-	replace(Common::String('\xD')  + '\xE4', 1); // "look in" = "examine"
-	replace(Common::String('\x4')  + '\xE6', 17); // "get up" = "stand"
-	replace(Common::String('\x4')  + '\xE7', 17); // "get down" = "stand"... well, why not?
-	replace(Common::String('\x12') + '\xE4', 2); // "go in" = "open [door]"
-	replace(Common::String('\x1C') + '\xE5', 253); // "P' off" is a swear word
-	replace(Common::String('\x4')  + '\x6' , 6); // "Take inventory" (remember Colossal Adventure?)
-	replace(Common::String('\x28') + '\xE8', 21); // "put on" = "don"
-	replace(Common::String('\x4')  + '\xE5', 20); // "take off" = "doff"
+	replace(Common::String("\xFF"),     0); // zap noise words
+	replace(Common::String("\xD\xE2"),  1); // "look at" = "examine"
+	replace(Common::String("\xD\xE4"),  1); // "look in" = "examine"
+	replace(Common::String("\x4\xE6"),  17); // "get up" = "stand"
+	replace(Common::String("\x4\xE7"),  17); // "get down" = "stand"... well, why not?
+	replace(Common::String("\x12\xE4"), 2); // "go in" = "open [door]"
+	replace(Common::String("\x1C\xE5"), 253); // "P' off" is a swear word
+	replace(Common::String("\x4\x6"),   6); // "Take inventory" (remember Colossal Adventure?)
+	replace(Common::String("\x28\xE8"), 21); // "put on" = "don"
+	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
 	if (_vm->_gyro->_dna._room == r__nottspub)
@@ -654,9 +655,9 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 	else {
 		Common::String tmpStr;
 		if (_person < 175)
-			tmpStr = Common::String::format("H%ce isn't around at the moment.", Scrolls::kControlToBuffer);
+			tmpStr = Common::String::format("He isn't around at the moment.");
 		else
-			tmpStr = Common::String::format("Sh%ce isn't around at the moment.", Scrolls::kControlToBuffer);
+			tmpStr = Common::String::format("She isn't around at the moment.");
 		_vm->_scrolls->displayText(tmpStr);
 		return false;
 	}
@@ -1250,7 +1251,8 @@ void Acci::getProc(char thing) {
  */
 void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->_dna._room != r__lustiesroom) {
-		_vm->_scrolls->displayText(Common::String("Not yet. Try later!") + Scrolls::kControlRegister + '2' + Scrolls::kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
 		return;
 	}
 	_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = false;
@@ -1286,7 +1288,8 @@ void Acci::personSpeaks() {
 	}
 
 	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
-		_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + '1' + Scrolls::kControlToBuffer); // Avvy himself!
+		Common::String tmpStr = Common::String::format("%c1%c", Scrolls::kControlRegister, Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr); // Avvy himself!
 		return;
 	}
 
@@ -1294,21 +1297,26 @@ void Acci::personSpeaks() {
 
 	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + byte(i + 49) + Scrolls::kControlToBuffer);
+			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, '1' + i, Scrolls::kControlToBuffer);
+			_vm->_scrolls->displayText(tmpStr);
 			found = true;
 		}
 	}
 
-	if (!found) {
-		for (byte i = 0; i < 16; i++) {
-			if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
-				_vm->_scrolls->displayText(Common::String(Scrolls::kControlRegister) + byte(i + 65) + Scrolls::kControlToBuffer);
+	if (found)
+		return;
+
+	for (byte i = 0; i < 16; i++) {
+		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room)) {
+			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, 'A' + i, Scrolls::kControlToBuffer);
+			_vm->_scrolls->displayText(tmpStr);
 		}
 	}
 }
 void Acci::heyThanks() {
 	personSpeaks();
-	_vm->_scrolls->displayText(Common::String("Hey, thanks!") + Scrolls::kControlSpeechBubble + "(But now, you've lost it!)");
+	Common::String tmpStr = Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
+	_vm->_scrolls->displayText(tmpStr);
 	_vm->_gyro->_dna._objects[_thing - 1] = false;
 }
 
@@ -1895,8 +1903,9 @@ void Acci::doThat() {
 			for (byte i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				for (byte j = 0; j < kVocabulary[_vm->_gyro->_dna._passwordNum + kFirstPassword]._word.size(); j++) {
-					if (kVocabulary[_vm->_gyro->_dna._passwordNum + kFirstPassword]._word[j] != temp[j])
+				int pwdId = _vm->_gyro->_dna._passwordNum + kFirstPassword;
+				for (byte j = 0; j < kVocabulary[pwdId]._word.size(); j++) {
+					if (kVocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
 				}
 			}
@@ -1986,9 +1995,11 @@ void Acci::doThat() {
 				if (!_vm->_gyro->_dna._aylesIsAwake)
 					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
 				break;
-			case Gyro::kPeopleJacques:
-				_vm->_scrolls->displayText(Common::String("Brother Jacques, Brother Jacques, are you asleep?") + Scrolls::kControlRegister + '1' +
-					Scrolls::kControlSpeechBubble + "Hmmm... that doesn't seem to do any good...");
+			case Gyro::kPeopleJacques: {
+				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
+					"Hmmm... that doesn't seem to do any good...", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+				_vm->_scrolls->displayText(tmpStr);
+				}
 				break;
 			default:
 				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
@@ -2006,7 +2017,8 @@ void Acci::doThat() {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->hangAroundForAWhile();
 			_vm->_lucerna->dawn();
-			_vm->_scrolls->displayText(Common::String("A few hours later...") + Scrolls::kControlParagraph + "nothing much has happened...");
+			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Scrolls::kControlParagraph);
+			_vm->_scrolls->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeRestart:
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f6fb1ed..2643299 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -127,8 +127,6 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	_vm->_lucerna->drawDirection();
 }
 
-
-
 void Avalot::setup() {
 	_vm->_gyro->_mouse = _vm->_gyro->kMouseStateNo;
 	_vm->_gyro->_letMeOut = false;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1fd2617..22fc708 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -699,8 +699,10 @@ void Scrolls::callScrollDriver() {
 				case 1:
 					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
-				case 2:
-					displayText(_vm->_acci->kVocabulary[_vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum]._word + kControlToBuffer);
+				case 2: {
+					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum;
+					displayText(_vm->_acci->kVocabulary[pwdId]._word + kControlToBuffer);
+					}
 					break;
 				case 3:
 					displayText(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer);


Commit: 49dbac6a2a5cde294a4c4c9a47467e7b5d95e08b
    https://github.com/scummvm/scummvm/commit/49dbac6a2a5cde294a4c4c9a47467e7b5d95e08b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-10T23:43:13-07:00

Commit Message:
AVALANCHE: Some polishing in Acci2

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index de36039..ad32ebd 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -261,19 +261,18 @@ Common::String Acci::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = _vm->_gyro->_dna._totalTime / ticksInOneSec; // No. of seconds.
-	h = floor((float)h);
+	h = floor(_vm->_gyro->_dna._totalTime / ticksInOneSec); // No. of seconds.
 	m = h % 3600;
-	h = h / 3600;
+	h /= 3600;
 	s = m % 60;
-	m = m / 60;
+	m /= 60;
 
 	Common::String result = "You've been playing for ";
 	if (h > 0)
-		result += _vm->_gyro->intToStr(h) + " hours, ";
+		result += Common::String::format("%d hours, ", h);
 	if ((m > 0) || (h != 0))
-		result += _vm->_gyro->intToStr(m) + " minutes and ";
-	return result + _vm->_gyro->intToStr(s) + " seconds.";
+		result = Common::String::format("%d minutes and ", m);
+	return result + Common::String::format("%d seconds", s);
 }
 
 void Acci::cheatParse(Common::String codes) {
@@ -751,24 +750,35 @@ void Acci::examine() {
 
 void Acci::inventory() {
 	byte itemNum = 0;
-	_vm->_scrolls->displayText(Common::String("You're carrying ") + Scrolls::kControlToBuffer);
+	Common::String tmpStr = Common::String::format("You're carrying %c", Scrolls::kControlToBuffer);
+	_vm->_scrolls->displayText(tmpStr);
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->displayText(Common::String("and ") + Scrolls::kControlToBuffer);
+			if (itemNum == _vm->_gyro->_dna._carryNum) {
+				tmpStr = Common::String::format("and %c", Scrolls::kControlToBuffer);
+				_vm->_scrolls->displayText(tmpStr);
+			}
+
 			_vm->_scrolls->displayText(_vm->_gyro->getItem(i + 1) + Scrolls::kControlToBuffer);
-			if ((i + 1) == _vm->_gyro->_dna._wearing)
-				_vm->_scrolls->displayText(Common::String(", which you're wearing") + Scrolls::kControlToBuffer);
-			if (itemNum < _vm->_gyro->_dna._carryNum)
-				_vm->_scrolls->displayText(Common::String(", ") + Scrolls::kControlToBuffer);
+
+			if ((i + 1) == _vm->_gyro->_dna._wearing) {
+				tmpStr = Common::String::format(", which you're wearing%c", Scrolls::kControlToBuffer);
+				_vm->_scrolls->displayText(tmpStr);
+			}
+
+			if (itemNum < _vm->_gyro->_dna._carryNum) {
+				tmpStr = Common::String::format(", %c", Scrolls::kControlToBuffer);
+				_vm->_scrolls->displayText(tmpStr);
+			}
 		}
 	}
 
-	if (_vm->_gyro->_dna._wearing == kNothing)
-		_vm->_scrolls->displayText(Common::String("...") + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "...and you're stark naked!");
-	else
+	if (_vm->_gyro->_dna._wearing == kNothing) {
+		tmpStr = Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+		_vm->_scrolls->displayText(tmpStr);
+	} else
 		_vm->_scrolls->displayText(".");
 }
 
@@ -838,23 +848,30 @@ void Acci::peopleInRoom() {
 	if (numPeople == 0) // If nobody's here, we can cut out straight away.
 		return;
 
+	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
 	for (byte i = 1; i < 29; i++) {
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
 				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
-			else if (actPerson < numPeople) // The middle...
-				_vm->_scrolls->displayText(Common::String(", ") + _vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
-			else // The end.
-				_vm->_scrolls->displayText(Common::String(" and ") + _vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
+			else if (actPerson < numPeople) { // The middle...
+				tmpStr = Common::String::format(", %s%c", _vm->_gyro->getName(i + 150), Scrolls::kControlToBuffer);
+				_vm->_scrolls->displayText(tmpStr);
+			} else { // The end.
+				tmpStr = Common::String::format(" and %s%c", _vm->_gyro->getName(i + 150), Scrolls::kControlToBuffer);
+				_vm->_scrolls->displayText(tmpStr);
+			}
 		}
 	}
 
-	if (numPeople == 1)
-		_vm->_scrolls->displayText(Common::String(" is") + Scrolls::kControlToBuffer);
-	else
-		_vm->_scrolls->displayText(Common::String(" are") + Scrolls::kControlToBuffer);
+	if (numPeople == 1) {
+		tmpStr = Common::String::format(" is%c", Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr);
+	} else {
+		tmpStr = Common::String::format(" are%c", Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr);
+	}
 
 	_vm->_scrolls->displayText(" here."); // End and display it.
 }
@@ -1360,9 +1377,10 @@ void Acci::doThat() {
 	case kVerbCodeOpen:
 		openDoor();
 		break;
-	case kVerbCodePause: // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		_vm->_scrolls->displayText(Common::String("Game paused.") + Scrolls::kControlCenter + Scrolls::kControlNewLine + Scrolls::kControlNewLine
-			+ "Press Enter, Esc, or click the mouse on the \"O.K.\" box to continue.");
+	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+		_vm->_scrolls->displayText(tmpStr);
+		}
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.


Commit: da1a427e794434a09cd39ab45e32ae7afca9a170
    https://github.com/scummvm/scummvm/commit/da1a427e794434a09cd39ab45e32ae7afca9a170
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-11T12:33:10-07:00

Commit Message:
Merge branch 'master' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
  A audio/softsynth/mt32/LA32FloatWaveGenerator.cpp
  A audio/softsynth/mt32/LA32FloatWaveGenerator.h
  A engines/fullpipe/behavior.cpp
  A engines/fullpipe/behavior.h
  A engines/fullpipe/constants.h
  A engines/fullpipe/detection.cpp
  A engines/fullpipe/fullpipe.cpp
  A engines/fullpipe/fullpipe.h
  A engines/fullpipe/gameloader.cpp
  A engines/fullpipe/gameloader.h
  A engines/fullpipe/gfx.cpp
  A engines/fullpipe/gfx.h
  A engines/fullpipe/init.cpp
  A engines/fullpipe/input.cpp
  A engines/fullpipe/input.h
  A engines/fullpipe/interaction.cpp
  A engines/fullpipe/interaction.h
  A engines/fullpipe/inventory.cpp
  A engines/fullpipe/inventory.h
  A engines/fullpipe/lift.cpp
  A engines/fullpipe/messages.cpp
  A engines/fullpipe/messages.h
  A engines/fullpipe/modal.cpp
  A engines/fullpipe/modal.h
  A engines/fullpipe/module.mk
  A engines/fullpipe/motion.cpp
  A engines/fullpipe/motion.h
  A engines/fullpipe/ngiarchive.cpp
  A engines/fullpipe/ngiarchive.h
  A engines/fullpipe/objectnames.h
  A engines/fullpipe/objects.h
  A engines/fullpipe/scene.cpp
  A engines/fullpipe/scene.h
  A engines/fullpipe/scenes.cpp
  A engines/fullpipe/scenes.h
  A engines/fullpipe/sound.cpp
  A engines/fullpipe/sound.h
  A engines/fullpipe/stateloader.cpp
  A engines/fullpipe/statics.cpp
  A engines/fullpipe/statics.h
  A engines/fullpipe/utils.cpp
  A engines/fullpipe/utils.h
  R audio/softsynth/mt32/AReverbModel.cpp
  R audio/softsynth/mt32/AReverbModel.h
  R audio/softsynth/mt32/DelayReverb.cpp
  R audio/softsynth/mt32/DelayReverb.h
  R audio/softsynth/mt32/FreeverbModel.cpp
  R audio/softsynth/mt32/FreeverbModel.h
  R audio/softsynth/mt32/LegacyWaveGenerator.cpp
  R audio/softsynth/mt32/LegacyWaveGenerator.h
  R audio/softsynth/mt32/freeverb.cpp
  R audio/softsynth/mt32/freeverb.h
    .gitignore
    AUTHORS
    audio/softsynth/mt32/BReverbModel.cpp
    audio/softsynth/mt32/BReverbModel.h
    audio/softsynth/mt32/LA32WaveGenerator.cpp
    audio/softsynth/mt32/LA32WaveGenerator.h
    audio/softsynth/mt32/Part.cpp
    audio/softsynth/mt32/Part.h
    audio/softsynth/mt32/Partial.cpp
    audio/softsynth/mt32/Partial.h
    audio/softsynth/mt32/PartialManager.cpp
    audio/softsynth/mt32/PartialManager.h
    audio/softsynth/mt32/Poly.cpp
    audio/softsynth/mt32/Poly.h
    audio/softsynth/mt32/Structures.h
    audio/softsynth/mt32/Synth.cpp
    audio/softsynth/mt32/Synth.h
    audio/softsynth/mt32/TVP.cpp
    audio/softsynth/mt32/Tables.h
    audio/softsynth/mt32/module.mk
    audio/softsynth/mt32/mt32emu.h
    backends/platform/tizen/application.cpp
    backends/platform/tizen/audio.cpp
    backends/platform/tizen/audio.h
    backends/platform/tizen/form.cpp
    backends/platform/tizen/form.h
    backends/platform/tizen/fs.cpp
    backends/platform/tizen/graphics.cpp
    backends/platform/tizen/sscanf.cpp
    backends/platform/tizen/system.cpp
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/create_mortdat.h
    devtools/create_mortdat/menudata.h
    devtools/create_project/msbuild.cpp
    devtools/create_project/msbuild.h
    devtools/create_project/msvc.cpp
    devtools/create_project/msvc.h
    devtools/create_project/visualstudio.cpp
    devtools/create_project/visualstudio.h
    devtools/credits.pl
    dists/engine-data/mort.dat
    engines/advancedDetector.cpp
    engines/advancedDetector.h
    engines/agi/detection_tables.h
    engines/agos/agos.h
    engines/agos/saveload.cpp
    engines/agos/script_pn.cpp
    engines/configure.engines
    engines/drascula/actors.cpp
    engines/drascula/animation.cpp
    engines/drascula/console.cpp
    engines/drascula/converse.cpp
    engines/drascula/drascula.cpp
    engines/drascula/drascula.h
    engines/drascula/graphics.cpp
    engines/drascula/interface.cpp
    engines/drascula/objects.cpp
    engines/drascula/rooms.cpp
    engines/drascula/saveload.cpp
    engines/drascula/sound.cpp
    engines/drascula/talk.cpp
    engines/engines.mk
    engines/kyra/text_rpg.cpp
    engines/lastexpress/data/scene.h
    engines/lastexpress/debug.cpp
    engines/lastexpress/game/scenes.cpp
    engines/lastexpress/game/state.h
    engines/lastexpress/lastexpress.cpp
    engines/mohawk/myst.cpp
    engines/mohawk/myst_stacks/myst.cpp
    engines/mortevielle/actions.cpp
    engines/mortevielle/detection.cpp
    engines/mortevielle/detection_tables.h
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/saveload.h
    engines/mortevielle/sound.cpp
    engines/mortevielle/utils.cpp
    engines/plugins_table.h
    engines/sci/detection.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/features.cpp
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/vm_types.cpp
    engines/sci/engine/vm_types.h
    engines/sci/engine/workarounds.cpp
    engines/sci/graphics/picture.cpp
    engines/sci/sci.h
    engines/scumm/gfx.cpp
    engines/sword25/gfx/microtiles.cpp
    engines/tinsel/detection_tables.h
    engines/toltecs/detection.cpp
    engines/tsage/blue_force/blueforce_logic.cpp
    engines/tsage/blue_force/blueforce_scenes0.cpp
    engines/tsage/blue_force/blueforce_scenes1.cpp
    engines/tsage/blue_force/blueforce_scenes5.cpp
    engines/tsage/blue_force/blueforce_scenes5.h
    engines/tsage/blue_force/blueforce_scenes8.cpp
    engines/tsage/converse.cpp
    engines/tsage/core.cpp
    engines/tsage/events.cpp
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_logic.h
    engines/tsage/ringworld2/ringworld2_scenes0.cpp
    engines/tsage/ringworld2/ringworld2_scenes0.h
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.h
    engines/tsage/ringworld2/ringworld2_scenes2.cpp
    engines/tsage/ringworld2/ringworld2_scenes2.h
    engines/tsage/ringworld2/ringworld2_scenes3.cpp
    engines/tsage/ringworld2/ringworld2_speakers.cpp
    engines/tsage/ringworld2/ringworld2_speakers.h
    engines/tsage/staticres.cpp
    engines/tsage/staticres.h
    engines/tsage/user_interface.cpp
    engines/tsage/user_interface.h
    engines/wintermute/base/base_persistence_manager.cpp
    engines/wintermute/base/base_persistence_manager.h
    engines/wintermute/base/font/base_font_truetype.cpp
    engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
    engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
    engines/wintermute/base/gfx/osystem/base_surface_osystem.h
    engines/wintermute/base/gfx/osystem/render_ticket.cpp
    engines/wintermute/base/scriptables/script_engine.cpp
    engines/wintermute/base/scriptables/script_value.cpp
    engines/wintermute/dcgf.h
    engines/wintermute/detection_tables.h
    engines/wintermute/graphics/transparent_surface.cpp
    engines/wintermute/graphics/transparent_surface.h
    engines/wintermute/utils/string_util.cpp
    engines/wintermute/wintermute.cpp
    graphics/VectorRenderer.h
    graphics/VectorRendererSpec.cpp
    graphics/VectorRendererSpec.h
    graphics/font.cpp
    gui/EventRecorder.cpp
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/about.cpp
    gui/credits.h
    gui/object.cpp
    gui/object.h
    gui/themes/scummclassic.zip
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/scummmodern_gfx.stx
    gui/widgets/editable.cpp
    gui/widgets/edittext.cpp
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/codecs/truemotion1.cpp
    video/video_decoder.cpp
    video/video_decoder.h





Commit: 2f42e9ce4607c228177e57e0e28a2333efc289e6
    https://github.com/scummvm/scummvm/commit/2f42e9ce4607c228177e57e0e28a2333efc289e6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-11T13:49:16-07:00

Commit Message:
AVALANCHE: Identify useless variables and function in Closing2

Changed paths:
    engines/avalanche/closing2.cpp
    engines/avalanche/closing2.h



diff --git a/engines/avalanche/closing2.cpp b/engines/avalanche/closing2.cpp
index c9bfcd0..7da630b 100644
--- a/engines/avalanche/closing2.cpp
+++ b/engines/avalanche/closing2.cpp
@@ -79,8 +79,9 @@ void Closing::exitGame() {
 	showScreen(); // No halt- it's already set up.
 }
 
-void Closing::handleBug() {
-	warning("STUB: Closing::handleBug()");
-}
+// CHECKME: Useless?
+// void Closing::handleBug() {
+//	warning("STUB: Closing::handleBug()");
+//}
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
index e1bf8b2..a2543fd 100644
--- a/engines/avalanche/closing2.h
+++ b/engines/avalanche/closing2.h
@@ -33,37 +33,33 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
-
-
 namespace Avalanche {
 class AvalancheEngine;
 
 class Closing {
 public:
 	Closing(AvalancheEngine *vm);
-
 	void exitGame();
 
 private:
+// CHECKME: Useless values?
 	enum ScreenType {
-		kScreenBugAlert = 1,
-		kScreenRamCram = 2,
-		kScreenNagScreen = 3,
-		kScreenTwoCopies = 5
+//		kScreenBugAlert = 1,
+//		kScreenRamCram = 2,
+//		kScreenTwoCopies = 5,
+		kScreenNagScreen = 3
 	};
 
 	AvalancheEngine *_vm;
 
-	Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
-	Common::File f;
-
 	void getScreen(ScreenType which);
-
 	void showScreen();
-
 	void putIn(Common::String str, uint16 where);
 
-	void handleBug();
+	// CHECKME: Unused?
+	// Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
+	// Common::File f;
+	// void handleBug();
 };
 
 } // End of namespace Avalanche.


Commit: 4c12daf55a35e06313cb0a5086b5cc5dae8dd971
    https://github.com/scummvm/scummvm/commit/4c12daf55a35e06313cb0a5086b5cc5dae8dd971
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-11T15:32:45-07:00

Commit Message:
AVALANCHE: Polish some more strings

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ad32ebd..ad4bd13 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -971,8 +971,8 @@ void Acci::openDoor() {
 	}
 
 	if (_vm->_gyro->_dna._room == r__map)
-		_vm->_scrolls->displayText(Common::String("Avvy, you can complete the whole game without ever going "
-				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."));
+		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
+				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
 		_vm->_scrolls->displayText("Door? What door?");
 }
@@ -1361,7 +1361,7 @@ void Acci::doThat() {
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_gyro->_alive) {
-			_vm->_scrolls->displayText(Common::String("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"));
+			_vm->_scrolls->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
 			return;
 		}
 		if (!_vm->_gyro->_dna._avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
@@ -1396,7 +1396,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeDrop:
-		_vm->_scrolls->displayText(Common::String("Two years ago you dropped a florin in the street. Three days ") +
+		_vm->_scrolls->displayText("Two years ago you dropped a florin in the street. Three days " \
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
 	case kVerbCodeInv:
@@ -1404,9 +1404,10 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
-			if (_vm->_gyro->_subjectNum == 99) // They typed "say password".
-				_vm->_scrolls->displayText(Common::String("Yes, but what ") + Scrolls::kControlItalic + "is" + Scrolls::kControlRoman + " the password?");
-			else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
+			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
+				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Scrolls::kControlItalic, Scrolls::kControlRoman);
+				_vm->_scrolls->displayText(tmpStr);
+			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
 				for (byte i = 0; i < 10; i++)
@@ -1452,7 +1453,7 @@ void Acci::doThat() {
 						break;
 					case Gyro::kPeopleCwytalot:
 						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-							_vm->_scrolls->displayText(Common::String("You might be able to influence Cwytalot more if you used it!"));
+							_vm->_scrolls->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
 							heyThanks();
 						break;
@@ -1578,7 +1579,8 @@ void Acci::doThat() {
 		if (_vm->_gyro->_dna._wearing == kNothing)
 			_vm->_scrolls->displayText("You're already stark naked!");
 		else if (_vm->_gyro->_dna._avvysInTheCupboard) {
-			_vm->_scrolls->displayText(Common::String("You take off ") + _vm->_gyro->getItem(_vm->_gyro->_dna._wearing) + '.');
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_dna._wearing).c_str());
+			_vm->_scrolls->displayText(tmpStr);
 			_vm->_gyro->_dna._wearing = kNothing;
 			_vm->_lucerna->refreshObjectList();
 		} else
@@ -1724,13 +1726,16 @@ void Acci::doThat() {
 		if (_vm->_gyro->setFlag('P')) {
 			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
-		} else
-			_vm->_scrolls->displayText(Common::String("It would be ") + Scrolls::kControlItalic + "VERY"
-			+ Scrolls::kControlRoman + " unwise to do that here, Avvy!");
+		} else {
+			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+			_vm->_scrolls->displayText(tmpStr);
+		}
 		break;
-	case kVerbCodeCheat:
-		_vm->_scrolls->displayText(Common::String(Scrolls::kControlItalic) + "Cheat mode now enabled.");
+	case kVerbCodeCheat: {
+		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Scrolls::kControlItalic);
+		_vm->_scrolls->displayText(tmpStr);
 		_vm->_gyro->_cheat = true;
+		}
 		break;
 	case kVerbCodeMagic:
 		if (_vm->_gyro->_dna._avariciusTalk > 0)
@@ -1758,19 +1763,25 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeExpletive:
 		switch (_vm->_gyro->_dna._sworeNum) {
-		case 0:
-			_vm->_scrolls->displayText(Common::String("Avvy! Do you mind? There might be kids playing!")
-				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "(I shouldn't say it again, if I were you!)");
+		case 0: {
+			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
+				"(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
+			}
 			break;
-		case 1:
-			_vm->_scrolls->displayText(Common::String("You hear a distant rumble of thunder. Must you always do things I tell you not to?")
-				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Don't do it again!");
+		case 1: {
+			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
+				"do things I tell you not to?%c%cDon't do it again!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
+			}
 			break;
-		default:
+		default: {
 			_vm->_pingo->zonk();
-			_vm->_scrolls->displayText(Common::String("A crack of lightning shoots from the sky, and fries you.")
-				+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "(`Such is the anger of the gods, Avvy!\")");
+			// CHECKME: Weird character in string
+			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
 			_vm->_lucerna->gameOver();
+			}
 		}
 		_vm->_gyro->_dna._sworeNum++;
 		break;
@@ -1830,7 +1841,8 @@ void Acci::doThat() {
 						}
 
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-						_vm->_scrolls->displayText(Common::String("Wine, please.") + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, '1', Scrolls::kControlSpeechBubble);
+						_vm->_scrolls->displayText(tmpStr);
 						if (_vm->_gyro->_dna._alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -2049,16 +2061,21 @@ void Acci::doThat() {
 	case kPardon:
 		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
 		break;
-	case kVerbCodeHello:
+	case kVerbCodeHello: {
 		personSpeaks();
-		_vm->_scrolls->displayText(Common::String("Hello.") + Scrolls::kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		}
 		break;
-	case kVerbCodeThanks:
+	case kVerbCodeThanks: {
 		personSpeaks();
-		_vm->_scrolls->displayText(Common::String("That's OK.") + Scrolls::kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		}
 		break;
 	default:
-		_vm->_scrolls->displayText(Common::String(Scrolls::kControlBell) + "Parser bug!");
+		Common::String tmpStr = Common::String::format("%cParser bug!", Scrolls::kControlBell);
+		_vm->_scrolls->displayText(tmpStr);
 	}
 }
 


Commit: 11c496c31b6eb410d5bd10d346606a92c82664b4
    https://github.com/scummvm/scummvm/commit/11c496c31b6eb410d5bd10d346606a92c82664b4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-11T22:43:15-07:00

Commit Message:
AVALANCHE: Complete 2 comments, get rid of Scrolls::kControlToBuffer in one function (for further discussions)

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ad4bd13..2c2c37a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -750,36 +750,30 @@ void Acci::examine() {
 
 void Acci::inventory() {
 	byte itemNum = 0;
-	Common::String tmpStr = Common::String::format("You're carrying %c", Scrolls::kControlToBuffer);
-	_vm->_scrolls->displayText(tmpStr);
+	Common::String tmpStr = Common::String::format("You're carrying ");
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_gyro->_dna._carryNum) {
-				tmpStr = Common::String::format("and %c", Scrolls::kControlToBuffer);
-				_vm->_scrolls->displayText(tmpStr);
-			}
+			if (itemNum == _vm->_gyro->_dna._carryNum)
+				tmpStr += "and %c";
 
-			_vm->_scrolls->displayText(_vm->_gyro->getItem(i + 1) + Scrolls::kControlToBuffer);
+			tmpStr += _vm->_gyro->getItem(i + 1);
 
-			if ((i + 1) == _vm->_gyro->_dna._wearing) {
-				tmpStr = Common::String::format(", which you're wearing%c", Scrolls::kControlToBuffer);
-				_vm->_scrolls->displayText(tmpStr);
-			}
+			if ((i + 1) == _vm->_gyro->_dna._wearing)
+				tmpStr += ", which you're wearing";
 
-			if (itemNum < _vm->_gyro->_dna._carryNum) {
-				tmpStr = Common::String::format(", %c", Scrolls::kControlToBuffer);
-				_vm->_scrolls->displayText(tmpStr);
-			}
+			if (itemNum < _vm->_gyro->_dna._carryNum)
+				tmpStr += ", ";
 		}
 	}
 
 	if (_vm->_gyro->_dna._wearing == kNothing) {
-		tmpStr = Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-		_vm->_scrolls->displayText(tmpStr);
+		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
 	} else
-		_vm->_scrolls->displayText(".");
+		tmpStr += '.';
+
+	_vm->_scrolls->displayText(tmpStr);
 }
 
 void Acci::swallow() {   // Eat something.
@@ -1630,7 +1624,7 @@ void Acci::doThat() {
 		if (_thing == kPardon) {
 			switch (_vm->_gyro->_dna._room) { // They just typed "play"...
 			case r__argentpub: { // ...in the pub, => play Nim.
-					warning("STUB: Acci::doThat() - case kVerbCodeplay");
+					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 					// play_nim();
 					// The following parts are copied from play_nim().
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
@@ -1688,7 +1682,7 @@ void Acci::doThat() {
 			case 55:
 				if (_vm->_gyro->_dna._room == r__argentpub)
 					// play_nim();
-					warning("STUB: Acci::doThat() - case kVerbCodeplay");
+					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 				else
 					_vm->_scrolls->displayText(kWhat);
 				break;


Commit: b936611e030f6748013b5360c8617d44643cb335
    https://github.com/scummvm/scummvm/commit/b936611e030f6748013b5360c8617d44643cb335
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T12:44:36-07:00

Commit Message:
AVALANCHE: Fix various warnings reported by GCC and/or wjp

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2c2c37a..74ddad9 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -654,9 +654,9 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 	else {
 		Common::String tmpStr;
 		if (_person < 175)
-			tmpStr = Common::String::format("He isn't around at the moment.");
+			tmpStr = "He isn't around at the moment.";
 		else
-			tmpStr = Common::String::format("She isn't around at the moment.");
+			tmpStr = "She isn't around at the moment.";
 		_vm->_scrolls->displayText(tmpStr);
 		return false;
 	}
@@ -750,13 +750,13 @@ void Acci::examine() {
 
 void Acci::inventory() {
 	byte itemNum = 0;
-	Common::String tmpStr = Common::String::format("You're carrying ");
+	Common::String tmpStr = Common::String("You're carrying ");
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_dna._objects[i]) {
 			itemNum++;
 			if (itemNum == _vm->_gyro->_dna._carryNum)
-				tmpStr += "and %c";
+				tmpStr += "and ";
 
 			tmpStr += _vm->_gyro->getItem(i + 1);
 
@@ -768,9 +768,9 @@ void Acci::inventory() {
 		}
 	}
 
-	if (_vm->_gyro->_dna._wearing == kNothing) {
+	if (_vm->_gyro->_dna._wearing == kNothing)
 		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-	} else
+	else
 		tmpStr += '.';
 
 	_vm->_scrolls->displayText(tmpStr);
@@ -850,10 +850,10 @@ void Acci::peopleInRoom() {
 			if (actPerson == 1) // First on the list.
 				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
 			else if (actPerson < numPeople) { // The middle...
-				tmpStr = Common::String::format(", %s%c", _vm->_gyro->getName(i + 150), Scrolls::kControlToBuffer);
+				tmpStr = Common::String::format(", %s%c", _vm->_gyro->getName(i + 150).c_str(), Scrolls::kControlToBuffer);
 				_vm->_scrolls->displayText(tmpStr);
 			} else { // The end.
-				tmpStr = Common::String::format(" and %s%c", _vm->_gyro->getName(i + 150), Scrolls::kControlToBuffer);
+				tmpStr = Common::String::format(" and %s%c", _vm->_gyro->getName(i + 150).c_str(), Scrolls::kControlToBuffer);
 				_vm->_scrolls->displayText(tmpStr);
 			}
 		}
@@ -1056,9 +1056,9 @@ void Acci::putProc() {
  * @remarks	Originally called 'not_in_order'
  */
 void Acci::notInOrder() {
+	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
-		"What I need next is %s%c2%c", _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]),
-		Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+		"What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 	_vm->_scrolls->displayText(tmpStr);
 }
 
@@ -1206,7 +1206,7 @@ void Acci::getProc(char thing) {
 				_vm->_gyro->_dna._boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else {
-				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing));
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
 				_vm->_scrolls->displayText(tmpStr);
 			}
 		} else
@@ -1835,7 +1835,7 @@ void Acci::doThat() {
 						}
 
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, '1', Scrolls::kControlSpeechBubble);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 						_vm->_scrolls->displayText(tmpStr);
 						if (_vm->_gyro->_dna._alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5bff123..615bf94 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -226,7 +226,7 @@ void AnimationType::walk() {
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
-				Common::String tmpStr = Common::String::format("%cSorry.%cThis place is not available yet!", Scrolls::kControlBell, Scrolls::kControlCenter, Scrolls::kControlRoman);
+				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Scrolls::kControlBell, Scrolls::kControlCenter, Scrolls::kControlRoman);
 				_anim->_vm->_scrolls->displayText(tmpStr);
 				}
 				break;
@@ -352,8 +352,8 @@ void AnimationType::remove() {
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
 	for (byte i = 0; i < _stat._frameNum; i++) {
+		assert(_animCount > 0);
 		_animCount--;
-		assert(_animCount >= 0);
 		delete[] _info._mani[_animCount];
 		delete[] _info._sil[_animCount];
 	}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index cdd6b7c..ce3fb8e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -454,7 +454,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
 		Scrolls::kControlItalic, Scrolls::kControlRoman, description.c_str(), Scrolls::kControlCenter, 
-		Scrolls::kControlNewLine, Scrolls::kControlNewLine, _gyro->_roomnName, Scrolls::kControlNewLine, 
+		Scrolls::kControlNewLine, Scrolls::kControlNewLine, _gyro->_roomnName.c_str(), Scrolls::kControlNewLine, 
 		Scrolls::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_scrolls->displayText(tmpStr);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3fe9560..71d38d3 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -232,7 +232,7 @@ void Lucerna::loadAlso(byte num) {
 			_vm->_gyro->_also[i][j] = new Common::String;
 			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
 		}
-		tmpStr = Common::String::format("\x9D%s\x9D", *_vm->_gyro->_also[i][0]);
+		tmpStr = Common::String::format("\x9D%s\x9D", *_vm->_gyro->_also[i][0]->c_str());
 		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
 
@@ -287,7 +287,7 @@ void Lucerna::loadAlso(byte num) {
 	file.close();
 	unScramble();
 	for (byte i = 0; i <= alsoNum; i++) {
-		tmpStr = Common::String::format(",%s,", *_vm->_gyro->_also[i][0]);
+		tmpStr = Common::String::format(",%s,", *_vm->_gyro->_also[i][0]->c_str());
 		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
 }


Commit: 65f39c14c92cf1453c58dd87db1b473f25b4dbd8
    https://github.com/scummvm/scummvm/commit/65f39c14c92cf1453c58dd87db1b473f25b4dbd8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T15:18:14-07:00

Commit Message:
AVALANCHE: Remove some verbosity related to excessive use of Common::String in Acci2

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 74ddad9..1b6446c 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -848,26 +848,20 @@ void Acci::peopleInRoom() {
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				_vm->_scrolls->displayText(_vm->_gyro->getName(i + 150) + Scrolls::kControlToBuffer);
-			else if (actPerson < numPeople) { // The middle...
-				tmpStr = Common::String::format(", %s%c", _vm->_gyro->getName(i + 150).c_str(), Scrolls::kControlToBuffer);
-				_vm->_scrolls->displayText(tmpStr);
-			} else { // The end.
-				tmpStr = Common::String::format(" and %s%c", _vm->_gyro->getName(i + 150).c_str(), Scrolls::kControlToBuffer);
-				_vm->_scrolls->displayText(tmpStr);
-			}
+				tmpStr = _vm->_gyro->getName(i + 150);
+			else if (actPerson < numPeople) // The middle...
+				tmpStr += ", " + _vm->_gyro->getName(i + 150);
+			else // The end.
+				tmpStr += " and " + _vm->_gyro->getName(i + 150);
 		}
 	}
 
-	if (numPeople == 1) {
-		tmpStr = Common::String::format(" is%c", Scrolls::kControlToBuffer);
-		_vm->_scrolls->displayText(tmpStr);
-	} else {
-		tmpStr = Common::String::format(" are%c", Scrolls::kControlToBuffer);
-		_vm->_scrolls->displayText(tmpStr);
-	}
+	if (numPeople == 1)
+		tmpStr += " is";
+	else
+		tmpStr += " are";
 
-	_vm->_scrolls->displayText(" here."); // End and display it.
+	_vm->_scrolls->displayText(tmpStr + " here."); // End and display it.
 }
 
 void Acci::lookAround() {
@@ -1290,7 +1284,7 @@ void Acci::winSequence() {
 	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
 }
 
-void Acci::personSpeaks() {
+Common::String Acci::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
 		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_dna._room))
 			_person = _vm->_gyro->_her;
@@ -1299,34 +1293,32 @@ void Acci::personSpeaks() {
 	}
 
 	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
-		Common::String tmpStr = Common::String::format("%c1%c", Scrolls::kControlRegister, Scrolls::kControlToBuffer);
-		_vm->_scrolls->displayText(tmpStr); // Avvy himself!
-		return;
+		return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
 	}
 
 	bool found = false; // The _person we're looking for's code is in _person.
+	Common::String tmpStr;
 
 	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, '1' + i, Scrolls::kControlToBuffer);
-			_vm->_scrolls->displayText(tmpStr);
+			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, '1' + i);
 			found = true;
 		}
 	}
 
 	if (found)
-		return;
+		return tmpStr;
 
 	for (byte i = 0; i < 16; i++) {
-		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room)) {
-			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, 'A' + i, Scrolls::kControlToBuffer);
-			_vm->_scrolls->displayText(tmpStr);
-		}
+		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
+			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
 	}
+
+	return tmpStr;
 }
 void Acci::heyThanks() {
-	personSpeaks();
-	Common::String tmpStr = Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
 	_vm->_scrolls->displayText(tmpStr);
 	_vm->_gyro->_dna._objects[_thing - 1] = false;
 }
@@ -2056,14 +2048,14 @@ void Acci::doThat() {
 		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
 		break;
 	case kVerbCodeHello: {
-		personSpeaks();
-		Common::String tmpStr = Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
 		_vm->_scrolls->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeThanks: {
-		personSpeaks();
-		Common::String tmpStr = Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
 		_vm->_scrolls->displayText(tmpStr);
 		}
 		break;
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index 55ad64e..dab5371 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -124,7 +124,7 @@ private:
 	void giveGeidaTheLute();
 	void playHarp();
 	void winSequence();
-	void personSpeaks();
+	Common::String personSpeaks();
 	void heyThanks();
 };
 


Commit: 7fdb5c439ec98c93fbdb2195c8f1a62b0c448a05
    https://github.com/scummvm/scummvm/commit/7fdb5c439ec98c93fbdb2195c8f1a62b0c448a05
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T16:08:37-07:00

Commit Message:
AVALANCHE: Fix bug in scrollModeNormal()

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 22fc708..1d2cd45 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -112,7 +112,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 }
 
 void Scrolls::scrollModeNormal() {
-	Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
+	Common::String egg = Common::String::format("%c%c%c%c%c+***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
 	Common::String e = "(c) 1994";
 
 	setReadyLight(3);


Commit: 8a59c9c1b27cc026ba096c44486f504ba1eb8c5d
    https://github.com/scummvm/scummvm/commit/8a59c9c1b27cc026ba096c44486f504ba1eb8c5d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T16:27:20-07:00

Commit Message:
AVALANCHE: undo previous commit, add comments about kControlNegative and a missing stub

Changed paths:
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1d2cd45..ab7d038 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -112,7 +112,11 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 }
 
 void Scrolls::scrollModeNormal() {
-	Common::String egg = Common::String::format("%c%c%c%c%c+***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
+	// Original code is:
+	// egg : array[1..8] of char = ^P^L^U^G^H+'***';
+	// this is not using kControl characters: it's the secret code to be entered to trigger the easter egg
+	// TODO: To be fixed when the Easter egg code is implemented
+	Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
 	Common::String e = "(c) 1994";
 
 	setReadyLight(3);
@@ -137,6 +141,7 @@ void Scrolls::scrollModeNormal() {
 	_vm->_graphics->_surface.copyFrom(temp);
 	temp.free();
 
+	warning("STUB: scrollModeNormal() - Check Easter Egg trigger");
 #if 0
 	char r;
 	bool oktoexit;
@@ -694,6 +699,8 @@ void Scrolls::callScrollDriver() {
 					return;
 			}
 			break;
+
+			// CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive 
 			case kControlNegative:
 				switch (_param) {
 				case 1:


Commit: f7c34949db4df92aced4a654072ef74bd064c421
    https://github.com/scummvm/scummvm/commit/f7c34949db4df92aced4a654072ef74bd064c421
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T23:29:19-07:00

Commit Message:
AVALANCHE: Error out when critical files are missing

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/pingo2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 615bf94..5735325 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -55,10 +55,8 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 
 	Common::File inf;
 	Common::String filename = Common::String::format("sprite%d.avd", spritenum);
-	if (!inf.open(filename)) {
-		warning("AVALANCHE: Trip: File not found: %s", filename.c_str());
-		return;
-	}
+	if (!inf.open(filename))
+		error("AVALANCHE: Trip: File not found: %s", filename.c_str());
 
 	inf.seek(177);
 
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 5069a92..acbe5e9 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -267,10 +267,8 @@ void Celer::updateBackgroundSprites() {
 void Celer::loadBackgroundSprites(byte number) {
 	Common::File f;
 	_filename = _filename.format("chunk%d.avd", number);
-	if (!f.open(_filename)) {
-		warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
-		return;
-	}
+	if (!f.open(_filename))
+		error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 
 	f.seek(44);
 	_spriteNum = f.readByte();
@@ -336,10 +334,8 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		drawSprite(destX, destY, _sprites[which]);
 	} else {
 		Common::File f;
-		if (!f.open(_filename)) { // Filename was set in loadBackgroundSprites().
-			warning("AVALANCHE: Celer: File not found: %s", _filename.c_str());
-			return;
-		}
+		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
+			error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
 
 		f.seek(_offsets[which]);
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 70c2150..ecd1be1 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -457,10 +457,8 @@ Common::String Gyro::f5Does() {
 void Gyro::loadMouse(byte which) {
 	Common::File f;
 
-	if (!f.open("mice.avd")) {
-		warning("AVALANCHE: Gyro: File not found: mice.avd");
-		return;
-	}
+	if (!f.open("mice.avd"))
+		error("AVALANCHE: Gyro: File not found: mice.avd");
 
 	::Graphics::Surface cursor;
 	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 71d38d3..784c83e 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -218,10 +218,8 @@ void Lucerna::loadAlso(byte num) {
 	}
 	Common::String filename;
 	filename = Common::String::format("also%d.avd", num);
-	if (!file.open(filename)) {
-		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
-		return;
-	}
+	if (!file.open(filename))
+		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 
 	file.seek(128);
 
@@ -298,10 +296,8 @@ void Lucerna::loadRoom(byte num) {
 	_vm->_graphics->fleshColors();
 
 	Common::String filename = Common::String::format("place%d.avd", num);
-	if (!file.open(filename)) {
-		warning("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
-		return;
-	}
+	if (!file.open(filename))
+		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
 
 	file.seek(146);
 	if (!_vm->_gyro->_roomnName.empty())
@@ -851,15 +847,11 @@ void Lucerna::thinkAbout(byte object, bool type) {
 	_vm->_gyro->setMousePointerWait();
 
 	if (type == Gyro::kThing) {
-		if (!file.open("thinks.avd")) {
-			warning("AVALANCHE: Lucerna: File not found: thinks.avd");
-			return;
-		}
+		if (!file.open("thinks.avd"))
+			error("AVALANCHE: Lucerna: File not found: thinks.avd");
 	} else { // Gyro::kPerson
-		if (!file.open("folk.avd")) {
-			warning("AVALANCHE: Lucerna: File not found: folk.avd");
-			return;
-		}
+		if (!file.open("folk.avd"))
+			error("AVALANCHE: Lucerna: File not found: folk.avd");
 
 		object -= 149;
 		if (object >= 25)
@@ -869,13 +861,10 @@ void Lucerna::thinkAbout(byte object, bool type) {
 	}
 
 	file.seek(object * picSize + 65);
-
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
 
 	picture.free();
-
 	file.close();
 
 	CursorMan.showMouse(false);
@@ -894,10 +883,8 @@ void Lucerna::loadDigits() {   // Load the scoring digits & rwlites
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
-	if (!file.open("digit.avd")) {
-		warning("AVALANCHE: Lucerna: File not found: digit.avd");
-		return;
-	}
+	if (!file.open("digit.avd"))
+		error("AVALANCHE: Lucerna: File not found: digit.avd");
 
 	for (byte i = 0; i < 10; i++) {
 		file.seek(i * digitsize);
@@ -913,25 +900,19 @@ void Lucerna::loadDigits() {   // Load the scoring digits & rwlites
 }
 
 void Lucerna::drawToolbar() {
-	if (!file.open("useful.avd")) {
-		warning("AVALANCHE: Lucerna: File not found: useful.avd");
-		return;
-	}
+	if (!file.open("useful.avd"))
+		error("AVALANCHE: Lucerna: File not found: useful.avd");
 
 	file.seek(40);
 
 	CursorMan.showMouse(false);
-
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
 
 	picture.free();
-
 	file.close();
 
 	CursorMan.showMouse(true);
-
 	_vm->_gyro->_oldDirection = 177;
 	drawDirection();
 }
diff --git a/engines/avalanche/pingo2.cpp b/engines/avalanche/pingo2.cpp
index 3ebb47e..9f99d8c 100644
--- a/engines/avalanche/pingo2.cpp
+++ b/engines/avalanche/pingo2.cpp
@@ -113,10 +113,8 @@ void Pingo::winningPic() {
 	Common::File f;
 	_vm->_lucerna->dusk();
 
-	if (!f.open("finale.avd")) {
-		warning("AVALANCHE: Lucerna: File not found: finale.avd");
-		return;
-	}
+	if (!f.open("finale.avd"))
+		error("AVALANCHE: Lucerna: File not found: finale.avd");
 
 #if 0
 	for (byte bit = 0; bit <= 3; bit++) {
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index ab7d038..4e11451 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -264,10 +264,8 @@ void Scrolls::unDodgem() {
 void Scrolls::getIcon(int16 x, int16 y, byte which) {
 	Common::File file;
 
-	if (!file.open("icons.avd")) {
-		warning("AVALANCHE: Scrolls: File not found: icons.avd");
-		return;
-	}
+	if (!file.open("icons.avd"))
+		error("AVALANCHE: Scrolls: File not found: icons.avd");
 
 	which--;
 	file.seek(which * 426);
@@ -286,10 +284,8 @@ void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File file;
 	Common::String filename = Common::String::format("%s.avd", fn.c_str());
 
-	if (!file.open(filename)) {
-		warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
-		return;
-	}
+	if (!file.open(filename))
+		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 
 #if 0
 	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
@@ -730,14 +726,12 @@ void Scrolls::callScrollDriver() {
 					break;
 				case 10:
 					switch (_vm->_gyro->_dna._boxContent) {
-					case 0: { // Sixpence.
+					case 0: // Sixpence.
 						_vm->_visa->displayScrollChain('q', 37); // You find the sixpence.
 						_vm->_gyro->_dna._money += 6;
 						_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing;
 						_vm->_lucerna->incScore(2);
 						return;
-					}
-					break;
 					case Acci::kNothing:
 						displayText("nothing at all. It's completely empty.");
 						break;
@@ -759,7 +753,7 @@ void Scrolls::callScrollDriver() {
 			case kControlNewLine:
 				_vm->_gyro->_scrollNum++;
 				break;
-			case kControlQuestion: {
+			case kControlQuestion:
 				if (call_spriterun)
 					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
@@ -768,9 +762,7 @@ void Scrolls::callScrollDriver() {
 				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] = kControlQuestion;
 
 				drawScroll(&Avalanche::Scrolls::scrollModeDialogue);
-
 				resetScroll();
-				}
 				break;
 			case kControlRegister:
 				mouthnext = true;
@@ -779,13 +771,13 @@ void Scrolls::callScrollDriver() {
 				for (byte j = 0; j < 9; j++)
 					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
 				break;
-			default: { // Add new char.
+			default: // Add new char.
 				if (_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1].size() == 50) {
 					solidify(_vm->_gyro->_scrollNum - 1);
 					_vm->_gyro->_scrollNum++;
 				}
 				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[i];
-				}
+				break;
 			}
 		}
 	}
@@ -800,26 +792,23 @@ void Scrolls::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A
 void Scrolls::loadFont() {
 	Common::File file;
 
-	if (!file.open("avalot.fnt")) {
-		warning("AVALANCHE: Scrolls: File not found: avalot.fnt");
-		return;
-	}
+	if (!file.open("avalot.fnt"))
+		error("AVALANCHE: Scrolls: File not found: avalot.fnt");
+
 	for (int16 i = 0; i < 256; i++)
 		file.read(_scrollFonts[0][i], 16);
 	file.close();
 
-	if (!file.open("avitalic.fnt")) {
-		warning("AVALANCHE: Scrolls: File not found: avitalic.fnt");
-		return;
-	}
+	if (!file.open("avitalic.fnt"))
+		error("AVALANCHE: Scrolls: File not found: avitalic.fnt");
+
 	for (int16 i = 0; i < 256; i++)
 		file.read(_scrollFonts[1][i], 16);
 	file.close();
 
-	if (!file.open("ttsmall.fnt")) {
-		warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
-		return;
-	}
+	if (!file.open("ttsmall.fnt"))
+		error("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
+
 	for (int16 i = 0; i < 256; i++)
 		file.read(_vm->_gyro->_font[i],16);
 	file.close();
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index dfc99d4..2354fe5 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -61,10 +61,8 @@ void Visa::doTheBubble() {
  */
 void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling) {
 	Common::File indexfile;
-	if (!indexfile.open("avalot.idx")) {
-		warning("AVALANCHE: Visa: File not found: avalot.idx");
-		return;
-	}
+	if (!indexfile.open("avalot.idx"))
+		error("AVALANCHE: Visa: File not found: avalot.idx");
 
 	bool error = false;
 
@@ -91,10 +89,9 @@ void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling
 	}
 
 	Common::File sezfile;
-	if (!sezfile.open("avalot.sez")) {
-		warning("AVALANCHE: Visa: File not found: avalot.sez");
-		return;
-	}
+	if (!sezfile.open("avalot.sez"))
+		error("AVALANCHE: Visa: File not found: avalot.sez");
+
 	sezfile.seek(sez_offset);
 	_vm->_gyro->_bufSize = sezfile.readUint16LE();
 	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
@@ -121,10 +118,8 @@ void Visa::speak(byte who, byte subject) {
 	_noError = false; // Assume that until we know otherwise.
 
 	Common::File indexfile;
-	if (!indexfile.open("converse.avd")) {
-		warning("AVALANCHE: Visa: File not found: converse.avd");
-		return;
-	}
+	if (!indexfile.open("converse.avd"))
+		error("AVALANCHE: Visa: File not found: converse.avd");
 
 	indexfile.seek(who * 2 - 2);
 	uint16 idx_offset = indexfile.readUint16LE();
@@ -140,10 +135,9 @@ void Visa::speak(byte who, byte subject) {
 	indexfile.close();
 
 	Common::File sezfile;
-	if (!sezfile.open("avalot.sez")) {
-		warning("AVALANCHE: Visa: File not found: avalot.sez");
-		return;
-	}
+	if (!sezfile.open("avalot.sez"))
+		error("AVALANCHE: Visa: File not found: avalot.sez");
+
 	sezfile.seek(sez_offset);
 	_vm->_gyro->_bufSize = sezfile.readUint16LE();
 	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);


Commit: 5e59ade554312ac841d620ccb92f38b15419dd9a
    https://github.com/scummvm/scummvm/commit/5e59ade554312ac841d620ccb92f38b15419dd9a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-12T23:31:57-07:00

Commit Message:
AVALANCHE: Fix compilation

Changed paths:
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 2354fe5..931f10f 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -90,7 +90,7 @@ void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling
 
 	Common::File sezfile;
 	if (!sezfile.open("avalot.sez"))
-		error("AVALANCHE: Visa: File not found: avalot.sez");
+		::error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
 	_vm->_gyro->_bufSize = sezfile.readUint16LE();


Commit: 59532fd567ab05bde42768069f9c00de4781dada
    https://github.com/scummvm/scummvm/commit/59532fd567ab05bde42768069f9c00de4781dada
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-13T08:07:26-07:00

Commit Message:
AVALANCHE: Fix crash.

Changed paths:
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 784c83e..82aabe2 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -230,7 +230,7 @@ void Lucerna::loadAlso(byte num) {
 			_vm->_gyro->_also[i][j] = new Common::String;
 			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
 		}
-		tmpStr = Common::String::format("\x9D%s\x9D", *_vm->_gyro->_also[i][0]->c_str());
+		tmpStr = Common::String::format("\x9D%s\x9D", _vm->_gyro->_also[i][0]->c_str());
 		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
 
@@ -285,7 +285,7 @@ void Lucerna::loadAlso(byte num) {
 	file.close();
 	unScramble();
 	for (byte i = 0; i <= alsoNum; i++) {
-		tmpStr = Common::String::format(",%s,", *_vm->_gyro->_also[i][0]->c_str());
+		tmpStr = Common::String::format(",%s,", _vm->_gyro->_also[i][0]->c_str());
 		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
 }


Commit: 44ff5eeafb14b85f89d9d2d234af7a19a20d997b
    https://github.com/scummvm/scummvm/commit/44ff5eeafb14b85f89d9d2d234af7a19a20d997b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-13T08:27:24-07:00

Commit Message:
AVALANCHE: Remove unnecessary error() call.

Changed paths:
    engines/avalanche/celer2.cpp



diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index acbe5e9..10c2efc 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -268,7 +268,7 @@ void Celer::loadBackgroundSprites(byte number) {
 	Common::File f;
 	_filename = _filename.format("chunk%d.avd", number);
 	if (!f.open(_filename))
-		error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
+		return; // We skip because some rooms don't have sprites in the background.
 
 	f.seek(44);
 	_spriteNum = f.readByte();


Commit: 82e76e7b5391ae87dc44d7986b2dfd40c53c3fc8
    https://github.com/scummvm/scummvm/commit/82e76e7b5391ae87dc44d7986b2dfd40c53c3fc8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-13T12:30:03-07:00

Commit Message:
AVALANCHE: Remove DNA structure which was essentially a savegame structure unused in ScummVM

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/enid2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/sequence2.cpp
    engines/avalanche/timer.cpp
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 1b6446c..747bcca 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -249,7 +249,7 @@ Common::String Acci::rank() {
 	};
 
 	for (byte i = 0; i < 8; i++) {
-		if ((_vm->_gyro->_dna._score >= kRanks[i]._score) && (_vm->_gyro->_dna._score < kRanks[i + 1]._score)) {
+		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
 		}
 	}
@@ -261,7 +261,7 @@ Common::String Acci::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = floor(_vm->_gyro->_dna._totalTime / ticksInOneSec); // No. of seconds.
+	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;
@@ -384,32 +384,32 @@ void Acci::storeInterrogation(byte interrogation) {
 	case 1:
 		_vm->_parser->_inputText.toLowercase();
 		sayIt();
-		_vm->_gyro->_dna._favouriteDrink = _vm->_parser->_inputText;
-		_vm->_gyro->_dna._cardiffQuestionNum = 2;
+		_vm->_gyro->_favouriteDrink = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 2;
 		break;
 	case 2:
 		properNouns();
 		sayIt();
-		_vm->_gyro->_dna._favouriteSong = _vm->_parser->_inputText;
-		_vm->_gyro->_dna._cardiffQuestionNum = 3;
+		_vm->_gyro->_favouriteSong = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 3;
 		break;
 	case 3:
 		properNouns();
 		sayIt();
-		_vm->_gyro->_dna._worstPlaceOnEarth = _vm->_parser->_inputText;
-		_vm->_gyro->_dna._cardiffQuestionNum = 4;
+		_vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 4;
 		break;
 	case 4:
 		_vm->_parser->_inputText.toLowercase();
 		sayIt();
-		if (!_vm->_gyro->_dna._spareEvening.empty())
-			_vm->_gyro->_dna._spareEvening.clear();
-		_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText;
+		if (!_vm->_gyro->_spareEvening.empty())
+			_vm->_gyro->_spareEvening.clear();
+		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
 		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
-		_vm->_gyro->_dna._cardiffQuestionNum = 5;
+		_vm->_gyro->_cardiffQuestionNum = 5;
 		break;
 	case 99:
 		//store_high(_vm->_parser->_inputText);
@@ -531,12 +531,12 @@ void Acci::parse() {
 	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
-	if (_vm->_gyro->_dna._room == r__nottspub)
+	if (_vm->_gyro->_room == r__nottspub)
 		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
 		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__aylesoffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;
@@ -625,7 +625,7 @@ void Acci::examineObject() {
 		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
 	switch (_thing) {
 	case Gyro::kObjectWine :
-		switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine.
+		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
@@ -638,7 +638,7 @@ void Acci::examineObject() {
 		}
 		break;
 	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_dna._rottenOnion)
+		if (_vm->_gyro->_rottenOnion)
 			_vm->_visa->displayScrollChain('q', 21); // Yucky onion.
 		else
 			_vm->_visa->displayScrollChain('t', 18);  // Normal onion scroll
@@ -649,7 +649,7 @@ void Acci::examineObject() {
 }
 
 bool Acci::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_dna._room))
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
 		return true;
 	else {
 		Common::String tmpStr;
@@ -669,13 +669,13 @@ void Acci::exampers() {
 		_person -= 149;
 		switch (_person) { // Special cases
 		case 11:
-			if (_vm->_gyro->_dna._wonNim) {
+			if (_vm->_gyro->_wonNim) {
 				_vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!"
 				return;
 			}
 			break;
 		case 99:
-			if (_vm->_gyro->_dna._lustieIsAsleep) {
+			if (_vm->_gyro->_lustieIsAsleep) {
 				_vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
 				return;
 			}
@@ -686,7 +686,7 @@ void Acci::exampers() {
 	}
 
 	// And afterwards...
-	if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake))
+	if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
 		_vm->_visa->displayScrollChain('Q', 13);
 }
 
@@ -702,7 +702,7 @@ bool Acci::isHolding() {
 
 	if (_thing > 100)
 		_vm->_scrolls->displayText("Be reasonable!");
-	else if (!_vm->_gyro->_dna._objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_scrolls->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
@@ -711,7 +711,7 @@ bool Acci::isHolding() {
 }
 
 void Acci::openBox(bool isOpening) {
-	if ((_vm->_gyro->_dna._room == r__yours) && (_thing == 54)) {
+	if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		_vm->_celer->updateBackgroundSprites();
@@ -753,22 +753,22 @@ void Acci::inventory() {
 	Common::String tmpStr = Common::String("You're carrying ");
 
 	for (byte i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_dna._objects[i]) {
+		if (_vm->_gyro->_objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_gyro->_dna._carryNum)
+			if (itemNum == _vm->_gyro->_carryNum)
 				tmpStr += "and ";
 
 			tmpStr += _vm->_gyro->getItem(i + 1);
 
-			if ((i + 1) == _vm->_gyro->_dna._wearing)
+			if ((i + 1) == _vm->_gyro->_wearing)
 				tmpStr += ", which you're wearing";
 
-			if (itemNum < _vm->_gyro->_dna._carryNum)
+			if (itemNum < _vm->_gyro->_carryNum)
 				tmpStr += ", ";
 		}
 	}
 
-	if (_vm->_gyro->_dna._wearing == kNothing)
+	if (_vm->_gyro->_wearing == kNothing)
 		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
 	else
 		tmpStr += '.';
@@ -779,16 +779,16 @@ void Acci::inventory() {
 void Acci::swallow() {   // Eat something.
 	switch (_thing) {
 	case Gyro::kObjectWine:
-		switch (_vm->_gyro->_dna._wineState) { // 4 is perfect
+		switch (_vm->_gyro->_wineState) { // 4 is perfect
 		case 1:
-			if (_vm->_gyro->_dna._teetotal)  {
+			if (_vm->_gyro->_teetotal)  {
 				_vm->_visa->displayScrollChain('D', 6);
 				return;
 			}
 			_vm->_visa->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_visa->displayScrollChain('U', 2);
-			_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
+			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
@@ -815,16 +815,16 @@ void Acci::swallow() {   // Eat something.
 		_vm->_lucerna->gameOver();
 		break;
 	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_dna._rottenOnion)
+		if (_vm->_gyro->_rottenOnion)
 			_vm->_visa->displayScrollChain('U', 11);
 		else {
 			_vm->_visa->displayScrollChain('U', 8);
-			_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false;
+			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 		}
 		break;
 	default:
-		if ((_vm->_gyro->_dna._room == r__argentpub) || (_vm->_gyro->_dna._room == r__nottspub))
+		if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub))
 			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
 		else
 			_vm->_scrolls->displayText("The taste of it makes you retch!");
@@ -835,7 +835,7 @@ void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
 	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room)
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
 			numPeople++;
 	}
 
@@ -845,7 +845,7 @@ void Acci::peopleInRoom() {
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
 	for (byte i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) {
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
 				tmpStr = _vm->_gyro->getName(i + 150);
@@ -866,29 +866,29 @@ void Acci::peopleInRoom() {
 
 void Acci::lookAround() {
 	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__spludwicks:
-		if (_vm->_gyro->_dna._avariciusTalk > 0)
+		if (_vm->_gyro->_avariciusTalk > 0)
 			_vm->_visa->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case r__robins:
-		if (_vm->_gyro->_dna._tiedUp)
+		if (_vm->_gyro->_tiedUp)
 			_vm->_visa->displayScrollChain('q', 38);
-		if (_vm->_gyro->_dna._mushroomGrowing)
+		if (_vm->_gyro->_mushroomGrowing)
 			_vm->_visa->displayScrollChain('q', 55);
 		break;
 	case r__insidecardiffcastle:
-		if (!_vm->_gyro->_dna._takenPen)
+		if (!_vm->_gyro->_takenPen)
 			_vm->_visa->displayScrollChain('q', 49);
 		break;
 	case r__lustiesroom:
-		if (_vm->_gyro->_dna._lustieIsAsleep)
+		if (_vm->_gyro->_lustieIsAsleep)
 			_vm->_visa->displayScrollChain('q', 65);
 		break;
 	case r__catacombs:
-		switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) {
+		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
 		case 258 :
 			_vm->_visa->displayScrollChain('q', 80); // Inside art gallery.
 			break;
@@ -907,7 +907,7 @@ void Acci::lookAround() {
 
 void Acci::openDoor() {
 	// Special cases.
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__yours:
 		if (_vm->_animation->inField(2)) {
 			// Opening the box.
@@ -925,7 +925,7 @@ void Acci::openDoor() {
 		break;
 	}
 
-	if ((!_vm->_gyro->_dna._userMovesAvvy) && (_vm->_gyro->_dna._room != r__lusties))
+	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties))
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte fv = 8; fv < 15; fv++) {
@@ -958,7 +958,7 @@ void Acci::openDoor() {
 		}
 	}
 
-	if (_vm->_gyro->_dna._room == r__map)
+	if (_vm->_gyro->_room == r__map)
 		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
@@ -986,14 +986,14 @@ void Acci::putProc() {
 	switch (_thing2) {
 	case Gyro::kObjectWine:
 		if (_thing == Gyro::kObjectOnion) {
-			if (_vm->_gyro->_dna._rottenOnion)
+			if (_vm->_gyro->_rottenOnion)
 				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
-				if (_vm->_gyro->_dna._wineState != 3) {
+				if (_vm->_gyro->_wineState != 3) {
 					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman);
 					_vm->_scrolls->displayText(tmpStr);
 				} else { // Put onion into vinegar! Yes!
-					_vm->_gyro->_dna._onionInVinegar = true;
+					_vm->_gyro->_onionInVinegar = true;
 					_vm->_lucerna->incScore(7);
 					_vm->_visa->displayScrollChain('u', 9);
 				}
@@ -1003,8 +1003,8 @@ void Acci::putProc() {
 		break;
 
 	case 54:
-		if (_vm->_gyro->_dna._room == r__yours) { // Put something into the box.
-			if (_vm->_gyro->_dna._boxContent != kNothing)
+		if (_vm->_gyro->_room == r__yours) { // Put something into the box.
+			if (_vm->_gyro->_boxContent != kNothing)
 				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
@@ -1021,14 +1021,14 @@ void Acci::putProc() {
 					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_gyro->_dna._wearing == _thing) {
+					if (_vm->_gyro->_wearing == _thing) {
 						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
 						_vm->_scrolls->displayText(tmpStr);
 					} else {
 						openBox(true); // Open box.
 
-						_vm->_gyro->_dna._boxContent = _thing;
-						_vm->_gyro->_dna._objects[_thing - 1] = false;
+						_vm->_gyro->_boxContent = _thing;
+						_vm->_gyro->_objects[_thing - 1] = false;
 						_vm->_lucerna->refreshObjectList();
 						_vm->_scrolls->displayText("OK, it's in the box.");
 
@@ -1050,7 +1050,7 @@ void Acci::putProc() {
  * @remarks	Originally called 'not_in_order'
  */
 void Acci::notInOrder() {
-	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]);
+	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
 		"What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 	_vm->_scrolls->displayText(tmpStr);
@@ -1071,18 +1071,18 @@ void Acci::goToCauldron() {
  * @remarks	Originally called 'give2spludwick'
  */
 bool Acci::giveToSpludwick() {
-	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) {
+	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
 		notInOrder();
 		return false;
 	}
 
 	switch (_thing) {
 	case Gyro::kObjectOnion:
-		_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false;
-		if (_vm->_gyro->_dna._rottenOnion)
+		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
+		if (_vm->_gyro->_rottenOnion)
 			_vm->_visa->displayScrollChain('q', 22);
 		else {
-			_vm->_gyro->_dna._givenToSpludwick++;
+			_vm->_gyro->_givenToSpludwick++;
 			_vm->_visa->displayScrollChain('q', 20);
 			goToCauldron();
 			_vm->_lucerna->incScore(3);
@@ -1090,20 +1090,20 @@ bool Acci::giveToSpludwick() {
 		_vm->_lucerna->refreshObjectList();
 		break;
 	case Gyro::kObjectInk:
-		_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = false;
+		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
 		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_dna._givenToSpludwick++;
+		_vm->_gyro->_givenToSpludwick++;
 		_vm->_visa->displayScrollChain('q', 24);
 		goToCauldron();
 		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
-		_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = false;
+		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
 		_vm->_visa->displayScrollChain('q', 25);
 		_vm->_lucerna->incScore(5);
-		_vm->_gyro->_dna._givenToSpludwick++;
+		_vm->_gyro->_givenToSpludwick++;
 		goToCauldron();
-		_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true;
+		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		break;
 	default:
@@ -1114,12 +1114,12 @@ bool Acci::giveToSpludwick() {
 }
 
 void Acci::drink() {
-	_vm->_gyro->_dna._alcoholLevel += 1;
-	if (_vm->_gyro->_dna._alcoholLevel == 5) {
-		_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1] = true; // Get the key.
-		_vm->_gyro->_dna._teetotal = true;
-		_vm->_gyro->_dna._avvyIsAwake = false;
-		_vm->_gyro->_dna._avvyInBed = true;
+	_vm->_gyro->_alcoholLevel += 1;
+	if (_vm->_gyro->_alcoholLevel == 5) {
+		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
+		_vm->_gyro->_teetotal = true;
+		_vm->_gyro->_avvyIsAwake = false;
+		_vm->_gyro->_avvyInBed = true;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_lucerna->dusk();
 		_vm->_gyro->hangAroundForAWhile();
@@ -1130,14 +1130,14 @@ void Acci::drink() {
 }
 
 void Acci::cardiffClimbing() {
-	if (_vm->_gyro->_dna._standingOnDais) { // Clamber up.
+	if (_vm->_gyro->_standingOnDais) { // Clamber up.
 		_vm->_scrolls->displayText("You climb down, back onto the floor.");
-		_vm->_gyro->_dna._standingOnDais = false;
+		_vm->_gyro->_standingOnDais = false;
 		_vm->_animation->appearPed(1, 3);
 	} else { // Clamber down.
 		if (_vm->_animation->inField(1)) {
 			_vm->_scrolls->displayText("You clamber up onto the dais.");
-			_vm->_gyro->_dna._standingOnDais = true;
+			_vm->_gyro->_standingOnDais = true;
 			_vm->_animation->appearPed(1, 2);
 		} else
 			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
@@ -1149,21 +1149,21 @@ void Acci::already() {
 }
 
 void Acci::standUp() {
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__yours: // Avvy isn't asleep.
-		if (_vm->_gyro->_dna._avvyIsAwake && _vm->_gyro->_dna._avvyInBed) {  // But he's in bed.
-			if (_vm->_gyro->_dna._teetotal) {
+		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
+			if (_vm->_gyro->_teetotal) {
 				_vm->_visa->displayScrollChain('d', 12);
 				_vm->_gyro->setBackgroundColor(0);
 				_vm->_visa->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
-			_vm->_gyro->_dna._userMovesAvvy = true;
+			_vm->_gyro->_userMovesAvvy = true;
 			_vm->_animation->appearPed(1, 2);
-			_vm->_gyro->_dna._direction = Gyro::kDirectionLeft;
+			_vm->_gyro->_direction = Gyro::kDirectionLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
-			_vm->_gyro->_dna._avvyInBed = false;
+			_vm->_gyro->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
 		} else
 			already();
@@ -1174,12 +1174,12 @@ void Acci::standUp() {
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro->_dna._sittingInPub)  {
+		if (_vm->_gyro->_sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(1, 4); // And walking away.
-			_vm->_gyro->_dna._sittingInPub = false; // Really not sitting down.
-			_vm->_gyro->_dna._userMovesAvvy = true; // And ambulant.
+			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
+			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
 		} else
 			already();
 		break;
@@ -1189,15 +1189,15 @@ void Acci::standUp() {
 }
 
 void Acci::getProc(char thing) {
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__yours:
 		if (_vm->_animation->inField(2)) {
-			if (_vm->_gyro->_dna._boxContent == thing) {
+			if (_vm->_gyro->_boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->displayText("OK, I've got it.");
-				_vm->_gyro->_dna._objects[thing - 1] = true;
+				_vm->_gyro->_objects[thing - 1] = true;
 				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_dna._boxContent = kNothing;
+				_vm->_gyro->_boxContent = kNothing;
 				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			} else {
 				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
@@ -1210,18 +1210,18 @@ void Acci::getProc(char thing) {
 		switch (thing) {
 		case Gyro::kObjectPen:
 			if (_vm->_animation->inField(2)) { // Standing on the dais.
-				if (_vm->_gyro->_dna._takenPen)
+				if (_vm->_gyro->_takenPen)
 					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
-					_vm->_gyro->_dna._takenPen = true;
-					_vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = true;
+					_vm->_gyro->_takenPen = true;
+					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
 					_vm->_scrolls->displayText("Taken.");
 				}
-			} else if (_vm->_gyro->_dna._standingOnDais)
+			} else if (_vm->_gyro->_standingOnDais)
 				_vm->_visa->displayScrollChain('q', 53);
 			else
 				_vm->_visa->displayScrollChain('q', 51);
@@ -1234,12 +1234,12 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case r__robins:
-		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_dna._mushroomGrowing)) {
+		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->displayText("Got it!");
-			_vm->_gyro->_dna._mushroomGrowing = false;
-			_vm->_gyro->_dna._takenMushroom = true;
-			_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = true;
+			_vm->_gyro->_mushroomGrowing = false;
+			_vm->_gyro->_takenMushroom = true;
+			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
 			_vm->_lucerna->refreshObjectList();
 			_vm->_lucerna->incScore(3);
 		} else
@@ -1255,12 +1255,12 @@ void Acci::getProc(char thing) {
  * @remarks	Originally called 'give_Geida_the_lute'
  */
 void Acci::giveGeidaTheLute() {
-	if (_vm->_gyro->_dna._room != r__lustiesroom) {
+	if (_vm->_gyro->_room != r__lustiesroom) {
 		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 		_vm->_scrolls->displayText(tmpStr);
 		return;
 	}
-	_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = false;
+	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
 	_vm->_lucerna->refreshObjectList();
 	_vm->_visa->displayScrollChain('q', 64); // She plays it.
 
@@ -1286,13 +1286,13 @@ void Acci::winSequence() {
 
 Common::String Acci::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_dna._room))
+		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
 			_person = _vm->_gyro->_her;
 		else
 			_person = _vm->_gyro->_him;
 	}
 
-	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) {
+	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
 		return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
 	}
 
@@ -1310,7 +1310,7 @@ Common::String Acci::personSpeaks() {
 		return tmpStr;
 
 	for (byte i = 0; i < 16; i++) {
-		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room))
+		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
 			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
 	}
 
@@ -1320,7 +1320,7 @@ void Acci::heyThanks() {
 	Common::String tmpStr = personSpeaks();
 	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
 	_vm->_scrolls->displayText(tmpStr);
-	_vm->_gyro->_dna._objects[_thing - 1] = false;
+	_vm->_gyro->_objects[_thing - 1] = false;
 }
 
 /**
@@ -1350,7 +1350,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
 			return;
 		}
-		if (!_vm->_gyro->_dna._avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
 			_vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
 			return;
 		}
@@ -1370,7 +1370,7 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
+			if (_vm->_gyro->_carryNum >= kCarryLimit)
 				_vm->_scrolls->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
@@ -1433,7 +1433,7 @@ void Acci::doThat() {
 					case Gyro::kPeopleCrapulus:
 						if (_thing == Gyro::kObjectWine) {
 							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
+							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
@@ -1451,21 +1451,21 @@ void Acci::doThat() {
 						if (_thing == Gyro::kObjectBadge) {
 							_vm->_visa->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_lucerna->incScore(3);
-							_vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = false;
-							_vm->_gyro->_dna._objects[Gyro::kObjectHabit - 1] = true;
-							_vm->_gyro->_dna._givenBadgeToIby = true;
+							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
+							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
+							_vm->_gyro->_givenBadgeToIby = true;
 							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 						} else
 							heyThanks();
 						break;
 					case Gyro::kPeopleAyles:
-						if (_vm->_gyro->_dna._aylesIsAwake) {
+						if (_vm->_gyro->_aylesIsAwake) {
 							if (_thing == Gyro::kObjectPen) {
-								_vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = false;
+								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
 								_vm->_visa->displayScrollChain('q', 54);
-								_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = true;
-								_vm->_gyro->_dna._givenPenToAyles = true;
+								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
+								_vm->_gyro->_givenPenToAyles = true;
 								_vm->_lucerna->refreshObjectList();
 								_vm->_lucerna->incScore(2);
 							} else
@@ -1476,10 +1476,10 @@ void Acci::doThat() {
 					case Gyro::kPeopleGeida:
 						switch (_thing) {
 						case Gyro::kObjectPotion:
-							_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = false;
+							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
 							_vm->_visa->displayScrollChain('u', 16); // She drinks it.
 							_vm->_lucerna->incScore(2);
-							_vm->_gyro->_dna._givenPotionToGeida = true;
+							_vm->_gyro->_givenPotionToGeida = true;
 							_vm->_lucerna->refreshObjectList();
 							break;
 						case Gyro::kObjectLute:
@@ -1492,7 +1492,7 @@ void Acci::doThat() {
 					case Gyro::kPeopleArkata:
 						switch (_thing) {
 						case Gyro::kObjectPotion:
-							if (_vm->_gyro->_dna._givenPotionToGeida)
+							if (_vm->_gyro->_givenPotionToGeida)
 								winSequence();
 							else
 								_vm->_visa->displayScrollChain('q', 77); // That Geida woman!
@@ -1562,12 +1562,12 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeUndress:
-		if (_vm->_gyro->_dna._wearing == kNothing)
+		if (_vm->_gyro->_wearing == kNothing)
 			_vm->_scrolls->displayText("You're already stark naked!");
-		else if (_vm->_gyro->_dna._avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_dna._wearing).c_str());
+		else if (_vm->_gyro->_avvysInTheCupboard) {
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
 			_vm->_scrolls->displayText(tmpStr);
-			_vm->_gyro->_dna._wearing = kNothing;
+			_vm->_gyro->_wearing = kNothing;
 			_vm->_lucerna->refreshObjectList();
 		} else
 			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
@@ -1581,14 +1581,14 @@ void Acci::doThat() {
 				break;
 			case Gyro::kObjectClothes:
 			case Gyro::kObjectHabit: { // Change this!
-					if (_vm->_gyro->_dna._wearing != kNothing) {
-						if (_vm->_gyro->_dna._wearing == _thing)
+					if (_vm->_gyro->_wearing != kNothing) {
+						if (_vm->_gyro->_wearing == _thing)
 							_vm->_scrolls->displayText("You're already wearing that.");
 						else
 							_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
 						return;
 					} else
-						_vm->_gyro->_dna._wearing = _thing;
+						_vm->_gyro->_wearing = _thing;
 
 					_vm->_lucerna->refreshObjectList();
 
@@ -1614,35 +1614,35 @@ void Acci::doThat() {
 		break;
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
-			switch (_vm->_gyro->_dna._room) { // They just typed "play"...
+			switch (_vm->_gyro->_room) { // They just typed "play"...
 			case r__argentpub: { // ...in the pub, => play Nim.
 					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 					// play_nim();
 					// The following parts are copied from play_nim().
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
-					if (_vm->_gyro->_dna._wonNim) { // Already won the game.
+					if (_vm->_gyro->_wonNim) { // Already won the game.
 						_vm->_visa->displayScrollChain('Q', 6);
 						return;
 					}
 
-					if (!_vm->_gyro->_dna._askedDogfoodAboutNim) {
+					if (!_vm->_gyro->_askedDogfoodAboutNim) {
 						_vm->_visa->displayScrollChain('q', 84);
 						return;
 					}
 
 					_vm->_visa->displayScrollChain('Q', 3);
-					_vm->_gyro->_dna._playedNim++;
+					_vm->_gyro->_playedNim++;
 
 					// You won - strange!
 					_vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute!
-					_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = true;
+					_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
 					_vm->_lucerna->refreshObjectList();
-					_vm->_gyro->_dna._wonNim = true;
+					_vm->_gyro->_wonNim = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
 					_vm->_lucerna->incScore(7); // 7 points for winning!
 
-					if (_vm->_gyro->_dna._playedNim == 1)
+					if (_vm->_gyro->_playedNim == 1)
 						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
 
 					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
@@ -1659,20 +1659,20 @@ void Acci::doThat() {
 			case Gyro::kObjectLute :
 					_vm->_visa->displayScrollChain('U', 7);
 
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_dna._room)
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
 						_vm->_visa->displayScrollChain('U', 10);
 
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_dna._room)
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
 						_vm->_visa->displayScrollChain('U', 15);
 				break;
 			case 52:
-				if (_vm->_gyro->_dna._room == r__musicroom)
+				if (_vm->_gyro->_room == r__musicroom)
 					playHarp();
 				else
 					_vm->_scrolls->displayText(kWhat);
 				break;
 			case 55:
-				if (_vm->_gyro->_dna._room == r__argentpub)
+				if (_vm->_gyro->_room == r__argentpub)
 					// play_nim();
 					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 				else
@@ -1687,7 +1687,7 @@ void Acci::doThat() {
 		if (isHolding()) {
 			if (_thing == Gyro::kObjectBell) {
 				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
 					_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
@@ -1724,10 +1724,10 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeMagic:
-		if (_vm->_gyro->_dna._avariciusTalk > 0)
+		if (_vm->_gyro->_avariciusTalk > 0)
 			_vm->_visa->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
 				_vm->_visa->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->displayScrollChain('q', 18);
@@ -1737,7 +1737,7 @@ void Acci::doThat() {
 					_vm->_animation->_sprites[1].walkTo(5);
 					_vm->_animation->_sprites[1]._callEachStepFl = true;
 					_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth;
-					_vm->_gyro->_dna._avariciusTalk = 14;
+					_vm->_gyro->_avariciusTalk = 14;
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
 			} else
@@ -1748,7 +1748,7 @@ void Acci::doThat() {
 		_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
-		switch (_vm->_gyro->_dna._sworeNum) {
+		switch (_vm->_gyro->_sworeNum) {
 		case 0: {
 			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
 				"(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
@@ -1769,10 +1769,10 @@ void Acci::doThat() {
 			_vm->_lucerna->gameOver();
 			}
 		}
-		_vm->_gyro->_dna._sworeNum++;
+		_vm->_gyro->_sworeNum++;
 		break;
 	case kVerbCodeListen:
-		if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 			_vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
 		else if (_vm->_gyro->_listen.empty())
 			_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy.");
@@ -1780,7 +1780,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayText(_vm->_gyro->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_gyro->_dna._room) {
+		switch (_vm->_gyro->_room) {
 		case r__argentpub:
 			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
 				switch (_thing) {
@@ -1788,40 +1788,40 @@ void Acci::doThat() {
 				case 53:
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
+					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
 						_vm->_visa->displayScrollChain('D', 15);
 						return;
 					}
 
-					if (_vm->_gyro->_dna._teetotal)  {
+					if (_vm->_gyro->_teetotal)  {
 						_vm->_visa->displayScrollChain('D', 6);
 						return;
 					}
 
-					if (_vm->_gyro->_dna._alcoholLevel == 0)
+					if (_vm->_gyro->_alcoholLevel == 0)
 						_vm->_lucerna->incScore(3);
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
-					_vm->_gyro->_dna._drinking = _thing;
+					_vm->_gyro->_drinking = _thing;
 
 					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-					_vm->_gyro->_dna._malagauche = 177;
+					_vm->_gyro->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
 				case Gyro::kObjectWine:
-					if (_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1])  // We've already got the wine!
+					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
 						_vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
-						if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one.
+						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
 							_vm->_visa->displayScrollChain('D', 15);
 							return;
 						}
 
-						if (_vm->_gyro->_dna._carryNum >= kCarryLimit) {
+						if (_vm->_gyro->_carryNum >= kCarryLimit) {
 							_vm->_scrolls->displayText("Your hands are full.");
 							return;
 						}
@@ -1829,10 +1829,10 @@ void Acci::doThat() {
 						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 						_vm->_scrolls->displayText(tmpStr);
-						if (_vm->_gyro->_dna._alcoholLevel == 0)
+						if (_vm->_gyro->_alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
 						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-						_vm->_gyro->_dna._malagauche = 177;
+						_vm->_gyro->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
 					}
@@ -1845,23 +1845,23 @@ void Acci::doThat() {
 		case r__outsideducks:
 			if (_vm->_animation->inField(6)) {
 				if (_thing == Gyro::kObjectOnion) {
-					if (_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1])
+					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
 						_vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
+					else if (_vm->_gyro->_carryNum >= kCarryLimit)
 						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
 					else {
-						if (_vm->_gyro->_dna._boughtOnion)
+						if (_vm->_gyro->_boughtOnion)
 							_vm->_visa->displayScrollChain('D', 11);
 						else {
 							_vm->_visa->displayScrollChain('D', 9);
 							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
-						_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = true;
+						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
 						_vm->_lucerna->refreshObjectList();
-						_vm->_gyro->_dna._boughtOnion = true;
-						_vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall!
-						_vm->_gyro->_dna._onionInVinegar = false;
+						_vm->_gyro->_boughtOnion = true;
+						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_gyro->_onionInVinegar = false;
 					}
 				} else
 					_vm->_visa->displayScrollChain('D', 0);
@@ -1877,10 +1877,10 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeAttack:
-		if ((_vm->_gyro->_dna._room == r__brummieroad) &&
+		if ((_vm->_gyro->_room == r__brummieroad) &&
 				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_dna._room)) {
-			switch (_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] * 2) {
+				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
+			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_visa->displayScrollChain('Q', 10);
@@ -1894,9 +1894,9 @@ void Acci::doThat() {
 				break;
 			case 3:
 				_vm->_visa->displayScrollChain('Q', 11);
-				_vm->_gyro->_dna._cwytalotGone = true;
-				_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = false;
-				_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = false;
+				_vm->_gyro->_cwytalotGone = true;
+				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
+				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
 				_vm->_lucerna->incScore(7);
@@ -1912,14 +1912,14 @@ void Acci::doThat() {
 			_vm->_visa->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
-		if (_vm->_gyro->_dna._room != r__bridge)
+		if (_vm->_gyro->_room != r__bridge)
 			_vm->_visa->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (byte i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				int pwdId = _vm->_gyro->_dna._passwordNum + kFirstPassword;
+				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
 				for (byte j = 0; j < kVocabulary[pwdId]._word.size(); j++) {
 					if (kVocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
@@ -1927,13 +1927,13 @@ void Acci::doThat() {
 			}
 
 			if (ok) {
-				if (_vm->_gyro->_dna._drawbridgeOpen != 0)
+				if (_vm->_gyro->_drawbridgeOpen != 0)
 					_vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
 					_vm->_lucerna->incScore(4);
 					_vm->_scrolls->displayText("The drawbridge opens!");
 					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
-					_vm->_gyro->_dna._drawbridgeOpen = 1;
+					_vm->_gyro->_drawbridgeOpen = 1;
 				}
 			} else
 				_vm->_visa->displayScrollChain('Q', 12);
@@ -1946,7 +1946,7 @@ void Acci::doThat() {
 		_vm->_lucerna->gameOver();
 		break;
 	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dna._score, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
 		_vm->_scrolls->displayText(tmpStr);
 		}
 		break;
@@ -1978,14 +1978,14 @@ void Acci::doThat() {
 
 		break;
 	case kVerbCodeClimb:
-		if (_vm->_gyro->_dna._room == r__insidecardiffcastle)
+		if (_vm->_gyro->_room == r__insidecardiffcastle)
 			cardiffClimbing();
 		else // In the wrong room!
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
 		//	show_highs();
@@ -1997,18 +1997,18 @@ void Acci::doThat() {
 			case kPardon:
 			case Gyro::kPeopleAvalot:
 			case 0:
-				if (!_vm->_gyro->_dna._avvyIsAwake) {
-					_vm->_gyro->_dna._avvyIsAwake = true;
+				if (!_vm->_gyro->_avvyIsAwake) {
+					_vm->_gyro->_avvyIsAwake = true;
 					_vm->_lucerna->incScore(1);
-					_vm->_gyro->_dna._avvyInBed = true;
+					_vm->_gyro->_avvyInBed = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
-					if (_vm->_gyro->_dna._teetotal)
+					if (_vm->_gyro->_teetotal)
 						_vm->_visa->displayScrollChain('d', 13);
 				} else
 					_vm->_scrolls->displayText("You're already awake, Avvy!");
 				break;
 			case Gyro::kPeopleAyles:
-				if (!_vm->_gyro->_dna._aylesIsAwake)
+				if (!_vm->_gyro->_aylesIsAwake)
 					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
 				break;
 			case Gyro::kPeopleJacques: {
@@ -2022,8 +2022,8 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeSit:
-		if (_vm->_gyro->_dna._room == r__nottspub) {
-			if (_vm->_gyro->_dna._sittingInPub)
+		if (_vm->_gyro->_room == r__nottspub) {
+			if (_vm->_gyro->_sittingInPub)
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
 				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5735325..bdca9fd 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -436,8 +436,8 @@ void Animation::catacombMove(byte ped) {
 
 
 
-	xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256;
-	_vm->_gyro->_dna._geidaSpin = 0;
+	xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256;
+	_vm->_gyro->_geidaSpin = 0;
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
@@ -456,15 +456,15 @@ void Animation::catacombMove(byte ped) {
 	case 2307:
 		flipRoom(r__lusties, 5);
 		_vm->_scrolls->displayText("Oh no... here we go again...");
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
 		_sprites[0]._moveX = 0;
 		return;
 	}
 
-	if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom)
+	if (!_vm->_gyro->_enterCatacombsFromLustiesRoom)
 		_vm->_lucerna->loadRoom(29);
-	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1];
+	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
@@ -595,7 +595,7 @@ void Animation::catacombMove(byte ped) {
 	case 0x1:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 
-		if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows))
+		if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows))
 			_vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
 		else
 			_vm->_gyro->_magics[12]._operation = Gyro::kMagicSpecial; // Right exit south.
@@ -726,7 +726,7 @@ void Animation::catacombMove(byte ped) {
 		break; // [1,1] : the other two.
 	}
 
-	if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) {
+	if ((_vm->_gyro->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
 		appearPed(2, geidaPed(ped));
@@ -746,27 +746,27 @@ void Animation::callSpecial(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-		_vm->_gyro->_dna._brummieStairs = 1;
+		_vm->_gyro->_brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
 		stopWalking();
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		break;
 	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
-		_vm->_gyro->_dna._brummieStairs = 3;
+		_vm->_gyro->_brummieStairs = 3;
 		_vm->_gyro->_magics[10]._operation = Gyro::kMagicNothing;
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim;
 		_vm->_gyro->_magics[11]._data = 5;
 		_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
 		stopWalking();
 		_vm->_visa->displayScrollChain('q', 26);
-		_vm->_gyro->_dna._userMovesAvvy = true;
+		_vm->_gyro->_userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
 		_sprites[0].bounce(); // Must include that.
 
-		if (!_vm->_gyro->_dna._arrowTriggered) {
-			_vm->_gyro->_dna._arrowTriggered = true;
+		if (!_vm->_gyro->_arrowTriggered) {
+			_vm->_gyro->_arrowTriggered = true;
 			appearPed(2, 4); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(5); // flies to ped 5.
 			_sprites[1]._facingDir = kDirUp; // Only face.
@@ -786,7 +786,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_enid->backToBootstrap(3);
 		break;
 	case 5:
-		if (_vm->_gyro->_dna._friarWillTieYouUp) {
+		if (_vm->_gyro->_friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
 			_vm->_visa->displayScrollChain('q', 35);
@@ -794,8 +794,8 @@ void Animation::callSpecial(uint16 which) {
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_visa->displayScrollChain('q', 36);
-			_vm->_gyro->_dna._tiedUp = true;
-			_vm->_gyro->_dna._friarWillTieYouUp = false;
+			_vm->_gyro->_tiedUp = true;
+			_vm->_gyro->_friarWillTieYouUp = false;
 			_sprites[1].walkTo(3);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
@@ -804,7 +804,7 @@ void Animation::callSpecial(uint16 which) {
 		}
 		break;
 	case 6: // _vm->_gyro->special 6: fall down oubliette.
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		_sprites[0]._moveX = 3;
 		_sprites[0]._moveY = 0;
 		_sprites[0]._facingDir = kDirRight;
@@ -821,7 +821,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
-		if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
+		if ((_vm->_gyro->_geidaFollows) && (!_vm->_gyro->_lustieIsAsleep)) {
 			_vm->_visa->displayScrollChain('q', 63);
 			_sprites[1].turn(kDirDown);
 			_sprites[1].stopWalk();
@@ -830,18 +830,18 @@ void Animation::callSpecial(uint16 which) {
 		}
 		break;
 	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
-		if (!_vm->_gyro->_dna._geidaFollows)
+		if (!_vm->_gyro->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
 		_sprites[1].walkTo(4); // She walks to somewhere...
 		_sprites[0].remove();     // Lose Avvy.
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
 		break;
 	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
-		if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
+		if ((_vm->_gyro->_catacombX == 4) && (_vm->_gyro->_catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1])
+			if (_vm->_gyro->_objects[Gyro::kObjectKey - 1])
 				_vm->_visa->displayScrollChain('q', 62);
 			else {
 				_vm->_visa->displayScrollChain('q', 61);
@@ -849,11 +849,11 @@ void Animation::callSpecial(uint16 which) {
 			}
 		}
 		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombY--;
+		_vm->_gyro->_catacombY--;
 		catacombMove(4);
-		if (_vm->_gyro->_dna._room != r__catacombs)
+		if (_vm->_gyro->_room != r__catacombs)
 			return;
-		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) {
+		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			appearPed(1, 12);
 			break;
@@ -867,27 +867,27 @@ void Animation::callSpecial(uint16 which) {
 		break;
 	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombX++;
+		_vm->_gyro->_catacombX++;
 		catacombMove(1);
-		if (_vm->_gyro->_dna._room != r__catacombs)
+		if (_vm->_gyro->_room != r__catacombs)
 			return;
 		appearPed(1, 1);
 		dawnDelay();
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombY += 1;
+		_vm->_gyro->_catacombY += 1;
 		catacombMove(2);
-		if (_vm->_gyro->_dna._room != r__catacombs)
+		if (_vm->_gyro->_room != r__catacombs)
 			return;
 		appearPed(1, 2);
 		dawnDelay();
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
 		_vm->_lucerna->dusk();
-		_vm->_gyro->_dna._catacombX--;
+		_vm->_gyro->_catacombX--;
 		catacombMove(3);
-		if (_vm->_gyro->_dna._room != r__catacombs)
+		if (_vm->_gyro->_room != r__catacombs)
 			return;
 		appearPed(1, 3);
 		dawnDelay();
@@ -903,7 +903,7 @@ void Animation::callSpecial(uint16 which) {
  * @remarks	Originally called 'open_the_door'
  */
 void Animation::openDoor(byte whither, byte ped, byte magicnum) {
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__outsideyours:
 	case r__outsidenottspub:
 	case r__outsideducks:
@@ -930,7 +930,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	case r__lusties:
 		switch (magicnum) {
 		case 14:
-			if (_vm->_gyro->_dna._avvysInTheCupboard) {
+			if (_vm->_gyro->_avvysInTheCupboard) {
 				hideInCupboard();
 				_vm->_sequence->firstShow(8);
 				_vm->_sequence->thenShow(7);
@@ -1080,13 +1080,13 @@ void Animation::arrowProcs(byte tripnum) {
 #endif
 			_vm->_lucerna->gameOver();
 
-			_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
+			_vm->_gyro->_userMovesAvvy = false; // Stop the user from moving him.
 			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
-		_vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up.
+		_vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
 }
@@ -1145,21 +1145,21 @@ void Animation::spin(byte whichway, byte &tripnum) {
 		if (_sprites[tripnum]._id == 2)
 			return; // Not for Spludwick
 
-		_vm->_gyro->_dna._geidaSpin += 1;
-		_vm->_gyro->_dna._geidaTime = 20;
-		if (_vm->_gyro->_dna._geidaSpin == 5) {
+		_vm->_gyro->_geidaSpin += 1;
+		_vm->_gyro->_geidaTime = 20;
+		if (_vm->_gyro->_geidaSpin == 5) {
 			_vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_gyro->_dna._geidaSpin = 0;
-			_vm->_gyro->_dna._geidaTime = 0; // knock out records
+			_vm->_gyro->_geidaSpin = 0;
+			_vm->_gyro->_geidaTime = 0; // knock out records
 		}
 	}
 }
 
 void Animation::geidaProcs(byte tripnum) {
-	if (_vm->_gyro->_dna._geidaTime > 0) {
-		_vm->_gyro->_dna._geidaTime--;
-		if (_vm->_gyro->_dna._geidaTime == 0)
-			_vm->_gyro->_dna._geidaSpin = 0;
+	if (_vm->_gyro->_geidaTime > 0) {
+		_vm->_gyro->_geidaTime--;
+		if (_vm->_gyro->_geidaTime == 0)
+			_vm->_gyro->_geidaSpin = 0;
 	}
 
 	if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
@@ -1279,7 +1279,7 @@ void Animation::animLink() {
 
 void Animation::stopWalking() {
 	_sprites[0].stopWalk();
-	_vm->_gyro->_dna._direction = kDirStopped;
+	_vm->_gyro->_direction = kDirStopped;
 	if (_vm->_gyro->_alive)
 		_sprites[0]._stepNum = 1;
 }
@@ -1289,16 +1289,16 @@ void Animation::stopWalking() {
  * @remarks	Originally called 'hide_in_the_cupboard'
  */
 void Animation::hideInCupboard() {
-	if (_vm->_gyro->_dna._avvysInTheCupboard) {
-		if (_vm->_gyro->_dna._wearing == Acci::kNothing) {
+	if (_vm->_gyro->_avvysInTheCupboard) {
+		if (_vm->_gyro->_wearing == Acci::kNothing) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman);
 			_vm->_scrolls->displayText(tmpStr);
 		} else {
 			_sprites[0]._visible = true;
-			_vm->_gyro->_dna._userMovesAvvy = true;
+			_vm->_gyro->_userMovesAvvy = true;
 			appearPed(1, 3); // Walk out of the cupboard.
 			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
-			_vm->_gyro->_dna._avvysInTheCupboard = false;
+			_vm->_gyro->_avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
 			_vm->_sequence->thenShow(7);
 			_vm->_sequence->startToClose();
@@ -1306,11 +1306,11 @@ void Animation::hideInCupboard() {
 	} else {
 		// Not hiding in the cupboard
 		_sprites[0]._visible = false;
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
 		_vm->_scrolls->displayText(tmpStr);
-		_vm->_gyro->_dna._avvysInTheCupboard = true;
+		_vm->_gyro->_avvysInTheCupboard = true;
 		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 	}
 }
@@ -1323,18 +1323,18 @@ void Animation::flipRoom(byte room, byte ped) {
 		return;
 	}
 
-	if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) {
+	if ((room == 177) && (_vm->_gyro->_room == r__lusties)) {
 		hideInCupboard();
 		return;
 	}
 
-	if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) {
+	if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == r__insidecardiffcastle)) {
 		// You can't *jump* out of Cardiff Castle!
 		_sprites[0]._moveX = 0;
 		return;
 	}
 
-	_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room);
+	_vm->_lucerna->exitRoom(_vm->_gyro->_room);
 	_vm->_lucerna->dusk();
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
@@ -1342,14 +1342,14 @@ void Animation::flipRoom(byte room, byte ped) {
 			_sprites[i].remove();
 	} // Deallocate sprite
 
-	if (_vm->_gyro->_dna._room == r__lustiesroom)
-		_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
+	if (_vm->_gyro->_room == r__lustiesroom)
+		_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterRoom(room, ped);
 	appearPed(1, ped);
-	_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
-	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
-	_vm->_gyro->_dna._direction = _sprites[0]._facingDir;
+	_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
+	_vm->_gyro->_oldDirection = _vm->_gyro->_direction;
+	_vm->_gyro->_direction = _sprites[0]._facingDir;
 	_vm->_lucerna->drawDirection();
 
 	_vm->_lucerna->dawn();
@@ -1385,7 +1385,7 @@ bool Animation::nearDoor() {
 }
 
 void Animation::handleMoveKey(const Common::Event &event) {
-	if (!_vm->_gyro->_dna._userMovesAvvy)
+	if (!_vm->_gyro->_userMovesAvvy)
 		return;
 
 	if (_vm->_dropdown->_activeMenuItem._activeNow)
@@ -1393,58 +1393,58 @@ void Animation::handleMoveKey(const Common::Event &event) {
 	else {
 		switch (event.kbd.keycode) {
 		case Common::KEYCODE_UP:
-			if (_vm->_gyro->_dna._direction != kDirUp) {
-				_vm->_gyro->_dna._direction = kDirUp;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirUp) {
+				_vm->_gyro->_direction = kDirUp;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_DOWN:
-			if (_vm->_gyro->_dna._direction != kDirDown) {
-				_vm->_gyro->_dna._direction = kDirDown;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirDown) {
+				_vm->_gyro->_direction = kDirDown;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_LEFT:
-			if (_vm->_gyro->_dna._direction != kDirLeft) {
-				_vm->_gyro->_dna._direction = kDirLeft;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirLeft) {
+				_vm->_gyro->_direction = kDirLeft;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_RIGHT:
-			if (_vm->_gyro->_dna._direction != kDirRight) {
-				_vm->_gyro->_dna._direction = kDirRight;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirRight) {
+				_vm->_gyro->_direction = kDirRight;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
-			if (_vm->_gyro->_dna._direction != kDirUpRight) {
-				_vm->_gyro->_dna._direction = kDirUpRight;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirUpRight) {
+				_vm->_gyro->_direction = kDirUpRight;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
-			if (_vm->_gyro->_dna._direction != kDirDownRight) {
-				_vm->_gyro->_dna._direction = kDirDownRight;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirDownRight) {
+				_vm->_gyro->_direction = kDirDownRight;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_END:
-			if (_vm->_gyro->_dna._direction != kDirDownLeft) {
-				_vm->_gyro->_dna._direction = kDirDownLeft;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirDownLeft) {
+				_vm->_gyro->_direction = kDirDownLeft;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_HOME:
-			if (_vm->_gyro->_dna._direction != kDirUpLeft) {
-				_vm->_gyro->_dna._direction = kDirUpLeft;
-				changeDirection(0, _vm->_gyro->_dna._direction);
+			if (_vm->_gyro->_direction != kDirUpLeft) {
+				_vm->_gyro->_direction = kDirUpLeft;
+				changeDirection(0, _vm->_gyro->_direction);
 			} else
 				stopWalking();
 			break;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index ce3fb8e..611a8ef 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -123,146 +123,146 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
-	sz.syncAsByte(_gyro->_dna._direction);
-	sz.syncAsByte(_gyro->_dna._carryNum);
+	sz.syncAsByte(_gyro->_direction);
+	sz.syncAsByte(_gyro->_carryNum);
 	for (byte i = 0; i < kObjectNum; i++)
-		sz.syncAsByte(_gyro->_dna._objects[i]);
-	sz.syncAsSint16LE(_gyro->_dna._score);
-	sz.syncAsSint32LE(_gyro->_dna._money);
-	sz.syncAsByte(_gyro->_dna._room);
-	sz.syncAsByte(_gyro->_dna._wearing);
-	sz.syncAsByte(_gyro->_dna._sworeNum);
-	sz.syncAsByte(_gyro->_dna._saveNum);
-	sz.syncBytes(_gyro->_dna._roomCount, 100);
-	sz.syncAsByte(_gyro->_dna._alcoholLevel);
-	sz.syncAsByte(_gyro->_dna._playedNim);
-	sz.syncAsByte(_gyro->_dna._wonNim);
-	sz.syncAsByte(_gyro->_dna._wineState);
-	sz.syncAsByte(_gyro->_dna._cwytalotGone);
-	sz.syncAsByte(_gyro->_dna._passwordNum);
-	sz.syncAsByte(_gyro->_dna._aylesIsAwake);
-	sz.syncAsByte(_gyro->_dna._drawbridgeOpen);
-	sz.syncAsByte(_gyro->_dna._avariciusTalk);
-	sz.syncAsByte(_gyro->_dna._boughtOnion);
-	sz.syncAsByte(_gyro->_dna._rottenOnion);
-	sz.syncAsByte(_gyro->_dna._onionInVinegar);
-	sz.syncAsByte(_gyro->_dna._givenToSpludwick);
-	sz.syncAsByte(_gyro->_dna._brummieStairs);
-	sz.syncAsByte(_gyro->_dna._cardiffQuestionNum);
-	sz.syncAsByte(_gyro->_dna._passedCwytalotInHerts);
-	sz.syncAsByte(_gyro->_dna._avvyIsAwake);
-	sz.syncAsByte(_gyro->_dna._avvyInBed);
-	sz.syncAsByte(_gyro->_dna._userMovesAvvy);
-	sz.syncAsByte(_gyro->_dna._dogFoodPos);
-	sz.syncAsByte(_gyro->_dna._givenBadgeToIby);
-	sz.syncAsByte(_gyro->_dna._friarWillTieYouUp);
-	sz.syncAsByte(_gyro->_dna._tiedUp);
-	sz.syncAsByte(_gyro->_dna._boxContent);
-	sz.syncAsByte(_gyro->_dna._talkedToCrapulus);
-	sz.syncAsByte(_gyro->_dna._jacquesState);
-	sz.syncAsByte(_gyro->_dna._bellsAreRinging);
-	sz.syncAsByte(_gyro->_dna._standingOnDais);
-	sz.syncAsByte(_gyro->_dna._takenPen);
-	sz.syncAsByte(_gyro->_dna._arrowTriggered);
-	sz.syncAsByte(_gyro->_dna._arrowInTheDoor);
+		sz.syncAsByte(_gyro->_objects[i]);
+	sz.syncAsSint16LE(_gyro->_dnascore);
+	sz.syncAsSint32LE(_gyro->_money);
+	sz.syncAsByte(_gyro->_room);
+	sz.syncAsByte(_gyro->_wearing);
+	sz.syncAsByte(_gyro->_sworeNum);
+	sz.syncAsByte(_gyro->_saveNum);
+	sz.syncBytes(_gyro->_roomCount, 100);
+	sz.syncAsByte(_gyro->_alcoholLevel);
+	sz.syncAsByte(_gyro->_playedNim);
+	sz.syncAsByte(_gyro->_wonNim);
+	sz.syncAsByte(_gyro->_wineState);
+	sz.syncAsByte(_gyro->_cwytalotGone);
+	sz.syncAsByte(_gyro->_passwordNum);
+	sz.syncAsByte(_gyro->_aylesIsAwake);
+	sz.syncAsByte(_gyro->_drawbridgeOpen);
+	sz.syncAsByte(_gyro->_avariciusTalk);
+	sz.syncAsByte(_gyro->_boughtOnion);
+	sz.syncAsByte(_gyro->_rottenOnion);
+	sz.syncAsByte(_gyro->_onionInVinegar);
+	sz.syncAsByte(_gyro->_givenToSpludwick);
+	sz.syncAsByte(_gyro->_brummieStairs);
+	sz.syncAsByte(_gyro->_cardiffQuestionNum);
+	sz.syncAsByte(_gyro->_passedCwytalotInHerts);
+	sz.syncAsByte(_gyro->_avvyIsAwake);
+	sz.syncAsByte(_gyro->_avvyInBed);
+	sz.syncAsByte(_gyro->_userMovesAvvy);
+	sz.syncAsByte(_gyro->_dogFoodPos);
+	sz.syncAsByte(_gyro->_givenBadgeToIby);
+	sz.syncAsByte(_gyro->_friarWillTieYouUp);
+	sz.syncAsByte(_gyro->_tiedUp);
+	sz.syncAsByte(_gyro->_boxContent);
+	sz.syncAsByte(_gyro->_talkedToCrapulus);
+	sz.syncAsByte(_gyro->_jacquesState);
+	sz.syncAsByte(_gyro->_bellsAreRinging);
+	sz.syncAsByte(_gyro->_standingOnDais);
+	sz.syncAsByte(_gyro->_takenPen);
+	sz.syncAsByte(_gyro->_arrowTriggered);
+	sz.syncAsByte(_gyro->_arrowInTheDoor);
 
 	if (sz.isSaving()) {
-		uint16 like2drinkSize = _gyro->_dna._favouriteDrink.size();
+		uint16 like2drinkSize = _gyro->_favouriteDrink.size();
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
-			char actChr = _gyro->_dna._favouriteDrink[i];
+			char actChr = _gyro->_favouriteDrink[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 favourite_songSize = _gyro->_dna._favouriteSong.size();
+		uint16 favourite_songSize = _gyro->_favouriteSong.size();
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
-			char actChr = _gyro->_dna._favouriteSong[i];
+			char actChr = _gyro->_favouriteSong[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 worst_place_on_earthSize = _gyro->_dna._worstPlaceOnEarth.size();
+		uint16 worst_place_on_earthSize = _gyro->_worstPlaceOnEarth.size();
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
-			char actChr = _gyro->_dna._worstPlaceOnEarth[i];
+			char actChr = _gyro->_worstPlaceOnEarth[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 spare_eveningSize = _gyro->_dna._spareEvening.size();
+		uint16 spare_eveningSize = _gyro->_spareEvening.size();
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
-			char actChr = _gyro->_dna._spareEvening[i];
+			char actChr = _gyro->_spareEvening[i];
 			sz.syncAsByte(actChr);
 		}
 	} else {
-		if (!_gyro->_dna._favouriteDrink.empty())
-			_gyro->_dna._favouriteDrink.clear();
+		if (!_gyro->_favouriteDrink.empty())
+			_gyro->_favouriteDrink.clear();
 		uint16 like2drinkSize = 0;
 		char actChr = ' ';
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_dna._favouriteDrink += actChr;
+			_gyro->_favouriteDrink += actChr;
 		}
 
-		if (!_gyro->_dna._favouriteSong.empty())
-			_gyro->_dna._favouriteSong.clear();
+		if (!_gyro->_favouriteSong.empty())
+			_gyro->_favouriteSong.clear();
 		uint16 favourite_songSize = 0;
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_dna._favouriteSong += actChr;
+			_gyro->_favouriteSong += actChr;
 		}
 
-		if (!_gyro->_dna._worstPlaceOnEarth.empty())
-			_gyro->_dna._worstPlaceOnEarth.clear();
+		if (!_gyro->_worstPlaceOnEarth.empty())
+			_gyro->_worstPlaceOnEarth.clear();
 		uint16 worst_place_on_earthSize = 0;
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_dna._worstPlaceOnEarth += actChr;
+			_gyro->_worstPlaceOnEarth += actChr;
 		}
 
-		if (!_gyro->_dna._spareEvening.empty())
-			_gyro->_dna._spareEvening.clear();
+		if (!_gyro->_spareEvening.empty())
+			_gyro->_spareEvening.clear();
 		uint16 spare_eveningSize = 0;
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_dna._spareEvening += actChr;
+			_gyro->_spareEvening += actChr;
 		}
 	}
 
-	sz.syncAsSint32LE(_gyro->_dna._totalTime);
-	sz.syncAsByte(_gyro->_dna._jumpStatus);
-	sz.syncAsByte(_gyro->_dna._mushroomGrowing);
-	sz.syncAsByte(_gyro->_dna._spludwickAtHome);
-	sz.syncAsByte(_gyro->_dna._lastRoom);
-	sz.syncAsByte(_gyro->_dna._lastRoomNotMap);
-	sz.syncAsByte(_gyro->_dna._crapulusWillTell);
-	sz.syncAsByte(_gyro->_dna._enterCatacombsFromLustiesRoom);
-	sz.syncAsByte(_gyro->_dna._teetotal);
-	sz.syncAsByte(_gyro->_dna._malagauche);
-	sz.syncAsByte(_gyro->_dna._drinking);
-	sz.syncAsByte(_gyro->_dna._enteredLustiesRoomAsMonk);
-	sz.syncAsByte(_gyro->_dna._catacombX);
-	sz.syncAsByte(_gyro->_dna._catacombY);
-	sz.syncAsByte(_gyro->_dna._avvysInTheCupboard);
-	sz.syncAsByte(_gyro->_dna._geidaFollows);
-	sz.syncAsByte(_gyro->_dna._geidaSpin);
-	sz.syncAsByte(_gyro->_dna._geidaTime);
-	sz.syncAsByte(_gyro->_dna._nextBell);
-	sz.syncAsByte(_gyro->_dna._givenPotionToGeida);
-	sz.syncAsByte(_gyro->_dna._lustieIsAsleep);
-	sz.syncAsByte(_gyro->_dna._flipToWhere);
-	sz.syncAsByte(_gyro->_dna._flipToPed);
-	sz.syncAsByte(_gyro->_dna._beenTiedUp);
-	sz.syncAsByte(_gyro->_dna._sittingInPub);
-	sz.syncAsByte(_gyro->_dna._spurgeTalkCount);
-	sz.syncAsByte(_gyro->_dna._metAvaroid);
-	sz.syncAsByte(_gyro->_dna._takenMushroom);
-	sz.syncAsByte(_gyro->_dna._givenPenToAyles);
-	sz.syncAsByte(_gyro->_dna._askedDogfoodAboutNim);
+	sz.syncAsSint32LE(_gyro->_totalTime);
+	sz.syncAsByte(_gyro->_jumpStatus);
+	sz.syncAsByte(_gyro->_mushroomGrowing);
+	sz.syncAsByte(_gyro->_spludwickAtHome);
+	sz.syncAsByte(_gyro->_lastRoom);
+	sz.syncAsByte(_gyro->_lastRoomNotMap);
+	sz.syncAsByte(_gyro->_crapulusWillTell);
+	sz.syncAsByte(_gyro->_enterCatacombsFromLustiesRoom);
+	sz.syncAsByte(_gyro->_teetotal);
+	sz.syncAsByte(_gyro->_malagauche);
+	sz.syncAsByte(_gyro->_drinking);
+	sz.syncAsByte(_gyro->_enteredLustiesRoomAsMonk);
+	sz.syncAsByte(_gyro->_catacombX);
+	sz.syncAsByte(_gyro->_catacombY);
+	sz.syncAsByte(_gyro->_avvysInTheCupboard);
+	sz.syncAsByte(_gyro->_geidaFollows);
+	sz.syncAsByte(_gyro->_geidaSpin);
+	sz.syncAsByte(_gyro->_geidaTime);
+	sz.syncAsByte(_gyro->_nextBell);
+	sz.syncAsByte(_gyro->_givenPotionToGeida);
+	sz.syncAsByte(_gyro->_lustieIsAsleep);
+	sz.syncAsByte(_gyro->_flipToWhere);
+	sz.syncAsByte(_gyro->_flipToPed);
+	sz.syncAsByte(_gyro->_beenTiedUp);
+	sz.syncAsByte(_gyro->_sittingInPub);
+	sz.syncAsByte(_gyro->_spurgeTalkCount);
+	sz.syncAsByte(_gyro->_metAvaroid);
+	sz.syncAsByte(_gyro->_takenMushroom);
+	sz.syncAsByte(_gyro->_givenPenToAyles);
+	sz.syncAsByte(_gyro->_askedDogfoodAboutNim);
 
 
 #if 0
@@ -443,7 +443,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_celer->forgetBackgroundSprites();
 	_lucerna->minorRedraw();
 	_dropdown->setupMenu();
-	_gyro->_whereIs[0] = _gyro->_dna._room;
+	_gyro->_whereIs[0] = _gyro->_room;
 	_gyro->_alive = true;
 	_lucerna->refreshObjectList();
 	_animation->updateSpeed();
@@ -459,7 +459,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_scrolls->displayText(tmpStr);
 
 	if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible)
-		_animation->changeDirection(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving.
+		_animation->changeDirection(0, _gyro->_direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2643299..5a9fa60 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -109,7 +109,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
-		if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) {
+		if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake) {
 			_vm->_animation->handleMoveKey(event); // Fallthroughs are intended.
 			_vm->_lucerna->drawDirection();
 			return;
@@ -147,7 +147,7 @@ void Avalot::setup() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_gyro->_defaultLed = 2;
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_gyro->_dna._direction = Gyro::kDirectionStopped;
+	_vm->_gyro->_direction = Gyro::kDirectionStopped;
 	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 10c2efc..143725a 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -57,7 +57,7 @@ void Celer::updateBackgroundSprites() {
 	if (_vm->_gyro->_dropdownActive)
 		return; // No animation when the menus are up.
 
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__outsideargentpub:
 		if ((_vm->_gyro->_roomTime % 12) == 0)
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
@@ -71,14 +71,14 @@ void Celer::updateBackgroundSprites() {
 			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
 	case r__yours:
-		if ((!_vm->_gyro->_dna._avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
+		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
 		break;
 	case r__argentpub:
-		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_dna._malagauche != 177)) {
+		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
 			// Malagauche cycle.
-			_vm->_gyro->_dna._malagauche += 1;
-			switch (_vm->_gyro->_dna._malagauche) {
+			_vm->_gyro->_malagauche += 1;
+			switch (_vm->_gyro->_malagauche) {
 			case 1:
 			case 11:
 			case 21:
@@ -94,7 +94,7 @@ void Celer::updateBackgroundSprites() {
 				drawBackgroundSprite(-1, -1, 13); // Winks.
 				break;
 			case 33:
-				_vm->_gyro->_dna._malagauche = 0;
+				_vm->_gyro->_malagauche = 0;
 				break;
 			}
 		}
@@ -112,7 +112,7 @@ void Celer::updateBackgroundSprites() {
 			drawBackgroundSprite(-1, -1, 7);
 			break;
 		case 199:
-			_vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this.
+			_vm->_gyro->_dogFoodPos = 177; // Impossible value for this.
 			break;
 		}
 
@@ -125,9 +125,9 @@ void Celer::updateBackgroundSprites() {
 			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
 				direction = 4;
 
-			if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_dna._dogFoodPos = direction;
+				_vm->_gyro->_dogFoodPos = direction;
 			}
 		}
 		break;
@@ -150,7 +150,7 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	case r__lustiesroom:
-		if (!(_vm->_gyro->_dna._lustieIsAsleep)) {
+		if (!(_vm->_gyro->_lustieIsAsleep)) {
 			byte direction = 0;
 			uint16 angle = _vm->_lucerna->bearing(2);
 			if ((_vm->_gyro->_roomTime % 45) > 42)
@@ -163,14 +163,14 @@ void Celer::updateBackgroundSprites() {
 			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
-			if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
+				_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
 			}
 		}
 		break;
 	case r__aylesoffice:
-		if ((!_vm->_gyro->_dna._aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
+		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
 			switch ((_vm->_gyro->_roomTime / 14) % 2) {
 			case 0:
 				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
@@ -182,7 +182,7 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	case r__robins:
-		if (_vm->_gyro->_dna._tiedUp) {
+		if (_vm->_gyro->_tiedUp) {
 			switch (_vm->_gyro->_roomTime % 54) {
 			case 20:
 				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
@@ -207,9 +207,9 @@ void Celer::updateBackgroundSprites() {
 		if ((_vm->_gyro->_roomTime % 60) > 57)
 			direction--; // Blinks.
 
-		if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
 		}
 
 		switch (_vm->_gyro->_roomTime % 50) {
@@ -239,22 +239,22 @@ void Celer::updateBackgroundSprites() {
 		if ((_vm->_gyro->_roomTime % 45) > 42)
 			direction++; // Duck blinks.
 
-		if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
 		}
 		break;
 	   }
 	}
 
-	if ((_vm->_gyro->_dna._bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
+	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
 		// They're ringing the bells.
 		switch (_vm->_gyro->_roomTime % 4) {
 		case 1:
-			if (_vm->_gyro->_dna._nextBell < 5)
-				_vm->_gyro->_dna._nextBell = 12;
-			_vm->_gyro->_dna._nextBell--;
-			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_dna._nextBell]);
+			if (_vm->_gyro->_nextBell < 5)
+				_vm->_gyro->_nextBell = 12;
+			_vm->_gyro->_nextBell--;
+			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]);
 			break;
 		case 2:
 			//nosound();
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index a934ed0..62f4680 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -448,7 +448,7 @@ void Dropdown::setupMenuAction() {
 	else
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->_dna._room == 99)
+	if (_vm->_gyro->_room == 99)
 		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
 	else
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
@@ -469,7 +469,7 @@ void Dropdown::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (byte i = 150; i <= 178; i++)
-		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_dna._room) {
+		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
 			people = people + i;
 		}
@@ -480,7 +480,7 @@ void Dropdown::setupMenuPeople() {
 void Dropdown::setupMenuObjects() {
 	_activeMenuItem.reset();
 	for (byte i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_dna._objects[i])
+		if (_vm->_gyro->_objects[i])
 			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
 	}
 	_activeMenuItem.display();
@@ -504,7 +504,7 @@ void Dropdown::setupMenuWith() {
 		// or (c), the _person you've selected is YOU!
 
 		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
-			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room))
+			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
@@ -522,13 +522,13 @@ void Dropdown::setupMenuWith() {
 		}
 		break;
 		case Gyro::kPeopleDogfood: {
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_dna._wonNim); // True if you HAVEN'T won.
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
 		}
 		break;
 		case Gyro::kPeopleMalagauche: {
-			bool isSober = !_vm->_gyro->_dna._teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]);
+			bool isSober = !_vm->_gyro->_teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
@@ -537,7 +537,7 @@ void Dropdown::setupMenuWith() {
 		}
 		break;
 		case Gyro::kPeopleTrader: {
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]);
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
 		}
 		break;
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
index a59db04..4c8013e 100644
--- a/engines/avalanche/enid2.cpp
+++ b/engines/avalanche/enid2.cpp
@@ -274,7 +274,7 @@ void Enid::ednaReload() {
 
 	_vm->_lucerna->majorRedraw();
 
-	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
+	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
 
 	_vm->_gyro->_alive = true;
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index ecd1be1..d9e0d74 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -178,7 +178,7 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 			_also[fv][ff] = 0;
 	}
 
-	_dna._totalTime = 0;
+	_totalTime = 0;
 }
 
 Gyro::~Gyro() {
@@ -225,6 +225,89 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 	warning("STUB: Gyro::shbox()");
 }
 
+void Gyro::resetVariables() {
+// Replaces memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
+	_direction = 0;
+	_carryNum = 0;
+	for (int i = 0; i < kObjectNum; i++)
+		_objects[i] = false;
+
+	_dnascore = 0;
+	_money = 0;
+	_room = 0;
+	_wearing = 0;
+	_sworeNum = 0;
+	_saveNum = 0;
+	for (int i = 0; i < 100; i++)
+		_roomCount[100] = 0;
+
+	_alcoholLevel = 0;
+	_playedNim = 0;
+	_wonNim = false;
+	_wineState = 0;
+	_cwytalotGone = false;
+	_passwordNum = 0;
+	_aylesIsAwake = false;
+	_drawbridgeOpen = 0;
+	_avariciusTalk = 0;
+	_boughtOnion = false;
+	_rottenOnion = false;
+	_onionInVinegar = false;
+	_givenToSpludwick = 0;
+	_brummieStairs = 0;
+	_cardiffQuestionNum = 0;
+	_passedCwytalotInHerts = false;
+	_avvyIsAwake = false;
+	_avvyInBed = false;
+	_userMovesAvvy = false;
+	_dogFoodPos = 0;
+	_givenBadgeToIby = false;
+	_friarWillTieYouUp = false;
+	_tiedUp = false;
+	_boxContent = 0;
+	_talkedToCrapulus = false;
+	_jacquesState = 0;
+	_bellsAreRinging = false;
+	_standingOnDais = false;
+	_takenPen = false;
+	_arrowTriggered = false;
+	_arrowInTheDoor = false;
+	_favouriteDrink = "";
+	_favouriteSong = "";
+	_worstPlaceOnEarth = "";
+	_spareEvening = "";
+	_totalTime = 0;
+	_jumpStatus = 0;
+	_mushroomGrowing = false;
+	_spludwickAtHome = false;
+	_lastRoom = 0;
+	_lastRoomNotMap = 0;
+	_crapulusWillTell = false;
+	_enterCatacombsFromLustiesRoom = false;
+	_teetotal = false;
+	_malagauche = 0;
+	_drinking = 0;
+	_enteredLustiesRoomAsMonk = false;
+	_catacombX = 0;
+	_catacombY = 0;
+	_avvysInTheCupboard = false;
+	_geidaFollows = false;
+	_geidaSpin = 0;
+	_geidaTime = 0;
+	_nextBell = 0;
+	_givenPotionToGeida = false;
+	_lustieIsAsleep = false;
+	_flipToWhere = 0;
+	_flipToPed = 0;
+	_beenTiedUp = false;
+	_sittingInPub = false;
+	_spurgeTalkCount = 0;
+	_metAvaroid = false;
+	_takenMushroom = false;
+	_givenPenToAyles = false;
+	_askedDogfoodAboutNim = false;
+}
+
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
 		if (_vm->_animation->_sprites[i]._quick)
@@ -236,19 +319,19 @@ void Gyro::newGame() {
 
 	_alive = true;
 	_score = 0;
-	memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
+	resetVariables();
 
 	_vm->_scrolls->setBubbleStateNatural();
 
-	_dna._spareEvening = "answer a questionnaire";
-	_dna._favouriteDrink = "beer";
-	_dna._money = 30; // 2/6
-	_dna._direction = kDirectionStopped;
-	_dna._wearing = kObjectClothes;
-	_dna._objects[kObjectMoney - 1] = true;
-	_dna._objects[kObjectBodkin - 1] = true;
-	_dna._objects[kObjectBell - 1] = true;
-	_dna._objects[kObjectClothes - 1] = true;
+	_spareEvening = "answer a questionnaire";
+	_favouriteDrink = "beer";
+	_money = 30; // 2/6
+	_direction = kDirectionStopped;
+	_wearing = kObjectClothes;
+	_objects[kObjectMoney - 1] = true;
+	_objects[kObjectBodkin - 1] = true;
+	_objects[kObjectBell - 1] = true;
+	_objects[kObjectClothes - 1] = true;
 
 	_thinkThing = true;
 	_thinks = 2;
@@ -263,10 +346,10 @@ void Gyro::newGame() {
 	_her = 254;
 	_it = 254;
 	_lastPerson = 254; // = Pardon?
-	_dna._passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
-	_dna._userMovesAvvy = false;
+	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_userMovesAvvy = false;
 	_doingSpriteRun = false;
-	_dna._avvyInBed = true;
+	_avvyInBed = true;
 	_enidFilename = "";
 
 	_vm->_lucerna->enterRoom(1, 1);
@@ -299,8 +382,8 @@ void Gyro::forceNumlock() {
 }
 
 bool Gyro::decreaseMoney(uint16 howmuchby) {
-	_dna._money -= howmuchby;
-	if (_dna._money < 0) {
+	_money -= howmuchby;
+	if (_money < 0) {
 		_vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!"
 		_vm->_lucerna->gameOver();
 		return false;
@@ -343,7 +426,7 @@ Common::String Gyro::getThing(byte which) {
 	Common::String get_thing_result;
 	switch (which) {
 	case kObjectWine:
-		switch (_dna._wineState) {
+		switch (_wineState) {
 		case 1:
 		case 4:
 			get_thing_result = kThings[which - 1];
@@ -354,7 +437,7 @@ Common::String Gyro::getThing(byte which) {
 		}
 		break;
 	case kObjectOnion:
-		if (_dna._rottenOnion)
+		if (_rottenOnion)
 			get_thing_result = "rotten onion";
 		else
 			get_thing_result = kThings[which - 1];
@@ -371,7 +454,7 @@ char Gyro::getThingChar(byte which) {
 	char get_thingchar_result;
 	switch (which) {
 	case kObjectWine:
-		if (_dna._wineState == 3)
+		if (_wineState == 3)
 			get_thingchar_result = 'V'; // Vinegar
 		else
 			get_thingchar_result = kThingsChar[which - 1];
@@ -396,7 +479,7 @@ Common::String Gyro::getItem(byte which) {
 
 	switch (which) {
 	case kObjectWine:
-		switch (_dna._wineState) {
+		switch (_wineState) {
 		case 0:
 		case 1:
 		case 4:
@@ -408,9 +491,9 @@ Common::String Gyro::getItem(byte which) {
 		}
 		break;
 	case kObjectOnion:
-		if (_dna._rottenOnion)
+		if (_rottenOnion)
 			get_better_result = "a rotten onion";
-		else if (_dna._onionInVinegar)
+		else if (_onionInVinegar)
 			get_better_result = "a pickled onion (in the vinegar)";
 		else
 			get_better_result = kItems[which - 1];
@@ -426,21 +509,21 @@ Common::String Gyro::getItem(byte which) {
 
 
 Common::String Gyro::f5Does() {
-	switch (_dna._room) {
+	switch (_room) {
 	case r__yours:
-		if (!_dna._avvyIsAwake)
+		if (!_avvyIsAwake)
 			return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
-		else if (_dna._avvyInBed)
+		else if (_avvyInBed)
 			return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
 		break;
 	case r__insidecardiffcastle:
-		if (_dna._standingOnDais)
+		if (_standingOnDais)
 			return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
 		else
 			return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
 		break;
 	case r__nottspub:
-		if (_dna._sittingInPub)
+		if (_sittingInPub)
 			return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
 		else
 			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index faab64c..35addc3 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -53,76 +53,6 @@ struct MouseHotspotType { // mouse-void
 	int16 _horizontal, _vertical;
 };
 
-struct DnaType { // Ux, uy, & ww now all belong to Trip5
-	byte _direction; // The direction Avvy is currently facing.
-	byte _carryNum; // How many objects you're carrying...
-	bool _objects[kObjectNum]; // ...and which ones they are.
-	int16 _score; // your score, of course
-	int32 _money; // your current amount of dosh
-	byte _room; // your current room
-	byte _wearing; // what you're wearing
-	byte _sworeNum; // number of times you've sworn
-	byte _saveNum; // number of times this game has been saved
-	byte _roomCount[100]; // Add one to each every time you enter a room
-	byte _alcoholLevel; // Your blood alcohol level.
-	byte _playedNim; // How many times you've played Nim.
-	bool _wonNim; // Have you *won* Nim? (That's harder.)
-	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
-	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
-	byte _passwordNum; // Number of the passw for this game.
-	bool _aylesIsAwake; // pretty obvious!
-	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
-	byte _avariciusTalk; // How much Avaricius has said to you.
-	bool _boughtOnion; // Have you bought an onion yet?
-	bool _rottenOnion; // And has it rotted?
-	bool _onionInVinegar; // Is the onion in the vinegar?
-	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
-	byte _brummieStairs; // Progression through the stairs trick.
-	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
-	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
-	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
-	bool _avvyInBed; // True if Avvy's in bed, but awake.
-	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
-	byte _dogFoodPos; // Which way Dogfood's looking in the pub.
-	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
-	bool _friarWillTieYouUp; // If you're going to get tied up.
-	bool _tiedUp; // You ARE tied up!
-	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
-	bool _talkedToCrapulus; // Pretty self-explanatory.
-	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
-	bool _bellsAreRinging; // Is Jacques ringing the bells?
-	bool _standingOnDais; // In room 71, inside Cardiff Castle.
-	bool _takenPen; // Have you taken the pen (in Cardiff?)
-	bool _arrowTriggered; // And has the arrow been triggered?
-	bool _arrowInTheDoor;  // Did the arrow hit the wall?
-	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
-	uint32 _totalTime; // Your total time playing this game, in ticks.
-	byte _jumpStatus; // Fixes how high you're jumping.
-	bool _mushroomGrowing; // Is the mushroom growing in 42?
-	bool _spludwickAtHome; // Is Spludwick at home?
-	byte _lastRoom;
-	byte _lastRoomNotMap;
-	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
-	bool _enterCatacombsFromLustiesRoom;
-	bool _teetotal; // Are we touching any more drinks?
-	byte _malagauche; // Position of Malagauche. See Celer for more info.
-	char _drinking; // What's he getting you?
-	bool _enteredLustiesRoomAsMonk;
-	byte _catacombX, _catacombY;   // XY coords in the catacombs.
-	bool _avvysInTheCupboard; // On screen 22.
-	bool _geidaFollows; // Is Geida following you?
-	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
-	byte _nextBell; // For the ringing.
-	bool _givenPotionToGeida; // Does Geida have the potion?
-	bool _lustieIsAsleep; // Is BDL asleep?
-	byte _flipToWhere, _flipToPed; // For the sequencer.
-	bool _beenTiedUp; // In r__Robins.
-	bool _sittingInPub; // Are you sitting down in the pub?
-	byte _spurgeTalkCount; // Count for talking to Spurge.
-	bool _metAvaroid;
-	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
-};
-
 struct PedType {
 	int16 _x, _y;
 	byte _direction;
@@ -324,7 +254,76 @@ public:
 	// You may know better than On which page to switch to.
 	bool _onCanDoPageSwap;
 
-	DnaType _dna;
+	// Former DNA structure
+	byte _direction; // The direction Avvy is currently facing.
+	byte _carryNum; // How many objects you're carrying...
+	bool _objects[kObjectNum]; // ...and which ones they are.
+	int16 _dnascore; // your score, of course
+	int32 _money; // your current amount of dosh
+	byte _room; // your current room
+	byte _wearing; // what you're wearing
+	byte _sworeNum; // number of times you've sworn
+	byte _saveNum; // number of times this game has been saved
+	byte _roomCount[100]; // Add one to each every time you enter a room
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _wonNim; // Have you *won* Nim? (That's harder.)
+	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
+	byte _passwordNum; // Number of the passw for this game.
+	bool _aylesIsAwake; // pretty obvious!
+	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
+	byte _avariciusTalk; // How much Avaricius has said to you.
+	bool _boughtOnion; // Have you bought an onion yet?
+	bool _rottenOnion; // And has it rotted?
+	bool _onionInVinegar; // Is the onion in the vinegar?
+	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
+	byte _brummieStairs; // Progression through the stairs trick.
+	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool _avvyInBed; // True if Avvy's in bed, but awake.
+	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
+	byte _dogFoodPos; // Which way Dogfood's looking in the pub.
+	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
+	bool _friarWillTieYouUp; // If you're going to get tied up.
+	bool _tiedUp; // You ARE tied up!
+	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
+	bool _talkedToCrapulus; // Pretty self-explanatory.
+	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
+	bool _bellsAreRinging; // Is Jacques ringing the bells?
+	bool _standingOnDais; // In room 71, inside Cardiff Castle.
+	bool _takenPen; // Have you taken the pen (in Cardiff?)
+	bool _arrowTriggered; // And has the arrow been triggered?
+	bool _arrowInTheDoor;  // Did the arrow hit the wall?
+	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
+	uint32 _totalTime; // Your total time playing this game, in ticks.
+	byte _jumpStatus; // Fixes how high you're jumping.
+	bool _mushroomGrowing; // Is the mushroom growing in 42?
+	bool _spludwickAtHome; // Is Spludwick at home?
+	byte _lastRoom;
+	byte _lastRoomNotMap;
+	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
+	bool _enterCatacombsFromLustiesRoom;
+	bool _teetotal; // Are we touching any more drinks?
+	byte _malagauche; // Position of Malagauche. See Celer for more info.
+	char _drinking; // What's he getting you?
+	bool _enteredLustiesRoomAsMonk;
+	byte _catacombX, _catacombY;   // XY coords in the catacombs.
+	bool _avvysInTheCupboard; // On screen 22.
+	bool _geidaFollows; // Is Geida following you?
+	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
+	byte _nextBell; // For the ringing.
+	bool _givenPotionToGeida; // Does Geida have the potion?
+	bool _lustieIsAsleep; // Is BDL asleep?
+	byte _flipToWhere, _flipToPed; // For the sequencer.
+	bool _beenTiedUp; // In r__Robins.
+	bool _sittingInPub; // Are you sitting down in the pub?
+	byte _spurgeTalkCount; // Count for talking to Spurge.
+	bool _metAvaroid;
+	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
+	// End of former DNA Structure
+
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
 	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
@@ -399,6 +398,7 @@ public:
 	void setBackgroundColor(byte x);
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
+	void resetVariables();
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
 	bool setFlag(char x);
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 82aabe2..12b7552 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -346,12 +346,12 @@ void Lucerna::exitRoom(byte x) {
 	switch (x) {
 	case r__spludwicks:
 		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
-		 _vm->_gyro->_dna._avariciusTalk = 0;
+		 _vm->_gyro->_avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case r__bridge:
-		if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
-			_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
+		if (_vm->_gyro->_drawbridgeOpen > 0) {
+			_vm->_gyro->_drawbridgeOpen = 4; // Fully open.
 			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
 		}
 		break;
@@ -367,9 +367,9 @@ void Lucerna::exitRoom(byte x) {
 
 	_vm->_gyro->_seeScroll = false; // Now it can work again!
 
-	_vm->_gyro->_dna._lastRoom = _vm->_gyro->_dna._room;
-	if (_vm->_gyro->_dna._room != r__map)
-		_vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room;
+	_vm->_gyro->_lastRoom = _vm->_gyro->_room;
+	if (_vm->_gyro->_room != r__map)
+		_vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room;
 }
 
 
@@ -381,28 +381,28 @@ void Lucerna::exitRoom(byte x) {
 void Lucerna::enterNewTown() {
 	_vm->_dropdown->setupMenu();
 
-	switch (_vm->_gyro->_dna._room) {
+	switch (_vm->_gyro->_room) {
 	case r__outsidenottspub: // Entry into Nottingham.
-		if ((_vm->_gyro->_dna._roomCount[r__robins] > 0) && (_vm->_gyro->_dna._beenTiedUp) && (!_vm->_gyro->_dna._takenMushroom))
-			_vm->_gyro->_dna._mushroomGrowing = true;
+		if ((_vm->_gyro->_roomCount[r__robins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
+			_vm->_gyro->_mushroomGrowing = true;
 		break;
 	case r__wisewomans: { // Entry into Argent.
-		if (_vm->_gyro->_dna._talkedToCrapulus && (! _vm->_gyro->_dna._lustieIsAsleep)) {
-			_vm->_gyro->_dna._spludwickAtHome = !((_vm->_gyro->_dna._roomCount[r__wisewomans] % 3) == 1);
-			_vm->_gyro->_dna._crapulusWillTell = ! _vm->_gyro->_dna._spludwickAtHome;
+		if (_vm->_gyro->_talkedToCrapulus && (! _vm->_gyro->_lustieIsAsleep)) {
+			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1);
+			_vm->_gyro->_crapulusWillTell = ! _vm->_gyro->_spludwickAtHome;
 		} else {
-			_vm->_gyro->_dna._spludwickAtHome = true;
-			_vm->_gyro->_dna._crapulusWillTell = false;
+			_vm->_gyro->_spludwickAtHome = true;
+			_vm->_gyro->_crapulusWillTell = false;
 		}
-		if (_vm->_gyro->_dna._boxContent == Gyro::kObjectWine)
-			_vm->_gyro->_dna._wineState = 3; // Vinegar
+		if (_vm->_gyro->_boxContent == Gyro::kObjectWine)
+			_vm->_gyro->_wineState = 3; // Vinegar
 	}
 	break;
 	}
 
-	if (_vm->_gyro->_dna._room != r__outsideducks) {
-		if ((_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar))
-			_vm->_gyro->_dna._rottenOnion = true; // You're holding the onion
+	if (_vm->_gyro->_room != r__outsideducks) {
+		if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar))
+			_vm->_gyro->_rottenOnion = true; // You're holding the onion
 	}
 }
 
@@ -421,30 +421,30 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	findPeople(room);
-	_vm->_gyro->_dna._room = room;
+	_vm->_gyro->_room = room;
 	if (ped != 0)
-		_vm->_gyro->_dna._roomCount[room]++;
+		_vm->_gyro->_roomCount[room]++;
 
 	loadRoom(room);
 
-	if ((_vm->_gyro->_dna._roomCount[room] == 0) && (! _vm->_gyro->setFlag('S')))
+	if ((_vm->_gyro->_roomCount[room] == 0) && (! _vm->_gyro->setFlag('S')))
 		incScore(1);
 
-	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room;
+	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
 
-	if (_vm->_gyro->_dna._geidaFollows)
+	if (_vm->_gyro->_geidaFollows)
 		_vm->_gyro->_whereIs[Gyro::kPeopleGeida - 150] = room;
 
 	_vm->_gyro->_roomTime = 0;
 
 
-	if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room))
+	if ((_vm->_gyro->_lastRoom == r__map) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room))
 		enterNewTown();
 
 
 	switch (room) {
 	case r__yours:
-		if (_vm->_gyro->_dna._avvyInBed) {
+		if (_vm->_gyro->_avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
 			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
@@ -453,12 +453,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsideyours:
 		if (ped > 0) {
-			if (! _vm->_gyro->_dna._talkedToCrapulus) {
+			if (! _vm->_gyro->_talkedToCrapulus) {
 
 				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
 				_vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus
 
-				if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) {
+				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
 					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
 					_vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you.
 				} else {
@@ -471,32 +471,32 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			} else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
 
-			if (_vm->_gyro->_dna._crapulusWillTell) {
+			if (_vm->_gyro->_crapulusWillTell) {
 				_vm->_animation->_sprites[1].init(8, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
 				_vm->_animation->_sprites[1].walkTo(4);
 				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
-				_vm->_gyro->_dna._crapulusWillTell = false;
+				_vm->_gyro->_crapulusWillTell = false;
 			}
 		}
 		break;
 
 	case r__outsidespludwicks:
-		if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
+		if ((_vm->_gyro->_roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
 			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
-			_vm->_gyro->_dna._spludwickAtHome = true;
+			_vm->_gyro->_spludwickAtHome = true;
 		}
 		break;
 
 	case r__spludwicks:
-		if (_vm->_gyro->_dna._spludwickAtHome) {
+		if (_vm->_gyro->_spludwickAtHome) {
 			if (ped > 0) {
 				_vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick
 				_vm->_animation->appearPed(2, 2);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
-			_vm->_gyro->_dna._dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
+			_vm->_gyro->_dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
 			_vm->_animation->_sprites[1]._callEachStepFl = true;
 			_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
@@ -505,9 +505,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__brummieroad:
-		if (_vm->_gyro->_dna._geidaFollows)
+		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(5, ped);
-		if (_vm->_gyro->_dna._cwytalotGone) {
+		if (_vm->_gyro->_cwytalotGone) {
 			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
 			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
 		} else {
@@ -517,7 +517,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 
-				if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here...
+				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
 					_vm->_animation->_sprites[1].walkTo(4); // ...and he walks up...
 				} else {
@@ -530,31 +530,31 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__argentroad:
-		if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) &&
-		        (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) {
+		if ((_vm->_gyro->_cwytalotGone) && (! _vm->_gyro->_passedCwytalotInHerts) && (ped == 2) &&
+		        (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
 			_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->appearPed(2, 1);
 			_vm->_animation->_sprites[1].walkTo(2);
 			_vm->_animation->_sprites[1]._vanishIfStill = true;
-			_vm->_gyro->_dna._passedCwytalotInHerts = true;
+			_vm->_gyro->_passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
 		}
 		break;
 
 	case r__bridge:
-		if (_vm->_gyro->_dna._drawbridgeOpen == 4) { // open
+		if (_vm->_gyro->_drawbridgeOpen == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
 			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 		}
-		if (_vm->_gyro->_dna._geidaFollows)
+		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(ped + 3, ped); // load Geida
 		break;
 
 	case r__robins:
 		if (ped > 0) {
-			if (! _vm->_gyro->_dna._beenTiedUp) {
+			if (! _vm->_gyro->_beenTiedUp) {
 				// A welcome party... or maybe not...
 				_vm->_animation->_sprites[1].init(6, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
@@ -563,22 +563,22 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			}
 		}
 
-		if (_vm->_gyro->_dna._beenTiedUp) {
+		if (_vm->_gyro->_beenTiedUp) {
 			_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = 0;
 			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0;
 		}
 
-		if (_vm->_gyro->_dna._tiedUp)
+		if (_vm->_gyro->_tiedUp)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 
-		if (!_vm->_gyro->_dna._mushroomGrowing)
+		if (!_vm->_gyro->_mushroomGrowing)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_graphics->refreshBackground();
 		break;
 
 	case r__outsidecardiffcastle:
 		if (ped > 0)
-			switch (_vm->_gyro->_dna._cardiffQuestionNum) {
+			switch (_vm->_gyro->_cardiffQuestionNum) {
 			case 0 : { // You've answered NONE of his questions.
 				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
@@ -596,8 +596,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
 			}
-		if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
-			_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
+		if (_vm->_gyro->_cardiffQuestionNum < 5)
+			_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
 		else _vm->_gyro->_interrogation = 0;
 		break;
 
@@ -610,9 +610,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		//setactivepage(1 - cp);
 
 		{
-			if ((_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) {
+			if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
 				_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
-				_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false;
+				_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 				refreshObjectList();
 			}
 		}
@@ -625,33 +625,33 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			switch (ped) {
 			case 3: { // Enter from oubliette
-				_vm->_gyro->_dna._catacombX = 8;
-				_vm->_gyro->_dna._catacombY = 4;
+				_vm->_gyro->_catacombX = 8;
+				_vm->_gyro->_catacombY = 4;
 			}
 			break;
 			case 5: { // Enter from du Lustie's
-				_vm->_gyro->_dna._catacombX = 8;
-				_vm->_gyro->_dna._catacombY = 7;
+				_vm->_gyro->_catacombX = 8;
+				_vm->_gyro->_catacombY = 7;
 			}
 			break;
 			case 6: { // Enter from Geida's
-				_vm->_gyro->_dna._catacombX = 4;
-				_vm->_gyro->_dna._catacombY = 1;
+				_vm->_gyro->_catacombX = 4;
+				_vm->_gyro->_catacombY = 1;
 			}
 			break;
 			}
 
-			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true;
+			_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
 			_vm->_animation->catacombMove(ped);
-			_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false;
+			_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
 		}
 		break;
 
 	case r__argentpub:
-		if (_vm->_gyro->_dna._wonNim)
+		if (_vm->_gyro->_wonNim)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
-		_vm->_gyro->_dna._malagauche = 0; // Ready to boot Malagauche
-		if (_vm->_gyro->_dna._givenBadgeToIby) {
+		_vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
+		if (_vm->_gyro->_givenBadgeToIby) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		}
@@ -659,16 +659,16 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__lustiesroom:
-		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
+		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
-		else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
+		else if (! _vm->_gyro->_enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
 			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
 
-		if (_vm->_gyro->_dna._geidaFollows) {
+		if (_vm->_gyro->_geidaFollows) {
 			putGeidaAt(5, ped);
-			if (_vm->_gyro->_dna._lustieIsAsleep) {
+			if (_vm->_gyro->_lustieIsAsleep) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
 			}
@@ -676,8 +676,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__musicroom:
-		if (_vm->_gyro->_dna._jacquesState > 0) {
-			_vm->_gyro->_dna._jacquesState = 5;
+		if (_vm->_gyro->_jacquesState > 0) {
+			_vm->_gyro->_jacquesState = 5;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
@@ -719,7 +719,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__wisewomans:
 		_vm->_animation->_sprites[1].init(11, false, _vm->_animation);
-		if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) {
+		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
 			_vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you.
 		} else {
@@ -737,18 +737,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(1);
-			if (_vm->_gyro->_dna._arrowInTheDoor)
+			if (_vm->_gyro->_arrowInTheDoor)
 				_vm->_sequence->thenShow(3);
 			else
 				_vm->_sequence->thenShow(2);
 
-			if (_vm->_gyro->_dna._takenPen)
+			if (_vm->_gyro->_takenPen)
 				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 
 			_vm->_sequence->startToClose();
 		} else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
-			if (_vm->_gyro->_dna._arrowInTheDoor)
+			if (_vm->_gyro->_arrowInTheDoor)
 				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			else
 				_vm->_celer->drawBackgroundSprite(-1, -1, 2);
@@ -789,7 +789,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__aylesoffice:
-		if (_vm->_gyro->_dna._aylesIsAwake)
+		if (_vm->_gyro->_aylesIsAwake)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
@@ -800,18 +800,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__easthall:
 	case r__westhall:
-		if (_vm->_gyro->_dna._geidaFollows)
+		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(ped + 2, ped);
 		break;
 
 	case r__lusties:
-		if (_vm->_gyro->_dna._geidaFollows)
+		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(ped + 6, ped);
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro->_dna._sittingInPub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
+		if (_vm->_gyro->_sittingInPub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
 		break;
 
 	case r__outsideducks:
@@ -828,7 +828,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__ducks:
-		_vm->_gyro->_dna._dogFoodPos = 1;
+		_vm->_gyro->_dogFoodPos = 1;
 		break; // Actually, Duck pos.
 	}
 
@@ -921,7 +921,7 @@ void Lucerna::drawScore() {
 	if (_vm->_gyro->kDemo)
 		return;
 
-	uint16 score = _vm->_gyro->_dna._score;
+	uint16 score = _vm->_gyro->_dnascore;
 	int8 numbers[3] = {0, 0, 0};
 	for (byte i = 0; i < 2; i++) {
 		byte divisor = 1;
@@ -947,7 +947,7 @@ void Lucerna::drawScore() {
 
 void Lucerna::incScore(byte num) {     // Add on no. of points
 	for (byte q = 1; q <= num; q++) {
-		_vm->_gyro->_dna._score++;
+		_vm->_gyro->_dnascore++;
 
 #if 0
 		if (soundfx) {
@@ -967,22 +967,22 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
 
 	switch (color) {
 	case kColorGreen:
-		_vm->_gyro->_dna._direction = Animation::kDirUp;
+		_vm->_gyro->_direction = Animation::kDirUp;
 		_vm->_animation->changeDirection(0, Animation::kDirUp);
 		drawDirection();
 		break;
 	case kColorBrown:
-		_vm->_gyro->_dna._direction = Animation::kDirDown;
+		_vm->_gyro->_direction = Animation::kDirDown;
 		_vm->_animation->changeDirection(0, Animation::kDirDown);
 		drawDirection();
 		break;
 	case kColorCyan:
-		_vm->_gyro->_dna._direction = Animation::kDirLeft;
+		_vm->_gyro->_direction = Animation::kDirLeft;
 		_vm->_animation->changeDirection(0, Animation::kDirLeft);
 		drawDirection();
 		break;
 	case kColorLightmagenta:
-		_vm->_gyro->_dna._direction = Animation::kDirRight;
+		_vm->_gyro->_direction = Animation::kDirRight;
 		_vm->_animation->changeDirection(0, Animation::kDirRight);
 		drawDirection();
 		break;
@@ -1001,14 +1001,14 @@ void Lucerna::fxToggle() {
 }
 
 void Lucerna::refreshObjectList() {
-	_vm->_gyro->_dna._carryNum = 0;
-	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1])
+	_vm->_gyro->_carryNum = 0;
+	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_objects[_vm->_gyro->_thinks - 1])
 		thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money
 
 	for (byte i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_dna._objects[i]) {
-			_vm->_gyro->_dna._carryNum++;
-			_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1;
+		if (_vm->_gyro->_objects[i]) {
+			_vm->_gyro->_carryNum++;
+			_vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1;
 		}
 	}
 }
@@ -1017,7 +1017,7 @@ void Lucerna::refreshObjectList() {
  * @remarks	Originally called 'verte'
  */
 void Lucerna::guideAvvy(Common::Point cursorPos) {
-	if (!_vm->_gyro->_dna._userMovesAvvy)
+	if (!_vm->_gyro->_userMovesAvvy)
 		return;
 
 	cursorPos.y /= 2;
@@ -1104,7 +1104,7 @@ void Lucerna::checkClick() {
 			_vm->_parser->plotText();
 		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
 			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
-				if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake)
+				if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake)
 					useCompass(cursorPos);
 			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
@@ -1167,19 +1167,19 @@ void Lucerna::dawn() {
 }
 
 void Lucerna::drawDirection() { // It's data is loaded in load_digits().
-	if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction)
+	if (_vm->_gyro->_oldDirection == _vm->_gyro->_direction)
 		return;
 
-	_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction;
+	_vm->_gyro->_oldDirection = _vm->_gyro->_direction;
 
 	CursorMan.showMouse(false);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_direction], 0, 161);
 	CursorMan.showMouse(true);
 }
 
 
 void Lucerna::gameOver() {
-	_vm->_gyro->_dna._userMovesAvvy = false;
+	_vm->_gyro->_userMovesAvvy = false;
 
 	int16 sx = _vm->_animation->_sprites[0]._x;
 	int16 sy = _vm->_animation->_sprites[0]._y;
@@ -1196,7 +1196,7 @@ void Lucerna::gameOver() {
 void Lucerna::minorRedraw() {
 	dusk();
 
-	enterRoom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant.
+	enterRoom(_vm->_gyro->_room, 0); // Ped unknown or non-existant.
 
 	for (byte i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4e11451..2830e9e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -561,19 +561,19 @@ void Scrolls::setBubbleStateNatural() {
 Common::String Scrolls::displayMoney() {
 	Common::String result;
 
-	if (_vm->_gyro->_dna._money < 12) { // just pence
-		result = Common::String::format("%dd", _vm->_gyro->_dna._money);
-	} else if (_vm->_gyro->_dna._money < 240) { // shillings & pence
-		if ((_vm->_gyro->_dna._money % 12) == 0)
-			result = Common::String::format("%d/-", _vm->_gyro->_dna._money / 12);
+	if (_vm->_gyro->_money < 12) { // just pence
+		result = Common::String::format("%dd", _vm->_gyro->_money);
+	} else if (_vm->_gyro->_money < 240) { // shillings & pence
+		if ((_vm->_gyro->_money % 12) == 0)
+			result = Common::String::format("%d/-", _vm->_gyro->_money / 12);
 		else
-			result = Common::String::format("%d/%d", _vm->_gyro->_dna._money / 12, _vm->_gyro->_dna._money % 12);
+			result = Common::String::format("%d/%d", _vm->_gyro->_money / 12, _vm->_gyro->_money % 12);
 	} else { // L, s & d
-		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_dna._money / 240, (_vm->_gyro->_dna._money / 12) % 20, 
-		                _vm->_gyro->_dna._money % 12);
+		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20, 
+		                _vm->_gyro->_money % 12);
 	}
-	if (_vm->_gyro->_dna._money > 12) {
-		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_dna._money);
+	if (_vm->_gyro->_money > 12) {
+		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money);
 		result += extraStr;
 	}
 
@@ -703,45 +703,45 @@ void Scrolls::callScrollDriver() {
 					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
 				case 2: {
-					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum;
+					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum;
 					displayText(_vm->_acci->kVocabulary[pwdId]._word + kControlToBuffer);
 					}
 					break;
 				case 3:
-					displayText(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer);
+					displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer);
 					break;
 				case 4:
-					displayText(_vm->_gyro->_dna._favouriteSong + kControlToBuffer);
+					displayText(_vm->_gyro->_favouriteSong + kControlToBuffer);
 					break;
 				case 5:
-					displayText(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer);
+					displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer);
 					break;
 				case 6:
-					displayText(_vm->_gyro->_dna._spareEvening + kControlToBuffer);
+					displayText(_vm->_gyro->_spareEvening + kControlToBuffer);
 					break;
 				case 9: {
-					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_dna._catacombX, _vm->_gyro->_dna._catacombY, kControlToBuffer);
+					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_catacombX, _vm->_gyro->_catacombY, kControlToBuffer);
 					displayText(tmpStr);
 					}
 					break;
 				case 10:
-					switch (_vm->_gyro->_dna._boxContent) {
+					switch (_vm->_gyro->_boxContent) {
 					case 0: // Sixpence.
 						_vm->_visa->displayScrollChain('q', 37); // You find the sixpence.
-						_vm->_gyro->_dna._money += 6;
-						_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing;
+						_vm->_gyro->_money += 6;
+						_vm->_gyro->_boxContent = _vm->_acci->kNothing;
 						_vm->_lucerna->incScore(2);
 						return;
 					case Acci::kNothing:
 						displayText("nothing at all. It's completely empty.");
 						break;
 					default:
-						displayText(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.');
+						displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.');
 					}
 					break;
 				case 11:
 					for (byte j = 0; j < kObjectNum; j++) {
-						if (_vm->_gyro->_dna._objects[j]) 
+						if (_vm->_gyro->_objects[j]) 
 							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
 					}
 					break;
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index b5eb6a4..22ee7fc 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -64,8 +64,8 @@ void Sequence::thenShow(byte what) {
 void Sequence::thenFlip(byte where, byte ped) {
 	thenShow(kNowFlip);
 
-	_vm->_gyro->_dna._flipToWhere = where;
-	_vm->_gyro->_dna._flipToPed = ped;
+	_vm->_gyro->_flipToWhere = where;
+	_vm->_gyro->_flipToPed = ped;
 }
 
 void Sequence::startToClose() {
@@ -74,7 +74,7 @@ void Sequence::startToClose() {
 }
 
 void Sequence::startToOpen() {
-	_vm->_gyro->_dna._userMovesAvvy = false; // They can't move.
+	_vm->_gyro->_userMovesAvvy = false; // They can't move.
 	_vm->_animation->stopWalking(); // And they're not moving now.
 	startToClose(); // Apart from that, it's the same thing.
 }
@@ -89,8 +89,8 @@ void Sequence::callSequencer() {
 		return; // No more routines.
 		break;
 	case 177: // Flip room.
-		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_animation->flipRoom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed);
+		_vm->_gyro->_userMovesAvvy = true;
+		_vm->_animation->flipRoom(_vm->_gyro->_flipToWhere, _vm->_gyro->_flipToPed);
 		if (_seq[0] == 177)
 			shoveLeft();
 		break;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index b88c53d..019f2da 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -220,7 +220,7 @@ void Timer::updateTimer() {
 		}
 	}
 	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
-	_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
+	_vm->_gyro->_totalTime++; // Total amount of time for this game.
 }
 
 void Timer::loseTimer(byte which) {
@@ -233,20 +233,20 @@ void Timer::loseTimer(byte which) {
 }
 
 void Timer::openDrawbridge() {
-	_vm->_gyro->_dna._drawbridgeOpen++;
-	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
+	_vm->_gyro->_drawbridgeOpen++;
+	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 1);
 
-	if (_vm->_gyro->_dna._drawbridgeOpen == 4)
+	if (_vm->_gyro->_drawbridgeOpen == 4)
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 	else
 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
 
 void Timer::avariciusTalks() {
-	_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
-	_vm->_gyro->_dna._avariciusTalk++;
+	_vm->_visa->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
+	_vm->_gyro->_avariciusTalk++;
 
-	if (_vm->_gyro->_dna._avariciusTalk < 17)
+	if (_vm->_gyro->_avariciusTalk < 17)
 		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
 	else
 		_vm->_lucerna->incScore(3);
@@ -277,20 +277,20 @@ void Timer::stairs() {
 	_vm->_gyro->blip();
 	_vm->_animation->_sprites[0].walkTo(4);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-	_vm->_gyro->_dna._brummieStairs = 2;
+	_vm->_gyro->_brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
 	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
 	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timer::cardiffSurvey() {
-	if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
-		_vm->_gyro->_dna._cardiffQuestionNum++;
+	if (_vm->_gyro->_cardiffQuestionNum == 0) {
+		_vm->_gyro->_cardiffQuestionNum++;
 		_vm->_visa->displayScrollChain('q', 27);
 	}
 
-	_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum);
-	_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
+	_vm->_visa->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
+	_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
@@ -305,8 +305,8 @@ void Timer::cwytalotInHerts() {
 
 void Timer::getTiedUp() {
 	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
-	_vm->_gyro->_dna._userMovesAvvy = false;
-	_vm->_gyro->_dna._beenTiedUp = true;
+	_vm->_gyro->_userMovesAvvy = false;
+	_vm->_gyro->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
 	_vm->_animation->_sprites[1].stopWalk();
 	_vm->_animation->_sprites[1].stopHoming();
@@ -319,7 +319,7 @@ void Timer::getTiedUp2() {
 	_vm->_animation->_sprites[0].walkTo(4);
 	_vm->_animation->_sprites[1].walkTo(5);
 	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries.
-	_vm->_gyro->_dna._friarWillTieYouUp = true;
+	_vm->_gyro->_friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
@@ -344,20 +344,20 @@ void Timer::hangAround2() {
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
 
-	_vm->_gyro->_dna._tiedUp = false;
+	_vm->_gyro->_tiedUp = false;
 
 	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
 }
 
 void Timer::afterTheShootemup() {
 
-	_vm->_animation->flipRoom(_vm->_gyro->_dna._room, 0);
+	_vm->_animation->flipRoom(_vm->_gyro->_room, 0);
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(1, 2);
-	_vm->_gyro->_dna._userMovesAvvy = true;
-	_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = true;
+	_vm->_gyro->_userMovesAvvy = true;
+	_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
@@ -386,9 +386,9 @@ void Timer::afterTheShootemup() {
 }
 
 void Timer::jacquesWakesUp() {
-	_vm->_gyro->_dna._jacquesState++;
+	_vm->_gyro->_jacquesState++;
 
-	switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
+	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
 		_vm->_visa->displayScrollChain('Q', 45);
@@ -405,13 +405,13 @@ void Timer::jacquesWakesUp() {
 		break;
 	}
 
-	if (_vm->_gyro->_dna._jacquesState == 5) {
-		_vm->_gyro->_dna._bellsAreRinging = true;
-		_vm->_gyro->_dna._aylesIsAwake = true;
+	if (_vm->_gyro->_jacquesState == 5) {
+		_vm->_gyro->_bellsAreRinging = true;
+		_vm->_gyro->_aylesIsAwake = true;
 		_vm->_lucerna->incScore(2);
 	}
 
-	switch (_vm->_gyro->_dna._jacquesState) {
+	switch (_vm->_gyro->_jacquesState) {
 	case 1:
 	case 2:
 	case 3:
@@ -450,9 +450,9 @@ void Timer::naughtyDuke3() {
 }
 
 void Timer::jump() {
-	_vm->_gyro->_dna._jumpStatus++;
+	_vm->_gyro->_jumpStatus++;
 
-	switch (_vm->_gyro->_dna._jumpStatus) {
+	switch (_vm->_gyro->_jumpStatus) {
 	case 1:
 	case 2:
 	case 3:
@@ -471,24 +471,24 @@ void Timer::jump() {
 		break;
 	}
 
-	if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
-		_vm->_gyro->_dna._userMovesAvvy = true;
-		_vm->_gyro->_dna._jumpStatus = 0;
+	if (_vm->_gyro->_jumpStatus == 20) { // End of jump.
+		_vm->_gyro->_userMovesAvvy = true;
+		_vm->_gyro->_jumpStatus = 0;
 	} else { // Still jumping.
 		addTimer(1, kProcJump, kReasonJumping);
 	}
 
-	if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
-			&& (_vm->_gyro->_dna._arrowInTheDoor == true)
+	if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
+			&& (_vm->_gyro->_room == r__insidecardiffcastle)
+			&& (_vm->_gyro->_arrowInTheDoor == true)
 			&& (_vm->_animation->inField(3))) { // Beside the wall
 		// Grab the arrow!
-		if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
+		if (_vm->_gyro->_carryNum >= kCarryLimit)
 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
-			_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = true;
+			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
+			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
 			_vm->_visa->displayScrollChain('q', 50);
 			_vm->_lucerna->incScore(3);
@@ -498,14 +498,14 @@ void Timer::jump() {
 
 void Timer::crapulusSaysSpludOut() {
 	_vm->_visa->displayScrollChain('q', 56);
-	_vm->_gyro->_dna._crapulusWillTell = false;
+	_vm->_gyro->_crapulusWillTell = false;
 }
 
 void Timer::buyDrinks() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->_dna._malagauche = 0;
+	_vm->_gyro->_malagauche = 0;
 
-	_vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it.
+	_vm->_visa->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
 	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
@@ -515,15 +515,15 @@ void Timer::buyDrinks() {
 
 void Timer::buyWine() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
-	_vm->_gyro->_dna._malagauche = 0;
+	_vm->_gyro->_malagauche = 0;
 
 	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
 	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) {
 		_vm->_visa->displayScrollChain('D', 4); // You paid up.
-		_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = true;
+		_vm->_gyro->_objects[Gyro::kObjectWine - 1] = true;
 		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_dna._wineState = 1; // OK Wine.
+		_vm->_gyro->_wineState = 1; // OK Wine.
 	}
 }
 
@@ -534,7 +534,7 @@ void Timer::callsGuards() {
 
 void Timer::greetsMonk() {
 	_vm->_visa->displayScrollChain('Q', 59);
-	_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
+	_vm->_gyro->_enteredLustiesRoomAsMonk = true;
 }
 
 void Timer::fallDownOubliette() {
@@ -545,13 +545,13 @@ void Timer::fallDownOubliette() {
 }
 
 void Timer::meetAvaroid() {
-	if (_vm->_gyro->_dna._metAvaroid) {
+	if (_vm->_gyro->_metAvaroid) {
 		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Scrolls::kControlItalic, Scrolls::kControlRoman);
 		_vm->_scrolls->displayText(tmpStr);
 		_vm->_lucerna->gameOver();
 	} else {
 		_vm->_visa->displayScrollChain('Q', 60);
-		_vm->_gyro->_dna._metAvaroid = true;
+		_vm->_gyro->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
 		_vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft;
@@ -570,7 +570,7 @@ void Timer::riseUpOubliette() {
 	if (_vm->_animation->_sprites[0]._moveY > 0)
 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
-		_vm->_gyro->_dna._userMovesAvvy = true;
+		_vm->_gyro->_userMovesAvvy = true;
 }
 
 void Timer::robinHoodAndGeida() {
@@ -580,7 +580,7 @@ void Timer::robinHoodAndGeida() {
 	_vm->_animation->_sprites[1].stopWalk();
 	_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
-	_vm->_gyro->_dna._geidaFollows = false;
+	_vm->_gyro->_geidaFollows = false;
 }
 
 void Timer::robinHoodAndGeidaTalk() {
@@ -598,7 +598,7 @@ void Timer::avalotReturns() {
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 1);
 	_vm->_visa->displayScrollChain('q', 67);
-	_vm->_gyro->_dna._userMovesAvvy = true;
+	_vm->_gyro->_userMovesAvvy = true;
 }
 
 /**
@@ -611,8 +611,8 @@ void Timer::avvySitDown() {
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_dna._sittingInPub = true;
-		_vm->_gyro->_dna._userMovesAvvy = false;
+		_vm->_gyro->_sittingInPub = true;
+		_vm->_gyro->_userMovesAvvy = false;
 		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
@@ -623,7 +623,7 @@ void Timer::ghostRoomPhew() {
 }
 
 void Timer::arkataShouts() {
-	if (_vm->_gyro->_dna._teetotal)
+	if (_vm->_gyro->_teetotal)
 		return;
 
 	_vm->_visa->displayScrollChain('q', 76);
@@ -676,7 +676,7 @@ void Timer::spludwickLeavesCauldron() {
 void Timer::giveLuteToGeida() { // Moved here from Acci.
 	_vm->_visa->displayScrollChain('Q', 86);
 	_vm->_lucerna->incScore(4);
-	_vm->_gyro->_dna._lustieIsAsleep = true;
+	_vm->_gyro->_lustieIsAsleep = true;
 	_vm->_sequence->firstShow(5);
 	_vm->_sequence->thenShow(6); // He falls asleep...
 	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index 931f10f..a7125d4 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -159,19 +159,19 @@ void Visa::talkTo(byte whom) {
 	if (_vm->_gyro->_subjectNum == 0) {
 		switch (whom) {
 		case Gyro::kPeopleSpludwick:
-			if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1])) {
+			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
 				displayScrollChain('q', 68);
-				_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true;
+				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_lucerna->incScore(3);
 				return;
-			} else if (_vm->_gyro->_dna._talkedToCrapulus) {
+			} else if (_vm->_gyro->_talkedToCrapulus) {
 				// Spludwick - what does he need?
 				// 0 - let it through to use normal routine.
-				switch (_vm->_gyro->_dna._givenToSpludwick) {
+				switch (_vm->_gyro->_givenToSpludwick) {
 				case 1: // Fallthrough is intended.
 				case 2: {
-					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]);
+					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
 					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 					_vm->_scrolls->displayText(tmpStr);
 					}
@@ -186,23 +186,23 @@ void Visa::talkTo(byte whom) {
 			}
 			break;
 		case Gyro::kPeopleIbythneth:
-			if (_vm->_gyro->_dna._givenBadgeToIby) {
+			if (_vm->_gyro->_givenBadgeToIby) {
 				displayScrollChain('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
 		case Gyro::kPeopleDogfood:
-			if (_vm->_gyro->_dna._wonNim) { // We've won the game.
+			if (_vm->_gyro->_wonNim) { // We've won the game.
 				displayScrollChain('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
-				_vm->_gyro->_dna._askedDogfoodAboutNim = true;
+				_vm->_gyro->_askedDogfoodAboutNim = true;
 			break;
 		case Gyro::kPeopleAyles:
-			if (!_vm->_gyro->_dna._aylesIsAwake) {
+			if (!_vm->_gyro->_aylesIsAwake) {
 				displayScrollChain('q', 43); // He's fast asleep!
 				return;
-			} else if (!_vm->_gyro->_dna._givenPenToAyles) {
+			} else if (!_vm->_gyro->_givenPenToAyles) {
 				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
 				return;
 			}
@@ -213,29 +213,29 @@ void Visa::talkTo(byte whom) {
 			return;
 
 		case Gyro::kPeopleGeida:
-			if (_vm->_gyro->_dna._givenPotionToGeida)
-				_vm->_gyro->_dna._geidaFollows = true;
+			if (_vm->_gyro->_givenPotionToGeida)
+				_vm->_gyro->_geidaFollows = true;
 			else {
 				displayScrollChain('u', 17);
 				return;
 			}
 			break;
 		case Gyro::kPeopleSpurge:
-			if (!_vm->_gyro->_dna._sittingInPub) {
+			if (!_vm->_gyro->_sittingInPub) {
 				displayScrollChain('q', 71); // Try going over and sitting down.
 				return;
 			} else {
-				if (_vm->_gyro->_dna._spurgeTalkCount < 5)
-					_vm->_gyro->_dna._spurgeTalkCount++;
-				if (_vm->_gyro->_dna._spurgeTalkCount > 1) { // no. 1 falls through
-					displayScrollChain('q', 70 + _vm->_gyro->_dna._spurgeTalkCount);
+				if (_vm->_gyro->_spurgeTalkCount < 5)
+					_vm->_gyro->_spurgeTalkCount++;
+				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
+					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
 					return;
 				}
 			}
 			break;
 		}
 	// On a subject. Is there any reason to block it?
-	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) {
+	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
 		displayScrollChain('q', 43); // He's fast asleep!
 		return;
 	}
@@ -264,10 +264,10 @@ void Visa::talkTo(byte whom) {
 		displayScrollChain('n', whom); // File not found!
 
 	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = true;
+		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
-		_vm->_gyro->_dna._talkedToCrapulus = true;
+		_vm->_gyro->_talkedToCrapulus = true;
 		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
 		_vm->_animation->_sprites[1]._vanishIfStill = true;


Commit: b083878dbefeb95c9bc9d4493839121565da6342
    https://github.com/scummvm/scummvm/commit/b083878dbefeb95c9bc9d4493839121565da6342
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-13T13:58:24-07:00

Commit Message:
AVALANCHE: Remove duplicated direction enum, move direction to animation class

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 747bcca..8387b0f 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1160,7 +1160,7 @@ void Acci::standUp() {
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
 			_vm->_animation->appearPed(1, 2);
-			_vm->_gyro->_direction = Gyro::kDirectionLeft;
+			_vm->_animation->_direction = Animation::kDirLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_avvyInBed = false;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index bdca9fd..5ce809c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1279,7 +1279,7 @@ void Animation::animLink() {
 
 void Animation::stopWalking() {
 	_sprites[0].stopWalk();
-	_vm->_gyro->_direction = kDirStopped;
+	_direction = kDirStopped;
 	if (_vm->_gyro->_alive)
 		_sprites[0]._stepNum = 1;
 }
@@ -1348,8 +1348,8 @@ void Animation::flipRoom(byte room, byte ped) {
 	_vm->_lucerna->enterRoom(room, ped);
 	appearPed(1, ped);
 	_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
-	_vm->_gyro->_oldDirection = _vm->_gyro->_direction;
-	_vm->_gyro->_direction = _sprites[0]._facingDir;
+	_oldDirection = _direction;
+	_direction = _sprites[0]._facingDir;
 	_vm->_lucerna->drawDirection();
 
 	_vm->_lucerna->dawn();
@@ -1393,58 +1393,58 @@ void Animation::handleMoveKey(const Common::Event &event) {
 	else {
 		switch (event.kbd.keycode) {
 		case Common::KEYCODE_UP:
-			if (_vm->_gyro->_direction != kDirUp) {
-				_vm->_gyro->_direction = kDirUp;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirUp) {
+				_direction = kDirUp;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_DOWN:
-			if (_vm->_gyro->_direction != kDirDown) {
-				_vm->_gyro->_direction = kDirDown;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirDown) {
+				_direction = kDirDown;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_LEFT:
-			if (_vm->_gyro->_direction != kDirLeft) {
-				_vm->_gyro->_direction = kDirLeft;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirLeft) {
+				_direction = kDirLeft;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_RIGHT:
-			if (_vm->_gyro->_direction != kDirRight) {
-				_vm->_gyro->_direction = kDirRight;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirRight) {
+				_direction = kDirRight;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
-			if (_vm->_gyro->_direction != kDirUpRight) {
-				_vm->_gyro->_direction = kDirUpRight;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirUpRight) {
+				_direction = kDirUpRight;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
-			if (_vm->_gyro->_direction != kDirDownRight) {
-				_vm->_gyro->_direction = kDirDownRight;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirDownRight) {
+				_direction = kDirDownRight;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_END:
-			if (_vm->_gyro->_direction != kDirDownLeft) {
-				_vm->_gyro->_direction = kDirDownLeft;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirDownLeft) {
+				_direction = kDirDownLeft;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_HOME:
-			if (_vm->_gyro->_direction != kDirUpLeft) {
-				_vm->_gyro->_direction = kDirUpLeft;
-				changeDirection(0, _vm->_gyro->_direction);
+			if (_direction != kDirUpLeft) {
+				_direction = kDirUpLeft;
+				changeDirection(0, _direction);
 			} else
 				stopWalking();
 			break;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 73abada..185f2f8 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -113,6 +113,8 @@ public:
 	AnimationType _sprites[kSpriteNumbMax];
 	bool _mustExclaim;
 	uint16 _sayWhat;
+	byte _direction; // The direction Avvy is currently facing.
+	byte _oldDirection;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 611a8ef..a5acf09 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -123,7 +123,7 @@ const char *AvalancheEngine::getCopyrightString() const {
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
-	sz.syncAsByte(_gyro->_direction);
+	sz.syncAsByte(_animation->_direction);
 	sz.syncAsByte(_gyro->_carryNum);
 	for (byte i = 0; i < kObjectNum; i++)
 		sz.syncAsByte(_gyro->_objects[i]);
@@ -459,7 +459,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_scrolls->displayText(tmpStr);
 
 	if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible)
-		_animation->changeDirection(0, _gyro->_direction); // We push Avvy in the right direction is he was moving.
+		_animation->changeDirection(0, _animation->_direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
@@ -487,6 +487,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 			day += "th";
 		}
 
+	// Y2K compliant ;)
 	return day + ' ' + month + ' ' + _gyro->intToStr(y + 1900);
 }
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5a9fa60..a4ead4a 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -147,7 +147,7 @@ void Avalot::setup() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_gyro->_defaultLed = 2;
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_gyro->_direction = Gyro::kDirectionStopped;
+	_vm->_animation->_direction = Animation::kDirStopped;
 	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index d9e0d74..1b95073 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -227,7 +227,7 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
 
 void Gyro::resetVariables() {
 // Replaces memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
-	_direction = 0;
+	_vm->_animation->_direction = 0;
 	_carryNum = 0;
 	for (int i = 0; i < kObjectNum; i++)
 		_objects[i] = false;
@@ -326,7 +326,7 @@ void Gyro::newGame() {
 	_spareEvening = "answer a questionnaire";
 	_favouriteDrink = "beer";
 	_money = 30; // 2/6
-	_direction = kDirectionStopped;
+	_vm->_animation->_direction = Animation::kDirStopped;
 	_wearing = kObjectClothes;
 	_objects[kObjectMoney - 1] = true;
 	_objects[kObjectBodkin - 1] = true;
@@ -339,7 +339,7 @@ void Gyro::newGame() {
 	_onToolbar = false;
 	_seeScroll = false;
 
-	_vm->_animation->_sprites[0].appear(300,117,kDirectionRight); // Needed to initialize Avalot.
+	_vm->_animation->_sprites[0].appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	_him = 254;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 35addc3..7581863 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -211,24 +211,12 @@ public:
 	// These following static constants should be included in CFG when it's written.
 
 	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
-
 	static const int16 kBorder = 1; // size of border on shadowboxes
-
-	enum Direction {
-		kDirectionUp, kDirectionRight, kDirectionDown, kDirectionLeft,
-		kDirectionUpRight, kDirectionDownRight, kDirectionDownLeft, kDirectionUpLeft,
-		kDirectionStopped
-	};
-
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
-
 	static const int32 kCatacombMap[8][8];
-
 	static const bool kDemo = false; // If this is true, we're in a demo of the game.
-
 	static const char kSpludwicksOrder[3];
-
 	static const QuasipedType kQuasipeds[16];
 
 	enum Pitch {
@@ -255,7 +243,6 @@ public:
 	bool _onCanDoPageSwap;
 
 	// Former DNA structure
-	byte _direction; // The direction Avvy is currently facing.
 	byte _carryNum; // How many objects you're carrying...
 	bool _objects[kObjectNum]; // ...and which ones they are.
 	int16 _dnascore; // your score, of course
@@ -343,7 +330,6 @@ public:
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	// Called .free() for them in ~Gyro().
-	byte _oldDirection;
 	int8 _scoreToDisplay[3];
 	byte _currentMouse; // current mouse-void
 	Common::String _verbStr; // what you can do with your object. :-)
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 12b7552..9a7d048 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -913,7 +913,7 @@ void Lucerna::drawToolbar() {
 	file.close();
 
 	CursorMan.showMouse(true);
-	_vm->_gyro->_oldDirection = 177;
+	_vm->_animation->_oldDirection = 177;
 	drawDirection();
 }
 
@@ -967,22 +967,22 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
 
 	switch (color) {
 	case kColorGreen:
-		_vm->_gyro->_direction = Animation::kDirUp;
+		_vm->_animation->_direction = Animation::kDirUp;
 		_vm->_animation->changeDirection(0, Animation::kDirUp);
 		drawDirection();
 		break;
 	case kColorBrown:
-		_vm->_gyro->_direction = Animation::kDirDown;
+		_vm->_animation->_direction = Animation::kDirDown;
 		_vm->_animation->changeDirection(0, Animation::kDirDown);
 		drawDirection();
 		break;
 	case kColorCyan:
-		_vm->_gyro->_direction = Animation::kDirLeft;
+		_vm->_animation->_direction = Animation::kDirLeft;
 		_vm->_animation->changeDirection(0, Animation::kDirLeft);
 		drawDirection();
 		break;
 	case kColorLightmagenta:
-		_vm->_gyro->_direction = Animation::kDirRight;
+		_vm->_animation->_direction = Animation::kDirRight;
 		_vm->_animation->changeDirection(0, Animation::kDirRight);
 		drawDirection();
 		break;
@@ -1167,13 +1167,13 @@ void Lucerna::dawn() {
 }
 
 void Lucerna::drawDirection() { // It's data is loaded in load_digits().
-	if (_vm->_gyro->_oldDirection == _vm->_gyro->_direction)
+	if (_vm->_animation->_oldDirection == _vm->_animation->_direction)
 		return;
 
-	_vm->_gyro->_oldDirection = _vm->_gyro->_direction;
+	_vm->_animation->_oldDirection = _vm->_animation->_direction;
 
 	CursorMan.showMouse(false);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_direction], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_animation->_direction], 0, 161);
 	CursorMan.showMouse(true);
 }
 
@@ -1240,7 +1240,7 @@ void Lucerna::spriteRun() {
 
 void Lucerna::fixFlashers() {
 	_vm->_gyro->_ledStatus = 177;
-	_vm->_gyro->_oldDirection = 177;
+	_vm->_animation->_oldDirection = 177;
 	_vm->_scrolls->setReadyLight(2);
 	drawDirection();
 }


Commit: a773f0eb2bc93af65769160f0f5359e7c6e2168a
    https://github.com/scummvm/scummvm/commit/a773f0eb2bc93af65769160f0f5359e7c6e2168a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-13T14:18:53-07:00

Commit Message:
AVALANCHE: Remove some dead/useless code

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 8387b0f..c31bc90 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1532,12 +1532,6 @@ void Acci::doThat() {
 		_vm->_scrolls->displayText("Vandalism is prohibited within this game!");
 		break;
 	case kVerbCodeQuit: // quit
-		if (_vm->_gyro->kDemo) {
-			warning("STUB: Acci::doThat() - case kVerbCodequit");
-		//	_vm->_visa->displayScrollChain('pos', 31);
-		//	close(demofile);
-		//	exit(0); // Change this later!!!
-		}
 		if (!_polite)
 			_vm->_scrolls->displayText("How about a `please\", Avvy?");
 		else if (_vm->_scrolls->displayQuestion(Common::String(Scrolls::kControlRegister) + 'C' + Scrolls::kControlIcon + "Do you really want to quit?"))
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 1b95073..17d21f4 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -318,7 +318,6 @@ void Gyro::newGame() {
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
 
 	_alive = true;
-	_score = 0;
 	resetVariables();
 
 	_vm->_scrolls->setBubbleStateNatural();
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 7581863..20e240a 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -215,7 +215,6 @@ public:
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
 	static const int32 kCatacombMap[8][8];
-	static const bool kDemo = false; // If this is true, we're in a demo of the game.
 	static const char kSpludwicksOrder[3];
 	static const QuasipedType kQuasipeds[16];
 
@@ -319,7 +318,7 @@ public:
 	bool _weirdWord;
 	bool _letMeOut;
 	Common::String _scroll[15];
-	byte _scrollNum, _score, _whichwas;
+	byte _scrollNum, _whichwas;
 	byte _thinks;
 	bool _thinkThing;
 	int16 _talkX, _talkY;
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 9a7d048..76329e3 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -918,9 +918,6 @@ void Lucerna::drawToolbar() {
 }
 
 void Lucerna::drawScore() {
-	if (_vm->_gyro->kDemo)
-		return;
-
 	uint16 score = _vm->_gyro->_dnascore;
 	int8 numbers[3] = {0, 0, 0};
 	for (byte i = 0; i < 2; i++) {


Commit: c288b09ca094422e484fd6d686dd8209cc69b0ac
    https://github.com/scummvm/scummvm/commit/c288b09ca094422e484fd6d686dd8209cc69b0ac
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-13T14:30:08-07:00

Commit Message:
AVALANCHE: Simplify the use of string for displayQuestion()

Changed paths:
    engines/avalanche/acci2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index c31bc90..95cd06a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1534,8 +1534,11 @@ void Acci::doThat() {
 	case kVerbCodeQuit: // quit
 		if (!_polite)
 			_vm->_scrolls->displayText("How about a `please\", Avvy?");
-		else if (_vm->_scrolls->displayQuestion(Common::String(Scrolls::kControlRegister) + 'C' + Scrolls::kControlIcon + "Do you really want to quit?"))
-			_vm->_gyro->_letMeOut = true;
+		else {
+			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Scrolls::kControlRegister, Scrolls::kControlIcon);
+			if (_vm->_scrolls->displayQuestion(tmpStr))
+				_vm->_gyro->_letMeOut = true;
+		}
 		break;
 	case kVerbCodeGo:
 		_vm->_scrolls->displayText("Just use the arrow keys to walk there.");


Commit: ef219d5c99adf8dab171c45fbb7f03921f485e2b
    https://github.com/scummvm/scummvm/commit/ef219d5c99adf8dab171c45fbb7f03921f485e2b
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-13T16:44:13-07:00

Commit Message:
AVALANCHE: Silence clang warning.

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/acci2.h
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 8387b0f..c5a5a8e 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -48,123 +48,287 @@
 
 namespace Avalanche {
 
-const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
+Acci::Acci(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Acci::init() {
+	_vm->_gyro->_weirdWord = false;
+
+	// Initailaze the vocabulary.
 	// Verbs: 1-49
-	{1, "EXAMINE"},      {1, "READ"},      {1, "XAM"}, // short
-	{2, "OPEN"},         {2, "LEAVE"},     {2, "UNLOCK"},
-	{3, "PAUSE"},        {47, "TA"}, // Early to avoid Take and Talk.
-	{4, "TAKE"},         {4, "GET"},       {4, "PICK"},
-	{5, "DROP"},         {6, "INVENTORY"}, {7, "TALK"},
-	{7, "SAY"},          {7, "ASK"},
-	{8, "GIVE"},         {9, "DRINK"},     {9, "IMBIBE"},
-	{9, "DRAIN"},        {10, "LOAD"},     {10, "RESTORE"},
-	{11, "SAVE"},        {12, "BRIBE"},    {12, "PAY"},
-	{13, "LOOK"},        {14, "BREAK"},    {15, "QUIT"},
-	{15, "EXIT"},        {16, "SIT"},      {16, "SLEEP"},
-	{17, "STAND"},
-	{18, "GO"},          {19, "INFO"},      {20, "UNDRESS"},
-	{20, "DOFF"},
-	{21, "DRESS"},       {21, "WEAR"},      {21, "DON"},
-	{22, "PLAY"},
-	{22, "STRUM"},       {23, "RING"},      {24, "HELP"},
-	{25, "KENDAL"},      {26, "CAPYBARA"},  {27, "BOSS"},
-	{255, "NINET"}, // block for NINETY
-	{28, "URINATE"},     {28, "MINGITE"},   {29, "NINETY"},
-	{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
-	{30, "HOCUS"},       {30, "POCUS"},     {30, "IZZY"},
-	{30, "WIZZY"},       {30, "PLOVER"},
-	{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
-	{30, "THURB"},       {30, "SNOEZE"},    {30, "SAMOHT"},
-	{30, "NOSIDE"},      {30, "PHUGGG"},    {30, "KNERL"},
-	{30, "MAGIC"},       {30, "KLAETU"},    {30, "VODEL"},
-	{30, "BONESCROLLS"}, {30, "RADOF"},
-	{31, "RESTART"},
-	{32, "SWALLOW"},     {32, "EAT"},       {33, "LISTEN"},
-	{33, "HEAR"},        {34, "BUY"},       {34, "PURCHASE"},
-	{34, "ORDER"},       {34, "DEMAND"},
-	{35, "ATTACK"},      {35, "HIT"},       {35, "KILL"},
-	{35, "PUNCH"},       {35, "KICK"},      {35, "SHOOT"},
-	{35, "FIRE"},
+	_vocabulary[0].init(1, "EXAMINE");
+	_vocabulary[1].init(1, "READ");
+	_vocabulary[2].init(1, "XAM");
+	_vocabulary[3].init(2, "OPEN");
+	_vocabulary[4].init(2, "LEAVE");
+	_vocabulary[5].init(2, "UNLOCK");
+	_vocabulary[6].init(3, "PAUSE");
+	_vocabulary[7].init(47, "TA"); // Early to avoid Take and Talk.
+	_vocabulary[8].init(4, "TAKE");
+	_vocabulary[9].init(4, "GET");
+	_vocabulary[10].init(4, "PICK");
+	_vocabulary[11].init(5, "DROP");
+	_vocabulary[12].init(6, "INVENTORY");
+	_vocabulary[13].init(7, "TALK");
+	_vocabulary[14].init(7, "SAY");
+	_vocabulary[15].init(7, "ASK");
+	_vocabulary[16].init(8, "GIVE");
+	_vocabulary[17].init(9, "DRINK");
+	_vocabulary[18].init(9, "IMBIBE");
+	_vocabulary[19].init(9, "DRAIN");
+	_vocabulary[20].init(10, "LOAD");
+	_vocabulary[21].init(10, "RESTORE");
+	_vocabulary[22].init(11, "SAVE");
+	_vocabulary[23].init(12, "BRIBE");
+	_vocabulary[24].init(12, "PAY");
+	_vocabulary[25].init(13, "LOOK");
+	_vocabulary[26].init(14, "BREAK");
+	_vocabulary[27].init(15, "QUIT");
+	_vocabulary[28].init(15, "EXIT");
+	_vocabulary[29].init(16, "SIT");
+	_vocabulary[30].init(16, "SLEEP");
+	_vocabulary[31].init(17, "STAND");
+
+	_vocabulary[32].init(18, "GO");
+	_vocabulary[33].init(19, "INFO");
+	_vocabulary[34].init(20, "UNDRESS");
+	_vocabulary[35].init(20, "DOFF");
+	_vocabulary[36].init(21, "DRESS");
+	_vocabulary[37].init(21, "WEAR");
+	_vocabulary[38].init(21, "DON");
+	_vocabulary[39].init(22, "PLAY");
+	_vocabulary[40].init(22, "STRUM");
+	_vocabulary[41].init(23, "RING");
+	_vocabulary[42].init(24, "HELP");
+	_vocabulary[43].init(25, "KENDAL");
+	_vocabulary[44].init(26, "CAPYBARA");
+	_vocabulary[45].init(27, "BOSS");
+	_vocabulary[46].init(255, "NINET"); // block for NINETY
+	_vocabulary[47].init(28, "URINATE");
+	_vocabulary[48].init(28, "MINGITE");
+	_vocabulary[49].init(29, "NINETY");
+	_vocabulary[50].init(30, "ABRACADABRA");
+	_vocabulary[51].init(30, "PLUGH");
+	_vocabulary[52].init(30, "XYZZY");
+	_vocabulary[53].init(30, "HOCUS");
+	_vocabulary[54].init(30, "POCUS");
+	_vocabulary[55].init(30, "IZZY");
+	_vocabulary[56].init(30, "WIZZY");
+	_vocabulary[57].init(30, "PLOVER");
+	_vocabulary[58].init(30, "MELENKURION");
+	_vocabulary[59].init(30, "ZORTON");
+	_vocabulary[60].init(30, "BLERBI");
+	_vocabulary[61].init(30, "THURB");
+	_vocabulary[62].init(30, "SNOEZE");
+	_vocabulary[63].init(30, "SAMOHT");
+	_vocabulary[64].init(30, "NOSIDE");
+	_vocabulary[65].init(30, "PHUGGG");
+	_vocabulary[66].init(30, "KNERL");
+	_vocabulary[67].init(30, "MAGIC");
+	_vocabulary[68].init(30, "KLAETU");
+	_vocabulary[69].init(30, "VODEL");
+	_vocabulary[70].init(30, "BONESCROLLS");
+	_vocabulary[71].init(30, "RADOF");
+
+	_vocabulary[72].init(31, "RESTART");
+	_vocabulary[73].init(32, "SWALLOW");
+	_vocabulary[74].init(32, "EAT");
+	_vocabulary[75].init(33, "LISTEN");
+	_vocabulary[76].init(33, "HEAR");
+	_vocabulary[77].init(34, "BUY");
+	_vocabulary[78].init(34, "PURCHASE");
+	_vocabulary[79].init(34, "ORDER");
+	_vocabulary[80].init(34, "DEMAND");
+	_vocabulary[81].init(35, "ATTACK");
+	_vocabulary[82].init(35, "HIT");
+	_vocabulary[83].init(35, "KILL");
+	_vocabulary[84].init(35, "PUNCH");
+	_vocabulary[85].init(35, "KICK");
+	_vocabulary[86].init(35, "SHOOT");
+	_vocabulary[87].init(35, "FIRE");
 
 	// Passwords: 36
-	{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
-	{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
-	{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
-	{36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
-	{36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
-	{36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
-	{36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
-	{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
-	{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
-	{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},
-	{37, "DIR"},       {37, "LS"},        {38, "DIE"},
-	{39, "SCORE"},
-	{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
-	{41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
-	{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
-	{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
-	{46, "HELLO"},     {46, "HI"},        {46, "YO"},
-	{47, "THANKS"}, // = 47, "ta", which was defined earlier.
+	_vocabulary[88].init(36, "TIROS");
+	_vocabulary[89].init(36, "WORDY");
+	_vocabulary[90].init(36, "STACK");
+	_vocabulary[91].init(36, "SHADOW");
+	_vocabulary[92].init(36, "OWL");
+	_vocabulary[93].init(36, "ACORN");
+	_vocabulary[94].init(36, "DOMESDAY");
+	_vocabulary[95].init(36, "FLOPPY");
+	_vocabulary[96].init(36, "DIODE");
+	_vocabulary[97].init(36, "FIELD");
+	_vocabulary[98].init(36, "COWSLIP");
+	_vocabulary[99].init(36, "OSBYTE");
+	_vocabulary[100].init(36, "OSCLI");
+	_vocabulary[101].init(36, "TIMBER");
+	_vocabulary[102].init(36, "ADVAL");
+	_vocabulary[103].init(36, "NEUTRON");
+	_vocabulary[104].init(36, "POSITRON");
+	_vocabulary[105].init(36, "ELECTRON");
+	_vocabulary[106].init(36, "CIRCUIT");
+	_vocabulary[107].init(36, "AURUM");
+	_vocabulary[108].init(36, "PETRIFY");
+	_vocabulary[109].init(36, "EBBY");
+	_vocabulary[110].init(36, "CATAPULT");
+	_vocabulary[111].init(36, "GAMERS");
+	_vocabulary[112].init(36, "FUDGE");
+	_vocabulary[113].init(36, "CANDLE");
+	_vocabulary[114].init(36, "BEEB");
+	_vocabulary[115].init(36, "MICRO");
+	_vocabulary[116].init(36, "SESAME");
+	_vocabulary[117].init(36, "LORDSHIP");
+
+	_vocabulary[118].init(37, "DIR");
+	_vocabulary[119].init(37, "LS");
+	_vocabulary[120].init(38, "DIE");
+	_vocabulary[121].init(39, "SCORE");
+	_vocabulary[122].init(40, "PUT");
+	_vocabulary[123].init(40, "INSERT");
+	_vocabulary[124].init(41, "KISS");
+	_vocabulary[125].init(41, "SNOG");
+	_vocabulary[126].init(41, "CUDDLE");
+	_vocabulary[127].init(42, "CLIMB");
+	_vocabulary[128].init(42, "CLAMBER");
+	_vocabulary[129].init(43, "JUMP");
+	_vocabulary[130].init(44, "HIGHSCORES");
+	_vocabulary[131].init(44, "HISCORES");
+	_vocabulary[132].init(45, "WAKEN");
+	_vocabulary[133].init(45, "AWAKEN");
+	_vocabulary[134].init(46, "HELLO");
+	_vocabulary[135].init(46, "HI");
+	_vocabulary[136].init(46, "YO");
+	_vocabulary[137].init(47, "THANKS"); // = 47, "ta", which was defined earlier.
 
 	// Nouns - Objects: 50-100
-	{50, "WINE"},       {50, "BOOZE"},    {50, "NASTY"},
-	{50, "VINEGAR"},    {51, "MONEYBAG"},
-	{51, "BAG"},        {51, "CASH"},     {51, "DOSH"},
-	{51, "WALLET"},
-	{52, "BODKIN"},     {52, "DAGGER"},   {53, "POTION"},
-	{54, "CHASTITY"},   {54, "BELT"},     {55, "BOLT"},
-	{55, "ARROW"},      {55, "DART"},
-	{56, "CROSSBOW"},   {56, "BOW"},      {57, "LUTE"},
-	{58, "PILGRIM"},    {58, "BADGE"},    {59, "MUSHROOMS"},
-	{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
-	{62, "PRESCRIPT"},  {62, "SCROLL"},   {62, "MESSAGE"},
-	{63, "PEN"},        {63, "QUILL"},    {64, "INK"},
-	{64, "INKPOT"},     {65, "CLOTHES"},  {66, "HABIT"},
-	{66, "DISGUISE"},   {67, "ONION"},
-	{99, "PASSWORD"},
+	_vocabulary[138].init(50, "WINE");
+	_vocabulary[139].init(50, "BOOZE");
+	_vocabulary[140].init(50, "NASTY");
+	_vocabulary[141].init(50, "VINEGAR");
+	_vocabulary[142].init(51, "MONEYBAG");
+	_vocabulary[143].init(51, "BAG");
+	_vocabulary[144].init(51, "CASH");
+	_vocabulary[145].init(51, "DOSH");
+	_vocabulary[146].init(51, "WALLET");
+	_vocabulary[147].init(52, "BODKIN");
+	_vocabulary[148].init(52, "DAGGER");
+	_vocabulary[149].init(53, "POTION");
+	_vocabulary[150].init(54, "CHASTITY");
+	_vocabulary[151].init(54, "BELT");
+	_vocabulary[152].init(55, "BOLT");
+	_vocabulary[153].init(55, "ARROW");
+	_vocabulary[154].init(55, "DART");
+	_vocabulary[155].init(56, "CROSSBOW");
+	_vocabulary[156].init(56, "BOW");
+	_vocabulary[157].init(57, "LUTE");
+	_vocabulary[158].init(58, "PILGRIM");
+	_vocabulary[159].init(58, "BADGE");
+	_vocabulary[160].init(59, "MUSHROOMS");
+	_vocabulary[161].init(59, "TOADSTOOLS");
+	_vocabulary[162].init(60, "KEY");
+	_vocabulary[163].init(61, "BELL");
+	_vocabulary[164].init(62, "PRESCRIPT");
+	_vocabulary[165].init(62, "SCROLL");
+	_vocabulary[166].init(62, "MESSAGE");
+	_vocabulary[167].init(63, "PEN");
+	_vocabulary[168].init(63, "QUILL");
+	_vocabulary[169].init(64, "INK");
+	_vocabulary[170].init(64, "INKPOT");
+	_vocabulary[171].init(65, "CLOTHES");
+	_vocabulary[172].init(66, "HABIT");
+	_vocabulary[173].init(66, "DISGUISE");
+	_vocabulary[174].init(67, "ONION");
+
+	_vocabulary[175].init(99, "PASSWORD");
 
 	// Objects from Also are placed between 101 and 131.
-
 	// Nouns - People - Male: 150-174
-	{150, "AVVY"},       {150, "AVALOT"},    {150, "YOURSELF"},
-	{150, "ME"},         {150, "MYSELF"},    {151, "SPLUDWICK"},
-	{151, "THOMAS"},     {151, "ALCHEMIST"}, {151, "CHEMIST"},
-	{152, "CRAPULUS"},   {152, "SERF"},      {152, "SLAVE"},
-	{158, "DU"}, // <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.
-	{152, "CRAPPY"},     {153, "DUCK"},      {153, "DOCTOR"},
-	{154, "MALAGAUCHE"},
-	{155, "FRIAR"},      {155, "TUCK"},      {156, "ROBIN"},
-	{156, "HOOD"},       {157, "CWYTALOT"},  {157, "GUARD"},
-	{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
-	{159, "DUKE"},       {159, "GRACE"},     {160, "DOGFOOD"},
-	{160, "MINSTREL"},   {161, "TRADER"},    {161, "SHOPKEEPER"},
-	{161, "STALLHOLDER"},
-	{162, "PILGRIM"},    {162, "IBYTHNETH"}, {163, "ABBOT"},
-	{163, "AYLES"},      {164, "PORT"},      {165, "SPURGE"},
-	{166, "JACQUES"},    {166, "SLEEPER"},   {166, "RINGER"},
+	_vocabulary[176].init(150, "AVVY");
+	_vocabulary[177].init(150, "AVALOT");
+	_vocabulary[178].init(150, "YOURSELF");
+	_vocabulary[179].init(150, "ME");
+	_vocabulary[180].init(150, "MYSELF");
+	_vocabulary[181].init(151, "SPLUDWICK");
+	_vocabulary[182].init(151, "THOMAS");
+	_vocabulary[183].init(151, "ALCHEMIST");
+	_vocabulary[184].init(151, "CHEMIST");
+	_vocabulary[185].init(152, "CRAPULUS");
+	_vocabulary[186].init(152, "SERF");
+	_vocabulary[187].init(152, "SLAVE");
+	_vocabulary[188].init(158, "DU"); // Put in early for Baron DU Lustie to save confusion with Duck & Duke.
+	_vocabulary[189].init(152, "CRAPPY");
+	_vocabulary[190].init(153, "DUCK");
+	_vocabulary[191].init(153, "DOCTOR");
+	_vocabulary[192].init(154, "MALAGAUCHE");
+	_vocabulary[193].init(155, "FRIAR");
+	_vocabulary[194].init(155, "TUCK");
+	_vocabulary[195].init(156, "ROBIN");
+	_vocabulary[196].init(156, "HOOD");
+	_vocabulary[197].init(157, "CWYTALOT");
+	_vocabulary[198].init(157, "GUARD");
+	_vocabulary[199].init(157, "BRIDGEKEEP");
+	_vocabulary[200].init(158, "BARON");
+	_vocabulary[201].init(158, "LUSTIE");
+	_vocabulary[202].init(159, "DUKE");
+	_vocabulary[203].init(159, "GRACE");
+	_vocabulary[204].init(160, "DOGFOOD");
+	_vocabulary[205].init(160, "MINSTREL");
+	_vocabulary[206].init(161, "TRADER");
+	_vocabulary[207].init(161, "SHOPKEEPER");
+	_vocabulary[208].init(161, "STALLHOLDER");
+	_vocabulary[209].init(162, "PILGRIM");
+	_vocabulary[210].init(162, "IBYTHNETH");
+	_vocabulary[211].init(163, "ABBOT");
+	_vocabulary[212].init(163, "AYLES");
+	_vocabulary[213].init(164, "PORT");
+	_vocabulary[214].init(165, "SPURGE");
+	_vocabulary[215].init(166, "JACQUES");
+	_vocabulary[216].init(166, "SLEEPER");
+	_vocabulary[217].init(166, "RINGER");
 
 	// Nouns - People - Female: 175-199
-	{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
-	{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
-	{178, "WITCH"},
+	_vocabulary[218].init(175, "WIFE");
+	_vocabulary[219].init(175, "ARKATA");
+	_vocabulary[220].init(176, "GEDALODAVA");
+	_vocabulary[221].init(176, "GEIDA");
+	_vocabulary[222].init(176, "PRINCESS");
+	_vocabulary[223].init(178, "WISE");
+	_vocabulary[224].init(178, "WITCH");
 
 	// Pronouns: 200-224
-	{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
-	{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
-	{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
-	{202, "IT"},        {202, "THING"},
-	{203, "MONK"},      {204, "BARMAN"},    {204, "BARTENDER"},
+	_vocabulary[225].init(200, "HIM");
+	_vocabulary[226].init(200, "MAN");
+	_vocabulary[227].init(200, "GUY");
+	_vocabulary[228].init(200, "DUDE");
+	_vocabulary[229].init(200, "CHAP");
+	_vocabulary[230].init(200, "FELLOW");
+	_vocabulary[231].init(201, "HER");
+	_vocabulary[232].init(201, "GIRL");
+	_vocabulary[233].init(201, "WOMAN");
+	_vocabulary[234].init(202, "IT");
+	_vocabulary[235].init(202, "THING");
+	_vocabulary[236].init(203, "MONK");
+	_vocabulary[237].init(204, "BARMAN");
+	_vocabulary[238].init(204, "BARTENDER");
 
 	// Prepositions: 225-249
-	{225, "TO"},        {226, "AT"},        {227, "UP"},
-	{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
-	{230, "UP"},        {231, "DOWN"},      {232, "ON"},
+	_vocabulary[239].init(225, "TO");
+	_vocabulary[240].init(226, "AT");
+	_vocabulary[241].init(227, "UP");
+	_vocabulary[242].init(228, "INTO");
+	_vocabulary[243].init(228, "INSIDE");
+	_vocabulary[244].init(229, "OFF");
+	_vocabulary[245].init(230, "UP");
+	_vocabulary[246].init(231, "DOWN");
+	_vocabulary[247].init(232, "ON");
 
 	// Please: 251
-	{251, "PLEASE"},
+	_vocabulary[248].init(251, "PLEASE");
 
 	// About: 252
-	{252, "ABOUT"}, {252, "CONCERNING"},
+	_vocabulary[249].init(252, "ABOUT");
+	_vocabulary[250].init(252, "CONCERNING");
 
 	// Swear words: 253
 	/*		  I M P O R T A N T    M E S S A G E
@@ -174,30 +338,37 @@ const Acci::VocabEntry Acci::kVocabulary[kParserWordsNum] = {
 	GOODNESS KNOWS WHO WROTE THEM.
 	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
 	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
-
-	{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
-	{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
-	{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
-	{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
-	{253, "SMEG"},
-	// ...and other even ruder words. You didn't read them, did you? Good. */
+	_vocabulary[251].init(253, "SHIT");
+	_vocabulary[252].init(28 , "PISS");
+	_vocabulary[253].init(28 , "PEE");
+	_vocabulary[254].init(253, "FART");
+	_vocabulary[255].init(253, "FUCK");
+	_vocabulary[256].init(253, "BALLS");
+	_vocabulary[257].init(253, "BLAST");
+	_vocabulary[258].init(253, "BUGGER");
+	_vocabulary[259].init(253, "KNICKERS");
+	_vocabulary[260].init(253, "BLOODY");
+	_vocabulary[261].init(253, "HELL");
+	_vocabulary[262].init(253, "DAMN");
+	_vocabulary[263].init(253, "SMEG");
+	// ...and other even ruder words. You didn't read them, did you? Good.
 
 	// Answer-back smart-alec words: 249
-	{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},
+	_vocabulary[264].init(249, "YES");
+	_vocabulary[265].init(249, "NO");
+	_vocabulary[266].init(249, "BECAUSE");
 
 	// Noise words: 255
-	{255, "THE"},       {255, "A"},         {255, "NOW"},
-	{255, "SOME"},      {255, "AND"},       {255, "THAT"},
-	{255, "POCUS"},     {255, "HIS"},
-	{255, "THIS"},      {255, "SENTINEL"} // for "Ken SENT Me"
-};
-
-Acci::Acci(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Acci::init() {
-	_vm->_gyro->_weirdWord = false;
+	_vocabulary[267].init(255, "THE");
+	_vocabulary[268].init(255, "A");
+	_vocabulary[269].init(255, "NOW");
+	_vocabulary[270].init(255, "SOME");
+	_vocabulary[271].init(255, "AND");
+	_vocabulary[272].init(255, "THAT");
+	_vocabulary[273].init(255, "POCUS");
+	_vocabulary[274].init(255, "HIS");
+	_vocabulary[275].init(255, "THIS");
+	_vocabulary[276].init(255, "SENTINEL"); // for "Ken SENT Me"
 }
 
 void Acci::clearWords() {
@@ -212,14 +383,14 @@ byte Acci::wordNum(Common::String word) {
 		return 0;
 
 	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (kVocabulary[i]._word == word)
-			return kVocabulary[i]._number;
+		if (_vocabulary[i]._word == word)
+			return _vocabulary[i]._number;
 	}
 
 	// If not found as a whole, we look for it as a substring.
 	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (Common::String(kVocabulary[i]._word.c_str(), word.size()) == word)
-			return kVocabulary[i]._number;
+		if (Common::String(_vocabulary[i]._word.c_str(), word.size()) == word)
+			return _vocabulary[i]._number;
 	}
 
 	return kPardon;
@@ -1920,8 +2091,8 @@ void Acci::doThat() {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
 				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
-				for (byte j = 0; j < kVocabulary[pwdId]._word.size(); j++) {
-					if (kVocabulary[pwdId]._word[j] != temp[j])
+				for (byte j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
+					if (_vocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
 				}
 			}
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
index dab5371..07816cc 100644
--- a/engines/avalanche/acci2.h
+++ b/engines/avalanche/acci2.h
@@ -60,9 +60,14 @@ public:
 	struct VocabEntry {
 		byte _number;
 		Common::String _word;
+
+		void init(byte number, Common::String word) {
+			_number = number;
+			_word = word;
+		}
 	};
 
-	static const VocabEntry kVocabulary[kParserWordsNum];
+	VocabEntry _vocabulary[kParserWordsNum];
 
 	Common::String _realWords[11];
 	byte _verb, _person, _thing;
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 2830e9e..3bcb2e0 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -704,7 +704,7 @@ void Scrolls::callScrollDriver() {
 					break;
 				case 2: {
 					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum;
-					displayText(_vm->_acci->kVocabulary[pwdId]._word + kControlToBuffer);
+					displayText(_vm->_acci->_vocabulary[pwdId]._word + kControlToBuffer);
 					}
 					break;
 				case 3:


Commit: 7d7e9ef7e6bd2e7c300d5b27947af2446e829fd5
    https://github.com/scummvm/scummvm/commit/7d7e9ef7e6bd2e7c300d5b27947af2446e829fd5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-13T16:44:39-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp





Commit: b710844971ec4e193444648239a45446da4ac697
    https://github.com/scummvm/scummvm/commit/b710844971ec4e193444648239a45446da4ac697
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-13T16:52:18-07:00

Commit Message:
AVALANCHE: Repair regression introduced when removing DNA.

Changed paths:
    engines/avalanche/gyro2.cpp



diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 17d21f4..5886806 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -239,7 +239,7 @@ void Gyro::resetVariables() {
 	_sworeNum = 0;
 	_saveNum = 0;
 	for (int i = 0; i < 100; i++)
-		_roomCount[100] = 0;
+		_roomCount[i] = 0;
 
 	_alcoholLevel = 0;
 	_playedNim = 0;


Commit: 5be2d50e14a37952716c41f896700274510f166a
    https://github.com/scummvm/scummvm/commit/5be2d50e14a37952716c41f896700274510f166a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-14T10:39:49-07:00

Commit Message:
AVALANCHE: Reduce verbosity related to animation sprites

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/dropdown2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index c255619..ad1e372 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1765,13 +1765,14 @@ void Acci::doThat() {
 						i = 3;
 					else
 						i = 0;
-					if (_vm->_animation->_sprites[0]._id != i) {
-						int16 x = _vm->_animation->_sprites[0]._x;
-						int16 y = _vm->_animation->_sprites[0]._y;
-						_vm->_animation->_sprites[0].remove();
-						_vm->_animation->_sprites[0].init(i, true, _vm->_animation);
-						_vm->_animation->_sprites[0].appear(x, y, Animation::kDirLeft);
-						_vm->_animation->_sprites[0]._visible = false;
+					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
+					if (spr->_id != i) {
+						int16 x = spr->_x;
+						int16 y = spr->_y;
+						spr->remove();
+						spr->init(i, true, _vm->_animation);
+						spr->appear(x, y, Animation::kDirLeft);
+						spr->_visible = false;
 					}
 				}
 				break;
@@ -1900,11 +1901,12 @@ void Acci::doThat() {
 				if (_vm->_gyro->_whereIs[1] == 12)
 					_vm->_visa->displayScrollChain('q', 18);
 				else {
-					_vm->_animation->_sprites[1].init(1, false, _vm->_animation); // Avaricius
+					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
+					spr->init(1, false, _vm->_animation); // Avaricius
 					_vm->_animation->appearPed(2, 4);
-					_vm->_animation->_sprites[1].walkTo(5);
-					_vm->_animation->_sprites[1]._callEachStepFl = true;
-					_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth;
+					spr->walkTo(5);
+					spr->_callEachStepFl = true;
+					spr->_eachStepProc = Animation::kProcBackAndForth;
 					_vm->_gyro->_avariciusTalk = 14;
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a5acf09..66b7462 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -285,41 +285,43 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	if (sz.isLoading()) {
 		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
-			if (_animation->_sprites[i]._quick)
-				_animation->_sprites[i].remove();
+			AnimationType *spr = &_animation->_sprites[i];
+			if (spr->_quick)
+				spr->remove();
 		}
 	}
 
 	for (byte i = 0; i < spriteNum; i++) {
-		sz.syncAsByte(_animation->_sprites[i]._id);
-		sz.syncAsByte(_animation->_sprites[i]._doCheck);
+		AnimationType *spr = &_animation->_sprites[i];
+		sz.syncAsByte(spr->_id);
+		sz.syncAsByte(spr->_doCheck);
 
 		if (sz.isLoading()) {
-			_animation->_sprites[i]._quick = true;
-			_animation->_sprites[i].init(_animation->_sprites[i]._id, _animation->_sprites[i]._doCheck, _animation);
+			spr->_quick = true;
+			spr->init(spr->_id, spr->_doCheck, _animation);
 		}
 
-		sz.syncAsByte(_animation->_sprites[i]._moveX);
-		sz.syncAsByte(_animation->_sprites[i]._moveY);
-		sz.syncAsByte(_animation->_sprites[i]._facingDir);
-		sz.syncAsByte(_animation->_sprites[i]._stepNum);
-		sz.syncAsByte(_animation->_sprites[i]._visible);
-		sz.syncAsByte(_animation->_sprites[i]._homing);
-		sz.syncAsByte(_animation->_sprites[i]._count);
-		sz.syncAsByte(_animation->_sprites[i]._info._xWidth);
-		sz.syncAsByte(_animation->_sprites[i]._speedX);
-		sz.syncAsByte(_animation->_sprites[i]._speedY);
-		sz.syncAsByte(_animation->_sprites[i]._animCount);
-		sz.syncAsSint16LE(_animation->_sprites[i]._homingX);
-		sz.syncAsSint16LE(_animation->_sprites[i]._homingY);
-		sz.syncAsByte(_animation->_sprites[i]._callEachStepFl);
-		sz.syncAsByte(_animation->_sprites[i]._eachStepProc);
-		sz.syncAsByte(_animation->_sprites[i]._vanishIfStill);
-		sz.syncAsSint16LE(_animation->_sprites[i]._x);
-		sz.syncAsSint16LE(_animation->_sprites[i]._y);
-
-		if (sz.isLoading() && _animation->_sprites[i]._visible)
-			_animation->_sprites[i].appear(_animation->_sprites[i]._x, _animation->_sprites[i]._y, _animation->_sprites[i]._facingDir);
+		sz.syncAsByte(spr->_moveX);
+		sz.syncAsByte(spr->_moveY);
+		sz.syncAsByte(spr->_facingDir);
+		sz.syncAsByte(spr->_stepNum);
+		sz.syncAsByte(spr->_visible);
+		sz.syncAsByte(spr->_homing);
+		sz.syncAsByte(spr->_count);
+		sz.syncAsByte(spr->_info._xWidth);
+		sz.syncAsByte(spr->_speedX);
+		sz.syncAsByte(spr->_speedY);
+		sz.syncAsByte(spr->_animCount);
+		sz.syncAsSint16LE(spr->_homingX);
+		sz.syncAsSint16LE(spr->_homingY);
+		sz.syncAsByte(spr->_callEachStepFl);
+		sz.syncAsByte(spr->_eachStepProc);
+		sz.syncAsByte(spr->_vanishIfStill);
+		sz.syncAsSint16LE(spr->_x);
+		sz.syncAsSint16LE(spr->_y);
+
+		if (sz.isLoading() && spr->_visible)
+			spr->appear(spr->_x, spr->_y, spr->_facingDir);
 	}
 
 	//groi = 177;
@@ -458,7 +460,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		Scrolls::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_scrolls->displayText(tmpStr);
 
-	if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible)
+	AnimationType *avvy = &_animation->_sprites[0];
+	if (avvy->_quick && avvy->_visible)
 		_animation->changeDirection(0, _animation->_direction); // We push Avvy in the right direction is he was moving.
 
 	return true;
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 62f4680..1f499a2 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -624,10 +624,11 @@ void Dropdown::runMenuAction() {
 		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
 		break;
 	case 5: {
-		if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
-			_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kRun;
+		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		if (avvy->_speedX == _vm->_gyro->kWalk)
+			avvy->_speedX = _vm->_gyro->kRun;
 		else
-			_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
+			avvy->_speedX = _vm->_gyro->kWalk;
 		_vm->_animation->updateSpeed();
 	}
 	break;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 5886806..9be471c 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -310,12 +310,14 @@ void Gyro::resetVariables() {
 
 void Gyro::newGame() {
 	for (byte i = 0; i < kMaxSprites; i++) {
-		if (_vm->_animation->_sprites[i]._quick)
-			_vm->_animation->_sprites[i].remove();
+		AnimationType *spr = &_vm->_animation->_sprites[i];
+		if (spr->_quick)
+			spr->remove();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
-	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->init(0, true, _vm->_animation);
 
 	_alive = true;
 	resetVariables();
@@ -338,7 +340,7 @@ void Gyro::newGame() {
 	_onToolbar = false;
 	_seeScroll = false;
 
-	_vm->_animation->_sprites[0].appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
+	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	_him = 254;
@@ -352,7 +354,7 @@ void Gyro::newGame() {
 	_enidFilename = "";
 
 	_vm->_lucerna->enterRoom(1, 1);
-	_vm->_animation->_sprites[0]._visible = false;
+	avvy->_visible = false;
 	_vm->_lucerna->drawScore();
 	_vm->_dropdown->setupMenu();
 	_vm->_lucerna->_clock.update();
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 76329e3..8851239 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -411,10 +411,12 @@ void Lucerna::enterNewTown() {
 void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	if (ped == 0)
 		return;
-	_vm->_animation->_sprites[1].init(5, false, _vm->_animation); // load Geida
+	AnimationType *spr1 = &_vm->_animation->_sprites[1];
+
+	spr1->init(5, false, _vm->_animation); // load Geida
 	_vm->_animation->appearPed(2, whichPed);
-	_vm->_animation->_sprites[1]._callEachStepFl = true;
-	_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
+	spr1->_callEachStepFl = true;
+	spr1->_eachStepProc = Animation::kProcGeida;
 }
 
 void Lucerna::enterRoom(byte room, byte ped) {
@@ -453,28 +455,29 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__outsideyours:
 		if (ped > 0) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (! _vm->_gyro->_talkedToCrapulus) {
-
 				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
-				_vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus
+				spr1->init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
 					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
-					_vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you.
+					spr1->walkTo(5); // Walks up to greet you.
 				} else {
 					_vm->_animation->appearPed(2, 5); // Starts where he was before.
-					_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
+					spr1->_facingDir = Animation::kDirLeft;
 				}
 
-				_vm->_animation->_sprites[1]._callEachStepFl = true;
-				_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
+				spr1->_callEachStepFl = true;
+				spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
 
-			} else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
+			} else
+				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
 
 			if (_vm->_gyro->_crapulusWillTell) {
-				_vm->_animation->_sprites[1].init(8, false, _vm->_animation);
+				spr1->init(8, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				_vm->_animation->_sprites[1].walkTo(4);
+				spr1->walkTo(4);
 				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_crapulusWillTell = false;
 			}
@@ -490,16 +493,17 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__spludwicks:
 		if (_vm->_gyro->_spludwickAtHome) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (ped > 0) {
-				_vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick
+				spr1->init(2, false, _vm->_animation); // load Spludwick
 				_vm->_animation->appearPed(2, 2);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
 			_vm->_gyro->_dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
 
-			_vm->_animation->_sprites[1]._callEachStepFl = true;
-			_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
+			spr1->_callEachStepFl = true;
+			spr1->_eachStepProc = Animation::kProcGeida;
 		} else
 			_vm->_gyro->_whereIs[1] = r__nowhere;
 		break;
@@ -512,30 +516,31 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
 		} else {
 			if (ped > 0) {
-				_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot
-				_vm->_animation->_sprites[1]._callEachStepFl = true;
-				_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY;
+				AnimationType *spr1 = &_vm->_animation->_sprites[1];
+				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
+				spr1->_callEachStepFl = true;
+				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
-					_vm->_animation->_sprites[1].walkTo(4); // ...and he walks up...
+					spr1->walkTo(4); // ...and he walks up...
 				} else {
 					// You've been here before.
 					_vm->_animation->appearPed(2, 4); // He's standing in your way straight away...
-					_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
+					spr1->_facingDir = Animation::kDirLeft;
 				}
 			}
 		}
 		break;
 
 	case r__argentroad:
-		if ((_vm->_gyro->_cwytalotGone) && (! _vm->_gyro->_passedCwytalotInHerts) && (ped == 2) &&
-		        (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
-			_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
+		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->appearPed(2, 1);
-			_vm->_animation->_sprites[1].walkTo(2);
-			_vm->_animation->_sprites[1]._vanishIfStill = true;
+			spr1->walkTo(2);
+			spr1->_vanishIfStill = true;
 			_vm->_gyro->_passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
 			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
@@ -556,9 +561,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (ped > 0) {
 			if (! _vm->_gyro->_beenTiedUp) {
 				// A welcome party... or maybe not...
-				_vm->_animation->_sprites[1].init(6, false, _vm->_animation);
+				AnimationType *spr1 = &_vm->_animation->_sprites[1];
+				spr1->init(6, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				_vm->_animation->_sprites[1].walkTo(3);
+				spr1->walkTo(3);
 				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 			}
 		}
@@ -577,28 +583,30 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__outsidecardiffcastle:
-		if (ped > 0)
+		if (ped > 0) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			switch (_vm->_gyro->_cardiffQuestionNum) {
-			case 0 : { // You've answered NONE of his questions.
-				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
+			case 0 : // You've answered NONE of his questions.
+				spr1->init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				_vm->_animation->_sprites[1].walkTo(3);
+				spr1->walkTo(3);
 				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
-			}
-			break;
+				break;
 			case 5 :
 				_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
-			default: { // You've answered SOME of his questions.
-				_vm->_animation->_sprites[1].init(9, false, _vm->_animation);
+			default: // You've answered SOME of his questions.
+				spr1->init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 3);
-				_vm->_animation->_sprites[1]._facingDir = Animation::kDirRight;
+				spr1->_facingDir = Animation::kDirRight;
 				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
-			}
+		}
+
 		if (_vm->_gyro->_cardiffQuestionNum < 5)
 			_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
-		else _vm->_gyro->_interrogation = 0;
+		else
+			_vm->_gyro->_interrogation = 0;
 		break;
 
 	case r__map:
@@ -717,18 +725,20 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__wisewomans:
-		_vm->_animation->_sprites[1].init(11, false, _vm->_animation);
+	case r__wisewomans: {
+		AnimationType *spr1 = &_vm->_animation->_sprites[1];
+		spr1->init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
-			_vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you.
+			spr1->walkTo(4); // Walks up to greet you.
 		} else {
 			_vm->_animation->appearPed(2, 4); // Starts where she was before.
-			_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
+			spr1->_facingDir = Animation::kDirLeft;
 		}
 
-		_vm->_animation->_sprites[1]._callEachStepFl = true;
-		_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFaceAvvy; // She always faces Avvy.
+		spr1->_callEachStepFl = true;
+		spr1->_eachStepProc = Animation::kProcFaceAvvy; // She always faces Avvy.
+		}
 		break;
 
 	case r__insidecardiffcastle:
@@ -810,7 +820,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__nottspub:
-		if (_vm->_gyro->_sittingInPub)  _vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		if (_vm->_gyro->_sittingInPub)
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
 		break;
 
@@ -833,9 +844,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	}
 
 	_vm->_gyro->_seeScroll = false; // Now it can work again!
-
-	if (_vm->_gyro->isLoaded)
-		_vm->_gyro->isLoaded = false;
+	_vm->_gyro->isLoaded = false;
 }
 
 void Lucerna::thinkAbout(byte object, bool type) {
@@ -1021,16 +1030,17 @@ void Lucerna::guideAvvy(Common::Point cursorPos) {
 	byte what;
 
 	// _vm->_animation->tr[0] is Avalot.)
-	if (cursorPos.x < _vm->_animation->_sprites[0]._x)
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	if (cursorPos.x < avvy->_x)
 		what = 1;
-	else if (cursorPos.x > (_vm->_animation->_sprites[0]._x + _vm->_animation->_sprites[0]._info._xLength))
+	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
 		what = 2;
 	else
 		what = 0; // On top
 
-	if (cursorPos.y < _vm->_animation->_sprites[0]._y)
+	if (cursorPos.y < avvy->_y)
 		what += 3;
-	else if (cursorPos.y > (_vm->_animation->_sprites[0]._y + _vm->_animation->_sprites[0]._info._yLength))
+	else if (cursorPos.y > (avvy->_y + avvy->_info._yLength))
 		what += 6;
 
 	switch (what) {
@@ -1178,13 +1188,14 @@ void Lucerna::drawDirection() { // It's data is loaded in load_digits().
 void Lucerna::gameOver() {
 	_vm->_gyro->_userMovesAvvy = false;
 
-	int16 sx = _vm->_animation->_sprites[0]._x;
-	int16 sy = _vm->_animation->_sprites[0]._y;
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	int16 sx = avvy->_x;
+	int16 sy = avvy->_y;
 
-	_vm->_animation->_sprites[0].remove();
-	_vm->_animation->_sprites[0].init(12, true, _vm->_animation); // 12 = Avalot falls
-	_vm->_animation->_sprites[0]._stepNum = 0;
-	_vm->_animation->_sprites[0].appear(sx, sy, 0);
+	avvy->remove();
+	avvy->init(12, true, _vm->_animation); // 12 = Avalot falls
+	avvy->_stepNum = 0;
+	avvy->appear(sx, sy, 0);
 
 	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
 	_vm->_gyro->_alive = false;
@@ -1207,18 +1218,17 @@ void Lucerna::majorRedraw() {
 }
 
 uint16 Lucerna::bearing(byte whichPed) {
-	byte pedId = whichPed - 1; // Different array indexes in Pascal and C.
+	static const double rad2deg = 180 / 3.14; // Pi
 
-	const double rad2deg = 180 / 3.14; // Pi
+	byte pedId = whichPed - 1; // Different array indexes in Pascal and C.
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
 
-	if (_vm->_animation->_sprites[0]._x == _vm->_gyro->_peds[pedId]._x)
+	if (avvy->_x == _vm->_gyro->_peds[pedId]._x)
 		return 0;
-	else if (_vm->_animation->_sprites[0]._x < _vm->_gyro->_peds[pedId]._x) {
-		return (uint16)((atan(double((_vm->_animation->_sprites[0]._y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_animation->_sprites[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
+	else if (avvy->_x < _vm->_gyro->_peds[pedId]._x) {
+		return (uint16)((atan(double((avvy->_y - _vm->_gyro->_peds[pedId]._y)) / (avvy->_x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
 	} else {
-		return (uint16)((atan(double((_vm->_animation->_sprites[0]._y - _vm->_gyro->_peds[pedId]._y))
-			/ (_vm->_animation->_sprites[0]._x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
+		return (uint16)((atan(double((avvy->_y - _vm->_gyro->_peds[pedId]._y)) / (avvy->_x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
 	}
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 3bcb2e0..f6c5dab 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -668,11 +668,12 @@ void Scrolls::callScrollDriver() {
 				if (_param == 0)
 					setBubbleStateNatural();
 				else if ((1 <= _param) && (_param <= 9)) {
-					if ((_param > _vm->_animation->kSpriteNumbMax) || (!_vm->_animation->_sprites[_param - 1]._quick)) { // Not valid.
+					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
+					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
 						_vm->_lucerna->errorLed();
 						setBubbleStateNatural();
 					} else
-						_vm->_animation->_sprites[_param - 1].chatter(); // Normal sprite talking routine.
+						spr->chatter(); // Normal sprite talking routine.
 				} else if ((10 <= _param) && (_param <= 36)) {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 019f2da..2df7ce2 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -308,10 +308,12 @@ void Timer::getTiedUp() {
 	_vm->_gyro->_userMovesAvvy = false;
 	_vm->_gyro->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
-	_vm->_animation->_sprites[1].stopWalk();
-	_vm->_animation->_sprites[1].stopHoming();
-	_vm->_animation->_sprites[1]._callEachStepFl = true;
-	_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGrabAvvy;
+
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	spr->stopWalk();
+	spr->stopHoming();
+	spr->_callEachStepFl = true;
+	spr->_eachStepProc = Animation::kProcGrabAvvy;
 	addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
 }
 
@@ -324,22 +326,25 @@ void Timer::getTiedUp2() {
 
 void Timer::hangAround() {
 	_vm->_animation->_sprites[1]._doCheck = false;
-	_vm->_animation->_sprites[0].init(7, true, _vm->_animation); // Robin Hood
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->appearPed(1, 2);
 	_vm->_visa->displayScrollChain('q', 39);
-	_vm->_animation->_sprites[0].walkTo(7);
+	avvy->walkTo(7);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timer::hangAround2() {
 	_vm->_visa->displayScrollChain('q', 40);
-	_vm->_animation->_sprites[1]._vanishIfStill = false;
-	_vm->_animation->_sprites[1].walkTo(4);
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	spr->_vanishIfStill = false;
+	spr->walkTo(4);
 	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
 	_vm->_visa->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
-	_vm->_animation->_sprites[1].remove(); // Get rid of Robin Hood and Friar Tuck.
+	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
 
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
@@ -424,9 +429,10 @@ void Timer::jacquesWakesUp() {
 }
 
 void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
-	_vm->_animation->_sprites[1].init(9, false, _vm->_animation); // Here comes the Duke.
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	spr->init(9, false, _vm->_animation); // Here comes the Duke.
 	_vm->_animation->appearPed(2, 1); // He starts at the door...
-	_vm->_animation->_sprites[1].walkTo(3); // He walks over to you.
+	spr->walkTo(3); // He walks over to you.
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -437,9 +443,10 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 }
 
 void Timer::naughtyDuke2() {
+	AnimationType *spr = &_vm->_animation->_sprites[1];
 	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
-	_vm->_animation->_sprites[1].walkTo(1); // Walk to the door.
-	_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
+	spr->walkTo(1); // Walk to the door.
+	spr->_vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
 
@@ -450,8 +457,9 @@ void Timer::naughtyDuke3() {
 }
 
 void Timer::jump() {
-	_vm->_gyro->_jumpStatus++;
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
 
+	_vm->_gyro->_jumpStatus++;
 	switch (_vm->_gyro->_jumpStatus) {
 	case 1:
 	case 2:
@@ -459,7 +467,7 @@ void Timer::jump() {
 	case 5:
 	case 7:
 	case 9:
-		_vm->_animation->_sprites[0]._y--;
+		avvy->_y--;
 		break;
 	case 12:
 	case 13:
@@ -467,7 +475,7 @@ void Timer::jump() {
 	case 16:
 	case 18:
 	case 19:
-		_vm->_animation->_sprites[0]._y++;
+		avvy->_y++;
 		break;
 	}
 
@@ -539,8 +547,10 @@ void Timer::greetsMonk() {
 
 void Timer::fallDownOubliette() {
 	_vm->_gyro->_magics[8]._operation = Gyro::kMagicNothing;
-	_vm->_animation->_sprites[0]._moveY++; // Increments dx/dy!
-	_vm->_animation->_sprites[0]._y += _vm->_animation->_sprites[0]._moveY;   // Dowwwn we go...
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->_moveY++; // Increments dx/dy!
+	avvy->_y += avvy->_moveY;   // Dowwwn we go...
 	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
 }
 
@@ -554,48 +564,59 @@ void Timer::meetAvaroid() {
 		_vm->_gyro->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
-		_vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft;
-		_vm->_animation->_sprites[0]._x = 151;
-		_vm->_animation->_sprites[0]._moveX = -3;
-		_vm->_animation->_sprites[0]._moveY = -5;
+		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		avvy->_facingDir = Animation::kDirLeft;
+		avvy->_x = 151;
+		avvy->_moveX = -3;
+		avvy->_moveY = -5;
 
 		_vm->_gyro->setBackgroundColor(2);
 	}
 }
 
 void Timer::riseUpOubliette() {
-	_vm->_animation->_sprites[0]._visible = true;
-	_vm->_animation->_sprites[0]._moveY++; // Decrements dx/dy!
-	_vm->_animation->_sprites[0]._y -= _vm->_animation->_sprites[0]._moveY; // Uuuupppp we go...
-	if (_vm->_animation->_sprites[0]._moveY > 0)
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->_visible = true;
+	avvy->_moveY++; // Decrements dx/dy!
+	avvy->_y -= avvy->_moveY; // Uuuupppp we go...
+	if (avvy->_moveY > 0)
 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
 		_vm->_gyro->_userMovesAvvy = true;
 }
 
 void Timer::robinHoodAndGeida() {
-	_vm->_animation->_sprites[0].init(7, true, _vm->_animation);
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->init(7, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 7);
-	_vm->_animation->_sprites[0].walkTo(6);
-	_vm->_animation->_sprites[1].stopWalk();
-	_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
+	avvy->walkTo(6);
+
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	spr->stopWalk();
+	spr->_facingDir = Animation::kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
 	_vm->_gyro->_geidaFollows = false;
 }
 
 void Timer::robinHoodAndGeidaTalk() {
 	_vm->_visa->displayScrollChain('q', 66);
-	_vm->_animation->_sprites[0].walkTo(2);
-	_vm->_animation->_sprites[1].walkTo(2);
-	_vm->_animation->_sprites[0]._vanishIfStill = true;
-	_vm->_animation->_sprites[1]._vanishIfStill = true;
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	avvy->walkTo(2);
+	spr->walkTo(2);
+	avvy->_vanishIfStill = true;
+	spr->_vanishIfStill = true;
+
 	addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
 }
 
 void Timer::avalotReturns() {
-	_vm->_animation->_sprites[0].remove();
-	_vm->_animation->_sprites[1].remove();
-	_vm->_animation->_sprites[0].init(0, true, _vm->_animation);
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *spr = &_vm->_animation->_sprites[1];
+	avvy->remove();
+	spr->remove();
+	avvy->init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 1);
 	_vm->_visa->displayScrollChain('q', 67);
 	_vm->_gyro->_userMovesAvvy = true;
@@ -607,18 +628,20 @@ void Timer::avalotReturns() {
  * @remarks	Originally called 'avvy_sit_down'
  */
 void Timer::avvySitDown() {
-	if (_vm->_animation->_sprites[0]._homing)    // Still walking.
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	if (avvy->_homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_sittingInPub = true;
 		_vm->_gyro->_userMovesAvvy = false;
-		_vm->_animation->_sprites[0]._visible = false;
+		avvy->_visible = false;
 	}
 }
 
 void Timer::ghostRoomPhew() {
-	Common::String tmpStr = Common::String::format("%cPHEW!%c You're glad to get out of %cthere!", Scrolls::kControlItalic, Scrolls::kControlRoman, Scrolls::kControlItalic);
+	Common::String tmpStr = Common::String::format("%cPHEW!%c You're glad to get out of %cthere!",
+		Scrolls::kControlItalic, Scrolls::kControlRoman, Scrolls::kControlItalic);
 	_vm->_scrolls->displayText(tmpStr);
 }
 
@@ -648,8 +671,9 @@ void Timer::winning() {
 }
 
 void Timer::avalotFalls() {
-	if (_vm->_animation->_sprites[0]._stepNum < 5) {
-		_vm->_animation->_sprites[0]._stepNum++;
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	if (avvy->_stepNum < 5) {
+		avvy->_stepNum++;
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay = Common::String::format("%c%c%c%c%c%c%c%c%c%c%c%c%cZ%c",


Commit: d7c2f495957ddd8181fe464b10de06646225c6f1
    https://github.com/scummvm/scummvm/commit/d7c2f495957ddd8181fe464b10de06646225c6f1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-14T15:35:40-07:00

Commit Message:
AVALANCHE: reduce the verbosity of a forgotten animation sprite

Changed paths:
    engines/avalanche/visa2.cpp



diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
index a7125d4..cbf0e05 100644
--- a/engines/avalanche/visa2.cpp
+++ b/engines/avalanche/visa2.cpp
@@ -270,8 +270,9 @@ void Visa::talkTo(byte whom) {
 		_vm->_gyro->_talkedToCrapulus = true;
 		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
 
-		_vm->_animation->_sprites[1]._vanishIfStill = true;
-		_vm->_animation->_sprites[1].walkTo(3); // Walks away.
+		AnimationType *spr = &_vm->_animation->_sprites[1];
+		spr->_vanishIfStill = true;
+		spr->walkTo(3); // Walks away.
 
 		_vm->_lucerna->incScore(2);
 	}


Commit: fb86c6db0dc58dedaed5ebc6391940229faf9b5d
    https://github.com/scummvm/scummvm/commit/fb86c6db0dc58dedaed5ebc6391940229faf9b5d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-14T15:36:23-07:00

Commit Message:
AVALANCHE: Janitorial: remove extra space after ! in boolean operations

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a4ead4a..796ab80 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -175,7 +175,7 @@ void Avalot::setup() {
 		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
 		_vm->_gyro->newGame(); // No game was requested- load the default.
 
-		_vm->_gyro->_soundFx = ! _vm->_gyro->_soundFx;
+		_vm->_gyro->_soundFx = !_vm->_gyro->_soundFx;
 		_vm->_lucerna->fxToggle();
 		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
 
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 8851239..a4b1094 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -387,9 +387,9 @@ void Lucerna::enterNewTown() {
 			_vm->_gyro->_mushroomGrowing = true;
 		break;
 	case r__wisewomans: { // Entry into Argent.
-		if (_vm->_gyro->_talkedToCrapulus && (! _vm->_gyro->_lustieIsAsleep)) {
+		if (_vm->_gyro->_talkedToCrapulus && (!_vm->_gyro->_lustieIsAsleep)) {
 			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1);
-			_vm->_gyro->_crapulusWillTell = ! _vm->_gyro->_spludwickAtHome;
+			_vm->_gyro->_crapulusWillTell = !_vm->_gyro->_spludwickAtHome;
 		} else {
 			_vm->_gyro->_spludwickAtHome = true;
 			_vm->_gyro->_crapulusWillTell = false;
@@ -429,7 +429,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	loadRoom(room);
 
-	if ((_vm->_gyro->_roomCount[room] == 0) && (! _vm->_gyro->setFlag('S')))
+	if ((_vm->_gyro->_roomCount[room] == 0) && (!_vm->_gyro->setFlag('S')))
 		incScore(1);
 
 	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
@@ -456,7 +456,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__outsideyours:
 		if (ped > 0) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			if (! _vm->_gyro->_talkedToCrapulus) {
+			if (!_vm->_gyro->_talkedToCrapulus) {
 				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
 				spr1->init(8, false, _vm->_animation); // load Crapulus
 
@@ -559,7 +559,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__robins:
 		if (ped > 0) {
-			if (! _vm->_gyro->_beenTiedUp) {
+			if (!_vm->_gyro->_beenTiedUp) {
 				// A welcome party... or maybe not...
 				AnimationType *spr1 = &_vm->_animation->_sprites[1];
 				spr1->init(6, false, _vm->_animation);
@@ -670,7 +670,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
 		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
-		else if (! _vm->_gyro->_enteredLustiesRoomAsMonk) // already
+		else if (!_vm->_gyro->_enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
 			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index f6c5dab..333b215 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -170,7 +170,7 @@ void Scrolls::scrollModeNormal() {
 					easteregg();
 			}
 			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
-			if (! oktoexit)  errorled();
+			if (!oktoexit)  errorled();
 		}
 
 	} while (!((oktoexit) || (mrelease > 0)));


Commit: a506b0b3e4490f69d58b1d3646de6065d98822d4
    https://github.com/scummvm/scummvm/commit/a506b0b3e4490f69d58b1d3646de6065d98822d4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-14T16:10:10-07:00

Commit Message:
AVALANCHE: Reduce some more verbosity

Changed paths:
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index ad1e372..bbbc04a 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1099,29 +1099,26 @@ void Acci::openDoor() {
 	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties))
 		return; // No doors can open if you can't move Avvy.
 
-	for (byte fv = 8; fv < 15; fv++) {
-		if (_vm->_animation->inField(fv + 1)) {
-			fv -= 8;
-
-			switch (_vm->_gyro->_portals[fv]._operation) {
+	for (byte i = 0; i < 7; i++) {
+		if (_vm->_animation->inField(i + 9)) {
+			MagicType *portal = &_vm->_gyro->_portals[i];
+			switch (portal->_operation) {
 			case Gyro::kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
-				_vm->_visa->displayScrollChain('x', _vm->_gyro->_portals[fv]._data);
+				_vm->_visa->displayScrollChain('x', portal->_data);
 				break;
 			case Gyro::kMagicTransport:
-				_vm->_animation->flipRoom((_vm->_gyro->_portals[fv]._data) >> 8,  // High byte
-					                 (_vm->_gyro->_portals[fv]._data) & 0x0F // Low byte
-									 );
+				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
 				break;
 			case Gyro::kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
-				_vm->_animation->callSpecial(_vm->_gyro->_portals[fv]._data);
+				_vm->_animation->callSpecial(portal->_data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_vm->_animation->openDoor((_vm->_gyro->_portals[fv]._data) >> 8, (_vm->_gyro->_portals[fv]._data) & 0x0F, fv + 9);
+				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
 				break;
 			}
 
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5ce809c..56f2ddf 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -210,17 +210,18 @@ void AnimationType::walk() {
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((tc != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
-			switch (_anim->_vm->_gyro->_magics[tc]._operation) {
+			MagicType *magic = &_anim->_vm->_gyro->_magics[tc];
+			switch (magic->_operation) {
 			case Gyro::kMagicExclaim:
 				bounce();
 				_anim->_mustExclaim = true;
-				_anim->_sayWhat = _anim->_vm->_gyro->_magics[tc]._data;
+				_anim->_sayWhat = magic->_data;
 				break;
 			case Gyro::kMagicBounce:
 				bounce();
 				break;
 			case Gyro::kMagicTransport:
-				_anim->flipRoom(_anim->_vm->_gyro->_magics[tc]._data >> 8, _anim->_vm->_gyro->_magics[tc]._data & 0xff);
+				_anim->flipRoom(magic->_data >> 8, magic->_data & 0xff);
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
@@ -229,10 +230,10 @@ void AnimationType::walk() {
 				}
 				break;
 			case Gyro::kMagicSpecial:
-				_anim->callSpecial(_anim->_vm->_gyro->_magics[tc]._data);
+				_anim->callSpecial(magic->_data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_anim->openDoor(_anim->_vm->_gyro->_magics[tc]._data >> 8, _anim->_vm->_gyro->_magics[tc]._data & 0xff, tc);
+				_anim->openDoor(magic->_data >> 8, magic->_data & 0xff, tc);
 				break;
 			}
 		}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index a4b1094..3b32d1f 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -262,13 +262,15 @@ void Lucerna::loadAlso(byte num) {
 	}
 
 	for (byte i = 0; i < 15; i++) {
-		_vm->_gyro->_magics[i]._operation = file.readByte();
-		_vm->_gyro->_magics[i]._data = file.readUint16LE();
+		MagicType *magic = &_vm->_gyro->_magics[i];
+		magic->_operation = file.readByte();
+		magic->_data = file.readUint16LE();
 	}
 
 	for (byte i = 0; i < 7; i++) {
-		_vm->_gyro->_portals[i]._operation = file.readByte();
-		_vm->_gyro->_portals[i]._data = file.readUint16LE();
+		MagicType *portal = &_vm->_gyro->_portals[i];
+		portal->_operation = file.readByte();
+		portal->_data = file.readUint16LE();
 	}
 
 	_vm->_gyro->_flags.clear();


Commit: 010d9f854e46ffbcb9b138e3dacffe9df25a116c
    https://github.com/scummvm/scummvm/commit/010d9f854e46ffbcb9b138e3dacffe9df25a116c
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-14T17:36:55-07:00

Commit Message:
AVALANCHE: Remove comment from AvalancheEngine::expandDate. It works as intended, no need to repair.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 66b7462..6312546 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -490,7 +490,6 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 			day += "th";
 		}
 
-	// Y2K compliant ;)
 	return day + ' ' + month + ' ' + _gyro->intToStr(y + 1900);
 }
 


Commit: f7ee139501403e4f55d1a6fcbe5c421d3317cfa1
    https://github.com/scummvm/scummvm/commit/f7ee139501403e4f55d1a6fcbe5c421d3317cfa1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T01:51:24-07:00

Commit Message:
AVALANCHE: Reduce verbosity some more

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/scrolls2.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 56f2ddf..c6fbe95 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -170,11 +170,9 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  */
 bool AnimationType::checkCollision() {
 	for (byte i = 0; i < _anim->kSpriteNumbMax; i++) {
-		if (_anim->_sprites[i]._quick && (_anim->_sprites[i]._id != _id) &&
-			((_x + _info._xLength) > _anim->_sprites[i]._x) &&
-			(_x < (_anim->_sprites[i]._x + _anim->_sprites[i]._info._xLength)) &&
-			(_anim->_sprites[i]._y == _y))
-				return true;
+		AnimationType *spr = &_anim->_sprites[i];
+		if (spr->_quick && (spr->_id != _id) && (_x + _info._xLength > spr->_x) && (_x < spr->_x + spr->_info._xLength) && (spr->_y == _y))
+			return true;
 	}
 
 	return false;
@@ -271,11 +269,12 @@ int8 AnimationType::getSign(int16 val) {
 		return 0;
 }
 
-void AnimationType::walkTo(byte pednum) {
-	pednum--; // Pascal -> C conversion: different array indexes.
-	setSpeed(getSign(_anim->_vm->_gyro->_peds[pednum]._x - _x) * 4, getSign(_anim->_vm->_gyro->_peds[pednum]._y - _y));
-	_homingX = _anim->_vm->_gyro->_peds[pednum]._x - _info._xLength / 2;
-	_homingY = _anim->_vm->_gyro->_peds[pednum]._y - _info._yLength;
+void AnimationType::walkTo(byte pedNum) {
+	PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum - 1]; // Pascal -> C conversion: different array indexes.
+
+	setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y));
+	_homingX = curPed->_x - _info._xLength / 2;
+	_homingY = curPed->_y - _info._yLength;
 	_homing = true;
 }
 
@@ -1006,11 +1005,11 @@ void Animation::changeDirection(byte t, byte dir) {
 	}
 }
 
-void Animation::appearPed(byte trn, byte np) {
-	trn--;
-	np--;
-	_sprites[trn].appear(_vm->_gyro->_peds[np]._x - _sprites[trn]._info._xLength / 2, _vm->_gyro->_peds[np]._y - _sprites[trn]._info._yLength, _vm->_gyro->_peds[np]._direction);
-	changeDirection(trn, _vm->_gyro->_peds[np]._direction);
+void Animation::appearPed(byte sprNum, byte pedNum) {
+	AnimationType *curSpr = &_sprites[sprNum - 1];
+	PedType *curPed = &_vm->_gyro->_peds[pedNum - 1];
+	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
+	changeDirection(sprNum - 1, curPed->_direction);
 }
 
 // Eachstep procedures:
@@ -1360,13 +1359,10 @@ void Animation::flipRoom(byte room, byte ped) {
 }
 
 bool Animation::inField(byte which) {
-	which--; // Pascal -> C: different array indexes.
-
+	FieldType *curField = &_vm->_gyro->_fields[which - 1]; // Pascal -> C: different array indexes.
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
 
-	return (_sprites[0]._x >= _vm->_gyro->_fields[which]._x1) && (_sprites[0]._x <= _vm->_gyro->_fields[which]._x2)
-		&& (yy >= _vm->_gyro->_fields[which]._y1) && (yy <= _vm->_gyro->_fields[which]._y2);
-
+	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
 bool Animation::nearDoor() {
@@ -1377,12 +1373,14 @@ bool Animation::nearDoor() {
 
 	int16 ux = _sprites[0]._x;
 	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
-	bool nd = false;
-	for (byte fv = 8; fv < _vm->_gyro->_fieldNum; fv++)
-		if ((ux >= _vm->_gyro->_fields[fv]._x1) && (ux <= _vm->_gyro->_fields[fv]._x2)
-			&& (uy >= _vm->_gyro->_fields[fv]._y1) && (uy <= _vm->_gyro->_fields[fv]._y2))
-			nd = true;
-	return nd;
+
+	for (byte i = 8; i < _vm->_gyro->_fieldNum; i++) {
+		FieldType *curField = &_vm->_gyro->_fields[i];
+		if ((ux >= curField->_x1) && (ux <= curField->_x2) && (uy >= curField->_y1) && (uy <= curField->_y2))
+			return true;
+	}
+
+	return false;
 }
 
 void Animation::handleMoveKey(const Common::Event &event) {
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 185f2f8..2765a7c 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -126,7 +126,7 @@ public:
 	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
 	void stopWalking();
 	void changeDirection(byte t, byte dir);
-	void appearPed(byte trn, byte np);
+	void appearPed(byte sprNum, byte pedNum);
 	void flipRoom(byte room, byte ped);
 	bool inField(byte which); // Returns true if you're within field "which".
 	bool nearDoor(); // Returns True if you're near a door.
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 796ab80..fe5d4d0 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -201,12 +201,15 @@ void Avalot::run(Common::String arg) {
 
 #ifdef DEBUG
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->_lineNum; i++)
-			_vm->_graphics->_surface.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i].col);
+		for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
+			LineType *curLine = &_vm->_gyro->_lines[i];
+			_vm->_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
+		}
 
 		for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
-			if (_vm->_gyro->_fields[i]._x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(_vm->_gyro->_fields[i]._x1, _vm->_gyro->_fields[i]._y1, _vm->_gyro->_fields[i]._x2, _vm->_gyro->_fields[i]._y2), kColorLightmagenta);
+			FieldType *curField = &_vm->_gyro->_fields[i];
+			if (curField->_x1 < 640)
+				_vm->_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
 		}
 		// ONLY FOR TESTING!!!
 #endif
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 3b32d1f..dc635aa 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -238,27 +238,30 @@ void Lucerna::loadAlso(byte num) {
 
 	_vm->_gyro->_lineNum = file.readByte();
 	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
-		_vm->_gyro->_lines[i]._x1 = file.readSint16LE();
-		_vm->_gyro->_lines[i]._y1 = file.readSint16LE();
-		_vm->_gyro->_lines[i]._x2 = file.readSint16LE();
-		_vm->_gyro->_lines[i]._y2 = file.readSint16LE();
-		_vm->_gyro->_lines[i]._color = file.readByte();
+		LineType *curLine = &_vm->_gyro->_lines[i];
+		curLine->_x1 = file.readSint16LE();
+		curLine->_y1 = file.readSint16LE();
+		curLine->_x2 = file.readSint16LE();
+		curLine->_y2 = file.readSint16LE();
+		curLine->_color = file.readByte();
 	}
 
 	memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds));
 	byte pedNum = file.readByte();
 	for (byte i = 0; i < pedNum; i++) {
-		_vm->_gyro->_peds[i]._x = file.readSint16LE();
-		_vm->_gyro->_peds[i]._y = file.readSint16LE();
-		_vm->_gyro->_peds[i]._direction = file.readByte();
+		PedType *curPed = &_vm->_gyro->_peds[i];
+		curPed->_x = file.readSint16LE();
+		curPed->_y = file.readSint16LE();
+		curPed->_direction = file.readByte();
 	}
 
 	_vm->_gyro->_fieldNum = file.readByte();
 	for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
-		_vm->_gyro->_fields[i]._x1 = file.readSint16LE();
-		_vm->_gyro->_fields[i]._y1 = file.readSint16LE();
-		_vm->_gyro->_fields[i]._x2 = file.readSint16LE();
-		_vm->_gyro->_fields[i]._y2 = file.readSint16LE();
+		FieldType *curField = &_vm->_gyro->_fields[i];
+		curField->_x1 = file.readSint16LE();
+		curField->_y1 = file.readSint16LE();
+		curField->_x2 = file.readSint16LE();
+		curField->_y2 = file.readSint16LE();
 	}
 
 	for (byte i = 0; i < 15; i++) {
@@ -323,8 +326,6 @@ void Lucerna::loadRoom(byte num) {
 	CursorMan.showMouse(true);
 }
 
-
-
 void Lucerna::zoomOut(int16 x, int16 y) {
 	warning("STUB: Lucerna::zoomout()");
 }
@@ -619,12 +620,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			zoomOut(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y);
 		//setactivepage(1 - cp);
 
-		{
-			if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
-				_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
-				_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-				refreshObjectList();
-			}
+		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
+			_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
+			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+			refreshObjectList();
 		}
 
 		_vm->_visa->displayScrollChain('q', 69);
@@ -1221,16 +1220,15 @@ void Lucerna::majorRedraw() {
 
 uint16 Lucerna::bearing(byte whichPed) {
 	static const double rad2deg = 180 / 3.14; // Pi
-
-	byte pedId = whichPed - 1; // Different array indexes in Pascal and C.
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	PedType *curPed = &_vm->_gyro->_peds[whichPed - 1]; // Different array indexes in Pascal and C.
 
-	if (avvy->_x == _vm->_gyro->_peds[pedId]._x)
+	if (avvy->_x == curPed->_x)
 		return 0;
-	else if (avvy->_x < _vm->_gyro->_peds[pedId]._x) {
-		return (uint16)((atan(double((avvy->_y - _vm->_gyro->_peds[pedId]._y)) / (avvy->_x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 90);
+	else if (avvy->_x < curPed->_x) {
+		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 90);
 	} else {
-		return (uint16)((atan(double((avvy->_y - _vm->_gyro->_peds[pedId]._y)) / (avvy->_x - _vm->_gyro->_peds[pedId]._x)) * rad2deg) + 270);
+		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 270);
 	}
 }
 
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 333b215..f96d56e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -678,8 +678,9 @@ void Scrolls::callScrollDriver() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					_vm->_gyro->_talkX = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1]._x;
-					_vm->_gyro->_talkY = _vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1]._y; // Position.
+					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1];
+					_vm->_gyro->_talkX = quasiPed->_x;
+					_vm->_gyro->_talkY = quasiPed->_y; // Position.
 
 					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[_param - 10]._foregroundColor;
 					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[_param - 10]._backgroundColor; // Colors.


Commit: ba05f95bb472af8530f70e62afd07a84ee273140
    https://github.com/scummvm/scummvm/commit/ba05f95bb472af8530f70e62afd07a84ee273140
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T03:25:07-07:00

Commit Message:
AVALANCHE: Get rid of Visa. Move everything from it to Scrolls.

Changed paths:
  R engines/avalanche/visa2.cpp
  R engines/avalanche/visa2.h
    engines/avalanche/acci2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/lucerna2.cpp
    engines/avalanche/module.mk
    engines/avalanche/scrolls2.cpp
    engines/avalanche/scrolls2.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index bbbc04a..1008a60 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -33,7 +33,6 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/enid2.h"
@@ -576,7 +575,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		if (!_vm->_gyro->_spareEvening.empty())
 			_vm->_gyro->_spareEvening.clear();
 		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
-		_vm->_visa->displayScrollChain('z', 5); // His closing statement...
+		_vm->_scrolls->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
@@ -798,24 +797,24 @@ void Acci::examineObject() {
 	case Gyro::kObjectWine :
 		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
-			_vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll
+			_vm->_scrolls->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
 		case 2:
-			_vm->_visa->displayScrollChain('d', 6); // Bad wine
+			_vm->_scrolls->displayScrollChain('d', 6); // Bad wine
 			break;
 		case 3:
-			_vm->_visa->displayScrollChain('d', 7); // Vinegar
+			_vm->_scrolls->displayScrollChain('d', 7); // Vinegar
 			break;
 		}
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_visa->displayScrollChain('q', 21); // Yucky onion.
+			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion.
 		else
-			_vm->_visa->displayScrollChain('t', 18);  // Normal onion scroll
+			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion scroll
 		break;
 	default:
-		_vm->_visa->displayScrollChain('t', _thing); // <<< Ordinarily
+		_vm->_scrolls->displayScrollChain('t', _thing); // <<< Ordinarily
 	}
 }
 
@@ -841,24 +840,24 @@ void Acci::exampers() {
 		switch (_person) { // Special cases
 		case 11:
 			if (_vm->_gyro->_wonNim) {
-				_vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!"
+				_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
 				return;
 			}
 			break;
 		case 99:
 			if (_vm->_gyro->_lustieIsAsleep) {
-				_vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
+				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
 				return;
 			}
 			break;
 		}
 		// Otherwise...
-		_vm->_visa->displayScrollChain('p', _person);
+		_vm->_scrolls->displayScrollChain('p', _person);
 	}
 
 	// And afterwards...
 	if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
-		_vm->_visa->displayScrollChain('Q', 13);
+		_vm->_scrolls->displayScrollChain('Q', 13);
 }
 
 /**
@@ -953,43 +952,43 @@ void Acci::swallow() {   // Eat something.
 		switch (_vm->_gyro->_wineState) { // 4 is perfect
 		case 1:
 			if (_vm->_gyro->_teetotal)  {
-				_vm->_visa->displayScrollChain('D', 6);
+				_vm->_scrolls->displayScrollChain('D', 6);
 				return;
 			}
-			_vm->_visa->displayScrollChain('U', 1);
+			_vm->_scrolls->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
-			_vm->_visa->displayScrollChain('U', 2);
+			_vm->_scrolls->displayScrollChain('U', 2);
 			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
 		case 2:
 		case 3:
-			_vm->_visa->displayScrollChain('d', 8);
+			_vm->_scrolls->displayScrollChain('d', 8);
 			break; // You can't drink it!
 		}
 		break;
 	case Gyro::kObjectPotion:
 		_vm->_gyro->setBackgroundColor(4);
-		_vm->_visa->displayScrollChain('U', 3);
+		_vm->_scrolls->displayScrollChain('U', 3);
 		_vm->_lucerna->gameOver();
 		_vm->_gyro->setBackgroundColor(0);
 		break;
 	case Gyro::kObjectInk:
-		_vm->_visa->displayScrollChain('U', 4);
+		_vm->_scrolls->displayScrollChain('U', 4);
 		break;
 	case Gyro::kObjectChastity:
-		_vm->_visa->displayScrollChain('U', 5);
+		_vm->_scrolls->displayScrollChain('U', 5);
 		break;
 	case Gyro::kObjectMushroom:
-		_vm->_visa->displayScrollChain('U', 6);
+		_vm->_scrolls->displayScrollChain('U', 6);
 		_vm->_lucerna->gameOver();
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_visa->displayScrollChain('U', 11);
+			_vm->_scrolls->displayScrollChain('U', 11);
 		else {
-			_vm->_visa->displayScrollChain('U', 8);
+			_vm->_scrolls->displayScrollChain('U', 8);
 			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 		}
@@ -1040,34 +1039,34 @@ void Acci::lookAround() {
 	switch (_vm->_gyro->_room) {
 	case r__spludwicks:
 		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_visa->displayScrollChain('q', 23);
+			_vm->_scrolls->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case r__robins:
 		if (_vm->_gyro->_tiedUp)
-			_vm->_visa->displayScrollChain('q', 38);
+			_vm->_scrolls->displayScrollChain('q', 38);
 		if (_vm->_gyro->_mushroomGrowing)
-			_vm->_visa->displayScrollChain('q', 55);
+			_vm->_scrolls->displayScrollChain('q', 55);
 		break;
 	case r__insidecardiffcastle:
 		if (!_vm->_gyro->_takenPen)
-			_vm->_visa->displayScrollChain('q', 49);
+			_vm->_scrolls->displayScrollChain('q', 49);
 		break;
 	case r__lustiesroom:
 		if (_vm->_gyro->_lustieIsAsleep)
-			_vm->_visa->displayScrollChain('q', 65);
+			_vm->_scrolls->displayScrollChain('q', 65);
 		break;
 	case r__catacombs:
 		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
 		case 258 :
-			_vm->_visa->displayScrollChain('q', 80); // Inside art gallery.
+			_vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery.
 			break;
 		case 514 :
-			_vm->_visa->displayScrollChain('q', 81); // Outside ditto.
+			_vm->_scrolls->displayScrollChain('q', 81); // Outside ditto.
 			break;
 		case 260 :
-			_vm->_visa->displayScrollChain('q', 82); // Outside Geida's room.
+			_vm->_scrolls->displayScrollChain('q', 82); // Outside Geida's room.
 			break;
 		}
 		break;
@@ -1090,7 +1089,7 @@ void Acci::openDoor() {
 		break;
 	case r__spludwicks:
 		if (_thing == 61) {
-			_vm->_visa->displayScrollChain('q', 85);
+			_vm->_scrolls->displayScrollChain('q', 85);
 			return;
 		}
 		break;
@@ -1105,7 +1104,7 @@ void Acci::openDoor() {
 			switch (portal->_operation) {
 			case Gyro::kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
-				_vm->_visa->displayScrollChain('x', portal->_data);
+				_vm->_scrolls->displayScrollChain('x', portal->_data);
 				break;
 			case Gyro::kMagicTransport:
 				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
@@ -1163,7 +1162,7 @@ void Acci::putProc() {
 				} else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_onionInVinegar = true;
 					_vm->_lucerna->incScore(7);
-					_vm->_visa->displayScrollChain('u', 9);
+					_vm->_scrolls->displayScrollChain('u', 9);
 				}
 			}
 		} else
@@ -1248,10 +1247,10 @@ bool Acci::giveToSpludwick() {
 	case Gyro::kObjectOnion:
 		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_visa->displayScrollChain('q', 22);
+			_vm->_scrolls->displayScrollChain('q', 22);
 		else {
 			_vm->_gyro->_givenToSpludwick++;
-			_vm->_visa->displayScrollChain('q', 20);
+			_vm->_scrolls->displayScrollChain('q', 20);
 			goToCauldron();
 			_vm->_lucerna->incScore(3);
 		}
@@ -1261,13 +1260,13 @@ bool Acci::giveToSpludwick() {
 		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_givenToSpludwick++;
-		_vm->_visa->displayScrollChain('q', 24);
+		_vm->_scrolls->displayScrollChain('q', 24);
 		goToCauldron();
 		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
 		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
-		_vm->_visa->displayScrollChain('q', 25);
+		_vm->_scrolls->displayScrollChain('q', 25);
 		_vm->_lucerna->incScore(5);
 		_vm->_gyro->_givenToSpludwick++;
 		goToCauldron();
@@ -1321,9 +1320,9 @@ void Acci::standUp() {
 	case r__yours: // Avvy isn't asleep.
 		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
 			if (_vm->_gyro->_teetotal) {
-				_vm->_visa->displayScrollChain('d', 12);
+				_vm->_scrolls->displayScrollChain('d', 12);
 				_vm->_gyro->setBackgroundColor(0);
-				_vm->_visa->displayScrollChain('d', 14);
+				_vm->_scrolls->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
@@ -1372,7 +1371,7 @@ void Acci::getProc(char thing) {
 				_vm->_scrolls->displayText(tmpStr);
 			}
 		} else
-			_vm->_visa->displayScrollChain('q', 57);
+			_vm->_scrolls->displayScrollChain('q', 57);
 		break;
 	case r__insidecardiffcastle:
 		switch (thing) {
@@ -1390,15 +1389,15 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->displayText("Taken.");
 				}
 			} else if (_vm->_gyro->_standingOnDais)
-				_vm->_visa->displayScrollChain('q', 53);
+				_vm->_scrolls->displayScrollChain('q', 53);
 			else
-				_vm->_visa->displayScrollChain('q', 51);
+				_vm->_scrolls->displayScrollChain('q', 51);
 			break;
 		case Gyro::kObjectBolt:
-			_vm->_visa->displayScrollChain('q', 52);
+			_vm->_scrolls->displayScrollChain('q', 52);
 			break;
 		default:
-			_vm->_visa->displayScrollChain('q', 57);
+			_vm->_scrolls->displayScrollChain('q', 57);
 		}
 		break;
 	case r__robins:
@@ -1411,10 +1410,10 @@ void Acci::getProc(char thing) {
 			_vm->_lucerna->refreshObjectList();
 			_vm->_lucerna->incScore(3);
 		} else
-			_vm->_visa->displayScrollChain('q', 57);
+			_vm->_scrolls->displayScrollChain('q', 57);
 		break;
 	default:
-		_vm->_visa->displayScrollChain('q', 57);
+		_vm->_scrolls->displayScrollChain('q', 57);
 	}
 }
 
@@ -1430,7 +1429,7 @@ void Acci::giveGeidaTheLute() {
 	}
 	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
 	_vm->_lucerna->refreshObjectList();
-	_vm->_visa->displayScrollChain('q', 64); // She plays it.
+	_vm->_scrolls->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
 	_vm->_enid->backToBootstrap(4);
@@ -1444,7 +1443,7 @@ void Acci::playHarp() {
 }
 
 void Acci::winSequence() {
-	_vm->_visa->displayScrollChain('q', 78);
+	_vm->_scrolls->displayScrollChain('q', 78);
 	_vm->_sequence->firstShow(7);
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
@@ -1576,10 +1575,10 @@ void Acci::doThat() {
 				if ((_person == 0) || (_person == kPardon))
 					_vm->_scrolls->displayText("Talk to whom?");
 				else if (isPersonHere())
-					_vm->_visa->talkTo(_person);
+					_vm->_scrolls->talkTo(_person);
 			}
 		} else if (isPersonHere())
-			_vm->_visa->talkTo(_person);
+			_vm->_scrolls->talkTo(_person);
 		break;
 	case kVerbCodeGive:
 		if (isHolding()) {
@@ -1617,7 +1616,7 @@ void Acci::doThat() {
 						break;
 					case Gyro::kPeopleIbythneth:
 						if (_thing == Gyro::kObjectBadge) {
-							_vm->_visa->displayScrollChain('q', 32); // Thanks! Wow!
+							_vm->_scrolls->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_lucerna->incScore(3);
 							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
 							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
@@ -1631,7 +1630,7 @@ void Acci::doThat() {
 						if (_vm->_gyro->_aylesIsAwake) {
 							if (_thing == Gyro::kObjectPen) {
 								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
-								_vm->_visa->displayScrollChain('q', 54);
+								_vm->_scrolls->displayScrollChain('q', 54);
 								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
 								_vm->_gyro->_givenPenToAyles = true;
 								_vm->_lucerna->refreshObjectList();
@@ -1645,7 +1644,7 @@ void Acci::doThat() {
 						switch (_thing) {
 						case Gyro::kObjectPotion:
 							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
-							_vm->_visa->displayScrollChain('u', 16); // She drinks it.
+							_vm->_scrolls->displayScrollChain('u', 16); // She drinks it.
 							_vm->_lucerna->incScore(2);
 							_vm->_gyro->_givenPotionToGeida = true;
 							_vm->_lucerna->refreshObjectList();
@@ -1663,7 +1662,7 @@ void Acci::doThat() {
 							if (_vm->_gyro->_givenPotionToGeida)
 								winSequence();
 							else
-								_vm->_visa->displayScrollChain('q', 77); // That Geida woman!
+								_vm->_scrolls->displayScrollChain('q', 77); // That Geida woman!
 							break;
 						default:
 							heyThanks();
@@ -1788,20 +1787,20 @@ void Acci::doThat() {
 					// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
 					if (_vm->_gyro->_wonNim) { // Already won the game.
-						_vm->_visa->displayScrollChain('Q', 6);
+						_vm->_scrolls->displayScrollChain('Q', 6);
 						return;
 					}
 
 					if (!_vm->_gyro->_askedDogfoodAboutNim) {
-						_vm->_visa->displayScrollChain('q', 84);
+						_vm->_scrolls->displayScrollChain('q', 84);
 						return;
 					}
 
-					_vm->_visa->displayScrollChain('Q', 3);
+					_vm->_scrolls->displayScrollChain('Q', 3);
 					_vm->_gyro->_playedNim++;
 
 					// You won - strange!
-					_vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute!
+					_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
 					_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
 					_vm->_lucerna->refreshObjectList();
 					_vm->_gyro->_wonNim = true;
@@ -1823,13 +1822,13 @@ void Acci::doThat() {
 		} else if (isHolding()) {
 			switch (_thing) {
 			case Gyro::kObjectLute :
-					_vm->_visa->displayScrollChain('U', 7);
+					_vm->_scrolls->displayScrollChain('U', 7);
 
 					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
-						_vm->_visa->displayScrollChain('U', 10);
+						_vm->_scrolls->displayScrollChain('U', 10);
 
 					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
-						_vm->_visa->displayScrollChain('U', 15);
+						_vm->_scrolls->displayScrollChain('U', 15);
 				break;
 			case 52:
 				if (_vm->_gyro->_room == r__musicroom)
@@ -1891,12 +1890,12 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeMagic:
 		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_visa->displayScrollChain('q', 19);
+			_vm->_scrolls->displayScrollChain('q', 19);
 		else {
 			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
-				_vm->_visa->displayScrollChain('q', 17);
+				_vm->_scrolls->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == 12)
-					_vm->_visa->displayScrollChain('q', 18);
+					_vm->_scrolls->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
 					spr->init(1, false, _vm->_animation); // Avaricius
@@ -1956,12 +1955,12 @@ void Acci::doThat() {
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
 					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-						_vm->_visa->displayScrollChain('D', 15);
+						_vm->_scrolls->displayScrollChain('D', 15);
 						return;
 					}
 
 					if (_vm->_gyro->_teetotal)  {
-						_vm->_visa->displayScrollChain('D', 6);
+						_vm->_scrolls->displayScrollChain('D', 6);
 						return;
 					}
 
@@ -1981,10 +1980,10 @@ void Acci::doThat() {
 					break; // We have a right one here - buy Pepsi??!
 				case Gyro::kObjectWine:
 					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
-						_vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent!
+						_vm->_scrolls->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-							_vm->_visa->displayScrollChain('D', 15);
+							_vm->_scrolls->displayScrollChain('D', 15);
 							return;
 						}
 
@@ -2006,21 +2005,21 @@ void Acci::doThat() {
 					break;
 				}
 			} else
-				_vm->_visa->displayScrollChain('D', 5); // Go to the bar!
+				_vm->_scrolls->displayScrollChain('D', 5); // Go to the bar!
 			break;
 
 		case r__outsideducks:
 			if (_vm->_animation->inField(6)) {
 				if (_thing == Gyro::kObjectOnion) {
 					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
-						_vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things!
+						_vm->_scrolls->displayScrollChain('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->_carryNum >= kCarryLimit)
 						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
 					else {
 						if (_vm->_gyro->_boughtOnion)
-							_vm->_visa->displayScrollChain('D', 11);
+							_vm->_scrolls->displayScrollChain('D', 11);
 						else {
-							_vm->_visa->displayScrollChain('D', 9);
+							_vm->_scrolls->displayScrollChain('D', 9);
 							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
@@ -2031,16 +2030,16 @@ void Acci::doThat() {
 						_vm->_gyro->_onionInVinegar = false;
 					}
 				} else
-					_vm->_visa->displayScrollChain('D', 0);
+					_vm->_scrolls->displayScrollChain('D', 0);
 			} else
-				_vm->_visa->displayScrollChain('D', 0);
+				_vm->_scrolls->displayScrollChain('D', 0);
 			break;
 
 		case r__nottspub:
-			_vm->_visa->displayScrollChain('n', 15); // Can't sell to southerners.
+			_vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners.
 			break;
 		default:
-			_vm->_visa->displayScrollChain('D', 0); // Can't buy that.
+			_vm->_scrolls->displayScrollChain('D', 0); // Can't buy that.
 		}
 		break;
 	case kVerbCodeAttack:
@@ -2050,7 +2049,7 @@ void Acci::doThat() {
 			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
-				_vm->_visa->displayScrollChain('Q', 10);
+				_vm->_scrolls->displayScrollChain('Q', 10);
 				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
@@ -2060,7 +2059,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
-				_vm->_visa->displayScrollChain('Q', 11);
+				_vm->_scrolls->displayScrollChain('Q', 11);
 				_vm->_gyro->_cwytalotGone = true;
 				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
 				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
@@ -2073,14 +2072,14 @@ void Acci::doThat() {
 				_vm->_gyro->_whereIs[7] = 177;
 				break;
 			default:
-				_vm->_visa->displayScrollChain('Q', 10); // Please try not to be so violent!
+				_vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent!
 			}
 		} else
-			_vm->_visa->displayScrollChain('Q', 10);
+			_vm->_scrolls->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
 		if (_vm->_gyro->_room != r__bridge)
-			_vm->_visa->displayScrollChain('Q', 12);
+			_vm->_scrolls->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (byte i = 0; i < _thats.size(); i++) {
@@ -2103,7 +2102,7 @@ void Acci::doThat() {
 					_vm->_gyro->_drawbridgeOpen = 1;
 				}
 			} else
-				_vm->_visa->displayScrollChain('Q', 12);
+				_vm->_scrolls->displayScrollChain('Q', 12);
 		}
 		break;
 	case kVerbCodeDir:
@@ -2129,16 +2128,16 @@ void Acci::doThat() {
 		else if (isPersonHere()) {
 			switch (_person) {
 			case Gyro::kPeopleArkata:
-				_vm->_visa->displayScrollChain('U', 12);
+				_vm->_scrolls->displayScrollChain('U', 12);
 				break;
 			case Gyro::kPeopleGeida:
-				_vm->_visa->displayScrollChain('U', 13);
+				_vm->_scrolls->displayScrollChain('U', 13);
 				break;
 			case Gyro::kPeopleWisewoman:
-				_vm->_visa->displayScrollChain('U', 14);
+				_vm->_scrolls->displayScrollChain('U', 14);
 				break;
 			default:
-				_vm->_visa->displayScrollChain('U', 5); // You WHAT?
+				_vm->_scrolls->displayScrollChain('U', 5); // You WHAT?
 			}
 		} else if ((150 <= _person) && (_person <= 174))
 			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
@@ -2170,7 +2169,7 @@ void Acci::doThat() {
 					_vm->_gyro->_avvyInBed = true;
 					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_teetotal)
-						_vm->_visa->displayScrollChain('d', 13);
+						_vm->_scrolls->displayScrollChain('d', 13);
 				} else
 					_vm->_scrolls->displayText("You're already awake, Avvy!");
 				break;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index c6fbe95..21063e0 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/animation.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/celer2.h"
 #include "avalanche/sequence2.h"
@@ -759,7 +758,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_gyro->_magics[11]._data = 5;
 		_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
 		stopWalking();
-		_vm->_visa->displayScrollChain('q', 26);
+		_vm->_scrolls->displayScrollChain('q', 26);
 		_vm->_gyro->_userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
@@ -789,11 +788,11 @@ void Animation::callSpecial(uint16 which) {
 		if (_vm->_gyro->_friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
-			_vm->_visa->displayScrollChain('q', 35);
+			_vm->_scrolls->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
-			_vm->_visa->displayScrollChain('q', 36);
+			_vm->_scrolls->displayScrollChain('q', 36);
 			_vm->_gyro->_tiedUp = true;
 			_vm->_gyro->_friarWillTieYouUp = false;
 			_sprites[1].walkTo(3);
@@ -822,7 +821,7 @@ void Animation::callSpecial(uint16 which) {
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_geidaFollows) && (!_vm->_gyro->_lustieIsAsleep)) {
-			_vm->_visa->displayScrollChain('q', 63);
+			_vm->_scrolls->displayScrollChain('q', 63);
 			_sprites[1].turn(kDirDown);
 			_sprites[1].stopWalk();
 			_sprites[1]._callEachStepFl = false; // Geida
@@ -842,9 +841,9 @@ void Animation::callSpecial(uint16 which) {
 		if ((_vm->_gyro->_catacombX == 4) && (_vm->_gyro->_catacombY == 1)) {
 			// Into Geida's room.
 			if (_vm->_gyro->_objects[Gyro::kObjectKey - 1])
-				_vm->_visa->displayScrollChain('q', 62);
+				_vm->_scrolls->displayScrollChain('q', 62);
 			else {
-				_vm->_visa->displayScrollChain('q', 61);
+				_vm->_scrolls->displayScrollChain('q', 61);
 				return;
 			}
 		}
@@ -1065,7 +1064,7 @@ void Animation::arrowProcs(byte tripnum) {
 			// OK, it's hit him... what now?
 
 			_sprites[1]._callEachStepFl = false; // prevent recursion.
-			_vm->_visa->displayScrollChain('Q', 47); // Complaint!
+			_vm->_scrolls->displayScrollChain('Q', 47); // Complaint!
 			_sprites[tripnum].remove(); // Deallocate the arrow.
 #if 0
 			tr[1].done; { Deallocate normal pic of Avvy. }
@@ -1273,7 +1272,7 @@ void Animation::animLink() {
 
 	if (_mustExclaim) {
 		_mustExclaim = false;
-		_vm->_visa->displayScrollChain('x', _sayWhat);
+		_vm->_scrolls->displayScrollChain('x', _sayWhat);
 	}
 }
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6312546..c768fc1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -64,7 +64,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _avalot;
 	delete _pingo;
 	delete _scrolls;
-	delete _visa;
 	delete _lucerna;
 	delete _enid;
 	delete _celer;
@@ -85,7 +84,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_gyro = new Gyro(this);
 	_pingo = new Pingo(this);
 	_scrolls = new Scrolls(this);
-	_visa = new Visa(this);
 	_lucerna = new Lucerna(this);
 	_enid = new Enid(this);
 	_celer = new Celer(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 69c157f..b93c117 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -37,7 +37,6 @@
 #include "avalanche/gyro2.h"
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/enid2.h"
 #include "avalanche/celer2.h"
@@ -74,7 +73,6 @@ public:
 	Gyro *_gyro;
 	Pingo *_pingo;
 	Scrolls *_scrolls;
-	Visa *_visa;
 	Lucerna *_lucerna;
 	Enid *_enid;
 	Celer *_celer;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index fe5d4d0..a5b3e06 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -41,7 +41,6 @@
 #include "avalanche/timer.h"
 #include "avalanche/celer2.h"
 #include "avalanche/enid2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/closing2.h"
 
 #include "common/str.h"
@@ -179,7 +178,7 @@ void Avalot::setup() {
 		_vm->_lucerna->fxToggle();
 		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
 
-		_vm->_visa->displayScrollChain('q', 83); // Info on the game, etc.
+		_vm->_scrolls->displayScrollChain('q', 83); // Info on the game, etc.
 	}
 }
 
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 9be471c..8bfa53f 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -33,7 +33,6 @@
 #include "avalanche/pingo2.h"
 #include "avalanche/scrolls2.h"
 #include "avalanche/lucerna2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/acci2.h"
 #include "avalanche/animation.h"
 
@@ -385,7 +384,7 @@ void Gyro::forceNumlock() {
 bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_money -= howmuchby;
 	if (_money < 0) {
-		_vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!"
+		_vm->_scrolls->displayScrollChain('Q', 2); // "You are now denariusless!"
 		_vm->_lucerna->gameOver();
 		return false;
 	} else
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index dc635aa..961202b 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/gyro2.h"
 #include "avalanche/scrolls2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/enid2.h"
@@ -621,12 +620,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		//setactivepage(1 - cp);
 
 		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
-			_vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine!
+			_vm->_scrolls->displayScrollChain('q', 9); // Don't want to waste the wine!
 			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 			refreshObjectList();
 		}
 
-		_vm->_visa->displayScrollChain('q', 69);
+		_vm->_scrolls->displayScrollChain('q', 69);
 		break;
 
 	case r__catacombs:
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 0f1722a..6881a3e 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -10,7 +10,6 @@ MODULE_OBJS = \
 	gyro2.o \
 	pingo2.o \
 	scrolls2.o \
-	visa2.o \
 	lucerna2.o \
 	enid2.o \
 	celer2.o \
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index f96d56e..56e9b2f 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -34,7 +34,6 @@
 #include "avalanche/lucerna2.h"
 #include "avalanche/animation.h"
 #include "avalanche/acci2.h"
-#include "avalanche/visa2.h"
 #include "avalanche/timer.h"
 
 #include "common/textconsole.h"
@@ -44,6 +43,7 @@ namespace Avalanche {
 
 Scrolls::Scrolls(AvalancheEngine *vm) {
 	_vm = vm;
+	_noError = true;
 }
 
 void Scrolls::init() {
@@ -729,7 +729,7 @@ void Scrolls::callScrollDriver() {
 				case 10:
 					switch (_vm->_gyro->_boxContent) {
 					case 0: // Sixpence.
-						_vm->_visa->displayScrollChain('q', 37); // You find the sixpence.
+						_vm->_scrolls->displayScrollChain('q', 37); // You find the sixpence.
 						_vm->_gyro->_money += 6;
 						_vm->_gyro->_boxContent = _vm->_acci->kNothing;
 						_vm->_lucerna->incScore(2);
@@ -826,4 +826,239 @@ void Scrolls::musicalScroll() {
 	resetScroll();
 }
 
+// From Visa:
+
+void Scrolls::unSkrimble() {
+	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
+		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
+}
+
+void Scrolls::doTheBubble() {
+	_vm->_gyro->_bufSize++;
+	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
+}
+
+/**
+ * Display a string in a scroll
+ * @remarks	Originally called 'dixi'
+ */
+void Scrolls::displayScrollChain(char block, byte point, bool report, bool bubbling) {
+	Common::File indexfile;
+	if (!indexfile.open("avalot.idx"))
+		error("AVALANCHE: Visa: File not found: avalot.idx");
+
+	bool error = false;
+
+	indexfile.seek((toupper(block) - 65) * 2);
+	uint16 idx_offset = indexfile.readUint16LE();
+	if (idx_offset == 0)
+		error = true;
+
+	indexfile.seek(idx_offset + point * 2);
+	uint16 sez_offset = indexfile.readUint16LE();
+	if (sez_offset == 0)
+		error = true;
+
+	indexfile.close();
+
+	_noError = !error;
+
+	if (error) {
+		if (report) {
+			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Scrolls::kControlBell, block, point);
+			_vm->_scrolls->displayText(todisplay);
+		}
+		return;
+	}
+
+	Common::File sezfile;
+	if (!sezfile.open("avalot.sez"))
+		::error("AVALANCHE: Visa: File not found: avalot.sez");
+
+	sezfile.seek(sez_offset);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	sezfile.close();
+	unSkrimble();
+
+	if (bubbling)
+		doTheBubble();
+
+	_vm->_scrolls->callScrollDriver();
+}
+
+/**
+ * Start speech
+ * @remarks	Originally called 'speech'
+ */
+void Scrolls::speak(byte who, byte subject) {
+	if (subject == 0) { // No subject.
+		displayScrollChain('s', who, false, true);
+		return;
+	}
+
+	// Subject given.
+	_noError = false; // Assume that until we know otherwise.
+
+	Common::File indexfile;
+	if (!indexfile.open("converse.avd"))
+		error("AVALANCHE: Visa: File not found: converse.avd");
+
+	indexfile.seek(who * 2 - 2);
+	uint16 idx_offset = indexfile.readUint16LE();
+	uint16 next_idx_offset = indexfile.readUint16LE();
+
+	if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
+		return;
+
+	indexfile.seek(idx_offset + subject * 2);
+	uint16 sez_offset = indexfile.readUint16LE();
+	if ((sez_offset == 0) || (indexfile.err()))
+		return;
+	indexfile.close();
+
+	Common::File sezfile;
+	if (!sezfile.open("avalot.sez"))
+		error("AVALANCHE: Visa: File not found: avalot.sez");
+
+	sezfile.seek(sez_offset);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	sezfile.close();
+
+	unSkrimble();
+	doTheBubble();
+
+	_vm->_scrolls->callScrollDriver();
+	_noError = true;
+}
+
+void Scrolls::talkTo(byte whom) {
+	if (_vm->_acci->_person == _vm->_acci->kPardon) {
+		_vm->_acci->_person = _vm->_gyro->_subjectNum;
+		_vm->_gyro->_subjectNum = 0;
+	}
+
+	if (_vm->_gyro->_subjectNum == 0) {
+		switch (whom) {
+		case Gyro::kPeopleSpludwick:
+			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
+				displayScrollChain('q', 68);
+				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_lucerna->incScore(3);
+				return;
+			} else if (_vm->_gyro->_talkedToCrapulus) {
+				// Spludwick - what does he need?
+				// 0 - let it through to use normal routine.
+				switch (_vm->_gyro->_givenToSpludwick) {
+				case 1: // Fallthrough is intended.
+				case 2: {
+					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+					_vm->_scrolls->displayText(tmpStr);
+					}
+					return;
+				case 3:
+					displayScrollChain('q', 30); // Need any help with the game?
+					return;
+				}
+			} else {
+				displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+				return;
+			}
+			break;
+		case Gyro::kPeopleIbythneth:
+			if (_vm->_gyro->_givenBadgeToIby) {
+				displayScrollChain('q', 33); // Thanks a lot!
+				return; // And leave the proc.
+			}
+			break; // Or... just continue, 'cos he hasn't got it.
+		case Gyro::kPeopleDogfood:
+			if (_vm->_gyro->_wonNim) { // We've won the game.
+				displayScrollChain('q', 6); // "I'm Not Playing!"
+				return; // Zap back.
+			} else
+				_vm->_gyro->_askedDogfoodAboutNim = true;
+			break;
+		case Gyro::kPeopleAyles:
+			if (!_vm->_gyro->_aylesIsAwake) {
+				displayScrollChain('q', 43); // He's fast asleep!
+				return;
+			} else if (!_vm->_gyro->_givenPenToAyles) {
+				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
+				return;
+			}
+			break;
+
+		case Gyro::kPeopleJacques:
+			displayScrollChain('q', 43);
+			return;
+
+		case Gyro::kPeopleGeida:
+			if (_vm->_gyro->_givenPotionToGeida)
+				_vm->_gyro->_geidaFollows = true;
+			else {
+				displayScrollChain('u', 17);
+				return;
+			}
+			break;
+		case Gyro::kPeopleSpurge:
+			if (!_vm->_gyro->_sittingInPub) {
+				displayScrollChain('q', 71); // Try going over and sitting down.
+				return;
+			} else {
+				if (_vm->_gyro->_spurgeTalkCount < 5)
+					_vm->_gyro->_spurgeTalkCount++;
+				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
+					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
+					return;
+				}
+			}
+			break;
+		}
+	// On a subject. Is there any reason to block it?
+	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
+		displayScrollChain('q', 43); // He's fast asleep!
+		return;
+	}
+
+	if (whom > 149)
+		whom -= 149;
+
+	bool noMatches = true;
+	for (byte i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
+			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, i + 49, Scrolls::kControlToBuffer);
+			_vm->_scrolls->displayText(tmpStr);
+			noMatches = false;
+			break;
+		}
+	}
+
+	if (noMatches) {
+		Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, Scrolls::kControlRegister, Scrolls::kControlToBuffer);
+		_vm->_scrolls->displayText(tmpStr);
+	}
+
+	speak(whom, _vm->_gyro->_subjectNum);
+
+	if (!_noError)
+		displayScrollChain('n', whom); // File not found!
+
+	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
+		_vm->_lucerna->refreshObjectList();
+		displayScrollChain('q', 1); // Circular from Cardiff.
+		_vm->_gyro->_talkedToCrapulus = true;
+		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
+
+		AnimationType *spr = &_vm->_animation->_sprites[1];
+		spr->_vanishIfStill = true;
+		spr->walkTo(3); // Walks away.
+
+		_vm->_lucerna->incScore(2);
+	}
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h
index 026c588..a8938a5 100644
--- a/engines/avalanche/scrolls2.h
+++ b/engines/avalanche/scrolls2.h
@@ -78,6 +78,10 @@ public:
 	Common::String displayMoney();
 	void musicalScroll(); // Practically this one is a mini-game which called when you play the harp in the monastery.
 
+	// From Visa:
+	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
+	void talkTo(byte whom);
+
 private:
 	AvalancheEngine *_vm;
 
@@ -116,6 +120,12 @@ private:
 	void getIcon(int16 x, int16 y, byte which);
 	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
 	void loadFont();
+
+	// From Visa:
+	bool _noError;
+	void unSkrimble();
+	void doTheBubble();
+	void speak(byte who, byte subject);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 2df7ce2..4e3f3aa 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -30,7 +30,6 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/timer.h"
-#include "avalanche/visa2.h"
 #include "avalanche/lucerna2.h"
 #include "avalanche/animation.h"
 #include "avalanche/scrolls2.h"
@@ -243,7 +242,7 @@ void Timer::openDrawbridge() {
 }
 
 void Timer::avariciusTalks() {
-	_vm->_visa->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
+	_vm->_scrolls->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
 	_vm->_gyro->_avariciusTalk++;
 
 	if (_vm->_gyro->_avariciusTalk < 17)
@@ -286,25 +285,25 @@ void Timer::stairs() {
 void Timer::cardiffSurvey() {
 	if (_vm->_gyro->_cardiffQuestionNum == 0) {
 		_vm->_gyro->_cardiffQuestionNum++;
-		_vm->_visa->displayScrollChain('q', 27);
+		_vm->_scrolls->displayScrollChain('q', 27);
 	}
 
-	_vm->_visa->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
+	_vm->_scrolls->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
 	_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
 void Timer::cardiffReturn() {
-	_vm->_visa->displayScrollChain('q', 28);
+	_vm->_scrolls->displayScrollChain('q', 28);
 	cardiffSurvey(); // Add end of question.
 }
 
 void Timer::cwytalotInHerts() {
-	_vm->_visa->displayScrollChain('q', 29);
+	_vm->_scrolls->displayScrollChain('q', 29);
 }
 
 void Timer::getTiedUp() {
-	_vm->_visa->displayScrollChain('q', 34); // ...Trouble!
+	_vm->_scrolls->displayScrollChain('q', 34); // ...Trouble!
 	_vm->_gyro->_userMovesAvvy = false;
 	_vm->_gyro->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
@@ -331,18 +330,18 @@ void Timer::hangAround() {
 	avvy->init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->appearPed(1, 2);
-	_vm->_visa->displayScrollChain('q', 39);
+	_vm->_scrolls->displayScrollChain('q', 39);
 	avvy->walkTo(7);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timer::hangAround2() {
-	_vm->_visa->displayScrollChain('q', 40);
+	_vm->_scrolls->displayScrollChain('q', 40);
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(4);
 	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
-	_vm->_visa->displayScrollChain('q', 41);
+	_vm->_scrolls->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
 
@@ -387,7 +386,7 @@ void Timer::afterTheShootemup() {
 
 	warning("STUB: Timer::after_the_shootemup()");
 
-	_vm->_visa->displayScrollChain('q', 70);
+	_vm->_scrolls->displayScrollChain('q', 70);
 }
 
 void Timer::jacquesWakesUp() {
@@ -396,7 +395,7 @@ void Timer::jacquesWakesUp() {
 	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
-		_vm->_visa->displayScrollChain('Q', 45);
+		_vm->_scrolls->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
@@ -444,7 +443,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 
 void Timer::naughtyDuke2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
-	_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
+	_vm->_scrolls->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 	spr->walkTo(1); // Walk to the door.
 	spr->_vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
@@ -498,14 +497,14 @@ void Timer::jump() {
 			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
-			_vm->_visa->displayScrollChain('q', 50);
+			_vm->_scrolls->displayScrollChain('q', 50);
 			_vm->_lucerna->incScore(3);
 		}
 	}
 }
 
 void Timer::crapulusSaysSpludOut() {
-	_vm->_visa->displayScrollChain('q', 56);
+	_vm->_scrolls->displayScrollChain('q', 56);
 	_vm->_gyro->_crapulusWillTell = false;
 }
 
@@ -513,11 +512,11 @@ void Timer::buyDrinks() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
-	_vm->_visa->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
+	_vm->_scrolls->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
-	_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
+	_vm->_scrolls->displayScrollChain('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
-		_vm->_visa->displayScrollChain('D', 3); // Tell 'em you paid up.
+		_vm->_scrolls->displayScrollChain('D', 3); // Tell 'em you paid up.
 	_vm->_acci->drink();
 }
 
@@ -525,10 +524,10 @@ void Timer::buyWine() {
 	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
-	_vm->_visa->displayScrollChain('D', 50); // You buy the wine.
-	_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
+	_vm->_scrolls->displayScrollChain('D', 50); // You buy the wine.
+	_vm->_scrolls->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) {
-		_vm->_visa->displayScrollChain('D', 4); // You paid up.
+		_vm->_scrolls->displayScrollChain('D', 4); // You paid up.
 		_vm->_gyro->_objects[Gyro::kObjectWine - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_wineState = 1; // OK Wine.
@@ -536,12 +535,12 @@ void Timer::buyWine() {
 }
 
 void Timer::callsGuards() {
-	_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
+	_vm->_scrolls->displayScrollChain('Q', 58); // "GUARDS!!!"
 	_vm->_lucerna->gameOver();
 }
 
 void Timer::greetsMonk() {
-	_vm->_visa->displayScrollChain('Q', 59);
+	_vm->_scrolls->displayScrollChain('Q', 59);
 	_vm->_gyro->_enteredLustiesRoomAsMonk = true;
 }
 
@@ -560,7 +559,7 @@ void Timer::meetAvaroid() {
 		_vm->_scrolls->displayText(tmpStr);
 		_vm->_lucerna->gameOver();
 	} else {
-		_vm->_visa->displayScrollChain('Q', 60);
+		_vm->_scrolls->displayScrollChain('Q', 60);
 		_vm->_gyro->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
@@ -599,7 +598,7 @@ void Timer::robinHoodAndGeida() {
 }
 
 void Timer::robinHoodAndGeidaTalk() {
-	_vm->_visa->displayScrollChain('q', 66);
+	_vm->_scrolls->displayScrollChain('q', 66);
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -618,7 +617,7 @@ void Timer::avalotReturns() {
 	spr->remove();
 	avvy->init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 1);
-	_vm->_visa->displayScrollChain('q', 67);
+	_vm->_scrolls->displayScrollChain('q', 67);
 	_vm->_gyro->_userMovesAvvy = true;
 }
 
@@ -649,12 +648,12 @@ void Timer::arkataShouts() {
 	if (_vm->_gyro->_teetotal)
 		return;
 
-	_vm->_visa->displayScrollChain('q', 76);
+	_vm->_scrolls->displayScrollChain('q', 76);
 	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
 }
 
 void Timer::winning() {
-	_vm->_visa->displayScrollChain('q', 79);
+	_vm->_scrolls->displayScrollChain('q', 79);
 	_vm->_pingo->winningPic();
 
 	warning("STUB: Timer::winning()");
@@ -698,7 +697,7 @@ void Timer::spludwickLeavesCauldron() {
 }
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.
-	_vm->_visa->displayScrollChain('Q', 86);
+	_vm->_scrolls->displayScrollChain('Q', 86);
 	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_lustieIsAsleep = true;
 	_vm->_sequence->firstShow(5);
diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp
deleted file mode 100644
index cbf0e05..0000000
--- a/engines/avalanche/visa2.cpp
+++ /dev/null
@@ -1,281 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* VISA		The new Sez handler. (Replaces Access.) */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/visa2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/acci2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/animation.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-Visa::Visa(AvalancheEngine *vm) {
-	_vm = vm;
-	_noError = true;
-}
-
-void Visa::unSkrimble() {
-	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
-		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
-}
-
-void Visa::doTheBubble() {
-	_vm->_gyro->_bufSize++;
-	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
-}
-
-/**
- * Display a string in a scroll
- * @remarks	Originally called 'dixi'
- */
-void Visa::displayScrollChain(char block, byte point, bool report, bool bubbling) {
-	Common::File indexfile;
-	if (!indexfile.open("avalot.idx"))
-		error("AVALANCHE: Visa: File not found: avalot.idx");
-
-	bool error = false;
-
-	indexfile.seek((toupper(block) - 65) * 2);
-	uint16 idx_offset = indexfile.readUint16LE();
-	if (idx_offset == 0)
-		error = true;
-
-	indexfile.seek(idx_offset + point * 2);
-	uint16 sez_offset = indexfile.readUint16LE();
-	if (sez_offset == 0)
-		error = true;
-
-	indexfile.close();
-
-	_noError = !error;
-
-	if (error) {
-		if (report) {
-			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Scrolls::kControlBell, block, point);
-			_vm->_scrolls->displayText(todisplay);
-		}
-		return;
-	}
-
-	Common::File sezfile;
-	if (!sezfile.open("avalot.sez"))
-		::error("AVALANCHE: Visa: File not found: avalot.sez");
-
-	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
-	sezfile.close();
-	unSkrimble();
-
-	if (bubbling)
-		doTheBubble();
-
-	_vm->_scrolls->callScrollDriver();
-}
-
-/**
- * Start speech
- * @remarks	Originally called 'speech'
- */
-void Visa::speak(byte who, byte subject) {
-	if (subject == 0) { // No subject.
-		displayScrollChain('s', who, false, true);
-		return;
-	}
-
-	// Subject given.
-	_noError = false; // Assume that until we know otherwise.
-
-	Common::File indexfile;
-	if (!indexfile.open("converse.avd"))
-		error("AVALANCHE: Visa: File not found: converse.avd");
-
-	indexfile.seek(who * 2 - 2);
-	uint16 idx_offset = indexfile.readUint16LE();
-	uint16 next_idx_offset = indexfile.readUint16LE();
-
-	if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
-		return;
-
-	indexfile.seek(idx_offset + subject * 2);
-	uint16 sez_offset = indexfile.readUint16LE();
-	if ((sez_offset == 0) || (indexfile.err()))
-		return;
-	indexfile.close();
-
-	Common::File sezfile;
-	if (!sezfile.open("avalot.sez"))
-		error("AVALANCHE: Visa: File not found: avalot.sez");
-
-	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
-	sezfile.close();
-
-	unSkrimble();
-	doTheBubble();
-
-	_vm->_scrolls->callScrollDriver();
-	_noError = true;
-}
-
-void Visa::talkTo(byte whom) {
-	if (_vm->_acci->_person == _vm->_acci->kPardon) {
-		_vm->_acci->_person = _vm->_gyro->_subjectNum;
-		_vm->_gyro->_subjectNum = 0;
-	}
-
-	if (_vm->_gyro->_subjectNum == 0) {
-		switch (whom) {
-		case Gyro::kPeopleSpludwick:
-			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
-				displayScrollChain('q', 68);
-				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_lucerna->incScore(3);
-				return;
-			} else if (_vm->_gyro->_talkedToCrapulus) {
-				// Spludwick - what does he need?
-				// 0 - let it through to use normal routine.
-				switch (_vm->_gyro->_givenToSpludwick) {
-				case 1: // Fallthrough is intended.
-				case 2: {
-					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
-					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-					_vm->_scrolls->displayText(tmpStr);
-					}
-					return;
-				case 3:
-					displayScrollChain('q', 30); // Need any help with the game?
-					return;
-				}
-			} else {
-				displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
-				return;
-			}
-			break;
-		case Gyro::kPeopleIbythneth:
-			if (_vm->_gyro->_givenBadgeToIby) {
-				displayScrollChain('q', 33); // Thanks a lot!
-				return; // And leave the proc.
-			}
-			break; // Or... just continue, 'cos he hasn't got it.
-		case Gyro::kPeopleDogfood:
-			if (_vm->_gyro->_wonNim) { // We've won the game.
-				displayScrollChain('q', 6); // "I'm Not Playing!"
-				return; // Zap back.
-			} else
-				_vm->_gyro->_askedDogfoodAboutNim = true;
-			break;
-		case Gyro::kPeopleAyles:
-			if (!_vm->_gyro->_aylesIsAwake) {
-				displayScrollChain('q', 43); // He's fast asleep!
-				return;
-			} else if (!_vm->_gyro->_givenPenToAyles) {
-				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
-				return;
-			}
-			break;
-
-		case Gyro::kPeopleJacques:
-			displayScrollChain('q', 43);
-			return;
-
-		case Gyro::kPeopleGeida:
-			if (_vm->_gyro->_givenPotionToGeida)
-				_vm->_gyro->_geidaFollows = true;
-			else {
-				displayScrollChain('u', 17);
-				return;
-			}
-			break;
-		case Gyro::kPeopleSpurge:
-			if (!_vm->_gyro->_sittingInPub) {
-				displayScrollChain('q', 71); // Try going over and sitting down.
-				return;
-			} else {
-				if (_vm->_gyro->_spurgeTalkCount < 5)
-					_vm->_gyro->_spurgeTalkCount++;
-				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
-					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
-					return;
-				}
-			}
-			break;
-		}
-	// On a subject. Is there any reason to block it?
-	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
-		displayScrollChain('q', 43); // He's fast asleep!
-		return;
-	}
-
-	if (whom > 149)
-		whom -= 149;
-
-	bool noMatches = true;
-	for (byte i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
-			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, i + 49, Scrolls::kControlToBuffer);
-			_vm->_scrolls->displayText(tmpStr);
-			noMatches = false;
-			break;
-		}
-	}
-
-	if (noMatches) {
-		Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, Scrolls::kControlRegister, Scrolls::kControlToBuffer);
-		_vm->_scrolls->displayText(tmpStr);
-	}
-
-	speak(whom, _vm->_gyro->_subjectNum);
-
-	if (!_noError)
-		displayScrollChain('n', whom); // File not found!
-
-	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		displayScrollChain('q', 1); // Circular from Cardiff.
-		_vm->_gyro->_talkedToCrapulus = true;
-		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
-
-		AnimationType *spr = &_vm->_animation->_sprites[1];
-		spr->_vanishIfStill = true;
-		spr->walkTo(3); // Walks away.
-
-		_vm->_lucerna->incScore(2);
-	}
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/visa2.h b/engines/avalanche/visa2.h
deleted file mode 100644
index c811053..0000000
--- a/engines/avalanche/visa2.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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* VISA		The new Sez handler. (Replaces Access.) */
-
-#ifndef AVALANCHE_VISA2_H
-#define AVALANCHE_VISA2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Visa {
-public:
-	Visa(AvalancheEngine *vm);
-
-	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
-	void talkTo(byte whom);
-
-private:
-	AvalancheEngine *_vm;
-
-	bool _noError;
-	void unSkrimble();
-	void doTheBubble();
-	void speak(byte who, byte subject);
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_VISA2_H


Commit: 4979cc5f69739f7d493076ebbedcc7a0eb77ef35
    https://github.com/scummvm/scummvm/commit/4979cc5f69739f7d493076ebbedcc7a0eb77ef35
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T03:44:49-07:00

Commit Message:
AVALANCHE: Rename Gyro::_dogFoodPos. Add comments to clarify it's function.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/celer2.cpp
    engines/avalanche/gyro2.cpp
    engines/avalanche/gyro2.h
    engines/avalanche/lucerna2.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c768fc1..9f2f46e 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -151,7 +151,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_gyro->_avvyIsAwake);
 	sz.syncAsByte(_gyro->_avvyInBed);
 	sz.syncAsByte(_gyro->_userMovesAvvy);
-	sz.syncAsByte(_gyro->_dogFoodPos);
+	sz.syncAsByte(_gyro->_npcFacing);
 	sz.syncAsByte(_gyro->_givenBadgeToIby);
 	sz.syncAsByte(_gyro->_friarWillTieYouUp);
 	sz.syncAsByte(_gyro->_tiedUp);
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 143725a..7e2891e 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -112,7 +112,7 @@ void Celer::updateBackgroundSprites() {
 			drawBackgroundSprite(-1, -1, 7);
 			break;
 		case 199:
-			_vm->_gyro->_dogFoodPos = 177; // Impossible value for this.
+			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
 			break;
 		}
 
@@ -125,9 +125,9 @@ void Celer::updateBackgroundSprites() {
 			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
 				direction = 4;
 
-			if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_dogFoodPos = direction;
+				_vm->_gyro->_npcFacing = direction;
 			}
 		}
 		break;
@@ -163,9 +163,9 @@ void Celer::updateBackgroundSprites() {
 			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
-			if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
+			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
 				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
+				_vm->_gyro->_npcFacing = direction;
 			}
 		}
 		break;
@@ -207,9 +207,9 @@ void Celer::updateBackgroundSprites() {
 		if ((_vm->_gyro->_roomTime % 60) > 57)
 			direction--; // Blinks.
 
-		if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_npcFacing) { // Port.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_npcFacing = direction;
 		}
 
 		switch (_vm->_gyro->_roomTime % 50) {
@@ -239,9 +239,9 @@ void Celer::updateBackgroundSprites() {
 		if ((_vm->_gyro->_roomTime % 45) > 42)
 			direction++; // Duck blinks.
 
-		if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed.
+		if (direction != _vm->_gyro->_npcFacing) { // Duck.
 			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not?
+			_vm->_gyro->_npcFacing = direction;
 		}
 		break;
 	   }
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index 8bfa53f..7598d6c 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -259,7 +259,7 @@ void Gyro::resetVariables() {
 	_avvyIsAwake = false;
 	_avvyInBed = false;
 	_userMovesAvvy = false;
-	_dogFoodPos = 0;
+	_npcFacing = 0;
 	_givenBadgeToIby = false;
 	_friarWillTieYouUp = false;
 	_tiedUp = false;
diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h
index 20e240a..0f8b9ae 100644
--- a/engines/avalanche/gyro2.h
+++ b/engines/avalanche/gyro2.h
@@ -270,7 +270,7 @@ public:
 	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
 	bool _avvyInBed; // True if Avvy's in bed, but awake.
 	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
-	byte _dogFoodPos; // Which way Dogfood's looking in the pub.
+	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
 	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
 	bool _friarWillTieYouUp; // If you're going to get tied up.
 	bool _tiedUp; // You ARE tied up!
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 961202b..c45c85c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -502,8 +502,6 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
-			_vm->_gyro->_dogFoodPos = 0;  // _vm->_gyro->also Spludwick pos.
-
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcGeida;
 		} else
@@ -667,7 +665,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__lustiesroom:
-		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
+		_vm->_gyro->_npcFacing = 1; // du Lustie.
 		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
 		else if (!_vm->_gyro->_enteredLustiesRoomAsMonk) // already
@@ -822,7 +820,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case r__nottspub:
 		if (_vm->_gyro->_sittingInPub)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
+		_vm->_gyro->_npcFacing = 1; // Port.
 		break;
 
 	case r__outsideducks:
@@ -839,8 +837,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break;
 
 	case r__ducks:
-		_vm->_gyro->_dogFoodPos = 1;
-		break; // Actually, Duck pos.
+		_vm->_gyro->_npcFacing = 1; // Duck.
+		break; 
 	}
 
 	_vm->_gyro->_seeScroll = false; // Now it can work again!


Commit: 7ee6e8699f97e691ea89266781f1c77437764658
    https://github.com/scummvm/scummvm/commit/7ee6e8699f97e691ea89266781f1c77437764658
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T04:03:21-07:00

Commit Message:
AVALANCHE: Remove the '2' from the source files' names.

Changed paths:
  A engines/avalanche/acci.cpp
  A engines/avalanche/acci.h
  A engines/avalanche/celer.cpp
  A engines/avalanche/celer.h
  A engines/avalanche/closing.cpp
  A engines/avalanche/closing.h
  A engines/avalanche/dropdown.cpp
  A engines/avalanche/dropdown.h
  A engines/avalanche/enid.cpp
  A engines/avalanche/enid.h
  A engines/avalanche/gyro.cpp
  A engines/avalanche/gyro.h
  A engines/avalanche/lucerna.cpp
  A engines/avalanche/lucerna.h
  A engines/avalanche/pingo.cpp
  A engines/avalanche/pingo.h
  A engines/avalanche/scrolls.cpp
  A engines/avalanche/scrolls.h
  A engines/avalanche/sequence.cpp
  A engines/avalanche/sequence.h
  R engines/avalanche/acci2.cpp
  R engines/avalanche/acci2.h
  R engines/avalanche/celer2.cpp
  R engines/avalanche/celer2.h
  R engines/avalanche/closing2.cpp
  R engines/avalanche/closing2.h
  R engines/avalanche/dropdown2.cpp
  R engines/avalanche/dropdown2.h
  R engines/avalanche/enid2.cpp
  R engines/avalanche/enid2.h
  R engines/avalanche/gyro2.cpp
  R engines/avalanche/gyro2.h
  R engines/avalanche/lucerna2.cpp
  R engines/avalanche/lucerna2.h
  R engines/avalanche/pingo2.cpp
  R engines/avalanche/pingo2.h
  R engines/avalanche/scrolls2.cpp
  R engines/avalanche/scrolls2.h
  R engines/avalanche/sequence2.cpp
  R engines/avalanche/sequence2.h
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/module.mk
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
new file mode 100644
index 0000000..3b633c1
--- /dev/null
+++ b/engines/avalanche/acci.cpp
@@ -0,0 +1,2267 @@
+ /* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ACCIDENCE II		The parser. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/acci.h"
+#include "avalanche/gyro.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/timer.h"
+#include "avalanche/animation.h"
+#include "avalanche/enid.h"
+#include "avalanche/celer.h"
+#include "avalanche/pingo.h"
+#include "avalanche/sequence.h"
+
+#include "common/textconsole.h"
+
+#include <cstring>
+#include <cmath>
+
+namespace Avalanche {
+
+Acci::Acci(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+void Acci::init() {
+	_vm->_gyro->_weirdWord = false;
+
+	// Initailaze the vocabulary.
+	// Verbs: 1-49
+	_vocabulary[0].init(1, "EXAMINE");
+	_vocabulary[1].init(1, "READ");
+	_vocabulary[2].init(1, "XAM");
+	_vocabulary[3].init(2, "OPEN");
+	_vocabulary[4].init(2, "LEAVE");
+	_vocabulary[5].init(2, "UNLOCK");
+	_vocabulary[6].init(3, "PAUSE");
+	_vocabulary[7].init(47, "TA"); // Early to avoid Take and Talk.
+	_vocabulary[8].init(4, "TAKE");
+	_vocabulary[9].init(4, "GET");
+	_vocabulary[10].init(4, "PICK");
+	_vocabulary[11].init(5, "DROP");
+	_vocabulary[12].init(6, "INVENTORY");
+	_vocabulary[13].init(7, "TALK");
+	_vocabulary[14].init(7, "SAY");
+	_vocabulary[15].init(7, "ASK");
+	_vocabulary[16].init(8, "GIVE");
+	_vocabulary[17].init(9, "DRINK");
+	_vocabulary[18].init(9, "IMBIBE");
+	_vocabulary[19].init(9, "DRAIN");
+	_vocabulary[20].init(10, "LOAD");
+	_vocabulary[21].init(10, "RESTORE");
+	_vocabulary[22].init(11, "SAVE");
+	_vocabulary[23].init(12, "BRIBE");
+	_vocabulary[24].init(12, "PAY");
+	_vocabulary[25].init(13, "LOOK");
+	_vocabulary[26].init(14, "BREAK");
+	_vocabulary[27].init(15, "QUIT");
+	_vocabulary[28].init(15, "EXIT");
+	_vocabulary[29].init(16, "SIT");
+	_vocabulary[30].init(16, "SLEEP");
+	_vocabulary[31].init(17, "STAND");
+
+	_vocabulary[32].init(18, "GO");
+	_vocabulary[33].init(19, "INFO");
+	_vocabulary[34].init(20, "UNDRESS");
+	_vocabulary[35].init(20, "DOFF");
+	_vocabulary[36].init(21, "DRESS");
+	_vocabulary[37].init(21, "WEAR");
+	_vocabulary[38].init(21, "DON");
+	_vocabulary[39].init(22, "PLAY");
+	_vocabulary[40].init(22, "STRUM");
+	_vocabulary[41].init(23, "RING");
+	_vocabulary[42].init(24, "HELP");
+	_vocabulary[43].init(25, "KENDAL");
+	_vocabulary[44].init(26, "CAPYBARA");
+	_vocabulary[45].init(27, "BOSS");
+	_vocabulary[46].init(255, "NINET"); // block for NINETY
+	_vocabulary[47].init(28, "URINATE");
+	_vocabulary[48].init(28, "MINGITE");
+	_vocabulary[49].init(29, "NINETY");
+	_vocabulary[50].init(30, "ABRACADABRA");
+	_vocabulary[51].init(30, "PLUGH");
+	_vocabulary[52].init(30, "XYZZY");
+	_vocabulary[53].init(30, "HOCUS");
+	_vocabulary[54].init(30, "POCUS");
+	_vocabulary[55].init(30, "IZZY");
+	_vocabulary[56].init(30, "WIZZY");
+	_vocabulary[57].init(30, "PLOVER");
+	_vocabulary[58].init(30, "MELENKURION");
+	_vocabulary[59].init(30, "ZORTON");
+	_vocabulary[60].init(30, "BLERBI");
+	_vocabulary[61].init(30, "THURB");
+	_vocabulary[62].init(30, "SNOEZE");
+	_vocabulary[63].init(30, "SAMOHT");
+	_vocabulary[64].init(30, "NOSIDE");
+	_vocabulary[65].init(30, "PHUGGG");
+	_vocabulary[66].init(30, "KNERL");
+	_vocabulary[67].init(30, "MAGIC");
+	_vocabulary[68].init(30, "KLAETU");
+	_vocabulary[69].init(30, "VODEL");
+	_vocabulary[70].init(30, "BONESCROLLS");
+	_vocabulary[71].init(30, "RADOF");
+
+	_vocabulary[72].init(31, "RESTART");
+	_vocabulary[73].init(32, "SWALLOW");
+	_vocabulary[74].init(32, "EAT");
+	_vocabulary[75].init(33, "LISTEN");
+	_vocabulary[76].init(33, "HEAR");
+	_vocabulary[77].init(34, "BUY");
+	_vocabulary[78].init(34, "PURCHASE");
+	_vocabulary[79].init(34, "ORDER");
+	_vocabulary[80].init(34, "DEMAND");
+	_vocabulary[81].init(35, "ATTACK");
+	_vocabulary[82].init(35, "HIT");
+	_vocabulary[83].init(35, "KILL");
+	_vocabulary[84].init(35, "PUNCH");
+	_vocabulary[85].init(35, "KICK");
+	_vocabulary[86].init(35, "SHOOT");
+	_vocabulary[87].init(35, "FIRE");
+
+	// Passwords: 36
+	_vocabulary[88].init(36, "TIROS");
+	_vocabulary[89].init(36, "WORDY");
+	_vocabulary[90].init(36, "STACK");
+	_vocabulary[91].init(36, "SHADOW");
+	_vocabulary[92].init(36, "OWL");
+	_vocabulary[93].init(36, "ACORN");
+	_vocabulary[94].init(36, "DOMESDAY");
+	_vocabulary[95].init(36, "FLOPPY");
+	_vocabulary[96].init(36, "DIODE");
+	_vocabulary[97].init(36, "FIELD");
+	_vocabulary[98].init(36, "COWSLIP");
+	_vocabulary[99].init(36, "OSBYTE");
+	_vocabulary[100].init(36, "OSCLI");
+	_vocabulary[101].init(36, "TIMBER");
+	_vocabulary[102].init(36, "ADVAL");
+	_vocabulary[103].init(36, "NEUTRON");
+	_vocabulary[104].init(36, "POSITRON");
+	_vocabulary[105].init(36, "ELECTRON");
+	_vocabulary[106].init(36, "CIRCUIT");
+	_vocabulary[107].init(36, "AURUM");
+	_vocabulary[108].init(36, "PETRIFY");
+	_vocabulary[109].init(36, "EBBY");
+	_vocabulary[110].init(36, "CATAPULT");
+	_vocabulary[111].init(36, "GAMERS");
+	_vocabulary[112].init(36, "FUDGE");
+	_vocabulary[113].init(36, "CANDLE");
+	_vocabulary[114].init(36, "BEEB");
+	_vocabulary[115].init(36, "MICRO");
+	_vocabulary[116].init(36, "SESAME");
+	_vocabulary[117].init(36, "LORDSHIP");
+
+	_vocabulary[118].init(37, "DIR");
+	_vocabulary[119].init(37, "LS");
+	_vocabulary[120].init(38, "DIE");
+	_vocabulary[121].init(39, "SCORE");
+	_vocabulary[122].init(40, "PUT");
+	_vocabulary[123].init(40, "INSERT");
+	_vocabulary[124].init(41, "KISS");
+	_vocabulary[125].init(41, "SNOG");
+	_vocabulary[126].init(41, "CUDDLE");
+	_vocabulary[127].init(42, "CLIMB");
+	_vocabulary[128].init(42, "CLAMBER");
+	_vocabulary[129].init(43, "JUMP");
+	_vocabulary[130].init(44, "HIGHSCORES");
+	_vocabulary[131].init(44, "HISCORES");
+	_vocabulary[132].init(45, "WAKEN");
+	_vocabulary[133].init(45, "AWAKEN");
+	_vocabulary[134].init(46, "HELLO");
+	_vocabulary[135].init(46, "HI");
+	_vocabulary[136].init(46, "YO");
+	_vocabulary[137].init(47, "THANKS"); // = 47, "ta", which was defined earlier.
+
+	// Nouns - Objects: 50-100
+	_vocabulary[138].init(50, "WINE");
+	_vocabulary[139].init(50, "BOOZE");
+	_vocabulary[140].init(50, "NASTY");
+	_vocabulary[141].init(50, "VINEGAR");
+	_vocabulary[142].init(51, "MONEYBAG");
+	_vocabulary[143].init(51, "BAG");
+	_vocabulary[144].init(51, "CASH");
+	_vocabulary[145].init(51, "DOSH");
+	_vocabulary[146].init(51, "WALLET");
+	_vocabulary[147].init(52, "BODKIN");
+	_vocabulary[148].init(52, "DAGGER");
+	_vocabulary[149].init(53, "POTION");
+	_vocabulary[150].init(54, "CHASTITY");
+	_vocabulary[151].init(54, "BELT");
+	_vocabulary[152].init(55, "BOLT");
+	_vocabulary[153].init(55, "ARROW");
+	_vocabulary[154].init(55, "DART");
+	_vocabulary[155].init(56, "CROSSBOW");
+	_vocabulary[156].init(56, "BOW");
+	_vocabulary[157].init(57, "LUTE");
+	_vocabulary[158].init(58, "PILGRIM");
+	_vocabulary[159].init(58, "BADGE");
+	_vocabulary[160].init(59, "MUSHROOMS");
+	_vocabulary[161].init(59, "TOADSTOOLS");
+	_vocabulary[162].init(60, "KEY");
+	_vocabulary[163].init(61, "BELL");
+	_vocabulary[164].init(62, "PRESCRIPT");
+	_vocabulary[165].init(62, "SCROLL");
+	_vocabulary[166].init(62, "MESSAGE");
+	_vocabulary[167].init(63, "PEN");
+	_vocabulary[168].init(63, "QUILL");
+	_vocabulary[169].init(64, "INK");
+	_vocabulary[170].init(64, "INKPOT");
+	_vocabulary[171].init(65, "CLOTHES");
+	_vocabulary[172].init(66, "HABIT");
+	_vocabulary[173].init(66, "DISGUISE");
+	_vocabulary[174].init(67, "ONION");
+
+	_vocabulary[175].init(99, "PASSWORD");
+
+	// Objects from Also are placed between 101 and 131.
+	// Nouns - People - Male: 150-174
+	_vocabulary[176].init(150, "AVVY");
+	_vocabulary[177].init(150, "AVALOT");
+	_vocabulary[178].init(150, "YOURSELF");
+	_vocabulary[179].init(150, "ME");
+	_vocabulary[180].init(150, "MYSELF");
+	_vocabulary[181].init(151, "SPLUDWICK");
+	_vocabulary[182].init(151, "THOMAS");
+	_vocabulary[183].init(151, "ALCHEMIST");
+	_vocabulary[184].init(151, "CHEMIST");
+	_vocabulary[185].init(152, "CRAPULUS");
+	_vocabulary[186].init(152, "SERF");
+	_vocabulary[187].init(152, "SLAVE");
+	_vocabulary[188].init(158, "DU"); // Put in early for Baron DU Lustie to save confusion with Duck & Duke.
+	_vocabulary[189].init(152, "CRAPPY");
+	_vocabulary[190].init(153, "DUCK");
+	_vocabulary[191].init(153, "DOCTOR");
+	_vocabulary[192].init(154, "MALAGAUCHE");
+	_vocabulary[193].init(155, "FRIAR");
+	_vocabulary[194].init(155, "TUCK");
+	_vocabulary[195].init(156, "ROBIN");
+	_vocabulary[196].init(156, "HOOD");
+	_vocabulary[197].init(157, "CWYTALOT");
+	_vocabulary[198].init(157, "GUARD");
+	_vocabulary[199].init(157, "BRIDGEKEEP");
+	_vocabulary[200].init(158, "BARON");
+	_vocabulary[201].init(158, "LUSTIE");
+	_vocabulary[202].init(159, "DUKE");
+	_vocabulary[203].init(159, "GRACE");
+	_vocabulary[204].init(160, "DOGFOOD");
+	_vocabulary[205].init(160, "MINSTREL");
+	_vocabulary[206].init(161, "TRADER");
+	_vocabulary[207].init(161, "SHOPKEEPER");
+	_vocabulary[208].init(161, "STALLHOLDER");
+	_vocabulary[209].init(162, "PILGRIM");
+	_vocabulary[210].init(162, "IBYTHNETH");
+	_vocabulary[211].init(163, "ABBOT");
+	_vocabulary[212].init(163, "AYLES");
+	_vocabulary[213].init(164, "PORT");
+	_vocabulary[214].init(165, "SPURGE");
+	_vocabulary[215].init(166, "JACQUES");
+	_vocabulary[216].init(166, "SLEEPER");
+	_vocabulary[217].init(166, "RINGER");
+
+	// Nouns - People - Female: 175-199
+	_vocabulary[218].init(175, "WIFE");
+	_vocabulary[219].init(175, "ARKATA");
+	_vocabulary[220].init(176, "GEDALODAVA");
+	_vocabulary[221].init(176, "GEIDA");
+	_vocabulary[222].init(176, "PRINCESS");
+	_vocabulary[223].init(178, "WISE");
+	_vocabulary[224].init(178, "WITCH");
+
+	// Pronouns: 200-224
+	_vocabulary[225].init(200, "HIM");
+	_vocabulary[226].init(200, "MAN");
+	_vocabulary[227].init(200, "GUY");
+	_vocabulary[228].init(200, "DUDE");
+	_vocabulary[229].init(200, "CHAP");
+	_vocabulary[230].init(200, "FELLOW");
+	_vocabulary[231].init(201, "HER");
+	_vocabulary[232].init(201, "GIRL");
+	_vocabulary[233].init(201, "WOMAN");
+	_vocabulary[234].init(202, "IT");
+	_vocabulary[235].init(202, "THING");
+	_vocabulary[236].init(203, "MONK");
+	_vocabulary[237].init(204, "BARMAN");
+	_vocabulary[238].init(204, "BARTENDER");
+
+	// Prepositions: 225-249
+	_vocabulary[239].init(225, "TO");
+	_vocabulary[240].init(226, "AT");
+	_vocabulary[241].init(227, "UP");
+	_vocabulary[242].init(228, "INTO");
+	_vocabulary[243].init(228, "INSIDE");
+	_vocabulary[244].init(229, "OFF");
+	_vocabulary[245].init(230, "UP");
+	_vocabulary[246].init(231, "DOWN");
+	_vocabulary[247].init(232, "ON");
+
+	// Please: 251
+	_vocabulary[248].init(251, "PLEASE");
+
+	// About: 252
+	_vocabulary[249].init(252, "ABOUT");
+	_vocabulary[250].init(252, "CONCERNING");
+
+	// Swear words: 253
+	/*		  I M P O R T A N T    M E S S A G E
+
+	DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+	DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+	GOODNESS KNOWS WHO WROTE THEM.
+	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+	_vocabulary[251].init(253, "SHIT");
+	_vocabulary[252].init(28 , "PISS");
+	_vocabulary[253].init(28 , "PEE");
+	_vocabulary[254].init(253, "FART");
+	_vocabulary[255].init(253, "FUCK");
+	_vocabulary[256].init(253, "BALLS");
+	_vocabulary[257].init(253, "BLAST");
+	_vocabulary[258].init(253, "BUGGER");
+	_vocabulary[259].init(253, "KNICKERS");
+	_vocabulary[260].init(253, "BLOODY");
+	_vocabulary[261].init(253, "HELL");
+	_vocabulary[262].init(253, "DAMN");
+	_vocabulary[263].init(253, "SMEG");
+	// ...and other even ruder words. You didn't read them, did you? Good.
+
+	// Answer-back smart-alec words: 249
+	_vocabulary[264].init(249, "YES");
+	_vocabulary[265].init(249, "NO");
+	_vocabulary[266].init(249, "BECAUSE");
+
+	// Noise words: 255
+	_vocabulary[267].init(255, "THE");
+	_vocabulary[268].init(255, "A");
+	_vocabulary[269].init(255, "NOW");
+	_vocabulary[270].init(255, "SOME");
+	_vocabulary[271].init(255, "AND");
+	_vocabulary[272].init(255, "THAT");
+	_vocabulary[273].init(255, "POCUS");
+	_vocabulary[274].init(255, "HIS");
+	_vocabulary[275].init(255, "THIS");
+	_vocabulary[276].init(255, "SENTINEL"); // for "Ken SENT Me"
+}
+
+void Acci::clearWords() {
+	for (byte i = 0; i < 11; i++) {
+		if (!_realWords[i].empty())
+			_realWords[i].clear();
+	}
+}
+
+byte Acci::wordNum(Common::String word) {
+	if (word.empty())
+		return 0;
+
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
+		if (_vocabulary[i]._word == word)
+			return _vocabulary[i]._number;
+	}
+
+	// If not found as a whole, we look for it as a substring.
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
+		if (Common::String(_vocabulary[i]._word.c_str(), word.size()) == word)
+			return _vocabulary[i]._number;
+	}
+
+	return kPardon;
+}
+
+void Acci::replace(Common::String oldChars, byte newChar) {
+	int16 pos = _vm->_parser->pos(oldChars, _thats);
+	while (pos != -1) {
+		if (newChar == 0)
+			_thats.deleteChar(pos);
+		else {
+			for (byte i = pos; i < pos + oldChars.size(); i++)
+				_thats.deleteChar(pos);
+			_thats.insertChar(newChar, pos);
+		}
+		pos = _vm->_parser->pos(oldChars, _thats);
+	}
+}
+
+Common::String Acci::rank() {
+	static const RankType kRanks[9] = {
+		{0, "Beginner"},     {10, "Novice"},
+		{20, "Improving"},   {35, "Not bad"},
+		{50, "Passable"},    {65, "Good"},
+		{80, "Experienced"}, {108, "The BEST!"},
+		{32767, "copyright'93"}
+	};
+
+	for (byte i = 0; i < 8; i++) {
+		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
+			return kRanks[i]._title;
+		}
+	}
+	return "";
+}
+
+Common::String Acci::totalTime() {
+	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
+	const double ticksInOneSec = (double)(65535) / 3600;
+	uint16 h, m, s;
+
+	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
+	m = h % 3600;
+	h /= 3600;
+	s = m % 60;
+	m /= 60;
+
+	Common::String result = "You've been playing for ";
+	if (h > 0)
+		result += Common::String::format("%d hours, ", h);
+	if ((m > 0) || (h != 0))
+		result = Common::String::format("%d minutes and ", m);
+	return result + Common::String::format("%d seconds", s);
+}
+
+void Acci::cheatParse(Common::String codes) {
+//	uint16 num;
+//	int16 e;
+//	char cmd;
+//	int16 se, sx, sy;
+
+	warning("STUB: Acci::cheatParse()");
+}
+
+
+
+void Acci::stripPunctuation(Common::String &word) {
+	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
+
+	for (byte i = 0; i < 32; i++) {
+		for (;;) {
+			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
+			if (pos == -1)
+				break;
+			word.deleteChar(pos);
+		}
+	}
+}
+
+void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
+	if (target == kPardon) {
+		ambiguous = true;
+		if (animate)
+			_vm->_scrolls->displayText("Whom?");
+		else
+			_vm->_scrolls->displayText("What?");
+	} else {
+		if (animate) {
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
+			_vm->_scrolls->displayText(tmpStr);
+		} else {
+			Common::String z = _vm->_gyro->getItem(target);
+			if (z != "") {
+				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
+				_vm->_scrolls->displayText(tmpStr);
+			}
+		}
+	}
+}
+
+bool Acci::doPronouns() {
+	bool ambiguous = false;
+
+	for (byte i = 0; i < _thats.size(); i++) {
+		byte wordCode = _thats[i];
+		switch (wordCode) {
+		case 200: {
+			displayWhat(_vm->_gyro->_him, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_him, i);
+			}
+			break;
+		case 201: {
+			displayWhat(_vm->_gyro->_her, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_her, i);
+			}
+			break;
+		case 202: {
+			displayWhat(_vm->_gyro->_it, false, ambiguous);
+			_thats.setChar(_vm->_gyro->_it, i);
+			}
+			break;
+		}
+	}
+
+	return ambiguous;
+}
+
+void Acci::properNouns() {
+	_vm->_parser->_inputText.toLowercase();
+
+	// We set every word's first character to uppercase.
+	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
+		if (_vm->_parser->_inputText[i] == ' ')
+			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
+	}
+
+	// And the first character as well.
+	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
+}
+
+void Acci::sayIt() {
+	Common::String x = _vm->_parser->_inputText;
+	x.setChar(toupper(x[0]), 0);
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), 
+		                                           Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
+	_vm->_scrolls->displayText(tmpStr);
+}
+
+void Acci::storeInterrogation(byte interrogation) {
+	if (_vm->_parser->_inputText.empty())
+		return;
+
+	// Strip _vm->_parser->_inputText:
+	while ((_vm->_parser->_inputText[0] == ' ') && (!_vm->_parser->_inputText.empty()))
+		_vm->_parser->_inputText.deleteChar(0);
+	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
+		_vm->_parser->_inputText.deleteLastChar();
+
+	_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
+
+	switch (interrogation) {
+	case 1:
+		_vm->_parser->_inputText.toLowercase();
+		sayIt();
+		_vm->_gyro->_favouriteDrink = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 2;
+		break;
+	case 2:
+		properNouns();
+		sayIt();
+		_vm->_gyro->_favouriteSong = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 3;
+		break;
+	case 3:
+		properNouns();
+		sayIt();
+		_vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText;
+		_vm->_gyro->_cardiffQuestionNum = 4;
+		break;
+	case 4:
+		_vm->_parser->_inputText.toLowercase();
+		sayIt();
+		if (!_vm->_gyro->_spareEvening.empty())
+			_vm->_gyro->_spareEvening.clear();
+		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
+		_vm->_scrolls->displayScrollChain('z', 5); // His closing statement...
+		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
+		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
+		_vm->_gyro->_cardiffQuestionNum = 5;
+		break;
+	case 99:
+		//store_high(_vm->_parser->_inputText);
+		warning("STUB: Acci::store_interrogation()");
+		break;
+	}
+
+	if (interrogation < 4)
+		_vm->_timer->cardiffSurvey();
+}
+
+
+
+void Acci::parse() {
+	// First parsing - word identification
+	if (!_thats.empty())
+		_thats.clear();
+
+	byte n = 0;
+	_polite = false;
+	_verb = kPardon;
+	_thing = kPardon;
+	_thing2 = kPardon;
+	_person = kPardon;
+	clearWords();
+
+
+	// A cheat mode attempt.
+	if (_vm->_parser->_inputText[0] == '.') {
+		cheatParse(_vm->_parser->_inputText);
+		_thats = kNothing;
+		return;
+	}
+
+	// Are we being interrogated right now?
+	if (_vm->_gyro->_interrogation > 0) {
+		storeInterrogation(_vm->_gyro->_interrogation);
+		_vm->_gyro->_weirdWord = true;
+		return;
+	}
+
+	// Actually process the command.
+	Common::String inputText = _vm->_parser->_inputText + ' ';
+	Common::String inputTextUpper = inputText;
+	inputTextUpper.toUppercase();
+	while (!inputTextUpper.empty()) {
+		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
+			inputTextUpper.deleteChar(0);
+			inputText.deleteChar(0);
+		}
+		if (inputTextUpper.empty())
+			break;
+
+		// Get the following word of the strings.
+		byte size = _vm->_parser->pos(Common::String(' '), inputTextUpper) + 1;
+		char *subStr = new char[size];
+		Common::strlcpy(subStr, inputTextUpper.c_str(), size);
+		Common::String thisword = subStr;
+		Common::strlcpy(subStr, inputText.c_str(), size);
+		_realWords[n] = subStr;
+		delete[] subStr;
+
+		stripPunctuation(inputTextUpper);
+
+		bool notfound = true;
+
+		// Check also[] first, which contains words about the actual room.
+		if (!thisword.empty()) {
+			for (byte i = 0; i < 31; i++) {
+				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
+					_thats += Common::String(99 + i);
+					notfound = false;
+				}
+			}
+		}
+
+		// Check Accis's own table (words[]) for "global" commands.
+		if (notfound) {
+			byte answer = wordNum(thisword);
+			if (answer == kPardon) {
+				notfound = true;
+				_thats = _thats + kPardon;
+			} else
+				_thats = _thats + answer;
+			n++;
+		}
+
+		// Delete words we already processed.
+		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
+		if (spacePos > -1) {
+			for (byte i = 0; i <= spacePos; i++)
+				inputTextUpper.deleteChar(0);
+		}
+
+		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
+		if (spacePos > -1) {
+			for (byte i = 0; i <= spacePos; i++)
+				inputText.deleteChar(0);
+		}
+	}
+
+	Common::String unkString;
+	int16 pos = _vm->_parser->pos(Common::String('\xFE'), _thats);
+	if (pos > -1)
+		unkString = _realWords[pos];
+	else
+		unkString.clear();
+
+	// Replace words' codes that mean the same.
+	replace(Common::String("\xFF"),     0); // zap noise words
+	replace(Common::String("\xD\xE2"),  1); // "look at" = "examine"
+	replace(Common::String("\xD\xE4"),  1); // "look in" = "examine"
+	replace(Common::String("\x4\xE6"),  17); // "get up" = "stand"
+	replace(Common::String("\x4\xE7"),  17); // "get down" = "stand"... well, why not?
+	replace(Common::String("\x12\xE4"), 2); // "go in" = "open [door]"
+	replace(Common::String("\x1C\xE5"), 253); // "P' off" is a swear word
+	replace(Common::String("\x4\x6"),   6); // "Take inventory" (remember Colossal Adventure?)
+	replace(Common::String("\x28\xE8"), 21); // "put on" = "don"
+	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
+
+	// Words that could mean more than one _person
+	if (_vm->_gyro->_room == r__nottspub)
+		replace(Common::String('\xCC'), 164); // Barman = Port
+	else
+		replace(Common::String('\xCC'), 154); // Barman = Malagauche
+
+	switch (_vm->_gyro->_room) {
+	case r__aylesoffice:
+		replace(Common::String('\xCB'), 163); // Monk = Ayles
+		break;
+	case r__musicroom:
+		replace(Common::String('\xCB'), 166); // Monk = Jacques
+		break;
+	default:
+		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
+	}
+
+	if (doPronouns()) {
+		_vm->_gyro->_weirdWord = true;
+		_thats = kNothing;
+		return;
+	}
+
+	// Second parsing.
+	if (!_vm->_gyro->_subject.empty())
+		_vm->_gyro->_subject.clear();
+	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
+
+	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
+		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
+			_vm->_gyro->_subjectNum = (byte)_thats[i];
+			_thats.setChar(kMoved, i);
+			break;
+		}
+	}
+
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
+			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
+				break;
+			}
+		}
+	}
+
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
+			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
+				// SAY not followed by a preposition
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
+				break;
+			}
+		}
+	}
+
+	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
+		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
+			_verb = (byte)_thats[i];
+		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
+			_thing2 = _thing;
+			_thing = (byte)_thats[i];
+		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
+			_person = (byte)_thats[i];
+		else if ((byte)_thats[i] == 251)
+			_polite = true;
+	}
+
+	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
+		_vm->_scrolls->displayText(tmpStr);
+		_vm->_gyro->_weirdWord = true;
+	} else
+		_vm->_gyro->_weirdWord = false;
+
+	if (_thats.empty())
+		_thats = kNothing;
+
+	if (_thing != kPardon)
+		_vm->_gyro->_it = _thing;
+
+	if (_person != kPardon) {
+		if (_person < 175)
+			_vm->_gyro->_him = _person;
+		else
+			_vm->_gyro->_her = _person;
+	}
+}
+
+void Acci::examineObject() {
+	if (_thing != _vm->_gyro->_thinks)
+		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
+	switch (_thing) {
+	case Gyro::kObjectWine :
+		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
+		case 1:
+			_vm->_scrolls->displayScrollChain('t', 1); // Normal examine wine scroll
+			break;
+		case 2:
+			_vm->_scrolls->displayScrollChain('d', 6); // Bad wine
+			break;
+		case 3:
+			_vm->_scrolls->displayScrollChain('d', 7); // Vinegar
+			break;
+		}
+		break;
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion.
+		else
+			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion scroll
+		break;
+	default:
+		_vm->_scrolls->displayScrollChain('t', _thing); // <<< Ordinarily
+	}
+}
+
+bool Acci::isPersonHere() { // Person equivalent of "holding".
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
+		return true;
+	else {
+		Common::String tmpStr;
+		if (_person < 175)
+			tmpStr = "He isn't around at the moment.";
+		else
+			tmpStr = "She isn't around at the moment.";
+		_vm->_scrolls->displayText(tmpStr);
+		return false;
+	}
+}
+
+void Acci::exampers() {
+	if (isPersonHere()) {
+		if (_thing != _vm->_gyro->_thinks)
+			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
+		_person -= 149;
+		switch (_person) { // Special cases
+		case 11:
+			if (_vm->_gyro->_wonNim) {
+				_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
+				return;
+			}
+			break;
+		case 99:
+			if (_vm->_gyro->_lustieIsAsleep) {
+				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
+				return;
+			}
+			break;
+		}
+		// Otherwise...
+		_vm->_scrolls->displayScrollChain('p', _person);
+	}
+
+	// And afterwards...
+	if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
+		_vm->_scrolls->displayScrollChain('Q', 13);
+}
+
+/**
+ * Return whether Avvy is holding an object or not
+ * @remarks	Originally called 'holding'
+ */
+bool Acci::isHolding() {
+	if ((51 <= _thing) && (_thing <= 99)) // Also.
+		return true;
+
+	bool holdingResult = false;
+
+	if (_thing > 100)
+		_vm->_scrolls->displayText("Be reasonable!");
+	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+		_vm->_scrolls->displayText("You're not holding it, Avvy.");
+	else
+		holdingResult = true;
+
+	return holdingResult;
+}
+
+void Acci::openBox(bool isOpening) {
+	if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) {
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+
+		_vm->_celer->updateBackgroundSprites();
+		_vm->_animation->animLink();
+		_vm->_graphics->refreshScreen();
+
+		_vm->_system->delayMillis(55);
+
+		if (!isOpening) {
+			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			_vm->_celer->updateBackgroundSprites();
+			_vm->_animation->animLink();
+			_vm->_graphics->refreshScreen();
+		}
+	}
+}
+
+void Acci::examine() {
+	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
+	if ((_person == kPardon) && (_thing != kPardon)) {
+		if (isHolding()) {
+			// Remember: it's been Slipped! Ie subtract 49.
+			if ((1 <= _thing) && (_thing <= 49)) // Standard object
+				examineObject();
+			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
+				openBox(true);
+				_vm->_scrolls->displayText(*_vm->_gyro->_also[_thing - 50][1]);
+				openBox(false);
+			}
+		}
+	} else if (_person != kPardon)
+		exampers();
+	else
+		_vm->_scrolls->displayText("It's just as it looks on the picture.");  // Don't know: guess.
+}
+
+void Acci::inventory() {
+	byte itemNum = 0;
+	Common::String tmpStr = Common::String("You're carrying ");
+
+	for (byte i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_objects[i]) {
+			itemNum++;
+			if (itemNum == _vm->_gyro->_carryNum)
+				tmpStr += "and ";
+
+			tmpStr += _vm->_gyro->getItem(i + 1);
+
+			if ((i + 1) == _vm->_gyro->_wearing)
+				tmpStr += ", which you're wearing";
+
+			if (itemNum < _vm->_gyro->_carryNum)
+				tmpStr += ", ";
+		}
+	}
+
+	if (_vm->_gyro->_wearing == kNothing)
+		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+	else
+		tmpStr += '.';
+
+	_vm->_scrolls->displayText(tmpStr);
+}
+
+void Acci::swallow() {   // Eat something.
+	switch (_thing) {
+	case Gyro::kObjectWine:
+		switch (_vm->_gyro->_wineState) { // 4 is perfect
+		case 1:
+			if (_vm->_gyro->_teetotal)  {
+				_vm->_scrolls->displayScrollChain('D', 6);
+				return;
+			}
+			_vm->_scrolls->displayScrollChain('U', 1);
+			_vm->_pingo->wobble();
+			_vm->_scrolls->displayScrollChain('U', 2);
+			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+			_vm->_lucerna->refreshObjectList();
+			drink();
+			break;
+		case 2:
+		case 3:
+			_vm->_scrolls->displayScrollChain('d', 8);
+			break; // You can't drink it!
+		}
+		break;
+	case Gyro::kObjectPotion:
+		_vm->_gyro->setBackgroundColor(4);
+		_vm->_scrolls->displayScrollChain('U', 3);
+		_vm->_lucerna->gameOver();
+		_vm->_gyro->setBackgroundColor(0);
+		break;
+	case Gyro::kObjectInk:
+		_vm->_scrolls->displayScrollChain('U', 4);
+		break;
+	case Gyro::kObjectChastity:
+		_vm->_scrolls->displayScrollChain('U', 5);
+		break;
+	case Gyro::kObjectMushroom:
+		_vm->_scrolls->displayScrollChain('U', 6);
+		_vm->_lucerna->gameOver();
+		break;
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_scrolls->displayScrollChain('U', 11);
+		else {
+			_vm->_scrolls->displayScrollChain('U', 8);
+			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
+			_vm->_lucerna->refreshObjectList();
+		}
+		break;
+	default:
+		if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub))
+			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
+		else
+			_vm->_scrolls->displayText("The taste of it makes you retch!");
+	}
+}
+
+void Acci::peopleInRoom() {
+	byte numPeople = 0; // Number of people in the room.
+
+	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
+			numPeople++;
+	}
+
+	if (numPeople == 0) // If nobody's here, we can cut out straight away.
+		return;
+
+	Common::String tmpStr;
+	byte actPerson = 0; // Actually listed people.
+	for (byte i = 1; i < 29; i++) {
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
+			actPerson++;
+			if (actPerson == 1) // First on the list.
+				tmpStr = _vm->_gyro->getName(i + 150);
+			else if (actPerson < numPeople) // The middle...
+				tmpStr += ", " + _vm->_gyro->getName(i + 150);
+			else // The end.
+				tmpStr += " and " + _vm->_gyro->getName(i + 150);
+		}
+	}
+
+	if (numPeople == 1)
+		tmpStr += " is";
+	else
+		tmpStr += " are";
+
+	_vm->_scrolls->displayText(tmpStr + " here."); // End and display it.
+}
+
+void Acci::lookAround() {
+	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
+	switch (_vm->_gyro->_room) {
+	case r__spludwicks:
+		if (_vm->_gyro->_avariciusTalk > 0)
+			_vm->_scrolls->displayScrollChain('q', 23);
+		else
+			peopleInRoom();
+		break;
+	case r__robins:
+		if (_vm->_gyro->_tiedUp)
+			_vm->_scrolls->displayScrollChain('q', 38);
+		if (_vm->_gyro->_mushroomGrowing)
+			_vm->_scrolls->displayScrollChain('q', 55);
+		break;
+	case r__insidecardiffcastle:
+		if (!_vm->_gyro->_takenPen)
+			_vm->_scrolls->displayScrollChain('q', 49);
+		break;
+	case r__lustiesroom:
+		if (_vm->_gyro->_lustieIsAsleep)
+			_vm->_scrolls->displayScrollChain('q', 65);
+		break;
+	case r__catacombs:
+		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
+		case 258 :
+			_vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery.
+			break;
+		case 514 :
+			_vm->_scrolls->displayScrollChain('q', 81); // Outside ditto.
+			break;
+		case 260 :
+			_vm->_scrolls->displayScrollChain('q', 82); // Outside Geida's room.
+			break;
+		}
+		break;
+	default:
+		peopleInRoom();
+	}
+}
+
+void Acci::openDoor() {
+	// Special cases.
+	switch (_vm->_gyro->_room) {
+	case r__yours:
+		if (_vm->_animation->inField(2)) {
+			// Opening the box.
+			_thing = 54; // The box.
+			_person = kPardon;
+			examine();
+			return;
+		}
+		break;
+	case r__spludwicks:
+		if (_thing == 61) {
+			_vm->_scrolls->displayScrollChain('q', 85);
+			return;
+		}
+		break;
+	}
+
+	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties))
+		return; // No doors can open if you can't move Avvy.
+
+	for (byte i = 0; i < 7; i++) {
+		if (_vm->_animation->inField(i + 9)) {
+			MagicType *portal = &_vm->_gyro->_portals[i];
+			switch (portal->_operation) {
+			case Gyro::kMagicExclaim:
+				_vm->_animation->_sprites[0].bounce();
+				_vm->_scrolls->displayScrollChain('x', portal->_data);
+				break;
+			case Gyro::kMagicTransport:
+				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
+				break;
+			case Gyro::kMagicUnfinished:
+				_vm->_animation->_sprites[0].bounce();
+				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
+				break;
+			case Gyro::kMagicSpecial:
+				_vm->_animation->callSpecial(portal->_data);
+				break;
+			case Gyro::kMagicOpenDoor:
+				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
+				break;
+			}
+
+			return;
+		}
+	}
+
+	if (_vm->_gyro->_room == r__map)
+		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
+				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
+	else
+		_vm->_scrolls->displayText("Door? What door?");
+}
+
+
+
+void Acci::silly() {
+	_vm->_scrolls->displayText("Don't be silly!");
+}
+
+void Acci::putProc() {
+	if (!isHolding())
+		return;
+
+	_thing2 -= 49; // Slip the second object.
+	char temp = _thing;
+	_thing = _thing2;
+	if (!isHolding())
+		return;
+	_thing = temp;
+
+	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
+	switch (_thing2) {
+	case Gyro::kObjectWine:
+		if (_thing == Gyro::kObjectOnion) {
+			if (_vm->_gyro->_rottenOnion)
+				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
+			else { // Put onion into wine?
+				if (_vm->_gyro->_wineState != 3) {
+					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+					_vm->_scrolls->displayText(tmpStr);
+				} else { // Put onion into vinegar! Yes!
+					_vm->_gyro->_onionInVinegar = true;
+					_vm->_lucerna->incScore(7);
+					_vm->_scrolls->displayScrollChain('u', 9);
+				}
+			}
+		} else
+			silly();
+		break;
+
+	case 54:
+		if (_vm->_gyro->_room == r__yours) { // Put something into the box.
+			if (_vm->_gyro->_boxContent != kNothing)
+				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
+			else {
+				switch (_thing) {
+				case Gyro::kObjectMoney:
+					_vm->_scrolls->displayText("You'd better keep some ready cash on you!");
+					break;
+				case Gyro::kObjectBell:
+					_vm->_scrolls->displayText("That's a silly place to keep a bell.");
+					break;
+				case Gyro::kObjectBodkin:
+					_vm->_scrolls->displayText("But you might need it!");
+					break;
+				case Gyro::kObjectOnion:
+					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
+					break;
+				default: // Put the object into the box...
+					if (_vm->_gyro->_wearing == _thing) {
+						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
+						_vm->_scrolls->displayText(tmpStr);
+					} else {
+						openBox(true); // Open box.
+
+						_vm->_gyro->_boxContent = _thing;
+						_vm->_gyro->_objects[_thing - 1] = false;
+						_vm->_lucerna->refreshObjectList();
+						_vm->_scrolls->displayText("OK, it's in the box.");
+
+						openBox(false); // Shut box.
+					}
+				}
+			}
+		} else
+			silly();
+		break;
+
+	default:
+		silly();
+	}
+}
+
+/**
+ * Display text when ingredients are not in the right order
+ * @remarks	Originally called 'not_in_order'
+ */
+void Acci::notInOrder() {
+	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
+		"What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+	_vm->_scrolls->displayText(tmpStr);
+}
+
+/**
+ * Move Spludwick to cauldron
+ * @remarks	Originally called 'go_to_cauldron'
+ */
+void Acci::goToCauldron() {
+	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
+	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
+	_vm->_animation->_sprites[1].walkTo(2);
+}
+
+/**
+ * Check is it's possible to give something to Spludwick
+ * @remarks	Originally called 'give2spludwick'
+ */
+bool Acci::giveToSpludwick() {
+	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
+		notInOrder();
+		return false;
+	}
+
+	switch (_thing) {
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_scrolls->displayScrollChain('q', 22);
+		else {
+			_vm->_gyro->_givenToSpludwick++;
+			_vm->_scrolls->displayScrollChain('q', 20);
+			goToCauldron();
+			_vm->_lucerna->incScore(3);
+		}
+		_vm->_lucerna->refreshObjectList();
+		break;
+	case Gyro::kObjectInk:
+		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
+		_vm->_lucerna->refreshObjectList();
+		_vm->_gyro->_givenToSpludwick++;
+		_vm->_scrolls->displayScrollChain('q', 24);
+		goToCauldron();
+		_vm->_lucerna->incScore(3);
+		break;
+	case Gyro::kObjectMushroom:
+		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
+		_vm->_scrolls->displayScrollChain('q', 25);
+		_vm->_lucerna->incScore(5);
+		_vm->_gyro->_givenToSpludwick++;
+		goToCauldron();
+		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
+		_vm->_lucerna->refreshObjectList();
+		break;
+	default:
+		return true;
+	}
+
+	return false;
+}
+
+void Acci::drink() {
+	_vm->_gyro->_alcoholLevel += 1;
+	if (_vm->_gyro->_alcoholLevel == 5) {
+		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
+		_vm->_gyro->_teetotal = true;
+		_vm->_gyro->_avvyIsAwake = false;
+		_vm->_gyro->_avvyInBed = true;
+		_vm->_lucerna->refreshObjectList();
+		_vm->_lucerna->dusk();
+		_vm->_gyro->hangAroundForAWhile();
+		_vm->_animation->flipRoom(1, 1);
+		_vm->_gyro->setBackgroundColor(14);
+		_vm->_animation->_sprites[0]._visible = false;
+	}
+}
+
+void Acci::cardiffClimbing() {
+	if (_vm->_gyro->_standingOnDais) { // Clamber up.
+		_vm->_scrolls->displayText("You climb down, back onto the floor.");
+		_vm->_gyro->_standingOnDais = false;
+		_vm->_animation->appearPed(1, 3);
+	} else { // Clamber down.
+		if (_vm->_animation->inField(1)) {
+			_vm->_scrolls->displayText("You clamber up onto the dais.");
+			_vm->_gyro->_standingOnDais = true;
+			_vm->_animation->appearPed(1, 2);
+		} else
+			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
+	}
+}
+
+void Acci::already() {
+	_vm->_scrolls->displayText("You're already standing!");
+}
+
+void Acci::standUp() {
+	switch (_vm->_gyro->_room) {
+	case r__yours: // Avvy isn't asleep.
+		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
+			if (_vm->_gyro->_teetotal) {
+				_vm->_scrolls->displayScrollChain('d', 12);
+				_vm->_gyro->setBackgroundColor(0);
+				_vm->_scrolls->displayScrollChain('d', 14);
+			}
+			_vm->_animation->_sprites[0]._visible = true;
+			_vm->_gyro->_userMovesAvvy = true;
+			_vm->_animation->appearPed(1, 2);
+			_vm->_animation->_direction = Animation::kDirLeft;
+			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
+			_vm->_lucerna->incScore(1);
+			_vm->_gyro->_avvyInBed = false;
+			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
+		} else
+			already();
+		break;
+
+	case r__insidecardiffcastle:
+		cardiffClimbing();
+		break;
+
+	case r__nottspub:
+		if (_vm->_gyro->_sittingInPub)  {
+			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
+			_vm->_animation->_sprites[0]._visible = true; // But standing up.
+			_vm->_animation->appearPed(1, 4); // And walking away.
+			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
+			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
+		} else
+			already();
+		break;
+	default:
+		already();
+	}
+}
+
+void Acci::getProc(char thing) {
+	switch (_vm->_gyro->_room) {
+	case r__yours:
+		if (_vm->_animation->inField(2)) {
+			if (_vm->_gyro->_boxContent == thing) {
+				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+				_vm->_scrolls->displayText("OK, I've got it.");
+				_vm->_gyro->_objects[thing - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_boxContent = kNothing;
+				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			} else {
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
+				_vm->_scrolls->displayText(tmpStr);
+			}
+		} else
+			_vm->_scrolls->displayScrollChain('q', 57);
+		break;
+	case r__insidecardiffcastle:
+		switch (thing) {
+		case Gyro::kObjectPen:
+			if (_vm->_animation->inField(2)) { // Standing on the dais.
+				if (_vm->_gyro->_takenPen)
+					_vm->_scrolls->displayText("It's not there, Avvy.");
+				else {
+					// OK: we're taking the pen, and it's there.
+					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
+					_vm->_animation->callSpecial(3); // Zap!
+					_vm->_gyro->_takenPen = true;
+					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
+					_vm->_lucerna->refreshObjectList();
+					_vm->_scrolls->displayText("Taken.");
+				}
+			} else if (_vm->_gyro->_standingOnDais)
+				_vm->_scrolls->displayScrollChain('q', 53);
+			else
+				_vm->_scrolls->displayScrollChain('q', 51);
+			break;
+		case Gyro::kObjectBolt:
+			_vm->_scrolls->displayScrollChain('q', 52);
+			break;
+		default:
+			_vm->_scrolls->displayScrollChain('q', 57);
+		}
+		break;
+	case r__robins:
+		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) {
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_scrolls->displayText("Got it!");
+			_vm->_gyro->_mushroomGrowing = false;
+			_vm->_gyro->_takenMushroom = true;
+			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
+			_vm->_lucerna->refreshObjectList();
+			_vm->_lucerna->incScore(3);
+		} else
+			_vm->_scrolls->displayScrollChain('q', 57);
+		break;
+	default:
+		_vm->_scrolls->displayScrollChain('q', 57);
+	}
+}
+
+/**
+ * Give the lute to Geida
+ * @remarks	Originally called 'give_Geida_the_lute'
+ */
+void Acci::giveGeidaTheLute() {
+	if (_vm->_gyro->_room != r__lustiesroom) {
+		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		return;
+	}
+	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
+	_vm->_lucerna->refreshObjectList();
+	_vm->_scrolls->displayScrollChain('q', 64); // She plays it.
+
+	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
+	_vm->_enid->backToBootstrap(4);
+}
+
+void Acci::playHarp() {
+	if (_vm->_animation->inField(7))
+		_vm->_scrolls->musicalScroll();
+	else
+		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
+}
+
+void Acci::winSequence() {
+	_vm->_scrolls->displayScrollChain('q', 78);
+	_vm->_sequence->firstShow(7);
+	_vm->_sequence->thenShow(8);
+	_vm->_sequence->thenShow(9);
+	_vm->_sequence->startToClose();
+	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
+}
+
+Common::String Acci::personSpeaks() {
+	if ((_person == kPardon) || (_person == 0)) {
+		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
+			_person = _vm->_gyro->_her;
+		else
+			_person = _vm->_gyro->_him;
+	}
+
+	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
+		return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
+	}
+
+	bool found = false; // The _person we're looking for's code is in _person.
+	Common::String tmpStr;
+
+	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
+			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, '1' + i);
+			found = true;
+		}
+	}
+
+	if (found)
+		return tmpStr;
+
+	for (byte i = 0; i < 16; i++) {
+		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
+			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
+	}
+
+	return tmpStr;
+}
+void Acci::heyThanks() {
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
+	_vm->_scrolls->displayText(tmpStr);
+	_vm->_gyro->_objects[_thing - 1] = false;
+}
+
+/**
+ * @remarks	Originally called 'do_that'
+ */
+void Acci::doThat() {
+	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	static const char kWhat[] = "That's not possible!";
+
+	if (_thats == Common::String(kNothing))  {
+		if (!_thats.empty())
+			_thats.clear();
+		return;
+	}
+
+	if (_vm->_gyro->_weirdWord)
+		return;
+
+	if (_thing < 200)
+		_thing -= 49; // "Slip"
+
+
+	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
+	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
+	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
+		if (!_vm->_gyro->_alive) {
+			_vm->_scrolls->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
+			return;
+		}
+		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+			_vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
+			return;
+		}
+	}
+
+	switch (_verb) {
+	case kVerbCodeExam:
+		examine();
+		break;
+	case kVerbCodeOpen:
+		openDoor();
+		break;
+	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+		_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeGet:
+		if (_thing != kPardon) { // Legitimate try to pick something up.
+			if (_vm->_gyro->_carryNum >= kCarryLimit)
+				_vm->_scrolls->displayText("You can't carry any more!");
+			else
+				getProc(_thing);
+		} else { // Not... ditto.
+			if (_person != kPardon)
+				_vm->_scrolls->displayText("You can't sweep folk off their feet!");
+			else
+				_vm->_scrolls->displayText("I assure you, you don't need it.");
+		}
+		break;
+	case kVerbCodeDrop:
+		_vm->_scrolls->displayText("Two years ago you dropped a florin in the street. Three days " \
+				"later it was gone! So now you never leave ANYTHING lying around. OK?");
+		break;
+	case kVerbCodeInv:
+		inventory();
+		break;
+	case kVerbCodeTalk:
+		if (_person == kPardon) {
+			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
+				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Scrolls::kControlItalic, Scrolls::kControlRoman);
+				_vm->_scrolls->displayText(tmpStr);
+			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
+				_thats.deleteChar(0);
+
+				for (byte i = 0; i < 10; i++)
+					_realWords[i] = _realWords[i + 1];
+
+				_verb = _vm->_gyro->_subjectNum;
+				doThat();
+				return;
+			} else {
+				_person = _vm->_gyro->_subjectNum;
+				_vm->_gyro->_subjectNum = 0;
+				if ((_person == 0) || (_person == kPardon))
+					_vm->_scrolls->displayText("Talk to whom?");
+				else if (isPersonHere())
+					_vm->_scrolls->talkTo(_person);
+			}
+		} else if (isPersonHere())
+			_vm->_scrolls->talkTo(_person);
+		break;
+	case kVerbCodeGive:
+		if (isHolding()) {
+			if (_person == kPardon)
+				_vm->_scrolls->displayText("Give to whom?");
+			else if (isPersonHere()) {
+				switch (_thing) {
+				case Gyro::kObjectMoney :
+					_vm->_scrolls->displayText("You can't bring yourself to give away your moneybag.");
+					break;
+				case Gyro::kObjectBodkin:
+				case Gyro::kObjectBell:
+				case Gyro::kObjectClothes:
+				case Gyro::kObjectHabit :
+					_vm->_scrolls->displayText("Don't give it away, it might be useful!");
+					break;
+				default:
+					switch (_person) {
+					case Gyro::kPeopleCrapulus:
+						if (_thing == Gyro::kObjectWine) {
+							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
+							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+						} else
+							heyThanks();
+						break;
+					case Gyro::kPeopleCwytalot:
+						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
+							_vm->_scrolls->displayText("You might be able to influence Cwytalot more if you used it!");
+						else
+							heyThanks();
+						break;
+					case Gyro::kPeopleSpludwick:
+						if (giveToSpludwick())
+							heyThanks();
+						break;
+					case Gyro::kPeopleIbythneth:
+						if (_thing == Gyro::kObjectBadge) {
+							_vm->_scrolls->displayScrollChain('q', 32); // Thanks! Wow!
+							_vm->_lucerna->incScore(3);
+							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
+							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
+							_vm->_gyro->_givenBadgeToIby = true;
+							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+						} else
+							heyThanks();
+						break;
+					case Gyro::kPeopleAyles:
+						if (_vm->_gyro->_aylesIsAwake) {
+							if (_thing == Gyro::kObjectPen) {
+								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
+								_vm->_scrolls->displayScrollChain('q', 54);
+								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
+								_vm->_gyro->_givenPenToAyles = true;
+								_vm->_lucerna->refreshObjectList();
+								_vm->_lucerna->incScore(2);
+							} else
+								heyThanks();
+						} else
+							_vm->_scrolls->displayText("But he's asleep!");
+						break;
+					case Gyro::kPeopleGeida:
+						switch (_thing) {
+						case Gyro::kObjectPotion:
+							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
+							_vm->_scrolls->displayScrollChain('u', 16); // She drinks it.
+							_vm->_lucerna->incScore(2);
+							_vm->_gyro->_givenPotionToGeida = true;
+							_vm->_lucerna->refreshObjectList();
+							break;
+						case Gyro::kObjectLute:
+							giveGeidaTheLute();
+							break;
+						default:
+							heyThanks();
+						}
+						break;
+					case Gyro::kPeopleArkata:
+						switch (_thing) {
+						case Gyro::kObjectPotion:
+							if (_vm->_gyro->_givenPotionToGeida)
+								winSequence();
+							else
+								_vm->_scrolls->displayScrollChain('q', 77); // That Geida woman!
+							break;
+						default:
+							heyThanks();
+						}
+						break;
+					default:
+						heyThanks();
+					}
+				}
+			}
+			_vm->_lucerna->refreshObjectList(); // Just in case...
+		}
+		break;
+
+	case kVerbCodeEat:
+	case kVerbCodeDrink:
+		if (isHolding())
+			swallow();
+		break;
+
+	case kVerbCodeLoad:
+		break;
+	case kVerbCodeSave:
+		break;
+	// We don't handle these two because we use ScummVM's save/load system.
+
+	case kVerbCodePay:
+		_vm->_scrolls->displayText("No money need change hands.");
+		break;
+	case kVerbCodeLook:
+		lookAround();
+		break;
+	case kVerbCodeBreak:
+		_vm->_scrolls->displayText("Vandalism is prohibited within this game!");
+		break;
+	case kVerbCodeQuit: // quit
+		if (!_polite)
+			_vm->_scrolls->displayText("How about a `please\", Avvy?");
+		else {
+			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Scrolls::kControlRegister, Scrolls::kControlIcon);
+			if (_vm->_scrolls->displayQuestion(tmpStr))
+				_vm->_gyro->_letMeOut = true;
+		}
+		break;
+	case kVerbCodeGo:
+		_vm->_scrolls->displayText("Just use the arrow keys to walk there.");
+		break;
+	case kVerbCodeInfo: {
+		_vm->_scrolls->_aboutScroll = true;
+
+		Common::String toDisplay;
+		for (byte i = 0; i < 7; i++)
+			toDisplay += Scrolls::kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Scrolls::kControlCenter + Scrolls::kControlNewLine
+			+ "The medi\x91val descendant of" + Scrolls::kControlNewLine
+			+ "Denarius Avaricius Sextus" + Scrolls::kControlNewLine + Scrolls::kControlNewLine
+			+ "version " + _vm->_gyro->kVersionNum + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Copyright \xEF "
+			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Scrolls::kControlRegister + 'Y' + Scrolls::kControlIcon;
+		_vm->_scrolls->displayText(toDisplay);
+		_vm->_scrolls->_aboutScroll = false;
+		}
+		break;
+	case kVerbCodeUndress:
+		if (_vm->_gyro->_wearing == kNothing)
+			_vm->_scrolls->displayText("You're already stark naked!");
+		else if (_vm->_gyro->_avvysInTheCupboard) {
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
+			_vm->_scrolls->displayText(tmpStr);
+			_vm->_gyro->_wearing = kNothing;
+			_vm->_lucerna->refreshObjectList();
+		} else
+			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
+		break;
+	case kVerbCodeWear:
+		if (isHolding()) { // Wear something.
+			switch (_thing) {
+			case Gyro::kObjectChastity:
+				// \? are used to avoid that ??! is parsed as a trigraph
+				_vm->_scrolls->displayText("Hey, what kind of a weirdo are you\?\?!");
+				break;
+			case Gyro::kObjectClothes:
+			case Gyro::kObjectHabit: { // Change this!
+					if (_vm->_gyro->_wearing != kNothing) {
+						if (_vm->_gyro->_wearing == _thing)
+							_vm->_scrolls->displayText("You're already wearing that.");
+						else
+							_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
+						return;
+					} else
+						_vm->_gyro->_wearing = _thing;
+
+					_vm->_lucerna->refreshObjectList();
+
+					byte i;
+					if (_thing == Gyro::kObjectHabit)
+						i = 3;
+					else
+						i = 0;
+					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
+					if (spr->_id != i) {
+						int16 x = spr->_x;
+						int16 y = spr->_y;
+						spr->remove();
+						spr->init(i, true, _vm->_animation);
+						spr->appear(x, y, Animation::kDirLeft);
+						spr->_visible = false;
+					}
+				}
+				break;
+			default:
+				_vm->_scrolls->displayText(kWhat);
+			}
+		}
+		break;
+	case kVerbCodePlay:
+		if (_thing == kPardon) {
+			switch (_vm->_gyro->_room) { // They just typed "play"...
+			case r__argentpub: { // ...in the pub, => play Nim.
+					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
+					// play_nim();
+					// The following parts are copied from play_nim().
+					// The player automatically wins the game everytime he wins, until I implement the mini-game.
+
+					if (_vm->_gyro->_wonNim) { // Already won the game.
+						_vm->_scrolls->displayScrollChain('Q', 6);
+						return;
+					}
+
+					if (!_vm->_gyro->_askedDogfoodAboutNim) {
+						_vm->_scrolls->displayScrollChain('q', 84);
+						return;
+					}
+
+					_vm->_scrolls->displayScrollChain('Q', 3);
+					_vm->_gyro->_playedNim++;
+
+					// You won - strange!
+					_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
+					_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
+					_vm->_lucerna->refreshObjectList();
+					_vm->_gyro->_wonNim = true;
+					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
+					_vm->_lucerna->incScore(7); // 7 points for winning!
+
+					if (_vm->_gyro->_playedNim == 1)
+						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
+
+					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
+					_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+						+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
+				}
+				break;
+			case r__musicroom:
+				playHarp();
+				break;
+			}
+		} else if (isHolding()) {
+			switch (_thing) {
+			case Gyro::kObjectLute :
+					_vm->_scrolls->displayScrollChain('U', 7);
+
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
+						_vm->_scrolls->displayScrollChain('U', 10);
+
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
+						_vm->_scrolls->displayScrollChain('U', 15);
+				break;
+			case 52:
+				if (_vm->_gyro->_room == r__musicroom)
+					playHarp();
+				else
+					_vm->_scrolls->displayText(kWhat);
+				break;
+			case 55:
+				if (_vm->_gyro->_room == r__argentpub)
+					// play_nim();
+					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
+				else
+					_vm->_scrolls->displayText(kWhat);
+				break;
+			default:
+				_vm->_scrolls->displayText(kWhat);
+			}
+		}
+		break;
+	case kVerbCodeRing:
+		if (isHolding()) {
+			if (_thing == Gyro::kObjectBell) {
+				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+					// \? are used to avoid that ??! is parsed as a trigraph
+					_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
+			} else
+				_vm->_scrolls->displayText(kWhat);
+		}
+		break;
+	case kVerbCodeHelp:
+		// boot_help();
+		warning("STUB: Acci::doThat() - case kVerbCodehelp");
+		break;
+	case kVerbCodeLarrypass:
+		_vm->_scrolls->displayText("Wrong game!");
+		break;
+	case kVerbCodePhaon:
+		_vm->_scrolls->displayText("Hello, Phaon!");
+		break;
+	case kVerbCodeBoss:
+		// bosskey();
+		warning("STUB: Acci::doThat() - case kVerbCodeboss");
+		break;
+	case kVerbCodePee:
+		if (_vm->_gyro->setFlag('P')) {
+			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
+			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
+		} else {
+			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Scrolls::kControlItalic, Scrolls::kControlRoman);
+			_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeCheat: {
+		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Scrolls::kControlItalic);
+		_vm->_scrolls->displayText(tmpStr);
+		_vm->_gyro->_cheat = true;
+		}
+		break;
+	case kVerbCodeMagic:
+		if (_vm->_gyro->_avariciusTalk > 0)
+			_vm->_scrolls->displayScrollChain('q', 19);
+		else {
+			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
+				_vm->_scrolls->displayScrollChain('q', 17);
+				if (_vm->_gyro->_whereIs[1] == 12)
+					_vm->_scrolls->displayScrollChain('q', 18);
+				else {
+					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
+					spr->init(1, false, _vm->_animation); // Avaricius
+					_vm->_animation->appearPed(2, 4);
+					spr->walkTo(5);
+					spr->_callEachStepFl = true;
+					spr->_eachStepProc = Animation::kProcBackAndForth;
+					_vm->_gyro->_avariciusTalk = 14;
+					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
+				}
+			} else
+				_vm->_scrolls->displayText("Nothing appears to happen...");
+		}
+		break;
+	case kVerbCodeSmartAlec:
+		_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
+		break;
+	case kVerbCodeExpletive:
+		switch (_vm->_gyro->_sworeNum) {
+		case 0: {
+			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
+				"(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
+			}
+			break;
+		case 1: {
+			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
+				"do things I tell you not to?%c%cDon't do it again!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
+			}
+			break;
+		default: {
+			_vm->_pingo->zonk();
+			// CHECKME: Weird character in string
+			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+			_vm->_scrolls->displayText(tmpStr);
+			_vm->_lucerna->gameOver();
+			}
+		}
+		_vm->_gyro->_sworeNum++;
+		break;
+	case kVerbCodeListen:
+		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+			_vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
+		else if (_vm->_gyro->_listen.empty())
+			_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy.");
+		else
+			_vm->_scrolls->displayText(_vm->_gyro->_listen);
+		break;
+	case kVerbCodeBuy: // What are they trying to buy?
+		switch (_vm->_gyro->_room) {
+		case r__argentpub:
+			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
+				switch (_thing) {
+				case 51:
+				case 53:
+				case 54:
+				case 58: // Beer, whisky, cider or mead.
+					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+						_vm->_scrolls->displayScrollChain('D', 15);
+						return;
+					}
+
+					if (_vm->_gyro->_teetotal)  {
+						_vm->_scrolls->displayScrollChain('D', 6);
+						return;
+					}
+
+					if (_vm->_gyro->_alcoholLevel == 0)
+						_vm->_lucerna->incScore(3);
+
+					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
+					_vm->_gyro->_drinking = _thing;
+
+					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+					_vm->_gyro->_malagauche = 177;
+					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
+					break;
+				case 52:
+					examine();
+					break; // We have a right one here - buy Pepsi??!
+				case Gyro::kObjectWine:
+					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
+						_vm->_scrolls->displayScrollChain('D', 2); // 1 bottle's shufishent!
+					else {
+						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+							_vm->_scrolls->displayScrollChain('D', 15);
+							return;
+						}
+
+						if (_vm->_gyro->_carryNum >= kCarryLimit) {
+							_vm->_scrolls->displayText("Your hands are full.");
+							return;
+						}
+
+						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+						_vm->_scrolls->displayText(tmpStr);
+						if (_vm->_gyro->_alcoholLevel == 0)
+							_vm->_lucerna->incScore(3);
+						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+						_vm->_gyro->_malagauche = 177;
+
+						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
+					}
+					break;
+				}
+			} else
+				_vm->_scrolls->displayScrollChain('D', 5); // Go to the bar!
+			break;
+
+		case r__outsideducks:
+			if (_vm->_animation->inField(6)) {
+				if (_thing == Gyro::kObjectOnion) {
+					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
+						_vm->_scrolls->displayScrollChain('D', 10); // Not planning to juggle with the things!
+					else if (_vm->_gyro->_carryNum >= kCarryLimit)
+						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
+					else {
+						if (_vm->_gyro->_boughtOnion)
+							_vm->_scrolls->displayScrollChain('D', 11);
+						else {
+							_vm->_scrolls->displayScrollChain('D', 9);
+							_vm->_lucerna->incScore(3);
+						}
+						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
+						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
+						_vm->_lucerna->refreshObjectList();
+						_vm->_gyro->_boughtOnion = true;
+						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_gyro->_onionInVinegar = false;
+					}
+				} else
+					_vm->_scrolls->displayScrollChain('D', 0);
+			} else
+				_vm->_scrolls->displayScrollChain('D', 0);
+			break;
+
+		case r__nottspub:
+			_vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners.
+			break;
+		default:
+			_vm->_scrolls->displayScrollChain('D', 0); // Can't buy that.
+		}
+		break;
+	case kVerbCodeAttack:
+		if ((_vm->_gyro->_room == r__brummieroad) &&
+				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
+				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
+			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
+				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
+			case 0:
+				_vm->_scrolls->displayScrollChain('Q', 10);
+				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
+				break;
+			case 1:
+				_vm->_scrolls->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
+				break;
+			case 2:
+				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
+				break;
+			case 3:
+				_vm->_scrolls->displayScrollChain('Q', 11);
+				_vm->_gyro->_cwytalotGone = true;
+				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
+				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
+				_vm->_lucerna->incScore(7);
+				_vm->_animation->_sprites[1].walkTo(2);
+				_vm->_animation->_sprites[1]._vanishIfStill = true;
+				_vm->_animation->_sprites[1]._callEachStepFl = false;
+				_vm->_gyro->_whereIs[7] = 177;
+				break;
+			default:
+				_vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent!
+			}
+		} else
+			_vm->_scrolls->displayScrollChain('Q', 10);
+		break;
+	case kVerbCodePasswd:
+		if (_vm->_gyro->_room != r__bridge)
+			_vm->_scrolls->displayScrollChain('Q', 12);
+		else {
+			bool ok = true;
+			for (byte i = 0; i < _thats.size(); i++) {
+				Common::String temp = _realWords[i];
+				temp.toUppercase();
+				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
+				for (byte j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
+					if (_vocabulary[pwdId]._word[j] != temp[j])
+						ok = false;
+				}
+			}
+
+			if (ok) {
+				if (_vm->_gyro->_drawbridgeOpen != 0)
+					_vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
+				else {
+					_vm->_lucerna->incScore(4);
+					_vm->_scrolls->displayText("The drawbridge opens!");
+					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
+					_vm->_gyro->_drawbridgeOpen = 1;
+				}
+			} else
+				_vm->_scrolls->displayScrollChain('Q', 12);
+		}
+		break;
+	case kVerbCodeDir:
+		_vm->_enid->dir(_realWords[1]);
+		break;
+	case kVerbCodeDie:
+		_vm->_lucerna->gameOver();
+		break;
+	case kVerbCodeScore: {
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
+		_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodePut:
+		putProc();
+		break;
+	case kVerbCodeStand:
+		standUp();
+		break;
+	case kVerbCodeKiss:
+		if (_person == kPardon)
+			_vm->_scrolls->displayText("Kiss whom?");
+		else if (isPersonHere()) {
+			switch (_person) {
+			case Gyro::kPeopleArkata:
+				_vm->_scrolls->displayScrollChain('U', 12);
+				break;
+			case Gyro::kPeopleGeida:
+				_vm->_scrolls->displayScrollChain('U', 13);
+				break;
+			case Gyro::kPeopleWisewoman:
+				_vm->_scrolls->displayScrollChain('U', 14);
+				break;
+			default:
+				_vm->_scrolls->displayScrollChain('U', 5); // You WHAT?
+			}
+		} else if ((150 <= _person) && (_person <= 174))
+			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
+
+		break;
+	case kVerbCodeClimb:
+		if (_vm->_gyro->_room == r__insidecardiffcastle)
+			cardiffClimbing();
+		else // In the wrong room!
+			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
+		break;
+	case kVerbCodeJump:
+		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
+		_vm->_gyro->_userMovesAvvy = false;
+		break;
+	case kVerbCodeHiscores:
+		//	show_highs();
+		warning("STUB: Acci::doThat() - case kVerbCodehighscores");
+		break;
+	case kVerbCodeWake:
+		if (isPersonHere())
+			switch (_person) {
+			case kPardon:
+			case Gyro::kPeopleAvalot:
+			case 0:
+				if (!_vm->_gyro->_avvyIsAwake) {
+					_vm->_gyro->_avvyIsAwake = true;
+					_vm->_lucerna->incScore(1);
+					_vm->_gyro->_avvyInBed = true;
+					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
+					if (_vm->_gyro->_teetotal)
+						_vm->_scrolls->displayScrollChain('d', 13);
+				} else
+					_vm->_scrolls->displayText("You're already awake, Avvy!");
+				break;
+			case Gyro::kPeopleAyles:
+				if (!_vm->_gyro->_aylesIsAwake)
+					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
+				break;
+			case Gyro::kPeopleJacques: {
+				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
+					"Hmmm... that doesn't seem to do any good...", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
+				_vm->_scrolls->displayText(tmpStr);
+				}
+				break;
+			default:
+				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
+		}
+		break;
+	case kVerbCodeSit:
+		if (_vm->_gyro->_room == r__nottspub) {
+			if (_vm->_gyro->_sittingInPub)
+				_vm->_scrolls->displayText("You're already sitting!");
+			else {
+				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
+				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
+			}
+		} else { // Default doodah.
+			_vm->_lucerna->dusk();
+			_vm->_gyro->hangAroundForAWhile();
+			_vm->_lucerna->dawn();
+			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Scrolls::kControlParagraph);
+			_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeRestart:
+		if (_vm->_scrolls->displayQuestion("Restart game and lose changes?"))  {
+			_vm->_lucerna->dusk();
+			_vm->_gyro->newGame();
+			_vm->_lucerna->dawn();
+		}
+		break;
+	case kPardon:
+		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
+		break;
+	case kVerbCodeHello: {
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeThanks: {
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
+		_vm->_scrolls->displayText(tmpStr);
+		}
+		break;
+	default:
+		Common::String tmpStr = Common::String::format("%cParser bug!", Scrolls::kControlBell);
+		_vm->_scrolls->displayText(tmpStr);
+	}
+}
+
+void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
+	switch (verb) {
+	case kVerbCodeExam:
+		answer = "Examine";
+		ansKey = 'x';
+		break; // The ubiquitous one.
+	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
+	case kVerbCodeDrink:
+		answer = "Drink";
+		ansKey = 'D';
+		break;
+	case kVerbCodeWear:
+		answer = "Wear";
+		ansKey = 'W';
+		break;
+	case kVerbCodeRing:
+		answer = "Ring";
+		ansKey = 'R';
+		break; // Only the bell!
+	case kVerbCodePlay:
+		answer = "Play";
+		ansKey = 'P';
+		break;
+	case kVerbCodeEat:
+		answer = "Eat";
+		ansKey = 'E';
+		break;
+	default:
+		answer = "? Unknown!"; // Bug!
+		ansKey = '?';
+	}
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
new file mode 100644
index 0000000..07816cc
--- /dev/null
+++ b/engines/avalanche/acci.h
@@ -0,0 +1,138 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ACCIDENCE II		The parser. */
+
+#ifndef AVALANCHE_ACCI2_H
+#define AVALANCHE_ACCI2_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Acci {
+public:
+	enum VerbCode {
+		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
+		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
+		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
+		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
+		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
+		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
+		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
+		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
+		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
+		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
+	};
+
+	static const byte kPardon = 254; // Didn't understand / wasn't given.
+	static const int16 kParserWordsNum = 277; // How many words does the parser know?
+	static const byte kNothing = 250;
+	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
+	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+
+	struct VocabEntry {
+		byte _number;
+		Common::String _word;
+
+		void init(byte number, Common::String word) {
+			_number = number;
+			_word = word;
+		}
+	};
+
+	VocabEntry _vocabulary[kParserWordsNum];
+
+	Common::String _realWords[11];
+	byte _verb, _person, _thing;
+	bool _polite;
+
+	Acci(AvalancheEngine *vm);
+
+	void init();
+	void parse();
+	void doThat();
+	void verbOpt(byte verb, Common::String &answer, char &ansKey);
+	void drink();
+
+private:
+	struct RankType {
+		uint16 _score;
+		Common::String _title;
+	};
+
+	Common::String _thats;
+	byte _thing2;
+
+	AvalancheEngine *_vm;
+
+	byte wordNum(Common::String word);
+	void replace(Common::String oldChars, byte newChar);
+
+	Common::String rank();
+	Common::String totalTime();
+
+	void clearWords();
+	void cheatParse(Common::String codes);
+	void stripPunctuation(Common::String &word); // Strips punctuation from word.
+	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
+	bool doPronouns();
+	void properNouns();
+	void lookAround(); // This is called when you say "look".
+	void sayIt();  // This makes Avalot say the response.
+	void openDoor();
+	void storeInterrogation(byte interrogation);
+	void examineObject(); // Examine a standard object-thing
+	bool isPersonHere();
+	void exampers();
+	bool isHolding();
+	void openBox(bool isOpening);
+	void examine();
+	void inventory();
+	void swallow();
+	void peopleInRoom(); // This lists the other people in the room.
+	void silly();
+	void putProc();  // Called when you call kVerbCodeput.
+	void notInOrder();
+	void goToCauldron();
+	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
+	void cardiffClimbing();
+	void already();
+	void standUp(); // Called when you ask Avvy to stand.
+	void getProc(char thing);
+	void giveGeidaTheLute();
+	void playHarp();
+	void winSequence();
+	Common::String personSpeaks();
+	void heyThanks();
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_ACCI2_H
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
deleted file mode 100644
index 1008a60..0000000
--- a/engines/avalanche/acci2.cpp
+++ /dev/null
@@ -1,2267 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ACCIDENCE II		The parser. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/acci2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/timer.h"
-#include "avalanche/animation.h"
-#include "avalanche/enid2.h"
-#include "avalanche/celer2.h"
-#include "avalanche/pingo2.h"
-#include "avalanche/sequence2.h"
-
-#include "common/textconsole.h"
-
-#include <cstring>
-#include <cmath>
-
-namespace Avalanche {
-
-Acci::Acci(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Acci::init() {
-	_vm->_gyro->_weirdWord = false;
-
-	// Initailaze the vocabulary.
-	// Verbs: 1-49
-	_vocabulary[0].init(1, "EXAMINE");
-	_vocabulary[1].init(1, "READ");
-	_vocabulary[2].init(1, "XAM");
-	_vocabulary[3].init(2, "OPEN");
-	_vocabulary[4].init(2, "LEAVE");
-	_vocabulary[5].init(2, "UNLOCK");
-	_vocabulary[6].init(3, "PAUSE");
-	_vocabulary[7].init(47, "TA"); // Early to avoid Take and Talk.
-	_vocabulary[8].init(4, "TAKE");
-	_vocabulary[9].init(4, "GET");
-	_vocabulary[10].init(4, "PICK");
-	_vocabulary[11].init(5, "DROP");
-	_vocabulary[12].init(6, "INVENTORY");
-	_vocabulary[13].init(7, "TALK");
-	_vocabulary[14].init(7, "SAY");
-	_vocabulary[15].init(7, "ASK");
-	_vocabulary[16].init(8, "GIVE");
-	_vocabulary[17].init(9, "DRINK");
-	_vocabulary[18].init(9, "IMBIBE");
-	_vocabulary[19].init(9, "DRAIN");
-	_vocabulary[20].init(10, "LOAD");
-	_vocabulary[21].init(10, "RESTORE");
-	_vocabulary[22].init(11, "SAVE");
-	_vocabulary[23].init(12, "BRIBE");
-	_vocabulary[24].init(12, "PAY");
-	_vocabulary[25].init(13, "LOOK");
-	_vocabulary[26].init(14, "BREAK");
-	_vocabulary[27].init(15, "QUIT");
-	_vocabulary[28].init(15, "EXIT");
-	_vocabulary[29].init(16, "SIT");
-	_vocabulary[30].init(16, "SLEEP");
-	_vocabulary[31].init(17, "STAND");
-
-	_vocabulary[32].init(18, "GO");
-	_vocabulary[33].init(19, "INFO");
-	_vocabulary[34].init(20, "UNDRESS");
-	_vocabulary[35].init(20, "DOFF");
-	_vocabulary[36].init(21, "DRESS");
-	_vocabulary[37].init(21, "WEAR");
-	_vocabulary[38].init(21, "DON");
-	_vocabulary[39].init(22, "PLAY");
-	_vocabulary[40].init(22, "STRUM");
-	_vocabulary[41].init(23, "RING");
-	_vocabulary[42].init(24, "HELP");
-	_vocabulary[43].init(25, "KENDAL");
-	_vocabulary[44].init(26, "CAPYBARA");
-	_vocabulary[45].init(27, "BOSS");
-	_vocabulary[46].init(255, "NINET"); // block for NINETY
-	_vocabulary[47].init(28, "URINATE");
-	_vocabulary[48].init(28, "MINGITE");
-	_vocabulary[49].init(29, "NINETY");
-	_vocabulary[50].init(30, "ABRACADABRA");
-	_vocabulary[51].init(30, "PLUGH");
-	_vocabulary[52].init(30, "XYZZY");
-	_vocabulary[53].init(30, "HOCUS");
-	_vocabulary[54].init(30, "POCUS");
-	_vocabulary[55].init(30, "IZZY");
-	_vocabulary[56].init(30, "WIZZY");
-	_vocabulary[57].init(30, "PLOVER");
-	_vocabulary[58].init(30, "MELENKURION");
-	_vocabulary[59].init(30, "ZORTON");
-	_vocabulary[60].init(30, "BLERBI");
-	_vocabulary[61].init(30, "THURB");
-	_vocabulary[62].init(30, "SNOEZE");
-	_vocabulary[63].init(30, "SAMOHT");
-	_vocabulary[64].init(30, "NOSIDE");
-	_vocabulary[65].init(30, "PHUGGG");
-	_vocabulary[66].init(30, "KNERL");
-	_vocabulary[67].init(30, "MAGIC");
-	_vocabulary[68].init(30, "KLAETU");
-	_vocabulary[69].init(30, "VODEL");
-	_vocabulary[70].init(30, "BONESCROLLS");
-	_vocabulary[71].init(30, "RADOF");
-
-	_vocabulary[72].init(31, "RESTART");
-	_vocabulary[73].init(32, "SWALLOW");
-	_vocabulary[74].init(32, "EAT");
-	_vocabulary[75].init(33, "LISTEN");
-	_vocabulary[76].init(33, "HEAR");
-	_vocabulary[77].init(34, "BUY");
-	_vocabulary[78].init(34, "PURCHASE");
-	_vocabulary[79].init(34, "ORDER");
-	_vocabulary[80].init(34, "DEMAND");
-	_vocabulary[81].init(35, "ATTACK");
-	_vocabulary[82].init(35, "HIT");
-	_vocabulary[83].init(35, "KILL");
-	_vocabulary[84].init(35, "PUNCH");
-	_vocabulary[85].init(35, "KICK");
-	_vocabulary[86].init(35, "SHOOT");
-	_vocabulary[87].init(35, "FIRE");
-
-	// Passwords: 36
-	_vocabulary[88].init(36, "TIROS");
-	_vocabulary[89].init(36, "WORDY");
-	_vocabulary[90].init(36, "STACK");
-	_vocabulary[91].init(36, "SHADOW");
-	_vocabulary[92].init(36, "OWL");
-	_vocabulary[93].init(36, "ACORN");
-	_vocabulary[94].init(36, "DOMESDAY");
-	_vocabulary[95].init(36, "FLOPPY");
-	_vocabulary[96].init(36, "DIODE");
-	_vocabulary[97].init(36, "FIELD");
-	_vocabulary[98].init(36, "COWSLIP");
-	_vocabulary[99].init(36, "OSBYTE");
-	_vocabulary[100].init(36, "OSCLI");
-	_vocabulary[101].init(36, "TIMBER");
-	_vocabulary[102].init(36, "ADVAL");
-	_vocabulary[103].init(36, "NEUTRON");
-	_vocabulary[104].init(36, "POSITRON");
-	_vocabulary[105].init(36, "ELECTRON");
-	_vocabulary[106].init(36, "CIRCUIT");
-	_vocabulary[107].init(36, "AURUM");
-	_vocabulary[108].init(36, "PETRIFY");
-	_vocabulary[109].init(36, "EBBY");
-	_vocabulary[110].init(36, "CATAPULT");
-	_vocabulary[111].init(36, "GAMERS");
-	_vocabulary[112].init(36, "FUDGE");
-	_vocabulary[113].init(36, "CANDLE");
-	_vocabulary[114].init(36, "BEEB");
-	_vocabulary[115].init(36, "MICRO");
-	_vocabulary[116].init(36, "SESAME");
-	_vocabulary[117].init(36, "LORDSHIP");
-
-	_vocabulary[118].init(37, "DIR");
-	_vocabulary[119].init(37, "LS");
-	_vocabulary[120].init(38, "DIE");
-	_vocabulary[121].init(39, "SCORE");
-	_vocabulary[122].init(40, "PUT");
-	_vocabulary[123].init(40, "INSERT");
-	_vocabulary[124].init(41, "KISS");
-	_vocabulary[125].init(41, "SNOG");
-	_vocabulary[126].init(41, "CUDDLE");
-	_vocabulary[127].init(42, "CLIMB");
-	_vocabulary[128].init(42, "CLAMBER");
-	_vocabulary[129].init(43, "JUMP");
-	_vocabulary[130].init(44, "HIGHSCORES");
-	_vocabulary[131].init(44, "HISCORES");
-	_vocabulary[132].init(45, "WAKEN");
-	_vocabulary[133].init(45, "AWAKEN");
-	_vocabulary[134].init(46, "HELLO");
-	_vocabulary[135].init(46, "HI");
-	_vocabulary[136].init(46, "YO");
-	_vocabulary[137].init(47, "THANKS"); // = 47, "ta", which was defined earlier.
-
-	// Nouns - Objects: 50-100
-	_vocabulary[138].init(50, "WINE");
-	_vocabulary[139].init(50, "BOOZE");
-	_vocabulary[140].init(50, "NASTY");
-	_vocabulary[141].init(50, "VINEGAR");
-	_vocabulary[142].init(51, "MONEYBAG");
-	_vocabulary[143].init(51, "BAG");
-	_vocabulary[144].init(51, "CASH");
-	_vocabulary[145].init(51, "DOSH");
-	_vocabulary[146].init(51, "WALLET");
-	_vocabulary[147].init(52, "BODKIN");
-	_vocabulary[148].init(52, "DAGGER");
-	_vocabulary[149].init(53, "POTION");
-	_vocabulary[150].init(54, "CHASTITY");
-	_vocabulary[151].init(54, "BELT");
-	_vocabulary[152].init(55, "BOLT");
-	_vocabulary[153].init(55, "ARROW");
-	_vocabulary[154].init(55, "DART");
-	_vocabulary[155].init(56, "CROSSBOW");
-	_vocabulary[156].init(56, "BOW");
-	_vocabulary[157].init(57, "LUTE");
-	_vocabulary[158].init(58, "PILGRIM");
-	_vocabulary[159].init(58, "BADGE");
-	_vocabulary[160].init(59, "MUSHROOMS");
-	_vocabulary[161].init(59, "TOADSTOOLS");
-	_vocabulary[162].init(60, "KEY");
-	_vocabulary[163].init(61, "BELL");
-	_vocabulary[164].init(62, "PRESCRIPT");
-	_vocabulary[165].init(62, "SCROLL");
-	_vocabulary[166].init(62, "MESSAGE");
-	_vocabulary[167].init(63, "PEN");
-	_vocabulary[168].init(63, "QUILL");
-	_vocabulary[169].init(64, "INK");
-	_vocabulary[170].init(64, "INKPOT");
-	_vocabulary[171].init(65, "CLOTHES");
-	_vocabulary[172].init(66, "HABIT");
-	_vocabulary[173].init(66, "DISGUISE");
-	_vocabulary[174].init(67, "ONION");
-
-	_vocabulary[175].init(99, "PASSWORD");
-
-	// Objects from Also are placed between 101 and 131.
-	// Nouns - People - Male: 150-174
-	_vocabulary[176].init(150, "AVVY");
-	_vocabulary[177].init(150, "AVALOT");
-	_vocabulary[178].init(150, "YOURSELF");
-	_vocabulary[179].init(150, "ME");
-	_vocabulary[180].init(150, "MYSELF");
-	_vocabulary[181].init(151, "SPLUDWICK");
-	_vocabulary[182].init(151, "THOMAS");
-	_vocabulary[183].init(151, "ALCHEMIST");
-	_vocabulary[184].init(151, "CHEMIST");
-	_vocabulary[185].init(152, "CRAPULUS");
-	_vocabulary[186].init(152, "SERF");
-	_vocabulary[187].init(152, "SLAVE");
-	_vocabulary[188].init(158, "DU"); // Put in early for Baron DU Lustie to save confusion with Duck & Duke.
-	_vocabulary[189].init(152, "CRAPPY");
-	_vocabulary[190].init(153, "DUCK");
-	_vocabulary[191].init(153, "DOCTOR");
-	_vocabulary[192].init(154, "MALAGAUCHE");
-	_vocabulary[193].init(155, "FRIAR");
-	_vocabulary[194].init(155, "TUCK");
-	_vocabulary[195].init(156, "ROBIN");
-	_vocabulary[196].init(156, "HOOD");
-	_vocabulary[197].init(157, "CWYTALOT");
-	_vocabulary[198].init(157, "GUARD");
-	_vocabulary[199].init(157, "BRIDGEKEEP");
-	_vocabulary[200].init(158, "BARON");
-	_vocabulary[201].init(158, "LUSTIE");
-	_vocabulary[202].init(159, "DUKE");
-	_vocabulary[203].init(159, "GRACE");
-	_vocabulary[204].init(160, "DOGFOOD");
-	_vocabulary[205].init(160, "MINSTREL");
-	_vocabulary[206].init(161, "TRADER");
-	_vocabulary[207].init(161, "SHOPKEEPER");
-	_vocabulary[208].init(161, "STALLHOLDER");
-	_vocabulary[209].init(162, "PILGRIM");
-	_vocabulary[210].init(162, "IBYTHNETH");
-	_vocabulary[211].init(163, "ABBOT");
-	_vocabulary[212].init(163, "AYLES");
-	_vocabulary[213].init(164, "PORT");
-	_vocabulary[214].init(165, "SPURGE");
-	_vocabulary[215].init(166, "JACQUES");
-	_vocabulary[216].init(166, "SLEEPER");
-	_vocabulary[217].init(166, "RINGER");
-
-	// Nouns - People - Female: 175-199
-	_vocabulary[218].init(175, "WIFE");
-	_vocabulary[219].init(175, "ARKATA");
-	_vocabulary[220].init(176, "GEDALODAVA");
-	_vocabulary[221].init(176, "GEIDA");
-	_vocabulary[222].init(176, "PRINCESS");
-	_vocabulary[223].init(178, "WISE");
-	_vocabulary[224].init(178, "WITCH");
-
-	// Pronouns: 200-224
-	_vocabulary[225].init(200, "HIM");
-	_vocabulary[226].init(200, "MAN");
-	_vocabulary[227].init(200, "GUY");
-	_vocabulary[228].init(200, "DUDE");
-	_vocabulary[229].init(200, "CHAP");
-	_vocabulary[230].init(200, "FELLOW");
-	_vocabulary[231].init(201, "HER");
-	_vocabulary[232].init(201, "GIRL");
-	_vocabulary[233].init(201, "WOMAN");
-	_vocabulary[234].init(202, "IT");
-	_vocabulary[235].init(202, "THING");
-	_vocabulary[236].init(203, "MONK");
-	_vocabulary[237].init(204, "BARMAN");
-	_vocabulary[238].init(204, "BARTENDER");
-
-	// Prepositions: 225-249
-	_vocabulary[239].init(225, "TO");
-	_vocabulary[240].init(226, "AT");
-	_vocabulary[241].init(227, "UP");
-	_vocabulary[242].init(228, "INTO");
-	_vocabulary[243].init(228, "INSIDE");
-	_vocabulary[244].init(229, "OFF");
-	_vocabulary[245].init(230, "UP");
-	_vocabulary[246].init(231, "DOWN");
-	_vocabulary[247].init(232, "ON");
-
-	// Please: 251
-	_vocabulary[248].init(251, "PLEASE");
-
-	// About: 252
-	_vocabulary[249].init(252, "ABOUT");
-	_vocabulary[250].init(252, "CONCERNING");
-
-	// Swear words: 253
-	/*		  I M P O R T A N T    M E S S A G E
-
-	DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
-	DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
-	GOODNESS KNOWS WHO WROTE THEM.
-	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
-	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
-	_vocabulary[251].init(253, "SHIT");
-	_vocabulary[252].init(28 , "PISS");
-	_vocabulary[253].init(28 , "PEE");
-	_vocabulary[254].init(253, "FART");
-	_vocabulary[255].init(253, "FUCK");
-	_vocabulary[256].init(253, "BALLS");
-	_vocabulary[257].init(253, "BLAST");
-	_vocabulary[258].init(253, "BUGGER");
-	_vocabulary[259].init(253, "KNICKERS");
-	_vocabulary[260].init(253, "BLOODY");
-	_vocabulary[261].init(253, "HELL");
-	_vocabulary[262].init(253, "DAMN");
-	_vocabulary[263].init(253, "SMEG");
-	// ...and other even ruder words. You didn't read them, did you? Good.
-
-	// Answer-back smart-alec words: 249
-	_vocabulary[264].init(249, "YES");
-	_vocabulary[265].init(249, "NO");
-	_vocabulary[266].init(249, "BECAUSE");
-
-	// Noise words: 255
-	_vocabulary[267].init(255, "THE");
-	_vocabulary[268].init(255, "A");
-	_vocabulary[269].init(255, "NOW");
-	_vocabulary[270].init(255, "SOME");
-	_vocabulary[271].init(255, "AND");
-	_vocabulary[272].init(255, "THAT");
-	_vocabulary[273].init(255, "POCUS");
-	_vocabulary[274].init(255, "HIS");
-	_vocabulary[275].init(255, "THIS");
-	_vocabulary[276].init(255, "SENTINEL"); // for "Ken SENT Me"
-}
-
-void Acci::clearWords() {
-	for (byte i = 0; i < 11; i++) {
-		if (!_realWords[i].empty())
-			_realWords[i].clear();
-	}
-}
-
-byte Acci::wordNum(Common::String word) {
-	if (word.empty())
-		return 0;
-
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (_vocabulary[i]._word == word)
-			return _vocabulary[i]._number;
-	}
-
-	// If not found as a whole, we look for it as a substring.
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (Common::String(_vocabulary[i]._word.c_str(), word.size()) == word)
-			return _vocabulary[i]._number;
-	}
-
-	return kPardon;
-}
-
-void Acci::replace(Common::String oldChars, byte newChar) {
-	int16 pos = _vm->_parser->pos(oldChars, _thats);
-	while (pos != -1) {
-		if (newChar == 0)
-			_thats.deleteChar(pos);
-		else {
-			for (byte i = pos; i < pos + oldChars.size(); i++)
-				_thats.deleteChar(pos);
-			_thats.insertChar(newChar, pos);
-		}
-		pos = _vm->_parser->pos(oldChars, _thats);
-	}
-}
-
-Common::String Acci::rank() {
-	static const RankType kRanks[9] = {
-		{0, "Beginner"},     {10, "Novice"},
-		{20, "Improving"},   {35, "Not bad"},
-		{50, "Passable"},    {65, "Good"},
-		{80, "Experienced"}, {108, "The BEST!"},
-		{32767, "copyright'93"}
-	};
-
-	for (byte i = 0; i < 8; i++) {
-		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
-			return kRanks[i]._title;
-		}
-	}
-	return "";
-}
-
-Common::String Acci::totalTime() {
-	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	const double ticksInOneSec = (double)(65535) / 3600;
-	uint16 h, m, s;
-
-	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
-	m = h % 3600;
-	h /= 3600;
-	s = m % 60;
-	m /= 60;
-
-	Common::String result = "You've been playing for ";
-	if (h > 0)
-		result += Common::String::format("%d hours, ", h);
-	if ((m > 0) || (h != 0))
-		result = Common::String::format("%d minutes and ", m);
-	return result + Common::String::format("%d seconds", s);
-}
-
-void Acci::cheatParse(Common::String codes) {
-//	uint16 num;
-//	int16 e;
-//	char cmd;
-//	int16 se, sx, sy;
-
-	warning("STUB: Acci::cheatParse()");
-}
-
-
-
-void Acci::stripPunctuation(Common::String &word) {
-	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
-
-	for (byte i = 0; i < 32; i++) {
-		for (;;) {
-			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
-			if (pos == -1)
-				break;
-			word.deleteChar(pos);
-		}
-	}
-}
-
-void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
-	if (target == kPardon) {
-		ambiguous = true;
-		if (animate)
-			_vm->_scrolls->displayText("Whom?");
-		else
-			_vm->_scrolls->displayText("What?");
-	} else {
-		if (animate) {
-			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
-			_vm->_scrolls->displayText(tmpStr);
-		} else {
-			Common::String z = _vm->_gyro->getItem(target);
-			if (z != "") {
-				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
-				_vm->_scrolls->displayText(tmpStr);
-			}
-		}
-	}
-}
-
-bool Acci::doPronouns() {
-	bool ambiguous = false;
-
-	for (byte i = 0; i < _thats.size(); i++) {
-		byte wordCode = _thats[i];
-		switch (wordCode) {
-		case 200: {
-			displayWhat(_vm->_gyro->_him, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_him, i);
-			}
-			break;
-		case 201: {
-			displayWhat(_vm->_gyro->_her, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_her, i);
-			}
-			break;
-		case 202: {
-			displayWhat(_vm->_gyro->_it, false, ambiguous);
-			_thats.setChar(_vm->_gyro->_it, i);
-			}
-			break;
-		}
-	}
-
-	return ambiguous;
-}
-
-void Acci::properNouns() {
-	_vm->_parser->_inputText.toLowercase();
-
-	// We set every word's first character to uppercase.
-	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
-		if (_vm->_parser->_inputText[i] == ' ')
-			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
-	}
-
-	// And the first character as well.
-	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
-}
-
-void Acci::sayIt() {
-	Common::String x = _vm->_parser->_inputText;
-	x.setChar(toupper(x[0]), 0);
-	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), 
-		                                           Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
-	_vm->_scrolls->displayText(tmpStr);
-}
-
-void Acci::storeInterrogation(byte interrogation) {
-	if (_vm->_parser->_inputText.empty())
-		return;
-
-	// Strip _vm->_parser->_inputText:
-	while ((_vm->_parser->_inputText[0] == ' ') && (!_vm->_parser->_inputText.empty()))
-		_vm->_parser->_inputText.deleteChar(0);
-	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
-		_vm->_parser->_inputText.deleteLastChar();
-
-	_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
-
-	switch (interrogation) {
-	case 1:
-		_vm->_parser->_inputText.toLowercase();
-		sayIt();
-		_vm->_gyro->_favouriteDrink = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 2;
-		break;
-	case 2:
-		properNouns();
-		sayIt();
-		_vm->_gyro->_favouriteSong = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 3;
-		break;
-	case 3:
-		properNouns();
-		sayIt();
-		_vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 4;
-		break;
-	case 4:
-		_vm->_parser->_inputText.toLowercase();
-		sayIt();
-		if (!_vm->_gyro->_spareEvening.empty())
-			_vm->_gyro->_spareEvening.clear();
-		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
-		_vm->_scrolls->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
-		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
-		_vm->_gyro->_cardiffQuestionNum = 5;
-		break;
-	case 99:
-		//store_high(_vm->_parser->_inputText);
-		warning("STUB: Acci::store_interrogation()");
-		break;
-	}
-
-	if (interrogation < 4)
-		_vm->_timer->cardiffSurvey();
-}
-
-
-
-void Acci::parse() {
-	// First parsing - word identification
-	if (!_thats.empty())
-		_thats.clear();
-
-	byte n = 0;
-	_polite = false;
-	_verb = kPardon;
-	_thing = kPardon;
-	_thing2 = kPardon;
-	_person = kPardon;
-	clearWords();
-
-
-	// A cheat mode attempt.
-	if (_vm->_parser->_inputText[0] == '.') {
-		cheatParse(_vm->_parser->_inputText);
-		_thats = kNothing;
-		return;
-	}
-
-	// Are we being interrogated right now?
-	if (_vm->_gyro->_interrogation > 0) {
-		storeInterrogation(_vm->_gyro->_interrogation);
-		_vm->_gyro->_weirdWord = true;
-		return;
-	}
-
-	// Actually process the command.
-	Common::String inputText = _vm->_parser->_inputText + ' ';
-	Common::String inputTextUpper = inputText;
-	inputTextUpper.toUppercase();
-	while (!inputTextUpper.empty()) {
-		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
-			inputTextUpper.deleteChar(0);
-			inputText.deleteChar(0);
-		}
-		if (inputTextUpper.empty())
-			break;
-
-		// Get the following word of the strings.
-		byte size = _vm->_parser->pos(Common::String(' '), inputTextUpper) + 1;
-		char *subStr = new char[size];
-		Common::strlcpy(subStr, inputTextUpper.c_str(), size);
-		Common::String thisword = subStr;
-		Common::strlcpy(subStr, inputText.c_str(), size);
-		_realWords[n] = subStr;
-		delete[] subStr;
-
-		stripPunctuation(inputTextUpper);
-
-		bool notfound = true;
-
-		// Check also[] first, which contains words about the actual room.
-		if (!thisword.empty()) {
-			for (byte i = 0; i < 31; i++) {
-				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
-					_thats += Common::String(99 + i);
-					notfound = false;
-				}
-			}
-		}
-
-		// Check Accis's own table (words[]) for "global" commands.
-		if (notfound) {
-			byte answer = wordNum(thisword);
-			if (answer == kPardon) {
-				notfound = true;
-				_thats = _thats + kPardon;
-			} else
-				_thats = _thats + answer;
-			n++;
-		}
-
-		// Delete words we already processed.
-		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
-		if (spacePos > -1) {
-			for (byte i = 0; i <= spacePos; i++)
-				inputTextUpper.deleteChar(0);
-		}
-
-		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
-		if (spacePos > -1) {
-			for (byte i = 0; i <= spacePos; i++)
-				inputText.deleteChar(0);
-		}
-	}
-
-	Common::String unkString;
-	int16 pos = _vm->_parser->pos(Common::String('\xFE'), _thats);
-	if (pos > -1)
-		unkString = _realWords[pos];
-	else
-		unkString.clear();
-
-	// Replace words' codes that mean the same.
-	replace(Common::String("\xFF"),     0); // zap noise words
-	replace(Common::String("\xD\xE2"),  1); // "look at" = "examine"
-	replace(Common::String("\xD\xE4"),  1); // "look in" = "examine"
-	replace(Common::String("\x4\xE6"),  17); // "get up" = "stand"
-	replace(Common::String("\x4\xE7"),  17); // "get down" = "stand"... well, why not?
-	replace(Common::String("\x12\xE4"), 2); // "go in" = "open [door]"
-	replace(Common::String("\x1C\xE5"), 253); // "P' off" is a swear word
-	replace(Common::String("\x4\x6"),   6); // "Take inventory" (remember Colossal Adventure?)
-	replace(Common::String("\x28\xE8"), 21); // "put on" = "don"
-	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
-
-	// Words that could mean more than one _person
-	if (_vm->_gyro->_room == r__nottspub)
-		replace(Common::String('\xCC'), 164); // Barman = Port
-	else
-		replace(Common::String('\xCC'), 154); // Barman = Malagauche
-
-	switch (_vm->_gyro->_room) {
-	case r__aylesoffice:
-		replace(Common::String('\xCB'), 163); // Monk = Ayles
-		break;
-	case r__musicroom:
-		replace(Common::String('\xCB'), 166); // Monk = Jacques
-		break;
-	default:
-		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
-	}
-
-	if (doPronouns()) {
-		_vm->_gyro->_weirdWord = true;
-		_thats = kNothing;
-		return;
-	}
-
-	// Second parsing.
-	if (!_vm->_gyro->_subject.empty())
-		_vm->_gyro->_subject.clear();
-	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
-
-	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
-		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
-			_vm->_gyro->_subjectNum = (byte)_thats[i];
-			_thats.setChar(kMoved, i);
-			break;
-		}
-	}
-
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
-		for (uint16 i = 0; i < _thats.size() - 1; i++) {
-			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
-				_thats.setChar(0, i + 1);
-				break;
-			}
-		}
-	}
-
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
-		for (uint16 i = 0; i < _thats.size() - 1; i++) {
-			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
-				// SAY not followed by a preposition
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
-				_thats.setChar(0, i + 1);
-				break;
-			}
-		}
-	}
-
-	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
-		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
-			_verb = (byte)_thats[i];
-		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
-			_thing2 = _thing;
-			_thing = (byte)_thats[i];
-		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
-			_person = (byte)_thats[i];
-		else if ((byte)_thats[i] == 251)
-			_polite = true;
-	}
-
-	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
-		_vm->_scrolls->displayText(tmpStr);
-		_vm->_gyro->_weirdWord = true;
-	} else
-		_vm->_gyro->_weirdWord = false;
-
-	if (_thats.empty())
-		_thats = kNothing;
-
-	if (_thing != kPardon)
-		_vm->_gyro->_it = _thing;
-
-	if (_person != kPardon) {
-		if (_person < 175)
-			_vm->_gyro->_him = _person;
-		else
-			_vm->_gyro->_her = _person;
-	}
-}
-
-void Acci::examineObject() {
-	if (_thing != _vm->_gyro->_thinks)
-		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
-	switch (_thing) {
-	case Gyro::kObjectWine :
-		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
-		case 1:
-			_vm->_scrolls->displayScrollChain('t', 1); // Normal examine wine scroll
-			break;
-		case 2:
-			_vm->_scrolls->displayScrollChain('d', 6); // Bad wine
-			break;
-		case 3:
-			_vm->_scrolls->displayScrollChain('d', 7); // Vinegar
-			break;
-		}
-		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion.
-		else
-			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion scroll
-		break;
-	default:
-		_vm->_scrolls->displayScrollChain('t', _thing); // <<< Ordinarily
-	}
-}
-
-bool Acci::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
-		return true;
-	else {
-		Common::String tmpStr;
-		if (_person < 175)
-			tmpStr = "He isn't around at the moment.";
-		else
-			tmpStr = "She isn't around at the moment.";
-		_vm->_scrolls->displayText(tmpStr);
-		return false;
-	}
-}
-
-void Acci::exampers() {
-	if (isPersonHere()) {
-		if (_thing != _vm->_gyro->_thinks)
-			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
-		_person -= 149;
-		switch (_person) { // Special cases
-		case 11:
-			if (_vm->_gyro->_wonNim) {
-				_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
-				return;
-			}
-			break;
-		case 99:
-			if (_vm->_gyro->_lustieIsAsleep) {
-				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
-				return;
-			}
-			break;
-		}
-		// Otherwise...
-		_vm->_scrolls->displayScrollChain('p', _person);
-	}
-
-	// And afterwards...
-	if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
-		_vm->_scrolls->displayScrollChain('Q', 13);
-}
-
-/**
- * Return whether Avvy is holding an object or not
- * @remarks	Originally called 'holding'
- */
-bool Acci::isHolding() {
-	if ((51 <= _thing) && (_thing <= 99)) // Also.
-		return true;
-
-	bool holdingResult = false;
-
-	if (_thing > 100)
-		_vm->_scrolls->displayText("Be reasonable!");
-	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
-		_vm->_scrolls->displayText("You're not holding it, Avvy.");
-	else
-		holdingResult = true;
-
-	return holdingResult;
-}
-
-void Acci::openBox(bool isOpening) {
-	if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
-
-		_vm->_celer->updateBackgroundSprites();
-		_vm->_animation->animLink();
-		_vm->_graphics->refreshScreen();
-
-		_vm->_system->delayMillis(55);
-
-		if (!isOpening) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
-			_vm->_celer->updateBackgroundSprites();
-			_vm->_animation->animLink();
-			_vm->_graphics->refreshScreen();
-		}
-	}
-}
-
-void Acci::examine() {
-	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
-	if ((_person == kPardon) && (_thing != kPardon)) {
-		if (isHolding()) {
-			// Remember: it's been Slipped! Ie subtract 49.
-			if ((1 <= _thing) && (_thing <= 49)) // Standard object
-				examineObject();
-			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
-				openBox(true);
-				_vm->_scrolls->displayText(*_vm->_gyro->_also[_thing - 50][1]);
-				openBox(false);
-			}
-		}
-	} else if (_person != kPardon)
-		exampers();
-	else
-		_vm->_scrolls->displayText("It's just as it looks on the picture.");  // Don't know: guess.
-}
-
-void Acci::inventory() {
-	byte itemNum = 0;
-	Common::String tmpStr = Common::String("You're carrying ");
-
-	for (byte i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i]) {
-			itemNum++;
-			if (itemNum == _vm->_gyro->_carryNum)
-				tmpStr += "and ";
-
-			tmpStr += _vm->_gyro->getItem(i + 1);
-
-			if ((i + 1) == _vm->_gyro->_wearing)
-				tmpStr += ", which you're wearing";
-
-			if (itemNum < _vm->_gyro->_carryNum)
-				tmpStr += ", ";
-		}
-	}
-
-	if (_vm->_gyro->_wearing == kNothing)
-		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-	else
-		tmpStr += '.';
-
-	_vm->_scrolls->displayText(tmpStr);
-}
-
-void Acci::swallow() {   // Eat something.
-	switch (_thing) {
-	case Gyro::kObjectWine:
-		switch (_vm->_gyro->_wineState) { // 4 is perfect
-		case 1:
-			if (_vm->_gyro->_teetotal)  {
-				_vm->_scrolls->displayScrollChain('D', 6);
-				return;
-			}
-			_vm->_scrolls->displayScrollChain('U', 1);
-			_vm->_pingo->wobble();
-			_vm->_scrolls->displayScrollChain('U', 2);
-			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-			_vm->_lucerna->refreshObjectList();
-			drink();
-			break;
-		case 2:
-		case 3:
-			_vm->_scrolls->displayScrollChain('d', 8);
-			break; // You can't drink it!
-		}
-		break;
-	case Gyro::kObjectPotion:
-		_vm->_gyro->setBackgroundColor(4);
-		_vm->_scrolls->displayScrollChain('U', 3);
-		_vm->_lucerna->gameOver();
-		_vm->_gyro->setBackgroundColor(0);
-		break;
-	case Gyro::kObjectInk:
-		_vm->_scrolls->displayScrollChain('U', 4);
-		break;
-	case Gyro::kObjectChastity:
-		_vm->_scrolls->displayScrollChain('U', 5);
-		break;
-	case Gyro::kObjectMushroom:
-		_vm->_scrolls->displayScrollChain('U', 6);
-		_vm->_lucerna->gameOver();
-		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('U', 11);
-		else {
-			_vm->_scrolls->displayScrollChain('U', 8);
-			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-			_vm->_lucerna->refreshObjectList();
-		}
-		break;
-	default:
-		if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub))
-			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
-		else
-			_vm->_scrolls->displayText("The taste of it makes you retch!");
-	}
-}
-
-void Acci::peopleInRoom() {
-	byte numPeople = 0; // Number of people in the room.
-
-	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
-			numPeople++;
-	}
-
-	if (numPeople == 0) // If nobody's here, we can cut out straight away.
-		return;
-
-	Common::String tmpStr;
-	byte actPerson = 0; // Actually listed people.
-	for (byte i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
-			actPerson++;
-			if (actPerson == 1) // First on the list.
-				tmpStr = _vm->_gyro->getName(i + 150);
-			else if (actPerson < numPeople) // The middle...
-				tmpStr += ", " + _vm->_gyro->getName(i + 150);
-			else // The end.
-				tmpStr += " and " + _vm->_gyro->getName(i + 150);
-		}
-	}
-
-	if (numPeople == 1)
-		tmpStr += " is";
-	else
-		tmpStr += " are";
-
-	_vm->_scrolls->displayText(tmpStr + " here."); // End and display it.
-}
-
-void Acci::lookAround() {
-	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
-	switch (_vm->_gyro->_room) {
-	case r__spludwicks:
-		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_scrolls->displayScrollChain('q', 23);
-		else
-			peopleInRoom();
-		break;
-	case r__robins:
-		if (_vm->_gyro->_tiedUp)
-			_vm->_scrolls->displayScrollChain('q', 38);
-		if (_vm->_gyro->_mushroomGrowing)
-			_vm->_scrolls->displayScrollChain('q', 55);
-		break;
-	case r__insidecardiffcastle:
-		if (!_vm->_gyro->_takenPen)
-			_vm->_scrolls->displayScrollChain('q', 49);
-		break;
-	case r__lustiesroom:
-		if (_vm->_gyro->_lustieIsAsleep)
-			_vm->_scrolls->displayScrollChain('q', 65);
-		break;
-	case r__catacombs:
-		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
-		case 258 :
-			_vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery.
-			break;
-		case 514 :
-			_vm->_scrolls->displayScrollChain('q', 81); // Outside ditto.
-			break;
-		case 260 :
-			_vm->_scrolls->displayScrollChain('q', 82); // Outside Geida's room.
-			break;
-		}
-		break;
-	default:
-		peopleInRoom();
-	}
-}
-
-void Acci::openDoor() {
-	// Special cases.
-	switch (_vm->_gyro->_room) {
-	case r__yours:
-		if (_vm->_animation->inField(2)) {
-			// Opening the box.
-			_thing = 54; // The box.
-			_person = kPardon;
-			examine();
-			return;
-		}
-		break;
-	case r__spludwicks:
-		if (_thing == 61) {
-			_vm->_scrolls->displayScrollChain('q', 85);
-			return;
-		}
-		break;
-	}
-
-	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties))
-		return; // No doors can open if you can't move Avvy.
-
-	for (byte i = 0; i < 7; i++) {
-		if (_vm->_animation->inField(i + 9)) {
-			MagicType *portal = &_vm->_gyro->_portals[i];
-			switch (portal->_operation) {
-			case Gyro::kMagicExclaim:
-				_vm->_animation->_sprites[0].bounce();
-				_vm->_scrolls->displayScrollChain('x', portal->_data);
-				break;
-			case Gyro::kMagicTransport:
-				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
-				break;
-			case Gyro::kMagicUnfinished:
-				_vm->_animation->_sprites[0].bounce();
-				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
-				break;
-			case Gyro::kMagicSpecial:
-				_vm->_animation->callSpecial(portal->_data);
-				break;
-			case Gyro::kMagicOpenDoor:
-				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
-				break;
-			}
-
-			return;
-		}
-	}
-
-	if (_vm->_gyro->_room == r__map)
-		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
-				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
-	else
-		_vm->_scrolls->displayText("Door? What door?");
-}
-
-
-
-void Acci::silly() {
-	_vm->_scrolls->displayText("Don't be silly!");
-}
-
-void Acci::putProc() {
-	if (!isHolding())
-		return;
-
-	_thing2 -= 49; // Slip the second object.
-	char temp = _thing;
-	_thing = _thing2;
-	if (!isHolding())
-		return;
-	_thing = temp;
-
-	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
-	switch (_thing2) {
-	case Gyro::kObjectWine:
-		if (_thing == Gyro::kObjectOnion) {
-			if (_vm->_gyro->_rottenOnion)
-				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
-			else { // Put onion into wine?
-				if (_vm->_gyro->_wineState != 3) {
-					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-					_vm->_scrolls->displayText(tmpStr);
-				} else { // Put onion into vinegar! Yes!
-					_vm->_gyro->_onionInVinegar = true;
-					_vm->_lucerna->incScore(7);
-					_vm->_scrolls->displayScrollChain('u', 9);
-				}
-			}
-		} else
-			silly();
-		break;
-
-	case 54:
-		if (_vm->_gyro->_room == r__yours) { // Put something into the box.
-			if (_vm->_gyro->_boxContent != kNothing)
-				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
-			else {
-				switch (_thing) {
-				case Gyro::kObjectMoney:
-					_vm->_scrolls->displayText("You'd better keep some ready cash on you!");
-					break;
-				case Gyro::kObjectBell:
-					_vm->_scrolls->displayText("That's a silly place to keep a bell.");
-					break;
-				case Gyro::kObjectBodkin:
-					_vm->_scrolls->displayText("But you might need it!");
-					break;
-				case Gyro::kObjectOnion:
-					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
-					break;
-				default: // Put the object into the box...
-					if (_vm->_gyro->_wearing == _thing) {
-						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
-						_vm->_scrolls->displayText(tmpStr);
-					} else {
-						openBox(true); // Open box.
-
-						_vm->_gyro->_boxContent = _thing;
-						_vm->_gyro->_objects[_thing - 1] = false;
-						_vm->_lucerna->refreshObjectList();
-						_vm->_scrolls->displayText("OK, it's in the box.");
-
-						openBox(false); // Shut box.
-					}
-				}
-			}
-		} else
-			silly();
-		break;
-
-	default:
-		silly();
-	}
-}
-
-/**
- * Display text when ingredients are not in the right order
- * @remarks	Originally called 'not_in_order'
- */
-void Acci::notInOrder() {
-	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
-	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
-		"What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-	_vm->_scrolls->displayText(tmpStr);
-}
-
-/**
- * Move Spludwick to cauldron
- * @remarks	Originally called 'go_to_cauldron'
- */
-void Acci::goToCauldron() {
-	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
-	_vm->_animation->_sprites[1].walkTo(2);
-}
-
-/**
- * Check is it's possible to give something to Spludwick
- * @remarks	Originally called 'give2spludwick'
- */
-bool Acci::giveToSpludwick() {
-	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
-		notInOrder();
-		return false;
-	}
-
-	switch (_thing) {
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('q', 22);
-		else {
-			_vm->_gyro->_givenToSpludwick++;
-			_vm->_scrolls->displayScrollChain('q', 20);
-			goToCauldron();
-			_vm->_lucerna->incScore(3);
-		}
-		_vm->_lucerna->refreshObjectList();
-		break;
-	case Gyro::kObjectInk:
-		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_givenToSpludwick++;
-		_vm->_scrolls->displayScrollChain('q', 24);
-		goToCauldron();
-		_vm->_lucerna->incScore(3);
-		break;
-	case Gyro::kObjectMushroom:
-		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
-		_vm->_scrolls->displayScrollChain('q', 25);
-		_vm->_lucerna->incScore(5);
-		_vm->_gyro->_givenToSpludwick++;
-		goToCauldron();
-		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		break;
-	default:
-		return true;
-	}
-
-	return false;
-}
-
-void Acci::drink() {
-	_vm->_gyro->_alcoholLevel += 1;
-	if (_vm->_gyro->_alcoholLevel == 5) {
-		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
-		_vm->_gyro->_teetotal = true;
-		_vm->_gyro->_avvyIsAwake = false;
-		_vm->_gyro->_avvyInBed = true;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_lucerna->dusk();
-		_vm->_gyro->hangAroundForAWhile();
-		_vm->_animation->flipRoom(1, 1);
-		_vm->_gyro->setBackgroundColor(14);
-		_vm->_animation->_sprites[0]._visible = false;
-	}
-}
-
-void Acci::cardiffClimbing() {
-	if (_vm->_gyro->_standingOnDais) { // Clamber up.
-		_vm->_scrolls->displayText("You climb down, back onto the floor.");
-		_vm->_gyro->_standingOnDais = false;
-		_vm->_animation->appearPed(1, 3);
-	} else { // Clamber down.
-		if (_vm->_animation->inField(1)) {
-			_vm->_scrolls->displayText("You clamber up onto the dais.");
-			_vm->_gyro->_standingOnDais = true;
-			_vm->_animation->appearPed(1, 2);
-		} else
-			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
-	}
-}
-
-void Acci::already() {
-	_vm->_scrolls->displayText("You're already standing!");
-}
-
-void Acci::standUp() {
-	switch (_vm->_gyro->_room) {
-	case r__yours: // Avvy isn't asleep.
-		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
-			if (_vm->_gyro->_teetotal) {
-				_vm->_scrolls->displayScrollChain('d', 12);
-				_vm->_gyro->setBackgroundColor(0);
-				_vm->_scrolls->displayScrollChain('d', 14);
-			}
-			_vm->_animation->_sprites[0]._visible = true;
-			_vm->_gyro->_userMovesAvvy = true;
-			_vm->_animation->appearPed(1, 2);
-			_vm->_animation->_direction = Animation::kDirLeft;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
-			_vm->_lucerna->incScore(1);
-			_vm->_gyro->_avvyInBed = false;
-			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
-		} else
-			already();
-		break;
-
-	case r__insidecardiffcastle:
-		cardiffClimbing();
-		break;
-
-	case r__nottspub:
-		if (_vm->_gyro->_sittingInPub)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
-			_vm->_animation->_sprites[0]._visible = true; // But standing up.
-			_vm->_animation->appearPed(1, 4); // And walking away.
-			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
-			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
-		} else
-			already();
-		break;
-	default:
-		already();
-	}
-}
-
-void Acci::getProc(char thing) {
-	switch (_vm->_gyro->_room) {
-	case r__yours:
-		if (_vm->_animation->inField(2)) {
-			if (_vm->_gyro->_boxContent == thing) {
-				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
-				_vm->_scrolls->displayText("OK, I've got it.");
-				_vm->_gyro->_objects[thing - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_boxContent = kNothing;
-				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
-			} else {
-				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
-				_vm->_scrolls->displayText(tmpStr);
-			}
-		} else
-			_vm->_scrolls->displayScrollChain('q', 57);
-		break;
-	case r__insidecardiffcastle:
-		switch (thing) {
-		case Gyro::kObjectPen:
-			if (_vm->_animation->inField(2)) { // Standing on the dais.
-				if (_vm->_gyro->_takenPen)
-					_vm->_scrolls->displayText("It's not there, Avvy.");
-				else {
-					// OK: we're taking the pen, and it's there.
-					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
-					_vm->_animation->callSpecial(3); // Zap!
-					_vm->_gyro->_takenPen = true;
-					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
-					_vm->_lucerna->refreshObjectList();
-					_vm->_scrolls->displayText("Taken.");
-				}
-			} else if (_vm->_gyro->_standingOnDais)
-				_vm->_scrolls->displayScrollChain('q', 53);
-			else
-				_vm->_scrolls->displayScrollChain('q', 51);
-			break;
-		case Gyro::kObjectBolt:
-			_vm->_scrolls->displayScrollChain('q', 52);
-			break;
-		default:
-			_vm->_scrolls->displayScrollChain('q', 57);
-		}
-		break;
-	case r__robins:
-		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-			_vm->_scrolls->displayText("Got it!");
-			_vm->_gyro->_mushroomGrowing = false;
-			_vm->_gyro->_takenMushroom = true;
-			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
-			_vm->_lucerna->refreshObjectList();
-			_vm->_lucerna->incScore(3);
-		} else
-			_vm->_scrolls->displayScrollChain('q', 57);
-		break;
-	default:
-		_vm->_scrolls->displayScrollChain('q', 57);
-	}
-}
-
-/**
- * Give the lute to Geida
- * @remarks	Originally called 'give_Geida_the_lute'
- */
-void Acci::giveGeidaTheLute() {
-	if (_vm->_gyro->_room != r__lustiesroom) {
-		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
-		return;
-	}
-	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
-	_vm->_lucerna->refreshObjectList();
-	_vm->_scrolls->displayScrollChain('q', 64); // She plays it.
-
-	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
-	_vm->_enid->backToBootstrap(4);
-}
-
-void Acci::playHarp() {
-	if (_vm->_animation->inField(7))
-		_vm->_scrolls->musicalScroll();
-	else
-		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
-}
-
-void Acci::winSequence() {
-	_vm->_scrolls->displayScrollChain('q', 78);
-	_vm->_sequence->firstShow(7);
-	_vm->_sequence->thenShow(8);
-	_vm->_sequence->thenShow(9);
-	_vm->_sequence->startToClose();
-	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
-}
-
-Common::String Acci::personSpeaks() {
-	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
-			_person = _vm->_gyro->_her;
-		else
-			_person = _vm->_gyro->_him;
-	}
-
-	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
-		return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
-	}
-
-	bool found = false; // The _person we're looking for's code is in _person.
-	Common::String tmpStr;
-
-	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, '1' + i);
-			found = true;
-		}
-	}
-
-	if (found)
-		return tmpStr;
-
-	for (byte i = 0; i < 16; i++) {
-		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
-			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
-	}
-
-	return tmpStr;
-}
-void Acci::heyThanks() {
-	Common::String tmpStr = personSpeaks();
-	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
-	_vm->_scrolls->displayText(tmpStr);
-	_vm->_gyro->_objects[_thing - 1] = false;
-}
-
-/**
- * @remarks	Originally called 'do_that'
- */
-void Acci::doThat() {
-	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
-	static const char kWhat[] = "That's not possible!";
-
-	if (_thats == Common::String(kNothing))  {
-		if (!_thats.empty())
-			_thats.clear();
-		return;
-	}
-
-	if (_vm->_gyro->_weirdWord)
-		return;
-
-	if (_thing < 200)
-		_thing -= 49; // "Slip"
-
-
-	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
-	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
-	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
-		if (!_vm->_gyro->_alive) {
-			_vm->_scrolls->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
-			return;
-		}
-		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
-			_vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
-			return;
-		}
-	}
-
-	switch (_verb) {
-	case kVerbCodeExam:
-		examine();
-		break;
-	case kVerbCodeOpen:
-		openDoor();
-		break;
-	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-		_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeGet:
-		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_gyro->_carryNum >= kCarryLimit)
-				_vm->_scrolls->displayText("You can't carry any more!");
-			else
-				getProc(_thing);
-		} else { // Not... ditto.
-			if (_person != kPardon)
-				_vm->_scrolls->displayText("You can't sweep folk off their feet!");
-			else
-				_vm->_scrolls->displayText("I assure you, you don't need it.");
-		}
-		break;
-	case kVerbCodeDrop:
-		_vm->_scrolls->displayText("Two years ago you dropped a florin in the street. Three days " \
-				"later it was gone! So now you never leave ANYTHING lying around. OK?");
-		break;
-	case kVerbCodeInv:
-		inventory();
-		break;
-	case kVerbCodeTalk:
-		if (_person == kPardon) {
-			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
-				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Scrolls::kControlItalic, Scrolls::kControlRoman);
-				_vm->_scrolls->displayText(tmpStr);
-			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
-				_thats.deleteChar(0);
-
-				for (byte i = 0; i < 10; i++)
-					_realWords[i] = _realWords[i + 1];
-
-				_verb = _vm->_gyro->_subjectNum;
-				doThat();
-				return;
-			} else {
-				_person = _vm->_gyro->_subjectNum;
-				_vm->_gyro->_subjectNum = 0;
-				if ((_person == 0) || (_person == kPardon))
-					_vm->_scrolls->displayText("Talk to whom?");
-				else if (isPersonHere())
-					_vm->_scrolls->talkTo(_person);
-			}
-		} else if (isPersonHere())
-			_vm->_scrolls->talkTo(_person);
-		break;
-	case kVerbCodeGive:
-		if (isHolding()) {
-			if (_person == kPardon)
-				_vm->_scrolls->displayText("Give to whom?");
-			else if (isPersonHere()) {
-				switch (_thing) {
-				case Gyro::kObjectMoney :
-					_vm->_scrolls->displayText("You can't bring yourself to give away your moneybag.");
-					break;
-				case Gyro::kObjectBodkin:
-				case Gyro::kObjectBell:
-				case Gyro::kObjectClothes:
-				case Gyro::kObjectHabit :
-					_vm->_scrolls->displayText("Don't give it away, it might be useful!");
-					break;
-				default:
-					switch (_person) {
-					case Gyro::kPeopleCrapulus:
-						if (_thing == Gyro::kObjectWine) {
-							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-						} else
-							heyThanks();
-						break;
-					case Gyro::kPeopleCwytalot:
-						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-							_vm->_scrolls->displayText("You might be able to influence Cwytalot more if you used it!");
-						else
-							heyThanks();
-						break;
-					case Gyro::kPeopleSpludwick:
-						if (giveToSpludwick())
-							heyThanks();
-						break;
-					case Gyro::kPeopleIbythneth:
-						if (_thing == Gyro::kObjectBadge) {
-							_vm->_scrolls->displayScrollChain('q', 32); // Thanks! Wow!
-							_vm->_lucerna->incScore(3);
-							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
-							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
-							_vm->_gyro->_givenBadgeToIby = true;
-							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
-							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
-						} else
-							heyThanks();
-						break;
-					case Gyro::kPeopleAyles:
-						if (_vm->_gyro->_aylesIsAwake) {
-							if (_thing == Gyro::kObjectPen) {
-								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
-								_vm->_scrolls->displayScrollChain('q', 54);
-								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
-								_vm->_gyro->_givenPenToAyles = true;
-								_vm->_lucerna->refreshObjectList();
-								_vm->_lucerna->incScore(2);
-							} else
-								heyThanks();
-						} else
-							_vm->_scrolls->displayText("But he's asleep!");
-						break;
-					case Gyro::kPeopleGeida:
-						switch (_thing) {
-						case Gyro::kObjectPotion:
-							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
-							_vm->_scrolls->displayScrollChain('u', 16); // She drinks it.
-							_vm->_lucerna->incScore(2);
-							_vm->_gyro->_givenPotionToGeida = true;
-							_vm->_lucerna->refreshObjectList();
-							break;
-						case Gyro::kObjectLute:
-							giveGeidaTheLute();
-							break;
-						default:
-							heyThanks();
-						}
-						break;
-					case Gyro::kPeopleArkata:
-						switch (_thing) {
-						case Gyro::kObjectPotion:
-							if (_vm->_gyro->_givenPotionToGeida)
-								winSequence();
-							else
-								_vm->_scrolls->displayScrollChain('q', 77); // That Geida woman!
-							break;
-						default:
-							heyThanks();
-						}
-						break;
-					default:
-						heyThanks();
-					}
-				}
-			}
-			_vm->_lucerna->refreshObjectList(); // Just in case...
-		}
-		break;
-
-	case kVerbCodeEat:
-	case kVerbCodeDrink:
-		if (isHolding())
-			swallow();
-		break;
-
-	case kVerbCodeLoad:
-		break;
-	case kVerbCodeSave:
-		break;
-	// We don't handle these two because we use ScummVM's save/load system.
-
-	case kVerbCodePay:
-		_vm->_scrolls->displayText("No money need change hands.");
-		break;
-	case kVerbCodeLook:
-		lookAround();
-		break;
-	case kVerbCodeBreak:
-		_vm->_scrolls->displayText("Vandalism is prohibited within this game!");
-		break;
-	case kVerbCodeQuit: // quit
-		if (!_polite)
-			_vm->_scrolls->displayText("How about a `please\", Avvy?");
-		else {
-			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Scrolls::kControlRegister, Scrolls::kControlIcon);
-			if (_vm->_scrolls->displayQuestion(tmpStr))
-				_vm->_gyro->_letMeOut = true;
-		}
-		break;
-	case kVerbCodeGo:
-		_vm->_scrolls->displayText("Just use the arrow keys to walk there.");
-		break;
-	case kVerbCodeInfo: {
-		_vm->_scrolls->_aboutScroll = true;
-
-		Common::String toDisplay;
-		for (byte i = 0; i < 7; i++)
-			toDisplay += Scrolls::kControlNewLine;
-		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Scrolls::kControlCenter + Scrolls::kControlNewLine
-			+ "The medi\x91val descendant of" + Scrolls::kControlNewLine
-			+ "Denarius Avaricius Sextus" + Scrolls::kControlNewLine + Scrolls::kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Copyright \xEF "
-			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Scrolls::kControlRegister + 'Y' + Scrolls::kControlIcon;
-		_vm->_scrolls->displayText(toDisplay);
-		_vm->_scrolls->_aboutScroll = false;
-		}
-		break;
-	case kVerbCodeUndress:
-		if (_vm->_gyro->_wearing == kNothing)
-			_vm->_scrolls->displayText("You're already stark naked!");
-		else if (_vm->_gyro->_avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
-			_vm->_scrolls->displayText(tmpStr);
-			_vm->_gyro->_wearing = kNothing;
-			_vm->_lucerna->refreshObjectList();
-		} else
-			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
-		break;
-	case kVerbCodeWear:
-		if (isHolding()) { // Wear something.
-			switch (_thing) {
-			case Gyro::kObjectChastity:
-				// \? are used to avoid that ??! is parsed as a trigraph
-				_vm->_scrolls->displayText("Hey, what kind of a weirdo are you\?\?!");
-				break;
-			case Gyro::kObjectClothes:
-			case Gyro::kObjectHabit: { // Change this!
-					if (_vm->_gyro->_wearing != kNothing) {
-						if (_vm->_gyro->_wearing == _thing)
-							_vm->_scrolls->displayText("You're already wearing that.");
-						else
-							_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
-						return;
-					} else
-						_vm->_gyro->_wearing = _thing;
-
-					_vm->_lucerna->refreshObjectList();
-
-					byte i;
-					if (_thing == Gyro::kObjectHabit)
-						i = 3;
-					else
-						i = 0;
-					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
-					if (spr->_id != i) {
-						int16 x = spr->_x;
-						int16 y = spr->_y;
-						spr->remove();
-						spr->init(i, true, _vm->_animation);
-						spr->appear(x, y, Animation::kDirLeft);
-						spr->_visible = false;
-					}
-				}
-				break;
-			default:
-				_vm->_scrolls->displayText(kWhat);
-			}
-		}
-		break;
-	case kVerbCodePlay:
-		if (_thing == kPardon) {
-			switch (_vm->_gyro->_room) { // They just typed "play"...
-			case r__argentpub: { // ...in the pub, => play Nim.
-					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
-					// play_nim();
-					// The following parts are copied from play_nim().
-					// The player automatically wins the game everytime he wins, until I implement the mini-game.
-
-					if (_vm->_gyro->_wonNim) { // Already won the game.
-						_vm->_scrolls->displayScrollChain('Q', 6);
-						return;
-					}
-
-					if (!_vm->_gyro->_askedDogfoodAboutNim) {
-						_vm->_scrolls->displayScrollChain('q', 84);
-						return;
-					}
-
-					_vm->_scrolls->displayScrollChain('Q', 3);
-					_vm->_gyro->_playedNim++;
-
-					// You won - strange!
-					_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
-					_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
-					_vm->_lucerna->refreshObjectList();
-					_vm->_gyro->_wonNim = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
-					_vm->_lucerna->incScore(7); // 7 points for winning!
-
-					if (_vm->_gyro->_playedNim == 1)
-						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
-
-					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-					_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-						+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
-				}
-				break;
-			case r__musicroom:
-				playHarp();
-				break;
-			}
-		} else if (isHolding()) {
-			switch (_thing) {
-			case Gyro::kObjectLute :
-					_vm->_scrolls->displayScrollChain('U', 7);
-
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
-						_vm->_scrolls->displayScrollChain('U', 10);
-
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
-						_vm->_scrolls->displayScrollChain('U', 15);
-				break;
-			case 52:
-				if (_vm->_gyro->_room == r__musicroom)
-					playHarp();
-				else
-					_vm->_scrolls->displayText(kWhat);
-				break;
-			case 55:
-				if (_vm->_gyro->_room == r__argentpub)
-					// play_nim();
-					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
-				else
-					_vm->_scrolls->displayText(kWhat);
-				break;
-			default:
-				_vm->_scrolls->displayText(kWhat);
-			}
-		}
-		break;
-	case kVerbCodeRing:
-		if (isHolding()) {
-			if (_thing == Gyro::kObjectBell) {
-				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-					// \? are used to avoid that ??! is parsed as a trigraph
-					_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
-			} else
-				_vm->_scrolls->displayText(kWhat);
-		}
-		break;
-	case kVerbCodeHelp:
-		// boot_help();
-		warning("STUB: Acci::doThat() - case kVerbCodehelp");
-		break;
-	case kVerbCodeLarrypass:
-		_vm->_scrolls->displayText("Wrong game!");
-		break;
-	case kVerbCodePhaon:
-		_vm->_scrolls->displayText("Hello, Phaon!");
-		break;
-	case kVerbCodeBoss:
-		// bosskey();
-		warning("STUB: Acci::doThat() - case kVerbCodeboss");
-		break;
-	case kVerbCodePee:
-		if (_vm->_gyro->setFlag('P')) {
-			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
-		} else {
-			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-			_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeCheat: {
-		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Scrolls::kControlItalic);
-		_vm->_scrolls->displayText(tmpStr);
-		_vm->_gyro->_cheat = true;
-		}
-		break;
-	case kVerbCodeMagic:
-		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_scrolls->displayScrollChain('q', 19);
-		else {
-			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
-				_vm->_scrolls->displayScrollChain('q', 17);
-				if (_vm->_gyro->_whereIs[1] == 12)
-					_vm->_scrolls->displayScrollChain('q', 18);
-				else {
-					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
-					spr->init(1, false, _vm->_animation); // Avaricius
-					_vm->_animation->appearPed(2, 4);
-					spr->walkTo(5);
-					spr->_callEachStepFl = true;
-					spr->_eachStepProc = Animation::kProcBackAndForth;
-					_vm->_gyro->_avariciusTalk = 14;
-					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
-				}
-			} else
-				_vm->_scrolls->displayText("Nothing appears to happen...");
-		}
-		break;
-	case kVerbCodeSmartAlec:
-		_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
-		break;
-	case kVerbCodeExpletive:
-		switch (_vm->_gyro->_sworeNum) {
-		case 0: {
-			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
-				"(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
-			}
-			break;
-		case 1: {
-			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
-				"do things I tell you not to?%c%cDon't do it again!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
-			}
-			break;
-		default: {
-			_vm->_pingo->zonk();
-			// CHECKME: Weird character in string
-			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
-			_vm->_lucerna->gameOver();
-			}
-		}
-		_vm->_gyro->_sworeNum++;
-		break;
-	case kVerbCodeListen:
-		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-			_vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
-		else if (_vm->_gyro->_listen.empty())
-			_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy.");
-		else
-			_vm->_scrolls->displayText(_vm->_gyro->_listen);
-		break;
-	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_gyro->_room) {
-		case r__argentpub:
-			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
-				switch (_thing) {
-				case 51:
-				case 53:
-				case 54:
-				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-						_vm->_scrolls->displayScrollChain('D', 15);
-						return;
-					}
-
-					if (_vm->_gyro->_teetotal)  {
-						_vm->_scrolls->displayScrollChain('D', 6);
-						return;
-					}
-
-					if (_vm->_gyro->_alcoholLevel == 0)
-						_vm->_lucerna->incScore(3);
-
-					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
-					_vm->_gyro->_drinking = _thing;
-
-					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-					_vm->_gyro->_malagauche = 177;
-					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
-					break;
-				case 52:
-					examine();
-					break; // We have a right one here - buy Pepsi??!
-				case Gyro::kObjectWine:
-					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
-						_vm->_scrolls->displayScrollChain('D', 2); // 1 bottle's shufishent!
-					else {
-						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-							_vm->_scrolls->displayScrollChain('D', 15);
-							return;
-						}
-
-						if (_vm->_gyro->_carryNum >= kCarryLimit) {
-							_vm->_scrolls->displayText("Your hands are full.");
-							return;
-						}
-
-						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-						_vm->_scrolls->displayText(tmpStr);
-						if (_vm->_gyro->_alcoholLevel == 0)
-							_vm->_lucerna->incScore(3);
-						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
-						_vm->_gyro->_malagauche = 177;
-
-						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
-					}
-					break;
-				}
-			} else
-				_vm->_scrolls->displayScrollChain('D', 5); // Go to the bar!
-			break;
-
-		case r__outsideducks:
-			if (_vm->_animation->inField(6)) {
-				if (_thing == Gyro::kObjectOnion) {
-					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
-						_vm->_scrolls->displayScrollChain('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_gyro->_carryNum >= kCarryLimit)
-						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
-					else {
-						if (_vm->_gyro->_boughtOnion)
-							_vm->_scrolls->displayScrollChain('D', 11);
-						else {
-							_vm->_scrolls->displayScrollChain('D', 9);
-							_vm->_lucerna->incScore(3);
-						}
-						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
-						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
-						_vm->_lucerna->refreshObjectList();
-						_vm->_gyro->_boughtOnion = true;
-						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
-						_vm->_gyro->_onionInVinegar = false;
-					}
-				} else
-					_vm->_scrolls->displayScrollChain('D', 0);
-			} else
-				_vm->_scrolls->displayScrollChain('D', 0);
-			break;
-
-		case r__nottspub:
-			_vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners.
-			break;
-		default:
-			_vm->_scrolls->displayScrollChain('D', 0); // Can't buy that.
-		}
-		break;
-	case kVerbCodeAttack:
-		if ((_vm->_gyro->_room == r__brummieroad) &&
-				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
-			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
-				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
-			case 0:
-				_vm->_scrolls->displayScrollChain('Q', 10);
-				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
-				break;
-			case 1:
-				_vm->_scrolls->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
-				break;
-			case 2:
-				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
-				break;
-			case 3:
-				_vm->_scrolls->displayScrollChain('Q', 11);
-				_vm->_gyro->_cwytalotGone = true;
-				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
-				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
-				_vm->_lucerna->incScore(7);
-				_vm->_animation->_sprites[1].walkTo(2);
-				_vm->_animation->_sprites[1]._vanishIfStill = true;
-				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_gyro->_whereIs[7] = 177;
-				break;
-			default:
-				_vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent!
-			}
-		} else
-			_vm->_scrolls->displayScrollChain('Q', 10);
-		break;
-	case kVerbCodePasswd:
-		if (_vm->_gyro->_room != r__bridge)
-			_vm->_scrolls->displayScrollChain('Q', 12);
-		else {
-			bool ok = true;
-			for (byte i = 0; i < _thats.size(); i++) {
-				Common::String temp = _realWords[i];
-				temp.toUppercase();
-				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
-				for (byte j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
-					if (_vocabulary[pwdId]._word[j] != temp[j])
-						ok = false;
-				}
-			}
-
-			if (ok) {
-				if (_vm->_gyro->_drawbridgeOpen != 0)
-					_vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
-				else {
-					_vm->_lucerna->incScore(4);
-					_vm->_scrolls->displayText("The drawbridge opens!");
-					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
-					_vm->_gyro->_drawbridgeOpen = 1;
-				}
-			} else
-				_vm->_scrolls->displayScrollChain('Q', 12);
-		}
-		break;
-	case kVerbCodeDir:
-		_vm->_enid->dir(_realWords[1]);
-		break;
-	case kVerbCodeDie:
-		_vm->_lucerna->gameOver();
-		break;
-	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
-		_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodePut:
-		putProc();
-		break;
-	case kVerbCodeStand:
-		standUp();
-		break;
-	case kVerbCodeKiss:
-		if (_person == kPardon)
-			_vm->_scrolls->displayText("Kiss whom?");
-		else if (isPersonHere()) {
-			switch (_person) {
-			case Gyro::kPeopleArkata:
-				_vm->_scrolls->displayScrollChain('U', 12);
-				break;
-			case Gyro::kPeopleGeida:
-				_vm->_scrolls->displayScrollChain('U', 13);
-				break;
-			case Gyro::kPeopleWisewoman:
-				_vm->_scrolls->displayScrollChain('U', 14);
-				break;
-			default:
-				_vm->_scrolls->displayScrollChain('U', 5); // You WHAT?
-			}
-		} else if ((150 <= _person) && (_person <= 174))
-			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
-
-		break;
-	case kVerbCodeClimb:
-		if (_vm->_gyro->_room == r__insidecardiffcastle)
-			cardiffClimbing();
-		else // In the wrong room!
-			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
-		break;
-	case kVerbCodeJump:
-		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
-		_vm->_gyro->_userMovesAvvy = false;
-		break;
-	case kVerbCodeHiscores:
-		//	show_highs();
-		warning("STUB: Acci::doThat() - case kVerbCodehighscores");
-		break;
-	case kVerbCodeWake:
-		if (isPersonHere())
-			switch (_person) {
-			case kPardon:
-			case Gyro::kPeopleAvalot:
-			case 0:
-				if (!_vm->_gyro->_avvyIsAwake) {
-					_vm->_gyro->_avvyIsAwake = true;
-					_vm->_lucerna->incScore(1);
-					_vm->_gyro->_avvyInBed = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
-					if (_vm->_gyro->_teetotal)
-						_vm->_scrolls->displayScrollChain('d', 13);
-				} else
-					_vm->_scrolls->displayText("You're already awake, Avvy!");
-				break;
-			case Gyro::kPeopleAyles:
-				if (!_vm->_gyro->_aylesIsAwake)
-					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
-				break;
-			case Gyro::kPeopleJacques: {
-				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
-					"Hmmm... that doesn't seem to do any good...", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-				_vm->_scrolls->displayText(tmpStr);
-				}
-				break;
-			default:
-				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
-		}
-		break;
-	case kVerbCodeSit:
-		if (_vm->_gyro->_room == r__nottspub) {
-			if (_vm->_gyro->_sittingInPub)
-				_vm->_scrolls->displayText("You're already sitting!");
-			else {
-				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
-				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
-			}
-		} else { // Default doodah.
-			_vm->_lucerna->dusk();
-			_vm->_gyro->hangAroundForAWhile();
-			_vm->_lucerna->dawn();
-			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Scrolls::kControlParagraph);
-			_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeRestart:
-		if (_vm->_scrolls->displayQuestion("Restart game and lose changes?"))  {
-			_vm->_lucerna->dusk();
-			_vm->_gyro->newGame();
-			_vm->_lucerna->dawn();
-		}
-		break;
-	case kPardon:
-		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
-		break;
-	case kVerbCodeHello: {
-		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeThanks: {
-		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
-		}
-		break;
-	default:
-		Common::String tmpStr = Common::String::format("%cParser bug!", Scrolls::kControlBell);
-		_vm->_scrolls->displayText(tmpStr);
-	}
-}
-
-void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
-	switch (verb) {
-	case kVerbCodeExam:
-		answer = "Examine";
-		ansKey = 'x';
-		break; // The ubiquitous one.
-	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
-	case kVerbCodeDrink:
-		answer = "Drink";
-		ansKey = 'D';
-		break;
-	case kVerbCodeWear:
-		answer = "Wear";
-		ansKey = 'W';
-		break;
-	case kVerbCodeRing:
-		answer = "Ring";
-		ansKey = 'R';
-		break; // Only the bell!
-	case kVerbCodePlay:
-		answer = "Play";
-		ansKey = 'P';
-		break;
-	case kVerbCodeEat:
-		answer = "Eat";
-		ansKey = 'E';
-		break;
-	default:
-		answer = "? Unknown!"; // Bug!
-		ansKey = '?';
-	}
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/acci2.h b/engines/avalanche/acci2.h
deleted file mode 100644
index 07816cc..0000000
--- a/engines/avalanche/acci2.h
+++ /dev/null
@@ -1,138 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ACCIDENCE II		The parser. */
-
-#ifndef AVALANCHE_ACCI2_H
-#define AVALANCHE_ACCI2_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Acci {
-public:
-	enum VerbCode {
-		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
-		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
-		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
-		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
-		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
-		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
-		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
-		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
-		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
-		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
-	};
-
-	static const byte kPardon = 254; // Didn't understand / wasn't given.
-	static const int16 kParserWordsNum = 277; // How many words does the parser know?
-	static const byte kNothing = 250;
-	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
-	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
-
-	struct VocabEntry {
-		byte _number;
-		Common::String _word;
-
-		void init(byte number, Common::String word) {
-			_number = number;
-			_word = word;
-		}
-	};
-
-	VocabEntry _vocabulary[kParserWordsNum];
-
-	Common::String _realWords[11];
-	byte _verb, _person, _thing;
-	bool _polite;
-
-	Acci(AvalancheEngine *vm);
-
-	void init();
-	void parse();
-	void doThat();
-	void verbOpt(byte verb, Common::String &answer, char &ansKey);
-	void drink();
-
-private:
-	struct RankType {
-		uint16 _score;
-		Common::String _title;
-	};
-
-	Common::String _thats;
-	byte _thing2;
-
-	AvalancheEngine *_vm;
-
-	byte wordNum(Common::String word);
-	void replace(Common::String oldChars, byte newChar);
-
-	Common::String rank();
-	Common::String totalTime();
-
-	void clearWords();
-	void cheatParse(Common::String codes);
-	void stripPunctuation(Common::String &word); // Strips punctuation from word.
-	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
-	bool doPronouns();
-	void properNouns();
-	void lookAround(); // This is called when you say "look".
-	void sayIt();  // This makes Avalot say the response.
-	void openDoor();
-	void storeInterrogation(byte interrogation);
-	void examineObject(); // Examine a standard object-thing
-	bool isPersonHere();
-	void exampers();
-	bool isHolding();
-	void openBox(bool isOpening);
-	void examine();
-	void inventory();
-	void swallow();
-	void peopleInRoom(); // This lists the other people in the room.
-	void silly();
-	void putProc();  // Called when you call kVerbCodeput.
-	void notInOrder();
-	void goToCauldron();
-	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
-	void cardiffClimbing();
-	void already();
-	void standUp(); // Called when you ask Avvy to stand.
-	void getProc(char thing);
-	void giveGeidaTheLute();
-	void playHarp();
-	void winSequence();
-	Common::String personSpeaks();
-	void heyThanks();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_ACCI2_H
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 21063e0..526f6a8 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -30,13 +30,13 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/animation.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/celer2.h"
-#include "avalanche/sequence2.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/gyro.h"
+#include "avalanche/celer.h"
+#include "avalanche/sequence.h"
 #include "avalanche/timer.h"
-#include "avalanche/enid2.h"
+#include "avalanche/enid.h"
 
 #include "common/scummsys.h"
 #include "common/textconsole.h"
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index b93c117..30eaee0 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -34,18 +34,18 @@
 #include "avalanche/parser.h"
 
 #include "avalanche/avalot.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/pingo2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/enid2.h"
-#include "avalanche/celer2.h"
-#include "avalanche/sequence2.h"
+#include "avalanche/gyro.h"
+#include "avalanche/pingo.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/enid.h"
+#include "avalanche/celer.h"
+#include "avalanche/sequence.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/acci2.h"
-#include "avalanche/dropdown2.h"
-#include "avalanche/closing2.h"
+#include "avalanche/acci.h"
+#include "avalanche/dropdown.h"
+#include "avalanche/closing.h"
 
 #include "common/serializer.h"
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a5b3e06..a52186d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -31,17 +31,17 @@
 
 #include "avalanche/graphics.h"
 #include "avalanche/avalot.h"
-#include "avalanche/gyro2.h"
+#include "avalanche/gyro.h"
 #include "avalanche/animation.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/dropdown2.h"
-#include "avalanche/pingo2.h"
+#include "avalanche/gyro.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/dropdown.h"
+#include "avalanche/pingo.h"
 #include "avalanche/timer.h"
-#include "avalanche/celer2.h"
-#include "avalanche/enid2.h"
-#include "avalanche/closing2.h"
+#include "avalanche/celer.h"
+#include "avalanche/enid.h"
+#include "avalanche/closing.h"
 
 #include "common/str.h"
 #include "common/textconsole.h"
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
new file mode 100644
index 0000000..f8b2604
--- /dev/null
+++ b/engines/avalanche/celer.cpp
@@ -0,0 +1,387 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/celer.h"
+#include "avalanche/animation.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/gyro.h"
+#include "avalanche/roomnums.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+const int16 Celer::kOnDisk = -1;
+
+Celer::Celer(AvalancheEngine *vm) {
+	_vm = vm;
+	_spriteNum = 0;
+}
+
+Celer::~Celer() {
+	forgetBackgroundSprites();
+}
+
+/**
+ * @remarks	Originally called 'pics_link'
+ */
+void Celer::updateBackgroundSprites() {
+	if (_vm->_gyro->_dropdownActive)
+		return; // No animation when the menus are up.
+
+	switch (_vm->_gyro->_room) {
+	case r__outsideargentpub:
+		if ((_vm->_gyro->_roomTime % 12) == 0)
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
+		break;
+	case r__brummieroad:
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4);
+		break;
+	case r__bridge:
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
+		break;
+	case r__yours:
+		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
+		break;
+	case r__argentpub:
+		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
+			// Malagauche cycle.
+			_vm->_gyro->_malagauche += 1;
+			switch (_vm->_gyro->_malagauche) {
+			case 1:
+			case 11:
+			case 21:
+				drawBackgroundSprite(-1, -1, 12); // Looks forwards.
+				break;
+			case 8:
+			case 18:
+			case 28:
+			case 32:
+				drawBackgroundSprite(-1, -1, 11); // Looks at you.
+				break;
+			case 30:
+				drawBackgroundSprite(-1, -1, 13); // Winks.
+				break;
+			case 33:
+				_vm->_gyro->_malagauche = 0;
+				break;
+			}
+		}
+
+		switch (_vm->_gyro->_roomTime % 200) {
+		case 179:
+		case 197:
+			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
+			break;
+		case 182:
+		case 194:
+			drawBackgroundSprite(-1, -1, 6);
+			break;
+		case 185:
+			drawBackgroundSprite(-1, -1, 7);
+			break;
+		case 199:
+			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
+			break;
+		}
+
+		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
+			byte direction = 0;
+			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
+				direction = 3;
+			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
+				direction = 2;
+			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
+				direction = 4;
+
+			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->_npcFacing = direction;
+			}
+		}
+		break;
+	case r__westhall:
+		if ((_vm->_gyro->_roomTime % 3) == 0) {
+			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
+			case 4:
+				drawBackgroundSprite(-1, -1, 1);
+				break;
+			case 1:
+			case 3:
+			case 5:
+				drawBackgroundSprite(-1, -1, 2);
+				break;
+			case 0:
+			case 2:
+				drawBackgroundSprite(-1, -1, 3);
+				break;
+			}
+		}
+		break;
+	case r__lustiesroom:
+		if (!(_vm->_gyro->_lustieIsAsleep)) {
+			byte direction = 0;
+			uint16 angle = _vm->_lucerna->bearing(2);
+			if ((_vm->_gyro->_roomTime % 45) > 42)
+				direction = 4; // du Lustie blinks.
+			// Bearing of Avvy from du Lustie.
+			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+					direction = 1; // Middle.
+			else if ((angle >= 45) && (angle <= 180))
+					direction = 2; // Left.
+			else if ((angle >= 181) && (angle <= 314))
+				direction = 3; // Right.
+
+			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
+				drawBackgroundSprite(-1, -1, direction);
+				_vm->_gyro->_npcFacing = direction;
+			}
+		}
+		break;
+	case r__aylesoffice:
+		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
+			switch ((_vm->_gyro->_roomTime / 14) % 2) {
+			case 0:
+				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
+				break;
+			case 1:
+				drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural.
+				break;
+			}
+		}
+		break;
+	case r__robins:
+		if (_vm->_gyro->_tiedUp) {
+			switch (_vm->_gyro->_roomTime % 54) {
+			case 20:
+				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
+				break;
+			case 23:
+				drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal.
+				break;
+			}
+		}
+		break;
+	case r__nottspub: {
+		// Bearing of Avvy from Port.
+		byte direction = 0;
+		uint16 angle = _vm->_lucerna->bearing(5);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+			direction = 2; // Middle.
+		else if ((angle >= 45) && (angle <= 180))
+			direction = 6; // Left.
+		else if ((angle >= 181) && (angle <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->_roomTime % 60) > 57)
+			direction--; // Blinks.
+
+		if (direction != _vm->_gyro->_npcFacing) { // Port.
+			drawBackgroundSprite(-1, -1, direction);
+			_vm->_gyro->_npcFacing = direction;
+		}
+
+		switch (_vm->_gyro->_roomTime % 50) {
+		case 45 :
+			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
+			break;
+		case 49 :
+			drawBackgroundSprite(-1, -1, 10);
+			break;
+		}
+		break;
+	  }
+	case r__ducks: {
+		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
+			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3);
+
+		// Bearing of Avvy from Duck.
+		byte direction = 0;
+		uint16 angle = _vm->_lucerna->bearing(2);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+			direction = 4; // Middle.
+		else if ((angle >= 45) && (angle <= 180))
+			direction = 6; // Left.
+		else if ((angle >= 181) && (angle <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->_roomTime % 45) > 42)
+			direction++; // Duck blinks.
+
+		if (direction != _vm->_gyro->_npcFacing) { // Duck.
+			drawBackgroundSprite(-1, -1, direction);
+			_vm->_gyro->_npcFacing = direction;
+		}
+		break;
+	   }
+	}
+
+	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
+		// They're ringing the bells.
+		switch (_vm->_gyro->_roomTime % 4) {
+		case 1:
+			if (_vm->_gyro->_nextBell < 5)
+				_vm->_gyro->_nextBell = 12;
+			_vm->_gyro->_nextBell--;
+			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]);
+			break;
+		case 2:
+			//nosound();
+			updateBackgroundSprites();
+			break;
+		}
+	}
+}
+
+void Celer::loadBackgroundSprites(byte number) {
+	Common::File f;
+	_filename = _filename.format("chunk%d.avd", number);
+	if (!f.open(_filename))
+		return; // We skip because some rooms don't have sprites in the background.
+
+	f.seek(44);
+	_spriteNum = f.readByte();
+	for (byte i = 0; i < _spriteNum; i++)
+		_offsets[i] = f.readSint32LE();
+
+	for (byte i = 0; i < _spriteNum; i++) {
+		f.seek(_offsets[i]);
+
+		SpriteType sprite;
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		bool natural = f.readByte();
+		bool memorize = f.readByte();
+
+		if (memorize) {
+			_sprites[i]._x = sprite._x;
+			_sprites[i]._xl = sprite._xl;
+			_sprites[i]._y = sprite._y;
+			_sprites[i]._yl = sprite._yl;
+			_sprites[i]._type = sprite._type;
+
+			if (natural) {
+				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
+				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
+				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+
+				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
+					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
+						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
+				}
+			} else {
+				_sprites[i]._size = sprite._size;
+				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
+			}
+		} else
+			_sprites[i]._x = kOnDisk;
+	}
+	f.close();
+}
+
+void Celer::forgetBackgroundSprites() {
+	for (byte i = 0; i < _spriteNum; i++) {
+		if (_sprites[i]._x > kOnDisk)
+			_sprites[i]._picture.free();
+	}
+}
+
+void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
+	which--; // For the difference between the Pascal and C array indexes.
+	//setactivepage(3);
+	warning("STUB: Celer::show_one()");
+
+	if (_sprites[which]._x > kOnDisk) {
+		if (destX < 0) {
+			destX = _sprites[which]._x * 8;
+			destY = _sprites[which]._y;
+		}
+		drawSprite(destX, destY, _sprites[which]);
+	} else {
+		Common::File f;
+		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
+			error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
+
+		f.seek(_offsets[which]);
+
+		SpriteType sprite;
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
+		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
+
+		if (destX < 0) {
+			destX = sprite._x * 8;
+			destY = sprite._y;
+		}
+		drawSprite(destX, destY, sprite);
+
+		sprite._picture.free();
+		f.close();
+	}
+
+	//setactivepage(1 - cp);
+	warning("STUB: Celer::show_one()");
+}
+
+
+
+void Celer::drawSprite(int16 x, int16 y, SpriteType &sprite) {
+	_r._x1 = x;
+	_r._y1 = y;
+	_r._y2 = y + sprite._yl;
+
+	switch (sprite._type) {
+	case kNaturalImage: // Allow fallthrough on purpose.
+	case kBgi:
+		_r._x2 = x + sprite._xl + 1;
+		break;
+	case kEga:
+		_r._x2 = x + sprite._xl;
+		break;
+	}
+
+	// These pictures are practically parts of the background. -10 is for the drop-down menu.
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
new file mode 100644
index 0000000..47a11bf
--- /dev/null
+++ b/engines/avalanche/celer.h
@@ -0,0 +1,81 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#ifndef AVALANCHE_CELER2_H
+#define AVALANCHE_CELER2_H
+
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "common/str.h"
+
+#include "graphics/surface.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Celer {
+public:
+	Celer(AvalancheEngine *vm);
+	~Celer();
+
+	void updateBackgroundSprites();
+	void loadBackgroundSprites(byte number);
+	void forgetBackgroundSprites();
+
+	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
+	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
+	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
+	void drawBackgroundSprite(int16 destX, int16 destY, byte which);
+
+private:
+	enum PictureType {kEga, kBgi, kNaturalImage};
+
+	struct SpriteType {
+		PictureType _type;
+		int16 _x, _y;
+		int16 _xl, _yl;
+		int32 _size;
+		::Graphics::Surface _picture;
+	};
+
+	AvalancheEngine *_vm;
+
+	int32 _offsets[40];
+	byte _spriteNum;
+	SpriteType _sprites[40];
+	ByteField _r;
+	Common::String _filename;
+	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
+
+	void drawSprite(int16 x, int16 y, SpriteType &sprite);
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_CELER2_H
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
deleted file mode 100644
index 7e2891e..0000000
--- a/engines/avalanche/celer2.cpp
+++ /dev/null
@@ -1,387 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CELER	The unit for updating the screen pics. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/celer2.h"
-#include "avalanche/animation.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/roomnums.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-const int16 Celer::kOnDisk = -1;
-
-Celer::Celer(AvalancheEngine *vm) {
-	_vm = vm;
-	_spriteNum = 0;
-}
-
-Celer::~Celer() {
-	forgetBackgroundSprites();
-}
-
-/**
- * @remarks	Originally called 'pics_link'
- */
-void Celer::updateBackgroundSprites() {
-	if (_vm->_gyro->_dropdownActive)
-		return; // No animation when the menus are up.
-
-	switch (_vm->_gyro->_room) {
-	case r__outsideargentpub:
-		if ((_vm->_gyro->_roomTime % 12) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
-		break;
-	case r__brummieroad:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4);
-		break;
-	case r__bridge:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
-		break;
-	case r__yours:
-		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
-		break;
-	case r__argentpub:
-		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
-			// Malagauche cycle.
-			_vm->_gyro->_malagauche += 1;
-			switch (_vm->_gyro->_malagauche) {
-			case 1:
-			case 11:
-			case 21:
-				drawBackgroundSprite(-1, -1, 12); // Looks forwards.
-				break;
-			case 8:
-			case 18:
-			case 28:
-			case 32:
-				drawBackgroundSprite(-1, -1, 11); // Looks at you.
-				break;
-			case 30:
-				drawBackgroundSprite(-1, -1, 13); // Winks.
-				break;
-			case 33:
-				_vm->_gyro->_malagauche = 0;
-				break;
-			}
-		}
-
-		switch (_vm->_gyro->_roomTime % 200) {
-		case 179:
-		case 197:
-			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
-			break;
-		case 182:
-		case 194:
-			drawBackgroundSprite(-1, -1, 6);
-			break;
-		case 185:
-			drawBackgroundSprite(-1, -1, 7);
-			break;
-		case 199:
-			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
-			break;
-		}
-
-		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
-			byte direction = 0;
-			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
-				direction = 3;
-			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
-				direction = 2;
-			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
-				direction = 4;
-
-			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
-				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_npcFacing = direction;
-			}
-		}
-		break;
-	case r__westhall:
-		if ((_vm->_gyro->_roomTime % 3) == 0) {
-			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
-			case 4:
-				drawBackgroundSprite(-1, -1, 1);
-				break;
-			case 1:
-			case 3:
-			case 5:
-				drawBackgroundSprite(-1, -1, 2);
-				break;
-			case 0:
-			case 2:
-				drawBackgroundSprite(-1, -1, 3);
-				break;
-			}
-		}
-		break;
-	case r__lustiesroom:
-		if (!(_vm->_gyro->_lustieIsAsleep)) {
-			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(2);
-			if ((_vm->_gyro->_roomTime % 45) > 42)
-				direction = 4; // du Lustie blinks.
-			// Bearing of Avvy from du Lustie.
-			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-					direction = 1; // Middle.
-			else if ((angle >= 45) && (angle <= 180))
-					direction = 2; // Left.
-			else if ((angle >= 181) && (angle <= 314))
-				direction = 3; // Right.
-
-			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
-				drawBackgroundSprite(-1, -1, direction);
-				_vm->_gyro->_npcFacing = direction;
-			}
-		}
-		break;
-	case r__aylesoffice:
-		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
-			switch ((_vm->_gyro->_roomTime / 14) % 2) {
-			case 0:
-				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
-				break;
-			case 1:
-				drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural.
-				break;
-			}
-		}
-		break;
-	case r__robins:
-		if (_vm->_gyro->_tiedUp) {
-			switch (_vm->_gyro->_roomTime % 54) {
-			case 20:
-				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
-				break;
-			case 23:
-				drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal.
-				break;
-			}
-		}
-		break;
-	case r__nottspub: {
-		// Bearing of Avvy from Port.
-		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(5);
-		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-			direction = 2; // Middle.
-		else if ((angle >= 45) && (angle <= 180))
-			direction = 6; // Left.
-		else if ((angle >= 181) && (angle <= 314))
-			direction = 8; // Right.
-
-		if ((_vm->_gyro->_roomTime % 60) > 57)
-			direction--; // Blinks.
-
-		if (direction != _vm->_gyro->_npcFacing) { // Port.
-			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_npcFacing = direction;
-		}
-
-		switch (_vm->_gyro->_roomTime % 50) {
-		case 45 :
-			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
-			break;
-		case 49 :
-			drawBackgroundSprite(-1, -1, 10);
-			break;
-		}
-		break;
-	  }
-	case r__ducks: {
-		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3);
-
-		// Bearing of Avvy from Duck.
-		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(2);
-		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-			direction = 4; // Middle.
-		else if ((angle >= 45) && (angle <= 180))
-			direction = 6; // Left.
-		else if ((angle >= 181) && (angle <= 314))
-			direction = 8; // Right.
-
-		if ((_vm->_gyro->_roomTime % 45) > 42)
-			direction++; // Duck blinks.
-
-		if (direction != _vm->_gyro->_npcFacing) { // Duck.
-			drawBackgroundSprite(-1, -1, direction);
-			_vm->_gyro->_npcFacing = direction;
-		}
-		break;
-	   }
-	}
-
-	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
-		// They're ringing the bells.
-		switch (_vm->_gyro->_roomTime % 4) {
-		case 1:
-			if (_vm->_gyro->_nextBell < 5)
-				_vm->_gyro->_nextBell = 12;
-			_vm->_gyro->_nextBell--;
-			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]);
-			break;
-		case 2:
-			//nosound();
-			updateBackgroundSprites();
-			break;
-		}
-	}
-}
-
-void Celer::loadBackgroundSprites(byte number) {
-	Common::File f;
-	_filename = _filename.format("chunk%d.avd", number);
-	if (!f.open(_filename))
-		return; // We skip because some rooms don't have sprites in the background.
-
-	f.seek(44);
-	_spriteNum = f.readByte();
-	for (byte i = 0; i < _spriteNum; i++)
-		_offsets[i] = f.readSint32LE();
-
-	for (byte i = 0; i < _spriteNum; i++) {
-		f.seek(_offsets[i]);
-
-		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
-		sprite._x = f.readSint16LE();
-		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
-		sprite._size = f.readSint32LE();
-		bool natural = f.readByte();
-		bool memorize = f.readByte();
-
-		if (memorize) {
-			_sprites[i]._x = sprite._x;
-			_sprites[i]._xl = sprite._xl;
-			_sprites[i]._y = sprite._y;
-			_sprites[i]._yl = sprite._yl;
-			_sprites[i]._type = sprite._type;
-
-			if (natural) {
-				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
-				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
-				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
-
-				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
-					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
-						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
-				}
-			} else {
-				_sprites[i]._size = sprite._size;
-				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
-			}
-		} else
-			_sprites[i]._x = kOnDisk;
-	}
-	f.close();
-}
-
-void Celer::forgetBackgroundSprites() {
-	for (byte i = 0; i < _spriteNum; i++) {
-		if (_sprites[i]._x > kOnDisk)
-			_sprites[i]._picture.free();
-	}
-}
-
-void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
-	which--; // For the difference between the Pascal and C array indexes.
-	//setactivepage(3);
-	warning("STUB: Celer::show_one()");
-
-	if (_sprites[which]._x > kOnDisk) {
-		if (destX < 0) {
-			destX = _sprites[which]._x * 8;
-			destY = _sprites[which]._y;
-		}
-		drawSprite(destX, destY, _sprites[which]);
-	} else {
-		Common::File f;
-		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
-			error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
-
-		f.seek(_offsets[which]);
-
-		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
-		sprite._x = f.readSint16LE();
-		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
-		sprite._size = f.readSint32LE();
-		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
-		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
-
-		if (destX < 0) {
-			destX = sprite._x * 8;
-			destY = sprite._y;
-		}
-		drawSprite(destX, destY, sprite);
-
-		sprite._picture.free();
-		f.close();
-	}
-
-	//setactivepage(1 - cp);
-	warning("STUB: Celer::show_one()");
-}
-
-
-
-void Celer::drawSprite(int16 x, int16 y, SpriteType &sprite) {
-	_r._x1 = x;
-	_r._y1 = y;
-	_r._y2 = y + sprite._yl;
-
-	switch (sprite._type) {
-	case kNaturalImage: // Allow fallthrough on purpose.
-	case kBgi:
-		_r._x2 = x + sprite._xl + 1;
-		break;
-	case kEga:
-		_r._x2 = x + sprite._xl;
-		break;
-	}
-
-	// These pictures are practically parts of the background. -10 is for the drop-down menu.
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h
deleted file mode 100644
index 47a11bf..0000000
--- a/engines/avalanche/celer2.h
+++ /dev/null
@@ -1,81 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CELER	The unit for updating the screen pics. */
-
-#ifndef AVALANCHE_CELER2_H
-#define AVALANCHE_CELER2_H
-
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "common/str.h"
-
-#include "graphics/surface.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Celer {
-public:
-	Celer(AvalancheEngine *vm);
-	~Celer();
-
-	void updateBackgroundSprites();
-	void loadBackgroundSprites(byte number);
-	void forgetBackgroundSprites();
-
-	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
-	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
-	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
-	void drawBackgroundSprite(int16 destX, int16 destY, byte which);
-
-private:
-	enum PictureType {kEga, kBgi, kNaturalImage};
-
-	struct SpriteType {
-		PictureType _type;
-		int16 _x, _y;
-		int16 _xl, _yl;
-		int32 _size;
-		::Graphics::Surface _picture;
-	};
-
-	AvalancheEngine *_vm;
-
-	int32 _offsets[40];
-	byte _spriteNum;
-	SpriteType _sprites[40];
-	ByteField _r;
-	Common::String _filename;
-	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
-
-	void drawSprite(int16 x, int16 y, SpriteType &sprite);
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_CELER2_H
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
new file mode 100644
index 0000000..df53bc3
--- /dev/null
+++ b/engines/avalanche/closing.cpp
@@ -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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CLOSING		The closing screen and error handler. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/closing.h"
+#include "avalanche/gyro.h"
+#include "avalanche/lucerna.h"
+
+#include "common/textconsole.h"
+#include "common/random.h"
+
+
+
+namespace Avalanche {
+
+Closing::Closing(AvalancheEngine *vm) {
+	_vm = vm;
+	warning("STUB: Closing::Closing()");
+}
+
+void Closing::getScreen(ScreenType which) {
+	warning("STUB: Closing::getScreen()");
+}
+
+void Closing::showScreen() {
+	warning("STUB: Closing::showScreen()");
+}
+
+void Closing::putIn(Common::String str, uint16 where) {
+	warning("STUB: Closing::putIn()");
+}
+
+void Closing::exitGame() {
+	const Common::String nouns[12] = {
+		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
+		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
+	};
+
+	const Common::String verbs[12] = {
+		"haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
+		"ignore", "stare at", "shriek at", "frighten", "quieten"
+	};
+
+	Common::String result;
+
+	//nosound();
+	warning("STUB: Closing::exitGame()");
+
+	getScreen(kScreenNagScreen);
+	result = nouns[_vm->_rnd->getRandomNumber(12)] + " will " + verbs[_vm->_rnd->getRandomNumber(12)] + " you";
+	putIn(result, 1628);
+	showScreen(); // No halt- it's already set up.
+}
+
+// CHECKME: Useless?
+// void Closing::handleBug() {
+//	warning("STUB: Closing::handleBug()");
+//}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
new file mode 100644
index 0000000..a2543fd
--- /dev/null
+++ b/engines/avalanche/closing.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CLOSING		The closing screen and error handler. */
+
+#ifndef AVALANCHE_CLOSING2_H
+#define AVALANCHE_CLOSING2_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Closing {
+public:
+	Closing(AvalancheEngine *vm);
+	void exitGame();
+
+private:
+// CHECKME: Useless values?
+	enum ScreenType {
+//		kScreenBugAlert = 1,
+//		kScreenRamCram = 2,
+//		kScreenTwoCopies = 5,
+		kScreenNagScreen = 3
+	};
+
+	AvalancheEngine *_vm;
+
+	void getScreen(ScreenType which);
+	void showScreen();
+	void putIn(Common::String str, uint16 where);
+
+	// CHECKME: Unused?
+	// Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
+	// Common::File f;
+	// void handleBug();
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_CLOSING2_H
diff --git a/engines/avalanche/closing2.cpp b/engines/avalanche/closing2.cpp
deleted file mode 100644
index 7da630b..0000000
--- a/engines/avalanche/closing2.cpp
+++ /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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CLOSING		The closing screen and error handler. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/closing2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/lucerna2.h"
-
-#include "common/textconsole.h"
-#include "common/random.h"
-
-
-
-namespace Avalanche {
-
-Closing::Closing(AvalancheEngine *vm) {
-	_vm = vm;
-	warning("STUB: Closing::Closing()");
-}
-
-void Closing::getScreen(ScreenType which) {
-	warning("STUB: Closing::getScreen()");
-}
-
-void Closing::showScreen() {
-	warning("STUB: Closing::showScreen()");
-}
-
-void Closing::putIn(Common::String str, uint16 where) {
-	warning("STUB: Closing::putIn()");
-}
-
-void Closing::exitGame() {
-	const Common::String nouns[12] = {
-		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
-		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
-	};
-
-	const Common::String verbs[12] = {
-		"haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
-		"ignore", "stare at", "shriek at", "frighten", "quieten"
-	};
-
-	Common::String result;
-
-	//nosound();
-	warning("STUB: Closing::exitGame()");
-
-	getScreen(kScreenNagScreen);
-	result = nouns[_vm->_rnd->getRandomNumber(12)] + " will " + verbs[_vm->_rnd->getRandomNumber(12)] + " you";
-	putIn(result, 1628);
-	showScreen(); // No halt- it's already set up.
-}
-
-// CHECKME: Useless?
-// void Closing::handleBug() {
-//	warning("STUB: Closing::handleBug()");
-//}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/closing2.h b/engines/avalanche/closing2.h
deleted file mode 100644
index a2543fd..0000000
--- a/engines/avalanche/closing2.h
+++ /dev/null
@@ -1,67 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CLOSING		The closing screen and error handler. */
-
-#ifndef AVALANCHE_CLOSING2_H
-#define AVALANCHE_CLOSING2_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Closing {
-public:
-	Closing(AvalancheEngine *vm);
-	void exitGame();
-
-private:
-// CHECKME: Useless values?
-	enum ScreenType {
-//		kScreenBugAlert = 1,
-//		kScreenRamCram = 2,
-//		kScreenTwoCopies = 5,
-		kScreenNagScreen = 3
-	};
-
-	AvalancheEngine *_vm;
-
-	void getScreen(ScreenType which);
-	void showScreen();
-	void putIn(Common::String str, uint16 where);
-
-	// CHECKME: Unused?
-	// Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
-	// Common::File f;
-	// void handleBug();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_CLOSING2_H
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
new file mode 100644
index 0000000..2e070e6
--- /dev/null
+++ b/engines/avalanche/dropdown.cpp
@@ -0,0 +1,816 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+ /* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/dropdown.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/gyro.h"
+#include "avalanche/acci.h"
+#include "avalanche/animation.h"
+#include "avalanche/enid.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+void HeadType::init(char trig, char altTrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr) {
+	_trigger = trig;
+	_altTrigger = altTrig;
+	_title = title;
+	_position = pos;
+	_xpos = _position * _dr->kSpacing + _dr->kIndent;
+	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
+	_setupFunc = setupFunc;
+	_chooseFunc = chooseFunc;
+
+	_dr = dr;
+}
+
+void HeadType::draw() {
+	CursorMan.showMouse(false);
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
+	CursorMan.showMouse(true);
+}
+
+void HeadType::highlight() {
+	CursorMan.showMouse(false);
+
+	//nosound();
+	//setactivepage(cp);
+	warning("STUB: Dropdown::headytpe::highlight()");
+
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
+
+	_dr->_activeMenuItem._left = _xpos;
+	_dr->_activeMenuItem._activeNow = true;
+	_dr->_vm->_gyro->_dropdownActive = true;
+	_dr->_activeMenuItem._activeNum = _position;
+
+	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
+}
+
+bool HeadType::parseAltTrigger(char key) {
+	if (key != _altTrigger)
+		return true;
+	return false;
+}
+
+
+
+void MenuItem::init(Dropdown *dr) {
+	_dr = dr;
+	_activeNow = false;
+	_dr->_vm->_gyro->_dropdownActive = false;
+	_activeNum = 1;
+}
+
+void MenuItem::reset() {
+	_optionNum = 0;
+	_width = 0;
+	_firstlix = false;
+	_oldY = 0;
+	_highlightNum = 0;
+}
+
+void MenuItem::setupOption(Common::String title, char trigger, Common::String shortcut, bool valid) {
+	uint16 width = (title + shortcut).size() + 3;
+	if (_width < width)
+		_width = width;
+
+	_options[_optionNum]._title = title;
+	_options[_optionNum]._trigger = trigger;
+	_options[_optionNum]._shortcut = shortcut;
+	_options[_optionNum]._valid = valid;
+	_optionNum++;
+}
+
+void MenuItem::displayOption(byte y, bool highlit) {
+	byte backgroundColor;
+	if (highlit)
+		backgroundColor = 0;
+	else
+		backgroundColor = 7;
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
+
+	Common::String text = _options[y]._title;
+	while (text.size() + _options[y]._shortcut.size() < _width)
+		text += ' '; // Pad _options[y] with spaces.
+	text += _options[y]._shortcut;
+
+	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
+}
+
+void MenuItem::display() {
+	CursorMan.showMouse(false);
+	//setactivepage(cp);
+	//setvisualpage(cp);
+	//setfillstyle(1, menu_b);
+	//setcolor(menu_border);
+	_firstlix = true;
+	_flx1 = _left - 2;
+	_flx2 = _left + _width;
+	fly = 15 + _optionNum * 10;
+	_activeNow = true;
+	_dr->_vm->_gyro->_dropdownActive = true;
+
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, fly), _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
+
+	displayOption(0, true);
+	for (byte y = 1; y < _optionNum; y++)
+		displayOption(y, false);
+
+	_dr->_vm->_gyro->_defaultLed = 1;
+	_dr->_vm->_gyro->_currentMouse = 177;
+	//mousepage(cp);
+	CursorMan.showMouse(true); // 4 = fletch
+}
+
+void MenuItem::wipe() {
+	//setactivepage(cp);
+	CursorMan.showMouse(false);
+
+	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
+
+	_activeNow = false;
+	_dr->_vm->_gyro->_dropdownActive = false;
+	_firstlix = false;
+	_dr->_vm->_gyro->_defaultLed = 2;
+
+	CursorMan.showMouse(true);
+}
+
+void MenuItem::moveHighlight(int8 inc) {
+	if (inc != 0) {
+		int8 highlightNum = _highlightNum + inc;
+		if ((highlightNum < 0) || (highlightNum >= _optionNum))
+			return;
+		_highlightNum = highlightNum;
+	}
+	//setactivepage(cp);
+	CursorMan.showMouse(false);
+	displayOption(_oldY, false);
+	displayOption(_highlightNum, true);
+	//setactivepage(1 - cp);
+	_oldY = _highlightNum;
+	CursorMan.showMouse(true);
+}
+
+void MenuItem::lightUp(Common::Point cursorPos) {
+	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
+		return;
+	_highlightNum = (cursorPos.y - 26) / 20;
+	if (_highlightNum == _oldY)
+		return;
+	moveHighlight(0);
+}
+
+void MenuItem::select(byte which) {
+	if (!_options[which]._valid)
+		return;
+
+	_choiceNum = which;
+	wipe();
+
+	if (_choiceNum == _optionNum)
+		_choiceNum--; // Off the bottom.
+	if (_choiceNum > _optionNum)
+		_choiceNum = 0; // Off the top, I suppose.
+
+	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
+}
+
+void MenuItem::parseKey(char c) {
+	c = toupper(c);
+	bool found = false;
+	for (byte i = 0; i < _optionNum; i++) {
+		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
+			select(i);
+			found = true;
+		}
+	}
+	if (!found)
+		_dr->_vm->_gyro->blip();
+}
+
+void MenuBar::init(Dropdown *dr) {
+	_dr = dr;
+	_menuNum = 0;
+}
+
+void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc) {
+	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
+	_menuNum++;
+}
+
+void MenuBar::draw() {
+	//setactivepage(3);
+
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
+
+	byte savecp = _dr->_vm->_gyro->_cp;
+	_dr->_vm->_gyro->_cp = 3;
+
+	for (byte i = 0; i < _menuNum; i++)
+		_menuItems[i].draw();
+
+	_dr->_vm->_gyro->_cp = savecp;
+}
+
+void MenuBar::parseAltTrigger(char c) {
+	byte i = 0;
+	while ((i < _menuNum) && (_menuItems[i].parseAltTrigger(c)))
+		i++;
+	if (i == _menuNum)
+		return;
+	setupMenuItem(i);
+}
+
+void MenuBar::setupMenuItem(byte which) {
+	if (_dr->_activeMenuItem._activeNow) {
+		_dr->_activeMenuItem.wipe(); // Get rid of menu.
+		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
+			return; // Clicked on own highlight.
+	}
+	_menuItems[which].highlight();
+	(_dr->*_menuItems[which]._setupFunc)();
+}
+
+void MenuBar::chooseMenuItem(int16 x) {
+	byte i = 0;
+	do {
+		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
+			setupMenuItem(i);
+			return;
+		}
+		i++;
+	} while (i < _menuNum);
+}
+
+Dropdown::Dropdown(AvalancheEngine *vm) {
+	_vm = vm;
+	_activeMenuItem.init(this);
+	_menuBar.init(this);
+}
+
+void Dropdown::findWhatYouCanDoWithIt() {
+	switch (_vm->_gyro->_thinks) {
+	case Gyro::kObjectWine:
+	case Gyro::kObjectPotion:
+	case Gyro::kObjectInk:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
+		break;
+	case Gyro::kObjectBell:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
+		break;
+	case Gyro::kObjectChastity:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		break;
+	case Gyro::kObjectLute:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
+		break;
+	case Gyro::kObjectMushroom:
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
+		break;
+	case Gyro::kObjectClothes:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		break;
+	default:
+		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
+	}
+}
+
+void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
+	byte fontColor;
+	byte backgroundColor;
+	if (highlighted) {
+		fontColor = kColorWhite;
+		backgroundColor = kColorBlack;
+	} else {
+		fontColor = kColorBlack;
+		backgroundColor = kColorLightgray;
+	}
+
+	byte ander;
+	if (valid)
+		ander = 255;
+	else
+		ander = 170;
+
+	FontType font;
+	for (byte i = 0; i < text.size(); i++) {
+		for (byte j = 0; j < 8; j++) {
+			byte idx = text[i];
+			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
+			// And set the background of the text to the desired color.
+			for (byte k = 0; k < 8; k++)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
+		}
+	}
+
+	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
+
+	// Underline the selected character.
+	if (!text.contains(trigger))
+		return;
+	else {
+		byte i;
+		for (i = 0; text[i] != trigger; i++)
+			; // Search for the character in the string.
+
+		byte pixel = ander;
+		for (byte bit = 0; bit < 8; bit++) {
+			byte pixelBit = (pixel >> bit) & 1;
+			if (pixelBit)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
+		}
+	}
+
+	_vm->_graphics->refreshScreen();
+}
+
+void Dropdown::bleep() {
+	warning("STUB: Dropdown::bleep()");
+}
+
+void Dropdown::parseKey(char r, char re) {
+	//switch (r) {
+	//case 0:
+	//case 224: {
+	//	switch (re) {
+	//	case 'K':
+	//		if (_activeMenuItem._activeNum > 1)  {
+	//			_activeMenuItem.wipe();
+	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum - 1);
+	//		} else {
+	//			// Get menu on the left-hand side.
+	//			_activeMenuItem.wipe();
+	//			_menuBar.chooseMenuItem((_menuBar._menuNum - 1) * kSpacing + kIndent);
+	//		}
+	//		break;
+	//	case 'M':
+	//		if (_activeMenuItem._activeNum < _menuBar._menuNum)  {
+	//			_activeMenuItem.wipe();
+	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum + 1);
+	//		} else {
+	//			// Get menu on the far right-hand side.
+	//			_activeMenuItem.wipe();
+	//			_menuBar.chooseMenuItem(kIndent);
+	//		}
+	//		break;
+	//	case 'H':
+	//		_activeMenuItem.moveHighlight(-1);
+	//		break;
+	//	case 'P':
+	//		_activeMenuItem.moveHighlight(1);
+	//		break;
+	//	default:
+	//		_menuBar.parseAltTrigger(re);
+	//	}
+	//}
+	//break;
+	//case 13:
+	//	_activeMenuItem.select(_activeMenuItem._highlightNum);
+	//	break;
+	//default: {
+	//	if (_activeMenuItem._activeNow)
+	//		_activeMenuItem.parseKey(r);
+	//	}
+	//}
+	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
+}
+
+Common::String Dropdown::selectGender(byte x) {
+	if (x < 175)
+		return "im";
+	else
+		return "er";
+}
+
+void Dropdown::setupMenuGame() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
+	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
+	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
+	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
+	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
+	_activeMenuItem.display();
+}
+
+void Dropdown::setupMenuFile() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("New game", 'N', "f4", true);
+	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
+	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
+	_activeMenuItem.display();
+}
+
+void Dropdown::setupMenuAction() {
+	_activeMenuItem.reset();
+
+	Common::String f5Does = _vm->_gyro->f5Does();
+	for (byte i = 0; i < 2; i++)
+		if (!f5Does.empty())
+			f5Does.deleteChar(0);
+	if (f5Does.empty())
+		_activeMenuItem.setupOption("Do something", 'D', "f5", false);
+	else
+		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
+	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
+	if (_vm->_gyro->_room == 99)
+		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
+	else
+		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
+	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
+	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
+	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
+		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
+	else
+		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
+
+	_activeMenuItem.display();
+}
+
+void Dropdown::setupMenuPeople() {
+	if (!people.empty())
+		people.clear();
+
+	_activeMenuItem.reset();
+
+	for (byte i = 150; i <= 178; i++)
+		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
+			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
+			people = people + i;
+		}
+
+	_activeMenuItem.display();
+}
+
+void Dropdown::setupMenuObjects() {
+	_activeMenuItem.reset();
+	for (byte i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_objects[i])
+			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
+	}
+	_activeMenuItem.display();
+}
+
+void Dropdown::setupMenuWith() {
+	_activeMenuItem.reset();
+
+	if (_vm->_gyro->_thinkThing) {
+		findWhatYouCanDoWithIt();
+
+		for (byte i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
+			char vbchar;
+			Common::String verb;
+
+			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
+			_activeMenuItem.setupOption(verb, vbchar, "", true);
+		}
+
+		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
+		// or (c), the _person you've selected is YOU!
+
+		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
+			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
+			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
+		else {
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
+		}
+	} else {
+		_activeMenuItem.setupOption("Examine", 'x', "", true);
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
+		switch (_vm->_gyro->_thinks) {
+		case Gyro::kPeopleGeida:
+		case Gyro::kPeopleArkata: {
+			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
+		}
+		break;
+		case Gyro::kPeopleDogfood: {
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
+		}
+		break;
+		case Gyro::kPeopleMalagauche: {
+			bool isSober = !_vm->_gyro->_teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
+			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
+			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
+			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
+			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
+		}
+		break;
+		case Gyro::kPeopleTrader: {
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
+		}
+		break;
+		}
+	}
+	_activeMenuItem.display();
+}
+
+void Dropdown::runMenuGame() {
+	// Help, boss, untrash screen.
+	switch (_activeMenuItem._choiceNum) {
+	case 0:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
+		break;
+	case 1:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
+		break;
+	case 2:
+		_vm->_lucerna->majorRedraw();
+		break;
+	case 3:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
+		break;
+	case 4:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
+		break;
+	}
+}
+
+void Dropdown::runMenuFile() {
+	// New game, load, save, save as, DOS shell, about, quit.
+	switch (_activeMenuItem._choiceNum) {
+	case 0:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
+		break;
+	case 1: {
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
+	}
+	break;
+	case 2: {
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
+	}
+	break;
+	case 3:
+		//_vm->_basher->filename_edit();
+		warning("STUB: Dropdown::runMenuFile()");
+		break;
+	case 4:
+		_vm->_enid->backToBootstrap(2);
+		break;
+	case 5:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
+		break;
+	}
+}
+
+void Dropdown::runMenuAction() {
+	Common::String f5Does;
+	// Get up, pause game, open door, look, inventory, walk/run.
+	switch (_activeMenuItem._choiceNum) {
+	case 0: {
+		_vm->_acci->_person = _vm->_acci->kPardon;
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		f5Does = _vm->_gyro->f5Does();
+		_vm->_lucerna->callVerb(f5Does[0]);
+	}
+	break;
+	case 1:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
+		break;
+	case 2:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
+		break;
+	case 3:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
+		break;
+	case 4:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
+		break;
+	case 5: {
+		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		if (avvy->_speedX == _vm->_gyro->kWalk)
+			avvy->_speedX = _vm->_gyro->kRun;
+		else
+			avvy->_speedX = _vm->_gyro->kWalk;
+		_vm->_animation->updateSpeed();
+	}
+	break;
+	}
+}
+
+void Dropdown::runMenuObjects() {
+	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing);
+}
+
+void Dropdown::runMenuPeople() {
+	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
+	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
+}
+
+void Dropdown::runMenuWith() {
+	_vm->_acci->_thing = _vm->_gyro->_thinks;
+
+	if (_vm->_gyro->_thinkThing) {
+
+		_vm->_acci->_thing += 49;
+
+		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
+			_vm->_acci->_person = _vm->_gyro->_lastPerson;
+		else
+			_vm->_acci->_person = 254;
+
+	} else {
+		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
+		case 100: { // Beer
+			_vm->_acci->_thing = 100;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		case 101: { // Wine
+			_vm->_acci->_thing = 50;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		case 102: { // Whisky
+			_vm->_acci->_thing = 102;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		case 103: { // Cider
+			_vm->_acci->_thing = 103;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		case 104: { // Mead
+			_vm->_acci->_thing = 107;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		case 105: { // Onion (trader)
+			_vm->_acci->_thing = 67;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		}
+		break;
+		default: {
+			_vm->_acci->_person = _vm->_acci->_thing;
+			_vm->_acci->_thing = 254;
+			_vm->_gyro->_subjectNum = 0;
+		}
+		}
+	}
+	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
+}
+
+void Dropdown::setupMenu() {
+	_menuBar.init(this);
+	_activeMenuItem.init(this);
+
+	_menuBar.createMenuItem('F', "File", '!', &Avalanche::Dropdown::setupMenuFile, &Avalanche::Dropdown::runMenuFile);
+	_menuBar.createMenuItem('G', "Game", 34, &Avalanche::Dropdown::setupMenuGame, &Avalanche::Dropdown::runMenuGame);
+	_menuBar.createMenuItem('A', "Action", 30, &Avalanche::Dropdown::setupMenuAction, &Avalanche::Dropdown::runMenuAction);
+	_menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Dropdown::setupMenuObjects, &Avalanche::Dropdown::runMenuObjects);
+	_menuBar.createMenuItem('P', "People", 25, &Avalanche::Dropdown::setupMenuPeople, &Avalanche::Dropdown::runMenuPeople);
+	_menuBar.createMenuItem('W', "With", 17, &Avalanche::Dropdown::setupMenuWith, &Avalanche::Dropdown::runMenuWith);
+
+	_menuBar.draw();
+}
+
+void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
+	Common::Point cursorPos = _vm->getMousePos();
+	::Graphics::Surface backup;
+	backup.copyFrom(_vm->_graphics->_surface);
+
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
+		_menuBar.chooseMenuItem(cursorPos.x);
+		do
+			_vm->updateEvents();
+		while (_vm->_lucerna->_holdLeftMouse);
+
+
+		while (!_vm->shouldQuit()) {
+			do {
+				_vm->updateEvents();
+
+				// We updadte the cursor's picture.
+				cursorPos = _vm->getMousePos();
+				// Change arrow...
+				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+					_vm->_gyro->newMouse(1); // Up arrow
+				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
+					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem.fly * 2 + 1))
+						_vm->_gyro->newMouse(3); // Right-arrow
+					else
+						_vm->_gyro->newMouse(4); // Fletch
+				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+					_vm->_gyro->newMouse(2); // Screwdriver
+
+				_activeMenuItem.lightUp(cursorPos);
+
+				_vm->_graphics->refreshScreen();
+			} while (!_vm->_lucerna->_holdLeftMouse);
+
+			if (_vm->_lucerna->_holdLeftMouse) {
+				if (cursorPos.y > 21) {
+					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1))))) {
+							// Clicked OUTSIDE the menu.
+							if (_activeMenuItem._activeNow) {
+								_activeMenuItem.wipe();
+								_vm->_lucerna->_holdLeftMouse = false;
+								backup.free();
+								return;
+							} // No "else"- clicking on menu has no effect (only releasing).
+						}
+				} else {
+					// Clicked on menu bar.
+					if (_activeMenuItem._activeNow) {
+						_activeMenuItem.wipe();
+						_vm->_graphics->_surface.copyFrom(backup);
+						_vm->_graphics->refreshScreen();
+
+						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
+							// If we clicked on the same menu item (the one that is already active) on the bar...
+							_vm->_lucerna->_holdLeftMouse = false;
+							backup.free();
+							return;
+						} else {
+							_vm->_lucerna->_holdLeftMouse = true;
+							break;
+						}
+					}
+				}
+
+				// NOT clicked button...
+				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) {
+
+						// We act only if the button is released over a menu item.
+						while (!_vm->shouldQuit()) {
+							cursorPos = _vm->getMousePos();
+							_activeMenuItem.lightUp(cursorPos);
+							_vm->_graphics->refreshScreen();
+
+							_vm->updateEvents();
+							if (!_vm->_lucerna->_holdLeftMouse)
+								break;
+						}
+
+						uint16 which = (cursorPos.y - 26) / 20;
+						_activeMenuItem.select(which);
+						if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
+							backup.free();
+							return;
+						}
+				}
+			}
+
+		}
+	}
+
+	backup.free();
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
new file mode 100644
index 0000000..95e258e
--- /dev/null
+++ b/engines/avalanche/dropdown.h
@@ -0,0 +1,167 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#ifndef AVALANCHE_DROPDOWN2_H
+#define AVALANCHE_DROPDOWN2_H
+
+#include "avalanche/color.h"
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Dropdown;
+
+typedef void (Dropdown::*DropdownFunc)();
+
+class HeadType {
+public:
+	Common::String _title;
+	char _trigger, _altTrigger;
+	byte _position;
+	int16 _xpos, _xright;
+	DropdownFunc _setupFunc, _chooseFunc;
+
+	void init(char trig, char alTtrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr);
+	void draw();
+	void highlight();
+	bool parseAltTrigger(char key);
+
+private:
+	Dropdown *_dr;
+};
+
+struct OptionType {
+	Common::String _title;
+	byte _trigger;
+	Common::String _shortcut;
+	bool _valid;
+};
+
+class MenuItem {
+public:
+	OptionType _options[12];
+	byte _optionNum;
+	uint16 _width, _left;
+	bool _firstlix;
+	int16 _flx1, _flx2, fly;
+	byte _oldY; // used by lightUp */
+	bool _activeNow; // Is there an active option now?
+	byte _activeNum; // And if so, which is it?
+	byte _choiceNum; // Your choice?
+	byte _highlightNum;
+
+	void init(Dropdown *dr);
+	void reset();
+	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
+	void display();
+	void wipe();
+	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
+	void displayOption(byte y, bool highlit);
+	void moveHighlight(int8 inc);
+	void select(byte which); // Choose which one you want.
+	void parseKey(char c);
+
+private:
+	Dropdown *_dr;
+};
+
+class MenuBar {
+public:
+	HeadType _menuItems[8];
+	byte _menuNum;
+
+	void init(Dropdown *dr);
+	void createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc);
+	void draw();
+	void parseAltTrigger(char c);
+	void setupMenuItem(byte which);
+	void chooseMenuItem(int16 x);
+
+private:
+	Dropdown *_dr;
+};
+
+class Dropdown {
+public:
+	friend class HeadType;
+	friend class MenuItem;
+	friend class MenuBar;
+
+	MenuItem _activeMenuItem;
+	MenuBar _menuBar;
+
+	Common::String people;
+
+	Dropdown(AvalancheEngine *vm);
+
+	void parseKey(char r, char re);
+	void updateMenu();
+	void setupMenu(); // Standard menu bar.
+
+private:
+	static const byte kIndent = 5;
+	static const byte kSpacing = 10;
+
+	static const byte kMenuBackgroundColor = kColorLightgray;
+	static const byte kMenuFontColor = kColorBlack;
+	static const byte kMenuBorderColor = kColorBlack;
+	static const byte kHighlightBackgroundColor = kColorBlack;
+	static const byte kHighlightFontColor = kColorWhite;
+	static const byte kDisabledColor = kColorDarkgray;
+
+	AvalancheEngine *_vm;
+
+	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
+	void findWhatYouCanDoWithIt();
+	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
+	void bleep();
+
+	void setupMenuGame();
+	void setupMenuFile();
+	void setupMenuAction();
+	void setupMenuPeople();
+	void setupMenuObjects();
+	void setupMenuWith();
+
+	void runMenuGame();
+	void runMenuFile();
+	void runMenuAction();
+	void runMenuObjects();
+	void runMenuPeople();
+	void runMenuWith();
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_DROPDOWN2_H
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
deleted file mode 100644
index 1f499a2..0000000
--- a/engines/avalanche/dropdown2.cpp
+++ /dev/null
@@ -1,816 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
- /* DROPDOWN	A customised version of Oopmenu (qv). */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/dropdown2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/gyro2.h"
-#include "avalanche/acci2.h"
-#include "avalanche/animation.h"
-#include "avalanche/enid2.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-void HeadType::init(char trig, char altTrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr) {
-	_trigger = trig;
-	_altTrigger = altTrig;
-	_title = title;
-	_position = pos;
-	_xpos = _position * _dr->kSpacing + _dr->kIndent;
-	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
-	_setupFunc = setupFunc;
-	_chooseFunc = chooseFunc;
-
-	_dr = dr;
-}
-
-void HeadType::draw() {
-	CursorMan.showMouse(false);
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
-	CursorMan.showMouse(true);
-}
-
-void HeadType::highlight() {
-	CursorMan.showMouse(false);
-
-	//nosound();
-	//setactivepage(cp);
-	warning("STUB: Dropdown::headytpe::highlight()");
-
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
-
-	_dr->_activeMenuItem._left = _xpos;
-	_dr->_activeMenuItem._activeNow = true;
-	_dr->_vm->_gyro->_dropdownActive = true;
-	_dr->_activeMenuItem._activeNum = _position;
-
-	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
-}
-
-bool HeadType::parseAltTrigger(char key) {
-	if (key != _altTrigger)
-		return true;
-	return false;
-}
-
-
-
-void MenuItem::init(Dropdown *dr) {
-	_dr = dr;
-	_activeNow = false;
-	_dr->_vm->_gyro->_dropdownActive = false;
-	_activeNum = 1;
-}
-
-void MenuItem::reset() {
-	_optionNum = 0;
-	_width = 0;
-	_firstlix = false;
-	_oldY = 0;
-	_highlightNum = 0;
-}
-
-void MenuItem::setupOption(Common::String title, char trigger, Common::String shortcut, bool valid) {
-	uint16 width = (title + shortcut).size() + 3;
-	if (_width < width)
-		_width = width;
-
-	_options[_optionNum]._title = title;
-	_options[_optionNum]._trigger = trigger;
-	_options[_optionNum]._shortcut = shortcut;
-	_options[_optionNum]._valid = valid;
-	_optionNum++;
-}
-
-void MenuItem::displayOption(byte y, bool highlit) {
-	byte backgroundColor;
-	if (highlit)
-		backgroundColor = 0;
-	else
-		backgroundColor = 7;
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
-
-	Common::String text = _options[y]._title;
-	while (text.size() + _options[y]._shortcut.size() < _width)
-		text += ' '; // Pad _options[y] with spaces.
-	text += _options[y]._shortcut;
-
-	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
-}
-
-void MenuItem::display() {
-	CursorMan.showMouse(false);
-	//setactivepage(cp);
-	//setvisualpage(cp);
-	//setfillstyle(1, menu_b);
-	//setcolor(menu_border);
-	_firstlix = true;
-	_flx1 = _left - 2;
-	_flx2 = _left + _width;
-	fly = 15 + _optionNum * 10;
-	_activeNow = true;
-	_dr->_vm->_gyro->_dropdownActive = true;
-
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, fly), _dr->kMenuBackgroundColor);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
-
-	displayOption(0, true);
-	for (byte y = 1; y < _optionNum; y++)
-		displayOption(y, false);
-
-	_dr->_vm->_gyro->_defaultLed = 1;
-	_dr->_vm->_gyro->_currentMouse = 177;
-	//mousepage(cp);
-	CursorMan.showMouse(true); // 4 = fletch
-}
-
-void MenuItem::wipe() {
-	//setactivepage(cp);
-	CursorMan.showMouse(false);
-
-	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
-
-	_activeNow = false;
-	_dr->_vm->_gyro->_dropdownActive = false;
-	_firstlix = false;
-	_dr->_vm->_gyro->_defaultLed = 2;
-
-	CursorMan.showMouse(true);
-}
-
-void MenuItem::moveHighlight(int8 inc) {
-	if (inc != 0) {
-		int8 highlightNum = _highlightNum + inc;
-		if ((highlightNum < 0) || (highlightNum >= _optionNum))
-			return;
-		_highlightNum = highlightNum;
-	}
-	//setactivepage(cp);
-	CursorMan.showMouse(false);
-	displayOption(_oldY, false);
-	displayOption(_highlightNum, true);
-	//setactivepage(1 - cp);
-	_oldY = _highlightNum;
-	CursorMan.showMouse(true);
-}
-
-void MenuItem::lightUp(Common::Point cursorPos) {
-	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
-		return;
-	_highlightNum = (cursorPos.y - 26) / 20;
-	if (_highlightNum == _oldY)
-		return;
-	moveHighlight(0);
-}
-
-void MenuItem::select(byte which) {
-	if (!_options[which]._valid)
-		return;
-
-	_choiceNum = which;
-	wipe();
-
-	if (_choiceNum == _optionNum)
-		_choiceNum--; // Off the bottom.
-	if (_choiceNum > _optionNum)
-		_choiceNum = 0; // Off the top, I suppose.
-
-	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
-}
-
-void MenuItem::parseKey(char c) {
-	c = toupper(c);
-	bool found = false;
-	for (byte i = 0; i < _optionNum; i++) {
-		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
-			select(i);
-			found = true;
-		}
-	}
-	if (!found)
-		_dr->_vm->_gyro->blip();
-}
-
-void MenuBar::init(Dropdown *dr) {
-	_dr = dr;
-	_menuNum = 0;
-}
-
-void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc) {
-	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
-	_menuNum++;
-}
-
-void MenuBar::draw() {
-	//setactivepage(3);
-
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
-
-	byte savecp = _dr->_vm->_gyro->_cp;
-	_dr->_vm->_gyro->_cp = 3;
-
-	for (byte i = 0; i < _menuNum; i++)
-		_menuItems[i].draw();
-
-	_dr->_vm->_gyro->_cp = savecp;
-}
-
-void MenuBar::parseAltTrigger(char c) {
-	byte i = 0;
-	while ((i < _menuNum) && (_menuItems[i].parseAltTrigger(c)))
-		i++;
-	if (i == _menuNum)
-		return;
-	setupMenuItem(i);
-}
-
-void MenuBar::setupMenuItem(byte which) {
-	if (_dr->_activeMenuItem._activeNow) {
-		_dr->_activeMenuItem.wipe(); // Get rid of menu.
-		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
-			return; // Clicked on own highlight.
-	}
-	_menuItems[which].highlight();
-	(_dr->*_menuItems[which]._setupFunc)();
-}
-
-void MenuBar::chooseMenuItem(int16 x) {
-	byte i = 0;
-	do {
-		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
-			setupMenuItem(i);
-			return;
-		}
-		i++;
-	} while (i < _menuNum);
-}
-
-Dropdown::Dropdown(AvalancheEngine *vm) {
-	_vm = vm;
-	_activeMenuItem.init(this);
-	_menuBar.init(this);
-}
-
-void Dropdown::findWhatYouCanDoWithIt() {
-	switch (_vm->_gyro->_thinks) {
-	case Gyro::kObjectWine:
-	case Gyro::kObjectPotion:
-	case Gyro::kObjectInk:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
-		break;
-	case Gyro::kObjectBell:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
-		break;
-	case Gyro::kObjectChastity:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
-		break;
-	case Gyro::kObjectLute:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
-		break;
-	case Gyro::kObjectMushroom:
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
-		break;
-	case Gyro::kObjectClothes:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
-		break;
-	default:
-		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
-	}
-}
-
-void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
-	byte fontColor;
-	byte backgroundColor;
-	if (highlighted) {
-		fontColor = kColorWhite;
-		backgroundColor = kColorBlack;
-	} else {
-		fontColor = kColorBlack;
-		backgroundColor = kColorLightgray;
-	}
-
-	byte ander;
-	if (valid)
-		ander = 255;
-	else
-		ander = 170;
-
-	FontType font;
-	for (byte i = 0; i < text.size(); i++) {
-		for (byte j = 0; j < 8; j++) {
-			byte idx = text[i];
-			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
-			// And set the background of the text to the desired color.
-			for (byte k = 0; k < 8; k++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
-		}
-	}
-
-	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
-
-	// Underline the selected character.
-	if (!text.contains(trigger))
-		return;
-	else {
-		byte i;
-		for (i = 0; text[i] != trigger; i++)
-			; // Search for the character in the string.
-
-		byte pixel = ander;
-		for (byte bit = 0; bit < 8; bit++) {
-			byte pixelBit = (pixel >> bit) & 1;
-			if (pixelBit)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
-		}
-	}
-
-	_vm->_graphics->refreshScreen();
-}
-
-void Dropdown::bleep() {
-	warning("STUB: Dropdown::bleep()");
-}
-
-void Dropdown::parseKey(char r, char re) {
-	//switch (r) {
-	//case 0:
-	//case 224: {
-	//	switch (re) {
-	//	case 'K':
-	//		if (_activeMenuItem._activeNum > 1)  {
-	//			_activeMenuItem.wipe();
-	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum - 1);
-	//		} else {
-	//			// Get menu on the left-hand side.
-	//			_activeMenuItem.wipe();
-	//			_menuBar.chooseMenuItem((_menuBar._menuNum - 1) * kSpacing + kIndent);
-	//		}
-	//		break;
-	//	case 'M':
-	//		if (_activeMenuItem._activeNum < _menuBar._menuNum)  {
-	//			_activeMenuItem.wipe();
-	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum + 1);
-	//		} else {
-	//			// Get menu on the far right-hand side.
-	//			_activeMenuItem.wipe();
-	//			_menuBar.chooseMenuItem(kIndent);
-	//		}
-	//		break;
-	//	case 'H':
-	//		_activeMenuItem.moveHighlight(-1);
-	//		break;
-	//	case 'P':
-	//		_activeMenuItem.moveHighlight(1);
-	//		break;
-	//	default:
-	//		_menuBar.parseAltTrigger(re);
-	//	}
-	//}
-	//break;
-	//case 13:
-	//	_activeMenuItem.select(_activeMenuItem._highlightNum);
-	//	break;
-	//default: {
-	//	if (_activeMenuItem._activeNow)
-	//		_activeMenuItem.parseKey(r);
-	//	}
-	//}
-	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
-}
-
-Common::String Dropdown::selectGender(byte x) {
-	if (x < 175)
-		return "im";
-	else
-		return "er";
-}
-
-void Dropdown::setupMenuGame() {
-	_activeMenuItem.reset();
-	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
-	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
-	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
-	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
-	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuFile() {
-	_activeMenuItem.reset();
-	_activeMenuItem.setupOption("New game", 'N', "f4", true);
-	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
-	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
-	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuAction() {
-	_activeMenuItem.reset();
-
-	Common::String f5Does = _vm->_gyro->f5Does();
-	for (byte i = 0; i < 2; i++)
-		if (!f5Does.empty())
-			f5Does.deleteChar(0);
-	if (f5Does.empty())
-		_activeMenuItem.setupOption("Do something", 'D', "f5", false);
-	else
-		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
-	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->_room == 99)
-		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
-	else
-		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
-	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
-	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
-		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
-	else
-		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
-
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuPeople() {
-	if (!people.empty())
-		people.clear();
-
-	_activeMenuItem.reset();
-
-	for (byte i = 150; i <= 178; i++)
-		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
-			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
-			people = people + i;
-		}
-
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuObjects() {
-	_activeMenuItem.reset();
-	for (byte i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i])
-			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
-	}
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuWith() {
-	_activeMenuItem.reset();
-
-	if (_vm->_gyro->_thinkThing) {
-		findWhatYouCanDoWithIt();
-
-		for (byte i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
-			char vbchar;
-			Common::String verb;
-
-			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
-			_activeMenuItem.setupOption(verb, vbchar, "", true);
-		}
-
-		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
-		// or (c), the _person you've selected is YOU!
-
-		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
-			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
-			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
-		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
-		}
-	} else {
-		_activeMenuItem.setupOption("Examine", 'x', "", true);
-		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
-		switch (_vm->_gyro->_thinks) {
-		case Gyro::kPeopleGeida:
-		case Gyro::kPeopleArkata: {
-			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
-		}
-		break;
-		case Gyro::kPeopleDogfood: {
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
-		}
-		break;
-		case Gyro::kPeopleMalagauche: {
-			bool isSober = !_vm->_gyro->_teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
-			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
-			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
-			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
-			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
-		}
-		break;
-		case Gyro::kPeopleTrader: {
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
-		}
-		break;
-		}
-	}
-	_activeMenuItem.display();
-}
-
-void Dropdown::runMenuGame() {
-	// Help, boss, untrash screen.
-	switch (_activeMenuItem._choiceNum) {
-	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
-		break;
-	case 1:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
-		break;
-	case 2:
-		_vm->_lucerna->majorRedraw();
-		break;
-	case 3:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
-		break;
-	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
-		break;
-	}
-}
-
-void Dropdown::runMenuFile() {
-	// New game, load, save, save as, DOS shell, about, quit.
-	switch (_activeMenuItem._choiceNum) {
-	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
-		break;
-	case 1: {
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
-	}
-	break;
-	case 2: {
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
-	}
-	break;
-	case 3:
-		//_vm->_basher->filename_edit();
-		warning("STUB: Dropdown::runMenuFile()");
-		break;
-	case 4:
-		_vm->_enid->backToBootstrap(2);
-		break;
-	case 5:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
-		break;
-	}
-}
-
-void Dropdown::runMenuAction() {
-	Common::String f5Does;
-	// Get up, pause game, open door, look, inventory, walk/run.
-	switch (_activeMenuItem._choiceNum) {
-	case 0: {
-		_vm->_acci->_person = _vm->_acci->kPardon;
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		f5Does = _vm->_gyro->f5Does();
-		_vm->_lucerna->callVerb(f5Does[0]);
-	}
-	break;
-	case 1:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
-		break;
-	case 2:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
-		break;
-	case 3:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
-		break;
-	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
-		break;
-	case 5: {
-		AnimationType *avvy = &_vm->_animation->_sprites[0];
-		if (avvy->_speedX == _vm->_gyro->kWalk)
-			avvy->_speedX = _vm->_gyro->kRun;
-		else
-			avvy->_speedX = _vm->_gyro->kWalk;
-		_vm->_animation->updateSpeed();
-	}
-	break;
-	}
-}
-
-void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing);
-}
-
-void Dropdown::runMenuPeople() {
-	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
-	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
-}
-
-void Dropdown::runMenuWith() {
-	_vm->_acci->_thing = _vm->_gyro->_thinks;
-
-	if (_vm->_gyro->_thinkThing) {
-
-		_vm->_acci->_thing += 49;
-
-		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
-			_vm->_acci->_person = _vm->_gyro->_lastPerson;
-		else
-			_vm->_acci->_person = 254;
-
-	} else {
-		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
-		case 100: { // Beer
-			_vm->_acci->_thing = 100;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		case 101: { // Wine
-			_vm->_acci->_thing = 50;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		case 102: { // Whisky
-			_vm->_acci->_thing = 102;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		case 103: { // Cider
-			_vm->_acci->_thing = 103;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		case 104: { // Mead
-			_vm->_acci->_thing = 107;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		case 105: { // Onion (trader)
-			_vm->_acci->_thing = 67;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		}
-		break;
-		default: {
-			_vm->_acci->_person = _vm->_acci->_thing;
-			_vm->_acci->_thing = 254;
-			_vm->_gyro->_subjectNum = 0;
-		}
-		}
-	}
-	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
-}
-
-void Dropdown::setupMenu() {
-	_menuBar.init(this);
-	_activeMenuItem.init(this);
-
-	_menuBar.createMenuItem('F', "File", '!', &Avalanche::Dropdown::setupMenuFile, &Avalanche::Dropdown::runMenuFile);
-	_menuBar.createMenuItem('G', "Game", 34, &Avalanche::Dropdown::setupMenuGame, &Avalanche::Dropdown::runMenuGame);
-	_menuBar.createMenuItem('A', "Action", 30, &Avalanche::Dropdown::setupMenuAction, &Avalanche::Dropdown::runMenuAction);
-	_menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Dropdown::setupMenuObjects, &Avalanche::Dropdown::runMenuObjects);
-	_menuBar.createMenuItem('P', "People", 25, &Avalanche::Dropdown::setupMenuPeople, &Avalanche::Dropdown::runMenuPeople);
-	_menuBar.createMenuItem('W', "With", 17, &Avalanche::Dropdown::setupMenuWith, &Avalanche::Dropdown::runMenuWith);
-
-	_menuBar.draw();
-}
-
-void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
-	Common::Point cursorPos = _vm->getMousePos();
-	::Graphics::Surface backup;
-	backup.copyFrom(_vm->_graphics->_surface);
-
-	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
-		_menuBar.chooseMenuItem(cursorPos.x);
-		do
-			_vm->updateEvents();
-		while (_vm->_lucerna->_holdLeftMouse);
-
-
-		while (!_vm->shouldQuit()) {
-			do {
-				_vm->updateEvents();
-
-				// We updadte the cursor's picture.
-				cursorPos = _vm->getMousePos();
-				// Change arrow...
-				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_gyro->newMouse(1); // Up arrow
-				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
-					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem.fly * 2 + 1))
-						_vm->_gyro->newMouse(3); // Right-arrow
-					else
-						_vm->_gyro->newMouse(4); // Fletch
-				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_gyro->newMouse(2); // Screwdriver
-
-				_activeMenuItem.lightUp(cursorPos);
-
-				_vm->_graphics->refreshScreen();
-			} while (!_vm->_lucerna->_holdLeftMouse);
-
-			if (_vm->_lucerna->_holdLeftMouse) {
-				if (cursorPos.y > 21) {
-					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1))))) {
-							// Clicked OUTSIDE the menu.
-							if (_activeMenuItem._activeNow) {
-								_activeMenuItem.wipe();
-								_vm->_lucerna->_holdLeftMouse = false;
-								backup.free();
-								return;
-							} // No "else"- clicking on menu has no effect (only releasing).
-						}
-				} else {
-					// Clicked on menu bar.
-					if (_activeMenuItem._activeNow) {
-						_activeMenuItem.wipe();
-						_vm->_graphics->_surface.copyFrom(backup);
-						_vm->_graphics->refreshScreen();
-
-						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
-							// If we clicked on the same menu item (the one that is already active) on the bar...
-							_vm->_lucerna->_holdLeftMouse = false;
-							backup.free();
-							return;
-						} else {
-							_vm->_lucerna->_holdLeftMouse = true;
-							break;
-						}
-					}
-				}
-
-				// NOT clicked button...
-				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) {
-
-						// We act only if the button is released over a menu item.
-						while (!_vm->shouldQuit()) {
-							cursorPos = _vm->getMousePos();
-							_activeMenuItem.lightUp(cursorPos);
-							_vm->_graphics->refreshScreen();
-
-							_vm->updateEvents();
-							if (!_vm->_lucerna->_holdLeftMouse)
-								break;
-						}
-
-						uint16 which = (cursorPos.y - 26) / 20;
-						_activeMenuItem.select(which);
-						if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
-							backup.free();
-							return;
-						}
-				}
-			}
-
-		}
-	}
-
-	backup.free();
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/dropdown2.h b/engines/avalanche/dropdown2.h
deleted file mode 100644
index 95e258e..0000000
--- a/engines/avalanche/dropdown2.h
+++ /dev/null
@@ -1,167 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* DROPDOWN	A customised version of Oopmenu (qv). */
-
-#ifndef AVALANCHE_DROPDOWN2_H
-#define AVALANCHE_DROPDOWN2_H
-
-#include "avalanche/color.h"
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Dropdown;
-
-typedef void (Dropdown::*DropdownFunc)();
-
-class HeadType {
-public:
-	Common::String _title;
-	char _trigger, _altTrigger;
-	byte _position;
-	int16 _xpos, _xright;
-	DropdownFunc _setupFunc, _chooseFunc;
-
-	void init(char trig, char alTtrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr);
-	void draw();
-	void highlight();
-	bool parseAltTrigger(char key);
-
-private:
-	Dropdown *_dr;
-};
-
-struct OptionType {
-	Common::String _title;
-	byte _trigger;
-	Common::String _shortcut;
-	bool _valid;
-};
-
-class MenuItem {
-public:
-	OptionType _options[12];
-	byte _optionNum;
-	uint16 _width, _left;
-	bool _firstlix;
-	int16 _flx1, _flx2, fly;
-	byte _oldY; // used by lightUp */
-	bool _activeNow; // Is there an active option now?
-	byte _activeNum; // And if so, which is it?
-	byte _choiceNum; // Your choice?
-	byte _highlightNum;
-
-	void init(Dropdown *dr);
-	void reset();
-	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
-	void display();
-	void wipe();
-	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
-	void displayOption(byte y, bool highlit);
-	void moveHighlight(int8 inc);
-	void select(byte which); // Choose which one you want.
-	void parseKey(char c);
-
-private:
-	Dropdown *_dr;
-};
-
-class MenuBar {
-public:
-	HeadType _menuItems[8];
-	byte _menuNum;
-
-	void init(Dropdown *dr);
-	void createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc);
-	void draw();
-	void parseAltTrigger(char c);
-	void setupMenuItem(byte which);
-	void chooseMenuItem(int16 x);
-
-private:
-	Dropdown *_dr;
-};
-
-class Dropdown {
-public:
-	friend class HeadType;
-	friend class MenuItem;
-	friend class MenuBar;
-
-	MenuItem _activeMenuItem;
-	MenuBar _menuBar;
-
-	Common::String people;
-
-	Dropdown(AvalancheEngine *vm);
-
-	void parseKey(char r, char re);
-	void updateMenu();
-	void setupMenu(); // Standard menu bar.
-
-private:
-	static const byte kIndent = 5;
-	static const byte kSpacing = 10;
-
-	static const byte kMenuBackgroundColor = kColorLightgray;
-	static const byte kMenuFontColor = kColorBlack;
-	static const byte kMenuBorderColor = kColorBlack;
-	static const byte kHighlightBackgroundColor = kColorBlack;
-	static const byte kHighlightFontColor = kColorWhite;
-	static const byte kDisabledColor = kColorDarkgray;
-
-	AvalancheEngine *_vm;
-
-	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
-	void findWhatYouCanDoWithIt();
-	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
-	void bleep();
-
-	void setupMenuGame();
-	void setupMenuFile();
-	void setupMenuAction();
-	void setupMenuPeople();
-	void setupMenuObjects();
-	void setupMenuWith();
-
-	void runMenuGame();
-	void runMenuFile();
-	void runMenuAction();
-	void runMenuObjects();
-	void runMenuPeople();
-	void runMenuWith();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_DROPDOWN2_H
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
new file mode 100644
index 0000000..4e8071a
--- /dev/null
+++ b/engines/avalanche/enid.cpp
@@ -0,0 +1,302 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ENID		Edna's manager. Loads/saves files. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/enid.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/animation.h"
+#include "avalanche/timer.h"
+#include "avalanche/celer.h"
+#include "avalanche/sequence.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+Enid::Enid(AvalancheEngine *vm) {
+	_vm = vm;
+}
+
+//  CHECKME: useless?
+#if 0
+const Common::String Enid::kCrlf = Common::String(char(15)) + Common::String(char(12));
+const char Enid::kTab = '\t';
+const char Enid::kEof = '\n';
+
+const Common::String Enid::kEdnaFirst =
+	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + // 64
+	kCrlf + kEof + kCrlf + kCrlf + // 7
+	kTab + "Glory to God in the highest," + kCrlf + // 31
+	kTab + "and on earth peace, goodwill toward men." + // 42
+	kCrlf + kTab + kTab + kTab + kTab + // 6
+	"Luke 2:14." + // 10
+	kCrlf + kCrlf + kCrlf + // 6
+	"1234567890" +kCrlf; // 11
+
+const Common::String Enid::kEdnaId = Common::String("TT\xB1\x30\x01\x75\xB1\x99\xB1");
+const int16 Enid::kAge = 18;
+const Common::String Enid::kWasHere = "Thomas was here ";
+const Enid::FourType Enid::kAvariciusFile = "Avvy";
+
+/**
+ * Expand month name
+ * @remarks	Originally called 'addon'
+ */
+void Enid::expandMonthName(Common::String x) {
+	_month += x;
+}
+
+Common::String Enid::expandDate(byte d, byte m, uint16 y) {
+	const Common::String months[12] = {
+		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
+		"Septem*", "Octo*", "Novem*", "Decem*"
+	};
+
+	Common::String expanddate_result;
+	_month = months[m];
+	switch (_month[_month.size()]) {
+	case '#':
+		expandMonthName("uary");
+		break;
+	case '*':
+		expandMonthName("ber");
+		break;
+	}
+
+	_day = _vm->_gyro->strf(d);
+
+	// d is always positive
+	if ((d <= 9) || ((d >= 21) && (d <= 31))) {
+		switch (d % 10) {
+		case 1:
+			_day = _day + "st";
+			break;
+		case 2:
+			_day = _day + "nd";
+			break;
+		case 3:
+			_day = _day + "rd";
+			break;
+		default:
+			_day = _day + "th";
+		}
+	}
+
+	expanddate_result = _day + ' ' + _month + ' ' + _vm->_gyro->strf(y);
+	return expanddate_result;
+}
+
+void Enid::showBug(char icon, Common::String strn) {
+	_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
+}
+
+bool Enid::testBug(byte what) {
+	bool test_bug_result;
+	if (what == 0)  {
+		test_bug_result = false;
+		return test_bug_result;
+	}
+	switch (what) {
+	case 2:
+		showBug('7', "Error in filename!");
+		break;
+	case 101:
+		showBug('6', "Disk full!");
+		break;
+	case 150:
+		showBug('4', "Disk is write-protected!");
+		break;
+	default:
+		showBug('B', "Saving error!");
+	}
+	test_bug_result = true;
+	return test_bug_result;
+}
+
+void Enid::ednaSave(Common::String name) {
+	warning("STUB: Enid::ednaSave()");
+}
+
+void Enid::loadError(Common::String x, char icon) {
+	if (_vm->_gyro->holdthedawn) {
+		_vm->_gyro->holdthedawn = false;
+		_vm->_lucerna->dawn();
+	}
+	_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
+	_bug = true;
+}
+
+void Enid::ednaLoad(Common::String name) {
+	warning("STUB: Enid::ednaLoad()");
+}
+
+void Enid::showHeader() {
+	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
+}
+
+void Enid::avvyBackground() {
+	// Not really a filing procedure,
+	// but it's only called just before edna_load, so I thought I'd put it
+	// in Enid instead of, say, Lucerna.
+
+#if 0
+	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }
+
+	asm
+		mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
+		mov dx,$3ce; mov al,4; out dx,al; { register. }
+		mov dx,$3c5; mov al,1; out dx,al;
+		mov dx,$3cf;           out dx,al;
+
+		mov bx,$A000; call far ptr @drawup;
+		mov bx,$A400; call far ptr @drawup;
+
+		jmp @the_end;
+
+		@drawup:
+
+		mov es,bx; { The segment to copy it to... }
+		mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
+
+		mov cx,10;
+		mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
+		mov ax,$AEAA; call far ptr @sameline;
+		mov ax,$A4EA; call far ptr @sameline;
+		mov ax,$44A4; call far ptr @sameline;
+
+		mov cx,9;
+		mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
+		mov ax,$AAEA; call far ptr @sameline;
+		mov ax,$AA4E; call far ptr @sameline;
+		mov ax,$444A; call far ptr @sameline;
+
+		mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
+		mov ax,$AAAE; call far ptr @sameline;
+		mov ax,$EAA4; call far ptr @sameline;
+		mov ax,$A444; call far ptr @sameline;
+
+		mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
+		mov ax,$EAAA; call far ptr @sameline;
+		mov ax,$4EAA; call far ptr @sameline;
+		mov ax,$4A44; call far ptr @sameline;
+
+		ret;
+
+
+		{ Replicate the same line many times. }
+
+		@sameline:
+		{ Requires:
+			what to copy in AX,
+			how many lines in CX, and
+			original offset in DI. }
+		push cx;
+		push di;
+
+		@samelineloop:
+
+		push cx;
+		mov cx,40; { No. of times to repeat it on one line. }
+
+		repz stosw; { Fast uint16-copying }
+
+		pop cx;
+
+		add di,1200; { The next one will be 16 lines down. }
+
+		loop @samelineloop;
+		pop di;
+		add di,80;
+		pop cx;
+
+		ret;
+
+		@the_end:
+		end;
+#endif
+}
+
+void Enid::toSundry(Sundry &sund) {
+	sund._qEnidFilename = _vm->_gyro->_enidFilename;
+	sund._qSoundFx = _vm->_gyro->_soundFx;
+	sund._qThinks = _vm->_gyro->_thinks;
+	sund._qThinkThing = _vm->_gyro->_thinkThing;
+}
+
+void Enid::fromSundry(Sundry sund) {
+	_vm->_gyro->_enidFilename = sund._qEnidFilename;
+	_vm->_gyro->_soundFx = sund._qSoundFx;
+	_vm->_gyro->_thinks = sund._qThinks;
+	_vm->_gyro->_thinkThing = sund._qThinkThing;
+}
+
+void Enid::restoreDna() {
+//	uint16 here, fv;
+//	sundry sund;
+
+	warning("STUB: Enid::restoreDna()");
+}
+
+void Enid::ednaReload() {
+
+	restoreDna();
+
+	_vm->_gyro->_seeScroll = true;  // This prevents display of the new sprites before the
+								   // new picture is loaded.
+
+	_vm->_lucerna->majorRedraw();
+
+	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
+
+	_vm->_gyro->_alive = true;
+
+	_vm->_lucerna->refreshObjectList();
+
+	if (_vm->_gyro->_holdTheDawn) {
+		_vm->_gyro->_holdTheDawn = false;
+		_vm->_lucerna->dawn();
+	}
+}
+
+bool Enid::thereWasAProblem() {
+	return _bug;
+}
+
+#endif
+
+void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
+	warning("STUB: Enid::dir()");
+}
+void Enid::backToBootstrap(byte what) {
+	warning("STUB: Enid::back_to_bootstrap()");
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
new file mode 100644
index 0000000..97e249e
--- /dev/null
+++ b/engines/avalanche/enid.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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* ENID		Edna's manager. Loads/saves files. */
+
+#ifndef AVALANCHE_ENID2_H
+#define AVALANCHE_ENID2_H
+
+#include "common/scummsys.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Enid {
+public:
+	Enid(AvalancheEngine *vm);
+	void dir(Common::String where);
+	void backToBootstrap(byte what);
+
+private:
+	AvalancheEngine *_vm;
+
+//  CHECKME: useless?
+//	static const Common::String kCrlf;
+//	static const char kTab, kEof;
+//	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
+//	static const int16 kAge;
+//	void expandMonthName(Common::String x);
+//	Common::String expandDate(byte d, byte m, uint16 y);
+//	void ednaSave(Common::String name);
+//	void showBug(char icon, Common::String strn);
+//	bool testBug(byte what);
+//	void loadError(Common::String x, char icon);
+//	void ednaLoad(Common::String name);
+//	void showHeader();
+//	void toSundry(sundry &sund);
+//	void fromSundry(sundry sund);
+//	void avvyBackground();
+//	void ednaReload(); // From Bootstrap's storage.
+//	void restoreDna();
+//	bool thereWasAProblem();
+
+//	typedef char FourType[5];
+//	static const FourType kAvariciusFile;
+
+//	bool _bug;
+//	Common::String _path, _groi;
+//	Common::String _month, _day;
+
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_ENID2_H
diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp
deleted file mode 100644
index 4c8013e..0000000
--- a/engines/avalanche/enid2.cpp
+++ /dev/null
@@ -1,302 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ENID		Edna's manager. Loads/saves files. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/enid2.h"
-#include "avalanche/scrolls2.h"
-#include "avalanche/lucerna2.h"
-#include "avalanche/animation.h"
-#include "avalanche/timer.h"
-#include "avalanche/celer2.h"
-#include "avalanche/sequence2.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-Enid::Enid(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-//  CHECKME: useless?
-#if 0
-const Common::String Enid::kCrlf = Common::String(char(15)) + Common::String(char(12));
-const char Enid::kTab = '\t';
-const char Enid::kEof = '\n';
-
-const Common::String Enid::kEdnaFirst =
-	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + // 64
-	kCrlf + kEof + kCrlf + kCrlf + // 7
-	kTab + "Glory to God in the highest," + kCrlf + // 31
-	kTab + "and on earth peace, goodwill toward men." + // 42
-	kCrlf + kTab + kTab + kTab + kTab + // 6
-	"Luke 2:14." + // 10
-	kCrlf + kCrlf + kCrlf + // 6
-	"1234567890" +kCrlf; // 11
-
-const Common::String Enid::kEdnaId = Common::String("TT\xB1\x30\x01\x75\xB1\x99\xB1");
-const int16 Enid::kAge = 18;
-const Common::String Enid::kWasHere = "Thomas was here ";
-const Enid::FourType Enid::kAvariciusFile = "Avvy";
-
-/**
- * Expand month name
- * @remarks	Originally called 'addon'
- */
-void Enid::expandMonthName(Common::String x) {
-	_month += x;
-}
-
-Common::String Enid::expandDate(byte d, byte m, uint16 y) {
-	const Common::String months[12] = {
-		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
-		"Septem*", "Octo*", "Novem*", "Decem*"
-	};
-
-	Common::String expanddate_result;
-	_month = months[m];
-	switch (_month[_month.size()]) {
-	case '#':
-		expandMonthName("uary");
-		break;
-	case '*':
-		expandMonthName("ber");
-		break;
-	}
-
-	_day = _vm->_gyro->strf(d);
-
-	// d is always positive
-	if ((d <= 9) || ((d >= 21) && (d <= 31))) {
-		switch (d % 10) {
-		case 1:
-			_day = _day + "st";
-			break;
-		case 2:
-			_day = _day + "nd";
-			break;
-		case 3:
-			_day = _day + "rd";
-			break;
-		default:
-			_day = _day + "th";
-		}
-	}
-
-	expanddate_result = _day + ' ' + _month + ' ' + _vm->_gyro->strf(y);
-	return expanddate_result;
-}
-
-void Enid::showBug(char icon, Common::String strn) {
-	_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
-}
-
-bool Enid::testBug(byte what) {
-	bool test_bug_result;
-	if (what == 0)  {
-		test_bug_result = false;
-		return test_bug_result;
-	}
-	switch (what) {
-	case 2:
-		showBug('7', "Error in filename!");
-		break;
-	case 101:
-		showBug('6', "Disk full!");
-		break;
-	case 150:
-		showBug('4', "Disk is write-protected!");
-		break;
-	default:
-		showBug('B', "Saving error!");
-	}
-	test_bug_result = true;
-	return test_bug_result;
-}
-
-void Enid::ednaSave(Common::String name) {
-	warning("STUB: Enid::ednaSave()");
-}
-
-void Enid::loadError(Common::String x, char icon) {
-	if (_vm->_gyro->holdthedawn) {
-		_vm->_gyro->holdthedawn = false;
-		_vm->_lucerna->dawn();
-	}
-	_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
-	_bug = true;
-}
-
-void Enid::ednaLoad(Common::String name) {
-	warning("STUB: Enid::ednaLoad()");
-}
-
-void Enid::showHeader() {
-	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
-}
-
-void Enid::avvyBackground() {
-	// Not really a filing procedure,
-	// but it's only called just before edna_load, so I thought I'd put it
-	// in Enid instead of, say, Lucerna.
-
-#if 0
-	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }
-
-	asm
-		mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
-		mov dx,$3ce; mov al,4; out dx,al; { register. }
-		mov dx,$3c5; mov al,1; out dx,al;
-		mov dx,$3cf;           out dx,al;
-
-		mov bx,$A000; call far ptr @drawup;
-		mov bx,$A400; call far ptr @drawup;
-
-		jmp @the_end;
-
-		@drawup:
-
-		mov es,bx; { The segment to copy it to... }
-		mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
-
-		mov cx,10;
-		mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
-		mov ax,$AEAA; call far ptr @sameline;
-		mov ax,$A4EA; call far ptr @sameline;
-		mov ax,$44A4; call far ptr @sameline;
-
-		mov cx,9;
-		mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
-		mov ax,$AAEA; call far ptr @sameline;
-		mov ax,$AA4E; call far ptr @sameline;
-		mov ax,$444A; call far ptr @sameline;
-
-		mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
-		mov ax,$AAAE; call far ptr @sameline;
-		mov ax,$EAA4; call far ptr @sameline;
-		mov ax,$A444; call far ptr @sameline;
-
-		mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
-		mov ax,$EAAA; call far ptr @sameline;
-		mov ax,$4EAA; call far ptr @sameline;
-		mov ax,$4A44; call far ptr @sameline;
-
-		ret;
-
-
-		{ Replicate the same line many times. }
-
-		@sameline:
-		{ Requires:
-			what to copy in AX,
-			how many lines in CX, and
-			original offset in DI. }
-		push cx;
-		push di;
-
-		@samelineloop:
-
-		push cx;
-		mov cx,40; { No. of times to repeat it on one line. }
-
-		repz stosw; { Fast uint16-copying }
-
-		pop cx;
-
-		add di,1200; { The next one will be 16 lines down. }
-
-		loop @samelineloop;
-		pop di;
-		add di,80;
-		pop cx;
-
-		ret;
-
-		@the_end:
-		end;
-#endif
-}
-
-void Enid::toSundry(Sundry &sund) {
-	sund._qEnidFilename = _vm->_gyro->_enidFilename;
-	sund._qSoundFx = _vm->_gyro->_soundFx;
-	sund._qThinks = _vm->_gyro->_thinks;
-	sund._qThinkThing = _vm->_gyro->_thinkThing;
-}
-
-void Enid::fromSundry(Sundry sund) {
-	_vm->_gyro->_enidFilename = sund._qEnidFilename;
-	_vm->_gyro->_soundFx = sund._qSoundFx;
-	_vm->_gyro->_thinks = sund._qThinks;
-	_vm->_gyro->_thinkThing = sund._qThinkThing;
-}
-
-void Enid::restoreDna() {
-//	uint16 here, fv;
-//	sundry sund;
-
-	warning("STUB: Enid::restoreDna()");
-}
-
-void Enid::ednaReload() {
-
-	restoreDna();
-
-	_vm->_gyro->_seeScroll = true;  // This prevents display of the new sprites before the
-								   // new picture is loaded.
-
-	_vm->_lucerna->majorRedraw();
-
-	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
-
-	_vm->_gyro->_alive = true;
-
-	_vm->_lucerna->refreshObjectList();
-
-	if (_vm->_gyro->_holdTheDawn) {
-		_vm->_gyro->_holdTheDawn = false;
-		_vm->_lucerna->dawn();
-	}
-}
-
-bool Enid::thereWasAProblem() {
-	return _bug;
-}
-
-#endif
-
-void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
-	warning("STUB: Enid::dir()");
-}
-void Enid::backToBootstrap(byte what) {
-	warning("STUB: Enid::back_to_bootstrap()");
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/enid2.h b/engines/avalanche/enid2.h
deleted file mode 100644
index 97e249e..0000000
--- a/engines/avalanche/enid2.h
+++ /dev/null
@@ -1,78 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ENID		Edna's manager. Loads/saves files. */
-
-#ifndef AVALANCHE_ENID2_H
-#define AVALANCHE_ENID2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Enid {
-public:
-	Enid(AvalancheEngine *vm);
-	void dir(Common::String where);
-	void backToBootstrap(byte what);
-
-private:
-	AvalancheEngine *_vm;
-
-//  CHECKME: useless?
-//	static const Common::String kCrlf;
-//	static const char kTab, kEof;
-//	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
-//	static const int16 kAge;
-//	void expandMonthName(Common::String x);
-//	Common::String expandDate(byte d, byte m, uint16 y);
-//	void ednaSave(Common::String name);
-//	void showBug(char icon, Common::String strn);
-//	bool testBug(byte what);
-//	void loadError(Common::String x, char icon);
-//	void ednaLoad(Common::String name);
-//	void showHeader();
-//	void toSundry(sundry &sund);
-//	void fromSundry(sundry sund);
-//	void avvyBackground();
-//	void ednaReload(); // From Bootstrap's storage.
-//	void restoreDna();
-//	bool thereWasAProblem();
-
-//	typedef char FourType[5];
-//	static const FourType kAvariciusFile;
-
-//	bool _bug;
-//	Common::String _path, _groi;
-//	Common::String _month, _day;
-
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_ENID2_H
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
new file mode 100644
index 0000000..1e95c6b
--- /dev/null
+++ b/engines/avalanche/gyro.cpp
@@ -0,0 +1,593 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* GYRO		It all revolves around this bit! */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/gyro.h"
+#include "avalanche/pingo.h"
+#include "avalanche/scrolls.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/acci.h"
+#include "avalanche/animation.h"
+
+#include "common/file.h"
+#include "common/random.h"
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+const char *Gyro::kVersionNum = "1.30";
+const char *Gyro::kCopyright = "1995";
+
+const MouseHotspotType Gyro::kMouseHotSpots[9] = {
+	{8,0}, // 1 - up-arrow
+	{0,0}, // 2 - screwdriver
+	{15,6}, // 3 - right-arrow
+	{0,0}, // 4 - fletch
+	{8,7}, // 5 - hourglass
+	{4,0}, // 6 - TTHand
+	{8,5}, // 7- Mark's crosshairs
+	{8,7}, // 8- I-beam
+	{0,0} // 9 - question mark
+};
+
+// Art gallery at 2,1; notice about this at 2,2.
+const int32 Gyro::kCatacombMap[8][8] = {
+	// Geida's room
+	// 1       2	   3     | 4	   5	   6	   7       8
+	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
+	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
+	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
+	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
+	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
+	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
+	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
+	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
+};
+// vv Stairs trap.
+
+/* Explanation: $NSEW.
+		Nibble N: North.
+		0     = no connection,
+		2     = (left,) middle(, right) door with left-hand handle,
+		5     = (left,) middle(, right) door with right-hand handle,
+		7     = arch,
+		8     = arch and 1 north of it,
+		9     = arch and 2 north of it,
+		D     = no connection + WINDOW,
+		E     = no connection + TORCH,
+		F     = recessed door (to Geida's room.)
+
+		Nibble S: South.
+		0     = no connection,
+		1,2,3 = left, middle, right door.
+
+		Nibble E: East.
+		0     = no connection (wall),
+		1     = no connection (wall + window),
+		2     = wall with door,
+		3     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor.
+
+		Nibble W: West.
+		0     = no connection (wall),
+		1     = no connection (wall + shield),
+		2     = wall with door,
+		3     = wall with door and shield,
+		4     = no connection (window),
+		5     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor. */
+
+const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
+
+// A quasiped defines how people who aren't sprites talk. For example, quasiped
+// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
+const QuasipedType Gyro::kQuasipeds[16] = {
+	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
+	{3, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{3, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
+	{3, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23).
+	{3, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
+	{6, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
+	{2, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
+	{2, kColorBrown, 7, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
+	{2, kColorLightgreen, 47, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
+	{3, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
+	{2, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
+	{2, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
+	{3, kColorWhite, 27, kColorRed, 177}, // M: Avaroid (screen 27).
+	{4, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
+	{5, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
+	{2, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
+};
+
+const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
+
+const uint16 Gyro::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+
+const TuneType Gyro::kTune = {
+	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
+	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
+	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
+};
+
+byte Gyro::_whereIs[29] = {
+	// The Lads
+	r__yours, // Avvy
+	r__spludwicks, // Spludwick
+	r__outsideyours, // Crapulus
+	r__ducks, // Duck - r__DucksRoom's not defined yet.
+	r__argentpub, // Malagauche
+	r__robins, // Friar Tuck.
+	177, // Robin Hood - can't meet him at the start.
+	r__brummieroad, // Cwytalot
+	r__lustiesroom, // Baron du Lustie.
+	r__outsidecardiffcastle, // The Duke of Cardiff.
+	r__argentpub, // Dogfood
+	r__outsideducks, // Trader
+	r__argentpub, // Ibythneth
+	r__aylesoffice, // Ayles
+	r__nottspub, // Port
+	r__nottspub, // Spurge
+	r__musicroom, // Jacques
+	0, 0, 0, 0, 0, 0, 0, 0,
+	// The Lasses
+	r__yours, // Arkata
+	r__geidas, // Geida
+	177, // nobody allocated here!
+	r__wisewomans  // The Wise Woman.
+};
+
+Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
+	_vm = vm;
+
+	// Needed because of Lucerna::load_also()
+	for (int fv = 0; fv < 31; fv++) {
+		for (int ff = 0; ff < 2; ff++)
+			_also[fv][ff] = 0;
+	}
+
+	_totalTime = 0;
+}
+
+Gyro::~Gyro() {
+	for (byte i = 0; i < 9; i++) {
+		_digits[i].free();
+		_directions[i].free();
+	}
+	_digits[9].free();
+}
+
+Common::String Gyro::intToStr(int32 num) {
+	return Common::String::format("%d", num);
+}
+
+void Gyro::newMouse(byte id) {
+	if (id == _currentMouse)
+		return;
+	_currentMouse = id;
+
+	loadMouse(id);
+}
+
+/**
+ * Set the mouse pointer to 'HourGlass"
+ * @remarks	Originally called 'wait'
+ */
+void Gyro::setMousePointerWait() {
+	newMouse(5);
+}
+
+void Gyro::note(uint16 hertz) {
+	warning("STUB: Gyro::note()");
+}
+
+void Gyro::blip() {
+	warning("STUB: Gyro::blip()");
+}
+
+void Gyro::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
+	warning("STUB: Gyro::shadow()");
+}
+
+void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+	warning("STUB: Gyro::shbox()");
+}
+
+void Gyro::resetVariables() {
+// Replaces memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
+	_vm->_animation->_direction = 0;
+	_carryNum = 0;
+	for (int i = 0; i < kObjectNum; i++)
+		_objects[i] = false;
+
+	_dnascore = 0;
+	_money = 0;
+	_room = 0;
+	_wearing = 0;
+	_sworeNum = 0;
+	_saveNum = 0;
+	for (int i = 0; i < 100; i++)
+		_roomCount[i] = 0;
+
+	_alcoholLevel = 0;
+	_playedNim = 0;
+	_wonNim = false;
+	_wineState = 0;
+	_cwytalotGone = false;
+	_passwordNum = 0;
+	_aylesIsAwake = false;
+	_drawbridgeOpen = 0;
+	_avariciusTalk = 0;
+	_boughtOnion = false;
+	_rottenOnion = false;
+	_onionInVinegar = false;
+	_givenToSpludwick = 0;
+	_brummieStairs = 0;
+	_cardiffQuestionNum = 0;
+	_passedCwytalotInHerts = false;
+	_avvyIsAwake = false;
+	_avvyInBed = false;
+	_userMovesAvvy = false;
+	_npcFacing = 0;
+	_givenBadgeToIby = false;
+	_friarWillTieYouUp = false;
+	_tiedUp = false;
+	_boxContent = 0;
+	_talkedToCrapulus = false;
+	_jacquesState = 0;
+	_bellsAreRinging = false;
+	_standingOnDais = false;
+	_takenPen = false;
+	_arrowTriggered = false;
+	_arrowInTheDoor = false;
+	_favouriteDrink = "";
+	_favouriteSong = "";
+	_worstPlaceOnEarth = "";
+	_spareEvening = "";
+	_totalTime = 0;
+	_jumpStatus = 0;
+	_mushroomGrowing = false;
+	_spludwickAtHome = false;
+	_lastRoom = 0;
+	_lastRoomNotMap = 0;
+	_crapulusWillTell = false;
+	_enterCatacombsFromLustiesRoom = false;
+	_teetotal = false;
+	_malagauche = 0;
+	_drinking = 0;
+	_enteredLustiesRoomAsMonk = false;
+	_catacombX = 0;
+	_catacombY = 0;
+	_avvysInTheCupboard = false;
+	_geidaFollows = false;
+	_geidaSpin = 0;
+	_geidaTime = 0;
+	_nextBell = 0;
+	_givenPotionToGeida = false;
+	_lustieIsAsleep = false;
+	_flipToWhere = 0;
+	_flipToPed = 0;
+	_beenTiedUp = false;
+	_sittingInPub = false;
+	_spurgeTalkCount = 0;
+	_metAvaroid = false;
+	_takenMushroom = false;
+	_givenPenToAyles = false;
+	_askedDogfoodAboutNim = false;
+}
+
+void Gyro::newGame() {
+	for (byte i = 0; i < kMaxSprites; i++) {
+		AnimationType *spr = &_vm->_animation->_sprites[i];
+		if (spr->_quick)
+			spr->remove();
+	}
+	// Deallocate sprite. Sorry, beta testers!
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->init(0, true, _vm->_animation);
+
+	_alive = true;
+	resetVariables();
+
+	_vm->_scrolls->setBubbleStateNatural();
+
+	_spareEvening = "answer a questionnaire";
+	_favouriteDrink = "beer";
+	_money = 30; // 2/6
+	_vm->_animation->_direction = Animation::kDirStopped;
+	_wearing = kObjectClothes;
+	_objects[kObjectMoney - 1] = true;
+	_objects[kObjectBodkin - 1] = true;
+	_objects[kObjectBell - 1] = true;
+	_objects[kObjectClothes - 1] = true;
+
+	_thinkThing = true;
+	_thinks = 2;
+	_vm->_lucerna->refreshObjectList();
+	_onToolbar = false;
+	_seeScroll = false;
+
+	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
+	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
+	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
+	_him = 254;
+	_her = 254;
+	_it = 254;
+	_lastPerson = 254; // = Pardon?
+	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_userMovesAvvy = false;
+	_doingSpriteRun = false;
+	_avvyInBed = true;
+	_enidFilename = "";
+
+	_vm->_lucerna->enterRoom(1, 1);
+	avvy->_visible = false;
+	_vm->_lucerna->drawScore();
+	_vm->_dropdown->setupMenu();
+	_vm->_lucerna->_clock.update();
+	_vm->_lucerna->spriteRun();
+}
+
+void Gyro::click() {
+	warning("STUB: Gyro::click()");
+}
+
+void Gyro::slowDown() {
+	warning("STUB: Gyro::slowdown()");
+}
+
+bool Gyro::setFlag(char x) {
+	for (uint16 i = 0; i < _flags.size(); i++) {
+		if (_flags[i] == x)
+			return true;
+	}
+
+	return false;
+}
+
+void Gyro::forceNumlock() {
+	warning("STUB: Gyro::force_numlock()");
+}
+
+bool Gyro::decreaseMoney(uint16 howmuchby) {
+	_money -= howmuchby;
+	if (_money < 0) {
+		_vm->_scrolls->displayScrollChain('Q', 2); // "You are now denariusless!"
+		_vm->_lucerna->gameOver();
+		return false;
+	} else
+		return true;
+}
+
+Common::String Gyro::getName(byte whose) {
+	static const Common::String kLads[17] = {
+		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
+		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
+		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+	};
+
+	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
+
+	if (whose < 175)
+		return kLads[whose - 150];
+	else
+		return kLasses[whose - 175];
+}
+
+byte Gyro::getNameChar(byte whose) {
+	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
+	static const char kLassChar[] = "kG\0xB1o";
+
+	if (whose < 175)
+		return kLadChar[whose - 150];
+	else
+		return kLassChar[whose - 175];
+}
+
+Common::String Gyro::getThing(byte which) {
+	static const Common::String kThings[kObjectNum] = {
+		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+	};
+
+	Common::String get_thing_result;
+	switch (which) {
+	case kObjectWine:
+		switch (_wineState) {
+		case 1:
+		case 4:
+			get_thing_result = kThings[which - 1];
+			break;
+		case 3:
+			get_thing_result = "Vinegar";
+			break;
+		}
+		break;
+	case kObjectOnion:
+		if (_rottenOnion)
+			get_thing_result = "rotten onion";
+		else
+			get_thing_result = kThings[which - 1];
+		break;
+	default:
+		get_thing_result = kThings[which - 1];
+	}
+	return get_thing_result;
+}
+
+char Gyro::getThingChar(byte which) {
+	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+
+	char get_thingchar_result;
+	switch (which) {
+	case kObjectWine:
+		if (_wineState == 3)
+			get_thingchar_result = 'V'; // Vinegar
+		else
+			get_thingchar_result = kThingsChar[which - 1];
+		break;
+	default:
+		get_thingchar_result = kThingsChar[which - 1];
+	}
+	return get_thingchar_result;
+}
+
+Common::String Gyro::getItem(byte which) {
+	static const Common::String kItems[kObjectNum] = {
+		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
+		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
+		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
+		"an onion"
+	};
+
+	Common::String get_better_result;
+	if (which > 150)
+		which -= 149;
+
+	switch (which) {
+	case kObjectWine:
+		switch (_wineState) {
+		case 0:
+		case 1:
+		case 4:
+			get_better_result = kItems[which - 1];
+			break;
+		case 3:
+			get_better_result = "some vinegar";
+			break;
+		}
+		break;
+	case kObjectOnion:
+		if (_rottenOnion)
+			get_better_result = "a rotten onion";
+		else if (_onionInVinegar)
+			get_better_result = "a pickled onion (in the vinegar)";
+		else
+			get_better_result = kItems[which - 1];
+		break;
+	default:
+		if ((which < kObjectNum) && (which > 0))
+			get_better_result = kItems[which - 1];
+		else
+			get_better_result = "";
+	}
+	return get_better_result;
+}
+
+
+Common::String Gyro::f5Does() {
+	switch (_room) {
+	case r__yours:
+		if (!_avvyIsAwake)
+			return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
+		else if (_avvyInBed)
+			return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
+		break;
+	case r__insidecardiffcastle:
+		if (_standingOnDais)
+			return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
+		else
+			return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
+		break;
+	case r__nottspub:
+		if (_sittingInPub)
+			return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
+		else
+			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
+		break;
+	case r__musicroom:
+		if (_vm->_animation->inField(7))
+			return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay);
+		break;
+	}
+
+	return Common::String::format("%c", _vm->_acci->kPardon); // If all else fails...
+}
+
+void Gyro::loadMouse(byte which) {
+	Common::File f;
+
+	if (!f.open("mice.avd"))
+		error("AVALANCHE: Gyro: File not found: mice.avd");
+
+	::Graphics::Surface cursor;
+	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
+	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
+
+
+	// The AND mask.
+	f.seek(kMouseSize * 2 * (which - 1) + 134);
+
+	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (byte j = 0; j < mask.h; j++)
+		for (byte i = 0; i < mask.w; i++)
+			for (byte k = 0; k < 2; k++)
+				if (*(byte *)mask.getBasePtr(i, j) == 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
+
+	mask.free();
+
+	// The OR mask.
+	f.seek(kMouseSize * 2 * (which - 1) + 134 * 2);
+
+	mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (byte j = 0; j < mask.h; j++)
+		for (byte i = 0; i < mask.w; i++)
+			for (byte k = 0; k < 2; k++) {
+				byte pixel = *(byte *)mask.getBasePtr(i, j);
+				if (pixel != 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
+			}
+
+	mask.free();
+	f.close();
+
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
+	cursor.free();
+}
+
+void Gyro::setBackgroundColor(byte x) {
+	warning("STUB: Gyro::background()");
+}
+
+void Gyro::hangAroundForAWhile() {
+	for (byte i = 0; i < 28; i++)
+		slowDown();
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
new file mode 100644
index 0000000..0f8b9ae
--- /dev/null
+++ b/engines/avalanche/gyro.h
@@ -0,0 +1,409 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* GYRO		It all revolves around this bit! */
+
+#ifndef AVALANCHE_GYRO2_H
+#define AVALANCHE_GYRO2_H
+
+#include "common/str.h"
+#include "common/scummsys.h"
+#include "common/file.h"
+
+#include "graphics/surface.h"
+
+#include "avalanche/roomnums.h"
+#include "avalanche/color.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+
+static const byte kObjectNum = 18; // always preface with a #
+static const int16 kCarryLimit = 12;  // carry limit
+
+static const int16 kNumlockCode = 32;  // Code for Num Lock
+static const int16 kMouseSize = 134;
+
+struct MouseHotspotType { // mouse-void
+	int16 _horizontal, _vertical;
+};
+
+struct PedType {
+	int16 _x, _y;
+	byte _direction;
+};
+
+struct MagicType {
+	byte _operation; // one of the operations
+	uint16 _data; // data for them
+};
+
+class FieldType {
+public:
+	int16 _x1, _y1, _x2, _y2;
+};
+
+struct ByteField {
+	byte _x1, _y1, _x2, _y2;
+};
+
+class LineType : public FieldType {
+public:
+	byte _color;
+};
+
+struct DemoType {
+	uint16 _delay;
+	char _key, _extd;
+};
+
+typedef byte TuneType[31];
+
+struct QuasipedType {
+	byte _whichPed, _foregroundColor, _room, _backgroundColor;
+	uint16 _who;
+};
+
+#if 0
+struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA.
+	Common::String _qEnidFilename;
+	bool _qSoundFx;
+	byte _qThinks;
+	bool _qThinkThing;
+};
+
+struct ednahead { // Edna header
+	// This header starts at byte offset 177 in the .ASG file.
+	char id[9];   // signature
+	uint16 revision; // EDNA revision, here 2 (1=dna256)
+	Common::String game; // Long name, eg Lord Avalot D'Argent
+	Common::String shortname; // Short name, eg Avalot
+	uint16 number; // Game's code number, here 2
+	uint16 ver; // Version number as int16 (eg 1.00 = 100)
+	Common::String verstr; // Vernum as Common::String (eg 1.00 = "1.00")
+	Common::String filename; // Filename, eg AVALOT.EXE
+	byte osbyte; // Saving OS (here 1=DOS. See below for others.
+	Common::String os; // Saving OS in text format.
+
+	// Info on this particular game
+
+	Common::String fn; // Filename (not extension ('cos that's .ASG))
+	byte d, m; // D, M, Y are the Day, Month & Year this game was...
+	uint16 y;  // ...saved on.
+	Common::String desc; // Description of game (same as in Avaricius!)
+	uint16 len; // Length of DNA (it's not going to be above 65535!)
+
+	// Quick reference & miscellaneous
+
+	uint16 saves; // no. of times this game has been saved
+	int16 cash; // contents of your wallet in numerical form
+	Common::String money; // ditto in Common::String form (eg 5/-, or 1 denarius)
+	uint16 points; // your score
+
+	// DNA values follow, then footer (which is ignored)
+};
+#endif
+
+class Gyro {
+public:
+	static const char *kVersionNum;
+	static const char *kCopyright;
+	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
+	static const int16 kGameCode = 2; // Avalot's code number
+
+	// Objects you can hold:
+	enum Object {
+		kObjectWine = 1,
+		kObjectMoney,
+		kObjectBodkin,
+		kObjectPotion,
+		kObjectChastity,
+		kObjectBolt,
+		kObjectCrossbow,
+		kObjectLute,
+		kObjectBadge,
+		kObjectMushroom,
+		kObjectKey,
+		kObjectBell,
+		kObjectPrescription,
+		kObjectPen,
+		kObjectInk,
+		kObjectClothes,
+		kObjectHabit,
+		kObjectOnion
+	};
+
+	// People who hang around this game.
+	enum People {
+		// Boys:
+		kPeopleAvalot = 150,
+		kPeopleSpludwick = 151,
+		kPeopleCrapulus = 152,
+		kPeopleDrDuck = 153,
+		kPeopleMalagauche = 154,
+		kPeopleFriarTuck = 155,
+		kPeopleRobinHood = 156,
+		kPeopleCwytalot = 157,
+		kPeopleDuLustie = 158,
+		kPeopleDuke = 159,
+		kPeopleDogfood = 160,
+		kPeopleTrader = 161,
+		kPeopleIbythneth = 162,
+		kPeopleAyles = 163,
+		kPeoplePort = 164,
+		kPeopleSpurge = 165,
+		kPeopleJacques = 166,
+		// Girls:
+		kPeopleArkata = 175,
+		kPeopleGeida = 176,
+		kPeopleWisewoman = 178
+	};
+
+	static const int16 kXW = 30;
+	static const int16 kYW = 36; // x width & y whatsit
+
+	static const int16 kMargin = 5;
+
+	static const MouseHotspotType kMouseHotSpots[9];
+
+	static const int16 kMaxSprites = 2; // Current max no. of sprites.
+
+	// For Thinkabout:
+	static const bool kThing = true;
+	static const bool kPerson = false;
+
+	// Magic/portal constants:
+	enum Magics {
+		kMagicNothing, // Ignore it if this line is touched.
+		kMagicBounce, // Bounce off this line. Not valid for portals.
+		kMagicExclaim, // Put up a chain of scrolls.
+		kMagicTransport, // Enter new room.
+		kMagicUnfinished, // Unfinished connection.
+		kMagicSpecial, // Special function.
+		kMagicOpenDoor // Opening door.
+	};
+
+	// These following static constants should be included in CFG when it's written.
+
+	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
+	static const int16 kBorder = 1; // size of border on shadowboxes
+	static const int16 kWalk = 3;
+	static const int16 kRun = 5;
+	static const int32 kCatacombMap[8][8];
+	static const char kSpludwicksOrder[3];
+	static const QuasipedType kQuasipeds[16];
+
+	enum Pitch {
+		kPitchLower,
+		kPitchSame,
+		kPitchHigher
+	};
+
+	static const char kMusicKeys[];
+	static const uint16 kNotes[12];
+
+	static const TuneType kTune;
+
+
+
+	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
+	// If a scroll comes up, or you leave the room, it's automatically set to zero.
+	byte _interrogation;
+
+	static byte _whereIs[29];
+
+	// Variable static constant for overriding the ability of On to switch pages.
+	// You may know better than On which page to switch to.
+	bool _onCanDoPageSwap;
+
+	// Former DNA structure
+	byte _carryNum; // How many objects you're carrying...
+	bool _objects[kObjectNum]; // ...and which ones they are.
+	int16 _dnascore; // your score, of course
+	int32 _money; // your current amount of dosh
+	byte _room; // your current room
+	byte _wearing; // what you're wearing
+	byte _sworeNum; // number of times you've sworn
+	byte _saveNum; // number of times this game has been saved
+	byte _roomCount[100]; // Add one to each every time you enter a room
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _wonNim; // Have you *won* Nim? (That's harder.)
+	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
+	byte _passwordNum; // Number of the passw for this game.
+	bool _aylesIsAwake; // pretty obvious!
+	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
+	byte _avariciusTalk; // How much Avaricius has said to you.
+	bool _boughtOnion; // Have you bought an onion yet?
+	bool _rottenOnion; // And has it rotted?
+	bool _onionInVinegar; // Is the onion in the vinegar?
+	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
+	byte _brummieStairs; // Progression through the stairs trick.
+	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool _avvyInBed; // True if Avvy's in bed, but awake.
+	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
+	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
+	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
+	bool _friarWillTieYouUp; // If you're going to get tied up.
+	bool _tiedUp; // You ARE tied up!
+	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
+	bool _talkedToCrapulus; // Pretty self-explanatory.
+	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
+	bool _bellsAreRinging; // Is Jacques ringing the bells?
+	bool _standingOnDais; // In room 71, inside Cardiff Castle.
+	bool _takenPen; // Have you taken the pen (in Cardiff?)
+	bool _arrowTriggered; // And has the arrow been triggered?
+	bool _arrowInTheDoor;  // Did the arrow hit the wall?
+	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
+	uint32 _totalTime; // Your total time playing this game, in ticks.
+	byte _jumpStatus; // Fixes how high you're jumping.
+	bool _mushroomGrowing; // Is the mushroom growing in 42?
+	bool _spludwickAtHome; // Is Spludwick at home?
+	byte _lastRoom;
+	byte _lastRoomNotMap;
+	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
+	bool _enterCatacombsFromLustiesRoom;
+	bool _teetotal; // Are we touching any more drinks?
+	byte _malagauche; // Position of Malagauche. See Celer for more info.
+	char _drinking; // What's he getting you?
+	bool _enteredLustiesRoomAsMonk;
+	byte _catacombX, _catacombY;   // XY coords in the catacombs.
+	bool _avvysInTheCupboard; // On screen 22.
+	bool _geidaFollows; // Is Geida following you?
+	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
+	byte _nextBell; // For the ringing.
+	bool _givenPotionToGeida; // Does Geida have the potion?
+	bool _lustieIsAsleep; // Is BDL asleep?
+	byte _flipToWhere, _flipToPed; // For the sequencer.
+	bool _beenTiedUp; // In r__Robins.
+	bool _sittingInPub; // Are you sitting down in the pub?
+	byte _spurgeTalkCount; // Count for talking to Spurge.
+	bool _metAvaroid;
+	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
+	// End of former DNA Structure
+
+	byte _lineNum; // Number of lines.
+	LineType _lines[50]; // For Also.
+	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
+	bool _dropsOk, _scReturn, _soundFx, _cheat;
+	Common::String _mouseText;
+	bool _weirdWord;
+	bool _letMeOut;
+	Common::String _scroll[15];
+	byte _scrollNum, _whichwas;
+	byte _thinks;
+	bool _thinkThing;
+	int16 _talkX, _talkY;
+	byte _talkBackgroundColor, _talkFontColor;
+	byte _scrollBells; // no. of times to ring the bell
+	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
+	char _objectList[10];
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	// Called .free() for them in ~Gyro().
+	int8 _scoreToDisplay[3];
+	byte _currentMouse; // current mouse-void
+	Common::String _verbStr; // what you can do with your object. :-)
+	Common::String *_also[31][2];
+	PedType _peds[15];
+	MagicType _magics[15];
+	MagicType _portals[7];
+	FieldType _fields[30];
+	byte _fieldNum;
+	Common::String _flags;
+	Common::String _listen;
+	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
+	byte _cp, _ledStatus, _defaultLed;
+	FontType _font;
+	bool _alive;
+	byte _buffer[2000];
+	uint16 _bufSize;
+	int16 _underScroll; // Y-coord of just under the scroll text.
+	bool _dropdownActive; // Kludge so we don't have to keep referring to Dropdown
+	Common::String _roomnName; // Name of actual room
+	Common::String _subject; // What you're talking to them about.
+	byte _subjectNum; // The same thing.
+	bool _keyboardClick; // Is a keyboard click noise wanted?
+	byte _him, _her, _it;
+	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
+
+	// For the demo:
+	DemoType _demoRec;
+	Common::File _demoFile; // of demo_type
+	Common::DumpFile _demoFileSave; // uruk added it - first use located in constructor of Basher
+
+	byte _lastPerson; // Last person to have been selected using the People menu.
+	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
+	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
+	bool isLoaded; // Is it a loaded gamestate?
+	Common::String _enidFilename;
+
+
+
+	Gyro(AvalancheEngine *vm);
+	~Gyro();
+
+	Common::String intToStr(int32 num);
+	void newMouse(byte id);
+	void setMousePointerWait();    // Makes hourglass.
+	void loadMouse(byte which);
+
+	void note(uint16 hertz);
+	void blip();
+	void click(); // "Audio keyboard feedback"
+
+	void setBackgroundColor(byte x);
+	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
+
+	void resetVariables();
+	void newGame(); // This sets up the DNA for a completely new game.
+	void slowDown();
+	bool setFlag(char x);
+	void forceNumlock();
+	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
+	void hangAroundForAWhile();
+	
+	Common::String getName(byte whose);
+	byte getNameChar(byte whose);
+	Common::String getThing(byte which);
+	char getThingChar(byte which);
+	Common::String getItem(byte which); // Called get_better in the original.
+	Common::String f5Does(); // This procedure determines what f5 does.
+
+private:
+	AvalancheEngine *_vm;
+
+	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
+};
+


Commit: a81b499062bf968b94bfaaa96d84aa893bf87343
    https://github.com/scummvm/scummvm/commit/a81b499062bf968b94bfaaa96d84aa893bf87343
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T04:21:03-07:00

Commit Message:
AVALANCHE: Get rid of Enid.

Changed paths:
  R engines/avalanche/enid.cpp
  R engines/avalanche/enid.h
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/module.mk
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3b633c1..a90e1f0 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -35,7 +35,6 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/enid.h"
 #include "avalanche/celer.h"
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
@@ -1432,7 +1431,7 @@ void Acci::giveGeidaTheLute() {
 	_vm->_scrolls->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
-	_vm->_enid->backToBootstrap(4);
+	//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 }
 
 void Acci::playHarp() {
@@ -2106,7 +2105,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeDir:
-		_vm->_enid->dir(_realWords[1]);
+		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
 		break;
 	case kVerbCodeDie:
 		_vm->_lucerna->gameOver();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 526f6a8..5f89ccb 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -36,7 +36,6 @@
 #include "avalanche/celer.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
-#include "avalanche/enid.h"
 
 #include "common/scummsys.h"
 #include "common/textconsole.h"
@@ -782,7 +781,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_lucerna->dusk();
 		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
-		_vm->_enid->backToBootstrap(3);
+		//_vm->_enid->backToBootstrap(3); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
 		if (_vm->_gyro->_friarWillTieYouUp) {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 9f2f46e..c6f74f8 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -65,7 +65,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _pingo;
 	delete _scrolls;
 	delete _lucerna;
-	delete _enid;
 	delete _celer;
 	delete _sequence;
 	delete _timer;
@@ -85,7 +84,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_pingo = new Pingo(this);
 	_scrolls = new Scrolls(this);
 	_lucerna = new Lucerna(this);
-	_enid = new Enid(this);
 	_celer = new Celer(this);
 	_sequence = new Sequence(this);
 	_timer = new Timer(this);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 30eaee0..8da1591 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -38,7 +38,6 @@
 #include "avalanche/pingo.h"
 #include "avalanche/scrolls.h"
 #include "avalanche/lucerna.h"
-#include "avalanche/enid.h"
 #include "avalanche/celer.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
@@ -74,7 +73,6 @@ public:
 	Pingo *_pingo;
 	Scrolls *_scrolls;
 	Lucerna *_lucerna;
-	Enid *_enid;
 	Celer *_celer;
 	Sequence *_sequence;
 	Timer *_timer;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a52186d..788b418 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -40,7 +40,6 @@
 #include "avalanche/pingo.h"
 #include "avalanche/timer.h"
 #include "avalanche/celer.h"
-#include "avalanche/enid.h"
 #include "avalanche/closing.h"
 
 #include "common/str.h"
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 2e070e6..5efa63e 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -34,7 +34,6 @@
 #include "avalanche/gyro.h"
 #include "avalanche/acci.h"
 #include "avalanche/animation.h"
-#include "avalanche/enid.h"
 
 #include "common/textconsole.h"
 
@@ -590,7 +589,7 @@ void Dropdown::runMenuFile() {
 		warning("STUB: Dropdown::runMenuFile()");
 		break;
 	case 4:
-		_vm->_enid->backToBootstrap(2);
+		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
 		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
diff --git a/engines/avalanche/enid.cpp b/engines/avalanche/enid.cpp
deleted file mode 100644
index 4e8071a..0000000
--- a/engines/avalanche/enid.cpp
+++ /dev/null
@@ -1,302 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ENID		Edna's manager. Loads/saves files. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/enid.h"
-#include "avalanche/scrolls.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/animation.h"
-#include "avalanche/timer.h"
-#include "avalanche/celer.h"
-#include "avalanche/sequence.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-Enid::Enid(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-//  CHECKME: useless?
-#if 0
-const Common::String Enid::kCrlf = Common::String(char(15)) + Common::String(char(12));
-const char Enid::kTab = '\t';
-const char Enid::kEof = '\n';
-
-const Common::String Enid::kEdnaFirst =
-	Common::String("This is an EDNA-based file, saved by a Thorsoft game. Good luck!") + // 64
-	kCrlf + kEof + kCrlf + kCrlf + // 7
-	kTab + "Glory to God in the highest," + kCrlf + // 31
-	kTab + "and on earth peace, goodwill toward men." + // 42
-	kCrlf + kTab + kTab + kTab + kTab + // 6
-	"Luke 2:14." + // 10
-	kCrlf + kCrlf + kCrlf + // 6
-	"1234567890" +kCrlf; // 11
-
-const Common::String Enid::kEdnaId = Common::String("TT\xB1\x30\x01\x75\xB1\x99\xB1");
-const int16 Enid::kAge = 18;
-const Common::String Enid::kWasHere = "Thomas was here ";
-const Enid::FourType Enid::kAvariciusFile = "Avvy";
-
-/**
- * Expand month name
- * @remarks	Originally called 'addon'
- */
-void Enid::expandMonthName(Common::String x) {
-	_month += x;
-}
-
-Common::String Enid::expandDate(byte d, byte m, uint16 y) {
-	const Common::String months[12] = {
-		"Jan#", "Febr#", "March", "April", "May", "June", "July", "August",
-		"Septem*", "Octo*", "Novem*", "Decem*"
-	};
-
-	Common::String expanddate_result;
-	_month = months[m];
-	switch (_month[_month.size()]) {
-	case '#':
-		expandMonthName("uary");
-		break;
-	case '*':
-		expandMonthName("ber");
-		break;
-	}
-
-	_day = _vm->_gyro->strf(d);
-
-	// d is always positive
-	if ((d <= 9) || ((d >= 21) && (d <= 31))) {
-		switch (d % 10) {
-		case 1:
-			_day = _day + "st";
-			break;
-		case 2:
-			_day = _day + "nd";
-			break;
-		case 3:
-			_day = _day + "rd";
-			break;
-		default:
-			_day = _day + "th";
-		}
-	}
-
-	expanddate_result = _day + ' ' + _month + ' ' + _vm->_gyro->strf(y);
-	return expanddate_result;
-}
-
-void Enid::showBug(char icon, Common::String strn) {
-	_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
-}
-
-bool Enid::testBug(byte what) {
-	bool test_bug_result;
-	if (what == 0)  {
-		test_bug_result = false;
-		return test_bug_result;
-	}
-	switch (what) {
-	case 2:
-		showBug('7', "Error in filename!");
-		break;
-	case 101:
-		showBug('6', "Disk full!");
-		break;
-	case 150:
-		showBug('4', "Disk is write-protected!");
-		break;
-	default:
-		showBug('B', "Saving error!");
-	}
-	test_bug_result = true;
-	return test_bug_result;
-}
-
-void Enid::ednaSave(Common::String name) {
-	warning("STUB: Enid::ednaSave()");
-}
-
-void Enid::loadError(Common::String x, char icon) {
-	if (_vm->_gyro->holdthedawn) {
-		_vm->_gyro->holdthedawn = false;
-		_vm->_lucerna->dawn();
-	}
-	_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error:  " + "\r\r\22" + x);
-	_bug = true;
-}
-
-void Enid::ednaLoad(Common::String name) {
-	warning("STUB: Enid::ednaLoad()");
-}
-
-void Enid::showHeader() {
-	_vm->_scrolls->display(Common::String("Dir: ") + _path + "\r\r\4");
-}
-
-void Enid::avvyBackground() {
-	// Not really a filing procedure,
-	// but it's only called just before edna_load, so I thought I'd put it
-	// in Enid instead of, say, Lucerna.
-
-#if 0
-	port[$3c4]:=2; port[$3ce]:=4; port[$3C5]:=1; port[$3CF]:=1; { Blue. }
-
-	asm
-		mov dx,$3c4; mov al,2; out dx,al; { Set up the VGA to use the "blue" }
-		mov dx,$3ce; mov al,4; out dx,al; { register. }
-		mov dx,$3c5; mov al,1; out dx,al;
-		mov dx,$3cf;           out dx,al;
-
-		mov bx,$A000; call far ptr @drawup;
-		mov bx,$A400; call far ptr @drawup;
-
-		jmp @the_end;
-
-		@drawup:
-
-		mov es,bx; { The segment to copy it to... }
-		mov di,$370;  { The offset (10 pixels down, plus 1 offset.) }
-
-		mov cx,10;
-		mov ax,$AA4A; call far ptr @sameline; { Print "AVVY" }
-		mov ax,$AEAA; call far ptr @sameline;
-		mov ax,$A4EA; call far ptr @sameline;
-		mov ax,$44A4; call far ptr @sameline;
-
-		mov cx,9;
-		mov ax,$AAA4; call far ptr @sameline; { Print "YAVV" }
-		mov ax,$AAEA; call far ptr @sameline;
-		mov ax,$AA4E; call far ptr @sameline;
-		mov ax,$444A; call far ptr @sameline;
-
-		mov ax,$4AAA; call far ptr @sameline; { Print "VYAV" }
-		mov ax,$AAAE; call far ptr @sameline;
-		mov ax,$EAA4; call far ptr @sameline;
-		mov ax,$A444; call far ptr @sameline;
-
-		mov ax,$A4AA; call far ptr @sameline; { Print "VVYA" }
-		mov ax,$EAAA; call far ptr @sameline;
-		mov ax,$4EAA; call far ptr @sameline;
-		mov ax,$4A44; call far ptr @sameline;
-
-		ret;
-
-
-		{ Replicate the same line many times. }
-
-		@sameline:
-		{ Requires:
-			what to copy in AX,
-			how many lines in CX, and
-			original offset in DI. }
-		push cx;
-		push di;
-
-		@samelineloop:
-
-		push cx;
-		mov cx,40; { No. of times to repeat it on one line. }
-
-		repz stosw; { Fast uint16-copying }
-
-		pop cx;
-
-		add di,1200; { The next one will be 16 lines down. }
-
-		loop @samelineloop;
-		pop di;
-		add di,80;
-		pop cx;
-
-		ret;
-
-		@the_end:
-		end;
-#endif
-}
-
-void Enid::toSundry(Sundry &sund) {
-	sund._qEnidFilename = _vm->_gyro->_enidFilename;
-	sund._qSoundFx = _vm->_gyro->_soundFx;
-	sund._qThinks = _vm->_gyro->_thinks;
-	sund._qThinkThing = _vm->_gyro->_thinkThing;
-}
-
-void Enid::fromSundry(Sundry sund) {
-	_vm->_gyro->_enidFilename = sund._qEnidFilename;
-	_vm->_gyro->_soundFx = sund._qSoundFx;
-	_vm->_gyro->_thinks = sund._qThinks;
-	_vm->_gyro->_thinkThing = sund._qThinkThing;
-}
-
-void Enid::restoreDna() {
-//	uint16 here, fv;
-//	sundry sund;
-
-	warning("STUB: Enid::restoreDna()");
-}
-
-void Enid::ednaReload() {
-
-	restoreDna();
-
-	_vm->_gyro->_seeScroll = true;  // This prevents display of the new sprites before the
-								   // new picture is loaded.
-
-	_vm->_lucerna->majorRedraw();
-
-	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
-
-	_vm->_gyro->_alive = true;
-
-	_vm->_lucerna->refreshObjectList();
-
-	if (_vm->_gyro->_holdTheDawn) {
-		_vm->_gyro->_holdTheDawn = false;
-		_vm->_lucerna->dawn();
-	}
-}
-
-bool Enid::thereWasAProblem() {
-	return _bug;
-}
-
-#endif
-
-void Enid::dir(Common::String where) { // OK, it worked in Avaricius, let's do it in Avalot!
-	warning("STUB: Enid::dir()");
-}
-void Enid::backToBootstrap(byte what) {
-	warning("STUB: Enid::back_to_bootstrap()");
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/enid.h b/engines/avalanche/enid.h
deleted file mode 100644
index 97e249e..0000000
--- a/engines/avalanche/enid.h
+++ /dev/null
@@ -1,78 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ENID		Edna's manager. Loads/saves files. */
-
-#ifndef AVALANCHE_ENID2_H
-#define AVALANCHE_ENID2_H
-
-#include "common/scummsys.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Enid {
-public:
-	Enid(AvalancheEngine *vm);
-	void dir(Common::String where);
-	void backToBootstrap(byte what);
-
-private:
-	AvalancheEngine *_vm;
-
-//  CHECKME: useless?
-//	static const Common::String kCrlf;
-//	static const char kTab, kEof;
-//	static const Common::String kEdnaFirst, kEdnaId, kWasHere;
-//	static const int16 kAge;
-//	void expandMonthName(Common::String x);
-//	Common::String expandDate(byte d, byte m, uint16 y);
-//	void ednaSave(Common::String name);
-//	void showBug(char icon, Common::String strn);
-//	bool testBug(byte what);
-//	void loadError(Common::String x, char icon);
-//	void ednaLoad(Common::String name);
-//	void showHeader();
-//	void toSundry(sundry &sund);
-//	void fromSundry(sundry sund);
-//	void avvyBackground();
-//	void ednaReload(); // From Bootstrap's storage.
-//	void restoreDna();
-//	bool thereWasAProblem();
-
-//	typedef char FourType[5];
-//	static const FourType kAvariciusFile;
-
-//	bool _bug;
-//	Common::String _path, _groi;
-//	Common::String _month, _day;
-
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_ENID2_H
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 31a8874..e848442 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -34,7 +34,6 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/enid.h"
 #include "avalanche/celer.h"
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index aabf34c..0da172c 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -11,7 +11,6 @@ MODULE_OBJS = \
 	pingo.o \
 	scrolls.o \
 	lucerna.o \
-	enid.o \
 	celer.o \
 	sequence.o \
 	timer.o \
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 736a581..efe5bf3 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -35,7 +35,6 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/acci.h"
 #include "avalanche/sequence.h"
-#include "avalanche/enid.h"
 #include "avalanche/pingo.h"
 
 #include "common/textconsole.h"
@@ -350,7 +349,7 @@ void Timer::hangAround2() {
 
 	_vm->_gyro->_tiedUp = false;
 
-	_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
+	// _vm->_enid->backToBootstrap(1); Call the shoot-'em-up. TODO: Replace it with proper ScummVM-friendly function(s)! Do not remove until then!
 }
 
 void Timer::afterTheShootemup() {


Commit: cccc126d156f4f64445eb0eef43affe3a99a5080
    https://github.com/scummvm/scummvm/commit/cccc126d156f4f64445eb0eef43affe3a99a5080
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T06:17:37-07:00

Commit Message:
AVALANCHE: Convert index use from Pascal to C in Bearing()

Changed paths:
    engines/avalanche/celer.cpp
    engines/avalanche/lucerna.cpp



diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index f8b2604..94ef574 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -118,11 +118,12 @@ void Celer::updateBackgroundSprites() {
 
 		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
 			byte direction = 0;
-			if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
+			uint16 angle = _vm->_lucerna->bearing(1);
+			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
 				direction = 3;
-			else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
+			else if ((angle >= 293) && (angle <= 357))
 				direction = 2;
-			else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
+			else if ((angle >= 271) && (angle <= 292))
 				direction = 4;
 
 			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
@@ -152,7 +153,7 @@ void Celer::updateBackgroundSprites() {
 	case r__lustiesroom:
 		if (!(_vm->_gyro->_lustieIsAsleep)) {
 			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(2);
+			uint16 angle = _vm->_lucerna->bearing(1);
 			if ((_vm->_gyro->_roomTime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
@@ -196,7 +197,7 @@ void Celer::updateBackgroundSprites() {
 	case r__nottspub: {
 		// Bearing of Avvy from Port.
 		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(5);
+		uint16 angle = _vm->_lucerna->bearing(4);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 2; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
@@ -228,7 +229,7 @@ void Celer::updateBackgroundSprites() {
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(2);
+		uint16 angle = _vm->_lucerna->bearing(1);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 4; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index e848442..ac27ea6 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1217,7 +1217,7 @@ void Lucerna::majorRedraw() {
 uint16 Lucerna::bearing(byte whichPed) {
 	static const double rad2deg = 180 / 3.14; // Pi
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	PedType *curPed = &_vm->_gyro->_peds[whichPed - 1]; // Different array indexes in Pascal and C.
+	PedType *curPed = &_vm->_gyro->_peds[whichPed];
 
 	if (avvy->_x == curPed->_x)
 		return 0;


Commit: ecbd87353e74712a86b1dfe171629c01c729670a
    https://github.com/scummvm/scummvm/commit/ecbd87353e74712a86b1dfe171629c01c729670a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T06:50:05-07:00

Commit Message:
AVALANCHE: Convert index use from Pascal to C in walkTo()

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index a90e1f0..59aaa90 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -575,7 +575,7 @@ void Acci::storeInterrogation(byte interrogation) {
 			_vm->_gyro->_spareEvening.clear();
 		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
 		_vm->_scrolls->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
+		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
 		_vm->_gyro->_cardiffQuestionNum = 5;
@@ -1229,7 +1229,7 @@ void Acci::notInOrder() {
 void Acci::goToCauldron() {
 	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
 	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
-	_vm->_animation->_sprites[1].walkTo(2);
+	_vm->_animation->_sprites[1].walkTo(1);
 }
 
 /**
@@ -1899,7 +1899,7 @@ void Acci::doThat() {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
 					spr->init(1, false, _vm->_animation); // Avaricius
 					_vm->_animation->appearPed(2, 4);
-					spr->walkTo(5);
+					spr->walkTo(4);
 					spr->_callEachStepFl = true;
 					spr->_eachStepProc = Animation::kProcBackAndForth;
 					_vm->_gyro->_avariciusTalk = 14;
@@ -2065,7 +2065,7 @@ void Acci::doThat() {
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
 				_vm->_lucerna->incScore(7);
-				_vm->_animation->_sprites[1].walkTo(2);
+				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
 				_vm->_gyro->_whereIs[7] = 177;
@@ -2191,7 +2191,7 @@ void Acci::doThat() {
 			if (_vm->_gyro->_sittingInPub)
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
-				_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.
+				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else { // Default doodah.
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5f89ccb..8ece6b1 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -268,7 +268,7 @@ int8 AnimationType::getSign(int16 val) {
 }
 
 void AnimationType::walkTo(byte pedNum) {
-	PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum - 1]; // Pascal -> C conversion: different array indexes.
+	PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum];
 
 	setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y));
 	_homingX = curPed->_x - _info._xLength / 2;
@@ -766,7 +766,7 @@ void Animation::callSpecial(uint16 which) {
 		if (!_vm->_gyro->_arrowTriggered) {
 			_vm->_gyro->_arrowTriggered = true;
 			appearPed(2, 4); // The dart starts at ped 4, and...
-			_sprites[1].walkTo(5); // flies to ped 5.
+			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
@@ -794,7 +794,7 @@ void Animation::callSpecial(uint16 which) {
 			_vm->_scrolls->displayScrollChain('q', 36);
 			_vm->_gyro->_tiedUp = true;
 			_vm->_gyro->_friarWillTieYouUp = false;
-			_sprites[1].walkTo(3);
+			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
 			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 177; // Not here, then.
@@ -831,7 +831,7 @@ void Animation::callSpecial(uint16 which) {
 		if (!_vm->_gyro->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
-		_sprites[1].walkTo(4); // She walks to somewhere...
+		_sprites[1].walkTo(3); // She walks to somewhere...
 		_sprites[0].remove();     // Lose Avvy.
 		_vm->_gyro->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
@@ -1035,9 +1035,9 @@ void Animation::followAvalotY(byte tripnum) {
 void Animation::backAndForth(byte tripnum) {
 	if (!_sprites[tripnum]._homing) {
 		if (_sprites[tripnum]._facingDir == kDirRight)
-			_sprites[tripnum].walkTo(4);
+			_sprites[tripnum].walkTo(3);
 		else
-			_sprites[tripnum].walkTo(5);
+			_sprites[tripnum].walkTo(4);
 	}
 }
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index ac27ea6..cb9e0c9 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -463,7 +463,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
 					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
-					spr1->walkTo(5); // Walks up to greet you.
+					spr1->walkTo(4); // Walks up to greet you.
 				} else {
 					_vm->_animation->appearPed(2, 5); // Starts where he was before.
 					spr1->_facingDir = Animation::kDirLeft;
@@ -478,7 +478,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (_vm->_gyro->_crapulusWillTell) {
 				spr1->init(8, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				spr1->walkTo(4);
+				spr1->walkTo(3);
 				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_crapulusWillTell = false;
 			}
@@ -523,7 +523,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
-					spr1->walkTo(4); // ...and he walks up...
+					spr1->walkTo(3); // ...and he walks up...
 				} else {
 					// You've been here before.
 					_vm->_animation->appearPed(2, 4); // He's standing in your way straight away...
@@ -538,7 +538,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->appearPed(2, 1);
-			spr1->walkTo(2);
+			spr1->walkTo(1);
 			spr1->_vanishIfStill = true;
 			_vm->_gyro->_passedCwytalotInHerts = true;
 			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
@@ -563,7 +563,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				AnimationType *spr1 = &_vm->_animation->_sprites[1];
 				spr1->init(6, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				spr1->walkTo(3);
+				spr1->walkTo(2);
 				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 			}
 		}
@@ -588,7 +588,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			case 0 : // You've answered NONE of his questions.
 				spr1->init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(2, 2);
-				spr1->walkTo(3);
+				spr1->walkTo(2);
 				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
 				break;
 			case 5 :
@@ -727,7 +727,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		spr1->init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
 			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
-			spr1->walkTo(4); // Walks up to greet you.
+			spr1->walkTo(3); // Walks up to greet you.
 		} else {
 			_vm->_animation->appearPed(2, 4); // Starts where she was before.
 			spr1->_facingDir = Animation::kDirLeft;
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 6e1bb0b..0390eca 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1055,7 +1055,7 @@ void Scrolls::talkTo(byte whom) {
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
-		spr->walkTo(3); // Walks away.
+		spr->walkTo(2); // Walks away.
 
 		_vm->_lucerna->incScore(2);
 	}
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index efe5bf3..2380eb5 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -273,7 +273,7 @@ void Timer::bang2() {
 
 void Timer::stairs() {
 	_vm->_gyro->blip();
-	_vm->_animation->_sprites[0].walkTo(4);
+	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 	_vm->_gyro->_brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
@@ -316,8 +316,8 @@ void Timer::getTiedUp() {
 }
 
 void Timer::getTiedUp2() {
-	_vm->_animation->_sprites[0].walkTo(4);
-	_vm->_animation->_sprites[1].walkTo(5);
+	_vm->_animation->_sprites[0].walkTo(3);
+	_vm->_animation->_sprites[1].walkTo(4);
 	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_gyro->_friarWillTieYouUp = true;
 }
@@ -330,7 +330,7 @@ void Timer::hangAround() {
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
 	_vm->_animation->appearPed(1, 2);
 	_vm->_scrolls->displayScrollChain('q', 39);
-	avvy->walkTo(7);
+	avvy->walkTo(6);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
@@ -338,7 +338,7 @@ void Timer::hangAround2() {
 	_vm->_scrolls->displayScrollChain('q', 40);
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
-	spr->walkTo(4);
+	spr->walkTo(3);
 	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
 	_vm->_scrolls->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
@@ -430,7 +430,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->init(9, false, _vm->_animation); // Here comes the Duke.
 	_vm->_animation->appearPed(2, 1); // He starts at the door...
-	spr->walkTo(3); // He walks over to you.
+	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -443,7 +443,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 void Timer::naughtyDuke2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	_vm->_scrolls->displayScrollChain('q', 48); // "Ha ha, it worked again!"
-	spr->walkTo(1); // Walk to the door.
+	spr->walkTo(0); // Walk to the door.
 	spr->_vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
@@ -587,7 +587,7 @@ void Timer::robinHoodAndGeida() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation);
 	_vm->_animation->appearPed(1, 7);
-	avvy->walkTo(6);
+	avvy->walkTo(5);
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->stopWalk();
@@ -601,8 +601,8 @@ void Timer::robinHoodAndGeidaTalk() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	AnimationType *spr = &_vm->_animation->_sprites[1];
-	avvy->walkTo(2);
-	spr->walkTo(2);
+	avvy->walkTo(1);
+	spr->walkTo(1);
 	avvy->_vanishIfStill = true;
 	spr->_vanishIfStill = true;
 


Commit: ddd7a95737c3222a786298f868234a613413b5ec
    https://github.com/scummvm/scummvm/commit/ddd7a95737c3222a786298f868234a613413b5ec
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T07:01:05-07:00

Commit Message:
AVALANCHE: Convert index use from Pascal to C in appearPed()

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 59aaa90..d15e6d0 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1299,12 +1299,12 @@ void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_standingOnDais) { // Clamber up.
 		_vm->_scrolls->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_standingOnDais = false;
-		_vm->_animation->appearPed(1, 3);
+		_vm->_animation->appearPed(1, 2);
 	} else { // Clamber down.
 		if (_vm->_animation->inField(1)) {
 			_vm->_scrolls->displayText("You clamber up onto the dais.");
 			_vm->_gyro->_standingOnDais = true;
-			_vm->_animation->appearPed(1, 2);
+			_vm->_animation->appearPed(1, 1);
 		} else
 			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
 	}
@@ -1325,7 +1325,7 @@ void Acci::standUp() {
 			}
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
-			_vm->_animation->appearPed(1, 2);
+			_vm->_animation->appearPed(1, 1);
 			_vm->_animation->_direction = Animation::kDirLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
@@ -1343,7 +1343,7 @@ void Acci::standUp() {
 		if (_vm->_gyro->_sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
-			_vm->_animation->appearPed(1, 4); // And walking away.
+			_vm->_animation->appearPed(1, 3); // And walking away.
 			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
 			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
 		} else
@@ -1898,7 +1898,7 @@ void Acci::doThat() {
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
 					spr->init(1, false, _vm->_animation); // Avaricius
-					_vm->_animation->appearPed(2, 4);
+					_vm->_animation->appearPed(2, 3);
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
 					spr->_eachStepProc = Animation::kProcBackAndForth;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 8ece6b1..0247182 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -727,7 +727,7 @@ void Animation::catacombMove(byte ped) {
 	if ((_vm->_gyro->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
-		appearPed(2, geidaPed(ped));
+		appearPed(2, geidaPed(ped) - 1);
 		_sprites[1]._callEachStepFl = true;
 		_sprites[1]._eachStepProc = kProcGeida;
 	}
@@ -765,7 +765,7 @@ void Animation::callSpecial(uint16 which) {
 
 		if (!_vm->_gyro->_arrowTriggered) {
 			_vm->_gyro->_arrowTriggered = true;
-			appearPed(2, 4); // The dart starts at ped 4, and...
+			appearPed(2, 3); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
@@ -853,13 +853,13 @@ void Animation::callSpecial(uint16 which) {
 			return;
 		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
-			appearPed(1, 12);
+			appearPed(1, 11);
 			break;
 		case 0x3:
-			appearPed(1, 11);
+			appearPed(1, 10);
 			break;
 		default:
-			appearPed(1, 4);
+			appearPed(1, 3);
 		}
 		dawnDelay();
 		break;
@@ -869,7 +869,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(1);
 		if (_vm->_gyro->_room != r__catacombs)
 			return;
-		appearPed(1, 1);
+		appearPed(1, 0);
 		dawnDelay();
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
@@ -878,7 +878,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(2);
 		if (_vm->_gyro->_room != r__catacombs)
 			return;
-		appearPed(1, 2);
+		appearPed(1, 1);
 		dawnDelay();
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
@@ -887,7 +887,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(3);
 		if (_vm->_gyro->_room != r__catacombs)
 			return;
-		appearPed(1, 3);
+		appearPed(1, 2);
 		dawnDelay();
 		break;
 	}
@@ -935,7 +935,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 				_vm->_sequence->startToClose();
 				return;
 			} else {
-				appearPed(1, 6);
+				appearPed(1, 5);
 				_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
 				_vm->_sequence->firstShow(8);
 				_vm->_sequence->thenShow(9);
@@ -1005,7 +1005,7 @@ void Animation::changeDirection(byte t, byte dir) {
 
 void Animation::appearPed(byte sprNum, byte pedNum) {
 	AnimationType *curSpr = &_sprites[sprNum - 1];
-	PedType *curPed = &_vm->_gyro->_peds[pedNum - 1];
+	PedType *curPed = &_vm->_gyro->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
 	changeDirection(sprNum - 1, curPed->_direction);
 }
@@ -1294,7 +1294,7 @@ void Animation::hideInCupboard() {
 		} else {
 			_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
-			appearPed(1, 3); // Walk out of the cupboard.
+			appearPed(1, 2); // Walk out of the cupboard.
 			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
@@ -1344,7 +1344,7 @@ void Animation::flipRoom(byte room, byte ped) {
 		_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterRoom(room, ped);
-	appearPed(1, ped);
+	appearPed(1, ped - 1);
 	_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
 	_oldDirection = _direction;
 	_direction = _sprites[0]._facingDir;
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index cb9e0c9..dd0a647 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -415,7 +415,7 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
 	AnimationType *spr1 = &_vm->_animation->_sprites[1];
 
 	spr1->init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->appearPed(2, whichPed);
+	_vm->_animation->appearPed(2, whichPed - 1);
 	spr1->_callEachStepFl = true;
 	spr1->_eachStepProc = Animation::kProcGeida;
 }
@@ -462,10 +462,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				spr1->init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
-					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
+					_vm->_animation->appearPed(2, 3); // Start on the right-hand side of the screen.
 					spr1->walkTo(4); // Walks up to greet you.
 				} else {
-					_vm->_animation->appearPed(2, 5); // Starts where he was before.
+					_vm->_animation->appearPed(2, 4); // Starts where he was before.
 					spr1->_facingDir = Animation::kDirLeft;
 				}
 
@@ -477,7 +477,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			if (_vm->_gyro->_crapulusWillTell) {
 				spr1->init(8, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->appearPed(2, 1);
 				spr1->walkTo(3);
 				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_crapulusWillTell = false;
@@ -497,7 +497,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (ped > 0) {
 				spr1->init(2, false, _vm->_animation); // load Spludwick
-				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->appearPed(2, 1);
 				_vm->_gyro->_whereIs[1] = r__spludwicks;
 			}
 
@@ -522,11 +522,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 
 				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
-					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
+					_vm->_animation->appearPed(2, 1); // He appears on the right of the screen...
 					spr1->walkTo(3); // ...and he walks up...
 				} else {
 					// You've been here before.
-					_vm->_animation->appearPed(2, 4); // He's standing in your way straight away...
+					_vm->_animation->appearPed(2, 3); // He's standing in your way straight away...
 					spr1->_facingDir = Animation::kDirLeft;
 				}
 			}
@@ -537,7 +537,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
-			_vm->_animation->appearPed(2, 1);
+			_vm->_animation->appearPed(2, 0);
 			spr1->walkTo(1);
 			spr1->_vanishIfStill = true;
 			_vm->_gyro->_passedCwytalotInHerts = true;
@@ -562,7 +562,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				// A welcome party... or maybe not...
 				AnimationType *spr1 = &_vm->_animation->_sprites[1];
 				spr1->init(6, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->appearPed(2, 1);
 				spr1->walkTo(2);
 				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 			}
@@ -587,7 +587,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			switch (_vm->_gyro->_cardiffQuestionNum) {
 			case 0 : // You've answered NONE of his questions.
 				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->appearPed(2, 1);
 				spr1->walkTo(2);
 				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
 				break;
@@ -596,7 +596,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				break; // You've answered ALL his questions. => nothing happens.
 			default: // You've answered SOME of his questions.
 				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 3);
+				_vm->_animation->appearPed(2, 2);
 				spr1->_facingDir = Animation::kDirRight;
 				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
@@ -726,10 +726,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		AnimationType *spr1 = &_vm->_animation->_sprites[1];
 		spr1->init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
-			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
+			_vm->_animation->appearPed(2, 1); // Start on the right-hand side of the screen.
 			spr1->walkTo(3); // Walks up to greet you.
 		} else {
-			_vm->_animation->appearPed(2, 4); // Starts where she was before.
+			_vm->_animation->appearPed(2, 3); // Starts where she was before.
 			spr1->_facingDir = Animation::kDirLeft;
 		}
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 2380eb5..faab01c 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -328,7 +328,7 @@ void Timer::hangAround() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
-	_vm->_animation->appearPed(1, 2);
+	_vm->_animation->appearPed(1, 1);
 	_vm->_scrolls->displayScrollChain('q', 39);
 	avvy->walkTo(6);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
@@ -358,7 +358,7 @@ void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
-	_vm->_animation->appearPed(1, 2);
+	_vm->_animation->appearPed(1, 1);
 	_vm->_gyro->_userMovesAvvy = true;
 	_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
@@ -429,7 +429,7 @@ void Timer::jacquesWakesUp() {
 void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->init(9, false, _vm->_animation); // Here comes the Duke.
-	_vm->_animation->appearPed(2, 1); // He starts at the door...
+	_vm->_animation->appearPed(2, 0); // He starts at the door...
 	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
@@ -586,7 +586,7 @@ void Timer::riseUpOubliette() {
 void Timer::robinHoodAndGeida() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation);
-	_vm->_animation->appearPed(1, 7);
+	_vm->_animation->appearPed(1, 6);
 	avvy->walkTo(5);
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -615,7 +615,7 @@ void Timer::avalotReturns() {
 	avvy->remove();
 	spr->remove();
 	avvy->init(0, true, _vm->_animation);
-	_vm->_animation->appearPed(1, 1);
+	_vm->_animation->appearPed(1, 0);
 	_vm->_scrolls->displayScrollChain('q', 67);
 	_vm->_gyro->_userMovesAvvy = true;
 }


Commit: 83ee99a3814a33d1a9e174cf3b6379d741a516ef
    https://github.com/scummvm/scummvm/commit/83ee99a3814a33d1a9e174cf3b6379d741a516ef
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T07:26:25-07:00

Commit Message:
AVALANCHE: Convert index use from Pascal to C in putGeidaAt()

Changed paths:
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h



diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index dd0a647..097b5da 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -407,15 +407,13 @@ void Lucerna::enterNewTown() {
 	}
 }
 
-
-
-void Lucerna::putGeidaAt(byte whichPed, byte &ped) {
+void Lucerna::putGeidaAt(byte whichPed, byte ped) {
 	if (ped == 0)
 		return;
 	AnimationType *spr1 = &_vm->_animation->_sprites[1];
 
 	spr1->init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->appearPed(2, whichPed - 1);
+	_vm->_animation->appearPed(2, whichPed);
 	spr1->_callEachStepFl = true;
 	spr1->_eachStepProc = Animation::kProcGeida;
 }
@@ -509,7 +507,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case r__brummieroad:
 		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(5, ped);
+			putGeidaAt(4, ped);
 		if (_vm->_gyro->_cwytalotGone) {
 			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
 			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
@@ -553,7 +551,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 		}
 		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 3, ped); // load Geida
+			putGeidaAt(ped + 2, ped); // load Geida
 		break;
 
 	case r__robins:
@@ -672,7 +670,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
 
 		if (_vm->_gyro->_geidaFollows) {
-			putGeidaAt(5, ped);
+			putGeidaAt(4, ped);
 			if (_vm->_gyro->_lustieIsAsleep) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_graphics->refreshBackground();
@@ -802,18 +800,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		break; // Ayles awake.
 
 	case r__geidas:
-		putGeidaAt(2, ped);
+		putGeidaAt(1, ped);
 		break; // load Geida
 
 	case r__easthall:
 	case r__westhall:
 		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 2, ped);
+			putGeidaAt(ped + 1, ped);
 		break;
 
 	case r__lusties:
 		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 6, ped);
+			putGeidaAt(ped + 5, ped);
 		break;
 
 	case r__nottspub:
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
index 9c1cc6c..87b1931 100644
--- a/engines/avalanche/lucerna.h
+++ b/engines/avalanche/lucerna.h
@@ -107,7 +107,7 @@ private:
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 	void enterNewTown();
 	void findPeople(byte room);
-	void putGeidaAt(byte whichPed, byte &ped);
+	void putGeidaAt(byte whichPed, byte ped);
 	void guideAvvy(Common::Point cursorPos);
 
 	// Will be used in dusk() and dawn().


Commit: d70b856da90ece5cc0d1e210a9992212a5da39a6
    https://github.com/scummvm/scummvm/commit/d70b856da90ece5cc0d1e210a9992212a5da39a6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T07:50:12-07:00

Commit Message:
AVALANCHE: Rename room number constans. Repair Lucerna::enterRoom().

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/roomnums.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index a90e1f0..390097a 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -700,16 +700,16 @@ void Acci::parse() {
 	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
-	if (_vm->_gyro->_room == r__nottspub)
+	if (_vm->_gyro->_room == kRoomNottsPub)
 		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
 		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
 	switch (_vm->_gyro->_room) {
-	case r__aylesoffice:
+	case kRoomAylesOffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;
-	case r__musicroom:
+	case kRoomMusicRoom:
 		replace(Common::String('\xCB'), 166); // Monk = Jacques
 		break;
 	default:
@@ -880,7 +880,7 @@ bool Acci::isHolding() {
 }
 
 void Acci::openBox(bool isOpening) {
-	if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) {
+	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		_vm->_celer->updateBackgroundSprites();
@@ -993,7 +993,7 @@ void Acci::swallow() {   // Eat something.
 		}
 		break;
 	default:
-		if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub))
+		if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub))
 			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
 		else
 			_vm->_scrolls->displayText("The taste of it makes you retch!");
@@ -1036,27 +1036,27 @@ void Acci::peopleInRoom() {
 void Acci::lookAround() {
 	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
 	switch (_vm->_gyro->_room) {
-	case r__spludwicks:
+	case kRoomSpludwicks:
 		if (_vm->_gyro->_avariciusTalk > 0)
 			_vm->_scrolls->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
-	case r__robins:
+	case kRoomRobins:
 		if (_vm->_gyro->_tiedUp)
 			_vm->_scrolls->displayScrollChain('q', 38);
 		if (_vm->_gyro->_mushroomGrowing)
 			_vm->_scrolls->displayScrollChain('q', 55);
 		break;
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		if (!_vm->_gyro->_takenPen)
 			_vm->_scrolls->displayScrollChain('q', 49);
 		break;
-	case r__lustiesroom:
+	case kRoomLustiesRoom:
 		if (_vm->_gyro->_lustieIsAsleep)
 			_vm->_scrolls->displayScrollChain('q', 65);
 		break;
-	case r__catacombs:
+	case kRoomCatacombs:
 		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
 		case 258 :
 			_vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery.
@@ -1077,7 +1077,7 @@ void Acci::lookAround() {
 void Acci::openDoor() {
 	// Special cases.
 	switch (_vm->_gyro->_room) {
-	case r__yours:
+	case kRoomYours:
 		if (_vm->_animation->inField(2)) {
 			// Opening the box.
 			_thing = 54; // The box.
@@ -1086,7 +1086,7 @@ void Acci::openDoor() {
 			return;
 		}
 		break;
-	case r__spludwicks:
+	case kRoomSpludwicks:
 		if (_thing == 61) {
 			_vm->_scrolls->displayScrollChain('q', 85);
 			return;
@@ -1094,7 +1094,7 @@ void Acci::openDoor() {
 		break;
 	}
 
-	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties))
+	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties))
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte i = 0; i < 7; i++) {
@@ -1124,7 +1124,7 @@ void Acci::openDoor() {
 		}
 	}
 
-	if (_vm->_gyro->_room == r__map)
+	if (_vm->_gyro->_room == kRoomMap)
 		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
@@ -1169,7 +1169,7 @@ void Acci::putProc() {
 		break;
 
 	case 54:
-		if (_vm->_gyro->_room == r__yours) { // Put something into the box.
+		if (_vm->_gyro->_room == kRoomYours) { // Put something into the box.
 			if (_vm->_gyro->_boxContent != kNothing)
 				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
@@ -1316,7 +1316,7 @@ void Acci::already() {
 
 void Acci::standUp() {
 	switch (_vm->_gyro->_room) {
-	case r__yours: // Avvy isn't asleep.
+	case kRoomYours: // Avvy isn't asleep.
 		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
 			if (_vm->_gyro->_teetotal) {
 				_vm->_scrolls->displayScrollChain('d', 12);
@@ -1335,11 +1335,11 @@ void Acci::standUp() {
 			already();
 		break;
 
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		cardiffClimbing();
 		break;
 
-	case r__nottspub:
+	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
@@ -1356,7 +1356,7 @@ void Acci::standUp() {
 
 void Acci::getProc(char thing) {
 	switch (_vm->_gyro->_room) {
-	case r__yours:
+	case kRoomYours:
 		if (_vm->_animation->inField(2)) {
 			if (_vm->_gyro->_boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
@@ -1372,7 +1372,7 @@ void Acci::getProc(char thing) {
 		} else
 			_vm->_scrolls->displayScrollChain('q', 57);
 		break;
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		switch (thing) {
 		case Gyro::kObjectPen:
 			if (_vm->_animation->inField(2)) { // Standing on the dais.
@@ -1399,7 +1399,7 @@ void Acci::getProc(char thing) {
 			_vm->_scrolls->displayScrollChain('q', 57);
 		}
 		break;
-	case r__robins:
+	case kRoomRobins:
 		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->displayText("Got it!");
@@ -1421,7 +1421,7 @@ void Acci::getProc(char thing) {
  * @remarks	Originally called 'give_Geida_the_lute'
  */
 void Acci::giveGeidaTheLute() {
-	if (_vm->_gyro->_room != r__lustiesroom) {
+	if (_vm->_gyro->_room != kRoomLustiesRoom) {
 		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 		_vm->_scrolls->displayText(tmpStr);
 		return;
@@ -1779,7 +1779,7 @@ void Acci::doThat() {
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
 			switch (_vm->_gyro->_room) { // They just typed "play"...
-			case r__argentpub: { // ...in the pub, => play Nim.
+			case kRoomArgentPub: { // ...in the pub, => play Nim.
 					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 					// play_nim();
 					// The following parts are copied from play_nim().
@@ -1814,7 +1814,7 @@ void Acci::doThat() {
 						+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
 				}
 				break;
-			case r__musicroom:
+			case kRoomMusicRoom:
 				playHarp();
 				break;
 			}
@@ -1830,13 +1830,13 @@ void Acci::doThat() {
 						_vm->_scrolls->displayScrollChain('U', 15);
 				break;
 			case 52:
-				if (_vm->_gyro->_room == r__musicroom)
+				if (_vm->_gyro->_room == kRoomMusicRoom)
 					playHarp();
 				else
 					_vm->_scrolls->displayText(kWhat);
 				break;
 			case 55:
-				if (_vm->_gyro->_room == r__argentpub)
+				if (_vm->_gyro->_room == kRoomArgentPub)
 					// play_nim();
 					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 				else
@@ -1946,7 +1946,7 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_room) {
-		case r__argentpub:
+		case kRoomArgentPub:
 			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
 				switch (_thing) {
 				case 51:
@@ -2007,7 +2007,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayScrollChain('D', 5); // Go to the bar!
 			break;
 
-		case r__outsideducks:
+		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(6)) {
 				if (_thing == Gyro::kObjectOnion) {
 					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
@@ -2034,7 +2034,7 @@ void Acci::doThat() {
 				_vm->_scrolls->displayScrollChain('D', 0);
 			break;
 
-		case r__nottspub:
+		case kRoomNottsPub:
 			_vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners.
 			break;
 		default:
@@ -2042,7 +2042,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeAttack:
-		if ((_vm->_gyro->_room == r__brummieroad) &&
+		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
 				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
 				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
 			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
@@ -2077,7 +2077,7 @@ void Acci::doThat() {
 			_vm->_scrolls->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
-		if (_vm->_gyro->_room != r__bridge)
+		if (_vm->_gyro->_room != kRoomBridge)
 			_vm->_scrolls->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
@@ -2143,7 +2143,7 @@ void Acci::doThat() {
 
 		break;
 	case kVerbCodeClimb:
-		if (_vm->_gyro->_room == r__insidecardiffcastle)
+		if (_vm->_gyro->_room == kRoomInsideCardiffCastle)
 			cardiffClimbing();
 		else // In the wrong room!
 			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
@@ -2187,7 +2187,7 @@ void Acci::doThat() {
 		}
 		break;
 	case kVerbCodeSit:
-		if (_vm->_gyro->_room == r__nottspub) {
+		if (_vm->_gyro->_room == kRoomNottsPub) {
 			if (_vm->_gyro->_sittingInPub)
 				_vm->_scrolls->displayText("You're already sitting!");
 			else {
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5f89ccb..ab90c27 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -439,20 +439,20 @@ void Animation::catacombMove(byte ped) {
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
-		flipRoom(r__lustiesroom, 4);
+		flipRoom(kRoomLustiesRoom, 4);
 		_vm->_scrolls->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033:{ // Oubliette
-		flipRoom(r__oubliette, 1);
+		flipRoom(kRoomOubliette, 1);
 		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 		_vm->_scrolls->displayText(tmpStr);
 		}
 		return;
 	case 4:
-		flipRoom(r__geidas, 1);
+		flipRoom(kRoomGeidas, 1);
 		return;
 	case 2307:
-		flipRoom(r__lusties, 5);
+		flipRoom(kRoomLusties, 5);
 		_vm->_scrolls->displayText("Oh no... here we go again...");
 		_vm->_gyro->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
@@ -849,7 +849,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_catacombY--;
 		catacombMove(4);
-		if (_vm->_gyro->_room != r__catacombs)
+		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
 		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
@@ -867,7 +867,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_catacombX++;
 		catacombMove(1);
-		if (_vm->_gyro->_room != r__catacombs)
+		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
 		appearPed(1, 1);
 		dawnDelay();
@@ -876,7 +876,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_catacombY += 1;
 		catacombMove(2);
-		if (_vm->_gyro->_room != r__catacombs)
+		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
 		appearPed(1, 2);
 		dawnDelay();
@@ -885,7 +885,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_lucerna->dusk();
 		_vm->_gyro->_catacombX--;
 		catacombMove(3);
-		if (_vm->_gyro->_room != r__catacombs)
+		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
 		appearPed(1, 3);
 		dawnDelay();
@@ -902,30 +902,30 @@ void Animation::callSpecial(uint16 which) {
  */
 void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	switch (_vm->_gyro->_room) {
-	case r__outsideyours:
-	case r__outsidenottspub:
-	case r__outsideducks:
+	case kRoomOutsideYours:
+	case kRoomOutsideNottsPub:
+	case kRoomOutsideDucks:
 		_vm->_sequence->firstShow(1);
 		_vm->_sequence->thenShow(2);
 		_vm->_sequence->thenShow(3);
 		break;
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		_vm->_sequence->firstShow(1);
 		_vm->_sequence->thenShow(5);
 		break;
-	case r__avvysgarden:
-	case r__entrancehall:
-	case r__insideabbey:
-	case r__yourhall:
+	case kRoomAvvysGarden:
+	case kRoomEntranceHall:
+	case kRoomInsideAbbey:
+	case kRoomYourHall:
 		_vm->_sequence->firstShow(1);
 		_vm->_sequence->thenShow(2);
 		break;
-	case r__musicroom:
-	case r__outsideargentpub:
+	case kRoomMusicRoom:
+	case kRoomOutsideArgentPub:
 		_vm->_sequence->firstShow(5);
 		_vm->_sequence->thenShow(6);
 		break;
-	case r__lusties:
+	case kRoomLusties:
 		switch (magicnum) {
 		case 14:
 			if (_vm->_gyro->_avvysInTheCupboard) {
@@ -1321,12 +1321,12 @@ void Animation::flipRoom(byte room, byte ped) {
 		return;
 	}
 
-	if ((room == 177) && (_vm->_gyro->_room == r__lusties)) {
+	if ((room == 177) && (_vm->_gyro->_room == kRoomLusties)) {
 		hideInCupboard();
 		return;
 	}
 
-	if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == r__insidecardiffcastle)) {
+	if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == kRoomInsideCardiffCastle)) {
 		// You can't *jump* out of Cardiff Castle!
 		_sprites[0]._moveX = 0;
 		return;
@@ -1340,7 +1340,7 @@ void Animation::flipRoom(byte room, byte ped) {
 			_sprites[i].remove();
 	} // Deallocate sprite
 
-	if (_vm->_gyro->_room == r__lustiesroom)
+	if (_vm->_gyro->_room == kRoomLustiesRoom)
 		_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterRoom(room, ped);
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index f8b2604..6a86bf7 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -58,23 +58,23 @@ void Celer::updateBackgroundSprites() {
 		return; // No animation when the menus are up.
 
 	switch (_vm->_gyro->_room) {
-	case r__outsideargentpub:
+	case kRoomOutsideArgentPub:
 		if ((_vm->_gyro->_roomTime % 12) == 0)
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
 		break;
-	case r__brummieroad:
+	case kRoomBrummieRoad:
 		if ((_vm->_gyro->_roomTime % 2) == 0)
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
-	case r__bridge:
+	case kRoomBridge:
 		if ((_vm->_gyro->_roomTime % 2) == 0)
 			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
-	case r__yours:
+	case kRoomYours:
 		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
 		break;
-	case r__argentpub:
+	case kRoomArgentPub:
 		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
 			// Malagauche cycle.
 			_vm->_gyro->_malagauche += 1;
@@ -131,7 +131,7 @@ void Celer::updateBackgroundSprites() {
 			}
 		}
 		break;
-	case r__westhall:
+	case kRoomWestHall:
 		if ((_vm->_gyro->_roomTime % 3) == 0) {
 			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
 			case 4:
@@ -149,7 +149,7 @@ void Celer::updateBackgroundSprites() {
 			}
 		}
 		break;
-	case r__lustiesroom:
+	case kRoomLustiesRoom:
 		if (!(_vm->_gyro->_lustieIsAsleep)) {
 			byte direction = 0;
 			uint16 angle = _vm->_lucerna->bearing(2);
@@ -169,7 +169,7 @@ void Celer::updateBackgroundSprites() {
 			}
 		}
 		break;
-	case r__aylesoffice:
+	case kRoomAylesOffice:
 		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
 			switch ((_vm->_gyro->_roomTime / 14) % 2) {
 			case 0:
@@ -181,7 +181,7 @@ void Celer::updateBackgroundSprites() {
 			}
 		}
 		break;
-	case r__robins:
+	case kRoomRobins:
 		if (_vm->_gyro->_tiedUp) {
 			switch (_vm->_gyro->_roomTime % 54) {
 			case 20:
@@ -193,7 +193,7 @@ void Celer::updateBackgroundSprites() {
 			}
 		}
 		break;
-	case r__nottspub: {
+	case kRoomNottsPub: {
 		// Bearing of Avvy from Port.
 		byte direction = 0;
 		uint16 angle = _vm->_lucerna->bearing(5);
@@ -222,7 +222,7 @@ void Celer::updateBackgroundSprites() {
 		}
 		break;
 	  }
-	case r__ducks: {
+	case kRoomDucks: {
 		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
 			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3);
 
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 1e95c6b..5cc877d 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -143,29 +143,29 @@ const TuneType Gyro::kTune = {
 
 byte Gyro::_whereIs[29] = {
 	// The Lads
-	r__yours, // Avvy
-	r__spludwicks, // Spludwick
-	r__outsideyours, // Crapulus
-	r__ducks, // Duck - r__DucksRoom's not defined yet.
-	r__argentpub, // Malagauche
-	r__robins, // Friar Tuck.
+	kRoomYours, // Avvy
+	kRoomSpludwicks, // Spludwick
+	kRoomOutsideYours, // Crapulus
+	kRoomDucks, // Duck - r__DucksRoom's not defined yet.
+	kRoomArgentPub, // Malagauche
+	kRoomRobins, // Friar Tuck.
 	177, // Robin Hood - can't meet him at the start.
-	r__brummieroad, // Cwytalot
-	r__lustiesroom, // Baron du Lustie.
-	r__outsidecardiffcastle, // The Duke of Cardiff.
-	r__argentpub, // Dogfood
-	r__outsideducks, // Trader
-	r__argentpub, // Ibythneth
-	r__aylesoffice, // Ayles
-	r__nottspub, // Port
-	r__nottspub, // Spurge
-	r__musicroom, // Jacques
+	kRoomBrummieRoad, // Cwytalot
+	kRoomLustiesRoom, // Baron du Lustie.
+	kRoomOutsideCardiffCastle, // The Duke of Cardiff.
+	kRoomArgentPub, // Dogfood
+	kRoomOutsideDucks, // Trader
+	kRoomArgentPub, // Ibythneth
+	kRoomAylesOffice, // Ayles
+	kRoomNottsPub, // Port
+	kRoomNottsPub, // Spurge
+	kRoomMusicRoom, // Jacques
 	0, 0, 0, 0, 0, 0, 0, 0,
 	// The Lasses
-	r__yours, // Arkata
-	r__geidas, // Geida
+	kRoomYours, // Arkata
+	kRoomGeidas, // Geida
 	177, // nobody allocated here!
-	r__wisewomans  // The Wise Woman.
+	kRoomWiseWomans  // The Wise Woman.
 };
 
 Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
@@ -510,25 +510,25 @@ Common::String Gyro::getItem(byte which) {
 
 Common::String Gyro::f5Does() {
 	switch (_room) {
-	case r__yours:
+	case kRoomYours:
 		if (!_avvyIsAwake)
 			return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
 		else if (_avvyInBed)
 			return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
 		break;
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		if (_standingOnDais)
 			return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
 		else
 			return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
 		break;
-	case r__nottspub:
+	case kRoomNottsPub:
 		if (_sittingInPub)
 			return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
 		else
 			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
 		break;
-	case r__musicroom:
+	case kRoomMusicRoom:
 		if (_vm->_animation->inField(7))
 			return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay);
 		break;
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index e848442..7d1e35d 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -345,21 +345,21 @@ void Lucerna::exitRoom(byte x) {
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
-	case r__spludwicks:
+	case kRoomSpludwicks:
 		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
 		 _vm->_gyro->_avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
-	case r__bridge:
+	case kRoomBridge:
 		if (_vm->_gyro->_drawbridgeOpen > 0) {
 			_vm->_gyro->_drawbridgeOpen = 4; // Fully open.
 			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
 		}
 		break;
-	case r__outsidecardiffcastle:
+	case kRoomOutsideCardiffCastle:
 		_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey);
 		break;
-	case r__robins:
+	case kRoomRobins:
 		_vm->_timer->loseTimer(Timer::kReasonGettingTiedUp);
 		break;
 	}
@@ -369,7 +369,7 @@ void Lucerna::exitRoom(byte x) {
 	_vm->_gyro->_seeScroll = false; // Now it can work again!
 
 	_vm->_gyro->_lastRoom = _vm->_gyro->_room;
-	if (_vm->_gyro->_room != r__map)
+	if (_vm->_gyro->_room != kRoomMap)
 		_vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room;
 }
 
@@ -383,13 +383,13 @@ void Lucerna::enterNewTown() {
 	_vm->_dropdown->setupMenu();
 
 	switch (_vm->_gyro->_room) {
-	case r__outsidenottspub: // Entry into Nottingham.
-		if ((_vm->_gyro->_roomCount[r__robins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
+	case kRoomOutsideNottsPub: // Entry into Nottingham.
+		if ((_vm->_gyro->_roomCount[kRoomRobins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
 			_vm->_gyro->_mushroomGrowing = true;
 		break;
-	case r__wisewomans: { // Entry into Argent.
+	case kRoomWiseWomans: { // Entry into Argent.
 		if (_vm->_gyro->_talkedToCrapulus && (!_vm->_gyro->_lustieIsAsleep)) {
-			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1);
+			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[kRoomWiseWomans] % 3) == 1);
 			_vm->_gyro->_crapulusWillTell = !_vm->_gyro->_spludwickAtHome;
 		} else {
 			_vm->_gyro->_spludwickAtHome = true;
@@ -401,7 +401,7 @@ void Lucerna::enterNewTown() {
 	break;
 	}
 
-	if (_vm->_gyro->_room != r__outsideducks) {
+	if (_vm->_gyro->_room != kRoomOutsideDucks) {
 		if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar))
 			_vm->_gyro->_rottenOnion = true; // You're holding the onion
 	}
@@ -441,12 +441,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	_vm->_gyro->_roomTime = 0;
 
 
-	if ((_vm->_gyro->_lastRoom == r__map) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room))
+	if ((_vm->_gyro->_lastRoom == kRoomMap) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room))
 		enterNewTown();
 
 
 	switch (room) {
-	case r__yours:
+	case kRoomYours:
 		if (_vm->_gyro->_avvyInBed) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
@@ -454,14 +454,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__outsideyours:
+	case kRoomOutsideYours:
 		if (ped > 0) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (!_vm->_gyro->_talkedToCrapulus) {
-				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomOutsideYours;
 				spr1->init(8, false, _vm->_animation); // load Crapulus
 
-				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
+				if (_vm->_gyro->_roomCount[kRoomOutsideYours] == 1) {
 					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
 					spr1->walkTo(5); // Walks up to greet you.
 				} else {
@@ -473,7 +473,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
 
 			} else
-				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomNowhere;
 
 			if (_vm->_gyro->_crapulusWillTell) {
 				spr1->init(8, false, _vm->_animation);
@@ -485,43 +485,43 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__outsidespludwicks:
-		if ((_vm->_gyro->_roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
+	case kRoomOutsideSpludwicks:
+		if ((_vm->_gyro->_roomCount[kRoomOutsideSpludwicks] == 1) && (ped == 1)) {
 			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
 			_vm->_gyro->_spludwickAtHome = true;
 		}
 		break;
 
-	case r__spludwicks:
+	case kRoomSpludwicks:
 		if (_vm->_gyro->_spludwickAtHome) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (ped > 0) {
 				spr1->init(2, false, _vm->_animation); // load Spludwick
 				_vm->_animation->appearPed(2, 2);
-				_vm->_gyro->_whereIs[1] = r__spludwicks;
+				_vm->_gyro->_whereIs[1] = kRoomSpludwicks;
 			}
 
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcGeida;
 		} else
-			_vm->_gyro->_whereIs[1] = r__nowhere;
+			_vm->_gyro->_whereIs[1] = kRoomNowhere;
 		break;
 
-	case r__brummieroad:
+	case kRoomBrummieRoad:
 		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(5, ped);
 		if (_vm->_gyro->_cwytalotGone) {
 			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
-			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
+			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomNowhere;
 		} else {
 			if (ped > 0) {
 				AnimationType *spr1 = &_vm->_animation->_sprites[1];
 				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
 				spr1->_callEachStepFl = true;
 				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
-				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomBrummieRoad;
 
-				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
+				if (_vm->_gyro->_roomCount[kRoomBrummieRoad] == 1) { // First time here...
 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
 					spr1->walkTo(4); // ...and he walks up...
 				} else {
@@ -533,8 +533,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__argentroad:
-		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
+	case kRoomArgentRoad:
+		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[kRoomArgentRoad] > 3)) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
 			_vm->_animation->appearPed(2, 1);
@@ -546,7 +546,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__bridge:
+	case kRoomBridge:
 		if (_vm->_gyro->_drawbridgeOpen == 4) { // open
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
@@ -556,7 +556,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			putGeidaAt(ped + 3, ped); // load Geida
 		break;
 
-	case r__robins:
+	case kRoomRobins:
 		if (ped > 0) {
 			if (!_vm->_gyro->_beenTiedUp) {
 				// A welcome party... or maybe not...
@@ -581,7 +581,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		_vm->_graphics->refreshBackground();
 		break;
 
-	case r__outsidecardiffcastle:
+	case kRoomOutsideCardiffCastle:
 		if (ped > 0) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			switch (_vm->_gyro->_cardiffQuestionNum) {
@@ -608,12 +608,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_gyro->_interrogation = 0;
 		break;
 
-	case r__map:
+	case kRoomMap:
 		// You're entering the map.
 		dawn();
 		//setactivepage(cp);
 		if (ped > 0)
-			zoomOut(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y);
+			zoomOut(_vm->_gyro->_peds[ped]._x, _vm->_gyro->_peds[ped]._y);
 		//setactivepage(1 - cp);
 
 		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
@@ -625,7 +625,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		_vm->_scrolls->displayScrollChain('q', 69);
 		break;
 
-	case r__catacombs:
+	case kRoomCatacombs:
 		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
 
 			switch (ped) {
@@ -652,7 +652,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__argentpub:
+	case kRoomArgentPub:
 		if (_vm->_gyro->_wonNim)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
 		_vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
@@ -663,7 +663,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		_vm->_graphics->refreshBackground();
 		break;
 
-	case r__lustiesroom:
+	case kRoomLustiesRoom:
 		_vm->_gyro->_npcFacing = 1; // du Lustie.
 		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
 			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
@@ -680,7 +680,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__musicroom:
+	case kRoomMusicRoom:
 		if (_vm->_gyro->_jacquesState > 0) {
 			_vm->_gyro->_jacquesState = 5;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
@@ -699,7 +699,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__outsidenottspub:
+	case kRoomOutsideNottsPub:
 		if (ped == 2) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_graphics->refreshBackground();
@@ -711,7 +711,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__outsideargentpub:
+	case kRoomOutsideArgentPub:
 		if (ped == 2)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 			_vm->_graphics->refreshBackground();
@@ -722,10 +722,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__wisewomans: {
+	case kRoomWiseWomans: {
 		AnimationType *spr1 = &_vm->_animation->_sprites[1];
 		spr1->init(11, false, _vm->_animation);
-		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
+		if ((_vm->_gyro->_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
 			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
 			spr1->walkTo(4); // Walks up to greet you.
 		} else {
@@ -738,7 +738,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__insidecardiffcastle:
+	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
 			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
 			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
@@ -763,7 +763,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__avvysgarden:
+	case kRoomAvvysGarden:
 		if (ped == 1)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
@@ -774,9 +774,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__entrancehall:
-	case r__insideabbey:
-	case r__yourhall:
+	case kRoomEntranceHall:
+	case kRoomInsideAbbey:
+	case kRoomYourHall:
 		if (ped == 2)  {
 #if 0
 			// It was the original:
@@ -795,34 +795,34 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__aylesoffice:
+	case kRoomAylesOffice:
 		if (_vm->_gyro->_aylesIsAwake)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
 
-	case r__geidas:
+	case kRoomGeidas:
 		putGeidaAt(2, ped);
 		break; // load Geida
 
-	case r__easthall:
-	case r__westhall:
+	case kRoomEastHall:
+	case kRoomWestHall:
 		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(ped + 2, ped);
 		break;
 
-	case r__lusties:
+	case kRoomLusties:
 		if (_vm->_gyro->_geidaFollows)
 			putGeidaAt(ped + 6, ped);
 		break;
 
-	case r__nottspub:
+	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_npcFacing = 1; // Port.
 		break;
 
-	case r__outsideducks:
+	case kRoomOutsideDucks:
 		if (ped == 2) {
 			// Shut the door
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
@@ -835,7 +835,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 		break;
 
-	case r__ducks:
+	case kRoomDucks:
 		_vm->_gyro->_npcFacing = 1; // Duck.
 		break; 
 	}
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index e623c27..c87fc4c 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -32,56 +32,42 @@
 
 namespace Avalanche {
 
-const byte r__nowhere = 0;
-const byte r__yours = 1;
-const byte r__outsideyours = 2;
-const byte r__outsidespludwicks = 3;
-const byte r__yourhall = 5;
-const byte r__musicroom = 7;
-const byte r__outsideargentpub = 9;
-const byte r__argentroad = 10;
-const byte r__wisewomans = 11;
-const byte r__spludwicks = 12;
-const byte r__insideabbey = 13;
-const byte r__outsideabbey = 14; // assumed
-const byte r__avvysgarden = 15;
-const byte r__aylesoffice = 16;
-const byte r__argentpub = 19;
-const byte r__brummieroad = 20;
-const byte r__bridge = 21; // ? not sure
-const byte r__lusties = 22;
-const byte r__lustiesroom = 23;
-const byte r__westhall = 25;
-const byte r__easthall = 26;
-const byte r__oubliette = 27;
-const byte r__geidas = 28;
-const byte r__catacombs = 29;
-
-//{ -------------- }
-
-const byte r__entrancehall = 40;
-const byte r__robins = 42;
-const byte r__outsidenottspub = 46;
-const byte r__nottspub = 47;
-
-//{ -------------- }
-
-const byte r__outsideducks = 50;
-const byte r__ducks = 51;
-
-//{ -------------- }
-
-const byte r__outsidecardiffcastle = 70;
-const byte r__insidecardiffcastle = 71;
-
-//{ -------------- }
-
-// place80 appears to be bogus
-
-//{ -------------- }
-
-const byte r__bosskey = 98; // assumed
-const byte r__map = 99;
+enum Room {
+	kRoomNowhere = 0,
+	kRoomYours = 1,
+	kRoomOutsideYours = 2,
+	kRoomOutsideSpludwicks = 3,
+	kRoomYourHall = 5,
+	kRoomMusicRoom = 7,
+	kRoomOutsideArgentPub = 9,
+	kRoomArgentRoad = 10,
+	kRoomWiseWomans = 11,
+	kRoomSpludwicks = 12,
+	kRoomInsideAbbey = 13,
+	kRoomOutsideAbbey = 14,
+	kRoomAvvysGarden = 15,
+	kRoomAylesOffice = 16,
+	kRoomArgentPub = 19,
+	kRoomBrummieRoad = 20,
+	kRoomBridge = 21, 
+	kRoomLusties = 22,
+	kRoomLustiesRoom = 23,
+	kRoomWestHall = 25,
+	kRoomEastHall = 26,
+	kRoomOubliette = 27,
+	kRoomGeidas = 28,
+	kRoomCatacombs = 29,
+	kRoomEntranceHall = 40,
+	kRoomRobins = 42,
+	kRoomOutsideNottsPub = 46,
+	kRoomNottsPub = 47,
+	kRoomOutsideDucks = 50,
+	kRoomDucks = 51,
+	kRoomOutsideCardiffCastle = 70,
+	kRoomInsideCardiffCastle = 71,
+	kRoomBossKey = 98, // assumed
+	kRoomMap = 99
+};
 
 } // End of namespace Avalanche
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index efe5bf3..8cc21fd 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -327,7 +327,7 @@ void Timer::hangAround() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
-	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
+	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins;
 	_vm->_animation->appearPed(1, 2);
 	_vm->_scrolls->displayScrollChain('q', 39);
 	avvy->walkTo(7);
@@ -339,7 +339,7 @@ void Timer::hangAround2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(4);
-	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
+	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomRobins;
 	_vm->_scrolls->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -485,7 +485,7 @@ void Timer::jump() {
 	}
 
 	if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_gyro->_room == r__insidecardiffcastle)
+			&& (_vm->_gyro->_room == kRoomInsideCardiffCastle)
 			&& (_vm->_gyro->_arrowInTheDoor == true)
 			&& (_vm->_animation->inField(3))) { // Beside the wall
 		// Grab the arrow!


Commit: 98cb1cd52b99713db26ac3724d0968fa2f20a959
    https://github.com/scummvm/scummvm/commit/98cb1cd52b99713db26ac3724d0968fa2f20a959
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T07:54:56-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Conflicts:
	engines/avalanche/lucerna.cpp
	engines/avalanche/timer.cpp

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/lucerna.h
    engines/avalanche/scrolls.cpp
    engines/avalanche/timer.cpp



diff --cc engines/avalanche/animation.cpp
index ab90c27,0247182..eaf74fa
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@@ -867,27 -867,27 +867,27 @@@ void Animation::callSpecial(uint16 whic
  		_vm->_lucerna->dusk();
  		_vm->_gyro->_catacombX++;
  		catacombMove(1);
 -		if (_vm->_gyro->_room != r__catacombs)
 +		if (_vm->_gyro->_room != kRoomCatacombs)
  			return;
- 		appearPed(1, 1);
+ 		appearPed(1, 0);
  		dawnDelay();
  		break;
  	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
  		_vm->_lucerna->dusk();
  		_vm->_gyro->_catacombY += 1;
  		catacombMove(2);
 -		if (_vm->_gyro->_room != r__catacombs)
 +		if (_vm->_gyro->_room != kRoomCatacombs)
  			return;
- 		appearPed(1, 2);
+ 		appearPed(1, 1);
  		dawnDelay();
  		break;
  	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
  		_vm->_lucerna->dusk();
  		_vm->_gyro->_catacombX--;
  		catacombMove(3);
 -		if (_vm->_gyro->_room != r__catacombs)
 +		if (_vm->_gyro->_room != kRoomCatacombs)
  			return;
- 		appearPed(1, 3);
+ 		appearPed(1, 2);
  		dawnDelay();
  		break;
  	}
diff --cc engines/avalanche/celer.cpp
index 6a86bf7,94ef574..e3aafdb
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@@ -149,10 -150,10 +150,10 @@@ void Celer::updateBackgroundSprites() 
  			}
  		}
  		break;
 -	case r__lustiesroom:
 +	case kRoomLustiesRoom:
  		if (!(_vm->_gyro->_lustieIsAsleep)) {
  			byte direction = 0;
- 			uint16 angle = _vm->_lucerna->bearing(2);
+ 			uint16 angle = _vm->_lucerna->bearing(1);
  			if ((_vm->_gyro->_roomTime % 45) > 42)
  				direction = 4; // du Lustie blinks.
  			// Bearing of Avvy from du Lustie.
@@@ -193,10 -194,10 +194,10 @@@
  			}
  		}
  		break;
 -	case r__nottspub: {
 +	case kRoomNottsPub: {
  		// Bearing of Avvy from Port.
  		byte direction = 0;
- 		uint16 angle = _vm->_lucerna->bearing(5);
+ 		uint16 angle = _vm->_lucerna->bearing(4);
  		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
  			direction = 2; // Middle.
  		else if ((angle >= 45) && (angle <= 180))
diff --cc engines/avalanche/lucerna.cpp
index 7d1e35d,097b5da..c735346
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@@ -458,14 -456,14 +456,14 @@@ void Lucerna::enterRoom(byte room, byt
  		if (ped > 0) {
  			AnimationType *spr1 = &_vm->_animation->_sprites[1];
  			if (!_vm->_gyro->_talkedToCrapulus) {
 -				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
 +				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomOutsideYours;
  				spr1->init(8, false, _vm->_animation); // load Crapulus
  
 -				if (_vm->_gyro->_roomCount[r__outsideyours] == 1) {
 +				if (_vm->_gyro->_roomCount[kRoomOutsideYours] == 1) {
- 					_vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen.
- 					spr1->walkTo(5); // Walks up to greet you.
+ 					_vm->_animation->appearPed(2, 3); // Start on the right-hand side of the screen.
+ 					spr1->walkTo(4); // Walks up to greet you.
  				} else {
- 					_vm->_animation->appearPed(2, 5); // Starts where he was before.
+ 					_vm->_animation->appearPed(2, 4); // Starts where he was before.
  					spr1->_facingDir = Animation::kDirLeft;
  				}
  
@@@ -497,48 -495,48 +495,48 @@@
  			AnimationType *spr1 = &_vm->_animation->_sprites[1];
  			if (ped > 0) {
  				spr1->init(2, false, _vm->_animation); // load Spludwick
- 				_vm->_animation->appearPed(2, 2);
+ 				_vm->_animation->appearPed(2, 1);
 -				_vm->_gyro->_whereIs[1] = r__spludwicks;
 +				_vm->_gyro->_whereIs[1] = kRoomSpludwicks;
  			}
  
  			spr1->_callEachStepFl = true;
  			spr1->_eachStepProc = Animation::kProcGeida;
  		} else
 -			_vm->_gyro->_whereIs[1] = r__nowhere;
 +			_vm->_gyro->_whereIs[1] = kRoomNowhere;
  		break;
  
 -	case r__brummieroad:
 +	case kRoomBrummieRoad:
  		if (_vm->_gyro->_geidaFollows)
- 			putGeidaAt(5, ped);
+ 			putGeidaAt(4, ped);
  		if (_vm->_gyro->_cwytalotGone) {
  			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
 -			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
 +			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomNowhere;
  		} else {
  			if (ped > 0) {
  				AnimationType *spr1 = &_vm->_animation->_sprites[1];
  				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
  				spr1->_callEachStepFl = true;
  				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
 -				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad;
 +				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomBrummieRoad;
  
 -				if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here...
 +				if (_vm->_gyro->_roomCount[kRoomBrummieRoad] == 1) { // First time here...
- 					_vm->_animation->appearPed(2, 2); // He appears on the right of the screen...
- 					spr1->walkTo(4); // ...and he walks up...
+ 					_vm->_animation->appearPed(2, 1); // He appears on the right of the screen...
+ 					spr1->walkTo(3); // ...and he walks up...
  				} else {
  					// You've been here before.
- 					_vm->_animation->appearPed(2, 4); // He's standing in your way straight away...
+ 					_vm->_animation->appearPed(2, 3); // He's standing in your way straight away...
  					spr1->_facingDir = Animation::kDirLeft;
  				}
  			}
  		}
  		break;
  
 -	case r__argentroad:
 -		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
 +	case kRoomArgentRoad:
 +		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[kRoomArgentRoad] > 3)) {
  			AnimationType *spr1 = &_vm->_animation->_sprites[1];
  			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
- 			_vm->_animation->appearPed(2, 1);
- 			spr1->walkTo(2);
+ 			_vm->_animation->appearPed(2, 0);
+ 			spr1->walkTo(1);
  			spr1->_vanishIfStill = true;
  			_vm->_gyro->_passedCwytalotInHerts = true;
  			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
@@@ -553,10 -551,10 +551,10 @@@
  			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
  		}
  		if (_vm->_gyro->_geidaFollows)
- 			putGeidaAt(ped + 3, ped); // load Geida
+ 			putGeidaAt(ped + 2, ped); // load Geida
  		break;
  
 -	case r__robins:
 +	case kRoomRobins:
  		if (ped > 0) {
  			if (!_vm->_gyro->_beenTiedUp) {
  				// A welcome party... or maybe not...
@@@ -722,14 -720,14 +720,14 @@@
  		}
  		break;
  
 -	case r__wisewomans: {
 +	case kRoomWiseWomans: {
  		AnimationType *spr1 = &_vm->_animation->_sprites[1];
  		spr1->init(11, false, _vm->_animation);
 -		if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) {
 +		if ((_vm->_gyro->_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
- 			_vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen.
- 			spr1->walkTo(4); // Walks up to greet you.
+ 			_vm->_animation->appearPed(2, 1); // Start on the right-hand side of the screen.
+ 			spr1->walkTo(3); // Walks up to greet you.
  		} else {
- 			_vm->_animation->appearPed(2, 4); // Starts where she was before.
+ 			_vm->_animation->appearPed(2, 3); // Starts where she was before.
  			spr1->_facingDir = Animation::kDirLeft;
  		}
  
@@@ -801,22 -799,22 +799,22 @@@
  		_vm->_graphics->refreshBackground();
  		break; // Ayles awake.
  
 -	case r__geidas:
 +	case kRoomGeidas:
- 		putGeidaAt(2, ped);
+ 		putGeidaAt(1, ped);
  		break; // load Geida
  
 -	case r__easthall:
 -	case r__westhall:
 +	case kRoomEastHall:
 +	case kRoomWestHall:
  		if (_vm->_gyro->_geidaFollows)
- 			putGeidaAt(ped + 2, ped);
+ 			putGeidaAt(ped + 1, ped);
  		break;
  
 -	case r__lusties:
 +	case kRoomLusties:
  		if (_vm->_gyro->_geidaFollows)
- 			putGeidaAt(ped + 6, ped);
+ 			putGeidaAt(ped + 5, ped);
  		break;
  
 -	case r__nottspub:
 +	case kRoomNottsPub:
  		if (_vm->_gyro->_sittingInPub)
  			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
  		_vm->_gyro->_npcFacing = 1; // Port.
diff --cc engines/avalanche/timer.cpp
index 8cc21fd,faab01c..1619440
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@@ -327,10 -327,10 +327,10 @@@ void Timer::hangAround() 
  
  	AnimationType *avvy = &_vm->_animation->_sprites[0];
  	avvy->init(7, true, _vm->_animation); // Robin Hood
 -	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins;
 +	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins;
- 	_vm->_animation->appearPed(1, 2);
+ 	_vm->_animation->appearPed(1, 1);
  	_vm->_scrolls->displayScrollChain('q', 39);
- 	avvy->walkTo(7);
+ 	avvy->walkTo(6);
  	addTimer(55, kProcHangAround2, kReasonHangingAround);
  }
  
@@@ -338,8 -338,8 +338,8 @@@ void Timer::hangAround2() 
  	_vm->_scrolls->displayScrollChain('q', 40);
  	AnimationType *spr = &_vm->_animation->_sprites[1];
  	spr->_vanishIfStill = false;
- 	spr->walkTo(4);
+ 	spr->walkTo(3);
 -	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins;
 +	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomRobins;
  	_vm->_scrolls->displayScrollChain('q', 41);
  	_vm->_animation->_sprites[0].remove();
  	spr->remove(); // Get rid of Robin Hood and Friar Tuck.


Commit: eaf6ecb7cdf3e372f143a4d9e7c89e89df508862
    https://github.com/scummvm/scummvm/commit/eaf6ecb7cdf3e372f143a4d9e7c89e89df508862
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T08:29:52-07:00

Commit Message:
AVALANCHE: Fix indexes used by kQuasipeds (Pascal -> C)

Changed paths:
    engines/avalanche/gyro.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 5cc877d..defa9f9 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -113,22 +113,23 @@ const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroo
 // A quasiped defines how people who aren't sprites talk. For example, quasiped
 // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
 const QuasipedType Gyro::kQuasipeds[16] = {
-	{2, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
-	{3, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
-	{3, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
-	{3, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23).
-	{3, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
-	{6, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
-	{2, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
-	{2, kColorBrown, 7, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
-	{2, kColorLightgreen, 47, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
-	{3, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
-	{2, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
-	{2, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
-	{3, kColorWhite, 27, kColorRed, 177}, // M: Avaroid (screen 27).
-	{4, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
-	{5, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
-	{2, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
+//	_whichPed, _foregroundColor, _room, _backgroundColor, _who
+	{1, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
+	{2, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{2, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
+	{2, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23).
+	{2, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
+	{5, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
+	{1, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
+	{1, kColorBrown, 7, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
+	{1, kColorLightgreen, 47, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
+	{2, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
+	{1, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
+	{1, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
+	{2, kColorWhite, 27, kColorRed, 177}, // M: Avaroid (screen 27).
+	{3, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
+	{4, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
+	{1, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
 };
 
 const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 0390eca..3ecec3c 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -678,7 +678,7 @@ void Scrolls::callScrollDriver() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed - 1];
+					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed];
 					_vm->_gyro->_talkX = quasiPed->_x;
 					_vm->_gyro->_talkY = quasiPed->_y; // Position.
 


Commit: ac49e6d09bb6bdc2ecb46178eef74170121d7851
    https://github.com/scummvm/scummvm/commit/ac49e6d09bb6bdc2ecb46178eef74170121d7851
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T08:29:53-07:00

Commit Message:
AVALANCHE: Get rid of a magic value in kQuasipeds initialization

Changed paths:
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h



diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index defa9f9..539f143 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -117,7 +117,7 @@ const QuasipedType Gyro::kQuasipeds[16] = {
 	{1, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
 	{2, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
 	{2, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
-	{2, kColorBlack, 23, kColorRed, 177}, // D: Hawk (screen 23).
+	{2, kColorBlack, 23, kColorRed, kPeopleInvisible}, // D: Hawk (screen 23).
 	{2, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
 	{5, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
 	{1, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
@@ -126,7 +126,7 @@ const QuasipedType Gyro::kQuasipeds[16] = {
 	{2, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
 	{1, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
 	{1, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
-	{2, kColorWhite, 27, kColorRed, 177}, // M: Avaroid (screen 27).
+	{2, kColorWhite, 27, kColorRed, kPeopleInvisible}, // M: Avaroid (screen 27).
 	{3, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
 	{4, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
 	{1, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 0f8b9ae..7785f4f 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -181,6 +181,7 @@ public:
 		// Girls:
 		kPeopleArkata = 175,
 		kPeopleGeida = 176,
+		kPeopleInvisible = 177,
 		kPeopleWisewoman = 178
 	};
 


Commit: 34acc80d7329352ecc55c36091877a2c3e8ec307
    https://github.com/scummvm/scummvm/commit/34acc80d7329352ecc55c36091877a2c3e8ec307
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T08:42:32-07:00

Commit Message:
AVALANCHE: Get rid of several magic values

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/roomnums.h
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3c3357e..dc8ebc2 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1893,7 +1893,7 @@ void Acci::doThat() {
 		else {
 			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
 				_vm->_scrolls->displayScrollChain('q', 17);
-				if (_vm->_gyro->_whereIs[1] == 12)
+				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
 					_vm->_scrolls->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -2044,7 +2044,7 @@ void Acci::doThat() {
 	case kVerbCodeAttack:
 		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
 				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-				&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
+				&& (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
 			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
@@ -2068,7 +2068,7 @@ void Acci::doThat() {
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_gyro->_whereIs[7] = 177;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy;
 				break;
 			default:
 				_vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent!
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index eaf74fa..833aa5c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -797,7 +797,7 @@ void Animation::callSpecial(uint16 which) {
 			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 177; // Not here, then.
+			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index c6f74f8..24e5f56 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -441,7 +441,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_celer->forgetBackgroundSprites();
 	_lucerna->minorRedraw();
 	_dropdown->setupMenu();
-	_gyro->_whereIs[0] = _gyro->_room;
+	_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _gyro->_room;
 	_gyro->_alive = true;
 	_lucerna->refreshObjectList();
 	_animation->updateSpeed();
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 539f143..d6ea248 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -150,7 +150,7 @@ byte Gyro::_whereIs[29] = {
 	kRoomDucks, // Duck - r__DucksRoom's not defined yet.
 	kRoomArgentPub, // Malagauche
 	kRoomRobins, // Friar Tuck.
-	177, // Robin Hood - can't meet him at the start.
+	kRoomDummy, // Robin Hood - can't meet him at the start.
 	kRoomBrummieRoad, // Cwytalot
 	kRoomLustiesRoom, // Baron du Lustie.
 	kRoomOutsideCardiffCastle, // The Duke of Cardiff.
@@ -165,7 +165,7 @@ byte Gyro::_whereIs[29] = {
 	// The Lasses
 	kRoomYours, // Arkata
 	kRoomGeidas, // Geida
-	177, // nobody allocated here!
+	kRoomDummy, // nobody allocated here!
 	kRoomWiseWomans  // The Wise Woman.
 };
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index c735346..65e1478 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -496,13 +496,13 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			if (ped > 0) {
 				spr1->init(2, false, _vm->_animation); // load Spludwick
 				_vm->_animation->appearPed(2, 1);
-				_vm->_gyro->_whereIs[1] = kRoomSpludwicks;
+				_vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomSpludwicks;
 			}
 
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcGeida;
 		} else
-			_vm->_gyro->_whereIs[1] = kRoomNowhere;
+			_vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomNowhere;
 		break;
 
 	case kRoomBrummieRoad:
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
index c87fc4c..a963468 100644
--- a/engines/avalanche/roomnums.h
+++ b/engines/avalanche/roomnums.h
@@ -66,7 +66,8 @@ enum Room {
 	kRoomOutsideCardiffCastle = 70,
 	kRoomInsideCardiffCastle = 71,
 	kRoomBossKey = 98, // assumed
-	kRoomMap = 99
+	kRoomMap = 99,
+	kRoomDummy = 177 // Dummy room
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 3ecec3c..87fdb0b 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -1051,7 +1051,7 @@ void Scrolls::talkTo(byte whom) {
 		_vm->_lucerna->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_gyro->_talkedToCrapulus = true;
-		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
+		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;


Commit: 982e8c652383c18cf5ef801b8f185cb1ae875f10
    https://github.com/scummvm/scummvm/commit/982e8c652383c18cf5ef801b8f185cb1ae875f10
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T08:49:22-07:00

Commit Message:
AVALANCHE: Remove hardcoded room number from the initialization of kQuadipeds

Changed paths:
    engines/avalanche/gyro.cpp



diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index d6ea248..0b50b2d 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -113,23 +113,23 @@ const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroo
 // A quasiped defines how people who aren't sprites talk. For example, quasiped
 // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
 const QuasipedType Gyro::kQuasipeds[16] = {
-//	_whichPed, _foregroundColor, _room, _backgroundColor, _who
-	{1, kColorLightgray, 19, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
-	{2, kColorGreen, 19, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
-	{2, kColorWhite, 1, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
-	{2, kColorBlack, 23, kColorRed, kPeopleInvisible}, // D: Hawk (screen 23).
-	{2, kColorLightgreen, 50, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
-	{5, kColorYellow, 42, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
-	{1, kColorBlue, 16, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
-	{1, kColorBrown, 7, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
-	{1, kColorLightgreen, 47, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
-	{2, kColorYellow, 47, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
-	{1, kColorLightgray, 23, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
-	{1, kColorYellow, 27, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
-	{2, kColorWhite, 27, kColorRed, kPeopleInvisible}, // M: Avaroid (screen 27).
-	{3, kColorLightgray, 19, kColorDarkgray, kPeopleMalagauche}, // N: Malagauche (screen 19).
-	{4, kColorLightmagenta, 47, kColorRed, kPeoplePort}, // O: Port (screen 47).
-	{1, kColorLightgreen, 51, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
+//_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
+	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
+	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{2, kColorWhite,        kRoomYours,        kColorMagenta,  kPeopleArkata},    // C: Arkata (screen 1).
+	{2, kColorBlack,        kRoomLustiesRoom,  kColorRed,      kPeopleInvisible}, // D: Hawk (screen 23).
+	{2, kColorLightgreen,   kRoomOutsideDucks, kColorBrown,    kPeopleTrader},    // E: Trader (screen 50).
+	{5, kColorYellow,       kRoomRobins,       kColorRed,      kPeopleAvalot},    // F: Avvy, tied up (scr.42)
+	{1, kColorBlue,         kRoomAylesOffice,  kColorWhite,    kPeopleAyles},     // G: Ayles (screen 16).
+	{1, kColorBrown,        kRoomMusicRoom,    kColorWhite,    kPeopleJacques},   // H: Jacques (screen 7).
+	{1, kColorLightgreen,   kRoomNottsPub,     kColorGreen,    kPeopleSpurge},    // I: Spurge (screen 47).
+	{2, kColorYellow,       kRoomNottsPub,     kColorRed,      kPeopleAvalot},    // J: Avalot (screen 47).
+	{1, kColorLightgray,    kRoomLustiesRoom,  kColorBlack,    kPeopleDuLustie},  // K: du Lustie (screen 23).
+	{1, kColorYellow,       kRoomOubliette,    kColorRed,      kPeopleAvalot},    // L: Avalot (screen 27).
+	{2, kColorWhite,        kRoomOubliette,    kColorRed,      kPeopleInvisible}, // M: Avaroid (screen 27).
+	{3, kColorLightgray,    kRoomArgentPub,    kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
+	{4, kColorLightmagenta, kRoomNottsPub,     kColorRed,      kPeoplePort},      // O: Port (screen 47).
+	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
 };
 
 const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";


Commit: 18a992856ed50cac71233166aa25d239c5a45c27
    https://github.com/scummvm/scummvm/commit/18a992856ed50cac71233166aa25d239c5a45c27
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T09:16:46-07:00

Commit Message:
AVALANCHE: Get rid of some more magic values

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/gyro.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index dc8ebc2..56ac2e9 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -782,7 +782,7 @@ void Acci::parse() {
 		_vm->_gyro->_it = _thing;
 
 	if (_person != kPardon) {
-		if (_person < 175)
+		if (_person < Gyro::kPeopleArkata)
 			_vm->_gyro->_him = _person;
 		else
 			_vm->_gyro->_her = _person;
@@ -822,7 +822,7 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 		return true;
 	else {
 		Common::String tmpStr;
-		if (_person < 175)
+		if (_person < Gyro::kPeopleArkata)
 			tmpStr = "He isn't around at the moment.";
 		else
 			tmpStr = "She isn't around at the moment.";
@@ -1891,7 +1891,7 @@ void Acci::doThat() {
 		if (_vm->_gyro->_avariciusTalk > 0)
 			_vm->_scrolls->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(2))) { // Avaricius appears!
 				_vm->_scrolls->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
 					_vm->_scrolls->displayScrollChain('q', 18);
@@ -2043,8 +2043,8 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeAttack:
 		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
-				((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-				&& (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
+			((_person == Gyro::kPeopleCwytalot) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) &&
+			(_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
 			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
@@ -2138,7 +2138,7 @@ void Acci::doThat() {
 			default:
 				_vm->_scrolls->displayScrollChain('U', 5); // You WHAT?
 			}
-		} else if ((150 <= _person) && (_person <= 174))
+		} else if ((Gyro::kPeopleAvalot <= _person) && (_person < Gyro::kPeopleArkata))
 			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
 
 		break;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 833aa5c..b476fe9 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1321,7 +1321,7 @@ void Animation::flipRoom(byte room, byte ped) {
 		return;
 	}
 
-	if ((room == 177) && (_vm->_gyro->_room == kRoomLusties)) {
+	if ((room == kRoomDummy) && (_vm->_gyro->_room == kRoomLusties)) {
 		hideInCupboard();
 		return;
 	}
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 5efa63e..86c4a1d 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -447,7 +447,7 @@ void Dropdown::setupMenuAction() {
 	else
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->_room == 99)
+	if (_vm->_gyro->_room == kRoomMap)
 		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
 	else
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
@@ -470,7 +470,7 @@ void Dropdown::setupMenuPeople() {
 	for (byte i = 150; i <= 178; i++)
 		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
-			people = people + i;
+			people += i;
 		}
 
 	_activeMenuItem.display();
@@ -653,7 +653,7 @@ void Dropdown::runMenuWith() {
 		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
 			_vm->_acci->_person = _vm->_gyro->_lastPerson;
 		else
-			_vm->_acci->_person = 254;
+			_vm->_acci->_person = Acci::kPardon;
 
 	} else {
 		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
@@ -695,7 +695,7 @@ void Dropdown::runMenuWith() {
 		break;
 		default: {
 			_vm->_acci->_person = _vm->_acci->_thing;
-			_vm->_acci->_thing = 254;
+			_vm->_acci->_thing = Acci::kPardon;
 			_vm->_gyro->_subjectNum = 0;
 		}
 		}
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 0b50b2d..7866100 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -234,7 +234,7 @@ void Gyro::resetVariables() {
 
 	_dnascore = 0;
 	_money = 0;
-	_room = 0;
+	_room = kRoomNowhere;
 	_wearing = 0;
 	_sworeNum = 0;
 	_saveNum = 0;
@@ -343,10 +343,10 @@ void Gyro::newGame() {
 	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
-	_him = 254;
-	_her = 254;
-	_it = 254;
-	_lastPerson = 254; // = Pardon?
+	_him = Acci::kPardon;
+	_her = Acci::kPardon;
+	_it = Acci::kPardon;
+	_lastPerson = Acci::kPardon; // = Pardon?
 	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;


Commit: ca596423809fff56b7e48148572df18967a012c1
    https://github.com/scummvm/scummvm/commit/ca596423809fff56b7e48148572df18967a012c1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T09:27:40-07:00

Commit Message:
AVALANCHE: for consistency, replace fv and ff loop variables by i and j. Remove some commented dead code

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index b476fe9..e15ecfa 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -95,14 +95,10 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 		_info._xWidth++;
 	for (byte i = 0; i < _stat._frameNum; i++) {
 		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
-		//getmem(sil[totalnum-1], 11 * (a.yl + 1));
 		_info._mani[_animCount] = new ManiType[_info._size - 6];
-		//getmem(mani[totalnum-1], a.size - 6);
 		for (byte j = 0; j <= _info._yLength; j++)
 			inf.read((*_info._sil[_animCount])[j], _info._xWidth);
-			//blockread(inf, (*sil[totalnum-1])[fv], xw);
 		inf.read(*_info._mani[_animCount], _info._size - 6);
-		//blockread(inf, *mani[totalnum-1], a.size - 6);
 
 		_animCount++;
 	}
@@ -427,7 +423,6 @@ byte Animation::geidaPed(byte which) {
 void Animation::catacombMove(byte ped) {
 	int32 here;
 	uint16 xy_uint16;
-	byte fv;
 
 	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 	// catacombs has a different number for it.
@@ -703,14 +698,14 @@ void Animation::catacombMove(byte ped) {
 		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		break;      // [5,7] : "Ite Mingite" sign.
 	case 258:
-		for (fv = 0; fv <= 2; fv++) { // [2,1] : Art gallery - pictures
-			_vm->_celer->drawBackgroundSprite(130 + fv * 120, 70, 15);
-			_vm->_celer->drawBackgroundSprite(184 + fv * 120, 78, 16);
+		for (int i = 0; i <= 2; i++) { // [2,1] : Art gallery - pictures
+			_vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 15);
+			_vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 16);
 		}
 		break;
 	case 1287:
-		for (fv = 10; fv <= 13; fv++)
-			_vm->_celer->drawBackgroundSprite(-1, -1, fv);
+		for (int i = 10; i <= 13; i++)
+			_vm->_celer->drawBackgroundSprite(-1, -1, i);
 		break; // [7,5] : 4 candles.
 	case 776:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
@@ -733,8 +728,6 @@ void Animation::catacombMove(byte ped) {
 	}
 }
 
-
-
 // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
 void Animation::dawnDelay() {
 	_vm->_timer->addTimer(2, Timer::kProcDawnDelay, Timer::kReasonDawndelay);
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 7866100..398a7a7 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -173,9 +173,9 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 	_vm = vm;
 
 	// Needed because of Lucerna::load_also()
-	for (int fv = 0; fv < 31; fv++) {
-		for (int ff = 0; ff < 2; ff++)
-			_also[fv][ff] = 0;
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++)
+			_also[i][j] = 0;
 	}
 
 	_totalTime = 0;
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 65e1478..c8c76d4 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -935,9 +935,9 @@ void Lucerna::drawScore() {
 
 	CursorMan.showMouse(false);
 
-	for (byte fv = 0; fv < 3; fv++) {
-		if (_vm->_gyro->_scoreToDisplay[fv] != numbers[fv])
-			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[fv]], 250 + (fv + 1) * 15, 177);
+	for (byte i = 0; i < 3; i++) {
+		if (_vm->_gyro->_scoreToDisplay[i] != numbers[i])
+			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[i]], 250 + (i + 1) * 15, 177);
 	}
 
 	CursorMan.showMouse(true);
@@ -947,12 +947,12 @@ void Lucerna::drawScore() {
 }
 
 void Lucerna::incScore(byte num) {     // Add on no. of points
-	for (byte q = 1; q <= num; q++) {
+	for (byte i = 1; i <= num; i++) {
 		_vm->_gyro->_dnascore++;
 
 #if 0
 		if (soundfx) {
-			for (byte fv = 1; fv <= 97; fv++)
+			for (byte j = 1; j <= 97; j++)
 				sound(177 + dna.score * 3);
 		}
 		nosound;
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 87fdb0b..26aea4b 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -290,13 +290,13 @@ void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 #if 0
 	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
 	byte bit;
-	for (uint16 fv = 1; fv <= yl; fv++)
+	for (uint16 i = 1; i <= yl; i++)
 		for (bit = 0; bit <= 3; bit++) {
 			port[0x3c4] = 2;
 			port[0x3ce] = 4;
 			port[0x3c5] = 1 << bit;
 			port[0x3cf] = bit;
-			blockread(f, mem[0xa000 * st + (fv * 80)], xl);
+			blockread(f, mem[0xa000 * st + (i * 80)], xl);
 		}
 	bit = getpixel(0, 0);
 #endif


Commit: b3c1a64aa1884066f683ea5acf683564bddee3e6
    https://github.com/scummvm/scummvm/commit/b3c1a64aa1884066f683ea5acf683564bddee3e6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T09:37:45-07:00

Commit Message:
AVALANCHE: Fix multiple bugs.

Changed paths:
    engines/avalanche/celer.cpp
    engines/avalanche/dropdown.cpp



diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index e3aafdb..3d78034 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -259,7 +259,6 @@ void Celer::updateBackgroundSprites() {
 			break;
 		case 2:
 			//nosound();
-			updateBackgroundSprites();
 			break;
 		}
 	}
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 86c4a1d..4c5afe5 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -338,7 +338,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
 
 	// Underline the selected character.
-	if (!text.contains(trigger))
+	if ((trigger == 0) || !text.contains(trigger) )
 		return;
 	else {
 		byte i;


Commit: 5de5c3900db34b884b5d3a91eb02f0b4db02a962
    https://github.com/scummvm/scummvm/commit/5de5c3900db34b884b5d3a91eb02f0b4db02a962
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T09:53:09-07:00

Commit Message:
AVALANCHE: Repair Acci::exampers().

Changed paths:
    engines/avalanche/acci.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 56ac2e9..8747b7e 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -843,7 +843,7 @@ void Acci::exampers() {
 				return;
 			}
 			break;
-		case 99:
+		case 9:
 			if (_vm->_gyro->_lustieIsAsleep) {
 				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
 				return;
@@ -852,11 +852,10 @@ void Acci::exampers() {
 		}
 		// Otherwise...
 		_vm->_scrolls->displayScrollChain('p', _person);
+		// And afterwards...
+		if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
+			_vm->_scrolls->displayScrollChain('Q', 13);
 	}
-
-	// And afterwards...
-	if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
-		_vm->_scrolls->displayScrollChain('Q', 13);
 }
 
 /**


Commit: 45dc123b8417ce85edab4de8b7e1050e51bc8661
    https://github.com/scummvm/scummvm/commit/45dc123b8417ce85edab4de8b7e1050e51bc8661
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T10:19:38-07:00

Commit Message:
AVALANCHE: Rework exampers()

Changed paths:
    engines/avalanche/acci.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 8747b7e..5436090 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -835,26 +835,25 @@ void Acci::exampers() {
 	if (isPersonHere()) {
 		if (_thing != _vm->_gyro->_thinks)
 			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
-		_person -= 149;
+		byte newPerson = _person - 149;
 		switch (_person) { // Special cases
-		case 11:
-			if (_vm->_gyro->_wonNim) {
+		case Gyro::kPeopleDogfood:
+			if (_vm->_gyro->_wonNim)
 				_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
-				return;
-			}
 			break;
-		case 9:
-			if (_vm->_gyro->_lustieIsAsleep) {
+		case Gyro::kPeopleDuLustie:
+			if (_vm->_gyro->_lustieIsAsleep)
 				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
-				return;
-			}
 			break;
+		case Gyro::kPeopleAyles:
+			_vm->_scrolls->displayScrollChain('p', newPerson);
+			if (!_vm->_gyro->_aylesIsAwake)
+				_vm->_scrolls->displayScrollChain('Q', 13);
+			break;
+		default:
+			_vm->_scrolls->displayScrollChain('p', newPerson);
 		}
-		// Otherwise...
-		_vm->_scrolls->displayScrollChain('p', _person);
-		// And afterwards...
-		if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
-			_vm->_scrolls->displayScrollChain('Q', 13);
+		_person = newPerson;
 	}
 }
 


Commit: c877ddf4113cbfb4304ba53685713ad207b80069
    https://github.com/scummvm/scummvm/commit/c877ddf4113cbfb4304ba53685713ad207b80069
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-15T11:12:30-07:00

Commit Message:
AVALANCHE: Rework Acci:exampers().

Changed paths:
    engines/avalanche/acci.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 5436090..dc79435 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -835,24 +835,19 @@ void Acci::exampers() {
 	if (isPersonHere()) {
 		if (_thing != _vm->_gyro->_thinks)
 			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
+
 		byte newPerson = _person - 149;
-		switch (_person) { // Special cases
-		case Gyro::kPeopleDogfood:
-			if (_vm->_gyro->_wonNim)
-				_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
-			break;
-		case Gyro::kPeopleDuLustie:
-			if (_vm->_gyro->_lustieIsAsleep)
-				_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
-			break;
-		case Gyro::kPeopleAyles:
-			_vm->_scrolls->displayScrollChain('p', newPerson);
-			if (!_vm->_gyro->_aylesIsAwake)
-				_vm->_scrolls->displayScrollChain('Q', 13);
-			break;
-		default:
+
+		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
+			_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
+		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
+			_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
+		else
 			_vm->_scrolls->displayScrollChain('p', newPerson);
-		}
+
+		if ((_person == Gyro::kPeopleAyles) && !_vm->_gyro->_aylesIsAwake)
+			_vm->_scrolls->displayScrollChain('Q', 13);
+
 		_person = newPerson;
 	}
 }


Commit: d6be9ed7db8db20aee90bd1c275d5b9d8bb7b9b3
    https://github.com/scummvm/scummvm/commit/d6be9ed7db8db20aee90bd1c275d5b9d8bb7b9b3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T15:05:35-07:00

Commit Message:
AVALANCHE: More index conversion in appearPed

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index dc79435..f4620f4 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1292,12 +1292,12 @@ void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_standingOnDais) { // Clamber up.
 		_vm->_scrolls->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_standingOnDais = false;
-		_vm->_animation->appearPed(1, 2);
+		_vm->_animation->appearPed(0, 2);
 	} else { // Clamber down.
 		if (_vm->_animation->inField(1)) {
 			_vm->_scrolls->displayText("You clamber up onto the dais.");
 			_vm->_gyro->_standingOnDais = true;
-			_vm->_animation->appearPed(1, 1);
+			_vm->_animation->appearPed(0, 1);
 		} else
 			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
 	}
@@ -1318,7 +1318,7 @@ void Acci::standUp() {
 			}
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
-			_vm->_animation->appearPed(1, 1);
+			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->_direction = Animation::kDirLeft;
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
@@ -1336,7 +1336,7 @@ void Acci::standUp() {
 		if (_vm->_gyro->_sittingInPub)  {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
-			_vm->_animation->appearPed(1, 3); // And walking away.
+			_vm->_animation->appearPed(0, 3); // And walking away.
 			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
 			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
 		} else
@@ -1891,7 +1891,7 @@ void Acci::doThat() {
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
 					spr->init(1, false, _vm->_animation); // Avaricius
-					_vm->_animation->appearPed(2, 3);
+					_vm->_animation->appearPed(1, 3);
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
 					spr->_eachStepProc = Animation::kProcBackAndForth;
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index e15ecfa..2327e51 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -722,7 +722,7 @@ void Animation::catacombMove(byte ped) {
 	if ((_vm->_gyro->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
-		appearPed(2, geidaPed(ped) - 1);
+		appearPed(1, geidaPed(ped) - 1);
 		_sprites[1]._callEachStepFl = true;
 		_sprites[1]._eachStepProc = kProcGeida;
 	}
@@ -758,7 +758,7 @@ void Animation::callSpecial(uint16 which) {
 
 		if (!_vm->_gyro->_arrowTriggered) {
 			_vm->_gyro->_arrowTriggered = true;
-			appearPed(2, 3); // The dart starts at ped 4, and...
+			appearPed(1, 3); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
@@ -846,13 +846,13 @@ void Animation::callSpecial(uint16 which) {
 			return;
 		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
-			appearPed(1, 11);
+			appearPed(0, 11);
 			break;
 		case 0x3:
-			appearPed(1, 10);
+			appearPed(0, 10);
 			break;
 		default:
-			appearPed(1, 3);
+			appearPed(0, 3);
 		}
 		dawnDelay();
 		break;
@@ -862,7 +862,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(1);
 		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
-		appearPed(1, 0);
+		appearPed(0, 0);
 		dawnDelay();
 		break;
 	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
@@ -871,7 +871,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(2);
 		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
-		appearPed(1, 1);
+		appearPed(0, 1);
 		dawnDelay();
 		break;
 	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
@@ -880,7 +880,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(3);
 		if (_vm->_gyro->_room != kRoomCatacombs)
 			return;
-		appearPed(1, 2);
+		appearPed(0, 2);
 		dawnDelay();
 		break;
 	}
@@ -928,7 +928,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 				_vm->_sequence->startToClose();
 				return;
 			} else {
-				appearPed(1, 5);
+				appearPed(0, 5);
 				_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
 				_vm->_sequence->firstShow(8);
 				_vm->_sequence->thenShow(9);
@@ -997,10 +997,10 @@ void Animation::changeDirection(byte t, byte dir) {
 }
 
 void Animation::appearPed(byte sprNum, byte pedNum) {
-	AnimationType *curSpr = &_sprites[sprNum - 1];
+	AnimationType *curSpr = &_sprites[sprNum];
 	PedType *curPed = &_vm->_gyro->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
-	changeDirection(sprNum - 1, curPed->_direction);
+	changeDirection(sprNum, curPed->_direction);
 }
 
 // Eachstep procedures:
@@ -1287,7 +1287,7 @@ void Animation::hideInCupboard() {
 		} else {
 			_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
-			appearPed(1, 2); // Walk out of the cupboard.
+			appearPed(0, 2); // Walk out of the cupboard.
 			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
@@ -1337,7 +1337,7 @@ void Animation::flipRoom(byte room, byte ped) {
 		_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
 
 	_vm->_lucerna->enterRoom(room, ped);
-	appearPed(1, ped - 1);
+	appearPed(0, ped - 1);
 	_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
 	_oldDirection = _direction;
 	_direction = _sprites[0]._facingDir;
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index c8c76d4..5ba0e70 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -413,7 +413,7 @@ void Lucerna::putGeidaAt(byte whichPed, byte ped) {
 	AnimationType *spr1 = &_vm->_animation->_sprites[1];
 
 	spr1->init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->appearPed(2, whichPed);
+	_vm->_animation->appearPed(1, whichPed);
 	spr1->_callEachStepFl = true;
 	spr1->_eachStepProc = Animation::kProcGeida;
 }
@@ -460,10 +460,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				spr1->init(8, false, _vm->_animation); // load Crapulus
 
 				if (_vm->_gyro->_roomCount[kRoomOutsideYours] == 1) {
-					_vm->_animation->appearPed(2, 3); // Start on the right-hand side of the screen.
+					_vm->_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
 					spr1->walkTo(4); // Walks up to greet you.
 				} else {
-					_vm->_animation->appearPed(2, 4); // Starts where he was before.
+					_vm->_animation->appearPed(1, 4); // Starts where he was before.
 					spr1->_facingDir = Animation::kDirLeft;
 				}
 
@@ -475,7 +475,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 			if (_vm->_gyro->_crapulusWillTell) {
 				spr1->init(8, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 1);
+				_vm->_animation->appearPed(1, 1);
 				spr1->walkTo(3);
 				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_vm->_gyro->_crapulusWillTell = false;
@@ -495,7 +495,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (ped > 0) {
 				spr1->init(2, false, _vm->_animation); // load Spludwick
-				_vm->_animation->appearPed(2, 1);
+				_vm->_animation->appearPed(1, 1);
 				_vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomSpludwicks;
 			}
 
@@ -520,11 +520,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomBrummieRoad;
 
 				if (_vm->_gyro->_roomCount[kRoomBrummieRoad] == 1) { // First time here...
-					_vm->_animation->appearPed(2, 1); // He appears on the right of the screen...
+					_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
 					spr1->walkTo(3); // ...and he walks up...
 				} else {
 					// You've been here before.
-					_vm->_animation->appearPed(2, 3); // He's standing in your way straight away...
+					_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
 					spr1->_facingDir = Animation::kDirLeft;
 				}
 			}
@@ -535,7 +535,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[kRoomArgentRoad] > 3)) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
-			_vm->_animation->appearPed(2, 0);
+			_vm->_animation->appearPed(1, 0);
 			spr1->walkTo(1);
 			spr1->_vanishIfStill = true;
 			_vm->_gyro->_passedCwytalotInHerts = true;
@@ -560,7 +560,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				// A welcome party... or maybe not...
 				AnimationType *spr1 = &_vm->_animation->_sprites[1];
 				spr1->init(6, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 1);
+				_vm->_animation->appearPed(1, 1);
 				spr1->walkTo(2);
 				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 			}
@@ -585,7 +585,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			switch (_vm->_gyro->_cardiffQuestionNum) {
 			case 0 : // You've answered NONE of his questions.
 				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 1);
+				_vm->_animation->appearPed(1, 1);
 				spr1->walkTo(2);
 				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
 				break;
@@ -594,7 +594,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				break; // You've answered ALL his questions. => nothing happens.
 			default: // You've answered SOME of his questions.
 				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(2, 2);
+				_vm->_animation->appearPed(1, 2);
 				spr1->_facingDir = Animation::kDirRight;
 				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
@@ -724,10 +724,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		AnimationType *spr1 = &_vm->_animation->_sprites[1];
 		spr1->init(11, false, _vm->_animation);
 		if ((_vm->_gyro->_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
-			_vm->_animation->appearPed(2, 1); // Start on the right-hand side of the screen.
+			_vm->_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
 			spr1->walkTo(3); // Walks up to greet you.
 		} else {
-			_vm->_animation->appearPed(2, 3); // Starts where she was before.
+			_vm->_animation->appearPed(1, 3); // Starts where she was before.
 			spr1->_facingDir = Animation::kDirLeft;
 		}
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 1619440..0f5eb12 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -328,7 +328,7 @@ void Timer::hangAround() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins;
-	_vm->_animation->appearPed(1, 1);
+	_vm->_animation->appearPed(0, 1);
 	_vm->_scrolls->displayScrollChain('q', 39);
 	avvy->walkTo(6);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
@@ -358,7 +358,7 @@ void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
-	_vm->_animation->appearPed(1, 1);
+	_vm->_animation->appearPed(0, 1);
 	_vm->_gyro->_userMovesAvvy = true;
 	_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true;
 	_vm->_lucerna->refreshObjectList();
@@ -429,7 +429,7 @@ void Timer::jacquesWakesUp() {
 void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->init(9, false, _vm->_animation); // Here comes the Duke.
-	_vm->_animation->appearPed(2, 0); // He starts at the door...
+	_vm->_animation->appearPed(1, 0); // He starts at the door...
 	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
@@ -586,7 +586,7 @@ void Timer::riseUpOubliette() {
 void Timer::robinHoodAndGeida() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation);
-	_vm->_animation->appearPed(1, 6);
+	_vm->_animation->appearPed(0, 6);
 	avvy->walkTo(5);
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -615,7 +615,7 @@ void Timer::avalotReturns() {
 	avvy->remove();
 	spr->remove();
 	avvy->init(0, true, _vm->_animation);
-	_vm->_animation->appearPed(1, 0);
+	_vm->_animation->appearPed(0, 0);
 	_vm->_scrolls->displayScrollChain('q', 67);
 	_vm->_gyro->_userMovesAvvy = true;
 }


Commit: 23ba373c9145060c3e766d56f845382a3e7c6ea6
    https://github.com/scummvm/scummvm/commit/23ba373c9145060c3e766d56f845382a3e7c6ea6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T15:26:36-07:00

Commit Message:
AVALANCHE: More index conversion in inField()

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index f4620f4..3f78b16 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -1071,7 +1071,7 @@ void Acci::openDoor() {
 	// Special cases.
 	switch (_vm->_gyro->_room) {
 	case kRoomYours:
-		if (_vm->_animation->inField(2)) {
+		if (_vm->_animation->inField(1)) {
 			// Opening the box.
 			_thing = 54; // The box.
 			_person = kPardon;
@@ -1091,7 +1091,7 @@ void Acci::openDoor() {
 		return; // No doors can open if you can't move Avvy.
 
 	for (byte i = 0; i < 7; i++) {
-		if (_vm->_animation->inField(i + 9)) {
+		if (_vm->_animation->inField(i + 8)) {
 			MagicType *portal = &_vm->_gyro->_portals[i];
 			switch (portal->_operation) {
 			case Gyro::kMagicExclaim:
@@ -1293,14 +1293,12 @@ void Acci::cardiffClimbing() {
 		_vm->_scrolls->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_standingOnDais = false;
 		_vm->_animation->appearPed(0, 2);
-	} else { // Clamber down.
-		if (_vm->_animation->inField(1)) {
-			_vm->_scrolls->displayText("You clamber up onto the dais.");
-			_vm->_gyro->_standingOnDais = true;
-			_vm->_animation->appearPed(0, 1);
-		} else
+	} else if (_vm->_animation->inField(0)) { // Clamber down
+		_vm->_scrolls->displayText("You clamber up onto the dais.");
+		_vm->_gyro->_standingOnDais = true;
+		_vm->_animation->appearPed(0, 1);
+	} else
 			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
-	}
 }
 
 void Acci::already() {
@@ -1350,7 +1348,7 @@ void Acci::standUp() {
 void Acci::getProc(char thing) {
 	switch (_vm->_gyro->_room) {
 	case kRoomYours:
-		if (_vm->_animation->inField(2)) {
+		if (_vm->_animation->inField(1)) {
 			if (_vm->_gyro->_boxContent == thing) {
 				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 				_vm->_scrolls->displayText("OK, I've got it.");
@@ -1368,7 +1366,7 @@ void Acci::getProc(char thing) {
 	case kRoomInsideCardiffCastle:
 		switch (thing) {
 		case Gyro::kObjectPen:
-			if (_vm->_animation->inField(2)) { // Standing on the dais.
+			if (_vm->_animation->inField(1)) { // Standing on the dais.
 				if (_vm->_gyro->_takenPen)
 					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
@@ -1393,7 +1391,7 @@ void Acci::getProc(char thing) {
 		}
 		break;
 	case kRoomRobins:
-		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) {
+		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
 			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_mushroomGrowing = false;
@@ -1428,7 +1426,7 @@ void Acci::giveGeidaTheLute() {
 }
 
 void Acci::playHarp() {
-	if (_vm->_animation->inField(7))
+	if (_vm->_animation->inField(6))
 		_vm->_scrolls->musicalScroll();
 	else
 		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
@@ -1884,7 +1882,7 @@ void Acci::doThat() {
 		if (_vm->_gyro->_avariciusTalk > 0)
 			_vm->_scrolls->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(2))) { // Avaricius appears!
+			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
 				_vm->_scrolls->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
 					_vm->_scrolls->displayScrollChain('q', 18);
@@ -1940,7 +1938,7 @@ void Acci::doThat() {
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_room) {
 		case kRoomArgentPub:
-			if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
+			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
 				switch (_thing) {
 				case 51:
 				case 53:
@@ -2001,7 +1999,7 @@ void Acci::doThat() {
 			break;
 
 		case kRoomOutsideDucks:
-			if (_vm->_animation->inField(6)) {
+			if (_vm->_animation->inField(5)) {
 				if (_thing == Gyro::kObjectOnion) {
 					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
 						_vm->_scrolls->displayScrollChain('D', 10); // Not planning to juggle with the things!
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 2327e51..2baa232 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1350,7 +1350,7 @@ void Animation::flipRoom(byte room, byte ped) {
 }
 
 bool Animation::inField(byte which) {
-	FieldType *curField = &_vm->_gyro->_fields[which - 1]; // Pascal -> C: different array indexes.
+	FieldType *curField = &_vm->_gyro->_fields[which];
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
 
 	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 398a7a7..601adee 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -530,7 +530,7 @@ Common::String Gyro::f5Does() {
 			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
 		break;
 	case kRoomMusicRoom:
-		if (_vm->_animation->inField(7))
+		if (_vm->_animation->inField(5))
 			return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay);
 		break;
 	}
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 0f5eb12..892dde0 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -487,7 +487,7 @@ void Timer::jump() {
 	if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
 			&& (_vm->_gyro->_room == kRoomInsideCardiffCastle)
 			&& (_vm->_gyro->_arrowInTheDoor == true)
-			&& (_vm->_animation->inField(3))) { // Beside the wall
+			&& (_vm->_animation->inField(2))) { // Beside the wall
 		// Grab the arrow!
 		if (_vm->_gyro->_carryNum >= kCarryLimit)
 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");


Commit: 9d259d0a07f0aefc4488eb2306560760cc486354
    https://github.com/scummvm/scummvm/commit/9d259d0a07f0aefc4488eb2306560760cc486354
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-15T16:15:47-07:00

Commit Message:
AVALANCHE: fix index in loadMouse, misc cleanup

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3f78b16..ba8dbbd 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -495,20 +495,17 @@ bool Acci::doPronouns() {
 	for (byte i = 0; i < _thats.size(); i++) {
 		byte wordCode = _thats[i];
 		switch (wordCode) {
-		case 200: {
+		case 200:
 			displayWhat(_vm->_gyro->_him, true, ambiguous);
 			_thats.setChar(_vm->_gyro->_him, i);
-			}
 			break;
-		case 201: {
+		case 201:
 			displayWhat(_vm->_gyro->_her, true, ambiguous);
 			_thats.setChar(_vm->_gyro->_her, i);
-			}
 			break;
-		case 202: {
+		case 202:
 			displayWhat(_vm->_gyro->_it, false, ambiguous);
 			_thats.setChar(_vm->_gyro->_it, i);
-			}
 			break;
 		}
 	}
@@ -1735,31 +1732,31 @@ void Acci::doThat() {
 				break;
 			case Gyro::kObjectClothes:
 			case Gyro::kObjectHabit: { // Change this!
-					if (_vm->_gyro->_wearing != kNothing) {
-						if (_vm->_gyro->_wearing == _thing)
-							_vm->_scrolls->displayText("You're already wearing that.");
-						else
-							_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
-						return;
-					} else
-						_vm->_gyro->_wearing = _thing;
+				if (_vm->_gyro->_wearing != kNothing) {
+					if (_vm->_gyro->_wearing == _thing)
+						_vm->_scrolls->displayText("You're already wearing that.");
+					else
+						_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
+					return;
+				} else
+					_vm->_gyro->_wearing = _thing;
 
-					_vm->_lucerna->refreshObjectList();
+				_vm->_lucerna->refreshObjectList();
 
-					byte i;
-					if (_thing == Gyro::kObjectHabit)
-						i = 3;
-					else
-						i = 0;
-					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
-					if (spr->_id != i) {
-						int16 x = spr->_x;
-						int16 y = spr->_y;
-						spr->remove();
-						spr->init(i, true, _vm->_animation);
-						spr->appear(x, y, Animation::kDirLeft);
-						spr->_visible = false;
-					}
+				byte i;
+				if (_thing == Gyro::kObjectHabit)
+					i = 3;
+				else
+					i = 0;
+				Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
+				if (spr->_id != i) {
+					int16 x = spr->_x;
+					int16 y = spr->_y;
+					spr->remove();
+					spr->init(i, true, _vm->_animation);
+					spr->appear(x, y, Animation::kDirLeft);
+					spr->_visible = false;
+				}
 				}
 				break;
 			default:
@@ -1770,40 +1767,39 @@ void Acci::doThat() {
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
 			switch (_vm->_gyro->_room) { // They just typed "play"...
-			case kRoomArgentPub: { // ...in the pub, => play Nim.
-					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
-					// play_nim();
-					// The following parts are copied from play_nim().
-					// The player automatically wins the game everytime he wins, until I implement the mini-game.
-
-					if (_vm->_gyro->_wonNim) { // Already won the game.
-						_vm->_scrolls->displayScrollChain('Q', 6);
-						return;
-					}
+			case kRoomArgentPub: // ...in the pub, => play Nim.
+				warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
+				// play_nim();
+				// The following parts are copied from play_nim().
+				// The player automatically wins the game everytime he wins, until I implement the mini-game.
+
+				if (_vm->_gyro->_wonNim) { // Already won the game.
+					_vm->_scrolls->displayScrollChain('Q', 6);
+					return;
+				}
 
-					if (!_vm->_gyro->_askedDogfoodAboutNim) {
-						_vm->_scrolls->displayScrollChain('q', 84);
-						return;
-					}
+				if (!_vm->_gyro->_askedDogfoodAboutNim) {
+					_vm->_scrolls->displayScrollChain('q', 84);
+					return;
+				}
 
-					_vm->_scrolls->displayScrollChain('Q', 3);
-					_vm->_gyro->_playedNim++;
+				_vm->_scrolls->displayScrollChain('Q', 3);
+				_vm->_gyro->_playedNim++;
 
-					// You won - strange!
-					_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
-					_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
-					_vm->_lucerna->refreshObjectList();
-					_vm->_gyro->_wonNim = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
-					_vm->_lucerna->incScore(7); // 7 points for winning!
+				// You won - strange!
+				_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
+				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_wonNim = true;
+				_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
+				_vm->_lucerna->incScore(7); // 7 points for winning!
 
-					if (_vm->_gyro->_playedNim == 1)
-						_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
+				if (_vm->_gyro->_playedNim == 1)
+					_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
 
-					// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-					_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-						+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
-				}
+				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
+				_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+					+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
 				break;
 			case kRoomMusicRoom:
 				playHarp();
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 2baa232..f3076da 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -656,7 +656,7 @@ void Animation::catacombMove(byte ped) {
 	// ARCHWAYS:
 	case 0x7:
 	case 0x8:
-	case 0x9: {
+	case 0x9:
 		_vm->_celer->drawBackgroundSprite(-1, -1, 6);
 
 		if (((here & 0xf000) >> 12) > 0x7)
@@ -666,8 +666,7 @@ void Animation::catacombMove(byte ped) {
 
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
-	}
-	break;
+		break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index 4c5afe5..c43a5b0 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -399,10 +399,9 @@ void Dropdown::parseKey(char r, char re) {
 	//case 13:
 	//	_activeMenuItem.select(_activeMenuItem._highlightNum);
 	//	break;
-	//default: {
+	//default:
 	//	if (_activeMenuItem._activeNow)
 	//		_activeMenuItem.parseKey(r);
-	//	}
 	//}
 	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
 }
@@ -467,11 +466,12 @@ void Dropdown::setupMenuPeople() {
 
 	_activeMenuItem.reset();
 
-	for (byte i = 150; i <= 178; i++)
+	for (byte i = 150; i <= 178; i++) {
 		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
 			people += i;
 		}
+	}
 
 	_activeMenuItem.display();
 }
@@ -515,16 +515,14 @@ void Dropdown::setupMenuWith() {
 		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
 		switch (_vm->_gyro->_thinks) {
 		case Gyro::kPeopleGeida:
-		case Gyro::kPeopleArkata: {
+		case Gyro::kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
-		}
-		break;
-		case Gyro::kPeopleDogfood: {
+			break;
+		case Gyro::kPeopleDogfood:
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
-		}
-		break;
+			break;
 		case Gyro::kPeopleMalagauche: {
 			bool isSober = !_vm->_gyro->_teetotal;
 			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
@@ -533,13 +531,12 @@ void Dropdown::setupMenuWith() {
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
 			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
-		}
-		break;
-		case Gyro::kPeopleTrader: {
+			}
+			break;
+		case Gyro::kPeopleTrader:
 			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
 			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
-		}
-		break;
+			break;
 		}
 	}
 	_activeMenuItem.display();
@@ -572,18 +569,16 @@ void Dropdown::runMenuFile() {
 	case 0:
 		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
 		break;
-	case 1: {
+	case 1:
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
 		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
-	}
-	break;
-	case 2: {
+		break;
+	case 2:
 		if (!_vm->_acci->_realWords[1].empty())
 			_vm->_acci->_realWords[1].clear();
 		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
-	}
-	break;
+		break;
 	case 3:
 		//_vm->_basher->filename_edit();
 		warning("STUB: Dropdown::runMenuFile()");
@@ -601,13 +596,12 @@ void Dropdown::runMenuAction() {
 	Common::String f5Does;
 	// Get up, pause game, open door, look, inventory, walk/run.
 	switch (_activeMenuItem._choiceNum) {
-	case 0: {
+	case 0:
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
 		f5Does = _vm->_gyro->f5Does();
 		_vm->_lucerna->callVerb(f5Does[0]);
-	}
-	break;
+		break;
 	case 1:
 		_vm->_acci->_thing = _vm->_acci->kPardon;
 		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
@@ -629,8 +623,8 @@ void Dropdown::runMenuAction() {
 		else
 			avvy->_speedX = _vm->_gyro->kWalk;
 		_vm->_animation->updateSpeed();
-	}
-	break;
+		}
+		break;
 	}
 }
 
@@ -657,48 +651,35 @@ void Dropdown::runMenuWith() {
 
 	} else {
 		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
-		case 100: { // Beer
+		case 100: // Beer
 			_vm->_acci->_thing = 100;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		case 101: { // Wine
+		case 101: // Wine
 			_vm->_acci->_thing = 50;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		case 102: { // Whisky
+		case 102: // Whisky
 			_vm->_acci->_thing = 102;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		case 103: { // Cider
+		case 103: // Cider
 			_vm->_acci->_thing = 103;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		case 104: { // Mead
+		case 104: // Mead
 			_vm->_acci->_thing = 107;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		case 105: { // Onion (trader)
+		case 105: // Onion (trader)
 			_vm->_acci->_thing = 67;
 			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
 			return;
-		}
-		break;
-		default: {
+		default:
 			_vm->_acci->_person = _vm->_acci->_thing;
 			_vm->_acci->_thing = Acci::kPardon;
 			_vm->_gyro->_subjectNum = 0;
 		}
-		}
 	}
 	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
 }
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 601adee..a0403c0 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -198,7 +198,7 @@ void Gyro::newMouse(byte id) {
 		return;
 	_currentMouse = id;
 
-	loadMouse(id);
+	loadMouse(id - 1);
 }
 
 /**
@@ -550,35 +550,40 @@ void Gyro::loadMouse(byte which) {
 
 
 	// The AND mask.
-	f.seek(kMouseSize * 2 * (which - 1) + 134);
+	f.seek(kMouseSize * 2 * which + 134);
 
 	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
 
-	for (byte j = 0; j < mask.h; j++)
-		for (byte i = 0; i < mask.w; i++)
-			for (byte k = 0; k < 2; k++)
+	for (byte j = 0; j < mask.h; j++) {
+		for (byte i = 0; i < mask.w; i++) {
+			for (byte k = 0; k < 2; k++) {
 				if (*(byte *)mask.getBasePtr(i, j) == 0)
 					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
+			}
+		}
+	}
 
 	mask.free();
 
 	// The OR mask.
-	f.seek(kMouseSize * 2 * (which - 1) + 134 * 2);
+	f.seek(kMouseSize * 2 * which + 134 * 2);
 
 	mask = _vm->_graphics->loadPictureGraphic(f);
 
-	for (byte j = 0; j < mask.h; j++)
-		for (byte i = 0; i < mask.w; i++)
+	for (byte j = 0; j < mask.h; j++) {
+		for (byte i = 0; i < mask.w; i++) {
 			for (byte k = 0; k < 2; k++) {
 				byte pixel = *(byte *)mask.getBasePtr(i, j);
 				if (pixel != 0)
 					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
 			}
+		}
+	}
 
 	mask.free();
 	f.close();
 
-	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which - 1]._horizontal, kMouseHotSpots[which - 1]._vertical * 2, 255, false);
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which]._horizontal, kMouseHotSpots[which]._vertical * 2, 255, false);
 	cursor.free();
 }
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 5ba0e70..0450ea9 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -387,7 +387,7 @@ void Lucerna::enterNewTown() {
 		if ((_vm->_gyro->_roomCount[kRoomRobins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
 			_vm->_gyro->_mushroomGrowing = true;
 		break;
-	case kRoomWiseWomans: { // Entry into Argent.
+	case kRoomWiseWomans: // Entry into Argent.
 		if (_vm->_gyro->_talkedToCrapulus && (!_vm->_gyro->_lustieIsAsleep)) {
 			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[kRoomWiseWomans] % 3) == 1);
 			_vm->_gyro->_crapulusWillTell = !_vm->_gyro->_spludwickAtHome;
@@ -397,8 +397,7 @@ void Lucerna::enterNewTown() {
 		}
 		if (_vm->_gyro->_boxContent == Gyro::kObjectWine)
 			_vm->_gyro->_wineState = 3; // Vinegar
-	}
-	break;
+		break;
 	}
 
 	if (_vm->_gyro->_room != kRoomOutsideDucks) {
@@ -627,21 +626,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
 
 			switch (ped) {
-			case 3: { // Enter from oubliette
+			case 3: // Enter from oubliette
 				_vm->_gyro->_catacombX = 8;
 				_vm->_gyro->_catacombY = 4;
-			}
-			break;
-			case 5: { // Enter from du Lustie's
+				break;
+			case 5: // Enter from du Lustie's
 				_vm->_gyro->_catacombX = 8;
 				_vm->_gyro->_catacombY = 7;
-			}
-			break;
-			case 6: { // Enter from Geida's
+				break;
+			case 6: // Enter from Geida's
 				_vm->_gyro->_catacombX = 4;
 				_vm->_gyro->_catacombY = 1;
-			}
-			break;
+				break;
 			}
 
 			_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 9be66ef..e2667b1 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -93,11 +93,10 @@ void Parser::handleReturn() {
 
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
-	case Common::KEYCODE_F5: {
+	case Common::KEYCODE_F5:
 		_vm->_acci->_person = _vm->_acci->kPardon;
 		_vm->_acci->_thing = _vm->_acci->kPardon;
 		_vm->_lucerna->callVerb(_vm->_gyro->f5Does()[0]);
-		}
 		break;
 	case Common::KEYCODE_F7:
 		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 26aea4b..3e277c9 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -90,13 +90,11 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 	int16 i = 0;
 	for (byte xx = 0; xx < lz; xx++) {
 		switch (z[xx]) {
-		case kControlRoman: {
+		case kControlRoman:
 			_currentFont = kFontStyleRoman;
-			}
 			break;
-		case kControlItalic: {
+		case kControlItalic:
 			_currentFont = kFontStyleItalic;
-			}
 			break;
 		default: {
 			for (byte yy = 0; yy < 12; yy++)
@@ -370,15 +368,13 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	case 0:
 		iconIndent = 0;
 		break; // No icon.
-	case 34: {
+	case 34:
 		drawSign("about", 28, 76, 15);
 		iconIndent = 0;
-		}
 		break;
-	case 35: {
+	case 35:
 		drawSign("gameover", 52, 59, 71);
 		iconIndent = 0;
-		}
 		break;
 	}
 
@@ -391,17 +387,15 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		if (!_vm->_gyro->_scroll[i].empty())
 			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
-			case kControlCenter: {
+			case kControlCenter:
 				centre = true;
 				_vm->_gyro->_scroll[i].deleteLastChar();
-				}
 				break;
-			case kControlLeftJustified: {
+			case kControlLeftJustified:
 				centre = false;
 				_vm->_gyro->_scroll[i].deleteLastChar();
-				}
 				break;
-			case kControlQuestion: {
+			case kControlQuestion:
 				//settextjustify(1, 1);
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
@@ -410,7 +404,6 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 				// inc(diy,14);
 				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
 				_vm->_gyro->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
-				}
 				break;
 			}
 
@@ -618,10 +611,9 @@ void Scrolls::callScrollDriver() {
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
-	default: {
+	default:
+		_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = kControlParagraph;
 		_vm->_gyro->_bufSize++;
-		_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = kControlParagraph;
-		}
 	}
 
 	uint16 size = _vm->_gyro->_bufSize;
@@ -638,7 +630,7 @@ void Scrolls::callScrollDriver() {
 			mouthnext = false;
 		} else {
 			switch (_vm->_gyro->_buffer[i]) {
-			case kControlParagraph: {
+			case kControlParagraph:
 				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
 					break;
 
@@ -652,12 +644,11 @@ void Scrolls::callScrollDriver() {
 
 				if (_vm->_gyro->_scReturn)
 					return;
-			}
-			break;
+				break;
 			case kControlBell:
 				_vm->_gyro->_scrollBells++;
 				break; // #7 = "Bel"
-			case kControlSpeechBubble: {
+			case kControlSpeechBubble:
 				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
 					break;
 
@@ -695,8 +686,7 @@ void Scrolls::callScrollDriver() {
 
 				if (_vm->_gyro->_scReturn)
 					return;
-			}
-			break;
+				break;
 
 			// CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive 
 			case kControlNegative:
@@ -760,8 +750,8 @@ void Scrolls::callScrollDriver() {
 					_vm->_lucerna->spriteRun();
 				call_spriterun = false;
 
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum] = kControlQuestion;
 				_vm->_gyro->_scrollNum++;
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] = kControlQuestion;
 
 				drawScroll(&Avalanche::Scrolls::scrollModeDialogue);
 				resetScroll();
@@ -834,8 +824,8 @@ void Scrolls::unSkrimble() {
 }
 
 void Scrolls::doTheBubble() {
+	_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = 2;
 	_vm->_gyro->_bufSize++;
-	_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1] = 2;
 }
 
 /**


Commit: 3f19e7a0fbf5da196e37438914e574cc6aee99c6
    https://github.com/scummvm/scummvm/commit/3f19e7a0fbf5da196e37438914e574cc6aee99c6
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-16T05:10:31-07:00

Commit Message:
AVALANCHE: Repair exit condition of the main loop.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 24e5f56..75ab53f 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -589,7 +589,7 @@ Common::Error AvalancheEngine::run() {
 		//	break;
 		//}
 
-	} while (!shouldQuit());
+	} while (!_gyro->_letMeOut && !shouldQuit());
 
 	return Common::kNoError;
 }


Commit: 5f6fc0de6be8cb048e3a757197912d872a7d6e27
    https://github.com/scummvm/scummvm/commit/5f6fc0de6be8cb048e3a757197912d872a7d6e27
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-16T05:36:30-07:00

Commit Message:
AVALANCHE: Remove unnecessary error() call.

Changed paths:
    engines/avalanche/celer.cpp



diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 3d78034..3efcdc4 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -335,7 +335,7 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 	} else {
 		Common::File f;
 		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
-			error("AVALANCHE: Celer: File not found: %s", _filename.c_str());
+			return; // We skip because some rooms don't have sprites in the background.
 
 		f.seek(_offsets[which]);
 


Commit: fe72db6c85d31fdc13e39f3575d63ef061ab8cc9
    https://github.com/scummvm/scummvm/commit/fe72db6c85d31fdc13e39f3575d63ef061ab8cc9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-16T07:18:02-07:00

Commit Message:
AVALANCHE: Make Graphics::drawPicture more safe. Fix an index-bug regarding Gyro::_objectList.

Changed paths:
    engines/avalanche/dropdown.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/lucerna.cpp



diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index c43a5b0..edf99ae 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -629,7 +629,7 @@ void Dropdown::runMenuAction() {
 }
 
 void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing);
+	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum], Gyro::kThing);
 }
 
 void Dropdown::runMenuPeople() {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 8f51f74..a6cbe3d 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -291,7 +291,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	}
 }
 
-void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
 		for (uint16 x = 0; x < picture.w; x++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index a94ed77..41b1016 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -85,7 +85,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 	void refreshScreen();
 	void refreshBackground();
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 0450ea9..275375c 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1004,8 +1004,8 @@ void Lucerna::refreshObjectList() {
 
 	for (byte i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_objects[i]) {
-			_vm->_gyro->_carryNum++;
 			_vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1;
+			_vm->_gyro->_carryNum++;
 		}
 	}
 }


Commit: 7f26871be13e64883e1f535f64735a93954ec8d4
    https://github.com/scummvm/scummvm/commit/7f26871be13e64883e1f535f64735a93954ec8d4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-16T11:20:34-07:00

Commit Message:
AVALANCHE: Remove dead code

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 788b418..1330ee5 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -191,7 +191,6 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_lucerna->_clock.update();
 		_vm->_dropdown->updateMenu();
-		_vm->_gyro->forceNumlock();
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index a0403c0..62dd4a3 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -378,10 +378,6 @@ bool Gyro::setFlag(char x) {
 	return false;
 }
 
-void Gyro::forceNumlock() {
-	warning("STUB: Gyro::force_numlock()");
-}
-
 bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_money -= howmuchby;
 	if (_money < 0) {
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 7785f4f..977a2e7 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -388,7 +388,6 @@ public:
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
 	bool setFlag(char x);
-	void forceNumlock();
 	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
 	void hangAroundForAWhile();
 	


Commit: 68533445a0c8f308907ad815b28abb2ba558e161
    https://github.com/scummvm/scummvm/commit/68533445a0c8f308907ad815b28abb2ba558e161
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-16T11:20:37-07:00

Commit Message:
AVALANCHE: Index conversion related to drawBackgroundSprite()

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/celer.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index ba8dbbd..3b46053 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -871,7 +871,7 @@ bool Acci::isHolding() {
 
 void Acci::openBox(bool isOpening) {
 	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
@@ -880,7 +880,7 @@ void Acci::openBox(bool isOpening) {
 		_vm->_system->delayMillis(55);
 
 		if (!isOpening) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 			_vm->_celer->updateBackgroundSprites();
 			_vm->_animation->animLink();
 			_vm->_graphics->refreshScreen();
@@ -1315,7 +1315,7 @@ void Acci::standUp() {
 			_vm->_gyro->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->_direction = Animation::kDirLeft;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
@@ -1329,7 +1329,7 @@ void Acci::standUp() {
 
 	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(0, 3); // And walking away.
 			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
@@ -1347,12 +1347,12 @@ void Acci::getProc(char thing) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
 			if (_vm->_gyro->_boxContent == thing) {
-				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 				_vm->_scrolls->displayText("OK, I've got it.");
 				_vm->_gyro->_objects[thing - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_boxContent = kNothing;
-				_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 			} else {
 				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
 				_vm->_scrolls->displayText(tmpStr);
@@ -1368,7 +1368,7 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
-					_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
+					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_gyro->_takenPen = true;
 					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
@@ -1389,7 +1389,7 @@ void Acci::getProc(char thing) {
 		break;
 	case kRoomRobins:
 		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_mushroomGrowing = false;
 			_vm->_gyro->_takenMushroom = true;
@@ -1608,8 +1608,8 @@ void Acci::doThat() {
 							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
 							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
 							_vm->_gyro->_givenBadgeToIby = true;
+							_vm->_celer->drawBackgroundSprite(-1, -1, 7);
 							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
-							_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 						} else
 							heyThanks();
 						break;
@@ -1791,7 +1791,7 @@ void Acci::doThat() {
 				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_wonNim = true;
-				_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
+				_vm->_celer->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
 				_vm->_lucerna->incScore(7); // 7 points for winning!
 
 				if (_vm->_gyro->_playedNim == 1)
@@ -1953,11 +1953,11 @@ void Acci::doThat() {
 					if (_vm->_gyro->_alcoholLevel == 0)
 						_vm->_lucerna->incScore(3);
 
-					_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+					_vm->_celer->drawBackgroundSprite(-1, -1, 11);
 					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
 					_vm->_gyro->_drinking = _thing;
 
-					_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+					_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 					_vm->_gyro->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
@@ -1978,12 +1978,12 @@ void Acci::doThat() {
 							return;
 						}
 
-						_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+						_vm->_celer->drawBackgroundSprite(-1, -1, 11);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 						_vm->_scrolls->displayText(tmpStr);
 						if (_vm->_gyro->_alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
-						_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+						_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 						_vm->_gyro->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
@@ -2153,7 +2153,7 @@ void Acci::doThat() {
 					_vm->_gyro->_avvyIsAwake = true;
 					_vm->_lucerna->incScore(1);
 					_vm->_gyro->_avvyInBed = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed.
+					_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_teetotal)
 						_vm->_scrolls->displayScrollChain('d', 13);
 				} else
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f3076da..3bd3bde 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -464,59 +464,59 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);  // ...window.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // Sloping wall.
@@ -531,44 +531,44 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
+		_vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicNothing; // Sloping wall.
@@ -586,7 +586,7 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x1:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 21);
 
 		if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows))
 			_vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
@@ -597,13 +597,13 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
 		_vm->_gyro->_magics[6]._operation = Gyro::kMagicSpecial; // Middle exit south.
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x3:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 24);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicSpecial; // Left exit south.
 		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
@@ -624,7 +624,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
@@ -642,7 +642,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x5:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
@@ -657,12 +657,12 @@ void Animation::catacombMove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 30);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 32);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
 
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
@@ -671,50 +671,50 @@ void Animation::catacombMove(byte ped) {
 	case 0xd: // No connection + WINDOW
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 14);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicNothing; // Door to Geida's room.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 17);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 16);
 		break;     // [2,2] : "Art Gallery" sign over door.
 	case 264:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
 		break;      // [8,1] : "The Wrong Way!" sign.
 	case 1797:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		break;      // [5,7] : "Ite Mingite" sign.
 	case 258:
 		for (int i = 0; i <= 2; i++) { // [2,1] : Art gallery - pictures
-			_vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 15);
-			_vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 16);
+			_vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 14);
+			_vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 15);
 		}
 		break;
 	case 1287:
 		for (int i = 10; i <= 13; i++)
-			_vm->_celer->drawBackgroundSprite(-1, -1, i);
+			_vm->_celer->drawBackgroundSprite(-1, -1, i - 1);
 		break; // [7,5] : 4 candles.
 	case 776:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		break;     // [8,3] : 1 candle.
 	case 2049:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
 		break;     // [1,8] : another candle.
 	case 257:
+		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
 		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
-		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
 		break; // [1,1] : the other two.
 	}
 
@@ -735,7 +735,7 @@ void Animation::dawnDelay() {
 void Animation::callSpecial(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 		_vm->_gyro->_brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
@@ -782,7 +782,7 @@ void Animation::callSpecial(uint16 which) {
 			_vm->_scrolls->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_scrolls->displayScrollChain('q', 36);
 			_vm->_gyro->_tiedUp = true;
 			_vm->_gyro->_friarWillTieYouUp = false;
@@ -1075,7 +1075,7 @@ void Animation::arrowProcs(byte tripnum) {
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door.
 		_vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
@@ -1301,7 +1301,7 @@ void Animation::hideInCupboard() {
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
 		_vm->_scrolls->displayText(tmpStr);
 		_vm->_gyro->_avvysInTheCupboard = true;
-		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 7);
 	}
 }
 
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 3efcdc4..f6e3773 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -60,19 +60,19 @@ void Celer::updateBackgroundSprites() {
 	switch (_vm->_gyro->_room) {
 	case kRoomOutsideArgentPub:
 		if ((_vm->_gyro->_roomTime % 12) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4);
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 4);
 		break;
 	case kRoomBrummieRoad:
 		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4);
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 2) % 4);
 		break;
 	case kRoomBridge:
 		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
+			drawBackgroundSprite(-1, -1, 3 + (_vm->_gyro->_roomTime / 2) % 4);
 		break;
 	case kRoomYours:
 		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 2);
 		break;
 	case kRoomArgentPub:
 		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
@@ -82,16 +82,16 @@ void Celer::updateBackgroundSprites() {
 			case 1:
 			case 11:
 			case 21:
-				drawBackgroundSprite(-1, -1, 12); // Looks forwards.
+				drawBackgroundSprite(-1, -1, 11); // Looks forwards.
 				break;
 			case 8:
 			case 18:
 			case 28:
 			case 32:
-				drawBackgroundSprite(-1, -1, 11); // Looks at you.
+				drawBackgroundSprite(-1, -1, 10); // Looks at you.
 				break;
 			case 30:
-				drawBackgroundSprite(-1, -1, 13); // Winks.
+				drawBackgroundSprite(-1, -1, 12); // Winks.
 				break;
 			case 33:
 				_vm->_gyro->_malagauche = 0;
@@ -102,14 +102,14 @@ void Celer::updateBackgroundSprites() {
 		switch (_vm->_gyro->_roomTime % 200) {
 		case 179:
 		case 197:
-			drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle.
+			drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle.
 			break;
 		case 182:
 		case 194:
-			drawBackgroundSprite(-1, -1, 6);
+			drawBackgroundSprite(-1, -1, 5);
 			break;
 		case 185:
-			drawBackgroundSprite(-1, -1, 7);
+			drawBackgroundSprite(-1, -1, 6);
 			break;
 		case 199:
 			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
@@ -127,7 +127,7 @@ void Celer::updateBackgroundSprites() {
 				direction = 4;
 
 			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
-				drawBackgroundSprite(-1, -1, direction);
+				drawBackgroundSprite(-1, -1, direction - 1);
 				_vm->_gyro->_npcFacing = direction;
 			}
 		}
@@ -136,16 +136,16 @@ void Celer::updateBackgroundSprites() {
 		if ((_vm->_gyro->_roomTime % 3) == 0) {
 			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
 			case 4:
-				drawBackgroundSprite(-1, -1, 1);
+				drawBackgroundSprite(-1, -1, 0);
 				break;
 			case 1:
 			case 3:
 			case 5:
-				drawBackgroundSprite(-1, -1, 2);
+				drawBackgroundSprite(-1, -1, 1);
 				break;
 			case 0:
 			case 2:
-				drawBackgroundSprite(-1, -1, 3);
+				drawBackgroundSprite(-1, -1, 2);
 				break;
 			}
 		}
@@ -165,7 +165,7 @@ void Celer::updateBackgroundSprites() {
 				direction = 3; // Right.
 
 			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
-				drawBackgroundSprite(-1, -1, direction);
+				drawBackgroundSprite(-1, -1, direction - 1);
 				_vm->_gyro->_npcFacing = direction;
 			}
 		}
@@ -174,10 +174,10 @@ void Celer::updateBackgroundSprites() {
 		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
 			switch ((_vm->_gyro->_roomTime / 14) % 2) {
 			case 0:
-				drawBackgroundSprite(-1, -1, 1);  // Frame 2: EGA.
+				drawBackgroundSprite(-1, -1, 0);  // Frame 2: EGA.
 				break;
 			case 1:
-				drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural.
+				drawBackgroundSprite(-1, -1, 2); // Frame 1: Natural.
 				break;
 			}
 		}
@@ -186,10 +186,10 @@ void Celer::updateBackgroundSprites() {
 		if (_vm->_gyro->_tiedUp) {
 			switch (_vm->_gyro->_roomTime % 54) {
 			case 20:
-				drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
+				drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks.
 				break;
 			case 23:
-				drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal.
+				drawBackgroundSprite(-1, -1, 1); // Frame 1: Back to normal.
 				break;
 			}
 		}
@@ -209,23 +209,23 @@ void Celer::updateBackgroundSprites() {
 			direction--; // Blinks.
 
 		if (direction != _vm->_gyro->_npcFacing) { // Port.
-			drawBackgroundSprite(-1, -1, direction);
+			drawBackgroundSprite(-1, -1, direction - 1);
 			_vm->_gyro->_npcFacing = direction;
 		}
 
 		switch (_vm->_gyro->_roomTime % 50) {
 		case 45 :
-			drawBackgroundSprite(-1, -1, 9); // Spurge blinks.
+			drawBackgroundSprite(-1, -1, 8); // Spurge blinks.
 			break;
 		case 49 :
-			drawBackgroundSprite(-1, -1, 10);
+			drawBackgroundSprite(-1, -1, 9);
 			break;
 		}
 		break;
 	  }
 	case kRoomDucks: {
 		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3);
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 3) % 3);
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
@@ -241,7 +241,7 @@ void Celer::updateBackgroundSprites() {
 			direction++; // Duck blinks.
 
 		if (direction != _vm->_gyro->_npcFacing) { // Duck.
-			drawBackgroundSprite(-1, -1, direction);
+			drawBackgroundSprite(-1, -1, direction - 1);
 			_vm->_gyro->_npcFacing = direction;
 		}
 		break;
@@ -321,23 +321,23 @@ void Celer::forgetBackgroundSprites() {
 	}
 }
 
-void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
-	which--; // For the difference between the Pascal and C array indexes.
-	//setactivepage(3);
-	warning("STUB: Celer::show_one()");
-
-	if (_sprites[which]._x > kOnDisk) {
+/**
+ * Draw background animation
+ * @remarks	Originally called 'show_one'
+ */
+void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
+	if (_sprites[sprId]._x > kOnDisk) {
 		if (destX < 0) {
-			destX = _sprites[which]._x * 8;
-			destY = _sprites[which]._y;
+			destX = _sprites[sprId]._x * 8;
+			destY = _sprites[sprId]._y;
 		}
-		drawSprite(destX, destY, _sprites[which]);
+		drawSprite(destX, destY, _sprites[sprId]);
 	} else {
 		Common::File f;
 		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
 			return; // We skip because some rooms don't have sprites in the background.
 
-		f.seek(_offsets[which]);
+		f.seek(_offsets[sprId]);
 
 		SpriteType sprite;
 		sprite._type = PictureType(f.readByte());
@@ -358,9 +358,6 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) {
 		sprite._picture.free();
 		f.close();
 	}
-
-	//setactivepage(1 - cp);
-	warning("STUB: Celer::show_one()");
 }
 
 
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
index 47a11bf..538a765 100644
--- a/engines/avalanche/celer.h
+++ b/engines/avalanche/celer.h
@@ -51,7 +51,7 @@ public:
 	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
 	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
 	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
-	void drawBackgroundSprite(int16 destX, int16 destY, byte which);
+	void drawBackgroundSprite(int16 destX, int16 destY, byte sprId);
 
 private:
 	enum PictureType {kEga, kBgi, kNaturalImage};
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 275375c..3fdca0c 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -445,7 +445,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	switch (room) {
 	case kRoomYours:
 		if (_vm->_gyro->_avvyInBed) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
 		}
@@ -545,7 +545,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomBridge:
 		if (_vm->_gyro->_drawbridgeOpen == 4) { // open
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
 			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 		}
@@ -571,10 +571,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 
 		if (_vm->_gyro->_tiedUp)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 
 		if (!_vm->_gyro->_mushroomGrowing)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break;
 
@@ -648,11 +648,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomArgentPub:
 		if (_vm->_gyro->_wonNim)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);   // No lute by the settle.
+			_vm->_celer->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
 		_vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
 		if (_vm->_gyro->_givenBadgeToIby) {
+			_vm->_celer->drawBackgroundSprite(-1, -1, 7);
 			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
-			_vm->_celer->drawBackgroundSprite(-1, -1, 9);
 		}
 		_vm->_graphics->refreshBackground();
 		break;
@@ -668,7 +668,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_geidaFollows) {
 			putGeidaAt(4, ped);
 			if (_vm->_gyro->_lustieIsAsleep) {
-				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
 				_vm->_graphics->refreshBackground();
 			}
 		}
@@ -677,14 +677,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case kRoomMusicRoom:
 		if (_vm->_gyro->_jacquesState > 0) {
 			_vm->_gyro->_jacquesState = 5;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 			_vm->_gyro->_magics[kColorBrown - 1]._operation = Gyro::kMagicNothing;
 			_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0;
 		}
 		if (ped != 0) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -695,7 +695,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomOutsideNottsPub:
 		if (ped == 2) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->thenShow(2);
@@ -707,7 +707,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomOutsideArgentPub:
 		if (ped == 2)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 6);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -735,7 +735,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
 			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(1);
 			if (_vm->_gyro->_arrowInTheDoor)
@@ -744,22 +744,22 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_sequence->thenShow(2);
 
 			if (_vm->_gyro->_takenPen)
-				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
 
 			_vm->_sequence->startToClose();
 		} else {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 			if (_vm->_gyro->_arrowInTheDoor)
-				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
-			else
 				_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			else
+				_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case kRoomAvvysGarden:
 		if (ped == 1)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -780,7 +780,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_sequence->start_to_close();
 #endif
 
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -791,7 +791,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomAylesOffice:
 		if (_vm->_gyro->_aylesIsAwake)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
 
@@ -812,14 +812,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_npcFacing = 1; // Port.
 		break;
 
 	case kRoomOutsideDucks:
 		if (ped == 2) {
 			// Shut the door
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->firstShow(2);
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 0e6d72a..1b55e88 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -98,7 +98,7 @@ void Sequence::callSequencer() {
 
 	if ((_seq[0] >= 1) && (_seq[0] <= 176)) {
 		// Show a frame.
-		_vm->_celer->drawBackgroundSprite(-1, -1, _seq[0]);
+		_vm->_celer->drawBackgroundSprite(-1, -1, _seq[0] - 1);
 		shoveLeft();
 	}
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 892dde0..8c169c5 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -232,7 +232,7 @@ void Timer::loseTimer(byte which) {
 
 void Timer::openDrawbridge() {
 	_vm->_gyro->_drawbridgeOpen++;
-	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 2);
 
 	if (_vm->_gyro->_drawbridgeOpen == 4)
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
@@ -274,7 +274,7 @@ void Timer::bang2() {
 void Timer::stairs() {
 	_vm->_gyro->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
-	_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 	_vm->_gyro->_brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
 	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
@@ -393,17 +393,17 @@ void Timer::jacquesWakesUp() {
 
 	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
 	case 1 :
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 0); // Eyes open.
 		_vm->_scrolls->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // But going through the door.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
+		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
 		_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
@@ -433,7 +433,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
-	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 
@@ -449,7 +449,7 @@ void Timer::naughtyDuke2() {
 }
 
 void Timer::naughtyDuke3() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+	_vm->_celer->drawBackgroundSprite(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 }
@@ -492,7 +492,7 @@ void Timer::jump() {
 		if (_vm->_gyro->_carryNum >= kCarryLimit)
 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
@@ -508,7 +508,7 @@ void Timer::crapulusSaysSpludOut() {
 }
 
 void Timer::buyDrinks() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+	_vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
 	_vm->_scrolls->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
@@ -520,7 +520,7 @@ void Timer::buyDrinks() {
 }
 
 void Timer::buyWine() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
+	_vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
 	_vm->_scrolls->displayScrollChain('D', 50); // You buy the wine.
@@ -630,7 +630,7 @@ void Timer::avvySitDown() {
 	if (avvy->_homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_sittingInPub = true;
 		_vm->_gyro->_userMovesAvvy = false;
 		avvy->_visible = false;


Commit: 6e08f55160eb9048d892d0b2f13cf4eb12206cc3
    https://github.com/scummvm/scummvm/commit/6e08f55160eb9048d892d0b2f13cf4eb12206cc3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-16T13:57:38-07:00

Commit Message:
AVALANCHE: Review all for statements

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/dropdown.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3b46053..b607478 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -370,7 +370,7 @@ void Acci::init() {
 }
 
 void Acci::clearWords() {
-	for (byte i = 0; i < 11; i++) {
+	for (int i = 0; i < 11; i++) {
 		if (!_realWords[i].empty())
 			_realWords[i].clear();
 	}
@@ -400,7 +400,7 @@ void Acci::replace(Common::String oldChars, byte newChar) {
 		if (newChar == 0)
 			_thats.deleteChar(pos);
 		else {
-			for (byte i = pos; i < pos + oldChars.size(); i++)
+			for (uint i = pos; i < pos + oldChars.size(); i++)
 				_thats.deleteChar(pos);
 			_thats.insertChar(newChar, pos);
 		}
@@ -417,7 +417,7 @@ Common::String Acci::rank() {
 		{32767, "copyright'93"}
 	};
 
-	for (byte i = 0; i < 8; i++) {
+	for (int i = 0; i < 8; i++) {
 		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
 		}
@@ -458,7 +458,7 @@ void Acci::cheatParse(Common::String codes) {
 void Acci::stripPunctuation(Common::String &word) {
 	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
 
-	for (byte i = 0; i < 32; i++) {
+	for (int i = 0; i < 32; i++) {
 		for (;;) {
 			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
 			if (pos == -1)
@@ -492,7 +492,7 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 bool Acci::doPronouns() {
 	bool ambiguous = false;
 
-	for (byte i = 0; i < _thats.size(); i++) {
+	for (uint i = 0; i < _thats.size(); i++) {
 		byte wordCode = _thats[i];
 		switch (wordCode) {
 		case 200:
@@ -517,7 +517,7 @@ void Acci::properNouns() {
 	_vm->_parser->_inputText.toLowercase();
 
 	// We set every word's first character to uppercase.
-	for (byte i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
+	for (uint i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
 		if (_vm->_parser->_inputText[i] == ' ')
 			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
 	}
@@ -644,7 +644,7 @@ void Acci::parse() {
 
 		// Check also[] first, which contains words about the actual room.
 		if (!thisword.empty()) {
-			for (byte i = 0; i < 31; i++) {
+			for (int i = 0; i < 31; i++) {
 				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
 					_thats += Common::String(99 + i);
 					notfound = false;
@@ -666,13 +666,13 @@ void Acci::parse() {
 		// Delete words we already processed.
 		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
 		if (spacePos > -1) {
-			for (byte i = 0; i <= spacePos; i++)
+			for (int i = 0; i <= spacePos; i++)
 				inputTextUpper.deleteChar(0);
 		}
 
 		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
 		if (spacePos > -1) {
-			for (byte i = 0; i <= spacePos; i++)
+			for (int i = 0; i <= spacePos; i++)
 				inputText.deleteChar(0);
 		}
 	}
@@ -911,7 +911,7 @@ void Acci::inventory() {
 	byte itemNum = 0;
 	Common::String tmpStr = Common::String("You're carrying ");
 
-	for (byte i = 0; i < kObjectNum; i++) {
+	for (int i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_objects[i]) {
 			itemNum++;
 			if (itemNum == _vm->_gyro->_carryNum)
@@ -993,7 +993,7 @@ void Acci::swallow() {   // Eat something.
 void Acci::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
-	for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
+	for (int i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
 			numPeople++;
 	}
@@ -1003,7 +1003,7 @@ void Acci::peopleInRoom() {
 
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
-	for (byte i = 1; i < 29; i++) {
+	for (int i = 1; i < 29; i++) {
 		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
@@ -1087,7 +1087,7 @@ void Acci::openDoor() {
 	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties))
 		return; // No doors can open if you can't move Avvy.
 
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		if (_vm->_animation->inField(i + 8)) {
 			MagicType *portal = &_vm->_gyro->_portals[i];
 			switch (portal->_operation) {
@@ -1453,7 +1453,7 @@ Common::String Acci::personSpeaks() {
 	bool found = false; // The _person we're looking for's code is in _person.
 	Common::String tmpStr;
 
-	for (byte i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
 			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, '1' + i);
 			found = true;
@@ -1463,7 +1463,7 @@ Common::String Acci::personSpeaks() {
 	if (found)
 		return tmpStr;
 
-	for (byte i = 0; i < 16; i++) {
+	for (int i = 0; i < 16; i++) {
 		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
 			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
 	}
@@ -1550,7 +1550,7 @@ void Acci::doThat() {
 			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
-				for (byte i = 0; i < 10; i++)
+				for (int i = 0; i < 10; i++)
 					_realWords[i] = _realWords[i + 1];
 
 				_verb = _vm->_gyro->_subjectNum;
@@ -1701,7 +1701,7 @@ void Acci::doThat() {
 		_vm->_scrolls->_aboutScroll = true;
 
 		Common::String toDisplay;
-		for (byte i = 0; i < 7; i++)
+		for (int i = 0; i < 7; i++)
 			toDisplay += Scrolls::kControlNewLine;
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Scrolls::kControlCenter + Scrolls::kControlNewLine
 			+ "The medi\x91val descendant of" + Scrolls::kControlNewLine
@@ -2068,11 +2068,11 @@ void Acci::doThat() {
 			_vm->_scrolls->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
-			for (byte i = 0; i < _thats.size(); i++) {
+			for (uint i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
 				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
-				for (byte j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
+				for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
 					if (_vocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
 				}
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 3bd3bde..edcc53c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -70,13 +70,13 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	if (!_stat._name.empty())
 		_stat._name.clear();
 	byte nameSize = inf.readByte();
-	for (byte i = 0; i < nameSize; i++)
+	for (int i = 0; i < nameSize; i++)
 		_stat._name += inf.readByte();
 	inf.skip(12 - nameSize);
 
 	//inf.skip(1); // Same as above.
 	byte commentSize = inf.readByte();
-	for (byte i = 0; i < commentSize; i++)
+	for (int i = 0; i < commentSize; i++)
 		_stat._comment += inf.readByte();
 	inf.skip(16 - commentSize);
 
@@ -93,10 +93,10 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (byte i = 0; i < _stat._frameNum; i++) {
+	for (int i = 0; i < _stat._frameNum; i++) {
 		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
 		_info._mani[_animCount] = new ManiType[_info._size - 6];
-		for (byte j = 0; j <= _info._yLength; j++)
+		for (int j = 0; j <= _info._yLength; j++)
 			inf.read((*_info._sil[_animCount])[j], _info._xWidth);
 		inf.read(*_info._mani[_animCount], _info._size - 6);
 
@@ -163,7 +163,7 @@ void AnimationType::appear(int16 wx, int16 wy, byte wf) {
  * @remarks	Originally called 'collision_check'
  */
 bool AnimationType::checkCollision() {
-	for (byte i = 0; i < _anim->kSpriteNumbMax; i++) {
+	for (int i = 0; i < _anim->kSpriteNumbMax; i++) {
 		AnimationType *spr = &_anim->_sprites[i];
 		if (spr->_quick && (spr->_id != _id) && (_x + _info._xLength > spr->_x) && (_x < spr->_x + spr->_info._xLength) && (spr->_y == _y))
 			return true;
@@ -343,7 +343,7 @@ void AnimationType::remove() {
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (byte i = 0; i < _stat._frameNum; i++) {
+	for (int i = 0; i < _stat._frameNum; i++) {
 		assert(_animCount > 0);
 		_animCount--;
 		delete[] _info._mani[_animCount];
@@ -1200,7 +1200,7 @@ void Animation::drawSprites() {
 
 	do {
 		ok = true;
-		for (byte i = 0; i < 4; i++) {
+		for (int i = 0; i < 4; i++) {
 			if (((order[i] != -1) && (order[i + 1] != -1))
 					&& (_sprites[order[i]]._y > _sprites[order[i + 1]]._y)) {
 				// Swap them!
@@ -1215,7 +1215,7 @@ void Animation::drawSprites() {
 
 	_vm->_graphics->refreshBackground();
 
-	for (byte i = 0; i < 5; i++) {
+	for (int i = 0; i < 5; i++) {
 		if (order[i] > -1)
 			_sprites[order[i]].draw();
 	}
@@ -1364,7 +1364,7 @@ bool Animation::nearDoor() {
 	int16 ux = _sprites[0]._x;
 	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
 
-	for (byte i = 8; i < _vm->_gyro->_fieldNum; i++) {
+	for (int i = 8; i < _vm->_gyro->_fieldNum; i++) {
 		FieldType *curField = &_vm->_gyro->_fields[i];
 		if ((ux >= curField->_x1) && (ux <= curField->_x2) && (uy >= curField->_y1) && (uy <= curField->_y2))
 			return true;
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 75ab53f..33c72c8 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -121,7 +121,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
 	sz.syncAsByte(_animation->_direction);
 	sz.syncAsByte(_gyro->_carryNum);
-	for (byte i = 0; i < kObjectNum; i++)
+	for (int i = 0; i < kObjectNum; i++)
 		sz.syncAsByte(_gyro->_objects[i]);
 	sz.syncAsSint16LE(_gyro->_dnascore);
 	sz.syncAsSint32LE(_gyro->_money);
@@ -262,7 +262,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 
 #if 0
-	for (byte groi = 0; groi < numtr; groi++) {
+	for (int groi = 0; groi < numtr; groi++) {
 		if (tr[groi].quick) {
 			blockwrite(f, groi, 1);
 			tr[groi].savedata(f);
@@ -272,7 +272,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
-		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) {
+		for (int i = 0; i < _animation->kSpriteNumbMax; i++) {
 			if (_animation->_sprites[i]._quick)
 				spriteNum++;
 		}
@@ -280,14 +280,14 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(spriteNum);
 
 	if (sz.isLoading()) {
-		for (byte i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
+		for (int i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
 			AnimationType *spr = &_animation->_sprites[i];
 			if (spr->_quick)
 				spr->remove();
 		}
 	}
 
-	for (byte i = 0; i < spriteNum; i++) {
+	for (int i = 0; i < spriteNum; i++) {
 		AnimationType *spr = &_animation->_sprites[i];
 		sz.syncAsByte(spr->_id);
 		sz.syncAsByte(spr->_doCheck);
@@ -324,7 +324,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, groi, 1);
 
 	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
 		sz.syncAsByte(_timer->_times[i]._action);
 		sz.syncAsByte(_timer->_times[i]._reason);
@@ -396,7 +396,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	// Check for our signature.
 	Common::String signature;
-	for (byte i = 0; i < 4; i++)
+	for (int i = 0; i < 4; i++)
 		signature += f->readByte();
 	if (signature != "AVAL")
 		return false;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 1330ee5..2d93ed8 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -149,7 +149,7 @@ void Avalot::setup() {
 	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
-	for (byte i = 0; i < 3; i++)
+	for (int i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
 	_vm->_animation->loadAnims();
@@ -198,12 +198,12 @@ void Avalot::run(Common::String arg) {
 
 #ifdef DEBUG
 		// ONLY FOR TESTING!!!
-		for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
+		for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
 			LineType *curLine = &_vm->_gyro->_lines[i];
 			_vm->_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
 		}
 
-		for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
+		for (int i = 0; i < _vm->_gyro->_fieldNum; i++) {
 			FieldType *curField = &_vm->_gyro->_fields[i];
 			if (curField->_x1 < 640)
 				_vm->_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index f6e3773..6edb4d2 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -272,10 +272,10 @@ void Celer::loadBackgroundSprites(byte number) {
 
 	f.seek(44);
 	_spriteNum = f.readByte();
-	for (byte i = 0; i < _spriteNum; i++)
+	for (int i = 0; i < _spriteNum; i++)
 		_offsets[i] = f.readSint32LE();
 
-	for (byte i = 0; i < _spriteNum; i++) {
+	for (int i = 0; i < _spriteNum; i++) {
 		f.seek(_offsets[i]);
 
 		SpriteType sprite;
@@ -315,7 +315,7 @@ void Celer::loadBackgroundSprites(byte number) {
 }
 
 void Celer::forgetBackgroundSprites() {
-	for (byte i = 0; i < _spriteNum; i++) {
+	for (int i = 0; i < _spriteNum; i++) {
 		if (_sprites[i]._x > kOnDisk)
 			_sprites[i]._picture.free();
 	}
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 97b823e..6e34a5a 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -128,7 +128,7 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 			if (file) {
 				// Check for our signature.
 				Common::String signature;
-				for (byte i = 0; i < 4; i++)
+				for (int i = 0; i < 4; i++)
 					signature += file->readByte();
 				if (signature != "AVAL") {
 					warning("Savegame of incompatible type!");
@@ -176,7 +176,7 @@ SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target,
 	if (f) {
 		// Check for our signature.
 		Common::String signature;
-		for (byte i = 0; i < 4; i++)
+		for (int i = 0; i < 4; i++)
 			signature += f->readByte();
 		if (signature != "AVAL") {
 			warning("Savegame of incompatible type!");
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index edf99ae..d088654 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -143,7 +143,7 @@ void MenuItem::display() {
 	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
 
 	displayOption(0, true);
-	for (byte y = 1; y < _optionNum; y++)
+	for (int y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 
 	_dr->_vm->_gyro->_defaultLed = 1;
@@ -209,7 +209,7 @@ void MenuItem::select(byte which) {
 void MenuItem::parseKey(char c) {
 	c = toupper(c);
 	bool found = false;
-	for (byte i = 0; i < _optionNum; i++) {
+	for (int i = 0; i < _optionNum; i++) {
 		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
 			select(i);
 			found = true;
@@ -237,7 +237,7 @@ void MenuBar::draw() {
 	byte savecp = _dr->_vm->_gyro->_cp;
 	_dr->_vm->_gyro->_cp = 3;
 
-	for (byte i = 0; i < _menuNum; i++)
+	for (int i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
 
 	_dr->_vm->_gyro->_cp = savecp;
@@ -325,12 +325,12 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 		ander = 170;
 
 	FontType font;
-	for (byte i = 0; i < text.size(); i++) {
-		for (byte j = 0; j < 8; j++) {
+	for (uint i = 0; i < text.size(); i++) {
+		for (int j = 0; j < 8; j++) {
 			byte idx = text[i];
 			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
-			for (byte k = 0; k < 8; k++)
+			for (int k = 0; k < 8; k++)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
 		}
 	}
@@ -346,7 +346,7 @@ void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text,
 			; // Search for the character in the string.
 
 		byte pixel = ander;
-		for (byte bit = 0; bit < 8; bit++) {
+		for (int bit = 0; bit < 8; bit++) {
 			byte pixelBit = (pixel >> bit) & 1;
 			if (pixelBit)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
@@ -438,7 +438,7 @@ void Dropdown::setupMenuAction() {
 	_activeMenuItem.reset();
 
 	Common::String f5Does = _vm->_gyro->f5Does();
-	for (byte i = 0; i < 2; i++)
+	for (int i = 0; i < 2; i++)
 		if (!f5Does.empty())
 			f5Does.deleteChar(0);
 	if (f5Does.empty())
@@ -466,7 +466,7 @@ void Dropdown::setupMenuPeople() {
 
 	_activeMenuItem.reset();
 
-	for (byte i = 150; i <= 178; i++) {
+	for (int i = 150; i <= 178; i++) {
 		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
 			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
 			people += i;
@@ -478,7 +478,7 @@ void Dropdown::setupMenuPeople() {
 
 void Dropdown::setupMenuObjects() {
 	_activeMenuItem.reset();
-	for (byte i = 0; i < kObjectNum; i++) {
+	for (int i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_objects[i])
 			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
 	}
@@ -491,7 +491,7 @@ void Dropdown::setupMenuWith() {
 	if (_vm->_gyro->_thinkThing) {
 		findWhatYouCanDoWithIt();
 
-		for (byte i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
+		for (uint i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
 			char vbchar;
 			Common::String verb;
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a6cbe3d..5b5d39e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -62,7 +62,7 @@ void Graphics::init() {
 		_egaPalette[i][2] = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
 	}
 
-	for (byte i = 0; i < 16; i++)
+	for (int i = 0; i < 16; i++)
 		g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[i]], i, 1);
 
 	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
@@ -176,7 +176,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 
 	// Get the top and the bottom of the triangle.
 	uint16 maxY = p[0].y, minY = p[0].y;
-	for (byte i = 1; i < 3; i++) {
+	for (int i = 1; i < 3; i++) {
 		if (p[i].y < minY)
 			minY = p[i].y;
 		if (p[i].y > maxY)
@@ -206,10 +206,10 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 }
 
 void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) {
-	for (byte i = 0; i < text.size(); i++) {
-		for (byte j = 0; j < fontHeight; j++) {
+	for (uint i = 0; i < text.size(); i++) {
+		for (int j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];
-			for (byte bit = 0; bit < 8; bit++) {
+			for (int bit = 0; bit < 8; bit++) {
 				byte pixelBit = (pixel >> bit) & 1;
 				if (pixelBit)
 					*(byte *)surface.getBasePtr(x + i * 8 + 7 - bit, y + j) = color;
@@ -228,11 +228,11 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
 	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
-	for (byte y = 0; y < height; y++) {
+	for (int y = 0; y < height; y++) {
 		for (int8 plane = 3; plane >= 0; plane--) { // The planes are in the opposite way.
 			for (uint16 x = 0; x < width; x += 8) {
 				byte pixel = file.readByte();
-				for (byte bit = 0; bit < 8; bit++) {
+				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
 					if (pixelBit != 0)
 						*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
@@ -251,11 +251,11 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	::Graphics::Surface picture;
 	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
 
-	for (byte plane = 0; plane < 4; plane++) {
+	for (int plane = 0; plane < 4; plane++) {
 		for (uint16 y = 0; y < height; y++) {
 			for (uint16 x = 0; x < width; x += 8) {
 				byte pixel = file.readByte();
-				for (byte i = 0; i < 8; i++) {
+				for (int i = 0; i < 8; i++) {
 					byte pixelBit = (pixel >> i) & 1;
 					*(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane);
 				}
@@ -268,8 +268,8 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the spirte blank.
-	for (byte j = 0; j < sprite._yLength; j++) {
-		for (byte i = 0; i < sprite._xLength; i++) {
+	for (int j = 0; j < sprite._yLength; j++) {
+		for (int i = 0; i < sprite._xLength; i++) {
 			if (((*sprite._sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
 				*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
 		}
@@ -278,11 +278,11 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	// Then we draw the picture to the blank places.
 	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
 
-	for (byte j = 0; j < sprite._yLength; j++) {
+	for (int j = 0; j < sprite._yLength; j++) {
 		for (int8 plane = 3; plane >= 0; plane--) { // The planes are in the opposite way.
 			for (uint16 i = 0; i  < sprite._xLength; i += 8) {
 				byte pixel = (*sprite._mani[picnum])[maniPos++];
-				for (byte bit = 0; bit < 8; bit++) {
+				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
 					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
 				}
@@ -304,7 +304,7 @@ void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
 		for (uint16 x = 0; x < _screen.w; x++) {
-			for (byte j = 0; j < 2; j++)
+			for (int j = 0; j < 2; j++)
 				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);
 		}
 	}
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 62dd4a3..2cb9d0e 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -182,7 +182,7 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
 }
 
 Gyro::~Gyro() {
-	for (byte i = 0; i < 9; i++) {
+	for (int i = 0; i < 9; i++) {
 		_digits[i].free();
 		_directions[i].free();
 	}
@@ -309,7 +309,7 @@ void Gyro::resetVariables() {
 }
 
 void Gyro::newGame() {
-	for (byte i = 0; i < kMaxSprites; i++) {
+	for (int i = 0; i < kMaxSprites; i++) {
 		AnimationType *spr = &_vm->_animation->_sprites[i];
 		if (spr->_quick)
 			spr->remove();
@@ -550,9 +550,9 @@ void Gyro::loadMouse(byte which) {
 
 	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
 
-	for (byte j = 0; j < mask.h; j++) {
-		for (byte i = 0; i < mask.w; i++) {
-			for (byte k = 0; k < 2; k++) {
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			for (int k = 0; k < 2; k++) {
 				if (*(byte *)mask.getBasePtr(i, j) == 0)
 					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
 			}
@@ -566,9 +566,9 @@ void Gyro::loadMouse(byte which) {
 
 	mask = _vm->_graphics->loadPictureGraphic(f);
 
-	for (byte j = 0; j < mask.h; j++) {
-		for (byte i = 0; i < mask.w; i++) {
-			for (byte k = 0; k < 2; k++) {
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			for (int k = 0; k < 2; k++) {
 				byte pixel = *(byte *)mask.getBasePtr(i, j);
 				if (pixel != 0)
 					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
@@ -588,7 +588,7 @@ void Gyro::setBackgroundColor(byte x) {
 }
 
 void Gyro::hangAroundForAWhile() {
-	for (byte i = 0; i < 28; i++)
+	for (int i = 0; i < 28; i++)
 		slowDown();
 }
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 3fdca0c..2b75d5a 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -117,8 +117,8 @@ Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false), _clock(vm) {
 }
 
 Lucerna::~Lucerna() {
-	for (byte i = 0; i < 31; i++) {
-		for (byte j = 0; j < 2; j++) {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)  {
 				delete _vm->_gyro->_also[i][j];
 				_vm->_gyro->_also[i][j] = 0;
@@ -128,8 +128,8 @@ Lucerna::~Lucerna() {
 }
 
 void Lucerna::init() {
-	for (byte i = 0; i < 31; i++) {
-		for (byte j = 0; j < 2; j++)
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++)
 			_vm->_gyro->_also[i][j] = 0;
 	}
 
@@ -165,7 +165,7 @@ void Lucerna::drawAlsoLines() {
 	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
-	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
 		// We had to check if the lines are within the borders of the screen.
 		if ((_vm->_gyro->_lines[i]._x1 >= 0) && (_vm->_gyro->_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y1 >= 0) && (_vm->_gyro->_lines[i]._y1 < _vm->_graphics->kScreenHeight)
 		 && (_vm->_gyro->_lines[i]._x2 >= 0) && (_vm->_gyro->_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y2 >= 0) && (_vm->_gyro->_lines[i]._y2 < _vm->_graphics->kScreenHeight))
@@ -195,8 +195,8 @@ void Lucerna::scram(Common::String &str) {
 }
 
 void Lucerna::unScramble() {
-	for (byte i = 0; i < 31; i++) {
-		for (byte j = 0; j < 2; j++) {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)
 				scram(*_vm->_gyro->_also[i][j]);
 		}
@@ -206,8 +206,8 @@ void Lucerna::unScramble() {
 }
 
 void Lucerna::loadAlso(byte num) {
-	for (byte i = 0; i < 31; i++) {
-		for (byte j = 0; j < 2; j++) {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
 			if (_vm->_gyro->_also[i][j] != 0)  {
 				delete _vm->_gyro->_also[i][j];
 				_vm->_gyro->_also[i][j] = 0;
@@ -223,8 +223,8 @@ void Lucerna::loadAlso(byte num) {
 
 	byte alsoNum = file.readByte();
 	Common::String tmpStr;
-	for (byte i = 0; i <= alsoNum; i++) {
-		for (byte j = 0; j < 2; j++) {
+	for (int i = 0; i <= alsoNum; i++) {
+		for (int j = 0; j < 2; j++) {
 			_vm->_gyro->_also[i][j] = new Common::String;
 			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
 		}
@@ -235,7 +235,7 @@ void Lucerna::loadAlso(byte num) {
 	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
 
 	_vm->_gyro->_lineNum = file.readByte();
-	for (byte i = 0; i < _vm->_gyro->_lineNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
 		LineType *curLine = &_vm->_gyro->_lines[i];
 		curLine->_x1 = file.readSint16LE();
 		curLine->_y1 = file.readSint16LE();
@@ -246,7 +246,7 @@ void Lucerna::loadAlso(byte num) {
 
 	memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds));
 	byte pedNum = file.readByte();
-	for (byte i = 0; i < pedNum; i++) {
+	for (int i = 0; i < pedNum; i++) {
 		PedType *curPed = &_vm->_gyro->_peds[i];
 		curPed->_x = file.readSint16LE();
 		curPed->_y = file.readSint16LE();
@@ -254,7 +254,7 @@ void Lucerna::loadAlso(byte num) {
 	}
 
 	_vm->_gyro->_fieldNum = file.readByte();
-	for (byte i = 0; i < _vm->_gyro->_fieldNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_fieldNum; i++) {
 		FieldType *curField = &_vm->_gyro->_fields[i];
 		curField->_x1 = file.readSint16LE();
 		curField->_y1 = file.readSint16LE();
@@ -262,32 +262,32 @@ void Lucerna::loadAlso(byte num) {
 		curField->_y2 = file.readSint16LE();
 	}
 
-	for (byte i = 0; i < 15; i++) {
+	for (int i = 0; i < 15; i++) {
 		MagicType *magic = &_vm->_gyro->_magics[i];
 		magic->_operation = file.readByte();
 		magic->_data = file.readUint16LE();
 	}
 
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		MagicType *portal = &_vm->_gyro->_portals[i];
 		portal->_operation = file.readByte();
 		portal->_data = file.readUint16LE();
 	}
 
 	_vm->_gyro->_flags.clear();
-	for (byte i = 0;  i < 26; i++)
+	for (int i = 0;  i < 26; i++)
 		_vm->_gyro->_flags += file.readByte();
 
 	int16 listen_length = file.readByte();
 	_vm->_gyro->_listen.clear();
-	for (byte i = 0; i < listen_length; i++)
+	for (int i = 0; i < listen_length; i++)
 		_vm->_gyro->_listen += file.readByte();
 
 	drawAlsoLines();
 
 	file.close();
 	unScramble();
-	for (byte i = 0; i <= alsoNum; i++) {
+	for (int i = 0; i <= alsoNum; i++) {
 		tmpStr = Common::String::format(",%s,", _vm->_gyro->_also[i][0]->c_str());
 		*_vm->_gyro->_also[i][0] = tmpStr;
 	}
@@ -305,7 +305,7 @@ void Lucerna::loadRoom(byte num) {
 	file.seek(146);
 	if (!_vm->_gyro->_roomnName.empty())
 		_vm->_gyro->_roomnName.clear();
-	for (byte i = 0; i < 30; i++) {
+	for (int i = 0; i < 30; i++) {
 		char actChar = file.readByte();
 		if ((32 <= actChar) && (actChar <= 126))
 			_vm->_gyro->_roomnName += actChar;
@@ -329,7 +329,7 @@ void Lucerna::zoomOut(int16 x, int16 y) {
 }
 
 void Lucerna::findPeople(byte room) {
-	for (byte i = 1; i < 29; i++) {
+	for (int i = 1; i < 29; i++) {
 		if (_vm->_gyro->_whereIs[i] == room) {
 			if (i < 25)
 				_vm->_gyro->_him = i + 150;
@@ -886,12 +886,12 @@ void Lucerna::loadDigits() {   // Load the scoring digits & rwlites
 	if (!file.open("digit.avd"))
 		error("AVALANCHE: Lucerna: File not found: digit.avd");
 
-	for (byte i = 0; i < 10; i++) {
+	for (int i = 0; i < 10; i++) {
 		file.seek(i * digitsize);
 		_vm->_gyro->_digits[i] = _vm->_graphics->loadPictureGraphic(file);
 	}
 
-	for (byte i = 0; i < 9; i++) {
+	for (int i = 0; i < 9; i++) {
 		file.seek(10 * digitsize + i * rwlitesize);
 		_vm->_gyro->_directions[i] = _vm->_graphics->loadPictureGraphic(file);
 	}
@@ -920,9 +920,9 @@ void Lucerna::drawToolbar() {
 void Lucerna::drawScore() {
 	uint16 score = _vm->_gyro->_dnascore;
 	int8 numbers[3] = {0, 0, 0};
-	for (byte i = 0; i < 2; i++) {
+	for (int i = 0; i < 2; i++) {
 		byte divisor = 1;
-		for (byte j = 0; j < (2 - i); j++)
+		for (int j = 0; j < (2 - i); j++)
 			divisor *= 10;
 		numbers[i] = score / divisor;
 		score -= numbers[i] * divisor;
@@ -931,24 +931,24 @@ void Lucerna::drawScore() {
 
 	CursorMan.showMouse(false);
 
-	for (byte i = 0; i < 3; i++) {
+	for (int i = 0; i < 3; i++) {
 		if (_vm->_gyro->_scoreToDisplay[i] != numbers[i])
 			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[i]], 250 + (i + 1) * 15, 177);
 	}
 
 	CursorMan.showMouse(true);
 
-	for (byte i = 0; i < 3; i++)
+	for (int i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = numbers[i];
 }
 
 void Lucerna::incScore(byte num) {     // Add on no. of points
-	for (byte i = 1; i <= num; i++) {
+	for (int i = 1; i <= num; i++) {
 		_vm->_gyro->_dnascore++;
 
 #if 0
 		if (soundfx) {
-			for (byte j = 1; j <= 97; j++)
+			for (int j = 1; j <= 97; j++)
 				sound(177 + dna.score * 3);
 		}
 		nosound;
@@ -1002,7 +1002,7 @@ void Lucerna::refreshObjectList() {
 	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_objects[_vm->_gyro->_thinks - 1])
 		thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money
 
-	for (byte i = 0; i < kObjectNum; i++) {
+	for (int i = 0; i < kObjectNum; i++) {
 		if (_vm->_gyro->_objects[i]) {
 			_vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1;
 			_vm->_gyro->_carryNum++;
@@ -1197,7 +1197,7 @@ void Lucerna::minorRedraw() {
 
 	enterRoom(_vm->_gyro->_room, 0); // Ped unknown or non-existant.
 
-	for (byte i = 0; i < 3; i++)
+	for (int i = 0; i < 3; i++)
 		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
 	drawScore();
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e2667b1..7f2ad4f 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -146,7 +146,7 @@ int16 Parser::pos(const Common::String &crit, const Common::String &src) {
 
 void Parser::drawCursor() {
 	// Draw the '_' character.
-	for (byte bit = 0; bit < 8; bit++)
+	for (int bit = 0; bit < 8; bit++)
 		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = kColorWhite;
 
 	ByteField bf;
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 5f2df1b..8fa1ef0 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -117,7 +117,7 @@ void Pingo::winningPic() {
 		error("AVALANCHE: Lucerna: File not found: finale.avd");
 
 #if 0
-	for (byte bit = 0; bit <= 3; bit++) {
+	for (int bit = 0; bit <= 3; bit++) {
 	port[0x3c4] = 2;
 	port[0x3ce] = 4;
 	port[0x3c5] = 1 << bit;
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 3e277c9..0cde27d 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -88,7 +88,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 	x /= 8;
 	y++;
 	int16 i = 0;
-	for (byte xx = 0; xx < lz; xx++) {
+	for (int xx = 0; xx < lz; xx++) {
 		switch (z[xx]) {
 		case kControlRoman:
 			_currentFont = kFontStyleRoman;
@@ -97,7 +97,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) {
 			_currentFont = kFontStyleItalic;
 			break;
 		default: {
-			for (byte yy = 0; yy < 12; yy++)
+			for (int yy = 0; yy < 12; yy++)
 				itw[(byte)z[xx]][yy] = _scrollFonts[_currentFont][(byte)z[xx]][yy + 2];
 
 			// We have to draw the characters one-by-one because of the accidental font changes.
@@ -198,7 +198,7 @@ void Scrolls::store(byte what, TuneType &played) {
 bool Scrolls::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
-	for (byte i = 0; i < sizeof(played); i++) {
+	for (int i = 0; i < sizeof(played); i++) {
 		if (played[i] != _vm->_gyro->kTune[i]) {
 			mistakes += 1;
 		}
@@ -244,7 +244,7 @@ void Scrolls::resetScrollDriver() {
 }
 
 void Scrolls::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (byte i = 0; i < _vm->_gyro->_scrollBells; i++)
+	for (int i = 0; i < _vm->_gyro->_scrollBells; i++)
 		_vm->_lucerna->errorLed(); // Ring the bell "x" times.
 }
 
@@ -313,7 +313,7 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 
 	int16 lx = 0;
 	int16 ly = (_vm->_gyro->_scrollNum) * 6;
-	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		ex = _vm->_gyro->_scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
@@ -384,7 +384,7 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	}
 
 
-	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		if (!_vm->_gyro->_scroll[i].empty())
 			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
 			case kControlCenter:
@@ -456,7 +456,7 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 
 	int16 xl = 0;
 	int16 yl = _vm->_gyro->_scrollNum * 5;
-	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		uint16 textWidth = _vm->_gyro->_scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
@@ -506,7 +506,7 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (byte i = 0; i < _vm->_gyro->_scrollNum; i++) {
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[i].size() / 2 * 8;
 		bool offset = _vm->_gyro->_scroll[i].size() % 2;
 		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
@@ -732,7 +732,7 @@ void Scrolls::callScrollDriver() {
 					}
 					break;
 				case 11:
-					for (byte j = 0; j < kObjectNum; j++) {
+					for (int j = 0; j < kObjectNum; j++) {
 						if (_vm->_gyro->_objects[j]) 
 							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
 					}
@@ -760,7 +760,7 @@ void Scrolls::callScrollDriver() {
 				mouthnext = true;
 				break;
 			case kControlInsertSpaces:
-				for (byte j = 0; j < 9; j++)
+				for (int j = 0; j < 9; j++)
 					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
 				break;
 			default: // Add new char.
@@ -1017,7 +1017,7 @@ void Scrolls::talkTo(byte whom) {
 		whom -= 149;
 
 	bool noMatches = true;
-	for (byte i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
+	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, i + 49, Scrolls::kControlToBuffer);
 			_vm->_scrolls->displayText(tmpStr);
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 8c169c5..2a8a569 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -44,7 +44,7 @@ namespace Avalanche {
 Timer::Timer(AvalancheEngine *vm) {
 	_vm = vm;
 
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		_times[i]._timeLeft = 0;
 		_times[i]._action = 0;
 		_times[i]._reason = 0;
@@ -83,7 +83,7 @@ void Timer::updateTimer() {
 	if (_vm->_gyro->_dropdownActive)
 		return;
 
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		if (_times[i]._timeLeft <= 0)
 			continue;
 
@@ -222,7 +222,7 @@ void Timer::updateTimer() {
 }
 
 void Timer::loseTimer(byte which) {
-	for (byte i = 0; i < 7; i++) {
+	for (int i = 0; i < 7; i++) {
 		if (_times[i]._reason == which)
 			_times[i]._timeLeft = 0; // Cancel this one!
 	}


Commit: 7790b4cc5bbbc895d9ee8f2dc09d259f231b85f0
    https://github.com/scummvm/scummvm/commit/7790b4cc5bbbc895d9ee8f2dc09d259f231b85f0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-17T15:05:14-07:00

Commit Message:
AVALANCHE: Janitorial - Clean up misc style glitches

Changed paths:
    engines/avalanche/dropdown.cpp
    engines/avalanche/dropdown.h
    engines/avalanche/graphics.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index d088654..8ae3af0 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -81,8 +81,6 @@ bool HeadType::parseAltTrigger(char key) {
 	return false;
 }
 
-
-
 void MenuItem::init(Dropdown *dr) {
 	_dr = dr;
 	_activeNow = false;
@@ -135,12 +133,12 @@ void MenuItem::display() {
 	_firstlix = true;
 	_flx1 = _left - 2;
 	_flx2 = _left + _width;
-	fly = 15 + _optionNum * 10;
+	_fly = 15 + _optionNum * 10;
 	_activeNow = true;
 	_dr->_vm->_gyro->_dropdownActive = true;
 
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, fly), _dr->kMenuBackgroundColor);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, fly + 1), _dr->kMenuBorderColor);
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), _dr->kMenuBorderColor);
 
 	displayOption(0, true);
 	for (int y = 1; y < _optionNum; y++)
@@ -183,7 +181,7 @@ void MenuItem::moveHighlight(int8 inc) {
 }
 
 void MenuItem::lightUp(Common::Point cursorPos) {
-	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((fly - 3) * 2 + 1)))
+	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((_fly - 3) * 2 + 1)))
 		return;
 	_highlightNum = (cursorPos.y - 26) / 20;
 	if (_highlightNum == _oldY)
@@ -263,14 +261,12 @@ void MenuBar::setupMenuItem(byte which) {
 }
 
 void MenuBar::chooseMenuItem(int16 x) {
-	byte i = 0;
-	do {
+	for (int i = 0; i < _menuNum; i++) {
 		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
 			setupMenuItem(i);
-			return;
+			break;
 		}
-		i++;
-	} while (i < _menuNum);
+	}
 }
 
 Dropdown::Dropdown(AvalancheEngine *vm) {
@@ -641,14 +637,12 @@ void Dropdown::runMenuWith() {
 	_vm->_acci->_thing = _vm->_gyro->_thinks;
 
 	if (_vm->_gyro->_thinkThing) {
-
 		_vm->_acci->_thing += 49;
 
 		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
 			_vm->_acci->_person = _vm->_gyro->_lastPerson;
 		else
 			_vm->_acci->_person = Acci::kPardon;
-
 	} else {
 		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
@@ -720,7 +714,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
 					_vm->_gyro->newMouse(1); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
-					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem.fly * 2 + 1))
+					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
 						_vm->_gyro->newMouse(3); // Right-arrow
 					else
 						_vm->_gyro->newMouse(4); // Fletch
@@ -735,7 +729,7 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 			if (_vm->_lucerna->_holdLeftMouse) {
 				if (cursorPos.y > 21) {
 					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1))))) {
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1))))) {
 							// Clicked OUTSIDE the menu.
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
@@ -765,28 +759,27 @@ void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
 
 				// NOT clicked button...
 				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem.fly * 2 + 1)))) {
+					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1)))) {
 
-						// We act only if the button is released over a menu item.
-						while (!_vm->shouldQuit()) {
-							cursorPos = _vm->getMousePos();
-							_activeMenuItem.lightUp(cursorPos);
-							_vm->_graphics->refreshScreen();
+					// We act only if the button is released over a menu item.
+					while (!_vm->shouldQuit()) {
+						cursorPos = _vm->getMousePos();
+						_activeMenuItem.lightUp(cursorPos);
+						_vm->_graphics->refreshScreen();
 
-							_vm->updateEvents();
-							if (!_vm->_lucerna->_holdLeftMouse)
-								break;
-						}
+						_vm->updateEvents();
+						if (!_vm->_lucerna->_holdLeftMouse)
+							break;
+					}
 
-						uint16 which = (cursorPos.y - 26) / 20;
-						_activeMenuItem.select(which);
-						if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
-							backup.free();
-							return;
-						}
+					uint16 which = (cursorPos.y - 26) / 20;
+					_activeMenuItem.select(which);
+					if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
+						backup.free();
+						return;
+					}
 				}
 			}
-
 		}
 	}
 
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
index 95e258e..b14f4cb 100644
--- a/engines/avalanche/dropdown.h
+++ b/engines/avalanche/dropdown.h
@@ -74,7 +74,7 @@ public:
 	byte _optionNum;
 	uint16 _width, _left;
 	bool _firstlix;
-	int16 _flx1, _flx2, fly;
+	int16 _flx1, _flx2, _fly;
 	byte _oldY; // used by lightUp */
 	bool _activeNow; // Is there an active option now?
 	byte _activeNum; // And if so, which is it?
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 5b5d39e..806ef3f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -71,8 +71,7 @@ void Graphics::init() {
 	_scrolls.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
-void Graphics::fleshColors()
-{
+void Graphics::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
 }
@@ -294,9 +293,8 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
-		for (uint16 x = 0; x < picture.w; x++) {
+		for (uint16 x = 0; x < picture.w; x++)
 			*(byte *)target.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);
-		}
 	}
 }
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 7f2ad4f..4bf0588 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -80,14 +80,12 @@ void Parser::handleBackspace() {
 void Parser::handleReturn() {
 	if (_vm->_dropdown->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
-	else {
-		if (!_inputText.empty()) {
-			_inputTextBackup = _inputText;
-			_vm->_acci->parse();
-			_vm->_acci->doThat();
-			_inputText.clear();
-			wipeText();
-		}
+	else if (!_inputText.empty()) {
+		_inputTextBackup = _inputText;
+		_vm->_acci->parse();
+		_vm->_acci->doThat();
+		_inputText.clear();
+		wipeText();
 	}
 }
 
@@ -108,11 +106,9 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 
 void Parser::plotText() {
 	CursorMan.showMouse(false);
-
 	cursorOff();
 
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
-
 	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 0cde27d..398396d 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -28,7 +28,6 @@
  /* SCROLLS		The scroll driver. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/scrolls.h"
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
@@ -199,9 +198,8 @@ bool Scrolls::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
 	for (int i = 0; i < sizeof(played); i++) {
-		if (played[i] != _vm->_gyro->kTune[i]) {
+		if (played[i] != _vm->_gyro->kTune[i])
 			mistakes += 1;
-		}
 	}
 
 	return mistakes < 5;
@@ -320,7 +318,7 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	}
 	int16 mx = 320;
 	int16 my = 100; // Getmaxx & getmaxy div 2, both.
-	lx = lx / 2;
+	lx /= 2;
 	ly -= 2;
 
 	if ((1 <= _useIcon) && (_useIcon <= 34))
@@ -539,9 +537,10 @@ bool Scrolls::displayQuestion(Common::String question) {
 
 void Scrolls::resetScroll() {
 	_vm->_gyro->_scrollNum = 1;
-	for (int i = 0; i < 15; i++)
+	for (int i = 0; i < 15; i++) {
 		if (!_vm->_gyro->_scroll[i].empty())
 			_vm->_gyro->_scroll[i].clear();
+	}
 }
 
 void Scrolls::setBubbleStateNatural() {
@@ -574,9 +573,8 @@ Common::String Scrolls::displayMoney() {
 }
 
 void Scrolls::stripTrailingSpaces(Common::String &str) {
-	while (str[str.size() - 1] == ' ') {
+	while (str[str.size() - 1] == ' ')
 		str.deleteLastChar();
-	}
 }
 
 void Scrolls::solidify(byte n) {
@@ -594,8 +592,6 @@ void Scrolls::solidify(byte n) {
 
 void Scrolls::callScrollDriver() {
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
-
-
 	//nosound();
 	warning("STUB: Scrolls::calldrivers()");
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 2a8a569..ebace78 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -480,9 +480,8 @@ void Timer::jump() {
 	if (_vm->_gyro->_jumpStatus == 20) { // End of jump.
 		_vm->_gyro->_userMovesAvvy = true;
 		_vm->_gyro->_jumpStatus = 0;
-	} else { // Still jumping.
+	} else // Still jumping.
 		addTimer(1, kProcJump, kReasonJumping);
-	}
 
 	if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
 			&& (_vm->_gyro->_room == kRoomInsideCardiffCastle)


Commit: 8be433b96066bbdee815ef719815a2904ef2621b
    https://github.com/scummvm/scummvm/commit/8be433b96066bbdee815ef719815a2904ef2621b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-17T22:47:52-07:00

Commit Message:
AVALANCHE: Rename DropDown into Menu, add some access functions

Changed paths:
  A engines/avalanche/menu.cpp
  A engines/avalanche/menu.h
  R engines/avalanche/dropdown.cpp
  R engines/avalanche/dropdown.h
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index edcc53c..e3634e0 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1226,7 +1226,7 @@ void Animation::drawSprites() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	if (_vm->_gyro->_dropdownActive | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
+	if (_vm->_menu->isActive() | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
@@ -1377,7 +1377,7 @@ void Animation::handleMoveKey(const Common::Event &event) {
 	if (!_vm->_gyro->_userMovesAvvy)
 		return;
 
-	if (_vm->_dropdown->_activeMenuItem._activeNow)
+	if (_vm->_menu->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
 	else {
 		switch (event.kbd.keycode) {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 33c72c8..980fcab 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -70,7 +70,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _timer;
 	delete _animation;
 	delete _acci;
-	delete _dropdown;
+	delete _menu;
 	delete _closing;
 	delete _gyro;
 }
@@ -89,7 +89,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_timer = new Timer(this);
 	_animation = new Animation(this);
 	_acci = new Acci(this);
-	_dropdown = new Dropdown(this);
+	_menu = new Menu(this);
 	_closing = new Closing(this);
 
 	_graphics->init();
@@ -440,7 +440,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	_celer->forgetBackgroundSprites();
 	_lucerna->minorRedraw();
-	_dropdown->setupMenu();
+	_menu->setup();
 	_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _gyro->_room;
 	_gyro->_alive = true;
 	_lucerna->refreshObjectList();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 8da1591..4a01c72 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -43,7 +43,7 @@
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/acci.h"
-#include "avalanche/dropdown.h"
+#include "avalanche/menu.h"
 #include "avalanche/closing.h"
 
 #include "common/serializer.h"
@@ -78,7 +78,7 @@ public:
 	Timer *_timer;
 	Animation *_animation;
 	Acci *_acci;
-	Dropdown *_dropdown;
+	Menu *_menu;
 	Closing *_closing;
 
 	OSystem *_system;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2d93ed8..687572c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -28,7 +28,6 @@
 /* AVALOT		The kernel of the program. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/graphics.h"
 #include "avalanche/avalot.h"
 #include "avalanche/gyro.h"
@@ -36,7 +35,7 @@
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/scrolls.h"
-#include "avalanche/dropdown.h"
+#include "avalanche/menu.h"
 #include "avalanche/pingo.h"
 #include "avalanche/timer.h"
 #include "avalanche/celer.h"
@@ -136,7 +135,6 @@ void Avalot::setup() {
 	_vm->_gyro->setMousePointerWait();
 	_vm->_gyro->_dropsOk = true;
 	_vm->_gyro->_mouseText = "";
-	_vm->_gyro->_dropdownActive = false;
 	_vm->_lucerna->loadDigits();
 	_vm->_gyro->_cheat = false;
 	_vm->_gyro->_cp = 0;
@@ -161,7 +159,7 @@ void Avalot::setup() {
 	_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
 	_vm->_animation->updateSpeed();
 
-
+	_vm->_menu->init();
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
@@ -190,7 +188,7 @@ void Avalot::run(Common::String arg) {
 		_vm->updateEvents(); // The event handler.
 
 		_vm->_lucerna->_clock.update();
-		_vm->_dropdown->updateMenu();
+		_vm->_menu->update();
 		_vm->_celer->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 6edb4d2..61a45c7 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -54,7 +54,7 @@ Celer::~Celer() {
  * @remarks	Originally called 'pics_link'
  */
 void Celer::updateBackgroundSprites() {
-	if (_vm->_gyro->_dropdownActive)
+	if (_vm->_menu->isActive())
 		return; // No animation when the menus are up.
 
 	switch (_vm->_gyro->_room) {
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
deleted file mode 100644
index 8ae3af0..0000000
--- a/engines/avalanche/dropdown.cpp
+++ /dev/null
@@ -1,789 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
- /* DROPDOWN	A customised version of Oopmenu (qv). */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/dropdown.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
-#include "avalanche/acci.h"
-#include "avalanche/animation.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-void HeadType::init(char trig, char altTrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr) {
-	_trigger = trig;
-	_altTrigger = altTrig;
-	_title = title;
-	_position = pos;
-	_xpos = _position * _dr->kSpacing + _dr->kIndent;
-	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
-	_setupFunc = setupFunc;
-	_chooseFunc = chooseFunc;
-
-	_dr = dr;
-}
-
-void HeadType::draw() {
-	CursorMan.showMouse(false);
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
-	CursorMan.showMouse(true);
-}
-
-void HeadType::highlight() {
-	CursorMan.showMouse(false);
-
-	//nosound();
-	//setactivepage(cp);
-	warning("STUB: Dropdown::headytpe::highlight()");
-
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
-
-	_dr->_activeMenuItem._left = _xpos;
-	_dr->_activeMenuItem._activeNow = true;
-	_dr->_vm->_gyro->_dropdownActive = true;
-	_dr->_activeMenuItem._activeNum = _position;
-
-	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
-}
-
-bool HeadType::parseAltTrigger(char key) {
-	if (key != _altTrigger)
-		return true;
-	return false;
-}
-
-void MenuItem::init(Dropdown *dr) {
-	_dr = dr;
-	_activeNow = false;
-	_dr->_vm->_gyro->_dropdownActive = false;
-	_activeNum = 1;
-}
-
-void MenuItem::reset() {
-	_optionNum = 0;
-	_width = 0;
-	_firstlix = false;
-	_oldY = 0;
-	_highlightNum = 0;
-}
-
-void MenuItem::setupOption(Common::String title, char trigger, Common::String shortcut, bool valid) {
-	uint16 width = (title + shortcut).size() + 3;
-	if (_width < width)
-		_width = width;
-
-	_options[_optionNum]._title = title;
-	_options[_optionNum]._trigger = trigger;
-	_options[_optionNum]._shortcut = shortcut;
-	_options[_optionNum]._valid = valid;
-	_optionNum++;
-}
-
-void MenuItem::displayOption(byte y, bool highlit) {
-	byte backgroundColor;
-	if (highlit)
-		backgroundColor = 0;
-	else
-		backgroundColor = 7;
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
-
-	Common::String text = _options[y]._title;
-	while (text.size() + _options[y]._shortcut.size() < _width)
-		text += ' '; // Pad _options[y] with spaces.
-	text += _options[y]._shortcut;
-
-	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
-}
-
-void MenuItem::display() {
-	CursorMan.showMouse(false);
-	//setactivepage(cp);
-	//setvisualpage(cp);
-	//setfillstyle(1, menu_b);
-	//setcolor(menu_border);
-	_firstlix = true;
-	_flx1 = _left - 2;
-	_flx2 = _left + _width;
-	_fly = 15 + _optionNum * 10;
-	_activeNow = true;
-	_dr->_vm->_gyro->_dropdownActive = true;
-
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), _dr->kMenuBackgroundColor);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), _dr->kMenuBorderColor);
-
-	displayOption(0, true);
-	for (int y = 1; y < _optionNum; y++)
-		displayOption(y, false);
-
-	_dr->_vm->_gyro->_defaultLed = 1;
-	_dr->_vm->_gyro->_currentMouse = 177;
-	//mousepage(cp);
-	CursorMan.showMouse(true); // 4 = fletch
-}
-
-void MenuItem::wipe() {
-	//setactivepage(cp);
-	CursorMan.showMouse(false);
-
-	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
-
-	_activeNow = false;
-	_dr->_vm->_gyro->_dropdownActive = false;
-	_firstlix = false;
-	_dr->_vm->_gyro->_defaultLed = 2;
-
-	CursorMan.showMouse(true);
-}
-
-void MenuItem::moveHighlight(int8 inc) {
-	if (inc != 0) {
-		int8 highlightNum = _highlightNum + inc;
-		if ((highlightNum < 0) || (highlightNum >= _optionNum))
-			return;
-		_highlightNum = highlightNum;
-	}
-	//setactivepage(cp);
-	CursorMan.showMouse(false);
-	displayOption(_oldY, false);
-	displayOption(_highlightNum, true);
-	//setactivepage(1 - cp);
-	_oldY = _highlightNum;
-	CursorMan.showMouse(true);
-}
-
-void MenuItem::lightUp(Common::Point cursorPos) {
-	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((_fly - 3) * 2 + 1)))
-		return;
-	_highlightNum = (cursorPos.y - 26) / 20;
-	if (_highlightNum == _oldY)
-		return;
-	moveHighlight(0);
-}
-
-void MenuItem::select(byte which) {
-	if (!_options[which]._valid)
-		return;
-
-	_choiceNum = which;
-	wipe();
-
-	if (_choiceNum == _optionNum)
-		_choiceNum--; // Off the bottom.
-	if (_choiceNum > _optionNum)
-		_choiceNum = 0; // Off the top, I suppose.
-
-	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
-}
-
-void MenuItem::parseKey(char c) {
-	c = toupper(c);
-	bool found = false;
-	for (int i = 0; i < _optionNum; i++) {
-		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
-			select(i);
-			found = true;
-		}
-	}
-	if (!found)
-		_dr->_vm->_gyro->blip();
-}
-
-void MenuBar::init(Dropdown *dr) {
-	_dr = dr;
-	_menuNum = 0;
-}
-
-void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc) {
-	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
-	_menuNum++;
-}
-
-void MenuBar::draw() {
-	//setactivepage(3);
-
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
-
-	byte savecp = _dr->_vm->_gyro->_cp;
-	_dr->_vm->_gyro->_cp = 3;
-
-	for (int i = 0; i < _menuNum; i++)
-		_menuItems[i].draw();
-
-	_dr->_vm->_gyro->_cp = savecp;
-}
-
-void MenuBar::parseAltTrigger(char c) {
-	byte i = 0;
-	while ((i < _menuNum) && (_menuItems[i].parseAltTrigger(c)))
-		i++;
-	if (i == _menuNum)
-		return;
-	setupMenuItem(i);
-}
-
-void MenuBar::setupMenuItem(byte which) {
-	if (_dr->_activeMenuItem._activeNow) {
-		_dr->_activeMenuItem.wipe(); // Get rid of menu.
-		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
-			return; // Clicked on own highlight.
-	}
-	_menuItems[which].highlight();
-	(_dr->*_menuItems[which]._setupFunc)();
-}
-
-void MenuBar::chooseMenuItem(int16 x) {
-	for (int i = 0; i < _menuNum; i++) {
-		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
-			setupMenuItem(i);
-			break;
-		}
-	}
-}
-
-Dropdown::Dropdown(AvalancheEngine *vm) {
-	_vm = vm;
-	_activeMenuItem.init(this);
-	_menuBar.init(this);
-}
-
-void Dropdown::findWhatYouCanDoWithIt() {
-	switch (_vm->_gyro->_thinks) {
-	case Gyro::kObjectWine:
-	case Gyro::kObjectPotion:
-	case Gyro::kObjectInk:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
-		break;
-	case Gyro::kObjectBell:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
-		break;
-	case Gyro::kObjectChastity:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
-		break;
-	case Gyro::kObjectLute:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
-		break;
-	case Gyro::kObjectMushroom:
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
-		break;
-	case Gyro::kObjectClothes:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
-		break;
-	default:
-		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
-	}
-}
-
-void Dropdown::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
-	byte fontColor;
-	byte backgroundColor;
-	if (highlighted) {
-		fontColor = kColorWhite;
-		backgroundColor = kColorBlack;
-	} else {
-		fontColor = kColorBlack;
-		backgroundColor = kColorLightgray;
-	}
-
-	byte ander;
-	if (valid)
-		ander = 255;
-	else
-		ander = 170;
-
-	FontType font;
-	for (uint i = 0; i < text.size(); i++) {
-		for (int j = 0; j < 8; j++) {
-			byte idx = text[i];
-			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
-			// And set the background of the text to the desired color.
-			for (int k = 0; k < 8; k++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
-		}
-	}
-
-	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
-
-	// Underline the selected character.
-	if ((trigger == 0) || !text.contains(trigger) )
-		return;
-	else {
-		byte i;
-		for (i = 0; text[i] != trigger; i++)
-			; // Search for the character in the string.
-
-		byte pixel = ander;
-		for (int bit = 0; bit < 8; bit++) {
-			byte pixelBit = (pixel >> bit) & 1;
-			if (pixelBit)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
-		}
-	}
-
-	_vm->_graphics->refreshScreen();
-}
-
-void Dropdown::bleep() {
-	warning("STUB: Dropdown::bleep()");
-}
-
-void Dropdown::parseKey(char r, char re) {
-	//switch (r) {
-	//case 0:
-	//case 224: {
-	//	switch (re) {
-	//	case 'K':
-	//		if (_activeMenuItem._activeNum > 1)  {
-	//			_activeMenuItem.wipe();
-	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum - 1);
-	//		} else {
-	//			// Get menu on the left-hand side.
-	//			_activeMenuItem.wipe();
-	//			_menuBar.chooseMenuItem((_menuBar._menuNum - 1) * kSpacing + kIndent);
-	//		}
-	//		break;
-	//	case 'M':
-	//		if (_activeMenuItem._activeNum < _menuBar._menuNum)  {
-	//			_activeMenuItem.wipe();
-	//			_menuBar.setupMenuItem(_activeMenuItem._activeNum + 1);
-	//		} else {
-	//			// Get menu on the far right-hand side.
-	//			_activeMenuItem.wipe();
-	//			_menuBar.chooseMenuItem(kIndent);
-	//		}
-	//		break;
-	//	case 'H':
-	//		_activeMenuItem.moveHighlight(-1);
-	//		break;
-	//	case 'P':
-	//		_activeMenuItem.moveHighlight(1);
-	//		break;
-	//	default:
-	//		_menuBar.parseAltTrigger(re);
-	//	}
-	//}
-	//break;
-	//case 13:
-	//	_activeMenuItem.select(_activeMenuItem._highlightNum);
-	//	break;
-	//default:
-	//	if (_activeMenuItem._activeNow)
-	//		_activeMenuItem.parseKey(r);
-	//}
-	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
-}
-
-Common::String Dropdown::selectGender(byte x) {
-	if (x < 175)
-		return "im";
-	else
-		return "er";
-}
-
-void Dropdown::setupMenuGame() {
-	_activeMenuItem.reset();
-	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
-	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
-	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
-	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
-	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuFile() {
-	_activeMenuItem.reset();
-	_activeMenuItem.setupOption("New game", 'N', "f4", true);
-	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
-	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
-	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuAction() {
-	_activeMenuItem.reset();
-
-	Common::String f5Does = _vm->_gyro->f5Does();
-	for (int i = 0; i < 2; i++)
-		if (!f5Does.empty())
-			f5Does.deleteChar(0);
-	if (f5Does.empty())
-		_activeMenuItem.setupOption("Do something", 'D', "f5", false);
-	else
-		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
-	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->_room == kRoomMap)
-		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
-	else
-		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
-	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
-	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
-		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
-	else
-		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
-
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuPeople() {
-	if (!people.empty())
-		people.clear();
-
-	_activeMenuItem.reset();
-
-	for (int i = 150; i <= 178; i++) {
-		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
-			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
-			people += i;
-		}
-	}
-
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuObjects() {
-	_activeMenuItem.reset();
-	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i])
-			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
-	}
-	_activeMenuItem.display();
-}
-
-void Dropdown::setupMenuWith() {
-	_activeMenuItem.reset();
-
-	if (_vm->_gyro->_thinkThing) {
-		findWhatYouCanDoWithIt();
-
-		for (uint i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
-			char vbchar;
-			Common::String verb;
-
-			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
-			_activeMenuItem.setupOption(verb, vbchar, "", true);
-		}
-
-		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
-		// or (c), the _person you've selected is YOU!
-
-		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
-			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
-			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
-		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
-		}
-	} else {
-		_activeMenuItem.setupOption("Examine", 'x', "", true);
-		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
-		switch (_vm->_gyro->_thinks) {
-		case Gyro::kPeopleGeida:
-		case Gyro::kPeopleArkata:
-			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
-			break;
-		case Gyro::kPeopleDogfood:
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
-			break;
-		case Gyro::kPeopleMalagauche: {
-			bool isSober = !_vm->_gyro->_teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
-			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
-			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
-			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
-			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
-			}
-			break;
-		case Gyro::kPeopleTrader:
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
-			break;
-		}
-	}
-	_activeMenuItem.display();
-}
-
-void Dropdown::runMenuGame() {
-	// Help, boss, untrash screen.
-	switch (_activeMenuItem._choiceNum) {
-	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
-		break;
-	case 1:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
-		break;
-	case 2:
-		_vm->_lucerna->majorRedraw();
-		break;
-	case 3:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
-		break;
-	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
-		break;
-	}
-}
-
-void Dropdown::runMenuFile() {
-	// New game, load, save, save as, DOS shell, about, quit.
-	switch (_activeMenuItem._choiceNum) {
-	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
-		break;
-	case 1:
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
-		break;
-	case 2:
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
-		break;
-	case 3:
-		//_vm->_basher->filename_edit();
-		warning("STUB: Dropdown::runMenuFile()");
-		break;
-	case 4:
-		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
-		break;
-	case 5:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
-		break;
-	}
-}
-
-void Dropdown::runMenuAction() {
-	Common::String f5Does;
-	// Get up, pause game, open door, look, inventory, walk/run.
-	switch (_activeMenuItem._choiceNum) {
-	case 0:
-		_vm->_acci->_person = _vm->_acci->kPardon;
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		f5Does = _vm->_gyro->f5Does();
-		_vm->_lucerna->callVerb(f5Does[0]);
-		break;
-	case 1:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
-		break;
-	case 2:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
-		break;
-	case 3:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
-		break;
-	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
-		break;
-	case 5: {
-		AnimationType *avvy = &_vm->_animation->_sprites[0];
-		if (avvy->_speedX == _vm->_gyro->kWalk)
-			avvy->_speedX = _vm->_gyro->kRun;
-		else
-			avvy->_speedX = _vm->_gyro->kWalk;
-		_vm->_animation->updateSpeed();
-		}
-		break;
-	}
-}
-
-void Dropdown::runMenuObjects() {
-	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum], Gyro::kThing);
-}
-
-void Dropdown::runMenuPeople() {
-	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
-	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
-}
-
-void Dropdown::runMenuWith() {
-	_vm->_acci->_thing = _vm->_gyro->_thinks;
-
-	if (_vm->_gyro->_thinkThing) {
-		_vm->_acci->_thing += 49;
-
-		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
-			_vm->_acci->_person = _vm->_gyro->_lastPerson;
-		else
-			_vm->_acci->_person = Acci::kPardon;
-	} else {
-		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
-		case 100: // Beer
-			_vm->_acci->_thing = 100;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		case 101: // Wine
-			_vm->_acci->_thing = 50;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		case 102: // Whisky
-			_vm->_acci->_thing = 102;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		case 103: // Cider
-			_vm->_acci->_thing = 103;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		case 104: // Mead
-			_vm->_acci->_thing = 107;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		case 105: // Onion (trader)
-			_vm->_acci->_thing = 67;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
-			return;
-		default:
-			_vm->_acci->_person = _vm->_acci->_thing;
-			_vm->_acci->_thing = Acci::kPardon;
-			_vm->_gyro->_subjectNum = 0;
-		}
-	}
-	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
-}
-
-void Dropdown::setupMenu() {
-	_menuBar.init(this);
-	_activeMenuItem.init(this);
-
-	_menuBar.createMenuItem('F', "File", '!', &Avalanche::Dropdown::setupMenuFile, &Avalanche::Dropdown::runMenuFile);
-	_menuBar.createMenuItem('G', "Game", 34, &Avalanche::Dropdown::setupMenuGame, &Avalanche::Dropdown::runMenuGame);
-	_menuBar.createMenuItem('A', "Action", 30, &Avalanche::Dropdown::setupMenuAction, &Avalanche::Dropdown::runMenuAction);
-	_menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Dropdown::setupMenuObjects, &Avalanche::Dropdown::runMenuObjects);
-	_menuBar.createMenuItem('P', "People", 25, &Avalanche::Dropdown::setupMenuPeople, &Avalanche::Dropdown::runMenuPeople);
-	_menuBar.createMenuItem('W', "With", 17, &Avalanche::Dropdown::setupMenuWith, &Avalanche::Dropdown::runMenuWith);
-
-	_menuBar.draw();
-}
-
-void Dropdown::updateMenu() { // TODO: Optimize it ASAP!!! It really needs it...
-	Common::Point cursorPos = _vm->getMousePos();
-	::Graphics::Surface backup;
-	backup.copyFrom(_vm->_graphics->_surface);
-
-	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
-		_menuBar.chooseMenuItem(cursorPos.x);
-		do
-			_vm->updateEvents();
-		while (_vm->_lucerna->_holdLeftMouse);
-
-
-		while (!_vm->shouldQuit()) {
-			do {
-				_vm->updateEvents();
-
-				// We updadte the cursor's picture.
-				cursorPos = _vm->getMousePos();
-				// Change arrow...
-				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_gyro->newMouse(1); // Up arrow
-				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
-					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->_gyro->newMouse(3); // Right-arrow
-					else
-						_vm->_gyro->newMouse(4); // Fletch
-				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_gyro->newMouse(2); // Screwdriver
-
-				_activeMenuItem.lightUp(cursorPos);
-
-				_vm->_graphics->refreshScreen();
-			} while (!_vm->_lucerna->_holdLeftMouse);
-
-			if (_vm->_lucerna->_holdLeftMouse) {
-				if (cursorPos.y > 21) {
-					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1))))) {
-							// Clicked OUTSIDE the menu.
-							if (_activeMenuItem._activeNow) {
-								_activeMenuItem.wipe();
-								_vm->_lucerna->_holdLeftMouse = false;
-								backup.free();
-								return;
-							} // No "else"- clicking on menu has no effect (only releasing).
-						}
-				} else {
-					// Clicked on menu bar.
-					if (_activeMenuItem._activeNow) {
-						_activeMenuItem.wipe();
-						_vm->_graphics->_surface.copyFrom(backup);
-						_vm->_graphics->refreshScreen();
-
-						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
-							// If we clicked on the same menu item (the one that is already active) on the bar...
-							_vm->_lucerna->_holdLeftMouse = false;
-							backup.free();
-							return;
-						} else {
-							_vm->_lucerna->_holdLeftMouse = true;
-							break;
-						}
-					}
-				}
-
-				// NOT clicked button...
-				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
-					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1)))) {
-
-					// We act only if the button is released over a menu item.
-					while (!_vm->shouldQuit()) {
-						cursorPos = _vm->getMousePos();
-						_activeMenuItem.lightUp(cursorPos);
-						_vm->_graphics->refreshScreen();
-
-						_vm->updateEvents();
-						if (!_vm->_lucerna->_holdLeftMouse)
-							break;
-					}
-
-					uint16 which = (cursorPos.y - 26) / 20;
-					_activeMenuItem.select(which);
-					if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
-						backup.free();
-						return;
-					}
-				}
-			}
-		}
-	}
-
-	backup.free();
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/dropdown.h b/engines/avalanche/dropdown.h
deleted file mode 100644
index b14f4cb..0000000
--- a/engines/avalanche/dropdown.h
+++ /dev/null
@@ -1,167 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* DROPDOWN	A customised version of Oopmenu (qv). */
-
-#ifndef AVALANCHE_DROPDOWN2_H
-#define AVALANCHE_DROPDOWN2_H
-
-#include "avalanche/color.h"
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Dropdown;
-
-typedef void (Dropdown::*DropdownFunc)();
-
-class HeadType {
-public:
-	Common::String _title;
-	char _trigger, _altTrigger;
-	byte _position;
-	int16 _xpos, _xright;
-	DropdownFunc _setupFunc, _chooseFunc;
-
-	void init(char trig, char alTtrig, Common::String title, byte pos, DropdownFunc setupFunc, DropdownFunc chooseFunc, Dropdown *dr);
-	void draw();
-	void highlight();
-	bool parseAltTrigger(char key);
-
-private:
-	Dropdown *_dr;
-};
-
-struct OptionType {
-	Common::String _title;
-	byte _trigger;
-	Common::String _shortcut;
-	bool _valid;
-};
-
-class MenuItem {
-public:
-	OptionType _options[12];
-	byte _optionNum;
-	uint16 _width, _left;
-	bool _firstlix;
-	int16 _flx1, _flx2, _fly;
-	byte _oldY; // used by lightUp */
-	bool _activeNow; // Is there an active option now?
-	byte _activeNum; // And if so, which is it?
-	byte _choiceNum; // Your choice?
-	byte _highlightNum;
-
-	void init(Dropdown *dr);
-	void reset();
-	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
-	void display();
-	void wipe();
-	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
-	void displayOption(byte y, bool highlit);
-	void moveHighlight(int8 inc);
-	void select(byte which); // Choose which one you want.
-	void parseKey(char c);
-
-private:
-	Dropdown *_dr;
-};
-
-class MenuBar {
-public:
-	HeadType _menuItems[8];
-	byte _menuNum;
-
-	void init(Dropdown *dr);
-	void createMenuItem(char trig, Common::String title, char altTrig, DropdownFunc setupFunc, DropdownFunc chooseFunc);
-	void draw();
-	void parseAltTrigger(char c);
-	void setupMenuItem(byte which);
-	void chooseMenuItem(int16 x);
-
-private:
-	Dropdown *_dr;
-};
-
-class Dropdown {
-public:
-	friend class HeadType;
-	friend class MenuItem;
-	friend class MenuBar;
-
-	MenuItem _activeMenuItem;
-	MenuBar _menuBar;
-
-	Common::String people;
-
-	Dropdown(AvalancheEngine *vm);
-
-	void parseKey(char r, char re);
-	void updateMenu();
-	void setupMenu(); // Standard menu bar.
-
-private:
-	static const byte kIndent = 5;
-	static const byte kSpacing = 10;
-
-	static const byte kMenuBackgroundColor = kColorLightgray;
-	static const byte kMenuFontColor = kColorBlack;
-	static const byte kMenuBorderColor = kColorBlack;
-	static const byte kHighlightBackgroundColor = kColorBlack;
-	static const byte kHighlightFontColor = kColorWhite;
-	static const byte kDisabledColor = kColorDarkgray;
-
-	AvalancheEngine *_vm;
-
-	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
-	void findWhatYouCanDoWithIt();
-	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
-	void bleep();
-
-	void setupMenuGame();
-	void setupMenuFile();
-	void setupMenuAction();
-	void setupMenuPeople();
-	void setupMenuObjects();
-	void setupMenuWith();
-
-	void runMenuGame();
-	void runMenuFile();
-	void runMenuAction();
-	void runMenuObjects();
-	void runMenuPeople();
-	void runMenuWith();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_DROPDOWN2_H
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 2cb9d0e..ec69594 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -356,7 +356,7 @@ void Gyro::newGame() {
 	_vm->_lucerna->enterRoom(1, 1);
 	avvy->_visible = false;
 	_vm->_lucerna->drawScore();
-	_vm->_dropdown->setupMenu();
+	_vm->_menu->setup();
 	_vm->_lucerna->_clock.update();
 	_vm->_lucerna->spriteRun();
 }
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 977a2e7..b01f3e1 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -348,7 +348,6 @@ public:
 	byte _buffer[2000];
 	uint16 _bufSize;
 	int16 _underScroll; // Y-coord of just under the scroll text.
-	bool _dropdownActive; // Kludge so we don't have to keep referring to Dropdown
 	Common::String _roomnName; // Name of actual room
 	Common::String _subject; // What you're talking to them about.
 	byte _subjectNum; // The same thing.
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 2b75d5a..336c686 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -380,7 +380,7 @@ void Lucerna::exitRoom(byte x) {
  * @remarks	Originally called 'new_town'
  */
 void Lucerna::enterNewTown() {
-	_vm->_dropdown->setupMenu();
+	_vm->_menu->setup();
 
 	switch (_vm->_gyro->_room) {
 	case kRoomOutsideNottsPub: // Entry into Nottingham.
@@ -1080,7 +1080,7 @@ void Lucerna::checkClick() {
 		_vm->_gyro->newMouse(8); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
 		_vm->_gyro->newMouse(2); // screwdriver
-	else if (!_vm->_gyro->_dropdownActive) { // Dropdown can handle its own pointers.
+	else if (!_vm->_menu->isActive()) { // Dropdown can handle its own pointers.
 		if (_holdLeftMouse) {
 			_vm->_gyro->newMouse(7); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
@@ -1091,7 +1091,7 @@ void Lucerna::checkClick() {
 	if (_holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_vm->_gyro->_dropsOk)
-				_vm->_dropdown->updateMenu();
+				_vm->_menu->update();
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
 			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
 			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
new file mode 100644
index 0000000..69267da
--- /dev/null
+++ b/engines/avalanche/menu.cpp
@@ -0,0 +1,799 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+ /* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/menu.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/gyro.h"
+#include "avalanche/acci.h"
+#include "avalanche/animation.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+void HeadType::init(char trig, char altTrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *dr) {
+	_trigger = trig;
+	_altTrigger = altTrig;
+	_title = title;
+	_position = pos;
+	_xpos = _position * _dr->kSpacing + _dr->kIndent;
+	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
+	_setupFunc = setupFunc;
+	_chooseFunc = chooseFunc;
+
+	_dr = dr;
+}
+
+void HeadType::draw() {
+	CursorMan.showMouse(false);
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
+	CursorMan.showMouse(true);
+}
+
+void HeadType::highlight() {
+	CursorMan.showMouse(false);
+
+	//nosound();
+	//setactivepage(cp);
+	warning("STUB: Dropdown::headytpe::highlight()");
+
+	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
+
+	_dr->_activeMenuItem._left = _xpos;
+	_dr->_activeMenuItem._activeNow = true;
+	_dr->_activeMenuItem._activeNum = _position;
+	_dr->_menuActive = true;
+
+	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
+}
+
+bool HeadType::parseAltTrigger(char key) {
+	if (key != _altTrigger)
+		return true;
+	return false;
+}
+
+void MenuItem::init(Menu *dr) {
+	_dr = dr;
+
+	_activeNow = false;
+	_activeNum = 1;
+	_dr->_menuActive = false;
+}
+
+void MenuItem::reset() {
+	_optionNum = 0;
+	_width = 0;
+	_firstlix = false;
+	_oldY = 0;
+	_highlightNum = 0;
+}
+
+void MenuItem::setupOption(Common::String title, char trigger, Common::String shortcut, bool valid) {
+	uint16 width = (title + shortcut).size() + 3;
+	if (_width < width)
+		_width = width;
+
+	_options[_optionNum]._title = title;
+	_options[_optionNum]._trigger = trigger;
+	_options[_optionNum]._shortcut = shortcut;
+	_options[_optionNum]._valid = valid;
+	_optionNum++;
+}
+
+void MenuItem::displayOption(byte y, bool highlit) {
+	byte backgroundColor;
+	if (highlit)
+		backgroundColor = 0;
+	else
+		backgroundColor = 7;
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
+
+	Common::String text = _options[y]._title;
+	while (text.size() + _options[y]._shortcut.size() < _width)
+		text += ' '; // Pad _options[y] with spaces.
+	text += _options[y]._shortcut;
+
+	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
+}
+
+void MenuItem::display() {
+	CursorMan.showMouse(false);
+	//setactivepage(cp);
+	//setvisualpage(cp);
+	//setfillstyle(1, menu_b);
+	//setcolor(menu_border);
+	_firstlix = true;
+	_flx1 = _left - 2;
+	_flx2 = _left + _width;
+	_fly = 15 + _optionNum * 10;
+	_activeNow = true;
+	_dr->_menuActive = true;
+
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), _dr->kMenuBorderColor);
+
+	displayOption(0, true);
+	for (int y = 1; y < _optionNum; y++)
+		displayOption(y, false);
+
+	_dr->_vm->_gyro->_defaultLed = 1;
+	_dr->_vm->_gyro->_currentMouse = 177;
+	//mousepage(cp);
+	CursorMan.showMouse(true); // 4 = fletch
+}
+
+void MenuItem::wipe() {
+	//setactivepage(cp);
+	CursorMan.showMouse(false);
+
+	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
+
+	_activeNow = false;
+	_dr->_menuActive = false;
+	_firstlix = false;
+	_dr->_vm->_gyro->_defaultLed = 2;
+
+	CursorMan.showMouse(true);
+}
+
+void MenuItem::moveHighlight(int8 inc) {
+	if (inc != 0) {
+		int8 highlightNum = _highlightNum + inc;
+		if ((highlightNum < 0) || (highlightNum >= _optionNum))
+			return;
+		_highlightNum = highlightNum;
+	}
+	//setactivepage(cp);
+	CursorMan.showMouse(false);
+	displayOption(_oldY, false);
+	displayOption(_highlightNum, true);
+	//setactivepage(1 - cp);
+	_oldY = _highlightNum;
+	CursorMan.showMouse(true);
+}
+
+void MenuItem::lightUp(Common::Point cursorPos) {
+	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((_fly - 3) * 2 + 1)))
+		return;
+	_highlightNum = (cursorPos.y - 26) / 20;
+	if (_highlightNum == _oldY)
+		return;
+	moveHighlight(0);
+}
+
+void MenuItem::select(byte which) {
+	if (!_options[which]._valid)
+		return;
+
+	_choiceNum = which;
+	wipe();
+
+	if (_choiceNum == _optionNum)
+		_choiceNum--; // Off the bottom.
+	if (_choiceNum > _optionNum)
+		_choiceNum = 0; // Off the top, I suppose.
+
+	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
+}
+
+void MenuItem::parseKey(char c) {
+	c = toupper(c);
+	bool found = false;
+	for (int i = 0; i < _optionNum; i++) {
+		if ((toupper(_options[i]._trigger) == c) && _options[i]._valid) {
+			select(i);
+			found = true;
+		}
+	}
+	if (!found)
+		_dr->_vm->_gyro->blip();
+}
+
+void MenuBar::init(Menu *dr) {
+	_dr = dr;
+	_menuNum = 0;
+}
+
+void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc) {
+	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
+	_menuNum++;
+}
+
+void MenuBar::draw() {
+	//setactivepage(3);
+
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
+
+	byte savecp = _dr->_vm->_gyro->_cp;
+	_dr->_vm->_gyro->_cp = 3;
+
+	for (int i = 0; i < _menuNum; i++)
+		_menuItems[i].draw();
+
+	_dr->_vm->_gyro->_cp = savecp;
+}
+
+void MenuBar::parseAltTrigger(char c) {
+	byte i = 0;
+	while ((i < _menuNum) && (_menuItems[i].parseAltTrigger(c)))
+		i++;
+	if (i == _menuNum)
+		return;
+	setupMenuItem(i);
+}
+
+void MenuBar::setupMenuItem(byte which) {
+	if (_dr->_activeMenuItem._activeNow) {
+		_dr->_activeMenuItem.wipe(); // Get rid of menu.
+		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
+			return; // Clicked on own highlight.
+	}
+	_menuItems[which].highlight();
+	(_dr->*_menuItems[which]._setupFunc)();
+}
+
+void MenuBar::chooseMenuItem(int16 x) {
+	for (int i = 0; i < _menuNum; i++) {
+		if ((x > _menuItems[i]._xpos * 8) && (x < _menuItems[i]._xright * 8)) {
+			setupMenuItem(i);
+			break;
+		}
+	}
+}
+
+Menu::Menu(AvalancheEngine *vm) {
+	_vm = vm;
+	_activeMenuItem.init(this);
+	_menuBar.init(this);
+}
+
+void Menu::findWhatYouCanDoWithIt() {
+	switch (_vm->_gyro->_thinks) {
+	case Gyro::kObjectWine:
+	case Gyro::kObjectPotion:
+	case Gyro::kObjectInk:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
+		break;
+	case Gyro::kObjectBell:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
+		break;
+	case Gyro::kObjectChastity:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		break;
+	case Gyro::kObjectLute:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
+		break;
+	case Gyro::kObjectMushroom:
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
+		break;
+	case Gyro::kObjectClothes:
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		break;
+	default:
+		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
+	}
+}
+
+void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
+	byte fontColor;
+	byte backgroundColor;
+	if (highlighted) {
+		fontColor = kColorWhite;
+		backgroundColor = kColorBlack;
+	} else {
+		fontColor = kColorBlack;
+		backgroundColor = kColorLightgray;
+	}
+
+	byte ander;
+	if (valid)
+		ander = 255;
+	else
+		ander = 170;
+
+	FontType font;
+	for (uint i = 0; i < text.size(); i++) {
+		for (int j = 0; j < 8; j++) {
+			byte idx = text[i];
+			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
+			// And set the background of the text to the desired color.
+			for (int k = 0; k < 8; k++)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
+		}
+	}
+
+	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
+
+	// Underline the selected character.
+	if ((trigger == 0) || !text.contains(trigger) )
+		return;
+	else {
+		byte i;
+		for (i = 0; text[i] != trigger; i++)
+			; // Search for the character in the string.
+
+		byte pixel = ander;
+		for (int bit = 0; bit < 8; bit++) {
+			byte pixelBit = (pixel >> bit) & 1;
+			if (pixelBit)
+				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
+		}
+	}
+
+	_vm->_graphics->refreshScreen();
+}
+
+void Menu::bleep() {
+	warning("STUB: Dropdown::bleep()");
+}
+
+void Menu::parseKey(char r, char re) {
+#if 0
+	switch (r) {
+	case 0:
+	case 224: {
+		switch (re) {
+		case 'K':
+			if (_activeMenuItem._activeNum > 1)  {
+				_activeMenuItem.wipe();
+				_menuBar.setupMenuItem(_activeMenuItem._activeNum - 1);
+			} else {
+				// Get menu on the left-hand side.
+				_activeMenuItem.wipe();
+				_menuBar.chooseMenuItem((_menuBar._menuNum - 1) * kSpacing + kIndent);
+			}
+			break;
+		case 'M':
+			if (_activeMenuItem._activeNum < _menuBar._menuNum)  {
+				_activeMenuItem.wipe();
+				_menuBar.setupMenuItem(_activeMenuItem._activeNum + 1);
+			} else {
+				// Get menu on the far right-hand side.
+				_activeMenuItem.wipe();
+				_menuBar.chooseMenuItem(kIndent);
+			}
+			break;
+		case 'H':
+			_activeMenuItem.moveHighlight(-1);
+			break;
+		case 'P':
+			_activeMenuItem.moveHighlight(1);
+			break;
+		default:
+			_menuBar.parseAltTrigger(re);
+		}
+	}
+	break;
+	case 13:
+		_activeMenuItem.select(_activeMenuItem._highlightNum);
+		break;
+	default:
+		if (_activeMenuItem._activeNow)
+			_activeMenuItem.parseKey(r);
+	}
+#endif
+
+	warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above!
+}
+
+Common::String Menu::selectGender(byte x) {
+	if (x < 175)
+		return "im";
+	else
+		return "er";
+}
+
+void Menu::setupMenuGame() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
+	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
+	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
+	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
+	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
+	_activeMenuItem.display();
+}
+
+void Menu::setupMenuFile() {
+	_activeMenuItem.reset();
+	_activeMenuItem.setupOption("New game", 'N', "f4", true);
+	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
+	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
+	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
+	_activeMenuItem.display();
+}
+
+void Menu::setupMenuAction() {
+	_activeMenuItem.reset();
+
+	Common::String f5Does = _vm->_gyro->f5Does();
+	for (int i = 0; i < 2; i++)
+		if (!f5Does.empty())
+			f5Does.deleteChar(0);
+	if (f5Does.empty())
+		_activeMenuItem.setupOption("Do something", 'D', "f5", false);
+	else
+		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
+	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
+	if (_vm->_gyro->_room == kRoomMap)
+		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
+	else
+		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
+	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
+	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
+	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
+		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
+	else
+		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
+
+	_activeMenuItem.display();
+}
+
+void Menu::setupMenuPeople() {
+	if (!people.empty())
+		people.clear();
+
+	_activeMenuItem.reset();
+
+	for (int i = 150; i <= 178; i++) {
+		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
+			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
+			people += i;
+		}
+	}
+
+	_activeMenuItem.display();
+}
+
+void Menu::setupMenuObjects() {
+	_activeMenuItem.reset();
+	for (int i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_objects[i])
+			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
+	}
+	_activeMenuItem.display();
+}
+
+void Menu::setupMenuWith() {
+	_activeMenuItem.reset();
+
+	if (_vm->_gyro->_thinkThing) {
+		findWhatYouCanDoWithIt();
+
+		for (uint i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
+			char vbchar;
+			Common::String verb;
+
+			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
+			_activeMenuItem.setupOption(verb, vbchar, "", true);
+		}
+
+		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
+		// or (c), the _person you've selected is YOU!
+
+		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
+			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
+			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
+		else {
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
+		}
+	} else {
+		_activeMenuItem.setupOption("Examine", 'x', "", true);
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
+		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
+		switch (_vm->_gyro->_thinks) {
+		case Gyro::kPeopleGeida:
+		case Gyro::kPeopleArkata:
+			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
+			break;
+		case Gyro::kPeopleDogfood:
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
+			break;
+		case Gyro::kPeopleMalagauche: {
+			bool isSober = !_vm->_gyro->_teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
+			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
+			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
+			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
+			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
+			}
+			break;
+		case Gyro::kPeopleTrader:
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
+			break;
+		}
+	}
+	_activeMenuItem.display();
+}
+
+void Menu::runMenuGame() {
+	// Help, boss, untrash screen.
+	switch (_activeMenuItem._choiceNum) {
+	case 0:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
+		break;
+	case 1:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
+		break;
+	case 2:
+		_vm->_lucerna->majorRedraw();
+		break;
+	case 3:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
+		break;
+	case 4:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
+		break;
+	}
+}
+
+void Menu::runMenuFile() {
+	// New game, load, save, save as, DOS shell, about, quit.
+	switch (_activeMenuItem._choiceNum) {
+	case 0:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
+		break;
+	case 1:
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
+		break;
+	case 2:
+		if (!_vm->_acci->_realWords[1].empty())
+			_vm->_acci->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
+		break;
+	case 3:
+		//_vm->_basher->filename_edit();
+		warning("STUB: Dropdown::runMenuFile()");
+		break;
+	case 4:
+		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
+		break;
+	case 5:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
+		break;
+	}
+}
+
+void Menu::runMenuAction() {
+	Common::String f5Does;
+	// Get up, pause game, open door, look, inventory, walk/run.
+	switch (_activeMenuItem._choiceNum) {
+	case 0:
+		_vm->_acci->_person = _vm->_acci->kPardon;
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		f5Does = _vm->_gyro->f5Does();
+		_vm->_lucerna->callVerb(f5Does[0]);
+		break;
+	case 1:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
+		break;
+	case 2:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
+		break;
+	case 3:
+		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
+		break;
+	case 4:
+		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
+		break;
+	case 5: {
+		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		if (avvy->_speedX == _vm->_gyro->kWalk)
+			avvy->_speedX = _vm->_gyro->kRun;
+		else
+			avvy->_speedX = _vm->_gyro->kWalk;
+		_vm->_animation->updateSpeed();
+		}
+		break;
+	}
+}
+
+void Menu::runMenuObjects() {
+	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum], Gyro::kThing);
+}
+
+void Menu::runMenuPeople() {
+	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
+	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
+}
+
+void Menu::runMenuWith() {
+	_vm->_acci->_thing = _vm->_gyro->_thinks;
+
+	if (_vm->_gyro->_thinkThing) {
+		_vm->_acci->_thing += 49;
+
+		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
+			_vm->_acci->_person = _vm->_gyro->_lastPerson;
+		else
+			_vm->_acci->_person = Acci::kPardon;
+	} else {
+		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
+		case 100: // Beer
+			_vm->_acci->_thing = 100;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		case 101: // Wine
+			_vm->_acci->_thing = 50;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		case 102: // Whisky
+			_vm->_acci->_thing = 102;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		case 103: // Cider
+			_vm->_acci->_thing = 103;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		case 104: // Mead
+			_vm->_acci->_thing = 107;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		case 105: // Onion (trader)
+			_vm->_acci->_thing = 67;
+			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			return;
+		default:
+			_vm->_acci->_person = _vm->_acci->_thing;
+			_vm->_acci->_thing = Acci::kPardon;
+			_vm->_gyro->_subjectNum = 0;
+		}
+	}
+	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
+}
+
+void Menu::setup() {
+	_menuBar.init(this);
+	_activeMenuItem.init(this);
+
+	_menuBar.createMenuItem('F', "File", '!', &Avalanche::Menu::setupMenuFile, &Avalanche::Menu::runMenuFile);
+	_menuBar.createMenuItem('G', "Game", 34, &Avalanche::Menu::setupMenuGame, &Avalanche::Menu::runMenuGame);
+	_menuBar.createMenuItem('A', "Action", 30, &Avalanche::Menu::setupMenuAction, &Avalanche::Menu::runMenuAction);
+	_menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Menu::setupMenuObjects, &Avalanche::Menu::runMenuObjects);
+	_menuBar.createMenuItem('P', "People", 25, &Avalanche::Menu::setupMenuPeople, &Avalanche::Menu::runMenuPeople);
+	_menuBar.createMenuItem('W', "With", 17, &Avalanche::Menu::setupMenuWith, &Avalanche::Menu::runMenuWith);
+
+	_menuBar.draw();
+}
+
+void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
+	Common::Point cursorPos = _vm->getMousePos();
+	::Graphics::Surface backup;
+	backup.copyFrom(_vm->_graphics->_surface);
+
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
+		_menuBar.chooseMenuItem(cursorPos.x);
+		do
+			_vm->updateEvents();
+		while (_vm->_lucerna->_holdLeftMouse);
+
+
+		while (!_vm->shouldQuit()) {
+			do {
+				_vm->updateEvents();
+
+				// We updadte the cursor's picture.
+				cursorPos = _vm->getMousePos();
+				// Change arrow...
+				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+					_vm->_gyro->newMouse(1); // Up arrow
+				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
+					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
+						_vm->_gyro->newMouse(3); // Right-arrow
+					else
+						_vm->_gyro->newMouse(4); // Fletch
+				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+					_vm->_gyro->newMouse(2); // Screwdriver
+
+				_activeMenuItem.lightUp(cursorPos);
+
+				_vm->_graphics->refreshScreen();
+			} while (!_vm->_lucerna->_holdLeftMouse);
+
+			if (_vm->_lucerna->_holdLeftMouse) {
+				if (cursorPos.y > 21) {
+					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1))))) {
+							// Clicked OUTSIDE the menu.
+							if (_activeMenuItem._activeNow) {
+								_activeMenuItem.wipe();
+								_vm->_lucerna->_holdLeftMouse = false;
+								backup.free();
+								return;
+							} // No "else"- clicking on menu has no effect (only releasing).
+						}
+				} else {
+					// Clicked on menu bar.
+					if (_activeMenuItem._activeNow) {
+						_activeMenuItem.wipe();
+						_vm->_graphics->_surface.copyFrom(backup);
+						_vm->_graphics->refreshScreen();
+
+						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
+							// If we clicked on the same menu item (the one that is already active) on the bar...
+							_vm->_lucerna->_holdLeftMouse = false;
+							backup.free();
+							return;
+						} else {
+							_vm->_lucerna->_holdLeftMouse = true;
+							break;
+						}
+					}
+				}
+
+				// NOT clicked button...
+				if ((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
+					&& (cursorPos.y >= 12) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1)))) {
+
+					// We act only if the button is released over a menu item.
+					while (!_vm->shouldQuit()) {
+						cursorPos = _vm->getMousePos();
+						_activeMenuItem.lightUp(cursorPos);
+						_vm->_graphics->refreshScreen();
+
+						_vm->updateEvents();
+						if (!_vm->_lucerna->_holdLeftMouse)
+							break;
+					}
+
+					uint16 which = (cursorPos.y - 26) / 20;
+					_activeMenuItem.select(which);
+					if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
+						backup.free();
+						return;
+					}
+				}
+			}
+		}
+	}
+
+	backup.free();
+}
+
+bool Menu::isActive() {
+	return _menuActive;
+}
+
+void Menu::init() {
+	_menuActive = false;
+}
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
new file mode 100644
index 0000000..ad0821e
--- /dev/null
+++ b/engines/avalanche/menu.h
@@ -0,0 +1,168 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* DROPDOWN	A customised version of Oopmenu (qv). */
+
+#ifndef AVALANCHE_DROPDOWN2_H
+#define AVALANCHE_DROPDOWN2_H
+
+#include "avalanche/color.h"
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Menu;
+
+typedef void (Menu::*MenuFunc)();
+
+class HeadType {
+public:
+	Common::String _title;
+	char _trigger, _altTrigger;
+	byte _position;
+	int16 _xpos, _xright;
+	MenuFunc _setupFunc, _chooseFunc;
+
+	void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *dr);
+	void draw();
+	void highlight();
+	bool parseAltTrigger(char key);
+
+private:
+	Menu *_dr;
+};
+
+struct OptionType {
+	Common::String _title;
+	byte _trigger;
+	Common::String _shortcut;
+	bool _valid;
+};
+
+class MenuItem {
+public:
+	OptionType _options[12];
+	byte _optionNum;
+	uint16 _width, _left;
+	bool _firstlix;
+	int16 _flx1, _flx2, _fly;
+	byte _oldY; // used by lightUp */
+	bool _activeNow; // Is there an active option now?
+	byte _activeNum; // And if so, which is it?
+	byte _choiceNum; // Your choice?
+	byte _highlightNum;
+
+	void init(Menu *dr);
+	void reset();
+	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
+	void display();
+	void wipe();
+	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
+	void displayOption(byte y, bool highlit);
+	void moveHighlight(int8 inc);
+	void select(byte which); // Choose which one you want.
+	void parseKey(char c);
+
+private:
+	Menu *_dr;
+};
+
+class MenuBar {
+public:
+	HeadType _menuItems[8];
+	byte _menuNum;
+
+	void init(Menu *dr);
+	void createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc);
+	void draw();
+	void parseAltTrigger(char c);
+	void setupMenuItem(byte which);
+	void chooseMenuItem(int16 x);
+
+private:
+	Menu *_dr;
+};
+
+class Menu {
+public:
+	friend class HeadType;
+	friend class MenuItem;
+	friend class MenuBar;
+
+	MenuItem _activeMenuItem;
+	MenuBar _menuBar;
+
+	Common::String people;
+
+	Menu(AvalancheEngine *vm);
+
+	void parseKey(char r, char re);
+	void update();
+	void setup(); // Standard menu bar.
+	bool isActive();
+	void init();
+
+private:
+	static const byte kIndent = 5;
+	static const byte kSpacing = 10;
+
+	static const byte kMenuBackgroundColor = kColorLightgray;
+	static const byte kMenuFontColor = kColorBlack;
+	static const byte kMenuBorderColor = kColorBlack;
+	static const byte kHighlightBackgroundColor = kColorBlack;
+	static const byte kHighlightFontColor = kColorWhite;
+	static const byte kDisabledColor = kColorDarkgray;
+
+	bool _menuActive; // Kludge so we don't have to keep referring to Dropdown
+
+	AvalancheEngine *_vm;
+
+	Common::String selectGender(byte x); // Returns "im" for boys, and "er" for girls.
+	void findWhatYouCanDoWithIt();
+	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
+	void bleep();
+
+	void setupMenuGame();
+	void setupMenuFile();
+	void setupMenuAction();
+	void setupMenuPeople();
+	void setupMenuObjects();
+	void setupMenuWith();
+
+	void runMenuGame();
+	void runMenuFile();
+	void runMenuAction();
+	void runMenuObjects();
+	void runMenuPeople();
+	void runMenuWith();
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_DROPDOWN2_H
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 0da172c..4a0c703 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -16,7 +16,7 @@ MODULE_OBJS = \
 	timer.o \
 	animation.o \
 	acci.o \
-	dropdown.o \
+	menu.o \
 	closing.o
 
 # This module can be built as a plugin
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 4bf0588..903a01b 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -65,7 +65,7 @@ void Parser::handleInputText(const Common::Event &event) {
 }
 
 void Parser::handleBackspace() {
-	if (!_vm->_dropdown->_activeMenuItem._activeNow) {
+	if (!_vm->_menu->_activeMenuItem._activeNow) {
 		if (_inputTextPos > _leftMargin) {
 			_inputTextPos--;
 			if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
@@ -78,7 +78,7 @@ void Parser::handleBackspace() {
 }
 
 void Parser::handleReturn() {
-	if (_vm->_dropdown->_activeMenuItem._activeNow)
+	if (_vm->_menu->_activeMenuItem._activeNow)
 		_vm->_parser->tryDropdown();
 	else if (!_inputText.empty()) {
 		_inputTextBackup = _inputText;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index ebace78..8038f01 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -80,7 +80,7 @@ void Timer::addTimer(int32 duration, byte action, byte reason) {
  * @remarks	Originally called 'one_tick'
  */
 void Timer::updateTimer() {
-	if (_vm->_gyro->_dropdownActive)
+	if (_vm->_menu->isActive())
 		return;
 
 	for (int i = 0; i < 7; i++) {


Commit: 9ba81f6097cf02a5e38c797746d4e8a5d46e8a6c
    https://github.com/scummvm/scummvm/commit/9ba81f6097cf02a5e38c797746d4e8a5d46e8a6c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-17T23:00:30-07:00

Commit Message:
AVALANCHE: move some engine init instructions to Gyro

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 980fcab..1c92d2b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -430,7 +430,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	synchronize(sz);
 	delete f;
 
-	_gyro->isLoaded = true;
+	_gyro->_isLoaded = true;
 	_gyro->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
 	if (_gyro->_holdTheDawn) {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 687572c..0bee2b7 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -125,34 +125,22 @@ void Avalot::handleKeyDown(Common::Event &event) {
 }
 
 void Avalot::setup() {
-	_vm->_gyro->_mouse = _vm->_gyro->kMouseStateNo;
-	_vm->_gyro->_letMeOut = false;
+	_vm->_gyro->init();
+
 	_vm->_scrolls->resetScroll();
-	CursorMan.showMouse(true);
-	_vm->_gyro->_holdTheDawn = true;
 	_vm->_lucerna->dusk();
-	_vm->_gyro->_currentMouse = 177;
-	_vm->_gyro->setMousePointerWait();
-	_vm->_gyro->_dropsOk = true;
-	_vm->_gyro->_mouseText = "";
 	_vm->_lucerna->loadDigits();
-	_vm->_gyro->_cheat = false;
-	_vm->_gyro->_cp = 0;
+
 	_vm->_parser->_inputTextPos = 0;
 	_vm->_parser->_quote = true;
-	_vm->_gyro->_ledStatus = 177;
-	_vm->_gyro->_defaultLed = 2;
+
 	// TSkellern = 0; Replace with a more local variable sometime
-	_vm->_animation->_direction = Animation::kDirStopped;
-	_vm->_gyro->_enidFilename = ""; // Undefined.
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
-	for (int i = 0; i < 3; i++)
-		_vm->_gyro->_scoreToDisplay[i] = -1; // Impossible digits.
 
+	_vm->_animation->_direction = Animation::kDirStopped;
 	_vm->_animation->loadAnims();
 
-	_vm->_gyro->_holdTheDawn = false;
 	_vm->_lucerna->dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
@@ -168,7 +156,7 @@ void Avalot::setup() {
 
 		_vm->loadGame(loadSlot);
 	} else {
-		_vm->_gyro->isLoaded = false; // Set to true in _vm->loadGame().
+		_vm->_gyro->_isLoaded = false; // Set to true in _vm->loadGame().
 		_vm->_gyro->newGame(); // No game was requested- load the default.
 
 		_vm->_gyro->_soundFx = !_vm->_gyro->_soundFx;
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index ec69594..ec4929e 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -592,4 +592,24 @@ void Gyro::hangAroundForAWhile() {
 		slowDown();
 }
 
+void Gyro::init() {
+	_mouse = kMouseStateNo;
+	_letMeOut = false;
+	_holdTheDawn = true;
+	_currentMouse = 177;
+	_dropsOk = true;
+	_mouseText = "";
+	_cheat = false;
+	_cp = 0;
+	_ledStatus = 177;
+	_defaultLed = 2;
+	_enidFilename = ""; // Undefined.
+	for (int i = 0; i < 3; i++)
+		_scoreToDisplay[i] = -1; // Impossible digits.
+	_holdTheDawn = false;
+
+	setMousePointerWait();
+	CursorMan.showMouse(true);
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index b01f3e1..27bbcb8 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -42,7 +42,6 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-
 static const byte kObjectNum = 18; // always preface with a #
 static const int16 kCarryLimit = 12;  // carry limit
 
@@ -187,11 +186,8 @@ public:
 
 	static const int16 kXW = 30;
 	static const int16 kYW = 36; // x width & y whatsit
-
 	static const int16 kMargin = 5;
-
 	static const MouseHotspotType kMouseHotSpots[9];
-
 	static const int16 kMaxSprites = 2; // Current max no. of sprites.
 
 	// For Thinkabout:
@@ -363,11 +359,9 @@ public:
 	byte _lastPerson; // Last person to have been selected using the People menu.
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
-	bool isLoaded; // Is it a loaded gamestate?
+	bool _isLoaded; // Is it a loaded gamestate?
 	Common::String _enidFilename;
 
-
-
 	Gyro(AvalancheEngine *vm);
 	~Gyro();
 
@@ -397,6 +391,7 @@ public:
 	Common::String getItem(byte which); // Called get_better in the original.
 	Common::String f5Does(); // This procedure determines what f5 does.
 
+	void init();
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 336c686..d5f48db 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -835,7 +835,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	}
 
 	_vm->_gyro->_seeScroll = false; // Now it can work again!
-	_vm->_gyro->isLoaded = false;
+	_vm->_gyro->_isLoaded = false;
 }
 
 void Lucerna::thinkAbout(byte object, bool type) {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 8038f01..bd31c2d 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -57,7 +57,7 @@ Timer::Timer(AvalancheEngine *vm) {
  * @remarks	Originally called 'set_up_timer'
  */
 void Timer::addTimer(int32 duration, byte action, byte reason) {
-	if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
+	if ((_vm->_gyro->_isLoaded == false) || (_timerLost == true)) {
 		byte i = 0;
 		while ((i < 7) && (_times[i]._timeLeft != 0))
 			i++;
@@ -70,7 +70,7 @@ void Timer::addTimer(int32 duration, byte action, byte reason) {
 		_times[i]._action = action;
 		_times[i]._reason = reason;
 	} else {
-		_vm->_gyro->isLoaded = false;
+		_vm->_gyro->_isLoaded = false;
 		return;
 	}
 }


Commit: edc147774100ffcdfb6aeaa896151e75790564ce
    https://github.com/scummvm/scummvm/commit/edc147774100ffcdfb6aeaa896151e75790564ce
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-17T23:07:20-07:00

Commit Message:
AVALANCHE: Remove index hack used for mouse pointer (Pascal to C conversion)

Changed paths:
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index ec4929e..cea537d 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -196,9 +196,9 @@ Common::String Gyro::intToStr(int32 num) {
 void Gyro::newMouse(byte id) {
 	if (id == _currentMouse)
 		return;
-	_currentMouse = id;
 
-	loadMouse(id - 1);
+	_currentMouse = id;
+	loadMouse(id);
 }
 
 /**
@@ -206,7 +206,7 @@ void Gyro::newMouse(byte id) {
  * @remarks	Originally called 'wait'
  */
 void Gyro::setMousePointerWait() {
-	newMouse(5);
+	newMouse(4);
 }
 
 void Gyro::note(uint16 hertz) {
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index d5f48db..ae6e8b7 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -1075,17 +1075,17 @@ void Lucerna::checkClick() {
 	_vm->_gyro->after_the_scroll = false;*/
 
 	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		_vm->_gyro->newMouse(1); // up arrow
+		_vm->_gyro->newMouse(0); // up arrow
 	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
-		_vm->_gyro->newMouse(8); //I-beam
+		_vm->_gyro->newMouse(7); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		_vm->_gyro->newMouse(2); // screwdriver
+		_vm->_gyro->newMouse(1); // screwdriver
 	else if (!_vm->_menu->isActive()) { // Dropdown can handle its own pointers.
 		if (_holdLeftMouse) {
-			_vm->_gyro->newMouse(7); // Mark's crosshairs
+			_vm->_gyro->newMouse(6); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
-			_vm->_gyro->newMouse(4); // fletch
+			_vm->_gyro->newMouse(3); // fletch
 	}
 
 	if (_holdLeftMouse) {
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 69267da..a51ec46 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -715,14 +715,14 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_gyro->newMouse(1); // Up arrow
+					_vm->_gyro->newMouse(0); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->_gyro->newMouse(3); // Right-arrow
+						_vm->_gyro->newMouse(2); // Right-arrow
 					else
-						_vm->_gyro->newMouse(4); // Fletch
+						_vm->_gyro->newMouse(3); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_gyro->newMouse(2); // Screwdriver
+					_vm->_gyro->newMouse(1); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 398396d..0439211 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -119,7 +119,7 @@ void Scrolls::scrollModeNormal() {
 	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
-	_vm->_gyro->newMouse(4);
+	_vm->_gyro->newMouse(3);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -209,7 +209,7 @@ void Scrolls::scrollModeMusic() {
 	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
 	CursorMan.showMouse(true);
-	_vm->_gyro->newMouse(4);
+	_vm->_gyro->newMouse(3);
 
 	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further.
 	// For now we act like the player just played the right tone.


Commit: 23b225ca0d1da28a45507824edcff1c9ca0f917b
    https://github.com/scummvm/scummvm/commit/23b225ca0d1da28a45507824edcff1c9ca0f917b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-18T14:59:26-07:00

Commit Message:
AVALANCHE: Add sound class, blip(), playNote() and click()

Changed paths:
  A engines/avalanche/sound.cpp
  A engines/avalanche/sound.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/celer.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 1c92d2b..b363b8a 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -73,6 +73,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _menu;
 	delete _closing;
 	delete _gyro;
+	delete _sound;
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
@@ -91,6 +92,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_acci = new Acci(this);
 	_menu = new Menu(this);
 	_closing = new Closing(this);
+	_sound = new SoundHandler(this);
 
 	_graphics->init();
 	_scrolls->init();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 4a01c72..c930fe7 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -45,6 +45,7 @@
 #include "avalanche/acci.h"
 #include "avalanche/menu.h"
 #include "avalanche/closing.h"
+#include "avalanche/sound.h"
 
 #include "common/serializer.h"
 
@@ -80,6 +81,7 @@ public:
 	Acci *_acci;
 	Menu *_menu;
 	Closing *_closing;
+	SoundHandler *_sound;
 
 	OSystem *_system;
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0bee2b7..565d54c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -56,11 +56,8 @@ Avalot::Avalot(AvalancheEngine *vm) {
 }
 
 void Avalot::handleKeyDown(Common::Event &event) {
-	//if (keyboardclick)
-	//	click();
-	//
-	// To be implemented later with the sounds, I assume.
-
+//	if (keyboardclick)
+	_vm->_sound->click();
 
 	if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15))
 		_vm->_parser->handleFunctionKey(event);
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 61a45c7..37a01ed 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -255,7 +255,8 @@ void Celer::updateBackgroundSprites() {
 			if (_vm->_gyro->_nextBell < 5)
 				_vm->_gyro->_nextBell = 12;
 			_vm->_gyro->_nextBell--;
-			_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]);
+			// CHECKME: 2 is a guess. No length in the original? 
+			_vm->_sound->playNote(_vm->_gyro->kNotes[_vm->_gyro->_nextBell], 2);
 			break;
 		case 2:
 			//nosound();
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index cea537d..c1ea6a2 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -209,14 +209,6 @@ void Gyro::setMousePointerWait() {
 	newMouse(4);
 }
 
-void Gyro::note(uint16 hertz) {
-	warning("STUB: Gyro::note()");
-}
-
-void Gyro::blip() {
-	warning("STUB: Gyro::blip()");
-}
-
 void Gyro::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
 	warning("STUB: Gyro::shadow()");
 }
@@ -361,10 +353,6 @@ void Gyro::newGame() {
 	_vm->_lucerna->spriteRun();
 }
 
-void Gyro::click() {
-	warning("STUB: Gyro::click()");
-}
-
 void Gyro::slowDown() {
 	warning("STUB: Gyro::slowdown()");
 }
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 27bbcb8..f62c250 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -370,10 +370,6 @@ public:
 	void setMousePointerWait();    // Makes hourglass.
 	void loadMouse(byte which);
 
-	void note(uint16 hertz);
-	void blip();
-	void click(); // "Audio keyboard feedback"
-
 	void setBackgroundColor(byte x);
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index ae6e8b7..0206d0a 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -946,13 +946,11 @@ void Lucerna::incScore(byte num) {     // Add on no. of points
 	for (int i = 1; i <= num; i++) {
 		_vm->_gyro->_dnascore++;
 
-#if 0
-		if (soundfx) {
+//		if (soundfx) {
 			for (int j = 1; j <= 97; j++)
-				sound(177 + dna.score * 3);
-		}
-		nosound;
-#endif
+				// Length os 2 is a guess, the original doesn't have a delay specified
+				_vm->_sound->playNote(177 + _vm->_gyro->_dnascore * 3, 2);
+//		}
 	}
 	warning("STUB: Lucerna::points()");
 
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index a51ec46..aa7cba7 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -214,7 +214,7 @@ void MenuItem::parseKey(char c) {
 		}
 	}
 	if (!found)
-		_dr->_vm->_gyro->blip();
+		_dr->_vm->_sound->blip();
 }
 
 void MenuBar::init(Menu *dr) {
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 4a0c703..0fea70e 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -17,7 +17,8 @@ MODULE_OBJS = \
 	animation.o \
 	acci.o \
 	menu.o \
-	closing.o
+	closing.o \
+	sound.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 903a01b..5f9e5d8 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -60,7 +60,7 @@ void Parser::handleInputText(const Common::Event &event) {
 			_inputTextPos++;
 			plotText();
 		} else
-			_vm->_gyro->blip();
+			_vm->_sound->blip();
 //	}
 }
 
@@ -73,7 +73,7 @@ void Parser::handleBackspace() {
 			_inputText.deleteChar(_inputTextPos);
 			plotText();
 		} else
-			_vm->_gyro->blip();
+			_vm->_sound->blip();
 	}
 }
 
diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
new file mode 100644
index 0000000..bec5426
--- /dev/null
+++ b/engines/avalanche/sound.cpp
@@ -0,0 +1,101 @@
+/* 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/debug.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/config-manager.h"
+
+#include "audio/decoders/raw.h"
+#include "audio/audiostream.h"
+
+#include "avalanche/avalanche.h"
+#include "avalanche/sound.h"
+
+namespace Avalanche {
+
+SoundHandler::SoundHandler(AvalancheEngine *vm) : _vm(vm) {
+	_speakerStream = new Audio::PCSpeaker(_vm->_mixer->getOutputRate());
+	_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
+						_speakerStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
+}
+
+SoundHandler::~SoundHandler() {
+	_vm->_mixer->stopHandle(_speakerHandle);
+	delete _speakerStream;
+}
+
+/**
+ * Stop any sound that might be playing
+ */
+void SoundHandler::stopSound() {
+	_vm->_mixer->stopAll();
+}
+
+/**
+ * Turn digitized sound on and off
+ */
+void SoundHandler::toggleSound() {
+//	_vm->_config._soundFl = !_vm->_config._soundFl;
+}
+
+/**
+ * Initialize for MCI sound and midi
+ */
+void SoundHandler::initSound() {
+	//_midiPlayer->open();
+}
+
+void SoundHandler::syncVolume() {
+	int soundVolume;
+
+	if (ConfMan.getBool("sfx_mute") || ConfMan.getBool("mute"))
+		soundVolume = -1;
+	else
+		soundVolume = MIN(255, ConfMan.getInt("sfx_volume"));
+
+	_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolume);
+}
+
+void SoundHandler::playNote(int freq, int length) {
+	// Does the user not want any sound?
+//	if (!_vm->_config._soundFl || !_vm->_mixer->isReady())
+	if (!_vm->_mixer->isReady())
+		return;
+
+	// Start a note playing (we will stop it when the timer expires).
+	_speakerStream->play(Audio::PCSpeaker::kWaveFormSquare, freq, length);
+}
+
+void SoundHandler::click() {
+	_vm->_mixer->stopAll();
+
+	playNote(7177, 1);
+}
+
+void SoundHandler::blip() {
+	_vm->_mixer->stopAll();
+
+	playNote(177, 77);
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h
new file mode 100644
index 0000000..65dda96
--- /dev/null
+++ b/engines/avalanche/sound.h
@@ -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.
+ *
+ */
+
+#ifndef AVALANCHE_SOUND_H
+#define AVALANCHE_SOUND_H
+
+#include "audio/mixer.h"
+#include "audio/midiplayer.h"
+#include "audio/softsynth/pcspk.h"
+
+namespace Avalanche {
+
+class SoundHandler {
+public:
+	SoundHandler(AvalancheEngine *vm);
+	~SoundHandler();
+
+	void toggleSound();
+	void playNote(int freq, int length);
+	void click();
+	void blip();
+	void initSound();
+	void syncVolume();
+
+private:
+	AvalancheEngine *_vm;
+	Audio::PCSpeaker *_speakerStream;
+	Audio::SoundHandle _speakerHandle;
+
+	void stopSound();
+};
+
+} // End of namespace Avalanche
+
+#endif //AVALANCHE_SOUND_H
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index bd31c2d..cbce6cb 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -272,7 +272,7 @@ void Timer::bang2() {
 }
 
 void Timer::stairs() {
-	_vm->_gyro->blip();
+	_vm->_sound->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
 	_vm->_gyro->_brummieStairs = 2;


Commit: d26a06a970c17c83ab3d8a85f462172edfa9b07f
    https://github.com/scummvm/scummvm/commit/d26a06a970c17c83ab3d8a85f462172edfa9b07f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-18T15:11:50-07:00

Commit Message:
AVALANCHE: Remove useless includes

Changed paths:
    engines/avalanche/sound.cpp
    engines/avalanche/sound.h



diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index bec5426..b031e32 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -20,12 +20,8 @@
  *
  */
 
-#include "common/debug.h"
 #include "common/system.h"
-#include "common/textconsole.h"
 #include "common/config-manager.h"
-
-#include "audio/decoders/raw.h"
 #include "audio/audiostream.h"
 
 #include "avalanche/avalanche.h"
diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h
index 65dda96..d8ffbd7 100644
--- a/engines/avalanche/sound.h
+++ b/engines/avalanche/sound.h
@@ -24,7 +24,6 @@
 #define AVALANCHE_SOUND_H
 
 #include "audio/mixer.h"
-#include "audio/midiplayer.h"
 #include "audio/softsynth/pcspk.h"
 
 namespace Avalanche {


Commit: 2238db712cf45d1b82d51fcbf31098d6ce9d6da8
    https://github.com/scummvm/scummvm/commit/2238db712cf45d1b82d51fcbf31098d6ce9d6da8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-18T15:23:59-07:00

Commit Message:
AVALANCHE: Remove useless function, add _soundFl

Changed paths:
    engines/avalanche/sound.cpp
    engines/avalanche/sound.h



diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index b031e32..7ab94c7 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -30,6 +30,7 @@
 namespace Avalanche {
 
 SoundHandler::SoundHandler(AvalancheEngine *vm) : _vm(vm) {
+	_soundFl = true;
 	_speakerStream = new Audio::PCSpeaker(_vm->_mixer->getOutputRate());
 	_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
 						_speakerStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
@@ -51,14 +52,7 @@ void SoundHandler::stopSound() {
  * Turn digitized sound on and off
  */
 void SoundHandler::toggleSound() {
-//	_vm->_config._soundFl = !_vm->_config._soundFl;
-}
-
-/**
- * Initialize for MCI sound and midi
- */
-void SoundHandler::initSound() {
-	//_midiPlayer->open();
+	_soundFl = !_soundFl;
 }
 
 void SoundHandler::syncVolume() {
@@ -74,8 +68,7 @@ void SoundHandler::syncVolume() {
 
 void SoundHandler::playNote(int freq, int length) {
 	// Does the user not want any sound?
-//	if (!_vm->_config._soundFl || !_vm->_mixer->isReady())
-	if (!_vm->_mixer->isReady())
+	if (!_soundFl || !_vm->_mixer->isReady())
 		return;
 
 	// Start a note playing (we will stop it when the timer expires).
diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h
index d8ffbd7..a982e98 100644
--- a/engines/avalanche/sound.h
+++ b/engines/avalanche/sound.h
@@ -30,6 +30,8 @@ namespace Avalanche {
 
 class SoundHandler {
 public:
+	bool _soundFl;
+
 	SoundHandler(AvalancheEngine *vm);
 	~SoundHandler();
 
@@ -37,7 +39,6 @@ public:
 	void playNote(int freq, int length);
 	void click();
 	void blip();
-	void initSound();
 	void syncVolume();
 
 private:


Commit: 035604091017142b59dc317dd8d2ad9320610da8
    https://github.com/scummvm/scummvm/commit/035604091017142b59dc317dd8d2ad9320610da8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T10:04:01-07:00

Commit Message:
AVALANCHE: Remove some STUBs, add calls to stopSound()

Changed paths:
    engines/avalanche/celer.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/scrolls.cpp
    engines/avalanche/sound.h



diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
index 37a01ed..0ebd846 100644
--- a/engines/avalanche/celer.cpp
+++ b/engines/avalanche/celer.cpp
@@ -259,7 +259,7 @@ void Celer::updateBackgroundSprites() {
 			_vm->_sound->playNote(_vm->_gyro->kNotes[_vm->_gyro->_nextBell], 2);
 			break;
 		case 2:
-			//nosound();
+			_vm->_sound->stopSound();
 			break;
 		}
 	}
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index df53bc3..900000d 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -68,13 +68,12 @@ void Closing::exitGame() {
 		"ignore", "stare at", "shriek at", "frighten", "quieten"
 	};
 
-	Common::String result;
-
-	//nosound();
-	warning("STUB: Closing::exitGame()");
+	_vm->_sound->stopSound();
 
 	getScreen(kScreenNagScreen);
-	result = nouns[_vm->_rnd->getRandomNumber(12)] + " will " + verbs[_vm->_rnd->getRandomNumber(12)] + " you";
+	byte nounId = _vm->_rnd->getRandomNumber(12);
+	byte verbId = _vm->_rnd->getRandomNumber(12);
+	Common::String result = nouns[nounId] + " will " + verbs[verbId] + " you";
 	putIn(result, 1628);
 	showScreen(); // No halt- it's already set up.
 }
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 0206d0a..2f38452 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -340,7 +340,7 @@ void Lucerna::findPeople(byte room) {
 }
 
 void Lucerna::exitRoom(byte x) {
-	//nosound();
+	_vm->_sound->stopSound();
 	_vm->_celer->forgetBackgroundSprites();
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
@@ -365,7 +365,6 @@ void Lucerna::exitRoom(byte x) {
 	}
 
 	_vm->_gyro->_interrogation = 0; // Leaving the room cancels all the questions automatically.
-
 	_vm->_gyro->_seeScroll = false; // Now it can work again!
 
 	_vm->_gyro->_lastRoom = _vm->_gyro->_room;
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index aa7cba7..2d899da 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -60,10 +60,7 @@ void HeadType::draw() {
 void HeadType::highlight() {
 	CursorMan.showMouse(false);
 
-	//nosound();
-	//setactivepage(cp);
-	warning("STUB: Dropdown::headytpe::highlight()");
-
+	_dr->_vm->_sound->stopSound();
 	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
 
 	_dr->_activeMenuItem._left = _xpos;
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 0439211..8df4635 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -592,9 +592,10 @@ void Scrolls::solidify(byte n) {
 
 void Scrolls::callScrollDriver() {
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
-	//nosound();
 	warning("STUB: Scrolls::calldrivers()");
 
+	_vm->_sound->stopSound();
+
 	setReadyLight(0);
 	_vm->_gyro->_scReturn = false;
 	bool mouthnext = false;
diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h
index a982e98..da2ece3 100644
--- a/engines/avalanche/sound.h
+++ b/engines/avalanche/sound.h
@@ -40,13 +40,12 @@ public:
 	void click();
 	void blip();
 	void syncVolume();
+	void stopSound();
 
 private:
 	AvalancheEngine *_vm;
 	Audio::PCSpeaker *_speakerStream;
 	Audio::SoundHandle _speakerHandle;
-
-	void stopSound();
 };
 
 } // End of namespace Avalanche


Commit: 21a9de5df23395b5a5466a7345222a045eab8135
    https://github.com/scummvm/scummvm/commit/21a9de5df23395b5a5466a7345222a045eab8135
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T11:53:47-07:00

Commit Message:
AVALANCHE: Rename Celer to Background.

Changed paths:
  A engines/avalanche/background.cpp
  A engines/avalanche/background.h
  R engines/avalanche/celer.cpp
  R engines/avalanche/celer.h
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/module.mk
    engines/avalanche/sequence.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index b607478..e303d3b 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -35,7 +35,7 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
 
@@ -871,17 +871,17 @@ bool Acci::isHolding() {
 
 void Acci::openBox(bool isOpening) {
 	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+		_vm->_background->drawBackgroundSprite(-1, -1, 4);
 
-		_vm->_celer->updateBackgroundSprites();
+		_vm->_background->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_graphics->refreshScreen();
 
 		_vm->_system->delayMillis(55);
 
 		if (!isOpening) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
-			_vm->_celer->updateBackgroundSprites();
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->updateBackgroundSprites();
 			_vm->_animation->animLink();
 			_vm->_graphics->refreshScreen();
 		}
@@ -1315,7 +1315,7 @@ void Acci::standUp() {
 			_vm->_gyro->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->_direction = Animation::kDirLeft;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
+			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
 			_vm->_lucerna->incScore(1);
 			_vm->_gyro->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
@@ -1329,7 +1329,7 @@ void Acci::standUp() {
 
 	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
+			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(0, 3); // And walking away.
 			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
@@ -1347,12 +1347,12 @@ void Acci::getProc(char thing) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
 			if (_vm->_gyro->_boxContent == thing) {
-				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+				_vm->_background->drawBackgroundSprite(-1, -1, 4);
 				_vm->_scrolls->displayText("OK, I've got it.");
 				_vm->_gyro->_objects[thing - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_boxContent = kNothing;
-				_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+				_vm->_background->drawBackgroundSprite(-1, -1, 5);
 			} else {
 				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
 				_vm->_scrolls->displayText(tmpStr);
@@ -1368,7 +1368,7 @@ void Acci::getProc(char thing) {
 					_vm->_scrolls->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
-					_vm->_celer->drawBackgroundSprite(-1, -1, 3); // No pen there now.
+					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_gyro->_takenPen = true;
 					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
@@ -1389,7 +1389,7 @@ void Acci::getProc(char thing) {
 		break;
 	case kRoomRobins:
 		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_scrolls->displayText("Got it!");
 			_vm->_gyro->_mushroomGrowing = false;
 			_vm->_gyro->_takenMushroom = true;
@@ -1608,8 +1608,8 @@ void Acci::doThat() {
 							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
 							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
 							_vm->_gyro->_givenBadgeToIby = true;
-							_vm->_celer->drawBackgroundSprite(-1, -1, 7);
-							_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+							_vm->_background->drawBackgroundSprite(-1, -1, 7);
+							_vm->_background->drawBackgroundSprite(-1, -1, 8);
 						} else
 							heyThanks();
 						break;
@@ -1791,7 +1791,7 @@ void Acci::doThat() {
 				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_wonNim = true;
-				_vm->_celer->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
+				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
 				_vm->_lucerna->incScore(7); // 7 points for winning!
 
 				if (_vm->_gyro->_playedNim == 1)
@@ -1953,11 +1953,11 @@ void Acci::doThat() {
 					if (_vm->_gyro->_alcoholLevel == 0)
 						_vm->_lucerna->incScore(3);
 
-					_vm->_celer->drawBackgroundSprite(-1, -1, 11);
+					_vm->_background->drawBackgroundSprite(-1, -1, 11);
 					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
 					_vm->_gyro->_drinking = _thing;
 
-					_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+					_vm->_background->drawBackgroundSprite(-1, -1, 9);
 					_vm->_gyro->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
@@ -1978,12 +1978,12 @@ void Acci::doThat() {
 							return;
 						}
 
-						_vm->_celer->drawBackgroundSprite(-1, -1, 11);
+						_vm->_background->drawBackgroundSprite(-1, -1, 11);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
 						_vm->_scrolls->displayText(tmpStr);
 						if (_vm->_gyro->_alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
-						_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+						_vm->_background->drawBackgroundSprite(-1, -1, 9);
 						_vm->_gyro->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
@@ -2153,7 +2153,7 @@ void Acci::doThat() {
 					_vm->_gyro->_avvyIsAwake = true;
 					_vm->_lucerna->incScore(1);
 					_vm->_gyro->_avvyInBed = true;
-					_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
+					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_teetotal)
 						_vm->_scrolls->displayScrollChain('d', 13);
 				} else
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index e3634e0..c30104f 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
 
@@ -464,59 +464,59 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27);
+		_vm->_background->drawBackgroundSprite(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4);  // ...window.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 4); // ...window.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_background->drawBackgroundSprite(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches.
+		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
+		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // Sloping wall.
@@ -531,44 +531,44 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18);
+		_vm->_background->drawBackgroundSprite(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...window.
+		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door.
+		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window.
+		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...door, and...
+		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // No door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches.
+		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
 		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and...
-		_vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches.
+		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
+		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door, and...
+		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_gyro->_magics[4]._operation = Gyro::kMagicNothing; // Sloping wall.
@@ -586,7 +586,7 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x1:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 21);
+		_vm->_background->drawBackgroundSprite(-1, -1, 21);
 
 		if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows))
 			_vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
@@ -597,13 +597,13 @@ void Animation::catacombMove(byte ped) {
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 22);
+		_vm->_background->drawBackgroundSprite(-1, -1, 22);
 		_vm->_gyro->_magics[6]._operation = Gyro::kMagicSpecial; // Middle exit south.
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
 		break;
 	case 0x3:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 23);
+		_vm->_background->drawBackgroundSprite(-1, -1, 23);
 		_vm->_gyro->_magics[11]._operation = Gyro::kMagicSpecial; // Left exit south.
 		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
@@ -624,7 +624,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x2:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+		_vm->_background->drawBackgroundSprite(-1, -1, 3);
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
@@ -642,7 +642,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x5:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+		_vm->_background->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
@@ -657,12 +657,12 @@ void Animation::catacombMove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+		_vm->_background->drawBackgroundSprite(-1, -1, 5);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 30);
+			_vm->_background->drawBackgroundSprite(-1, -1, 30);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 31);
+			_vm->_background->drawBackgroundSprite(-1, -1, 31);
 
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north.
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
@@ -671,50 +671,50 @@ void Animation::catacombMove(byte ped) {
 	case 0xd: // No connection + WINDOW
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 13);
+		_vm->_background->drawBackgroundSprite(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7);
+		_vm->_background->drawBackgroundSprite(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
 		_vm->_gyro->_magics[0]._operation = Gyro::kMagicNothing; // Door to Geida's room.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+		_vm->_background->drawBackgroundSprite(-1, -1, 0);
 		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 16);
+		_vm->_background->drawBackgroundSprite(-1, -1, 16);
 		break;     // [2,2] : "Art Gallery" sign over door.
 	case 264:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+		_vm->_background->drawBackgroundSprite(-1, -1, 8);
 		break;      // [8,1] : "The Wrong Way!" sign.
 	case 1797:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+		_vm->_background->drawBackgroundSprite(-1, -1, 1);
 		break;      // [5,7] : "Ite Mingite" sign.
 	case 258:
 		for (int i = 0; i <= 2; i++) { // [2,1] : Art gallery - pictures
-			_vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 14);
-			_vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 15);
+			_vm->_background->drawBackgroundSprite(130 + i * 120, 70, 14);
+			_vm->_background->drawBackgroundSprite(184 + i * 120, 78, 15);
 		}
 		break;
 	case 1287:
 		for (int i = 10; i <= 13; i++)
-			_vm->_celer->drawBackgroundSprite(-1, -1, i - 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, i - 1);
 		break; // [7,5] : 4 candles.
 	case 776:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 9);
+		_vm->_background->drawBackgroundSprite(-1, -1, 9);
 		break;     // [8,3] : 1 candle.
 	case 2049:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 10);
+		_vm->_background->drawBackgroundSprite(-1, -1, 10);
 		break;     // [1,8] : another candle.
 	case 257:
-		_vm->_celer->drawBackgroundSprite(-1, -1, 11);
-		_vm->_celer->drawBackgroundSprite(-1, -1, 12);
+		_vm->_background->drawBackgroundSprite(-1, -1, 11);
+		_vm->_background->drawBackgroundSprite(-1, -1, 12);
 		break; // [1,1] : the other two.
 	}
 
@@ -735,7 +735,7 @@ void Animation::dawnDelay() {
 void Animation::callSpecial(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+		_vm->_background->drawBackgroundSprite(-1, -1, 0);
 		_vm->_gyro->_brummieStairs = 1;
 		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
@@ -782,7 +782,7 @@ void Animation::callSpecial(uint16 which) {
 			_vm->_scrolls->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_scrolls->displayScrollChain('q', 36);
 			_vm->_gyro->_tiedUp = true;
 			_vm->_gyro->_friarWillTieYouUp = false;
@@ -1075,7 +1075,7 @@ void Animation::arrowProcs(byte tripnum) {
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door.
+		_vm->_background->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door.
 		_vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
@@ -1301,7 +1301,7 @@ void Animation::hideInCupboard() {
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
 		_vm->_scrolls->displayText(tmpStr);
 		_vm->_gyro->_avvysInTheCupboard = true;
-		_vm->_celer->drawBackgroundSprite(-1, -1, 7);
+		_vm->_background->drawBackgroundSprite(-1, -1, 7);
 	}
 }
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b363b8a..f9e8dfc 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -65,7 +65,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _pingo;
 	delete _scrolls;
 	delete _lucerna;
-	delete _celer;
+	delete _background;
 	delete _sequence;
 	delete _timer;
 	delete _animation;
@@ -85,7 +85,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_pingo = new Pingo(this);
 	_scrolls = new Scrolls(this);
 	_lucerna = new Lucerna(this);
-	_celer = new Celer(this);
+	_background = new Background(this);
 	_sequence = new Sequence(this);
 	_timer = new Timer(this);
 	_animation = new Animation(this);
@@ -440,7 +440,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		_lucerna->dawn();
 	}
 
-	_celer->forgetBackgroundSprites();
+	_background->forgetBackgroundSprites();
 	_lucerna->minorRedraw();
 	_menu->setup();
 	_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _gyro->_room;
@@ -450,7 +450,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_lucerna->drawDirection();
 	_gyro->_onToolbar = false;
 	_animation->animLink();
-	_celer->updateBackgroundSprites();
+	_background->updateBackgroundSprites();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
 		Scrolls::kControlItalic, Scrolls::kControlRoman, description.c_str(), Scrolls::kControlCenter, 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index c930fe7..739fcd0 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -38,7 +38,7 @@
 #include "avalanche/pingo.h"
 #include "avalanche/scrolls.h"
 #include "avalanche/lucerna.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
@@ -74,7 +74,7 @@ public:
 	Pingo *_pingo;
 	Scrolls *_scrolls;
 	Lucerna *_lucerna;
-	Celer *_celer;
+	Background *_background;
 	Sequence *_sequence;
 	Timer *_timer;
 	Animation *_animation;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 565d54c..f4d180e 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -38,7 +38,7 @@
 #include "avalanche/menu.h"
 #include "avalanche/pingo.h"
 #include "avalanche/timer.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/closing.h"
 
 #include "common/str.h"
@@ -174,7 +174,7 @@ void Avalot::run(Common::String arg) {
 
 		_vm->_lucerna->_clock.update();
 		_vm->_menu->update();
-		_vm->_celer->updateBackgroundSprites();
+		_vm->_background->updateBackgroundSprites();
 		_vm->_animation->animLink();
 		_vm->_lucerna->checkClick();
 		_vm->_timer->updateTimer();
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
new file mode 100644
index 0000000..34379491
--- /dev/null
+++ b/engines/avalanche/background.cpp
@@ -0,0 +1,385 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#include "avalanche/avalanche.h"
+
+#include "avalanche/background.h"
+#include "avalanche/animation.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/gyro.h"
+#include "avalanche/roomnums.h"
+
+#include "common/textconsole.h"
+
+namespace Avalanche {
+
+const int16 Background::kOnDisk = -1;
+
+Background::Background(AvalancheEngine *vm) {
+	_vm = vm;
+	_spriteNum = 0;
+}
+
+Background::~Background() {
+	forgetBackgroundSprites();
+}
+
+/**
+ * @remarks	Originally called 'pics_link'
+ */
+void Background::updateBackgroundSprites() {
+	if (_vm->_menu->isActive())
+		return; // No animation when the menus are up.
+
+	switch (_vm->_gyro->_room) {
+	case kRoomOutsideArgentPub:
+		if ((_vm->_gyro->_roomTime % 12) == 0)
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 4);
+		break;
+	case kRoomBrummieRoad:
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 2) % 4);
+		break;
+	case kRoomBridge:
+		if ((_vm->_gyro->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 3 + (_vm->_gyro->_roomTime / 2) % 4);
+		break;
+	case kRoomYours:
+		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 2);
+		break;
+	case kRoomArgentPub:
+		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
+			// Malagauche cycle.
+			_vm->_gyro->_malagauche += 1;
+			switch (_vm->_gyro->_malagauche) {
+			case 1:
+			case 11:
+			case 21:
+				drawBackgroundSprite(-1, -1, 11); // Looks forwards.
+				break;
+			case 8:
+			case 18:
+			case 28:
+			case 32:
+				drawBackgroundSprite(-1, -1, 10); // Looks at you.
+				break;
+			case 30:
+				drawBackgroundSprite(-1, -1, 12); // Winks.
+				break;
+			case 33:
+				_vm->_gyro->_malagauche = 0;
+				break;
+			}
+		}
+
+		switch (_vm->_gyro->_roomTime % 200) {
+		case 179:
+		case 197:
+			drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle.
+			break;
+		case 182:
+		case 194:
+			drawBackgroundSprite(-1, -1, 5);
+			break;
+		case 185:
+			drawBackgroundSprite(-1, -1, 6);
+			break;
+		case 199:
+			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
+			break;
+		}
+
+		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
+			byte direction = 0;
+			uint16 angle = _vm->_lucerna->bearing(1);
+			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
+				direction = 3;
+			else if ((angle >= 293) && (angle <= 357))
+				direction = 2;
+			else if ((angle >= 271) && (angle <= 292))
+				direction = 4;
+
+			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
+				drawBackgroundSprite(-1, -1, direction - 1);
+				_vm->_gyro->_npcFacing = direction;
+			}
+		}
+		break;
+	case kRoomWestHall:
+		if ((_vm->_gyro->_roomTime % 3) == 0) {
+			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
+			case 4:
+				drawBackgroundSprite(-1, -1, 0);
+				break;
+			case 1:
+			case 3:
+			case 5:
+				drawBackgroundSprite(-1, -1, 1);
+				break;
+			case 0:
+			case 2:
+				drawBackgroundSprite(-1, -1, 2);
+				break;
+			}
+		}
+		break;
+	case kRoomLustiesRoom:
+		if (!(_vm->_gyro->_lustieIsAsleep)) {
+			byte direction = 0;
+			uint16 angle = _vm->_lucerna->bearing(1);
+			if ((_vm->_gyro->_roomTime % 45) > 42)
+				direction = 4; // du Lustie blinks.
+			// Bearing of Avvy from du Lustie.
+			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+					direction = 1; // Middle.
+			else if ((angle >= 45) && (angle <= 180))
+					direction = 2; // Left.
+			else if ((angle >= 181) && (angle <= 314))
+				direction = 3; // Right.
+
+			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
+				drawBackgroundSprite(-1, -1, direction - 1);
+				_vm->_gyro->_npcFacing = direction;
+			}
+		}
+		break;
+	case kRoomAylesOffice:
+		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
+			switch ((_vm->_gyro->_roomTime / 14) % 2) {
+			case 0:
+				drawBackgroundSprite(-1, -1, 0);  // Frame 2: EGA.
+				break;
+			case 1:
+				drawBackgroundSprite(-1, -1, 2); // Frame 1: Natural.
+				break;
+			}
+		}
+		break;
+	case kRoomRobins:
+		if (_vm->_gyro->_tiedUp) {
+			switch (_vm->_gyro->_roomTime % 54) {
+			case 20:
+				drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks.
+				break;
+			case 23:
+				drawBackgroundSprite(-1, -1, 1); // Frame 1: Back to normal.
+				break;
+			}
+		}
+		break;
+	case kRoomNottsPub: {
+		// Bearing of Avvy from Port.
+		byte direction = 0;
+		uint16 angle = _vm->_lucerna->bearing(4);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+			direction = 2; // Middle.
+		else if ((angle >= 45) && (angle <= 180))
+			direction = 6; // Left.
+		else if ((angle >= 181) && (angle <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->_roomTime % 60) > 57)
+			direction--; // Blinks.
+
+		if (direction != _vm->_gyro->_npcFacing) { // Port.
+			drawBackgroundSprite(-1, -1, direction - 1);
+			_vm->_gyro->_npcFacing = direction;
+		}
+
+		switch (_vm->_gyro->_roomTime % 50) {
+		case 45 :
+			drawBackgroundSprite(-1, -1, 8); // Spurge blinks.
+			break;
+		case 49 :
+			drawBackgroundSprite(-1, -1, 9);
+			break;
+		}
+		break;
+	  }
+	case kRoomDucks: {
+		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
+			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 3) % 3);
+
+		// Bearing of Avvy from Duck.
+		byte direction = 0;
+		uint16 angle = _vm->_lucerna->bearing(1);
+		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
+			direction = 4; // Middle.
+		else if ((angle >= 45) && (angle <= 180))
+			direction = 6; // Left.
+		else if ((angle >= 181) && (angle <= 314))
+			direction = 8; // Right.
+
+		if ((_vm->_gyro->_roomTime % 45) > 42)
+			direction++; // Duck blinks.
+
+		if (direction != _vm->_gyro->_npcFacing) { // Duck.
+			drawBackgroundSprite(-1, -1, direction - 1);
+			_vm->_gyro->_npcFacing = direction;
+		}
+		break;
+	   }
+	}
+
+	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
+		// They're ringing the bells.
+		switch (_vm->_gyro->_roomTime % 4) {
+		case 1:
+			if (_vm->_gyro->_nextBell < 5)
+				_vm->_gyro->_nextBell = 12;
+			_vm->_gyro->_nextBell--;
+			// CHECKME: 2 is a guess. No length in the original? 
+			_vm->_sound->playNote(_vm->_gyro->kNotes[_vm->_gyro->_nextBell], 2);
+			break;
+		case 2:
+			_vm->_sound->stopSound();
+			break;
+		}
+	}
+}
+
+void Background::loadBackgroundSprites(byte number) {
+	Common::File f;
+	_filename = _filename.format("chunk%d.avd", number);
+	if (!f.open(_filename))
+		return; // We skip because some rooms don't have sprites in the background.
+
+	f.seek(44);
+	_spriteNum = f.readByte();
+	for (int i = 0; i < _spriteNum; i++)
+		_offsets[i] = f.readSint32LE();
+
+	for (int i = 0; i < _spriteNum; i++) {
+		f.seek(_offsets[i]);
+
+		SpriteType sprite;
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		bool natural = f.readByte();
+		bool memorize = f.readByte();
+
+		if (memorize) {
+			_sprites[i]._x = sprite._x;
+			_sprites[i]._xl = sprite._xl;
+			_sprites[i]._y = sprite._y;
+			_sprites[i]._yl = sprite._yl;
+			_sprites[i]._type = sprite._type;
+
+			if (natural) {
+				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
+				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
+				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+
+				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
+					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
+						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
+				}
+			} else {
+				_sprites[i]._size = sprite._size;
+				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
+			}
+		} else
+			_sprites[i]._x = kOnDisk;
+	}
+	f.close();
+}
+
+void Background::forgetBackgroundSprites() {
+	for (int i = 0; i < _spriteNum; i++) {
+		if (_sprites[i]._x > kOnDisk)
+			_sprites[i]._picture.free();
+	}
+}
+
+/**
+ * Draw background animation
+ * @remarks	Originally called 'show_one'
+ */
+void Background::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
+	if (_sprites[sprId]._x > kOnDisk) {
+		if (destX < 0) {
+			destX = _sprites[sprId]._x * 8;
+			destY = _sprites[sprId]._y;
+		}
+		drawSprite(destX, destY, _sprites[sprId]);
+	} else {
+		Common::File f;
+		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
+			return; // We skip because some rooms don't have sprites in the background.
+
+		f.seek(_offsets[sprId]);
+
+		SpriteType sprite;
+		sprite._type = PictureType(f.readByte());
+		sprite._x = f.readSint16LE();
+		sprite._y = f.readSint16LE();
+		sprite._xl = f.readSint16LE();
+		sprite._yl = f.readSint16LE();
+		sprite._size = f.readSint32LE();
+		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
+		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
+
+		if (destX < 0) {
+			destX = sprite._x * 8;
+			destY = sprite._y;
+		}
+		drawSprite(destX, destY, sprite);
+
+		sprite._picture.free();
+		f.close();
+	}
+}
+
+
+
+void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
+	_r._x1 = x;
+	_r._y1 = y;
+	_r._y2 = y + sprite._yl;
+
+	switch (sprite._type) {
+	case kNaturalImage: // Allow fallthrough on purpose.
+	case kBgi:
+		_r._x2 = x + sprite._xl + 1;
+		break;
+	case kEga:
+		_r._x2 = x + sprite._xl;
+		break;
+	}
+
+	// These pictures are practically parts of the background. -10 is for the drop-down menu.
+	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
+}
+
+} // End of namespace Avalanche.
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
new file mode 100644
index 0000000..18e47e7
--- /dev/null
+++ b/engines/avalanche/background.h
@@ -0,0 +1,81 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+/* CELER	The unit for updating the screen pics. */
+
+#ifndef AVALANCHE_CELER2_H
+#define AVALANCHE_CELER2_H
+
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "common/str.h"
+
+#include "graphics/surface.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Background {
+public:
+	Background(AvalancheEngine *vm);
+	~Background();
+
+	void updateBackgroundSprites();
+	void loadBackgroundSprites(byte number);
+	void forgetBackgroundSprites();
+
+	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
+	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
+	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
+	void drawBackgroundSprite(int16 destX, int16 destY, byte sprId);
+
+private:
+	enum PictureType {kEga, kBgi, kNaturalImage};
+
+	struct SpriteType {
+		PictureType _type;
+		int16 _x, _y;
+		int16 _xl, _yl;
+		int32 _size;
+		::Graphics::Surface _picture;
+	};
+
+	AvalancheEngine *_vm;
+
+	int32 _offsets[40];
+	byte _spriteNum;
+	SpriteType _sprites[40];
+	ByteField _r;
+	Common::String _filename;
+	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
+
+	void drawSprite(int16 x, int16 y, SpriteType &sprite);
+};
+
+} // End of namespace Avalanche.
+
+#endif // AVALANCHE_CELER2_H
diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp
deleted file mode 100644
index 0ebd846..0000000
--- a/engines/avalanche/celer.cpp
+++ /dev/null
@@ -1,385 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CELER	The unit for updating the screen pics. */
-
-#include "avalanche/avalanche.h"
-
-#include "avalanche/celer.h"
-#include "avalanche/animation.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
-#include "avalanche/roomnums.h"
-
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-const int16 Celer::kOnDisk = -1;
-
-Celer::Celer(AvalancheEngine *vm) {
-	_vm = vm;
-	_spriteNum = 0;
-}
-
-Celer::~Celer() {
-	forgetBackgroundSprites();
-}
-
-/**
- * @remarks	Originally called 'pics_link'
- */
-void Celer::updateBackgroundSprites() {
-	if (_vm->_menu->isActive())
-		return; // No animation when the menus are up.
-
-	switch (_vm->_gyro->_room) {
-	case kRoomOutsideArgentPub:
-		if ((_vm->_gyro->_roomTime % 12) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 4);
-		break;
-	case kRoomBrummieRoad:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 2) % 4);
-		break;
-	case kRoomBridge:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 3 + (_vm->_gyro->_roomTime / 2) % 4);
-		break;
-	case kRoomYours:
-		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 2);
-		break;
-	case kRoomArgentPub:
-		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
-			// Malagauche cycle.
-			_vm->_gyro->_malagauche += 1;
-			switch (_vm->_gyro->_malagauche) {
-			case 1:
-			case 11:
-			case 21:
-				drawBackgroundSprite(-1, -1, 11); // Looks forwards.
-				break;
-			case 8:
-			case 18:
-			case 28:
-			case 32:
-				drawBackgroundSprite(-1, -1, 10); // Looks at you.
-				break;
-			case 30:
-				drawBackgroundSprite(-1, -1, 12); // Winks.
-				break;
-			case 33:
-				_vm->_gyro->_malagauche = 0;
-				break;
-			}
-		}
-
-		switch (_vm->_gyro->_roomTime % 200) {
-		case 179:
-		case 197:
-			drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle.
-			break;
-		case 182:
-		case 194:
-			drawBackgroundSprite(-1, -1, 5);
-			break;
-		case 185:
-			drawBackgroundSprite(-1, -1, 6);
-			break;
-		case 199:
-			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
-			break;
-		}
-
-		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
-			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(1);
-			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
-				direction = 3;
-			else if ((angle >= 293) && (angle <= 357))
-				direction = 2;
-			else if ((angle >= 271) && (angle <= 292))
-				direction = 4;
-
-			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
-				drawBackgroundSprite(-1, -1, direction - 1);
-				_vm->_gyro->_npcFacing = direction;
-			}
-		}
-		break;
-	case kRoomWestHall:
-		if ((_vm->_gyro->_roomTime % 3) == 0) {
-			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
-			case 4:
-				drawBackgroundSprite(-1, -1, 0);
-				break;
-			case 1:
-			case 3:
-			case 5:
-				drawBackgroundSprite(-1, -1, 1);
-				break;
-			case 0:
-			case 2:
-				drawBackgroundSprite(-1, -1, 2);
-				break;
-			}
-		}
-		break;
-	case kRoomLustiesRoom:
-		if (!(_vm->_gyro->_lustieIsAsleep)) {
-			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(1);
-			if ((_vm->_gyro->_roomTime % 45) > 42)
-				direction = 4; // du Lustie blinks.
-			// Bearing of Avvy from du Lustie.
-			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-					direction = 1; // Middle.
-			else if ((angle >= 45) && (angle <= 180))
-					direction = 2; // Left.
-			else if ((angle >= 181) && (angle <= 314))
-				direction = 3; // Right.
-
-			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
-				drawBackgroundSprite(-1, -1, direction - 1);
-				_vm->_gyro->_npcFacing = direction;
-			}
-		}
-		break;
-	case kRoomAylesOffice:
-		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
-			switch ((_vm->_gyro->_roomTime / 14) % 2) {
-			case 0:
-				drawBackgroundSprite(-1, -1, 0);  // Frame 2: EGA.
-				break;
-			case 1:
-				drawBackgroundSprite(-1, -1, 2); // Frame 1: Natural.
-				break;
-			}
-		}
-		break;
-	case kRoomRobins:
-		if (_vm->_gyro->_tiedUp) {
-			switch (_vm->_gyro->_roomTime % 54) {
-			case 20:
-				drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks.
-				break;
-			case 23:
-				drawBackgroundSprite(-1, -1, 1); // Frame 1: Back to normal.
-				break;
-			}
-		}
-		break;
-	case kRoomNottsPub: {
-		// Bearing of Avvy from Port.
-		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(4);
-		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-			direction = 2; // Middle.
-		else if ((angle >= 45) && (angle <= 180))
-			direction = 6; // Left.
-		else if ((angle >= 181) && (angle <= 314))
-			direction = 8; // Right.
-
-		if ((_vm->_gyro->_roomTime % 60) > 57)
-			direction--; // Blinks.
-
-		if (direction != _vm->_gyro->_npcFacing) { // Port.
-			drawBackgroundSprite(-1, -1, direction - 1);
-			_vm->_gyro->_npcFacing = direction;
-		}
-
-		switch (_vm->_gyro->_roomTime % 50) {
-		case 45 :
-			drawBackgroundSprite(-1, -1, 8); // Spurge blinks.
-			break;
-		case 49 :
-			drawBackgroundSprite(-1, -1, 9);
-			break;
-		}
-		break;
-	  }
-	case kRoomDucks: {
-		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 3) % 3);
-
-		// Bearing of Avvy from Duck.
-		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(1);
-		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
-			direction = 4; // Middle.
-		else if ((angle >= 45) && (angle <= 180))
-			direction = 6; // Left.
-		else if ((angle >= 181) && (angle <= 314))
-			direction = 8; // Right.
-
-		if ((_vm->_gyro->_roomTime % 45) > 42)
-			direction++; // Duck blinks.
-
-		if (direction != _vm->_gyro->_npcFacing) { // Duck.
-			drawBackgroundSprite(-1, -1, direction - 1);
-			_vm->_gyro->_npcFacing = direction;
-		}
-		break;
-	   }
-	}
-
-	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
-		// They're ringing the bells.
-		switch (_vm->_gyro->_roomTime % 4) {
-		case 1:
-			if (_vm->_gyro->_nextBell < 5)
-				_vm->_gyro->_nextBell = 12;
-			_vm->_gyro->_nextBell--;
-			// CHECKME: 2 is a guess. No length in the original? 
-			_vm->_sound->playNote(_vm->_gyro->kNotes[_vm->_gyro->_nextBell], 2);
-			break;
-		case 2:
-			_vm->_sound->stopSound();
-			break;
-		}
-	}
-}
-
-void Celer::loadBackgroundSprites(byte number) {
-	Common::File f;
-	_filename = _filename.format("chunk%d.avd", number);
-	if (!f.open(_filename))
-		return; // We skip because some rooms don't have sprites in the background.
-
-	f.seek(44);
-	_spriteNum = f.readByte();
-	for (int i = 0; i < _spriteNum; i++)
-		_offsets[i] = f.readSint32LE();
-
-	for (int i = 0; i < _spriteNum; i++) {
-		f.seek(_offsets[i]);
-
-		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
-		sprite._x = f.readSint16LE();
-		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
-		sprite._size = f.readSint32LE();
-		bool natural = f.readByte();
-		bool memorize = f.readByte();
-
-		if (memorize) {
-			_sprites[i]._x = sprite._x;
-			_sprites[i]._xl = sprite._xl;
-			_sprites[i]._y = sprite._y;
-			_sprites[i]._yl = sprite._yl;
-			_sprites[i]._type = sprite._type;
-
-			if (natural) {
-				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
-				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
-				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
-
-				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
-					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
-						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
-				}
-			} else {
-				_sprites[i]._size = sprite._size;
-				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
-			}
-		} else
-			_sprites[i]._x = kOnDisk;
-	}
-	f.close();
-}
-
-void Celer::forgetBackgroundSprites() {
-	for (int i = 0; i < _spriteNum; i++) {
-		if (_sprites[i]._x > kOnDisk)
-			_sprites[i]._picture.free();
-	}
-}
-
-/**
- * Draw background animation
- * @remarks	Originally called 'show_one'
- */
-void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
-	if (_sprites[sprId]._x > kOnDisk) {
-		if (destX < 0) {
-			destX = _sprites[sprId]._x * 8;
-			destY = _sprites[sprId]._y;
-		}
-		drawSprite(destX, destY, _sprites[sprId]);
-	} else {
-		Common::File f;
-		if (!f.open(_filename)) // Filename was set in loadBackgroundSprites().
-			return; // We skip because some rooms don't have sprites in the background.
-
-		f.seek(_offsets[sprId]);
-
-		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
-		sprite._x = f.readSint16LE();
-		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
-		sprite._size = f.readSint32LE();
-		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
-		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
-
-		if (destX < 0) {
-			destX = sprite._x * 8;
-			destY = sprite._y;
-		}
-		drawSprite(destX, destY, sprite);
-
-		sprite._picture.free();
-		f.close();
-	}
-}
-
-
-
-void Celer::drawSprite(int16 x, int16 y, SpriteType &sprite) {
-	_r._x1 = x;
-	_r._y1 = y;
-	_r._y2 = y + sprite._yl;
-
-	switch (sprite._type) {
-	case kNaturalImage: // Allow fallthrough on purpose.
-	case kBgi:
-		_r._x2 = x + sprite._xl + 1;
-		break;
-	case kEga:
-		_r._x2 = x + sprite._xl;
-		break;
-	}
-
-	// These pictures are practically parts of the background. -10 is for the drop-down menu.
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h
deleted file mode 100644
index 538a765..0000000
--- a/engines/avalanche/celer.h
+++ /dev/null
@@ -1,81 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* CELER	The unit for updating the screen pics. */
-
-#ifndef AVALANCHE_CELER2_H
-#define AVALANCHE_CELER2_H
-
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "common/str.h"
-
-#include "graphics/surface.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Celer {
-public:
-	Celer(AvalancheEngine *vm);
-	~Celer();
-
-	void updateBackgroundSprites();
-	void loadBackgroundSprites(byte number);
-	void forgetBackgroundSprites();
-
-	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
-	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
-	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
-	void drawBackgroundSprite(int16 destX, int16 destY, byte sprId);
-
-private:
-	enum PictureType {kEga, kBgi, kNaturalImage};
-
-	struct SpriteType {
-		PictureType _type;
-		int16 _x, _y;
-		int16 _xl, _yl;
-		int32 _size;
-		::Graphics::Surface _picture;
-	};
-
-	AvalancheEngine *_vm;
-
-	int32 _offsets[40];
-	byte _spriteNum;
-	SpriteType _sprites[40];
-	ByteField _r;
-	Common::String _filename;
-	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
-
-	void drawSprite(int16 x, int16 y, SpriteType &sprite);
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_CELER2_H
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 2f38452..4143a43 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -34,7 +34,7 @@
 #include "avalanche/scrolls.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
 #include "avalanche/acci.h"
@@ -320,7 +320,7 @@ void Lucerna::loadRoom(byte num) {
 	file.close();
 
 	loadAlso(num);
-	_vm->_celer->loadBackgroundSprites(num);
+	_vm->_background->loadBackgroundSprites(num);
 	CursorMan.showMouse(true);
 }
 
@@ -341,7 +341,7 @@ void Lucerna::findPeople(byte room) {
 
 void Lucerna::exitRoom(byte x) {
 	_vm->_sound->stopSound();
-	_vm->_celer->forgetBackgroundSprites();
+	_vm->_background->forgetBackgroundSprites();
 	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
@@ -444,7 +444,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	switch (room) {
 	case kRoomYours:
 		if (_vm->_gyro->_avvyInBed) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
 		}
@@ -544,7 +544,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomBridge:
 		if (_vm->_gyro->_drawbridgeOpen == 4) { // open
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
+			_vm->_background->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
 			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
 		}
@@ -570,10 +570,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		}
 
 		if (_vm->_gyro->_tiedUp)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 
 		if (!_vm->_gyro->_mushroomGrowing)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break;
 
@@ -647,11 +647,11 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomArgentPub:
 		if (_vm->_gyro->_wonNim)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
 		_vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
 		if (_vm->_gyro->_givenBadgeToIby) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 7);
-			_vm->_celer->drawBackgroundSprite(-1, -1, 8);
+			_vm->_background->drawBackgroundSprite(-1, -1, 7);
+			_vm->_background->drawBackgroundSprite(-1, -1, 8);
 		}
 		_vm->_graphics->refreshBackground();
 		break;
@@ -667,7 +667,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 		if (_vm->_gyro->_geidaFollows) {
 			putGeidaAt(4, ped);
 			if (_vm->_gyro->_lustieIsAsleep) {
-				_vm->_celer->drawBackgroundSprite(-1, -1, 4);
+				_vm->_background->drawBackgroundSprite(-1, -1, 4);
 				_vm->_graphics->refreshBackground();
 			}
 		}
@@ -676,14 +676,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case kRoomMusicRoom:
 		if (_vm->_gyro->_jacquesState > 0) {
 			_vm->_gyro->_jacquesState = 5;
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+			_vm->_background->drawBackgroundSprite(-1, -1, 3);
 			_vm->_gyro->_magics[kColorBrown - 1]._operation = Gyro::kMagicNothing;
 			_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0;
 		}
 		if (ped != 0) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -694,7 +694,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomOutsideNottsPub:
 		if (ped == 2) {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->thenShow(2);
@@ -706,7 +706,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomOutsideArgentPub:
 		if (ped == 2)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -734,7 +734,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
 			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
-			_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(1);
 			if (_vm->_gyro->_arrowInTheDoor)
@@ -743,22 +743,22 @@ void Lucerna::enterRoom(byte room, byte ped) {
 				_vm->_sequence->thenShow(2);
 
 			if (_vm->_gyro->_takenPen)
-				_vm->_celer->drawBackgroundSprite(-1, -1, 3);
+				_vm->_background->drawBackgroundSprite(-1, -1, 3);
 
 			_vm->_sequence->startToClose();
 		} else {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);
 			if (_vm->_gyro->_arrowInTheDoor)
-				_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+				_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			else
-				_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+				_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case kRoomAvvysGarden:
 		if (ped == 1)  {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -779,7 +779,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			_vm->_sequence->start_to_close();
 #endif
 
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -790,7 +790,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomAylesOffice:
 		if (_vm->_gyro->_aylesIsAwake)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
 
@@ -811,14 +811,14 @@ void Lucerna::enterRoom(byte room, byte ped) {
 
 	case kRoomNottsPub:
 		if (_vm->_gyro->_sittingInPub)
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_npcFacing = 1; // Port.
 		break;
 
 	case kRoomOutsideDucks:
 		if (ped == 2) {
 			// Shut the door
-			_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->firstShow(2);
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 0fea70e..4c50329 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -11,7 +11,7 @@ MODULE_OBJS = \
 	pingo.o \
 	scrolls.o \
 	lucerna.o \
-	celer.o \
+	background.o \
 	sequence.o \
 	timer.o \
 	animation.o \
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 1b55e88..c3940cd 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -32,7 +32,7 @@
 #include "avalanche/sequence.h"
 #include "avalanche/gyro.h"
 #include "avalanche/timer.h"
-#include "avalanche/celer.h"
+#include "avalanche/background.h"
 #include "avalanche/animation.h"
 
 #include "common/scummsys.h"
@@ -98,7 +98,7 @@ void Sequence::callSequencer() {
 
 	if ((_seq[0] >= 1) && (_seq[0] <= 176)) {
 		// Show a frame.
-		_vm->_celer->drawBackgroundSprite(-1, -1, _seq[0] - 1);
+		_vm->_background->drawBackgroundSprite(-1, -1, _seq[0] - 1);
 		shoveLeft();
 	}
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index cbce6cb..59161e3 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -232,7 +232,7 @@ void Timer::loseTimer(byte which) {
 
 void Timer::openDrawbridge() {
 	_vm->_gyro->_drawbridgeOpen++;
-	_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 2);
+	_vm->_background->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 2);
 
 	if (_vm->_gyro->_drawbridgeOpen == 4)
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
@@ -274,7 +274,7 @@ void Timer::bang2() {
 void Timer::stairs() {
 	_vm->_sound->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
-	_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+	_vm->_background->drawBackgroundSprite(-1, -1, 1);
 	_vm->_gyro->_brummieStairs = 2;
 	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
 	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
@@ -393,17 +393,17 @@ void Timer::jacquesWakesUp() {
 
 	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
 	case 1 :
-		_vm->_celer->drawBackgroundSprite(-1, -1, 0); // Eyes open.
+		_vm->_background->drawBackgroundSprite(-1, -1, 0); // Eyes open.
 		_vm->_scrolls->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2); // But going through the door.
+		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
+		_vm->_background->drawBackgroundSprite(-1, -1, 2); // But going through the door.
 		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
-		_vm->_celer->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
+		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
+		_vm->_background->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
 		_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
@@ -433,7 +433,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
-	_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+	_vm->_background->drawBackgroundSprite(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 
@@ -449,7 +449,7 @@ void Timer::naughtyDuke2() {
 }
 
 void Timer::naughtyDuke3() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 0);
+	_vm->_background->drawBackgroundSprite(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 }
@@ -491,7 +491,7 @@ void Timer::jump() {
 		if (_vm->_gyro->_carryNum >= kCarryLimit)
 			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_celer->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
@@ -507,7 +507,7 @@ void Timer::crapulusSaysSpludOut() {
 }
 
 void Timer::buyDrinks() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
+	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
 	_vm->_scrolls->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
@@ -519,7 +519,7 @@ void Timer::buyDrinks() {
 }
 
 void Timer::buyWine() {
-	_vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
+	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
 	_vm->_scrolls->displayScrollChain('D', 50); // You buy the wine.
@@ -629,7 +629,7 @@ void Timer::avvySitDown() {
 	if (avvy->_homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
-		_vm->_celer->drawBackgroundSprite(-1, -1, 2);
+		_vm->_background->drawBackgroundSprite(-1, -1, 2);
 		_vm->_gyro->_sittingInPub = true;
 		_vm->_gyro->_userMovesAvvy = false;
 		avvy->_visible = false;


Commit: 31637f198333999a75e513267002819b1ee6e752
    https://github.com/scummvm/scummvm/commit/31637f198333999a75e513267002819b1ee6e752
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T12:21:53-07:00

Commit Message:
AVALANCHE: Cosmetic modifications.

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/background.h
    engines/avalanche/closing.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sound.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index e303d3b..3301d47 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -28,7 +28,6 @@
 /* ACCIDENCE II		The parser. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/acci.h"
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index c30104f..ed6f92f 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -28,7 +28,6 @@
 /* TRIP5	Trippancy V - the sprite animation subsystem */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/animation.h"
 #include "avalanche/scrolls.h"
 #include "avalanche/lucerna.h"
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 739fcd0..cd13cf5 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -29,10 +29,8 @@
 #define AVALANCHE_AVALANCHE_H
 
 #include "avalanche/console.h"
-
 #include "avalanche/graphics.h"
 #include "avalanche/parser.h"
-
 #include "avalanche/avalot.h"
 #include "avalanche/gyro.h"
 #include "avalanche/pingo.h"
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f4d180e..ac961a6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -45,12 +45,8 @@
 #include "common/textconsole.h"
 #include "common/config-manager.h"
 
-
-
 namespace Avalanche {
 
-
-
 Avalot::Avalot(AvalancheEngine *vm) {
 	_vm = vm;
 }
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 34379491..5f182bc 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -25,10 +25,9 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* CELER	The unit for updating the screen pics. */
+/* Original name: CELER		The unit for updating the screen pics. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/background.h"
 #include "avalanche/animation.h"
 #include "avalanche/lucerna.h"
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 18e47e7..915abb9 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* CELER	The unit for updating the screen pics. */
+/* Original name: CELER		The unit for updating the screen pics. */
 
 #ifndef AVALANCHE_CELER2_H
 #define AVALANCHE_CELER2_H
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 900000d..85d5fe0 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -28,7 +28,6 @@
 /* CLOSING		The closing screen and error handler. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/closing.h"
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
@@ -36,8 +35,6 @@
 #include "common/textconsole.h"
 #include "common/random.h"
 
-
-
 namespace Avalanche {
 
 Closing::Closing(AvalancheEngine *vm) {
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 6e34a5a..1b243d2 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -25,12 +25,14 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#include "engines/advancedDetector.h"
+#include "avalanche/avalanche.h"
+
 #include "common/system.h"
 #include "common/savefile.h"
-#include "graphics/thumbnail.h"
 
-#include "avalanche/avalanche.h"
+#include "engines/advancedDetector.h"
+
+#include "graphics/thumbnail.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 806ef3f..97624cf 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -25,8 +25,6 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-#include "math.h"
-
 #include "avalanche/avalanche.h"
 #include "avalanche/graphics.h"
 
@@ -37,6 +35,8 @@
 
 #include "graphics/palette.h"
 
+#include "math.h"
+
 namespace Avalanche {
 
 const byte Graphics::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 41b1016..7706c5f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -29,9 +29,9 @@
 #define AVALANCHE_GRAPHICS_H
 
 #include "common/file.h"
+#include "common/rect.h"
 
 #include "graphics/surface.h"
-#include "common/rect.h"
 
 namespace Avalanche {
 class AvalancheEngine;
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index c1ea6a2..9d4aa19 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -28,7 +28,6 @@
 /* GYRO		It all revolves around this bit! */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/gyro.h"
 #include "avalanche/pingo.h"
 #include "avalanche/scrolls.h"
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index f62c250..659d200 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -30,15 +30,15 @@
 #ifndef AVALANCHE_GYRO2_H
 #define AVALANCHE_GYRO2_H
 
+#include "avalanche/roomnums.h"
+#include "avalanche/color.h"
+
 #include "common/str.h"
 #include "common/scummsys.h"
 #include "common/file.h"
 
 #include "graphics/surface.h"
 
-#include "avalanche/roomnums.h"
-#include "avalanche/color.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 4143a43..3b30739 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -28,7 +28,6 @@
 /* LUCERNA		The screen, [keyboard] and mouse handler.*/
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
 #include "avalanche/scrolls.h"
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 2d899da..3e67a66 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
- /* DROPDOWN	A customised version of Oopmenu (qv). */
+/* Original name: DROPDOWN		A customised version of Oopmenu (qv). */
 
 #include "avalanche/avalanche.h"
 #include "avalanche/menu.h"
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index ad0821e..9a00a28 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -25,12 +25,13 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* DROPDOWN	A customised version of Oopmenu (qv). */
+/* Original name: DROPDOWN		A customised version of Oopmenu (qv). */
 
 #ifndef AVALANCHE_DROPDOWN2_H
 #define AVALANCHE_DROPDOWN2_H
 
 #include "avalanche/color.h"
+
 #include "common/scummsys.h"
 #include "common/str.h"
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index c3940cd..cb6bd06 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -28,7 +28,6 @@
 /* SEQUENCE		The sequencer. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/sequence.h"
 #include "avalanche/gyro.h"
 #include "avalanche/timer.h"
diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index 7ab94c7..dba679e 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -20,13 +20,14 @@
  *
  */
 
-#include "common/system.h"
-#include "common/config-manager.h"
 #include "audio/audiostream.h"
 
 #include "avalanche/avalanche.h"
 #include "avalanche/sound.h"
 
+#include "common/system.h"
+#include "common/config-manager.h"
+
 namespace Avalanche {
 
 SoundHandler::SoundHandler(AvalancheEngine *vm) : _vm(vm) {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 59161e3..b473e77 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -28,7 +28,6 @@
 /* Original name: TIMEOUT	The scheduling unit. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/timer.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/animation.h"


Commit: 16f5f32376dc6648c5ffb6ca461a45105f4f3435
    https://github.com/scummvm/scummvm/commit/16f5f32376dc6648c5ffb6ca461a45105f4f3435
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T13:45:03-07:00

Commit Message:
AVALANCHE: Repair Scrolls::musicalScroll() and Scrolls::store().

Changed paths:
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 8df4635..83656a3 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -190,7 +190,7 @@ void Scrolls::scrollModeDialogue() {
 }
 
 void Scrolls::store(byte what, TuneType &played) {
-	memcpy(played + 1, played + 2, sizeof(played) - 1);
+	memcpy(played, played + 1, sizeof(played) - 1);
 	played[30] = what;
 }
 
@@ -809,7 +809,9 @@ void Scrolls::musicalScroll() {
 	displayText(tmpStr);
 
 	_vm->_lucerna->spriteRun();
+	CursorMan.showMouse(false);
 	drawScroll(&Avalanche::Scrolls::scrollModeMusic);
+	CursorMan.showMouse(true);
 	resetScroll();
 }
 


Commit: 5ccff749a5d3bdbc3c9fac3023e5a336f4f8f2c1
    https://github.com/scummvm/scummvm/commit/5ccff749a5d3bdbc3c9fac3023e5a336f4f8f2c1
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T15:23:20-07:00

Commit Message:
AVALANCHE: Add minigame: playing the harp.

Changed paths:
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 9d4aa19..0754ae3 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -131,8 +131,6 @@ const QuasipedType Gyro::kQuasipeds[16] = {
 	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
 };
 
-const char Gyro::kMusicKeys[] = "QWERTYUIOP[]";
-
 const uint16 Gyro::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
 
 const TuneType Gyro::kTune = {
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 659d200..51b6c15 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -221,7 +221,6 @@ public:
 		kPitchHigher
 	};
 
-	static const char kMusicKeys[];
 	static const uint16 kNotes[12];
 
 	static const TuneType kTune;
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 83656a3..9e56170 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -131,7 +131,9 @@ void Scrolls::scrollModeNormal() {
 
 		_vm->getEvent(event);
 		if ((event.type == Common::EVENT_LBUTTONUP) ||
-			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS))))
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE)
+			|| (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH)
+			|| (event.kbd.keycode == Common::KEYCODE_PLUS))))
 			break;
 	}
 
@@ -208,30 +210,111 @@ bool Scrolls::theyMatch(TuneType &played) {
 void Scrolls::scrollModeMusic() {
 	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
-	CursorMan.showMouse(true);
+	CursorMan.showMouse(false);
 	_vm->_gyro->newMouse(3);
 
-	// Since there are no sounds in the game yet, it's pretty pointless to implement this function further.
-	// For now we act like the player just played the right tone.
-#if 0
-	if (they_match(played)) {
-#endif
-		_vm->_gyro->_scReturn = true;
-		CursorMan.showMouse(false);
-		setReadyLight(0);
-		_vm->_gyro->_seeScroll = false;
+	TuneType played;
+	for (int i = 0; i < sizeof(played); i++)
+		played[i] = 0;
+	byte lastOne = 0, thisOne = 0;
 
-		_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
-		warning("STUB: Scrolls::music_scroll()");
-		return;
-#if 0
-	}
+	_vm->_gyro->_seeScroll = true;
 
-	_vm->_gyro->screturn = false;
-	CursorMan.showMouse(false);
-	state(0);
-	_vm->_gyro->seescroll = false;
-#endif
+	::Graphics::Surface temp;
+	temp.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+
+	Common::Event event;
+	while (!_vm->shouldQuit()) {
+		_vm->_graphics->refreshScreen();
+
+		_vm->getEvent(event);
+
+		// When we stop playing?
+		if ((event.type == Common::EVENT_LBUTTONDOWN) ||
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)))) {
+				_vm->_graphics->_surface.copyFrom(temp);
+				temp.free();
+				_vm->_gyro->_seeScroll = false;
+				CursorMan.showMouse(true);
+				return;
+		}
+
+		// When we DO play:
+		if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_q)
+			|| (event.kbd.keycode == Common::KEYCODE_w) || (event.kbd.keycode == Common::KEYCODE_e)
+			|| (event.kbd.keycode == Common::KEYCODE_r) || (event.kbd.keycode == Common::KEYCODE_t)
+			|| (event.kbd.keycode == Common::KEYCODE_y) || (event.kbd.keycode == Common::KEYCODE_u)
+			|| (event.kbd.keycode == Common::KEYCODE_i) || (event.kbd.keycode == Common::KEYCODE_o)
+			|| (event.kbd.keycode == Common::KEYCODE_p) || (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET)
+			|| (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
+				byte value;
+				switch (event.kbd.keycode) {
+				case Common::KEYCODE_q:
+					value = 0;
+					break;
+				case Common::KEYCODE_w:
+					value = 1;
+					break;
+				case Common::KEYCODE_e:
+					value = 2;
+					break;
+				case Common::KEYCODE_r:
+					value = 3;
+					break;
+				case Common::KEYCODE_t:
+					value = 4;
+					break;
+				case Common::KEYCODE_y:
+					value = 5;
+					break;
+				case Common::KEYCODE_u:
+					value = 6;
+					break;
+				case Common::KEYCODE_i:
+					value = 7;
+					break;
+				case Common::KEYCODE_o:
+					value = 8;
+					break;
+				case Common::KEYCODE_p:
+					value = 9;
+					break;
+				case Common::KEYCODE_LEFTBRACKET:
+					value = 10;
+					break;
+				case Common::KEYCODE_RIGHTBRACKET:
+					value = 11;
+					break;
+				}
+
+				lastOne = thisOne;
+				thisOne = value;
+
+				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
+
+				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
+					if (thisOne < lastOne)
+						store(Gyro::kPitchLower, played);
+					else if (thisOne == lastOne)
+						store(Gyro::kPitchSame, played);
+					else
+						store(Gyro::kPitchHigher, played);
+				}
+				
+				if (theyMatch(played)) {
+					setReadyLight(0);
+					_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
+
+
+					_vm->_graphics->_surface.copyFrom(temp);
+					temp.free();
+					_vm->_gyro->_seeScroll = false;
+					CursorMan.showMouse(true);
+					return;
+				}
+		}
+	}
 }
 
 void Scrolls::resetScrollDriver() {


Commit: 207335d0f22ef821bd9c314ce13346ec6ff8b7c5
    https://github.com/scummvm/scummvm/commit/207335d0f22ef821bd9c314ce13346ec6ff8b7c5
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T15:56:41-07:00

Commit Message:
AVALANCHE: Repair minigame: Harp.

Changed paths:
    engines/avalanche/gyro.h
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 51b6c15..155feee 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -216,9 +216,10 @@ public:
 	static const QuasipedType kQuasipeds[16];
 
 	enum Pitch {
+		kPitchInvalid,
 		kPitchLower,
 		kPitchSame,
-		kPitchHigher
+		kPitchHigher,
 	};
 
 	static const uint16 kNotes[12];
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 9e56170..8936bfa 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -215,8 +215,8 @@ void Scrolls::scrollModeMusic() {
 
 	TuneType played;
 	for (int i = 0; i < sizeof(played); i++)
-		played[i] = 0;
-	byte lastOne = 0, thisOne = 0;
+		played[i] = Gyro::kPitchInvalid;
+	int8 lastOne = -1, thisOne = -1; // Invalid values.
 
 	_vm->_gyro->_seeScroll = true;
 


Commit: 4b84999a30670350faa7e950113dba309475f168
    https://github.com/scummvm/scummvm/commit/4b84999a30670350faa7e950113dba309475f168
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T16:20:31-07:00

Commit Message:
AVALANCHE: Another addition regarding the harp game.

Changed paths:
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 8936bfa..6a2cd8d 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -292,6 +292,7 @@ void Scrolls::scrollModeMusic() {
 				thisOne = value;
 
 				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
+				_vm->_system->delayMillis(500);
 
 				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
 					if (thisOne < lastOne)


Commit: 95b2e2724361b2bdfa2a8291c36a825893255e48
    https://github.com/scummvm/scummvm/commit/95b2e2724361b2bdfa2a8291c36a825893255e48
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-19T16:50:18-07:00

Commit Message:
AVALANCHE: A little revision of the harp minigame.

Changed paths:
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 6a2cd8d..2b8e114 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -233,21 +233,17 @@ void Scrolls::scrollModeMusic() {
 		// When we stop playing?
 		if ((event.type == Common::EVENT_LBUTTONDOWN) ||
 			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)))) {
-				_vm->_graphics->_surface.copyFrom(temp);
-				temp.free();
-				_vm->_gyro->_seeScroll = false;
-				CursorMan.showMouse(true);
-				return;
+				break;
 		}
 
 		// When we DO play:
-		if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_q)
-			|| (event.kbd.keycode == Common::KEYCODE_w) || (event.kbd.keycode == Common::KEYCODE_e)
-			|| (event.kbd.keycode == Common::KEYCODE_r) || (event.kbd.keycode == Common::KEYCODE_t)
-			|| (event.kbd.keycode == Common::KEYCODE_y) || (event.kbd.keycode == Common::KEYCODE_u)
-			|| (event.kbd.keycode == Common::KEYCODE_i) || (event.kbd.keycode == Common::KEYCODE_o)
-			|| (event.kbd.keycode == Common::KEYCODE_p) || (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET)
-			|| (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
+		if ((event.type == Common::EVENT_KEYDOWN)
+			&& ((event.kbd.keycode == Common::KEYCODE_q) || (event.kbd.keycode == Common::KEYCODE_w)
+			|| (event.kbd.keycode == Common::KEYCODE_e) || (event.kbd.keycode == Common::KEYCODE_r)
+			|| (event.kbd.keycode == Common::KEYCODE_t) || (event.kbd.keycode == Common::KEYCODE_y)
+			|| (event.kbd.keycode == Common::KEYCODE_u) || (event.kbd.keycode == Common::KEYCODE_i)
+			|| (event.kbd.keycode == Common::KEYCODE_o) || (event.kbd.keycode == Common::KEYCODE_p)
+			|| (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET) || (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
 				byte value;
 				switch (event.kbd.keycode) {
 				case Common::KEYCODE_q:
@@ -292,7 +288,7 @@ void Scrolls::scrollModeMusic() {
 				thisOne = value;
 
 				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
-				_vm->_system->delayMillis(500);
+				_vm->_system->delayMillis(200);
 
 				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
 					if (thisOne < lastOne)
@@ -306,16 +302,15 @@ void Scrolls::scrollModeMusic() {
 				if (theyMatch(played)) {
 					setReadyLight(0);
 					_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
-
-
-					_vm->_graphics->_surface.copyFrom(temp);
-					temp.free();
-					_vm->_gyro->_seeScroll = false;
-					CursorMan.showMouse(true);
-					return;
+					break;
 				}
 		}
 	}
+
+	_vm->_graphics->_surface.copyFrom(temp);
+	temp.free();
+	_vm->_gyro->_seeScroll = false;
+	CursorMan.showMouse(true);
 }
 
 void Scrolls::resetScrollDriver() {


Commit: f78de9b382c916f194fe89d2c44cf0139fba1fc8
    https://github.com/scummvm/scummvm/commit/f78de9b382c916f194fe89d2c44cf0139fba1fc8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:02:18-07:00

Commit Message:
AVALANCHE: Add check on shouldQuit() in Harp mini-game

Changed paths:
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 2b8e114..67c8fbd 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -130,7 +130,8 @@ void Scrolls::scrollModeNormal() {
 		_vm->_graphics->refreshScreen();
 
 		_vm->getEvent(event);
-		if ((event.type == Common::EVENT_LBUTTONUP) ||
+		if (_vm->shouldQuit() || 
+			(event.type == Common::EVENT_LBUTTONUP) ||
 			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE)
 			|| (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH)
 			|| (event.kbd.keycode == Common::KEYCODE_PLUS))))


Commit: bb58813eeec71104e770867533e55940d6262de9
    https://github.com/scummvm/scummvm/commit/bb58813eeec71104e770867533e55940d6262de9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:09:31-07:00

Commit Message:
AVALANCHE: Remove code used for Demo

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/gyro.h
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f9e8dfc..b7fa2ac 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -621,26 +621,11 @@ Common::String AvalancheEngine::elmToStr(Elm how) {
 	}
 }
 
-// Getting used only in demo() / call_menu(). Going to be implemented at the same time with these.
-bool AvalancheEngine::keyPressed() {
-	warning("STUB: keyPressed()");
-	return false;
-}
-
 // Same as keypressed1().
 void AvalancheEngine::flushBuffer() {
 	warning("STUB: flushBuffer()");
 }
 
-// Same as keypressed1().
-void AvalancheEngine::demo() {
-	warning("STUB: demo()");
-}
-
-void AvalancheEngine::runDemo() {
-	warning("STUB: runDemo()");
-}
-
 void AvalancheEngine::dosShell() {
 	warning("STUB: dosShell()");
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index cd13cf5..90f3436 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -147,7 +147,7 @@ private:
 	// From bootstrp:
 	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
 
-	Common::String _demoArgs, _argsWithNoFilename;
+	Common::String _argsWithNoFilename;
 	byte _originalMode;
 	byte *_old1c;
 	Common::String _segofs;
@@ -158,8 +158,6 @@ private:
 	Common::String elmToStr(Elm how);
 	bool keyPressed();
 	void flushBuffer();
-	void demo();
-	void runDemo();
 	void dosShell();
 	void bFlight();
 	Common::String commandCom();
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 155feee..a50fa15 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -76,11 +76,6 @@ public:
 	byte _color;
 };
 
-struct DemoType {
-	uint16 _delay;
-	char _key, _extd;
-};
-
 typedef byte TuneType[31];
 
 struct QuasipedType {
@@ -351,11 +346,6 @@ public:
 	byte _him, _her, _it;
 	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
-	// For the demo:
-	DemoType _demoRec;
-	Common::File _demoFile; // of demo_type
-	Common::DumpFile _demoFileSave; // uruk added it - first use located in constructor of Basher
-
 	byte _lastPerson; // Last person to have been selected using the People menu.
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 67c8fbd..fdcf520 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -151,12 +151,7 @@ void Scrolls::scrollModeNormal() {
 
 //#ifdef RECORD slowdown(); basher::count += 1; #endif
 
-			if (_vm->_gyro->demo) {
-				if (_vm->_basher->demo_ready())
-					break;
-				if (_vm->_enhanced->keypressede())
-					return;
-			} else if (_vm->_enhanced->keypressede())
+			if (_vm->_enhanced->keypressede())
 				break;
 		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
 


Commit: f88ca9dc81e81a03c476d0224422a42d7d30e225
    https://github.com/scummvm/scummvm/commit/f88ca9dc81e81a03c476d0224422a42d7d30e225
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:35:50-07:00

Commit Message:
AVALANCHE: Remove misc dead or useless code: useless arguments, stubbed ini file reading, etc

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b7fa2ac..7d216fa 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -519,63 +519,15 @@ Common::Point AvalancheEngine::getMousePos() {
 	return _eventMan->getMousePos();
 }
 
-// From Bootstrp:
-const char AvalancheEngine::kRuncodes[2][3] = {"et", "Go"};
-
-void AvalancheEngine::bFlightOn() {
-	_storage._skellern = kReset;
-	// setintvec(0x1c, &b_flight);
-}
-
-void AvalancheEngine::getArguments() {
-	// This function should mess around with command line arguments,
-	// but I am not sure if there'll be use of these arguments at all...
-	warning("STUB: getArguments()");
-}
-
-void AvalancheEngine::getSlope() {
-	// Same as get_arguments()
-	warning("STUB: getSlope()");
-}
-
-void AvalancheEngine::callMenu() {
-	warning("STUB: callMenu()");
-}
-
-void AvalancheEngine::runAvalot() {
-	bFlightOn();
-
-	_avalot->run(Common::String(kRuncodes[_firstTime]) + _arguments);
-	// TODO: Check if parameters are ever used (probably not) and eventually remove them.
-	// If there's an error initializing avalot, i'll handle it in there, not here
-
-	_firstTime = false;
-}
-
 Common::Error AvalancheEngine::run() {
 	Common::ErrorCode err = initialize();
 	if (err != Common::kNoError)
 		return err;
 
-	// From bootstrp:
-	_firstTime = true;
-
-	getArguments();
-	getSlope();
-
-	_zoomy = true;
-	// Don't call the menu by default. Might be modified later, if get_slope() gets implemented,
-	// because zoomy's value is given there. Not sure yet what "zoomy" stands for.
-	if (!_zoomy)
-		callMenu();    // Not run when zoomy.
-
 	do {
-		runAvalot();
+		_avalot->runAvalot();
 
 		// Needed for later implementation!!! Don't remove these comments!!!
-
-		//if (dosexitcode != 77)  quit(); // Didn't stop for us.
-
 		//switch (_storage._operation) {
 		//case kRunShootemup:
 		//	run("seu.avx", kJsb, kBflight, kNormal);
@@ -602,6 +554,11 @@ void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, E
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 }
 
+void AvalancheEngine::bFlightOn() {
+	_storage._skellern = kReset;
+	// setintvec(0x1c, &b_flight);
+}
+
 void AvalancheEngine::bFlightOff() {
 	// setintvec(0x1c, old_1c);
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 90f3436..16482c8 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -122,28 +122,18 @@ private:
 	AvalancheConsole *_console;
 	Common::Platform _platform;
 
-	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
-	static const char kRuncodes[2][3];
-	static const int16 kReset = 0;
-	static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false;
-
+#if 0
 	struct {
 		byte _operation;
 		uint16 _skellern;
 		byte _contents[1000];
 	} _storage;
 
-	Common::String _arguments;
-	bool _firstTime;
-	bool _zoomy;
+	static const int16 kRunShootemup = 1, kRunDosshell = 2, kRunGhostroom = 3, kRunGolden = 4;
+	static const int16 kReset = 0;
 
-	void bFlightOn();
-	void getArguments();
-	void getSlope();
-	void callMenu();
-	void runAvalot();
+	static const bool kJsb = true, kNoJsb = false, kBflight = true, kNoBflight = false;
 
-#if 0
 	// From bootstrp:
 	enum Elm {kNormal, kMusical, kElmpoyten, kRegi};
 
@@ -152,8 +142,10 @@ private:
 	byte *_old1c;
 	Common::String _segofs;
 	int32 _soundcard, _speed, _baseaddr, _irq, _dma;
+	bool _zoomy;
 
 	void run(Common::String what, bool withJsb, bool withBflight, Elm how);
+	void bFlightOn();
 	void bFlightOff();
 	Common::String elmToStr(Elm how);
 	bool keyPressed();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ac961a6..dbc38be 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -160,7 +160,7 @@ void Avalot::setup() {
 	}
 }
 
-void Avalot::run(Common::String arg) {
+void Avalot::runAvalot() {
 	setup();
 
 	do {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 34a9d9f..1f20466 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -42,7 +42,7 @@ public:
 
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 	void setup();
-	void run(Common::String arg);
+	void runAvalot();
 
 private:
 	AvalancheEngine *_vm;


Commit: b11bf988f49c889650b9ab9ce1c0edd12c9f9d0f
    https://github.com/scummvm/scummvm/commit/b11bf988f49c889650b9ab9ce1c0edd12c9f9d0f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:46:39-07:00

Commit Message:
AVALANCHE: Remove roomnums.h

Changed paths:
  R engines/avalanche/roomnums.h
    engines/avalanche/background.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 5f182bc..d9f606b 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/animation.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
-#include "avalanche/roomnums.h"
 
 #include "common/textconsole.h"
 
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index a50fa15..6bd2040 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -30,7 +30,6 @@
 #ifndef AVALANCHE_GYRO2_H
 #define AVALANCHE_GYRO2_H
 
-#include "avalanche/roomnums.h"
 #include "avalanche/color.h"
 
 #include "common/str.h"
@@ -42,6 +41,19 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+// CHECKME: kRoomBossKey is a guess
+enum Room {
+	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
+	kRoomYourHall = 5,      kRoomMusicRoom = 7,    kRoomOutsideArgentPub = 9,      kRoomArgentRoad = 10,
+	kRoomWiseWomans = 11,   kRoomSpludwicks = 12,  kRoomInsideAbbey = 13,          kRoomOutsideAbbey = 14,
+	kRoomAvvysGarden = 15,  kRoomAylesOffice = 16, kRoomArgentPub = 19,            kRoomBrummieRoad = 20,
+	kRoomBridge = 21,       kRoomLusties = 22,     kRoomLustiesRoom = 23,          kRoomWestHall = 25,
+	kRoomEastHall = 26,     kRoomOubliette = 27,   kRoomGeidas = 28,               kRoomCatacombs = 29,
+	kRoomEntranceHall = 40, kRoomRobins = 42,      kRoomOutsideNottsPub = 46,      kRoomNottsPub = 47,
+	kRoomOutsideDucks = 50, kRoomDucks = 51,       kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71,
+	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
+};
+
 static const byte kObjectNum = 18; // always preface with a #
 static const int16 kCarryLimit = 12;  // carry limit
 
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 3b30739..b50a516 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -37,7 +37,6 @@
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
 #include "avalanche/acci.h"
-#include "avalanche/roomnums.h"
 
 #include "common/rect.h"
 #include "common/system.h"
diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h
deleted file mode 100644
index a963468..0000000
--- a/engines/avalanche/roomnums.h
+++ /dev/null
@@ -1,75 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-#ifndef AVALANCHE_ROOMNUMS_H
-#define AVALANCHE_ROOMNUMS_H
-
-#include "common/system.h"
-
-namespace Avalanche {
-
-enum Room {
-	kRoomNowhere = 0,
-	kRoomYours = 1,
-	kRoomOutsideYours = 2,
-	kRoomOutsideSpludwicks = 3,
-	kRoomYourHall = 5,
-	kRoomMusicRoom = 7,
-	kRoomOutsideArgentPub = 9,
-	kRoomArgentRoad = 10,
-	kRoomWiseWomans = 11,
-	kRoomSpludwicks = 12,
-	kRoomInsideAbbey = 13,
-	kRoomOutsideAbbey = 14,
-	kRoomAvvysGarden = 15,
-	kRoomAylesOffice = 16,
-	kRoomArgentPub = 19,
-	kRoomBrummieRoad = 20,
-	kRoomBridge = 21, 
-	kRoomLusties = 22,
-	kRoomLustiesRoom = 23,
-	kRoomWestHall = 25,
-	kRoomEastHall = 26,
-	kRoomOubliette = 27,
-	kRoomGeidas = 28,
-	kRoomCatacombs = 29,
-	kRoomEntranceHall = 40,
-	kRoomRobins = 42,
-	kRoomOutsideNottsPub = 46,
-	kRoomNottsPub = 47,
-	kRoomOutsideDucks = 50,
-	kRoomDucks = 51,
-	kRoomOutsideCardiffCastle = 70,
-	kRoomInsideCardiffCastle = 71,
-	kRoomBossKey = 98, // assumed
-	kRoomMap = 99,
-	kRoomDummy = 177 // Dummy room
-};
-
-} // End of namespace Avalanche
-
-#endif // AVALANCHE_ROOMNUMS_H


Commit: a7bb292cbaa32fed01e65ea24ead472572a72f5e
    https://github.com/scummvm/scummvm/commit/a7bb292cbaa32fed01e65ea24ead472572a72f5e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:52:18-07:00

Commit Message:
AVALANCHE: Remove color.h

Changed paths:
  R engines/avalanche/color.h
    engines/avalanche/gyro.h
    engines/avalanche/menu.h



diff --git a/engines/avalanche/color.h b/engines/avalanche/color.h
deleted file mode 100644
index e9f9c46..0000000
--- a/engines/avalanche/color.h
+++ /dev/null
@@ -1,58 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-// Color constants replacing the colors from the CRT unit of Pascal
-
-#ifndef AVALANCHE_COLOR_H
-#define AVALANCHE_COLOR_H
-
-#include "common/system.h"
-
-namespace Avalanche {
-
-enum Color {
-	kColorBlack,
-	kColorBlue,
-	kColorGreen,
-	kColorCyan,
-	kColorRed,
-	kColorMagenta,
-	kColorBrown,
-	kColorLightgray,
-	kColorDarkgray,
-	kColorLightblue,
-	kColorLightgreen,
-	kColorLightcyan,
-	kColorLightred,
-	kColorLightmagenta,
-	kColorYellow,
-	kColorWhite
-};
-
-} // End of namespace Avalanche
-
-#endif // AVALANCHE_COLOR_H
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 6bd2040..43809be 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -30,8 +30,6 @@
 #ifndef AVALANCHE_GYRO2_H
 #define AVALANCHE_GYRO2_H
 
-#include "avalanche/color.h"
-
 #include "common/str.h"
 #include "common/scummsys.h"
 #include "common/file.h"
@@ -41,6 +39,13 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+enum Color {
+	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
+	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
+	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
+	kColorWhite
+};
+
 // CHECKME: kRoomBossKey is a guess
 enum Room {
 	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index 9a00a28..5f9c896 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -30,8 +30,6 @@
 #ifndef AVALANCHE_DROPDOWN2_H
 #define AVALANCHE_DROPDOWN2_H
 
-#include "avalanche/color.h"
-
 #include "common/scummsys.h"
 #include "common/str.h"
 


Commit: 6943fcfb031d21823a2ca4a93b80159bd516e586
    https://github.com/scummvm/scummvm/commit/6943fcfb031d21823a2ca4a93b80159bd516e586
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-19T22:55:10-07:00

Commit Message:
AVALANCHE: Janitorial - leftover Bristish -> American English

Changed paths:
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 3e67a66..2a537eb 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* Original name: DROPDOWN		A customised version of Oopmenu (qv). */
+/* Original name: DROPDOWN		A customized version of Oopmenu (qv). */
 
 #include "avalanche/avalanche.h"
 #include "avalanche/menu.h"
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index 5f9c896..35acbbe 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -25,7 +25,7 @@
  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
  */
 
-/* Original name: DROPDOWN		A customised version of Oopmenu (qv). */
+/* Original name: DROPDOWN		A customized version of Oopmenu (qv). */
 
 #ifndef AVALANCHE_DROPDOWN2_H
 #define AVALANCHE_DROPDOWN2_H


Commit: 2b6364674093a4bbb2bc0865bc3db748f7436784
    https://github.com/scummvm/scummvm/commit/2b6364674093a4bbb2bc0865bc3db748f7436784
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-20T14:09:43-07:00

Commit Message:
AVALANCHE: Remove some useless/dead code

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index ed6f92f..e2f7721 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -248,9 +248,7 @@ void AnimationType::bounce() {
 		_anim->stopWalking();
 	else
 		stopWalk();
-	_anim->_vm->_gyro->_onCanDoPageSwap = false;
 	_anim->_vm->_lucerna->drawDirection();
-	_anim->_vm->_gyro->_onCanDoPageSwap = true;
 }
 
 int8 AnimationType::getSign(int16 val) {
@@ -375,7 +373,6 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	// if not alive then begin checkfeet:=0; exit; end;
 	byte a = 0;
 
-	//setactivepage(2);
 	if (x1 < 0)
 		x1 = 0;
 	if (x2 > 639)
@@ -398,7 +395,6 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 		}
 	}
 
-	//setactivepage(1 - cp);
 	return a;
 }
 
@@ -950,8 +946,6 @@ void Animation::updateSpeed() {
 
 	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
 
-	//setactivepage(3);
-
 	if (_sprites[0]._speedX == _vm->_gyro->kRun)
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
@@ -961,8 +955,6 @@ void Animation::updateSpeed() {
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
-
-	//setactivepage(1 - cp);
 }
 
 void Animation::changeDirection(byte t, byte dir) {
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 0754ae3..e338ecd 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -166,7 +166,7 @@ byte Gyro::_whereIs[29] = {
 	kRoomWiseWomans  // The Wise Woman.
 };
 
-Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
+Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0) {
 	_vm = vm;
 
 	// Needed because of Lucerna::load_also()
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 43809be..16d7df2 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -235,21 +235,13 @@ public:
 	};
 
 	static const uint16 kNotes[12];
-
 	static const TuneType kTune;
 
-
-
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 	byte _interrogation;
-
 	static byte _whereIs[29];
 
-	// Variable static constant for overriding the ability of On to switch pages.
-	// You may know better than On which page to switch to.
-	bool _onCanDoPageSwap;
-
 	// Former DNA structure
 	byte _carryNum; // How many objects you're carrying...
 	bool _objects[kObjectNum]; // ...and which ones they are.
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index b50a516..98a9775 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -605,10 +605,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	case kRoomMap:
 		// You're entering the map.
 		dawn();
-		//setactivepage(cp);
 		if (ped > 0)
 			zoomOut(_vm->_gyro->_peds[ped]._x, _vm->_gyro->_peds[ped]._y);
-		//setactivepage(1 - cp);
 
 		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
 			_vm->_scrolls->displayScrollChain('q', 9); // Don't want to waste the wine!
@@ -867,9 +865,7 @@ void Lucerna::thinkAbout(byte object, bool type) {
 	CursorMan.showMouse(false);
 
 #if 0
-	setactivepage(3);
 	putimage(x, y, p, 0);
-	setactivepage(1 - cp);
 #endif
 
 	CursorMan.showMouse(true);
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 2a537eb..4be9573 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -123,8 +123,6 @@ void MenuItem::displayOption(byte y, bool highlit) {
 
 void MenuItem::display() {
 	CursorMan.showMouse(false);
-	//setactivepage(cp);
-	//setvisualpage(cp);
 	//setfillstyle(1, menu_b);
 	//setcolor(menu_border);
 	_firstlix = true;
@@ -143,12 +141,11 @@ void MenuItem::display() {
 
 	_dr->_vm->_gyro->_defaultLed = 1;
 	_dr->_vm->_gyro->_currentMouse = 177;
-	//mousepage(cp);
+
 	CursorMan.showMouse(true); // 4 = fletch
 }
 
 void MenuItem::wipe() {
-	//setactivepage(cp);
 	CursorMan.showMouse(false);
 
 	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
@@ -168,11 +165,9 @@ void MenuItem::moveHighlight(int8 inc) {
 			return;
 		_highlightNum = highlightNum;
 	}
-	//setactivepage(cp);
 	CursorMan.showMouse(false);
 	displayOption(_oldY, false);
 	displayOption(_highlightNum, true);
-	//setactivepage(1 - cp);
 	_oldY = _highlightNum;
 	CursorMan.showMouse(true);
 }
@@ -225,8 +220,6 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Menu
 }
 
 void MenuBar::draw() {
-	//setactivepage(3);
-
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
 	byte savecp = _dr->_vm->_gyro->_cp;
@@ -703,7 +696,6 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 			_vm->updateEvents();
 		while (_vm->_lucerna->_holdLeftMouse);
 
-
 		while (!_vm->shouldQuit()) {
 			do {
 				_vm->updateEvents();
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 8fa1ef0..0e6ec52 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -57,7 +57,7 @@ const
 var fv:byte; gd,gm:int16; r:char;
 begin;
 	dusk; delavvy;
-	setactivepage(3); mousepage(3); setvisualpage(3); off;
+	off;
 	cleardevice; setfillstyle(xhatchfill,11);
 	settextstyle(1,0,4); settextjustify(1,1);
 	dplot(320,10,title);
@@ -78,7 +78,7 @@ begin;
 	newpointer(6); { TTHand }
 	dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
 	while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
-	dusk; setvisualpage(0); setactivepage(0); mousepage(0); dawn;
+	dusk; dawn;
 	copy02;
 #endif
 
@@ -126,11 +126,8 @@ void Pingo::winningPic() {
 	}
 #endif
 
-	warning("STUB: Pingo::winningPic()");
-
 	f.close();
 
-	//setvisualpage(0);
 	warning("STUB: Pingo::winningPic()");
 
 	_vm->_lucerna->dawn();
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index fdcf520..b2a81a7 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -378,14 +378,9 @@ void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 }
 
 void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
-	int16 ex;
-
-	//setvisualpage(cp);
-	//setactivepage(1 - cp);
-	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
-
 	int16 lx = 0;
 	int16 ly = (_vm->_gyro->_scrollNum) * 6;
+	int16 ex;
 	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		ex = _vm->_gyro->_scroll[i].size() * 8;
 		if (lx < ex)
@@ -489,7 +484,6 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	}
 
 	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
-	//setvisualpage(1 - cp);
 	ringBell();
 	//my = getpixel(0, 0);
 	_vm->_gyro->_dropsOk = false;
@@ -499,13 +493,10 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 
 	unDodgem();
 	_vm->_gyro->_dropsOk = true;
-	//setvisualpage(cp);
-	//mousepage(cp);
 	CursorMan.showMouse(false);
 	// mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);
 	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
 	//blitfix();
-	_vm->_gyro->_onCanDoPageSwap = true; // Normality again.
 	CursorMan.showMouse(true);
 	//settextjustify(0, 0); // sink
 	resetScrollDriver();
@@ -518,15 +509,8 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	Common::Point points[3];
 //	byte *rp1, *rp2; // replace: 1=bubble, 2=pointer
-	int16 xc; // x correction
-
-	//setvisualpage(cp);
-	//setactivepage(1 - cp);
-	_vm->_gyro->_onCanDoPageSwap = false;  // On can now no longer swap pages. So we can do what we want without its interference!
-	//mousepage(1 - cp); // Mousepage
 
 	CursorMan.showMouse(false);
-
 	int16 xl = 0;
 	int16 yl = _vm->_gyro->_scrollNum * 5;
 	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
@@ -539,7 +523,7 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	int16 xw = xl + 18;
 	int16 yw = yl + 7;
 	int16 my = yw * 2 - 2;
-	xc = 0;
+	int16 xc = 0;
 
 	if ((_vm->_gyro->_talkX - xw) < 0)
 		xc = -(_vm->_gyro->_talkX - xw);
@@ -585,9 +569,7 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
 	}
 
-	//setvisualpage(1 - cp);
 	ringBell();
-	_vm->_gyro->_onCanDoPageSwap = false;
 	CursorMan.showMouse(true);
 	_vm->_gyro->_dropsOk = false;
 
@@ -597,12 +579,13 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	CursorMan.showMouse(false);
 	_vm->_gyro->_dropsOk = true;
 
-	//setvisualpage(cp);
 	CursorMan.showMouse(true); // sink;
-	_vm->_gyro->_onCanDoPageSwap = true;
 	resetScrollDriver();
-	/*if (_vm->_gyro->mpress > 0)
-	_vm->_gyro->after_the_scroll = true;*/
+
+#if 0
+	if (_vm->_gyro->mpress > 0)
+		_vm->_gyro->after_the_scroll = true;
+#endif
 }
 
 bool Scrolls::displayQuestion(Common::String question) {


Commit: c7f888de7c903a959df29440594888bc9caed4b7
    https://github.com/scummvm/scummvm/commit/c7f888de7c903a959df29440594888bc9caed4b7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-20T14:19:30-07:00

Commit Message:
AVALANCHE: Remove remaining off and on calls in commented code

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h
    engines/avalanche/pingo.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index e2f7721..90966c4 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -103,7 +103,7 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	}
 	_animCount++;
 
-	// on;
+	CursorMan.showMouse(true);
 	_x = 0;
 	_y = 0;
 	_quick = true;
@@ -1051,13 +1051,13 @@ void Animation::arrowProcs(byte tripnum) {
 #if 0
 			tr[1].done; { Deallocate normal pic of Avvy. }
 
-			off;
+			CursorMan.showMouse(false);
 			for byte fv:=0 to 1 do
 			begin
 			cp:=1-cp;
 			getback;
 			end;
-			on;
+			CursorMan.showMouse(true);
 #endif
 			_vm->_lucerna->gameOver();
 
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 4be9573..701435e 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -38,37 +38,37 @@
 
 namespace Avalanche {
 
-void HeadType::init(char trig, char altTrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *dr) {
+void HeadType::init(char trig, char altTrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *menu) {
 	_trigger = trig;
 	_altTrigger = altTrig;
 	_title = title;
 	_position = pos;
-	_xpos = _position * _dr->kSpacing + _dr->kIndent;
-	_xright = (_position + 1) * _dr->kSpacing + _dr->kIndent;
+	_xpos = _position * _menu->kSpacing + _menu->kIndent;
+	_xright = (_position + 1) * _menu->kSpacing + _menu->kIndent;
 	_setupFunc = setupFunc;
 	_chooseFunc = chooseFunc;
 
-	_dr = dr;
+	_menu = menu;
 }
 
 void HeadType::draw() {
 	CursorMan.showMouse(false);
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, false);
+	_menu->drawMenuText(_xpos, 1, _trigger, _title, true, false);
 	CursorMan.showMouse(true);
 }
 
 void HeadType::highlight() {
 	CursorMan.showMouse(false);
 
-	_dr->_vm->_sound->stopSound();
-	_dr->drawMenuText(_xpos, 1, _trigger, _title, true, true);
+	_menu->_vm->_sound->stopSound();
+	_menu->drawMenuText(_xpos, 1, _trigger, _title, true, true);
 
-	_dr->_activeMenuItem._left = _xpos;
-	_dr->_activeMenuItem._activeNow = true;
-	_dr->_activeMenuItem._activeNum = _position;
-	_dr->_menuActive = true;
+	_menu->_activeMenuItem._left = _xpos;
+	_menu->_activeMenuItem._activeNow = true;
+	_menu->_activeMenuItem._activeNum = _position;
+	_menu->_menuActive = true;
 
-	_dr->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
+	_menu->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
 }
 
 bool HeadType::parseAltTrigger(char key) {
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index 35acbbe..da9f93b 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -54,7 +54,7 @@ public:
 	bool parseAltTrigger(char key);
 
 private:
-	Menu *_dr;
+	Menu *_menu;
 };
 
 struct OptionType {
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 0e6ec52..b97fb67 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -57,7 +57,7 @@ const
 var fv:byte; gd,gm:int16; r:char;
 begin;
 	dusk; delavvy;
-	off;
+	CursorMan.showMouse(false);
 	cleardevice; setfillstyle(xhatchfill,11);
 	settextstyle(1,0,4); settextjustify(1,1);
 	dplot(320,10,title);
@@ -76,7 +76,9 @@ begin;
 	setcolor(yellow);   outtextxy(gd+1,gm-1,fish);
 	end;
 	newpointer(6); { TTHand }
-	dawn; on; setbkcolor(1); repeat check until (mpress>0) or keypressed;
+	dawn;
+	CursorMan.showMouse(true);
+	setbkcolor(1); repeat check until (mpress>0) or keypressed;
 	while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
 	dusk; dawn;
 	copy02;


Commit: 39b4d8b71c7293f95442560680a6f2a64b62dbd2
    https://github.com/scummvm/scummvm/commit/39b4d8b71c7293f95442560680a6f2a64b62dbd2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T03:10:16-07:00

Commit Message:
AVALANCHE: Some cleanup and comment modifications.

Changed paths:
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 3301d47..28f05a9 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -444,11 +444,6 @@ Common::String Acci::totalTime() {
 }
 
 void Acci::cheatParse(Common::String codes) {
-//	uint16 num;
-//	int16 e;
-//	char cmd;
-//	int16 se, sx, sy;
-
 	warning("STUB: Acci::cheatParse()");
 }
 
@@ -804,12 +799,12 @@ void Acci::examineObject() {
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion.
+			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion
 		else
-			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion scroll
+			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion
 		break;
 	default:
-		_vm->_scrolls->displayScrollChain('t', _thing); // <<< Ordinarily
+		_vm->_scrolls->displayScrollChain('t', _thing); // Ordinarily
 	}
 }
 
@@ -837,7 +832,7 @@ void Acci::exampers() {
 		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
 			_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
 		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
-			_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
+			_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep.
 		else
 			_vm->_scrolls->displayScrollChain('p', newPerson);
 
@@ -891,7 +886,7 @@ void Acci::examine() {
 	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
 	if ((_person == kPardon) && (_thing != kPardon)) {
 		if (isHolding()) {
-			// Remember: it's been Slipped! Ie subtract 49.
+			// Remember: it's been slipped! Ie subtract 49.
 			if ((1 <= _thing) && (_thing <= 49)) // Standard object
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
@@ -934,7 +929,7 @@ void Acci::inventory() {
 	_vm->_scrolls->displayText(tmpStr);
 }
 
-void Acci::swallow() {   // Eat something.
+void Acci::swallow() { // Eat something.
 	switch (_thing) {
 	case Gyro::kObjectWine:
 		switch (_vm->_gyro->_wineState) { // 4 is perfect
@@ -1120,8 +1115,6 @@ void Acci::openDoor() {
 		_vm->_scrolls->displayText("Door? What door?");
 }
 
-
-
 void Acci::silly() {
 	_vm->_scrolls->displayText("Don't be silly!");
 }
@@ -1469,6 +1462,7 @@ Common::String Acci::personSpeaks() {
 
 	return tmpStr;
 }
+
 void Acci::heyThanks() {
 	Common::String tmpStr = personSpeaks();
 	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 90966c4..4b129e2 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -197,11 +197,11 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte tc = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((tc != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
-			MagicType *magic = &_anim->_vm->_gyro->_magics[tc];
+		if ((magicColor != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
+			MagicType *magic = &_anim->_vm->_gyro->_magics[magicColor];
 			switch (magic->_operation) {
 			case Gyro::kMagicExclaim:
 				bounce();
@@ -224,7 +224,7 @@ void AnimationType::walk() {
 				_anim->callSpecial(magic->_data);
 				break;
 			case Gyro::kMagicOpenDoor:
-				_anim->openDoor(magic->_data >> 8, magic->_data & 0xff, tc);
+				_anim->openDoor(magic->_data >> 8, magic->_data & 0xff, magicColor);
 				break;
 			}
 		}
@@ -370,8 +370,7 @@ void Animation::loadAnims() {
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	// if not alive then begin checkfeet:=0; exit; end;
-	byte a = 0;
+	byte returnColor = 0;
 
 	if (x1 < 0)
 		x1 = 0;
@@ -380,22 +379,22 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 	if (oy < y) {
 		for (int16 i = x1; i <= x2; i++) {
 			for (int16 j = oy + yl; j <= y + yl; j++) {
-				byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
-				if (c > a)
-					a = c;
+				byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+				if (actColor > returnColor)
+					returnColor = actColor;
 			}
 		}
 	} else {
 		for (int16 i = x1; i <= x2; i++) {
 			for (int16 j = y + yl; j <= oy + yl; j++) {
-				byte c = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
-				if (c > a)
-					a = c;
+				byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+				if (actColor > returnColor)
+					returnColor = actColor;
 			}
 		}
 	}
 
-	return a;
+	return returnColor;
 }
 
 byte Animation::geidaPed(byte which) {
@@ -421,9 +420,6 @@ void Animation::catacombMove(byte ped) {
 
 	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 	// catacombs has a different number for it.
-
-
-
 	xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256;
 	_vm->_gyro->_geidaSpin = 0;
 
@@ -572,8 +568,6 @@ void Animation::catacombMove(byte ped) {
 		break;
 	}
 
-	/*  ---- */
-
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
 		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
@@ -993,7 +987,6 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
 	changeDirection(sprNum, curPed->_direction);
 }
 
-// Eachstep procedures:
 void Animation::followAvalotY(byte tripnum) {
 	if (_sprites[0]._facingDir == kDirLeft)
 		return;
@@ -1048,17 +1041,7 @@ void Animation::arrowProcs(byte tripnum) {
 			_sprites[1]._callEachStepFl = false; // prevent recursion.
 			_vm->_scrolls->displayScrollChain('Q', 47); // Complaint!
 			_sprites[tripnum].remove(); // Deallocate the arrow.
-#if 0
-			tr[1].done; { Deallocate normal pic of Avvy. }
-
-			CursorMan.showMouse(false);
-			for byte fv:=0 to 1 do
-			begin
-			cp:=1-cp;
-			getback;
-			end;
-			CursorMan.showMouse(true);
-#endif
+
 			_vm->_lucerna->gameOver();
 
 			_vm->_gyro->_userMovesAvvy = false; // Stop the user from moving him.
@@ -1072,22 +1055,6 @@ void Animation::arrowProcs(byte tripnum) {
 
 }
 
-#if 0
-procedure Spludwick_procs(tripnum:byte);
-var fv:byte;
-begin
-	with tr[tripnum] do
-	if not homing then { We only need to do anything if Spludwick *stops*
-						walking. }
-	with _vm->_gyro->dna do
-	begin
-	inc(DogfoodPos);
-	if DogfoodPos=8 then DogfoodPos:=1;
-	walkto(DogfoodPos);
-	end;
-end;
-#endif
-
 void Animation::grabAvvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 	int16 tox = _sprites[0]._x + 17;
 	int16 toy = _sprites[0]._y - 1;
@@ -1203,7 +1170,6 @@ void Animation::drawSprites() {
 		}
 	} while (!ok);
 
-
 	_vm->_graphics->refreshBackground();
 
 	for (int i = 0; i < 5; i++) {
@@ -1437,5 +1403,4 @@ void Animation::handleMoveKey(const Common::Event &event) {
 	}
 }
 
-
 } // End of namespace Avalanche.


Commit: c34bc12af20e21e100138d8e9dc37006f404420d
    https://github.com/scummvm/scummvm/commit/c34bc12af20e21e100138d8e9dc37006f404420d
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T03:36:19-07:00

Commit Message:
AVALANCHE: Remove useless code.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7d216fa..f140ae9 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -527,7 +527,7 @@ Common::Error AvalancheEngine::run() {
 	do {
 		_avalot->runAvalot();
 
-		// Needed for later implementation!!! Don't remove these comments!!!
+#if 0
 		//switch (_storage._operation) {
 		//case kRunShootemup:
 		//	run("seu.avx", kJsb, kBflight, kNormal);
@@ -542,6 +542,7 @@ Common::Error AvalancheEngine::run() {
 		//	run("golden.avx", kJsb, kBflight, kMusical);
 		//	break;
 		//}
+#endif
 
 	} while (!_gyro->_letMeOut && !shouldQuit());
 
@@ -554,15 +555,6 @@ void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, E
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
 }
 
-void AvalancheEngine::bFlightOn() {
-	_storage._skellern = kReset;
-	// setintvec(0x1c, &b_flight);
-}
-
-void AvalancheEngine::bFlightOff() {
-	// setintvec(0x1c, old_1c);
-}
-
 Common::String AvalancheEngine::elmToStr(Elm how) {
 	switch (how) {
 	case kNormal:
@@ -587,11 +579,6 @@ void AvalancheEngine::dosShell() {
 	warning("STUB: dosShell()");
 }
 
-//TODO: Remove these (b_flight) functions later ( https://github.com/tthurman/avalot/wiki/B-Flight )
-void AvalancheEngine::bFlight() {   //interrupt;
-	_storage._skellern++;
-}
-
 // Needed in dos_shell(). TODO: Remove later.
 Common::String AvalancheEngine::commandCom() {
 	warning("STUB: commandCom()");
@@ -603,16 +590,6 @@ void AvalancheEngine::explain(byte error) {
 	warning("STUB: explain()");
 }
 
-// The original ones were all commented out, so probably there's no need
-// of these two cursor functions at all. TODO: Remove later.
-void AvalancheEngine::cursorOff() {
-	warning("STUB: cursorOff()");
-}
-
-void AvalancheEngine::cursorOn() {
-	warning("STUB: cursorOn()");
-}
-
 // Needed later.
 void AvalancheEngine::quit() {
 	cursorOn();


Commit: 8d5ce97ca457c9bc2ee055f879f17d748282a102
    https://github.com/scummvm/scummvm/commit/8d5ce97ca457c9bc2ee055f879f17d748282a102
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T03:39:03-07:00

Commit Message:
AVALANCHE: Mostly cosmetic modifications in avalot.cpp.

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index dbc38be..7126f33 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -127,7 +127,6 @@ void Avalot::setup() {
 	_vm->_parser->_inputTextPos = 0;
 	_vm->_parser->_quote = true;
 
-	// TSkellern = 0; Replace with a more local variable sometime
 	_vm->_lucerna->drawToolbar();
 	_vm->_scrolls->setReadyLight(2);
 
@@ -150,7 +149,7 @@ void Avalot::setup() {
 		_vm->loadGame(loadSlot);
 	} else {
 		_vm->_gyro->_isLoaded = false; // Set to true in _vm->loadGame().
-		_vm->_gyro->newGame(); // No game was requested- load the default.
+		_vm->_gyro->newGame();
 
 		_vm->_gyro->_soundFx = !_vm->_gyro->_soundFx;
 		_vm->_lucerna->fxToggle();
@@ -176,7 +175,6 @@ void Avalot::runAvalot() {
 		_vm->_timer->updateTimer();
 
 #ifdef DEBUG
-		// ONLY FOR TESTING!!!
 		for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
 			LineType *curLine = &_vm->_gyro->_lines[i];
 			_vm->_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
@@ -187,10 +185,9 @@ void Avalot::runAvalot() {
 			if (curField->_x1 < 640)
 				_vm->_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
 		}
-		// ONLY FOR TESTING!!!
 #endif
 
-		_vm->_graphics->refreshScreen();  // TODO: Maybe it'll have a better place later. Move it there when it's needed.
+		_vm->_graphics->refreshScreen();
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
 		if (delay <= 55)


Commit: 3650f5d6a74d7c0ce74701c4a9dc915700fdd5f2
    https://github.com/scummvm/scummvm/commit/3650f5d6a74d7c0ce74701c4a9dc915700fdd5f2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T04:10:14-07:00

Commit Message:
AVALANCHE: More clean up, removement of dead code.

Changed paths:
    engines/avalanche/background.cpp
    engines/avalanche/background.h
    engines/avalanche/closing.cpp
    engines/avalanche/closing.h
    engines/avalanche/graphics.h
    engines/avalanche/gyro.h
    engines/avalanche/lucerna.cpp



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index d9f606b..3a70fd7 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -359,8 +359,6 @@ void Background::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
 	}
 }
 
-
-
 void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
 	_r._x1 = x;
 	_r._y1 = y;
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 915abb9..d38106d 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -71,7 +71,7 @@ private:
 	SpriteType _sprites[40];
 	ByteField _r;
 	Common::String _filename;
-	static const int16 kOnDisk; // Value of memos[fv].x when it's not in memory.
+	static const int16 kOnDisk; // Value of _sprites[fv]._x when it's not in memory.
 
 	void drawSprite(int16 x, int16 y, SpriteType &sprite);
 };
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 85d5fe0..39f177e 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -75,9 +75,4 @@ void Closing::exitGame() {
 	showScreen(); // No halt- it's already set up.
 }
 
-// CHECKME: Useless?
-// void Closing::handleBug() {
-//	warning("STUB: Closing::handleBug()");
-//}
-
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index a2543fd..b4c80a8 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -42,12 +42,12 @@ public:
 	void exitGame();
 
 private:
-// CHECKME: Useless values?
+	// Will be needed during implementation of Closing.
 	enum ScreenType {
-//		kScreenBugAlert = 1,
-//		kScreenRamCram = 2,
-//		kScreenTwoCopies = 5,
-		kScreenNagScreen = 3
+		kScreenBugAlert = 1,
+		kScreenRamCram = 2,
+		kScreenNagScreen = 3,
+		kScreenTwoCopies = 5
 	};
 
 	AvalancheEngine *_vm;
@@ -56,10 +56,6 @@ private:
 	void showScreen();
 	void putIn(Common::String str, uint16 where);
 
-	// CHECKME: Unused?
-	// Common::String q; //absolute $B8FA:0* ; Nobody's using the graphics memory now.
-	// Common::File f;
-	// void handleBug();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 7706c5f..4cf338b 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -36,9 +36,10 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-typedef byte FontType[256][16]; // raw font type
+typedef byte FontType[256][16];
 
-typedef byte ManiType[2049]; // manitype = array[5..2053] of byte;
+typedef byte ManiType[2049];
+// manitype = array[5..2053] of byte;
 // Be aware!!!
 
 typedef byte SilType[51][11]; // 35, 4
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 16d7df2..67ca2cf 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -107,37 +107,6 @@ struct Sundry { // Things which must be saved over a backtobootstrap, outside DN
 	byte _qThinks;
 	bool _qThinkThing;
 };
-
-struct ednahead { // Edna header
-	// This header starts at byte offset 177 in the .ASG file.
-	char id[9];   // signature
-	uint16 revision; // EDNA revision, here 2 (1=dna256)
-	Common::String game; // Long name, eg Lord Avalot D'Argent
-	Common::String shortname; // Short name, eg Avalot
-	uint16 number; // Game's code number, here 2
-	uint16 ver; // Version number as int16 (eg 1.00 = 100)
-	Common::String verstr; // Vernum as Common::String (eg 1.00 = "1.00")
-	Common::String filename; // Filename, eg AVALOT.EXE
-	byte osbyte; // Saving OS (here 1=DOS. See below for others.
-	Common::String os; // Saving OS in text format.
-
-	// Info on this particular game
-
-	Common::String fn; // Filename (not extension ('cos that's .ASG))
-	byte d, m; // D, M, Y are the Day, Month & Year this game was...
-	uint16 y;  // ...saved on.
-	Common::String desc; // Description of game (same as in Avaricius!)
-	uint16 len; // Length of DNA (it's not going to be above 65535!)
-
-	// Quick reference & miscellaneous
-
-	uint16 saves; // no. of times this game has been saved
-	int16 cash; // contents of your wallet in numerical form
-	Common::String money; // ditto in Common::String form (eg 5/-, or 1 denarius)
-	uint16 points; // your score
-
-	// DNA values follow, then footer (which is ignored)
-};
 #endif
 
 class Gyro {
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 98a9775..539bb40 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -173,8 +173,6 @@ void Lucerna::drawAlsoLines() {
 	CursorMan.showMouse(true);
 }
 
-// readAlsoStringFromFile, scram and unScramble are only used in loadAlso
-
 /**
  * Check is it's possible to give something to Spludwick
  * @remarks	Originally called 'nextstring'
@@ -438,7 +436,6 @@ void Lucerna::enterRoom(byte room, byte ped) {
 	if ((_vm->_gyro->_lastRoom == kRoomMap) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room))
 		enterNewTown();
 
-
 	switch (room) {
 	case kRoomYours:
 		if (_vm->_gyro->_avvyInBed) {
@@ -855,6 +852,8 @@ void Lucerna::thinkAbout(byte object, bool type) {
 			object--; // Last time...
 	}
 
+	CursorMan.showMouse(false);
+
 	file.seek(object * picSize + 65);
 	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
 	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
@@ -862,12 +861,6 @@ void Lucerna::thinkAbout(byte object, bool type) {
 	picture.free();
 	file.close();
 
-	CursorMan.showMouse(false);
-
-#if 0
-	putimage(x, y, p, 0);
-#endif
-
 	CursorMan.showMouse(true);
 	_vm->_gyro->_thinkThing = type;
 }
@@ -935,7 +928,7 @@ void Lucerna::drawScore() {
 		_vm->_gyro->_scoreToDisplay[i] = numbers[i];
 }
 
-void Lucerna::incScore(byte num) {     // Add on no. of points
+void Lucerna::incScore(byte num) {    
 	for (int i = 1; i <= num; i++) {
 		_vm->_gyro->_dnascore++;
 
@@ -1214,10 +1207,6 @@ uint16 Lucerna::bearing(byte whichPed) {
 }
 
 /** 
- * A sprite run is performed before displaying a scroll, if not all the
- * sprites are still. It performs two fast cycles, only using a few of
- * the links usually used, and without any extra animation. This should
- * make the sprites the same on both pages.
  * @remarks	Originally called 'sprite_run'
  */
 void Lucerna::spriteRun() {


Commit: 2df1aa6287b889baa6e545c0448a1d6f92dd7155
    https://github.com/scummvm/scummvm/commit/2df1aa6287b889baa6e545c0448a1d6f92dd7155
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T04:33:43-07:00

Commit Message:
AVALANCHE: More clean up, removement of dead code, some rearranging.

Changed paths:
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h
    engines/avalanche/module.mk
    engines/avalanche/pingo.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 701435e..b786399 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -123,8 +123,7 @@ void MenuItem::displayOption(byte y, bool highlit) {
 
 void MenuItem::display() {
 	CursorMan.showMouse(false);
-	//setfillstyle(1, menu_b);
-	//setcolor(menu_border);
+
 	_firstlix = true;
 	_flx1 = _left - 2;
 	_flx2 = _left + _width;
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index da9f93b..e1d4205 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -71,7 +71,7 @@ public:
 	uint16 _width, _left;
 	bool _firstlix;
 	int16 _flx1, _flx2, _fly;
-	byte _oldY; // used by lightUp */
+	byte _oldY; // used by lightUp
 	bool _activeNow; // Is there an active option now?
 	byte _activeNum; // And if so, which is it?
 	byte _choiceNum; // Your choice?
@@ -138,7 +138,7 @@ private:
 	static const byte kHighlightFontColor = kColorWhite;
 	static const byte kDisabledColor = kColorDarkgray;
 
-	bool _menuActive; // Kludge so we don't have to keep referring to Dropdown
+	bool _menuActive; // Kludge so we don't have to keep referring to the menu.
 
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 4c50329..be8a103 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -1,25 +1,25 @@
 MODULE := engines/avalanche
 
 MODULE_OBJS = \
+	acci.o \
+	animation.o \
 	avalanche.o \
-	graphics.o \
-	parser.o \
 	avalot.o \
+	background.o \
+	closing.o \
 	console.o \
 	detection.o \
+	graphics.o \
 	gyro.o \
+	lucerna.o \
+	menu.o \
+	parser.o \
 	pingo.o \
 	scrolls.o \
-	lucerna.o \
-	background.o \
 	sequence.o \
-	timer.o \
-	animation.o \
-	acci.o \
-	menu.o \
-	closing.o \
-	sound.o
-
+	sound.o \
+	timer.o
+	
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)
 PLUGIN := 1
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index b97fb67..7196f46 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -49,41 +49,6 @@ void Pingo::dPlot(int16 x, int16 y, Common::String z) {
 }
 
 void Pingo::bossKey() {
-#if 0
-const
-	months : array[0..11] of char = 'JFMAMJJASOND';
-	title = 'Net Profits';
-	fish = 224; // 'à'
-var fv:byte; gd,gm:int16; r:char;
-begin;
-	dusk; delavvy;
-	CursorMan.showMouse(false);
-	cleardevice; setfillstyle(xhatchfill,11);
-	settextstyle(1,0,4); settextjustify(1,1);
-	dplot(320,10,title);
-	settextstyle(1,0,0); setusercharsize(4,3,7,12);
-	for fv:=0 to 11 do
-	begin;
-	dplot(26+fv*52,187,months[fv]);
-	bar(fv*52,177-fv*14,51+fv*52,180);
-	rectangle(fv*52,177-fv*14,51+fv*52,180);
-	end;
-	settextstyle(0,0,1);
-	for fv:=1 to 177 do
-	begin;
-	gd:=random(630); gm:=random(160)+30;
-	setcolor(lightred); outtextxy(gd  ,gm  ,fish);
-	setcolor(yellow);   outtextxy(gd+1,gm-1,fish);
-	end;
-	newpointer(6); { TTHand }
-	dawn;
-	CursorMan.showMouse(true);
-	setbkcolor(1); repeat check until (mpress>0) or keypressed;
-	while keypressed do r:=readkey; setbkcolor(0); settextjustify(0,0);
-	dusk; dawn;
-	copy02;
-#endif
-
 	warning("STUB: Pingo::bossKey()");
 }
 
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index b2a81a7..d4462aa 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -423,9 +423,6 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
 
-//	CHECKME: unused?
-//	ex = mx - lx;
-//	int16 ey = my - ly;
 	mx -= lx;
 	my -= ly + 2;
 
@@ -451,7 +448,6 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-
 	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
 		if (!_vm->_gyro->_scroll[i].empty())
 			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
@@ -485,7 +481,7 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 
 	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	ringBell();
-	//my = getpixel(0, 0);
+	
 	_vm->_gyro->_dropsOk = false;
 	dodgem();
 
@@ -493,22 +489,12 @@ void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
 
 	unDodgem();
 	_vm->_gyro->_dropsOk = true;
-	CursorMan.showMouse(false);
-	// mblit(ex-46,ey-6,ex+lx*2+15,ey+ly*2+6,3,0);
-	//mblit((ex - 46) / 8, ey - 6, 1 + (ex + lx * 2 + 15) / 8, ey + ly * 2 + 6, cp, 1 - cp);
-	//blitfix();
-	CursorMan.showMouse(true);
-	//settextjustify(0, 0); // sink
+	
 	resetScrollDriver();
-	/*if (_vm->_gyro->mpress > 0)
-	_vm->_gyro->after_the_scroll = true;*/
-
-	warning("STUB: Scrolls::drawScroll()");
 }
 
 void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	Common::Point points[3];
-//	byte *rp1, *rp2; // replace: 1=bubble, 2=pointer
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
@@ -557,9 +543,6 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
 
 
-	// CHECKME: Unused?
-	// yl -= 3;
-
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
@@ -570,22 +553,15 @@ void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
 	}
 
 	ringBell();
-	CursorMan.showMouse(true);
+	CursorMan.showMouse(false);
 	_vm->_gyro->_dropsOk = false;
 
 	// This does the actual drawing to the screen.
 	(this->*modeFunc)();
 
-	CursorMan.showMouse(false);
 	_vm->_gyro->_dropsOk = true;
-
 	CursorMan.showMouse(true); // sink;
 	resetScrollDriver();
-
-#if 0
-	if (_vm->_gyro->mpress > 0)
-		_vm->_gyro->after_the_scroll = true;
-#endif
 }
 
 bool Scrolls::displayQuestion(Common::String question) {


Commit: 2dcdca571192faebdc1799461fe907fad7087ef3
    https://github.com/scummvm/scummvm/commit/2dcdca571192faebdc1799461fe907fad7087ef3
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T05:16:32-07:00

Commit Message:
AVALANCHE: Silence GCC warnings and repair Scrolls::scrollModeNormal().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/gyro.h
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 97624cf..aa363bb 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -290,7 +290,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	}
 }
 
-void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
 		for (uint16 x = 0; x < picture.w; x++)
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 4cf338b..de08a9a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -86,7 +86,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 	void refreshScreen();
 	void refreshBackground();
 
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
index 67ca2cf..99fe6f7 100644
--- a/engines/avalanche/gyro.h
+++ b/engines/avalanche/gyro.h
@@ -93,7 +93,7 @@ public:
 	byte _color;
 };
 
-typedef byte TuneType[31];
+typedef int8 TuneType[31];
 
 struct QuasipedType {
 	byte _whichPed, _foregroundColor, _room, _backgroundColor;
@@ -200,7 +200,7 @@ public:
 		kPitchInvalid,
 		kPitchLower,
 		kPitchSame,
-		kPitchHigher,
+		kPitchHigher
 	};
 
 	static const uint16 kNotes[12];
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index d4462aa..ca5b515 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -118,7 +118,6 @@ void Scrolls::scrollModeNormal() {
 
 	setReadyLight(3);
 	_vm->_gyro->_seeScroll = true;
-	CursorMan.showMouse(true);
 	_vm->_gyro->newMouse(3);
 
 	::Graphics::Surface temp;
@@ -177,7 +176,6 @@ void Scrolls::scrollModeNormal() {
 
 	setReadyLight(0);
 	_vm->_gyro->_seeScroll = false;
-	CursorMan.showMouse(false);
 	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
 
 	warning("STUB: Scrolls::scrollModeNormal()");
@@ -278,6 +276,8 @@ void Scrolls::scrollModeMusic() {
 				case Common::KEYCODE_RIGHTBRACKET:
 					value = 11;
 					break;
+				default:
+					break;
 				}
 
 				lastOne = thisOne;


Commit: 3b57efaf992b3dccbf60b0f94004c587b93fec32
    https://github.com/scummvm/scummvm/commit/3b57efaf992b3dccbf60b0f94004c587b93fec32
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T05:25:54-07:00

Commit Message:
AVALANCHE: Revise Graphics::drawPicture().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index aa363bb..643025f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -290,11 +290,11 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	}
 }
 
-void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
 		for (uint16 x = 0; x < picture.w; x++)
-			*(byte *)target.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);
+			*(byte *)target.getBasePtr(x + destX, y + destY) = *(const byte *)picture.getBasePtr(x, y);
 	}
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index de08a9a..4cf338b 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -86,7 +86,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 	void refreshScreen();
 	void refreshBackground();
 


Commit: 897a0d0a61cc393a80a276b94d37c2d0d7c8dfbc
    https://github.com/scummvm/scummvm/commit/897a0d0a61cc393a80a276b94d37c2d0d7c8dfbc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T05:36:23-07:00

Commit Message:
AVALANCHE: Silence more GCC warnings.

Changed paths:
    engines/avalanche/parser.cpp
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 5f9e5d8..d341e76 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -144,12 +144,6 @@ void Parser::drawCursor() {
 	// Draw the '_' character.
 	for (int bit = 0; bit < 8; bit++)
 		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = kColorWhite;
-
-	ByteField bf;
-	bf._x1 = _inputTextPos + 1;
-	bf._x2 = _inputTextPos + 2;
-	bf._y1 = 168;
-	bf._y2 = 168;
 }
 
 void Parser::wipeText() {
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index ca5b515..0b1b4a4 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -193,7 +193,7 @@ void Scrolls::store(byte what, TuneType &played) {
 bool Scrolls::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
-	for (int i = 0; i < sizeof(played); i++) {
+	for (byte i = 0; i < sizeof(played); i++) {
 		if (played[i] != _vm->_gyro->kTune[i])
 			mistakes += 1;
 	}
@@ -208,7 +208,7 @@ void Scrolls::scrollModeMusic() {
 	_vm->_gyro->newMouse(3);
 
 	TuneType played;
-	for (int i = 0; i < sizeof(played); i++)
+	for (byte i = 0; i < sizeof(played); i++)
 		played[i] = Gyro::kPitchInvalid;
 	int8 lastOne = -1, thisOne = -1; // Invalid values.
 


Commit: e0b4280a949606d63d438cdb3046f630f837f183
    https://github.com/scummvm/scummvm/commit/e0b4280a949606d63d438cdb3046f630f837f183
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T05:49:35-07:00

Commit Message:
AVALANCHE: Change byte to unsigned int in for loops.

Changed paths:
    engines/avalanche/scrolls.cpp



diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
index 0b1b4a4..e5d08ec 100644
--- a/engines/avalanche/scrolls.cpp
+++ b/engines/avalanche/scrolls.cpp
@@ -193,7 +193,7 @@ void Scrolls::store(byte what, TuneType &played) {
 bool Scrolls::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
-	for (byte i = 0; i < sizeof(played); i++) {
+	for (unsigned int i = 0; i < sizeof(played); i++) {
 		if (played[i] != _vm->_gyro->kTune[i])
 			mistakes += 1;
 	}
@@ -208,7 +208,7 @@ void Scrolls::scrollModeMusic() {
 	_vm->_gyro->newMouse(3);
 
 	TuneType played;
-	for (byte i = 0; i < sizeof(played); i++)
+	for (unsigned int i = 0; i < sizeof(played); i++)
 		played[i] = Gyro::kPitchInvalid;
 	int8 lastOne = -1, thisOne = -1; // Invalid values.
 


Commit: ba103fd5dd8ecde9962ccad03b79a440c06f7a7b
    https://github.com/scummvm/scummvm/commit/ba103fd5dd8ecde9962ccad03b79a440c06f7a7b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T06:36:13-07:00

Commit Message:
AVALANCHE: Some polishing in Animation

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 4b129e2..c014b95 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -59,12 +59,12 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 
 	int32 id = inf.readSint32LE();
 	if (id != idshould) {
-		//output << '\7';
 		inf.close();
 		return;
 	}
 
-	inf.skip(2); // Replace variable named 'soa' in the original code.
+	// Replace variable named 'soa' in the original code.
+	inf.skip(2);
 
 	if (!_stat._name.empty())
 		_stat._name.clear();
@@ -73,7 +73,6 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 		_stat._name += inf.readByte();
 	inf.skip(12 - nameSize);
 
-	//inf.skip(1); // Same as above.
 	byte commentSize = inf.readByte();
 	for (int i = 0; i < commentSize; i++)
 		_stat._comment += inf.readByte();
@@ -134,7 +133,8 @@ void AnimationType::original() {
 void AnimationType::draw() {
 	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
-	byte picnum = _facingDir * _stat._seq + _stepNum; // There'll maybe problem because of the different array indexes in Pascal (starting from 1).
+
+	byte picnum = _facingDir * _stat._seq + _stepNum;
 
 	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
@@ -370,47 +370,42 @@ void Animation::loadAnims() {
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	byte returnColor = 0;
+	if (!_vm->_gyro->_alive)
+		return 0;
 
 	if (x1 < 0)
 		x1 = 0;
 	if (x2 > 639)
 		x2 = 639;
-	if (oy < y) {
-		for (int16 i = x1; i <= x2; i++) {
-			for (int16 j = oy + yl; j <= y + yl; j++) {
-				byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
-				if (actColor > returnColor)
-					returnColor = actColor;
-			}
-		}
-	} else {
-		for (int16 i = x1; i <= x2; i++) {
-			for (int16 j = y + yl; j <= oy + yl; j++) {
-				byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
-				if (actColor > returnColor)
-					returnColor = actColor;
-			}
+
+	int16 minY = MIN(oy, y) + yl;
+	int16 maxY = MAX(oy, y) + yl;
+	byte returnColor = 0;
+
+	for (int16 i = x1; i <= x2; i++) {
+		for (int16 j = minY; j <= maxY; j++) {
+			byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+			returnColor = MAX(returnColor, actColor);
 		}
 	}
 
 	return returnColor;
 }
 
-byte Animation::geidaPed(byte which) {
-	switch (which) {
+byte Animation::geidaPed(byte ped) {
+	switch (ped) {
 	case 1:
-		return 7;
+		return 6;
 	case 2:
 	case 6:
-		return 8;
+		return 7;
 	case 3:
 	case 5:
-		return 9;
+		return 8;
 	case 4:
-		return 10;
+		return 9;
 	default:
-		return 0;
+		error("geidaPed(): Unhandled ped value %d", ped);
 	}
 }
 
@@ -710,7 +705,7 @@ void Animation::catacombMove(byte ped) {
 	if ((_vm->_gyro->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
-		appearPed(1, geidaPed(ped) - 1);
+		appearPed(1, geidaPed(ped));
 		_sprites[1]._callEachStepFl = true;
 		_sprites[1]._eachStepProc = kProcGeida;
 	}
@@ -1300,9 +1295,6 @@ void Animation::flipRoom(byte room, byte ped) {
 	_vm->_lucerna->drawDirection();
 
 	_vm->_lucerna->dawn();
-
-	// Tidy up after mouse. I know it's a kludge...
-	//  tidy_after_mouse;
 }
 
 bool Animation::inField(byte which) {
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 2765a7c..1f13fd1 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -137,7 +137,7 @@ private:
 	AvalancheEngine *_vm;
 
 	byte checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
-	byte geidaPed(byte which);
+	byte geidaPed(byte ped);
 	void dawnDelay();
 
 	void grabAvvy(byte tripnum);


Commit: d82975fc38c9334c15810fff216ab59fd5af5ec2
    https://github.com/scummvm/scummvm/commit/d82975fc38c9334c15810fff216ab59fd5af5ec2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T07:09:33-07:00

Commit Message:
AVALANCHE: Add an assert in flipRoom(), fix an issue in post-STU functions

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index c014b95..fafd088 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1258,6 +1258,7 @@ void Animation::hideInCupboard() {
 }
 
 void Animation::flipRoom(byte room, byte ped) {
+	assert((ped > 0) && (ped < 15));
 	if (!_vm->_gyro->_alive) {
 		// You can't leave the room if you're dead.
 		_sprites[0]._moveX = 0;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index b473e77..ac5f096 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -353,8 +353,10 @@ void Timer::hangAround2() {
 
 void Timer::afterTheShootemup() {
 
-	_vm->_animation->flipRoom(_vm->_gyro->_room, 0);
+	// CHECKME: is it correct?
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
+	_vm->_animation->flipRoom(_vm->_gyro->_room, 1);
+	//
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);


Commit: 628c5bb5155e8f1de23763c1e300aaa351aca871
    https://github.com/scummvm/scummvm/commit/628c5bb5155e8f1de23763c1e300aaa351aca871
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T07:20:57-07:00

Commit Message:
AVALANCHE: Remove comment. (Answer: It is.)

Changed paths:
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index ac5f096..9f51e2a 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -352,11 +352,8 @@ void Timer::hangAround2() {
 }
 
 void Timer::afterTheShootemup() {
-
-	// CHECKME: is it correct?
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 	_vm->_animation->flipRoom(_vm->_gyro->_room, 1);
-	//
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);


Commit: 350d622324581fe0ceb2eee38d4a7750690a0cf0
    https://github.com/scummvm/scummvm/commit/350d622324581fe0ceb2eee38d4a7750690a0cf0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T09:06:37-07:00

Commit Message:
AVALANCHE: rename scrolls to dialogs

Changed paths:
  A engines/avalanche/dialogs.cpp
  A engines/avalanche/dialogs.h
  R engines/avalanche/scrolls.cpp
  R engines/avalanche/scrolls.h
    engines/avalanche/acci.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/module.mk
    engines/avalanche/pingo.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
index 28f05a9..f98eb91 100644
--- a/engines/avalanche/acci.cpp
+++ b/engines/avalanche/acci.cpp
@@ -31,7 +31,7 @@
 #include "avalanche/acci.h"
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/background.h"
@@ -466,18 +466,18 @@ void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
 	if (target == kPardon) {
 		ambiguous = true;
 		if (animate)
-			_vm->_scrolls->displayText("Whom?");
+			_vm->_dialogs->displayText("Whom?");
 		else
-			_vm->_scrolls->displayText("What?");
+			_vm->_dialogs->displayText("What?");
 	} else {
 		if (animate) {
 			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
-			_vm->_scrolls->displayText(tmpStr);
+			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			Common::String z = _vm->_gyro->getItem(target);
 			if (z != "") {
 				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
-				_vm->_scrolls->displayText(tmpStr);
+				_vm->_dialogs->displayText(tmpStr);
 			}
 		}
 	}
@@ -523,9 +523,9 @@ void Acci::properNouns() {
 void Acci::sayIt() {
 	Common::String x = _vm->_parser->_inputText;
 	x.setChar(toupper(x[0]), 0);
-	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Scrolls::kControlRegister, x.c_str(), 
-		                                           Scrolls::kControlSpeechBubble, Scrolls::kControlRegister);
-	_vm->_scrolls->displayText(tmpStr);
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Dialogs::kControlRegister, x.c_str(), 
+		                                           Dialogs::kControlSpeechBubble, Dialogs::kControlRegister);
+	_vm->_dialogs->displayText(tmpStr);
 }
 
 void Acci::storeInterrogation(byte interrogation) {
@@ -565,7 +565,7 @@ void Acci::storeInterrogation(byte interrogation) {
 		if (!_vm->_gyro->_spareEvening.empty())
 			_vm->_gyro->_spareEvening.clear();
 		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
-		_vm->_scrolls->displayScrollChain('z', 5); // His closing statement...
+		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
 		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
@@ -761,7 +761,7 @@ void Acci::parse() {
 
 	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
-		_vm->_scrolls->displayText(tmpStr);
+		_vm->_dialogs->displayText(tmpStr);
 		_vm->_gyro->_weirdWord = true;
 	} else
 		_vm->_gyro->_weirdWord = false;
@@ -787,24 +787,24 @@ void Acci::examineObject() {
 	case Gyro::kObjectWine :
 		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
-			_vm->_scrolls->displayScrollChain('t', 1); // Normal examine wine scroll
+			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
 		case 2:
-			_vm->_scrolls->displayScrollChain('d', 6); // Bad wine
+			_vm->_dialogs->displayScrollChain('d', 6); // Bad wine
 			break;
 		case 3:
-			_vm->_scrolls->displayScrollChain('d', 7); // Vinegar
+			_vm->_dialogs->displayScrollChain('d', 7); // Vinegar
 			break;
 		}
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('q', 21); // Yucky onion
+			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
 		else
-			_vm->_scrolls->displayScrollChain('t', 18);  // Normal onion
+			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
 		break;
 	default:
-		_vm->_scrolls->displayScrollChain('t', _thing); // Ordinarily
+		_vm->_dialogs->displayScrollChain('t', _thing); // Ordinarily
 	}
 }
 
@@ -817,7 +817,7 @@ bool Acci::isPersonHere() { // Person equivalent of "holding".
 			tmpStr = "He isn't around at the moment.";
 		else
 			tmpStr = "She isn't around at the moment.";
-		_vm->_scrolls->displayText(tmpStr);
+		_vm->_dialogs->displayText(tmpStr);
 		return false;
 	}
 }
@@ -830,14 +830,14 @@ void Acci::exampers() {
 		byte newPerson = _person - 149;
 
 		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
-			_vm->_scrolls->displayScrollChain('Q', 8); // "I'm Not Playing!"
+			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
 		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
-			_vm->_scrolls->displayScrollChain('Q', 65); // He's asleep.
+			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
 		else
-			_vm->_scrolls->displayScrollChain('p', newPerson);
+			_vm->_dialogs->displayScrollChain('p', newPerson);
 
 		if ((_person == Gyro::kPeopleAyles) && !_vm->_gyro->_aylesIsAwake)
-			_vm->_scrolls->displayScrollChain('Q', 13);
+			_vm->_dialogs->displayScrollChain('Q', 13);
 
 		_person = newPerson;
 	}
@@ -854,9 +854,9 @@ bool Acci::isHolding() {
 	bool holdingResult = false;
 
 	if (_thing > 100)
-		_vm->_scrolls->displayText("Be reasonable!");
+		_vm->_dialogs->displayText("Be reasonable!");
 	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
-		_vm->_scrolls->displayText("You're not holding it, Avvy.");
+		_vm->_dialogs->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
 
@@ -891,14 +891,14 @@ void Acci::examine() {
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_scrolls->displayText(*_vm->_gyro->_also[_thing - 50][1]);
+				_vm->_dialogs->displayText(*_vm->_gyro->_also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
 	} else if (_person != kPardon)
 		exampers();
 	else
-		_vm->_scrolls->displayText("It's just as it looks on the picture.");  // Don't know: guess.
+		_vm->_dialogs->displayText("It's just as it looks on the picture.");  // Don't know: guess.
 }
 
 void Acci::inventory() {
@@ -922,11 +922,11 @@ void Acci::inventory() {
 	}
 
 	if (_vm->_gyro->_wearing == kNothing)
-		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
+		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 	else
 		tmpStr += '.';
 
-	_vm->_scrolls->displayText(tmpStr);
+	_vm->_dialogs->displayText(tmpStr);
 }
 
 void Acci::swallow() { // Eat something.
@@ -935,52 +935,52 @@ void Acci::swallow() { // Eat something.
 		switch (_vm->_gyro->_wineState) { // 4 is perfect
 		case 1:
 			if (_vm->_gyro->_teetotal)  {
-				_vm->_scrolls->displayScrollChain('D', 6);
+				_vm->_dialogs->displayScrollChain('D', 6);
 				return;
 			}
-			_vm->_scrolls->displayScrollChain('U', 1);
+			_vm->_dialogs->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
-			_vm->_scrolls->displayScrollChain('U', 2);
+			_vm->_dialogs->displayScrollChain('U', 2);
 			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 			drink();
 			break;
 		case 2:
 		case 3:
-			_vm->_scrolls->displayScrollChain('d', 8);
+			_vm->_dialogs->displayScrollChain('d', 8);
 			break; // You can't drink it!
 		}
 		break;
 	case Gyro::kObjectPotion:
 		_vm->_gyro->setBackgroundColor(4);
-		_vm->_scrolls->displayScrollChain('U', 3);
+		_vm->_dialogs->displayScrollChain('U', 3);
 		_vm->_lucerna->gameOver();
 		_vm->_gyro->setBackgroundColor(0);
 		break;
 	case Gyro::kObjectInk:
-		_vm->_scrolls->displayScrollChain('U', 4);
+		_vm->_dialogs->displayScrollChain('U', 4);
 		break;
 	case Gyro::kObjectChastity:
-		_vm->_scrolls->displayScrollChain('U', 5);
+		_vm->_dialogs->displayScrollChain('U', 5);
 		break;
 	case Gyro::kObjectMushroom:
-		_vm->_scrolls->displayScrollChain('U', 6);
+		_vm->_dialogs->displayScrollChain('U', 6);
 		_vm->_lucerna->gameOver();
 		break;
 	case Gyro::kObjectOnion:
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('U', 11);
+			_vm->_dialogs->displayScrollChain('U', 11);
 		else {
-			_vm->_scrolls->displayScrollChain('U', 8);
+			_vm->_dialogs->displayScrollChain('U', 8);
 			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
 			_vm->_lucerna->refreshObjectList();
 		}
 		break;
 	default:
 		if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub))
-			_vm->_scrolls->displayText("Try BUYing things before you drink them!");
+			_vm->_dialogs->displayText("Try BUYing things before you drink them!");
 		else
-			_vm->_scrolls->displayText("The taste of it makes you retch!");
+			_vm->_dialogs->displayText("The taste of it makes you retch!");
 	}
 }
 
@@ -1014,42 +1014,42 @@ void Acci::peopleInRoom() {
 	else
 		tmpStr += " are";
 
-	_vm->_scrolls->displayText(tmpStr + " here."); // End and display it.
+	_vm->_dialogs->displayText(tmpStr + " here."); // End and display it.
 }
 
 void Acci::lookAround() {
-	_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
+	_vm->_dialogs->displayText(*_vm->_gyro->_also[0][1]);
 	switch (_vm->_gyro->_room) {
 	case kRoomSpludwicks:
 		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_scrolls->displayScrollChain('q', 23);
+			_vm->_dialogs->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case kRoomRobins:
 		if (_vm->_gyro->_tiedUp)
-			_vm->_scrolls->displayScrollChain('q', 38);
+			_vm->_dialogs->displayScrollChain('q', 38);
 		if (_vm->_gyro->_mushroomGrowing)
-			_vm->_scrolls->displayScrollChain('q', 55);
+			_vm->_dialogs->displayScrollChain('q', 55);
 		break;
 	case kRoomInsideCardiffCastle:
 		if (!_vm->_gyro->_takenPen)
-			_vm->_scrolls->displayScrollChain('q', 49);
+			_vm->_dialogs->displayScrollChain('q', 49);
 		break;
 	case kRoomLustiesRoom:
 		if (_vm->_gyro->_lustieIsAsleep)
-			_vm->_scrolls->displayScrollChain('q', 65);
+			_vm->_dialogs->displayScrollChain('q', 65);
 		break;
 	case kRoomCatacombs:
 		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
 		case 258 :
-			_vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery.
+			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
 			break;
 		case 514 :
-			_vm->_scrolls->displayScrollChain('q', 81); // Outside ditto.
+			_vm->_dialogs->displayScrollChain('q', 81); // Outside ditto.
 			break;
 		case 260 :
-			_vm->_scrolls->displayScrollChain('q', 82); // Outside Geida's room.
+			_vm->_dialogs->displayScrollChain('q', 82); // Outside Geida's room.
 			break;
 		}
 		break;
@@ -1072,7 +1072,7 @@ void Acci::openDoor() {
 		break;
 	case kRoomSpludwicks:
 		if (_thing == 61) {
-			_vm->_scrolls->displayScrollChain('q', 85);
+			_vm->_dialogs->displayScrollChain('q', 85);
 			return;
 		}
 		break;
@@ -1087,14 +1087,14 @@ void Acci::openDoor() {
 			switch (portal->_operation) {
 			case Gyro::kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
-				_vm->_scrolls->displayScrollChain('x', portal->_data);
+				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
 			case Gyro::kMagicTransport:
 				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
 				break;
 			case Gyro::kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
-				_vm->_scrolls->displayText("Sorry. This place is not available yet!");
+				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
 				break;
 			case Gyro::kMagicSpecial:
 				_vm->_animation->callSpecial(portal->_data);
@@ -1109,14 +1109,14 @@ void Acci::openDoor() {
 	}
 
 	if (_vm->_gyro->_room == kRoomMap)
-		_vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
+		_vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
-		_vm->_scrolls->displayText("Door? What door?");
+		_vm->_dialogs->displayText("Door? What door?");
 }
 
 void Acci::silly() {
-	_vm->_scrolls->displayText("Don't be silly!");
+	_vm->_dialogs->displayText("Don't be silly!");
 }
 
 void Acci::putProc() {
@@ -1135,15 +1135,15 @@ void Acci::putProc() {
 	case Gyro::kObjectWine:
 		if (_thing == Gyro::kObjectOnion) {
 			if (_vm->_gyro->_rottenOnion)
-				_vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
+				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
 				if (_vm->_gyro->_wineState != 3) {
-					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-					_vm->_scrolls->displayText(tmpStr);
+					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+					_vm->_dialogs->displayText(tmpStr);
 				} else { // Put onion into vinegar! Yes!
 					_vm->_gyro->_onionInVinegar = true;
 					_vm->_lucerna->incScore(7);
-					_vm->_scrolls->displayScrollChain('u', 9);
+					_vm->_dialogs->displayScrollChain('u', 9);
 				}
 			}
 		} else
@@ -1153,32 +1153,32 @@ void Acci::putProc() {
 	case 54:
 		if (_vm->_gyro->_room == kRoomYours) { // Put something into the box.
 			if (_vm->_gyro->_boxContent != kNothing)
-				_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
+				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
 				case Gyro::kObjectMoney:
-					_vm->_scrolls->displayText("You'd better keep some ready cash on you!");
+					_vm->_dialogs->displayText("You'd better keep some ready cash on you!");
 					break;
 				case Gyro::kObjectBell:
-					_vm->_scrolls->displayText("That's a silly place to keep a bell.");
+					_vm->_dialogs->displayText("That's a silly place to keep a bell.");
 					break;
 				case Gyro::kObjectBodkin:
-					_vm->_scrolls->displayText("But you might need it!");
+					_vm->_dialogs->displayText("But you might need it!");
 					break;
 				case Gyro::kObjectOnion:
-					_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
+					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
 					if (_vm->_gyro->_wearing == _thing) {
 						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
-						_vm->_scrolls->displayText(tmpStr);
+						_vm->_dialogs->displayText(tmpStr);
 					} else {
 						openBox(true); // Open box.
 
 						_vm->_gyro->_boxContent = _thing;
 						_vm->_gyro->_objects[_thing - 1] = false;
 						_vm->_lucerna->refreshObjectList();
-						_vm->_scrolls->displayText("OK, it's in the box.");
+						_vm->_dialogs->displayText("OK, it's in the box.");
 
 						openBox(false); // Shut box.
 					}
@@ -1200,8 +1200,8 @@ void Acci::putProc() {
 void Acci::notInOrder() {
 	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
-		"What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-	_vm->_scrolls->displayText(tmpStr);
+		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+	_vm->_dialogs->displayText(tmpStr);
 }
 
 /**
@@ -1228,10 +1228,10 @@ bool Acci::giveToSpludwick() {
 	case Gyro::kObjectOnion:
 		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
 		if (_vm->_gyro->_rottenOnion)
-			_vm->_scrolls->displayScrollChain('q', 22);
+			_vm->_dialogs->displayScrollChain('q', 22);
 		else {
 			_vm->_gyro->_givenToSpludwick++;
-			_vm->_scrolls->displayScrollChain('q', 20);
+			_vm->_dialogs->displayScrollChain('q', 20);
 			goToCauldron();
 			_vm->_lucerna->incScore(3);
 		}
@@ -1241,13 +1241,13 @@ bool Acci::giveToSpludwick() {
 		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_givenToSpludwick++;
-		_vm->_scrolls->displayScrollChain('q', 24);
+		_vm->_dialogs->displayScrollChain('q', 24);
 		goToCauldron();
 		_vm->_lucerna->incScore(3);
 		break;
 	case Gyro::kObjectMushroom:
 		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
-		_vm->_scrolls->displayScrollChain('q', 25);
+		_vm->_dialogs->displayScrollChain('q', 25);
 		_vm->_lucerna->incScore(5);
 		_vm->_gyro->_givenToSpludwick++;
 		goToCauldron();
@@ -1279,19 +1279,19 @@ void Acci::drink() {
 
 void Acci::cardiffClimbing() {
 	if (_vm->_gyro->_standingOnDais) { // Clamber up.
-		_vm->_scrolls->displayText("You climb down, back onto the floor.");
+		_vm->_dialogs->displayText("You climb down, back onto the floor.");
 		_vm->_gyro->_standingOnDais = false;
 		_vm->_animation->appearPed(0, 2);
 	} else if (_vm->_animation->inField(0)) { // Clamber down
-		_vm->_scrolls->displayText("You clamber up onto the dais.");
+		_vm->_dialogs->displayText("You clamber up onto the dais.");
 		_vm->_gyro->_standingOnDais = true;
 		_vm->_animation->appearPed(0, 1);
 	} else
-			_vm->_scrolls->displayText("Get a bit closer, Avvy.");
+			_vm->_dialogs->displayText("Get a bit closer, Avvy.");
 }
 
 void Acci::already() {
-	_vm->_scrolls->displayText("You're already standing!");
+	_vm->_dialogs->displayText("You're already standing!");
 }
 
 void Acci::standUp() {
@@ -1299,9 +1299,9 @@ void Acci::standUp() {
 	case kRoomYours: // Avvy isn't asleep.
 		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
 			if (_vm->_gyro->_teetotal) {
-				_vm->_scrolls->displayScrollChain('d', 12);
+				_vm->_dialogs->displayScrollChain('d', 12);
 				_vm->_gyro->setBackgroundColor(0);
-				_vm->_scrolls->displayScrollChain('d', 14);
+				_vm->_dialogs->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
@@ -1340,24 +1340,24 @@ void Acci::getProc(char thing) {
 		if (_vm->_animation->inField(1)) {
 			if (_vm->_gyro->_boxContent == thing) {
 				_vm->_background->drawBackgroundSprite(-1, -1, 4);
-				_vm->_scrolls->displayText("OK, I've got it.");
+				_vm->_dialogs->displayText("OK, I've got it.");
 				_vm->_gyro->_objects[thing - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_boxContent = kNothing;
 				_vm->_background->drawBackgroundSprite(-1, -1, 5);
 			} else {
 				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
-				_vm->_scrolls->displayText(tmpStr);
+				_vm->_dialogs->displayText(tmpStr);
 			}
 		} else
-			_vm->_scrolls->displayScrollChain('q', 57);
+			_vm->_dialogs->displayScrollChain('q', 57);
 		break;
 	case kRoomInsideCardiffCastle:
 		switch (thing) {
 		case Gyro::kObjectPen:
 			if (_vm->_animation->inField(1)) { // Standing on the dais.
 				if (_vm->_gyro->_takenPen)
-					_vm->_scrolls->displayText("It's not there, Avvy.");
+					_vm->_dialogs->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
@@ -1365,34 +1365,34 @@ void Acci::getProc(char thing) {
 					_vm->_gyro->_takenPen = true;
 					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
 					_vm->_lucerna->refreshObjectList();
-					_vm->_scrolls->displayText("Taken.");
+					_vm->_dialogs->displayText("Taken.");
 				}
 			} else if (_vm->_gyro->_standingOnDais)
-				_vm->_scrolls->displayScrollChain('q', 53);
+				_vm->_dialogs->displayScrollChain('q', 53);
 			else
-				_vm->_scrolls->displayScrollChain('q', 51);
+				_vm->_dialogs->displayScrollChain('q', 51);
 			break;
 		case Gyro::kObjectBolt:
-			_vm->_scrolls->displayScrollChain('q', 52);
+			_vm->_dialogs->displayScrollChain('q', 52);
 			break;
 		default:
-			_vm->_scrolls->displayScrollChain('q', 57);
+			_vm->_dialogs->displayScrollChain('q', 57);
 		}
 		break;
 	case kRoomRobins:
 		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			_vm->_scrolls->displayText("Got it!");
+			_vm->_dialogs->displayText("Got it!");
 			_vm->_gyro->_mushroomGrowing = false;
 			_vm->_gyro->_takenMushroom = true;
 			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
 			_vm->_lucerna->refreshObjectList();
 			_vm->_lucerna->incScore(3);
 		} else
-			_vm->_scrolls->displayScrollChain('q', 57);
+			_vm->_dialogs->displayScrollChain('q', 57);
 		break;
 	default:
-		_vm->_scrolls->displayScrollChain('q', 57);
+		_vm->_dialogs->displayScrollChain('q', 57);
 	}
 }
 
@@ -1402,13 +1402,13 @@ void Acci::getProc(char thing) {
  */
 void Acci::giveGeidaTheLute() {
 	if (_vm->_gyro->_room != kRoomLustiesRoom) {
-		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
 		return;
 	}
 	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
 	_vm->_lucerna->refreshObjectList();
-	_vm->_scrolls->displayScrollChain('q', 64); // She plays it.
+	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
 	//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
@@ -1416,13 +1416,13 @@ void Acci::giveGeidaTheLute() {
 
 void Acci::playHarp() {
 	if (_vm->_animation->inField(6))
-		_vm->_scrolls->musicalScroll();
+		_vm->_dialogs->displayMusicalScroll();
 	else
-		_vm->_scrolls->displayText("Get a bit closer to it, Avvy!");
+		_vm->_dialogs->displayText("Get a bit closer to it, Avvy!");
 }
 
 void Acci::winSequence() {
-	_vm->_scrolls->displayScrollChain('q', 78);
+	_vm->_dialogs->displayScrollChain('q', 78);
 	_vm->_sequence->firstShow(7);
 	_vm->_sequence->thenShow(8);
 	_vm->_sequence->thenShow(9);
@@ -1439,7 +1439,7 @@ Common::String Acci::personSpeaks() {
 	}
 
 	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
-		return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
+		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
 	}
 
 	bool found = false; // The _person we're looking for's code is in _person.
@@ -1447,7 +1447,7 @@ Common::String Acci::personSpeaks() {
 
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, '1' + i);
+			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, '1' + i);
 			found = true;
 		}
 	}
@@ -1457,7 +1457,7 @@ Common::String Acci::personSpeaks() {
 
 	for (int i = 0; i < 16; i++) {
 		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
-			tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
+			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
 	}
 
 	return tmpStr;
@@ -1465,8 +1465,8 @@ Common::String Acci::personSpeaks() {
 
 void Acci::heyThanks() {
 	Common::String tmpStr = personSpeaks();
-	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
-	_vm->_scrolls->displayText(tmpStr);
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
+	_vm->_dialogs->displayText(tmpStr);
 	_vm->_gyro->_objects[_thing - 1] = false;
 }
 
@@ -1494,11 +1494,11 @@ void Acci::doThat() {
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_gyro->_alive) {
-			_vm->_scrolls->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
+			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
 			return;
 		}
 		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
-			_vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
+			_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
 			return;
 		}
 	}
@@ -1511,25 +1511,25 @@ void Acci::doThat() {
 		openDoor();
 		break;
 	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
 			if (_vm->_gyro->_carryNum >= kCarryLimit)
-				_vm->_scrolls->displayText("You can't carry any more!");
+				_vm->_dialogs->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
 		} else { // Not... ditto.
 			if (_person != kPardon)
-				_vm->_scrolls->displayText("You can't sweep folk off their feet!");
+				_vm->_dialogs->displayText("You can't sweep folk off their feet!");
 			else
-				_vm->_scrolls->displayText("I assure you, you don't need it.");
+				_vm->_dialogs->displayText("I assure you, you don't need it.");
 		}
 		break;
 	case kVerbCodeDrop:
-		_vm->_scrolls->displayText("Two years ago you dropped a florin in the street. Three days " \
+		_vm->_dialogs->displayText("Two years ago you dropped a florin in the street. Three days " \
 				"later it was gone! So now you never leave ANYTHING lying around. OK?");
 		break;
 	case kVerbCodeInv:
@@ -1538,8 +1538,8 @@ void Acci::doThat() {
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
 			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
-				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Scrolls::kControlItalic, Scrolls::kControlRoman);
-				_vm->_scrolls->displayText(tmpStr);
+				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
+				_vm->_dialogs->displayText(tmpStr);
 			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
@@ -1553,40 +1553,40 @@ void Acci::doThat() {
 				_person = _vm->_gyro->_subjectNum;
 				_vm->_gyro->_subjectNum = 0;
 				if ((_person == 0) || (_person == kPardon))
-					_vm->_scrolls->displayText("Talk to whom?");
+					_vm->_dialogs->displayText("Talk to whom?");
 				else if (isPersonHere())
-					_vm->_scrolls->talkTo(_person);
+					_vm->_dialogs->talkTo(_person);
 			}
 		} else if (isPersonHere())
-			_vm->_scrolls->talkTo(_person);
+			_vm->_dialogs->talkTo(_person);
 		break;
 	case kVerbCodeGive:
 		if (isHolding()) {
 			if (_person == kPardon)
-				_vm->_scrolls->displayText("Give to whom?");
+				_vm->_dialogs->displayText("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
 				case Gyro::kObjectMoney :
-					_vm->_scrolls->displayText("You can't bring yourself to give away your moneybag.");
+					_vm->_dialogs->displayText("You can't bring yourself to give away your moneybag.");
 					break;
 				case Gyro::kObjectBodkin:
 				case Gyro::kObjectBell:
 				case Gyro::kObjectClothes:
 				case Gyro::kObjectHabit :
-					_vm->_scrolls->displayText("Don't give it away, it might be useful!");
+					_vm->_dialogs->displayText("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
 					case Gyro::kPeopleCrapulus:
 						if (_thing == Gyro::kObjectWine) {
-							_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down.");
+							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
 							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
 					case Gyro::kPeopleCwytalot:
 						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-							_vm->_scrolls->displayText("You might be able to influence Cwytalot more if you used it!");
+							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
 							heyThanks();
 						break;
@@ -1596,7 +1596,7 @@ void Acci::doThat() {
 						break;
 					case Gyro::kPeopleIbythneth:
 						if (_thing == Gyro::kObjectBadge) {
-							_vm->_scrolls->displayScrollChain('q', 32); // Thanks! Wow!
+							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_lucerna->incScore(3);
 							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
 							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
@@ -1610,7 +1610,7 @@ void Acci::doThat() {
 						if (_vm->_gyro->_aylesIsAwake) {
 							if (_thing == Gyro::kObjectPen) {
 								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
-								_vm->_scrolls->displayScrollChain('q', 54);
+								_vm->_dialogs->displayScrollChain('q', 54);
 								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
 								_vm->_gyro->_givenPenToAyles = true;
 								_vm->_lucerna->refreshObjectList();
@@ -1618,13 +1618,13 @@ void Acci::doThat() {
 							} else
 								heyThanks();
 						} else
-							_vm->_scrolls->displayText("But he's asleep!");
+							_vm->_dialogs->displayText("But he's asleep!");
 						break;
 					case Gyro::kPeopleGeida:
 						switch (_thing) {
 						case Gyro::kObjectPotion:
 							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
-							_vm->_scrolls->displayScrollChain('u', 16); // She drinks it.
+							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
 							_vm->_lucerna->incScore(2);
 							_vm->_gyro->_givenPotionToGeida = true;
 							_vm->_lucerna->refreshObjectList();
@@ -1642,7 +1642,7 @@ void Acci::doThat() {
 							if (_vm->_gyro->_givenPotionToGeida)
 								winSequence();
 							else
-								_vm->_scrolls->displayScrollChain('q', 77); // That Geida woman!
+								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
 							break;
 						default:
 							heyThanks();
@@ -1670,66 +1670,66 @@ void Acci::doThat() {
 	// We don't handle these two because we use ScummVM's save/load system.
 
 	case kVerbCodePay:
-		_vm->_scrolls->displayText("No money need change hands.");
+		_vm->_dialogs->displayText("No money need change hands.");
 		break;
 	case kVerbCodeLook:
 		lookAround();
 		break;
 	case kVerbCodeBreak:
-		_vm->_scrolls->displayText("Vandalism is prohibited within this game!");
+		_vm->_dialogs->displayText("Vandalism is prohibited within this game!");
 		break;
 	case kVerbCodeQuit: // quit
 		if (!_polite)
-			_vm->_scrolls->displayText("How about a `please\", Avvy?");
+			_vm->_dialogs->displayText("How about a `please\", Avvy?");
 		else {
-			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Scrolls::kControlRegister, Scrolls::kControlIcon);
-			if (_vm->_scrolls->displayQuestion(tmpStr))
+			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
+			if (_vm->_dialogs->displayQuestion(tmpStr))
 				_vm->_gyro->_letMeOut = true;
 		}
 		break;
 	case kVerbCodeGo:
-		_vm->_scrolls->displayText("Just use the arrow keys to walk there.");
+		_vm->_dialogs->displayText("Just use the arrow keys to walk there.");
 		break;
 	case kVerbCodeInfo: {
-		_vm->_scrolls->_aboutScroll = true;
+		_vm->_dialogs->_aboutBox = true;
 
 		Common::String toDisplay;
 		for (int i = 0; i < 7; i++)
-			toDisplay += Scrolls::kControlNewLine;
-		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Scrolls::kControlCenter + Scrolls::kControlNewLine
-			+ "The medi\x91val descendant of" + Scrolls::kControlNewLine
-			+ "Denarius Avaricius Sextus" + Scrolls::kControlNewLine + Scrolls::kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Copyright \xEF "
-			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Scrolls::kControlRegister + 'Y' + Scrolls::kControlIcon;
-		_vm->_scrolls->displayText(toDisplay);
-		_vm->_scrolls->_aboutScroll = false;
+			toDisplay += Dialogs::kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
+			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
+			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
+			+ "version " + _vm->_gyro->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
+			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+		_vm->_dialogs->displayText(toDisplay);
+		_vm->_dialogs->_aboutBox = false;
 		}
 		break;
 	case kVerbCodeUndress:
 		if (_vm->_gyro->_wearing == kNothing)
-			_vm->_scrolls->displayText("You're already stark naked!");
+			_vm->_dialogs->displayText("You're already stark naked!");
 		else if (_vm->_gyro->_avvysInTheCupboard) {
 			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
-			_vm->_scrolls->displayText(tmpStr);
+			_vm->_dialogs->displayText(tmpStr);
 			_vm->_gyro->_wearing = kNothing;
 			_vm->_lucerna->refreshObjectList();
 		} else
-			_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
+			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case kVerbCodeWear:
 		if (isHolding()) { // Wear something.
 			switch (_thing) {
 			case Gyro::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
-				_vm->_scrolls->displayText("Hey, what kind of a weirdo are you\?\?!");
+				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
 				break;
 			case Gyro::kObjectClothes:
 			case Gyro::kObjectHabit: { // Change this!
 				if (_vm->_gyro->_wearing != kNothing) {
 					if (_vm->_gyro->_wearing == _thing)
-						_vm->_scrolls->displayText("You're already wearing that.");
+						_vm->_dialogs->displayText("You're already wearing that.");
 					else
-						_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
+						_vm->_dialogs->displayText("You'll be rather warm wearing two sets of clothes!");
 					return;
 				} else
 					_vm->_gyro->_wearing = _thing;
@@ -1753,7 +1753,7 @@ void Acci::doThat() {
 				}
 				break;
 			default:
-				_vm->_scrolls->displayText(kWhat);
+				_vm->_dialogs->displayText(kWhat);
 			}
 		}
 		break;
@@ -1767,20 +1767,20 @@ void Acci::doThat() {
 				// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
 				if (_vm->_gyro->_wonNim) { // Already won the game.
-					_vm->_scrolls->displayScrollChain('Q', 6);
+					_vm->_dialogs->displayScrollChain('Q', 6);
 					return;
 				}
 
 				if (!_vm->_gyro->_askedDogfoodAboutNim) {
-					_vm->_scrolls->displayScrollChain('q', 84);
+					_vm->_dialogs->displayScrollChain('q', 84);
 					return;
 				}
 
-				_vm->_scrolls->displayScrollChain('Q', 3);
+				_vm->_dialogs->displayScrollChain('Q', 3);
 				_vm->_gyro->_playedNim++;
 
 				// You won - strange!
-				_vm->_scrolls->displayScrollChain('Q', 7); // You won! Give us a lute!
+				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
 				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
 				_vm->_lucerna->refreshObjectList();
 				_vm->_gyro->_wonNim = true;
@@ -1791,8 +1791,8 @@ void Acci::doThat() {
 					_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-				_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-					+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
+				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+					+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
 				break;
 			case kRoomMusicRoom:
 				playHarp();
@@ -1801,41 +1801,41 @@ void Acci::doThat() {
 		} else if (isHolding()) {
 			switch (_thing) {
 			case Gyro::kObjectLute :
-					_vm->_scrolls->displayScrollChain('U', 7);
+					_vm->_dialogs->displayScrollChain('U', 7);
 
 					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
-						_vm->_scrolls->displayScrollChain('U', 10);
+						_vm->_dialogs->displayScrollChain('U', 10);
 
 					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
-						_vm->_scrolls->displayScrollChain('U', 15);
+						_vm->_dialogs->displayScrollChain('U', 15);
 				break;
 			case 52:
 				if (_vm->_gyro->_room == kRoomMusicRoom)
 					playHarp();
 				else
-					_vm->_scrolls->displayText(kWhat);
+					_vm->_dialogs->displayText(kWhat);
 				break;
 			case 55:
 				if (_vm->_gyro->_room == kRoomArgentPub)
 					// play_nim();
 					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
 				else
-					_vm->_scrolls->displayText(kWhat);
+					_vm->_dialogs->displayText(kWhat);
 				break;
 			default:
-				_vm->_scrolls->displayText(kWhat);
+				_vm->_dialogs->displayText(kWhat);
 			}
 		}
 		break;
 	case kVerbCodeRing:
 		if (isHolding()) {
 			if (_thing == Gyro::kObjectBell) {
-				_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
-					_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
+					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
-				_vm->_scrolls->displayText(kWhat);
+				_vm->_dialogs->displayText(kWhat);
 		}
 		break;
 	case kVerbCodeHelp:
@@ -1843,10 +1843,10 @@ void Acci::doThat() {
 		warning("STUB: Acci::doThat() - case kVerbCodehelp");
 		break;
 	case kVerbCodeLarrypass:
-		_vm->_scrolls->displayText("Wrong game!");
+		_vm->_dialogs->displayText("Wrong game!");
 		break;
 	case kVerbCodePhaon:
-		_vm->_scrolls->displayText("Hello, Phaon!");
+		_vm->_dialogs->displayText("Hello, Phaon!");
 		break;
 	case kVerbCodeBoss:
 		// bosskey();
@@ -1854,27 +1854,27 @@ void Acci::doThat() {
 		break;
 	case kVerbCodePee:
 		if (_vm->_gyro->setFlag('P')) {
-			_vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
+			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else {
-			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-			_vm->_scrolls->displayText(tmpStr);
+			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeCheat: {
-		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Scrolls::kControlItalic);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
+		_vm->_dialogs->displayText(tmpStr);
 		_vm->_gyro->_cheat = true;
 		}
 		break;
 	case kVerbCodeMagic:
 		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_scrolls->displayScrollChain('q', 19);
+			_vm->_dialogs->displayScrollChain('q', 19);
 		else {
 			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
-				_vm->_scrolls->displayScrollChain('q', 17);
+				_vm->_dialogs->displayScrollChain('q', 17);
 				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
-					_vm->_scrolls->displayScrollChain('q', 18);
+					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
 					spr->init(1, false, _vm->_animation); // Avaricius
@@ -1886,31 +1886,31 @@ void Acci::doThat() {
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
 			} else
-				_vm->_scrolls->displayText("Nothing appears to happen...");
+				_vm->_dialogs->displayText("Nothing appears to happen...");
 		}
 		break;
 	case kVerbCodeSmartAlec:
-		_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
+		_vm->_dialogs->displayText("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
 		switch (_vm->_gyro->_sworeNum) {
 		case 0: {
 			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
-				"(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
+				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
 			}
 			break;
 		case 1: {
 			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
-				"do things I tell you not to?%c%cDon't do it again!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
+				"do things I tell you not to?%c%cDon't do it again!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
 			}
 			break;
 		default: {
 			_vm->_pingo->zonk();
 			// CHECKME: Weird character in string
-			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-			_vm->_scrolls->displayText(tmpStr);
+			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
 			_vm->_lucerna->gameOver();
 			}
 		}
@@ -1918,11 +1918,11 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeListen:
 		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-			_vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
+			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
 		else if (_vm->_gyro->_listen.empty())
-			_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy.");
+			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_scrolls->displayText(_vm->_gyro->_listen);
+			_vm->_dialogs->displayText(_vm->_gyro->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
 		switch (_vm->_gyro->_room) {
@@ -1934,12 +1934,12 @@ void Acci::doThat() {
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
 					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-						_vm->_scrolls->displayScrollChain('D', 15);
+						_vm->_dialogs->displayScrollChain('D', 15);
 						return;
 					}
 
 					if (_vm->_gyro->_teetotal)  {
-						_vm->_scrolls->displayScrollChain('D', 6);
+						_vm->_dialogs->displayScrollChain('D', 6);
 						return;
 					}
 
@@ -1947,7 +1947,7 @@ void Acci::doThat() {
 						_vm->_lucerna->incScore(3);
 
 					_vm->_background->drawBackgroundSprite(-1, -1, 11);
-					_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble);
+					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
 					_vm->_gyro->_drinking = _thing;
 
 					_vm->_background->drawBackgroundSprite(-1, -1, 9);
@@ -1959,21 +1959,21 @@ void Acci::doThat() {
 					break; // We have a right one here - buy Pepsi??!
 				case Gyro::kObjectWine:
 					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
-						_vm->_scrolls->displayScrollChain('D', 2); // 1 bottle's shufishent!
+						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-							_vm->_scrolls->displayScrollChain('D', 15);
+							_vm->_dialogs->displayScrollChain('D', 15);
 							return;
 						}
 
 						if (_vm->_gyro->_carryNum >= kCarryLimit) {
-							_vm->_scrolls->displayText("Your hands are full.");
+							_vm->_dialogs->displayText("Your hands are full.");
 							return;
 						}
 
 						_vm->_background->drawBackgroundSprite(-1, -1, 11);
-						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-						_vm->_scrolls->displayText(tmpStr);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+						_vm->_dialogs->displayText(tmpStr);
 						if (_vm->_gyro->_alcoholLevel == 0)
 							_vm->_lucerna->incScore(3);
 						_vm->_background->drawBackgroundSprite(-1, -1, 9);
@@ -1984,21 +1984,21 @@ void Acci::doThat() {
 					break;
 				}
 			} else
-				_vm->_scrolls->displayScrollChain('D', 5); // Go to the bar!
+				_vm->_dialogs->displayScrollChain('D', 5); // Go to the bar!
 			break;
 
 		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(5)) {
 				if (_thing == Gyro::kObjectOnion) {
 					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
-						_vm->_scrolls->displayScrollChain('D', 10); // Not planning to juggle with the things!
+						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_gyro->_carryNum >= kCarryLimit)
-						_vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
+						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
 					else {
 						if (_vm->_gyro->_boughtOnion)
-							_vm->_scrolls->displayScrollChain('D', 11);
+							_vm->_dialogs->displayScrollChain('D', 11);
 						else {
-							_vm->_scrolls->displayScrollChain('D', 9);
+							_vm->_dialogs->displayScrollChain('D', 9);
 							_vm->_lucerna->incScore(3);
 						}
 						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
@@ -2009,16 +2009,16 @@ void Acci::doThat() {
 						_vm->_gyro->_onionInVinegar = false;
 					}
 				} else
-					_vm->_scrolls->displayScrollChain('D', 0);
+					_vm->_dialogs->displayScrollChain('D', 0);
 			} else
-				_vm->_scrolls->displayScrollChain('D', 0);
+				_vm->_dialogs->displayScrollChain('D', 0);
 			break;
 
 		case kRoomNottsPub:
-			_vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners.
+			_vm->_dialogs->displayScrollChain('n', 15); // Can't sell to southerners.
 			break;
 		default:
-			_vm->_scrolls->displayScrollChain('D', 0); // Can't buy that.
+			_vm->_dialogs->displayScrollChain('D', 0); // Can't buy that.
 		}
 		break;
 	case kVerbCodeAttack:
@@ -2028,17 +2028,17 @@ void Acci::doThat() {
 			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
-				_vm->_scrolls->displayScrollChain('Q', 10);
-				_vm->_scrolls->displayText("(At the very least, don't use your bare hands!)");
+				_vm->_dialogs->displayScrollChain('Q', 10);
+				_vm->_dialogs->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_scrolls->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
+				_vm->_dialogs->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
 				break;
 			case 2:
-				_vm->_scrolls->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
+				_vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
-				_vm->_scrolls->displayScrollChain('Q', 11);
+				_vm->_dialogs->displayScrollChain('Q', 11);
 				_vm->_gyro->_cwytalotGone = true;
 				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
 				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
@@ -2051,14 +2051,14 @@ void Acci::doThat() {
 				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy;
 				break;
 			default:
-				_vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent!
+				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
 			}
 		} else
-			_vm->_scrolls->displayScrollChain('Q', 10);
+			_vm->_dialogs->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
 		if (_vm->_gyro->_room != kRoomBridge)
-			_vm->_scrolls->displayScrollChain('Q', 12);
+			_vm->_dialogs->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (uint i = 0; i < _thats.size(); i++) {
@@ -2073,15 +2073,15 @@ void Acci::doThat() {
 
 			if (ok) {
 				if (_vm->_gyro->_drawbridgeOpen != 0)
-					_vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
+					_vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
 					_vm->_lucerna->incScore(4);
-					_vm->_scrolls->displayText("The drawbridge opens!");
+					_vm->_dialogs->displayText("The drawbridge opens!");
 					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
 					_vm->_gyro->_drawbridgeOpen = 1;
 				}
 			} else
-				_vm->_scrolls->displayScrollChain('Q', 12);
+				_vm->_dialogs->displayScrollChain('Q', 12);
 		}
 		break;
 	case kVerbCodeDir:
@@ -2091,8 +2091,8 @@ void Acci::doThat() {
 		_vm->_lucerna->gameOver();
 		break;
 	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str());
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
+		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodePut:
@@ -2103,30 +2103,30 @@ void Acci::doThat() {
 		break;
 	case kVerbCodeKiss:
 		if (_person == kPardon)
-			_vm->_scrolls->displayText("Kiss whom?");
+			_vm->_dialogs->displayText("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
 			case Gyro::kPeopleArkata:
-				_vm->_scrolls->displayScrollChain('U', 12);
+				_vm->_dialogs->displayScrollChain('U', 12);
 				break;
 			case Gyro::kPeopleGeida:
-				_vm->_scrolls->displayScrollChain('U', 13);
+				_vm->_dialogs->displayScrollChain('U', 13);
 				break;
 			case Gyro::kPeopleWisewoman:
-				_vm->_scrolls->displayScrollChain('U', 14);
+				_vm->_dialogs->displayScrollChain('U', 14);
 				break;
 			default:
-				_vm->_scrolls->displayScrollChain('U', 5); // You WHAT?
+				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
 			}
 		} else if ((Gyro::kPeopleAvalot <= _person) && (_person < Gyro::kPeopleArkata))
-			_vm->_scrolls->displayText("Hey, what kind of a weirdo are you??");
+			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
 
 		break;
 	case kVerbCodeClimb:
 		if (_vm->_gyro->_room == kRoomInsideCardiffCastle)
 			cardiffClimbing();
 		else // In the wrong room!
-			_vm->_scrolls->displayText("Not with your head for heights, Avvy!");
+			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
@@ -2148,28 +2148,28 @@ void Acci::doThat() {
 					_vm->_gyro->_avvyInBed = true;
 					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
 					if (_vm->_gyro->_teetotal)
-						_vm->_scrolls->displayScrollChain('d', 13);
+						_vm->_dialogs->displayScrollChain('d', 13);
 				} else
-					_vm->_scrolls->displayText("You're already awake, Avvy!");
+					_vm->_dialogs->displayText("You're already awake, Avvy!");
 				break;
 			case Gyro::kPeopleAyles:
 				if (!_vm->_gyro->_aylesIsAwake)
-					_vm->_scrolls->displayText("You can't seem to wake him by yourself.");
+					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
 				break;
 			case Gyro::kPeopleJacques: {
 				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
-					"Hmmm... that doesn't seem to do any good...", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-				_vm->_scrolls->displayText(tmpStr);
+					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+				_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
 			default:
-				_vm->_scrolls->displayText("It's difficult to awaken people who aren't asleep...!");
+				_vm->_dialogs->displayText("It's difficult to awaken people who aren't asleep...!");
 		}
 		break;
 	case kVerbCodeSit:
 		if (_vm->_gyro->_room == kRoomNottsPub) {
 			if (_vm->_gyro->_sittingInPub)
-				_vm->_scrolls->displayText("You're already sitting!");
+				_vm->_dialogs->displayText("You're already sitting!");
 			else {
 				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
@@ -2178,35 +2178,35 @@ void Acci::doThat() {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->hangAroundForAWhile();
 			_vm->_lucerna->dawn();
-			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Scrolls::kControlParagraph);
-			_vm->_scrolls->displayText(tmpStr);
+			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
+			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeRestart:
-		if (_vm->_scrolls->displayQuestion("Restart game and lose changes?"))  {
+		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
 			_vm->_lucerna->dusk();
 			_vm->_gyro->newGame();
 			_vm->_lucerna->dawn();
 		}
 		break;
 	case kPardon:
-		_vm->_scrolls->displayText("Hey, a verb would be helpful!");
+		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
 		break;
 	case kVerbCodeHello: {
 		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("Hello.%c", Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
+		tmpStr += Common::String::format("Hello.%c", Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeThanks: {
 		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("That's OK.%c", Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
+		tmpStr += Common::String::format("That's OK.%c", Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	default:
-		Common::String tmpStr = Common::String::format("%cParser bug!", Scrolls::kControlBell);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("%cParser bug!", Dialogs::kControlBell);
+		_vm->_dialogs->displayText(tmpStr);
 	}
 }
 
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index fafd088..8fb28ed 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -29,7 +29,7 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/animation.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
 #include "avalanche/background.h"
@@ -216,8 +216,8 @@ void AnimationType::walk() {
 				break;
 			case Gyro::kMagicUnfinished: {
 				bounce();
-				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Scrolls::kControlBell, Scrolls::kControlCenter, Scrolls::kControlRoman);
-				_anim->_vm->_scrolls->displayText(tmpStr);
+				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Dialogs::kControlBell, Dialogs::kControlCenter, Dialogs::kControlRoman);
+				_anim->_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
 			case Gyro::kMagicSpecial:
@@ -421,12 +421,12 @@ void Animation::catacombMove(byte ped) {
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
 		flipRoom(kRoomLustiesRoom, 4);
-		_vm->_scrolls->displayText("Phew! Nice to be out of there!");
+		_vm->_dialogs->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033:{ // Oubliette
 		flipRoom(kRoomOubliette, 1);
-		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
 		}
 		return;
 	case 4:
@@ -434,7 +434,7 @@ void Animation::catacombMove(byte ped) {
 		return;
 	case 2307:
 		flipRoom(kRoomLusties, 5);
-		_vm->_scrolls->displayText("Oh no... here we go again...");
+		_vm->_dialogs->displayText("Oh no... here we go again...");
 		_vm->_gyro->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
 		_sprites[0]._moveX = 0;
@@ -733,7 +733,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_gyro->_magics[11]._data = 5;
 		_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
 		stopWalking();
-		_vm->_scrolls->displayScrollChain('q', 26);
+		_vm->_dialogs->displayScrollChain('q', 26);
 		_vm->_gyro->_userMovesAvvy = true;
 		break;
 	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
@@ -763,11 +763,11 @@ void Animation::callSpecial(uint16 which) {
 		if (_vm->_gyro->_friarWillTieYouUp) {
 			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
 			_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
-			_vm->_scrolls->displayScrollChain('q', 35);
+			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_scrolls->displayScrollChain('q', 36);
+			_vm->_dialogs->displayScrollChain('q', 36);
 			_vm->_gyro->_tiedUp = true;
 			_vm->_gyro->_friarWillTieYouUp = false;
 			_sprites[1].walkTo(2);
@@ -791,12 +791,12 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
 		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
-		_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
+		_vm->_dialogs->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
 		if ((_vm->_gyro->_geidaFollows) && (!_vm->_gyro->_lustieIsAsleep)) {
-			_vm->_scrolls->displayScrollChain('q', 63);
+			_vm->_dialogs->displayScrollChain('q', 63);
 			_sprites[1].turn(kDirDown);
 			_sprites[1].stopWalk();
 			_sprites[1]._callEachStepFl = false; // Geida
@@ -816,9 +816,9 @@ void Animation::callSpecial(uint16 which) {
 		if ((_vm->_gyro->_catacombX == 4) && (_vm->_gyro->_catacombY == 1)) {
 			// Into Geida's room.
 			if (_vm->_gyro->_objects[Gyro::kObjectKey - 1])
-				_vm->_scrolls->displayScrollChain('q', 62);
+				_vm->_dialogs->displayScrollChain('q', 62);
 			else {
-				_vm->_scrolls->displayScrollChain('q', 61);
+				_vm->_dialogs->displayScrollChain('q', 61);
 				return;
 			}
 		}
@@ -1034,7 +1034,7 @@ void Animation::arrowProcs(byte tripnum) {
 			// OK, it's hit him... what now?
 
 			_sprites[1]._callEachStepFl = false; // prevent recursion.
-			_vm->_scrolls->displayScrollChain('Q', 47); // Complaint!
+			_vm->_dialogs->displayScrollChain('Q', 47); // Complaint!
 			_sprites[tripnum].remove(); // Deallocate the arrow.
 
 			_vm->_lucerna->gameOver();
@@ -1091,7 +1091,7 @@ void Animation::spin(byte whichway, byte &tripnum) {
 		_vm->_gyro->_geidaSpin += 1;
 		_vm->_gyro->_geidaTime = 20;
 		if (_vm->_gyro->_geidaSpin == 5) {
-			_vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
+			_vm->_dialogs->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
 			_vm->_gyro->_geidaSpin = 0;
 			_vm->_gyro->_geidaTime = 0; // knock out records
 		}
@@ -1215,7 +1215,7 @@ void Animation::animLink() {
 
 	if (_mustExclaim) {
 		_mustExclaim = false;
-		_vm->_scrolls->displayScrollChain('x', _sayWhat);
+		_vm->_dialogs->displayScrollChain('x', _sayWhat);
 	}
 }
 
@@ -1233,13 +1233,13 @@ void Animation::stopWalking() {
 void Animation::hideInCupboard() {
 	if (_vm->_gyro->_avvysInTheCupboard) {
 		if (_vm->_gyro->_wearing == Acci::kNothing) {
-			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-			_vm->_scrolls->displayText(tmpStr);
+			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			_sprites[0]._visible = true;
 			_vm->_gyro->_userMovesAvvy = true;
 			appearPed(0, 2); // Walk out of the cupboard.
-			_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!");
+			_vm->_dialogs->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_gyro->_avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
 			_vm->_sequence->thenShow(7);
@@ -1250,8 +1250,8 @@ void Animation::hideInCupboard() {
 		_sprites[0]._visible = false;
 		_vm->_gyro->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
-			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
-		_vm->_scrolls->displayText(tmpStr);
+			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Dialogs::kControlParagraph);
+		_vm->_dialogs->displayText(tmpStr);
 		_vm->_gyro->_avvysInTheCupboard = true;
 		_vm->_background->drawBackgroundSprite(-1, -1, 7);
 	}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index f140ae9..d7a07fe 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -63,7 +63,7 @@ AvalancheEngine::~AvalancheEngine() {
 
 	delete _avalot;
 	delete _pingo;
-	delete _scrolls;
+	delete _dialogs;
 	delete _lucerna;
 	delete _background;
 	delete _sequence;
@@ -83,7 +83,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_avalot = new Avalot(this);
 	_gyro = new Gyro(this);
 	_pingo = new Pingo(this);
-	_scrolls = new Scrolls(this);
+	_dialogs = new Dialogs(this);
 	_lucerna = new Lucerna(this);
 	_background = new Background(this);
 	_sequence = new Sequence(this);
@@ -95,7 +95,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_sound = new SoundHandler(this);
 
 	_graphics->init();
-	_scrolls->init();
+	_dialogs->init();
 	_lucerna->init();
 	_acci->init();
 	_parser->init();
@@ -453,10 +453,10 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_background->updateBackgroundSprites();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
-		Scrolls::kControlItalic, Scrolls::kControlRoman, description.c_str(), Scrolls::kControlCenter, 
-		Scrolls::kControlNewLine, Scrolls::kControlNewLine, _gyro->_roomnName.c_str(), Scrolls::kControlNewLine, 
-		Scrolls::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
-	_scrolls->displayText(tmpStr);
+		Dialogs::kControlItalic, Dialogs::kControlRoman, description.c_str(), Dialogs::kControlCenter, 
+		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _gyro->_roomnName.c_str(), Dialogs::kControlNewLine, 
+		Dialogs::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
+	_dialogs->displayText(tmpStr);
 
 	AnimationType *avvy = &_animation->_sprites[0];
 	if (avvy->_quick && avvy->_visible)
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 16482c8..2a7df29 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -34,7 +34,7 @@
 #include "avalanche/avalot.h"
 #include "avalanche/gyro.h"
 #include "avalanche/pingo.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/background.h"
 #include "avalanche/sequence.h"
@@ -70,7 +70,7 @@ public:
 	Avalot *_avalot;
 	Gyro *_gyro;
 	Pingo *_pingo;
-	Scrolls *_scrolls;
+	Dialogs *_dialogs;
 	Lucerna *_lucerna;
 	Background *_background;
 	Sequence *_sequence;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7126f33..5dc7fcf 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -34,7 +34,7 @@
 #include "avalanche/animation.h"
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/menu.h"
 #include "avalanche/pingo.h"
 #include "avalanche/timer.h"
@@ -120,7 +120,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
 void Avalot::setup() {
 	_vm->_gyro->init();
 
-	_vm->_scrolls->resetScroll();
+	_vm->_dialogs->reset();
 	_vm->_lucerna->dusk();
 	_vm->_lucerna->loadDigits();
 
@@ -128,7 +128,7 @@ void Avalot::setup() {
 	_vm->_parser->_quote = true;
 
 	_vm->_lucerna->drawToolbar();
-	_vm->_scrolls->setReadyLight(2);
+	_vm->_dialogs->setReadyLight(2);
 
 	_vm->_animation->_direction = Animation::kDirStopped;
 	_vm->_animation->loadAnims();
@@ -155,7 +155,7 @@ void Avalot::setup() {
 		_vm->_lucerna->fxToggle();
 		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
 
-		_vm->_scrolls->displayScrollChain('q', 83); // Info on the game, etc.
+		_vm->_dialogs->displayScrollChain('q', 83); // Info on the game, etc.
 	}
 }
 
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
new file mode 100644
index 0000000..a496fcd
--- /dev/null
+++ b/engines/avalanche/dialogs.cpp
@@ -0,0 +1,1087 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+ /* SCROLLS		The scroll driver. */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/dialogs.h"
+#include "avalanche/gyro.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/animation.h"
+#include "avalanche/acci.h"
+#include "avalanche/timer.h"
+
+#include "common/textconsole.h"
+#include "common/file.h"
+
+namespace Avalanche {
+
+Dialogs::Dialogs(AvalancheEngine *vm) {
+	_vm = vm;
+	_noError = true;
+}
+
+void Dialogs::init() {
+	loadFont();
+	resetScrollDriver();
+}
+
+void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
+	if (_vm->_gyro->_ledStatus == state)
+		return; // Already like that!
+
+	byte color = kColorBlack;
+	switch (state) {
+	case 0:
+		color = kColorBlack;
+		break; // Off
+	case 1:
+	case 2:
+	case 3:
+		color = kColorGreen;
+		break; // Hit a key
+	}
+	warning("STUB: Scrolls::state()");
+
+	CursorMan.showMouse(false);
+
+	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
+
+	CursorMan.showMouse(true);
+	_vm->_gyro->_ledStatus = state;
+}
+
+void Dialogs::easterEgg() {
+	warning("STUB: Scrolls::easterEgg()");
+}
+
+void Dialogs::say(int16 x, int16 y, Common::String z) {
+	FontType itw;
+	byte lz = z.size();
+
+	bool offset = x % 8 == 4;
+	x /= 8;
+	y++;
+	int16 i = 0;
+	for (int xx = 0; xx < lz; xx++) {
+		switch (z[xx]) {
+		case kControlRoman:
+			_currentFont = kFontStyleRoman;
+			break;
+		case kControlItalic:
+			_currentFont = kFontStyleItalic;
+			break;
+		default: {
+			for (int yy = 0; yy < 12; yy++)
+				itw[(byte)z[xx]][yy] = _fonts[_currentFont][(byte)z[xx]][yy + 2];
+
+			// We have to draw the characters one-by-one because of the accidental font changes.
+			i++;
+			Common::String chr(z[xx]);
+			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, kColorBlack);
+			}
+		}
+	}
+}
+
+void Dialogs::scrollModeNormal() {
+	// Original code is:
+	// egg : array[1..8] of char = ^P^L^U^G^H+'***';
+	// this is not using kControl characters: it's the secret code to be entered to trigger the easter egg
+	// TODO: To be fixed when the Easter egg code is implemented
+	Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
+	Common::String e = "(c) 1994";
+
+	setReadyLight(3);
+	_vm->_gyro->_seeScroll = true;
+	_vm->_gyro->newMouse(3);
+
+	::Graphics::Surface temp;
+	temp.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+
+	Common::Event event;
+	while (!_vm->shouldQuit()) {
+		_vm->_graphics->refreshScreen();
+
+		_vm->getEvent(event);
+		if (_vm->shouldQuit() || 
+			(event.type == Common::EVENT_LBUTTONUP) ||
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE)
+			|| (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH)
+			|| (event.kbd.keycode == Common::KEYCODE_PLUS))))
+			break;
+	}
+
+	_vm->_graphics->_surface.copyFrom(temp);
+	temp.free();
+
+	warning("STUB: scrollModeNormal() - Check Easter Egg trigger");
+#if 0
+	char r;
+	bool oktoexit;
+	do {
+		do {
+			_vm->_gyro->check(); // was "checkclick;"
+
+//#ifdef RECORD slowdown(); basher::count += 1; #endif
+
+			if (_vm->_enhanced->keypressede())
+				break;
+		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
+
+
+		if (mrelease == 0) {
+			inkey();
+			if (aboutscroll) {
+				move(e[2 - 1], e[1 - 1], 7);
+				e[8 - 1] = inchar;
+				if (egg == e)
+					easteregg();
+			}
+			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
+			if (!oktoexit)  errorled();
+		}
+
+	} while (!((oktoexit) || (mrelease > 0)));
+
+//#ifdef RECORD record_one(); #endif
+
+	_vm->_gyro->screturn = r == '#'; // "back door"
+#endif
+
+	setReadyLight(0);
+	_vm->_gyro->_seeScroll = false;
+	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
+
+	warning("STUB: Scrolls::scrollModeNormal()");
+}
+
+void Dialogs::scrollModeDialogue() {
+	warning("STUB: Scrolls::scrollModeDialogue()");
+}
+
+void Dialogs::store(byte what, TuneType &played) {
+	memcpy(played, played + 1, sizeof(played) - 1);
+	played[30] = what;
+}
+
+bool Dialogs::theyMatch(TuneType &played) {
+	byte mistakes = 0;
+
+	for (unsigned int i = 0; i < sizeof(played); i++) {
+		if (played[i] != _vm->_gyro->kTune[i])
+			mistakes += 1;
+	}
+
+	return mistakes < 5;
+}
+
+void Dialogs::scrollModeMusic() {
+	setReadyLight(3);
+	_vm->_gyro->_seeScroll = true;
+	CursorMan.showMouse(false);
+	_vm->_gyro->newMouse(3);
+
+	TuneType played;
+	for (unsigned int i = 0; i < sizeof(played); i++)
+		played[i] = Gyro::kPitchInvalid;
+	int8 lastOne = -1, thisOne = -1; // Invalid values.
+
+	_vm->_gyro->_seeScroll = true;
+
+	::Graphics::Surface temp;
+	temp.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+
+	Common::Event event;
+	while (!_vm->shouldQuit()) {
+		_vm->_graphics->refreshScreen();
+
+		_vm->getEvent(event);
+
+		// When we stop playing?
+		if ((event.type == Common::EVENT_LBUTTONDOWN) ||
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)))) {
+				break;
+		}
+
+		// When we DO play:
+		if ((event.type == Common::EVENT_KEYDOWN)
+			&& ((event.kbd.keycode == Common::KEYCODE_q) || (event.kbd.keycode == Common::KEYCODE_w)
+			|| (event.kbd.keycode == Common::KEYCODE_e) || (event.kbd.keycode == Common::KEYCODE_r)
+			|| (event.kbd.keycode == Common::KEYCODE_t) || (event.kbd.keycode == Common::KEYCODE_y)
+			|| (event.kbd.keycode == Common::KEYCODE_u) || (event.kbd.keycode == Common::KEYCODE_i)
+			|| (event.kbd.keycode == Common::KEYCODE_o) || (event.kbd.keycode == Common::KEYCODE_p)
+			|| (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET) || (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
+				byte value;
+				switch (event.kbd.keycode) {
+				case Common::KEYCODE_q:
+					value = 0;
+					break;
+				case Common::KEYCODE_w:
+					value = 1;
+					break;
+				case Common::KEYCODE_e:
+					value = 2;
+					break;
+				case Common::KEYCODE_r:
+					value = 3;
+					break;
+				case Common::KEYCODE_t:
+					value = 4;
+					break;
+				case Common::KEYCODE_y:
+					value = 5;
+					break;
+				case Common::KEYCODE_u:
+					value = 6;
+					break;
+				case Common::KEYCODE_i:
+					value = 7;
+					break;
+				case Common::KEYCODE_o:
+					value = 8;
+					break;
+				case Common::KEYCODE_p:
+					value = 9;
+					break;
+				case Common::KEYCODE_LEFTBRACKET:
+					value = 10;
+					break;
+				case Common::KEYCODE_RIGHTBRACKET:
+					value = 11;
+					break;
+				default:
+					break;
+				}
+
+				lastOne = thisOne;
+				thisOne = value;
+
+				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
+				_vm->_system->delayMillis(200);
+
+				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
+					if (thisOne < lastOne)
+						store(Gyro::kPitchLower, played);
+					else if (thisOne == lastOne)
+						store(Gyro::kPitchSame, played);
+					else
+						store(Gyro::kPitchHigher, played);
+				}
+				
+				if (theyMatch(played)) {
+					setReadyLight(0);
+					_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
+					break;
+				}
+		}
+	}
+
+	_vm->_graphics->_surface.copyFrom(temp);
+	temp.free();
+	_vm->_gyro->_seeScroll = false;
+	CursorMan.showMouse(true);
+}
+
+void Dialogs::resetScrollDriver() {
+	_vm->_gyro->_scrollBells = 0;
+	_currentFont = kFontStyleRoman;
+	_useIcon = 0;
+	_vm->_gyro->_interrogation = 0; // Always reset after a scroll comes up.
+}
+
+void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
+	for (int i = 0; i < _vm->_gyro->_scrollBells; i++)
+		_vm->_lucerna->errorLed(); // Ring the bell "x" times.
+}
+
+void Dialogs::dodgem() {
+	_dodgeCoord = _vm->getMousePos();
+	g_system->warpMouse(_dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
+}
+
+void Dialogs::unDodgem() {
+	Common::Point actCoord = _vm->getMousePos();
+	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
+		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
+}
+
+void Dialogs::getIcon(int16 x, int16 y, byte which) {
+	Common::File file;
+
+	if (!file.open("icons.avd"))
+		error("AVALANCHE: Scrolls: File not found: icons.avd");
+
+	which--;
+	file.seek(which * 426);
+
+	byte *p = new byte[426];
+	file.read(p, 426);
+
+	//putimage(x, y, p, 0);
+	warning("STUB: Scrolls::getIcon()");
+
+	delete[] p;
+	file.close();
+}
+
+void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
+	Common::File file;
+	Common::String filename = Common::String::format("%s.avd", fn.c_str());
+
+	if (!file.open(filename))
+		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
+
+#if 0
+	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
+	byte bit;
+	for (uint16 i = 1; i <= yl; i++)
+		for (bit = 0; bit <= 3; bit++) {
+			port[0x3c4] = 2;
+			port[0x3ce] = 4;
+			port[0x3c5] = 1 << bit;
+			port[0x3cf] = bit;
+			blockread(f, mem[0xa000 * st + (i * 80)], xl);
+		}
+	bit = getpixel(0, 0);
+#endif
+
+	warning("STUB: Scrolls::drawSign()");
+
+	file.close();
+}
+
+void Dialogs::drawScroll(DialogFunctionType modeFunc) {
+	int16 lx = 0;
+	int16 ly = (_vm->_gyro->_scrollNum) * 6;
+	int16 ex;
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		ex = _vm->_gyro->_scroll[i].size() * 8;
+		if (lx < ex)
+			lx = ex;
+	}
+	int16 mx = 320;
+	int16 my = 100; // Getmaxx & getmaxy div 2, both.
+	lx /= 2;
+	ly -= 2;
+
+	if ((1 <= _useIcon) && (_useIcon <= 34))
+		lx += kHalfIconWidth;
+
+	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
+
+	CursorMan.showMouse(false);
+
+	// The right corners of the scroll.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorLightgray);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
+
+	// The body of the scroll.
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
+
+	// The left corners of the scroll.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
+	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
+	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
+
+	// The rear borders of the scroll.
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
+
+	mx -= lx;
+	my -= ly + 2;
+
+	bool centre = false;
+
+	byte iconIndent = 0;
+	switch (_useIcon) {
+	case 0:
+		iconIndent = 0;
+		break; // No icon.
+	case 34:
+		drawSign("about", 28, 76, 15);
+		iconIndent = 0;
+		break;
+	case 35:
+		drawSign("gameover", 52, 59, 71);
+		iconIndent = 0;
+		break;
+	}
+
+	if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon.
+		getIcon(mx, my + ly / 2, _useIcon);
+		iconIndent = 53;
+	}
+
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		if (!_vm->_gyro->_scroll[i].empty())
+			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
+			case kControlCenter:
+				centre = true;
+				_vm->_gyro->_scroll[i].deleteLastChar();
+				break;
+			case kControlLeftJustified:
+				centre = false;
+				_vm->_gyro->_scroll[i].deleteLastChar();
+				break;
+			case kControlQuestion:
+				//settextjustify(1, 1);
+				_shadowBoxX = mx + lx;
+				_shadowBoxY = my + ly;
+				_vm->_gyro->_scroll[i].setChar(' ', 0);
+				// byte groi = *_vm->_graphics->getPixel(0, 0);
+				// inc(diy,14);
+				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
+				_vm->_gyro->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
+				break;
+			}
+
+		if (centre)
+			say(320 - _vm->_gyro->_scroll[i].size() * 4 + iconIndent, my, _vm->_gyro->_scroll[i]);
+		else
+			say(mx + iconIndent, my, _vm->_gyro->_scroll[i]);
+
+		my += 12;
+	}
+
+	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+	ringBell();
+	
+	_vm->_gyro->_dropsOk = false;
+	dodgem();
+
+	(this->*modeFunc)();
+
+	unDodgem();
+	_vm->_gyro->_dropsOk = true;
+	
+	resetScrollDriver();
+}
+
+void Dialogs::drawBubble(DialogFunctionType modeFunc) {
+	Common::Point points[3];
+
+	CursorMan.showMouse(false);
+	int16 xl = 0;
+	int16 yl = _vm->_gyro->_scrollNum * 5;
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		uint16 textWidth = _vm->_gyro->_scroll[i].size() * 8;
+		if (textWidth > xl)
+			xl = textWidth;
+	}
+	xl /= 2;
+
+	int16 xw = xl + 18;
+	int16 yw = yl + 7;
+	int16 my = yw * 2 - 2;
+	int16 xc = 0;
+
+	if ((_vm->_gyro->_talkX - xw) < 0)
+		xc = -(_vm->_gyro->_talkX - xw);
+	if ((_vm->_gyro->_talkX + xw) > 639)
+		xc = 639 - (_vm->_gyro->_talkX + xw);
+
+	points[0].x = _vm->_gyro->_talkX - 10;
+	points[0].y = yw;
+	points[1].x = _vm->_gyro->_talkX + 10;
+	points[1].y = yw;
+	points[2].x = _vm->_gyro->_talkX;
+	points[2].y = _vm->_gyro->_talkY;
+
+	// Backup the screen before drawing the bubble.
+	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
+
+	// The body of the bubble.
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw + 9, 7, _vm->_gyro->_talkX + xw - 8 + xc, my + 1), _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw - 1, 12, _vm->_gyro->_talkX + xw + xc + 2, my - 4), _vm->_gyro->_talkBackgroundColor);
+
+	// Top right corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, 11, 0, 90, 9, _vm->_gyro->_talkBackgroundColor);
+	// Bottom right corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->_talkBackgroundColor);
+	// Top left corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, 11, 90, 180, 9, _vm->_gyro->_talkBackgroundColor);
+	// Bottom left corner of the bubble.
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->_talkBackgroundColor);
+
+	// "Tail" of the speech bubble.
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
+
+
+	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
+	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
+	// It's almost the same, only notable differences are '?', '!', etc.
+	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
+		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[i].size() / 2 * 8;
+		bool offset = _vm->_gyro->_scroll[i].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
+	}
+
+	ringBell();
+	CursorMan.showMouse(false);
+	_vm->_gyro->_dropsOk = false;
+
+	// This does the actual drawing to the screen.
+	(this->*modeFunc)();
+
+	_vm->_gyro->_dropsOk = true;
+	CursorMan.showMouse(true); // sink;
+	resetScrollDriver();
+}
+
+bool Dialogs::displayQuestion(Common::String question) {
+	warning("STUB: Scrolls::displayQuestion()");
+	return true;
+}
+
+void Dialogs::reset() {
+	_vm->_gyro->_scrollNum = 1;
+	for (int i = 0; i < 15; i++) {
+		if (!_vm->_gyro->_scroll[i].empty())
+			_vm->_gyro->_scroll[i].clear();
+	}
+}
+
+void Dialogs::setBubbleStateNatural() {
+	_vm->_gyro->_talkX = 320;
+	_vm->_gyro->_talkY = 200;
+	_vm->_gyro->_talkBackgroundColor = 8;
+	_vm->_gyro->_talkFontColor = 15;
+}
+
+Common::String Dialogs::displayMoney() {
+	Common::String result;
+
+	if (_vm->_gyro->_money < 12) { // just pence
+		result = Common::String::format("%dd", _vm->_gyro->_money);
+	} else if (_vm->_gyro->_money < 240) { // shillings & pence
+		if ((_vm->_gyro->_money % 12) == 0)
+			result = Common::String::format("%d/-", _vm->_gyro->_money / 12);
+		else
+			result = Common::String::format("%d/%d", _vm->_gyro->_money / 12, _vm->_gyro->_money % 12);
+	} else { // L, s & d
+		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20, 
+		                _vm->_gyro->_money % 12);
+	}
+	if (_vm->_gyro->_money > 12) {
+		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money);
+		result += extraStr;
+	}
+
+	return result;
+}
+
+void Dialogs::stripTrailingSpaces(Common::String &str) {
+	while (str[str.size() - 1] == ' ')
+		str.deleteLastChar();
+}
+
+void Dialogs::solidify(byte n) {
+	if (!_vm->_gyro->_scroll[n].contains(' '))
+		return; // No spaces.
+
+	// So there MUST be a space there, somewhere...
+	do {
+		_vm->_gyro->_scroll[n + 1] = _vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] + _vm->_gyro->_scroll[n + 1];
+		_vm->_gyro->_scroll[n].deleteLastChar();
+	} while (_vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] != ' ');
+
+	stripTrailingSpaces(_vm->_gyro->_scroll[n]);
+}
+
+void Dialogs::callDialogDriver() {
+//	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
+	warning("STUB: Scrolls::calldrivers()");
+
+	_vm->_sound->stopSound();
+
+	setReadyLight(0);
+	_vm->_gyro->_scReturn = false;
+	bool mouthnext = false;
+	bool call_spriterun = true; // Only call sprite_run the FIRST time.
+
+	switch (_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1]) {
+	case kControlToBuffer:
+		_vm->_gyro->_bufSize--;
+		break; // ^D = (D)on't include pagebreak
+	case kControlSpeechBubble:
+	case kControlQuestion:
+		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
+	default:
+		_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = kControlParagraph;
+		_vm->_gyro->_bufSize++;
+	}
+
+	uint16 size = _vm->_gyro->_bufSize;
+
+	for (uint16 i = 0; i < size; i++) {
+		if (mouthnext) {
+			if (_vm->_gyro->_buffer[i] == kControlRegister)
+				_param = 0;
+			else if (('0' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= '9'))
+				_param = _vm->_gyro->_buffer[i] - 48;
+			else if (('A' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= 'Z'))
+				_param = _vm->_gyro->_buffer[i] - 55;
+
+			mouthnext = false;
+		} else {
+			switch (_vm->_gyro->_buffer[i]) {
+			case kControlParagraph:
+				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
+					break;
+
+				if (call_spriterun)
+					_vm->_lucerna->spriteRun();
+				call_spriterun = false;
+
+				drawScroll(&Avalanche::Dialogs::scrollModeNormal);
+
+				reset();
+
+				if (_vm->_gyro->_scReturn)
+					return;
+				break;
+			case kControlBell:
+				_vm->_gyro->_scrollBells++;
+				break; // #7 = "Bel"
+			case kControlSpeechBubble:
+				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
+					break;
+
+				if (call_spriterun)
+					_vm->_lucerna->spriteRun();
+				call_spriterun = false;
+
+				if (_param == 0)
+					setBubbleStateNatural();
+				else if ((1 <= _param) && (_param <= 9)) {
+					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
+					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
+						_vm->_lucerna->errorLed();
+						setBubbleStateNatural();
+					} else
+						spr->chatter(); // Normal sprite talking routine.
+				} else if ((10 <= _param) && (_param <= 36)) {
+					// Quasi-peds. (This routine performs the same
+					// thing with QPs as triptype.chatter does with the
+					// sprites.)
+					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed];
+					_vm->_gyro->_talkX = quasiPed->_x;
+					_vm->_gyro->_talkY = quasiPed->_y; // Position.
+
+					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[_param - 10]._foregroundColor;
+					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[_param - 10]._backgroundColor; // Colors.
+				} else {
+					_vm->_lucerna->errorLed(); // Not valid.
+					setBubbleStateNatural();
+				}
+
+				drawBubble(&Avalanche::Dialogs::scrollModeNormal);
+
+				reset();
+
+				if (_vm->_gyro->_scReturn)
+					return;
+				break;
+
+			// CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive 
+			case kControlNegative:
+				switch (_param) {
+				case 1:
+					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
+					break;
+				case 2: {
+					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum;
+					displayText(_vm->_acci->_vocabulary[pwdId]._word + kControlToBuffer);
+					}
+					break;
+				case 3:
+					displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer);
+					break;
+				case 4:
+					displayText(_vm->_gyro->_favouriteSong + kControlToBuffer);
+					break;
+				case 5:
+					displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer);
+					break;
+				case 6:
+					displayText(_vm->_gyro->_spareEvening + kControlToBuffer);
+					break;
+				case 9: {
+					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_catacombX, _vm->_gyro->_catacombY, kControlToBuffer);
+					displayText(tmpStr);
+					}
+					break;
+				case 10:
+					switch (_vm->_gyro->_boxContent) {
+					case 0: // Sixpence.
+						_vm->_dialogs->displayScrollChain('q', 37); // You find the sixpence.
+						_vm->_gyro->_money += 6;
+						_vm->_gyro->_boxContent = _vm->_acci->kNothing;
+						_vm->_lucerna->incScore(2);
+						return;
+					case Acci::kNothing:
+						displayText("nothing at all. It's completely empty.");
+						break;
+					default:
+						displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.');
+					}
+					break;
+				case 11:
+					for (int j = 0; j < kObjectNum; j++) {
+						if (_vm->_gyro->_objects[j]) 
+							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
+					}
+					break;
+				}
+				break;
+			case kControlIcon:
+				_useIcon = _param;
+				break;
+			case kControlNewLine:
+				_vm->_gyro->_scrollNum++;
+				break;
+			case kControlQuestion:
+				if (call_spriterun)
+					_vm->_lucerna->spriteRun();
+				call_spriterun = false;
+
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum] = kControlQuestion;
+				_vm->_gyro->_scrollNum++;
+
+				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
+				reset();
+				break;
+			case kControlRegister:
+				mouthnext = true;
+				break;
+			case kControlInsertSpaces:
+				for (int j = 0; j < 9; j++)
+					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
+				break;
+			default: // Add new char.
+				if (_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1].size() == 50) {
+					solidify(_vm->_gyro->_scrollNum - 1);
+					_vm->_gyro->_scrollNum++;
+				}
+				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[i];
+				break;
+			}
+		}
+	}
+}
+
+void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
+	_vm->_gyro->_bufSize = text.size();
+	memcpy(_vm->_gyro->_buffer, text.c_str(), _vm->_gyro->_bufSize);
+	callDialogDriver();
+}
+
+void Dialogs::loadFont() {
+	Common::File file;
+
+	if (!file.open("avalot.fnt"))
+		error("AVALANCHE: Scrolls: File not found: avalot.fnt");
+
+	for (int16 i = 0; i < 256; i++)
+		file.read(_fonts[0][i], 16);
+	file.close();
+
+	if (!file.open("avitalic.fnt"))
+		error("AVALANCHE: Scrolls: File not found: avitalic.fnt");
+
+	for (int16 i = 0; i < 256; i++)
+		file.read(_fonts[1][i], 16);
+	file.close();
+
+	if (!file.open("ttsmall.fnt"))
+		error("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
+
+	for (int16 i = 0; i < 256; i++)
+		file.read(_vm->_gyro->_font[i],16);
+	file.close();
+}
+
+void Dialogs::displayMusicalScroll() {
+	Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c", 
+		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
+	displayText(tmpStr);
+
+	_vm->_lucerna->spriteRun();
+	CursorMan.showMouse(false);
+	drawScroll(&Avalanche::Dialogs::scrollModeMusic);
+	CursorMan.showMouse(true);
+	reset();
+}
+
+// From Visa:
+
+void Dialogs::unSkrimble() {
+	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
+		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
+}
+
+void Dialogs::doTheBubble() {
+	_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = 2;
+	_vm->_gyro->_bufSize++;
+}
+
+/**
+ * Display a string in a scroll
+ * @remarks	Originally called 'dixi'
+ */
+void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbling) {
+	Common::File indexfile;
+	if (!indexfile.open("avalot.idx"))
+		error("AVALANCHE: Visa: File not found: avalot.idx");
+
+	bool error = false;
+
+	indexfile.seek((toupper(block) - 65) * 2);
+	uint16 idx_offset = indexfile.readUint16LE();
+	if (idx_offset == 0)
+		error = true;
+
+	indexfile.seek(idx_offset + point * 2);
+	uint16 sez_offset = indexfile.readUint16LE();
+	if (sez_offset == 0)
+		error = true;
+
+	indexfile.close();
+
+	_noError = !error;
+
+	if (error) {
+		if (report) {
+			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Dialogs::kControlBell, block, point);
+			_vm->_dialogs->displayText(todisplay);
+		}
+		return;
+	}
+
+	Common::File sezfile;
+	if (!sezfile.open("avalot.sez"))
+		::error("AVALANCHE: Visa: File not found: avalot.sez");
+
+	sezfile.seek(sez_offset);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	sezfile.close();
+	unSkrimble();
+
+	if (bubbling)
+		doTheBubble();
+
+	_vm->_dialogs->callDialogDriver();
+}
+
+/**
+ * Start speech
+ * @remarks	Originally called 'speech'
+ */
+void Dialogs::speak(byte who, byte subject) {
+	if (subject == 0) { // No subject.
+		displayScrollChain('s', who, false, true);
+		return;
+	}
+
+	// Subject given.
+	_noError = false; // Assume that until we know otherwise.
+
+	Common::File indexfile;
+	if (!indexfile.open("converse.avd"))
+		error("AVALANCHE: Visa: File not found: converse.avd");
+
+	indexfile.seek(who * 2 - 2);
+	uint16 idx_offset = indexfile.readUint16LE();
+	uint16 next_idx_offset = indexfile.readUint16LE();
+
+	if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
+		return;
+
+	indexfile.seek(idx_offset + subject * 2);
+	uint16 sez_offset = indexfile.readUint16LE();
+	if ((sez_offset == 0) || (indexfile.err()))
+		return;
+	indexfile.close();
+
+	Common::File sezfile;
+	if (!sezfile.open("avalot.sez"))
+		error("AVALANCHE: Visa: File not found: avalot.sez");
+
+	sezfile.seek(sez_offset);
+	_vm->_gyro->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	sezfile.close();
+
+	unSkrimble();
+	doTheBubble();
+
+	_vm->_dialogs->callDialogDriver();
+	_noError = true;
+}
+
+void Dialogs::talkTo(byte whom) {
+	if (_vm->_acci->_person == _vm->_acci->kPardon) {
+		_vm->_acci->_person = _vm->_gyro->_subjectNum;
+		_vm->_gyro->_subjectNum = 0;
+	}
+
+	if (_vm->_gyro->_subjectNum == 0) {
+		switch (whom) {
+		case Gyro::kPeopleSpludwick:
+			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
+				displayScrollChain('q', 68);
+				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_lucerna->incScore(3);
+				return;
+			} else if (_vm->_gyro->_talkedToCrapulus) {
+				// Spludwick - what does he need?
+				// 0 - let it through to use normal routine.
+				switch (_vm->_gyro->_givenToSpludwick) {
+				case 1: // Fallthrough is intended.
+				case 2: {
+					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+					_vm->_dialogs->displayText(tmpStr);
+					}
+					return;
+				case 3:
+					displayScrollChain('q', 30); // Need any help with the game?
+					return;
+				}
+			} else {
+				displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+				return;
+			}
+			break;
+		case Gyro::kPeopleIbythneth:
+			if (_vm->_gyro->_givenBadgeToIby) {
+				displayScrollChain('q', 33); // Thanks a lot!
+				return; // And leave the proc.
+			}
+			break; // Or... just continue, 'cos he hasn't got it.
+		case Gyro::kPeopleDogfood:
+			if (_vm->_gyro->_wonNim) { // We've won the game.
+				displayScrollChain('q', 6); // "I'm Not Playing!"
+				return; // Zap back.
+			} else
+				_vm->_gyro->_askedDogfoodAboutNim = true;
+			break;
+		case Gyro::kPeopleAyles:
+			if (!_vm->_gyro->_aylesIsAwake) {
+				displayScrollChain('q', 43); // He's fast asleep!
+				return;
+			} else if (!_vm->_gyro->_givenPenToAyles) {
+				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
+				return;
+			}
+			break;
+
+		case Gyro::kPeopleJacques:
+			displayScrollChain('q', 43);
+			return;
+
+		case Gyro::kPeopleGeida:
+			if (_vm->_gyro->_givenPotionToGeida)
+				_vm->_gyro->_geidaFollows = true;
+			else {
+				displayScrollChain('u', 17);
+				return;
+			}
+			break;
+		case Gyro::kPeopleSpurge:
+			if (!_vm->_gyro->_sittingInPub) {
+				displayScrollChain('q', 71); // Try going over and sitting down.
+				return;
+			} else {
+				if (_vm->_gyro->_spurgeTalkCount < 5)
+					_vm->_gyro->_spurgeTalkCount++;
+				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
+					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
+					return;
+				}
+			}
+			break;
+		}
+	// On a subject. Is there any reason to block it?
+	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
+		displayScrollChain('q', 43); // He's fast asleep!
+		return;
+	}
+
+	if (whom > 149)
+		whom -= 149;
+
+	bool noMatches = true;
+	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
+			Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, i + 49, Dialogs::kControlToBuffer);
+			_vm->_dialogs->displayText(tmpStr);
+			noMatches = false;
+			break;
+		}
+	}
+
+	if (noMatches) {
+		Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, Dialogs::kControlRegister, Dialogs::kControlToBuffer);
+		_vm->_dialogs->displayText(tmpStr);
+	}
+
+	speak(whom, _vm->_gyro->_subjectNum);
+
+	if (!_noError)
+		displayScrollChain('n', whom); // File not found!
+
+	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
+		_vm->_lucerna->refreshObjectList();
+		displayScrollChain('q', 1); // Circular from Cardiff.
+		_vm->_gyro->_talkedToCrapulus = true;
+		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
+
+		AnimationType *spr = &_vm->_animation->_sprites[1];
+		spr->_vanishIfStill = true;
+		spr->walkTo(2); // Walks away.
+
+		_vm->_lucerna->incScore(2);
+	}
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
new file mode 100644
index 0000000..9cb4470
--- /dev/null
+++ b/engines/avalanche/dialogs.h
@@ -0,0 +1,133 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+ /* SCROLLS		The scroll driver. */
+
+#ifndef AVALANCHE_DIALOGS_H
+#define AVALANCHE_DIALOGS_H
+
+#include "common/system.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Dialogs;
+
+typedef void (Dialogs::*DialogFunctionType)();
+
+class Dialogs {
+public:
+	// Constants to replace the command characters from Pascal.
+	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
+	enum ControlCharacter {
+		kControlSpeechBubble = 2, // ^B
+		kControlCenter = 3, // ^C
+		kControlToBuffer = 4, // ^D
+		kControlItalic = 6, // ^F
+		kControlBell = 7, // ^G
+		kControlBackspace = 8, // ^H
+		kControlInsertSpaces = 9, // ^I
+		kControlLeftJustified = 12, // ^L
+		kControlNewLine = 13, // ^M
+		kControlParagraph = 16, // ^P
+		kControlQuestion = 17, // ^Q
+		kControlRoman = 18, // ^R
+		kControlRegister = 19, // ^S
+		kControlNegative = 21, // ^U
+		kControlIcon = 22 // ^V
+	};
+
+	bool _aboutBox; // Is this the about box?
+	FontType _fonts[2];
+
+	Dialogs(AvalancheEngine *vm);
+
+	void init();
+	void setReadyLight(byte state); // Sets "Ready" light to whatever.
+	void drawScroll(DialogFunctionType modeFunc);
+	void drawBubble(DialogFunctionType modeFunc);
+	void reset();
+	void callDialogDriver();
+	void displayText(Common::String text);
+	bool displayQuestion(Common::String question);
+	void setBubbleStateNatural(); // Natural state of bubbles
+	Common::String displayMoney();
+	void displayMusicalScroll(); // Practically this one is a mini-game which called when you play the harp in the monastery.
+
+	// From Visa:
+	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
+	void talkTo(byte whom);
+
+private:
+	AvalancheEngine *_vm;
+
+	enum FontStyle {
+		kFontStyleRoman,
+		kFontStyleItalic
+	};
+
+	static const int16 kHalfIconWidth = 19; // Half the width of an icon.
+
+	int16 _shadowBoxX, _shadowBoxY;
+	byte _currentFont; // Current font
+	Common::Point _dodgeCoord;
+	byte _param; // For using arguments code
+	byte _useIcon;
+
+	// These 3 functions are always passed as ScrollsFunctionType parameters.
+	void scrollModeNormal();
+	void scrollModeDialogue();
+	void scrollModeMusic();
+
+	// These 2 are used only in musicalScroll().
+	void store(byte what, TuneType &played);
+	bool theyMatch(TuneType &played);
+
+	void stripTrailingSpaces(Common::String &str); // Original: strip.
+	void solidify(byte n); // Does the word wrapping.
+
+	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
+	void unDodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
+
+	void easterEgg();
+	void say(int16 x, int16 y, Common::String text);
+	void resetScrollDriver();
+	void ringBell(); // Original: dingdongbell
+	void getIcon(int16 x, int16 y, byte which);
+	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
+	void loadFont();
+
+	// From Visa:
+	bool _noError;
+	void unSkrimble();
+	void doTheBubble();
+	void speak(byte who, byte subject);
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_DIALOGS_H
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index e338ecd..3d86d34 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -30,7 +30,7 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/gyro.h"
 #include "avalanche/pingo.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/acci.h"
 #include "avalanche/animation.h"
@@ -311,7 +311,7 @@ void Gyro::newGame() {
 	_alive = true;
 	resetVariables();
 
-	_vm->_scrolls->setBubbleStateNatural();
+	_vm->_dialogs->setBubbleStateNatural();
 
 	_spareEvening = "answer a questionnaire";
 	_favouriteDrink = "beer";
@@ -366,7 +366,7 @@ bool Gyro::setFlag(char x) {
 bool Gyro::decreaseMoney(uint16 howmuchby) {
 	_money -= howmuchby;
 	if (_money < 0) {
-		_vm->_scrolls->displayScrollChain('Q', 2); // "You are now denariusless!"
+		_vm->_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
 		_vm->_lucerna->gameOver();
 		return false;
 	} else
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 539bb40..34ba7c1 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -30,7 +30,7 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
 #include "avalanche/background.h"
@@ -70,8 +70,8 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
 		Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
 			"midnight. Are you having an all-night Avvy session? Glad you like the game that much!", 
-			Scrolls::kControlNewLine, Scrolls::kControlNewLine);
-		_vm->_scrolls->displayText(tmpStr);
+			Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		_vm->_dialogs->displayText(tmpStr);
 	}
 	_oldHour = _hour;
 	_oldHourAngle = _hourAngle;
@@ -148,7 +148,7 @@ void Lucerna::callVerb(byte id) {
 		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
 			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
 			"what the current setting of this key is.");
-		_vm->_scrolls->displayText(tmpStr);
+		_vm->_dialogs->displayText(tmpStr);
 	} else {
 		_vm->_gyro->_weirdWord = false;
 		_vm->_acci->_polite = true;
@@ -606,12 +606,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
 			zoomOut(_vm->_gyro->_peds[ped]._x, _vm->_gyro->_peds[ped]._y);
 
 		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
-			_vm->_scrolls->displayScrollChain('q', 9); // Don't want to waste the wine!
+			_vm->_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
 			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
 			refreshObjectList();
 		}
 
-		_vm->_scrolls->displayScrollChain('q', 69);
+		_vm->_dialogs->displayScrollChain('q', 69);
 		break;
 
 	case kRoomCatacombs:
@@ -1117,7 +1117,7 @@ void Lucerna::checkClick() {
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
-				_vm->_gyro->_mouseText.insertChar(Scrolls::kControlNewLine, 0);
+				_vm->_gyro->_mouseText.insertChar(Dialogs::kControlNewLine, 0);
 		} else if (!_vm->_gyro->_dropsOk)
 			_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
 	}
@@ -1218,7 +1218,7 @@ void Lucerna::spriteRun() {
 void Lucerna::fixFlashers() {
 	_vm->_gyro->_ledStatus = 177;
 	_vm->_animation->_oldDirection = 177;
-	_vm->_scrolls->setReadyLight(2);
+	_vm->_dialogs->setReadyLight(2);
 	drawDirection();
 }
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index be8a103..f044a41 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -15,7 +15,7 @@ MODULE_OBJS = \
 	menu.o \
 	parser.o \
 	pingo.o \
-	scrolls.o \
+	dialogs.o \
 	sequence.o \
 	sound.o \
 	timer.o
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 7196f46..95e15e5 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -33,7 +33,7 @@
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 
 #include "common/textconsole.h"
 #include "common/file.h"
diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp
deleted file mode 100644
index e5d08ec..0000000
--- a/engines/avalanche/scrolls.cpp
+++ /dev/null
@@ -1,1087 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
- /* SCROLLS		The scroll driver. */
-
-#include "avalanche/avalanche.h"
-#include "avalanche/scrolls.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/animation.h"
-#include "avalanche/acci.h"
-#include "avalanche/timer.h"
-
-#include "common/textconsole.h"
-#include "common/file.h"
-
-namespace Avalanche {
-
-Scrolls::Scrolls(AvalancheEngine *vm) {
-	_vm = vm;
-	_noError = true;
-}
-
-void Scrolls::init() {
-	loadFont();
-	resetScrollDriver();
-}
-
-void Scrolls::setReadyLight(byte state) {     // Sets "Ready" light to whatever
-	if (_vm->_gyro->_ledStatus == state)
-		return; // Already like that!
-
-	byte color = kColorBlack;
-	switch (state) {
-	case 0:
-		color = kColorBlack;
-		break; // Off
-	case 1:
-	case 2:
-	case 3:
-		color = kColorGreen;
-		break; // Hit a key
-	}
-	warning("STUB: Scrolls::state()");
-
-	CursorMan.showMouse(false);
-
-	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
-
-	CursorMan.showMouse(true);
-	_vm->_gyro->_ledStatus = state;
-}
-
-void Scrolls::easterEgg() {
-	warning("STUB: Scrolls::easterEgg()");
-}
-
-void Scrolls::say(int16 x, int16 y, Common::String z) {
-	FontType itw;
-	byte lz = z.size();
-
-	bool offset = x % 8 == 4;
-	x /= 8;
-	y++;
-	int16 i = 0;
-	for (int xx = 0; xx < lz; xx++) {
-		switch (z[xx]) {
-		case kControlRoman:
-			_currentFont = kFontStyleRoman;
-			break;
-		case kControlItalic:
-			_currentFont = kFontStyleItalic;
-			break;
-		default: {
-			for (int yy = 0; yy < 12; yy++)
-				itw[(byte)z[xx]][yy] = _scrollFonts[_currentFont][(byte)z[xx]][yy + 2];
-
-			// We have to draw the characters one-by-one because of the accidental font changes.
-			i++;
-			Common::String chr(z[xx]);
-			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, kColorBlack);
-			}
-		}
-	}
-}
-
-void Scrolls::scrollModeNormal() {
-	// Original code is:
-	// egg : array[1..8] of char = ^P^L^U^G^H+'***';
-	// this is not using kControl characters: it's the secret code to be entered to trigger the easter egg
-	// TODO: To be fixed when the Easter egg code is implemented
-	Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace);
-	Common::String e = "(c) 1994";
-
-	setReadyLight(3);
-	_vm->_gyro->_seeScroll = true;
-	_vm->_gyro->newMouse(3);
-
-	::Graphics::Surface temp;
-	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
-
-	Common::Event event;
-	while (!_vm->shouldQuit()) {
-		_vm->_graphics->refreshScreen();
-
-		_vm->getEvent(event);
-		if (_vm->shouldQuit() || 
-			(event.type == Common::EVENT_LBUTTONUP) ||
-			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE)
-			|| (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH)
-			|| (event.kbd.keycode == Common::KEYCODE_PLUS))))
-			break;
-	}
-
-	_vm->_graphics->_surface.copyFrom(temp);
-	temp.free();
-
-	warning("STUB: scrollModeNormal() - Check Easter Egg trigger");
-#if 0
-	char r;
-	bool oktoexit;
-	do {
-		do {
-			_vm->_gyro->check(); // was "checkclick;"
-
-//#ifdef RECORD slowdown(); basher::count += 1; #endif
-
-			if (_vm->_enhanced->keypressede())
-				break;
-		} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
-
-
-		if (mrelease == 0) {
-			inkey();
-			if (aboutscroll) {
-				move(e[2 - 1], e[1 - 1], 7);
-				e[8 - 1] = inchar;
-				if (egg == e)
-					easteregg();
-			}
-			oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar);
-			if (!oktoexit)  errorled();
-		}
-
-	} while (!((oktoexit) || (mrelease > 0)));
-
-//#ifdef RECORD record_one(); #endif
-
-	_vm->_gyro->screturn = r == '#'; // "back door"
-#endif
-
-	setReadyLight(0);
-	_vm->_gyro->_seeScroll = false;
-	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
-
-	warning("STUB: Scrolls::scrollModeNormal()");
-}
-
-void Scrolls::scrollModeDialogue() {
-	warning("STUB: Scrolls::scrollModeDialogue()");
-}
-
-void Scrolls::store(byte what, TuneType &played) {
-	memcpy(played, played + 1, sizeof(played) - 1);
-	played[30] = what;
-}
-
-bool Scrolls::theyMatch(TuneType &played) {
-	byte mistakes = 0;
-
-	for (unsigned int i = 0; i < sizeof(played); i++) {
-		if (played[i] != _vm->_gyro->kTune[i])
-			mistakes += 1;
-	}
-
-	return mistakes < 5;
-}
-
-void Scrolls::scrollModeMusic() {
-	setReadyLight(3);
-	_vm->_gyro->_seeScroll = true;
-	CursorMan.showMouse(false);
-	_vm->_gyro->newMouse(3);
-
-	TuneType played;
-	for (unsigned int i = 0; i < sizeof(played); i++)
-		played[i] = Gyro::kPitchInvalid;
-	int8 lastOne = -1, thisOne = -1; // Invalid values.
-
-	_vm->_gyro->_seeScroll = true;
-
-	::Graphics::Surface temp;
-	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
-
-	Common::Event event;
-	while (!_vm->shouldQuit()) {
-		_vm->_graphics->refreshScreen();
-
-		_vm->getEvent(event);
-
-		// When we stop playing?
-		if ((event.type == Common::EVENT_LBUTTONDOWN) ||
-			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)))) {
-				break;
-		}
-
-		// When we DO play:
-		if ((event.type == Common::EVENT_KEYDOWN)
-			&& ((event.kbd.keycode == Common::KEYCODE_q) || (event.kbd.keycode == Common::KEYCODE_w)
-			|| (event.kbd.keycode == Common::KEYCODE_e) || (event.kbd.keycode == Common::KEYCODE_r)
-			|| (event.kbd.keycode == Common::KEYCODE_t) || (event.kbd.keycode == Common::KEYCODE_y)
-			|| (event.kbd.keycode == Common::KEYCODE_u) || (event.kbd.keycode == Common::KEYCODE_i)
-			|| (event.kbd.keycode == Common::KEYCODE_o) || (event.kbd.keycode == Common::KEYCODE_p)
-			|| (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET) || (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
-				byte value;
-				switch (event.kbd.keycode) {
-				case Common::KEYCODE_q:
-					value = 0;
-					break;
-				case Common::KEYCODE_w:
-					value = 1;
-					break;
-				case Common::KEYCODE_e:
-					value = 2;
-					break;
-				case Common::KEYCODE_r:
-					value = 3;
-					break;
-				case Common::KEYCODE_t:
-					value = 4;
-					break;
-				case Common::KEYCODE_y:
-					value = 5;
-					break;
-				case Common::KEYCODE_u:
-					value = 6;
-					break;
-				case Common::KEYCODE_i:
-					value = 7;
-					break;
-				case Common::KEYCODE_o:
-					value = 8;
-					break;
-				case Common::KEYCODE_p:
-					value = 9;
-					break;
-				case Common::KEYCODE_LEFTBRACKET:
-					value = 10;
-					break;
-				case Common::KEYCODE_RIGHTBRACKET:
-					value = 11;
-					break;
-				default:
-					break;
-				}
-
-				lastOne = thisOne;
-				thisOne = value;
-
-				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
-				_vm->_system->delayMillis(200);
-
-				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
-					if (thisOne < lastOne)
-						store(Gyro::kPitchLower, played);
-					else if (thisOne == lastOne)
-						store(Gyro::kPitchSame, played);
-					else
-						store(Gyro::kPitchHigher, played);
-				}
-				
-				if (theyMatch(played)) {
-					setReadyLight(0);
-					_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
-					break;
-				}
-		}
-	}
-
-	_vm->_graphics->_surface.copyFrom(temp);
-	temp.free();
-	_vm->_gyro->_seeScroll = false;
-	CursorMan.showMouse(true);
-}
-
-void Scrolls::resetScrollDriver() {
-	_vm->_gyro->_scrollBells = 0;
-	_currentFont = kFontStyleRoman;
-	_useIcon = 0;
-	_vm->_gyro->_interrogation = 0; // Always reset after a scroll comes up.
-}
-
-void Scrolls::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (int i = 0; i < _vm->_gyro->_scrollBells; i++)
-		_vm->_lucerna->errorLed(); // Ring the bell "x" times.
-}
-
-void Scrolls::dodgem() {
-	_dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(_dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
-}
-
-void Scrolls::unDodgem() {
-	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
-		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
-}
-
-void Scrolls::getIcon(int16 x, int16 y, byte which) {
-	Common::File file;
-
-	if (!file.open("icons.avd"))
-		error("AVALANCHE: Scrolls: File not found: icons.avd");
-
-	which--;
-	file.seek(which * 426);
-
-	byte *p = new byte[426];
-	file.read(p, 426);
-
-	//putimage(x, y, p, 0);
-	warning("STUB: Scrolls::getIcon()");
-
-	delete[] p;
-	file.close();
-}
-
-void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
-	Common::File file;
-	Common::String filename = Common::String::format("%s.avd", fn.c_str());
-
-	if (!file.open(filename))
-		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
-
-#if 0
-	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
-	byte bit;
-	for (uint16 i = 1; i <= yl; i++)
-		for (bit = 0; bit <= 3; bit++) {
-			port[0x3c4] = 2;
-			port[0x3ce] = 4;
-			port[0x3c5] = 1 << bit;
-			port[0x3cf] = bit;
-			blockread(f, mem[0xa000 * st + (i * 80)], xl);
-		}
-	bit = getpixel(0, 0);
-#endif
-
-	warning("STUB: Scrolls::drawSign()");
-
-	file.close();
-}
-
-void Scrolls::drawScroll(ScrollsFunctionType modeFunc) {
-	int16 lx = 0;
-	int16 ly = (_vm->_gyro->_scrollNum) * 6;
-	int16 ex;
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		ex = _vm->_gyro->_scroll[i].size() * 8;
-		if (lx < ex)
-			lx = ex;
-	}
-	int16 mx = 320;
-	int16 my = 100; // Getmaxx & getmaxy div 2, both.
-	lx /= 2;
-	ly -= 2;
-
-	if ((1 <= _useIcon) && (_useIcon <= 34))
-		lx += kHalfIconWidth;
-
-	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
-
-	CursorMan.showMouse(false);
-
-	// The right corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorLightgray);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
-
-	// The body of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
-
-	// The left corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
-
-	// The rear borders of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
-
-	mx -= lx;
-	my -= ly + 2;
-
-	bool centre = false;
-
-	byte iconIndent = 0;
-	switch (_useIcon) {
-	case 0:
-		iconIndent = 0;
-		break; // No icon.
-	case 34:
-		drawSign("about", 28, 76, 15);
-		iconIndent = 0;
-		break;
-	case 35:
-		drawSign("gameover", 52, 59, 71);
-		iconIndent = 0;
-		break;
-	}
-
-	if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon.
-		getIcon(mx, my + ly / 2, _useIcon);
-		iconIndent = 53;
-	}
-
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		if (!_vm->_gyro->_scroll[i].empty())
-			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
-			case kControlCenter:
-				centre = true;
-				_vm->_gyro->_scroll[i].deleteLastChar();
-				break;
-			case kControlLeftJustified:
-				centre = false;
-				_vm->_gyro->_scroll[i].deleteLastChar();
-				break;
-			case kControlQuestion:
-				//settextjustify(1, 1);
-				_shadowBoxX = mx + lx;
-				_shadowBoxY = my + ly;
-				_vm->_gyro->_scroll[i].setChar(' ', 0);
-				// byte groi = *_vm->_graphics->getPixel(0, 0);
-				// inc(diy,14);
-				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
-				_vm->_gyro->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
-				break;
-			}
-
-		if (centre)
-			say(320 - _vm->_gyro->_scroll[i].size() * 4 + iconIndent, my, _vm->_gyro->_scroll[i]);
-		else
-			say(mx + iconIndent, my, _vm->_gyro->_scroll[i]);
-
-		my += 12;
-	}
-
-	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
-	ringBell();
-	
-	_vm->_gyro->_dropsOk = false;
-	dodgem();
-
-	(this->*modeFunc)();
-
-	unDodgem();
-	_vm->_gyro->_dropsOk = true;
-	
-	resetScrollDriver();
-}
-
-void Scrolls::drawBubble(ScrollsFunctionType modeFunc) {
-	Common::Point points[3];
-
-	CursorMan.showMouse(false);
-	int16 xl = 0;
-	int16 yl = _vm->_gyro->_scrollNum * 5;
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		uint16 textWidth = _vm->_gyro->_scroll[i].size() * 8;
-		if (textWidth > xl)
-			xl = textWidth;
-	}
-	xl /= 2;
-
-	int16 xw = xl + 18;
-	int16 yw = yl + 7;
-	int16 my = yw * 2 - 2;
-	int16 xc = 0;
-
-	if ((_vm->_gyro->_talkX - xw) < 0)
-		xc = -(_vm->_gyro->_talkX - xw);
-	if ((_vm->_gyro->_talkX + xw) > 639)
-		xc = 639 - (_vm->_gyro->_talkX + xw);
-
-	points[0].x = _vm->_gyro->_talkX - 10;
-	points[0].y = yw;
-	points[1].x = _vm->_gyro->_talkX + 10;
-	points[1].y = yw;
-	points[2].x = _vm->_gyro->_talkX;
-	points[2].y = _vm->_gyro->_talkY;
-
-	// Backup the screen before drawing the bubble.
-	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
-
-	// The body of the bubble.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw + 9, 7, _vm->_gyro->_talkX + xw - 8 + xc, my + 1), _vm->_gyro->_talkBackgroundColor);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw - 1, 12, _vm->_gyro->_talkX + xw + xc + 2, my - 4), _vm->_gyro->_talkBackgroundColor);
-
-	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, 11, 0, 90, 9, _vm->_gyro->_talkBackgroundColor);
-	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->_talkBackgroundColor);
-	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, 11, 90, 180, 9, _vm->_gyro->_talkBackgroundColor);
-	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->_talkBackgroundColor);
-
-	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
-
-
-	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
-	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
-	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[i].size() / 2 * 8;
-		bool offset = _vm->_gyro->_scroll[i].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
-	}
-
-	ringBell();
-	CursorMan.showMouse(false);
-	_vm->_gyro->_dropsOk = false;
-
-	// This does the actual drawing to the screen.
-	(this->*modeFunc)();
-
-	_vm->_gyro->_dropsOk = true;
-	CursorMan.showMouse(true); // sink;
-	resetScrollDriver();
-}
-
-bool Scrolls::displayQuestion(Common::String question) {
-	warning("STUB: Scrolls::displayQuestion()");
-	return true;
-}
-
-void Scrolls::resetScroll() {
-	_vm->_gyro->_scrollNum = 1;
-	for (int i = 0; i < 15; i++) {
-		if (!_vm->_gyro->_scroll[i].empty())
-			_vm->_gyro->_scroll[i].clear();
-	}
-}
-
-void Scrolls::setBubbleStateNatural() {
-	_vm->_gyro->_talkX = 320;
-	_vm->_gyro->_talkY = 200;
-	_vm->_gyro->_talkBackgroundColor = 8;
-	_vm->_gyro->_talkFontColor = 15;
-}
-
-Common::String Scrolls::displayMoney() {
-	Common::String result;
-
-	if (_vm->_gyro->_money < 12) { // just pence
-		result = Common::String::format("%dd", _vm->_gyro->_money);
-	} else if (_vm->_gyro->_money < 240) { // shillings & pence
-		if ((_vm->_gyro->_money % 12) == 0)
-			result = Common::String::format("%d/-", _vm->_gyro->_money / 12);
-		else
-			result = Common::String::format("%d/%d", _vm->_gyro->_money / 12, _vm->_gyro->_money % 12);
-	} else { // L, s & d
-		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20, 
-		                _vm->_gyro->_money % 12);
-	}
-	if (_vm->_gyro->_money > 12) {
-		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money);
-		result += extraStr;
-	}
-
-	return result;
-}
-
-void Scrolls::stripTrailingSpaces(Common::String &str) {
-	while (str[str.size() - 1] == ' ')
-		str.deleteLastChar();
-}
-
-void Scrolls::solidify(byte n) {
-	if (!_vm->_gyro->_scroll[n].contains(' '))
-		return; // No spaces.
-
-	// So there MUST be a space there, somewhere...
-	do {
-		_vm->_gyro->_scroll[n + 1] = _vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] + _vm->_gyro->_scroll[n + 1];
-		_vm->_gyro->_scroll[n].deleteLastChar();
-	} while (_vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] != ' ');
-
-	stripTrailingSpaces(_vm->_gyro->_scroll[n]);
-}
-
-void Scrolls::callScrollDriver() {
-//	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
-	warning("STUB: Scrolls::calldrivers()");
-
-	_vm->_sound->stopSound();
-
-	setReadyLight(0);
-	_vm->_gyro->_scReturn = false;
-	bool mouthnext = false;
-	bool call_spriterun = true; // Only call sprite_run the FIRST time.
-
-	switch (_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1]) {
-	case kControlToBuffer:
-		_vm->_gyro->_bufSize--;
-		break; // ^D = (D)on't include pagebreak
-	case kControlSpeechBubble:
-	case kControlQuestion:
-		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
-	default:
-		_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = kControlParagraph;
-		_vm->_gyro->_bufSize++;
-	}
-
-	uint16 size = _vm->_gyro->_bufSize;
-
-	for (uint16 i = 0; i < size; i++) {
-		if (mouthnext) {
-			if (_vm->_gyro->_buffer[i] == kControlRegister)
-				_param = 0;
-			else if (('0' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= '9'))
-				_param = _vm->_gyro->_buffer[i] - 48;
-			else if (('A' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= 'Z'))
-				_param = _vm->_gyro->_buffer[i] - 55;
-
-			mouthnext = false;
-		} else {
-			switch (_vm->_gyro->_buffer[i]) {
-			case kControlParagraph:
-				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
-					break;
-
-				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
-				call_spriterun = false;
-
-				drawScroll(&Avalanche::Scrolls::scrollModeNormal);
-
-				resetScroll();
-
-				if (_vm->_gyro->_scReturn)
-					return;
-				break;
-			case kControlBell:
-				_vm->_gyro->_scrollBells++;
-				break; // #7 = "Bel"
-			case kControlSpeechBubble:
-				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
-					break;
-
-				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
-				call_spriterun = false;
-
-				if (_param == 0)
-					setBubbleStateNatural();
-				else if ((1 <= _param) && (_param <= 9)) {
-					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
-					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
-						_vm->_lucerna->errorLed();
-						setBubbleStateNatural();
-					} else
-						spr->chatter(); // Normal sprite talking routine.
-				} else if ((10 <= _param) && (_param <= 36)) {
-					// Quasi-peds. (This routine performs the same
-					// thing with QPs as triptype.chatter does with the
-					// sprites.)
-					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed];
-					_vm->_gyro->_talkX = quasiPed->_x;
-					_vm->_gyro->_talkY = quasiPed->_y; // Position.
-
-					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[_param - 10]._foregroundColor;
-					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[_param - 10]._backgroundColor; // Colors.
-				} else {
-					_vm->_lucerna->errorLed(); // Not valid.
-					setBubbleStateNatural();
-				}
-
-				drawBubble(&Avalanche::Scrolls::scrollModeNormal);
-
-				resetScroll();
-
-				if (_vm->_gyro->_scReturn)
-					return;
-				break;
-
-			// CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive 
-			case kControlNegative:
-				switch (_param) {
-				case 1:
-					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
-					break;
-				case 2: {
-					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum;
-					displayText(_vm->_acci->_vocabulary[pwdId]._word + kControlToBuffer);
-					}
-					break;
-				case 3:
-					displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer);
-					break;
-				case 4:
-					displayText(_vm->_gyro->_favouriteSong + kControlToBuffer);
-					break;
-				case 5:
-					displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer);
-					break;
-				case 6:
-					displayText(_vm->_gyro->_spareEvening + kControlToBuffer);
-					break;
-				case 9: {
-					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_catacombX, _vm->_gyro->_catacombY, kControlToBuffer);
-					displayText(tmpStr);
-					}
-					break;
-				case 10:
-					switch (_vm->_gyro->_boxContent) {
-					case 0: // Sixpence.
-						_vm->_scrolls->displayScrollChain('q', 37); // You find the sixpence.
-						_vm->_gyro->_money += 6;
-						_vm->_gyro->_boxContent = _vm->_acci->kNothing;
-						_vm->_lucerna->incScore(2);
-						return;
-					case Acci::kNothing:
-						displayText("nothing at all. It's completely empty.");
-						break;
-					default:
-						displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.');
-					}
-					break;
-				case 11:
-					for (int j = 0; j < kObjectNum; j++) {
-						if (_vm->_gyro->_objects[j]) 
-							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
-					}
-					break;
-				}
-				break;
-			case kControlIcon:
-				_useIcon = _param;
-				break;
-			case kControlNewLine:
-				_vm->_gyro->_scrollNum++;
-				break;
-			case kControlQuestion:
-				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
-				call_spriterun = false;
-
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum] = kControlQuestion;
-				_vm->_gyro->_scrollNum++;
-
-				drawScroll(&Avalanche::Scrolls::scrollModeDialogue);
-				resetScroll();
-				break;
-			case kControlRegister:
-				mouthnext = true;
-				break;
-			case kControlInsertSpaces:
-				for (int j = 0; j < 9; j++)
-					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
-				break;
-			default: // Add new char.
-				if (_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1].size() == 50) {
-					solidify(_vm->_gyro->_scrollNum - 1);
-					_vm->_gyro->_scrollNum++;
-				}
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[i];
-				break;
-			}
-		}
-	}
-}
-
-void Scrolls::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_gyro->_bufSize = text.size();
-	memcpy(_vm->_gyro->_buffer, text.c_str(), _vm->_gyro->_bufSize);
-	callScrollDriver();
-}
-
-void Scrolls::loadFont() {
-	Common::File file;
-
-	if (!file.open("avalot.fnt"))
-		error("AVALANCHE: Scrolls: File not found: avalot.fnt");
-
-	for (int16 i = 0; i < 256; i++)
-		file.read(_scrollFonts[0][i], 16);
-	file.close();
-
-	if (!file.open("avitalic.fnt"))
-		error("AVALANCHE: Scrolls: File not found: avitalic.fnt");
-
-	for (int16 i = 0; i < 256; i++)
-		file.read(_scrollFonts[1][i], 16);
-	file.close();
-
-	if (!file.open("ttsmall.fnt"))
-		error("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
-
-	for (int16 i = 0; i < 256; i++)
-		file.read(_vm->_gyro->_font[i],16);
-	file.close();
-}
-
-void Scrolls::musicalScroll() {
-	Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c", 
-		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
-	displayText(tmpStr);
-
-	_vm->_lucerna->spriteRun();
-	CursorMan.showMouse(false);
-	drawScroll(&Avalanche::Scrolls::scrollModeMusic);
-	CursorMan.showMouse(true);
-	resetScroll();
-}
-
-// From Visa:
-
-void Scrolls::unSkrimble() {
-	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
-		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
-}
-
-void Scrolls::doTheBubble() {
-	_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = 2;
-	_vm->_gyro->_bufSize++;
-}
-
-/**
- * Display a string in a scroll
- * @remarks	Originally called 'dixi'
- */
-void Scrolls::displayScrollChain(char block, byte point, bool report, bool bubbling) {
-	Common::File indexfile;
-	if (!indexfile.open("avalot.idx"))
-		error("AVALANCHE: Visa: File not found: avalot.idx");
-
-	bool error = false;
-
-	indexfile.seek((toupper(block) - 65) * 2);
-	uint16 idx_offset = indexfile.readUint16LE();
-	if (idx_offset == 0)
-		error = true;
-
-	indexfile.seek(idx_offset + point * 2);
-	uint16 sez_offset = indexfile.readUint16LE();
-	if (sez_offset == 0)
-		error = true;
-
-	indexfile.close();
-
-	_noError = !error;
-
-	if (error) {
-		if (report) {
-			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Scrolls::kControlBell, block, point);
-			_vm->_scrolls->displayText(todisplay);
-		}
-		return;
-	}
-
-	Common::File sezfile;
-	if (!sezfile.open("avalot.sez"))
-		::error("AVALANCHE: Visa: File not found: avalot.sez");
-
-	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
-	sezfile.close();
-	unSkrimble();
-
-	if (bubbling)
-		doTheBubble();
-
-	_vm->_scrolls->callScrollDriver();
-}
-
-/**
- * Start speech
- * @remarks	Originally called 'speech'
- */
-void Scrolls::speak(byte who, byte subject) {
-	if (subject == 0) { // No subject.
-		displayScrollChain('s', who, false, true);
-		return;
-	}
-
-	// Subject given.
-	_noError = false; // Assume that until we know otherwise.
-
-	Common::File indexfile;
-	if (!indexfile.open("converse.avd"))
-		error("AVALANCHE: Visa: File not found: converse.avd");
-
-	indexfile.seek(who * 2 - 2);
-	uint16 idx_offset = indexfile.readUint16LE();
-	uint16 next_idx_offset = indexfile.readUint16LE();
-
-	if ((idx_offset == 0) || ((((next_idx_offset - idx_offset) / 2) - 1) < subject))
-		return;
-
-	indexfile.seek(idx_offset + subject * 2);
-	uint16 sez_offset = indexfile.readUint16LE();
-	if ((sez_offset == 0) || (indexfile.err()))
-		return;
-	indexfile.close();
-
-	Common::File sezfile;
-	if (!sezfile.open("avalot.sez"))
-		error("AVALANCHE: Visa: File not found: avalot.sez");
-
-	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
-	sezfile.close();
-
-	unSkrimble();
-	doTheBubble();
-
-	_vm->_scrolls->callScrollDriver();
-	_noError = true;
-}
-
-void Scrolls::talkTo(byte whom) {
-	if (_vm->_acci->_person == _vm->_acci->kPardon) {
-		_vm->_acci->_person = _vm->_gyro->_subjectNum;
-		_vm->_gyro->_subjectNum = 0;
-	}
-
-	if (_vm->_gyro->_subjectNum == 0) {
-		switch (whom) {
-		case Gyro::kPeopleSpludwick:
-			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
-				displayScrollChain('q', 68);
-				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_lucerna->incScore(3);
-				return;
-			} else if (_vm->_gyro->_talkedToCrapulus) {
-				// Spludwick - what does he need?
-				// 0 - let it through to use normal routine.
-				switch (_vm->_gyro->_givenToSpludwick) {
-				case 1: // Fallthrough is intended.
-				case 2: {
-					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
-					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
-					_vm->_scrolls->displayText(tmpStr);
-					}
-					return;
-				case 3:
-					displayScrollChain('q', 30); // Need any help with the game?
-					return;
-				}
-			} else {
-				displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
-				return;
-			}
-			break;
-		case Gyro::kPeopleIbythneth:
-			if (_vm->_gyro->_givenBadgeToIby) {
-				displayScrollChain('q', 33); // Thanks a lot!
-				return; // And leave the proc.
-			}
-			break; // Or... just continue, 'cos he hasn't got it.
-		case Gyro::kPeopleDogfood:
-			if (_vm->_gyro->_wonNim) { // We've won the game.
-				displayScrollChain('q', 6); // "I'm Not Playing!"
-				return; // Zap back.
-			} else
-				_vm->_gyro->_askedDogfoodAboutNim = true;
-			break;
-		case Gyro::kPeopleAyles:
-			if (!_vm->_gyro->_aylesIsAwake) {
-				displayScrollChain('q', 43); // He's fast asleep!
-				return;
-			} else if (!_vm->_gyro->_givenPenToAyles) {
-				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
-				return;
-			}
-			break;
-
-		case Gyro::kPeopleJacques:
-			displayScrollChain('q', 43);
-			return;
-
-		case Gyro::kPeopleGeida:
-			if (_vm->_gyro->_givenPotionToGeida)
-				_vm->_gyro->_geidaFollows = true;
-			else {
-				displayScrollChain('u', 17);
-				return;
-			}
-			break;
-		case Gyro::kPeopleSpurge:
-			if (!_vm->_gyro->_sittingInPub) {
-				displayScrollChain('q', 71); // Try going over and sitting down.
-				return;
-			} else {
-				if (_vm->_gyro->_spurgeTalkCount < 5)
-					_vm->_gyro->_spurgeTalkCount++;
-				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
-					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
-					return;
-				}
-			}
-			break;
-		}
-	// On a subject. Is there any reason to block it?
-	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
-		displayScrollChain('q', 43); // He's fast asleep!
-		return;
-	}
-
-	if (whom > 149)
-		whom -= 149;
-
-	bool noMatches = true;
-	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
-			Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, i + 49, Scrolls::kControlToBuffer);
-			_vm->_scrolls->displayText(tmpStr);
-			noMatches = false;
-			break;
-		}
-	}
-
-	if (noMatches) {
-		Common::String tmpStr = Common::String::format("%c%c%c", Scrolls::kControlRegister, Scrolls::kControlRegister, Scrolls::kControlToBuffer);
-		_vm->_scrolls->displayText(tmpStr);
-	}
-
-	speak(whom, _vm->_gyro->_subjectNum);
-
-	if (!_noError)
-		displayScrollChain('n', whom); // File not found!
-
-	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		displayScrollChain('q', 1); // Circular from Cardiff.
-		_vm->_gyro->_talkedToCrapulus = true;
-		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
-
-		AnimationType *spr = &_vm->_animation->_sprites[1];
-		spr->_vanishIfStill = true;
-		spr->walkTo(2); // Walks away.
-
-		_vm->_lucerna->incScore(2);
-	}
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/scrolls.h b/engines/avalanche/scrolls.h
deleted file mode 100644
index a8938a5..0000000
--- a/engines/avalanche/scrolls.h
+++ /dev/null
@@ -1,133 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
- /* SCROLLS		The scroll driver. */
-
-#ifndef AVALANCHE_SCROLLS2_H
-#define AVALANCHE_SCROLLS2_H
-
-#include "common/system.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Scrolls;
-
-typedef void (Scrolls::*ScrollsFunctionType)();
-
-class Scrolls {
-public:
-	// Constants to replace the command characters from Pascal.
-	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
-	enum ControlCharacter {
-		kControlSpeechBubble = 2, // ^B
-		kControlCenter = 3, // ^C
-		kControlToBuffer = 4, // ^D
-		kControlItalic = 6, // ^F
-		kControlBell = 7, // ^G
-		kControlBackspace = 8, // ^H
-		kControlInsertSpaces = 9, // ^I
-		kControlLeftJustified = 12, // ^L
-		kControlNewLine = 13, // ^M
-		kControlParagraph = 16, // ^P
-		kControlQuestion = 17, // ^Q
-		kControlRoman = 18, // ^R
-		kControlRegister = 19, // ^S
-		kControlNegative = 21, // ^U
-		kControlIcon = 22 // ^V
-	};
-
-	bool _aboutScroll; // Is this the about box?
-	FontType _scrollFonts[2];
-
-	Scrolls(AvalancheEngine *vm);
-
-	void init();
-	void setReadyLight(byte state); // Sets "Ready" light to whatever.
-	void drawScroll(ScrollsFunctionType modeFunc);
-	void drawBubble(ScrollsFunctionType modeFunc);
-	void resetScroll();
-	void callScrollDriver();
-	void displayText(Common::String text);
-	bool displayQuestion(Common::String question);
-	void setBubbleStateNatural(); // Natural state of bubbles
-	Common::String displayMoney();
-	void musicalScroll(); // Practically this one is a mini-game which called when you play the harp in the monastery.
-
-	// From Visa:
-	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
-	void talkTo(byte whom);
-
-private:
-	AvalancheEngine *_vm;
-
-	enum FontStyle {
-		kFontStyleRoman,
-		kFontStyleItalic
-	};
-
-	static const int16 kHalfIconWidth = 19; // Half the width of an icon.
-
-	int16 _shadowBoxX, _shadowBoxY;
-	byte _currentFont; // Current font
-	Common::Point _dodgeCoord;
-	byte _param; // For using arguments code
-	byte _useIcon;
-
-	// These 3 functions are always passed as ScrollsFunctionType parameters.
-	void scrollModeNormal();
-	void scrollModeDialogue();
-	void scrollModeMusic();
-
-	// These 2 are used only in musicalScroll().
-	void store(byte what, TuneType &played);
-	bool theyMatch(TuneType &played);
-
-	void stripTrailingSpaces(Common::String &str); // Original: strip.
-	void solidify(byte n); // Does the word wrapping.
-
-	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
-	void unDodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
-
-	void easterEgg();
-	void say(int16 x, int16 y, Common::String text);
-	void resetScrollDriver();
-	void ringBell(); // Original: dingdongbell
-	void getIcon(int16 x, int16 y, byte which);
-	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
-	void loadFont();
-
-	// From Visa:
-	bool _noError;
-	void unSkrimble();
-	void doTheBubble();
-	void speak(byte who, byte subject);
-};
-
-} // End of namespace Avalanche
-
-#endif // AVALANCHE_SCROLLS2_H
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 9f51e2a..c76c989 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -31,7 +31,7 @@
 #include "avalanche/timer.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
-#include "avalanche/scrolls.h"
+#include "avalanche/dialogs.h"
 #include "avalanche/acci.h"
 #include "avalanche/sequence.h"
 #include "avalanche/pingo.h"
@@ -240,7 +240,7 @@ void Timer::openDrawbridge() {
 }
 
 void Timer::avariciusTalks() {
-	_vm->_scrolls->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
+	_vm->_dialogs->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
 	_vm->_gyro->_avariciusTalk++;
 
 	if (_vm->_gyro->_avariciusTalk < 17)
@@ -257,17 +257,17 @@ void Timer::urinate() {
 }
 
 void Timer::toilet() {
-	_vm->_scrolls->displayText("That's better!");
+	_vm->_dialogs->displayText("That's better!");
 }
 
 void Timer::bang() {
-	Common::String tmpStr = Common::String::format("%c< BANG! >", Scrolls::kControlItalic);
-	_vm->_scrolls->displayText(tmpStr);
+	Common::String tmpStr = Common::String::format("%c< BANG! >", Dialogs::kControlItalic);
+	_vm->_dialogs->displayText(tmpStr);
 	addTimer(30, kProcBang2, kReasonExplosion);
 }
 
 void Timer::bang2() {
-	_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
+	_vm->_dialogs->displayText("Hmm... sounds like Spludwick's up to something...");
 }
 
 void Timer::stairs() {
@@ -283,25 +283,25 @@ void Timer::stairs() {
 void Timer::cardiffSurvey() {
 	if (_vm->_gyro->_cardiffQuestionNum == 0) {
 		_vm->_gyro->_cardiffQuestionNum++;
-		_vm->_scrolls->displayScrollChain('q', 27);
+		_vm->_dialogs->displayScrollChain('q', 27);
 	}
 
-	_vm->_scrolls->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
+	_vm->_dialogs->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
 	_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
 void Timer::cardiffReturn() {
-	_vm->_scrolls->displayScrollChain('q', 28);
+	_vm->_dialogs->displayScrollChain('q', 28);
 	cardiffSurvey(); // Add end of question.
 }
 
 void Timer::cwytalotInHerts() {
-	_vm->_scrolls->displayScrollChain('q', 29);
+	_vm->_dialogs->displayScrollChain('q', 29);
 }
 
 void Timer::getTiedUp() {
-	_vm->_scrolls->displayScrollChain('q', 34); // ...Trouble!
+	_vm->_dialogs->displayScrollChain('q', 34); // ...Trouble!
 	_vm->_gyro->_userMovesAvvy = false;
 	_vm->_gyro->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
@@ -328,18 +328,18 @@ void Timer::hangAround() {
 	avvy->init(7, true, _vm->_animation); // Robin Hood
 	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins;
 	_vm->_animation->appearPed(0, 1);
-	_vm->_scrolls->displayScrollChain('q', 39);
+	_vm->_dialogs->displayScrollChain('q', 39);
 	avvy->walkTo(6);
 	addTimer(55, kProcHangAround2, kReasonHangingAround);
 }
 
 void Timer::hangAround2() {
-	_vm->_scrolls->displayScrollChain('q', 40);
+	_vm->_dialogs->displayScrollChain('q', 40);
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
 	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomRobins;
-	_vm->_scrolls->displayScrollChain('q', 41);
+	_vm->_dialogs->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
 
@@ -362,8 +362,8 @@ void Timer::afterTheShootemup() {
 	_vm->_lucerna->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
-	_vm->_scrolls->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
-		+ Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)");
+	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+		+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
 
 #if 0
 	byte shootscore, gain;
@@ -383,7 +383,7 @@ void Timer::afterTheShootemup() {
 
 	warning("STUB: Timer::after_the_shootemup()");
 
-	_vm->_scrolls->displayScrollChain('q', 70);
+	_vm->_dialogs->displayScrollChain('q', 70);
 }
 
 void Timer::jacquesWakesUp() {
@@ -392,7 +392,7 @@ void Timer::jacquesWakesUp() {
 	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_background->drawBackgroundSprite(-1, -1, 0); // Eyes open.
-		_vm->_scrolls->displayScrollChain('Q', 45);
+		_vm->_dialogs->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
@@ -440,7 +440,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 
 void Timer::naughtyDuke2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
-	_vm->_scrolls->displayScrollChain('q', 48); // "Ha ha, it worked again!"
+	_vm->_dialogs->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 	spr->walkTo(0); // Walk to the door.
 	spr->_vanishIfStill = true; // Then go away!
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
@@ -487,20 +487,20 @@ void Timer::jump() {
 			&& (_vm->_animation->inField(2))) { // Beside the wall
 		// Grab the arrow!
 		if (_vm->_gyro->_carryNum >= kCarryLimit)
-			_vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
+			_vm->_dialogs->displayText("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
 			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
 			_vm->_lucerna->refreshObjectList();
-			_vm->_scrolls->displayScrollChain('q', 50);
+			_vm->_dialogs->displayScrollChain('q', 50);
 			_vm->_lucerna->incScore(3);
 		}
 	}
 }
 
 void Timer::crapulusSaysSpludOut() {
-	_vm->_scrolls->displayScrollChain('q', 56);
+	_vm->_dialogs->displayScrollChain('q', 56);
 	_vm->_gyro->_crapulusWillTell = false;
 }
 
@@ -508,11 +508,11 @@ void Timer::buyDrinks() {
 	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
-	_vm->_scrolls->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
+	_vm->_dialogs->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
-	_vm->_scrolls->displayScrollChain('D', 1); // That'll be thruppence.
+	_vm->_dialogs->displayScrollChain('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
-		_vm->_scrolls->displayScrollChain('D', 3); // Tell 'em you paid up.
+		_vm->_dialogs->displayScrollChain('D', 3); // Tell 'em you paid up.
 	_vm->_acci->drink();
 }
 
@@ -520,10 +520,10 @@ void Timer::buyWine() {
 	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
 	_vm->_gyro->_malagauche = 0;
 
-	_vm->_scrolls->displayScrollChain('D', 50); // You buy the wine.
-	_vm->_scrolls->displayScrollChain('D', 1); // It'll be thruppence.
+	_vm->_dialogs->displayScrollChain('D', 50); // You buy the wine.
+	_vm->_dialogs->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) {
-		_vm->_scrolls->displayScrollChain('D', 4); // You paid up.
+		_vm->_dialogs->displayScrollChain('D', 4); // You paid up.
 		_vm->_gyro->_objects[Gyro::kObjectWine - 1] = true;
 		_vm->_lucerna->refreshObjectList();
 		_vm->_gyro->_wineState = 1; // OK Wine.
@@ -531,12 +531,12 @@ void Timer::buyWine() {
 }
 
 void Timer::callsGuards() {
-	_vm->_scrolls->displayScrollChain('Q', 58); // "GUARDS!!!"
+	_vm->_dialogs->displayScrollChain('Q', 58); // "GUARDS!!!"
 	_vm->_lucerna->gameOver();
 }
 
 void Timer::greetsMonk() {
-	_vm->_scrolls->displayScrollChain('Q', 59);
+	_vm->_dialogs->displayScrollChain('Q', 59);
 	_vm->_gyro->_enteredLustiesRoomAsMonk = true;
 }
 
@@ -551,11 +551,11 @@ void Timer::fallDownOubliette() {
 
 void Timer::meetAvaroid() {
 	if (_vm->_gyro->_metAvaroid) {
-		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Scrolls::kControlItalic, Scrolls::kControlRoman);
-		_vm->_scrolls->displayText(tmpStr);
+		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+		_vm->_dialogs->displayText(tmpStr);
 		_vm->_lucerna->gameOver();
 	} else {
-		_vm->_scrolls->displayScrollChain('Q', 60);
+		_vm->_dialogs->displayScrollChain('Q', 60);
 		_vm->_gyro->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
@@ -594,7 +594,7 @@ void Timer::robinHoodAndGeida() {
 }
 
 void Timer::robinHoodAndGeidaTalk() {
-	_vm->_scrolls->displayScrollChain('q', 66);
+	_vm->_dialogs->displayScrollChain('q', 66);
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -613,7 +613,7 @@ void Timer::avalotReturns() {
 	spr->remove();
 	avvy->init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(0, 0);
-	_vm->_scrolls->displayScrollChain('q', 67);
+	_vm->_dialogs->displayScrollChain('q', 67);
 	_vm->_gyro->_userMovesAvvy = true;
 }
 
@@ -636,20 +636,20 @@ void Timer::avvySitDown() {
 
 void Timer::ghostRoomPhew() {
 	Common::String tmpStr = Common::String::format("%cPHEW!%c You're glad to get out of %cthere!",
-		Scrolls::kControlItalic, Scrolls::kControlRoman, Scrolls::kControlItalic);
-	_vm->_scrolls->displayText(tmpStr);
+		Dialogs::kControlItalic, Dialogs::kControlRoman, Dialogs::kControlItalic);
+	_vm->_dialogs->displayText(tmpStr);
 }
 
 void Timer::arkataShouts() {
 	if (_vm->_gyro->_teetotal)
 		return;
 
-	_vm->_scrolls->displayScrollChain('q', 76);
+	_vm->_dialogs->displayScrollChain('q', 76);
 	addTimer(160, kProcArkataShouts, kReasonArkataShouts);
 }
 
 void Timer::winning() {
-	_vm->_scrolls->displayScrollChain('q', 79);
+	_vm->_dialogs->displayScrollChain('q', 79);
 	_vm->_pingo->winningPic();
 
 	warning("STUB: Timer::winning()");
@@ -661,7 +661,7 @@ void Timer::winning() {
 	// TODO: To be implemented with Pingo::winningPic().
 
 	_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
-	_vm->_scrolls->displayText(" T H E    E N D ");
+	_vm->_dialogs->displayText(" T H E    E N D ");
 	_vm->_gyro->_letMeOut = true;
 }
 
@@ -672,12 +672,12 @@ void Timer::avalotFalls() {
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay = Common::String::format("%c%c%c%c%c%c%c%c%c%c%c%c%cZ%c",
-			Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine,
-			Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine,
-			Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces,
-			Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces, Scrolls::kControlInsertSpaces,
-			Scrolls::kControlRegister, Scrolls::kControlIcon);
-		_vm->_scrolls->displayText(toDisplay);
+			Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine,
+			Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine,
+			Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces,
+			Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces,
+			Dialogs::kControlRegister, Dialogs::kControlIcon);
+		_vm->_dialogs->displayText(toDisplay);
 	}
 }
 
@@ -693,7 +693,7 @@ void Timer::spludwickLeavesCauldron() {
 }
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.
-	_vm->_scrolls->displayScrollChain('Q', 86);
+	_vm->_dialogs->displayScrollChain('Q', 86);
 	_vm->_lucerna->incScore(4);
 	_vm->_gyro->_lustieIsAsleep = true;
 	_vm->_sequence->firstShow(5);


Commit: a80af5326e14e444856b9a772e793c370666ba26
    https://github.com/scummvm/scummvm/commit/a80af5326e14e444856b9a772e793c370666ba26
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T09:37:52-07:00

Commit Message:
AVALANCHE: Merge Acci and Parser

Changed paths:
  R engines/avalanche/acci.cpp
  R engines/avalanche/acci.h
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/gyro.cpp
    engines/avalanche/lucerna.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp
deleted file mode 100644
index f98eb91..0000000
--- a/engines/avalanche/acci.cpp
+++ /dev/null
@@ -1,2246 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ACCIDENCE II		The parser. */
-
-#include "avalanche/avalanche.h"
-#include "avalanche/acci.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/timer.h"
-#include "avalanche/animation.h"
-#include "avalanche/background.h"
-#include "avalanche/pingo.h"
-#include "avalanche/sequence.h"
-
-#include "common/textconsole.h"
-
-#include <cstring>
-#include <cmath>
-
-namespace Avalanche {
-
-Acci::Acci(AvalancheEngine *vm) {
-	_vm = vm;
-}
-
-void Acci::init() {
-	_vm->_gyro->_weirdWord = false;
-
-	// Initailaze the vocabulary.
-	// Verbs: 1-49
-	_vocabulary[0].init(1, "EXAMINE");
-	_vocabulary[1].init(1, "READ");
-	_vocabulary[2].init(1, "XAM");
-	_vocabulary[3].init(2, "OPEN");
-	_vocabulary[4].init(2, "LEAVE");
-	_vocabulary[5].init(2, "UNLOCK");
-	_vocabulary[6].init(3, "PAUSE");
-	_vocabulary[7].init(47, "TA"); // Early to avoid Take and Talk.
-	_vocabulary[8].init(4, "TAKE");
-	_vocabulary[9].init(4, "GET");
-	_vocabulary[10].init(4, "PICK");
-	_vocabulary[11].init(5, "DROP");
-	_vocabulary[12].init(6, "INVENTORY");
-	_vocabulary[13].init(7, "TALK");
-	_vocabulary[14].init(7, "SAY");
-	_vocabulary[15].init(7, "ASK");
-	_vocabulary[16].init(8, "GIVE");
-	_vocabulary[17].init(9, "DRINK");
-	_vocabulary[18].init(9, "IMBIBE");
-	_vocabulary[19].init(9, "DRAIN");
-	_vocabulary[20].init(10, "LOAD");
-	_vocabulary[21].init(10, "RESTORE");
-	_vocabulary[22].init(11, "SAVE");
-	_vocabulary[23].init(12, "BRIBE");
-	_vocabulary[24].init(12, "PAY");
-	_vocabulary[25].init(13, "LOOK");
-	_vocabulary[26].init(14, "BREAK");
-	_vocabulary[27].init(15, "QUIT");
-	_vocabulary[28].init(15, "EXIT");
-	_vocabulary[29].init(16, "SIT");
-	_vocabulary[30].init(16, "SLEEP");
-	_vocabulary[31].init(17, "STAND");
-
-	_vocabulary[32].init(18, "GO");
-	_vocabulary[33].init(19, "INFO");
-	_vocabulary[34].init(20, "UNDRESS");
-	_vocabulary[35].init(20, "DOFF");
-	_vocabulary[36].init(21, "DRESS");
-	_vocabulary[37].init(21, "WEAR");
-	_vocabulary[38].init(21, "DON");
-	_vocabulary[39].init(22, "PLAY");
-	_vocabulary[40].init(22, "STRUM");
-	_vocabulary[41].init(23, "RING");
-	_vocabulary[42].init(24, "HELP");
-	_vocabulary[43].init(25, "KENDAL");
-	_vocabulary[44].init(26, "CAPYBARA");
-	_vocabulary[45].init(27, "BOSS");
-	_vocabulary[46].init(255, "NINET"); // block for NINETY
-	_vocabulary[47].init(28, "URINATE");
-	_vocabulary[48].init(28, "MINGITE");
-	_vocabulary[49].init(29, "NINETY");
-	_vocabulary[50].init(30, "ABRACADABRA");
-	_vocabulary[51].init(30, "PLUGH");
-	_vocabulary[52].init(30, "XYZZY");
-	_vocabulary[53].init(30, "HOCUS");
-	_vocabulary[54].init(30, "POCUS");
-	_vocabulary[55].init(30, "IZZY");
-	_vocabulary[56].init(30, "WIZZY");
-	_vocabulary[57].init(30, "PLOVER");
-	_vocabulary[58].init(30, "MELENKURION");
-	_vocabulary[59].init(30, "ZORTON");
-	_vocabulary[60].init(30, "BLERBI");
-	_vocabulary[61].init(30, "THURB");
-	_vocabulary[62].init(30, "SNOEZE");
-	_vocabulary[63].init(30, "SAMOHT");
-	_vocabulary[64].init(30, "NOSIDE");
-	_vocabulary[65].init(30, "PHUGGG");
-	_vocabulary[66].init(30, "KNERL");
-	_vocabulary[67].init(30, "MAGIC");
-	_vocabulary[68].init(30, "KLAETU");
-	_vocabulary[69].init(30, "VODEL");
-	_vocabulary[70].init(30, "BONESCROLLS");
-	_vocabulary[71].init(30, "RADOF");
-
-	_vocabulary[72].init(31, "RESTART");
-	_vocabulary[73].init(32, "SWALLOW");
-	_vocabulary[74].init(32, "EAT");
-	_vocabulary[75].init(33, "LISTEN");
-	_vocabulary[76].init(33, "HEAR");
-	_vocabulary[77].init(34, "BUY");
-	_vocabulary[78].init(34, "PURCHASE");
-	_vocabulary[79].init(34, "ORDER");
-	_vocabulary[80].init(34, "DEMAND");
-	_vocabulary[81].init(35, "ATTACK");
-	_vocabulary[82].init(35, "HIT");
-	_vocabulary[83].init(35, "KILL");
-	_vocabulary[84].init(35, "PUNCH");
-	_vocabulary[85].init(35, "KICK");
-	_vocabulary[86].init(35, "SHOOT");
-	_vocabulary[87].init(35, "FIRE");
-
-	// Passwords: 36
-	_vocabulary[88].init(36, "TIROS");
-	_vocabulary[89].init(36, "WORDY");
-	_vocabulary[90].init(36, "STACK");
-	_vocabulary[91].init(36, "SHADOW");
-	_vocabulary[92].init(36, "OWL");
-	_vocabulary[93].init(36, "ACORN");
-	_vocabulary[94].init(36, "DOMESDAY");
-	_vocabulary[95].init(36, "FLOPPY");
-	_vocabulary[96].init(36, "DIODE");
-	_vocabulary[97].init(36, "FIELD");
-	_vocabulary[98].init(36, "COWSLIP");
-	_vocabulary[99].init(36, "OSBYTE");
-	_vocabulary[100].init(36, "OSCLI");
-	_vocabulary[101].init(36, "TIMBER");
-	_vocabulary[102].init(36, "ADVAL");
-	_vocabulary[103].init(36, "NEUTRON");
-	_vocabulary[104].init(36, "POSITRON");
-	_vocabulary[105].init(36, "ELECTRON");
-	_vocabulary[106].init(36, "CIRCUIT");
-	_vocabulary[107].init(36, "AURUM");
-	_vocabulary[108].init(36, "PETRIFY");
-	_vocabulary[109].init(36, "EBBY");
-	_vocabulary[110].init(36, "CATAPULT");
-	_vocabulary[111].init(36, "GAMERS");
-	_vocabulary[112].init(36, "FUDGE");
-	_vocabulary[113].init(36, "CANDLE");
-	_vocabulary[114].init(36, "BEEB");
-	_vocabulary[115].init(36, "MICRO");
-	_vocabulary[116].init(36, "SESAME");
-	_vocabulary[117].init(36, "LORDSHIP");
-
-	_vocabulary[118].init(37, "DIR");
-	_vocabulary[119].init(37, "LS");
-	_vocabulary[120].init(38, "DIE");
-	_vocabulary[121].init(39, "SCORE");
-	_vocabulary[122].init(40, "PUT");
-	_vocabulary[123].init(40, "INSERT");
-	_vocabulary[124].init(41, "KISS");
-	_vocabulary[125].init(41, "SNOG");
-	_vocabulary[126].init(41, "CUDDLE");
-	_vocabulary[127].init(42, "CLIMB");
-	_vocabulary[128].init(42, "CLAMBER");
-	_vocabulary[129].init(43, "JUMP");
-	_vocabulary[130].init(44, "HIGHSCORES");
-	_vocabulary[131].init(44, "HISCORES");
-	_vocabulary[132].init(45, "WAKEN");
-	_vocabulary[133].init(45, "AWAKEN");
-	_vocabulary[134].init(46, "HELLO");
-	_vocabulary[135].init(46, "HI");
-	_vocabulary[136].init(46, "YO");
-	_vocabulary[137].init(47, "THANKS"); // = 47, "ta", which was defined earlier.
-
-	// Nouns - Objects: 50-100
-	_vocabulary[138].init(50, "WINE");
-	_vocabulary[139].init(50, "BOOZE");
-	_vocabulary[140].init(50, "NASTY");
-	_vocabulary[141].init(50, "VINEGAR");
-	_vocabulary[142].init(51, "MONEYBAG");
-	_vocabulary[143].init(51, "BAG");
-	_vocabulary[144].init(51, "CASH");
-	_vocabulary[145].init(51, "DOSH");
-	_vocabulary[146].init(51, "WALLET");
-	_vocabulary[147].init(52, "BODKIN");
-	_vocabulary[148].init(52, "DAGGER");
-	_vocabulary[149].init(53, "POTION");
-	_vocabulary[150].init(54, "CHASTITY");
-	_vocabulary[151].init(54, "BELT");
-	_vocabulary[152].init(55, "BOLT");
-	_vocabulary[153].init(55, "ARROW");
-	_vocabulary[154].init(55, "DART");
-	_vocabulary[155].init(56, "CROSSBOW");
-	_vocabulary[156].init(56, "BOW");
-	_vocabulary[157].init(57, "LUTE");
-	_vocabulary[158].init(58, "PILGRIM");
-	_vocabulary[159].init(58, "BADGE");
-	_vocabulary[160].init(59, "MUSHROOMS");
-	_vocabulary[161].init(59, "TOADSTOOLS");
-	_vocabulary[162].init(60, "KEY");
-	_vocabulary[163].init(61, "BELL");
-	_vocabulary[164].init(62, "PRESCRIPT");
-	_vocabulary[165].init(62, "SCROLL");
-	_vocabulary[166].init(62, "MESSAGE");
-	_vocabulary[167].init(63, "PEN");
-	_vocabulary[168].init(63, "QUILL");
-	_vocabulary[169].init(64, "INK");
-	_vocabulary[170].init(64, "INKPOT");
-	_vocabulary[171].init(65, "CLOTHES");
-	_vocabulary[172].init(66, "HABIT");
-	_vocabulary[173].init(66, "DISGUISE");
-	_vocabulary[174].init(67, "ONION");
-
-	_vocabulary[175].init(99, "PASSWORD");
-
-	// Objects from Also are placed between 101 and 131.
-	// Nouns - People - Male: 150-174
-	_vocabulary[176].init(150, "AVVY");
-	_vocabulary[177].init(150, "AVALOT");
-	_vocabulary[178].init(150, "YOURSELF");
-	_vocabulary[179].init(150, "ME");
-	_vocabulary[180].init(150, "MYSELF");
-	_vocabulary[181].init(151, "SPLUDWICK");
-	_vocabulary[182].init(151, "THOMAS");
-	_vocabulary[183].init(151, "ALCHEMIST");
-	_vocabulary[184].init(151, "CHEMIST");
-	_vocabulary[185].init(152, "CRAPULUS");
-	_vocabulary[186].init(152, "SERF");
-	_vocabulary[187].init(152, "SLAVE");
-	_vocabulary[188].init(158, "DU"); // Put in early for Baron DU Lustie to save confusion with Duck & Duke.
-	_vocabulary[189].init(152, "CRAPPY");
-	_vocabulary[190].init(153, "DUCK");
-	_vocabulary[191].init(153, "DOCTOR");
-	_vocabulary[192].init(154, "MALAGAUCHE");
-	_vocabulary[193].init(155, "FRIAR");
-	_vocabulary[194].init(155, "TUCK");
-	_vocabulary[195].init(156, "ROBIN");
-	_vocabulary[196].init(156, "HOOD");
-	_vocabulary[197].init(157, "CWYTALOT");
-	_vocabulary[198].init(157, "GUARD");
-	_vocabulary[199].init(157, "BRIDGEKEEP");
-	_vocabulary[200].init(158, "BARON");
-	_vocabulary[201].init(158, "LUSTIE");
-	_vocabulary[202].init(159, "DUKE");
-	_vocabulary[203].init(159, "GRACE");
-	_vocabulary[204].init(160, "DOGFOOD");
-	_vocabulary[205].init(160, "MINSTREL");
-	_vocabulary[206].init(161, "TRADER");
-	_vocabulary[207].init(161, "SHOPKEEPER");
-	_vocabulary[208].init(161, "STALLHOLDER");
-	_vocabulary[209].init(162, "PILGRIM");
-	_vocabulary[210].init(162, "IBYTHNETH");
-	_vocabulary[211].init(163, "ABBOT");
-	_vocabulary[212].init(163, "AYLES");
-	_vocabulary[213].init(164, "PORT");
-	_vocabulary[214].init(165, "SPURGE");
-	_vocabulary[215].init(166, "JACQUES");
-	_vocabulary[216].init(166, "SLEEPER");
-	_vocabulary[217].init(166, "RINGER");
-
-	// Nouns - People - Female: 175-199
-	_vocabulary[218].init(175, "WIFE");
-	_vocabulary[219].init(175, "ARKATA");
-	_vocabulary[220].init(176, "GEDALODAVA");
-	_vocabulary[221].init(176, "GEIDA");
-	_vocabulary[222].init(176, "PRINCESS");
-	_vocabulary[223].init(178, "WISE");
-	_vocabulary[224].init(178, "WITCH");
-
-	// Pronouns: 200-224
-	_vocabulary[225].init(200, "HIM");
-	_vocabulary[226].init(200, "MAN");
-	_vocabulary[227].init(200, "GUY");
-	_vocabulary[228].init(200, "DUDE");
-	_vocabulary[229].init(200, "CHAP");
-	_vocabulary[230].init(200, "FELLOW");
-	_vocabulary[231].init(201, "HER");
-	_vocabulary[232].init(201, "GIRL");
-	_vocabulary[233].init(201, "WOMAN");
-	_vocabulary[234].init(202, "IT");
-	_vocabulary[235].init(202, "THING");
-	_vocabulary[236].init(203, "MONK");
-	_vocabulary[237].init(204, "BARMAN");
-	_vocabulary[238].init(204, "BARTENDER");
-
-	// Prepositions: 225-249
-	_vocabulary[239].init(225, "TO");
-	_vocabulary[240].init(226, "AT");
-	_vocabulary[241].init(227, "UP");
-	_vocabulary[242].init(228, "INTO");
-	_vocabulary[243].init(228, "INSIDE");
-	_vocabulary[244].init(229, "OFF");
-	_vocabulary[245].init(230, "UP");
-	_vocabulary[246].init(231, "DOWN");
-	_vocabulary[247].init(232, "ON");
-
-	// Please: 251
-	_vocabulary[248].init(251, "PLEASE");
-
-	// About: 252
-	_vocabulary[249].init(252, "ABOUT");
-	_vocabulary[250].init(252, "CONCERNING");
-
-	// Swear words: 253
-	/*		  I M P O R T A N T    M E S S A G E
-
-	DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
-	DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
-	GOODNESS KNOWS WHO WROTE THEM.
-	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
-	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
-	_vocabulary[251].init(253, "SHIT");
-	_vocabulary[252].init(28 , "PISS");
-	_vocabulary[253].init(28 , "PEE");
-	_vocabulary[254].init(253, "FART");
-	_vocabulary[255].init(253, "FUCK");
-	_vocabulary[256].init(253, "BALLS");
-	_vocabulary[257].init(253, "BLAST");
-	_vocabulary[258].init(253, "BUGGER");
-	_vocabulary[259].init(253, "KNICKERS");
-	_vocabulary[260].init(253, "BLOODY");
-	_vocabulary[261].init(253, "HELL");
-	_vocabulary[262].init(253, "DAMN");
-	_vocabulary[263].init(253, "SMEG");
-	// ...and other even ruder words. You didn't read them, did you? Good.
-
-	// Answer-back smart-alec words: 249
-	_vocabulary[264].init(249, "YES");
-	_vocabulary[265].init(249, "NO");
-	_vocabulary[266].init(249, "BECAUSE");
-
-	// Noise words: 255
-	_vocabulary[267].init(255, "THE");
-	_vocabulary[268].init(255, "A");
-	_vocabulary[269].init(255, "NOW");
-	_vocabulary[270].init(255, "SOME");
-	_vocabulary[271].init(255, "AND");
-	_vocabulary[272].init(255, "THAT");
-	_vocabulary[273].init(255, "POCUS");
-	_vocabulary[274].init(255, "HIS");
-	_vocabulary[275].init(255, "THIS");
-	_vocabulary[276].init(255, "SENTINEL"); // for "Ken SENT Me"
-}
-
-void Acci::clearWords() {
-	for (int i = 0; i < 11; i++) {
-		if (!_realWords[i].empty())
-			_realWords[i].clear();
-	}
-}
-
-byte Acci::wordNum(Common::String word) {
-	if (word.empty())
-		return 0;
-
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (_vocabulary[i]._word == word)
-			return _vocabulary[i]._number;
-	}
-
-	// If not found as a whole, we look for it as a substring.
-	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
-		if (Common::String(_vocabulary[i]._word.c_str(), word.size()) == word)
-			return _vocabulary[i]._number;
-	}
-
-	return kPardon;
-}
-
-void Acci::replace(Common::String oldChars, byte newChar) {
-	int16 pos = _vm->_parser->pos(oldChars, _thats);
-	while (pos != -1) {
-		if (newChar == 0)
-			_thats.deleteChar(pos);
-		else {
-			for (uint i = pos; i < pos + oldChars.size(); i++)
-				_thats.deleteChar(pos);
-			_thats.insertChar(newChar, pos);
-		}
-		pos = _vm->_parser->pos(oldChars, _thats);
-	}
-}
-
-Common::String Acci::rank() {
-	static const RankType kRanks[9] = {
-		{0, "Beginner"},     {10, "Novice"},
-		{20, "Improving"},   {35, "Not bad"},
-		{50, "Passable"},    {65, "Good"},
-		{80, "Experienced"}, {108, "The BEST!"},
-		{32767, "copyright'93"}
-	};
-
-	for (int i = 0; i < 8; i++) {
-		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
-			return kRanks[i]._title;
-		}
-	}
-	return "";
-}
-
-Common::String Acci::totalTime() {
-	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	const double ticksInOneSec = (double)(65535) / 3600;
-	uint16 h, m, s;
-
-	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
-	m = h % 3600;
-	h /= 3600;
-	s = m % 60;
-	m /= 60;
-
-	Common::String result = "You've been playing for ";
-	if (h > 0)
-		result += Common::String::format("%d hours, ", h);
-	if ((m > 0) || (h != 0))
-		result = Common::String::format("%d minutes and ", m);
-	return result + Common::String::format("%d seconds", s);
-}
-
-void Acci::cheatParse(Common::String codes) {
-	warning("STUB: Acci::cheatParse()");
-}
-
-
-
-void Acci::stripPunctuation(Common::String &word) {
-	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
-
-	for (int i = 0; i < 32; i++) {
-		for (;;) {
-			int16 pos = _vm->_parser->pos(Common::String(punct[i]), word);
-			if (pos == -1)
-				break;
-			word.deleteChar(pos);
-		}
-	}
-}
-
-void Acci::displayWhat(byte target, bool animate, bool &ambiguous) {
-	if (target == kPardon) {
-		ambiguous = true;
-		if (animate)
-			_vm->_dialogs->displayText("Whom?");
-		else
-			_vm->_dialogs->displayText("What?");
-	} else {
-		if (animate) {
-			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
-			_vm->_dialogs->displayText(tmpStr);
-		} else {
-			Common::String z = _vm->_gyro->getItem(target);
-			if (z != "") {
-				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
-				_vm->_dialogs->displayText(tmpStr);
-			}
-		}
-	}
-}
-
-bool Acci::doPronouns() {
-	bool ambiguous = false;
-
-	for (uint i = 0; i < _thats.size(); i++) {
-		byte wordCode = _thats[i];
-		switch (wordCode) {
-		case 200:
-			displayWhat(_vm->_gyro->_him, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_him, i);
-			break;
-		case 201:
-			displayWhat(_vm->_gyro->_her, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_her, i);
-			break;
-		case 202:
-			displayWhat(_vm->_gyro->_it, false, ambiguous);
-			_thats.setChar(_vm->_gyro->_it, i);
-			break;
-		}
-	}
-
-	return ambiguous;
-}
-
-void Acci::properNouns() {
-	_vm->_parser->_inputText.toLowercase();
-
-	// We set every word's first character to uppercase.
-	for (uint i = 1; i < (_vm->_parser->_inputText.size() - 1); i++) {
-		if (_vm->_parser->_inputText[i] == ' ')
-			_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[i + 1]), i + 1);
-	}
-
-	// And the first character as well.
-	_vm->_parser->_inputText.setChar(toupper(_vm->_parser->_inputText[0]), 0);
-}
-
-void Acci::sayIt() {
-	Common::String x = _vm->_parser->_inputText;
-	x.setChar(toupper(x[0]), 0);
-	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Dialogs::kControlRegister, x.c_str(), 
-		                                           Dialogs::kControlSpeechBubble, Dialogs::kControlRegister);
-	_vm->_dialogs->displayText(tmpStr);
-}
-
-void Acci::storeInterrogation(byte interrogation) {
-	if (_vm->_parser->_inputText.empty())
-		return;
-
-	// Strip _vm->_parser->_inputText:
-	while ((_vm->_parser->_inputText[0] == ' ') && (!_vm->_parser->_inputText.empty()))
-		_vm->_parser->_inputText.deleteChar(0);
-	while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
-		_vm->_parser->_inputText.deleteLastChar();
-
-	_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
-
-	switch (interrogation) {
-	case 1:
-		_vm->_parser->_inputText.toLowercase();
-		sayIt();
-		_vm->_gyro->_favouriteDrink = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 2;
-		break;
-	case 2:
-		properNouns();
-		sayIt();
-		_vm->_gyro->_favouriteSong = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 3;
-		break;
-	case 3:
-		properNouns();
-		sayIt();
-		_vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText;
-		_vm->_gyro->_cardiffQuestionNum = 4;
-		break;
-	case 4:
-		_vm->_parser->_inputText.toLowercase();
-		sayIt();
-		if (!_vm->_gyro->_spareEvening.empty())
-			_vm->_gyro->_spareEvening.clear();
-		_vm->_gyro->_spareEvening = _vm->_parser->_inputText;
-		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
-		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
-		_vm->_gyro->_cardiffQuestionNum = 5;
-		break;
-	case 99:
-		//store_high(_vm->_parser->_inputText);
-		warning("STUB: Acci::store_interrogation()");
-		break;
-	}
-
-	if (interrogation < 4)
-		_vm->_timer->cardiffSurvey();
-}
-
-
-
-void Acci::parse() {
-	// First parsing - word identification
-	if (!_thats.empty())
-		_thats.clear();
-
-	byte n = 0;
-	_polite = false;
-	_verb = kPardon;
-	_thing = kPardon;
-	_thing2 = kPardon;
-	_person = kPardon;
-	clearWords();
-
-
-	// A cheat mode attempt.
-	if (_vm->_parser->_inputText[0] == '.') {
-		cheatParse(_vm->_parser->_inputText);
-		_thats = kNothing;
-		return;
-	}
-
-	// Are we being interrogated right now?
-	if (_vm->_gyro->_interrogation > 0) {
-		storeInterrogation(_vm->_gyro->_interrogation);
-		_vm->_gyro->_weirdWord = true;
-		return;
-	}
-
-	// Actually process the command.
-	Common::String inputText = _vm->_parser->_inputText + ' ';
-	Common::String inputTextUpper = inputText;
-	inputTextUpper.toUppercase();
-	while (!inputTextUpper.empty()) {
-		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
-			inputTextUpper.deleteChar(0);
-			inputText.deleteChar(0);
-		}
-		if (inputTextUpper.empty())
-			break;
-
-		// Get the following word of the strings.
-		byte size = _vm->_parser->pos(Common::String(' '), inputTextUpper) + 1;
-		char *subStr = new char[size];
-		Common::strlcpy(subStr, inputTextUpper.c_str(), size);
-		Common::String thisword = subStr;
-		Common::strlcpy(subStr, inputText.c_str(), size);
-		_realWords[n] = subStr;
-		delete[] subStr;
-
-		stripPunctuation(inputTextUpper);
-
-		bool notfound = true;
-
-		// Check also[] first, which contains words about the actual room.
-		if (!thisword.empty()) {
-			for (int i = 0; i < 31; i++) {
-				if ((_vm->_gyro->_also[i][0] != 0) && (_vm->_parser->pos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
-					_thats += Common::String(99 + i);
-					notfound = false;
-				}
-			}
-		}
-
-		// Check Accis's own table (words[]) for "global" commands.
-		if (notfound) {
-			byte answer = wordNum(thisword);
-			if (answer == kPardon) {
-				notfound = true;
-				_thats = _thats + kPardon;
-			} else
-				_thats = _thats + answer;
-			n++;
-		}
-
-		// Delete words we already processed.
-		int16 spacePos = _vm->_parser->pos(Common::String(' '), inputTextUpper);
-		if (spacePos > -1) {
-			for (int i = 0; i <= spacePos; i++)
-				inputTextUpper.deleteChar(0);
-		}
-
-		spacePos = _vm->_parser->pos(Common::String(' '), inputText);
-		if (spacePos > -1) {
-			for (int i = 0; i <= spacePos; i++)
-				inputText.deleteChar(0);
-		}
-	}
-
-	Common::String unkString;
-	int16 pos = _vm->_parser->pos(Common::String('\xFE'), _thats);
-	if (pos > -1)
-		unkString = _realWords[pos];
-	else
-		unkString.clear();
-
-	// Replace words' codes that mean the same.
-	replace(Common::String("\xFF"),     0); // zap noise words
-	replace(Common::String("\xD\xE2"),  1); // "look at" = "examine"
-	replace(Common::String("\xD\xE4"),  1); // "look in" = "examine"
-	replace(Common::String("\x4\xE6"),  17); // "get up" = "stand"
-	replace(Common::String("\x4\xE7"),  17); // "get down" = "stand"... well, why not?
-	replace(Common::String("\x12\xE4"), 2); // "go in" = "open [door]"
-	replace(Common::String("\x1C\xE5"), 253); // "P' off" is a swear word
-	replace(Common::String("\x4\x6"),   6); // "Take inventory" (remember Colossal Adventure?)
-	replace(Common::String("\x28\xE8"), 21); // "put on" = "don"
-	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
-
-	// Words that could mean more than one _person
-	if (_vm->_gyro->_room == kRoomNottsPub)
-		replace(Common::String('\xCC'), 164); // Barman = Port
-	else
-		replace(Common::String('\xCC'), 154); // Barman = Malagauche
-
-	switch (_vm->_gyro->_room) {
-	case kRoomAylesOffice:
-		replace(Common::String('\xCB'), 163); // Monk = Ayles
-		break;
-	case kRoomMusicRoom:
-		replace(Common::String('\xCB'), 166); // Monk = Jacques
-		break;
-	default:
-		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
-	}
-
-	if (doPronouns()) {
-		_vm->_gyro->_weirdWord = true;
-		_thats = kNothing;
-		return;
-	}
-
-	// Second parsing.
-	if (!_vm->_gyro->_subject.empty())
-		_vm->_gyro->_subject.clear();
-	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
-
-	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
-		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
-			_vm->_gyro->_subjectNum = (byte)_thats[i];
-			_thats.setChar(kMoved, i);
-			break;
-		}
-	}
-
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
-		for (uint16 i = 0; i < _thats.size() - 1; i++) {
-			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
-				_thats.setChar(0, i + 1);
-				break;
-			}
-		}
-	}
-
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
-		for (uint16 i = 0; i < _thats.size() - 1; i++) {
-			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
-				// SAY not followed by a preposition
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
-				_thats.setChar(0, i + 1);
-				break;
-			}
-		}
-	}
-
-	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
-		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
-			_verb = (byte)_thats[i];
-		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
-			_thing2 = _thing;
-			_thing = (byte)_thats[i];
-		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
-			_person = (byte)_thats[i];
-		else if ((byte)_thats[i] == 251)
-			_polite = true;
-	}
-
-	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
-		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
-		_vm->_dialogs->displayText(tmpStr);
-		_vm->_gyro->_weirdWord = true;
-	} else
-		_vm->_gyro->_weirdWord = false;
-
-	if (_thats.empty())
-		_thats = kNothing;
-
-	if (_thing != kPardon)
-		_vm->_gyro->_it = _thing;
-
-	if (_person != kPardon) {
-		if (_person < Gyro::kPeopleArkata)
-			_vm->_gyro->_him = _person;
-		else
-			_vm->_gyro->_her = _person;
-	}
-}
-
-void Acci::examineObject() {
-	if (_thing != _vm->_gyro->_thinks)
-		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
-	switch (_thing) {
-	case Gyro::kObjectWine :
-		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
-		case 1:
-			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
-			break;
-		case 2:
-			_vm->_dialogs->displayScrollChain('d', 6); // Bad wine
-			break;
-		case 3:
-			_vm->_dialogs->displayScrollChain('d', 7); // Vinegar
-			break;
-		}
-		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
-		else
-			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
-		break;
-	default:
-		_vm->_dialogs->displayScrollChain('t', _thing); // Ordinarily
-	}
-}
-
-bool Acci::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
-		return true;
-	else {
-		Common::String tmpStr;
-		if (_person < Gyro::kPeopleArkata)
-			tmpStr = "He isn't around at the moment.";
-		else
-			tmpStr = "She isn't around at the moment.";
-		_vm->_dialogs->displayText(tmpStr);
-		return false;
-	}
-}
-
-void Acci::exampers() {
-	if (isPersonHere()) {
-		if (_thing != _vm->_gyro->_thinks)
-			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
-
-		byte newPerson = _person - 149;
-
-		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
-			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
-		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
-			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
-		else
-			_vm->_dialogs->displayScrollChain('p', newPerson);
-
-		if ((_person == Gyro::kPeopleAyles) && !_vm->_gyro->_aylesIsAwake)
-			_vm->_dialogs->displayScrollChain('Q', 13);
-
-		_person = newPerson;
-	}
-}
-
-/**
- * Return whether Avvy is holding an object or not
- * @remarks	Originally called 'holding'
- */
-bool Acci::isHolding() {
-	if ((51 <= _thing) && (_thing <= 99)) // Also.
-		return true;
-
-	bool holdingResult = false;
-
-	if (_thing > 100)
-		_vm->_dialogs->displayText("Be reasonable!");
-	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
-		_vm->_dialogs->displayText("You're not holding it, Avvy.");
-	else
-		holdingResult = true;
-
-	return holdingResult;
-}
-
-void Acci::openBox(bool isOpening) {
-	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
-		_vm->_background->drawBackgroundSprite(-1, -1, 4);
-
-		_vm->_background->updateBackgroundSprites();
-		_vm->_animation->animLink();
-		_vm->_graphics->refreshScreen();
-
-		_vm->_system->delayMillis(55);
-
-		if (!isOpening) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
-			_vm->_background->updateBackgroundSprites();
-			_vm->_animation->animLink();
-			_vm->_graphics->refreshScreen();
-		}
-	}
-}
-
-void Acci::examine() {
-	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
-	if ((_person == kPardon) && (_thing != kPardon)) {
-		if (isHolding()) {
-			// Remember: it's been slipped! Ie subtract 49.
-			if ((1 <= _thing) && (_thing <= 49)) // Standard object
-				examineObject();
-			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
-				openBox(true);
-				_vm->_dialogs->displayText(*_vm->_gyro->_also[_thing - 50][1]);
-				openBox(false);
-			}
-		}
-	} else if (_person != kPardon)
-		exampers();
-	else
-		_vm->_dialogs->displayText("It's just as it looks on the picture.");  // Don't know: guess.
-}
-
-void Acci::inventory() {
-	byte itemNum = 0;
-	Common::String tmpStr = Common::String("You're carrying ");
-
-	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i]) {
-			itemNum++;
-			if (itemNum == _vm->_gyro->_carryNum)
-				tmpStr += "and ";
-
-			tmpStr += _vm->_gyro->getItem(i + 1);
-
-			if ((i + 1) == _vm->_gyro->_wearing)
-				tmpStr += ", which you're wearing";
-
-			if (itemNum < _vm->_gyro->_carryNum)
-				tmpStr += ", ";
-		}
-	}
-
-	if (_vm->_gyro->_wearing == kNothing)
-		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-	else
-		tmpStr += '.';
-
-	_vm->_dialogs->displayText(tmpStr);
-}
-
-void Acci::swallow() { // Eat something.
-	switch (_thing) {
-	case Gyro::kObjectWine:
-		switch (_vm->_gyro->_wineState) { // 4 is perfect
-		case 1:
-			if (_vm->_gyro->_teetotal)  {
-				_vm->_dialogs->displayScrollChain('D', 6);
-				return;
-			}
-			_vm->_dialogs->displayScrollChain('U', 1);
-			_vm->_pingo->wobble();
-			_vm->_dialogs->displayScrollChain('U', 2);
-			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-			_vm->_lucerna->refreshObjectList();
-			drink();
-			break;
-		case 2:
-		case 3:
-			_vm->_dialogs->displayScrollChain('d', 8);
-			break; // You can't drink it!
-		}
-		break;
-	case Gyro::kObjectPotion:
-		_vm->_gyro->setBackgroundColor(4);
-		_vm->_dialogs->displayScrollChain('U', 3);
-		_vm->_lucerna->gameOver();
-		_vm->_gyro->setBackgroundColor(0);
-		break;
-	case Gyro::kObjectInk:
-		_vm->_dialogs->displayScrollChain('U', 4);
-		break;
-	case Gyro::kObjectChastity:
-		_vm->_dialogs->displayScrollChain('U', 5);
-		break;
-	case Gyro::kObjectMushroom:
-		_vm->_dialogs->displayScrollChain('U', 6);
-		_vm->_lucerna->gameOver();
-		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_dialogs->displayScrollChain('U', 11);
-		else {
-			_vm->_dialogs->displayScrollChain('U', 8);
-			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-			_vm->_lucerna->refreshObjectList();
-		}
-		break;
-	default:
-		if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub))
-			_vm->_dialogs->displayText("Try BUYing things before you drink them!");
-		else
-			_vm->_dialogs->displayText("The taste of it makes you retch!");
-	}
-}
-
-void Acci::peopleInRoom() {
-	byte numPeople = 0; // Number of people in the room.
-
-	for (int i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
-			numPeople++;
-	}
-
-	if (numPeople == 0) // If nobody's here, we can cut out straight away.
-		return;
-
-	Common::String tmpStr;
-	byte actPerson = 0; // Actually listed people.
-	for (int i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
-			actPerson++;
-			if (actPerson == 1) // First on the list.
-				tmpStr = _vm->_gyro->getName(i + 150);
-			else if (actPerson < numPeople) // The middle...
-				tmpStr += ", " + _vm->_gyro->getName(i + 150);
-			else // The end.
-				tmpStr += " and " + _vm->_gyro->getName(i + 150);
-		}
-	}
-
-	if (numPeople == 1)
-		tmpStr += " is";
-	else
-		tmpStr += " are";
-
-	_vm->_dialogs->displayText(tmpStr + " here."); // End and display it.
-}
-
-void Acci::lookAround() {
-	_vm->_dialogs->displayText(*_vm->_gyro->_also[0][1]);
-	switch (_vm->_gyro->_room) {
-	case kRoomSpludwicks:
-		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_dialogs->displayScrollChain('q', 23);
-		else
-			peopleInRoom();
-		break;
-	case kRoomRobins:
-		if (_vm->_gyro->_tiedUp)
-			_vm->_dialogs->displayScrollChain('q', 38);
-		if (_vm->_gyro->_mushroomGrowing)
-			_vm->_dialogs->displayScrollChain('q', 55);
-		break;
-	case kRoomInsideCardiffCastle:
-		if (!_vm->_gyro->_takenPen)
-			_vm->_dialogs->displayScrollChain('q', 49);
-		break;
-	case kRoomLustiesRoom:
-		if (_vm->_gyro->_lustieIsAsleep)
-			_vm->_dialogs->displayScrollChain('q', 65);
-		break;
-	case kRoomCatacombs:
-		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
-		case 258 :
-			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
-			break;
-		case 514 :
-			_vm->_dialogs->displayScrollChain('q', 81); // Outside ditto.
-			break;
-		case 260 :
-			_vm->_dialogs->displayScrollChain('q', 82); // Outside Geida's room.
-			break;
-		}
-		break;
-	default:
-		peopleInRoom();
-	}
-}
-
-void Acci::openDoor() {
-	// Special cases.
-	switch (_vm->_gyro->_room) {
-	case kRoomYours:
-		if (_vm->_animation->inField(1)) {
-			// Opening the box.
-			_thing = 54; // The box.
-			_person = kPardon;
-			examine();
-			return;
-		}
-		break;
-	case kRoomSpludwicks:
-		if (_thing == 61) {
-			_vm->_dialogs->displayScrollChain('q', 85);
-			return;
-		}
-		break;
-	}
-
-	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties))
-		return; // No doors can open if you can't move Avvy.
-
-	for (int i = 0; i < 7; i++) {
-		if (_vm->_animation->inField(i + 8)) {
-			MagicType *portal = &_vm->_gyro->_portals[i];
-			switch (portal->_operation) {
-			case Gyro::kMagicExclaim:
-				_vm->_animation->_sprites[0].bounce();
-				_vm->_dialogs->displayScrollChain('x', portal->_data);
-				break;
-			case Gyro::kMagicTransport:
-				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
-				break;
-			case Gyro::kMagicUnfinished:
-				_vm->_animation->_sprites[0].bounce();
-				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
-				break;
-			case Gyro::kMagicSpecial:
-				_vm->_animation->callSpecial(portal->_data);
-				break;
-			case Gyro::kMagicOpenDoor:
-				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
-				break;
-			}
-
-			return;
-		}
-	}
-
-	if (_vm->_gyro->_room == kRoomMap)
-		_vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \
-				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
-	else
-		_vm->_dialogs->displayText("Door? What door?");
-}
-
-void Acci::silly() {
-	_vm->_dialogs->displayText("Don't be silly!");
-}
-
-void Acci::putProc() {
-	if (!isHolding())
-		return;
-
-	_thing2 -= 49; // Slip the second object.
-	char temp = _thing;
-	_thing = _thing2;
-	if (!isHolding())
-		return;
-	_thing = temp;
-
-	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
-	switch (_thing2) {
-	case Gyro::kObjectWine:
-		if (_thing == Gyro::kObjectOnion) {
-			if (_vm->_gyro->_rottenOnion)
-				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
-			else { // Put onion into wine?
-				if (_vm->_gyro->_wineState != 3) {
-					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
-					_vm->_dialogs->displayText(tmpStr);
-				} else { // Put onion into vinegar! Yes!
-					_vm->_gyro->_onionInVinegar = true;
-					_vm->_lucerna->incScore(7);
-					_vm->_dialogs->displayScrollChain('u', 9);
-				}
-			}
-		} else
-			silly();
-		break;
-
-	case 54:
-		if (_vm->_gyro->_room == kRoomYours) { // Put something into the box.
-			if (_vm->_gyro->_boxContent != kNothing)
-				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
-			else {
-				switch (_thing) {
-				case Gyro::kObjectMoney:
-					_vm->_dialogs->displayText("You'd better keep some ready cash on you!");
-					break;
-				case Gyro::kObjectBell:
-					_vm->_dialogs->displayText("That's a silly place to keep a bell.");
-					break;
-				case Gyro::kObjectBodkin:
-					_vm->_dialogs->displayText("But you might need it!");
-					break;
-				case Gyro::kObjectOnion:
-					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
-					break;
-				default: // Put the object into the box...
-					if (_vm->_gyro->_wearing == _thing) {
-						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
-						_vm->_dialogs->displayText(tmpStr);
-					} else {
-						openBox(true); // Open box.
-
-						_vm->_gyro->_boxContent = _thing;
-						_vm->_gyro->_objects[_thing - 1] = false;
-						_vm->_lucerna->refreshObjectList();
-						_vm->_dialogs->displayText("OK, it's in the box.");
-
-						openBox(false); // Shut box.
-					}
-				}
-			}
-		} else
-			silly();
-		break;
-
-	default:
-		silly();
-	}
-}
-
-/**
- * Display text when ingredients are not in the right order
- * @remarks	Originally called 'not_in_order'
- */
-void Acci::notInOrder() {
-	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
-	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
-		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
-	_vm->_dialogs->displayText(tmpStr);
-}
-
-/**
- * Move Spludwick to cauldron
- * @remarks	Originally called 'go_to_cauldron'
- */
-void Acci::goToCauldron() {
-	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
-	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
-	_vm->_animation->_sprites[1].walkTo(1);
-}
-
-/**
- * Check is it's possible to give something to Spludwick
- * @remarks	Originally called 'give2spludwick'
- */
-bool Acci::giveToSpludwick() {
-	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
-		notInOrder();
-		return false;
-	}
-
-	switch (_thing) {
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-		if (_vm->_gyro->_rottenOnion)
-			_vm->_dialogs->displayScrollChain('q', 22);
-		else {
-			_vm->_gyro->_givenToSpludwick++;
-			_vm->_dialogs->displayScrollChain('q', 20);
-			goToCauldron();
-			_vm->_lucerna->incScore(3);
-		}
-		_vm->_lucerna->refreshObjectList();
-		break;
-	case Gyro::kObjectInk:
-		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_givenToSpludwick++;
-		_vm->_dialogs->displayScrollChain('q', 24);
-		goToCauldron();
-		_vm->_lucerna->incScore(3);
-		break;
-	case Gyro::kObjectMushroom:
-		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
-		_vm->_dialogs->displayScrollChain('q', 25);
-		_vm->_lucerna->incScore(5);
-		_vm->_gyro->_givenToSpludwick++;
-		goToCauldron();
-		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		break;
-	default:
-		return true;
-	}
-
-	return false;
-}
-
-void Acci::drink() {
-	_vm->_gyro->_alcoholLevel += 1;
-	if (_vm->_gyro->_alcoholLevel == 5) {
-		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
-		_vm->_gyro->_teetotal = true;
-		_vm->_gyro->_avvyIsAwake = false;
-		_vm->_gyro->_avvyInBed = true;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_lucerna->dusk();
-		_vm->_gyro->hangAroundForAWhile();
-		_vm->_animation->flipRoom(1, 1);
-		_vm->_gyro->setBackgroundColor(14);
-		_vm->_animation->_sprites[0]._visible = false;
-	}
-}
-
-void Acci::cardiffClimbing() {
-	if (_vm->_gyro->_standingOnDais) { // Clamber up.
-		_vm->_dialogs->displayText("You climb down, back onto the floor.");
-		_vm->_gyro->_standingOnDais = false;
-		_vm->_animation->appearPed(0, 2);
-	} else if (_vm->_animation->inField(0)) { // Clamber down
-		_vm->_dialogs->displayText("You clamber up onto the dais.");
-		_vm->_gyro->_standingOnDais = true;
-		_vm->_animation->appearPed(0, 1);
-	} else
-			_vm->_dialogs->displayText("Get a bit closer, Avvy.");
-}
-
-void Acci::already() {
-	_vm->_dialogs->displayText("You're already standing!");
-}
-
-void Acci::standUp() {
-	switch (_vm->_gyro->_room) {
-	case kRoomYours: // Avvy isn't asleep.
-		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
-			if (_vm->_gyro->_teetotal) {
-				_vm->_dialogs->displayScrollChain('d', 12);
-				_vm->_gyro->setBackgroundColor(0);
-				_vm->_dialogs->displayScrollChain('d', 14);
-			}
-			_vm->_animation->_sprites[0]._visible = true;
-			_vm->_gyro->_userMovesAvvy = true;
-			_vm->_animation->appearPed(0, 1);
-			_vm->_animation->_direction = Animation::kDirLeft;
-			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
-			_vm->_lucerna->incScore(1);
-			_vm->_gyro->_avvyInBed = false;
-			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
-		} else
-			already();
-		break;
-
-	case kRoomInsideCardiffCastle:
-		cardiffClimbing();
-		break;
-
-	case kRoomNottsPub:
-		if (_vm->_gyro->_sittingInPub)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
-			_vm->_animation->_sprites[0]._visible = true; // But standing up.
-			_vm->_animation->appearPed(0, 3); // And walking away.
-			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
-			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
-		} else
-			already();
-		break;
-	default:
-		already();
-	}
-}
-
-void Acci::getProc(char thing) {
-	switch (_vm->_gyro->_room) {
-	case kRoomYours:
-		if (_vm->_animation->inField(1)) {
-			if (_vm->_gyro->_boxContent == thing) {
-				_vm->_background->drawBackgroundSprite(-1, -1, 4);
-				_vm->_dialogs->displayText("OK, I've got it.");
-				_vm->_gyro->_objects[thing - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_boxContent = kNothing;
-				_vm->_background->drawBackgroundSprite(-1, -1, 5);
-			} else {
-				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
-				_vm->_dialogs->displayText(tmpStr);
-			}
-		} else
-			_vm->_dialogs->displayScrollChain('q', 57);
-		break;
-	case kRoomInsideCardiffCastle:
-		switch (thing) {
-		case Gyro::kObjectPen:
-			if (_vm->_animation->inField(1)) { // Standing on the dais.
-				if (_vm->_gyro->_takenPen)
-					_vm->_dialogs->displayText("It's not there, Avvy.");
-				else {
-					// OK: we're taking the pen, and it's there.
-					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
-					_vm->_animation->callSpecial(3); // Zap!
-					_vm->_gyro->_takenPen = true;
-					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
-					_vm->_lucerna->refreshObjectList();
-					_vm->_dialogs->displayText("Taken.");
-				}
-			} else if (_vm->_gyro->_standingOnDais)
-				_vm->_dialogs->displayScrollChain('q', 53);
-			else
-				_vm->_dialogs->displayScrollChain('q', 51);
-			break;
-		case Gyro::kObjectBolt:
-			_vm->_dialogs->displayScrollChain('q', 52);
-			break;
-		default:
-			_vm->_dialogs->displayScrollChain('q', 57);
-		}
-		break;
-	case kRoomRobins:
-		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			_vm->_dialogs->displayText("Got it!");
-			_vm->_gyro->_mushroomGrowing = false;
-			_vm->_gyro->_takenMushroom = true;
-			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
-			_vm->_lucerna->refreshObjectList();
-			_vm->_lucerna->incScore(3);
-		} else
-			_vm->_dialogs->displayScrollChain('q', 57);
-		break;
-	default:
-		_vm->_dialogs->displayScrollChain('q', 57);
-	}
-}
-
-/**
- * Give the lute to Geida
- * @remarks	Originally called 'give_Geida_the_lute'
- */
-void Acci::giveGeidaTheLute() {
-	if (_vm->_gyro->_room != kRoomLustiesRoom) {
-		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
-		_vm->_dialogs->displayText(tmpStr);
-		return;
-	}
-	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
-	_vm->_lucerna->refreshObjectList();
-	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
-
-	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
-	//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
-}
-
-void Acci::playHarp() {
-	if (_vm->_animation->inField(6))
-		_vm->_dialogs->displayMusicalScroll();
-	else
-		_vm->_dialogs->displayText("Get a bit closer to it, Avvy!");
-}
-
-void Acci::winSequence() {
-	_vm->_dialogs->displayScrollChain('q', 78);
-	_vm->_sequence->firstShow(7);
-	_vm->_sequence->thenShow(8);
-	_vm->_sequence->thenShow(9);
-	_vm->_sequence->startToClose();
-	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
-}
-
-Common::String Acci::personSpeaks() {
-	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
-			_person = _vm->_gyro->_her;
-		else
-			_person = _vm->_gyro->_him;
-	}
-
-	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
-		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
-	}
-
-	bool found = false; // The _person we're looking for's code is in _person.
-	Common::String tmpStr;
-
-	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, '1' + i);
-			found = true;
-		}
-	}
-
-	if (found)
-		return tmpStr;
-
-	for (int i = 0; i < 16; i++) {
-		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
-			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
-	}
-
-	return tmpStr;
-}
-
-void Acci::heyThanks() {
-	Common::String tmpStr = personSpeaks();
-	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
-	_vm->_dialogs->displayText(tmpStr);
-	_vm->_gyro->_objects[_thing - 1] = false;
-}
-
-/**
- * @remarks	Originally called 'do_that'
- */
-void Acci::doThat() {
-	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
-	static const char kWhat[] = "That's not possible!";
-
-	if (_thats == Common::String(kNothing))  {
-		if (!_thats.empty())
-			_thats.clear();
-		return;
-	}
-
-	if (_vm->_gyro->_weirdWord)
-		return;
-
-	if (_thing < 200)
-		_thing -= 49; // "Slip"
-
-
-	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
-	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
-	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
-		if (!_vm->_gyro->_alive) {
-			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
-			return;
-		}
-		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
-			_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
-			return;
-		}
-	}
-
-	switch (_verb) {
-	case kVerbCodeExam:
-		examine();
-		break;
-	case kVerbCodeOpen:
-		openDoor();
-		break;
-	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-		_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeGet:
-		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_gyro->_carryNum >= kCarryLimit)
-				_vm->_dialogs->displayText("You can't carry any more!");
-			else
-				getProc(_thing);
-		} else { // Not... ditto.
-			if (_person != kPardon)
-				_vm->_dialogs->displayText("You can't sweep folk off their feet!");
-			else
-				_vm->_dialogs->displayText("I assure you, you don't need it.");
-		}
-		break;
-	case kVerbCodeDrop:
-		_vm->_dialogs->displayText("Two years ago you dropped a florin in the street. Three days " \
-				"later it was gone! So now you never leave ANYTHING lying around. OK?");
-		break;
-	case kVerbCodeInv:
-		inventory();
-		break;
-	case kVerbCodeTalk:
-		if (_person == kPardon) {
-			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
-				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
-				_vm->_dialogs->displayText(tmpStr);
-			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
-				_thats.deleteChar(0);
-
-				for (int i = 0; i < 10; i++)
-					_realWords[i] = _realWords[i + 1];
-
-				_verb = _vm->_gyro->_subjectNum;
-				doThat();
-				return;
-			} else {
-				_person = _vm->_gyro->_subjectNum;
-				_vm->_gyro->_subjectNum = 0;
-				if ((_person == 0) || (_person == kPardon))
-					_vm->_dialogs->displayText("Talk to whom?");
-				else if (isPersonHere())
-					_vm->_dialogs->talkTo(_person);
-			}
-		} else if (isPersonHere())
-			_vm->_dialogs->talkTo(_person);
-		break;
-	case kVerbCodeGive:
-		if (isHolding()) {
-			if (_person == kPardon)
-				_vm->_dialogs->displayText("Give to whom?");
-			else if (isPersonHere()) {
-				switch (_thing) {
-				case Gyro::kObjectMoney :
-					_vm->_dialogs->displayText("You can't bring yourself to give away your moneybag.");
-					break;
-				case Gyro::kObjectBodkin:
-				case Gyro::kObjectBell:
-				case Gyro::kObjectClothes:
-				case Gyro::kObjectHabit :
-					_vm->_dialogs->displayText("Don't give it away, it might be useful!");
-					break;
-				default:
-					switch (_person) {
-					case Gyro::kPeopleCrapulus:
-						if (_thing == Gyro::kObjectWine) {
-							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-						} else
-							heyThanks();
-						break;
-					case Gyro::kPeopleCwytalot:
-						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
-							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
-						else
-							heyThanks();
-						break;
-					case Gyro::kPeopleSpludwick:
-						if (giveToSpludwick())
-							heyThanks();
-						break;
-					case Gyro::kPeopleIbythneth:
-						if (_thing == Gyro::kObjectBadge) {
-							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
-							_vm->_lucerna->incScore(3);
-							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
-							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
-							_vm->_gyro->_givenBadgeToIby = true;
-							_vm->_background->drawBackgroundSprite(-1, -1, 7);
-							_vm->_background->drawBackgroundSprite(-1, -1, 8);
-						} else
-							heyThanks();
-						break;
-					case Gyro::kPeopleAyles:
-						if (_vm->_gyro->_aylesIsAwake) {
-							if (_thing == Gyro::kObjectPen) {
-								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
-								_vm->_dialogs->displayScrollChain('q', 54);
-								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
-								_vm->_gyro->_givenPenToAyles = true;
-								_vm->_lucerna->refreshObjectList();
-								_vm->_lucerna->incScore(2);
-							} else
-								heyThanks();
-						} else
-							_vm->_dialogs->displayText("But he's asleep!");
-						break;
-					case Gyro::kPeopleGeida:
-						switch (_thing) {
-						case Gyro::kObjectPotion:
-							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
-							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
-							_vm->_lucerna->incScore(2);
-							_vm->_gyro->_givenPotionToGeida = true;
-							_vm->_lucerna->refreshObjectList();
-							break;
-						case Gyro::kObjectLute:
-							giveGeidaTheLute();
-							break;
-						default:
-							heyThanks();
-						}
-						break;
-					case Gyro::kPeopleArkata:
-						switch (_thing) {
-						case Gyro::kObjectPotion:
-							if (_vm->_gyro->_givenPotionToGeida)
-								winSequence();
-							else
-								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
-							break;
-						default:
-							heyThanks();
-						}
-						break;
-					default:
-						heyThanks();
-					}
-				}
-			}
-			_vm->_lucerna->refreshObjectList(); // Just in case...
-		}
-		break;
-
-	case kVerbCodeEat:
-	case kVerbCodeDrink:
-		if (isHolding())
-			swallow();
-		break;
-
-	case kVerbCodeLoad:
-		break;
-	case kVerbCodeSave:
-		break;
-	// We don't handle these two because we use ScummVM's save/load system.
-
-	case kVerbCodePay:
-		_vm->_dialogs->displayText("No money need change hands.");
-		break;
-	case kVerbCodeLook:
-		lookAround();
-		break;
-	case kVerbCodeBreak:
-		_vm->_dialogs->displayText("Vandalism is prohibited within this game!");
-		break;
-	case kVerbCodeQuit: // quit
-		if (!_polite)
-			_vm->_dialogs->displayText("How about a `please\", Avvy?");
-		else {
-			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
-			if (_vm->_dialogs->displayQuestion(tmpStr))
-				_vm->_gyro->_letMeOut = true;
-		}
-		break;
-	case kVerbCodeGo:
-		_vm->_dialogs->displayText("Just use the arrow keys to walk there.");
-		break;
-	case kVerbCodeInfo: {
-		_vm->_dialogs->_aboutBox = true;
-
-		Common::String toDisplay;
-		for (int i = 0; i < 7; i++)
-			toDisplay += Dialogs::kControlNewLine;
-		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
-			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
-			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
-			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
-		_vm->_dialogs->displayText(toDisplay);
-		_vm->_dialogs->_aboutBox = false;
-		}
-		break;
-	case kVerbCodeUndress:
-		if (_vm->_gyro->_wearing == kNothing)
-			_vm->_dialogs->displayText("You're already stark naked!");
-		else if (_vm->_gyro->_avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
-			_vm->_dialogs->displayText(tmpStr);
-			_vm->_gyro->_wearing = kNothing;
-			_vm->_lucerna->refreshObjectList();
-		} else
-			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
-		break;
-	case kVerbCodeWear:
-		if (isHolding()) { // Wear something.
-			switch (_thing) {
-			case Gyro::kObjectChastity:
-				// \? are used to avoid that ??! is parsed as a trigraph
-				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
-				break;
-			case Gyro::kObjectClothes:
-			case Gyro::kObjectHabit: { // Change this!
-				if (_vm->_gyro->_wearing != kNothing) {
-					if (_vm->_gyro->_wearing == _thing)
-						_vm->_dialogs->displayText("You're already wearing that.");
-					else
-						_vm->_dialogs->displayText("You'll be rather warm wearing two sets of clothes!");
-					return;
-				} else
-					_vm->_gyro->_wearing = _thing;
-
-				_vm->_lucerna->refreshObjectList();
-
-				byte i;
-				if (_thing == Gyro::kObjectHabit)
-					i = 3;
-				else
-					i = 0;
-				Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
-				if (spr->_id != i) {
-					int16 x = spr->_x;
-					int16 y = spr->_y;
-					spr->remove();
-					spr->init(i, true, _vm->_animation);
-					spr->appear(x, y, Animation::kDirLeft);
-					spr->_visible = false;
-				}
-				}
-				break;
-			default:
-				_vm->_dialogs->displayText(kWhat);
-			}
-		}
-		break;
-	case kVerbCodePlay:
-		if (_thing == kPardon) {
-			switch (_vm->_gyro->_room) { // They just typed "play"...
-			case kRoomArgentPub: // ...in the pub, => play Nim.
-				warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
-				// play_nim();
-				// The following parts are copied from play_nim().
-				// The player automatically wins the game everytime he wins, until I implement the mini-game.
-
-				if (_vm->_gyro->_wonNim) { // Already won the game.
-					_vm->_dialogs->displayScrollChain('Q', 6);
-					return;
-				}
-
-				if (!_vm->_gyro->_askedDogfoodAboutNim) {
-					_vm->_dialogs->displayScrollChain('q', 84);
-					return;
-				}
-
-				_vm->_dialogs->displayScrollChain('Q', 3);
-				_vm->_gyro->_playedNim++;
-
-				// You won - strange!
-				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
-				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_wonNim = true;
-				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
-				_vm->_lucerna->incScore(7); // 7 points for winning!
-
-				if (_vm->_gyro->_playedNim == 1)
-					_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
-
-				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-					+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
-				break;
-			case kRoomMusicRoom:
-				playHarp();
-				break;
-			}
-		} else if (isHolding()) {
-			switch (_thing) {
-			case Gyro::kObjectLute :
-					_vm->_dialogs->displayScrollChain('U', 7);
-
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
-						_vm->_dialogs->displayScrollChain('U', 10);
-
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
-						_vm->_dialogs->displayScrollChain('U', 15);
-				break;
-			case 52:
-				if (_vm->_gyro->_room == kRoomMusicRoom)
-					playHarp();
-				else
-					_vm->_dialogs->displayText(kWhat);
-				break;
-			case 55:
-				if (_vm->_gyro->_room == kRoomArgentPub)
-					// play_nim();
-					warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
-				else
-					_vm->_dialogs->displayText(kWhat);
-				break;
-			default:
-				_vm->_dialogs->displayText(kWhat);
-			}
-		}
-		break;
-	case kVerbCodeRing:
-		if (isHolding()) {
-			if (_thing == Gyro::kObjectBell) {
-				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-					// \? are used to avoid that ??! is parsed as a trigraph
-					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
-			} else
-				_vm->_dialogs->displayText(kWhat);
-		}
-		break;
-	case kVerbCodeHelp:
-		// boot_help();
-		warning("STUB: Acci::doThat() - case kVerbCodehelp");
-		break;
-	case kVerbCodeLarrypass:
-		_vm->_dialogs->displayText("Wrong game!");
-		break;
-	case kVerbCodePhaon:
-		_vm->_dialogs->displayText("Hello, Phaon!");
-		break;
-	case kVerbCodeBoss:
-		// bosskey();
-		warning("STUB: Acci::doThat() - case kVerbCodeboss");
-		break;
-	case kVerbCodePee:
-		if (_vm->_gyro->setFlag('P')) {
-			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
-			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
-		} else {
-			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Dialogs::kControlItalic, Dialogs::kControlRoman);
-			_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeCheat: {
-		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
-		_vm->_dialogs->displayText(tmpStr);
-		_vm->_gyro->_cheat = true;
-		}
-		break;
-	case kVerbCodeMagic:
-		if (_vm->_gyro->_avariciusTalk > 0)
-			_vm->_dialogs->displayScrollChain('q', 19);
-		else {
-			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
-				_vm->_dialogs->displayScrollChain('q', 17);
-				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
-					_vm->_dialogs->displayScrollChain('q', 18);
-				else {
-					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
-					spr->init(1, false, _vm->_animation); // Avaricius
-					_vm->_animation->appearPed(1, 3);
-					spr->walkTo(4);
-					spr->_callEachStepFl = true;
-					spr->_eachStepProc = Animation::kProcBackAndForth;
-					_vm->_gyro->_avariciusTalk = 14;
-					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
-				}
-			} else
-				_vm->_dialogs->displayText("Nothing appears to happen...");
-		}
-		break;
-	case kVerbCodeSmartAlec:
-		_vm->_dialogs->displayText("Listen, smart alec, that was just rhetoric.");
-		break;
-	case kVerbCodeExpletive:
-		switch (_vm->_gyro->_sworeNum) {
-		case 0: {
-			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
-				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-			_vm->_dialogs->displayText(tmpStr);
-			}
-			break;
-		case 1: {
-			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
-				"do things I tell you not to?%c%cDon't do it again!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-			_vm->_dialogs->displayText(tmpStr);
-			}
-			break;
-		default: {
-			_vm->_pingo->zonk();
-			// CHECKME: Weird character in string
-			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-			_vm->_dialogs->displayText(tmpStr);
-			_vm->_lucerna->gameOver();
-			}
-		}
-		_vm->_gyro->_sworeNum++;
-		break;
-	case kVerbCodeListen:
-		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
-			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
-		else if (_vm->_gyro->_listen.empty())
-			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");
-		else
-			_vm->_dialogs->displayText(_vm->_gyro->_listen);
-		break;
-	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_gyro->_room) {
-		case kRoomArgentPub:
-			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
-				switch (_thing) {
-				case 51:
-				case 53:
-				case 54:
-				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-						_vm->_dialogs->displayScrollChain('D', 15);
-						return;
-					}
-
-					if (_vm->_gyro->_teetotal)  {
-						_vm->_dialogs->displayScrollChain('D', 6);
-						return;
-					}
-
-					if (_vm->_gyro->_alcoholLevel == 0)
-						_vm->_lucerna->incScore(3);
-
-					_vm->_background->drawBackgroundSprite(-1, -1, 11);
-					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
-					_vm->_gyro->_drinking = _thing;
-
-					_vm->_background->drawBackgroundSprite(-1, -1, 9);
-					_vm->_gyro->_malagauche = 177;
-					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
-					break;
-				case 52:
-					examine();
-					break; // We have a right one here - buy Pepsi??!
-				case Gyro::kObjectWine:
-					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
-						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
-					else {
-						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
-							_vm->_dialogs->displayScrollChain('D', 15);
-							return;
-						}
-
-						if (_vm->_gyro->_carryNum >= kCarryLimit) {
-							_vm->_dialogs->displayText("Your hands are full.");
-							return;
-						}
-
-						_vm->_background->drawBackgroundSprite(-1, -1, 11);
-						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
-						_vm->_dialogs->displayText(tmpStr);
-						if (_vm->_gyro->_alcoholLevel == 0)
-							_vm->_lucerna->incScore(3);
-						_vm->_background->drawBackgroundSprite(-1, -1, 9);
-						_vm->_gyro->_malagauche = 177;
-
-						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
-					}
-					break;
-				}
-			} else
-				_vm->_dialogs->displayScrollChain('D', 5); // Go to the bar!
-			break;
-
-		case kRoomOutsideDucks:
-			if (_vm->_animation->inField(5)) {
-				if (_thing == Gyro::kObjectOnion) {
-					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
-						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_gyro->_carryNum >= kCarryLimit)
-						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
-					else {
-						if (_vm->_gyro->_boughtOnion)
-							_vm->_dialogs->displayScrollChain('D', 11);
-						else {
-							_vm->_dialogs->displayScrollChain('D', 9);
-							_vm->_lucerna->incScore(3);
-						}
-						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
-						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
-						_vm->_lucerna->refreshObjectList();
-						_vm->_gyro->_boughtOnion = true;
-						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
-						_vm->_gyro->_onionInVinegar = false;
-					}
-				} else
-					_vm->_dialogs->displayScrollChain('D', 0);
-			} else
-				_vm->_dialogs->displayScrollChain('D', 0);
-			break;
-
-		case kRoomNottsPub:
-			_vm->_dialogs->displayScrollChain('n', 15); // Can't sell to southerners.
-			break;
-		default:
-			_vm->_dialogs->displayScrollChain('D', 0); // Can't buy that.
-		}
-		break;
-	case kVerbCodeAttack:
-		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
-			((_person == Gyro::kPeopleCwytalot) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) &&
-			(_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
-			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
-				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
-			case 0:
-				_vm->_dialogs->displayScrollChain('Q', 10);
-				_vm->_dialogs->displayText("(At the very least, don't use your bare hands!)");
-				break;
-			case 1:
-				_vm->_dialogs->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
-				break;
-			case 2:
-				_vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
-				break;
-			case 3:
-				_vm->_dialogs->displayScrollChain('Q', 11);
-				_vm->_gyro->_cwytalotGone = true;
-				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
-				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
-				_vm->_lucerna->incScore(7);
-				_vm->_animation->_sprites[1].walkTo(1);
-				_vm->_animation->_sprites[1]._vanishIfStill = true;
-				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy;
-				break;
-			default:
-				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
-			}
-		} else
-			_vm->_dialogs->displayScrollChain('Q', 10);
-		break;
-	case kVerbCodePasswd:
-		if (_vm->_gyro->_room != kRoomBridge)
-			_vm->_dialogs->displayScrollChain('Q', 12);
-		else {
-			bool ok = true;
-			for (uint i = 0; i < _thats.size(); i++) {
-				Common::String temp = _realWords[i];
-				temp.toUppercase();
-				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
-				for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
-					if (_vocabulary[pwdId]._word[j] != temp[j])
-						ok = false;
-				}
-			}
-
-			if (ok) {
-				if (_vm->_gyro->_drawbridgeOpen != 0)
-					_vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again.");
-				else {
-					_vm->_lucerna->incScore(4);
-					_vm->_dialogs->displayText("The drawbridge opens!");
-					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
-					_vm->_gyro->_drawbridgeOpen = 1;
-				}
-			} else
-				_vm->_dialogs->displayScrollChain('Q', 12);
-		}
-		break;
-	case kVerbCodeDir:
-		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
-		break;
-	case kVerbCodeDie:
-		_vm->_lucerna->gameOver();
-		break;
-	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
-		_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodePut:
-		putProc();
-		break;
-	case kVerbCodeStand:
-		standUp();
-		break;
-	case kVerbCodeKiss:
-		if (_person == kPardon)
-			_vm->_dialogs->displayText("Kiss whom?");
-		else if (isPersonHere()) {
-			switch (_person) {
-			case Gyro::kPeopleArkata:
-				_vm->_dialogs->displayScrollChain('U', 12);
-				break;
-			case Gyro::kPeopleGeida:
-				_vm->_dialogs->displayScrollChain('U', 13);
-				break;
-			case Gyro::kPeopleWisewoman:
-				_vm->_dialogs->displayScrollChain('U', 14);
-				break;
-			default:
-				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
-			}
-		} else if ((Gyro::kPeopleAvalot <= _person) && (_person < Gyro::kPeopleArkata))
-			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
-
-		break;
-	case kVerbCodeClimb:
-		if (_vm->_gyro->_room == kRoomInsideCardiffCastle)
-			cardiffClimbing();
-		else // In the wrong room!
-			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
-		break;
-	case kVerbCodeJump:
-		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
-		_vm->_gyro->_userMovesAvvy = false;
-		break;
-	case kVerbCodeHiscores:
-		//	show_highs();
-		warning("STUB: Acci::doThat() - case kVerbCodehighscores");
-		break;
-	case kVerbCodeWake:
-		if (isPersonHere())
-			switch (_person) {
-			case kPardon:
-			case Gyro::kPeopleAvalot:
-			case 0:
-				if (!_vm->_gyro->_avvyIsAwake) {
-					_vm->_gyro->_avvyIsAwake = true;
-					_vm->_lucerna->incScore(1);
-					_vm->_gyro->_avvyInBed = true;
-					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
-					if (_vm->_gyro->_teetotal)
-						_vm->_dialogs->displayScrollChain('d', 13);
-				} else
-					_vm->_dialogs->displayText("You're already awake, Avvy!");
-				break;
-			case Gyro::kPeopleAyles:
-				if (!_vm->_gyro->_aylesIsAwake)
-					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
-				break;
-			case Gyro::kPeopleJacques: {
-				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
-					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
-				_vm->_dialogs->displayText(tmpStr);
-				}
-				break;
-			default:
-				_vm->_dialogs->displayText("It's difficult to awaken people who aren't asleep...!");
-		}
-		break;
-	case kVerbCodeSit:
-		if (_vm->_gyro->_room == kRoomNottsPub) {
-			if (_vm->_gyro->_sittingInPub)
-				_vm->_dialogs->displayText("You're already sitting!");
-			else {
-				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
-				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
-			}
-		} else { // Default doodah.
-			_vm->_lucerna->dusk();
-			_vm->_gyro->hangAroundForAWhile();
-			_vm->_lucerna->dawn();
-			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
-			_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeRestart:
-		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
-			_vm->_lucerna->dusk();
-			_vm->_gyro->newGame();
-			_vm->_lucerna->dawn();
-		}
-		break;
-	case kPardon:
-		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
-		break;
-	case kVerbCodeHello: {
-		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("Hello.%c", Dialogs::kControlSpeechBubble);
-		_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	case kVerbCodeThanks: {
-		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("That's OK.%c", Dialogs::kControlSpeechBubble);
-		_vm->_dialogs->displayText(tmpStr);
-		}
-		break;
-	default:
-		Common::String tmpStr = Common::String::format("%cParser bug!", Dialogs::kControlBell);
-		_vm->_dialogs->displayText(tmpStr);
-	}
-}
-
-void Acci::verbOpt(byte verb, Common::String &answer, char &ansKey) {
-	switch (verb) {
-	case kVerbCodeExam:
-		answer = "Examine";
-		ansKey = 'x';
-		break; // The ubiquitous one.
-	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
-	case kVerbCodeDrink:
-		answer = "Drink";
-		ansKey = 'D';
-		break;
-	case kVerbCodeWear:
-		answer = "Wear";
-		ansKey = 'W';
-		break;
-	case kVerbCodeRing:
-		answer = "Ring";
-		ansKey = 'R';
-		break; // Only the bell!
-	case kVerbCodePlay:
-		answer = "Play";
-		ansKey = 'P';
-		break;
-	case kVerbCodeEat:
-		answer = "Eat";
-		ansKey = 'E';
-		break;
-	default:
-		answer = "? Unknown!"; // Bug!
-		ansKey = '?';
-	}
-}
-
-} // End of namespace Avalanche.
diff --git a/engines/avalanche/acci.h b/engines/avalanche/acci.h
deleted file mode 100644
index 07816cc..0000000
--- a/engines/avalanche/acci.h
+++ /dev/null
@@ -1,138 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* ACCIDENCE II		The parser. */
-
-#ifndef AVALANCHE_ACCI2_H
-#define AVALANCHE_ACCI2_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Acci {
-public:
-	enum VerbCode {
-		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
-		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
-		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
-		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
-		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
-		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
-		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
-		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
-		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
-		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
-	};
-
-	static const byte kPardon = 254; // Didn't understand / wasn't given.
-	static const int16 kParserWordsNum = 277; // How many words does the parser know?
-	static const byte kNothing = 250;
-	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
-	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
-
-	struct VocabEntry {
-		byte _number;
-		Common::String _word;
-
-		void init(byte number, Common::String word) {
-			_number = number;
-			_word = word;
-		}
-	};
-
-	VocabEntry _vocabulary[kParserWordsNum];
-
-	Common::String _realWords[11];
-	byte _verb, _person, _thing;
-	bool _polite;
-
-	Acci(AvalancheEngine *vm);
-
-	void init();
-	void parse();
-	void doThat();
-	void verbOpt(byte verb, Common::String &answer, char &ansKey);
-	void drink();
-
-private:
-	struct RankType {
-		uint16 _score;
-		Common::String _title;
-	};
-
-	Common::String _thats;
-	byte _thing2;
-
-	AvalancheEngine *_vm;
-
-	byte wordNum(Common::String word);
-	void replace(Common::String oldChars, byte newChar);
-
-	Common::String rank();
-	Common::String totalTime();
-
-	void clearWords();
-	void cheatParse(Common::String codes);
-	void stripPunctuation(Common::String &word); // Strips punctuation from word.
-	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
-	bool doPronouns();
-	void properNouns();
-	void lookAround(); // This is called when you say "look".
-	void sayIt();  // This makes Avalot say the response.
-	void openDoor();
-	void storeInterrogation(byte interrogation);
-	void examineObject(); // Examine a standard object-thing
-	bool isPersonHere();
-	void exampers();
-	bool isHolding();
-	void openBox(bool isOpening);
-	void examine();
-	void inventory();
-	void swallow();
-	void peopleInRoom(); // This lists the other people in the room.
-	void silly();
-	void putProc();  // Called when you call kVerbCodeput.
-	void notInOrder();
-	void goToCauldron();
-	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
-	void cardiffClimbing();
-	void already();
-	void standUp(); // Called when you ask Avvy to stand.
-	void getProc(char thing);
-	void giveGeidaTheLute();
-	void playHarp();
-	void winSequence();
-	Common::String personSpeaks();
-	void heyThanks();
-};
-
-} // End of namespace Avalanche.
-
-#endif // AVALANCHE_ACCI2_H
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 8fb28ed..d274591 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1232,7 +1232,7 @@ void Animation::stopWalking() {
  */
 void Animation::hideInCupboard() {
 	if (_vm->_gyro->_avvysInTheCupboard) {
-		if (_vm->_gyro->_wearing == Acci::kNothing) {
+		if (_vm->_gyro->_wearing == Parser::kNothing) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d7a07fe..7dcf4a0 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -69,7 +69,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _sequence;
 	delete _timer;
 	delete _animation;
-	delete _acci;
 	delete _menu;
 	delete _closing;
 	delete _gyro;
@@ -89,7 +88,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_sequence = new Sequence(this);
 	_timer = new Timer(this);
 	_animation = new Animation(this);
-	_acci = new Acci(this);
 	_menu = new Menu(this);
 	_closing = new Closing(this);
 	_sound = new SoundHandler(this);
@@ -97,7 +95,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_graphics->init();
 	_dialogs->init();
 	_lucerna->init();
-	_acci->init();
 	_parser->init();
 
 	return Common::kNoError;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 2a7df29..781031c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -40,7 +40,6 @@
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
-#include "avalanche/acci.h"
 #include "avalanche/menu.h"
 #include "avalanche/closing.h"
 #include "avalanche/sound.h"
@@ -76,7 +75,6 @@ public:
 	Sequence *_sequence;
 	Timer *_timer;
 	Animation *_animation;
-	Acci *_acci;
 	Menu *_menu;
 	Closing *_closing;
 	SoundHandler *_sound;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index a496fcd..69a3984 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/gyro.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
-#include "avalanche/acci.h"
 #include "avalanche/timer.h"
 
 #include "common/textconsole.h"
@@ -726,8 +725,8 @@ void Dialogs::callDialogDriver() {
 					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
 				case 2: {
-					int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum;
-					displayText(_vm->_acci->_vocabulary[pwdId]._word + kControlToBuffer);
+					int pwdId = _vm->_parser->kFirstPassword + _vm->_gyro->_passwordNum;
+					displayText(_vm->_parser->_vocabulary[pwdId]._word + kControlToBuffer);
 					}
 					break;
 				case 3:
@@ -750,12 +749,12 @@ void Dialogs::callDialogDriver() {
 				case 10:
 					switch (_vm->_gyro->_boxContent) {
 					case 0: // Sixpence.
-						_vm->_dialogs->displayScrollChain('q', 37); // You find the sixpence.
+						displayScrollChain('q', 37); // You find the sixpence.
 						_vm->_gyro->_money += 6;
-						_vm->_gyro->_boxContent = _vm->_acci->kNothing;
+						_vm->_gyro->_boxContent = _vm->_parser->kNothing;
 						_vm->_lucerna->incScore(2);
 						return;
-					case Acci::kNothing:
+					case Parser::kNothing:
 						displayText("nothing at all. It's completely empty.");
 						break;
 					default:
@@ -889,7 +888,7 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 	if (error) {
 		if (report) {
 			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Dialogs::kControlBell, block, point);
-			_vm->_dialogs->displayText(todisplay);
+			displayText(todisplay);
 		}
 		return;
 	}
@@ -907,7 +906,7 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 	if (bubbling)
 		doTheBubble();
 
-	_vm->_dialogs->callDialogDriver();
+	callDialogDriver();
 }
 
 /**
@@ -952,13 +951,13 @@ void Dialogs::speak(byte who, byte subject) {
 	unSkrimble();
 	doTheBubble();
 
-	_vm->_dialogs->callDialogDriver();
+	callDialogDriver();
 	_noError = true;
 }
 
 void Dialogs::talkTo(byte whom) {
-	if (_vm->_acci->_person == _vm->_acci->kPardon) {
-		_vm->_acci->_person = _vm->_gyro->_subjectNum;
+	if (_vm->_parser->_person == _vm->_parser->kPardon) {
+		_vm->_parser->_person = _vm->_gyro->_subjectNum;
 		_vm->_gyro->_subjectNum = 0;
 	}
 
@@ -979,7 +978,7 @@ void Dialogs::talkTo(byte whom) {
 				case 2: {
 					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
 					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
-					_vm->_dialogs->displayText(tmpStr);
+					displayText(tmpStr);
 					}
 					return;
 				case 3:
@@ -1053,7 +1052,7 @@ void Dialogs::talkTo(byte whom) {
 	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, i + 49, Dialogs::kControlToBuffer);
-			_vm->_dialogs->displayText(tmpStr);
+			displayText(tmpStr);
 			noMatches = false;
 			break;
 		}
@@ -1061,7 +1060,7 @@ void Dialogs::talkTo(byte whom) {
 
 	if (noMatches) {
 		Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, Dialogs::kControlRegister, Dialogs::kControlToBuffer);
-		_vm->_dialogs->displayText(tmpStr);
+		displayText(tmpStr);
 	}
 
 	speak(whom, _vm->_gyro->_subjectNum);
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
index 3d86d34..9960839 100644
--- a/engines/avalanche/gyro.cpp
+++ b/engines/avalanche/gyro.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/pingo.h"
 #include "avalanche/dialogs.h"
 #include "avalanche/lucerna.h"
-#include "avalanche/acci.h"
 #include "avalanche/animation.h"
 
 #include "common/file.h"
@@ -332,10 +331,10 @@ void Gyro::newGame() {
 	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
-	_him = Acci::kPardon;
-	_her = Acci::kPardon;
-	_it = Acci::kPardon;
-	_lastPerson = Acci::kPardon; // = Pardon?
+	_him = Parser::kPardon;
+	_her = Parser::kPardon;
+	_it = Parser::kPardon;
+	_lastPerson = Parser::kPardon; // = Pardon?
 	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
@@ -494,29 +493,29 @@ Common::String Gyro::f5Does() {
 	switch (_room) {
 	case kRoomYours:
 		if (!_avvyIsAwake)
-			return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
+			return Common::String::format("%cWWake up", Parser::kVerbCodeWake);
 		else if (_avvyInBed)
-			return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
+			return Common::String::format("%cGGet up", Parser::kVerbCodeStand);
 		break;
 	case kRoomInsideCardiffCastle:
 		if (_standingOnDais)
-			return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
+			return Common::String::format("%cCClimb down", Parser::kVerbCodeClimb);
 		else
-			return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
+			return Common::String::format("%cCClimb up", Parser::kVerbCodeClimb);
 		break;
 	case kRoomNottsPub:
 		if (_sittingInPub)
-			return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
+			return Common::String::format("%cSStand up", Parser::kVerbCodeStand);
 		else
-			return Common::String::format("%cSSit down", Acci::kVerbCodeSit);
+			return Common::String::format("%cSSit down", Parser::kVerbCodeSit);
 		break;
 	case kRoomMusicRoom:
 		if (_vm->_animation->inField(5))
-			return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay);
+			return Common::String::format("%cPPlay the harp", Parser::kVerbCodePlay);
 		break;
 	}
 
-	return Common::String::format("%c", _vm->_acci->kPardon); // If all else fails...
+	return Common::String::format("%c", _vm->_parser->kPardon); // If all else fails...
 }
 
 void Gyro::loadMouse(byte which) {
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
index 34ba7c1..88c1357 100644
--- a/engines/avalanche/lucerna.cpp
+++ b/engines/avalanche/lucerna.cpp
@@ -36,7 +36,6 @@
 #include "avalanche/background.h"
 #include "avalanche/pingo.h"
 #include "avalanche/sequence.h"
-#include "avalanche/acci.h"
 
 #include "common/rect.h"
 #include "common/system.h"
@@ -144,16 +143,16 @@ void Lucerna::init() {
  * @remarks	Originally called 'callverb'
  */
 void Lucerna::callVerb(byte id) {
-	if (id == _vm->_acci->kPardon) {
+	if (id == _vm->_parser->kPardon) {
 		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
 			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
 			"what the current setting of this key is.");
 		_vm->_dialogs->displayText(tmpStr);
 	} else {
 		_vm->_gyro->_weirdWord = false;
-		_vm->_acci->_polite = true;
-		_vm->_acci->_verb = id;
-		_vm->_acci->doThat();
+		_vm->_parser->_polite = true;
+		_vm->_parser->_verb = id;
+		_vm->_parser->doThat();
 	}
 }
 
@@ -1094,20 +1093,20 @@ void Lucerna::checkClick() {
 				} while (_holdLeftMouse);
 
 				if (_vm->_gyro->_thinkThing) {
-					_vm->_acci->_thing = _vm->_gyro->_thinks;
-					_vm->_acci->_thing += 49;
-					_vm->_acci->_person = _vm->_acci->kPardon;
+					_vm->_parser->_thing = _vm->_gyro->_thinks;
+					_vm->_parser->_thing += 49;
+					_vm->_parser->_person = _vm->_parser->kPardon;
 				} else {
-					_vm->_acci->_person = _vm->_gyro->_thinks;
-					_vm->_acci->_thing = _vm->_acci->kPardon;
+					_vm->_parser->_person = _vm->_gyro->_thinks;
+					_vm->_parser->_thing = _vm->_parser->kPardon;
 				}
-				callVerb(Acci::kVerbCodeExam);
+				callVerb(Parser::kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
 				} while (_holdLeftMouse);
 
-				callVerb(Acci::kVerbCodeScore);
+				callVerb(Parser::kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
 				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
 				_vm->_animation->updateSpeed();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index b786399..64b3b97 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -31,7 +31,6 @@
 #include "avalanche/menu.h"
 #include "avalanche/lucerna.h"
 #include "avalanche/gyro.h"
-#include "avalanche/acci.h"
 #include "avalanche/animation.h"
 
 #include "common/textconsole.h"
@@ -269,26 +268,26 @@ void Menu::findWhatYouCanDoWithIt() {
 	case Gyro::kObjectWine:
 	case Gyro::kObjectPotion:
 	case Gyro::kObjectInk:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeDrink;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeDrink;
 		break;
 	case Gyro::kObjectBell:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeRing;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeRing;
 		break;
 	case Gyro::kObjectChastity:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
 	case Gyro::kObjectLute:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodePlay;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodePlay;
 		break;
 	case Gyro::kObjectMushroom:
 	case Gyro::kObjectOnion:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeEat;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeEat;
 		break;
 	case Gyro::kObjectClothes:
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeWear;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->_verbStr = Acci::kVerbCodeExam; // Anything else.
+		_vm->_gyro->_verbStr = Parser::kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -483,33 +482,33 @@ void Menu::setupMenuWith() {
 			char vbchar;
 			Common::String verb;
 
-			_vm->_acci->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
+			_vm->_parser->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing)
+		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_parser->kNothing)
 			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeGive;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
 		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
-		_vm->_gyro->_verbStr = Common::String(Acci::kVerbCodeExam) + Acci::kVerbCodeTalk;
+		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeTalk;
 		switch (_vm->_gyro->_thinks) {
 		case Gyro::kPeopleGeida:
 		case Gyro::kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodeKiss;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodeKiss;
 			break;
 		case Gyro::kPeopleDogfood:
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
+			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodePlay;
 			break;
 		case Gyro::kPeopleMalagauche: {
 			bool isSober = !_vm->_gyro->_teetotal;
@@ -534,19 +533,19 @@ void Menu::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeHelp);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeBoss);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeBoss);
 		break;
 	case 2:
 		_vm->_lucerna->majorRedraw();
 		break;
 	case 3:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInfo);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeInfo);
 		break;
 	}
 }
@@ -555,17 +554,17 @@ void Menu::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeRestart);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeRestart);
 		break;
 	case 1:
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLoad);
+		if (!_vm->_parser->_realWords[1].empty())
+			_vm->_parser->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Parser::kVerbCodeLoad);
 		break;
 	case 2:
-		if (!_vm->_acci->_realWords[1].empty())
-			_vm->_acci->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Acci::kVerbCodeSave);
+		if (!_vm->_parser->_realWords[1].empty())
+			_vm->_parser->_realWords[1].clear();
+		_vm->_lucerna->callVerb(Parser::kVerbCodeSave);
 		break;
 	case 3:
 		//_vm->_basher->filename_edit();
@@ -575,7 +574,7 @@ void Menu::runMenuFile() {
 		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeQuit);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeQuit);
 		break;
 	}
 }
@@ -585,24 +584,24 @@ void Menu::runMenuAction() {
 	// Get up, pause game, open door, look, inventory, walk/run.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_acci->_person = _vm->_acci->kPardon;
-		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_vm->_parser->_person = _vm->_parser->kPardon;
+		_vm->_parser->_thing = _vm->_parser->kPardon;
 		f5Does = _vm->_gyro->f5Does();
 		_vm->_lucerna->callVerb(f5Does[0]);
 		break;
 	case 1:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodePause);
+		_vm->_parser->_thing = _vm->_parser->kPardon;
+		_vm->_lucerna->callVerb(Parser::kVerbCodePause);
 		break;
 	case 2:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeOpen);
 		break;
 	case 3:
-		_vm->_acci->_thing = _vm->_acci->kPardon;
-		_vm->_lucerna->callVerb(Acci::kVerbCodeLook);
+		_vm->_parser->_thing = _vm->_parser->kPardon;
+		_vm->_lucerna->callVerb(Parser::kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeInv);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeInv);
 		break;
 	case 5: {
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
@@ -626,44 +625,44 @@ void Menu::runMenuPeople() {
 }
 
 void Menu::runMenuWith() {
-	_vm->_acci->_thing = _vm->_gyro->_thinks;
+	_vm->_parser->_thing = _vm->_gyro->_thinks;
 
 	if (_vm->_gyro->_thinkThing) {
-		_vm->_acci->_thing += 49;
+		_vm->_parser->_thing += 49;
 
-		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Acci::kVerbCodeGive)
-			_vm->_acci->_person = _vm->_gyro->_lastPerson;
+		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive)
+			_vm->_parser->_person = _vm->_gyro->_lastPerson;
 		else
-			_vm->_acci->_person = Acci::kPardon;
+			_vm->_parser->_person = Parser::kPardon;
 	} else {
 		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
-			_vm->_acci->_thing = 100;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 100;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 101: // Wine
-			_vm->_acci->_thing = 50;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 50;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 102: // Whisky
-			_vm->_acci->_thing = 102;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 102;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 103: // Cider
-			_vm->_acci->_thing = 103;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 103;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 104: // Mead
-			_vm->_acci->_thing = 107;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 107;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 105: // Onion (trader)
-			_vm->_acci->_thing = 67;
-			_vm->_lucerna->callVerb(Acci::kVerbCodeBuy);
+			_vm->_parser->_thing = 67;
+			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
 			return;
 		default:
-			_vm->_acci->_person = _vm->_acci->_thing;
-			_vm->_acci->_thing = Acci::kPardon;
+			_vm->_parser->_person = _vm->_parser->_thing;
+			_vm->_parser->_thing = Parser::kPardon;
 			_vm->_gyro->_subjectNum = 0;
 		}
 	}
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index f044a41..541123f 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -1,7 +1,6 @@
 MODULE := engines/avalanche
 
 MODULE_OBJS = \
-	acci.o \
 	animation.o \
 	avalanche.o \
 	avalot.o \
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index d341e76..29fadda 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -27,6 +27,19 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/parser.h"
+#include "avalanche/gyro.h"
+#include "avalanche/lucerna.h"
+#include "avalanche/dialogs.h"
+#include "avalanche/timer.h"
+#include "avalanche/animation.h"
+#include "avalanche/background.h"
+#include "avalanche/pingo.h"
+#include "avalanche/sequence.h"
+
+#include "common/textconsole.h"
+
+#include <cstring>
+#include <cmath>
 
 namespace Avalanche {
 
@@ -39,13 +52,330 @@ void Parser::init() {
 	if (!_inputText.empty())
 		_inputText.clear();
 	_inputTextPos = 0;
+
+	_vm->_gyro->_weirdWord = false;
+
+	// Initailaze the vocabulary.
+	// Verbs: 1-49
+	_vocabulary[0].init(1, "EXAMINE");
+	_vocabulary[1].init(1, "READ");
+	_vocabulary[2].init(1, "XAM");
+	_vocabulary[3].init(2, "OPEN");
+	_vocabulary[4].init(2, "LEAVE");
+	_vocabulary[5].init(2, "UNLOCK");
+	_vocabulary[6].init(3, "PAUSE");
+	_vocabulary[7].init(47, "TA"); // Early to avoid Take and Talk.
+	_vocabulary[8].init(4, "TAKE");
+	_vocabulary[9].init(4, "GET");
+	_vocabulary[10].init(4, "PICK");
+	_vocabulary[11].init(5, "DROP");
+	_vocabulary[12].init(6, "INVENTORY");
+	_vocabulary[13].init(7, "TALK");
+	_vocabulary[14].init(7, "SAY");
+	_vocabulary[15].init(7, "ASK");
+	_vocabulary[16].init(8, "GIVE");
+	_vocabulary[17].init(9, "DRINK");
+	_vocabulary[18].init(9, "IMBIBE");
+	_vocabulary[19].init(9, "DRAIN");
+	_vocabulary[20].init(10, "LOAD");
+	_vocabulary[21].init(10, "RESTORE");
+	_vocabulary[22].init(11, "SAVE");
+	_vocabulary[23].init(12, "BRIBE");
+	_vocabulary[24].init(12, "PAY");
+	_vocabulary[25].init(13, "LOOK");
+	_vocabulary[26].init(14, "BREAK");
+	_vocabulary[27].init(15, "QUIT");
+	_vocabulary[28].init(15, "EXIT");
+	_vocabulary[29].init(16, "SIT");
+	_vocabulary[30].init(16, "SLEEP");
+	_vocabulary[31].init(17, "STAND");
+
+	_vocabulary[32].init(18, "GO");
+	_vocabulary[33].init(19, "INFO");
+	_vocabulary[34].init(20, "UNDRESS");
+	_vocabulary[35].init(20, "DOFF");
+	_vocabulary[36].init(21, "DRESS");
+	_vocabulary[37].init(21, "WEAR");
+	_vocabulary[38].init(21, "DON");
+	_vocabulary[39].init(22, "PLAY");
+	_vocabulary[40].init(22, "STRUM");
+	_vocabulary[41].init(23, "RING");
+	_vocabulary[42].init(24, "HELP");
+	_vocabulary[43].init(25, "KENDAL");
+	_vocabulary[44].init(26, "CAPYBARA");
+	_vocabulary[45].init(27, "BOSS");
+	_vocabulary[46].init(255, "NINET"); // block for NINETY
+	_vocabulary[47].init(28, "URINATE");
+	_vocabulary[48].init(28, "MINGITE");
+	_vocabulary[49].init(29, "NINETY");
+	_vocabulary[50].init(30, "ABRACADABRA");
+	_vocabulary[51].init(30, "PLUGH");
+	_vocabulary[52].init(30, "XYZZY");
+	_vocabulary[53].init(30, "HOCUS");
+	_vocabulary[54].init(30, "POCUS");
+	_vocabulary[55].init(30, "IZZY");
+	_vocabulary[56].init(30, "WIZZY");
+	_vocabulary[57].init(30, "PLOVER");
+	_vocabulary[58].init(30, "MELENKURION");
+	_vocabulary[59].init(30, "ZORTON");
+	_vocabulary[60].init(30, "BLERBI");
+	_vocabulary[61].init(30, "THURB");
+	_vocabulary[62].init(30, "SNOEZE");
+	_vocabulary[63].init(30, "SAMOHT");
+	_vocabulary[64].init(30, "NOSIDE");
+	_vocabulary[65].init(30, "PHUGGG");
+	_vocabulary[66].init(30, "KNERL");
+	_vocabulary[67].init(30, "MAGIC");
+	_vocabulary[68].init(30, "KLAETU");
+	_vocabulary[69].init(30, "VODEL");
+	_vocabulary[70].init(30, "BONESCROLLS");
+	_vocabulary[71].init(30, "RADOF");
+
+	_vocabulary[72].init(31, "RESTART");
+	_vocabulary[73].init(32, "SWALLOW");
+	_vocabulary[74].init(32, "EAT");
+	_vocabulary[75].init(33, "LISTEN");
+	_vocabulary[76].init(33, "HEAR");
+	_vocabulary[77].init(34, "BUY");
+	_vocabulary[78].init(34, "PURCHASE");
+	_vocabulary[79].init(34, "ORDER");
+	_vocabulary[80].init(34, "DEMAND");
+	_vocabulary[81].init(35, "ATTACK");
+	_vocabulary[82].init(35, "HIT");
+	_vocabulary[83].init(35, "KILL");
+	_vocabulary[84].init(35, "PUNCH");
+	_vocabulary[85].init(35, "KICK");
+	_vocabulary[86].init(35, "SHOOT");
+	_vocabulary[87].init(35, "FIRE");
+
+	// Passwords: 36
+	_vocabulary[88].init(36, "TIROS");
+	_vocabulary[89].init(36, "WORDY");
+	_vocabulary[90].init(36, "STACK");
+	_vocabulary[91].init(36, "SHADOW");
+	_vocabulary[92].init(36, "OWL");
+	_vocabulary[93].init(36, "ACORN");
+	_vocabulary[94].init(36, "DOMESDAY");
+	_vocabulary[95].init(36, "FLOPPY");
+	_vocabulary[96].init(36, "DIODE");
+	_vocabulary[97].init(36, "FIELD");
+	_vocabulary[98].init(36, "COWSLIP");
+	_vocabulary[99].init(36, "OSBYTE");
+	_vocabulary[100].init(36, "OSCLI");
+	_vocabulary[101].init(36, "TIMBER");
+	_vocabulary[102].init(36, "ADVAL");
+	_vocabulary[103].init(36, "NEUTRON");
+	_vocabulary[104].init(36, "POSITRON");
+	_vocabulary[105].init(36, "ELECTRON");
+	_vocabulary[106].init(36, "CIRCUIT");
+	_vocabulary[107].init(36, "AURUM");
+	_vocabulary[108].init(36, "PETRIFY");
+	_vocabulary[109].init(36, "EBBY");
+	_vocabulary[110].init(36, "CATAPULT");
+	_vocabulary[111].init(36, "GAMERS");
+	_vocabulary[112].init(36, "FUDGE");
+	_vocabulary[113].init(36, "CANDLE");
+	_vocabulary[114].init(36, "BEEB");
+	_vocabulary[115].init(36, "MICRO");
+	_vocabulary[116].init(36, "SESAME");
+	_vocabulary[117].init(36, "LORDSHIP");
+
+	_vocabulary[118].init(37, "DIR");
+	_vocabulary[119].init(37, "LS");
+	_vocabulary[120].init(38, "DIE");
+	_vocabulary[121].init(39, "SCORE");
+	_vocabulary[122].init(40, "PUT");
+	_vocabulary[123].init(40, "INSERT");
+	_vocabulary[124].init(41, "KISS");
+	_vocabulary[125].init(41, "SNOG");
+	_vocabulary[126].init(41, "CUDDLE");
+	_vocabulary[127].init(42, "CLIMB");
+	_vocabulary[128].init(42, "CLAMBER");
+	_vocabulary[129].init(43, "JUMP");
+	_vocabulary[130].init(44, "HIGHSCORES");
+	_vocabulary[131].init(44, "HISCORES");
+	_vocabulary[132].init(45, "WAKEN");
+	_vocabulary[133].init(45, "AWAKEN");
+	_vocabulary[134].init(46, "HELLO");
+	_vocabulary[135].init(46, "HI");
+	_vocabulary[136].init(46, "YO");
+	_vocabulary[137].init(47, "THANKS"); // = 47, "ta", which was defined earlier.
+
+	// Nouns - Objects: 50-100
+	_vocabulary[138].init(50, "WINE");
+	_vocabulary[139].init(50, "BOOZE");
+	_vocabulary[140].init(50, "NASTY");
+	_vocabulary[141].init(50, "VINEGAR");
+	_vocabulary[142].init(51, "MONEYBAG");
+	_vocabulary[143].init(51, "BAG");
+	_vocabulary[144].init(51, "CASH");
+	_vocabulary[145].init(51, "DOSH");
+	_vocabulary[146].init(51, "WALLET");
+	_vocabulary[147].init(52, "BODKIN");
+	_vocabulary[148].init(52, "DAGGER");
+	_vocabulary[149].init(53, "POTION");
+	_vocabulary[150].init(54, "CHASTITY");
+	_vocabulary[151].init(54, "BELT");
+	_vocabulary[152].init(55, "BOLT");
+	_vocabulary[153].init(55, "ARROW");
+	_vocabulary[154].init(55, "DART");
+	_vocabulary[155].init(56, "CROSSBOW");
+	_vocabulary[156].init(56, "BOW");
+	_vocabulary[157].init(57, "LUTE");
+	_vocabulary[158].init(58, "PILGRIM");
+	_vocabulary[159].init(58, "BADGE");
+	_vocabulary[160].init(59, "MUSHROOMS");
+	_vocabulary[161].init(59, "TOADSTOOLS");
+	_vocabulary[162].init(60, "KEY");
+	_vocabulary[163].init(61, "BELL");
+	_vocabulary[164].init(62, "PRESCRIPT");
+	_vocabulary[165].init(62, "SCROLL");
+	_vocabulary[166].init(62, "MESSAGE");
+	_vocabulary[167].init(63, "PEN");
+	_vocabulary[168].init(63, "QUILL");
+	_vocabulary[169].init(64, "INK");
+	_vocabulary[170].init(64, "INKPOT");
+	_vocabulary[171].init(65, "CLOTHES");
+	_vocabulary[172].init(66, "HABIT");
+	_vocabulary[173].init(66, "DISGUISE");
+	_vocabulary[174].init(67, "ONION");
+
+	_vocabulary[175].init(99, "PASSWORD");
+
+	// Objects from Also are placed between 101 and 131.
+	// Nouns - People - Male: 150-174
+	_vocabulary[176].init(150, "AVVY");
+	_vocabulary[177].init(150, "AVALOT");
+	_vocabulary[178].init(150, "YOURSELF");
+	_vocabulary[179].init(150, "ME");
+	_vocabulary[180].init(150, "MYSELF");
+	_vocabulary[181].init(151, "SPLUDWICK");
+	_vocabulary[182].init(151, "THOMAS");
+	_vocabulary[183].init(151, "ALCHEMIST");
+	_vocabulary[184].init(151, "CHEMIST");
+	_vocabulary[185].init(152, "CRAPULUS");
+	_vocabulary[186].init(152, "SERF");
+	_vocabulary[187].init(152, "SLAVE");
+	_vocabulary[188].init(158, "DU"); // Put in early for Baron DU Lustie to save confusion with Duck & Duke.
+	_vocabulary[189].init(152, "CRAPPY");
+	_vocabulary[190].init(153, "DUCK");
+	_vocabulary[191].init(153, "DOCTOR");
+	_vocabulary[192].init(154, "MALAGAUCHE");
+	_vocabulary[193].init(155, "FRIAR");
+	_vocabulary[194].init(155, "TUCK");
+	_vocabulary[195].init(156, "ROBIN");
+	_vocabulary[196].init(156, "HOOD");
+	_vocabulary[197].init(157, "CWYTALOT");
+	_vocabulary[198].init(157, "GUARD");
+	_vocabulary[199].init(157, "BRIDGEKEEP");
+	_vocabulary[200].init(158, "BARON");
+	_vocabulary[201].init(158, "LUSTIE");
+	_vocabulary[202].init(159, "DUKE");
+	_vocabulary[203].init(159, "GRACE");
+	_vocabulary[204].init(160, "DOGFOOD");
+	_vocabulary[205].init(160, "MINSTREL");
+	_vocabulary[206].init(161, "TRADER");
+	_vocabulary[207].init(161, "SHOPKEEPER");
+	_vocabulary[208].init(161, "STALLHOLDER");
+	_vocabulary[209].init(162, "PILGRIM");
+	_vocabulary[210].init(162, "IBYTHNETH");
+	_vocabulary[211].init(163, "ABBOT");
+	_vocabulary[212].init(163, "AYLES");
+	_vocabulary[213].init(164, "PORT");
+	_vocabulary[214].init(165, "SPURGE");
+	_vocabulary[215].init(166, "JACQUES");
+	_vocabulary[216].init(166, "SLEEPER");
+	_vocabulary[217].init(166, "RINGER");
+
+	// Nouns - People - Female: 175-199
+	_vocabulary[218].init(175, "WIFE");
+	_vocabulary[219].init(175, "ARKATA");
+	_vocabulary[220].init(176, "GEDALODAVA");
+	_vocabulary[221].init(176, "GEIDA");
+	_vocabulary[222].init(176, "PRINCESS");
+	_vocabulary[223].init(178, "WISE");
+	_vocabulary[224].init(178, "WITCH");
+
+	// Pronouns: 200-224
+	_vocabulary[225].init(200, "HIM");
+	_vocabulary[226].init(200, "MAN");
+	_vocabulary[227].init(200, "GUY");
+	_vocabulary[228].init(200, "DUDE");
+	_vocabulary[229].init(200, "CHAP");
+	_vocabulary[230].init(200, "FELLOW");
+	_vocabulary[231].init(201, "HER");
+	_vocabulary[232].init(201, "GIRL");
+	_vocabulary[233].init(201, "WOMAN");
+	_vocabulary[234].init(202, "IT");
+	_vocabulary[235].init(202, "THING");
+	_vocabulary[236].init(203, "MONK");
+	_vocabulary[237].init(204, "BARMAN");
+	_vocabulary[238].init(204, "BARTENDER");
+
+	// Prepositions: 225-249
+	_vocabulary[239].init(225, "TO");
+	_vocabulary[240].init(226, "AT");
+	_vocabulary[241].init(227, "UP");
+	_vocabulary[242].init(228, "INTO");
+	_vocabulary[243].init(228, "INSIDE");
+	_vocabulary[244].init(229, "OFF");
+	_vocabulary[245].init(230, "UP");
+	_vocabulary[246].init(231, "DOWN");
+	_vocabulary[247].init(232, "ON");
+
+	// Please: 251
+	_vocabulary[248].init(251, "PLEASE");
+
+	// About: 252
+	_vocabulary[249].init(252, "ABOUT");
+	_vocabulary[250].init(252, "CONCERNING");
+
+	// Swear words: 253
+	/*		  I M P O R T A N T    M E S S A G E
+
+	DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
+	DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
+	GOODNESS KNOWS WHO WROTE THEM.
+	READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
+	WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */
+	_vocabulary[251].init(253, "SHIT");
+	_vocabulary[252].init(28 , "PISS");
+	_vocabulary[253].init(28 , "PEE");
+	_vocabulary[254].init(253, "FART");
+	_vocabulary[255].init(253, "FUCK");
+	_vocabulary[256].init(253, "BALLS");
+	_vocabulary[257].init(253, "BLAST");
+	_vocabulary[258].init(253, "BUGGER");
+	_vocabulary[259].init(253, "KNICKERS");
+	_vocabulary[260].init(253, "BLOODY");
+	_vocabulary[261].init(253, "HELL");
+	_vocabulary[262].init(253, "DAMN");
+	_vocabulary[263].init(253, "SMEG");
+	// ...and other even ruder words. You didn't read them, did you? Good.
+
+	// Answer-back smart-alec words: 249
+	_vocabulary[264].init(249, "YES");
+	_vocabulary[265].init(249, "NO");
+	_vocabulary[266].init(249, "BECAUSE");
+
+	// Noise words: 255
+	_vocabulary[267].init(255, "THE");
+	_vocabulary[268].init(255, "A");
+	_vocabulary[269].init(255, "NOW");
+	_vocabulary[270].init(255, "SOME");
+	_vocabulary[271].init(255, "AND");
+	_vocabulary[272].init(255, "THAT");
+	_vocabulary[273].init(255, "POCUS");
+	_vocabulary[274].init(255, "HIS");
+	_vocabulary[275].init(255, "THIS");
+	_vocabulary[276].init(255, "SENTINEL"); // for "Ken SENT Me"
 }
 
 void Parser::handleInputText(const Common::Event &event) {
 	byte inChar = event.kbd.ascii;
 	warning("STUB: Parser::handleInputText()");
-//	if (_vm->_dropdown->_activeMenuItem._activeNow) {
-//		_vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd);
+//	if (_vm->_menu->_activeMenuItem._activeNow) {
+//		_vm->_menu->parseKey(inChar, _vm->_enhanced->extd);
 //	} else {
 		if (_inputText.size() < 76) {
 			if ((inChar == '"') || (inChar == '`')) {
@@ -65,25 +395,26 @@ void Parser::handleInputText(const Common::Event &event) {
 }
 
 void Parser::handleBackspace() {
-	if (!_vm->_menu->_activeMenuItem._activeNow) {
-		if (_inputTextPos > _leftMargin) {
-			_inputTextPos--;
-			if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
-				_quote = !_quote;
-			_inputText.deleteChar(_inputTextPos);
-			plotText();
-		} else
-			_vm->_sound->blip();
-	}
+	if (_vm->_menu->_activeMenuItem._activeNow)
+		return;
+
+	if (_inputTextPos > _leftMargin) {
+		_inputTextPos--;
+		if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
+			_quote = !_quote;
+		_inputText.deleteChar(_inputTextPos);
+		plotText();
+	} else
+		_vm->_sound->blip();
 }
 
 void Parser::handleReturn() {
 	if (_vm->_menu->_activeMenuItem._activeNow)
-		_vm->_parser->tryDropdown();
+		tryDropdown();
 	else if (!_inputText.empty()) {
 		_inputTextBackup = _inputText;
-		_vm->_acci->parse();
-		_vm->_acci->doThat();
+		parse();
+		doThat();
 		_inputText.clear();
 		wipeText();
 	}
@@ -92,12 +423,12 @@ void Parser::handleReturn() {
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_F5:
-		_vm->_acci->_person = _vm->_acci->kPardon;
-		_vm->_acci->_thing = _vm->_acci->kPardon;
+		_person = kPardon;
+		_thing = kPardon;
 		_vm->_lucerna->callVerb(_vm->_gyro->f5Does()[0]);
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_lucerna->callVerb(Acci::kVerbCodeOpen);
+		_vm->_lucerna->callVerb(Parser::kVerbCodeOpen);
 		break;
 	default:
 		break;
@@ -109,7 +440,7 @@ void Parser::plotText() {
 	cursorOff();
 
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->_font, 8, 24, 161, kColorWhite);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_gyro->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);
@@ -133,7 +464,7 @@ void Parser::tryDropdown() {
 	warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown's keyboard handling.
 }
 
-int16 Parser::pos(const Common::String &crit, const Common::String &src) {
+int16 Parser::getPos(const Common::String &crit, const Common::String &src) {
 	if (src.contains(crit))
 		return strstr(src.c_str(),crit.c_str()) - src.c_str();
 	else
@@ -159,4 +490,1879 @@ void Parser::wipeText() {
 	CursorMan.showMouse(true);
 }
 
+void Parser::clearWords() {
+	for (int i = 0; i < 11; i++) {
+		if (!_realWords[i].empty())
+			_realWords[i].clear();
+	}
+}
+
+byte Parser::wordNum(Common::String word) {
+	if (word.empty())
+		return 0;
+
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
+		if (_vocabulary[i]._word == word)
+			return _vocabulary[i]._number;
+	}
+
+	// If not found as a whole, we look for it as a substring.
+	for (int32 i = kParserWordsNum - 1; i >= 0; i--) {
+		if (Common::String(_vocabulary[i]._word.c_str(), word.size()) == word)
+			return _vocabulary[i]._number;
+	}
+
+	return kPardon;
+}
+
+void Parser::replace(Common::String oldChars, byte newChar) {
+	int16 pos = getPos(oldChars, _thats);
+	while (pos != -1) {
+		if (newChar == 0)
+			_thats.deleteChar(pos);
+		else {
+			for (uint i = pos; i < pos + oldChars.size(); i++)
+				_thats.deleteChar(pos);
+			_thats.insertChar(newChar, pos);
+		}
+		pos = getPos(oldChars, _thats);
+	}
+}
+
+Common::String Parser::rank() {
+	static const RankType kRanks[9] = {
+		{0, "Beginner"},     {10, "Novice"},
+		{20, "Improving"},   {35, "Not bad"},
+		{50, "Passable"},    {65, "Good"},
+		{80, "Experienced"}, {108, "The BEST!"},
+		{32767, "copyright'93"}
+	};
+
+	for (int i = 0; i < 8; i++) {
+		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
+			return kRanks[i]._title;
+		}
+	}
+	return "";
+}
+
+Common::String Parser::totalTime() {
+	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
+	const double ticksInOneSec = (double)(65535) / 3600;
+	uint16 h, m, s;
+
+	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
+	m = h % 3600;
+	h /= 3600;
+	s = m % 60;
+	m /= 60;
+
+	Common::String result = "You've been playing for ";
+	if (h > 0)
+		result += Common::String::format("%d hours, ", h);
+	if ((m > 0) || (h != 0))
+		result = Common::String::format("%d minutes and ", m);
+	return result + Common::String::format("%d seconds", s);
+}
+
+void Parser::cheatParse(Common::String codes) {
+	warning("STUB: Parser::cheatParse()");
+}
+
+
+
+void Parser::stripPunctuation(Common::String &word) {
+	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
+
+	for (int i = 0; i < 32; i++) {
+		for (;;) {
+			int16 pos = getPos(Common::String(punct[i]), word);
+			if (pos == -1)
+				break;
+			word.deleteChar(pos);
+		}
+	}
+}
+
+void Parser::displayWhat(byte target, bool animate, bool &ambiguous) {
+	if (target == kPardon) {
+		ambiguous = true;
+		if (animate)
+			_vm->_dialogs->displayText("Whom?");
+		else
+			_vm->_dialogs->displayText("What?");
+	} else {
+		if (animate) {
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
+			_vm->_dialogs->displayText(tmpStr);
+		} else {
+			Common::String z = _vm->_gyro->getItem(target);
+			if (z != "") {
+				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
+				_vm->_dialogs->displayText(tmpStr);
+			}
+		}
+	}
+}
+
+bool Parser::doPronouns() {
+	bool ambiguous = false;
+
+	for (uint i = 0; i < _thats.size(); i++) {
+		byte wordCode = _thats[i];
+		switch (wordCode) {
+		case 200:
+			displayWhat(_vm->_gyro->_him, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_him, i);
+			break;
+		case 201:
+			displayWhat(_vm->_gyro->_her, true, ambiguous);
+			_thats.setChar(_vm->_gyro->_her, i);
+			break;
+		case 202:
+			displayWhat(_vm->_gyro->_it, false, ambiguous);
+			_thats.setChar(_vm->_gyro->_it, i);
+			break;
+		}
+	}
+
+	return ambiguous;
+}
+
+void Parser::properNouns() {
+	_inputText.toLowercase();
+
+	// We set every word's first character to uppercase.
+	for (uint i = 1; i < (_inputText.size() - 1); i++) {
+		if (_inputText[i] == ' ')
+			_inputText.setChar(toupper(_inputText[i + 1]), i + 1);
+	}
+
+	// And the first character as well.
+	_inputText.setChar(toupper(_inputText[0]), 0);
+}
+
+void Parser::sayIt() {
+	Common::String x = _inputText;
+	x.setChar(toupper(x[0]), 0);
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Dialogs::kControlRegister, x.c_str(), 
+		                                           Dialogs::kControlSpeechBubble, Dialogs::kControlRegister);
+	_vm->_dialogs->displayText(tmpStr);
+}
+
+void Parser::storeInterrogation(byte interrogation) {
+	if (_inputText.empty())
+		return;
+
+	// Strip _inputText:
+	while ((_inputText[0] == ' ') && (!_inputText.empty()))
+		_inputText.deleteChar(0);
+	while ((_inputText.lastChar() == ' ') && (!_inputText.empty()))
+		_inputText.deleteLastChar();
+
+	_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
+
+	switch (interrogation) {
+	case 1:
+		_inputText.toLowercase();
+		sayIt();
+		_vm->_gyro->_favouriteDrink = _inputText;
+		_vm->_gyro->_cardiffQuestionNum = 2;
+		break;
+	case 2:
+		properNouns();
+		sayIt();
+		_vm->_gyro->_favouriteSong = _inputText;
+		_vm->_gyro->_cardiffQuestionNum = 3;
+		break;
+	case 3:
+		properNouns();
+		sayIt();
+		_vm->_gyro->_worstPlaceOnEarth = _inputText;
+		_vm->_gyro->_cardiffQuestionNum = 4;
+		break;
+	case 4:
+		_inputText.toLowercase();
+		sayIt();
+		if (!_vm->_gyro->_spareEvening.empty())
+			_vm->_gyro->_spareEvening.clear();
+		_vm->_gyro->_spareEvening = _inputText;
+		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
+		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
+		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
+		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
+		_vm->_gyro->_cardiffQuestionNum = 5;
+		break;
+	case 99:
+		//store_high(_inputText);
+		warning("STUB: Parser::store_interrogation()");
+		break;
+	}
+
+	if (interrogation < 4)
+		_vm->_timer->cardiffSurvey();
+}
+
+
+
+void Parser::parse() {
+	// First parsing - word identification
+	if (!_thats.empty())
+		_thats.clear();
+
+	byte n = 0;
+	_polite = false;
+	_verb = kPardon;
+	_thing = kPardon;
+	_thing2 = kPardon;
+	_person = kPardon;
+	clearWords();
+
+
+	// A cheat mode attempt.
+	if (_inputText[0] == '.') {
+		cheatParse(_inputText);
+		_thats = kNothing;
+		return;
+	}
+
+	// Are we being interrogated right now?
+	if (_vm->_gyro->_interrogation > 0) {
+		storeInterrogation(_vm->_gyro->_interrogation);
+		_vm->_gyro->_weirdWord = true;
+		return;
+	}
+
+	// Actually process the command.
+	Common::String inputText = _inputText + ' ';
+	Common::String inputTextUpper = inputText;
+	inputTextUpper.toUppercase();
+	while (!inputTextUpper.empty()) {
+		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
+			inputTextUpper.deleteChar(0);
+			inputText.deleteChar(0);
+		}
+		if (inputTextUpper.empty())
+			break;
+
+		// Get the following word of the strings.
+		byte size = getPos(Common::String(' '), inputTextUpper) + 1;
+		char *subStr = new char[size];
+		Common::strlcpy(subStr, inputTextUpper.c_str(), size);
+		Common::String thisword = subStr;
+		Common::strlcpy(subStr, inputText.c_str(), size);
+		_realWords[n] = subStr;
+		delete[] subStr;
+
+		stripPunctuation(inputTextUpper);
+
+		bool notfound = true;
+
+		// Check also[] first, which contains words about the actual room.
+		if (!thisword.empty()) {
+			for (int i = 0; i < 31; i++) {
+				if ((_vm->_gyro->_also[i][0] != 0) && (getPos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
+					_thats += Common::String(99 + i);
+					notfound = false;
+				}
+			}
+		}
+
+		// Check Accis's own table (words[]) for "global" commands.
+		if (notfound) {
+			byte answer = wordNum(thisword);
+			if (answer == kPardon) {
+				notfound = true;
+				_thats = _thats + kPardon;
+			} else
+				_thats = _thats + answer;
+			n++;
+		}
+
+		// Delete words we already processed.
+		int16 spacePos = getPos(Common::String(' '), inputTextUpper);
+		if (spacePos > -1) {
+			for (int i = 0; i <= spacePos; i++)
+				inputTextUpper.deleteChar(0);
+		}
+
+		spacePos = getPos(Common::String(' '), inputText);
+		if (spacePos > -1) {
+			for (int i = 0; i <= spacePos; i++)
+				inputText.deleteChar(0);
+		}
+	}
+
+	Common::String unkString;
+	int16 pos = getPos(Common::String('\xFE'), _thats);
+	if (pos > -1)
+		unkString = _realWords[pos];
+	else
+		unkString.clear();
+
+	// Replace words' codes that mean the same.
+	replace(Common::String("\xFF"),     0); // zap noise words
+	replace(Common::String("\xD\xE2"),  1); // "look at" = "examine"
+	replace(Common::String("\xD\xE4"),  1); // "look in" = "examine"
+	replace(Common::String("\x4\xE6"),  17); // "get up" = "stand"
+	replace(Common::String("\x4\xE7"),  17); // "get down" = "stand"... well, why not?
+	replace(Common::String("\x12\xE4"), 2); // "go in" = "open [door]"
+	replace(Common::String("\x1C\xE5"), 253); // "P' off" is a swear word
+	replace(Common::String("\x4\x6"),   6); // "Take inventory" (remember Colossal Adventure?)
+	replace(Common::String("\x28\xE8"), 21); // "put on" = "don"
+	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
+
+	// Words that could mean more than one _person
+	if (_vm->_gyro->_room == kRoomNottsPub)
+		replace(Common::String('\xCC'), 164); // Barman = Port
+	else
+		replace(Common::String('\xCC'), 154); // Barman = Malagauche
+
+	switch (_vm->_gyro->_room) {
+	case kRoomAylesOffice:
+		replace(Common::String('\xCB'), 163); // Monk = Ayles
+		break;
+	case kRoomMusicRoom:
+		replace(Common::String('\xCB'), 166); // Monk = Jacques
+		break;
+	default:
+		replace(Common::String('\xCB'), 162); // Monk = Ibythneth
+	}
+
+	if (doPronouns()) {
+		_vm->_gyro->_weirdWord = true;
+		_thats = kNothing;
+		return;
+	}
+
+	// Second parsing.
+	if (!_vm->_gyro->_subject.empty())
+		_vm->_gyro->_subject.clear();
+	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
+
+	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
+		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
+			_vm->_gyro->_subjectNum = (byte)_thats[i];
+			_thats.setChar(kMoved, i);
+			break;
+		}
+	}
+
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
+			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
+				break;
+			}
+		}
+	}
+
+	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+		for (uint16 i = 0; i < _thats.size() - 1; i++) {
+			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
+				// SAY not followed by a preposition
+				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_thats.setChar(0, i + 1);
+				break;
+			}
+		}
+	}
+
+	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
+		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
+			_verb = (byte)_thats[i];
+		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
+			_thing2 = _thing;
+			_thing = (byte)_thats[i];
+		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
+			_person = (byte)_thats[i];
+		else if ((byte)_thats[i] == 251)
+			_polite = true;
+	}
+
+	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
+		_vm->_dialogs->displayText(tmpStr);
+		_vm->_gyro->_weirdWord = true;
+	} else
+		_vm->_gyro->_weirdWord = false;
+
+	if (_thats.empty())
+		_thats = kNothing;
+
+	if (_thing != kPardon)
+		_vm->_gyro->_it = _thing;
+
+	if (_person != kPardon) {
+		if (_person < Gyro::kPeopleArkata)
+			_vm->_gyro->_him = _person;
+		else
+			_vm->_gyro->_her = _person;
+	}
+}
+
+void Parser::examineObject() {
+	if (_thing != _vm->_gyro->_thinks)
+		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
+	switch (_thing) {
+	case Gyro::kObjectWine :
+		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
+		case 1:
+			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
+			break;
+		case 2:
+			_vm->_dialogs->displayScrollChain('d', 6); // Bad wine
+			break;
+		case 3:
+			_vm->_dialogs->displayScrollChain('d', 7); // Vinegar
+			break;
+		}
+		break;
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
+		else
+			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
+		break;
+	default:
+		_vm->_dialogs->displayScrollChain('t', _thing); // Ordinarily
+	}
+}
+
+bool Parser::isPersonHere() { // Person equivalent of "holding".
+	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
+		return true;
+	else {
+		Common::String tmpStr;
+		if (_person < Gyro::kPeopleArkata)
+			tmpStr = "He isn't around at the moment.";
+		else
+			tmpStr = "She isn't around at the moment.";
+		_vm->_dialogs->displayText(tmpStr);
+		return false;
+	}
+}
+
+void Parser::exampers() {
+	if (isPersonHere()) {
+		if (_thing != _vm->_gyro->_thinks)
+			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
+
+		byte newPerson = _person - 149;
+
+		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
+			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
+		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
+			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
+		else
+			_vm->_dialogs->displayScrollChain('p', newPerson);
+
+		if ((_person == Gyro::kPeopleAyles) && !_vm->_gyro->_aylesIsAwake)
+			_vm->_dialogs->displayScrollChain('Q', 13);
+
+		_person = newPerson;
+	}
+}
+
+/**
+ * Return whether Avvy is holding an object or not
+ * @remarks	Originally called 'holding'
+ */
+bool Parser::isHolding() {
+	if ((51 <= _thing) && (_thing <= 99)) // Also.
+		return true;
+
+	bool holdingResult = false;
+
+	if (_thing > 100)
+		_vm->_dialogs->displayText("Be reasonable!");
+	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+		_vm->_dialogs->displayText("You're not holding it, Avvy.");
+	else
+		holdingResult = true;
+
+	return holdingResult;
+}
+
+void Parser::openBox(bool isOpening) {
+	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
+		_vm->_background->drawBackgroundSprite(-1, -1, 4);
+
+		_vm->_background->updateBackgroundSprites();
+		_vm->_animation->animLink();
+		_vm->_graphics->refreshScreen();
+
+		_vm->_system->delayMillis(55);
+
+		if (!isOpening) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->updateBackgroundSprites();
+			_vm->_animation->animLink();
+			_vm->_graphics->refreshScreen();
+		}
+	}
+}
+
+void Parser::examine() {
+	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
+	if ((_person == kPardon) && (_thing != kPardon)) {
+		if (isHolding()) {
+			// Remember: it's been slipped! Ie subtract 49.
+			if ((1 <= _thing) && (_thing <= 49)) // Standard object
+				examineObject();
+			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
+				openBox(true);
+				_vm->_dialogs->displayText(*_vm->_gyro->_also[_thing - 50][1]);
+				openBox(false);
+			}
+		}
+	} else if (_person != kPardon)
+		exampers();
+	else
+		_vm->_dialogs->displayText("It's just as it looks on the picture.");  // Don't know: guess.
+}
+
+void Parser::inventory() {
+	byte itemNum = 0;
+	Common::String tmpStr = Common::String("You're carrying ");
+
+	for (int i = 0; i < kObjectNum; i++) {
+		if (_vm->_gyro->_objects[i]) {
+			itemNum++;
+			if (itemNum == _vm->_gyro->_carryNum)
+				tmpStr += "and ";
+
+			tmpStr += _vm->_gyro->getItem(i + 1);
+
+			if ((i + 1) == _vm->_gyro->_wearing)
+				tmpStr += ", which you're wearing";
+
+			if (itemNum < _vm->_gyro->_carryNum)
+				tmpStr += ", ";
+		}
+	}
+
+	if (_vm->_gyro->_wearing == kNothing)
+		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+	else
+		tmpStr += '.';
+
+	_vm->_dialogs->displayText(tmpStr);
+}
+
+void Parser::swallow() { // Eat something.
+	switch (_thing) {
+	case Gyro::kObjectWine:
+		switch (_vm->_gyro->_wineState) { // 4 is perfect
+		case 1:
+			if (_vm->_gyro->_teetotal)  {
+				_vm->_dialogs->displayScrollChain('D', 6);
+				return;
+			}
+			_vm->_dialogs->displayScrollChain('U', 1);
+			_vm->_pingo->wobble();
+			_vm->_dialogs->displayScrollChain('U', 2);
+			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+			_vm->_lucerna->refreshObjectList();
+			drink();
+			break;
+		case 2:
+		case 3:
+			_vm->_dialogs->displayScrollChain('d', 8);
+			break; // You can't drink it!
+		}
+		break;
+	case Gyro::kObjectPotion:
+		_vm->_gyro->setBackgroundColor(4);
+		_vm->_dialogs->displayScrollChain('U', 3);
+		_vm->_lucerna->gameOver();
+		_vm->_gyro->setBackgroundColor(0);
+		break;
+	case Gyro::kObjectInk:
+		_vm->_dialogs->displayScrollChain('U', 4);
+		break;
+	case Gyro::kObjectChastity:
+		_vm->_dialogs->displayScrollChain('U', 5);
+		break;
+	case Gyro::kObjectMushroom:
+		_vm->_dialogs->displayScrollChain('U', 6);
+		_vm->_lucerna->gameOver();
+		break;
+	case Gyro::kObjectOnion:
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_dialogs->displayScrollChain('U', 11);
+		else {
+			_vm->_dialogs->displayScrollChain('U', 8);
+			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
+			_vm->_lucerna->refreshObjectList();
+		}
+		break;
+	default:
+		if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub))
+			_vm->_dialogs->displayText("Try BUYing things before you drink them!");
+		else
+			_vm->_dialogs->displayText("The taste of it makes you retch!");
+	}
+}
+
+void Parser::peopleInRoom() {
+	byte numPeople = 0; // Number of people in the room.
+
+	for (int i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
+			numPeople++;
+	}
+
+	if (numPeople == 0) // If nobody's here, we can cut out straight away.
+		return;
+
+	Common::String tmpStr;
+	byte actPerson = 0; // Actually listed people.
+	for (int i = 1; i < 29; i++) {
+		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
+			actPerson++;
+			if (actPerson == 1) // First on the list.
+				tmpStr = _vm->_gyro->getName(i + 150);
+			else if (actPerson < numPeople) // The middle...
+				tmpStr += ", " + _vm->_gyro->getName(i + 150);
+			else // The end.
+				tmpStr += " and " + _vm->_gyro->getName(i + 150);
+		}
+	}
+
+	if (numPeople == 1)
+		tmpStr += " is";
+	else
+		tmpStr += " are";
+
+	_vm->_dialogs->displayText(tmpStr + " here."); // End and display it.
+}
+
+void Parser::lookAround() {
+	_vm->_dialogs->displayText(*_vm->_gyro->_also[0][1]);
+	switch (_vm->_gyro->_room) {
+	case kRoomSpludwicks:
+		if (_vm->_gyro->_avariciusTalk > 0)
+			_vm->_dialogs->displayScrollChain('q', 23);
+		else
+			peopleInRoom();
+		break;
+	case kRoomRobins:
+		if (_vm->_gyro->_tiedUp)
+			_vm->_dialogs->displayScrollChain('q', 38);
+		if (_vm->_gyro->_mushroomGrowing)
+			_vm->_dialogs->displayScrollChain('q', 55);
+		break;
+	case kRoomInsideCardiffCastle:
+		if (!_vm->_gyro->_takenPen)
+			_vm->_dialogs->displayScrollChain('q', 49);
+		break;
+	case kRoomLustiesRoom:
+		if (_vm->_gyro->_lustieIsAsleep)
+			_vm->_dialogs->displayScrollChain('q', 65);
+		break;
+	case kRoomCatacombs:
+		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
+		case 258 :
+			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
+			break;
+		case 514 :
+			_vm->_dialogs->displayScrollChain('q', 81); // Outside ditto.
+			break;
+		case 260 :
+			_vm->_dialogs->displayScrollChain('q', 82); // Outside Geida's room.
+			break;
+		}
+		break;
+	default:
+		peopleInRoom();
+	}
+}
+
+void Parser::openDoor() {
+	// Special cases.
+	switch (_vm->_gyro->_room) {
+	case kRoomYours:
+		if (_vm->_animation->inField(1)) {
+			// Opening the box.
+			_thing = 54; // The box.
+			_person = kPardon;
+			examine();
+			return;
+		}
+		break;
+	case kRoomSpludwicks:
+		if (_thing == 61) {
+			_vm->_dialogs->displayScrollChain('q', 85);
+			return;
+		}
+		break;
+	}
+
+	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties))
+		return; // No doors can open if you can't move Avvy.
+
+	for (int i = 0; i < 7; i++) {
+		if (_vm->_animation->inField(i + 8)) {
+			MagicType *portal = &_vm->_gyro->_portals[i];
+			switch (portal->_operation) {
+			case Gyro::kMagicExclaim:
+				_vm->_animation->_sprites[0].bounce();
+				_vm->_dialogs->displayScrollChain('x', portal->_data);
+				break;
+			case Gyro::kMagicTransport:
+				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
+				break;
+			case Gyro::kMagicUnfinished:
+				_vm->_animation->_sprites[0].bounce();
+				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
+				break;
+			case Gyro::kMagicSpecial:
+				_vm->_animation->callSpecial(portal->_data);
+				break;
+			case Gyro::kMagicOpenDoor:
+				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
+				break;
+			}
+
+			return;
+		}
+	}
+
+	if (_vm->_gyro->_room == kRoomMap)
+		_vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \
+				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
+	else
+		_vm->_dialogs->displayText("Door? What door?");
+}
+
+void Parser::silly() {
+	_vm->_dialogs->displayText("Don't be silly!");
+}
+
+void Parser::putProc() {
+	if (!isHolding())
+		return;
+
+	_thing2 -= 49; // Slip the second object.
+	char temp = _thing;
+	_thing = _thing2;
+	if (!isHolding())
+		return;
+	_thing = temp;
+
+	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
+	switch (_thing2) {
+	case Gyro::kObjectWine:
+		if (_thing == Gyro::kObjectOnion) {
+			if (_vm->_gyro->_rottenOnion)
+				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
+			else { // Put onion into wine?
+				if (_vm->_gyro->_wineState != 3) {
+					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+					_vm->_dialogs->displayText(tmpStr);
+				} else { // Put onion into vinegar! Yes!
+					_vm->_gyro->_onionInVinegar = true;
+					_vm->_lucerna->incScore(7);
+					_vm->_dialogs->displayScrollChain('u', 9);
+				}
+			}
+		} else
+			silly();
+		break;
+
+	case 54:
+		if (_vm->_gyro->_room == kRoomYours) { // Put something into the box.
+			if (_vm->_gyro->_boxContent != kNothing)
+				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
+			else {
+				switch (_thing) {
+				case Gyro::kObjectMoney:
+					_vm->_dialogs->displayText("You'd better keep some ready cash on you!");
+					break;
+				case Gyro::kObjectBell:
+					_vm->_dialogs->displayText("That's a silly place to keep a bell.");
+					break;
+				case Gyro::kObjectBodkin:
+					_vm->_dialogs->displayText("But you might need it!");
+					break;
+				case Gyro::kObjectOnion:
+					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
+					break;
+				default: // Put the object into the box...
+					if (_vm->_gyro->_wearing == _thing) {
+						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
+						_vm->_dialogs->displayText(tmpStr);
+					} else {
+						openBox(true); // Open box.
+
+						_vm->_gyro->_boxContent = _thing;
+						_vm->_gyro->_objects[_thing - 1] = false;
+						_vm->_lucerna->refreshObjectList();
+						_vm->_dialogs->displayText("OK, it's in the box.");
+
+						openBox(false); // Shut box.
+					}
+				}
+			}
+		} else
+			silly();
+		break;
+
+	default:
+		silly();
+	}
+}
+
+/**
+ * Display text when ingredients are not in the right order
+ * @remarks	Originally called 'not_in_order'
+ */
+void Parser::notInOrder() {
+	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
+		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+	_vm->_dialogs->displayText(tmpStr);
+}
+
+/**
+ * Move Spludwick to cauldron
+ * @remarks	Originally called 'go_to_cauldron'
+ */
+void Parser::goToCauldron() {
+	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
+	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
+	_vm->_animation->_sprites[1].walkTo(1);
+}
+
+/**
+ * Check is it's possible to give something to Spludwick
+ * @remarks	Originally called 'give2spludwick'
+ */
+bool Parser::giveToSpludwick() {
+	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
+		notInOrder();
+		return false;
+	}
+
+	switch (_thing) {
+	case Gyro::kObjectOnion:
+		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
+		if (_vm->_gyro->_rottenOnion)
+			_vm->_dialogs->displayScrollChain('q', 22);
+		else {
+			_vm->_gyro->_givenToSpludwick++;
+			_vm->_dialogs->displayScrollChain('q', 20);
+			goToCauldron();
+			_vm->_lucerna->incScore(3);
+		}
+		_vm->_lucerna->refreshObjectList();
+		break;
+	case Gyro::kObjectInk:
+		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
+		_vm->_lucerna->refreshObjectList();
+		_vm->_gyro->_givenToSpludwick++;
+		_vm->_dialogs->displayScrollChain('q', 24);
+		goToCauldron();
+		_vm->_lucerna->incScore(3);
+		break;
+	case Gyro::kObjectMushroom:
+		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
+		_vm->_dialogs->displayScrollChain('q', 25);
+		_vm->_lucerna->incScore(5);
+		_vm->_gyro->_givenToSpludwick++;
+		goToCauldron();
+		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
+		_vm->_lucerna->refreshObjectList();
+		break;
+	default:
+		return true;
+	}
+
+	return false;
+}
+
+void Parser::drink() {
+	_vm->_gyro->_alcoholLevel += 1;
+	if (_vm->_gyro->_alcoholLevel == 5) {
+		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
+		_vm->_gyro->_teetotal = true;
+		_vm->_gyro->_avvyIsAwake = false;
+		_vm->_gyro->_avvyInBed = true;
+		_vm->_lucerna->refreshObjectList();
+		_vm->_lucerna->dusk();
+		_vm->_gyro->hangAroundForAWhile();
+		_vm->_animation->flipRoom(1, 1);
+		_vm->_gyro->setBackgroundColor(14);
+		_vm->_animation->_sprites[0]._visible = false;
+	}
+}
+
+void Parser::cardiffClimbing() {
+	if (_vm->_gyro->_standingOnDais) { // Clamber up.
+		_vm->_dialogs->displayText("You climb down, back onto the floor.");
+		_vm->_gyro->_standingOnDais = false;
+		_vm->_animation->appearPed(0, 2);
+	} else if (_vm->_animation->inField(0)) { // Clamber down
+		_vm->_dialogs->displayText("You clamber up onto the dais.");
+		_vm->_gyro->_standingOnDais = true;
+		_vm->_animation->appearPed(0, 1);
+	} else
+			_vm->_dialogs->displayText("Get a bit closer, Avvy.");
+}
+
+void Parser::already() {
+	_vm->_dialogs->displayText("You're already standing!");
+}
+
+void Parser::standUp() {
+	switch (_vm->_gyro->_room) {
+	case kRoomYours: // Avvy isn't asleep.
+		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
+			if (_vm->_gyro->_teetotal) {
+				_vm->_dialogs->displayScrollChain('d', 12);
+				_vm->_gyro->setBackgroundColor(0);
+				_vm->_dialogs->displayScrollChain('d', 14);
+			}
+			_vm->_animation->_sprites[0]._visible = true;
+			_vm->_gyro->_userMovesAvvy = true;
+			_vm->_animation->appearPed(0, 1);
+			_vm->_animation->_direction = Animation::kDirLeft;
+			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
+			_vm->_lucerna->incScore(1);
+			_vm->_gyro->_avvyInBed = false;
+			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
+		} else
+			already();
+		break;
+
+	case kRoomInsideCardiffCastle:
+		cardiffClimbing();
+		break;
+
+	case kRoomNottsPub:
+		if (_vm->_gyro->_sittingInPub)  {
+			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
+			_vm->_animation->_sprites[0]._visible = true; // But standing up.
+			_vm->_animation->appearPed(0, 3); // And walking away.
+			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
+			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
+		} else
+			already();
+		break;
+	default:
+		already();
+	}
+}
+
+void Parser::getProc(char thing) {
+	switch (_vm->_gyro->_room) {
+	case kRoomYours:
+		if (_vm->_animation->inField(1)) {
+			if (_vm->_gyro->_boxContent == thing) {
+				_vm->_background->drawBackgroundSprite(-1, -1, 4);
+				_vm->_dialogs->displayText("OK, I've got it.");
+				_vm->_gyro->_objects[thing - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_boxContent = kNothing;
+				_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			} else {
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
+				_vm->_dialogs->displayText(tmpStr);
+			}
+		} else
+			_vm->_dialogs->displayScrollChain('q', 57);
+		break;
+	case kRoomInsideCardiffCastle:
+		switch (thing) {
+		case Gyro::kObjectPen:
+			if (_vm->_animation->inField(1)) { // Standing on the dais.
+				if (_vm->_gyro->_takenPen)
+					_vm->_dialogs->displayText("It's not there, Avvy.");
+				else {
+					// OK: we're taking the pen, and it's there.
+					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
+					_vm->_animation->callSpecial(3); // Zap!
+					_vm->_gyro->_takenPen = true;
+					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
+					_vm->_lucerna->refreshObjectList();
+					_vm->_dialogs->displayText("Taken.");
+				}
+			} else if (_vm->_gyro->_standingOnDais)
+				_vm->_dialogs->displayScrollChain('q', 53);
+			else
+				_vm->_dialogs->displayScrollChain('q', 51);
+			break;
+		case Gyro::kObjectBolt:
+			_vm->_dialogs->displayScrollChain('q', 52);
+			break;
+		default:
+			_vm->_dialogs->displayScrollChain('q', 57);
+		}
+		break;
+	case kRoomRobins:
+		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_dialogs->displayText("Got it!");
+			_vm->_gyro->_mushroomGrowing = false;
+			_vm->_gyro->_takenMushroom = true;
+			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
+			_vm->_lucerna->refreshObjectList();
+			_vm->_lucerna->incScore(3);
+		} else
+			_vm->_dialogs->displayScrollChain('q', 57);
+		break;
+	default:
+		_vm->_dialogs->displayScrollChain('q', 57);
+	}
+}
+
+/**
+ * Give the lute to Geida
+ * @remarks	Originally called 'give_Geida_the_lute'
+ */
+void Parser::giveGeidaTheLute() {
+	if (_vm->_gyro->_room != kRoomLustiesRoom) {
+		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
+		return;
+	}
+	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
+	_vm->_lucerna->refreshObjectList();
+	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
+
+	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
+	//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
+}
+
+void Parser::playHarp() {
+	if (_vm->_animation->inField(6))
+		_vm->_dialogs->displayMusicalScroll();
+	else
+		_vm->_dialogs->displayText("Get a bit closer to it, Avvy!");
+}
+
+void Parser::winSequence() {
+	_vm->_dialogs->displayScrollChain('q', 78);
+	_vm->_sequence->firstShow(7);
+	_vm->_sequence->thenShow(8);
+	_vm->_sequence->thenShow(9);
+	_vm->_sequence->startToClose();
+	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
+}
+
+Common::String Parser::personSpeaks() {
+	if ((_person == kPardon) || (_person == 0)) {
+		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
+			_person = _vm->_gyro->_her;
+		else
+			_person = _vm->_gyro->_him;
+	}
+
+	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
+		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
+	}
+
+	bool found = false; // The _person we're looking for's code is in _person.
+	Common::String tmpStr;
+
+	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
+			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, '1' + i);
+			found = true;
+		}
+	}
+
+	if (found)
+		return tmpStr;
+
+	for (int i = 0; i < 16; i++) {
+		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
+			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
+	}
+
+	return tmpStr;
+}
+
+void Parser::heyThanks() {
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
+	_vm->_dialogs->displayText(tmpStr);
+	_vm->_gyro->_objects[_thing - 1] = false;
+}
+
+/**
+ * @remarks	Originally called 'do_that'
+ */
+void Parser::doThat() {
+	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	static const char kWhat[] = "That's not possible!";
+
+	if (_thats == Common::String(kNothing))  {
+		if (!_thats.empty())
+			_thats.clear();
+		return;
+	}
+
+	if (_vm->_gyro->_weirdWord)
+		return;
+
+	if (_thing < 200)
+		_thing -= 49; // "Slip"
+
+
+	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
+	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
+	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
+		if (!_vm->_gyro->_alive) {
+			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
+			return;
+		}
+		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+			_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
+			return;
+		}
+	}
+
+	switch (_verb) {
+	case kVerbCodeExam:
+		examine();
+		break;
+	case kVerbCodeOpen:
+		openDoor();
+		break;
+	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeGet:
+		if (_thing != kPardon) { // Legitimate try to pick something up.
+			if (_vm->_gyro->_carryNum >= kCarryLimit)
+				_vm->_dialogs->displayText("You can't carry any more!");
+			else
+				getProc(_thing);
+		} else { // Not... ditto.
+			if (_person != kPardon)
+				_vm->_dialogs->displayText("You can't sweep folk off their feet!");
+			else
+				_vm->_dialogs->displayText("I assure you, you don't need it.");
+		}
+		break;
+	case kVerbCodeDrop:
+		_vm->_dialogs->displayText("Two years ago you dropped a florin in the street. Three days " \
+				"later it was gone! So now you never leave ANYTHING lying around. OK?");
+		break;
+	case kVerbCodeInv:
+		inventory();
+		break;
+	case kVerbCodeTalk:
+		if (_person == kPardon) {
+			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
+				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
+				_vm->_dialogs->displayText(tmpStr);
+			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
+				_thats.deleteChar(0);
+
+				for (int i = 0; i < 10; i++)
+					_realWords[i] = _realWords[i + 1];
+
+				_verb = _vm->_gyro->_subjectNum;
+				doThat();
+				return;
+			} else {
+				_person = _vm->_gyro->_subjectNum;
+				_vm->_gyro->_subjectNum = 0;
+				if ((_person == 0) || (_person == kPardon))
+					_vm->_dialogs->displayText("Talk to whom?");
+				else if (isPersonHere())
+					_vm->_dialogs->talkTo(_person);
+			}
+		} else if (isPersonHere())
+			_vm->_dialogs->talkTo(_person);
+		break;
+	case kVerbCodeGive:
+		if (isHolding()) {
+			if (_person == kPardon)
+				_vm->_dialogs->displayText("Give to whom?");
+			else if (isPersonHere()) {
+				switch (_thing) {
+				case Gyro::kObjectMoney :
+					_vm->_dialogs->displayText("You can't bring yourself to give away your moneybag.");
+					break;
+				case Gyro::kObjectBodkin:
+				case Gyro::kObjectBell:
+				case Gyro::kObjectClothes:
+				case Gyro::kObjectHabit :
+					_vm->_dialogs->displayText("Don't give it away, it might be useful!");
+					break;
+				default:
+					switch (_person) {
+					case Gyro::kPeopleCrapulus:
+						if (_thing == Gyro::kObjectWine) {
+							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
+							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+						} else
+							heyThanks();
+						break;
+					case Gyro::kPeopleCwytalot:
+						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
+							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
+						else
+							heyThanks();
+						break;
+					case Gyro::kPeopleSpludwick:
+						if (giveToSpludwick())
+							heyThanks();
+						break;
+					case Gyro::kPeopleIbythneth:
+						if (_thing == Gyro::kObjectBadge) {
+							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
+							_vm->_lucerna->incScore(3);
+							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
+							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
+							_vm->_gyro->_givenBadgeToIby = true;
+							_vm->_background->drawBackgroundSprite(-1, -1, 7);
+							_vm->_background->drawBackgroundSprite(-1, -1, 8);
+						} else
+							heyThanks();
+						break;
+					case Gyro::kPeopleAyles:
+						if (_vm->_gyro->_aylesIsAwake) {
+							if (_thing == Gyro::kObjectPen) {
+								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
+								_vm->_dialogs->displayScrollChain('q', 54);
+								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
+								_vm->_gyro->_givenPenToAyles = true;
+								_vm->_lucerna->refreshObjectList();
+								_vm->_lucerna->incScore(2);
+							} else
+								heyThanks();
+						} else
+							_vm->_dialogs->displayText("But he's asleep!");
+						break;
+					case Gyro::kPeopleGeida:
+						switch (_thing) {
+						case Gyro::kObjectPotion:
+							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
+							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
+							_vm->_lucerna->incScore(2);
+							_vm->_gyro->_givenPotionToGeida = true;
+							_vm->_lucerna->refreshObjectList();
+							break;
+						case Gyro::kObjectLute:
+							giveGeidaTheLute();
+							break;
+						default:
+							heyThanks();
+						}
+						break;
+					case Gyro::kPeopleArkata:
+						switch (_thing) {
+						case Gyro::kObjectPotion:
+							if (_vm->_gyro->_givenPotionToGeida)
+								winSequence();
+							else
+								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
+							break;
+						default:
+							heyThanks();
+						}
+						break;
+					default:
+						heyThanks();
+					}
+				}
+			}
+			_vm->_lucerna->refreshObjectList(); // Just in case...
+		}
+		break;
+
+	case kVerbCodeEat:
+	case kVerbCodeDrink:
+		if (isHolding())
+			swallow();
+		break;
+
+	case kVerbCodeLoad:
+		break;
+	case kVerbCodeSave:
+		break;
+	// We don't handle these two because we use ScummVM's save/load system.
+
+	case kVerbCodePay:
+		_vm->_dialogs->displayText("No money need change hands.");
+		break;
+	case kVerbCodeLook:
+		lookAround();
+		break;
+	case kVerbCodeBreak:
+		_vm->_dialogs->displayText("Vandalism is prohibited within this game!");
+		break;
+	case kVerbCodeQuit: // quit
+		if (!_polite)
+			_vm->_dialogs->displayText("How about a `please\", Avvy?");
+		else {
+			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
+			if (_vm->_dialogs->displayQuestion(tmpStr))
+				_vm->_gyro->_letMeOut = true;
+		}
+		break;
+	case kVerbCodeGo:
+		_vm->_dialogs->displayText("Just use the arrow keys to walk there.");
+		break;
+	case kVerbCodeInfo: {
+		_vm->_dialogs->_aboutBox = true;
+
+		Common::String toDisplay;
+		for (int i = 0; i < 7; i++)
+			toDisplay += Dialogs::kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
+			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
+			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
+			+ "version " + _vm->_gyro->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
+			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+		_vm->_dialogs->displayText(toDisplay);
+		_vm->_dialogs->_aboutBox = false;
+		}
+		break;
+	case kVerbCodeUndress:
+		if (_vm->_gyro->_wearing == kNothing)
+			_vm->_dialogs->displayText("You're already stark naked!");
+		else if (_vm->_gyro->_avvysInTheCupboard) {
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
+			_vm->_dialogs->displayText(tmpStr);
+			_vm->_gyro->_wearing = kNothing;
+			_vm->_lucerna->refreshObjectList();
+		} else
+			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
+		break;
+	case kVerbCodeWear:
+		if (isHolding()) { // Wear something.
+			switch (_thing) {
+			case Gyro::kObjectChastity:
+				// \? are used to avoid that ??! is parsed as a trigraph
+				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
+				break;
+			case Gyro::kObjectClothes:
+			case Gyro::kObjectHabit: { // Change this!
+				if (_vm->_gyro->_wearing != kNothing) {
+					if (_vm->_gyro->_wearing == _thing)
+						_vm->_dialogs->displayText("You're already wearing that.");
+					else
+						_vm->_dialogs->displayText("You'll be rather warm wearing two sets of clothes!");
+					return;
+				} else
+					_vm->_gyro->_wearing = _thing;
+
+				_vm->_lucerna->refreshObjectList();
+
+				byte i;
+				if (_thing == Gyro::kObjectHabit)
+					i = 3;
+				else
+					i = 0;
+				Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
+				if (spr->_id != i) {
+					int16 x = spr->_x;
+					int16 y = spr->_y;
+					spr->remove();
+					spr->init(i, true, _vm->_animation);
+					spr->appear(x, y, Animation::kDirLeft);
+					spr->_visible = false;
+				}
+				}
+				break;
+			default:
+				_vm->_dialogs->displayText(kWhat);
+			}
+		}
+		break;
+	case kVerbCodePlay:
+		if (_thing == kPardon) {
+			switch (_vm->_gyro->_room) { // They just typed "play"...
+			case kRoomArgentPub: // ...in the pub, => play Nim.
+				warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
+				// play_nim();
+				// The following parts are copied from play_nim().
+				// The player automatically wins the game everytime he wins, until I implement the mini-game.
+
+				if (_vm->_gyro->_wonNim) { // Already won the game.
+					_vm->_dialogs->displayScrollChain('Q', 6);
+					return;
+				}
+
+				if (!_vm->_gyro->_askedDogfoodAboutNim) {
+					_vm->_dialogs->displayScrollChain('q', 84);
+					return;
+				}
+
+				_vm->_dialogs->displayScrollChain('Q', 3);
+				_vm->_gyro->_playedNim++;
+
+				// You won - strange!
+				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
+				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_wonNim = true;
+				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
+				_vm->_lucerna->incScore(7); // 7 points for winning!
+
+				if (_vm->_gyro->_playedNim == 1)
+					_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
+
+				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
+				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
+					+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
+				break;
+			case kRoomMusicRoom:
+				playHarp();
+				break;
+			}
+		} else if (isHolding()) {
+			switch (_thing) {
+			case Gyro::kObjectLute :
+					_vm->_dialogs->displayScrollChain('U', 7);
+
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
+						_vm->_dialogs->displayScrollChain('U', 10);
+
+					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
+						_vm->_dialogs->displayScrollChain('U', 15);
+				break;
+			case 52:
+				if (_vm->_gyro->_room == kRoomMusicRoom)
+					playHarp();
+				else
+					_vm->_dialogs->displayText(kWhat);
+				break;
+			case 55:
+				if (_vm->_gyro->_room == kRoomArgentPub)
+					// play_nim();
+					warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
+				else
+					_vm->_dialogs->displayText(kWhat);
+				break;
+			default:
+				_vm->_dialogs->displayText(kWhat);
+			}
+		}
+		break;
+	case kVerbCodeRing:
+		if (isHolding()) {
+			if (_thing == Gyro::kObjectBell) {
+				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
+				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+					// \? are used to avoid that ??! is parsed as a trigraph
+					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
+			} else
+				_vm->_dialogs->displayText(kWhat);
+		}
+		break;
+	case kVerbCodeHelp:
+		// boot_help();
+		warning("STUB: Parser::doThat() - case kVerbCodehelp");
+		break;
+	case kVerbCodeLarrypass:
+		_vm->_dialogs->displayText("Wrong game!");
+		break;
+	case kVerbCodePhaon:
+		_vm->_dialogs->displayText("Hello, Phaon!");
+		break;
+	case kVerbCodeBoss:
+		// bosskey();
+		warning("STUB: Parser::doThat() - case kVerbCodeboss");
+		break;
+	case kVerbCodePee:
+		if (_vm->_gyro->setFlag('P')) {
+			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
+			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
+		} else {
+			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+			_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeCheat: {
+		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
+		_vm->_dialogs->displayText(tmpStr);
+		_vm->_gyro->_cheat = true;
+		}
+		break;
+	case kVerbCodeMagic:
+		if (_vm->_gyro->_avariciusTalk > 0)
+			_vm->_dialogs->displayScrollChain('q', 19);
+		else {
+			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
+				_vm->_dialogs->displayScrollChain('q', 17);
+				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
+					_vm->_dialogs->displayScrollChain('q', 18);
+				else {
+					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
+					spr->init(1, false, _vm->_animation); // Avaricius
+					_vm->_animation->appearPed(1, 3);
+					spr->walkTo(4);
+					spr->_callEachStepFl = true;
+					spr->_eachStepProc = Animation::kProcBackAndForth;
+					_vm->_gyro->_avariciusTalk = 14;
+					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
+				}
+			} else
+				_vm->_dialogs->displayText("Nothing appears to happen...");
+		}
+		break;
+	case kVerbCodeSmartAlec:
+		_vm->_dialogs->displayText("Listen, smart alec, that was just rhetoric.");
+		break;
+	case kVerbCodeExpletive:
+		switch (_vm->_gyro->_sworeNum) {
+		case 0: {
+			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
+				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
+			}
+			break;
+		case 1: {
+			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
+				"do things I tell you not to?%c%cDon't do it again!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
+			}
+			break;
+		default: {
+			_vm->_pingo->zonk();
+			// CHECKME: Weird character in string
+			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			_vm->_dialogs->displayText(tmpStr);
+			_vm->_lucerna->gameOver();
+			}
+		}
+		_vm->_gyro->_sworeNum++;
+		break;
+	case kVerbCodeListen:
+		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
+		else if (_vm->_gyro->_listen.empty())
+			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");
+		else
+			_vm->_dialogs->displayText(_vm->_gyro->_listen);
+		break;
+	case kVerbCodeBuy: // What are they trying to buy?
+		switch (_vm->_gyro->_room) {
+		case kRoomArgentPub:
+			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
+				switch (_thing) {
+				case 51:
+				case 53:
+				case 54:
+				case 58: // Beer, whisky, cider or mead.
+					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+						_vm->_dialogs->displayScrollChain('D', 15);
+						return;
+					}
+
+					if (_vm->_gyro->_teetotal)  {
+						_vm->_dialogs->displayScrollChain('D', 6);
+						return;
+					}
+
+					if (_vm->_gyro->_alcoholLevel == 0)
+						_vm->_lucerna->incScore(3);
+
+					_vm->_background->drawBackgroundSprite(-1, -1, 11);
+					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
+					_vm->_gyro->_drinking = _thing;
+
+					_vm->_background->drawBackgroundSprite(-1, -1, 9);
+					_vm->_gyro->_malagauche = 177;
+					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
+					break;
+				case 52:
+					examine();
+					break; // We have a right one here - buy Pepsi??!
+				case Gyro::kObjectWine:
+					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
+						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
+					else {
+						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+							_vm->_dialogs->displayScrollChain('D', 15);
+							return;
+						}
+
+						if (_vm->_gyro->_carryNum >= kCarryLimit) {
+							_vm->_dialogs->displayText("Your hands are full.");
+							return;
+						}
+
+						_vm->_background->drawBackgroundSprite(-1, -1, 11);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+						_vm->_dialogs->displayText(tmpStr);
+						if (_vm->_gyro->_alcoholLevel == 0)
+							_vm->_lucerna->incScore(3);
+						_vm->_background->drawBackgroundSprite(-1, -1, 9);
+						_vm->_gyro->_malagauche = 177;
+
+						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
+					}
+					break;
+				}
+			} else
+				_vm->_dialogs->displayScrollChain('D', 5); // Go to the bar!
+			break;
+
+		case kRoomOutsideDucks:
+			if (_vm->_animation->inField(5)) {
+				if (_thing == Gyro::kObjectOnion) {
+					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
+						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
+					else if (_vm->_gyro->_carryNum >= kCarryLimit)
+						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
+					else {
+						if (_vm->_gyro->_boughtOnion)
+							_vm->_dialogs->displayScrollChain('D', 11);
+						else {
+							_vm->_dialogs->displayScrollChain('D', 9);
+							_vm->_lucerna->incScore(3);
+						}
+						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
+						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
+						_vm->_lucerna->refreshObjectList();
+						_vm->_gyro->_boughtOnion = true;
+						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_gyro->_onionInVinegar = false;
+					}
+				} else
+					_vm->_dialogs->displayScrollChain('D', 0);
+			} else
+				_vm->_dialogs->displayScrollChain('D', 0);
+			break;
+
+		case kRoomNottsPub:
+			_vm->_dialogs->displayScrollChain('n', 15); // Can't sell to southerners.
+			break;
+		default:
+			_vm->_dialogs->displayScrollChain('D', 0); // Can't buy that.
+		}
+		break;
+	case kVerbCodeAttack:
+		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
+			((_person == Gyro::kPeopleCwytalot) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) &&
+			(_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
+			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
+				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
+			case 0:
+				_vm->_dialogs->displayScrollChain('Q', 10);
+				_vm->_dialogs->displayText("(At the very least, don't use your bare hands!)");
+				break;
+			case 1:
+				_vm->_dialogs->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
+				break;
+			case 2:
+				_vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
+				break;
+			case 3:
+				_vm->_dialogs->displayScrollChain('Q', 11);
+				_vm->_gyro->_cwytalotGone = true;
+				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
+				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
+				_vm->_lucerna->refreshObjectList();
+				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
+				_vm->_lucerna->incScore(7);
+				_vm->_animation->_sprites[1].walkTo(1);
+				_vm->_animation->_sprites[1]._vanishIfStill = true;
+				_vm->_animation->_sprites[1]._callEachStepFl = false;
+				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy;
+				break;
+			default:
+				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
+			}
+		} else
+			_vm->_dialogs->displayScrollChain('Q', 10);
+		break;
+	case kVerbCodePasswd:
+		if (_vm->_gyro->_room != kRoomBridge)
+			_vm->_dialogs->displayScrollChain('Q', 12);
+		else {
+			bool ok = true;
+			for (uint i = 0; i < _thats.size(); i++) {
+				Common::String temp = _realWords[i];
+				temp.toUppercase();
+				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
+				for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
+					if (_vocabulary[pwdId]._word[j] != temp[j])
+						ok = false;
+				}
+			}
+
+			if (ok) {
+				if (_vm->_gyro->_drawbridgeOpen != 0)
+					_vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again.");
+				else {
+					_vm->_lucerna->incScore(4);
+					_vm->_dialogs->displayText("The drawbridge opens!");
+					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
+					_vm->_gyro->_drawbridgeOpen = 1;
+				}
+			} else
+				_vm->_dialogs->displayScrollChain('Q', 12);
+		}
+		break;
+	case kVerbCodeDir:
+		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
+		break;
+	case kVerbCodeDie:
+		_vm->_lucerna->gameOver();
+		break;
+	case kVerbCodeScore: {
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
+		_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodePut:
+		putProc();
+		break;
+	case kVerbCodeStand:
+		standUp();
+		break;
+	case kVerbCodeKiss:
+		if (_person == kPardon)
+			_vm->_dialogs->displayText("Kiss whom?");
+		else if (isPersonHere()) {
+			switch (_person) {
+			case Gyro::kPeopleArkata:
+				_vm->_dialogs->displayScrollChain('U', 12);
+				break;
+			case Gyro::kPeopleGeida:
+				_vm->_dialogs->displayScrollChain('U', 13);
+				break;
+			case Gyro::kPeopleWisewoman:
+				_vm->_dialogs->displayScrollChain('U', 14);
+				break;
+			default:
+				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
+			}
+		} else if ((Gyro::kPeopleAvalot <= _person) && (_person < Gyro::kPeopleArkata))
+			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
+
+		break;
+	case kVerbCodeClimb:
+		if (_vm->_gyro->_room == kRoomInsideCardiffCastle)
+			cardiffClimbing();
+		else // In the wrong room!
+			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
+		break;
+	case kVerbCodeJump:
+		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
+		_vm->_gyro->_userMovesAvvy = false;
+		break;
+	case kVerbCodeHiscores:
+		//	show_highs();
+		warning("STUB: Parser::doThat() - case kVerbCodehighscores");
+		break;
+	case kVerbCodeWake:
+		if (isPersonHere())
+			switch (_person) {
+			case kPardon:
+			case Gyro::kPeopleAvalot:
+			case 0:
+				if (!_vm->_gyro->_avvyIsAwake) {
+					_vm->_gyro->_avvyIsAwake = true;
+					_vm->_lucerna->incScore(1);
+					_vm->_gyro->_avvyInBed = true;
+					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
+					if (_vm->_gyro->_teetotal)
+						_vm->_dialogs->displayScrollChain('d', 13);
+				} else
+					_vm->_dialogs->displayText("You're already awake, Avvy!");
+				break;
+			case Gyro::kPeopleAyles:
+				if (!_vm->_gyro->_aylesIsAwake)
+					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
+				break;
+			case Gyro::kPeopleJacques: {
+				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
+					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+				_vm->_dialogs->displayText(tmpStr);
+				}
+				break;
+			default:
+				_vm->_dialogs->displayText("It's difficult to awaken people who aren't asleep...!");
+		}
+		break;
+	case kVerbCodeSit:
+		if (_vm->_gyro->_room == kRoomNottsPub) {
+			if (_vm->_gyro->_sittingInPub)
+				_vm->_dialogs->displayText("You're already sitting!");
+			else {
+				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
+				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
+			}
+		} else { // Default doodah.
+			_vm->_lucerna->dusk();
+			_vm->_gyro->hangAroundForAWhile();
+			_vm->_lucerna->dawn();
+			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
+			_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeRestart:
+		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
+			_vm->_lucerna->dusk();
+			_vm->_gyro->newGame();
+			_vm->_lucerna->dawn();
+		}
+		break;
+	case kPardon:
+		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
+		break;
+	case kVerbCodeHello: {
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("Hello.%c", Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	case kVerbCodeThanks: {
+		Common::String tmpStr = personSpeaks();
+		tmpStr += Common::String::format("That's OK.%c", Dialogs::kControlSpeechBubble);
+		_vm->_dialogs->displayText(tmpStr);
+		}
+		break;
+	default:
+		Common::String tmpStr = Common::String::format("%cParser bug!", Dialogs::kControlBell);
+		_vm->_dialogs->displayText(tmpStr);
+	}
+}
+
+void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
+	switch (verb) {
+	case kVerbCodeExam:
+		answer = "Examine";
+		ansKey = 'x';
+		break; // The ubiquitous one.
+	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
+	case kVerbCodeDrink:
+		answer = "Drink";
+		ansKey = 'D';
+		break;
+	case kVerbCodeWear:
+		answer = "Wear";
+		ansKey = 'W';
+		break;
+	case kVerbCodeRing:
+		answer = "Ring";
+		ansKey = 'R';
+		break; // Only the bell!
+	case kVerbCodePlay:
+		answer = "Play";
+		ansKey = 'P';
+		break;
+	case kVerbCodeEat:
+		answer = "Eat";
+		ansKey = 'E';
+		break;
+	default:
+		answer = "? Unknown!"; // Bug!
+		ansKey = '?';
+	}
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index b6ee046..1084c01 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -29,12 +29,49 @@
 #define AVALANCHE_PARSER_H
 
 #include "common/events.h"
+#include "common/scummsys.h"
+#include "common/str.h"
+
 
 namespace Avalanche {
 class AvalancheEngine;
 
 class Parser {
 public:
+	enum VerbCode {
+		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
+		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
+		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
+		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
+		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
+		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
+		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
+		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
+		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
+		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
+	};
+
+	static const byte kPardon = 254; // Didn't understand / wasn't given.
+	static const int16 kParserWordsNum = 277; // How many words does the parser know?
+	static const byte kNothing = 250;
+	static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
+	static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+
+	struct VocabEntry {
+		byte _number;
+		Common::String _word;
+
+		void init(byte number, Common::String word) {
+			_number = number;
+			_word = word;
+		}
+	};
+
+	VocabEntry _vocabulary[kParserWordsNum];
+
+	Common::String _realWords[11];
+	byte _verb, _person, _thing;
+	bool _polite;
 	Common::String _inputText; // Original name: current
 	Common::String _inputTextBackup;
 	byte _inputTextPos; // Original name: curpos
@@ -45,6 +82,11 @@ public:
 	Parser(AvalancheEngine *vm);
 
 	void init();
+	void parse();
+	void doThat();
+	void verbOpt(byte verb, Common::String &answer, char &ansKey);
+	void drink();
+
 	void handleInputText(const Common::Event &event);
 	void handleBackspace();
 	void handleReturn();
@@ -53,11 +95,59 @@ public:
 	void cursorOn();
 	void cursorOff();
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
-	int16 pos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+	int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
 
 private:
 	AvalancheEngine *_vm;
 
+	struct RankType {
+		uint16 _score;
+		Common::String _title;
+	};
+
+	Common::String _thats;
+	byte _thing2;
+
+	byte wordNum(Common::String word);
+	void replace(Common::String oldChars, byte newChar);
+
+	Common::String rank();
+	Common::String totalTime();
+
+	void clearWords();
+	void cheatParse(Common::String codes);
+	void stripPunctuation(Common::String &word); // Strips punctuation from word.
+	void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
+	bool doPronouns();
+	void properNouns();
+	void lookAround(); // This is called when you say "look".
+	void sayIt();  // This makes Avalot say the response.
+	void openDoor();
+	void storeInterrogation(byte interrogation);
+	void examineObject(); // Examine a standard object-thing
+	bool isPersonHere();
+	void exampers();
+	bool isHolding();
+	void openBox(bool isOpening);
+	void examine();
+	void inventory();
+	void swallow();
+	void peopleInRoom(); // This lists the other people in the room.
+	void silly();
+	void putProc();  // Called when you call kVerbCodeput.
+	void notInOrder();
+	void goToCauldron();
+	bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
+	void cardiffClimbing();
+	void already();
+	void standUp(); // Called when you ask Avvy to stand.
+	void getProc(char thing);
+	void giveGeidaTheLute();
+	void playHarp();
+	void winSequence();
+	Common::String personSpeaks();
+	void heyThanks();
+
 	void drawCursor();
 	void wipeText();
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index c76c989..b40731a 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -32,7 +32,6 @@
 #include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
 #include "avalanche/dialogs.h"
-#include "avalanche/acci.h"
 #include "avalanche/sequence.h"
 #include "avalanche/pingo.h"
 
@@ -513,7 +512,7 @@ void Timer::buyDrinks() {
 	_vm->_dialogs->displayScrollChain('D', 1); // That'll be thruppence.
 	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
 		_vm->_dialogs->displayScrollChain('D', 3); // Tell 'em you paid up.
-	_vm->_acci->drink();
+	_vm->_parser->drink();
 }
 
 void Timer::buyWine() {
@@ -660,7 +659,7 @@ void Timer::winning() {
 #endif
 	// TODO: To be implemented with Pingo::winningPic().
 
-	_vm->_lucerna->callVerb(Acci::kVerbCodeScore);
+	_vm->_lucerna->callVerb(Parser::kVerbCodeScore);
 	_vm->_dialogs->displayText(" T H E    E N D ");
 	_vm->_gyro->_letMeOut = true;
 }


Commit: 183f10e4a08dfe714b49866b079beffd98cafffc
    https://github.com/scummvm/scummvm/commit/183f10e4a08dfe714b49866b079beffd98cafffc
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T10:12:44-07:00

Commit Message:
AVALANCHE: Simplify Sequence::firstShow().

Changed paths:
    engines/avalanche/sequence.cpp



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index cb6bd06..871a385 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -43,12 +43,10 @@ Sequence::Sequence(AvalancheEngine *vm) {
 }
 
 void Sequence::firstShow(byte what) {
-	// First, we need to blank out the entire array.
-	for (uint i = 0; i < sizeof(_seq); i++)
-		_seq[i] = 0;
+	_seq[0] = what;
 
-	// Then it's just the same as thenShow.
-	thenShow(what);
+	for (uint i = 1; i < kSeqLength; i++)
+		_seq[i] = 0;
 }
 
 void Sequence::thenShow(byte what) {


Commit: ed7e71d226fa833577bba1939b3bc034a0ad877a
    https://github.com/scummvm/scummvm/commit/ed7e71d226fa833577bba1939b3bc034a0ad877a
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T10:22:21-07:00

Commit Message:
AVALANCHE: Some revision in Sequence.

Changed paths:
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 871a385..a17200e 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -77,7 +77,9 @@ void Sequence::startToOpen() {
 }
 
 void Sequence::shoveLeft() {
-	memcpy(_seq, _seq+1, kSeqLength - 1); // Shift everything to the left.
+	for (uint i = 0; i < kSeqLength - 1; i++)
+		_seq[i] = _seq[i + 1];
+	_seq[kSeqLength - 1] = 0;
 }
 
 void Sequence::callSequencer() {
@@ -93,8 +95,7 @@ void Sequence::callSequencer() {
 		break;
 	}
 
-	if ((_seq[0] >= 1) && (_seq[0] <= 176)) {
-		// Show a frame.
+	if (_seq[0] <= 176) { // Show a frame.
 		_vm->_background->drawBackgroundSprite(-1, -1, _seq[0] - 1);
 		shoveLeft();
 	}
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 67650d5..c1461c6 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -54,7 +54,7 @@ public:
 private:
 	AvalancheEngine *_vm;
 
-	void shoveLeft(); // This PROC is called by Timer when it's time to do another frame.
+	void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
 };
 
 } // End of namespace Avalanche.


Commit: 89471e76d1177f2cbe5f2b638fe69559de85b84f
    https://github.com/scummvm/scummvm/commit/89471e76d1177f2cbe5f2b638fe69559de85b84f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T10:30:37-07:00

Commit Message:
AVALANCHE: More revision in Sequence.

Changed paths:
    engines/avalanche/sequence.cpp



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index a17200e..712275e 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -83,20 +83,22 @@ void Sequence::shoveLeft() {
 }
 
 void Sequence::callSequencer() {
-	switch (_seq[0]) {
+	byte curSeq = _seq[0];
+
+	switch (curSeq) {
 	case 0:
 		return; // No more routines.
 		break;
 	case 177: // Flip room.
 		_vm->_gyro->_userMovesAvvy = true;
 		_vm->_animation->flipRoom(_vm->_gyro->_flipToWhere, _vm->_gyro->_flipToPed);
-		if (_seq[0] == 177)
+		if (curSeq == 177)
 			shoveLeft();
 		break;
 	}
 
-	if (_seq[0] <= 176) { // Show a frame.
-		_vm->_background->drawBackgroundSprite(-1, -1, _seq[0] - 1);
+	if (curSeq <= 176) { // Show a frame.
+		_vm->_background->drawBackgroundSprite(-1, -1, curSeq - 1);
 		shoveLeft();
 	}
 


Commit: 4b4f07a7f6e8643080de8048d94e7d22bc7f3753
    https://github.com/scummvm/scummvm/commit/4b4f07a7f6e8643080de8048d94e7d22bc7f3753
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T13:28:48-07:00

Commit Message:
AVALANCHE: Merge Gyro, Lucerna and Avalot

Changed paths:
  R engines/avalanche/gyro.cpp
  R engines/avalanche/gyro.h
  R engines/avalanche/lucerna.cpp
  R engines/avalanche/lucerna.h
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/background.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/module.mk
    engines/avalanche/parser.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index d274591..0593b04 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -30,8 +30,6 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/animation.h"
 #include "avalanche/dialogs.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
 #include "avalanche/background.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
@@ -149,8 +147,8 @@ void AnimationType::turn(byte whichway) {
 void AnimationType::appear(int16 wx, int16 wy, byte wf) {
 	_x = (wx / 8) * 8;
 	_y = wy;
-	_oldX[_anim->_vm->_gyro->_cp] = wx;
-	_oldY[_anim->_vm->_gyro->_cp] = wy;
+	_oldX[_anim->_vm->_avalot->_cp] = wx;
+	_oldY[_anim->_vm->_avalot->_cp] = wy;
 	turn(wf);
 	_visible = true;
 	_moveX = 0;
@@ -182,9 +180,9 @@ void AnimationType::walk() {
 		r._y2 = _y + _info._yLength + 2;
 	}
 
-	if (!_anim->_vm->_gyro->_doingSpriteRun) {
-		_oldX[_anim->_vm->_gyro->_cp] = _x;
-		_oldY[_anim->_vm->_gyro->_cp] = _y;
+	if (!_anim->_vm->_avalot->_doingSpriteRun) {
+		_oldX[_anim->_vm->_avalot->_cp] = _x;
+		_oldY[_anim->_vm->_avalot->_cp] = _y;
 		if (_homing)
 			homeStep();
 		_x += _moveX;
@@ -197,40 +195,40 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_gyro->_cp], _y, _info._yLength) - 1;
+		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_avalot->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((magicColor != 255) & (!_anim->_vm->_gyro->_doingSpriteRun)) {
-			MagicType *magic = &_anim->_vm->_gyro->_magics[magicColor];
+		if ((magicColor != 255) & (!_anim->_vm->_avalot->_doingSpriteRun)) {
+			MagicType *magic = &_anim->_vm->_avalot->_magics[magicColor];
 			switch (magic->_operation) {
-			case Gyro::kMagicExclaim:
+			case Avalot::kMagicExclaim:
 				bounce();
 				_anim->_mustExclaim = true;
 				_anim->_sayWhat = magic->_data;
 				break;
-			case Gyro::kMagicBounce:
+			case Avalot::kMagicBounce:
 				bounce();
 				break;
-			case Gyro::kMagicTransport:
+			case Avalot::kMagicTransport:
 				_anim->flipRoom(magic->_data >> 8, magic->_data & 0xff);
 				break;
-			case Gyro::kMagicUnfinished: {
+			case Avalot::kMagicUnfinished: {
 				bounce();
 				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Dialogs::kControlBell, Dialogs::kControlCenter, Dialogs::kControlRoman);
 				_anim->_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
-			case Gyro::kMagicSpecial:
+			case Avalot::kMagicSpecial:
 				_anim->callSpecial(magic->_data);
 				break;
-			case Gyro::kMagicOpenDoor:
+			case Avalot::kMagicOpenDoor:
 				_anim->openDoor(magic->_data >> 8, magic->_data & 0xff, magicColor);
 				break;
 			}
 		}
 	}
 
-	if (!_anim->_vm->_gyro->_doingSpriteRun) {
+	if (!_anim->_vm->_avalot->_doingSpriteRun) {
 		_count++;
 		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
 			_stepNum++;
@@ -242,13 +240,13 @@ void AnimationType::walk() {
 }
 
 void AnimationType::bounce() {
-	_x = _oldX[_anim->_vm->_gyro->_cp];
-	_y = _oldY[_anim->_vm->_gyro->_cp];
+	_x = _oldX[_anim->_vm->_avalot->_cp];
+	_y = _oldY[_anim->_vm->_avalot->_cp];
 	if (_doCheck)
 		_anim->stopWalking();
 	else
 		stopWalk();
-	_anim->_vm->_lucerna->drawDirection();
+	_anim->_vm->_avalot->drawDirection();
 }
 
 int8 AnimationType::getSign(int16 val) {
@@ -261,7 +259,7 @@ int8 AnimationType::getSign(int16 val) {
 }
 
 void AnimationType::walkTo(byte pedNum) {
-	PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum];
+	PedType *curPed = &_anim->_vm->_avalot->_peds[pedNum];
 
 	setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y));
 	_homingX = curPed->_x - _info._xLength / 2;
@@ -329,10 +327,10 @@ void AnimationType::stopWalk() {
 }
 
 void AnimationType::chatter() {
-	_anim->_vm->_gyro->_talkX = _x + _info._xLength / 2;
-	_anim->_vm->_gyro->_talkY = _y;
-	_anim->_vm->_gyro->_talkFontColor = _stat._fgBubbleCol;
-	_anim->_vm->_gyro->_talkBackgroundColor = _stat._bgBubbleCol;
+	_anim->_vm->_avalot->_talkX = _x + _info._xLength / 2;
+	_anim->_vm->_avalot->_talkY = _y;
+	_anim->_vm->_avalot->_talkFontColor = _stat._fgBubbleCol;
+	_anim->_vm->_avalot->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
 void AnimationType::remove() {
@@ -370,7 +368,7 @@ void Animation::loadAnims() {
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	if (!_vm->_gyro->_alive)
+	if (!_vm->_avalot->_alive)
 		return 0;
 
 	if (x1 < 0)
@@ -415,8 +413,8 @@ void Animation::catacombMove(byte ped) {
 
 	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 	// catacombs has a different number for it.
-	xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256;
-	_vm->_gyro->_geidaSpin = 0;
+	xy_uint16 = _vm->_avalot->_catacombX + _vm->_avalot->_catacombY * 256;
+	_vm->_avalot->_geidaSpin = 0;
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
@@ -435,78 +433,78 @@ void Animation::catacombMove(byte ped) {
 	case 2307:
 		flipRoom(kRoomLusties, 5);
 		_vm->_dialogs->displayText("Oh no... here we go again...");
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
 		_sprites[0]._moveX = 0;
 		return;
 	}
 
-	if (!_vm->_gyro->_enterCatacombsFromLustiesRoom)
-		_vm->_lucerna->loadRoom(29);
-	here = _vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1];
+	if (!_vm->_avalot->_enterCatacombsFromLustiesRoom)
+		_vm->_avalot->loadRoom(29);
+	here = _vm->_avalot->kCatacombMap[_vm->_avalot->_catacombY - 1][_vm->_avalot->_catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
 		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
 		_vm->_background->drawBackgroundSprite(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // No door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // No door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
 		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[2]._operation = Gyro::kMagicSpecial; // Straight wall.
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // Sloping wall.
+		_vm->_avalot->_magics[2]._operation = Avalot::kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -514,127 +512,127 @@ void Animation::catacombMove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...door, and...
 		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // No door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // No door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
 		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door, and...
 		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_gyro->_magics[4]._operation = Gyro::kMagicNothing; // Sloping wall.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicSpecial; // Straight wall.
-		_vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[4]._operation = Avalot::kMagicNothing; // Sloping wall.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicSpecial; // Straight wall.
+		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
 		break;
 	}
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
+		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_background->drawBackgroundSprite(-1, -1, 21);
 
-		if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows))
-			_vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
+		if ((xy_uint16 == 2051) && (_vm->_avalot->_geidaFollows))
+			_vm->_avalot->_magics[12]._operation = Avalot::kMagicExclaim;
 		else
-			_vm->_gyro->_magics[12]._operation = Gyro::kMagicSpecial; // Right exit south.
+			_vm->_avalot->_magics[12]._operation = Avalot::kMagicSpecial; // Right exit south.
 
-		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
+		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_background->drawBackgroundSprite(-1, -1, 22);
-		_vm->_gyro->_magics[6]._operation = Gyro::kMagicSpecial; // Middle exit south.
-		_vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
+		_vm->_avalot->_magics[6]._operation = Avalot::kMagicSpecial; // Middle exit south.
+		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_background->drawBackgroundSprite(-1, -1, 23);
-		_vm->_gyro->_magics[11]._operation = Gyro::kMagicSpecial; // Left exit south.
-		_vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce;
+		_vm->_avalot->_magics[11]._operation = Avalot::kMagicSpecial; // Left exit south.
+		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
 		break;
 	// LEFT handles:
 #if 0
 	case 0x1:
 		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
 		break;
 #endif
 	case 0x2:
 		_vm->_background->drawBackgroundSprite(-1, -1, 3);
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
 		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Right exit north. } { Change magic number! }
+		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
 		break;
 	// RIGHT handles:
 	case 0x4:
 		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Left exit north. } { Change magic number! }
+		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
 		break;
 #endif
 	case 0x5:
 		_vm->_background->drawBackgroundSprite(-1, -1, 2);
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north.
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
 		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
-		_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
+		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Right exit north. }
+		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
 		break;
 #endif
 	// ARCHWAYS:
@@ -648,25 +646,25 @@ void Animation::catacombMove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_background->drawBackgroundSprite(-1, -1, 31);
 
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north.
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicSpecial; // Middle arch north.
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
 		break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce;
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_gyro->_magics[0]._operation = Gyro::kMagicNothing; // Door to Geida's room.
+		_vm->_avalot->_magics[0]._operation = Avalot::kMagicNothing; // Door to Geida's room.
 		_vm->_background->drawBackgroundSprite(-1, -1, 0);
-		_vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door.
+		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
 	}
 
@@ -702,7 +700,7 @@ void Animation::catacombMove(byte ped) {
 		break; // [1,1] : the other two.
 	}
 
-	if ((_vm->_gyro->_geidaFollows) && (ped > 0)) {
+	if ((_vm->_avalot->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
 		appearPed(1, geidaPed(ped));
@@ -711,36 +709,36 @@ void Animation::catacombMove(byte ped) {
 	}
 }
 
-// This proc gets called whenever you touch a line defined as _vm->_gyro->special.
+// This proc gets called whenever you touch a line defined as _vm->_avalot->special.
 void Animation::dawnDelay() {
 	_vm->_timer->addTimer(2, Timer::kProcDawnDelay, Timer::kReasonDawndelay);
 }
 
 void Animation::callSpecial(uint16 which) {
 	switch (which) {
-	case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
+	case 1: // _vm->_avalot->special 1: Room 22: top of stairs.
 		_vm->_background->drawBackgroundSprite(-1, -1, 0);
-		_vm->_gyro->_brummieStairs = 1;
-		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
+		_vm->_avalot->_brummieStairs = 1;
+		_vm->_avalot->_magics[9]._operation = Avalot::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
 		stopWalking();
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_userMovesAvvy = false;
 		break;
-	case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs.
-		_vm->_gyro->_brummieStairs = 3;
-		_vm->_gyro->_magics[10]._operation = Gyro::kMagicNothing;
-		_vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim;
-		_vm->_gyro->_magics[11]._data = 5;
-		_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
+	case 2: // _vm->_avalot->special 2: Room 22: bottom of stairs.
+		_vm->_avalot->_brummieStairs = 3;
+		_vm->_avalot->_magics[10]._operation = Avalot::kMagicNothing;
+		_vm->_avalot->_magics[11]._operation = Avalot::kMagicExclaim;
+		_vm->_avalot->_magics[11]._data = 5;
+		_vm->_avalot->_magics[3]._operation = Avalot::kMagicBounce; // Now works as planned!
 		stopWalking();
 		_vm->_dialogs->displayScrollChain('q', 26);
-		_vm->_gyro->_userMovesAvvy = true;
+		_vm->_avalot->_userMovesAvvy = true;
 		break;
-	case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
+	case 3: // _vm->_avalot->special 3: Room 71: triggers dart.
 		_sprites[0].bounce(); // Must include that.
 
-		if (!_vm->_gyro->_arrowTriggered) {
-			_vm->_gyro->_arrowTriggered = true;
+		if (!_vm->_avalot->_arrowTriggered) {
+			_vm->_avalot->_arrowTriggered = true;
 			appearPed(1, 3); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
@@ -754,80 +752,80 @@ void Animation::callSpecial(uint16 which) {
 		}
 		break;
 	case 4: // This is the ghost room link.
-		_vm->_lucerna->dusk();
+		_vm->_avalot->dusk();
 		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
 		//_vm->_enid->backToBootstrap(3); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		if (_vm->_gyro->_friarWillTieYouUp) {
-			// _vm->_gyro->special 5: Room 42: touched tree, and get tied up.
-			_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
+		if (_vm->_avalot->_friarWillTieYouUp) {
+			// _vm->_avalot->special 5: Room 42: touched tree, and get tied up.
+			_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Boundary effect is now working again.
 			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_dialogs->displayScrollChain('q', 36);
-			_vm->_gyro->_tiedUp = true;
-			_vm->_gyro->_friarWillTieYouUp = false;
+			_vm->_avalot->_tiedUp = true;
+			_vm->_avalot->_friarWillTieYouUp = false;
 			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
+			_vm->_avalot->_whereIs[Avalot::kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
-	case 6: // _vm->_gyro->special 6: fall down oubliette.
-		_vm->_gyro->_userMovesAvvy = false;
+	case 6: // _vm->_avalot->special 6: fall down oubliette.
+		_vm->_avalot->_userMovesAvvy = false;
 		_sprites[0]._moveX = 3;
 		_sprites[0]._moveY = 0;
 		_sprites[0]._facingDir = kDirRight;
 		_vm->_timer->addTimer(1, Timer::kProcFallDownOubliette, Timer::kReasonFallingDownOubliette);
 		break;
-	case 7: // _vm->_gyro->special 7: stop falling down oubliette.
+	case 7: // _vm->_avalot->special 7: stop falling down oubliette.
 		_sprites[0]._visible = false;
-		_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
+		_vm->_avalot->_magics[9]._operation = Avalot::kMagicNothing;
 		stopWalking();
 		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
-		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
-		//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
+		//_vm->_avalot->mblit(12, 80, 38, 160, 3, 0);
+		//_vm->_avalot->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_dialogs->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
-	case 8:        // _vm->_gyro->special 8: leave du Lustie's room.
-		if ((_vm->_gyro->_geidaFollows) && (!_vm->_gyro->_lustieIsAsleep)) {
+	case 8:        // _vm->_avalot->special 8: leave du Lustie's room.
+		if ((_vm->_avalot->_geidaFollows) && (!_vm->_avalot->_lustieIsAsleep)) {
 			_vm->_dialogs->displayScrollChain('q', 63);
 			_sprites[1].turn(kDirDown);
 			_sprites[1].stopWalk();
 			_sprites[1]._callEachStepFl = false; // Geida
-			_vm->_lucerna->gameOver();
+			_vm->_avalot->gameOver();
 		}
 		break;
-	case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood...
-		if (!_vm->_gyro->_geidaFollows)
+	case 9: // _vm->_avalot->special 9: lose Geida to Robin Hood...
+		if (!_vm->_avalot->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
 		_sprites[1].walkTo(3); // She walks to somewhere...
 		_sprites[0].remove();     // Lose Avvy.
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
 		break;
-	case 10: // _vm->_gyro->special 10: transfer north in catacombs.
-		if ((_vm->_gyro->_catacombX == 4) && (_vm->_gyro->_catacombY == 1)) {
+	case 10: // _vm->_avalot->special 10: transfer north in catacombs.
+		if ((_vm->_avalot->_catacombX == 4) && (_vm->_avalot->_catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_gyro->_objects[Gyro::kObjectKey - 1])
+			if (_vm->_avalot->_objects[Avalot::kObjectKey - 1])
 				_vm->_dialogs->displayScrollChain('q', 62);
 			else {
 				_vm->_dialogs->displayScrollChain('q', 61);
 				return;
 			}
 		}
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_catacombY--;
+		_vm->_avalot->dusk();
+		_vm->_avalot->_catacombY--;
 		catacombMove(4);
-		if (_vm->_gyro->_room != kRoomCatacombs)
+		if (_vm->_avalot->_room != kRoomCatacombs)
 			return;
-		switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) {
+		switch ((_vm->_avalot->kCatacombMap[_vm->_avalot->_catacombY - 1][_vm->_avalot->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			appearPed(0, 11);
 			break;
@@ -839,29 +837,29 @@ void Animation::callSpecial(uint16 which) {
 		}
 		dawnDelay();
 		break;
-	case 11: // _vm->_gyro->special 11: transfer east in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_catacombX++;
+	case 11: // _vm->_avalot->special 11: transfer east in catacombs.
+		_vm->_avalot->dusk();
+		_vm->_avalot->_catacombX++;
 		catacombMove(1);
-		if (_vm->_gyro->_room != kRoomCatacombs)
+		if (_vm->_avalot->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 0);
 		dawnDelay();
 		break;
-	case 12: // _vm->_gyro->special 12: transfer south in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_catacombY += 1;
+	case 12: // _vm->_avalot->special 12: transfer south in catacombs.
+		_vm->_avalot->dusk();
+		_vm->_avalot->_catacombY += 1;
 		catacombMove(2);
-		if (_vm->_gyro->_room != kRoomCatacombs)
+		if (_vm->_avalot->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 1);
 		dawnDelay();
 		break;
-	case 13: // _vm->_gyro->special 13: transfer west in catacombs.
-		_vm->_lucerna->dusk();
-		_vm->_gyro->_catacombX--;
+	case 13: // _vm->_avalot->special 13: transfer west in catacombs.
+		_vm->_avalot->dusk();
+		_vm->_avalot->_catacombX--;
 		catacombMove(3);
-		if (_vm->_gyro->_room != kRoomCatacombs)
+		if (_vm->_avalot->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 2);
 		dawnDelay();
@@ -877,7 +875,7 @@ void Animation::callSpecial(uint16 which) {
  * @remarks	Originally called 'open_the_door'
  */
 void Animation::openDoor(byte whither, byte ped, byte magicnum) {
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomOutsideYours:
 	case kRoomOutsideNottsPub:
 	case kRoomOutsideDucks:
@@ -904,7 +902,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
 	case kRoomLusties:
 		switch (magicnum) {
 		case 14:
-			if (_vm->_gyro->_avvysInTheCupboard) {
+			if (_vm->_avalot->_avvysInTheCupboard) {
 				hideInCupboard();
 				_vm->_sequence->firstShow(8);
 				_vm->_sequence->thenShow(7);
@@ -935,12 +933,12 @@ void Animation::updateSpeed() {
 
 	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
 
-	if (_sprites[0]._speedX == _vm->_gyro->kRun)
+	if (_sprites[0]._speedX == _vm->_avalot->kRun)
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	else
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
 
-	if (_sprites[0]._speedX == _vm->_gyro->kRun)
+	if (_sprites[0]._speedX == _vm->_avalot->kRun)
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 	else
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
@@ -977,7 +975,7 @@ void Animation::changeDirection(byte t, byte dir) {
 
 void Animation::appearPed(byte sprNum, byte pedNum) {
 	AnimationType *curSpr = &_sprites[sprNum];
-	PedType *curPed = &_vm->_gyro->_peds[pedNum];
+	PedType *curPed = &_vm->_avalot->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
 	changeDirection(sprNum, curPed->_direction);
 }
@@ -1037,15 +1035,15 @@ void Animation::arrowProcs(byte tripnum) {
 			_vm->_dialogs->displayScrollChain('Q', 47); // Complaint!
 			_sprites[tripnum].remove(); // Deallocate the arrow.
 
-			_vm->_lucerna->gameOver();
+			_vm->_avalot->gameOver();
 
-			_vm->_gyro->_userMovesAvvy = false; // Stop the user from moving him.
+			_vm->_avalot->_userMovesAvvy = false; // Stop the user from moving him.
 			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
 		_vm->_background->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door.
-		_vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up.
+		_vm->_avalot->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
 }
@@ -1088,21 +1086,21 @@ void Animation::spin(byte whichway, byte &tripnum) {
 		if (_sprites[tripnum]._id == 2)
 			return; // Not for Spludwick
 
-		_vm->_gyro->_geidaSpin += 1;
-		_vm->_gyro->_geidaTime = 20;
-		if (_vm->_gyro->_geidaSpin == 5) {
+		_vm->_avalot->_geidaSpin += 1;
+		_vm->_avalot->_geidaTime = 20;
+		if (_vm->_avalot->_geidaSpin == 5) {
 			_vm->_dialogs->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_gyro->_geidaSpin = 0;
-			_vm->_gyro->_geidaTime = 0; // knock out records
+			_vm->_avalot->_geidaSpin = 0;
+			_vm->_avalot->_geidaTime = 0; // knock out records
 		}
 	}
 }
 
 void Animation::geidaProcs(byte tripnum) {
-	if (_vm->_gyro->_geidaTime > 0) {
-		_vm->_gyro->_geidaTime--;
-		if (_vm->_gyro->_geidaTime == 0)
-			_vm->_gyro->_geidaSpin = 0;
+	if (_vm->_avalot->_geidaTime > 0) {
+		_vm->_avalot->_geidaTime--;
+		if (_vm->_avalot->_geidaTime == 0)
+			_vm->_avalot->_geidaSpin = 0;
 	}
 
 	if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
@@ -1178,7 +1176,7 @@ void Animation::drawSprites() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	if (_vm->_menu->isActive() | _vm->_gyro->_onToolbar | _vm->_gyro->_seeScroll)
+	if (_vm->_menu->isActive() | _vm->_avalot->_onToolbar | _vm->_avalot->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
@@ -1222,7 +1220,7 @@ void Animation::animLink() {
 void Animation::stopWalking() {
 	_sprites[0].stopWalk();
 	_direction = kDirStopped;
-	if (_vm->_gyro->_alive)
+	if (_vm->_avalot->_alive)
 		_sprites[0]._stepNum = 1;
 }
 
@@ -1231,16 +1229,16 @@ void Animation::stopWalking() {
  * @remarks	Originally called 'hide_in_the_cupboard'
  */
 void Animation::hideInCupboard() {
-	if (_vm->_gyro->_avvysInTheCupboard) {
-		if (_vm->_gyro->_wearing == Parser::kNothing) {
+	if (_vm->_avalot->_avvysInTheCupboard) {
+		if (_vm->_avalot->_wearing == Parser::kNothing) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			_sprites[0]._visible = true;
-			_vm->_gyro->_userMovesAvvy = true;
+			_vm->_avalot->_userMovesAvvy = true;
 			appearPed(0, 2); // Walk out of the cupboard.
 			_vm->_dialogs->displayText("You leave the cupboard. Nice to be out of there!");
-			_vm->_gyro->_avvysInTheCupboard = false;
+			_vm->_avalot->_avvysInTheCupboard = false;
 			_vm->_sequence->firstShow(8);
 			_vm->_sequence->thenShow(7);
 			_vm->_sequence->startToClose();
@@ -1248,65 +1246,65 @@ void Animation::hideInCupboard() {
 	} else {
 		// Not hiding in the cupboard
 		_sprites[0]._visible = false;
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Dialogs::kControlParagraph);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_gyro->_avvysInTheCupboard = true;
+		_vm->_avalot->_avvysInTheCupboard = true;
 		_vm->_background->drawBackgroundSprite(-1, -1, 7);
 	}
 }
 
 void Animation::flipRoom(byte room, byte ped) {
 	assert((ped > 0) && (ped < 15));
-	if (!_vm->_gyro->_alive) {
+	if (!_vm->_avalot->_alive) {
 		// You can't leave the room if you're dead.
 		_sprites[0]._moveX = 0;
 		_sprites[0]._moveY = 0; // Stop him from moving.
 		return;
 	}
 
-	if ((room == kRoomDummy) && (_vm->_gyro->_room == kRoomLusties)) {
+	if ((room == kRoomDummy) && (_vm->_avalot->_room == kRoomLusties)) {
 		hideInCupboard();
 		return;
 	}
 
-	if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == kRoomInsideCardiffCastle)) {
+	if ((_vm->_avalot->_jumpStatus > 0) && (_vm->_avalot->_room == kRoomInsideCardiffCastle)) {
 		// You can't *jump* out of Cardiff Castle!
 		_sprites[0]._moveX = 0;
 		return;
 	}
 
-	_vm->_lucerna->exitRoom(_vm->_gyro->_room);
-	_vm->_lucerna->dusk();
+	_vm->_avalot->exitRoom(_vm->_avalot->_room);
+	_vm->_avalot->dusk();
 
 	for (int16 i = 1; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick)
 			_sprites[i].remove();
 	} // Deallocate sprite
 
-	if (_vm->_gyro->_room == kRoomLustiesRoom)
-		_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
+	if (_vm->_avalot->_room == kRoomLustiesRoom)
+		_vm->_avalot->_enterCatacombsFromLustiesRoom = true;
 
-	_vm->_lucerna->enterRoom(room, ped);
+	_vm->_avalot->enterRoom(room, ped);
 	appearPed(0, ped - 1);
-	_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
+	_vm->_avalot->_enterCatacombsFromLustiesRoom = false;
 	_oldDirection = _direction;
 	_direction = _sprites[0]._facingDir;
-	_vm->_lucerna->drawDirection();
+	_vm->_avalot->drawDirection();
 
-	_vm->_lucerna->dawn();
+	_vm->_avalot->dawn();
 }
 
 bool Animation::inField(byte which) {
-	FieldType *curField = &_vm->_gyro->_fields[which];
+	FieldType *curField = &_vm->_avalot->_fields[which];
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
 
 	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
 bool Animation::nearDoor() {
-	if (_vm->_gyro->_fieldNum < 8) {
+	if (_vm->_avalot->_fieldNum < 8) {
 		// there ARE no doors here!
 		return false;
 	}
@@ -1314,8 +1312,8 @@ bool Animation::nearDoor() {
 	int16 ux = _sprites[0]._x;
 	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
 
-	for (int i = 8; i < _vm->_gyro->_fieldNum; i++) {
-		FieldType *curField = &_vm->_gyro->_fields[i];
+	for (int i = 8; i < _vm->_avalot->_fieldNum; i++) {
+		FieldType *curField = &_vm->_avalot->_fields[i];
 		if ((ux >= curField->_x1) && (ux <= curField->_x2) && (uy >= curField->_y1) && (uy <= curField->_y2))
 			return true;
 	}
@@ -1324,7 +1322,7 @@ bool Animation::nearDoor() {
 }
 
 void Animation::handleMoveKey(const Common::Event &event) {
-	if (!_vm->_gyro->_userMovesAvvy)
+	if (!_vm->_avalot->_userMovesAvvy)
 		return;
 
 	if (_vm->_menu->_activeMenuItem._activeNow)
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7dcf4a0..673280c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -64,14 +64,12 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _avalot;
 	delete _pingo;
 	delete _dialogs;
-	delete _lucerna;
 	delete _background;
 	delete _sequence;
 	delete _timer;
 	delete _animation;
 	delete _menu;
 	delete _closing;
-	delete _gyro;
 	delete _sound;
 }
 
@@ -80,10 +78,8 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_parser = new Parser(this);
 
 	_avalot = new Avalot(this);
-	_gyro = new Gyro(this);
 	_pingo = new Pingo(this);
 	_dialogs = new Dialogs(this);
-	_lucerna = new Lucerna(this);
 	_background = new Background(this);
 	_sequence = new Sequence(this);
 	_timer = new Timer(this);
@@ -94,7 +90,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 
 	_graphics->init();
 	_dialogs->init();
-	_lucerna->init();
+	_avalot->init();
 	_parser->init();
 
 	return Common::kNoError;
@@ -119,145 +115,145 @@ const char *AvalancheEngine::getCopyrightString() const {
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	//blockwrite(f, dna, sizeof(dna));
 	sz.syncAsByte(_animation->_direction);
-	sz.syncAsByte(_gyro->_carryNum);
+	sz.syncAsByte(_avalot->_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
-		sz.syncAsByte(_gyro->_objects[i]);
-	sz.syncAsSint16LE(_gyro->_dnascore);
-	sz.syncAsSint32LE(_gyro->_money);
-	sz.syncAsByte(_gyro->_room);
-	sz.syncAsByte(_gyro->_wearing);
-	sz.syncAsByte(_gyro->_sworeNum);
-	sz.syncAsByte(_gyro->_saveNum);
-	sz.syncBytes(_gyro->_roomCount, 100);
-	sz.syncAsByte(_gyro->_alcoholLevel);
-	sz.syncAsByte(_gyro->_playedNim);
-	sz.syncAsByte(_gyro->_wonNim);
-	sz.syncAsByte(_gyro->_wineState);
-	sz.syncAsByte(_gyro->_cwytalotGone);
-	sz.syncAsByte(_gyro->_passwordNum);
-	sz.syncAsByte(_gyro->_aylesIsAwake);
-	sz.syncAsByte(_gyro->_drawbridgeOpen);
-	sz.syncAsByte(_gyro->_avariciusTalk);
-	sz.syncAsByte(_gyro->_boughtOnion);
-	sz.syncAsByte(_gyro->_rottenOnion);
-	sz.syncAsByte(_gyro->_onionInVinegar);
-	sz.syncAsByte(_gyro->_givenToSpludwick);
-	sz.syncAsByte(_gyro->_brummieStairs);
-	sz.syncAsByte(_gyro->_cardiffQuestionNum);
-	sz.syncAsByte(_gyro->_passedCwytalotInHerts);
-	sz.syncAsByte(_gyro->_avvyIsAwake);
-	sz.syncAsByte(_gyro->_avvyInBed);
-	sz.syncAsByte(_gyro->_userMovesAvvy);
-	sz.syncAsByte(_gyro->_npcFacing);
-	sz.syncAsByte(_gyro->_givenBadgeToIby);
-	sz.syncAsByte(_gyro->_friarWillTieYouUp);
-	sz.syncAsByte(_gyro->_tiedUp);
-	sz.syncAsByte(_gyro->_boxContent);
-	sz.syncAsByte(_gyro->_talkedToCrapulus);
-	sz.syncAsByte(_gyro->_jacquesState);
-	sz.syncAsByte(_gyro->_bellsAreRinging);
-	sz.syncAsByte(_gyro->_standingOnDais);
-	sz.syncAsByte(_gyro->_takenPen);
-	sz.syncAsByte(_gyro->_arrowTriggered);
-	sz.syncAsByte(_gyro->_arrowInTheDoor);
+		sz.syncAsByte(_avalot->_objects[i]);
+	sz.syncAsSint16LE(_avalot->_dnascore);
+	sz.syncAsSint32LE(_avalot->_money);
+	sz.syncAsByte(_avalot->_room);
+	sz.syncAsByte(_avalot->_wearing);
+	sz.syncAsByte(_avalot->_sworeNum);
+	sz.syncAsByte(_avalot->_saveNum);
+	sz.syncBytes(_avalot->_roomCount, 100);
+	sz.syncAsByte(_avalot->_alcoholLevel);
+	sz.syncAsByte(_avalot->_playedNim);
+	sz.syncAsByte(_avalot->_wonNim);
+	sz.syncAsByte(_avalot->_wineState);
+	sz.syncAsByte(_avalot->_cwytalotGone);
+	sz.syncAsByte(_avalot->_passwordNum);
+	sz.syncAsByte(_avalot->_aylesIsAwake);
+	sz.syncAsByte(_avalot->_drawbridgeOpen);
+	sz.syncAsByte(_avalot->_avariciusTalk);
+	sz.syncAsByte(_avalot->_boughtOnion);
+	sz.syncAsByte(_avalot->_rottenOnion);
+	sz.syncAsByte(_avalot->_onionInVinegar);
+	sz.syncAsByte(_avalot->_givenToSpludwick);
+	sz.syncAsByte(_avalot->_brummieStairs);
+	sz.syncAsByte(_avalot->_cardiffQuestionNum);
+	sz.syncAsByte(_avalot->_passedCwytalotInHerts);
+	sz.syncAsByte(_avalot->_avvyIsAwake);
+	sz.syncAsByte(_avalot->_avvyInBed);
+	sz.syncAsByte(_avalot->_userMovesAvvy);
+	sz.syncAsByte(_avalot->_npcFacing);
+	sz.syncAsByte(_avalot->_givenBadgeToIby);
+	sz.syncAsByte(_avalot->_friarWillTieYouUp);
+	sz.syncAsByte(_avalot->_tiedUp);
+	sz.syncAsByte(_avalot->_boxContent);
+	sz.syncAsByte(_avalot->_talkedToCrapulus);
+	sz.syncAsByte(_avalot->_jacquesState);
+	sz.syncAsByte(_avalot->_bellsAreRinging);
+	sz.syncAsByte(_avalot->_standingOnDais);
+	sz.syncAsByte(_avalot->_takenPen);
+	sz.syncAsByte(_avalot->_arrowTriggered);
+	sz.syncAsByte(_avalot->_arrowInTheDoor);
 
 	if (sz.isSaving()) {
-		uint16 like2drinkSize = _gyro->_favouriteDrink.size();
+		uint16 like2drinkSize = _avalot->_favouriteDrink.size();
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
-			char actChr = _gyro->_favouriteDrink[i];
+			char actChr = _avalot->_favouriteDrink[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 favourite_songSize = _gyro->_favouriteSong.size();
+		uint16 favourite_songSize = _avalot->_favouriteSong.size();
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
-			char actChr = _gyro->_favouriteSong[i];
+			char actChr = _avalot->_favouriteSong[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 worst_place_on_earthSize = _gyro->_worstPlaceOnEarth.size();
+		uint16 worst_place_on_earthSize = _avalot->_worstPlaceOnEarth.size();
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
-			char actChr = _gyro->_worstPlaceOnEarth[i];
+			char actChr = _avalot->_worstPlaceOnEarth[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 spare_eveningSize = _gyro->_spareEvening.size();
+		uint16 spare_eveningSize = _avalot->_spareEvening.size();
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
-			char actChr = _gyro->_spareEvening[i];
+			char actChr = _avalot->_spareEvening[i];
 			sz.syncAsByte(actChr);
 		}
 	} else {
-		if (!_gyro->_favouriteDrink.empty())
-			_gyro->_favouriteDrink.clear();
+		if (!_avalot->_favouriteDrink.empty())
+			_avalot->_favouriteDrink.clear();
 		uint16 like2drinkSize = 0;
 		char actChr = ' ';
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_favouriteDrink += actChr;
+			_avalot->_favouriteDrink += actChr;
 		}
 
-		if (!_gyro->_favouriteSong.empty())
-			_gyro->_favouriteSong.clear();
+		if (!_avalot->_favouriteSong.empty())
+			_avalot->_favouriteSong.clear();
 		uint16 favourite_songSize = 0;
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_favouriteSong += actChr;
+			_avalot->_favouriteSong += actChr;
 		}
 
-		if (!_gyro->_worstPlaceOnEarth.empty())
-			_gyro->_worstPlaceOnEarth.clear();
+		if (!_avalot->_worstPlaceOnEarth.empty())
+			_avalot->_worstPlaceOnEarth.clear();
 		uint16 worst_place_on_earthSize = 0;
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_worstPlaceOnEarth += actChr;
+			_avalot->_worstPlaceOnEarth += actChr;
 		}
 
-		if (!_gyro->_spareEvening.empty())
-			_gyro->_spareEvening.clear();
+		if (!_avalot->_spareEvening.empty())
+			_avalot->_spareEvening.clear();
 		uint16 spare_eveningSize = 0;
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
 			sz.syncAsByte(actChr);
-			_gyro->_spareEvening += actChr;
+			_avalot->_spareEvening += actChr;
 		}
 	}
 
-	sz.syncAsSint32LE(_gyro->_totalTime);
-	sz.syncAsByte(_gyro->_jumpStatus);
-	sz.syncAsByte(_gyro->_mushroomGrowing);
-	sz.syncAsByte(_gyro->_spludwickAtHome);
-	sz.syncAsByte(_gyro->_lastRoom);
-	sz.syncAsByte(_gyro->_lastRoomNotMap);
-	sz.syncAsByte(_gyro->_crapulusWillTell);
-	sz.syncAsByte(_gyro->_enterCatacombsFromLustiesRoom);
-	sz.syncAsByte(_gyro->_teetotal);
-	sz.syncAsByte(_gyro->_malagauche);
-	sz.syncAsByte(_gyro->_drinking);
-	sz.syncAsByte(_gyro->_enteredLustiesRoomAsMonk);
-	sz.syncAsByte(_gyro->_catacombX);
-	sz.syncAsByte(_gyro->_catacombY);
-	sz.syncAsByte(_gyro->_avvysInTheCupboard);
-	sz.syncAsByte(_gyro->_geidaFollows);
-	sz.syncAsByte(_gyro->_geidaSpin);
-	sz.syncAsByte(_gyro->_geidaTime);
-	sz.syncAsByte(_gyro->_nextBell);
-	sz.syncAsByte(_gyro->_givenPotionToGeida);
-	sz.syncAsByte(_gyro->_lustieIsAsleep);
-	sz.syncAsByte(_gyro->_flipToWhere);
-	sz.syncAsByte(_gyro->_flipToPed);
-	sz.syncAsByte(_gyro->_beenTiedUp);
-	sz.syncAsByte(_gyro->_sittingInPub);
-	sz.syncAsByte(_gyro->_spurgeTalkCount);
-	sz.syncAsByte(_gyro->_metAvaroid);
-	sz.syncAsByte(_gyro->_takenMushroom);
-	sz.syncAsByte(_gyro->_givenPenToAyles);
-	sz.syncAsByte(_gyro->_askedDogfoodAboutNim);
+	sz.syncAsSint32LE(_avalot->_totalTime);
+	sz.syncAsByte(_avalot->_jumpStatus);
+	sz.syncAsByte(_avalot->_mushroomGrowing);
+	sz.syncAsByte(_avalot->_spludwickAtHome);
+	sz.syncAsByte(_avalot->_lastRoom);
+	sz.syncAsByte(_avalot->_lastRoomNotMap);
+	sz.syncAsByte(_avalot->_crapulusWillTell);
+	sz.syncAsByte(_avalot->_enterCatacombsFromLustiesRoom);
+	sz.syncAsByte(_avalot->_teetotal);
+	sz.syncAsByte(_avalot->_malagauche);
+	sz.syncAsByte(_avalot->_drinking);
+	sz.syncAsByte(_avalot->_enteredLustiesRoomAsMonk);
+	sz.syncAsByte(_avalot->_catacombX);
+	sz.syncAsByte(_avalot->_catacombY);
+	sz.syncAsByte(_avalot->_avvysInTheCupboard);
+	sz.syncAsByte(_avalot->_geidaFollows);
+	sz.syncAsByte(_avalot->_geidaSpin);
+	sz.syncAsByte(_avalot->_geidaTime);
+	sz.syncAsByte(_avalot->_nextBell);
+	sz.syncAsByte(_avalot->_givenPotionToGeida);
+	sz.syncAsByte(_avalot->_lustieIsAsleep);
+	sz.syncAsByte(_avalot->_flipToWhere);
+	sz.syncAsByte(_avalot->_flipToPed);
+	sz.syncAsByte(_avalot->_beenTiedUp);
+	sz.syncAsByte(_avalot->_sittingInPub);
+	sz.syncAsByte(_avalot->_spurgeTalkCount);
+	sz.syncAsByte(_avalot->_metAvaroid);
+	sz.syncAsByte(_avalot->_takenMushroom);
+	sz.syncAsByte(_avalot->_givenPenToAyles);
+	sz.syncAsByte(_avalot->_askedDogfoodAboutNim);
 
 
 #if 0
@@ -334,7 +330,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
-	return (!_gyro->_seeScroll && _gyro->_alive);
+	return (!_avalot->_seeScroll && _avalot->_alive);
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
@@ -380,7 +376,7 @@ Common::String AvalancheEngine::getSaveFileName(const int slot) {
 }
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
-	return (!_gyro->_seeScroll);
+	return (!_avalot->_seeScroll);
 }
 
 Common::Error AvalancheEngine::loadGameState(int slot) {
@@ -429,29 +425,29 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	synchronize(sz);
 	delete f;
 
-	_gyro->_isLoaded = true;
-	_gyro->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
+	_avalot->_isLoaded = true;
+	_avalot->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
-	if (_gyro->_holdTheDawn) {
-		_gyro->_holdTheDawn = false;
-		_lucerna->dawn();
+	if (_avalot->_holdTheDawn) {
+		_avalot->_holdTheDawn = false;
+		_avalot->dawn();
 	}
 
 	_background->forgetBackgroundSprites();
-	_lucerna->minorRedraw();
+	_avalot->minorRedraw();
 	_menu->setup();
-	_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _gyro->_room;
-	_gyro->_alive = true;
-	_lucerna->refreshObjectList();
+	_avalot->_whereIs[Avalot::kPeopleAvalot - 150] = _avalot->_room;
+	_avalot->_alive = true;
+	_avalot->refreshObjectList();
 	_animation->updateSpeed();
-	_lucerna->drawDirection();
-	_gyro->_onToolbar = false;
+	_avalot->drawDirection();
+	_avalot->_onToolbar = false;
 	_animation->animLink();
 	_background->updateBackgroundSprites();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
 		Dialogs::kControlItalic, Dialogs::kControlRoman, description.c_str(), Dialogs::kControlCenter, 
-		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _gyro->_roomnName.c_str(), Dialogs::kControlNewLine, 
+		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _avalot->_roomnName.c_str(), Dialogs::kControlNewLine, 
 		Dialogs::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_dialogs->displayText(tmpStr);
 
@@ -468,7 +464,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 	};
 
 	Common::String month = months[m];
-	Common::String day = _gyro->intToStr(d);
+	Common::String day = _avalot->intToStr(d);
 
 	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
 		switch (d % 10) {
@@ -485,7 +481,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 			day += "th";
 		}
 
-	return day + ' ' + month + ' ' + _gyro->intToStr(y + 1900);
+	return day + ' ' + month + ' ' + _avalot->intToStr(y + 1900);
 }
 
 void AvalancheEngine::updateEvents() {
@@ -494,10 +490,10 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_lucerna->_holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
+			_avalot->_holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
 			break;
 		case Common::EVENT_LBUTTONUP:
-			_lucerna->_holdLeftMouse = false; // Same as above.
+			_avalot->_holdLeftMouse = false; // Same as above.
 			break;
 		case Common::EVENT_KEYDOWN:
 			_avalot->handleKeyDown(event);
@@ -541,7 +537,7 @@ Common::Error AvalancheEngine::run() {
 		//}
 #endif
 
-	} while (!_gyro->_letMeOut && !shouldQuit());
+	} while (!_avalot->_letMeOut && !shouldQuit());
 
 	return Common::kNoError;
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 781031c..289cf60 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -32,10 +32,8 @@
 #include "avalanche/graphics.h"
 #include "avalanche/parser.h"
 #include "avalanche/avalot.h"
-#include "avalanche/gyro.h"
 #include "avalanche/pingo.h"
 #include "avalanche/dialogs.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/background.h"
 #include "avalanche/sequence.h"
 #include "avalanche/timer.h"
@@ -67,10 +65,8 @@ public:
 	Parser *_parser;
 
 	Avalot *_avalot;
-	Gyro *_gyro;
 	Pingo *_pingo;
 	Dialogs *_dialogs;
-	Lucerna *_lucerna;
 	Background *_background;
 	Sequence *_sequence;
 	Timer *_timer;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5dc7fcf..e514d79 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -30,10 +30,7 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/graphics.h"
 #include "avalanche/avalot.h"
-#include "avalanche/gyro.h"
 #include "avalanche/animation.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/dialogs.h"
 #include "avalanche/menu.h"
 #include "avalanche/pingo.h"
@@ -41,14 +38,232 @@
 #include "avalanche/background.h"
 #include "avalanche/closing.h"
 
+#include "common/file.h"
+#include "common/random.h"
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "common/config-manager.h"
 
 namespace Avalanche {
 
-Avalot::Avalot(AvalancheEngine *vm) {
+const char *Avalot::kVersionNum = "1.30";
+const char *Avalot::kCopyright = "1995";
+
+const MouseHotspotType Avalot::kMouseHotSpots[9] = {
+	{8,0}, // 1 - up-arrow
+	{0,0}, // 2 - screwdriver
+	{15,6}, // 3 - right-arrow
+	{0,0}, // 4 - fletch
+	{8,7}, // 5 - hourglass
+	{4,0}, // 6 - TTHand
+	{8,5}, // 7- Mark's crosshairs
+	{8,7}, // 8- I-beam
+	{0,0} // 9 - question mark
+};
+
+// Art gallery at 2,1; notice about this at 2,2.
+const int32 Avalot::kCatacombMap[8][8] = {
+	// Geida's room
+	// 1       2	   3     | 4	   5	   6	   7       8
+	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
+	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
+	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
+	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
+	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
+	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
+	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
+	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
+};
+// vv Stairs trap.
+
+/* Explanation: $NSEW.
+		Nibble N: North.
+		0     = no connection,
+		2     = (left,) middle(, right) door with left-hand handle,
+		5     = (left,) middle(, right) door with right-hand handle,
+		7     = arch,
+		8     = arch and 1 north of it,
+		9     = arch and 2 north of it,
+		D     = no connection + WINDOW,
+		E     = no connection + TORCH,
+		F     = recessed door (to Geida's room.)
+
+		Nibble S: South.
+		0     = no connection,
+		1,2,3 = left, middle, right door.
+
+		Nibble E: East.
+		0     = no connection (wall),
+		1     = no connection (wall + window),
+		2     = wall with door,
+		3     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor.
+
+		Nibble W: West.
+		0     = no connection (wall),
+		1     = no connection (wall + shield),
+		2     = wall with door,
+		3     = wall with door and shield,
+		4     = no connection (window),
+		5     = wall with door and window,
+		6     = wall with candles,
+		7     = wall with door and candles,
+		F     = straight-through corridor. */
+
+const char Avalot::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
+
+// A quasiped defines how people who aren't sprites talk. For example, quasiped
+// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
+const QuasipedType Avalot::kQuasipeds[16] = {
+//_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
+	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
+	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{2, kColorWhite,        kRoomYours,        kColorMagenta,  kPeopleArkata},    // C: Arkata (screen 1).
+	{2, kColorBlack,        kRoomLustiesRoom,  kColorRed,      kPeopleInvisible}, // D: Hawk (screen 23).
+	{2, kColorLightgreen,   kRoomOutsideDucks, kColorBrown,    kPeopleTrader},    // E: Trader (screen 50).
+	{5, kColorYellow,       kRoomRobins,       kColorRed,      kPeopleAvalot},    // F: Avvy, tied up (scr.42)
+	{1, kColorBlue,         kRoomAylesOffice,  kColorWhite,    kPeopleAyles},     // G: Ayles (screen 16).
+	{1, kColorBrown,        kRoomMusicRoom,    kColorWhite,    kPeopleJacques},   // H: Jacques (screen 7).
+	{1, kColorLightgreen,   kRoomNottsPub,     kColorGreen,    kPeopleSpurge},    // I: Spurge (screen 47).
+	{2, kColorYellow,       kRoomNottsPub,     kColorRed,      kPeopleAvalot},    // J: Avalot (screen 47).
+	{1, kColorLightgray,    kRoomLustiesRoom,  kColorBlack,    kPeopleDuLustie},  // K: du Lustie (screen 23).
+	{1, kColorYellow,       kRoomOubliette,    kColorRed,      kPeopleAvalot},    // L: Avalot (screen 27).
+	{2, kColorWhite,        kRoomOubliette,    kColorRed,      kPeopleInvisible}, // M: Avaroid (screen 27).
+	{3, kColorLightgray,    kRoomArgentPub,    kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
+	{4, kColorLightmagenta, kRoomNottsPub,     kColorRed,      kPeoplePort},      // O: Port (screen 47).
+	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
+};
+
+const uint16 Avalot::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+
+const TuneType Avalot::kTune = {
+	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
+	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
+	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
+};
+
+byte Avalot::_whereIs[29] = {
+	// The Lads
+	kRoomYours, // Avvy
+	kRoomSpludwicks, // Spludwick
+	kRoomOutsideYours, // Crapulus
+	kRoomDucks, // Duck - r__DucksRoom's not defined yet.
+	kRoomArgentPub, // Malagauche
+	kRoomRobins, // Friar Tuck.
+	kRoomDummy, // Robin Hood - can't meet him at the start.
+	kRoomBrummieRoad, // Cwytalot
+	kRoomLustiesRoom, // Baron du Lustie.
+	kRoomOutsideCardiffCastle, // The Duke of Cardiff.
+	kRoomArgentPub, // Dogfood
+	kRoomOutsideDucks, // Trader
+	kRoomArgentPub, // Ibythneth
+	kRoomAylesOffice, // Ayles
+	kRoomNottsPub, // Port
+	kRoomNottsPub, // Spurge
+	kRoomMusicRoom, // Jacques
+	0, 0, 0, 0, 0, 0, 0, 0,
+	// The Lasses
+	kRoomYours, // Arkata
+	kRoomGeidas, // Geida
+	kRoomDummy, // nobody allocated here!
+	kRoomWiseWomans  // The Wise Woman.
+};
+
+Clock::Clock(AvalancheEngine *vm) {
+	_vm = vm;
+	_oldHour = _oldHourAngle = _oldMinute = 17717;
+}
+
+void Clock::update() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
+	TimeDate t;
+	_vm->_system->getTimeAndDate(t);
+	_hour = t.tm_hour;
+	_minute = t.tm_min;
+	_second = t.tm_sec;
+
+	_hourAngle = (_hour % 12) * 30 + _minute / 2;
+
+	if (_oldHour != _hour)  {
+		plotHands();
+		chime();
+	}
+
+	if (_oldMinute != _minute)
+		plotHands();
+
+	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
+		Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
+			"midnight. Are you having an all-night Avvy session? Glad you like the game that much!", 
+			Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		_vm->_dialogs->displayText(tmpStr);
+	}
+	_oldHour = _hour;
+	_oldHourAngle = _hourAngle;
+	_oldMinute = _minute;
+}
+
+void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
+	if (angle > 900) {
+		endPoint.x = 177;
+		return;
+	}
+
+	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color);
+}
+
+void Clock::drawHand(const Common::Point &endPoint, byte color) {
+	if (endPoint.x == 177)
+		return;
+
+	_vm->_graphics->_surface.drawLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
+}
+
+void Clock::plotHands() {
+	calcHand(_oldHourAngle, 14, _clockHandHour, kColorYellow);
+	calcHand(_oldMinute * 6, 17, _clockHandMinute, kColorYellow);
+	drawHand(_clockHandHour, kColorBrown);
+	drawHand(_clockHandMinute, kColorBrown);
+
+	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
+	calcHand(_minute * 6, 17, _clockHandMinute, kColorBrown);
+	drawHand(_clockHandHour, kColorYellow);
+	drawHand(_clockHandMinute, kColorYellow);
+}
+
+void Clock::chime() {
+	warning("STUB: Clock::chime()");
+}
+
+
+Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogation(0) {
 	_vm = vm;
+
+	// Needed because of Lucerna::load_also()
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++)
+			_also[i][j] = 0;
+	}
+
+	_totalTime = 0;
+}
+
+Avalot::~Avalot() {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
+			if (_also[i][j] != 0)  {
+				delete _also[i][j];
+				_also[i][j] = 0;
+			}
+		}
+	}
+
+	for (int i = 0; i < 9; i++) {
+		_digits[i].free();
+		_directions[i].free();
+	}
+	_digits[9].free();
 }
 
 void Avalot::handleKeyDown(Common::Event &event) {
@@ -99,9 +314,9 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_HOME:
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
-		if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake) {
+		if (_alive && _avvyIsAwake) {
 			_vm->_animation->handleMoveKey(event); // Fallthroughs are intended.
-			_vm->_lucerna->drawDirection();
+			drawDirection();
 			return;
 		}
 	case Common::KEYCODE_BACKSPACE:
@@ -114,46 +329,46 @@ void Avalot::handleKeyDown(Common::Event &event) {
 		break;
 	}
 
-	_vm->_lucerna->drawDirection();
+	drawDirection();
 }
 
 void Avalot::setup() {
-	_vm->_gyro->init();
+	init();
 
 	_vm->_dialogs->reset();
-	_vm->_lucerna->dusk();
-	_vm->_lucerna->loadDigits();
+	dusk();
+	loadDigits();
 
 	_vm->_parser->_inputTextPos = 0;
 	_vm->_parser->_quote = true;
 
-	_vm->_lucerna->drawToolbar();
+	drawToolbar();
 	_vm->_dialogs->setReadyLight(2);
 
 	_vm->_animation->_direction = Animation::kDirStopped;
 	_vm->_animation->loadAnims();
 
-	_vm->_lucerna->dawn();
+	dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();
-	_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
+	_vm->_animation->_sprites[0]._speedX = kWalk;
 	_vm->_animation->updateSpeed();
 
 	_vm->_menu->init();
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
-		_vm->_gyro->_thinks = 2; // You always have money.
-		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
+		_thinks = 2; // You always have money.
+		thinkAbout(Avalot::kObjectMoney, Avalot::kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
-		_vm->_gyro->_isLoaded = false; // Set to true in _vm->loadGame().
-		_vm->_gyro->newGame();
+		_isLoaded = false; // Set to true in _vm->loadGame().
+		newGame();
 
-		_vm->_gyro->_soundFx = !_vm->_gyro->_soundFx;
-		_vm->_lucerna->fxToggle();
-		_vm->_lucerna->thinkAbout(Gyro::kObjectMoney, Gyro::kThing);
+		_soundFx = !_soundFx;
+		fxToggle();
+		thinkAbout(Avalot::kObjectMoney, Avalot::kThing);
 
 		_vm->_dialogs->displayScrollChain('q', 83); // Info on the game, etc.
 	}
@@ -167,21 +382,21 @@ void Avalot::runAvalot() {
 
 		_vm->updateEvents(); // The event handler.
 
-		_vm->_lucerna->_clock.update();
+		_clock.update();
 		_vm->_menu->update();
 		_vm->_background->updateBackgroundSprites();
 		_vm->_animation->animLink();
-		_vm->_lucerna->checkClick();
+		checkClick();
 		_vm->_timer->updateTimer();
 
 #ifdef DEBUG
-		for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
-			LineType *curLine = &_vm->_gyro->_lines[i];
+		for (int i = 0; i < _lineNum; i++) {
+			LineType *curLine = &_lines[i];
 			_vm->_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
 		}
 
-		for (int i = 0; i < _vm->_gyro->_fieldNum; i++) {
-			FieldType *curField = &_vm->_gyro->_fields[i];
+		for (int i = 0; i < _fieldNum; i++) {
+			FieldType *curField = &_fields[i];
 			if (curField->_x1 < 640)
 				_vm->_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
 		}
@@ -191,8 +406,8 @@ void Avalot::runAvalot() {
 
 		uint32 delay = _vm->_system->getMillis() - beginLoop;
 		if (delay <= 55)
-			_vm->_system->delayMillis(55 - delay); // Replaces _vm->_gyro->slowdown(); 55 comes from 18.2 Hz (B Flight).
-	} while (!_vm->_gyro->_letMeOut && !_vm->shouldQuit());
+			_vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
+	} while (!_letMeOut && !_vm->shouldQuit());
 
 	//if (logging)
 	//	close(logfile);
@@ -201,4 +416,1507 @@ void Avalot::runAvalot() {
 	_vm->_closing->exitGame();
 }
 
+void Avalot::init() {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++)
+			_also[i][j] = 0;
+	}
+
+#if 0
+	if (_vm->_enhanced->atbios)
+		atkey = "f1";
+	else
+		atkey = "alt-";
+#endif
+
+	_mouse = kMouseStateNo;
+	_letMeOut = false;
+	_holdTheDawn = true;
+	_currentMouse = 177;
+	_dropsOk = true;
+	_mouseText = "";
+	_cheat = false;
+	_cp = 0;
+	_ledStatus = 177;
+	_defaultLed = 2;
+	_enidFilename = ""; // Undefined.
+	for (int i = 0; i < 3; i++)
+		_scoreToDisplay[i] = -1; // Impossible digits.
+	_holdTheDawn = false;
+
+	setMousePointerWait();
+	CursorMan.showMouse(true);
+}
+
+/**
+ * Call a given Verb
+ * @remarks	Originally called 'callverb'
+ */
+void Avalot::callVerb(byte id) {
+	if (id == _vm->_parser->kPardon) {
+		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
+			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
+			"what the current setting of this key is.");
+		_vm->_dialogs->displayText(tmpStr);
+	} else {
+		_weirdWord = false;
+		_vm->_parser->_polite = true;
+		_vm->_parser->_verb = id;
+		_vm->_parser->doThat();
+	}
+}
+
+void Avalot::drawAlsoLines() {
+	CursorMan.showMouse(false);
+
+	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
+	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
+
+	for (int i = 0; i < _lineNum; i++) {
+		// We had to check if the lines are within the borders of the screen.
+		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < _vm->_graphics->kScreenHeight)
+		 && (_lines[i]._x2 >= 0) && (_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < _vm->_graphics->kScreenHeight))
+			_vm->_graphics->_magics.drawLine(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
+	}
+
+	CursorMan.showMouse(true);
+}
+
+/**
+ * Check is it's possible to give something to Spludwick
+ * @remarks	Originally called 'nextstring'
+ */
+Common::String Avalot::readAlsoStringFromFile() {
+	Common::String str;
+	byte length = file.readByte();
+	for (int i = 0; i < length; i++)
+		str += file.readByte();
+	return str;
+}
+
+void Avalot::scram(Common::String &str) {
+	for (uint i = 0; i < str.size(); i++)
+		str.setChar(str[i] ^ 177, i);
+}
+
+void Avalot::unScramble() {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
+			if (_also[i][j] != 0)
+				scram(*_also[i][j]);
+		}
+	}
+	scram(_listen);
+	scram(_flags);
+}
+
+void Avalot::loadAlso(byte num) {
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
+			if (_also[i][j] != 0)  {
+				delete _also[i][j];
+				_also[i][j] = 0;
+			}
+		}
+	}
+	Common::String filename;
+	filename = Common::String::format("also%d.avd", num);
+	if (!file.open(filename))
+		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+
+	file.seek(128);
+
+	byte alsoNum = file.readByte();
+	Common::String tmpStr;
+	for (int i = 0; i <= alsoNum; i++) {
+		for (int j = 0; j < 2; j++) {
+			_also[i][j] = new Common::String;
+			*_also[i][j] = readAlsoStringFromFile();
+		}
+		tmpStr = Common::String::format("\x9D%s\x9D", _also[i][0]->c_str());
+		*_also[i][0] = tmpStr;
+	}
+
+	memset(_lines, 0xFF, sizeof(_lines));
+
+	_lineNum = file.readByte();
+	for (int i = 0; i < _lineNum; i++) {
+		LineType *curLine = &_lines[i];
+		curLine->_x1 = file.readSint16LE();
+		curLine->_y1 = file.readSint16LE();
+		curLine->_x2 = file.readSint16LE();
+		curLine->_y2 = file.readSint16LE();
+		curLine->_color = file.readByte();
+	}
+
+	memset(_peds, 177, sizeof(_peds));
+	byte pedNum = file.readByte();
+	for (int i = 0; i < pedNum; i++) {
+		PedType *curPed = &_peds[i];
+		curPed->_x = file.readSint16LE();
+		curPed->_y = file.readSint16LE();
+		curPed->_direction = file.readByte();
+	}
+
+	_fieldNum = file.readByte();
+	for (int i = 0; i < _fieldNum; i++) {
+		FieldType *curField = &_fields[i];
+		curField->_x1 = file.readSint16LE();
+		curField->_y1 = file.readSint16LE();
+		curField->_x2 = file.readSint16LE();
+		curField->_y2 = file.readSint16LE();
+	}
+
+	for (int i = 0; i < 15; i++) {
+		MagicType *magic = &_magics[i];
+		magic->_operation = file.readByte();
+		magic->_data = file.readUint16LE();
+	}
+
+	for (int i = 0; i < 7; i++) {
+		MagicType *portal = &_portals[i];
+		portal->_operation = file.readByte();
+		portal->_data = file.readUint16LE();
+	}
+
+	_flags.clear();
+	for (int i = 0;  i < 26; i++)
+		_flags += file.readByte();
+
+	int16 listen_length = file.readByte();
+	_listen.clear();
+	for (int i = 0; i < listen_length; i++)
+		_listen += file.readByte();
+
+	drawAlsoLines();
+
+	file.close();
+	unScramble();
+	for (int i = 0; i <= alsoNum; i++) {
+		tmpStr = Common::String::format(",%s,", _also[i][0]->c_str());
+		*_also[i][0] = tmpStr;
+	}
+}
+
+void Avalot::loadRoom(byte num) {
+	CursorMan.showMouse(false);
+
+	_vm->_graphics->fleshColors();
+
+	Common::String filename = Common::String::format("place%d.avd", num);
+	if (!file.open(filename))
+		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+
+	file.seek(146);
+	if (!_roomnName.empty())
+		_roomnName.clear();
+	for (int i = 0; i < 30; i++) {
+		char actChar = file.readByte();
+		if ((32 <= actChar) && (actChar <= 126))
+			_roomnName += actChar;
+	}
+	// Compression method byte follows this...
+
+	file.seek(177);
+
+	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(file, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
+	_vm->_graphics->refreshBackground();
+
+	file.close();
+
+	loadAlso(num);
+	_vm->_background->loadBackgroundSprites(num);
+	CursorMan.showMouse(true);
+}
+
+void Avalot::zoomOut(int16 x, int16 y) {
+	warning("STUB: Avalot::zoomout()");
+}
+
+void Avalot::findPeople(byte room) {
+	for (int i = 1; i < 29; i++) {
+		if (_whereIs[i] == room) {
+			if (i < 25)
+				_him = i + 150;
+			else
+				_her = i + 150;
+		}
+	}
+}
+
+void Avalot::exitRoom(byte x) {
+	_vm->_sound->stopSound();
+	_vm->_background->forgetBackgroundSprites();
+	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
+
+	switch (x) {
+	case kRoomSpludwicks:
+		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
+		 _avariciusTalk = 0;
+		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
+		break;
+	case kRoomBridge:
+		if (_drawbridgeOpen > 0) {
+			_drawbridgeOpen = 4; // Fully open.
+			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
+		}
+		break;
+	case kRoomOutsideCardiffCastle:
+		_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey);
+		break;
+	case kRoomRobins:
+		_vm->_timer->loseTimer(Timer::kReasonGettingTiedUp);
+		break;
+	}
+
+	_interrogation = 0; // Leaving the room cancels all the questions automatically.
+	_seeScroll = false; // Now it can work again!
+
+	_lastRoom = _room;
+	if (_room != kRoomMap)
+		_lastRoomNotMap = _room;
+}
+
+
+/**
+ * Only when entering a NEW town! Not returning to the last one,
+ * but choosing another from the map.
+ * @remarks	Originally called 'new_town'
+ */
+void Avalot::enterNewTown() {
+	_vm->_menu->setup();
+
+	switch (_room) {
+	case kRoomOutsideNottsPub: // Entry into Nottingham.
+		if ((_roomCount[kRoomRobins] > 0) && (_beenTiedUp) && (!_takenMushroom))
+			_mushroomGrowing = true;
+		break;
+	case kRoomWiseWomans: // Entry into Argent.
+		if (_talkedToCrapulus && (!_lustieIsAsleep)) {
+			_spludwickAtHome = !((_roomCount[kRoomWiseWomans] % 3) == 1);
+			_crapulusWillTell = !_spludwickAtHome;
+		} else {
+			_spludwickAtHome = true;
+			_crapulusWillTell = false;
+		}
+		if (_boxContent == Avalot::kObjectWine)
+			_wineState = 3; // Vinegar
+		break;
+	}
+
+	if ((_room != kRoomOutsideDucks) && (_objects[Avalot::kObjectOnion - 1]) && !(_onionInVinegar))
+		_rottenOnion = true; // You're holding the onion
+}
+
+void Avalot::putGeidaAt(byte whichPed, byte ped) {
+	if (ped == 0)
+		return;
+	AnimationType *spr1 = &_vm->_animation->_sprites[1];
+
+	spr1->init(5, false, _vm->_animation); // load Geida
+	_vm->_animation->appearPed(1, whichPed);
+	spr1->_callEachStepFl = true;
+	spr1->_eachStepProc = Animation::kProcGeida;
+}
+
+void Avalot::enterRoom(byte room, byte ped) {
+	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
+
+	findPeople(room);
+	_room = room;
+	if (ped != 0)
+		_roomCount[room]++;
+
+	loadRoom(room);
+
+	if ((_roomCount[room] == 0) && (!setFlag('S')))
+		incScore(1);
+
+	_whereIs[Avalot::kPeopleAvalot - 150] = _room;
+
+	if (_geidaFollows)
+		_whereIs[Avalot::kPeopleGeida - 150] = room;
+
+	_roomTime = 0;
+
+
+	if ((_lastRoom == kRoomMap) && (_lastRoomNotMap != _room))
+		enterNewTown();
+
+	switch (room) {
+	case kRoomYours:
+		if (_avvyInBed) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_graphics->refreshBackground();
+			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
+		}
+		break;
+
+	case kRoomOutsideYours:
+		if (ped > 0) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			if (!_talkedToCrapulus) {
+				_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomOutsideYours;
+				spr1->init(8, false, _vm->_animation); // load Crapulus
+
+				if (_roomCount[kRoomOutsideYours] == 1) {
+					_vm->_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
+					spr1->walkTo(4); // Walks up to greet you.
+				} else {
+					_vm->_animation->appearPed(1, 4); // Starts where he was before.
+					spr1->_facingDir = Animation::kDirLeft;
+				}
+
+				spr1->_callEachStepFl = true;
+				spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
+
+			} else
+				_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomNowhere;
+
+			if (_crapulusWillTell) {
+				spr1->init(8, false, _vm->_animation);
+				_vm->_animation->appearPed(1, 1);
+				spr1->walkTo(3);
+				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
+				_crapulusWillTell = false;
+			}
+		}
+		break;
+
+	case kRoomOutsideSpludwicks:
+		if ((_roomCount[kRoomOutsideSpludwicks] == 1) && (ped == 1)) {
+			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
+			_spludwickAtHome = true;
+		}
+		break;
+
+	case kRoomSpludwicks:
+		if (_spludwickAtHome) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			if (ped > 0) {
+				spr1->init(2, false, _vm->_animation); // load Spludwick
+				_vm->_animation->appearPed(1, 1);
+				_whereIs[Avalot::kPeopleSpludwick - 150] = kRoomSpludwicks;
+			}
+
+			spr1->_callEachStepFl = true;
+			spr1->_eachStepProc = Animation::kProcGeida;
+		} else
+			_whereIs[Avalot::kPeopleSpludwick - 150] = kRoomNowhere;
+		break;
+
+	case kRoomBrummieRoad:
+		if (_geidaFollows)
+			putGeidaAt(4, ped);
+		if (_cwytalotGone) {
+			_magics[kColorLightred - 1]._operation = Avalot::kMagicNothing;
+			_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomNowhere;
+		} else {
+			if (ped > 0) {
+				AnimationType *spr1 = &_vm->_animation->_sprites[1];
+				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
+				spr1->_callEachStepFl = true;
+				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
+				_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomBrummieRoad;
+
+				if (_roomCount[kRoomBrummieRoad] == 1) { // First time here...
+					_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
+					spr1->walkTo(3); // ...and he walks up...
+				} else {
+					// You've been here before.
+					_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
+					spr1->_facingDir = Animation::kDirLeft;
+				}
+			}
+		}
+		break;
+
+	case kRoomArgentRoad:
+		if ((_cwytalotGone) && (!_passedCwytalotInHerts) && (ped == 2) && (_roomCount[kRoomArgentRoad] > 3)) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
+			_vm->_animation->appearPed(1, 0);
+			spr1->walkTo(1);
+			spr1->_vanishIfStill = true;
+			_passedCwytalotInHerts = true;
+			// whereis[#157] = r__Nowhere; // can we fit this in?
+			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
+		}
+		break;
+
+	case kRoomBridge:
+		if (_drawbridgeOpen == 4) { // open
+			_vm->_background->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
+			_vm->_graphics->refreshBackground();
+			_magics[kColorGreen - 1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
+		}
+		if (_geidaFollows)
+			putGeidaAt(ped + 2, ped); // load Geida
+		break;
+
+	case kRoomRobins:
+		if (ped > 0) {
+			if (!_beenTiedUp) {
+				// A welcome party... or maybe not...
+				AnimationType *spr1 = &_vm->_animation->_sprites[1];
+				spr1->init(6, false, _vm->_animation);
+				_vm->_animation->appearPed(1, 1);
+				spr1->walkTo(2);
+				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
+			}
+		}
+
+		if (_beenTiedUp) {
+			_whereIs[Avalot::kPeopleRobinHood - 150] = 0;
+			_whereIs[Avalot::kPeopleFriarTuck - 150] = 0;
+		}
+
+		if (_tiedUp)
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+
+		if (!_mushroomGrowing)
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+		_vm->_graphics->refreshBackground();
+		break;
+
+	case kRoomOutsideCardiffCastle:
+		if (ped > 0) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			switch (_cardiffQuestionNum) {
+			case 0 : // You've answered NONE of his questions.
+				spr1->init(9, false, _vm->_animation);
+				_vm->_animation->appearPed(1, 1);
+				spr1->walkTo(2);
+				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
+				break;
+			case 5 :
+				_magics[1]._operation = Avalot::kMagicNothing;
+				break; // You've answered ALL his questions. => nothing happens.
+			default: // You've answered SOME of his questions.
+				spr1->init(9, false, _vm->_animation);
+				_vm->_animation->appearPed(1, 2);
+				spr1->_facingDir = Animation::kDirRight;
+				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
+			}
+		}
+
+		if (_cardiffQuestionNum < 5)
+			_interrogation = _cardiffQuestionNum;
+		else
+			_interrogation = 0;
+		break;
+
+	case kRoomMap:
+		// You're entering the map.
+		dawn();
+		if (ped > 0)
+			zoomOut(_peds[ped]._x, _peds[ped]._y);
+
+		if ((_objects[Avalot::kObjectWine - 1]) && (_wineState != 3)) {
+			_vm->_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
+			_objects[Avalot::kObjectWine - 1] = false;
+			refreshObjectList();
+		}
+
+		_vm->_dialogs->displayScrollChain('q', 69);
+		break;
+
+	case kRoomCatacombs:
+		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
+
+			switch (ped) {
+			case 3: // Enter from oubliette
+				_catacombX = 8;
+				_catacombY = 4;
+				break;
+			case 5: // Enter from du Lustie's
+				_catacombX = 8;
+				_catacombY = 7;
+				break;
+			case 6: // Enter from Geida's
+				_catacombX = 4;
+				_catacombY = 1;
+				break;
+			}
+
+			_enterCatacombsFromLustiesRoom = true;
+			_vm->_animation->catacombMove(ped);
+			_enterCatacombsFromLustiesRoom = false;
+		}
+		break;
+
+	case kRoomArgentPub:
+		if (_wonNim)
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
+		_malagauche = 0; // Ready to boot Malagauche
+		if (_givenBadgeToIby) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 7);
+			_vm->_background->drawBackgroundSprite(-1, -1, 8);
+		}
+		_vm->_graphics->refreshBackground();
+		break;
+
+	case kRoomLustiesRoom:
+		_npcFacing = 1; // du Lustie.
+		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
+			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
+		else if (!_enteredLustiesRoomAsMonk) // already
+			// Presumably, Avvy dressed as a monk.
+			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
+
+		if (_geidaFollows) {
+			putGeidaAt(4, ped);
+			if (_lustieIsAsleep) {
+				_vm->_background->drawBackgroundSprite(-1, -1, 4);
+				_vm->_graphics->refreshBackground();
+			}
+		}
+		break;
+
+	case kRoomMusicRoom:
+		if (_jacquesState > 0) {
+			_jacquesState = 5;
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_graphics->refreshBackground();
+			_vm->_background->drawBackgroundSprite(-1, -1, 3);
+			_magics[kColorBrown - 1]._operation = Avalot::kMagicNothing;
+			_whereIs[Avalot::kPeopleJacques - 150] = 0;
+		}
+		if (ped != 0) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(6);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(7);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomOutsideNottsPub:
+		if (ped == 2) {
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(3);
+			_vm->_sequence->thenShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(4);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomOutsideArgentPub:
+		if (ped == 2)  {
+			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(6);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(7);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomWiseWomans: {
+		AnimationType *spr1 = &_vm->_animation->_sprites[1];
+		spr1->init(11, false, _vm->_animation);
+		if ((_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
+			_vm->_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
+			spr1->walkTo(3); // Walks up to greet you.
+		} else {
+			_vm->_animation->appearPed(1, 3); // Starts where she was before.
+			spr1->_facingDir = Animation::kDirLeft;
+		}
+
+		spr1->_callEachStepFl = true;
+		spr1->_eachStepProc = Animation::kProcFaceAvvy; // She always faces Avvy.
+		}
+		break;
+
+	case kRoomInsideCardiffCastle:
+		if (ped > 0) {
+			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(1);
+			if (_arrowInTheDoor)
+				_vm->_sequence->thenShow(3);
+			else
+				_vm->_sequence->thenShow(2);
+
+			if (_takenPen)
+				_vm->_background->drawBackgroundSprite(-1, -1, 3);
+
+			_vm->_sequence->startToClose();
+		} else {
+			_vm->_background->drawBackgroundSprite(-1, -1, 0);
+			if (_arrowInTheDoor)
+				_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			else
+				_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_graphics->refreshBackground();
+		}
+		break;
+
+	case kRoomAvvysGarden:
+		if (ped == 1)  {
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(3);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomEntranceHall:
+	case kRoomInsideAbbey:
+	case kRoomYourHall:
+		if (ped == 2)  {
+#if 0
+			// It was the original:
+			_vm->_celer->show_one(-1, -1, 2);
+			_vm->_sequence->first_show(1);
+			_vm->_sequence->then_show(3);
+			_vm->_sequence->start_to_close();
+#endif
+
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(3);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomAylesOffice:
+		if (_aylesIsAwake)
+			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+		_vm->_graphics->refreshBackground();
+		break; // Ayles awake.
+
+	case kRoomGeidas:
+		putGeidaAt(1, ped);
+		break; // load Geida
+
+	case kRoomEastHall:
+	case kRoomWestHall:
+		if (_geidaFollows)
+			putGeidaAt(ped + 1, ped);
+		break;
+
+	case kRoomLusties:
+		if (_geidaFollows)
+			putGeidaAt(ped + 5, ped);
+		break;
+
+	case kRoomNottsPub:
+		if (_sittingInPub)
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+		_npcFacing = 1; // Port.
+		break;
+
+	case kRoomOutsideDucks:
+		if (ped == 2) {
+			// Shut the door
+			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_graphics->refreshBackground();
+			_vm->_sequence->firstShow(3);
+			_vm->_sequence->firstShow(2);
+			_vm->_sequence->thenShow(1);
+			_vm->_sequence->thenShow(4);
+			_vm->_sequence->startToClose();
+		}
+		break;
+
+	case kRoomDucks:
+		_npcFacing = 1; // Duck.
+		break; 
+	}
+
+	_seeScroll = false; // Now it can work again!
+	_isLoaded = false;
+}
+
+void Avalot::thinkAbout(byte object, bool type) {
+	const int16 picSize = 966;
+
+	_thinks = object;
+	object--;
+
+	setMousePointerWait();
+
+	if (type == Avalot::kThing) {
+		if (!file.open("thinks.avd"))
+			error("AVALANCHE: Lucerna: File not found: thinks.avd");
+	} else { // Avalot::kPerson
+		if (!file.open("folk.avd"))
+			error("AVALANCHE: Lucerna: File not found: folk.avd");
+
+		object -= 149;
+		if (object >= 25)
+			object -= 8;
+		if (object == 20)
+			object--; // Last time...
+	}
+
+	CursorMan.showMouse(false);
+
+	file.seek(object * picSize + 65);
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
+
+	picture.free();
+	file.close();
+
+	CursorMan.showMouse(true);
+	_thinkThing = type;
+}
+
+void Avalot::loadDigits() {   // Load the scoring digits & rwlites
+	const byte digitsize = 134;
+	const byte rwlitesize = 126;
+
+	if (!file.open("digit.avd"))
+		error("AVALANCHE: Lucerna: File not found: digit.avd");
+
+	for (int i = 0; i < 10; i++) {
+		file.seek(i * digitsize);
+		_digits[i] = _vm->_graphics->loadPictureGraphic(file);
+	}
+
+	for (int i = 0; i < 9; i++) {
+		file.seek(10 * digitsize + i * rwlitesize);
+		_directions[i] = _vm->_graphics->loadPictureGraphic(file);
+	}
+
+	file.close();
+}
+
+void Avalot::drawToolbar() {
+	if (!file.open("useful.avd"))
+		error("AVALANCHE: Lucerna: File not found: useful.avd");
+
+	file.seek(40);
+
+	CursorMan.showMouse(false);
+	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
+
+	picture.free();
+	file.close();
+
+	CursorMan.showMouse(true);
+	_vm->_animation->_oldDirection = 177;
+	drawDirection();
+}
+
+void Avalot::drawScore() {
+	uint16 score = _dnascore;
+	int8 numbers[3] = {0, 0, 0};
+	for (int i = 0; i < 2; i++) {
+		byte divisor = 1;
+		for (int j = 0; j < (2 - i); j++)
+			divisor *= 10;
+		numbers[i] = score / divisor;
+		score -= numbers[i] * divisor;
+	}
+	numbers[2] = score;
+
+	CursorMan.showMouse(false);
+
+	for (int i = 0; i < 3; i++) {
+		if (_scoreToDisplay[i] != numbers[i])
+			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _digits[numbers[i]], 250 + (i + 1) * 15, 177);
+	}
+
+	CursorMan.showMouse(true);
+
+	for (int i = 0; i < 3; i++)
+		_scoreToDisplay[i] = numbers[i];
+}
+
+void Avalot::incScore(byte num) {    
+	for (int i = 1; i <= num; i++) {
+		_dnascore++;
+
+//		if (soundfx) {
+			for (int j = 1; j <= 97; j++)
+				// Length os 2 is a guess, the original doesn't have a delay specified
+				_vm->_sound->playNote(177 + _dnascore * 3, 2);
+//		}
+	}
+	warning("STUB: Avalot::points()");
+
+	drawScore();
+}
+
+void Avalot::useCompass(const Common::Point &cursorPos) {
+	byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
+
+	switch (color) {
+	case kColorGreen:
+		_vm->_animation->_direction = Animation::kDirUp;
+		_vm->_animation->changeDirection(0, Animation::kDirUp);
+		drawDirection();
+		break;
+	case kColorBrown:
+		_vm->_animation->_direction = Animation::kDirDown;
+		_vm->_animation->changeDirection(0, Animation::kDirDown);
+		drawDirection();
+		break;
+	case kColorCyan:
+		_vm->_animation->_direction = Animation::kDirLeft;
+		_vm->_animation->changeDirection(0, Animation::kDirLeft);
+		drawDirection();
+		break;
+	case kColorLightmagenta:
+		_vm->_animation->_direction = Animation::kDirRight;
+		_vm->_animation->changeDirection(0, Animation::kDirRight);
+		drawDirection();
+		break;
+	case kColorRed:
+	case kColorWhite:
+	case kColorLightcyan:
+	case kColorYellow: // Fall-throughs are intended.
+		_vm->_animation->stopWalking();
+		drawDirection();
+		break;
+	}
+}
+
+void Avalot::fxToggle() {
+	warning("STUB: Avalot::fxtoggle()");
+}
+
+void Avalot::refreshObjectList() {
+	_carryNum = 0;
+	if (_thinkThing && !_objects[_thinks - 1])
+		thinkAbout(Avalot::kObjectMoney, Avalot::kThing); // you always have money
+
+	for (int i = 0; i < kObjectNum; i++) {
+		if (_objects[i]) {
+			_objectList[_carryNum] = i + 1;
+			_carryNum++;
+		}
+	}
+}
+
+/**
+ * @remarks	Originally called 'verte'
+ */
+void Avalot::guideAvvy(Common::Point cursorPos) {
+	if (!_userMovesAvvy)
+		return;
+
+	cursorPos.y /= 2;
+	byte what;
+
+	// _vm->_animation->tr[0] is Avalot.)
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	if (cursorPos.x < avvy->_x)
+		what = 1;
+	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
+		what = 2;
+	else
+		what = 0; // On top
+
+	if (cursorPos.y < avvy->_y)
+		what += 3;
+	else if (cursorPos.y > (avvy->_y + avvy->_info._yLength))
+		what += 6;
+
+	switch (what) {
+	case 0:
+		_vm->_animation->stopWalking();
+		break; // Clicked on Avvy: no movement.
+	case 1:
+		_vm->_animation->changeDirection(0, Animation::kDirLeft);
+		break;
+	case 2:
+		_vm->_animation->changeDirection(0, Animation::kDirRight);
+		break;
+	case 3:
+		_vm->_animation->changeDirection(0, Animation::kDirUp);
+		break;
+	case 4:
+		_vm->_animation->changeDirection(0, Animation::kDirUpLeft);
+		break;
+	case 5:
+		_vm->_animation->changeDirection(0, Animation::kDirUpRight);
+		break;
+	case 6:
+		_vm->_animation->changeDirection(0, Animation::kDirDown);
+		break;
+	case 7:
+		_vm->_animation->changeDirection(0, Animation::kDirDownLeft);
+		break;
+	case 8:
+		_vm->_animation->changeDirection(0, Animation::kDirDownRight);
+		break;
+	}    // No other values are possible.
+
+	drawDirection();
+}
+
+void Avalot::checkClick() {
+	Common::Point cursorPos = _vm->getMousePos();
+	_onToolbar = kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
+
+	/*if (mrelease > 0)
+		after_the_scroll = false;*/
+
+	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+		newMouse(0); // up arrow
+	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
+		newMouse(7); //I-beam
+	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+		newMouse(1); // screwdriver
+	else if (!_vm->_menu->isActive()) { // Dropdown can handle its own pointers.
+		if (_holdLeftMouse) {
+			newMouse(6); // Mark's crosshairs
+			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
+		} else
+			newMouse(3); // fletch
+	}
+
+	if (_holdLeftMouse) {
+		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
+			if (_dropsOk)
+				_vm->_menu->update();
+		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
+			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
+			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
+				_vm->_parser->_inputTextPos = _vm->_parser->_inputText.size() + 1;
+			if (_vm->_parser->_inputTextPos < 1)
+				_vm->_parser->_inputTextPos = 1;
+			_vm->_parser->_inputTextPos--;
+			_vm->_parser->plotText();
+		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
+			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
+				if (_alive && _avvyIsAwake)
+					useCompass(cursorPos);
+			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
+				do {
+					_vm->updateEvents();
+				} while (_holdLeftMouse);
+
+				if (_thinkThing) {
+					_vm->_parser->_thing = _thinks;
+					_vm->_parser->_thing += 49;
+					_vm->_parser->_person = _vm->_parser->kPardon;
+				} else {
+					_vm->_parser->_person = _thinks;
+					_vm->_parser->_thing = _vm->_parser->kPardon;
+				}
+				callVerb(Parser::kVerbCodeExam);
+			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
+				do {
+					_vm->updateEvents();
+				} while (_holdLeftMouse);
+
+				callVerb(Parser::kVerbCodeScore);
+			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
+				_vm->_animation->_sprites[0]._speedX = kWalk;
+				_vm->_animation->updateSpeed();
+			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
+				_vm->_animation->_sprites[0]._speedX = kRun;
+				_vm->_animation->updateSpeed();
+			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
+				fxToggle();
+			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
+				_mouseText.insertChar(Dialogs::kControlNewLine, 0);
+		} else if (!_dropsOk)
+			_mouseText = Common::String(13) + _mouseText;
+	}
+}
+
+void Avalot::errorLed() {
+	warning("STUB: Avalot::errorled()");
+}
+
+int8 Avalot::fades(int8 x) {
+	warning("STUB: Avalot::fades()");
+	return 0;
+}
+
+void Avalot::fadeOut(byte n) {
+	warning("STUB: Avalot::fadeOut()");
+}
+
+void Avalot::dusk() {
+	warning("STUB: Avalot::dusk()");
+}
+
+void Avalot::fadeIn(byte n) {
+	warning("STUB: Avalot::fadeIn()");
+}
+
+void Avalot::dawn() {
+	warning("STUB: Avalot::dawn()");
+}
+
+void Avalot::drawDirection() { // It's data is loaded in load_digits().
+	if (_vm->_animation->_oldDirection == _vm->_animation->_direction)
+		return;
+
+	_vm->_animation->_oldDirection = _vm->_animation->_direction;
+
+	CursorMan.showMouse(false);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _directions[_vm->_animation->_direction], 0, 161);
+	CursorMan.showMouse(true);
+}
+
+
+void Avalot::gameOver() {
+	_userMovesAvvy = false;
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	int16 sx = avvy->_x;
+	int16 sy = avvy->_y;
+
+	avvy->remove();
+	avvy->init(12, true, _vm->_animation); // 12 = Avalot falls
+	avvy->_stepNum = 0;
+	avvy->appear(sx, sy, 0);
+
+	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
+	_alive = false;
+}
+
+void Avalot::minorRedraw() {
+	dusk();
+
+	enterRoom(_room, 0); // Ped unknown or non-existant.
+
+	for (int i = 0; i < 3; i++)
+		_scoreToDisplay[i] = -1; // impossible digits
+	drawScore();
+
+	dawn();
+}
+
+void Avalot::majorRedraw() {
+	warning("STUB: Avalot::major_redraw()");
+}
+
+uint16 Avalot::bearing(byte whichPed) {
+	static const double rad2deg = 180 / 3.14; // Pi
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	PedType *curPed = &_peds[whichPed];
+
+	if (avvy->_x == curPed->_x)
+		return 0;
+	else if (avvy->_x < curPed->_x) {
+		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 90);
+	} else {
+		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 270);
+	}
+}
+
+/** 
+ * @remarks	Originally called 'sprite_run'
+ */
+void Avalot::spriteRun() {
+	_doingSpriteRun = true;
+	_vm->_animation->animLink();
+	_doingSpriteRun = false;
+}
+
+void Avalot::fixFlashers() {
+	_ledStatus = 177;
+	_vm->_animation->_oldDirection = 177;
+	_vm->_dialogs->setReadyLight(2);
+	drawDirection();
+}
+
+Common::String Avalot::intToStr(int32 num) {
+	return Common::String::format("%d", num);
+}
+
+void Avalot::newMouse(byte id) {
+	if (id == _currentMouse)
+		return;
+
+	_currentMouse = id;
+	loadMouse(id);
+}
+
+/**
+ * Set the mouse pointer to 'HourGlass"
+ * @remarks	Originally called 'wait'
+ */
+void Avalot::setMousePointerWait() {
+	newMouse(4);
+}
+
+void Avalot::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
+	warning("STUB: Avalot::shadow()");
+}
+
+void Avalot::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
+	warning("STUB: Avalot::shbox()");
+}
+
+void Avalot::resetVariables() {
+// Replaces memset(&_dna, 0, sizeof(DnaType));
+	_vm->_animation->_direction = 0;
+	_carryNum = 0;
+	for (int i = 0; i < kObjectNum; i++)
+		_objects[i] = false;
+
+	_dnascore = 0;
+	_money = 0;
+	_room = kRoomNowhere;
+	_wearing = 0;
+	_sworeNum = 0;
+	_saveNum = 0;
+	for (int i = 0; i < 100; i++)
+		_roomCount[i] = 0;
+
+	_alcoholLevel = 0;
+	_playedNim = 0;
+	_wonNim = false;
+	_wineState = 0;
+	_cwytalotGone = false;
+	_passwordNum = 0;
+	_aylesIsAwake = false;
+	_drawbridgeOpen = 0;
+	_avariciusTalk = 0;
+	_boughtOnion = false;
+	_rottenOnion = false;
+	_onionInVinegar = false;
+	_givenToSpludwick = 0;
+	_brummieStairs = 0;
+	_cardiffQuestionNum = 0;
+	_passedCwytalotInHerts = false;
+	_avvyIsAwake = false;
+	_avvyInBed = false;
+	_userMovesAvvy = false;
+	_npcFacing = 0;
+	_givenBadgeToIby = false;
+	_friarWillTieYouUp = false;
+	_tiedUp = false;
+	_boxContent = 0;
+	_talkedToCrapulus = false;
+	_jacquesState = 0;
+	_bellsAreRinging = false;
+	_standingOnDais = false;
+	_takenPen = false;
+	_arrowTriggered = false;
+	_arrowInTheDoor = false;
+	_favouriteDrink = "";
+	_favouriteSong = "";
+	_worstPlaceOnEarth = "";
+	_spareEvening = "";
+	_totalTime = 0;
+	_jumpStatus = 0;
+	_mushroomGrowing = false;
+	_spludwickAtHome = false;
+	_lastRoom = 0;
+	_lastRoomNotMap = 0;
+	_crapulusWillTell = false;
+	_enterCatacombsFromLustiesRoom = false;
+	_teetotal = false;
+	_malagauche = 0;
+	_drinking = 0;
+	_enteredLustiesRoomAsMonk = false;
+	_catacombX = 0;
+	_catacombY = 0;
+	_avvysInTheCupboard = false;
+	_geidaFollows = false;
+	_geidaSpin = 0;
+	_geidaTime = 0;
+	_nextBell = 0;
+	_givenPotionToGeida = false;
+	_lustieIsAsleep = false;
+	_flipToWhere = 0;
+	_flipToPed = 0;
+	_beenTiedUp = false;
+	_sittingInPub = false;
+	_spurgeTalkCount = 0;
+	_metAvaroid = false;
+	_takenMushroom = false;
+	_givenPenToAyles = false;
+	_askedDogfoodAboutNim = false;
+}
+
+void Avalot::newGame() {
+	for (int i = 0; i < kMaxSprites; i++) {
+		AnimationType *spr = &_vm->_animation->_sprites[i];
+		if (spr->_quick)
+			spr->remove();
+	}
+	// Deallocate sprite. Sorry, beta testers!
+
+	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	avvy->init(0, true, _vm->_animation);
+
+	_alive = true;
+	resetVariables();
+
+	_vm->_dialogs->setBubbleStateNatural();
+
+	_spareEvening = "answer a questionnaire";
+	_favouriteDrink = "beer";
+	_money = 30; // 2/6
+	_vm->_animation->_direction = Animation::kDirStopped;
+	_wearing = kObjectClothes;
+	_objects[kObjectMoney - 1] = true;
+	_objects[kObjectBodkin - 1] = true;
+	_objects[kObjectBell - 1] = true;
+	_objects[kObjectClothes - 1] = true;
+
+	_thinkThing = true;
+	_thinks = 2;
+	refreshObjectList();
+	_onToolbar = false;
+	_seeScroll = false;
+
+	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
+	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
+	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
+	_him = Parser::kPardon;
+	_her = Parser::kPardon;
+	_it = Parser::kPardon;
+	_lastPerson = Parser::kPardon; // = Pardon?
+	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_userMovesAvvy = false;
+	_doingSpriteRun = false;
+	_avvyInBed = true;
+	_enidFilename = "";
+
+	enterRoom(1, 1);
+	avvy->_visible = false;
+	drawScore();
+	_vm->_menu->setup();
+	_clock.update();
+	spriteRun();
+}
+
+void Avalot::slowDown() {
+	warning("STUB: Avalot::slowdown()");
+}
+
+bool Avalot::setFlag(char x) {
+	for (uint16 i = 0; i < _flags.size(); i++) {
+		if (_flags[i] == x)
+			return true;
+	}
+
+	return false;
+}
+
+bool Avalot::decreaseMoney(uint16 howmuchby) {
+	_money -= howmuchby;
+	if (_money < 0) {
+		_vm->_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
+		gameOver();
+		return false;
+	} else
+		return true;
+}
+
+Common::String Avalot::getName(byte whose) {
+	static const Common::String kLads[17] = {
+		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
+		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
+		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+	};
+
+	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
+
+	if (whose < 175)
+		return kLads[whose - 150];
+	else
+		return kLasses[whose - 175];
+}
+
+byte Avalot::getNameChar(byte whose) {
+	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
+	static const char kLassChar[] = "kG\0xB1o";
+
+	if (whose < 175)
+		return kLadChar[whose - 150];
+	else
+		return kLassChar[whose - 175];
+}
+
+Common::String Avalot::getThing(byte which) {
+	static const Common::String kThings[kObjectNum] = {
+		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+	};
+
+	Common::String get_thing_result;
+	switch (which) {
+	case kObjectWine:
+		switch (_wineState) {
+		case 1:
+		case 4:
+			get_thing_result = kThings[which - 1];
+			break;
+		case 3:
+			get_thing_result = "Vinegar";
+			break;
+		}
+		break;
+	case kObjectOnion:
+		if (_rottenOnion)
+			get_thing_result = "rotten onion";
+		else
+			get_thing_result = kThings[which - 1];
+		break;
+	default:
+		get_thing_result = kThings[which - 1];
+	}
+	return get_thing_result;
+}
+
+char Avalot::getThingChar(byte which) {
+	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+
+	char get_thingchar_result;
+	switch (which) {
+	case kObjectWine:
+		if (_wineState == 3)
+			get_thingchar_result = 'V'; // Vinegar
+		else
+			get_thingchar_result = kThingsChar[which - 1];
+		break;
+	default:
+		get_thingchar_result = kThingsChar[which - 1];
+	}
+	return get_thingchar_result;
+}
+
+Common::String Avalot::getItem(byte which) {
+	static const Common::String kItems[kObjectNum] = {
+		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
+		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
+		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
+		"an onion"
+	};
+
+	Common::String get_better_result;
+	if (which > 150)
+		which -= 149;
+
+	switch (which) {
+	case kObjectWine:
+		switch (_wineState) {
+		case 0:
+		case 1:
+		case 4:
+			get_better_result = kItems[which - 1];
+			break;
+		case 3:
+			get_better_result = "some vinegar";
+			break;
+		}
+		break;
+	case kObjectOnion:
+		if (_rottenOnion)
+			get_better_result = "a rotten onion";
+		else if (_onionInVinegar)
+			get_better_result = "a pickled onion (in the vinegar)";
+		else
+			get_better_result = kItems[which - 1];
+		break;
+	default:
+		if ((which < kObjectNum) && (which > 0))
+			get_better_result = kItems[which - 1];
+		else
+			get_better_result = "";
+	}
+	return get_better_result;
+}
+
+
+Common::String Avalot::f5Does() {
+	switch (_room) {
+	case kRoomYours:
+		if (!_avvyIsAwake)
+			return Common::String::format("%cWWake up", Parser::kVerbCodeWake);
+		else if (_avvyInBed)
+			return Common::String::format("%cGGet up", Parser::kVerbCodeStand);
+		break;
+	case kRoomInsideCardiffCastle:
+		if (_standingOnDais)
+			return Common::String::format("%cCClimb down", Parser::kVerbCodeClimb);
+		else
+			return Common::String::format("%cCClimb up", Parser::kVerbCodeClimb);
+		break;
+	case kRoomNottsPub:
+		if (_sittingInPub)
+			return Common::String::format("%cSStand up", Parser::kVerbCodeStand);
+		else
+			return Common::String::format("%cSSit down", Parser::kVerbCodeSit);
+		break;
+	case kRoomMusicRoom:
+		if (_vm->_animation->inField(5))
+			return Common::String::format("%cPPlay the harp", Parser::kVerbCodePlay);
+		break;
+	}
+
+	return Common::String::format("%c", _vm->_parser->kPardon); // If all else fails...
+}
+
+void Avalot::loadMouse(byte which) {
+	Common::File f;
+
+	if (!f.open("mice.avd"))
+		error("AVALANCHE: Gyro: File not found: mice.avd");
+
+	::Graphics::Surface cursor;
+	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
+	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
+
+
+	// The AND mask.
+	f.seek(kMouseSize * 2 * which + 134);
+
+	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			for (int k = 0; k < 2; k++) {
+				if (*(byte *)mask.getBasePtr(i, j) == 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
+			}
+		}
+	}
+
+	mask.free();
+
+	// The OR mask.
+	f.seek(kMouseSize * 2 * which + 134 * 2);
+
+	mask = _vm->_graphics->loadPictureGraphic(f);
+
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			for (int k = 0; k < 2; k++) {
+				byte pixel = *(byte *)mask.getBasePtr(i, j);
+				if (pixel != 0)
+					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
+			}
+		}
+	}
+
+	mask.free();
+	f.close();
+
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which]._horizontal, kMouseHotSpots[which]._vertical * 2, 255, false);
+	cursor.free();
+}
+
+void Avalot::setBackgroundColor(byte x) {
+	warning("STUB: Avalot::background()");
+}
+
+void Avalot::hangAroundForAWhile() {
+	for (int i = 0; i < 28; i++)
+		slowDown();
+}
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 1f20466..51be1a3 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -32,20 +32,412 @@
 
 #include "common/events.h"
 #include "common/system.h"
+#include "common/str.h"
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "graphics/surface.h"
 
 namespace Avalanche {
 class AvalancheEngine;
 
+class Clock {
+public:
+	Clock(AvalancheEngine *vm);
+
+	void update();
+	
+private:
+	static const int kCenterX = 510;
+	static const int kCenterY = 183;
+
+	AvalancheEngine *_vm;
+
+	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
+	Common::Point _clockHandHour, _clockHandMinute;
+
+	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
+	void drawHand(const Common::Point &endPoint, byte color);
+	void plotHands();
+	void chime();
+};
+
+enum Color {
+	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
+	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
+	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
+	kColorWhite
+};
+
+// CHECKME: kRoomBossKey is a guess
+enum Room {
+	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
+	kRoomYourHall = 5,      kRoomMusicRoom = 7,    kRoomOutsideArgentPub = 9,      kRoomArgentRoad = 10,
+	kRoomWiseWomans = 11,   kRoomSpludwicks = 12,  kRoomInsideAbbey = 13,          kRoomOutsideAbbey = 14,
+	kRoomAvvysGarden = 15,  kRoomAylesOffice = 16, kRoomArgentPub = 19,            kRoomBrummieRoad = 20,
+	kRoomBridge = 21,       kRoomLusties = 22,     kRoomLustiesRoom = 23,          kRoomWestHall = 25,
+	kRoomEastHall = 26,     kRoomOubliette = 27,   kRoomGeidas = 28,               kRoomCatacombs = 29,
+	kRoomEntranceHall = 40, kRoomRobins = 42,      kRoomOutsideNottsPub = 46,      kRoomNottsPub = 47,
+	kRoomOutsideDucks = 50, kRoomDucks = 51,       kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71,
+	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
+};
+
+static const byte kObjectNum = 18; // always preface with a #
+static const int16 kCarryLimit = 12;  // carry limit
+
+static const int16 kNumlockCode = 32;  // Code for Num Lock
+static const int16 kMouseSize = 134;
+
+struct MouseHotspotType { // mouse-void
+	int16 _horizontal, _vertical;
+};
+
+struct PedType {
+	int16 _x, _y;
+	byte _direction;
+};
+
+struct MagicType {
+	byte _operation; // one of the operations
+	uint16 _data; // data for them
+};
+
+class FieldType {
+public:
+	int16 _x1, _y1, _x2, _y2;
+};
+
+struct ByteField {
+	byte _x1, _y1, _x2, _y2;
+};
+
+class LineType : public FieldType {
+public:
+	byte _color;
+};
+
+typedef int8 TuneType[31];
+
+struct QuasipedType {
+	byte _whichPed, _foregroundColor, _room, _backgroundColor;
+	uint16 _who;
+};
+
+#if 0
+struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA.
+	Common::String _qEnidFilename;
+	bool _qSoundFx;
+	byte _qThinks;
+	bool _qThinkThing;
+};
+#endif
+
 class Avalot {
 public:
+	// Objects you can hold:
+	enum Object {
+		kObjectWine = 1,
+		kObjectMoney,
+		kObjectBodkin,
+		kObjectPotion,
+		kObjectChastity,
+		kObjectBolt,
+		kObjectCrossbow,
+		kObjectLute,
+		kObjectBadge,
+		kObjectMushroom,
+		kObjectKey,
+		kObjectBell,
+		kObjectPrescription,
+		kObjectPen,
+		kObjectInk,
+		kObjectClothes,
+		kObjectHabit,
+		kObjectOnion
+	};
+
+	// People who hang around this game.
+	enum People {
+		// Boys:
+		kPeopleAvalot = 150,
+		kPeopleSpludwick = 151,
+		kPeopleCrapulus = 152,
+		kPeopleDrDuck = 153,
+		kPeopleMalagauche = 154,
+		kPeopleFriarTuck = 155,
+		kPeopleRobinHood = 156,
+		kPeopleCwytalot = 157,
+		kPeopleDuLustie = 158,
+		kPeopleDuke = 159,
+		kPeopleDogfood = 160,
+		kPeopleTrader = 161,
+		kPeopleIbythneth = 162,
+		kPeopleAyles = 163,
+		kPeoplePort = 164,
+		kPeopleSpurge = 165,
+		kPeopleJacques = 166,
+		// Girls:
+		kPeopleArkata = 175,
+		kPeopleGeida = 176,
+		kPeopleInvisible = 177,
+		kPeopleWisewoman = 178
+	};
+
+	static const int16 kXW = 30;
+	static const int16 kYW = 36; // x width & y whatsit
+	static const int16 kMargin = 5;
+	static const MouseHotspotType kMouseHotSpots[9];
+	static const int16 kMaxSprites = 2; // Current max no. of sprites.
+
+	// For Thinkabout:
+	static const bool kThing = true;
+	static const bool kPerson = false;
+
+	// Magic/portal constants:
+	enum Magics {
+		kMagicNothing, // Ignore it if this line is touched.
+		kMagicBounce, // Bounce off this line. Not valid for portals.
+		kMagicExclaim, // Put up a chain of scrolls.
+		kMagicTransport, // Enter new room.
+		kMagicUnfinished, // Unfinished connection.
+		kMagicSpecial, // Special function.
+		kMagicOpenDoor // Opening door.
+	};
+
+	// These following static constants should be included in CFG when it's written.
+
+	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
+	static const int16 kBorder = 1; // size of border on shadowboxes
+	static const int16 kWalk = 3;
+	static const int16 kRun = 5;
+	static const int32 kCatacombMap[8][8];
+	static const char kSpludwicksOrder[3];
+	static const QuasipedType kQuasipeds[16];
+
+	enum Pitch {
+		kPitchInvalid,
+		kPitchLower,
+		kPitchSame,
+		kPitchHigher
+	};
+
+	static const uint16 kNotes[12];
+	static const TuneType kTune;
+
+	static const char *kVersionNum;
+	static const char *kCopyright;
+	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
+	static const int16 kGameCode = 2; // Avalot's code number
+
+
+
 	Avalot(AvalancheEngine *vm);
+	~Avalot();
+
+	bool _holdLeftMouse;
+	Clock _clock;
+	
+	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
+	// If a scroll comes up, or you leave the room, it's automatically set to zero.
+	byte _interrogation;
+	static byte _whereIs[29];
+
+	// Former DNA structure
+	byte _carryNum; // How many objects you're carrying...
+	bool _objects[kObjectNum]; // ...and which ones they are.
+	int16 _dnascore; // your score, of course
+	int32 _money; // your current amount of dosh
+	byte _room; // your current room
+	byte _wearing; // what you're wearing
+	byte _sworeNum; // number of times you've sworn
+	byte _saveNum; // number of times this game has been saved
+	byte _roomCount[100]; // Add one to each every time you enter a room
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _wonNim; // Have you *won* Nim? (That's harder.)
+	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
+	byte _passwordNum; // Number of the passw for this game.
+	bool _aylesIsAwake; // pretty obvious!
+	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
+	byte _avariciusTalk; // How much Avaricius has said to you.
+	bool _boughtOnion; // Have you bought an onion yet?
+	bool _rottenOnion; // And has it rotted?
+	bool _onionInVinegar; // Is the onion in the vinegar?
+	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
+	byte _brummieStairs; // Progression through the stairs trick.
+	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool _avvyInBed; // True if Avvy's in bed, but awake.
+	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
+	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
+	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
+	bool _friarWillTieYouUp; // If you're going to get tied up.
+	bool _tiedUp; // You ARE tied up!
+	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
+	bool _talkedToCrapulus; // Pretty self-explanatory.
+	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
+	bool _bellsAreRinging; // Is Jacques ringing the bells?
+	bool _standingOnDais; // In room 71, inside Cardiff Castle.
+	bool _takenPen; // Have you taken the pen (in Cardiff?)
+	bool _arrowTriggered; // And has the arrow been triggered?
+	bool _arrowInTheDoor;  // Did the arrow hit the wall?
+	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
+	uint32 _totalTime; // Your total time playing this game, in ticks.
+	byte _jumpStatus; // Fixes how high you're jumping.
+	bool _mushroomGrowing; // Is the mushroom growing in 42?
+	bool _spludwickAtHome; // Is Spludwick at home?
+	byte _lastRoom;
+	byte _lastRoomNotMap;
+	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
+	bool _enterCatacombsFromLustiesRoom;
+	bool _teetotal; // Are we touching any more drinks?
+	byte _malagauche; // Position of Malagauche. See Celer for more info.
+	char _drinking; // What's he getting you?
+	bool _enteredLustiesRoomAsMonk;
+	byte _catacombX, _catacombY;   // XY coords in the catacombs.
+	bool _avvysInTheCupboard; // On screen 22.
+	bool _geidaFollows; // Is Geida following you?
+	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
+	byte _nextBell; // For the ringing.
+	bool _givenPotionToGeida; // Does Geida have the potion?
+	bool _lustieIsAsleep; // Is BDL asleep?
+	byte _flipToWhere, _flipToPed; // For the sequencer.
+	bool _beenTiedUp; // In r__Robins.
+	bool _sittingInPub; // Are you sitting down in the pub?
+	byte _spurgeTalkCount; // Count for talking to Spurge.
+	bool _metAvaroid;
+	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
+	// End of former DNA Structure
+
+	byte _lineNum; // Number of lines.
+	LineType _lines[50]; // For Also.
+	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
+	bool _dropsOk, _scReturn, _soundFx, _cheat;
+	Common::String _mouseText;
+	bool _weirdWord;
+	bool _letMeOut;
+	Common::String _scroll[15];
+	byte _scrollNum, _whichwas;
+	byte _thinks;
+	bool _thinkThing;
+	int16 _talkX, _talkY;
+	byte _talkBackgroundColor, _talkFontColor;
+	byte _scrollBells; // no. of times to ring the bell
+	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
+	char _objectList[10];
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	// Called .free() for them in ~Gyro().
+	int8 _scoreToDisplay[3];
+	byte _currentMouse; // current mouse-void
+	Common::String _verbStr; // what you can do with your object. :-)
+	Common::String *_also[31][2];
+	PedType _peds[15];
+	MagicType _magics[15];
+	MagicType _portals[7];
+	FieldType _fields[30];
+	byte _fieldNum;
+	Common::String _flags;
+	Common::String _listen;
+	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
+	byte _cp, _ledStatus, _defaultLed;
+	FontType _font;
+	bool _alive;
+	byte _buffer[2000];
+	uint16 _bufSize;
+	int16 _underScroll; // Y-coord of just under the scroll text.
+	Common::String _roomnName; // Name of actual room
+	Common::String _subject; // What you're talking to them about.
+	byte _subjectNum; // The same thing.
+	bool _keyboardClick; // Is a keyboard click noise wanted?
+	byte _him, _her, _it;
+	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
+
+	byte _lastPerson; // Last person to have been selected using the People menu.
+	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
+	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
+	bool _isLoaded; // Is it a loaded gamestate?
+	Common::String _enidFilename;
 
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 	void setup();
 	void runAvalot();
 
+	void init();
+	void callVerb(byte id);
+	void drawAlsoLines();
+	void loadRoom(byte num);
+	void exitRoom(byte x);
+	void enterRoom(byte room, byte ped);
+	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
+	void loadDigits(); // Load the scoring digits & rwlites
+	void drawToolbar();
+	void drawScore();
+	void incScore(byte num); // Add on no. of points
+	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
+	void fxToggle();
+	void refreshObjectList();
+	void checkClick();
+	void errorLed();
+	void dusk();
+	void dawn();
+	void drawDirection(); // Draws the little icon at the left end of the text input field.
+	void gameOver();
+	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
+	void fixFlashers();
+	void loadAlso(byte num);
+
+	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
+	void minorRedraw();
+	void majorRedraw();
+
+	void spriteRun();
+
+	Common::String intToStr(int32 num);
+	void newMouse(byte id);
+	void setMousePointerWait();    // Makes hourglass.
+	void loadMouse(byte which);
+
+	void setBackgroundColor(byte x);
+	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
+
+	void resetVariables();
+	void newGame(); // This sets up the DNA for a completely new game.
+	void slowDown();
+	bool setFlag(char x);
+	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
+	void hangAroundForAWhile();
+	
+	Common::String getName(byte whose);
+	byte getNameChar(byte whose);
+	Common::String getThing(byte which);
+	char getThingChar(byte which);
+	Common::String getItem(byte which); // Called get_better in the original.
+	Common::String f5Does(); // This procedure determines what f5 does.
+
 private:
 	AvalancheEngine *_vm;
+
+	Common::File file;
+	Common::String readAlsoStringFromFile();
+	void scram(Common::String &str);
+	void unScramble();
+
+	void zoomOut(int16 x, int16 y); // Only used when entering the map.
+	void enterNewTown();
+	void findPeople(byte room);
+	void putGeidaAt(byte whichPed, byte ped);
+	void guideAvvy(Common::Point cursorPos);
+
+	// Will be used in dusk() and dawn().
+	bool _fxHidden;
+
+	int8 fades(int8 x);
+	void fadeOut(byte n);
+	void fadeIn(byte n);
+
+	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 3a70fd7..9da9161 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -30,8 +30,6 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/background.h"
 #include "avalanche/animation.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
 
 #include "common/textconsole.h"
 
@@ -55,28 +53,28 @@ void Background::updateBackgroundSprites() {
 	if (_vm->_menu->isActive())
 		return; // No animation when the menus are up.
 
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomOutsideArgentPub:
-		if ((_vm->_gyro->_roomTime % 12) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 4);
+		if ((_vm->_avalot->_roomTime % 12) == 0)
+			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 12) % 4);
 		break;
 	case kRoomBrummieRoad:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 2) % 4);
+		if ((_vm->_avalot->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 2) % 4);
 		break;
 	case kRoomBridge:
-		if ((_vm->_gyro->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 3 + (_vm->_gyro->_roomTime / 2) % 4);
+		if ((_vm->_avalot->_roomTime % 2) == 0)
+			drawBackgroundSprite(-1, -1, 3 + (_vm->_avalot->_roomTime / 2) % 4);
 		break;
 	case kRoomYours:
-		if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0))
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 2);
+		if ((!_vm->_avalot->_avvyIsAwake) && ((_vm->_avalot->_roomTime % 4) == 0))
+			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 12) % 2);
 		break;
 	case kRoomArgentPub:
-		if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) {
+		if (((_vm->_avalot->_roomTime % 7) == 1) && (_vm->_avalot->_malagauche != 177)) {
 			// Malagauche cycle.
-			_vm->_gyro->_malagauche += 1;
-			switch (_vm->_gyro->_malagauche) {
+			_vm->_avalot->_malagauche += 1;
+			switch (_vm->_avalot->_malagauche) {
 			case 1:
 			case 11:
 			case 21:
@@ -92,12 +90,12 @@ void Background::updateBackgroundSprites() {
 				drawBackgroundSprite(-1, -1, 12); // Winks.
 				break;
 			case 33:
-				_vm->_gyro->_malagauche = 0;
+				_vm->_avalot->_malagauche = 0;
 				break;
 			}
 		}
 
-		switch (_vm->_gyro->_roomTime % 200) {
+		switch (_vm->_avalot->_roomTime % 200) {
 		case 179:
 		case 197:
 			drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle.
@@ -110,13 +108,13 @@ void Background::updateBackgroundSprites() {
 			drawBackgroundSprite(-1, -1, 6);
 			break;
 		case 199:
-			_vm->_gyro->_npcFacing = 177; // Impossible value for this.
+			_vm->_avalot->_npcFacing = 177; // Impossible value for this.
 			break;
 		}
 
-		if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally.
+		if ((_vm->_avalot->_roomTime % 200 >= 0) && (_vm->_avalot->_roomTime % 200 <= 178)) { // Normally.
 			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(1);
+			uint16 angle = _vm->_avalot->bearing(1);
 			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
 				direction = 3;
 			else if ((angle >= 293) && (angle <= 357))
@@ -124,15 +122,15 @@ void Background::updateBackgroundSprites() {
 			else if ((angle >= 271) && (angle <= 292))
 				direction = 4;
 
-			if (direction != _vm->_gyro->_npcFacing) { // Dogfood.
+			if (direction != _vm->_avalot->_npcFacing) { // Dogfood.
 				drawBackgroundSprite(-1, -1, direction - 1);
-				_vm->_gyro->_npcFacing = direction;
+				_vm->_avalot->_npcFacing = direction;
 			}
 		}
 		break;
 	case kRoomWestHall:
-		if ((_vm->_gyro->_roomTime % 3) == 0) {
-			switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) {
+		if ((_vm->_avalot->_roomTime % 3) == 0) {
+			switch ((_vm->_avalot->_roomTime / int32(3)) % int32(6)) {
 			case 4:
 				drawBackgroundSprite(-1, -1, 0);
 				break;
@@ -149,10 +147,10 @@ void Background::updateBackgroundSprites() {
 		}
 		break;
 	case kRoomLustiesRoom:
-		if (!(_vm->_gyro->_lustieIsAsleep)) {
+		if (!(_vm->_avalot->_lustieIsAsleep)) {
 			byte direction = 0;
-			uint16 angle = _vm->_lucerna->bearing(1);
-			if ((_vm->_gyro->_roomTime % 45) > 42)
+			uint16 angle = _vm->_avalot->bearing(1);
+			if ((_vm->_avalot->_roomTime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
 			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
@@ -162,15 +160,15 @@ void Background::updateBackgroundSprites() {
 			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
-			if (direction != _vm->_gyro->_npcFacing) { // du Lustie.
+			if (direction != _vm->_avalot->_npcFacing) { // du Lustie.
 				drawBackgroundSprite(-1, -1, direction - 1);
-				_vm->_gyro->_npcFacing = direction;
+				_vm->_avalot->_npcFacing = direction;
 			}
 		}
 		break;
 	case kRoomAylesOffice:
-		if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) {
-			switch ((_vm->_gyro->_roomTime / 14) % 2) {
+		if ((!_vm->_avalot->_aylesIsAwake) && (_vm->_avalot->_roomTime % 14 == 0)) {
+			switch ((_vm->_avalot->_roomTime / 14) % 2) {
 			case 0:
 				drawBackgroundSprite(-1, -1, 0);  // Frame 2: EGA.
 				break;
@@ -181,8 +179,8 @@ void Background::updateBackgroundSprites() {
 		}
 		break;
 	case kRoomRobins:
-		if (_vm->_gyro->_tiedUp) {
-			switch (_vm->_gyro->_roomTime % 54) {
+		if (_vm->_avalot->_tiedUp) {
+			switch (_vm->_avalot->_roomTime % 54) {
 			case 20:
 				drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks.
 				break;
@@ -195,7 +193,7 @@ void Background::updateBackgroundSprites() {
 	case kRoomNottsPub: {
 		// Bearing of Avvy from Port.
 		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(4);
+		uint16 angle = _vm->_avalot->bearing(4);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 2; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
@@ -203,15 +201,15 @@ void Background::updateBackgroundSprites() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_gyro->_roomTime % 60) > 57)
+		if ((_vm->_avalot->_roomTime % 60) > 57)
 			direction--; // Blinks.
 
-		if (direction != _vm->_gyro->_npcFacing) { // Port.
+		if (direction != _vm->_avalot->_npcFacing) { // Port.
 			drawBackgroundSprite(-1, -1, direction - 1);
-			_vm->_gyro->_npcFacing = direction;
+			_vm->_avalot->_npcFacing = direction;
 		}
 
-		switch (_vm->_gyro->_roomTime % 50) {
+		switch (_vm->_avalot->_roomTime % 50) {
 		case 45 :
 			drawBackgroundSprite(-1, -1, 8); // Spurge blinks.
 			break;
@@ -222,12 +220,12 @@ void Background::updateBackgroundSprites() {
 		break;
 	  }
 	case kRoomDucks: {
-		if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 3) % 3);
+		if ((_vm->_avalot->_roomTime % 3) == 0) // The fire flickers.
+			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 3) % 3);
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
-		uint16 angle = _vm->_lucerna->bearing(1);
+		uint16 angle = _vm->_avalot->bearing(1);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 4; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
@@ -235,26 +233,26 @@ void Background::updateBackgroundSprites() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_gyro->_roomTime % 45) > 42)
+		if ((_vm->_avalot->_roomTime % 45) > 42)
 			direction++; // Duck blinks.
 
-		if (direction != _vm->_gyro->_npcFacing) { // Duck.
+		if (direction != _vm->_avalot->_npcFacing) { // Duck.
 			drawBackgroundSprite(-1, -1, direction - 1);
-			_vm->_gyro->_npcFacing = direction;
+			_vm->_avalot->_npcFacing = direction;
 		}
 		break;
 	   }
 	}
 
-	if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
+	if ((_vm->_avalot->_bellsAreRinging) && (_vm->_avalot->setFlag('B'))) {
 		// They're ringing the bells.
-		switch (_vm->_gyro->_roomTime % 4) {
+		switch (_vm->_avalot->_roomTime % 4) {
 		case 1:
-			if (_vm->_gyro->_nextBell < 5)
-				_vm->_gyro->_nextBell = 12;
-			_vm->_gyro->_nextBell--;
+			if (_vm->_avalot->_nextBell < 5)
+				_vm->_avalot->_nextBell = 12;
+			_vm->_avalot->_nextBell--;
 			// CHECKME: 2 is a guess. No length in the original? 
-			_vm->_sound->playNote(_vm->_gyro->kNotes[_vm->_gyro->_nextBell], 2);
+			_vm->_sound->playNote(_vm->_avalot->kNotes[_vm->_avalot->_nextBell], 2);
 			break;
 		case 2:
 			_vm->_sound->stopSound();
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 39f177e..8221484 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -29,8 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/closing.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
 
 #include "common/textconsole.h"
 #include "common/random.h"
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 69a3984..3004f62 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -29,8 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/dialogs.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
 #include "avalanche/timer.h"
 
@@ -50,7 +48,7 @@ void Dialogs::init() {
 }
 
 void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
-	if (_vm->_gyro->_ledStatus == state)
+	if (_vm->_avalot->_ledStatus == state)
 		return; // Already like that!
 
 	byte color = kColorBlack;
@@ -71,7 +69,7 @@ void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
 	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 
 	CursorMan.showMouse(true);
-	_vm->_gyro->_ledStatus = state;
+	_vm->_avalot->_ledStatus = state;
 }
 
 void Dialogs::easterEgg() {
@@ -116,8 +114,8 @@ void Dialogs::scrollModeNormal() {
 	Common::String e = "(c) 1994";
 
 	setReadyLight(3);
-	_vm->_gyro->_seeScroll = true;
-	_vm->_gyro->newMouse(3);
+	_vm->_avalot->_seeScroll = true;
+	_vm->_avalot->newMouse(3);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -145,7 +143,7 @@ void Dialogs::scrollModeNormal() {
 	bool oktoexit;
 	do {
 		do {
-			_vm->_gyro->check(); // was "checkclick;"
+			_vm->_avalot->check(); // was "checkclick;"
 
 //#ifdef RECORD slowdown(); basher::count += 1; #endif
 
@@ -170,12 +168,12 @@ void Dialogs::scrollModeNormal() {
 
 //#ifdef RECORD record_one(); #endif
 
-	_vm->_gyro->screturn = r == '#'; // "back door"
+	_vm->_avalot->screturn = r == '#'; // "back door"
 #endif
 
 	setReadyLight(0);
-	_vm->_gyro->_seeScroll = false;
-	_vm->_lucerna->_holdLeftMouse = false; // Used in Lucerna::checkclick().
+	_vm->_avalot->_seeScroll = false;
+	_vm->_avalot->_holdLeftMouse = false; // Used in Lucerna::checkclick().
 
 	warning("STUB: Scrolls::scrollModeNormal()");
 }
@@ -193,7 +191,7 @@ bool Dialogs::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
 	for (unsigned int i = 0; i < sizeof(played); i++) {
-		if (played[i] != _vm->_gyro->kTune[i])
+		if (played[i] != _vm->_avalot->kTune[i])
 			mistakes += 1;
 	}
 
@@ -202,16 +200,16 @@ bool Dialogs::theyMatch(TuneType &played) {
 
 void Dialogs::scrollModeMusic() {
 	setReadyLight(3);
-	_vm->_gyro->_seeScroll = true;
+	_vm->_avalot->_seeScroll = true;
 	CursorMan.showMouse(false);
-	_vm->_gyro->newMouse(3);
+	_vm->_avalot->newMouse(3);
 
 	TuneType played;
 	for (unsigned int i = 0; i < sizeof(played); i++)
-		played[i] = Gyro::kPitchInvalid;
+		played[i] = Avalot::kPitchInvalid;
 	int8 lastOne = -1, thisOne = -1; // Invalid values.
 
-	_vm->_gyro->_seeScroll = true;
+	_vm->_avalot->_seeScroll = true;
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -282,16 +280,16 @@ void Dialogs::scrollModeMusic() {
 				lastOne = thisOne;
 				thisOne = value;
 
-				_vm->_sound->playNote(_vm->_gyro->kNotes[thisOne], 100);
+				_vm->_sound->playNote(_vm->_avalot->kNotes[thisOne], 100);
 				_vm->_system->delayMillis(200);
 
-				if (!_vm->_gyro->_bellsAreRinging) { // These handle playing the right tune.
+				if (!_vm->_avalot->_bellsAreRinging) { // These handle playing the right tune.
 					if (thisOne < lastOne)
-						store(Gyro::kPitchLower, played);
+						store(Avalot::kPitchLower, played);
 					else if (thisOne == lastOne)
-						store(Gyro::kPitchSame, played);
+						store(Avalot::kPitchSame, played);
 					else
-						store(Gyro::kPitchHigher, played);
+						store(Avalot::kPitchHigher, played);
 				}
 				
 				if (theyMatch(played)) {
@@ -304,30 +302,30 @@ void Dialogs::scrollModeMusic() {
 
 	_vm->_graphics->_surface.copyFrom(temp);
 	temp.free();
-	_vm->_gyro->_seeScroll = false;
+	_vm->_avalot->_seeScroll = false;
 	CursorMan.showMouse(true);
 }
 
 void Dialogs::resetScrollDriver() {
-	_vm->_gyro->_scrollBells = 0;
+	_vm->_avalot->_scrollBells = 0;
 	_currentFont = kFontStyleRoman;
 	_useIcon = 0;
-	_vm->_gyro->_interrogation = 0; // Always reset after a scroll comes up.
+	_vm->_avalot->_interrogation = 0; // Always reset after a scroll comes up.
 }
 
 void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (int i = 0; i < _vm->_gyro->_scrollBells; i++)
-		_vm->_lucerna->errorLed(); // Ring the bell "x" times.
+	for (int i = 0; i < _vm->_avalot->_scrollBells; i++)
+		_vm->_avalot->errorLed(); // Ring the bell "x" times.
 }
 
 void Dialogs::dodgem() {
 	_dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(_dodgeCoord.x, _vm->_gyro->_underScroll); // Move the pointer off the scroll.
+	g_system->warpMouse(_dodgeCoord.x, _vm->_avalot->_underScroll); // Move the pointer off the scroll.
 }
 
 void Dialogs::unDodgem() {
 	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_gyro->_underScroll))
+	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_avalot->_underScroll))
 		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
@@ -358,7 +356,7 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 
 #if 0
-	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro->cp) * _vm->_gyro->pagetop);
+	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_avalot->cp) * _vm->_avalot->pagetop);
 	byte bit;
 	for (uint16 i = 1; i <= yl; i++)
 		for (bit = 0; bit <= 3; bit++) {
@@ -378,10 +376,10 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
-	int16 ly = (_vm->_gyro->_scrollNum) * 6;
+	int16 ly = (_vm->_avalot->_scrollNum) * 6;
 	int16 ex;
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		ex = _vm->_gyro->_scroll[i].size() * 8;
+	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
+		ex = _vm->_avalot->_scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
 	}
@@ -447,47 +445,47 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		if (!_vm->_gyro->_scroll[i].empty())
-			switch (_vm->_gyro->_scroll[i][_vm->_gyro->_scroll[i].size() - 1]) {
+	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
+		if (!_vm->_avalot->_scroll[i].empty())
+			switch (_vm->_avalot->_scroll[i][_vm->_avalot->_scroll[i].size() - 1]) {
 			case kControlCenter:
 				centre = true;
-				_vm->_gyro->_scroll[i].deleteLastChar();
+				_vm->_avalot->_scroll[i].deleteLastChar();
 				break;
 			case kControlLeftJustified:
 				centre = false;
-				_vm->_gyro->_scroll[i].deleteLastChar();
+				_vm->_avalot->_scroll[i].deleteLastChar();
 				break;
 			case kControlQuestion:
 				//settextjustify(1, 1);
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
-				_vm->_gyro->_scroll[i].setChar(' ', 0);
+				_vm->_avalot->_scroll[i].setChar(' ', 0);
 				// byte groi = *_vm->_graphics->getPixel(0, 0);
 				// inc(diy,14);
-				_vm->_gyro->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
-				_vm->_gyro->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
+				_vm->_avalot->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
+				_vm->_avalot->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				break;
 			}
 
 		if (centre)
-			say(320 - _vm->_gyro->_scroll[i].size() * 4 + iconIndent, my, _vm->_gyro->_scroll[i]);
+			say(320 - _vm->_avalot->_scroll[i].size() * 4 + iconIndent, my, _vm->_avalot->_scroll[i]);
 		else
-			say(mx + iconIndent, my, _vm->_gyro->_scroll[i]);
+			say(mx + iconIndent, my, _vm->_avalot->_scroll[i]);
 
 		my += 12;
 	}
 
-	_vm->_gyro->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+	_vm->_avalot->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	ringBell();
 	
-	_vm->_gyro->_dropsOk = false;
+	_vm->_avalot->_dropsOk = false;
 	dodgem();
 
 	(this->*modeFunc)();
 
 	unDodgem();
-	_vm->_gyro->_dropsOk = true;
+	_vm->_avalot->_dropsOk = true;
 	
 	resetScrollDriver();
 }
@@ -497,9 +495,9 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
-	int16 yl = _vm->_gyro->_scrollNum * 5;
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		uint16 textWidth = _vm->_gyro->_scroll[i].size() * 8;
+	int16 yl = _vm->_avalot->_scrollNum * 5;
+	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
+		uint16 textWidth = _vm->_avalot->_scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
 	}
@@ -510,55 +508,55 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	int16 my = yw * 2 - 2;
 	int16 xc = 0;
 
-	if ((_vm->_gyro->_talkX - xw) < 0)
-		xc = -(_vm->_gyro->_talkX - xw);
-	if ((_vm->_gyro->_talkX + xw) > 639)
-		xc = 639 - (_vm->_gyro->_talkX + xw);
+	if ((_vm->_avalot->_talkX - xw) < 0)
+		xc = -(_vm->_avalot->_talkX - xw);
+	if ((_vm->_avalot->_talkX + xw) > 639)
+		xc = 639 - (_vm->_avalot->_talkX + xw);
 
-	points[0].x = _vm->_gyro->_talkX - 10;
+	points[0].x = _vm->_avalot->_talkX - 10;
 	points[0].y = yw;
-	points[1].x = _vm->_gyro->_talkX + 10;
+	points[1].x = _vm->_avalot->_talkX + 10;
 	points[1].y = yw;
-	points[2].x = _vm->_gyro->_talkX;
-	points[2].y = _vm->_gyro->_talkY;
+	points[2].x = _vm->_avalot->_talkX;
+	points[2].y = _vm->_avalot->_talkY;
 
 	// Backup the screen before drawing the bubble.
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	// The body of the bubble.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw + 9, 7, _vm->_gyro->_talkX + xw - 8 + xc, my + 1), _vm->_gyro->_talkBackgroundColor);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_gyro->_talkX - xw - 1, 12, _vm->_gyro->_talkX + xw + xc + 2, my - 4), _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_avalot->_talkX - xw + 9, 7, _vm->_avalot->_talkX + xw - 8 + xc, my + 1), _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_avalot->_talkX - xw - 1, 12, _vm->_avalot->_talkX + xw + xc + 2, my - 4), _vm->_avalot->_talkBackgroundColor);
 
 	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, 11, 0, 90, 9, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX + xw - 10, 11, 0, 90, 9, _vm->_avalot->_talkBackgroundColor);
 	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_avalot->_talkBackgroundColor);
 	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, 11, 90, 180, 9, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX - xw + 10, 11, 90, 180, 9, _vm->_avalot->_talkBackgroundColor);
 	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_gyro->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_avalot->_talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_gyro->_talkBackgroundColor);
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_avalot->_talkBackgroundColor);
 
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
-	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Gyro::characters instead.
+	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Avalot::characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i < _vm->_gyro->_scrollNum; i++) {
-		int16 x = xc + _vm->_gyro->_talkX - _vm->_gyro->_scroll[i].size() / 2 * 8;
-		bool offset = _vm->_gyro->_scroll[i].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_gyro->_scroll[i], _vm->_gyro->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_gyro->_talkFontColor);
+	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
+		int16 x = xc + _vm->_avalot->_talkX - _vm->_avalot->_scroll[i].size() / 2 * 8;
+		bool offset = _vm->_avalot->_scroll[i].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_avalot->_scroll[i], _vm->_avalot->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_avalot->_talkFontColor);
 	}
 
 	ringBell();
 	CursorMan.showMouse(false);
-	_vm->_gyro->_dropsOk = false;
+	_vm->_avalot->_dropsOk = false;
 
 	// This does the actual drawing to the screen.
 	(this->*modeFunc)();
 
-	_vm->_gyro->_dropsOk = true;
+	_vm->_avalot->_dropsOk = true;
 	CursorMan.showMouse(true); // sink;
 	resetScrollDriver();
 }
@@ -569,36 +567,36 @@ bool Dialogs::displayQuestion(Common::String question) {
 }
 
 void Dialogs::reset() {
-	_vm->_gyro->_scrollNum = 1;
+	_vm->_avalot->_scrollNum = 1;
 	for (int i = 0; i < 15; i++) {
-		if (!_vm->_gyro->_scroll[i].empty())
-			_vm->_gyro->_scroll[i].clear();
+		if (!_vm->_avalot->_scroll[i].empty())
+			_vm->_avalot->_scroll[i].clear();
 	}
 }
 
 void Dialogs::setBubbleStateNatural() {
-	_vm->_gyro->_talkX = 320;
-	_vm->_gyro->_talkY = 200;
-	_vm->_gyro->_talkBackgroundColor = 8;
-	_vm->_gyro->_talkFontColor = 15;
+	_vm->_avalot->_talkX = 320;
+	_vm->_avalot->_talkY = 200;
+	_vm->_avalot->_talkBackgroundColor = 8;
+	_vm->_avalot->_talkFontColor = 15;
 }
 
 Common::String Dialogs::displayMoney() {
 	Common::String result;
 
-	if (_vm->_gyro->_money < 12) { // just pence
-		result = Common::String::format("%dd", _vm->_gyro->_money);
-	} else if (_vm->_gyro->_money < 240) { // shillings & pence
-		if ((_vm->_gyro->_money % 12) == 0)
-			result = Common::String::format("%d/-", _vm->_gyro->_money / 12);
+	if (_vm->_avalot->_money < 12) { // just pence
+		result = Common::String::format("%dd", _vm->_avalot->_money);
+	} else if (_vm->_avalot->_money < 240) { // shillings & pence
+		if ((_vm->_avalot->_money % 12) == 0)
+			result = Common::String::format("%d/-", _vm->_avalot->_money / 12);
 		else
-			result = Common::String::format("%d/%d", _vm->_gyro->_money / 12, _vm->_gyro->_money % 12);
+			result = Common::String::format("%d/%d", _vm->_avalot->_money / 12, _vm->_avalot->_money % 12);
 	} else { // L, s & d
-		result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20, 
-		                _vm->_gyro->_money % 12);
+		result = Common::String::format("\x9C%d.%d.%d", _vm->_avalot->_money / 240, (_vm->_avalot->_money / 12) % 20, 
+		                _vm->_avalot->_money % 12);
 	}
-	if (_vm->_gyro->_money > 12) {
-		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money);
+	if (_vm->_avalot->_money > 12) {
+		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_avalot->_money);
 		result += extraStr;
 	}
 
@@ -611,16 +609,16 @@ void Dialogs::stripTrailingSpaces(Common::String &str) {
 }
 
 void Dialogs::solidify(byte n) {
-	if (!_vm->_gyro->_scroll[n].contains(' '))
+	if (!_vm->_avalot->_scroll[n].contains(' '))
 		return; // No spaces.
 
 	// So there MUST be a space there, somewhere...
 	do {
-		_vm->_gyro->_scroll[n + 1] = _vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] + _vm->_gyro->_scroll[n + 1];
-		_vm->_gyro->_scroll[n].deleteLastChar();
-	} while (_vm->_gyro->_scroll[n][_vm->_gyro->_scroll[n].size() - 1] != ' ');
+		_vm->_avalot->_scroll[n + 1] = _vm->_avalot->_scroll[n][_vm->_avalot->_scroll[n].size() - 1] + _vm->_avalot->_scroll[n + 1];
+		_vm->_avalot->_scroll[n].deleteLastChar();
+	} while (_vm->_avalot->_scroll[n][_vm->_avalot->_scroll[n].size() - 1] != ' ');
 
-	stripTrailingSpaces(_vm->_gyro->_scroll[n]);
+	stripTrailingSpaces(_vm->_avalot->_scroll[n]);
 }
 
 void Dialogs::callDialogDriver() {
@@ -630,60 +628,60 @@ void Dialogs::callDialogDriver() {
 	_vm->_sound->stopSound();
 
 	setReadyLight(0);
-	_vm->_gyro->_scReturn = false;
+	_vm->_avalot->_scReturn = false;
 	bool mouthnext = false;
 	bool call_spriterun = true; // Only call sprite_run the FIRST time.
 
-	switch (_vm->_gyro->_buffer[_vm->_gyro->_bufSize - 1]) {
+	switch (_vm->_avalot->_buffer[_vm->_avalot->_bufSize - 1]) {
 	case kControlToBuffer:
-		_vm->_gyro->_bufSize--;
+		_vm->_avalot->_bufSize--;
 		break; // ^D = (D)on't include pagebreak
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
 	default:
-		_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = kControlParagraph;
-		_vm->_gyro->_bufSize++;
+		_vm->_avalot->_buffer[_vm->_avalot->_bufSize] = kControlParagraph;
+		_vm->_avalot->_bufSize++;
 	}
 
-	uint16 size = _vm->_gyro->_bufSize;
+	uint16 size = _vm->_avalot->_bufSize;
 
 	for (uint16 i = 0; i < size; i++) {
 		if (mouthnext) {
-			if (_vm->_gyro->_buffer[i] == kControlRegister)
+			if (_vm->_avalot->_buffer[i] == kControlRegister)
 				_param = 0;
-			else if (('0' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= '9'))
-				_param = _vm->_gyro->_buffer[i] - 48;
-			else if (('A' <= _vm->_gyro->_buffer[i]) && (_vm->_gyro->_buffer[i] <= 'Z'))
-				_param = _vm->_gyro->_buffer[i] - 55;
+			else if (('0' <= _vm->_avalot->_buffer[i]) && (_vm->_avalot->_buffer[i] <= '9'))
+				_param = _vm->_avalot->_buffer[i] - 48;
+			else if (('A' <= _vm->_avalot->_buffer[i]) && (_vm->_avalot->_buffer[i] <= 'Z'))
+				_param = _vm->_avalot->_buffer[i] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_vm->_gyro->_buffer[i]) {
+			switch (_vm->_avalot->_buffer[i]) {
 			case kControlParagraph:
-				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
+				if ((_vm->_avalot->_scrollNum == 1) && (_vm->_avalot->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
+					_vm->_avalot->spriteRun();
 				call_spriterun = false;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeNormal);
 
 				reset();
 
-				if (_vm->_gyro->_scReturn)
+				if (_vm->_avalot->_scReturn)
 					return;
 				break;
 			case kControlBell:
-				_vm->_gyro->_scrollBells++;
+				_vm->_avalot->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble:
-				if ((_vm->_gyro->_scrollNum == 1) && (_vm->_gyro->_scroll[0].empty()))
+				if ((_vm->_avalot->_scrollNum == 1) && (_vm->_avalot->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
+					_vm->_avalot->spriteRun();
 				call_spriterun = false;
 
 				if (_param == 0)
@@ -691,7 +689,7 @@ void Dialogs::callDialogDriver() {
 				else if ((1 <= _param) && (_param <= 9)) {
 					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
 					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
-						_vm->_lucerna->errorLed();
+						_vm->_avalot->errorLed();
 						setBubbleStateNatural();
 					} else
 						spr->chatter(); // Normal sprite talking routine.
@@ -699,14 +697,14 @@ void Dialogs::callDialogDriver() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					PedType *quasiPed = &_vm->_gyro->_peds[_vm->_gyro->kQuasipeds[_param - 10]._whichPed];
-					_vm->_gyro->_talkX = quasiPed->_x;
-					_vm->_gyro->_talkY = quasiPed->_y; // Position.
+					PedType *quasiPed = &_vm->_avalot->_peds[_vm->_avalot->kQuasipeds[_param - 10]._whichPed];
+					_vm->_avalot->_talkX = quasiPed->_x;
+					_vm->_avalot->_talkY = quasiPed->_y; // Position.
 
-					_vm->_gyro->_talkFontColor = _vm->_gyro->kQuasipeds[_param - 10]._foregroundColor;
-					_vm->_gyro->_talkBackgroundColor = _vm->_gyro->kQuasipeds[_param - 10]._backgroundColor; // Colors.
+					_vm->_avalot->_talkFontColor = _vm->_avalot->kQuasipeds[_param - 10]._foregroundColor;
+					_vm->_avalot->_talkBackgroundColor = _vm->_avalot->kQuasipeds[_param - 10]._backgroundColor; // Colors.
 				} else {
-					_vm->_lucerna->errorLed(); // Not valid.
+					_vm->_avalot->errorLed(); // Not valid.
 					setBubbleStateNatural();
 				}
 
@@ -714,7 +712,7 @@ void Dialogs::callDialogDriver() {
 
 				reset();
 
-				if (_vm->_gyro->_scReturn)
+				if (_vm->_avalot->_scReturn)
 					return;
 				break;
 
@@ -725,46 +723,46 @@ void Dialogs::callDialogDriver() {
 					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
 				case 2: {
-					int pwdId = _vm->_parser->kFirstPassword + _vm->_gyro->_passwordNum;
+					int pwdId = _vm->_parser->kFirstPassword + _vm->_avalot->_passwordNum;
 					displayText(_vm->_parser->_vocabulary[pwdId]._word + kControlToBuffer);
 					}
 					break;
 				case 3:
-					displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer);
+					displayText(_vm->_avalot->_favouriteDrink + kControlToBuffer);
 					break;
 				case 4:
-					displayText(_vm->_gyro->_favouriteSong + kControlToBuffer);
+					displayText(_vm->_avalot->_favouriteSong + kControlToBuffer);
 					break;
 				case 5:
-					displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer);
+					displayText(_vm->_avalot->_worstPlaceOnEarth + kControlToBuffer);
 					break;
 				case 6:
-					displayText(_vm->_gyro->_spareEvening + kControlToBuffer);
+					displayText(_vm->_avalot->_spareEvening + kControlToBuffer);
 					break;
 				case 9: {
-					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_catacombX, _vm->_gyro->_catacombY, kControlToBuffer);
+					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_avalot->_catacombX, _vm->_avalot->_catacombY, kControlToBuffer);
 					displayText(tmpStr);
 					}
 					break;
 				case 10:
-					switch (_vm->_gyro->_boxContent) {
+					switch (_vm->_avalot->_boxContent) {
 					case 0: // Sixpence.
 						displayScrollChain('q', 37); // You find the sixpence.
-						_vm->_gyro->_money += 6;
-						_vm->_gyro->_boxContent = _vm->_parser->kNothing;
-						_vm->_lucerna->incScore(2);
+						_vm->_avalot->_money += 6;
+						_vm->_avalot->_boxContent = _vm->_parser->kNothing;
+						_vm->_avalot->incScore(2);
 						return;
 					case Parser::kNothing:
 						displayText("nothing at all. It's completely empty.");
 						break;
 					default:
-						displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.');
+						displayText(_vm->_avalot->getItem(_vm->_avalot->_boxContent) + '.');
 					}
 					break;
 				case 11:
 					for (int j = 0; j < kObjectNum; j++) {
-						if (_vm->_gyro->_objects[j]) 
-							displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
+						if (_vm->_avalot->_objects[j]) 
+							displayText(_vm->_avalot->getItem(j) + ", " + kControlToBuffer);
 					}
 					break;
 				}
@@ -773,15 +771,15 @@ void Dialogs::callDialogDriver() {
 				_useIcon = _param;
 				break;
 			case kControlNewLine:
-				_vm->_gyro->_scrollNum++;
+				_vm->_avalot->_scrollNum++;
 				break;
 			case kControlQuestion:
 				if (call_spriterun)
-					_vm->_lucerna->spriteRun();
+					_vm->_avalot->spriteRun();
 				call_spriterun = false;
 
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum] = kControlQuestion;
-				_vm->_gyro->_scrollNum++;
+				_vm->_avalot->_scroll[_vm->_avalot->_scrollNum] = kControlQuestion;
+				_vm->_avalot->_scrollNum++;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
 				reset();
@@ -791,14 +789,14 @@ void Dialogs::callDialogDriver() {
 				break;
 			case kControlInsertSpaces:
 				for (int j = 0; j < 9; j++)
-					_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += ' ';
+					_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1] += ' ';
 				break;
 			default: // Add new char.
-				if (_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1].size() == 50) {
-					solidify(_vm->_gyro->_scrollNum - 1);
-					_vm->_gyro->_scrollNum++;
+				if (_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1].size() == 50) {
+					solidify(_vm->_avalot->_scrollNum - 1);
+					_vm->_avalot->_scrollNum++;
 				}
-				_vm->_gyro->_scroll[_vm->_gyro->_scrollNum - 1] += _vm->_gyro->_buffer[i];
+				_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1] += _vm->_avalot->_buffer[i];
 				break;
 			}
 		}
@@ -806,8 +804,8 @@ void Dialogs::callDialogDriver() {
 }
 
 void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_gyro->_bufSize = text.size();
-	memcpy(_vm->_gyro->_buffer, text.c_str(), _vm->_gyro->_bufSize);
+	_vm->_avalot->_bufSize = text.size();
+	memcpy(_vm->_avalot->_buffer, text.c_str(), _vm->_avalot->_bufSize);
 	callDialogDriver();
 }
 
@@ -832,7 +830,7 @@ void Dialogs::loadFont() {
 		error("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
 
 	for (int16 i = 0; i < 256; i++)
-		file.read(_vm->_gyro->_font[i],16);
+		file.read(_vm->_avalot->_font[i],16);
 	file.close();
 }
 
@@ -841,7 +839,7 @@ void Dialogs::displayMusicalScroll() {
 		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
 	displayText(tmpStr);
 
-	_vm->_lucerna->spriteRun();
+	_vm->_avalot->spriteRun();
 	CursorMan.showMouse(false);
 	drawScroll(&Avalanche::Dialogs::scrollModeMusic);
 	CursorMan.showMouse(true);
@@ -851,13 +849,13 @@ void Dialogs::displayMusicalScroll() {
 // From Visa:
 
 void Dialogs::unSkrimble() {
-	for (uint16  i = 0; i < _vm->_gyro->_bufSize; i++)
-		_vm->_gyro->_buffer[i] = (~(_vm->_gyro->_buffer[i] - (i + 1))) % 256;
+	for (uint16  i = 0; i < _vm->_avalot->_bufSize; i++)
+		_vm->_avalot->_buffer[i] = (~(_vm->_avalot->_buffer[i] - (i + 1))) % 256;
 }
 
 void Dialogs::doTheBubble() {
-	_vm->_gyro->_buffer[_vm->_gyro->_bufSize] = 2;
-	_vm->_gyro->_bufSize++;
+	_vm->_avalot->_buffer[_vm->_avalot->_bufSize] = 2;
+	_vm->_avalot->_bufSize++;
 }
 
 /**
@@ -898,8 +896,8 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 		::error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	_vm->_avalot->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_avalot->_buffer, _vm->_avalot->_bufSize);
 	sezfile.close();
 	unSkrimble();
 
@@ -944,8 +942,8 @@ void Dialogs::speak(byte who, byte subject) {
 		error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_vm->_gyro->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_gyro->_buffer, _vm->_gyro->_bufSize);
+	_vm->_avalot->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_avalot->_buffer, _vm->_avalot->_bufSize);
 	sezfile.close();
 
 	unSkrimble();
@@ -957,26 +955,26 @@ void Dialogs::speak(byte who, byte subject) {
 
 void Dialogs::talkTo(byte whom) {
 	if (_vm->_parser->_person == _vm->_parser->kPardon) {
-		_vm->_parser->_person = _vm->_gyro->_subjectNum;
-		_vm->_gyro->_subjectNum = 0;
+		_vm->_parser->_person = _vm->_avalot->_subjectNum;
+		_vm->_avalot->_subjectNum = 0;
 	}
 
-	if (_vm->_gyro->_subjectNum == 0) {
+	if (_vm->_avalot->_subjectNum == 0) {
 		switch (whom) {
-		case Gyro::kPeopleSpludwick:
-			if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) {
+		case Avalot::kPeopleSpludwick:
+			if ((_vm->_avalot->_lustieIsAsleep) & (!_vm->_avalot->_objects[Avalot::kObjectPotion - 1])) {
 				displayScrollChain('q', 68);
-				_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_lucerna->incScore(3);
+				_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = true;
+				_vm->_avalot->refreshObjectList();
+				_vm->_avalot->incScore(3);
 				return;
-			} else if (_vm->_gyro->_talkedToCrapulus) {
+			} else if (_vm->_avalot->_talkedToCrapulus) {
 				// Spludwick - what does he need?
 				// 0 - let it through to use normal routine.
-				switch (_vm->_gyro->_givenToSpludwick) {
+				switch (_vm->_avalot->_givenToSpludwick) {
 				case 1: // Fallthrough is intended.
 				case 2: {
-					Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+					Common::String objStr = _vm->_avalot->getItem(Avalot::kSpludwicksOrder[_vm->_avalot->_givenToSpludwick]);
 					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 					displayText(tmpStr);
 					}
@@ -990,57 +988,57 @@ void Dialogs::talkTo(byte whom) {
 				return;
 			}
 			break;
-		case Gyro::kPeopleIbythneth:
-			if (_vm->_gyro->_givenBadgeToIby) {
+		case Avalot::kPeopleIbythneth:
+			if (_vm->_avalot->_givenBadgeToIby) {
 				displayScrollChain('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
-		case Gyro::kPeopleDogfood:
-			if (_vm->_gyro->_wonNim) { // We've won the game.
+		case Avalot::kPeopleDogfood:
+			if (_vm->_avalot->_wonNim) { // We've won the game.
 				displayScrollChain('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
-				_vm->_gyro->_askedDogfoodAboutNim = true;
+				_vm->_avalot->_askedDogfoodAboutNim = true;
 			break;
-		case Gyro::kPeopleAyles:
-			if (!_vm->_gyro->_aylesIsAwake) {
+		case Avalot::kPeopleAyles:
+			if (!_vm->_avalot->_aylesIsAwake) {
 				displayScrollChain('q', 43); // He's fast asleep!
 				return;
-			} else if (!_vm->_gyro->_givenPenToAyles) {
+			} else if (!_vm->_avalot->_givenPenToAyles) {
 				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
 				return;
 			}
 			break;
 
-		case Gyro::kPeopleJacques:
+		case Avalot::kPeopleJacques:
 			displayScrollChain('q', 43);
 			return;
 
-		case Gyro::kPeopleGeida:
-			if (_vm->_gyro->_givenPotionToGeida)
-				_vm->_gyro->_geidaFollows = true;
+		case Avalot::kPeopleGeida:
+			if (_vm->_avalot->_givenPotionToGeida)
+				_vm->_avalot->_geidaFollows = true;
 			else {
 				displayScrollChain('u', 17);
 				return;
 			}
 			break;
-		case Gyro::kPeopleSpurge:
-			if (!_vm->_gyro->_sittingInPub) {
+		case Avalot::kPeopleSpurge:
+			if (!_vm->_avalot->_sittingInPub) {
 				displayScrollChain('q', 71); // Try going over and sitting down.
 				return;
 			} else {
-				if (_vm->_gyro->_spurgeTalkCount < 5)
-					_vm->_gyro->_spurgeTalkCount++;
-				if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
-					displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
+				if (_vm->_avalot->_spurgeTalkCount < 5)
+					_vm->_avalot->_spurgeTalkCount++;
+				if (_vm->_avalot->_spurgeTalkCount > 1) { // no. 1 falls through
+					displayScrollChain('q', 70 + _vm->_avalot->_spurgeTalkCount);
 					return;
 				}
 			}
 			break;
 		}
 	// On a subject. Is there any reason to block it?
-	} else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) {
+	} else if ((whom == Avalot::kPeopleAyles) && (!_vm->_avalot->_aylesIsAwake)) {
 		displayScrollChain('q', 43); // He's fast asleep!
 		return;
 	}
@@ -1063,23 +1061,23 @@ void Dialogs::talkTo(byte whom) {
 		displayText(tmpStr);
 	}
 
-	speak(whom, _vm->_gyro->_subjectNum);
+	speak(whom, _vm->_avalot->_subjectNum);
 
 	if (!_noError)
 		displayScrollChain('n', whom); // File not found!
 
-	if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true;
-		_vm->_lucerna->refreshObjectList();
+	if ((_vm->_avalot->_subjectNum == 0) && ((whom + 149) == Avalot::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_avalot->_objects[Avalot::kObjectBadge - 1] = true;
+		_vm->_avalot->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
-		_vm->_gyro->_talkedToCrapulus = true;
-		_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
+		_vm->_avalot->_talkedToCrapulus = true;
+		_vm->_avalot->_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
 		spr->walkTo(2); // Walks away.
 
-		_vm->_lucerna->incScore(2);
+		_vm->_avalot->incScore(2);
 	}
 }
 
diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp
deleted file mode 100644
index 9960839..0000000
--- a/engines/avalanche/gyro.cpp
+++ /dev/null
@@ -1,599 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* GYRO		It all revolves around this bit! */
-
-#include "avalanche/avalanche.h"
-#include "avalanche/gyro.h"
-#include "avalanche/pingo.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/animation.h"
-
-#include "common/file.h"
-#include "common/random.h"
-#include "common/textconsole.h"
-
-namespace Avalanche {
-
-const char *Gyro::kVersionNum = "1.30";
-const char *Gyro::kCopyright = "1995";
-
-const MouseHotspotType Gyro::kMouseHotSpots[9] = {
-	{8,0}, // 1 - up-arrow
-	{0,0}, // 2 - screwdriver
-	{15,6}, // 3 - right-arrow
-	{0,0}, // 4 - fletch
-	{8,7}, // 5 - hourglass
-	{4,0}, // 6 - TTHand
-	{8,5}, // 7- Mark's crosshairs
-	{8,7}, // 8- I-beam
-	{0,0} // 9 - question mark
-};
-
-// Art gallery at 2,1; notice about this at 2,2.
-const int32 Gyro::kCatacombMap[8][8] = {
-	// Geida's room
-	// 1       2	   3     | 4	   5	   6	   7       8
-	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
-	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
-	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
-	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
-	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
-	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
-	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
-	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
-};
-// vv Stairs trap.
-
-/* Explanation: $NSEW.
-		Nibble N: North.
-		0     = no connection,
-		2     = (left,) middle(, right) door with left-hand handle,
-		5     = (left,) middle(, right) door with right-hand handle,
-		7     = arch,
-		8     = arch and 1 north of it,
-		9     = arch and 2 north of it,
-		D     = no connection + WINDOW,
-		E     = no connection + TORCH,
-		F     = recessed door (to Geida's room.)
-
-		Nibble S: South.
-		0     = no connection,
-		1,2,3 = left, middle, right door.
-
-		Nibble E: East.
-		0     = no connection (wall),
-		1     = no connection (wall + window),
-		2     = wall with door,
-		3     = wall with door and window,
-		6     = wall with candles,
-		7     = wall with door and candles,
-		F     = straight-through corridor.
-
-		Nibble W: West.
-		0     = no connection (wall),
-		1     = no connection (wall + shield),
-		2     = wall with door,
-		3     = wall with door and shield,
-		4     = no connection (window),
-		5     = wall with door and window,
-		6     = wall with candles,
-		7     = wall with door and candles,
-		F     = straight-through corridor. */
-
-const char Gyro::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
-
-// A quasiped defines how people who aren't sprites talk. For example, quasiped
-// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
-const QuasipedType Gyro::kQuasipeds[16] = {
-//_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
-	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
-	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
-	{2, kColorWhite,        kRoomYours,        kColorMagenta,  kPeopleArkata},    // C: Arkata (screen 1).
-	{2, kColorBlack,        kRoomLustiesRoom,  kColorRed,      kPeopleInvisible}, // D: Hawk (screen 23).
-	{2, kColorLightgreen,   kRoomOutsideDucks, kColorBrown,    kPeopleTrader},    // E: Trader (screen 50).
-	{5, kColorYellow,       kRoomRobins,       kColorRed,      kPeopleAvalot},    // F: Avvy, tied up (scr.42)
-	{1, kColorBlue,         kRoomAylesOffice,  kColorWhite,    kPeopleAyles},     // G: Ayles (screen 16).
-	{1, kColorBrown,        kRoomMusicRoom,    kColorWhite,    kPeopleJacques},   // H: Jacques (screen 7).
-	{1, kColorLightgreen,   kRoomNottsPub,     kColorGreen,    kPeopleSpurge},    // I: Spurge (screen 47).
-	{2, kColorYellow,       kRoomNottsPub,     kColorRed,      kPeopleAvalot},    // J: Avalot (screen 47).
-	{1, kColorLightgray,    kRoomLustiesRoom,  kColorBlack,    kPeopleDuLustie},  // K: du Lustie (screen 23).
-	{1, kColorYellow,       kRoomOubliette,    kColorRed,      kPeopleAvalot},    // L: Avalot (screen 27).
-	{2, kColorWhite,        kRoomOubliette,    kColorRed,      kPeopleInvisible}, // M: Avaroid (screen 27).
-	{3, kColorLightgray,    kRoomArgentPub,    kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
-	{4, kColorLightmagenta, kRoomNottsPub,     kColorRed,      kPeoplePort},      // O: Port (screen 47).
-	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
-};
-
-const uint16 Gyro::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
-
-const TuneType Gyro::kTune = {
-	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
-	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
-	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
-};
-
-byte Gyro::_whereIs[29] = {
-	// The Lads
-	kRoomYours, // Avvy
-	kRoomSpludwicks, // Spludwick
-	kRoomOutsideYours, // Crapulus
-	kRoomDucks, // Duck - r__DucksRoom's not defined yet.
-	kRoomArgentPub, // Malagauche
-	kRoomRobins, // Friar Tuck.
-	kRoomDummy, // Robin Hood - can't meet him at the start.
-	kRoomBrummieRoad, // Cwytalot
-	kRoomLustiesRoom, // Baron du Lustie.
-	kRoomOutsideCardiffCastle, // The Duke of Cardiff.
-	kRoomArgentPub, // Dogfood
-	kRoomOutsideDucks, // Trader
-	kRoomArgentPub, // Ibythneth
-	kRoomAylesOffice, // Ayles
-	kRoomNottsPub, // Port
-	kRoomNottsPub, // Spurge
-	kRoomMusicRoom, // Jacques
-	0, 0, 0, 0, 0, 0, 0, 0,
-	// The Lasses
-	kRoomYours, // Arkata
-	kRoomGeidas, // Geida
-	kRoomDummy, // nobody allocated here!
-	kRoomWiseWomans  // The Wise Woman.
-};
-
-Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0) {
-	_vm = vm;
-
-	// Needed because of Lucerna::load_also()
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++)
-			_also[i][j] = 0;
-	}
-
-	_totalTime = 0;
-}
-
-Gyro::~Gyro() {
-	for (int i = 0; i < 9; i++) {
-		_digits[i].free();
-		_directions[i].free();
-	}
-	_digits[9].free();
-}
-
-Common::String Gyro::intToStr(int32 num) {
-	return Common::String::format("%d", num);
-}
-
-void Gyro::newMouse(byte id) {
-	if (id == _currentMouse)
-		return;
-
-	_currentMouse = id;
-	loadMouse(id);
-}
-
-/**
- * Set the mouse pointer to 'HourGlass"
- * @remarks	Originally called 'wait'
- */
-void Gyro::setMousePointerWait() {
-	newMouse(4);
-}
-
-void Gyro::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
-	warning("STUB: Gyro::shadow()");
-}
-
-void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
-	warning("STUB: Gyro::shbox()");
-}
-
-void Gyro::resetVariables() {
-// Replaces memset(&_vm->_gyro->_dna, 0, sizeof(DnaType));
-	_vm->_animation->_direction = 0;
-	_carryNum = 0;
-	for (int i = 0; i < kObjectNum; i++)
-		_objects[i] = false;
-
-	_dnascore = 0;
-	_money = 0;
-	_room = kRoomNowhere;
-	_wearing = 0;
-	_sworeNum = 0;
-	_saveNum = 0;
-	for (int i = 0; i < 100; i++)
-		_roomCount[i] = 0;
-
-	_alcoholLevel = 0;
-	_playedNim = 0;
-	_wonNim = false;
-	_wineState = 0;
-	_cwytalotGone = false;
-	_passwordNum = 0;
-	_aylesIsAwake = false;
-	_drawbridgeOpen = 0;
-	_avariciusTalk = 0;
-	_boughtOnion = false;
-	_rottenOnion = false;
-	_onionInVinegar = false;
-	_givenToSpludwick = 0;
-	_brummieStairs = 0;
-	_cardiffQuestionNum = 0;
-	_passedCwytalotInHerts = false;
-	_avvyIsAwake = false;
-	_avvyInBed = false;
-	_userMovesAvvy = false;
-	_npcFacing = 0;
-	_givenBadgeToIby = false;
-	_friarWillTieYouUp = false;
-	_tiedUp = false;
-	_boxContent = 0;
-	_talkedToCrapulus = false;
-	_jacquesState = 0;
-	_bellsAreRinging = false;
-	_standingOnDais = false;
-	_takenPen = false;
-	_arrowTriggered = false;
-	_arrowInTheDoor = false;
-	_favouriteDrink = "";
-	_favouriteSong = "";
-	_worstPlaceOnEarth = "";
-	_spareEvening = "";
-	_totalTime = 0;
-	_jumpStatus = 0;
-	_mushroomGrowing = false;
-	_spludwickAtHome = false;
-	_lastRoom = 0;
-	_lastRoomNotMap = 0;
-	_crapulusWillTell = false;
-	_enterCatacombsFromLustiesRoom = false;
-	_teetotal = false;
-	_malagauche = 0;
-	_drinking = 0;
-	_enteredLustiesRoomAsMonk = false;
-	_catacombX = 0;
-	_catacombY = 0;
-	_avvysInTheCupboard = false;
-	_geidaFollows = false;
-	_geidaSpin = 0;
-	_geidaTime = 0;
-	_nextBell = 0;
-	_givenPotionToGeida = false;
-	_lustieIsAsleep = false;
-	_flipToWhere = 0;
-	_flipToPed = 0;
-	_beenTiedUp = false;
-	_sittingInPub = false;
-	_spurgeTalkCount = 0;
-	_metAvaroid = false;
-	_takenMushroom = false;
-	_givenPenToAyles = false;
-	_askedDogfoodAboutNim = false;
-}
-
-void Gyro::newGame() {
-	for (int i = 0; i < kMaxSprites; i++) {
-		AnimationType *spr = &_vm->_animation->_sprites[i];
-		if (spr->_quick)
-			spr->remove();
-	}
-	// Deallocate sprite. Sorry, beta testers!
-
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	avvy->init(0, true, _vm->_animation);
-
-	_alive = true;
-	resetVariables();
-
-	_vm->_dialogs->setBubbleStateNatural();
-
-	_spareEvening = "answer a questionnaire";
-	_favouriteDrink = "beer";
-	_money = 30; // 2/6
-	_vm->_animation->_direction = Animation::kDirStopped;
-	_wearing = kObjectClothes;
-	_objects[kObjectMoney - 1] = true;
-	_objects[kObjectBodkin - 1] = true;
-	_objects[kObjectBell - 1] = true;
-	_objects[kObjectClothes - 1] = true;
-
-	_thinkThing = true;
-	_thinks = 2;
-	_vm->_lucerna->refreshObjectList();
-	_onToolbar = false;
-	_seeScroll = false;
-
-	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
-	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
-	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
-	_him = Parser::kPardon;
-	_her = Parser::kPardon;
-	_it = Parser::kPardon;
-	_lastPerson = Parser::kPardon; // = Pardon?
-	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
-	_userMovesAvvy = false;
-	_doingSpriteRun = false;
-	_avvyInBed = true;
-	_enidFilename = "";
-
-	_vm->_lucerna->enterRoom(1, 1);
-	avvy->_visible = false;
-	_vm->_lucerna->drawScore();
-	_vm->_menu->setup();
-	_vm->_lucerna->_clock.update();
-	_vm->_lucerna->spriteRun();
-}
-
-void Gyro::slowDown() {
-	warning("STUB: Gyro::slowdown()");
-}
-
-bool Gyro::setFlag(char x) {
-	for (uint16 i = 0; i < _flags.size(); i++) {
-		if (_flags[i] == x)
-			return true;
-	}
-
-	return false;
-}
-
-bool Gyro::decreaseMoney(uint16 howmuchby) {
-	_money -= howmuchby;
-	if (_money < 0) {
-		_vm->_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
-		_vm->_lucerna->gameOver();
-		return false;
-	} else
-		return true;
-}
-
-Common::String Gyro::getName(byte whose) {
-	static const Common::String kLads[17] = {
-		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
-		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
-		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
-	};
-
-	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
-
-	if (whose < 175)
-		return kLads[whose - 150];
-	else
-		return kLasses[whose - 175];
-}
-
-byte Gyro::getNameChar(byte whose) {
-	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
-	static const char kLassChar[] = "kG\0xB1o";
-
-	if (whose < 175)
-		return kLadChar[whose - 150];
-	else
-		return kLassChar[whose - 175];
-}
-
-Common::String Gyro::getThing(byte which) {
-	static const Common::String kThings[kObjectNum] = {
-		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
-		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
-		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
-	};
-
-	Common::String get_thing_result;
-	switch (which) {
-	case kObjectWine:
-		switch (_wineState) {
-		case 1:
-		case 4:
-			get_thing_result = kThings[which - 1];
-			break;
-		case 3:
-			get_thing_result = "Vinegar";
-			break;
-		}
-		break;
-	case kObjectOnion:
-		if (_rottenOnion)
-			get_thing_result = "rotten onion";
-		else
-			get_thing_result = kThings[which - 1];
-		break;
-	default:
-		get_thing_result = kThings[which - 1];
-	}
-	return get_thing_result;
-}
-
-char Gyro::getThingChar(byte which) {
-	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
-
-	char get_thingchar_result;
-	switch (which) {
-	case kObjectWine:
-		if (_wineState == 3)
-			get_thingchar_result = 'V'; // Vinegar
-		else
-			get_thingchar_result = kThingsChar[which - 1];
-		break;
-	default:
-		get_thingchar_result = kThingsChar[which - 1];
-	}
-	return get_thingchar_result;
-}
-
-Common::String Gyro::getItem(byte which) {
-	static const Common::String kItems[kObjectNum] = {
-		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
-		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
-		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
-		"an onion"
-	};
-
-	Common::String get_better_result;
-	if (which > 150)
-		which -= 149;
-
-	switch (which) {
-	case kObjectWine:
-		switch (_wineState) {
-		case 0:
-		case 1:
-		case 4:
-			get_better_result = kItems[which - 1];
-			break;
-		case 3:
-			get_better_result = "some vinegar";
-			break;
-		}
-		break;
-	case kObjectOnion:
-		if (_rottenOnion)
-			get_better_result = "a rotten onion";
-		else if (_onionInVinegar)
-			get_better_result = "a pickled onion (in the vinegar)";
-		else
-			get_better_result = kItems[which - 1];
-		break;
-	default:
-		if ((which < kObjectNum) && (which > 0))
-			get_better_result = kItems[which - 1];
-		else
-			get_better_result = "";
-	}
-	return get_better_result;
-}
-
-
-Common::String Gyro::f5Does() {
-	switch (_room) {
-	case kRoomYours:
-		if (!_avvyIsAwake)
-			return Common::String::format("%cWWake up", Parser::kVerbCodeWake);
-		else if (_avvyInBed)
-			return Common::String::format("%cGGet up", Parser::kVerbCodeStand);
-		break;
-	case kRoomInsideCardiffCastle:
-		if (_standingOnDais)
-			return Common::String::format("%cCClimb down", Parser::kVerbCodeClimb);
-		else
-			return Common::String::format("%cCClimb up", Parser::kVerbCodeClimb);
-		break;
-	case kRoomNottsPub:
-		if (_sittingInPub)
-			return Common::String::format("%cSStand up", Parser::kVerbCodeStand);
-		else
-			return Common::String::format("%cSSit down", Parser::kVerbCodeSit);
-		break;
-	case kRoomMusicRoom:
-		if (_vm->_animation->inField(5))
-			return Common::String::format("%cPPlay the harp", Parser::kVerbCodePlay);
-		break;
-	}
-
-	return Common::String::format("%c", _vm->_parser->kPardon); // If all else fails...
-}
-
-void Gyro::loadMouse(byte which) {
-	Common::File f;
-
-	if (!f.open("mice.avd"))
-		error("AVALANCHE: Gyro: File not found: mice.avd");
-
-	::Graphics::Surface cursor;
-	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
-	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
-
-
-	// The AND mask.
-	f.seek(kMouseSize * 2 * which + 134);
-
-	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
-
-	for (int j = 0; j < mask.h; j++) {
-		for (int i = 0; i < mask.w; i++) {
-			for (int k = 0; k < 2; k++) {
-				if (*(byte *)mask.getBasePtr(i, j) == 0)
-					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
-			}
-		}
-	}
-
-	mask.free();
-
-	// The OR mask.
-	f.seek(kMouseSize * 2 * which + 134 * 2);
-
-	mask = _vm->_graphics->loadPictureGraphic(f);
-
-	for (int j = 0; j < mask.h; j++) {
-		for (int i = 0; i < mask.w; i++) {
-			for (int k = 0; k < 2; k++) {
-				byte pixel = *(byte *)mask.getBasePtr(i, j);
-				if (pixel != 0)
-					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
-			}
-		}
-	}
-
-	mask.free();
-	f.close();
-
-	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which]._horizontal, kMouseHotSpots[which]._vertical * 2, 255, false);
-	cursor.free();
-}
-
-void Gyro::setBackgroundColor(byte x) {
-	warning("STUB: Gyro::background()");
-}
-
-void Gyro::hangAroundForAWhile() {
-	for (int i = 0; i < 28; i++)
-		slowDown();
-}
-
-void Gyro::init() {
-	_mouse = kMouseStateNo;
-	_letMeOut = false;
-	_holdTheDawn = true;
-	_currentMouse = 177;
-	_dropsOk = true;
-	_mouseText = "";
-	_cheat = false;
-	_cp = 0;
-	_ledStatus = 177;
-	_defaultLed = 2;
-	_enidFilename = ""; // Undefined.
-	for (int i = 0; i < 3; i++)
-		_scoreToDisplay[i] = -1; // Impossible digits.
-	_holdTheDawn = false;
-
-	setMousePointerWait();
-	CursorMan.showMouse(true);
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/gyro.h b/engines/avalanche/gyro.h
deleted file mode 100644
index 99fe6f7..0000000
--- a/engines/avalanche/gyro.h
+++ /dev/null
@@ -1,367 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* GYRO		It all revolves around this bit! */
-
-#ifndef AVALANCHE_GYRO2_H
-#define AVALANCHE_GYRO2_H
-
-#include "common/str.h"
-#include "common/scummsys.h"
-#include "common/file.h"
-
-#include "graphics/surface.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-enum Color {
-	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
-	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
-	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
-	kColorWhite
-};
-
-// CHECKME: kRoomBossKey is a guess
-enum Room {
-	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
-	kRoomYourHall = 5,      kRoomMusicRoom = 7,    kRoomOutsideArgentPub = 9,      kRoomArgentRoad = 10,
-	kRoomWiseWomans = 11,   kRoomSpludwicks = 12,  kRoomInsideAbbey = 13,          kRoomOutsideAbbey = 14,
-	kRoomAvvysGarden = 15,  kRoomAylesOffice = 16, kRoomArgentPub = 19,            kRoomBrummieRoad = 20,
-	kRoomBridge = 21,       kRoomLusties = 22,     kRoomLustiesRoom = 23,          kRoomWestHall = 25,
-	kRoomEastHall = 26,     kRoomOubliette = 27,   kRoomGeidas = 28,               kRoomCatacombs = 29,
-	kRoomEntranceHall = 40, kRoomRobins = 42,      kRoomOutsideNottsPub = 46,      kRoomNottsPub = 47,
-	kRoomOutsideDucks = 50, kRoomDucks = 51,       kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71,
-	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
-};
-
-static const byte kObjectNum = 18; // always preface with a #
-static const int16 kCarryLimit = 12;  // carry limit
-
-static const int16 kNumlockCode = 32;  // Code for Num Lock
-static const int16 kMouseSize = 134;
-
-struct MouseHotspotType { // mouse-void
-	int16 _horizontal, _vertical;
-};
-
-struct PedType {
-	int16 _x, _y;
-	byte _direction;
-};
-
-struct MagicType {
-	byte _operation; // one of the operations
-	uint16 _data; // data for them
-};
-
-class FieldType {
-public:
-	int16 _x1, _y1, _x2, _y2;
-};
-
-struct ByteField {
-	byte _x1, _y1, _x2, _y2;
-};
-
-class LineType : public FieldType {
-public:
-	byte _color;
-};
-
-typedef int8 TuneType[31];
-
-struct QuasipedType {
-	byte _whichPed, _foregroundColor, _room, _backgroundColor;
-	uint16 _who;
-};
-
-#if 0
-struct Sundry { // Things which must be saved over a backtobootstrap, outside DNA.
-	Common::String _qEnidFilename;
-	bool _qSoundFx;
-	byte _qThinks;
-	bool _qThinkThing;
-};
-#endif
-
-class Gyro {
-public:
-	static const char *kVersionNum;
-	static const char *kCopyright;
-	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
-	static const int16 kGameCode = 2; // Avalot's code number
-
-	// Objects you can hold:
-	enum Object {
-		kObjectWine = 1,
-		kObjectMoney,
-		kObjectBodkin,
-		kObjectPotion,
-		kObjectChastity,
-		kObjectBolt,
-		kObjectCrossbow,
-		kObjectLute,
-		kObjectBadge,
-		kObjectMushroom,
-		kObjectKey,
-		kObjectBell,
-		kObjectPrescription,
-		kObjectPen,
-		kObjectInk,
-		kObjectClothes,
-		kObjectHabit,
-		kObjectOnion
-	};
-
-	// People who hang around this game.
-	enum People {
-		// Boys:
-		kPeopleAvalot = 150,
-		kPeopleSpludwick = 151,
-		kPeopleCrapulus = 152,
-		kPeopleDrDuck = 153,
-		kPeopleMalagauche = 154,
-		kPeopleFriarTuck = 155,
-		kPeopleRobinHood = 156,
-		kPeopleCwytalot = 157,
-		kPeopleDuLustie = 158,
-		kPeopleDuke = 159,
-		kPeopleDogfood = 160,
-		kPeopleTrader = 161,
-		kPeopleIbythneth = 162,
-		kPeopleAyles = 163,
-		kPeoplePort = 164,
-		kPeopleSpurge = 165,
-		kPeopleJacques = 166,
-		// Girls:
-		kPeopleArkata = 175,
-		kPeopleGeida = 176,
-		kPeopleInvisible = 177,
-		kPeopleWisewoman = 178
-	};
-
-	static const int16 kXW = 30;
-	static const int16 kYW = 36; // x width & y whatsit
-	static const int16 kMargin = 5;
-	static const MouseHotspotType kMouseHotSpots[9];
-	static const int16 kMaxSprites = 2; // Current max no. of sprites.
-
-	// For Thinkabout:
-	static const bool kThing = true;
-	static const bool kPerson = false;
-
-	// Magic/portal constants:
-	enum Magics {
-		kMagicNothing, // Ignore it if this line is touched.
-		kMagicBounce, // Bounce off this line. Not valid for portals.
-		kMagicExclaim, // Put up a chain of scrolls.
-		kMagicTransport, // Enter new room.
-		kMagicUnfinished, // Unfinished connection.
-		kMagicSpecial, // Special function.
-		kMagicOpenDoor // Opening door.
-	};
-
-	// These following static constants should be included in CFG when it's written.
-
-	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
-	static const int16 kBorder = 1; // size of border on shadowboxes
-	static const int16 kWalk = 3;
-	static const int16 kRun = 5;
-	static const int32 kCatacombMap[8][8];
-	static const char kSpludwicksOrder[3];
-	static const QuasipedType kQuasipeds[16];
-
-	enum Pitch {
-		kPitchInvalid,
-		kPitchLower,
-		kPitchSame,
-		kPitchHigher
-	};
-
-	static const uint16 kNotes[12];
-	static const TuneType kTune;
-
-	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
-	// If a scroll comes up, or you leave the room, it's automatically set to zero.
-	byte _interrogation;
-	static byte _whereIs[29];
-
-	// Former DNA structure
-	byte _carryNum; // How many objects you're carrying...
-	bool _objects[kObjectNum]; // ...and which ones they are.
-	int16 _dnascore; // your score, of course
-	int32 _money; // your current amount of dosh
-	byte _room; // your current room
-	byte _wearing; // what you're wearing
-	byte _sworeNum; // number of times you've sworn
-	byte _saveNum; // number of times this game has been saved
-	byte _roomCount[100]; // Add one to each every time you enter a room
-	byte _alcoholLevel; // Your blood alcohol level.
-	byte _playedNim; // How many times you've played Nim.
-	bool _wonNim; // Have you *won* Nim? (That's harder.)
-	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
-	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
-	byte _passwordNum; // Number of the passw for this game.
-	bool _aylesIsAwake; // pretty obvious!
-	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
-	byte _avariciusTalk; // How much Avaricius has said to you.
-	bool _boughtOnion; // Have you bought an onion yet?
-	bool _rottenOnion; // And has it rotted?
-	bool _onionInVinegar; // Is the onion in the vinegar?
-	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
-	byte _brummieStairs; // Progression through the stairs trick.
-	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
-	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
-	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
-	bool _avvyInBed; // True if Avvy's in bed, but awake.
-	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
-	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
-	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
-	bool _friarWillTieYouUp; // If you're going to get tied up.
-	bool _tiedUp; // You ARE tied up!
-	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
-	bool _talkedToCrapulus; // Pretty self-explanatory.
-	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
-	bool _bellsAreRinging; // Is Jacques ringing the bells?
-	bool _standingOnDais; // In room 71, inside Cardiff Castle.
-	bool _takenPen; // Have you taken the pen (in Cardiff?)
-	bool _arrowTriggered; // And has the arrow been triggered?
-	bool _arrowInTheDoor;  // Did the arrow hit the wall?
-	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
-	uint32 _totalTime; // Your total time playing this game, in ticks.
-	byte _jumpStatus; // Fixes how high you're jumping.
-	bool _mushroomGrowing; // Is the mushroom growing in 42?
-	bool _spludwickAtHome; // Is Spludwick at home?
-	byte _lastRoom;
-	byte _lastRoomNotMap;
-	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
-	bool _enterCatacombsFromLustiesRoom;
-	bool _teetotal; // Are we touching any more drinks?
-	byte _malagauche; // Position of Malagauche. See Celer for more info.
-	char _drinking; // What's he getting you?
-	bool _enteredLustiesRoomAsMonk;
-	byte _catacombX, _catacombY;   // XY coords in the catacombs.
-	bool _avvysInTheCupboard; // On screen 22.
-	bool _geidaFollows; // Is Geida following you?
-	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
-	byte _nextBell; // For the ringing.
-	bool _givenPotionToGeida; // Does Geida have the potion?
-	bool _lustieIsAsleep; // Is BDL asleep?
-	byte _flipToWhere, _flipToPed; // For the sequencer.
-	bool _beenTiedUp; // In r__Robins.
-	bool _sittingInPub; // Are you sitting down in the pub?
-	byte _spurgeTalkCount; // Count for talking to Spurge.
-	bool _metAvaroid;
-	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
-	// End of former DNA Structure
-
-	byte _lineNum; // Number of lines.
-	LineType _lines[50]; // For Also.
-	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
-	bool _dropsOk, _scReturn, _soundFx, _cheat;
-	Common::String _mouseText;
-	bool _weirdWord;
-	bool _letMeOut;
-	Common::String _scroll[15];
-	byte _scrollNum, _whichwas;
-	byte _thinks;
-	bool _thinkThing;
-	int16 _talkX, _talkY;
-	byte _talkBackgroundColor, _talkFontColor;
-	byte _scrollBells; // no. of times to ring the bell
-	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
-	char _objectList[10];
-	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
-	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
-	// Called .free() for them in ~Gyro().
-	int8 _scoreToDisplay[3];
-	byte _currentMouse; // current mouse-void
-	Common::String _verbStr; // what you can do with your object. :-)
-	Common::String *_also[31][2];
-	PedType _peds[15];
-	MagicType _magics[15];
-	MagicType _portals[7];
-	FieldType _fields[30];
-	byte _fieldNum;
-	Common::String _flags;
-	Common::String _listen;
-	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
-	byte _cp, _ledStatus, _defaultLed;
-	FontType _font;
-	bool _alive;
-	byte _buffer[2000];
-	uint16 _bufSize;
-	int16 _underScroll; // Y-coord of just under the scroll text.
-	Common::String _roomnName; // Name of actual room
-	Common::String _subject; // What you're talking to them about.
-	byte _subjectNum; // The same thing.
-	bool _keyboardClick; // Is a keyboard click noise wanted?
-	byte _him, _her, _it;
-	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
-
-	byte _lastPerson; // Last person to have been selected using the People menu.
-	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
-	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
-	bool _isLoaded; // Is it a loaded gamestate?
-	Common::String _enidFilename;
-
-	Gyro(AvalancheEngine *vm);
-	~Gyro();
-
-	Common::String intToStr(int32 num);
-	void newMouse(byte id);
-	void setMousePointerWait();    // Makes hourglass.
-	void loadMouse(byte which);
-
-	void setBackgroundColor(byte x);
-	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
-
-	void resetVariables();
-	void newGame(); // This sets up the DNA for a completely new game.
-	void slowDown();
-	bool setFlag(char x);
-	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
-	void hangAroundForAWhile();
-	
-	Common::String getName(byte whose);
-	byte getNameChar(byte whose);
-	Common::String getThing(byte which);
-	char getThingChar(byte which);
-	Common::String getItem(byte which); // Called get_better in the original.
-	Common::String f5Does(); // This procedure determines what f5 does.
-
-	void init();
-private:
-	AvalancheEngine *_vm;
-
-	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
-};
-
-} // End of namespace Avalanche
-
-#endif // AVALANCHE_GYRO2_H
diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp
deleted file mode 100644
index 88c1357..0000000
--- a/engines/avalanche/lucerna.cpp
+++ /dev/null
@@ -1,1224 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* LUCERNA		The screen, [keyboard] and mouse handler.*/
-
-#include "avalanche/avalanche.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/timer.h"
-#include "avalanche/animation.h"
-#include "avalanche/background.h"
-#include "avalanche/pingo.h"
-#include "avalanche/sequence.h"
-
-#include "common/rect.h"
-#include "common/system.h"
-
-#include "graphics/palette.h"
-
-namespace Avalanche {
-
-Clock::Clock(AvalancheEngine *vm) {
-	_vm = vm;
-	_oldHour = _oldHourAngle = _oldMinute = 17717;
-}
-
-void Clock::update() { // TODO: Move variables from Gyro to here (or at least somewhere nearby), rename them.
-	TimeDate t;
-	_vm->_system->getTimeAndDate(t);
-	_hour = t.tm_hour;
-	_minute = t.tm_min;
-	_second = t.tm_sec;
-
-	_hourAngle = (_hour % 12) * 30 + _minute / 2;
-
-	if (_oldHour != _hour)  {
-		plotHands();
-		chime();
-	}
-
-	if (_oldMinute != _minute)
-		plotHands();
-
-	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
-		Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
-			"midnight. Are you having an all-night Avvy session? Glad you like the game that much!", 
-			Dialogs::kControlNewLine, Dialogs::kControlNewLine);
-		_vm->_dialogs->displayText(tmpStr);
-	}
-	_oldHour = _hour;
-	_oldHourAngle = _hourAngle;
-	_oldMinute = _minute;
-}
-
-void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
-	if (angle > 900) {
-		endPoint.x = 177;
-		return;
-	}
-
-	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color);
-}
-
-void Clock::drawHand(const Common::Point &endPoint, byte color) {
-	if (endPoint.x == 177)
-		return;
-
-	_vm->_graphics->_surface.drawLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
-}
-
-void Clock::plotHands() {
-	calcHand(_oldHourAngle, 14, _clockHandHour, kColorYellow);
-	calcHand(_oldMinute * 6, 17, _clockHandMinute, kColorYellow);
-	drawHand(_clockHandHour, kColorBrown);
-	drawHand(_clockHandMinute, kColorBrown);
-
-	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
-	calcHand(_minute * 6, 17, _clockHandMinute, kColorBrown);
-	drawHand(_clockHandHour, kColorYellow);
-	drawHand(_clockHandMinute, kColorYellow);
-}
-
-void Clock::chime() {
-	warning("STUB: Clock::chime()");
-}
-
-Lucerna::Lucerna(AvalancheEngine *vm) : _fxHidden(false), _clock(vm) {
-	_vm = vm;
-}
-
-Lucerna::~Lucerna() {
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++) {
-			if (_vm->_gyro->_also[i][j] != 0)  {
-				delete _vm->_gyro->_also[i][j];
-				_vm->_gyro->_also[i][j] = 0;
-			}
-		}
-	}
-}
-
-void Lucerna::init() {
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++)
-			_vm->_gyro->_also[i][j] = 0;
-	}
-
-#if 0
-	if (_vm->_enhanced->atbios)
-		_vm->_gyro->atkey = "f1";
-	else
-		_vm->_gyro->atkey = "alt-";
-#endif
-}
-
-/**
- * Call a given Verb
- * @remarks	Originally called 'callverb'
- */
-void Lucerna::callVerb(byte id) {
-	if (id == _vm->_parser->kPardon) {
-		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
-			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
-			"what the current setting of this key is.");
-		_vm->_dialogs->displayText(tmpStr);
-	} else {
-		_vm->_gyro->_weirdWord = false;
-		_vm->_parser->_polite = true;
-		_vm->_parser->_verb = id;
-		_vm->_parser->doThat();
-	}
-}
-
-void Lucerna::drawAlsoLines() {
-	CursorMan.showMouse(false);
-
-	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
-	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
-
-	for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
-		// We had to check if the lines are within the borders of the screen.
-		if ((_vm->_gyro->_lines[i]._x1 >= 0) && (_vm->_gyro->_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y1 >= 0) && (_vm->_gyro->_lines[i]._y1 < _vm->_graphics->kScreenHeight)
-		 && (_vm->_gyro->_lines[i]._x2 >= 0) && (_vm->_gyro->_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_vm->_gyro->_lines[i]._y2 >= 0) && (_vm->_gyro->_lines[i]._y2 < _vm->_graphics->kScreenHeight))
-			_vm->_graphics->_magics.drawLine(_vm->_gyro->_lines[i]._x1, _vm->_gyro->_lines[i]._y1, _vm->_gyro->_lines[i]._x2, _vm->_gyro->_lines[i]._y2, _vm->_gyro->_lines[i]._color);
-	}
-
-	CursorMan.showMouse(true);
-}
-
-/**
- * Check is it's possible to give something to Spludwick
- * @remarks	Originally called 'nextstring'
- */
-Common::String Lucerna::readAlsoStringFromFile() {
-	Common::String str;
-	byte length = file.readByte();
-	for (int i = 0; i < length; i++)
-		str += file.readByte();
-	return str;
-}
-
-void Lucerna::scram(Common::String &str) {
-	for (uint i = 0; i < str.size(); i++)
-		str.setChar(str[i] ^ 177, i);
-}
-
-void Lucerna::unScramble() {
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++) {
-			if (_vm->_gyro->_also[i][j] != 0)
-				scram(*_vm->_gyro->_also[i][j]);
-		}
-	}
-	scram(_vm->_gyro->_listen);
-	scram(_vm->_gyro->_flags);
-}
-
-void Lucerna::loadAlso(byte num) {
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++) {
-			if (_vm->_gyro->_also[i][j] != 0)  {
-				delete _vm->_gyro->_also[i][j];
-				_vm->_gyro->_also[i][j] = 0;
-			}
-		}
-	}
-	Common::String filename;
-	filename = Common::String::format("also%d.avd", num);
-	if (!file.open(filename))
-		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
-
-	file.seek(128);
-
-	byte alsoNum = file.readByte();
-	Common::String tmpStr;
-	for (int i = 0; i <= alsoNum; i++) {
-		for (int j = 0; j < 2; j++) {
-			_vm->_gyro->_also[i][j] = new Common::String;
-			*_vm->_gyro->_also[i][j] = readAlsoStringFromFile();
-		}
-		tmpStr = Common::String::format("\x9D%s\x9D", _vm->_gyro->_also[i][0]->c_str());
-		*_vm->_gyro->_also[i][0] = tmpStr;
-	}
-
-	memset(_vm->_gyro->_lines, 0xFF, sizeof(_vm->_gyro->_lines));
-
-	_vm->_gyro->_lineNum = file.readByte();
-	for (int i = 0; i < _vm->_gyro->_lineNum; i++) {
-		LineType *curLine = &_vm->_gyro->_lines[i];
-		curLine->_x1 = file.readSint16LE();
-		curLine->_y1 = file.readSint16LE();
-		curLine->_x2 = file.readSint16LE();
-		curLine->_y2 = file.readSint16LE();
-		curLine->_color = file.readByte();
-	}
-
-	memset(_vm->_gyro->_peds, 177, sizeof(_vm->_gyro->_peds));
-	byte pedNum = file.readByte();
-	for (int i = 0; i < pedNum; i++) {
-		PedType *curPed = &_vm->_gyro->_peds[i];
-		curPed->_x = file.readSint16LE();
-		curPed->_y = file.readSint16LE();
-		curPed->_direction = file.readByte();
-	}
-
-	_vm->_gyro->_fieldNum = file.readByte();
-	for (int i = 0; i < _vm->_gyro->_fieldNum; i++) {
-		FieldType *curField = &_vm->_gyro->_fields[i];
-		curField->_x1 = file.readSint16LE();
-		curField->_y1 = file.readSint16LE();
-		curField->_x2 = file.readSint16LE();
-		curField->_y2 = file.readSint16LE();
-	}
-
-	for (int i = 0; i < 15; i++) {
-		MagicType *magic = &_vm->_gyro->_magics[i];
-		magic->_operation = file.readByte();
-		magic->_data = file.readUint16LE();
-	}
-
-	for (int i = 0; i < 7; i++) {
-		MagicType *portal = &_vm->_gyro->_portals[i];
-		portal->_operation = file.readByte();
-		portal->_data = file.readUint16LE();
-	}
-
-	_vm->_gyro->_flags.clear();
-	for (int i = 0;  i < 26; i++)
-		_vm->_gyro->_flags += file.readByte();
-
-	int16 listen_length = file.readByte();
-	_vm->_gyro->_listen.clear();
-	for (int i = 0; i < listen_length; i++)
-		_vm->_gyro->_listen += file.readByte();
-
-	drawAlsoLines();
-
-	file.close();
-	unScramble();
-	for (int i = 0; i <= alsoNum; i++) {
-		tmpStr = Common::String::format(",%s,", _vm->_gyro->_also[i][0]->c_str());
-		*_vm->_gyro->_also[i][0] = tmpStr;
-	}
-}
-
-void Lucerna::loadRoom(byte num) {
-	CursorMan.showMouse(false);
-
-	_vm->_graphics->fleshColors();
-
-	Common::String filename = Common::String::format("place%d.avd", num);
-	if (!file.open(filename))
-		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
-
-	file.seek(146);
-	if (!_vm->_gyro->_roomnName.empty())
-		_vm->_gyro->_roomnName.clear();
-	for (int i = 0; i < 30; i++) {
-		char actChar = file.readByte();
-		if ((32 <= actChar) && (actChar <= 126))
-			_vm->_gyro->_roomnName += actChar;
-	}
-	// Compression method byte follows this...
-
-	file.seek(177);
-
-	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(file, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
-	_vm->_graphics->refreshBackground();
-
-	file.close();
-
-	loadAlso(num);
-	_vm->_background->loadBackgroundSprites(num);
-	CursorMan.showMouse(true);
-}
-
-void Lucerna::zoomOut(int16 x, int16 y) {
-	warning("STUB: Lucerna::zoomout()");
-}
-
-void Lucerna::findPeople(byte room) {
-	for (int i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == room) {
-			if (i < 25)
-				_vm->_gyro->_him = i + 150;
-			else
-				_vm->_gyro->_her = i + 150;
-		}
-	}
-}
-
-void Lucerna::exitRoom(byte x) {
-	_vm->_sound->stopSound();
-	_vm->_background->forgetBackgroundSprites();
-	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
-
-	switch (x) {
-	case kRoomSpludwicks:
-		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
-		 _vm->_gyro->_avariciusTalk = 0;
-		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
-		break;
-	case kRoomBridge:
-		if (_vm->_gyro->_drawbridgeOpen > 0) {
-			_vm->_gyro->_drawbridgeOpen = 4; // Fully open.
-			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
-		}
-		break;
-	case kRoomOutsideCardiffCastle:
-		_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey);
-		break;
-	case kRoomRobins:
-		_vm->_timer->loseTimer(Timer::kReasonGettingTiedUp);
-		break;
-	}
-
-	_vm->_gyro->_interrogation = 0; // Leaving the room cancels all the questions automatically.
-	_vm->_gyro->_seeScroll = false; // Now it can work again!
-
-	_vm->_gyro->_lastRoom = _vm->_gyro->_room;
-	if (_vm->_gyro->_room != kRoomMap)
-		_vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room;
-}
-
-
-/**
- * Only when entering a NEW town! Not returning to the last one,
- * but choosing another from the map.
- * @remarks	Originally called 'new_town'
- */
-void Lucerna::enterNewTown() {
-	_vm->_menu->setup();
-
-	switch (_vm->_gyro->_room) {
-	case kRoomOutsideNottsPub: // Entry into Nottingham.
-		if ((_vm->_gyro->_roomCount[kRoomRobins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
-			_vm->_gyro->_mushroomGrowing = true;
-		break;
-	case kRoomWiseWomans: // Entry into Argent.
-		if (_vm->_gyro->_talkedToCrapulus && (!_vm->_gyro->_lustieIsAsleep)) {
-			_vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[kRoomWiseWomans] % 3) == 1);
-			_vm->_gyro->_crapulusWillTell = !_vm->_gyro->_spludwickAtHome;
-		} else {
-			_vm->_gyro->_spludwickAtHome = true;
-			_vm->_gyro->_crapulusWillTell = false;
-		}
-		if (_vm->_gyro->_boxContent == Gyro::kObjectWine)
-			_vm->_gyro->_wineState = 3; // Vinegar
-		break;
-	}
-
-	if (_vm->_gyro->_room != kRoomOutsideDucks) {
-		if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar))
-			_vm->_gyro->_rottenOnion = true; // You're holding the onion
-	}
-}
-
-void Lucerna::putGeidaAt(byte whichPed, byte ped) {
-	if (ped == 0)
-		return;
-	AnimationType *spr1 = &_vm->_animation->_sprites[1];
-
-	spr1->init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->appearPed(1, whichPed);
-	spr1->_callEachStepFl = true;
-	spr1->_eachStepProc = Animation::kProcGeida;
-}
-
-void Lucerna::enterRoom(byte room, byte ped) {
-	_vm->_gyro->_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
-
-	findPeople(room);
-	_vm->_gyro->_room = room;
-	if (ped != 0)
-		_vm->_gyro->_roomCount[room]++;
-
-	loadRoom(room);
-
-	if ((_vm->_gyro->_roomCount[room] == 0) && (!_vm->_gyro->setFlag('S')))
-		incScore(1);
-
-	_vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room;
-
-	if (_vm->_gyro->_geidaFollows)
-		_vm->_gyro->_whereIs[Gyro::kPeopleGeida - 150] = room;
-
-	_vm->_gyro->_roomTime = 0;
-
-
-	if ((_vm->_gyro->_lastRoom == kRoomMap) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room))
-		enterNewTown();
-
-	switch (room) {
-	case kRoomYours:
-		if (_vm->_gyro->_avvyInBed) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
-		}
-		break;
-
-	case kRoomOutsideYours:
-		if (ped > 0) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			if (!_vm->_gyro->_talkedToCrapulus) {
-				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomOutsideYours;
-				spr1->init(8, false, _vm->_animation); // load Crapulus
-
-				if (_vm->_gyro->_roomCount[kRoomOutsideYours] == 1) {
-					_vm->_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
-					spr1->walkTo(4); // Walks up to greet you.
-				} else {
-					_vm->_animation->appearPed(1, 4); // Starts where he was before.
-					spr1->_facingDir = Animation::kDirLeft;
-				}
-
-				spr1->_callEachStepFl = true;
-				spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
-
-			} else
-				_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomNowhere;
-
-			if (_vm->_gyro->_crapulusWillTell) {
-				spr1->init(8, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
-				spr1->walkTo(3);
-				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
-				_vm->_gyro->_crapulusWillTell = false;
-			}
-		}
-		break;
-
-	case kRoomOutsideSpludwicks:
-		if ((_vm->_gyro->_roomCount[kRoomOutsideSpludwicks] == 1) && (ped == 1)) {
-			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
-			_vm->_gyro->_spludwickAtHome = true;
-		}
-		break;
-
-	case kRoomSpludwicks:
-		if (_vm->_gyro->_spludwickAtHome) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			if (ped > 0) {
-				spr1->init(2, false, _vm->_animation); // load Spludwick
-				_vm->_animation->appearPed(1, 1);
-				_vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomSpludwicks;
-			}
-
-			spr1->_callEachStepFl = true;
-			spr1->_eachStepProc = Animation::kProcGeida;
-		} else
-			_vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomNowhere;
-		break;
-
-	case kRoomBrummieRoad:
-		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(4, ped);
-		if (_vm->_gyro->_cwytalotGone) {
-			_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
-			_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomNowhere;
-		} else {
-			if (ped > 0) {
-				AnimationType *spr1 = &_vm->_animation->_sprites[1];
-				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
-				spr1->_callEachStepFl = true;
-				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
-				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomBrummieRoad;
-
-				if (_vm->_gyro->_roomCount[kRoomBrummieRoad] == 1) { // First time here...
-					_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
-					spr1->walkTo(3); // ...and he walks up...
-				} else {
-					// You've been here before.
-					_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
-					spr1->_facingDir = Animation::kDirLeft;
-				}
-			}
-		}
-		break;
-
-	case kRoomArgentRoad:
-		if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[kRoomArgentRoad] > 3)) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
-			_vm->_animation->appearPed(1, 0);
-			spr1->walkTo(1);
-			spr1->_vanishIfStill = true;
-			_vm->_gyro->_passedCwytalotInHerts = true;
-			// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
-		}
-		break;
-
-	case kRoomBridge:
-		if (_vm->_gyro->_drawbridgeOpen == 4) { // open
-			_vm->_background->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
-			_vm->_graphics->refreshBackground();
-			_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
-		}
-		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 2, ped); // load Geida
-		break;
-
-	case kRoomRobins:
-		if (ped > 0) {
-			if (!_vm->_gyro->_beenTiedUp) {
-				// A welcome party... or maybe not...
-				AnimationType *spr1 = &_vm->_animation->_sprites[1];
-				spr1->init(6, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
-				spr1->walkTo(2);
-				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
-			}
-		}
-
-		if (_vm->_gyro->_beenTiedUp) {
-			_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = 0;
-			_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0;
-		}
-
-		if (_vm->_gyro->_tiedUp)
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-
-		if (!_vm->_gyro->_mushroomGrowing)
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-		_vm->_graphics->refreshBackground();
-		break;
-
-	case kRoomOutsideCardiffCastle:
-		if (ped > 0) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			switch (_vm->_gyro->_cardiffQuestionNum) {
-			case 0 : // You've answered NONE of his questions.
-				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
-				spr1->walkTo(2);
-				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
-				break;
-			case 5 :
-				_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
-				break; // You've answered ALL his questions. => nothing happens.
-			default: // You've answered SOME of his questions.
-				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 2);
-				spr1->_facingDir = Animation::kDirRight;
-				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
-			}
-		}
-
-		if (_vm->_gyro->_cardiffQuestionNum < 5)
-			_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
-		else
-			_vm->_gyro->_interrogation = 0;
-		break;
-
-	case kRoomMap:
-		// You're entering the map.
-		dawn();
-		if (ped > 0)
-			zoomOut(_vm->_gyro->_peds[ped]._x, _vm->_gyro->_peds[ped]._y);
-
-		if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) {
-			_vm->_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
-			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-			refreshObjectList();
-		}
-
-		_vm->_dialogs->displayScrollChain('q', 69);
-		break;
-
-	case kRoomCatacombs:
-		if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
-
-			switch (ped) {
-			case 3: // Enter from oubliette
-				_vm->_gyro->_catacombX = 8;
-				_vm->_gyro->_catacombY = 4;
-				break;
-			case 5: // Enter from du Lustie's
-				_vm->_gyro->_catacombX = 8;
-				_vm->_gyro->_catacombY = 7;
-				break;
-			case 6: // Enter from Geida's
-				_vm->_gyro->_catacombX = 4;
-				_vm->_gyro->_catacombY = 1;
-				break;
-			}
-
-			_vm->_gyro->_enterCatacombsFromLustiesRoom = true;
-			_vm->_animation->catacombMove(ped);
-			_vm->_gyro->_enterCatacombsFromLustiesRoom = false;
-		}
-		break;
-
-	case kRoomArgentPub:
-		if (_vm->_gyro->_wonNim)
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
-		_vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
-		if (_vm->_gyro->_givenBadgeToIby) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 7);
-			_vm->_background->drawBackgroundSprite(-1, -1, 8);
-		}
-		_vm->_graphics->refreshBackground();
-		break;
-
-	case kRoomLustiesRoom:
-		_vm->_gyro->_npcFacing = 1; // du Lustie.
-		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
-		else if (!_vm->_gyro->_enteredLustiesRoomAsMonk) // already
-			// Presumably, Avvy dressed as a monk.
-			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
-
-		if (_vm->_gyro->_geidaFollows) {
-			putGeidaAt(4, ped);
-			if (_vm->_gyro->_lustieIsAsleep) {
-				_vm->_background->drawBackgroundSprite(-1, -1, 4);
-				_vm->_graphics->refreshBackground();
-			}
-		}
-		break;
-
-	case kRoomMusicRoom:
-		if (_vm->_gyro->_jacquesState > 0) {
-			_vm->_gyro->_jacquesState = 5;
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_background->drawBackgroundSprite(-1, -1, 3);
-			_vm->_gyro->_magics[kColorBrown - 1]._operation = Gyro::kMagicNothing;
-			_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0;
-		}
-		if (ped != 0) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(6);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(7);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomOutsideNottsPub:
-		if (ped == 2) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(3);
-			_vm->_sequence->thenShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(4);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomOutsideArgentPub:
-		if (ped == 2)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(6);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(7);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomWiseWomans: {
-		AnimationType *spr1 = &_vm->_animation->_sprites[1];
-		spr1->init(11, false, _vm->_animation);
-		if ((_vm->_gyro->_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
-			_vm->_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
-			spr1->walkTo(3); // Walks up to greet you.
-		} else {
-			_vm->_animation->appearPed(1, 3); // Starts where she was before.
-			spr1->_facingDir = Animation::kDirLeft;
-		}
-
-		spr1->_callEachStepFl = true;
-		spr1->_eachStepProc = Animation::kProcFaceAvvy; // She always faces Avvy.
-		}
-		break;
-
-	case kRoomInsideCardiffCastle:
-		if (ped > 0) {
-			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(1);
-			if (_vm->_gyro->_arrowInTheDoor)
-				_vm->_sequence->thenShow(3);
-			else
-				_vm->_sequence->thenShow(2);
-
-			if (_vm->_gyro->_takenPen)
-				_vm->_background->drawBackgroundSprite(-1, -1, 3);
-
-			_vm->_sequence->startToClose();
-		} else {
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);
-			if (_vm->_gyro->_arrowInTheDoor)
-				_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			else
-				_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-		}
-		break;
-
-	case kRoomAvvysGarden:
-		if (ped == 1)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(3);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomEntranceHall:
-	case kRoomInsideAbbey:
-	case kRoomYourHall:
-		if (ped == 2)  {
-#if 0
-			// It was the original:
-			_vm->_celer->show_one(-1, -1, 2);
-			_vm->_sequence->first_show(1);
-			_vm->_sequence->then_show(3);
-			_vm->_sequence->start_to_close();
-#endif
-
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(3);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomAylesOffice:
-		if (_vm->_gyro->_aylesIsAwake)
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-		_vm->_graphics->refreshBackground();
-		break; // Ayles awake.
-
-	case kRoomGeidas:
-		putGeidaAt(1, ped);
-		break; // load Geida
-
-	case kRoomEastHall:
-	case kRoomWestHall:
-		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 1, ped);
-		break;
-
-	case kRoomLusties:
-		if (_vm->_gyro->_geidaFollows)
-			putGeidaAt(ped + 5, ped);
-		break;
-
-	case kRoomNottsPub:
-		if (_vm->_gyro->_sittingInPub)
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-		_vm->_gyro->_npcFacing = 1; // Port.
-		break;
-
-	case kRoomOutsideDucks:
-		if (ped == 2) {
-			// Shut the door
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(3);
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(4);
-			_vm->_sequence->startToClose();
-		}
-		break;
-
-	case kRoomDucks:
-		_vm->_gyro->_npcFacing = 1; // Duck.
-		break; 
-	}
-
-	_vm->_gyro->_seeScroll = false; // Now it can work again!
-	_vm->_gyro->_isLoaded = false;
-}
-
-void Lucerna::thinkAbout(byte object, bool type) {
-	const int16 picSize = 966;
-
-	_vm->_gyro->_thinks = object;
-	object--;
-
-	_vm->_gyro->setMousePointerWait();
-
-	if (type == Gyro::kThing) {
-		if (!file.open("thinks.avd"))
-			error("AVALANCHE: Lucerna: File not found: thinks.avd");
-	} else { // Gyro::kPerson
-		if (!file.open("folk.avd"))
-			error("AVALANCHE: Lucerna: File not found: folk.avd");
-
-		object -= 149;
-		if (object >= 25)
-			object -= 8;
-		if (object == 20)
-			object--; // Last time...
-	}
-
-	CursorMan.showMouse(false);
-
-	file.seek(object * picSize + 65);
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
-
-	picture.free();
-	file.close();
-
-	CursorMan.showMouse(true);
-	_vm->_gyro->_thinkThing = type;
-}
-
-void Lucerna::loadDigits() {   // Load the scoring digits & rwlites
-	const byte digitsize = 134;
-	const byte rwlitesize = 126;
-
-	if (!file.open("digit.avd"))
-		error("AVALANCHE: Lucerna: File not found: digit.avd");
-
-	for (int i = 0; i < 10; i++) {
-		file.seek(i * digitsize);
-		_vm->_gyro->_digits[i] = _vm->_graphics->loadPictureGraphic(file);
-	}
-
-	for (int i = 0; i < 9; i++) {
-		file.seek(10 * digitsize + i * rwlitesize);
-		_vm->_gyro->_directions[i] = _vm->_graphics->loadPictureGraphic(file);
-	}
-
-	file.close();
-}
-
-void Lucerna::drawToolbar() {
-	if (!file.open("useful.avd"))
-		error("AVALANCHE: Lucerna: File not found: useful.avd");
-
-	file.seek(40);
-
-	CursorMan.showMouse(false);
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
-
-	picture.free();
-	file.close();
-
-	CursorMan.showMouse(true);
-	_vm->_animation->_oldDirection = 177;
-	drawDirection();
-}
-
-void Lucerna::drawScore() {
-	uint16 score = _vm->_gyro->_dnascore;
-	int8 numbers[3] = {0, 0, 0};
-	for (int i = 0; i < 2; i++) {
-		byte divisor = 1;
-		for (int j = 0; j < (2 - i); j++)
-			divisor *= 10;
-		numbers[i] = score / divisor;
-		score -= numbers[i] * divisor;
-	}
-	numbers[2] = score;
-
-	CursorMan.showMouse(false);
-
-	for (int i = 0; i < 3; i++) {
-		if (_vm->_gyro->_scoreToDisplay[i] != numbers[i])
-			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_digits[numbers[i]], 250 + (i + 1) * 15, 177);
-	}
-
-	CursorMan.showMouse(true);
-
-	for (int i = 0; i < 3; i++)
-		_vm->_gyro->_scoreToDisplay[i] = numbers[i];
-}
-
-void Lucerna::incScore(byte num) {    
-	for (int i = 1; i <= num; i++) {
-		_vm->_gyro->_dnascore++;
-
-//		if (soundfx) {
-			for (int j = 1; j <= 97; j++)
-				// Length os 2 is a guess, the original doesn't have a delay specified
-				_vm->_sound->playNote(177 + _vm->_gyro->_dnascore * 3, 2);
-//		}
-	}
-	warning("STUB: Lucerna::points()");
-
-	drawScore();
-}
-
-void Lucerna::useCompass(const Common::Point &cursorPos) {
-	byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
-
-	switch (color) {
-	case kColorGreen:
-		_vm->_animation->_direction = Animation::kDirUp;
-		_vm->_animation->changeDirection(0, Animation::kDirUp);
-		drawDirection();
-		break;
-	case kColorBrown:
-		_vm->_animation->_direction = Animation::kDirDown;
-		_vm->_animation->changeDirection(0, Animation::kDirDown);
-		drawDirection();
-		break;
-	case kColorCyan:
-		_vm->_animation->_direction = Animation::kDirLeft;
-		_vm->_animation->changeDirection(0, Animation::kDirLeft);
-		drawDirection();
-		break;
-	case kColorLightmagenta:
-		_vm->_animation->_direction = Animation::kDirRight;
-		_vm->_animation->changeDirection(0, Animation::kDirRight);
-		drawDirection();
-		break;
-	case kColorRed:
-	case kColorWhite:
-	case kColorLightcyan:
-	case kColorYellow: // Fall-throughs are intended.
-		_vm->_animation->stopWalking();
-		drawDirection();
-		break;
-	}
-}
-
-void Lucerna::fxToggle() {
-	warning("STUB: Lucerna::fxtoggle()");
-}
-
-void Lucerna::refreshObjectList() {
-	_vm->_gyro->_carryNum = 0;
-	if (_vm->_gyro->_thinkThing && !_vm->_gyro->_objects[_vm->_gyro->_thinks - 1])
-		thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money
-
-	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i]) {
-			_vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1;
-			_vm->_gyro->_carryNum++;
-		}
-	}
-}
-
-/**
- * @remarks	Originally called 'verte'
- */
-void Lucerna::guideAvvy(Common::Point cursorPos) {
-	if (!_vm->_gyro->_userMovesAvvy)
-		return;
-
-	cursorPos.y /= 2;
-	byte what;
-
-	// _vm->_animation->tr[0] is Avalot.)
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	if (cursorPos.x < avvy->_x)
-		what = 1;
-	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
-		what = 2;
-	else
-		what = 0; // On top
-
-	if (cursorPos.y < avvy->_y)
-		what += 3;
-	else if (cursorPos.y > (avvy->_y + avvy->_info._yLength))
-		what += 6;
-
-	switch (what) {
-	case 0:
-		_vm->_animation->stopWalking();
-		break; // Clicked on Avvy: no movement.
-	case 1:
-		_vm->_animation->changeDirection(0, Animation::kDirLeft);
-		break;
-	case 2:
-		_vm->_animation->changeDirection(0, Animation::kDirRight);
-		break;
-	case 3:
-		_vm->_animation->changeDirection(0, Animation::kDirUp);
-		break;
-	case 4:
-		_vm->_animation->changeDirection(0, Animation::kDirUpLeft);
-		break;
-	case 5:
-		_vm->_animation->changeDirection(0, Animation::kDirUpRight);
-		break;
-	case 6:
-		_vm->_animation->changeDirection(0, Animation::kDirDown);
-		break;
-	case 7:
-		_vm->_animation->changeDirection(0, Animation::kDirDownLeft);
-		break;
-	case 8:
-		_vm->_animation->changeDirection(0, Animation::kDirDownRight);
-		break;
-	}    // No other values are possible.
-
-	drawDirection();
-}
-
-void Lucerna::checkClick() {
-	Common::Point cursorPos = _vm->getMousePos();
-	_vm->_gyro->_onToolbar = _vm->_gyro->kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
-
-	/*if (_vm->_gyro->mrelease > 0)
-	_vm->_gyro->after_the_scroll = false;*/
-
-	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		_vm->_gyro->newMouse(0); // up arrow
-	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
-		_vm->_gyro->newMouse(7); //I-beam
-	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		_vm->_gyro->newMouse(1); // screwdriver
-	else if (!_vm->_menu->isActive()) { // Dropdown can handle its own pointers.
-		if (_holdLeftMouse) {
-			_vm->_gyro->newMouse(6); // Mark's crosshairs
-			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
-		} else
-			_vm->_gyro->newMouse(3); // fletch
-	}
-
-	if (_holdLeftMouse) {
-		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
-			if (_vm->_gyro->_dropsOk)
-				_vm->_menu->update();
-		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
-			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
-			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
-				_vm->_parser->_inputTextPos = _vm->_parser->_inputText.size() + 1;
-			if (_vm->_parser->_inputTextPos < 1)
-				_vm->_parser->_inputTextPos = 1;
-			_vm->_parser->_inputTextPos--;
-			_vm->_parser->plotText();
-		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
-			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
-				if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake)
-					useCompass(cursorPos);
-			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
-				do {
-					_vm->updateEvents();
-				} while (_holdLeftMouse);
-
-				if (_vm->_gyro->_thinkThing) {
-					_vm->_parser->_thing = _vm->_gyro->_thinks;
-					_vm->_parser->_thing += 49;
-					_vm->_parser->_person = _vm->_parser->kPardon;
-				} else {
-					_vm->_parser->_person = _vm->_gyro->_thinks;
-					_vm->_parser->_thing = _vm->_parser->kPardon;
-				}
-				callVerb(Parser::kVerbCodeExam);
-			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
-				do {
-					_vm->updateEvents();
-				} while (_holdLeftMouse);
-
-				callVerb(Parser::kVerbCodeScore);
-			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kWalk;
-				_vm->_animation->updateSpeed();
-			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_animation->_sprites[0]._speedX = _vm->_gyro->kRun;
-				_vm->_animation->updateSpeed();
-			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
-				fxToggle();
-			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
-				_vm->_gyro->_mouseText.insertChar(Dialogs::kControlNewLine, 0);
-		} else if (!_vm->_gyro->_dropsOk)
-			_vm->_gyro->_mouseText = Common::String(13) + _vm->_gyro->_mouseText;
-	}
-}
-
-void Lucerna::errorLed() {
-	warning("STUB: Lucerna::errorled()");
-}
-
-int8 Lucerna::fades(int8 x) {
-	warning("STUB: Lucerna::fades()");
-	return 0;
-}
-
-void Lucerna::fadeOut(byte n) {
-	warning("STUB: Lucerna::fadeOut()");
-}
-
-void Lucerna::dusk() {
-	warning("STUB: Lucerna::dusk()");
-}
-
-void Lucerna::fadeIn(byte n) {
-	warning("STUB: Lucerna::fadeIn()");
-}
-
-void Lucerna::dawn() {
-	warning("STUB: Lucerna::dawn()");
-}
-
-void Lucerna::drawDirection() { // It's data is loaded in load_digits().
-	if (_vm->_animation->_oldDirection == _vm->_animation->_direction)
-		return;
-
-	_vm->_animation->_oldDirection = _vm->_animation->_direction;
-
-	CursorMan.showMouse(false);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_animation->_direction], 0, 161);
-	CursorMan.showMouse(true);
-}
-
-
-void Lucerna::gameOver() {
-	_vm->_gyro->_userMovesAvvy = false;
-
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	int16 sx = avvy->_x;
-	int16 sy = avvy->_y;
-
-	avvy->remove();
-	avvy->init(12, true, _vm->_animation); // 12 = Avalot falls
-	avvy->_stepNum = 0;
-	avvy->appear(sx, sy, 0);
-
-	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
-	_vm->_gyro->_alive = false;
-}
-
-void Lucerna::minorRedraw() {
-	dusk();
-
-	enterRoom(_vm->_gyro->_room, 0); // Ped unknown or non-existant.
-
-	for (int i = 0; i < 3; i++)
-		_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits
-	drawScore();
-
-	dawn();
-}
-
-void Lucerna::majorRedraw() {
-	warning("STUB: Lucerna::major_redraw()");
-}
-
-uint16 Lucerna::bearing(byte whichPed) {
-	static const double rad2deg = 180 / 3.14; // Pi
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	PedType *curPed = &_vm->_gyro->_peds[whichPed];
-
-	if (avvy->_x == curPed->_x)
-		return 0;
-	else if (avvy->_x < curPed->_x) {
-		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 90);
-	} else {
-		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 270);
-	}
-}
-
-/** 
- * @remarks	Originally called 'sprite_run'
- */
-void Lucerna::spriteRun() {
-	_vm->_gyro->_doingSpriteRun = true;
-	_vm->_animation->animLink();
-	_vm->_gyro->_doingSpriteRun = false;
-}
-
-void Lucerna::fixFlashers() {
-	_vm->_gyro->_ledStatus = 177;
-	_vm->_animation->_oldDirection = 177;
-	_vm->_dialogs->setReadyLight(2);
-	drawDirection();
-}
-
-} // End of namespace Avalanche
diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h
deleted file mode 100644
index 87b1931..0000000
--- a/engines/avalanche/lucerna.h
+++ /dev/null
@@ -1,124 +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.
- *
- */
-
-/*
- * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
- * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
- */
-
-/* LUCERNA		The screen, [keyboard] and mouse handler.*/
-
-#ifndef AVALANCHE_LUCERNA2_H
-#define AVALANCHE_LUCERNA2_H
-
-#include "common/scummsys.h"
-#include "common/file.h"
-
-namespace Avalanche {
-class AvalancheEngine;
-
-class Clock {
-public:
-	Clock(AvalancheEngine *vm);
-
-	void update();
-	
-private:
-	static const int kCenterX = 510;
-	static const int kCenterY = 183;
-
-	AvalancheEngine *_vm;
-
-	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
-	Common::Point _clockHandHour, _clockHandMinute;
-
-	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
-	void drawHand(const Common::Point &endPoint, byte color);
-	void plotHands();
-	void chime();
-};
-
-class Lucerna {
-public:
-	bool _holdLeftMouse;
-	Clock _clock;
-	
-	Lucerna(AvalancheEngine *vm);
-	~Lucerna();
-
-	void init();
-	void callVerb(byte id);
-	void drawAlsoLines();
-	void loadRoom(byte num);
-	void exitRoom(byte x);
-	void enterRoom(byte room, byte ped);
-	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
-	void loadDigits(); // Load the scoring digits & rwlites
-	void drawToolbar();
-	void drawScore();
-	void incScore(byte num); // Add on no. of points
-	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
-	void fxToggle();
-	void refreshObjectList();
-	void checkClick();
-	void errorLed();
-	void dusk();
-	void dawn();
-	void drawDirection(); // Draws the little icon at the left end of the text input field.
-	void gameOver();
-	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
-	void fixFlashers();
-	void loadAlso(byte num);
-
-	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
-	void minorRedraw();
-	void majorRedraw();
-
-	void spriteRun();
-
-private:
-	AvalancheEngine *_vm;
-
-	Common::File file;
-
-	Common::String readAlsoStringFromFile();
-	void scram(Common::String &str);
-	void unScramble();
-
-	void zoomOut(int16 x, int16 y); // Only used when entering the map.
-	void enterNewTown();
-	void findPeople(byte room);
-	void putGeidaAt(byte whichPed, byte ped);
-	void guideAvvy(Common::Point cursorPos);
-
-	// Will be used in dusk() and dawn().
-	bool _fxHidden;
-
-	int8 fades(int8 x);
-	void fadeOut(byte n);
-	void fadeIn(byte n);
-
-};
-
-} // End of namespace Avalanche
-
-#endif // AVALANCHE_LUCERNA2_H
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 64b3b97..0fb1f62 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -29,8 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/menu.h"
-#include "avalanche/lucerna.h"
-#include "avalanche/gyro.h"
 #include "avalanche/animation.h"
 
 #include "common/textconsole.h"
@@ -67,7 +65,7 @@ void HeadType::highlight() {
 	_menu->_activeMenuItem._activeNum = _position;
 	_menu->_menuActive = true;
 
-	_menu->_vm->_gyro->_currentMouse = 177; // Force redraw of cursor.
+	_menu->_vm->_avalot->_currentMouse = 177; // Force redraw of cursor.
 }
 
 bool HeadType::parseAltTrigger(char key) {
@@ -137,8 +135,8 @@ void MenuItem::display() {
 	for (int y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 
-	_dr->_vm->_gyro->_defaultLed = 1;
-	_dr->_vm->_gyro->_currentMouse = 177;
+	_dr->_vm->_avalot->_defaultLed = 1;
+	_dr->_vm->_avalot->_currentMouse = 177;
 
 	CursorMan.showMouse(true); // 4 = fletch
 }
@@ -151,7 +149,7 @@ void MenuItem::wipe() {
 	_activeNow = false;
 	_dr->_menuActive = false;
 	_firstlix = false;
-	_dr->_vm->_gyro->_defaultLed = 2;
+	_dr->_vm->_avalot->_defaultLed = 2;
 
 	CursorMan.showMouse(true);
 }
@@ -220,13 +218,13 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Menu
 void MenuBar::draw() {
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
-	byte savecp = _dr->_vm->_gyro->_cp;
-	_dr->_vm->_gyro->_cp = 3;
+	byte savecp = _dr->_vm->_avalot->_cp;
+	_dr->_vm->_avalot->_cp = 3;
 
 	for (int i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
 
-	_dr->_vm->_gyro->_cp = savecp;
+	_dr->_vm->_avalot->_cp = savecp;
 }
 
 void MenuBar::parseAltTrigger(char c) {
@@ -264,30 +262,30 @@ Menu::Menu(AvalancheEngine *vm) {
 }
 
 void Menu::findWhatYouCanDoWithIt() {
-	switch (_vm->_gyro->_thinks) {
-	case Gyro::kObjectWine:
-	case Gyro::kObjectPotion:
-	case Gyro::kObjectInk:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeDrink;
+	switch (_vm->_avalot->_thinks) {
+	case Avalot::kObjectWine:
+	case Avalot::kObjectPotion:
+	case Avalot::kObjectInk:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeDrink;
 		break;
-	case Gyro::kObjectBell:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeRing;
+	case Avalot::kObjectBell:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeRing;
 		break;
-	case Gyro::kObjectChastity:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
+	case Avalot::kObjectChastity:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
-	case Gyro::kObjectLute:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodePlay;
+	case Avalot::kObjectLute:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodePlay;
 		break;
-	case Gyro::kObjectMushroom:
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeEat;
+	case Avalot::kObjectMushroom:
+	case Avalot::kObjectOnion:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeEat;
 		break;
-	case Gyro::kObjectClothes:
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
+	case Avalot::kObjectClothes:
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
 	default:
-		_vm->_gyro->_verbStr = Parser::kVerbCodeExam; // Anything else.
+		_vm->_avalot->_verbStr = Parser::kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -312,7 +310,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 	for (uint i = 0; i < text.size(); i++) {
 		for (int j = 0; j < 8; j++) {
 			byte idx = text[i];
-			font[idx][j] = _vm->_gyro->_font[idx][j] & ander; // Set the font.
+			font[idx][j] = _vm->_avalot->_font[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
 			for (int k = 0; k < 8; k++)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
@@ -414,9 +412,9 @@ void Menu::setupMenuFile() {
 	_activeMenuItem.reset();
 	_activeMenuItem.setupOption("New game", 'N', "f4", true);
 	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
-	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_gyro->_alive);
-	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_gyro->_atKey + '1', true);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_avalot->_alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_avalot->_alive);
+	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_avalot->_atKey + '1', true);
 	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
 	_activeMenuItem.display();
 }
@@ -424,7 +422,7 @@ void Menu::setupMenuFile() {
 void Menu::setupMenuAction() {
 	_activeMenuItem.reset();
 
-	Common::String f5Does = _vm->_gyro->f5Does();
+	Common::String f5Does = _vm->_avalot->f5Does();
 	for (int i = 0; i < 2; i++)
 		if (!f5Does.empty())
 			f5Does.deleteChar(0);
@@ -433,13 +431,13 @@ void Menu::setupMenuAction() {
 	else
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_gyro->_room == kRoomMap)
+	if (_vm->_avalot->_room == kRoomMap)
 		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
 	else
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]._speedX == _vm->_gyro->kWalk)
+	if (_vm->_animation->_sprites[0]._speedX == _vm->_avalot->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -454,8 +452,8 @@ void Menu::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (int i = 150; i <= 178; i++) {
-		if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) {
-			_activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
+		if (_vm->_avalot->_whereIs[i - 150] == _vm->_avalot->_room) {
+			_activeMenuItem.setupOption(_vm->_avalot->getName(i), _vm->_avalot->getNameChar(i), "", true);
 			people += i;
 		}
 	}
@@ -466,8 +464,8 @@ void Menu::setupMenuPeople() {
 void Menu::setupMenuObjects() {
 	_activeMenuItem.reset();
 	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i])
-			_activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
+		if (_vm->_avalot->_objects[i])
+			_activeMenuItem.setupOption(_vm->_avalot->getThing(i + 1), _vm->_avalot->getThingChar(i + 1), "", true);
 	}
 	_activeMenuItem.display();
 }
@@ -475,54 +473,54 @@ void Menu::setupMenuObjects() {
 void Menu::setupMenuWith() {
 	_activeMenuItem.reset();
 
-	if (_vm->_gyro->_thinkThing) {
+	if (_vm->_avalot->_thinkThing) {
 		findWhatYouCanDoWithIt();
 
-		for (uint i = 0; i < _vm->_gyro->_verbStr.size(); i++) {
+		for (uint i = 0; i < _vm->_avalot->_verbStr.size(); i++) {
 			char vbchar;
 			Common::String verb;
 
-			_vm->_parser->verbOpt(_vm->_gyro->_verbStr[i], verb, vbchar);
+			_vm->_parser->verbOpt(_vm->_avalot->_verbStr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_parser->kNothing)
-			|| (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room))
+		if ((_vm->_avalot->_lastPerson == Avalot::kPeopleAvalot) || (_vm->_avalot->_lastPerson == _vm->_parser->kNothing)
+			|| (_vm->_avalot->_whereIs[_vm->_avalot->_lastPerson - 150] != _vm->_avalot->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodeGive;
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_avalot->getName(_vm->_avalot->_lastPerson), 'G', "", true);
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
-		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_gyro->_thinks), 'T', "", true);
-		_vm->_gyro->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeTalk;
-		switch (_vm->_gyro->_thinks) {
-		case Gyro::kPeopleGeida:
-		case Gyro::kPeopleArkata:
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_avalot->_thinks), 'T', "", true);
+		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeTalk;
+		switch (_vm->_avalot->_thinks) {
+		case Avalot::kPeopleGeida:
+		case Avalot::kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodeKiss;
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodeKiss;
 			break;
-		case Gyro::kPeopleDogfood:
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won.
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Parser::kVerbCodePlay;
+		case Avalot::kPeopleDogfood:
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_avalot->_wonNim); // True if you HAVEN'T won.
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodePlay;
 			break;
-		case Gyro::kPeopleMalagauche: {
-			bool isSober = !_vm->_gyro->_teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
+		case Avalot::kPeopleMalagauche: {
+			bool isSober = !_vm->_avalot->_teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_avalot->_objects[Avalot::kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
 			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 101 + 100 + 102 + 103 + 104;
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 101 + 100 + 102 + 103 + 104;
 			}
 			break;
-		case Gyro::kPeopleTrader:
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]);
-			_vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
+		case Avalot::kPeopleTrader:
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_avalot->_objects[Avalot::kObjectOnion - 1]);
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 105;
 			break;
 		}
 	}
@@ -533,19 +531,19 @@ void Menu::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeHelp);
+		_vm->_avalot->callVerb(Parser::kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeBoss);
+		_vm->_avalot->callVerb(Parser::kVerbCodeBoss);
 		break;
 	case 2:
-		_vm->_lucerna->majorRedraw();
+		_vm->_avalot->majorRedraw();
 		break;
 	case 3:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeScore);
+		_vm->_avalot->callVerb(Parser::kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeInfo);
+		_vm->_avalot->callVerb(Parser::kVerbCodeInfo);
 		break;
 	}
 }
@@ -554,17 +552,17 @@ void Menu::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeRestart);
+		_vm->_avalot->callVerb(Parser::kVerbCodeRestart);
 		break;
 	case 1:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Parser::kVerbCodeLoad);
+		_vm->_avalot->callVerb(Parser::kVerbCodeLoad);
 		break;
 	case 2:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_lucerna->callVerb(Parser::kVerbCodeSave);
+		_vm->_avalot->callVerb(Parser::kVerbCodeSave);
 		break;
 	case 3:
 		//_vm->_basher->filename_edit();
@@ -574,7 +572,7 @@ void Menu::runMenuFile() {
 		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeQuit);
+		_vm->_avalot->callVerb(Parser::kVerbCodeQuit);
 		break;
 	}
 }
@@ -586,29 +584,29 @@ void Menu::runMenuAction() {
 	case 0:
 		_vm->_parser->_person = _vm->_parser->kPardon;
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		f5Does = _vm->_gyro->f5Does();
-		_vm->_lucerna->callVerb(f5Does[0]);
+		f5Does = _vm->_avalot->f5Does();
+		_vm->_avalot->callVerb(f5Does[0]);
 		break;
 	case 1:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_lucerna->callVerb(Parser::kVerbCodePause);
+		_vm->_avalot->callVerb(Parser::kVerbCodePause);
 		break;
 	case 2:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeOpen);
+		_vm->_avalot->callVerb(Parser::kVerbCodeOpen);
 		break;
 	case 3:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_lucerna->callVerb(Parser::kVerbCodeLook);
+		_vm->_avalot->callVerb(Parser::kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeInv);
+		_vm->_avalot->callVerb(Parser::kVerbCodeInv);
 		break;
 	case 5: {
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
-		if (avvy->_speedX == _vm->_gyro->kWalk)
-			avvy->_speedX = _vm->_gyro->kRun;
+		if (avvy->_speedX == _vm->_avalot->kWalk)
+			avvy->_speedX = _vm->_avalot->kRun;
 		else
-			avvy->_speedX = _vm->_gyro->kWalk;
+			avvy->_speedX = _vm->_avalot->kWalk;
 		_vm->_animation->updateSpeed();
 		}
 		break;
@@ -616,57 +614,57 @@ void Menu::runMenuAction() {
 }
 
 void Menu::runMenuObjects() {
-	_vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum], Gyro::kThing);
+	_vm->_avalot->thinkAbout(_vm->_avalot->_objectList[_activeMenuItem._choiceNum], Avalot::kThing);
 }
 
 void Menu::runMenuPeople() {
-	_vm->_lucerna->thinkAbout(people[_activeMenuItem._choiceNum], Gyro::kPerson);
-	_vm->_gyro->_lastPerson = people[_activeMenuItem._choiceNum];
+	_vm->_avalot->thinkAbout(people[_activeMenuItem._choiceNum], Avalot::kPerson);
+	_vm->_avalot->_lastPerson = people[_activeMenuItem._choiceNum];
 }
 
 void Menu::runMenuWith() {
-	_vm->_parser->_thing = _vm->_gyro->_thinks;
+	_vm->_parser->_thing = _vm->_avalot->_thinks;
 
-	if (_vm->_gyro->_thinkThing) {
+	if (_vm->_avalot->_thinkThing) {
 		_vm->_parser->_thing += 49;
 
-		if (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive)
-			_vm->_parser->_person = _vm->_gyro->_lastPerson;
+		if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive)
+			_vm->_parser->_person = _vm->_avalot->_lastPerson;
 		else
 			_vm->_parser->_person = Parser::kPardon;
 	} else {
-		switch (_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]) {
+		switch (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
 			_vm->_parser->_thing = 100;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 101: // Wine
 			_vm->_parser->_thing = 50;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 102: // Whisky
 			_vm->_parser->_thing = 102;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 103: // Cider
 			_vm->_parser->_thing = 103;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 104: // Mead
 			_vm->_parser->_thing = 107;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		case 105: // Onion (trader)
 			_vm->_parser->_thing = 67;
-			_vm->_lucerna->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		default:
 			_vm->_parser->_person = _vm->_parser->_thing;
 			_vm->_parser->_thing = Parser::kPardon;
-			_vm->_gyro->_subjectNum = 0;
+			_vm->_avalot->_subjectNum = 0;
 		}
 	}
-	_vm->_lucerna->callVerb(_vm->_gyro->_verbStr[_activeMenuItem._choiceNum]);
+	_vm->_avalot->callVerb(_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Menu::setup() {
@@ -688,11 +686,11 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 	::Graphics::Surface backup;
 	backup.copyFrom(_vm->_graphics->_surface);
 
-	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_lucerna->_holdLeftMouse) {
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_avalot->_holdLeftMouse) {
 		_menuBar.chooseMenuItem(cursorPos.x);
 		do
 			_vm->updateEvents();
-		while (_vm->_lucerna->_holdLeftMouse);
+		while (_vm->_avalot->_holdLeftMouse);
 
 		while (!_vm->shouldQuit()) {
 			do {
@@ -702,28 +700,28 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_gyro->newMouse(0); // Up arrow
+					_vm->_avalot->newMouse(0); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->_gyro->newMouse(2); // Right-arrow
+						_vm->_avalot->newMouse(2); // Right-arrow
 					else
-						_vm->_gyro->newMouse(3); // Fletch
+						_vm->_avalot->newMouse(3); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_gyro->newMouse(1); // Screwdriver
+					_vm->_avalot->newMouse(1); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 
 				_vm->_graphics->refreshScreen();
-			} while (!_vm->_lucerna->_holdLeftMouse);
+			} while (!_vm->_avalot->_holdLeftMouse);
 
-			if (_vm->_lucerna->_holdLeftMouse) {
+			if (_vm->_avalot->_holdLeftMouse) {
 				if (cursorPos.y > 21) {
 					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
 						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1))))) {
 							// Clicked OUTSIDE the menu.
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
-								_vm->_lucerna->_holdLeftMouse = false;
+								_vm->_avalot->_holdLeftMouse = false;
 								backup.free();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
@@ -737,11 +735,11 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
-							_vm->_lucerna->_holdLeftMouse = false;
+							_vm->_avalot->_holdLeftMouse = false;
 							backup.free();
 							return;
 						} else {
-							_vm->_lucerna->_holdLeftMouse = true;
+							_vm->_avalot->_holdLeftMouse = true;
 							break;
 						}
 					}
@@ -758,7 +756,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 						_vm->_graphics->refreshScreen();
 
 						_vm->updateEvents();
-						if (!_vm->_lucerna->_holdLeftMouse)
+						if (!_vm->_avalot->_holdLeftMouse)
 							break;
 					}
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 541123f..9c1205d 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -9,8 +9,6 @@ MODULE_OBJS = \
 	console.o \
 	detection.o \
 	graphics.o \
-	gyro.o \
-	lucerna.o \
 	menu.o \
 	parser.o \
 	pingo.o \
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 29fadda..4a58763 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -27,8 +27,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/parser.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/dialogs.h"
 #include "avalanche/timer.h"
 #include "avalanche/animation.h"
@@ -53,7 +51,7 @@ void Parser::init() {
 		_inputText.clear();
 	_inputTextPos = 0;
 
-	_vm->_gyro->_weirdWord = false;
+	_vm->_avalot->_weirdWord = false;
 
 	// Initailaze the vocabulary.
 	// Verbs: 1-49
@@ -425,10 +423,10 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F5:
 		_person = kPardon;
 		_thing = kPardon;
-		_vm->_lucerna->callVerb(_vm->_gyro->f5Does()[0]);
+		_vm->_avalot->callVerb(_vm->_avalot->f5Does()[0]);
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_lucerna->callVerb(Parser::kVerbCodeOpen);
+		_vm->_avalot->callVerb(Parser::kVerbCodeOpen);
 		break;
 	default:
 		break;
@@ -440,7 +438,7 @@ void Parser::plotText() {
 	cursorOff();
 
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_gyro->_font, 8, 24, 161, kColorWhite);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_avalot->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);
@@ -539,7 +537,7 @@ Common::String Parser::rank() {
 	};
 
 	for (int i = 0; i < 8; i++) {
-		if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) {
+		if ((_vm->_avalot->_dnascore >= kRanks[i]._score) && (_vm->_avalot->_dnascore < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
 		}
 	}
@@ -551,7 +549,7 @@ Common::String Parser::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds.
+	h = floor(_vm->_avalot->_totalTime / ticksInOneSec); // No. of seconds.
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;
@@ -593,10 +591,10 @@ void Parser::displayWhat(byte target, bool animate, bool &ambiguous) {
 			_vm->_dialogs->displayText("What?");
 	} else {
 		if (animate) {
-			Common::String tmpStr = Common::String::format("{ %s }", _vm->_gyro->getName(target).c_str());
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName(target).c_str());
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
-			Common::String z = _vm->_gyro->getItem(target);
+			Common::String z = _vm->_avalot->getItem(target);
 			if (z != "") {
 				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
 				_vm->_dialogs->displayText(tmpStr);
@@ -612,16 +610,16 @@ bool Parser::doPronouns() {
 		byte wordCode = _thats[i];
 		switch (wordCode) {
 		case 200:
-			displayWhat(_vm->_gyro->_him, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_him, i);
+			displayWhat(_vm->_avalot->_him, true, ambiguous);
+			_thats.setChar(_vm->_avalot->_him, i);
 			break;
 		case 201:
-			displayWhat(_vm->_gyro->_her, true, ambiguous);
-			_thats.setChar(_vm->_gyro->_her, i);
+			displayWhat(_vm->_avalot->_her, true, ambiguous);
+			_thats.setChar(_vm->_avalot->_her, i);
 			break;
 		case 202:
-			displayWhat(_vm->_gyro->_it, false, ambiguous);
-			_thats.setChar(_vm->_gyro->_it, i);
+			displayWhat(_vm->_avalot->_it, false, ambiguous);
+			_thats.setChar(_vm->_avalot->_it, i);
 			break;
 		}
 	}
@@ -666,32 +664,32 @@ void Parser::storeInterrogation(byte interrogation) {
 	case 1:
 		_inputText.toLowercase();
 		sayIt();
-		_vm->_gyro->_favouriteDrink = _inputText;
-		_vm->_gyro->_cardiffQuestionNum = 2;
+		_vm->_avalot->_favouriteDrink = _inputText;
+		_vm->_avalot->_cardiffQuestionNum = 2;
 		break;
 	case 2:
 		properNouns();
 		sayIt();
-		_vm->_gyro->_favouriteSong = _inputText;
-		_vm->_gyro->_cardiffQuestionNum = 3;
+		_vm->_avalot->_favouriteSong = _inputText;
+		_vm->_avalot->_cardiffQuestionNum = 3;
 		break;
 	case 3:
 		properNouns();
 		sayIt();
-		_vm->_gyro->_worstPlaceOnEarth = _inputText;
-		_vm->_gyro->_cardiffQuestionNum = 4;
+		_vm->_avalot->_worstPlaceOnEarth = _inputText;
+		_vm->_avalot->_cardiffQuestionNum = 4;
 		break;
 	case 4:
 		_inputText.toLowercase();
 		sayIt();
-		if (!_vm->_gyro->_spareEvening.empty())
-			_vm->_gyro->_spareEvening.clear();
-		_vm->_gyro->_spareEvening = _inputText;
+		if (!_vm->_avalot->_spareEvening.empty())
+			_vm->_avalot->_spareEvening.clear();
+		_vm->_avalot->_spareEvening = _inputText;
 		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
-		_vm->_gyro->_cardiffQuestionNum = 5;
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing;
+		_vm->_avalot->_cardiffQuestionNum = 5;
 		break;
 	case 99:
 		//store_high(_inputText);
@@ -727,9 +725,9 @@ void Parser::parse() {
 	}
 
 	// Are we being interrogated right now?
-	if (_vm->_gyro->_interrogation > 0) {
-		storeInterrogation(_vm->_gyro->_interrogation);
-		_vm->_gyro->_weirdWord = true;
+	if (_vm->_avalot->_interrogation > 0) {
+		storeInterrogation(_vm->_avalot->_interrogation);
+		_vm->_avalot->_weirdWord = true;
 		return;
 	}
 
@@ -761,7 +759,7 @@ void Parser::parse() {
 		// Check also[] first, which contains words about the actual room.
 		if (!thisword.empty()) {
 			for (int i = 0; i < 31; i++) {
-				if ((_vm->_gyro->_also[i][0] != 0) && (getPos(',' + thisword, *_vm->_gyro->_also[i][0]) > -1)) {
+				if ((_vm->_avalot->_also[i][0] != 0) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) {
 					_thats += Common::String(99 + i);
 					notfound = false;
 				}
@@ -813,12 +811,12 @@ void Parser::parse() {
 	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
-	if (_vm->_gyro->_room == kRoomNottsPub)
+	if (_vm->_avalot->_room == kRoomNottsPub)
 		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
 		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomAylesOffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;
@@ -830,39 +828,39 @@ void Parser::parse() {
 	}
 
 	if (doPronouns()) {
-		_vm->_gyro->_weirdWord = true;
+		_vm->_avalot->_weirdWord = true;
 		_thats = kNothing;
 		return;
 	}
 
 	// Second parsing.
-	if (!_vm->_gyro->_subject.empty())
-		_vm->_gyro->_subject.clear();
-	_vm->_gyro->_subjectNum = 0; // Find subject of conversation.
+	if (!_vm->_avalot->_subject.empty())
+		_vm->_avalot->_subject.clear();
+	_vm->_avalot->_subjectNum = 0; // Find subject of conversation.
 
 	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
 		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
-			_vm->_gyro->_subjectNum = (byte)_thats[i];
+			_vm->_avalot->_subjectNum = (byte)_thats[i];
 			_thats.setChar(kMoved, i);
 			break;
 		}
 	}
 
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // Still not found.
+	if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // Still not found.
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_vm->_avalot->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
 		}
 	}
 
-	if ((_vm->_gyro->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+	if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
-				_vm->_gyro->_subjectNum = (byte)_thats[i + 1];
+				_vm->_avalot->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
@@ -884,30 +882,30 @@ void Parser::parse() {
 	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_gyro->_weirdWord = true;
+		_vm->_avalot->_weirdWord = true;
 	} else
-		_vm->_gyro->_weirdWord = false;
+		_vm->_avalot->_weirdWord = false;
 
 	if (_thats.empty())
 		_thats = kNothing;
 
 	if (_thing != kPardon)
-		_vm->_gyro->_it = _thing;
+		_vm->_avalot->_it = _thing;
 
 	if (_person != kPardon) {
-		if (_person < Gyro::kPeopleArkata)
-			_vm->_gyro->_him = _person;
+		if (_person < Avalot::kPeopleArkata)
+			_vm->_avalot->_him = _person;
 		else
-			_vm->_gyro->_her = _person;
+			_vm->_avalot->_her = _person;
 	}
 }
 
 void Parser::examineObject() {
-	if (_thing != _vm->_gyro->_thinks)
-		_vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
+	if (_thing != _vm->_avalot->_thinks)
+		_vm->_avalot->thinkAbout(_thing, Avalot::kThing);
 	switch (_thing) {
-	case Gyro::kObjectWine :
-		switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
+	case Avalot::kObjectWine :
+		switch (_vm->_avalot->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
@@ -919,8 +917,8 @@ void Parser::examineObject() {
 			break;
 		}
 		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
+	case Avalot::kObjectOnion:
+		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
 		else
 			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
@@ -931,11 +929,11 @@ void Parser::examineObject() {
 }
 
 bool Parser::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room))
+	if ((_person == kPardon) || (_person == 0) || (_vm->_avalot->_whereIs[_person - 150] == _vm->_avalot->_room))
 		return true;
 	else {
 		Common::String tmpStr;
-		if (_person < Gyro::kPeopleArkata)
+		if (_person < Avalot::kPeopleArkata)
 			tmpStr = "He isn't around at the moment.";
 		else
 			tmpStr = "She isn't around at the moment.";
@@ -946,19 +944,19 @@ bool Parser::isPersonHere() { // Person equivalent of "holding".
 
 void Parser::exampers() {
 	if (isPersonHere()) {
-		if (_thing != _vm->_gyro->_thinks)
-			_vm->_lucerna->thinkAbout(_person, Gyro::kPerson);
+		if (_thing != _vm->_avalot->_thinks)
+			_vm->_avalot->thinkAbout(_person, Avalot::kPerson);
 
 		byte newPerson = _person - 149;
 
-		if ((_person == Gyro::kPeopleDogfood) && _vm->_gyro->_wonNim)
+		if ((_person == Avalot::kPeopleDogfood) && _vm->_avalot->_wonNim)
 			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
-		else if ((_person == Gyro::kPeopleDuLustie) && _vm->_gyro->_lustieIsAsleep)
+		else if ((_person == Avalot::kPeopleDuLustie) && _vm->_avalot->_lustieIsAsleep)
 			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
 		else
 			_vm->_dialogs->displayScrollChain('p', newPerson);
 
-		if ((_person == Gyro::kPeopleAyles) && !_vm->_gyro->_aylesIsAwake)
+		if ((_person == Avalot::kPeopleAyles) && !_vm->_avalot->_aylesIsAwake)
 			_vm->_dialogs->displayScrollChain('Q', 13);
 
 		_person = newPerson;
@@ -977,7 +975,7 @@ bool Parser::isHolding() {
 
 	if (_thing > 100)
 		_vm->_dialogs->displayText("Be reasonable!");
-	else if (!_vm->_gyro->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+	else if (!_vm->_avalot->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_dialogs->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
@@ -986,7 +984,7 @@ bool Parser::isHolding() {
 }
 
 void Parser::openBox(bool isOpening) {
-	if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) {
+	if ((_vm->_avalot->_room == kRoomYours) && (_thing == 54)) {
 		_vm->_background->drawBackgroundSprite(-1, -1, 4);
 
 		_vm->_background->updateBackgroundSprites();
@@ -1013,7 +1011,7 @@ void Parser::examine() {
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_dialogs->displayText(*_vm->_gyro->_also[_thing - 50][1]);
+				_vm->_dialogs->displayText(*_vm->_avalot->_also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
@@ -1028,22 +1026,22 @@ void Parser::inventory() {
 	Common::String tmpStr = Common::String("You're carrying ");
 
 	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_gyro->_objects[i]) {
+		if (_vm->_avalot->_objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_gyro->_carryNum)
+			if (itemNum == _vm->_avalot->_carryNum)
 				tmpStr += "and ";
 
-			tmpStr += _vm->_gyro->getItem(i + 1);
+			tmpStr += _vm->_avalot->getItem(i + 1);
 
-			if ((i + 1) == _vm->_gyro->_wearing)
+			if ((i + 1) == _vm->_avalot->_wearing)
 				tmpStr += ", which you're wearing";
 
-			if (itemNum < _vm->_gyro->_carryNum)
+			if (itemNum < _vm->_avalot->_carryNum)
 				tmpStr += ", ";
 		}
 	}
 
-	if (_vm->_gyro->_wearing == kNothing)
+	if (_vm->_avalot->_wearing == kNothing)
 		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 	else
 		tmpStr += '.';
@@ -1053,18 +1051,18 @@ void Parser::inventory() {
 
 void Parser::swallow() { // Eat something.
 	switch (_thing) {
-	case Gyro::kObjectWine:
-		switch (_vm->_gyro->_wineState) { // 4 is perfect
+	case Avalot::kObjectWine:
+		switch (_vm->_avalot->_wineState) { // 4 is perfect
 		case 1:
-			if (_vm->_gyro->_teetotal)  {
+			if (_vm->_avalot->_teetotal)  {
 				_vm->_dialogs->displayScrollChain('D', 6);
 				return;
 			}
 			_vm->_dialogs->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_dialogs->displayScrollChain('U', 2);
-			_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
-			_vm->_lucerna->refreshObjectList();
+			_vm->_avalot->_objects[Avalot::kObjectWine - 1] = false;
+			_vm->_avalot->refreshObjectList();
 			drink();
 			break;
 		case 2:
@@ -1073,33 +1071,33 @@ void Parser::swallow() { // Eat something.
 			break; // You can't drink it!
 		}
 		break;
-	case Gyro::kObjectPotion:
-		_vm->_gyro->setBackgroundColor(4);
+	case Avalot::kObjectPotion:
+		_vm->_avalot->setBackgroundColor(4);
 		_vm->_dialogs->displayScrollChain('U', 3);
-		_vm->_lucerna->gameOver();
-		_vm->_gyro->setBackgroundColor(0);
+		_vm->_avalot->gameOver();
+		_vm->_avalot->setBackgroundColor(0);
 		break;
-	case Gyro::kObjectInk:
+	case Avalot::kObjectInk:
 		_vm->_dialogs->displayScrollChain('U', 4);
 		break;
-	case Gyro::kObjectChastity:
+	case Avalot::kObjectChastity:
 		_vm->_dialogs->displayScrollChain('U', 5);
 		break;
-	case Gyro::kObjectMushroom:
+	case Avalot::kObjectMushroom:
 		_vm->_dialogs->displayScrollChain('U', 6);
-		_vm->_lucerna->gameOver();
+		_vm->_avalot->gameOver();
 		break;
-	case Gyro::kObjectOnion:
-		if (_vm->_gyro->_rottenOnion)
+	case Avalot::kObjectOnion:
+		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('U', 11);
 		else {
 			_vm->_dialogs->displayScrollChain('U', 8);
-			_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-			_vm->_lucerna->refreshObjectList();
+			_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = false;
+			_vm->_avalot->refreshObjectList();
 		}
 		break;
 	default:
-		if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub))
+		if ((_vm->_avalot->_room == kRoomArgentPub) || (_vm->_avalot->_room == kRoomNottsPub))
 			_vm->_dialogs->displayText("Try BUYing things before you drink them!");
 		else
 			_vm->_dialogs->displayText("The taste of it makes you retch!");
@@ -1110,7 +1108,7 @@ void Parser::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
 	for (int i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room)
+		if (_vm->_avalot->_whereIs[i] == _vm->_avalot->_room)
 			numPeople++;
 	}
 
@@ -1120,14 +1118,14 @@ void Parser::peopleInRoom() {
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
 	for (int i = 1; i < 29; i++) {
-		if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) {
+		if (_vm->_avalot->_whereIs[i] == _vm->_avalot->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				tmpStr = _vm->_gyro->getName(i + 150);
+				tmpStr = _vm->_avalot->getName(i + 150);
 			else if (actPerson < numPeople) // The middle...
-				tmpStr += ", " + _vm->_gyro->getName(i + 150);
+				tmpStr += ", " + _vm->_avalot->getName(i + 150);
 			else // The end.
-				tmpStr += " and " + _vm->_gyro->getName(i + 150);
+				tmpStr += " and " + _vm->_avalot->getName(i + 150);
 		}
 	}
 
@@ -1140,30 +1138,30 @@ void Parser::peopleInRoom() {
 }
 
 void Parser::lookAround() {
-	_vm->_dialogs->displayText(*_vm->_gyro->_also[0][1]);
-	switch (_vm->_gyro->_room) {
+	_vm->_dialogs->displayText(*_vm->_avalot->_also[0][1]);
+	switch (_vm->_avalot->_room) {
 	case kRoomSpludwicks:
-		if (_vm->_gyro->_avariciusTalk > 0)
+		if (_vm->_avalot->_avariciusTalk > 0)
 			_vm->_dialogs->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case kRoomRobins:
-		if (_vm->_gyro->_tiedUp)
+		if (_vm->_avalot->_tiedUp)
 			_vm->_dialogs->displayScrollChain('q', 38);
-		if (_vm->_gyro->_mushroomGrowing)
+		if (_vm->_avalot->_mushroomGrowing)
 			_vm->_dialogs->displayScrollChain('q', 55);
 		break;
 	case kRoomInsideCardiffCastle:
-		if (!_vm->_gyro->_takenPen)
+		if (!_vm->_avalot->_takenPen)
 			_vm->_dialogs->displayScrollChain('q', 49);
 		break;
 	case kRoomLustiesRoom:
-		if (_vm->_gyro->_lustieIsAsleep)
+		if (_vm->_avalot->_lustieIsAsleep)
 			_vm->_dialogs->displayScrollChain('q', 65);
 		break;
 	case kRoomCatacombs:
-		switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
+		switch (_vm->_avalot->_catacombY * 256 + _vm->_avalot->_catacombX) {
 		case 258 :
 			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
 			break;
@@ -1182,7 +1180,7 @@ void Parser::lookAround() {
 
 void Parser::openDoor() {
 	// Special cases.
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
 			// Opening the box.
@@ -1200,28 +1198,28 @@ void Parser::openDoor() {
 		break;
 	}
 
-	if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties))
+	if ((!_vm->_avalot->_userMovesAvvy) && (_vm->_avalot->_room != kRoomLusties))
 		return; // No doors can open if you can't move Avvy.
 
 	for (int i = 0; i < 7; i++) {
 		if (_vm->_animation->inField(i + 8)) {
-			MagicType *portal = &_vm->_gyro->_portals[i];
+			MagicType *portal = &_vm->_avalot->_portals[i];
 			switch (portal->_operation) {
-			case Gyro::kMagicExclaim:
+			case Avalot::kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
-			case Gyro::kMagicTransport:
+			case Avalot::kMagicTransport:
 				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
 				break;
-			case Gyro::kMagicUnfinished:
+			case Avalot::kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
 				break;
-			case Gyro::kMagicSpecial:
+			case Avalot::kMagicSpecial:
 				_vm->_animation->callSpecial(portal->_data);
 				break;
-			case Gyro::kMagicOpenDoor:
+			case Avalot::kMagicOpenDoor:
 				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
 				break;
 			}
@@ -1230,7 +1228,7 @@ void Parser::openDoor() {
 		}
 	}
 
-	if (_vm->_gyro->_room == kRoomMap)
+	if (_vm->_avalot->_room == kRoomMap)
 		_vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
@@ -1254,17 +1252,17 @@ void Parser::putProc() {
 
 	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
 	switch (_thing2) {
-	case Gyro::kObjectWine:
-		if (_thing == Gyro::kObjectOnion) {
-			if (_vm->_gyro->_rottenOnion)
+	case Avalot::kObjectWine:
+		if (_thing == Avalot::kObjectOnion) {
+			if (_vm->_avalot->_rottenOnion)
 				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
-				if (_vm->_gyro->_wineState != 3) {
+				if (_vm->_avalot->_wineState != 3) {
 					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 					_vm->_dialogs->displayText(tmpStr);
 				} else { // Put onion into vinegar! Yes!
-					_vm->_gyro->_onionInVinegar = true;
-					_vm->_lucerna->incScore(7);
+					_vm->_avalot->_onionInVinegar = true;
+					_vm->_avalot->incScore(7);
 					_vm->_dialogs->displayScrollChain('u', 9);
 				}
 			}
@@ -1273,33 +1271,33 @@ void Parser::putProc() {
 		break;
 
 	case 54:
-		if (_vm->_gyro->_room == kRoomYours) { // Put something into the box.
-			if (_vm->_gyro->_boxContent != kNothing)
+		if (_vm->_avalot->_room == kRoomYours) { // Put something into the box.
+			if (_vm->_avalot->_boxContent != kNothing)
 				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
-				case Gyro::kObjectMoney:
+				case Avalot::kObjectMoney:
 					_vm->_dialogs->displayText("You'd better keep some ready cash on you!");
 					break;
-				case Gyro::kObjectBell:
+				case Avalot::kObjectBell:
 					_vm->_dialogs->displayText("That's a silly place to keep a bell.");
 					break;
-				case Gyro::kObjectBodkin:
+				case Avalot::kObjectBodkin:
 					_vm->_dialogs->displayText("But you might need it!");
 					break;
-				case Gyro::kObjectOnion:
+				case Avalot::kObjectOnion:
 					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_gyro->_wearing == _thing) {
-						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
+					if (_vm->_avalot->_wearing == _thing) {
+						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_avalot->getItem(_thing).c_str());
 						_vm->_dialogs->displayText(tmpStr);
 					} else {
 						openBox(true); // Open box.
 
-						_vm->_gyro->_boxContent = _thing;
-						_vm->_gyro->_objects[_thing - 1] = false;
-						_vm->_lucerna->refreshObjectList();
+						_vm->_avalot->_boxContent = _thing;
+						_vm->_avalot->_objects[_thing - 1] = false;
+						_vm->_avalot->refreshObjectList();
 						_vm->_dialogs->displayText("OK, it's in the box.");
 
 						openBox(false); // Shut box.
@@ -1320,7 +1318,7 @@ void Parser::putProc() {
  * @remarks	Originally called 'not_in_order'
  */
 void Parser::notInOrder() {
-	Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]);
+	Common::String itemStr = _vm->_avalot->getItem(_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
 		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
@@ -1341,40 +1339,40 @@ void Parser::goToCauldron() {
  * @remarks	Originally called 'give2spludwick'
  */
 bool Parser::giveToSpludwick() {
-	if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
+	if (_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick] != _thing) {
 		notInOrder();
 		return false;
 	}
 
 	switch (_thing) {
-	case Gyro::kObjectOnion:
-		_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
-		if (_vm->_gyro->_rottenOnion)
+	case Avalot::kObjectOnion:
+		_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = false;
+		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 22);
 		else {
-			_vm->_gyro->_givenToSpludwick++;
+			_vm->_avalot->_givenToSpludwick++;
 			_vm->_dialogs->displayScrollChain('q', 20);
 			goToCauldron();
-			_vm->_lucerna->incScore(3);
+			_vm->_avalot->incScore(3);
 		}
-		_vm->_lucerna->refreshObjectList();
+		_vm->_avalot->refreshObjectList();
 		break;
-	case Gyro::kObjectInk:
-		_vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_givenToSpludwick++;
+	case Avalot::kObjectInk:
+		_vm->_avalot->_objects[Avalot::kObjectInk - 1] = false;
+		_vm->_avalot->refreshObjectList();
+		_vm->_avalot->_givenToSpludwick++;
 		_vm->_dialogs->displayScrollChain('q', 24);
 		goToCauldron();
-		_vm->_lucerna->incScore(3);
+		_vm->_avalot->incScore(3);
 		break;
-	case Gyro::kObjectMushroom:
-		_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
+	case Avalot::kObjectMushroom:
+		_vm->_avalot->_objects[Avalot::kObjectMushroom - 1] = false;
 		_vm->_dialogs->displayScrollChain('q', 25);
-		_vm->_lucerna->incScore(5);
-		_vm->_gyro->_givenToSpludwick++;
+		_vm->_avalot->incScore(5);
+		_vm->_avalot->_givenToSpludwick++;
 		goToCauldron();
-		_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
-		_vm->_lucerna->refreshObjectList();
+		_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = true;
+		_vm->_avalot->refreshObjectList();
 		break;
 	default:
 		return true;
@@ -1384,29 +1382,29 @@ bool Parser::giveToSpludwick() {
 }
 
 void Parser::drink() {
-	_vm->_gyro->_alcoholLevel += 1;
-	if (_vm->_gyro->_alcoholLevel == 5) {
-		_vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
-		_vm->_gyro->_teetotal = true;
-		_vm->_gyro->_avvyIsAwake = false;
-		_vm->_gyro->_avvyInBed = true;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_lucerna->dusk();
-		_vm->_gyro->hangAroundForAWhile();
+	_vm->_avalot->_alcoholLevel += 1;
+	if (_vm->_avalot->_alcoholLevel == 5) {
+		_vm->_avalot->_objects[Avalot::kObjectKey - 1] = true; // Get the key.
+		_vm->_avalot->_teetotal = true;
+		_vm->_avalot->_avvyIsAwake = false;
+		_vm->_avalot->_avvyInBed = true;
+		_vm->_avalot->refreshObjectList();
+		_vm->_avalot->dusk();
+		_vm->_avalot->hangAroundForAWhile();
 		_vm->_animation->flipRoom(1, 1);
-		_vm->_gyro->setBackgroundColor(14);
+		_vm->_avalot->setBackgroundColor(14);
 		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
 
 void Parser::cardiffClimbing() {
-	if (_vm->_gyro->_standingOnDais) { // Clamber up.
+	if (_vm->_avalot->_standingOnDais) { // Clamber up.
 		_vm->_dialogs->displayText("You climb down, back onto the floor.");
-		_vm->_gyro->_standingOnDais = false;
+		_vm->_avalot->_standingOnDais = false;
 		_vm->_animation->appearPed(0, 2);
 	} else if (_vm->_animation->inField(0)) { // Clamber down
 		_vm->_dialogs->displayText("You clamber up onto the dais.");
-		_vm->_gyro->_standingOnDais = true;
+		_vm->_avalot->_standingOnDais = true;
 		_vm->_animation->appearPed(0, 1);
 	} else
 			_vm->_dialogs->displayText("Get a bit closer, Avvy.");
@@ -1417,21 +1415,21 @@ void Parser::already() {
 }
 
 void Parser::standUp() {
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomYours: // Avvy isn't asleep.
-		if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) {  // But he's in bed.
-			if (_vm->_gyro->_teetotal) {
+		if (_vm->_avalot->_avvyIsAwake && _vm->_avalot->_avvyInBed) {  // But he's in bed.
+			if (_vm->_avalot->_teetotal) {
 				_vm->_dialogs->displayScrollChain('d', 12);
-				_vm->_gyro->setBackgroundColor(0);
+				_vm->_avalot->setBackgroundColor(0);
 				_vm->_dialogs->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
-			_vm->_gyro->_userMovesAvvy = true;
+			_vm->_avalot->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->_direction = Animation::kDirLeft;
 			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
-			_vm->_lucerna->incScore(1);
-			_vm->_gyro->_avvyInBed = false;
+			_vm->_avalot->incScore(1);
+			_vm->_avalot->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
 		} else
 			already();
@@ -1442,12 +1440,12 @@ void Parser::standUp() {
 		break;
 
 	case kRoomNottsPub:
-		if (_vm->_gyro->_sittingInPub)  {
+		if (_vm->_avalot->_sittingInPub)  {
 			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(0, 3); // And walking away.
-			_vm->_gyro->_sittingInPub = false; // Really not sitting down.
-			_vm->_gyro->_userMovesAvvy = true; // And ambulant.
+			_vm->_avalot->_sittingInPub = false; // Really not sitting down.
+			_vm->_avalot->_userMovesAvvy = true; // And ambulant.
 		} else
 			already();
 		break;
@@ -1457,18 +1455,18 @@ void Parser::standUp() {
 }
 
 void Parser::getProc(char thing) {
-	switch (_vm->_gyro->_room) {
+	switch (_vm->_avalot->_room) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
-			if (_vm->_gyro->_boxContent == thing) {
+			if (_vm->_avalot->_boxContent == thing) {
 				_vm->_background->drawBackgroundSprite(-1, -1, 4);
 				_vm->_dialogs->displayText("OK, I've got it.");
-				_vm->_gyro->_objects[thing - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_boxContent = kNothing;
+				_vm->_avalot->_objects[thing - 1] = true;
+				_vm->_avalot->refreshObjectList();
+				_vm->_avalot->_boxContent = kNothing;
 				_vm->_background->drawBackgroundSprite(-1, -1, 5);
 			} else {
-				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str());
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_avalot->getItem(thing).c_str());
 				_vm->_dialogs->displayText(tmpStr);
 			}
 		} else
@@ -1476,25 +1474,25 @@ void Parser::getProc(char thing) {
 		break;
 	case kRoomInsideCardiffCastle:
 		switch (thing) {
-		case Gyro::kObjectPen:
+		case Avalot::kObjectPen:
 			if (_vm->_animation->inField(1)) { // Standing on the dais.
-				if (_vm->_gyro->_takenPen)
+				if (_vm->_avalot->_takenPen)
 					_vm->_dialogs->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
-					_vm->_gyro->_takenPen = true;
-					_vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
-					_vm->_lucerna->refreshObjectList();
+					_vm->_avalot->_takenPen = true;
+					_vm->_avalot->_objects[Avalot::kObjectPen - 1] = true;
+					_vm->_avalot->refreshObjectList();
 					_vm->_dialogs->displayText("Taken.");
 				}
-			} else if (_vm->_gyro->_standingOnDais)
+			} else if (_vm->_avalot->_standingOnDais)
 				_vm->_dialogs->displayScrollChain('q', 53);
 			else
 				_vm->_dialogs->displayScrollChain('q', 51);
 			break;
-		case Gyro::kObjectBolt:
+		case Avalot::kObjectBolt:
 			_vm->_dialogs->displayScrollChain('q', 52);
 			break;
 		default:
@@ -1502,14 +1500,14 @@ void Parser::getProc(char thing) {
 		}
 		break;
 	case kRoomRobins:
-		if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) {
+		if ((thing == Avalot::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_dialogs->displayText("Got it!");
-			_vm->_gyro->_mushroomGrowing = false;
-			_vm->_gyro->_takenMushroom = true;
-			_vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
-			_vm->_lucerna->refreshObjectList();
-			_vm->_lucerna->incScore(3);
+			_vm->_avalot->_mushroomGrowing = false;
+			_vm->_avalot->_takenMushroom = true;
+			_vm->_avalot->_objects[Avalot::kObjectMushroom - 1] = true;
+			_vm->_avalot->refreshObjectList();
+			_vm->_avalot->incScore(3);
 		} else
 			_vm->_dialogs->displayScrollChain('q', 57);
 		break;
@@ -1523,13 +1521,13 @@ void Parser::getProc(char thing) {
  * @remarks	Originally called 'give_Geida_the_lute'
  */
 void Parser::giveGeidaTheLute() {
-	if (_vm->_gyro->_room != kRoomLustiesRoom) {
+	if (_vm->_avalot->_room != kRoomLustiesRoom) {
 		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		return;
 	}
-	_vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
-	_vm->_lucerna->refreshObjectList();
+	_vm->_avalot->_objects[Avalot::kObjectLute - 1] = false;
+	_vm->_avalot->refreshObjectList();
 	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
@@ -1554,13 +1552,13 @@ void Parser::winSequence() {
 
 Common::String Parser::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room))
-			_person = _vm->_gyro->_her;
+		if ((_vm->_avalot->_him == kPardon) || (_vm->_avalot->_whereIs[_vm->_avalot->_him - 150] != _vm->_avalot->_room))
+			_person = _vm->_avalot->_her;
 		else
-			_person = _vm->_gyro->_him;
+			_person = _vm->_avalot->_him;
 	}
 
-	if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) {
+	if (_vm->_avalot->_whereIs[_person - 150] != _vm->_avalot->_room) {
 		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
 	}
 
@@ -1578,7 +1576,7 @@ Common::String Parser::personSpeaks() {
 		return tmpStr;
 
 	for (int i = 0; i < 16; i++) {
-		if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room))
+		if ((_vm->_avalot->kQuasipeds[i]._who == _person) && (_vm->_avalot->kQuasipeds[i]._room == _vm->_avalot->_room))
 			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
 	}
 
@@ -1589,7 +1587,7 @@ void Parser::heyThanks() {
 	Common::String tmpStr = personSpeaks();
 	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
-	_vm->_gyro->_objects[_thing - 1] = false;
+	_vm->_avalot->_objects[_thing - 1] = false;
 }
 
 /**
@@ -1605,7 +1603,7 @@ void Parser::doThat() {
 		return;
 	}
 
-	if (_vm->_gyro->_weirdWord)
+	if (_vm->_avalot->_weirdWord)
 		return;
 
 	if (_thing < 200)
@@ -1615,11 +1613,11 @@ void Parser::doThat() {
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
-		if (!_vm->_gyro->_alive) {
+		if (!_vm->_avalot->_alive) {
 			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
 			return;
 		}
-		if (!_vm->_gyro->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+		if (!_vm->_avalot->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
 			_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
 			return;
 		}
@@ -1639,7 +1637,7 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_gyro->_carryNum >= kCarryLimit)
+			if (_vm->_avalot->_carryNum >= kCarryLimit)
 				_vm->_dialogs->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
@@ -1659,21 +1657,21 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeTalk:
 		if (_person == kPardon) {
-			if (_vm->_gyro->_subjectNum == 99) { // They typed "say password".
+			if (_vm->_avalot->_subjectNum == 99) { // They typed "say password".
 				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
 				_vm->_dialogs->displayText(tmpStr);
-			} else if (((1 <= _vm->_gyro->_subjectNum) && (_vm->_gyro->_subjectNum <= 49)) || (_vm->_gyro->_subjectNum == 253) || (_vm->_gyro->_subjectNum == 249)) {
+			} else if (((1 <= _vm->_avalot->_subjectNum) && (_vm->_avalot->_subjectNum <= 49)) || (_vm->_avalot->_subjectNum == 253) || (_vm->_avalot->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
 				for (int i = 0; i < 10; i++)
 					_realWords[i] = _realWords[i + 1];
 
-				_verb = _vm->_gyro->_subjectNum;
+				_verb = _vm->_avalot->_subjectNum;
 				doThat();
 				return;
 			} else {
-				_person = _vm->_gyro->_subjectNum;
-				_vm->_gyro->_subjectNum = 0;
+				_person = _vm->_avalot->_subjectNum;
+				_vm->_avalot->_subjectNum = 0;
 				if ((_person == 0) || (_person == kPardon))
 					_vm->_dialogs->displayText("Talk to whom?");
 				else if (isPersonHere())
@@ -1688,80 +1686,80 @@ void Parser::doThat() {
 				_vm->_dialogs->displayText("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
-				case Gyro::kObjectMoney :
+				case Avalot::kObjectMoney :
 					_vm->_dialogs->displayText("You can't bring yourself to give away your moneybag.");
 					break;
-				case Gyro::kObjectBodkin:
-				case Gyro::kObjectBell:
-				case Gyro::kObjectClothes:
-				case Gyro::kObjectHabit :
+				case Avalot::kObjectBodkin:
+				case Avalot::kObjectBell:
+				case Avalot::kObjectClothes:
+				case Avalot::kObjectHabit :
 					_vm->_dialogs->displayText("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
-					case Gyro::kPeopleCrapulus:
-						if (_thing == Gyro::kObjectWine) {
+					case Avalot::kPeopleCrapulus:
+						if (_thing == Avalot::kObjectWine) {
 							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
+							_vm->_avalot->_objects[Avalot::kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
-					case Gyro::kPeopleCwytalot:
-						if ((_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
+					case Avalot::kPeopleCwytalot:
+						if ((_thing == Avalot::kObjectCrossbow) || (_thing == Avalot::kObjectBolt))
 							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
 							heyThanks();
 						break;
-					case Gyro::kPeopleSpludwick:
+					case Avalot::kPeopleSpludwick:
 						if (giveToSpludwick())
 							heyThanks();
 						break;
-					case Gyro::kPeopleIbythneth:
-						if (_thing == Gyro::kObjectBadge) {
+					case Avalot::kPeopleIbythneth:
+						if (_thing == Avalot::kObjectBadge) {
 							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
-							_vm->_lucerna->incScore(3);
-							_vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
-							_vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
-							_vm->_gyro->_givenBadgeToIby = true;
+							_vm->_avalot->incScore(3);
+							_vm->_avalot->_objects[Avalot::kObjectBadge - 1] = false;
+							_vm->_avalot->_objects[Avalot::kObjectHabit - 1] = true;
+							_vm->_avalot->_givenBadgeToIby = true;
 							_vm->_background->drawBackgroundSprite(-1, -1, 7);
 							_vm->_background->drawBackgroundSprite(-1, -1, 8);
 						} else
 							heyThanks();
 						break;
-					case Gyro::kPeopleAyles:
-						if (_vm->_gyro->_aylesIsAwake) {
-							if (_thing == Gyro::kObjectPen) {
-								_vm->_gyro->_objects[Gyro::kObjectPen - 1] = false;
+					case Avalot::kPeopleAyles:
+						if (_vm->_avalot->_aylesIsAwake) {
+							if (_thing == Avalot::kObjectPen) {
+								_vm->_avalot->_objects[Avalot::kObjectPen - 1] = false;
 								_vm->_dialogs->displayScrollChain('q', 54);
-								_vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
-								_vm->_gyro->_givenPenToAyles = true;
-								_vm->_lucerna->refreshObjectList();
-								_vm->_lucerna->incScore(2);
+								_vm->_avalot->_objects[Avalot::kObjectInk - 1] = true;
+								_vm->_avalot->_givenPenToAyles = true;
+								_vm->_avalot->refreshObjectList();
+								_vm->_avalot->incScore(2);
 							} else
 								heyThanks();
 						} else
 							_vm->_dialogs->displayText("But he's asleep!");
 						break;
-					case Gyro::kPeopleGeida:
+					case Avalot::kPeopleGeida:
 						switch (_thing) {
-						case Gyro::kObjectPotion:
-							_vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false;
+						case Avalot::kObjectPotion:
+							_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = false;
 							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
-							_vm->_lucerna->incScore(2);
-							_vm->_gyro->_givenPotionToGeida = true;
-							_vm->_lucerna->refreshObjectList();
+							_vm->_avalot->incScore(2);
+							_vm->_avalot->_givenPotionToGeida = true;
+							_vm->_avalot->refreshObjectList();
 							break;
-						case Gyro::kObjectLute:
+						case Avalot::kObjectLute:
 							giveGeidaTheLute();
 							break;
 						default:
 							heyThanks();
 						}
 						break;
-					case Gyro::kPeopleArkata:
+					case Avalot::kPeopleArkata:
 						switch (_thing) {
-						case Gyro::kObjectPotion:
-							if (_vm->_gyro->_givenPotionToGeida)
+						case Avalot::kObjectPotion:
+							if (_vm->_avalot->_givenPotionToGeida)
 								winSequence();
 							else
 								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
@@ -1775,7 +1773,7 @@ void Parser::doThat() {
 					}
 				}
 			}
-			_vm->_lucerna->refreshObjectList(); // Just in case...
+			_vm->_avalot->refreshObjectList(); // Just in case...
 		}
 		break;
 
@@ -1806,7 +1804,7 @@ void Parser::doThat() {
 		else {
 			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
 			if (_vm->_dialogs->displayQuestion(tmpStr))
-				_vm->_gyro->_letMeOut = true;
+				_vm->_avalot->_letMeOut = true;
 		}
 		break;
 	case kVerbCodeGo:
@@ -1821,45 +1819,45 @@ void Parser::doThat() {
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
 			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
 			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
-			+ "version " + _vm->_gyro->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
-			+ _vm->_gyro->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+			+ "version " + _vm->_avalot->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
+			+ _vm->_avalot->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
 		_vm->_dialogs->displayText(toDisplay);
 		_vm->_dialogs->_aboutBox = false;
 		}
 		break;
 	case kVerbCodeUndress:
-		if (_vm->_gyro->_wearing == kNothing)
+		if (_vm->_avalot->_wearing == kNothing)
 			_vm->_dialogs->displayText("You're already stark naked!");
-		else if (_vm->_gyro->_avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
+		else if (_vm->_avalot->_avvysInTheCupboard) {
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_avalot->getItem(_vm->_avalot->_wearing).c_str());
 			_vm->_dialogs->displayText(tmpStr);
-			_vm->_gyro->_wearing = kNothing;
-			_vm->_lucerna->refreshObjectList();
+			_vm->_avalot->_wearing = kNothing;
+			_vm->_avalot->refreshObjectList();
 		} else
 			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
 		break;
 	case kVerbCodeWear:
 		if (isHolding()) { // Wear something.
 			switch (_thing) {
-			case Gyro::kObjectChastity:
+			case Avalot::kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
 				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
 				break;
-			case Gyro::kObjectClothes:
-			case Gyro::kObjectHabit: { // Change this!
-				if (_vm->_gyro->_wearing != kNothing) {
-					if (_vm->_gyro->_wearing == _thing)
+			case Avalot::kObjectClothes:
+			case Avalot::kObjectHabit: { // Change this!
+				if (_vm->_avalot->_wearing != kNothing) {
+					if (_vm->_avalot->_wearing == _thing)
 						_vm->_dialogs->displayText("You're already wearing that.");
 					else
 						_vm->_dialogs->displayText("You'll be rather warm wearing two sets of clothes!");
 					return;
 				} else
-					_vm->_gyro->_wearing = _thing;
+					_vm->_avalot->_wearing = _thing;
 
-				_vm->_lucerna->refreshObjectList();
+				_vm->_avalot->refreshObjectList();
 
 				byte i;
-				if (_thing == Gyro::kObjectHabit)
+				if (_thing == Avalot::kObjectHabit)
 					i = 3;
 				else
 					i = 0;
@@ -1881,36 +1879,36 @@ void Parser::doThat() {
 		break;
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
-			switch (_vm->_gyro->_room) { // They just typed "play"...
+			switch (_vm->_avalot->_room) { // They just typed "play"...
 			case kRoomArgentPub: // ...in the pub, => play Nim.
 				warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
 				// play_nim();
 				// The following parts are copied from play_nim().
 				// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
-				if (_vm->_gyro->_wonNim) { // Already won the game.
+				if (_vm->_avalot->_wonNim) { // Already won the game.
 					_vm->_dialogs->displayScrollChain('Q', 6);
 					return;
 				}
 
-				if (!_vm->_gyro->_askedDogfoodAboutNim) {
+				if (!_vm->_avalot->_askedDogfoodAboutNim) {
 					_vm->_dialogs->displayScrollChain('q', 84);
 					return;
 				}
 
 				_vm->_dialogs->displayScrollChain('Q', 3);
-				_vm->_gyro->_playedNim++;
+				_vm->_avalot->_playedNim++;
 
 				// You won - strange!
 				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
-				_vm->_gyro->_objects[Gyro::kObjectLute - 1] = true;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_wonNim = true;
+				_vm->_avalot->_objects[Avalot::kObjectLute - 1] = true;
+				_vm->_avalot->refreshObjectList();
+				_vm->_avalot->_wonNim = true;
 				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
-				_vm->_lucerna->incScore(7); // 7 points for winning!
+				_vm->_avalot->incScore(7); // 7 points for winning!
 
-				if (_vm->_gyro->_playedNim == 1)
-					_vm->_lucerna->incScore(3); // 3 points for playing your 1st game.
+				if (_vm->_avalot->_playedNim == 1)
+					_vm->_avalot->incScore(3); // 3 points for playing your 1st game.
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
@@ -1922,23 +1920,23 @@ void Parser::doThat() {
 			}
 		} else if (isHolding()) {
 			switch (_thing) {
-			case Gyro::kObjectLute :
+			case Avalot::kObjectLute :
 					_vm->_dialogs->displayScrollChain('U', 7);
 
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)
+					if (_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 10);
 
-					if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room)
+					if (_vm->_avalot->_whereIs[Avalot::kPeopleDuLustie - 150] == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 15);
 				break;
 			case 52:
-				if (_vm->_gyro->_room == kRoomMusicRoom)
+				if (_vm->_avalot->_room == kRoomMusicRoom)
 					playHarp();
 				else
 					_vm->_dialogs->displayText(kWhat);
 				break;
 			case 55:
-				if (_vm->_gyro->_room == kRoomArgentPub)
+				if (_vm->_avalot->_room == kRoomArgentPub)
 					// play_nim();
 					warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
 				else
@@ -1951,9 +1949,9 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeRing:
 		if (isHolding()) {
-			if (_thing == Gyro::kObjectBell) {
+			if (_thing == Avalot::kObjectBell) {
 				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+				if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
 					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
@@ -1975,7 +1973,7 @@ void Parser::doThat() {
 		warning("STUB: Parser::doThat() - case kVerbCodeboss");
 		break;
 	case kVerbCodePee:
-		if (_vm->_gyro->setFlag('P')) {
+		if (_vm->_avalot->setFlag('P')) {
 			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else {
@@ -1986,16 +1984,16 @@ void Parser::doThat() {
 	case kVerbCodeCheat: {
 		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_gyro->_cheat = true;
+		_vm->_avalot->_cheat = true;
 		}
 		break;
 	case kVerbCodeMagic:
-		if (_vm->_gyro->_avariciusTalk > 0)
+		if (_vm->_avalot->_avariciusTalk > 0)
 			_vm->_dialogs->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_gyro->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
+			if ((_vm->_avalot->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
 				_vm->_dialogs->displayScrollChain('q', 17);
-				if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks)
+				if (_vm->_avalot->_whereIs[1] == kRoomSpludwicks)
 					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -2004,7 +2002,7 @@ void Parser::doThat() {
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
 					spr->_eachStepProc = Animation::kProcBackAndForth;
-					_vm->_gyro->_avariciusTalk = 14;
+					_vm->_avalot->_avariciusTalk = 14;
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
 			} else
@@ -2015,7 +2013,7 @@ void Parser::doThat() {
 		_vm->_dialogs->displayText("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
-		switch (_vm->_gyro->_sworeNum) {
+		switch (_vm->_avalot->_sworeNum) {
 		case 0: {
 			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
 				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
@@ -2033,21 +2031,21 @@ void Parser::doThat() {
 			// CHECKME: Weird character in string
 			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
-			_vm->_lucerna->gameOver();
+			_vm->_avalot->gameOver();
 			}
 		}
-		_vm->_gyro->_sworeNum++;
+		_vm->_avalot->_sworeNum++;
 		break;
 	case kVerbCodeListen:
-		if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B')))
+		if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
 			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
-		else if (_vm->_gyro->_listen.empty())
+		else if (_vm->_avalot->_listen.empty())
 			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_dialogs->displayText(_vm->_gyro->_listen);
+			_vm->_dialogs->displayText(_vm->_avalot->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_gyro->_room) {
+		switch (_vm->_avalot->_room) {
 		case kRoomArgentPub:
 			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
 				switch (_thing) {
@@ -2055,40 +2053,40 @@ void Parser::doThat() {
 				case 53:
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+					if (_vm->_avalot->_malagauche == 177) { // Already getting us one.
 						_vm->_dialogs->displayScrollChain('D', 15);
 						return;
 					}
 
-					if (_vm->_gyro->_teetotal)  {
+					if (_vm->_avalot->_teetotal)  {
 						_vm->_dialogs->displayScrollChain('D', 6);
 						return;
 					}
 
-					if (_vm->_gyro->_alcoholLevel == 0)
-						_vm->_lucerna->incScore(3);
+					if (_vm->_avalot->_alcoholLevel == 0)
+						_vm->_avalot->incScore(3);
 
 					_vm->_background->drawBackgroundSprite(-1, -1, 11);
 					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
-					_vm->_gyro->_drinking = _thing;
+					_vm->_avalot->_drinking = _thing;
 
 					_vm->_background->drawBackgroundSprite(-1, -1, 9);
-					_vm->_gyro->_malagauche = 177;
+					_vm->_avalot->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
-				case Gyro::kObjectWine:
-					if (_vm->_gyro->_objects[Gyro::kObjectWine - 1])  // We've already got the wine!
+				case Avalot::kObjectWine:
+					if (_vm->_avalot->_objects[Avalot::kObjectWine - 1])  // We've already got the wine!
 						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
-						if (_vm->_gyro->_malagauche == 177) { // Already getting us one.
+						if (_vm->_avalot->_malagauche == 177) { // Already getting us one.
 							_vm->_dialogs->displayScrollChain('D', 15);
 							return;
 						}
 
-						if (_vm->_gyro->_carryNum >= kCarryLimit) {
+						if (_vm->_avalot->_carryNum >= kCarryLimit) {
 							_vm->_dialogs->displayText("Your hands are full.");
 							return;
 						}
@@ -2096,10 +2094,10 @@ void Parser::doThat() {
 						_vm->_background->drawBackgroundSprite(-1, -1, 11);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 						_vm->_dialogs->displayText(tmpStr);
-						if (_vm->_gyro->_alcoholLevel == 0)
-							_vm->_lucerna->incScore(3);
+						if (_vm->_avalot->_alcoholLevel == 0)
+							_vm->_avalot->incScore(3);
 						_vm->_background->drawBackgroundSprite(-1, -1, 9);
-						_vm->_gyro->_malagauche = 177;
+						_vm->_avalot->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
 					}
@@ -2111,24 +2109,24 @@ void Parser::doThat() {
 
 		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(5)) {
-				if (_thing == Gyro::kObjectOnion) {
-					if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1])
+				if (_thing == Avalot::kObjectOnion) {
+					if (_vm->_avalot->_objects[Avalot::kObjectOnion - 1])
 						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_gyro->_carryNum >= kCarryLimit)
+					else if (_vm->_avalot->_carryNum >= kCarryLimit)
 						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
 					else {
-						if (_vm->_gyro->_boughtOnion)
+						if (_vm->_avalot->_boughtOnion)
 							_vm->_dialogs->displayScrollChain('D', 11);
 						else {
 							_vm->_dialogs->displayScrollChain('D', 9);
-							_vm->_lucerna->incScore(3);
+							_vm->_avalot->incScore(3);
 						}
-						_vm->_gyro->decreaseMoney(3); // It costs thruppence.
-						_vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true;
-						_vm->_lucerna->refreshObjectList();
-						_vm->_gyro->_boughtOnion = true;
-						_vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
-						_vm->_gyro->_onionInVinegar = false;
+						_vm->_avalot->decreaseMoney(3); // It costs thruppence.
+						_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = true;
+						_vm->_avalot->refreshObjectList();
+						_vm->_avalot->_boughtOnion = true;
+						_vm->_avalot->_rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_avalot->_onionInVinegar = false;
 					}
 				} else
 					_vm->_dialogs->displayScrollChain('D', 0);
@@ -2144,33 +2142,33 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeAttack:
-		if ((_vm->_gyro->_room == kRoomBrummieRoad) &&
-			((_person == Gyro::kPeopleCwytalot) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) &&
-			(_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) {
-			switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
+		if ((_vm->_avalot->_room == kRoomBrummieRoad) &&
+			((_person == Avalot::kPeopleCwytalot) || (_thing == Avalot::kObjectCrossbow) || (_thing == Avalot::kObjectBolt)) &&
+			(_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] == _vm->_avalot->_room)) {
+			switch (_vm->_avalot->_objects[Avalot::kObjectBolt - 1] + _vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_dialogs->displayScrollChain('Q', 10);
 				_vm->_dialogs->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_dialogs->displayText("Attack _vm->_gyro->him with only a crossbow bolt? Are you planning on playing darts?!");
+				_vm->_dialogs->displayText("Attack _vm->_avalot->him with only a crossbow bolt? Are you planning on playing darts?!");
 				break;
 			case 2:
 				_vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
 				_vm->_dialogs->displayScrollChain('Q', 11);
-				_vm->_gyro->_cwytalotGone = true;
-				_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
-				_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
-				_vm->_lucerna->refreshObjectList();
-				_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
-				_vm->_lucerna->incScore(7);
+				_vm->_avalot->_cwytalotGone = true;
+				_vm->_avalot->_objects[Avalot::kObjectBolt - 1] = false;
+				_vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] = false;
+				_vm->_avalot->refreshObjectList();
+				_vm->_avalot->_magics[11]._operation = Avalot::kMagicNothing;
+				_vm->_avalot->incScore(7);
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy;
+				_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomDummy;
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
@@ -2179,14 +2177,14 @@ void Parser::doThat() {
 			_vm->_dialogs->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
-		if (_vm->_gyro->_room != kRoomBridge)
+		if (_vm->_avalot->_room != kRoomBridge)
 			_vm->_dialogs->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (uint i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				int pwdId = _vm->_gyro->_passwordNum + kFirstPassword;
+				int pwdId = _vm->_avalot->_passwordNum + kFirstPassword;
 				for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
 					if (_vocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
@@ -2194,13 +2192,13 @@ void Parser::doThat() {
 			}
 
 			if (ok) {
-				if (_vm->_gyro->_drawbridgeOpen != 0)
+				if (_vm->_avalot->_drawbridgeOpen != 0)
 					_vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
-					_vm->_lucerna->incScore(4);
+					_vm->_avalot->incScore(4);
 					_vm->_dialogs->displayText("The drawbridge opens!");
 					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
-					_vm->_gyro->_drawbridgeOpen = 1;
+					_vm->_avalot->_drawbridgeOpen = 1;
 				}
 			} else
 				_vm->_dialogs->displayScrollChain('Q', 12);
@@ -2210,10 +2208,10 @@ void Parser::doThat() {
 		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
 		break;
 	case kVerbCodeDie:
-		_vm->_lucerna->gameOver();
+		_vm->_avalot->gameOver();
 		break;
 	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_gyro->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_avalot->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -2228,31 +2226,31 @@ void Parser::doThat() {
 			_vm->_dialogs->displayText("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
-			case Gyro::kPeopleArkata:
+			case Avalot::kPeopleArkata:
 				_vm->_dialogs->displayScrollChain('U', 12);
 				break;
-			case Gyro::kPeopleGeida:
+			case Avalot::kPeopleGeida:
 				_vm->_dialogs->displayScrollChain('U', 13);
 				break;
-			case Gyro::kPeopleWisewoman:
+			case Avalot::kPeopleWisewoman:
 				_vm->_dialogs->displayScrollChain('U', 14);
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
 			}
-		} else if ((Gyro::kPeopleAvalot <= _person) && (_person < Gyro::kPeopleArkata))
+		} else if ((Avalot::kPeopleAvalot <= _person) && (_person < Avalot::kPeopleArkata))
 			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
 
 		break;
 	case kVerbCodeClimb:
-		if (_vm->_gyro->_room == kRoomInsideCardiffCastle)
+		if (_vm->_avalot->_room == kRoomInsideCardiffCastle)
 			cardiffClimbing();
 		else // In the wrong room!
 			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
 		//	show_highs();
@@ -2262,23 +2260,23 @@ void Parser::doThat() {
 		if (isPersonHere())
 			switch (_person) {
 			case kPardon:
-			case Gyro::kPeopleAvalot:
+			case Avalot::kPeopleAvalot:
 			case 0:
-				if (!_vm->_gyro->_avvyIsAwake) {
-					_vm->_gyro->_avvyIsAwake = true;
-					_vm->_lucerna->incScore(1);
-					_vm->_gyro->_avvyInBed = true;
+				if (!_vm->_avalot->_avvyIsAwake) {
+					_vm->_avalot->_avvyIsAwake = true;
+					_vm->_avalot->incScore(1);
+					_vm->_avalot->_avvyInBed = true;
 					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
-					if (_vm->_gyro->_teetotal)
+					if (_vm->_avalot->_teetotal)
 						_vm->_dialogs->displayScrollChain('d', 13);
 				} else
 					_vm->_dialogs->displayText("You're already awake, Avvy!");
 				break;
-			case Gyro::kPeopleAyles:
-				if (!_vm->_gyro->_aylesIsAwake)
+			case Avalot::kPeopleAyles:
+				if (!_vm->_avalot->_aylesIsAwake)
 					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
 				break;
-			case Gyro::kPeopleJacques: {
+			case Avalot::kPeopleJacques: {
 				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
 					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 				_vm->_dialogs->displayText(tmpStr);
@@ -2289,26 +2287,26 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeSit:
-		if (_vm->_gyro->_room == kRoomNottsPub) {
-			if (_vm->_gyro->_sittingInPub)
+		if (_vm->_avalot->_room == kRoomNottsPub) {
+			if (_vm->_avalot->_sittingInPub)
 				_vm->_dialogs->displayText("You're already sitting!");
 			else {
 				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else { // Default doodah.
-			_vm->_lucerna->dusk();
-			_vm->_gyro->hangAroundForAWhile();
-			_vm->_lucerna->dawn();
+			_vm->_avalot->dusk();
+			_vm->_avalot->hangAroundForAWhile();
+			_vm->_avalot->dawn();
 			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
 			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeRestart:
 		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
-			_vm->_lucerna->dusk();
-			_vm->_gyro->newGame();
-			_vm->_lucerna->dawn();
+			_vm->_avalot->dusk();
+			_vm->_avalot->newGame();
+			_vm->_avalot->dawn();
 		}
 		break;
 	case kPardon:
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 95e15e5..368fa0d 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -30,8 +30,6 @@
 #include "avalanche/avalanche.h"
 
 #include "avalanche/pingo.h"
-#include "avalanche/gyro.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
 #include "avalanche/dialogs.h"
 
@@ -78,7 +76,7 @@ void Pingo::zonk() {
 
 void Pingo::winningPic() {
 	Common::File f;
-	_vm->_lucerna->dusk();
+	_vm->_avalot->dusk();
 
 	if (!f.open("finale.avd"))
 		error("AVALANCHE: Lucerna: File not found: finale.avd");
@@ -97,11 +95,11 @@ void Pingo::winningPic() {
 
 	warning("STUB: Pingo::winningPic()");
 
-	_vm->_lucerna->dawn();
+	_vm->_avalot->dawn();
 
 #if 0
 	do {
-		_vm->_gyro->check();
+		_vm->_avalot->check();
 	} while (!(keypressed() || (mrelease > 0)));
 	while (keypressed())
 		char r = readkey();
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 712275e..8ca3844 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -29,7 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/sequence.h"
-#include "avalanche/gyro.h"
 #include "avalanche/timer.h"
 #include "avalanche/background.h"
 #include "avalanche/animation.h"
@@ -61,8 +60,8 @@ void Sequence::thenShow(byte what) {
 void Sequence::thenFlip(byte where, byte ped) {
 	thenShow(kNowFlip);
 
-	_vm->_gyro->_flipToWhere = where;
-	_vm->_gyro->_flipToPed = ped;
+	_vm->_avalot->_flipToWhere = where;
+	_vm->_avalot->_flipToPed = ped;
 }
 
 void Sequence::startToClose() {
@@ -71,7 +70,7 @@ void Sequence::startToClose() {
 }
 
 void Sequence::startToOpen() {
-	_vm->_gyro->_userMovesAvvy = false; // They can't move.
+	_vm->_avalot->_userMovesAvvy = false; // They can't move.
 	_vm->_animation->stopWalking(); // And they're not moving now.
 	startToClose(); // Apart from that, it's the same thing.
 }
@@ -90,8 +89,8 @@ void Sequence::callSequencer() {
 		return; // No more routines.
 		break;
 	case 177: // Flip room.
-		_vm->_gyro->_userMovesAvvy = true;
-		_vm->_animation->flipRoom(_vm->_gyro->_flipToWhere, _vm->_gyro->_flipToPed);
+		_vm->_avalot->_userMovesAvvy = true;
+		_vm->_animation->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
 		if (curSeq == 177)
 			shoveLeft();
 		break;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index b40731a..081f7a3 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -29,7 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/timer.h"
-#include "avalanche/lucerna.h"
 #include "avalanche/animation.h"
 #include "avalanche/dialogs.h"
 #include "avalanche/sequence.h"
@@ -55,7 +54,7 @@ Timer::Timer(AvalancheEngine *vm) {
  * @remarks	Originally called 'set_up_timer'
  */
 void Timer::addTimer(int32 duration, byte action, byte reason) {
-	if ((_vm->_gyro->_isLoaded == false) || (_timerLost == true)) {
+	if ((_vm->_avalot->_isLoaded == false) || (_timerLost == true)) {
 		byte i = 0;
 		while ((i < 7) && (_times[i]._timeLeft != 0))
 			i++;
@@ -68,7 +67,7 @@ void Timer::addTimer(int32 duration, byte action, byte reason) {
 		_times[i]._action = action;
 		_times[i]._reason = reason;
 	} else {
-		_vm->_gyro->_isLoaded = false;
+		_vm->_avalot->_isLoaded = false;
 		return;
 	}
 }
@@ -156,7 +155,7 @@ void Timer::updateTimer() {
 				crapulusSaysSpludOut();
 				break;
 			case kProcDawnDelay:
-				_vm->_lucerna->dawn();
+				_vm->_avalot->dawn();
 				break;
 			case kProcBuyDrinks:
 				buyDrinks();
@@ -215,8 +214,8 @@ void Timer::updateTimer() {
 			}
 		}
 	}
-	_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
-	_vm->_gyro->_totalTime++; // Total amount of time for this game.
+	_vm->_avalot->_roomTime++; // Cycles since you've been in this room.
+	_vm->_avalot->_totalTime++; // Total amount of time for this game.
 }
 
 void Timer::loseTimer(byte which) {
@@ -229,29 +228,29 @@ void Timer::loseTimer(byte which) {
 }
 
 void Timer::openDrawbridge() {
-	_vm->_gyro->_drawbridgeOpen++;
-	_vm->_background->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 2);
+	_vm->_avalot->_drawbridgeOpen++;
+	_vm->_background->drawBackgroundSprite(-1, -1, _vm->_avalot->_drawbridgeOpen - 2);
 
-	if (_vm->_gyro->_drawbridgeOpen == 4)
-		_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
+	if (_vm->_avalot->_drawbridgeOpen == 4)
+		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
 	else
 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
 
 void Timer::avariciusTalks() {
-	_vm->_dialogs->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
-	_vm->_gyro->_avariciusTalk++;
+	_vm->_dialogs->displayScrollChain('q', _vm->_avalot->_avariciusTalk);
+	_vm->_avalot->_avariciusTalk++;
 
-	if (_vm->_gyro->_avariciusTalk < 17)
+	if (_vm->_avalot->_avariciusTalk < 17)
 		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
 	else
-		_vm->_lucerna->incScore(3);
+		_vm->_avalot->incScore(3);
 }
 
 void Timer::urinate() {
 	_vm->_animation->_sprites[0].turn(Animation::kDirUp);
 	_vm->_animation->stopWalking();
-	_vm->_lucerna->drawDirection();
+	_vm->_avalot->drawDirection();
 	addTimer(14, kProcToilet, kReasonGoToToilet);
 }
 
@@ -273,20 +272,20 @@ void Timer::stairs() {
 	_vm->_sound->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_background->drawBackgroundSprite(-1, -1, 1);
-	_vm->_gyro->_brummieStairs = 2;
-	_vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial;
-	_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
-	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+	_vm->_avalot->_brummieStairs = 2;
+	_vm->_avalot->_magics[10]._operation = Avalot::kMagicSpecial;
+	_vm->_avalot->_magics[10]._data = 2; // Reached the bottom of the stairs.
+	_vm->_avalot->_magics[3]._operation = Avalot::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timer::cardiffSurvey() {
-	if (_vm->_gyro->_cardiffQuestionNum == 0) {
-		_vm->_gyro->_cardiffQuestionNum++;
+	if (_vm->_avalot->_cardiffQuestionNum == 0) {
+		_vm->_avalot->_cardiffQuestionNum++;
 		_vm->_dialogs->displayScrollChain('q', 27);
 	}
 
-	_vm->_dialogs->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
-	_vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
+	_vm->_dialogs->displayScrollChain('z', _vm->_avalot->_cardiffQuestionNum);
+	_vm->_avalot->_interrogation = _vm->_avalot->_cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
@@ -301,8 +300,8 @@ void Timer::cwytalotInHerts() {
 
 void Timer::getTiedUp() {
 	_vm->_dialogs->displayScrollChain('q', 34); // ...Trouble!
-	_vm->_gyro->_userMovesAvvy = false;
-	_vm->_gyro->_beenTiedUp = true;
+	_vm->_avalot->_userMovesAvvy = false;
+	_vm->_avalot->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -316,8 +315,8 @@ void Timer::getTiedUp() {
 void Timer::getTiedUp2() {
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_animation->_sprites[1].walkTo(4);
-	_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries.
-	_vm->_gyro->_friarWillTieYouUp = true;
+	_vm->_avalot->_magics[3]._operation = Avalot::kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_avalot->_friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
@@ -325,7 +324,7 @@ void Timer::hangAround() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
-	_vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins;
+	_vm->_avalot->_whereIs[Avalot::kPeopleRobinHood - 150] = kRoomRobins;
 	_vm->_animation->appearPed(0, 1);
 	_vm->_dialogs->displayScrollChain('q', 39);
 	avvy->walkTo(6);
@@ -337,7 +336,7 @@ void Timer::hangAround2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
-	_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomRobins;
+	_vm->_avalot->_whereIs[Avalot::kPeopleFriarTuck - 150] = kRoomRobins;
 	_vm->_dialogs->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -345,20 +344,20 @@ void Timer::hangAround2() {
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
 
-	_vm->_gyro->_tiedUp = false;
+	_vm->_avalot->_tiedUp = false;
 
 	// _vm->_enid->backToBootstrap(1); Call the shoot-'em-up. TODO: Replace it with proper ScummVM-friendly function(s)! Do not remove until then!
 }
 
 void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
-	_vm->_animation->flipRoom(_vm->_gyro->_room, 1);
+	_vm->_animation->flipRoom(_vm->_avalot->_room, 1);
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);
-	_vm->_gyro->_userMovesAvvy = true;
-	_vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true;
-	_vm->_lucerna->refreshObjectList();
+	_vm->_avalot->_userMovesAvvy = true;
+	_vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] = true;
+	_vm->_avalot->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
 	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
@@ -386,9 +385,9 @@ void Timer::afterTheShootemup() {
 }
 
 void Timer::jacquesWakesUp() {
-	_vm->_gyro->_jacquesState++;
+	_vm->_avalot->_jacquesState++;
 
-	switch (_vm->_gyro->_jacquesState) { // Additional pictures.
+	switch (_vm->_avalot->_jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_background->drawBackgroundSprite(-1, -1, 0); // Eyes open.
 		_vm->_dialogs->displayScrollChain('Q', 45);
@@ -396,22 +395,22 @@ void Timer::jacquesWakesUp() {
 	case 2 : // Going through the door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
 		_vm->_background->drawBackgroundSprite(-1, -1, 2); // But going through the door.
-		_vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // You can't wake him up now.
+		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
 		_vm->_background->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
-		_vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; // Gone!
+		_vm->_avalot->_whereIs[Avalot::kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
 
-	if (_vm->_gyro->_jacquesState == 5) {
-		_vm->_gyro->_bellsAreRinging = true;
-		_vm->_gyro->_aylesIsAwake = true;
-		_vm->_lucerna->incScore(2);
+	if (_vm->_avalot->_jacquesState == 5) {
+		_vm->_avalot->_bellsAreRinging = true;
+		_vm->_avalot->_aylesIsAwake = true;
+		_vm->_avalot->incScore(2);
 	}
 
-	switch (_vm->_gyro->_jacquesState) {
+	switch (_vm->_avalot->_jacquesState) {
 	case 1:
 	case 2:
 	case 3:
@@ -454,8 +453,8 @@ void Timer::naughtyDuke3() {
 void Timer::jump() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 
-	_vm->_gyro->_jumpStatus++;
-	switch (_vm->_gyro->_jumpStatus) {
+	_vm->_avalot->_jumpStatus++;
+	switch (_vm->_avalot->_jumpStatus) {
 	case 1:
 	case 2:
 	case 3:
@@ -474,73 +473,73 @@ void Timer::jump() {
 		break;
 	}
 
-	if (_vm->_gyro->_jumpStatus == 20) { // End of jump.
-		_vm->_gyro->_userMovesAvvy = true;
-		_vm->_gyro->_jumpStatus = 0;
+	if (_vm->_avalot->_jumpStatus == 20) { // End of jump.
+		_vm->_avalot->_userMovesAvvy = true;
+		_vm->_avalot->_jumpStatus = 0;
 	} else // Still jumping.
 		addTimer(1, kProcJump, kReasonJumping);
 
-	if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_gyro->_room == kRoomInsideCardiffCastle)
-			&& (_vm->_gyro->_arrowInTheDoor == true)
+	if ((_vm->_avalot->_jumpStatus == 10) // You're at the highest point of your jump.
+			&& (_vm->_avalot->_room == kRoomInsideCardiffCastle)
+			&& (_vm->_avalot->_arrowInTheDoor == true)
 			&& (_vm->_animation->inField(2))) { // Beside the wall
 		// Grab the arrow!
-		if (_vm->_gyro->_carryNum >= kCarryLimit)
+		if (_vm->_avalot->_carryNum >= kCarryLimit)
 			_vm->_dialogs->displayText("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_background->drawBackgroundSprite(-1, -1, 1);
-			_vm->_gyro->_arrowInTheDoor = false; // You've got it.
-			_vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
-			_vm->_lucerna->refreshObjectList();
+			_vm->_avalot->_arrowInTheDoor = false; // You've got it.
+			_vm->_avalot->_objects[Avalot::kObjectBolt - 1] = true;
+			_vm->_avalot->refreshObjectList();
 			_vm->_dialogs->displayScrollChain('q', 50);
-			_vm->_lucerna->incScore(3);
+			_vm->_avalot->incScore(3);
 		}
 	}
 }
 
 void Timer::crapulusSaysSpludOut() {
 	_vm->_dialogs->displayScrollChain('q', 56);
-	_vm->_gyro->_crapulusWillTell = false;
+	_vm->_avalot->_crapulusWillTell = false;
 }
 
 void Timer::buyDrinks() {
 	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
-	_vm->_gyro->_malagauche = 0;
+	_vm->_avalot->_malagauche = 0;
 
-	_vm->_dialogs->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it.
+	_vm->_dialogs->displayScrollChain('D', _vm->_avalot->_drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
 	_vm->_dialogs->displayScrollChain('D', 1); // That'll be thruppence.
-	if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
+	if (_vm->_avalot->decreaseMoney(3)) // Pay 3d.
 		_vm->_dialogs->displayScrollChain('D', 3); // Tell 'em you paid up.
 	_vm->_parser->drink();
 }
 
 void Timer::buyWine() {
 	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
-	_vm->_gyro->_malagauche = 0;
+	_vm->_avalot->_malagauche = 0;
 
 	_vm->_dialogs->displayScrollChain('D', 50); // You buy the wine.
 	_vm->_dialogs->displayScrollChain('D', 1); // It'll be thruppence.
-	if (_vm->_gyro->decreaseMoney(3)) {
+	if (_vm->_avalot->decreaseMoney(3)) {
 		_vm->_dialogs->displayScrollChain('D', 4); // You paid up.
-		_vm->_gyro->_objects[Gyro::kObjectWine - 1] = true;
-		_vm->_lucerna->refreshObjectList();
-		_vm->_gyro->_wineState = 1; // OK Wine.
+		_vm->_avalot->_objects[Avalot::kObjectWine - 1] = true;
+		_vm->_avalot->refreshObjectList();
+		_vm->_avalot->_wineState = 1; // OK Wine.
 	}
 }
 
 void Timer::callsGuards() {
 	_vm->_dialogs->displayScrollChain('Q', 58); // "GUARDS!!!"
-	_vm->_lucerna->gameOver();
+	_vm->_avalot->gameOver();
 }
 
 void Timer::greetsMonk() {
 	_vm->_dialogs->displayScrollChain('Q', 59);
-	_vm->_gyro->_enteredLustiesRoomAsMonk = true;
+	_vm->_avalot->_enteredLustiesRoomAsMonk = true;
 }
 
 void Timer::fallDownOubliette() {
-	_vm->_gyro->_magics[8]._operation = Gyro::kMagicNothing;
+	_vm->_avalot->_magics[8]._operation = Avalot::kMagicNothing;
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->_moveY++; // Increments dx/dy!
@@ -549,13 +548,13 @@ void Timer::fallDownOubliette() {
 }
 
 void Timer::meetAvaroid() {
-	if (_vm->_gyro->_metAvaroid) {
+	if (_vm->_avalot->_metAvaroid) {
 		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_lucerna->gameOver();
+		_vm->_avalot->gameOver();
 	} else {
 		_vm->_dialogs->displayScrollChain('Q', 60);
-		_vm->_gyro->_metAvaroid = true;
+		_vm->_avalot->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
@@ -564,7 +563,7 @@ void Timer::meetAvaroid() {
 		avvy->_moveX = -3;
 		avvy->_moveY = -5;
 
-		_vm->_gyro->setBackgroundColor(2);
+		_vm->_avalot->setBackgroundColor(2);
 	}
 }
 
@@ -576,7 +575,7 @@ void Timer::riseUpOubliette() {
 	if (avvy->_moveY > 0)
 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
-		_vm->_gyro->_userMovesAvvy = true;
+		_vm->_avalot->_userMovesAvvy = true;
 }
 
 void Timer::robinHoodAndGeida() {
@@ -589,7 +588,7 @@ void Timer::robinHoodAndGeida() {
 	spr->stopWalk();
 	spr->_facingDir = Animation::kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
-	_vm->_gyro->_geidaFollows = false;
+	_vm->_avalot->_geidaFollows = false;
 }
 
 void Timer::robinHoodAndGeidaTalk() {
@@ -613,7 +612,7 @@ void Timer::avalotReturns() {
 	avvy->init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(0, 0);
 	_vm->_dialogs->displayScrollChain('q', 67);
-	_vm->_gyro->_userMovesAvvy = true;
+	_vm->_avalot->_userMovesAvvy = true;
 }
 
 /**
@@ -627,8 +626,8 @@ void Timer::avvySitDown() {
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_background->drawBackgroundSprite(-1, -1, 2);
-		_vm->_gyro->_sittingInPub = true;
-		_vm->_gyro->_userMovesAvvy = false;
+		_vm->_avalot->_sittingInPub = true;
+		_vm->_avalot->_userMovesAvvy = false;
 		avvy->_visible = false;
 	}
 }
@@ -640,7 +639,7 @@ void Timer::ghostRoomPhew() {
 }
 
 void Timer::arkataShouts() {
-	if (_vm->_gyro->_teetotal)
+	if (_vm->_avalot->_teetotal)
 		return;
 
 	_vm->_dialogs->displayScrollChain('q', 76);
@@ -654,14 +653,14 @@ void Timer::winning() {
 	warning("STUB: Timer::winning()");
 #if 0
 	do {
-		_vm->_lucerna->checkclick();
-	} while (!(_vm->_gyro->mrelease == 0));
+		_vm->_avalot->checkclick();
+	} while (!(_vm->_avalot->mrelease == 0));
 #endif
 	// TODO: To be implemented with Pingo::winningPic().
 
-	_vm->_lucerna->callVerb(Parser::kVerbCodeScore);
+	_vm->_avalot->callVerb(Parser::kVerbCodeScore);
 	_vm->_dialogs->displayText(" T H E    E N D ");
-	_vm->_gyro->_letMeOut = true;
+	_vm->_avalot->_letMeOut = true;
 }
 
 void Timer::avalotFalls() {
@@ -693,8 +692,8 @@ void Timer::spludwickLeavesCauldron() {
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.
 	_vm->_dialogs->displayScrollChain('Q', 86);
-	_vm->_lucerna->incScore(4);
-	_vm->_gyro->_lustieIsAsleep = true;
+	_vm->_avalot->incScore(4);
+	_vm->_avalot->_lustieIsAsleep = true;
 	_vm->_sequence->firstShow(5);
 	_vm->_sequence->thenShow(6); // He falls asleep...
 	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.


Commit: 45ad88b73b654b5ba0ea28e271a742ae17e966c3
    https://github.com/scummvm/scummvm/commit/45ad88b73b654b5ba0ea28e271a742ae17e966c3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T13:39:56-07:00

Commit Message:
AVALANCHE: uncomment some sound code, code cleanup

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e514d79..772c1ad 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -267,7 +267,6 @@ Avalot::~Avalot() {
 }
 
 void Avalot::handleKeyDown(Common::Event &event) {
-//	if (keyboardclick)
 	_vm->_sound->click();
 
 	if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15))
@@ -409,8 +408,6 @@ void Avalot::runAvalot() {
 			_vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
 	} while (!_letMeOut && !_vm->shouldQuit());
 
-	//if (logging)
-	//	close(logfile);
 	warning("STUB: Avalot::run()");
 
 	_vm->_closing->exitGame();
@@ -811,22 +808,20 @@ void Avalot::enterRoom(byte room, byte ped) {
 		if (_cwytalotGone) {
 			_magics[kColorLightred - 1]._operation = Avalot::kMagicNothing;
 			_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomNowhere;
-		} else {
-			if (ped > 0) {
-				AnimationType *spr1 = &_vm->_animation->_sprites[1];
-				spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
-				spr1->_callEachStepFl = true;
-				spr1->_eachStepProc = Animation::kProcFollowAvvyY;
-				_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomBrummieRoad;
-
-				if (_roomCount[kRoomBrummieRoad] == 1) { // First time here...
-					_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
-					spr1->walkTo(3); // ...and he walks up...
-				} else {
-					// You've been here before.
-					_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
-					spr1->_facingDir = Animation::kDirLeft;
-				}
+		} else if (ped > 0) {
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
+			spr1->_callEachStepFl = true;
+			spr1->_eachStepProc = Animation::kProcFollowAvvyY;
+			_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomBrummieRoad;
+
+			if (_roomCount[kRoomBrummieRoad] == 1) { // First time here...
+				_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
+				spr1->walkTo(3); // ...and he walks up...
+			} else {
+				// You've been here before.
+				_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
+				spr1->_facingDir = Animation::kDirLeft;
 			}
 		}
 		break;
@@ -855,15 +850,13 @@ void Avalot::enterRoom(byte room, byte ped) {
 		break;
 
 	case kRoomRobins:
-		if (ped > 0) {
-			if (!_beenTiedUp) {
-				// A welcome party... or maybe not...
-				AnimationType *spr1 = &_vm->_animation->_sprites[1];
-				spr1->init(6, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
-				spr1->walkTo(2);
-				_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
-			}
+		if ((ped > 0) && (!_beenTiedUp)) {
+			// A welcome party... or maybe not...
+			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			spr1->init(6, false, _vm->_animation);
+			_vm->_animation->appearPed(1, 1);
+			spr1->walkTo(2);
+			_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 		}
 
 		if (_beenTiedUp) {
@@ -1239,11 +1232,11 @@ void Avalot::incScore(byte num) {
 	for (int i = 1; i <= num; i++) {
 		_dnascore++;
 
-//		if (soundfx) {
+		if (_soundFx) {
 			for (int j = 1; j <= 97; j++)
 				// Length os 2 is a guess, the original doesn't have a delay specified
 				_vm->_sound->playNote(177 + _dnascore * 3, 2);
-//		}
+		}
 	}
 	warning("STUB: Avalot::points()");
 


Commit: 66fe0b2ebc054f167931a661620e59d66c664a15
    https://github.com/scummvm/scummvm/commit/66fe0b2ebc054f167931a661620e59d66c664a15
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T13:48:39-07:00

Commit Message:
AVALANCHE: Remove useless comments.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 673280c..7297788 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -113,7 +113,6 @@ const char *AvalancheEngine::getCopyrightString() const {
 }
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
-	//blockwrite(f, dna, sizeof(dna));
 	sz.syncAsByte(_animation->_direction);
 	sz.syncAsByte(_avalot->_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
@@ -255,16 +254,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_givenPenToAyles);
 	sz.syncAsByte(_avalot->_askedDogfoodAboutNim);
 
-
-#if 0
-	for (int groi = 0; groi < numtr; groi++) {
-		if (tr[groi].quick) {
-			blockwrite(f, groi, 1);
-			tr[groi].savedata(f);
-		}
-	}
-#endif
-
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
 		for (int i = 0; i < _animation->kSpriteNumbMax; i++) {
@@ -315,17 +304,12 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 			spr->appear(spr->_x, spr->_y, spr->_facingDir);
 	}
 
-	//groi = 177;
-	//blockwrite(f, groi, 1);
-
-	//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
 	for (int i = 0; i < 7; i++) {
 		sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
 		sz.syncAsByte(_timer->_times[i]._action);
 		sz.syncAsByte(_timer->_times[i]._reason);
 	}
 
-	//blockwrite(f, seq, sizeof(seq)); // Sequencer information.
 	sz.syncBytes(_sequence->_seq, _sequence->kSeqLength);
 }
 


Commit: 79a961c89d4f8fd46b70a01cc0d717274c415402
    https://github.com/scummvm/scummvm/commit/79a961c89d4f8fd46b70a01cc0d717274c415402
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-21T14:34:21-07:00

Commit Message:
AVALANCHE: Move some variables, fix savegame counter increment when saving

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 0593b04..70f007a 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1230,7 +1230,7 @@ void Animation::stopWalking() {
  */
 void Animation::hideInCupboard() {
 	if (_vm->_avalot->_avvysInTheCupboard) {
-		if (_vm->_avalot->_wearing == Parser::kNothing) {
+		if (_vm->_parser->_wearing == Parser::kNothing) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7297788..282c629 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -120,8 +120,10 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsSint16LE(_avalot->_dnascore);
 	sz.syncAsSint32LE(_avalot->_money);
 	sz.syncAsByte(_avalot->_room);
-	sz.syncAsByte(_avalot->_wearing);
-	sz.syncAsByte(_avalot->_sworeNum);
+	sz.syncAsByte(_parser->_wearing);
+	sz.syncAsByte(_parser->_sworeNum);
+	if (sz.isSaving())
+		_avalot->_saveNum++;
 	sz.syncAsByte(_avalot->_saveNum);
 	sz.syncBytes(_avalot->_roomCount, 100);
 	sz.syncAsByte(_avalot->_alcoholLevel);
@@ -474,7 +476,7 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_avalot->_holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
+			_avalot->_holdLeftMouse = true; // Used in Avalot::checkclick() and Menu::menu_link().
 			break;
 		case Common::EVENT_LBUTTONUP:
 			_avalot->_holdLeftMouse = false; // Same as above.
@@ -505,20 +507,20 @@ Common::Error AvalancheEngine::run() {
 		_avalot->runAvalot();
 
 #if 0
-		//switch (_storage._operation) {
-		//case kRunShootemup:
-		//	run("seu.avx", kJsb, kBflight, kNormal);
-		//	break;
-		//case kRunDosshell:
-		//	dosShell();
-		//	break;
-		//case kRunGhostroom:
-		//	run("g-room.avx", kJsb, kNoBflight, kNormal);
-		//	break;
-		//case kRunGolden:
-		//	run("golden.avx", kJsb, kBflight, kMusical);
-		//	break;
-		//}
+		switch (_storage._operation) {
+		case kRunShootemup:
+			run("seu.avx", kJsb, kBflight, kNormal);
+			break;
+		case kRunDosshell:
+			dosShell();
+			break;
+		case kRunGhostroom:
+			run("g-room.avx", kJsb, kNoBflight, kNormal);
+			break;
+		case kRunGolden:
+			run("golden.avx", kJsb, kBflight, kMusical);
+			break;
+		}
 #endif
 
 	} while (!_avalot->_letMeOut && !shouldQuit());
@@ -528,8 +530,8 @@ Common::Error AvalancheEngine::run() {
 
 #if 0
 void AvalancheEngine::run(Common::String what, bool withJsb, bool withBflight, Elm how) {
-	warning("STUB: run(%s)", what.c_str());
 	// Probably there'll be no need of this function, as all *.AVX-es will become classes.
+	warning("STUB: run(%s)", what.c_str());
 }
 
 Common::String AvalancheEngine::elmToStr(Elm how) {
@@ -541,7 +543,7 @@ Common::String AvalancheEngine::elmToStr(Elm how) {
 		return Common::String("REGI");
 	case kElmpoyten:
 		return Common::String("ELMPOYTEN");
-		// Useless, but silent a warning
+	// Useless, but silent a warning
 	default:
 		return Common::String("");
 	}
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 772c1ad..c5d942d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1560,8 +1560,8 @@ void Avalot::resetVariables() {
 	_dnascore = 0;
 	_money = 0;
 	_room = kRoomNowhere;
-	_wearing = 0;
-	_sworeNum = 0;
+	_vm->_parser->_wearing = 0;
+	_vm->_parser->_sworeNum = 0;
 	_saveNum = 0;
 	for (int i = 0; i < 100; i++)
 		_roomCount[i] = 0;
@@ -1653,7 +1653,7 @@ void Avalot::newGame() {
 	_favouriteDrink = "beer";
 	_money = 30; // 2/6
 	_vm->_animation->_direction = Animation::kDirStopped;
-	_wearing = kObjectClothes;
+	_vm->_parser->_wearing = kObjectClothes;
 	_objects[kObjectMoney - 1] = true;
 	_objects[kObjectBodkin - 1] = true;
 	_objects[kObjectBell - 1] = true;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 51be1a3..cc50374 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -247,8 +247,6 @@ public:
 	int16 _dnascore; // your score, of course
 	int32 _money; // your current amount of dosh
 	byte _room; // your current room
-	byte _wearing; // what you're wearing
-	byte _sworeNum; // number of times you've sworn
 	byte _saveNum; // number of times this game has been saved
 	byte _roomCount[100]; // Add one to each every time you enter a room
 	byte _alcoholLevel; // Your blood alcohol level.
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 4a58763..7233628 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1033,7 +1033,7 @@ void Parser::inventory() {
 
 			tmpStr += _vm->_avalot->getItem(i + 1);
 
-			if ((i + 1) == _vm->_avalot->_wearing)
+			if ((i + 1) == _wearing)
 				tmpStr += ", which you're wearing";
 
 			if (itemNum < _vm->_avalot->_carryNum)
@@ -1041,7 +1041,7 @@ void Parser::inventory() {
 		}
 	}
 
-	if (_vm->_avalot->_wearing == kNothing)
+	if (_wearing == kNothing)
 		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 	else
 		tmpStr += '.';
@@ -1289,7 +1289,7 @@ void Parser::putProc() {
 					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
-					if (_vm->_avalot->_wearing == _thing) {
+					if (_wearing == _thing) {
 						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_avalot->getItem(_thing).c_str());
 						_vm->_dialogs->displayText(tmpStr);
 					} else {
@@ -1826,12 +1826,12 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeUndress:
-		if (_vm->_avalot->_wearing == kNothing)
+		if (_wearing == kNothing)
 			_vm->_dialogs->displayText("You're already stark naked!");
 		else if (_vm->_avalot->_avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_avalot->getItem(_vm->_avalot->_wearing).c_str());
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_avalot->getItem(_wearing).c_str());
 			_vm->_dialogs->displayText(tmpStr);
-			_vm->_avalot->_wearing = kNothing;
+			_wearing = kNothing;
 			_vm->_avalot->refreshObjectList();
 		} else
 			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
@@ -1845,14 +1845,14 @@ void Parser::doThat() {
 				break;
 			case Avalot::kObjectClothes:
 			case Avalot::kObjectHabit: { // Change this!
-				if (_vm->_avalot->_wearing != kNothing) {
-					if (_vm->_avalot->_wearing == _thing)
+				if (_wearing != kNothing) {
+					if (_wearing == _thing)
 						_vm->_dialogs->displayText("You're already wearing that.");
 					else
 						_vm->_dialogs->displayText("You'll be rather warm wearing two sets of clothes!");
 					return;
 				} else
-					_vm->_avalot->_wearing = _thing;
+					_wearing = _thing;
 
 				_vm->_avalot->refreshObjectList();
 
@@ -2013,7 +2013,7 @@ void Parser::doThat() {
 		_vm->_dialogs->displayText("Listen, smart alec, that was just rhetoric.");
 		break;
 	case kVerbCodeExpletive:
-		switch (_vm->_avalot->_sworeNum) {
+		switch (_sworeNum) {
 		case 0: {
 			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
 				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
@@ -2034,7 +2034,7 @@ void Parser::doThat() {
 			_vm->_avalot->gameOver();
 			}
 		}
-		_vm->_avalot->_sworeNum++;
+		_sworeNum++;
 		break;
 	case kVerbCodeListen:
 		if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 1084c01..d117e56 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -32,7 +32,6 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 
-
 namespace Avalanche {
 class AvalancheEngine;
 
@@ -79,6 +78,9 @@ public:
 	byte _leftMargin;
 	bool _cursorState;
 
+	byte _wearing; // what you're wearing
+	byte _sworeNum; // number of times you've sworn
+
 	Parser(AvalancheEngine *vm);
 
 	void init();


Commit: 9450faf15087d9c9074dea39d1483ccca68d6986
    https://github.com/scummvm/scummvm/commit/9450faf15087d9c9074dea39d1483ccca68d6986
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T14:38:08-07:00

Commit Message:
AVALANCHE: Implement Clock::chime().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c5d942d..4390985 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -233,7 +233,21 @@ void Clock::plotHands() {
 }
 
 void Clock::chime() {
-	warning("STUB: Clock::chime()");
+	if ((_oldHour == 17717) || (!_vm->_avalot->_soundFx)) // Too high - must be first time around
+		return;
+	
+	byte hour = _hour % 12;
+	if (hour == 0)
+		hour = 12;
+
+	_vm->_avalot->setMousePointerWait();
+
+	for (int i = 1; i <= hour; i++) {
+		for (int j = 1; j <= 3; j++)
+			_vm->_sound->playNote((i % 3) * 64 + 140 - j * 30, 50 - j * 12);
+		if (i != hour) 
+			_vm->_system->delayMillis(100);
+	}
 }
 
 


Commit: 2ffcd492be4b596575f1fde10e0e8696ff3c0811
    https://github.com/scummvm/scummvm/commit/2ffcd492be4b596575f1fde10e0e8696ff3c0811
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T15:06:52-07:00

Commit Message:
AVALANCHE: Implement Avalot::zoomOut().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4390985..3979707 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -641,7 +641,25 @@ void Avalot::loadRoom(byte num) {
 }
 
 void Avalot::zoomOut(int16 x, int16 y) {
-	warning("STUB: Avalot::zoomout()");
+	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
+
+	::Graphics::Surface backup;
+	backup.copyFrom(_vm->_graphics->_surface);
+	
+	for (byte i = 1; i <= 20; i ++) {
+		int16 x1 = x - (x / 20) * i;
+		int16 y1 = y - ((y - 10) / 20) * i;
+		int16 x2 = x + (((639 - x) / 20) * i);
+		int16 y2 = y + (((161 - y) / 20) * i);
+
+		_vm->_graphics->_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
+		_vm->_graphics->refreshScreen();
+		_vm->_system->delayMillis(17);
+		_vm->_graphics->_surface.copyFrom(backup);
+		_vm->_graphics->refreshScreen();
+	}
+
+	backup.free();
 }
 
 void Avalot::findPeople(byte room) {


Commit: 03f6a56e20f225b638dce00d99861379d568cb65
    https://github.com/scummvm/scummvm/commit/03f6a56e20f225b638dce00d99861379d568cb65
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-21T15:19:20-07:00

Commit Message:
AVALANCHE: Remove comment, replace character.

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 7233628..d24a37d 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1631,7 +1631,7 @@ void Parser::doThat() {
 		openDoor();
 		break;
 	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the \"O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the `O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -2028,7 +2028,6 @@ void Parser::doThat() {
 			break;
 		default: {
 			_vm->_pingo->zonk();
-			// CHECKME: Weird character in string
 			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
 			_vm->_avalot->gameOver();


Commit: 302e74cac1fe18404d59d84135fa6debfec239cb
    https://github.com/scummvm/scummvm/commit/302e74cac1fe18404d59d84135fa6debfec239cb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-22T08:44:46-07:00

Commit Message:
AVALANCHE: Fix GCC warning

Changed paths:
    engines/avalanche/sequence.cpp



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 8ca3844..53e43b5 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -44,7 +44,7 @@ Sequence::Sequence(AvalancheEngine *vm) {
 void Sequence::firstShow(byte what) {
 	_seq[0] = what;
 
-	for (uint i = 1; i < kSeqLength; i++)
+	for (int i = 1; i < kSeqLength; i++)
 		_seq[i] = 0;
 }
 


Commit: 863709ca576652767af00e9dcb84dfaab11e1a9e
    https://github.com/scummvm/scummvm/commit/863709ca576652767af00e9dcb84dfaab11e1a9e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-22T08:45:48-07:00

Commit Message:
AVALANCHE: Move some variables

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 282c629..110cef7 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -123,11 +123,11 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_parser->_wearing);
 	sz.syncAsByte(_parser->_sworeNum);
 	if (sz.isSaving())
-		_avalot->_saveNum++;
-	sz.syncAsByte(_avalot->_saveNum);
+		_saveNum++;
+	sz.syncAsByte(_saveNum);
 	sz.syncBytes(_avalot->_roomCount, 100);
-	sz.syncAsByte(_avalot->_alcoholLevel);
-	sz.syncAsByte(_avalot->_playedNim);
+	sz.syncAsByte(_parser->_alcoholLevel);
+	sz.syncAsByte(_parser->_playedNim);
 	sz.syncAsByte(_avalot->_wonNim);
 	sz.syncAsByte(_avalot->_wineState);
 	sz.syncAsByte(_avalot->_cwytalotGone);
@@ -135,7 +135,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_aylesIsAwake);
 	sz.syncAsByte(_avalot->_drawbridgeOpen);
 	sz.syncAsByte(_avalot->_avariciusTalk);
-	sz.syncAsByte(_avalot->_boughtOnion);
+	sz.syncAsByte(_parser->_boughtOnion);
 	sz.syncAsByte(_avalot->_rottenOnion);
 	sz.syncAsByte(_avalot->_onionInVinegar);
 	sz.syncAsByte(_avalot->_givenToSpludwick);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 289cf60..27a5bd6 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -61,10 +61,11 @@ static const int kSavegameVersion = 1;
 
 class AvalancheEngine : public Engine {
 public:
-	Graphics *_graphics;
-	Parser *_parser;
+	byte _saveNum; // number of times this game has been saved
 
 	Avalot *_avalot;
+	Graphics *_graphics;
+	Parser *_parser;
 	Pingo *_pingo;
 	Dialogs *_dialogs;
 	Background *_background;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 3979707..86bd7fe 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1594,12 +1594,12 @@ void Avalot::resetVariables() {
 	_room = kRoomNowhere;
 	_vm->_parser->_wearing = 0;
 	_vm->_parser->_sworeNum = 0;
-	_saveNum = 0;
+	_vm->_saveNum = 0;
 	for (int i = 0; i < 100; i++)
 		_roomCount[i] = 0;
 
-	_alcoholLevel = 0;
-	_playedNim = 0;
+	_vm->_parser->_alcoholLevel = 0;
+	_vm->_parser->_playedNim = 0;
 	_wonNim = false;
 	_wineState = 0;
 	_cwytalotGone = false;
@@ -1607,7 +1607,7 @@ void Avalot::resetVariables() {
 	_aylesIsAwake = false;
 	_drawbridgeOpen = 0;
 	_avariciusTalk = 0;
-	_boughtOnion = false;
+	_vm->_parser->_boughtOnion = false;
 	_rottenOnion = false;
 	_onionInVinegar = false;
 	_givenToSpludwick = 0;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index cc50374..efd04ff 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -247,10 +247,7 @@ public:
 	int16 _dnascore; // your score, of course
 	int32 _money; // your current amount of dosh
 	byte _room; // your current room
-	byte _saveNum; // number of times this game has been saved
 	byte _roomCount[100]; // Add one to each every time you enter a room
-	byte _alcoholLevel; // Your blood alcohol level.
-	byte _playedNim; // How many times you've played Nim.
 	bool _wonNim; // Have you *won* Nim? (That's harder.)
 	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
 	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
@@ -258,7 +255,6 @@ public:
 	bool _aylesIsAwake; // pretty obvious!
 	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
 	byte _avariciusTalk; // How much Avaricius has said to you.
-	bool _boughtOnion; // Have you bought an onion yet?
 	bool _rottenOnion; // And has it rotted?
 	bool _onionInVinegar; // Is the onion in the vinegar?
 	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index d24a37d..67f4243 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1382,8 +1382,8 @@ bool Parser::giveToSpludwick() {
 }
 
 void Parser::drink() {
-	_vm->_avalot->_alcoholLevel += 1;
-	if (_vm->_avalot->_alcoholLevel == 5) {
+	_alcoholLevel += 1;
+	if (_alcoholLevel == 5) {
 		_vm->_avalot->_objects[Avalot::kObjectKey - 1] = true; // Get the key.
 		_vm->_avalot->_teetotal = true;
 		_vm->_avalot->_avvyIsAwake = false;
@@ -1897,7 +1897,7 @@ void Parser::doThat() {
 				}
 
 				_vm->_dialogs->displayScrollChain('Q', 3);
-				_vm->_avalot->_playedNim++;
+				_playedNim++;
 
 				// You won - strange!
 				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
@@ -1907,7 +1907,7 @@ void Parser::doThat() {
 				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
 				_vm->_avalot->incScore(7); // 7 points for winning!
 
-				if (_vm->_avalot->_playedNim == 1)
+				if (_playedNim == 1)
 					_vm->_avalot->incScore(3); // 3 points for playing your 1st game.
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
@@ -2062,7 +2062,7 @@ void Parser::doThat() {
 						return;
 					}
 
-					if (_vm->_avalot->_alcoholLevel == 0)
+					if (_alcoholLevel == 0)
 						_vm->_avalot->incScore(3);
 
 					_vm->_background->drawBackgroundSprite(-1, -1, 11);
@@ -2093,7 +2093,7 @@ void Parser::doThat() {
 						_vm->_background->drawBackgroundSprite(-1, -1, 11);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 						_vm->_dialogs->displayText(tmpStr);
-						if (_vm->_avalot->_alcoholLevel == 0)
+						if (_alcoholLevel == 0)
 							_vm->_avalot->incScore(3);
 						_vm->_background->drawBackgroundSprite(-1, -1, 9);
 						_vm->_avalot->_malagauche = 177;
@@ -2114,7 +2114,7 @@ void Parser::doThat() {
 					else if (_vm->_avalot->_carryNum >= kCarryLimit)
 						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
 					else {
-						if (_vm->_avalot->_boughtOnion)
+						if (_boughtOnion)
 							_vm->_dialogs->displayScrollChain('D', 11);
 						else {
 							_vm->_dialogs->displayScrollChain('D', 9);
@@ -2123,7 +2123,7 @@ void Parser::doThat() {
 						_vm->_avalot->decreaseMoney(3); // It costs thruppence.
 						_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = true;
 						_vm->_avalot->refreshObjectList();
-						_vm->_avalot->_boughtOnion = true;
+						_boughtOnion = true;
 						_vm->_avalot->_rottenOnion = false; // It's OK when it leaves the stall!
 						_vm->_avalot->_onionInVinegar = false;
 					}
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index d117e56..1373413 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -80,6 +80,9 @@ public:
 
 	byte _wearing; // what you're wearing
 	byte _sworeNum; // number of times you've sworn
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _boughtOnion; // Have you bought an onion yet?
 
 	Parser(AvalancheEngine *vm);
 


Commit: 061c06c1286ba20b58412e494cf39a40eabb35b6
    https://github.com/scummvm/scummvm/commit/061c06c1286ba20b58412e494cf39a40eabb35b6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-22T11:20:51-07:00

Commit Message:
AVALANCHE: (hopefully) fix a GCC warning

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 67f4243..1bfbe93 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -549,7 +549,7 @@ Common::String Parser::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = floor(_vm->_avalot->_totalTime / ticksInOneSec); // No. of seconds.
+	h = (uint16)floor(_vm->_avalot->_totalTime / ticksInOneSec); // No. of seconds.
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;


Commit: 61eb94e5c8a7502563d5720a9db71ba1646b49bb
    https://github.com/scummvm/scummvm/commit/61eb94e5c8a7502563d5720a9db71ba1646b49bb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-22T13:47:12-07:00

Commit Message:
AVALANCHE: Use struct for consistency in Avalot

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 86bd7fe..8feec3f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -137,7 +137,6 @@ const QuasipedType Avalot::kQuasipeds[16] = {
 };
 
 const uint16 Avalot::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
-
 const TuneType Avalot::kTune = {
 	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
 	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index efd04ff..29433ee 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -101,8 +101,7 @@ struct MagicType {
 	uint16 _data; // data for them
 };
 
-class FieldType {
-public:
+struct FieldType {
 	int16 _x1, _y1, _x2, _y2;
 };
 
@@ -110,8 +109,7 @@ struct ByteField {
 	byte _x1, _y1, _x2, _y2;
 };
 
-class LineType : public FieldType {
-public:
+struct LineType : public FieldType {
 	byte _color;
 };
 


Commit: 02caaa573539bcd0760a47ecfd3c24c813568cc0
    https://github.com/scummvm/scummvm/commit/02caaa573539bcd0760a47ecfd3c24c813568cc0
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-22T14:36:25-07:00

Commit Message:
AVALANCHE: Optimize Animation::updateSpeed().

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 70f007a..18164c7 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -933,15 +933,13 @@ void Animation::updateSpeed() {
 
 	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
 
-	if (_sprites[0]._speedX == _vm->_avalot->kRun)
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
-	else
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
-
-	if (_sprites[0]._speedX == _vm->_avalot->kRun)
+	if (_sprites[0]._speedX == _vm->_avalot->kRun) {
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
-	else
+		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
+	} else {
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
+		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
+	}
 }
 
 void Animation::changeDirection(byte t, byte dir) {


Commit: cbe9c151aa305e929527a1dd81d34e7c818ae128
    https://github.com/scummvm/scummvm/commit/cbe9c151aa305e929527a1dd81d34e7c818ae128
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-23T14:16:57-07:00

Commit Message:
AVALANCHE: Refactor some variables. This breaks savegame compatibility

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 18164c7..7ddc589 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -137,14 +137,14 @@ void AnimationType::draw() {
 	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
 
-void AnimationType::turn(byte whichway) {
+void AnimationType::turn(Direction whichway) {
 	if (whichway == 8)
-		_facingDir = Animation::kDirUp;
+		_facingDir = kDirUp;
 	else
 		_facingDir = whichway;
 }
 
-void AnimationType::appear(int16 wx, int16 wy, byte wf) {
+void AnimationType::appear(int16 wx, int16 wy, Direction wf) {
 	_x = (wx / 8) * 8;
 	_y = wy;
 	_oldX[_anim->_vm->_avalot->_cp] = wx;
@@ -309,14 +309,14 @@ void AnimationType::setSpeed(int8 xx, int8 yy) {
 	if (_moveX == 0) {
 		// No horz movement
 		if (_moveY < 0)
-			turn(Animation::kDirUp);
+			turn(kDirUp);
 		else
-			turn(Animation::kDirDown);
+			turn(kDirDown);
 	} else {
 		if (_moveX < 0)
-			turn(Animation::kDirLeft);
+			turn(kDirLeft);
 		else
-			turn(Animation::kDirRight);
+			turn(kDirRight);
 	}
 }
 
@@ -942,7 +942,7 @@ void Animation::updateSpeed() {
 	}
 }
 
-void Animation::changeDirection(byte t, byte dir) {
+void Animation::setMoveSpeed(byte t, Direction dir) {
 	switch (dir) {
 	case kDirUp:
 		_sprites[t].setSpeed(0, -_sprites[t]._speedY);
@@ -975,7 +975,7 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
 	AnimationType *curSpr = &_sprites[sprNum];
 	PedType *curPed = &_vm->_avalot->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
-	changeDirection(sprNum, curPed->_direction);
+	setMoveSpeed(sprNum, curPed->_direction);
 }
 
 void Animation::followAvalotY(byte tripnum) {
@@ -1078,19 +1078,20 @@ void Animation::takeAStep(byte &tripnum) {
 	}
 }
 
-void Animation::spin(byte whichway, byte &tripnum) {
-	if (_sprites[tripnum]._facingDir != whichway) {
-		_sprites[tripnum]._facingDir = whichway;
-		if (_sprites[tripnum]._id == 2)
-			return; // Not for Spludwick
+void Animation::spin(Direction dir, byte &tripnum) {
+	if (_sprites[tripnum]._facingDir == dir)
+		return;
 
-		_vm->_avalot->_geidaSpin += 1;
-		_vm->_avalot->_geidaTime = 20;
-		if (_vm->_avalot->_geidaSpin == 5) {
-			_vm->_dialogs->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
-			_vm->_avalot->_geidaSpin = 0;
-			_vm->_avalot->_geidaTime = 0; // knock out records
-		}
+	_sprites[tripnum]._facingDir = dir;
+	if (_sprites[tripnum]._id == 2)
+		return; // Not for Spludwick
+
+	_vm->_avalot->_geidaSpin += 1;
+	_vm->_avalot->_geidaTime = 20;
+	if (_vm->_avalot->_geidaSpin == 5) {
+		_vm->_dialogs->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
+		_vm->_avalot->_geidaSpin = 0;
+		_vm->_avalot->_geidaTime = 0; // knock out records
 	}
 }
 
@@ -1330,56 +1331,56 @@ void Animation::handleMoveKey(const Common::Event &event) {
 		case Common::KEYCODE_UP:
 			if (_direction != kDirUp) {
 				_direction = kDirUp;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_DOWN:
 			if (_direction != kDirDown) {
 				_direction = kDirDown;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_LEFT:
 			if (_direction != kDirLeft) {
 				_direction = kDirLeft;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_RIGHT:
 			if (_direction != kDirRight) {
 				_direction = kDirRight;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEUP:
 			if (_direction != kDirUpRight) {
 				_direction = kDirUpRight;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_PAGEDOWN:
 			if (_direction != kDirDownRight) {
 				_direction = kDirDownRight;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_END:
 			if (_direction != kDirDownLeft) {
 				_direction = kDirDownLeft;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
 		case Common::KEYCODE_HOME:
 			if (_direction != kDirUpLeft) {
 				_direction = kDirUpLeft;
-				changeDirection(0, _direction);
+				setMoveSpeed(0, _direction);
 			} else
 				stopWalking();
 			break;
@@ -1392,4 +1393,24 @@ void Animation::handleMoveKey(const Common::Event &event) {
 	}
 }
 
+void Animation::setDirection(Direction dir) {
+	_direction = dir;
+}
+
+void Animation::setOldDirection(Direction dir) {
+	_oldDirection = dir;
+}
+
+Direction Animation::getDirection() {
+	return _direction;
+}
+
+Direction Animation::getOldDirection() {
+	return _oldDirection;
+}
+
+void Animation::synchronize(Common::Serializer &sz) {
+	sz.syncAsByte(_direction);
+}
+
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 1f13fd1..a411de7 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -39,6 +39,12 @@ namespace Avalanche {
 class AvalancheEngine;
 class Animation;
 
+enum Direction {
+	kDirUp = 0, kDirRight, kDirDown, kDirLeft,
+	kDirUpRight, kDirDownRight, kDirDownLeft, kDirUpLeft,
+	kDirStopped, kDirNone = 177
+};
+
 struct StatType {
 	Common::String _name; // Name of character.
 	Common::String _comment; // Comment.
@@ -52,7 +58,8 @@ class AnimationType {
 public:
 	SpriteInfo _info;
 	StatType _stat; // Vital statistics.
-	byte _facingDir, _stepNum;
+	Direction _facingDir;
+	byte _stepNum;
 	int16 _x, _y; // Current xy coords.
 	int16 _oldX[2], _oldY[2];  // Last xy coords.
 	int8 _moveX, _moveY; // Amount to move sprite by, each step.
@@ -69,8 +76,8 @@ public:
 	void init(byte spritenum, bool doCheck, Animation *anim); // Loads & sets up the sprite.
 	void original(); // Just sets 'quick' to false.
 	void draw(); // Drops sprite onto screen. Original: andexor().
-	void turn(byte whichway); // Turns character round.
-	void appear(int16 wx, int16 wy, byte wf); // Switches it on.
+	void turn(Direction whichway); // Turns character round.
+	void appear(int16 wx, int16 wy, Direction wf); // Switches it on.
 	void bounce(); // Bounces off walls.
 	void walk(); // Prepares for andexor, etc.
 	void walkTo(byte pednum); // Home in on a point.
@@ -92,12 +99,6 @@ class Animation {
 public:
 	friend class AnimationType;
 
-	enum Direction {
-		kDirUp, kDirRight, kDirDown, kDirLeft,
-		kDirUpRight, kDirDownRight, kDirDownLeft, kDirUpLeft,
-		kDirStopped
-	};
-
 	static const byte kSpriteNumbMax = 5; // current max no. of sprites
 
 	enum Proc {
@@ -113,8 +114,6 @@ public:
 	AnimationType _sprites[kSpriteNumbMax];
 	bool _mustExclaim;
 	uint16 _sayWhat;
-	byte _direction; // The direction Avvy is currently facing.
-	byte _oldDirection;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
@@ -125,7 +124,7 @@ public:
 	void openDoor(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
 	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
 	void stopWalking();
-	void changeDirection(byte t, byte dir);
+	void setMoveSpeed(byte t, Direction dir);
 	void appearPed(byte sprNum, byte pedNum);
 	void flipRoom(byte room, byte ped);
 	bool inField(byte which); // Returns true if you're within field "which".
@@ -133,7 +132,16 @@ public:
 	void updateSpeed();
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
 
+	void setDirection(Direction dir);
+	void setOldDirection(Direction dir);
+	Direction getDirection();
+	Direction getOldDirection();
+
+	void synchronize(Common::Serializer &sz);
 private:
+	Direction _direction; // The direction Avvy is currently facing.
+	Direction _oldDirection;
+
 	AvalancheEngine *_vm;
 
 	byte checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
@@ -150,7 +158,7 @@ private:
 	void faceAvvy(byte tripnum);
 	
 	// Movements for Homing NPCs: Spludwick and Geida.
-	void spin(byte whichway, byte &tripnum);
+	void spin(Direction dir, byte &tripnum);
 	void takeAStep(byte &tripnum);
 	void geidaProcs(byte tripnum);
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 110cef7..b8f06bf 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -113,15 +113,15 @@ const char *AvalancheEngine::getCopyrightString() const {
 }
 
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
-	sz.syncAsByte(_animation->_direction);
+	_animation->synchronize(sz);
+	_parser->synchronize(sz);
+
 	sz.syncAsByte(_avalot->_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
 		sz.syncAsByte(_avalot->_objects[i]);
 	sz.syncAsSint16LE(_avalot->_dnascore);
 	sz.syncAsSint32LE(_avalot->_money);
 	sz.syncAsByte(_avalot->_room);
-	sz.syncAsByte(_parser->_wearing);
-	sz.syncAsByte(_parser->_sworeNum);
 	if (sz.isSaving())
 		_saveNum++;
 	sz.syncAsByte(_saveNum);
@@ -439,7 +439,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	AnimationType *avvy = &_animation->_sprites[0];
 	if (avvy->_quick && avvy->_visible)
-		_animation->changeDirection(0, _animation->_direction); // We push Avvy in the right direction is he was moving.
+		_animation->setMoveSpeed(0, _animation->getDirection()); // We push Avvy in the right direction is he was moving.
 
 	return true;
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 8feec3f..b1c2edd 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -357,7 +357,7 @@ void Avalot::setup() {
 	drawToolbar();
 	_vm->_dialogs->setReadyLight(2);
 
-	_vm->_animation->_direction = Animation::kDirStopped;
+	_vm->_animation->setDirection(kDirStopped);
 	_vm->_animation->loadAnims();
 
 	dawn();
@@ -565,7 +565,7 @@ void Avalot::loadAlso(byte num) {
 		PedType *curPed = &_peds[i];
 		curPed->_x = file.readSint16LE();
 		curPed->_y = file.readSint16LE();
-		curPed->_direction = file.readByte();
+		curPed->_direction = (Direction)file.readByte();
 	}
 
 	_fieldNum = file.readByte();
@@ -792,7 +792,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 					spr1->walkTo(4); // Walks up to greet you.
 				} else {
 					_vm->_animation->appearPed(1, 4); // Starts where he was before.
-					spr1->_facingDir = Animation::kDirLeft;
+					spr1->_facingDir = kDirLeft;
 				}
 
 				spr1->_callEachStepFl = true;
@@ -852,7 +852,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 			} else {
 				// You've been here before.
 				_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
-				spr1->_facingDir = Animation::kDirLeft;
+				spr1->_facingDir = kDirLeft;
 			}
 		}
 		break;
@@ -919,7 +919,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 			default: // You've answered SOME of his questions.
 				spr1->init(9, false, _vm->_animation);
 				_vm->_animation->appearPed(1, 2);
-				spr1->_facingDir = Animation::kDirRight;
+				spr1->_facingDir = kDirRight;
 				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
 		}
@@ -1047,7 +1047,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 			spr1->walkTo(3); // Walks up to greet you.
 		} else {
 			_vm->_animation->appearPed(1, 3); // Starts where she was before.
-			spr1->_facingDir = Animation::kDirLeft;
+			spr1->_facingDir = kDirLeft;
 		}
 
 		spr1->_callEachStepFl = true;
@@ -1230,7 +1230,7 @@ void Avalot::drawToolbar() {
 	file.close();
 
 	CursorMan.showMouse(true);
-	_vm->_animation->_oldDirection = 177;
+	_vm->_animation->setOldDirection(kDirNone);
 	drawDirection();
 }
 
@@ -1279,23 +1279,23 @@ void Avalot::useCompass(const Common::Point &cursorPos) {
 
 	switch (color) {
 	case kColorGreen:
-		_vm->_animation->_direction = Animation::kDirUp;
-		_vm->_animation->changeDirection(0, Animation::kDirUp);
+		_vm->_animation->setDirection(kDirUp);
+		_vm->_animation->setMoveSpeed(0, kDirUp);
 		drawDirection();
 		break;
 	case kColorBrown:
-		_vm->_animation->_direction = Animation::kDirDown;
-		_vm->_animation->changeDirection(0, Animation::kDirDown);
+		_vm->_animation->setDirection(kDirDown);
+		_vm->_animation->setMoveSpeed(0, kDirDown);
 		drawDirection();
 		break;
 	case kColorCyan:
-		_vm->_animation->_direction = Animation::kDirLeft;
-		_vm->_animation->changeDirection(0, Animation::kDirLeft);
+		_vm->_animation->setDirection(kDirLeft);
+		_vm->_animation->setMoveSpeed(0, kDirLeft);
 		drawDirection();
 		break;
 	case kColorLightmagenta:
-		_vm->_animation->_direction = Animation::kDirRight;
-		_vm->_animation->changeDirection(0, Animation::kDirRight);
+		_vm->_animation->setDirection(kDirRight);
+		_vm->_animation->setMoveSpeed(0, kDirRight);
 		drawDirection();
 		break;
 	case kColorRed:
@@ -1354,28 +1354,28 @@ void Avalot::guideAvvy(Common::Point cursorPos) {
 		_vm->_animation->stopWalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_animation->changeDirection(0, Animation::kDirLeft);
+		_vm->_animation->setMoveSpeed(0, kDirLeft);
 		break;
 	case 2:
-		_vm->_animation->changeDirection(0, Animation::kDirRight);
+		_vm->_animation->setMoveSpeed(0, kDirRight);
 		break;
 	case 3:
-		_vm->_animation->changeDirection(0, Animation::kDirUp);
+		_vm->_animation->setMoveSpeed(0, kDirUp);
 		break;
 	case 4:
-		_vm->_animation->changeDirection(0, Animation::kDirUpLeft);
+		_vm->_animation->setMoveSpeed(0, kDirUpLeft);
 		break;
 	case 5:
-		_vm->_animation->changeDirection(0, Animation::kDirUpRight);
+		_vm->_animation->setMoveSpeed(0, kDirUpRight);
 		break;
 	case 6:
-		_vm->_animation->changeDirection(0, Animation::kDirDown);
+		_vm->_animation->setMoveSpeed(0, kDirDown);
 		break;
 	case 7:
-		_vm->_animation->changeDirection(0, Animation::kDirDownLeft);
+		_vm->_animation->setMoveSpeed(0, kDirDownLeft);
 		break;
 	case 8:
-		_vm->_animation->changeDirection(0, Animation::kDirDownRight);
+		_vm->_animation->setMoveSpeed(0, kDirDownRight);
 		break;
 	}    // No other values are possible.
 
@@ -1480,13 +1480,13 @@ void Avalot::dawn() {
 }
 
 void Avalot::drawDirection() { // It's data is loaded in load_digits().
-	if (_vm->_animation->_oldDirection == _vm->_animation->_direction)
+	if (_vm->_animation->getOldDirection() == _vm->_animation->getDirection())
 		return;
 
-	_vm->_animation->_oldDirection = _vm->_animation->_direction;
+	_vm->_animation->setOldDirection(_vm->_animation->getDirection());
 
 	CursorMan.showMouse(false);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _directions[_vm->_animation->_direction], 0, 161);
+	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _directions[_vm->_animation->getDirection()], 0, 161);
 	CursorMan.showMouse(true);
 }
 
@@ -1501,7 +1501,7 @@ void Avalot::gameOver() {
 	avvy->remove();
 	avvy->init(12, true, _vm->_animation); // 12 = Avalot falls
 	avvy->_stepNum = 0;
-	avvy->appear(sx, sy, 0);
+	avvy->appear(sx, sy, kDirUp);
 
 	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
 	_alive = false;
@@ -1548,7 +1548,7 @@ void Avalot::spriteRun() {
 
 void Avalot::fixFlashers() {
 	_ledStatus = 177;
-	_vm->_animation->_oldDirection = 177;
+	_vm->_animation->setOldDirection(kDirNone);
 	_vm->_dialogs->setReadyLight(2);
 	drawDirection();
 }
@@ -1582,8 +1582,7 @@ void Avalot::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Strin
 }
 
 void Avalot::resetVariables() {
-// Replaces memset(&_dna, 0, sizeof(DnaType));
-	_vm->_animation->_direction = 0;
+	_vm->_animation->setDirection(kDirUp);
 	_carryNum = 0;
 	for (int i = 0; i < kObjectNum; i++)
 		_objects[i] = false;
@@ -1683,7 +1682,7 @@ void Avalot::newGame() {
 	_spareEvening = "answer a questionnaire";
 	_favouriteDrink = "beer";
 	_money = 30; // 2/6
-	_vm->_animation->_direction = Animation::kDirStopped;
+	_vm->_animation->setDirection(kDirStopped);
 	_vm->_parser->_wearing = kObjectClothes;
 	_objects[kObjectMoney - 1] = true;
 	_objects[kObjectBodkin - 1] = true;
@@ -1696,7 +1695,7 @@ void Avalot::newGame() {
 	_onToolbar = false;
 	_seeScroll = false;
 
-	avvy->appear(300, 117, Animation::kDirRight); // Needed to initialize Avalot.
+	avvy->appear(300, 117, kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
 	_him = Parser::kPardon;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 29433ee..0179d89 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -30,6 +30,8 @@
 #ifndef AVALANCHE_AVALOT_H
 #define AVALANCHE_AVALOT_H
 
+#include "avalanche/animation.h"
+
 #include "common/events.h"
 #include "common/system.h"
 #include "common/str.h"
@@ -93,7 +95,7 @@ struct MouseHotspotType { // mouse-void
 
 struct PedType {
 	int16 _x, _y;
-	byte _direction;
+	Direction _direction;
 };
 
 struct MagicType {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 1bfbe93..c54b482 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1426,7 +1426,7 @@ void Parser::standUp() {
 			_vm->_animation->_sprites[0]._visible = true;
 			_vm->_avalot->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
-			_vm->_animation->_direction = Animation::kDirLeft;
+			_vm->_animation->setDirection(kDirLeft);
 			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
 			_vm->_avalot->incScore(1);
 			_vm->_avalot->_avvyInBed = false;
@@ -1867,7 +1867,7 @@ void Parser::doThat() {
 					int16 y = spr->_y;
 					spr->remove();
 					spr->init(i, true, _vm->_animation);
-					spr->appear(x, y, Animation::kDirLeft);
+					spr->appear(x, y, kDirLeft);
 					spr->_visible = false;
 				}
 				}
@@ -2362,4 +2362,9 @@ void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
 	}
 }
 
+void Parser::synchronize(Common::Serializer &sz) {
+	sz.syncAsByte(_wearing);
+	sz.syncAsByte(_sworeNum);
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 1373413..8f49a48 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -31,6 +31,8 @@
 #include "common/events.h"
 #include "common/scummsys.h"
 #include "common/str.h"
+#include "common/serializer.h"
+
 
 namespace Avalanche {
 class AvalancheEngine;
@@ -102,6 +104,8 @@ public:
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
 	int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
 
+	void synchronize(Common::Serializer &sz);
+
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 081f7a3..1fc69a2 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -248,7 +248,7 @@ void Timer::avariciusTalks() {
 }
 
 void Timer::urinate() {
-	_vm->_animation->_sprites[0].turn(Animation::kDirUp);
+	_vm->_animation->_sprites[0].turn(kDirUp);
 	_vm->_animation->stopWalking();
 	_vm->_avalot->drawDirection();
 	addTimer(14, kProcToilet, kReasonGoToToilet);
@@ -558,7 +558,7 @@ void Timer::meetAvaroid() {
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
-		avvy->_facingDir = Animation::kDirLeft;
+		avvy->_facingDir = kDirLeft;
 		avvy->_x = 151;
 		avvy->_moveX = -3;
 		avvy->_moveY = -5;
@@ -586,7 +586,7 @@ void Timer::robinHoodAndGeida() {
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->stopWalk();
-	spr->_facingDir = Animation::kDirLeft;
+	spr->_facingDir = kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
 	_vm->_avalot->_geidaFollows = false;
 }


Commit: f4e37939c7cb36041b610d8a8d42576959b94ed9
    https://github.com/scummvm/scummvm/commit/f4e37939c7cb36041b610d8a8d42576959b94ed9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-23T22:31:43-07:00

Commit Message:
AVALANCHE: Move 2 enums out of Avalot classes, set private some parser variables

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 7ddc589..1172b1c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -771,7 +771,7 @@ void Animation::callSpecial(uint16 which) {
 			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_avalot->_whereIs[Avalot::kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
+			_vm->_avalot->_whereIs[kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
@@ -813,7 +813,7 @@ void Animation::callSpecial(uint16 which) {
 	case 10: // _vm->_avalot->special 10: transfer north in catacombs.
 		if ((_vm->_avalot->_catacombX == 4) && (_vm->_avalot->_catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_avalot->_objects[Avalot::kObjectKey - 1])
+			if (_vm->_avalot->_objects[kObjectKey - 1])
 				_vm->_dialogs->displayScrollChain('q', 62);
 			else {
 				_vm->_dialogs->displayScrollChain('q', 61);
@@ -1229,7 +1229,7 @@ void Animation::stopWalking() {
  */
 void Animation::hideInCupboard() {
 	if (_vm->_avalot->_avvysInTheCupboard) {
-		if (_vm->_parser->_wearing == Parser::kNothing) {
+		if (_vm->_parser->_wearing == kObjectDummy) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b8f06bf..b0db964 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -126,8 +126,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		_saveNum++;
 	sz.syncAsByte(_saveNum);
 	sz.syncBytes(_avalot->_roomCount, 100);
-	sz.syncAsByte(_parser->_alcoholLevel);
-	sz.syncAsByte(_parser->_playedNim);
 	sz.syncAsByte(_avalot->_wonNim);
 	sz.syncAsByte(_avalot->_wineState);
 	sz.syncAsByte(_avalot->_cwytalotGone);
@@ -135,7 +133,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_aylesIsAwake);
 	sz.syncAsByte(_avalot->_drawbridgeOpen);
 	sz.syncAsByte(_avalot->_avariciusTalk);
-	sz.syncAsByte(_parser->_boughtOnion);
 	sz.syncAsByte(_avalot->_rottenOnion);
 	sz.syncAsByte(_avalot->_onionInVinegar);
 	sz.syncAsByte(_avalot->_givenToSpludwick);
@@ -422,7 +419,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_background->forgetBackgroundSprites();
 	_avalot->minorRedraw();
 	_menu->setup();
-	_avalot->_whereIs[Avalot::kPeopleAvalot - 150] = _avalot->_room;
+	_avalot->_whereIs[kPeopleAvalot - 150] = _avalot->_room;
 	_avalot->_alive = true;
 	_avalot->refreshObjectList();
 	_animation->updateSpeed();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index b1c2edd..afee722 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -371,7 +371,7 @@ void Avalot::setup() {
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_thinks = 2; // You always have money.
-		thinkAbout(Avalot::kObjectMoney, Avalot::kThing);
+		thinkAbout(kObjectMoney, Avalot::kThing);
 
 		_vm->loadGame(loadSlot);
 	} else {
@@ -380,7 +380,7 @@ void Avalot::setup() {
 
 		_soundFx = !_soundFx;
 		fxToggle();
-		thinkAbout(Avalot::kObjectMoney, Avalot::kThing);
+		thinkAbout(kObjectMoney, Avalot::kThing);
 
 		_vm->_dialogs->displayScrollChain('q', 83); // Info on the game, etc.
 	}
@@ -727,12 +727,12 @@ void Avalot::enterNewTown() {
 			_spludwickAtHome = true;
 			_crapulusWillTell = false;
 		}
-		if (_boxContent == Avalot::kObjectWine)
+		if (_boxContent == kObjectWine)
 			_wineState = 3; // Vinegar
 		break;
 	}
 
-	if ((_room != kRoomOutsideDucks) && (_objects[Avalot::kObjectOnion - 1]) && !(_onionInVinegar))
+	if ((_room != kRoomOutsideDucks) && (_objects[kObjectOnion - 1]) && !(_onionInVinegar))
 		_rottenOnion = true; // You're holding the onion
 }
 
@@ -760,10 +760,10 @@ void Avalot::enterRoom(byte room, byte ped) {
 	if ((_roomCount[room] == 0) && (!setFlag('S')))
 		incScore(1);
 
-	_whereIs[Avalot::kPeopleAvalot - 150] = _room;
+	_whereIs[kPeopleAvalot - 150] = _room;
 
 	if (_geidaFollows)
-		_whereIs[Avalot::kPeopleGeida - 150] = room;
+		_whereIs[kPeopleGeida - 150] = room;
 
 	_roomTime = 0;
 
@@ -784,7 +784,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 		if (ped > 0) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			if (!_talkedToCrapulus) {
-				_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomOutsideYours;
+				_whereIs[kPeopleCrapulus - 150] = kRoomOutsideYours;
 				spr1->init(8, false, _vm->_animation); // load Crapulus
 
 				if (_roomCount[kRoomOutsideYours] == 1) {
@@ -799,7 +799,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 				spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy.
 
 			} else
-				_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomNowhere;
+				_whereIs[kPeopleCrapulus - 150] = kRoomNowhere;
 
 			if (_crapulusWillTell) {
 				spr1->init(8, false, _vm->_animation);
@@ -824,13 +824,13 @@ void Avalot::enterRoom(byte room, byte ped) {
 			if (ped > 0) {
 				spr1->init(2, false, _vm->_animation); // load Spludwick
 				_vm->_animation->appearPed(1, 1);
-				_whereIs[Avalot::kPeopleSpludwick - 150] = kRoomSpludwicks;
+				_whereIs[kPeopleSpludwick - 150] = kRoomSpludwicks;
 			}
 
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcGeida;
 		} else
-			_whereIs[Avalot::kPeopleSpludwick - 150] = kRoomNowhere;
+			_whereIs[kPeopleSpludwick - 150] = kRoomNowhere;
 		break;
 
 	case kRoomBrummieRoad:
@@ -838,13 +838,13 @@ void Avalot::enterRoom(byte room, byte ped) {
 			putGeidaAt(4, ped);
 		if (_cwytalotGone) {
 			_magics[kColorLightred - 1]._operation = Avalot::kMagicNothing;
-			_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomNowhere;
+			_whereIs[kPeopleCwytalot - 150] = kRoomNowhere;
 		} else if (ped > 0) {
 			AnimationType *spr1 = &_vm->_animation->_sprites[1];
 			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcFollowAvvyY;
-			_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomBrummieRoad;
+			_whereIs[kPeopleCwytalot - 150] = kRoomBrummieRoad;
 
 			if (_roomCount[kRoomBrummieRoad] == 1) { // First time here...
 				_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
@@ -891,8 +891,8 @@ void Avalot::enterRoom(byte room, byte ped) {
 		}
 
 		if (_beenTiedUp) {
-			_whereIs[Avalot::kPeopleRobinHood - 150] = 0;
-			_whereIs[Avalot::kPeopleFriarTuck - 150] = 0;
+			_whereIs[kPeopleRobinHood - 150] = 0;
+			_whereIs[kPeopleFriarTuck - 150] = 0;
 		}
 
 		if (_tiedUp)
@@ -936,9 +936,9 @@ void Avalot::enterRoom(byte room, byte ped) {
 		if (ped > 0)
 			zoomOut(_peds[ped]._x, _peds[ped]._y);
 
-		if ((_objects[Avalot::kObjectWine - 1]) && (_wineState != 3)) {
+		if ((_objects[kObjectWine - 1]) && (_wineState != 3)) {
 			_vm->_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
-			_objects[Avalot::kObjectWine - 1] = false;
+			_objects[kObjectWine - 1] = false;
 			refreshObjectList();
 		}
 
@@ -1004,7 +1004,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 			_vm->_graphics->refreshBackground();
 			_vm->_background->drawBackgroundSprite(-1, -1, 3);
 			_magics[kColorBrown - 1]._operation = Avalot::kMagicNothing;
-			_whereIs[Avalot::kPeopleJacques - 150] = 0;
+			_whereIs[kPeopleJacques - 150] = 0;
 		}
 		if (ped != 0) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 5);
@@ -1315,7 +1315,7 @@ void Avalot::fxToggle() {
 void Avalot::refreshObjectList() {
 	_carryNum = 0;
 	if (_thinkThing && !_objects[_thinks - 1])
-		thinkAbout(Avalot::kObjectMoney, Avalot::kThing); // you always have money
+		thinkAbout(kObjectMoney, Avalot::kThing); // you always have money
 
 	for (int i = 0; i < kObjectNum; i++) {
 		if (_objects[i]) {
@@ -1590,14 +1590,10 @@ void Avalot::resetVariables() {
 	_dnascore = 0;
 	_money = 0;
 	_room = kRoomNowhere;
-	_vm->_parser->_wearing = 0;
-	_vm->_parser->_sworeNum = 0;
 	_vm->_saveNum = 0;
 	for (int i = 0; i < 100; i++)
 		_roomCount[i] = 0;
 
-	_vm->_parser->_alcoholLevel = 0;
-	_vm->_parser->_playedNim = 0;
 	_wonNim = false;
 	_wineState = 0;
 	_cwytalotGone = false;
@@ -1605,7 +1601,6 @@ void Avalot::resetVariables() {
 	_aylesIsAwake = false;
 	_drawbridgeOpen = 0;
 	_avariciusTalk = 0;
-	_vm->_parser->_boughtOnion = false;
 	_rottenOnion = false;
 	_onionInVinegar = false;
 	_givenToSpludwick = 0;
@@ -1661,6 +1656,8 @@ void Avalot::resetVariables() {
 	_takenMushroom = false;
 	_givenPenToAyles = false;
 	_askedDogfoodAboutNim = false;
+
+	_vm->_parser->resetVariables();
 }
 
 void Avalot::newGame() {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 0179d89..89f67b8 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -83,6 +83,56 @@ enum Room {
 	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
 };
 
+// Objects you can hold:
+enum Object {
+	kObjectWine = 1,
+	kObjectMoney,
+	kObjectBodkin,
+	kObjectPotion,
+	kObjectChastity,
+	kObjectBolt,
+	kObjectCrossbow,
+	kObjectLute,
+	kObjectBadge,
+	kObjectMushroom,
+	kObjectKey,
+	kObjectBell,
+	kObjectPrescription,
+	kObjectPen,
+	kObjectInk,
+	kObjectClothes,
+	kObjectHabit,
+	kObjectOnion,
+	kObjectDummy = 177
+};
+
+// People who hang around this game.
+enum People {
+	// Boys:
+	kPeopleAvalot = 150,
+	kPeopleSpludwick = 151,
+	kPeopleCrapulus = 152,
+	kPeopleDrDuck = 153,
+	kPeopleMalagauche = 154,
+	kPeopleFriarTuck = 155,
+	kPeopleRobinHood = 156,
+	kPeopleCwytalot = 157,
+	kPeopleDuLustie = 158,
+	kPeopleDuke = 159,
+	kPeopleDogfood = 160,
+	kPeopleTrader = 161,
+	kPeopleIbythneth = 162,
+	kPeopleAyles = 163,
+	kPeoplePort = 164,
+	kPeopleSpurge = 165,
+	kPeopleJacques = 166,
+	// Girls:
+	kPeopleArkata = 175,
+	kPeopleGeida = 176,
+	kPeopleInvisible = 177,
+	kPeopleWisewoman = 178
+};
+
 static const byte kObjectNum = 18; // always preface with a #
 static const int16 kCarryLimit = 12;  // carry limit
 
@@ -133,55 +183,6 @@ struct Sundry { // Things which must be saved over a backtobootstrap, outside DN
 
 class Avalot {
 public:
-	// Objects you can hold:
-	enum Object {
-		kObjectWine = 1,
-		kObjectMoney,
-		kObjectBodkin,
-		kObjectPotion,
-		kObjectChastity,
-		kObjectBolt,
-		kObjectCrossbow,
-		kObjectLute,
-		kObjectBadge,
-		kObjectMushroom,
-		kObjectKey,
-		kObjectBell,
-		kObjectPrescription,
-		kObjectPen,
-		kObjectInk,
-		kObjectClothes,
-		kObjectHabit,
-		kObjectOnion
-	};
-
-	// People who hang around this game.
-	enum People {
-		// Boys:
-		kPeopleAvalot = 150,
-		kPeopleSpludwick = 151,
-		kPeopleCrapulus = 152,
-		kPeopleDrDuck = 153,
-		kPeopleMalagauche = 154,
-		kPeopleFriarTuck = 155,
-		kPeopleRobinHood = 156,
-		kPeopleCwytalot = 157,
-		kPeopleDuLustie = 158,
-		kPeopleDuke = 159,
-		kPeopleDogfood = 160,
-		kPeopleTrader = 161,
-		kPeopleIbythneth = 162,
-		kPeopleAyles = 163,
-		kPeoplePort = 164,
-		kPeopleSpurge = 165,
-		kPeopleJacques = 166,
-		// Girls:
-		kPeopleArkata = 175,
-		kPeopleGeida = 176,
-		kPeopleInvisible = 177,
-		kPeopleWisewoman = 178
-	};
-
 	static const int16 kXW = 30;
 	static const int16 kYW = 36; // x width & y whatsit
 	static const int16 kMargin = 5;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 3004f62..37f8fc1 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -961,10 +961,10 @@ void Dialogs::talkTo(byte whom) {
 
 	if (_vm->_avalot->_subjectNum == 0) {
 		switch (whom) {
-		case Avalot::kPeopleSpludwick:
-			if ((_vm->_avalot->_lustieIsAsleep) & (!_vm->_avalot->_objects[Avalot::kObjectPotion - 1])) {
+		case kPeopleSpludwick:
+			if ((_vm->_avalot->_lustieIsAsleep) & (!_vm->_avalot->_objects[kObjectPotion - 1])) {
 				displayScrollChain('q', 68);
-				_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = true;
+				_vm->_avalot->_objects[kObjectPotion - 1] = true;
 				_vm->_avalot->refreshObjectList();
 				_vm->_avalot->incScore(3);
 				return;
@@ -988,20 +988,20 @@ void Dialogs::talkTo(byte whom) {
 				return;
 			}
 			break;
-		case Avalot::kPeopleIbythneth:
+		case kPeopleIbythneth:
 			if (_vm->_avalot->_givenBadgeToIby) {
 				displayScrollChain('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
-		case Avalot::kPeopleDogfood:
+		case kPeopleDogfood:
 			if (_vm->_avalot->_wonNim) { // We've won the game.
 				displayScrollChain('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
 				_vm->_avalot->_askedDogfoodAboutNim = true;
 			break;
-		case Avalot::kPeopleAyles:
+		case kPeopleAyles:
 			if (!_vm->_avalot->_aylesIsAwake) {
 				displayScrollChain('q', 43); // He's fast asleep!
 				return;
@@ -1011,11 +1011,11 @@ void Dialogs::talkTo(byte whom) {
 			}
 			break;
 
-		case Avalot::kPeopleJacques:
+		case kPeopleJacques:
 			displayScrollChain('q', 43);
 			return;
 
-		case Avalot::kPeopleGeida:
+		case kPeopleGeida:
 			if (_vm->_avalot->_givenPotionToGeida)
 				_vm->_avalot->_geidaFollows = true;
 			else {
@@ -1023,7 +1023,7 @@ void Dialogs::talkTo(byte whom) {
 				return;
 			}
 			break;
-		case Avalot::kPeopleSpurge:
+		case kPeopleSpurge:
 			if (!_vm->_avalot->_sittingInPub) {
 				displayScrollChain('q', 71); // Try going over and sitting down.
 				return;
@@ -1038,7 +1038,7 @@ void Dialogs::talkTo(byte whom) {
 			break;
 		}
 	// On a subject. Is there any reason to block it?
-	} else if ((whom == Avalot::kPeopleAyles) && (!_vm->_avalot->_aylesIsAwake)) {
+	} else if ((whom == kPeopleAyles) && (!_vm->_avalot->_aylesIsAwake)) {
 		displayScrollChain('q', 43); // He's fast asleep!
 		return;
 	}
@@ -1066,12 +1066,12 @@ void Dialogs::talkTo(byte whom) {
 	if (!_noError)
 		displayScrollChain('n', whom); // File not found!
 
-	if ((_vm->_avalot->_subjectNum == 0) && ((whom + 149) == Avalot::kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_avalot->_objects[Avalot::kObjectBadge - 1] = true;
+	if ((_vm->_avalot->_subjectNum == 0) && ((whom + 149) == kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_avalot->_objects[kObjectBadge - 1] = true;
 		_vm->_avalot->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_avalot->_talkedToCrapulus = true;
-		_vm->_avalot->_whereIs[Avalot::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
+		_vm->_avalot->_whereIs[kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 0fb1f62..fab349e 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -263,25 +263,25 @@ Menu::Menu(AvalancheEngine *vm) {
 
 void Menu::findWhatYouCanDoWithIt() {
 	switch (_vm->_avalot->_thinks) {
-	case Avalot::kObjectWine:
-	case Avalot::kObjectPotion:
-	case Avalot::kObjectInk:
+	case kObjectWine:
+	case kObjectPotion:
+	case kObjectInk:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeDrink;
 		break;
-	case Avalot::kObjectBell:
+	case kObjectBell:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeRing;
 		break;
-	case Avalot::kObjectChastity:
+	case kObjectChastity:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
-	case Avalot::kObjectLute:
+	case kObjectLute:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodePlay;
 		break;
-	case Avalot::kObjectMushroom:
-	case Avalot::kObjectOnion:
+	case kObjectMushroom:
+	case kObjectOnion:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeEat;
 		break;
-	case Avalot::kObjectClothes:
+	case kObjectClothes:
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
 		break;
 	default:
@@ -487,7 +487,7 @@ void Menu::setupMenuWith() {
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_avalot->_lastPerson == Avalot::kPeopleAvalot) || (_vm->_avalot->_lastPerson == _vm->_parser->kNothing)
+		if ((_vm->_avalot->_lastPerson == kPeopleAvalot) || (_vm->_avalot->_lastPerson == _vm->_parser->kNothing)
 			|| (_vm->_avalot->_whereIs[_vm->_avalot->_lastPerson - 150] != _vm->_avalot->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
@@ -499,18 +499,18 @@ void Menu::setupMenuWith() {
 		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_avalot->_thinks), 'T', "", true);
 		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeTalk;
 		switch (_vm->_avalot->_thinks) {
-		case Avalot::kPeopleGeida:
-		case Avalot::kPeopleArkata:
+		case kPeopleGeida:
+		case kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
 			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodeKiss;
 			break;
-		case Avalot::kPeopleDogfood:
+		case kPeopleDogfood:
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_avalot->_wonNim); // True if you HAVEN'T won.
 			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodePlay;
 			break;
-		case Avalot::kPeopleMalagauche: {
+		case kPeopleMalagauche: {
 			bool isSober = !_vm->_avalot->_teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_avalot->_objects[Avalot::kObjectWine - 1]);
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_avalot->_objects[kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
@@ -518,8 +518,8 @@ void Menu::setupMenuWith() {
 			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 101 + 100 + 102 + 103 + 104;
 			}
 			break;
-		case Avalot::kPeopleTrader:
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_avalot->_objects[Avalot::kObjectOnion - 1]);
+		case kPeopleTrader:
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_avalot->_objects[kObjectOnion - 1]);
 			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 105;
 			break;
 		}
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index c54b482..94d3d24 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -893,7 +893,7 @@ void Parser::parse() {
 		_vm->_avalot->_it = _thing;
 
 	if (_person != kPardon) {
-		if (_person < Avalot::kPeopleArkata)
+		if (_person < kPeopleArkata)
 			_vm->_avalot->_him = _person;
 		else
 			_vm->_avalot->_her = _person;
@@ -904,7 +904,7 @@ void Parser::examineObject() {
 	if (_thing != _vm->_avalot->_thinks)
 		_vm->_avalot->thinkAbout(_thing, Avalot::kThing);
 	switch (_thing) {
-	case Avalot::kObjectWine :
+	case kObjectWine :
 		switch (_vm->_avalot->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
@@ -917,7 +917,7 @@ void Parser::examineObject() {
 			break;
 		}
 		break;
-	case Avalot::kObjectOnion:
+	case kObjectOnion:
 		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
 		else
@@ -933,7 +933,7 @@ bool Parser::isPersonHere() { // Person equivalent of "holding".
 		return true;
 	else {
 		Common::String tmpStr;
-		if (_person < Avalot::kPeopleArkata)
+		if (_person < kPeopleArkata)
 			tmpStr = "He isn't around at the moment.";
 		else
 			tmpStr = "She isn't around at the moment.";
@@ -949,14 +949,14 @@ void Parser::exampers() {
 
 		byte newPerson = _person - 149;
 
-		if ((_person == Avalot::kPeopleDogfood) && _vm->_avalot->_wonNim)
+		if ((_person == kPeopleDogfood) && _vm->_avalot->_wonNim)
 			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
-		else if ((_person == Avalot::kPeopleDuLustie) && _vm->_avalot->_lustieIsAsleep)
+		else if ((_person == kPeopleDuLustie) && _vm->_avalot->_lustieIsAsleep)
 			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
 		else
 			_vm->_dialogs->displayScrollChain('p', newPerson);
 
-		if ((_person == Avalot::kPeopleAyles) && !_vm->_avalot->_aylesIsAwake)
+		if ((_person == kPeopleAyles) && !_vm->_avalot->_aylesIsAwake)
 			_vm->_dialogs->displayScrollChain('Q', 13);
 
 		_person = newPerson;
@@ -1051,7 +1051,7 @@ void Parser::inventory() {
 
 void Parser::swallow() { // Eat something.
 	switch (_thing) {
-	case Avalot::kObjectWine:
+	case kObjectWine:
 		switch (_vm->_avalot->_wineState) { // 4 is perfect
 		case 1:
 			if (_vm->_avalot->_teetotal)  {
@@ -1061,7 +1061,7 @@ void Parser::swallow() { // Eat something.
 			_vm->_dialogs->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_dialogs->displayScrollChain('U', 2);
-			_vm->_avalot->_objects[Avalot::kObjectWine - 1] = false;
+			_vm->_avalot->_objects[kObjectWine - 1] = false;
 			_vm->_avalot->refreshObjectList();
 			drink();
 			break;
@@ -1071,28 +1071,28 @@ void Parser::swallow() { // Eat something.
 			break; // You can't drink it!
 		}
 		break;
-	case Avalot::kObjectPotion:
+	case kObjectPotion:
 		_vm->_avalot->setBackgroundColor(4);
 		_vm->_dialogs->displayScrollChain('U', 3);
 		_vm->_avalot->gameOver();
 		_vm->_avalot->setBackgroundColor(0);
 		break;
-	case Avalot::kObjectInk:
+	case kObjectInk:
 		_vm->_dialogs->displayScrollChain('U', 4);
 		break;
-	case Avalot::kObjectChastity:
+	case kObjectChastity:
 		_vm->_dialogs->displayScrollChain('U', 5);
 		break;
-	case Avalot::kObjectMushroom:
+	case kObjectMushroom:
 		_vm->_dialogs->displayScrollChain('U', 6);
 		_vm->_avalot->gameOver();
 		break;
-	case Avalot::kObjectOnion:
+	case kObjectOnion:
 		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('U', 11);
 		else {
 			_vm->_dialogs->displayScrollChain('U', 8);
-			_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = false;
+			_vm->_avalot->_objects[kObjectOnion - 1] = false;
 			_vm->_avalot->refreshObjectList();
 		}
 		break;
@@ -1252,8 +1252,8 @@ void Parser::putProc() {
 
 	// Thing is the _thing which you're putting in. _thing2 is where you're putting it.
 	switch (_thing2) {
-	case Avalot::kObjectWine:
-		if (_thing == Avalot::kObjectOnion) {
+	case kObjectWine:
+		if (_thing == kObjectOnion) {
 			if (_vm->_avalot->_rottenOnion)
 				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
@@ -1276,16 +1276,16 @@ void Parser::putProc() {
 				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
-				case Avalot::kObjectMoney:
+				case kObjectMoney:
 					_vm->_dialogs->displayText("You'd better keep some ready cash on you!");
 					break;
-				case Avalot::kObjectBell:
+				case kObjectBell:
 					_vm->_dialogs->displayText("That's a silly place to keep a bell.");
 					break;
-				case Avalot::kObjectBodkin:
+				case kObjectBodkin:
 					_vm->_dialogs->displayText("But you might need it!");
 					break;
-				case Avalot::kObjectOnion:
+				case kObjectOnion:
 					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
 					break;
 				default: // Put the object into the box...
@@ -1345,8 +1345,8 @@ bool Parser::giveToSpludwick() {
 	}
 
 	switch (_thing) {
-	case Avalot::kObjectOnion:
-		_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = false;
+	case kObjectOnion:
+		_vm->_avalot->_objects[kObjectOnion - 1] = false;
 		if (_vm->_avalot->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 22);
 		else {
@@ -1357,21 +1357,21 @@ bool Parser::giveToSpludwick() {
 		}
 		_vm->_avalot->refreshObjectList();
 		break;
-	case Avalot::kObjectInk:
-		_vm->_avalot->_objects[Avalot::kObjectInk - 1] = false;
+	case kObjectInk:
+		_vm->_avalot->_objects[kObjectInk - 1] = false;
 		_vm->_avalot->refreshObjectList();
 		_vm->_avalot->_givenToSpludwick++;
 		_vm->_dialogs->displayScrollChain('q', 24);
 		goToCauldron();
 		_vm->_avalot->incScore(3);
 		break;
-	case Avalot::kObjectMushroom:
-		_vm->_avalot->_objects[Avalot::kObjectMushroom - 1] = false;
+	case kObjectMushroom:
+		_vm->_avalot->_objects[kObjectMushroom - 1] = false;
 		_vm->_dialogs->displayScrollChain('q', 25);
 		_vm->_avalot->incScore(5);
 		_vm->_avalot->_givenToSpludwick++;
 		goToCauldron();
-		_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = true;
+		_vm->_avalot->_objects[kObjectPotion - 1] = true;
 		_vm->_avalot->refreshObjectList();
 		break;
 	default:
@@ -1384,7 +1384,7 @@ bool Parser::giveToSpludwick() {
 void Parser::drink() {
 	_alcoholLevel += 1;
 	if (_alcoholLevel == 5) {
-		_vm->_avalot->_objects[Avalot::kObjectKey - 1] = true; // Get the key.
+		_vm->_avalot->_objects[kObjectKey - 1] = true; // Get the key.
 		_vm->_avalot->_teetotal = true;
 		_vm->_avalot->_avvyIsAwake = false;
 		_vm->_avalot->_avvyInBed = true;
@@ -1474,7 +1474,7 @@ void Parser::getProc(char thing) {
 		break;
 	case kRoomInsideCardiffCastle:
 		switch (thing) {
-		case Avalot::kObjectPen:
+		case kObjectPen:
 			if (_vm->_animation->inField(1)) { // Standing on the dais.
 				if (_vm->_avalot->_takenPen)
 					_vm->_dialogs->displayText("It's not there, Avvy.");
@@ -1483,7 +1483,7 @@ void Parser::getProc(char thing) {
 					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_avalot->_takenPen = true;
-					_vm->_avalot->_objects[Avalot::kObjectPen - 1] = true;
+					_vm->_avalot->_objects[kObjectPen - 1] = true;
 					_vm->_avalot->refreshObjectList();
 					_vm->_dialogs->displayText("Taken.");
 				}
@@ -1492,7 +1492,7 @@ void Parser::getProc(char thing) {
 			else
 				_vm->_dialogs->displayScrollChain('q', 51);
 			break;
-		case Avalot::kObjectBolt:
+		case kObjectBolt:
 			_vm->_dialogs->displayScrollChain('q', 52);
 			break;
 		default:
@@ -1500,12 +1500,12 @@ void Parser::getProc(char thing) {
 		}
 		break;
 	case kRoomRobins:
-		if ((thing == Avalot::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) {
+		if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 2);
 			_vm->_dialogs->displayText("Got it!");
 			_vm->_avalot->_mushroomGrowing = false;
 			_vm->_avalot->_takenMushroom = true;
-			_vm->_avalot->_objects[Avalot::kObjectMushroom - 1] = true;
+			_vm->_avalot->_objects[kObjectMushroom - 1] = true;
 			_vm->_avalot->refreshObjectList();
 			_vm->_avalot->incScore(3);
 		} else
@@ -1526,7 +1526,7 @@ void Parser::giveGeidaTheLute() {
 		_vm->_dialogs->displayText(tmpStr);
 		return;
 	}
-	_vm->_avalot->_objects[Avalot::kObjectLute - 1] = false;
+	_vm->_avalot->_objects[kObjectLute - 1] = false;
 	_vm->_avalot->refreshObjectList();
 	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
 
@@ -1686,52 +1686,52 @@ void Parser::doThat() {
 				_vm->_dialogs->displayText("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
-				case Avalot::kObjectMoney :
+				case kObjectMoney :
 					_vm->_dialogs->displayText("You can't bring yourself to give away your moneybag.");
 					break;
-				case Avalot::kObjectBodkin:
-				case Avalot::kObjectBell:
-				case Avalot::kObjectClothes:
-				case Avalot::kObjectHabit :
+				case kObjectBodkin:
+				case kObjectBell:
+				case kObjectClothes:
+				case kObjectHabit :
 					_vm->_dialogs->displayText("Don't give it away, it might be useful!");
 					break;
 				default:
 					switch (_person) {
-					case Avalot::kPeopleCrapulus:
-						if (_thing == Avalot::kObjectWine) {
+					case kPeopleCrapulus:
+						if (_thing == kObjectWine) {
 							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_avalot->_objects[Avalot::kObjectWine - 1] = false;
+							_vm->_avalot->_objects[kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
-					case Avalot::kPeopleCwytalot:
-						if ((_thing == Avalot::kObjectCrossbow) || (_thing == Avalot::kObjectBolt))
+					case kPeopleCwytalot:
+						if ((_thing == kObjectCrossbow) || (_thing == kObjectBolt))
 							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
 							heyThanks();
 						break;
-					case Avalot::kPeopleSpludwick:
+					case kPeopleSpludwick:
 						if (giveToSpludwick())
 							heyThanks();
 						break;
-					case Avalot::kPeopleIbythneth:
-						if (_thing == Avalot::kObjectBadge) {
+					case kPeopleIbythneth:
+						if (_thing == kObjectBadge) {
 							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
 							_vm->_avalot->incScore(3);
-							_vm->_avalot->_objects[Avalot::kObjectBadge - 1] = false;
-							_vm->_avalot->_objects[Avalot::kObjectHabit - 1] = true;
+							_vm->_avalot->_objects[kObjectBadge - 1] = false;
+							_vm->_avalot->_objects[kObjectHabit - 1] = true;
 							_vm->_avalot->_givenBadgeToIby = true;
 							_vm->_background->drawBackgroundSprite(-1, -1, 7);
 							_vm->_background->drawBackgroundSprite(-1, -1, 8);
 						} else
 							heyThanks();
 						break;
-					case Avalot::kPeopleAyles:
+					case kPeopleAyles:
 						if (_vm->_avalot->_aylesIsAwake) {
-							if (_thing == Avalot::kObjectPen) {
-								_vm->_avalot->_objects[Avalot::kObjectPen - 1] = false;
+							if (_thing == kObjectPen) {
+								_vm->_avalot->_objects[kObjectPen - 1] = false;
 								_vm->_dialogs->displayScrollChain('q', 54);
-								_vm->_avalot->_objects[Avalot::kObjectInk - 1] = true;
+								_vm->_avalot->_objects[kObjectInk - 1] = true;
 								_vm->_avalot->_givenPenToAyles = true;
 								_vm->_avalot->refreshObjectList();
 								_vm->_avalot->incScore(2);
@@ -1740,25 +1740,25 @@ void Parser::doThat() {
 						} else
 							_vm->_dialogs->displayText("But he's asleep!");
 						break;
-					case Avalot::kPeopleGeida:
+					case kPeopleGeida:
 						switch (_thing) {
-						case Avalot::kObjectPotion:
-							_vm->_avalot->_objects[Avalot::kObjectPotion - 1] = false;
+						case kObjectPotion:
+							_vm->_avalot->_objects[kObjectPotion - 1] = false;
 							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
 							_vm->_avalot->incScore(2);
 							_vm->_avalot->_givenPotionToGeida = true;
 							_vm->_avalot->refreshObjectList();
 							break;
-						case Avalot::kObjectLute:
+						case kObjectLute:
 							giveGeidaTheLute();
 							break;
 						default:
 							heyThanks();
 						}
 						break;
-					case Avalot::kPeopleArkata:
+					case kPeopleArkata:
 						switch (_thing) {
-						case Avalot::kObjectPotion:
+						case kObjectPotion:
 							if (_vm->_avalot->_givenPotionToGeida)
 								winSequence();
 							else
@@ -1839,12 +1839,12 @@ void Parser::doThat() {
 	case kVerbCodeWear:
 		if (isHolding()) { // Wear something.
 			switch (_thing) {
-			case Avalot::kObjectChastity:
+			case kObjectChastity:
 				// \? are used to avoid that ??! is parsed as a trigraph
 				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
 				break;
-			case Avalot::kObjectClothes:
-			case Avalot::kObjectHabit: { // Change this!
+			case kObjectClothes:
+			case kObjectHabit: { // Change this!
 				if (_wearing != kNothing) {
 					if (_wearing == _thing)
 						_vm->_dialogs->displayText("You're already wearing that.");
@@ -1857,7 +1857,7 @@ void Parser::doThat() {
 				_vm->_avalot->refreshObjectList();
 
 				byte i;
-				if (_thing == Avalot::kObjectHabit)
+				if (_thing == kObjectHabit)
 					i = 3;
 				else
 					i = 0;
@@ -1901,7 +1901,7 @@ void Parser::doThat() {
 
 				// You won - strange!
 				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
-				_vm->_avalot->_objects[Avalot::kObjectLute - 1] = true;
+				_vm->_avalot->_objects[kObjectLute - 1] = true;
 				_vm->_avalot->refreshObjectList();
 				_vm->_avalot->_wonNim = true;
 				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
@@ -1920,13 +1920,13 @@ void Parser::doThat() {
 			}
 		} else if (isHolding()) {
 			switch (_thing) {
-			case Avalot::kObjectLute :
+			case kObjectLute :
 					_vm->_dialogs->displayScrollChain('U', 7);
 
-					if (_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] == _vm->_avalot->_room)
+					if (_vm->_avalot->_whereIs[kPeopleCwytalot - 150] == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 10);
 
-					if (_vm->_avalot->_whereIs[Avalot::kPeopleDuLustie - 150] == _vm->_avalot->_room)
+					if (_vm->_avalot->_whereIs[kPeopleDuLustie - 150] == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 15);
 				break;
 			case 52:
@@ -1949,7 +1949,7 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeRing:
 		if (isHolding()) {
-			if (_thing == Avalot::kObjectBell) {
+			if (_thing == kObjectBell) {
 				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
@@ -2076,8 +2076,8 @@ void Parser::doThat() {
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
-				case Avalot::kObjectWine:
-					if (_vm->_avalot->_objects[Avalot::kObjectWine - 1])  // We've already got the wine!
+				case kObjectWine:
+					if (_vm->_avalot->_objects[kObjectWine - 1])  // We've already got the wine!
 						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
 						if (_vm->_avalot->_malagauche == 177) { // Already getting us one.
@@ -2108,8 +2108,8 @@ void Parser::doThat() {
 
 		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(5)) {
-				if (_thing == Avalot::kObjectOnion) {
-					if (_vm->_avalot->_objects[Avalot::kObjectOnion - 1])
+				if (_thing == kObjectOnion) {
+					if (_vm->_avalot->_objects[kObjectOnion - 1])
 						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
 					else if (_vm->_avalot->_carryNum >= kCarryLimit)
 						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
@@ -2121,7 +2121,7 @@ void Parser::doThat() {
 							_vm->_avalot->incScore(3);
 						}
 						_vm->_avalot->decreaseMoney(3); // It costs thruppence.
-						_vm->_avalot->_objects[Avalot::kObjectOnion - 1] = true;
+						_vm->_avalot->_objects[kObjectOnion - 1] = true;
 						_vm->_avalot->refreshObjectList();
 						_boughtOnion = true;
 						_vm->_avalot->_rottenOnion = false; // It's OK when it leaves the stall!
@@ -2142,9 +2142,9 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeAttack:
 		if ((_vm->_avalot->_room == kRoomBrummieRoad) &&
-			((_person == Avalot::kPeopleCwytalot) || (_thing == Avalot::kObjectCrossbow) || (_thing == Avalot::kObjectBolt)) &&
-			(_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] == _vm->_avalot->_room)) {
-			switch (_vm->_avalot->_objects[Avalot::kObjectBolt - 1] + _vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] * 2) {
+			((_person == kPeopleCwytalot) || (_thing == kObjectCrossbow) || (_thing == kObjectBolt)) &&
+			(_vm->_avalot->_whereIs[kPeopleCwytalot - 150] == _vm->_avalot->_room)) {
+			switch (_vm->_avalot->_objects[kObjectBolt - 1] + _vm->_avalot->_objects[kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_dialogs->displayScrollChain('Q', 10);
@@ -2159,15 +2159,15 @@ void Parser::doThat() {
 			case 3:
 				_vm->_dialogs->displayScrollChain('Q', 11);
 				_vm->_avalot->_cwytalotGone = true;
-				_vm->_avalot->_objects[Avalot::kObjectBolt - 1] = false;
-				_vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] = false;
+				_vm->_avalot->_objects[kObjectBolt - 1] = false;
+				_vm->_avalot->_objects[kObjectCrossbow - 1] = false;
 				_vm->_avalot->refreshObjectList();
 				_vm->_avalot->_magics[11]._operation = Avalot::kMagicNothing;
 				_vm->_avalot->incScore(7);
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_avalot->_whereIs[Avalot::kPeopleCwytalot - 150] = kRoomDummy;
+				_vm->_avalot->_whereIs[kPeopleCwytalot - 150] = kRoomDummy;
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
@@ -2225,19 +2225,19 @@ void Parser::doThat() {
 			_vm->_dialogs->displayText("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
-			case Avalot::kPeopleArkata:
+			case kPeopleArkata:
 				_vm->_dialogs->displayScrollChain('U', 12);
 				break;
-			case Avalot::kPeopleGeida:
+			case kPeopleGeida:
 				_vm->_dialogs->displayScrollChain('U', 13);
 				break;
-			case Avalot::kPeopleWisewoman:
+			case kPeopleWisewoman:
 				_vm->_dialogs->displayScrollChain('U', 14);
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
 			}
-		} else if ((Avalot::kPeopleAvalot <= _person) && (_person < Avalot::kPeopleArkata))
+		} else if ((kPeopleAvalot <= _person) && (_person < kPeopleArkata))
 			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
 
 		break;
@@ -2259,7 +2259,7 @@ void Parser::doThat() {
 		if (isPersonHere())
 			switch (_person) {
 			case kPardon:
-			case Avalot::kPeopleAvalot:
+			case kPeopleAvalot:
 			case 0:
 				if (!_vm->_avalot->_avvyIsAwake) {
 					_vm->_avalot->_avvyIsAwake = true;
@@ -2271,11 +2271,11 @@ void Parser::doThat() {
 				} else
 					_vm->_dialogs->displayText("You're already awake, Avvy!");
 				break;
-			case Avalot::kPeopleAyles:
+			case kPeopleAyles:
 				if (!_vm->_avalot->_aylesIsAwake)
 					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
 				break;
-			case Avalot::kPeopleJacques: {
+			case kPeopleJacques: {
 				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
 					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 				_vm->_dialogs->displayText(tmpStr);
@@ -2362,9 +2362,20 @@ void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
 	}
 }
 
+void Parser::resetVariables() {
+	_wearing = 0;
+	_sworeNum = 0;
+	_alcoholLevel = 0;
+	_playedNim = 0;
+	_boughtOnion = false;
+}
+
 void Parser::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_wearing);
 	sz.syncAsByte(_sworeNum);
+	sz.syncAsByte(_alcoholLevel);
+	sz.syncAsByte(_playedNim);
+	sz.syncAsByte(_boughtOnion);
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 8f49a48..30b5929 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -81,10 +81,6 @@ public:
 	bool _cursorState;
 
 	byte _wearing; // what you're wearing
-	byte _sworeNum; // number of times you've sworn
-	byte _alcoholLevel; // Your blood alcohol level.
-	byte _playedNim; // How many times you've played Nim.
-	bool _boughtOnion; // Have you bought an onion yet?
 
 	Parser(AvalancheEngine *vm);
 
@@ -104,6 +100,7 @@ public:
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
 	int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
 
+	void resetVariables();
 	void synchronize(Common::Serializer &sz);
 
 private:
@@ -116,6 +113,10 @@ private:
 
 	Common::String _thats;
 	byte _thing2;
+	byte _sworeNum; // number of times you've sworn
+	byte _alcoholLevel; // Your blood alcohol level.
+	byte _playedNim; // How many times you've played Nim.
+	bool _boughtOnion; // Have you bought an onion yet?
 
 	byte wordNum(Common::String word);
 	void replace(Common::String oldChars, byte newChar);
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 1fc69a2..ae9481c 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -324,7 +324,7 @@ void Timer::hangAround() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
-	_vm->_avalot->_whereIs[Avalot::kPeopleRobinHood - 150] = kRoomRobins;
+	_vm->_avalot->_whereIs[kPeopleRobinHood - 150] = kRoomRobins;
 	_vm->_animation->appearPed(0, 1);
 	_vm->_dialogs->displayScrollChain('q', 39);
 	avvy->walkTo(6);
@@ -336,7 +336,7 @@ void Timer::hangAround2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
-	_vm->_avalot->_whereIs[Avalot::kPeopleFriarTuck - 150] = kRoomRobins;
+	_vm->_avalot->_whereIs[kPeopleFriarTuck - 150] = kRoomRobins;
 	_vm->_dialogs->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -356,7 +356,7 @@ void Timer::afterTheShootemup() {
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);
 	_vm->_avalot->_userMovesAvvy = true;
-	_vm->_avalot->_objects[Avalot::kObjectCrossbow - 1] = true;
+	_vm->_avalot->_objects[kObjectCrossbow - 1] = true;
 	_vm->_avalot->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
@@ -400,7 +400,7 @@ void Timer::jacquesWakesUp() {
 	case 3 :  // Gone through the door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
 		_vm->_background->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
-		_vm->_avalot->_whereIs[Avalot::kPeopleJacques - 150] = 0; // Gone!
+		_vm->_avalot->_whereIs[kPeopleJacques - 150] = 0; // Gone!
 		break;
 	}
 
@@ -489,7 +489,7 @@ void Timer::jump() {
 		else {
 			_vm->_background->drawBackgroundSprite(-1, -1, 1);
 			_vm->_avalot->_arrowInTheDoor = false; // You've got it.
-			_vm->_avalot->_objects[Avalot::kObjectBolt - 1] = true;
+			_vm->_avalot->_objects[kObjectBolt - 1] = true;
 			_vm->_avalot->refreshObjectList();
 			_vm->_dialogs->displayScrollChain('q', 50);
 			_vm->_avalot->incScore(3);
@@ -522,7 +522,7 @@ void Timer::buyWine() {
 	_vm->_dialogs->displayScrollChain('D', 1); // It'll be thruppence.
 	if (_vm->_avalot->decreaseMoney(3)) {
 		_vm->_dialogs->displayScrollChain('D', 4); // You paid up.
-		_vm->_avalot->_objects[Avalot::kObjectWine - 1] = true;
+		_vm->_avalot->_objects[kObjectWine - 1] = true;
 		_vm->_avalot->refreshObjectList();
 		_vm->_avalot->_wineState = 1; // OK Wine.
 	}


Commit: 0b7de38dc1969fa2cee4337d0071b97071cceaae
    https://github.com/scummvm/scummvm/commit/0b7de38dc1969fa2cee4337d0071b97071cceaae
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-23T23:15:28-07:00

Commit Message:
AVALANCHE: Use Room enum instead of byte in misc place

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 1172b1c..92ebb4b 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -210,7 +210,7 @@ void AnimationType::walk() {
 				bounce();
 				break;
 			case Avalot::kMagicTransport:
-				_anim->flipRoom(magic->_data >> 8, magic->_data & 0xff);
+				_anim->_vm->_avalot->flipRoom((Room)(magic->_data >> 8), magic->_data & 0xff);
 				break;
 			case Avalot::kMagicUnfinished: {
 				bounce();
@@ -222,7 +222,7 @@ void AnimationType::walk() {
 				_anim->callSpecial(magic->_data);
 				break;
 			case Avalot::kMagicOpenDoor:
-				_anim->openDoor(magic->_data >> 8, magic->_data & 0xff, magicColor);
+				_anim->_vm->_avalot->openDoor((Room)(magic->_data >> 8), magic->_data & 0xff, magicColor);
 				break;
 			}
 		}
@@ -418,20 +418,20 @@ void Animation::catacombMove(byte ped) {
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
-		flipRoom(kRoomLustiesRoom, 4);
+		_vm->_avalot->flipRoom(kRoomLustiesRoom, 4);
 		_vm->_dialogs->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033:{ // Oubliette
-		flipRoom(kRoomOubliette, 1);
+		_vm->_avalot->flipRoom(kRoomOubliette, 1);
 		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		return;
 	case 4:
-		flipRoom(kRoomGeidas, 1);
+		_vm->_avalot->flipRoom(kRoomGeidas, 1);
 		return;
 	case 2307:
-		flipRoom(kRoomLusties, 5);
+		_vm->_avalot->flipRoom(kRoomLusties, 5);
 		_vm->_dialogs->displayText("Oh no... here we go again...");
 		_vm->_avalot->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
@@ -771,7 +771,7 @@ void Animation::callSpecial(uint16 which) {
 			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_avalot->_whereIs[kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then.
+			_vm->_avalot->setRoom(kPeopleFriarTuck, kRoomDummy); // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
@@ -867,67 +867,6 @@ void Animation::callSpecial(uint16 which) {
 	}
 }
 
-/**
- * Open the Door.
- * This slides the door open. The data really ought to be saved in
- * the Also file, and will be next time. However, for now, they're
- * here.
- * @remarks	Originally called 'open_the_door'
- */
-void Animation::openDoor(byte whither, byte ped, byte magicnum) {
-	switch (_vm->_avalot->_room) {
-	case kRoomOutsideYours:
-	case kRoomOutsideNottsPub:
-	case kRoomOutsideDucks:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(2);
-		_vm->_sequence->thenShow(3);
-		break;
-	case kRoomInsideCardiffCastle:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(5);
-		break;
-	case kRoomAvvysGarden:
-	case kRoomEntranceHall:
-	case kRoomInsideAbbey:
-	case kRoomYourHall:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(2);
-		break;
-	case kRoomMusicRoom:
-	case kRoomOutsideArgentPub:
-		_vm->_sequence->firstShow(5);
-		_vm->_sequence->thenShow(6);
-		break;
-	case kRoomLusties:
-		switch (magicnum) {
-		case 14:
-			if (_vm->_avalot->_avvysInTheCupboard) {
-				hideInCupboard();
-				_vm->_sequence->firstShow(8);
-				_vm->_sequence->thenShow(7);
-				_vm->_sequence->startToClose();
-				return;
-			} else {
-				appearPed(0, 5);
-				_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
-				_vm->_sequence->firstShow(8);
-				_vm->_sequence->thenShow(9);
-			}
-			break;
-		case 12:
-			_vm->_sequence->firstShow(4);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(6);
-			break;
-		}
-		break;
-	}
-
-	_vm->_sequence->thenFlip(whither, ped);
-	_vm->_sequence->startToOpen();
-}
-
 void Animation::updateSpeed() {
 	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.
 
@@ -1254,47 +1193,6 @@ void Animation::hideInCupboard() {
 	}
 }
 
-void Animation::flipRoom(byte room, byte ped) {
-	assert((ped > 0) && (ped < 15));
-	if (!_vm->_avalot->_alive) {
-		// You can't leave the room if you're dead.
-		_sprites[0]._moveX = 0;
-		_sprites[0]._moveY = 0; // Stop him from moving.
-		return;
-	}
-
-	if ((room == kRoomDummy) && (_vm->_avalot->_room == kRoomLusties)) {
-		hideInCupboard();
-		return;
-	}
-
-	if ((_vm->_avalot->_jumpStatus > 0) && (_vm->_avalot->_room == kRoomInsideCardiffCastle)) {
-		// You can't *jump* out of Cardiff Castle!
-		_sprites[0]._moveX = 0;
-		return;
-	}
-
-	_vm->_avalot->exitRoom(_vm->_avalot->_room);
-	_vm->_avalot->dusk();
-
-	for (int16 i = 1; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]._quick)
-			_sprites[i].remove();
-	} // Deallocate sprite
-
-	if (_vm->_avalot->_room == kRoomLustiesRoom)
-		_vm->_avalot->_enterCatacombsFromLustiesRoom = true;
-
-	_vm->_avalot->enterRoom(room, ped);
-	appearPed(0, ped - 1);
-	_vm->_avalot->_enterCatacombsFromLustiesRoom = false;
-	_oldDirection = _direction;
-	_direction = _sprites[0]._facingDir;
-	_vm->_avalot->drawDirection();
-
-	_vm->_avalot->dawn();
-}
-
 bool Animation::inField(byte which) {
 	FieldType *curField = &_vm->_avalot->_fields[which];
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index a411de7..4710981 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -121,16 +121,15 @@ public:
 	void animLink();
 	void loadAnims(); // Original: loadtrip().
 	void callSpecial(uint16 which);
-	void openDoor(byte whither, byte ped, byte magicnum); // Handles slidey-open doors.
 	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
 	void stopWalking();
 	void setMoveSpeed(byte t, Direction dir);
 	void appearPed(byte sprNum, byte pedNum);
-	void flipRoom(byte room, byte ped);
 	bool inField(byte which); // Returns true if you're within field "which".
 	bool nearDoor(); // Returns True if you're near a door.
 	void updateSpeed();
 	void handleMoveKey(const Common::Event &event); // To replace tripkey().
+	void hideInCupboard();
 
 	void setDirection(Direction dir);
 	void setOldDirection(Direction dir);
@@ -150,7 +149,6 @@ private:
 
 	void grabAvvy(byte tripnum);
 	void arrowProcs(byte tripnum);
-	void hideInCupboard();
 
 	// Different movements for NPCs:
 	void followAvalotY(byte tripnum); // Original: follow_avvy_y().
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index b0db964..4e92901 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -419,7 +419,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_background->forgetBackgroundSprites();
 	_avalot->minorRedraw();
 	_menu->setup();
-	_avalot->_whereIs[kPeopleAvalot - 150] = _avalot->_room;
+	_avalot->setRoom(kPeopleAvalot, _avalot->_room);
 	_avalot->_alive = true;
 	_avalot->refreshObjectList();
 	_animation->updateSpeed();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index afee722..747604d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -143,7 +143,7 @@ const TuneType Avalot::kTune = {
 	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
 };
 
-byte Avalot::_whereIs[29] = {
+Room Avalot::_whereIs[29] = {
 	// The Lads
 	kRoomYours, // Avvy
 	kRoomSpludwicks, // Spludwick
@@ -162,7 +162,14 @@ byte Avalot::_whereIs[29] = {
 	kRoomNottsPub, // Port
 	kRoomNottsPub, // Spurge
 	kRoomMusicRoom, // Jacques
-	0, 0, 0, 0, 0, 0, 0, 0,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
+	kRoomNowhere,
 	// The Lasses
 	kRoomYours, // Arkata
 	kRoomGeidas, // Geida
@@ -747,23 +754,23 @@ void Avalot::putGeidaAt(byte whichPed, byte ped) {
 	spr1->_eachStepProc = Animation::kProcGeida;
 }
 
-void Avalot::enterRoom(byte room, byte ped) {
+void Avalot::enterRoom(Room roomId, byte ped) {
 	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
-	findPeople(room);
-	_room = room;
+	findPeople(roomId);
+	_room = roomId;
 	if (ped != 0)
-		_roomCount[room]++;
+		_roomCount[roomId]++;
 
-	loadRoom(room);
+	loadRoom(roomId);
 
-	if ((_roomCount[room] == 0) && (!setFlag('S')))
+	if ((_roomCount[roomId] == 0) && (!setFlag('S')))
 		incScore(1);
 
 	_whereIs[kPeopleAvalot - 150] = _room;
 
 	if (_geidaFollows)
-		_whereIs[kPeopleGeida - 150] = room;
+		_whereIs[kPeopleGeida - 150] = roomId;
 
 	_roomTime = 0;
 
@@ -771,7 +778,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 	if ((_lastRoom == kRoomMap) && (_lastRoomNotMap != _room))
 		enterNewTown();
 
-	switch (room) {
+	switch (roomId) {
 	case kRoomYours:
 		if (_avvyInBed) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 2);
@@ -891,8 +898,8 @@ void Avalot::enterRoom(byte room, byte ped) {
 		}
 
 		if (_beenTiedUp) {
-			_whereIs[kPeopleRobinHood - 150] = 0;
-			_whereIs[kPeopleFriarTuck - 150] = 0;
+			_whereIs[kPeopleRobinHood - 150] = kRoomNowhere;
+			_whereIs[kPeopleFriarTuck - 150] = kRoomNowhere;
 		}
 
 		if (_tiedUp)
@@ -1004,7 +1011,7 @@ void Avalot::enterRoom(byte room, byte ped) {
 			_vm->_graphics->refreshBackground();
 			_vm->_background->drawBackgroundSprite(-1, -1, 3);
 			_magics[kColorBrown - 1]._operation = Avalot::kMagicNothing;
-			_whereIs[kPeopleJacques - 150] = 0;
+			_whereIs[kPeopleJacques - 150] = kRoomNowhere;
 		}
 		if (ped != 0) {
 			_vm->_background->drawBackgroundSprite(-1, -1, 5);
@@ -1647,7 +1654,7 @@ void Avalot::resetVariables() {
 	_nextBell = 0;
 	_givenPotionToGeida = false;
 	_lustieIsAsleep = false;
-	_flipToWhere = 0;
+	_flipToWhere = kRoomNowhere;
 	_flipToPed = 0;
 	_beenTiedUp = false;
 	_sittingInPub = false;
@@ -1705,7 +1712,7 @@ void Avalot::newGame() {
 	_avvyInBed = true;
 	_enidFilename = "";
 
-	enterRoom(1, 1);
+	enterRoom(kRoomYours, 1);
 	avvy->_visible = false;
 	drawScore();
 	_vm->_menu->setup();
@@ -1939,4 +1946,114 @@ void Avalot::hangAroundForAWhile() {
 	for (int i = 0; i < 28; i++)
 		slowDown();
 }
+
+void Avalot::flipRoom(Room room, byte ped) {
+	assert((ped > 0) && (ped < 15));
+	if (!_alive) {
+		// You can't leave the room if you're dead.
+		_vm->_animation->_sprites[0]._moveX = 0;
+		_vm->_animation->_sprites[0]._moveY = 0; // Stop him from moving.
+		return;
+	}
+
+	if ((room == kRoomDummy) && (_room == kRoomLusties)) {
+		_vm->_animation->hideInCupboard();
+		return;
+	}
+
+	if ((_jumpStatus > 0) && (_room == kRoomInsideCardiffCastle)) {
+		// You can't *jump* out of Cardiff Castle!
+		_vm->_animation->_sprites[0]._moveX = 0;
+		return;
+	}
+
+	exitRoom(_room);
+	dusk();
+
+	for (int16 i = 1; i < _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._quick)
+			_vm->_animation->_sprites[i].remove();
+	} // Deallocate sprite
+
+	if (_room == kRoomLustiesRoom)
+		_enterCatacombsFromLustiesRoom = true;
+
+	enterRoom(room, ped);
+	_vm->_animation->appearPed(0, ped - 1);
+	_enterCatacombsFromLustiesRoom = false;
+	_vm->_animation->setOldDirection(_vm->_animation->getDirection());
+	_vm->_animation->setDirection(_vm->_animation->_sprites[0]._facingDir);
+	drawDirection();
+
+	dawn();
+}
+
+/**
+ * Open the Door.
+ * This slides the door open. The data really ought to be saved in
+ * the Also file, and will be next time. However, for now, they're
+ * here.
+ * @remarks	Originally called 'open_the_door'
+ */
+void Avalot::openDoor(Room whither, byte ped, byte magicnum) {
+	switch (_room) {
+	case kRoomOutsideYours:
+	case kRoomOutsideNottsPub:
+	case kRoomOutsideDucks:
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(2);
+		_vm->_sequence->thenShow(3);
+		break;
+	case kRoomInsideCardiffCastle:
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(5);
+		break;
+	case kRoomAvvysGarden:
+	case kRoomEntranceHall:
+	case kRoomInsideAbbey:
+	case kRoomYourHall:
+		_vm->_sequence->firstShow(1);
+		_vm->_sequence->thenShow(2);
+		break;
+	case kRoomMusicRoom:
+	case kRoomOutsideArgentPub:
+		_vm->_sequence->firstShow(5);
+		_vm->_sequence->thenShow(6);
+		break;
+	case kRoomLusties:
+		switch (magicnum) {
+		case 14:
+			if (_avvysInTheCupboard) {
+				_vm->_animation->hideInCupboard();
+				_vm->_sequence->firstShow(8);
+				_vm->_sequence->thenShow(7);
+				_vm->_sequence->startToClose();
+				return;
+			} else {
+				_vm->_animation->appearPed(0, 5);
+				_vm->_animation->_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
+				_vm->_sequence->firstShow(8);
+				_vm->_sequence->thenShow(9);
+			}
+			break;
+		case 12:
+			_vm->_sequence->firstShow(4);
+			_vm->_sequence->thenShow(5);
+			_vm->_sequence->thenShow(6);
+			break;
+		}
+		break;
+	}
+
+	_vm->_sequence->thenFlip(whither, ped);
+	_vm->_sequence->startToOpen();
+}
+
+void Avalot::setRoom(byte persId, Room roomId) {
+	_whereIs[persId - 150] = roomId;	
+}
+
+Room Avalot::getRoom(byte persId) {
+	return _whereIs[persId - 150];	
+}
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 89f67b8..92cc456 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -240,14 +240,13 @@ public:
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 	byte _interrogation;
-	static byte _whereIs[29];
 
 	// Former DNA structure
 	byte _carryNum; // How many objects you're carrying...
 	bool _objects[kObjectNum]; // ...and which ones they are.
 	int16 _dnascore; // your score, of course
 	int32 _money; // your current amount of dosh
-	byte _room; // your current room
+	Room _room; // your current room
 	byte _roomCount[100]; // Add one to each every time you enter a room
 	bool _wonNim; // Have you *won* Nim? (That's harder.)
 	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
@@ -297,7 +296,8 @@ public:
 	byte _nextBell; // For the ringing.
 	bool _givenPotionToGeida; // Does Geida have the potion?
 	bool _lustieIsAsleep; // Is BDL asleep?
-	byte _flipToWhere, _flipToPed; // For the sequencer.
+	Room _flipToWhere;
+	byte _flipToPed; // For the sequencer.
 	bool _beenTiedUp; // In r__Robins.
 	bool _sittingInPub; // Are you sitting down in the pub?
 	byte _spurgeTalkCount; // Count for talking to Spurge.
@@ -364,7 +364,7 @@ public:
 	void drawAlsoLines();
 	void loadRoom(byte num);
 	void exitRoom(byte x);
-	void enterRoom(byte room, byte ped);
+	void enterRoom(Room room, byte ped);
 	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
 	void loadDigits(); // Load the scoring digits & rwlites
 	void drawToolbar();
@@ -411,9 +411,16 @@ public:
 	Common::String getItem(byte which); // Called get_better in the original.
 	Common::String f5Does(); // This procedure determines what f5 does.
 
+	void openDoor(Room whither, byte ped, byte magicnum); // Handles slidey-open doors.
+	void flipRoom(Room room, byte ped);
+
+	void setRoom(byte persId, Room roomId);
+	Room getRoom(byte persId);
 private:
 	AvalancheEngine *_vm;
 
+	static Room _whereIs[29];
+
 	Common::File file;
 	Common::String readAlsoStringFromFile();
 	void scram(Common::String &str);
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 37f8fc1..e9d89c2 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1071,7 +1071,7 @@ void Dialogs::talkTo(byte whom) {
 		_vm->_avalot->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
 		_vm->_avalot->_talkedToCrapulus = true;
-		_vm->_avalot->_whereIs[kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off.
+		_vm->_avalot->setRoom(kPeopleCrapulus, kRoomDummy); // Crapulus walks off.
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index fab349e..6af0e79 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -452,7 +452,7 @@ void Menu::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (int i = 150; i <= 178; i++) {
-		if (_vm->_avalot->_whereIs[i - 150] == _vm->_avalot->_room) {
+		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) {
 			_activeMenuItem.setupOption(_vm->_avalot->getName(i), _vm->_avalot->getNameChar(i), "", true);
 			people += i;
 		}
@@ -488,7 +488,7 @@ void Menu::setupMenuWith() {
 		// or (c), the _person you've selected is YOU!
 
 		if ((_vm->_avalot->_lastPerson == kPeopleAvalot) || (_vm->_avalot->_lastPerson == _vm->_parser->kNothing)
-			|| (_vm->_avalot->_whereIs[_vm->_avalot->_lastPerson - 150] != _vm->_avalot->_room))
+			|| (_vm->_avalot->getRoom(_vm->_avalot->_lastPerson) != _vm->_avalot->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_avalot->getName(_vm->_avalot->_lastPerson), 'G', "", true);
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 94d3d24..8e60a56 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -929,7 +929,7 @@ void Parser::examineObject() {
 }
 
 bool Parser::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_avalot->_whereIs[_person - 150] == _vm->_avalot->_room))
+	if ((_person == kPardon) || (_person == 0) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room))
 		return true;
 	else {
 		Common::String tmpStr;
@@ -1107,8 +1107,8 @@ void Parser::swallow() { // Eat something.
 void Parser::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
-	for (int i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_avalot->_whereIs[i] == _vm->_avalot->_room)
+	for (int i = 151; i < 179; i++) { // Start at 1 so we don't list Avvy himself!
+		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room)
 			numPeople++;
 	}
 
@@ -1117,8 +1117,8 @@ void Parser::peopleInRoom() {
 
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
-	for (int i = 1; i < 29; i++) {
-		if (_vm->_avalot->_whereIs[i] == _vm->_avalot->_room) {
+	for (int i = 151; i < 179; i++) {
+		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
 				tmpStr = _vm->_avalot->getName(i + 150);
@@ -1210,7 +1210,7 @@ void Parser::openDoor() {
 				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
 			case Avalot::kMagicTransport:
-				_vm->_animation->flipRoom((portal->_data) >> 8, portal->_data & 0x0F);
+				_vm->_avalot->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
 				break;
 			case Avalot::kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
@@ -1220,7 +1220,7 @@ void Parser::openDoor() {
 				_vm->_animation->callSpecial(portal->_data);
 				break;
 			case Avalot::kMagicOpenDoor:
-				_vm->_animation->openDoor(portal->_data >> 8, portal->_data & 0x0F, i + 9);
+				_vm->_avalot->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9);
 				break;
 			}
 
@@ -1391,7 +1391,7 @@ void Parser::drink() {
 		_vm->_avalot->refreshObjectList();
 		_vm->_avalot->dusk();
 		_vm->_avalot->hangAroundForAWhile();
-		_vm->_animation->flipRoom(1, 1);
+		_vm->_avalot->flipRoom(kRoomYours, 1);
 		_vm->_avalot->setBackgroundColor(14);
 		_vm->_animation->_sprites[0]._visible = false;
 	}
@@ -1552,13 +1552,13 @@ void Parser::winSequence() {
 
 Common::String Parser::personSpeaks() {
 	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_avalot->_him == kPardon) || (_vm->_avalot->_whereIs[_vm->_avalot->_him - 150] != _vm->_avalot->_room))
+		if ((_vm->_avalot->_him == kPardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room))
 			_person = _vm->_avalot->_her;
 		else
 			_person = _vm->_avalot->_him;
 	}
 
-	if (_vm->_avalot->_whereIs[_person - 150] != _vm->_avalot->_room) {
+	if (_vm->_avalot->getRoom(_person) != _vm->_avalot->_room) {
 		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
 	}
 
@@ -1923,10 +1923,10 @@ void Parser::doThat() {
 			case kObjectLute :
 					_vm->_dialogs->displayScrollChain('U', 7);
 
-					if (_vm->_avalot->_whereIs[kPeopleCwytalot - 150] == _vm->_avalot->_room)
+					if (_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 10);
 
-					if (_vm->_avalot->_whereIs[kPeopleDuLustie - 150] == _vm->_avalot->_room)
+					if (_vm->_avalot->getRoom(kPeopleDuLustie) == _vm->_avalot->_room)
 						_vm->_dialogs->displayScrollChain('U', 15);
 				break;
 			case 52:
@@ -1993,7 +1993,7 @@ void Parser::doThat() {
 		else {
 			if ((_vm->_avalot->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
 				_vm->_dialogs->displayScrollChain('q', 17);
-				if (_vm->_avalot->_whereIs[1] == kRoomSpludwicks)
+				if (_vm->_avalot->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
 					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -2143,7 +2143,7 @@ void Parser::doThat() {
 	case kVerbCodeAttack:
 		if ((_vm->_avalot->_room == kRoomBrummieRoad) &&
 			((_person == kPeopleCwytalot) || (_thing == kObjectCrossbow) || (_thing == kObjectBolt)) &&
-			(_vm->_avalot->_whereIs[kPeopleCwytalot - 150] == _vm->_avalot->_room)) {
+			(_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room)) {
 			switch (_vm->_avalot->_objects[kObjectBolt - 1] + _vm->_avalot->_objects[kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
@@ -2167,7 +2167,7 @@ void Parser::doThat() {
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_avalot->_whereIs[kPeopleCwytalot - 150] = kRoomDummy;
+				_vm->_avalot->setRoom(kPeopleCwytalot, kRoomDummy);
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 53e43b5..0d26cbb 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -57,7 +57,7 @@ void Sequence::thenShow(byte what) {
 	}
 }
 
-void Sequence::thenFlip(byte where, byte ped) {
+void Sequence::thenFlip(Room where, byte ped) {
 	thenShow(kNowFlip);
 
 	_vm->_avalot->_flipToWhere = where;
@@ -90,7 +90,7 @@ void Sequence::callSequencer() {
 		break;
 	case 177: // Flip room.
 		_vm->_avalot->_userMovesAvvy = true;
-		_vm->_animation->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
+		_vm->_avalot->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
 		if (curSeq == 177)
 			shoveLeft();
 		break;
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index c1461c6..a160b58 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -46,7 +46,7 @@ public:
 
 	void firstShow(byte what);
 	void thenShow(byte what);
-	void thenFlip(byte where, byte ped);
+	void thenFlip(Room where, byte ped);
 	void startToClose();
 	void startToOpen();
 	void callSequencer();
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index ae9481c..425feea 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -324,7 +324,7 @@ void Timer::hangAround() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
-	_vm->_avalot->_whereIs[kPeopleRobinHood - 150] = kRoomRobins;
+	_vm->_avalot->setRoom(kPeopleRobinHood, kRoomRobins);
 	_vm->_animation->appearPed(0, 1);
 	_vm->_dialogs->displayScrollChain('q', 39);
 	avvy->walkTo(6);
@@ -336,7 +336,7 @@ void Timer::hangAround2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
-	_vm->_avalot->_whereIs[kPeopleFriarTuck - 150] = kRoomRobins;
+	_vm->_avalot->setRoom(kPeopleFriarTuck, kRoomRobins);
 	_vm->_dialogs->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -351,7 +351,7 @@ void Timer::hangAround2() {
 
 void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
-	_vm->_animation->flipRoom(_vm->_avalot->_room, 1);
+	_vm->_avalot->flipRoom(_vm->_avalot->_room, 1);
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);
@@ -400,7 +400,7 @@ void Timer::jacquesWakesUp() {
 	case 3 :  // Gone through the door.
 		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
 		_vm->_background->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
-		_vm->_avalot->_whereIs[kPeopleJacques - 150] = 0; // Gone!
+		_vm->_avalot->setRoom(kPeopleJacques, kRoomNowhere); // Gone!
 		break;
 	}
 


Commit: 3ae30372bcf3bff39f8d4fd0df65536bc589ae8f
    https://github.com/scummvm/scummvm/commit/3ae30372bcf3bff39f8d4fd0df65536bc589ae8f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-24T09:25:53-07:00

Commit Message:
AVALANCHE: Repair bug regarding uninitialized direction in Avalot. Some renaming in Animation.

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 92ebb4b..5fd109a 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -123,7 +123,7 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	inf.close();
 }
 
-void AnimationType::original() {
+void AnimationType::reset() {
 	_quick = false;
 	_id = 177;
 }
@@ -362,9 +362,9 @@ Animation::~Animation() {
 	}
 }
 
-void Animation::loadAnims() {
+void Animation::resetAnims() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++)
-		_sprites[i].original();
+		_sprites[i].reset();
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 4710981..47fab38 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -74,7 +74,7 @@ public:
 	byte _eachStepProc;
 
 	void init(byte spritenum, bool doCheck, Animation *anim); // Loads & sets up the sprite.
-	void original(); // Just sets 'quick' to false.
+	void reset(); // Just sets 'quick' to false. Original name: original().
 	void draw(); // Drops sprite onto screen. Original: andexor().
 	void turn(Direction whichway); // Turns character round.
 	void appear(int16 wx, int16 wy, Direction wf); // Switches it on.
@@ -119,7 +119,7 @@ public:
 	~Animation();
 
 	void animLink();
-	void loadAnims(); // Original: loadtrip().
+	void resetAnims(); // Original: loadtrip().
 	void callSpecial(uint16 which);
 	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
 	void stopWalking();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 747604d..9abdd9c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -361,12 +361,12 @@ void Avalot::setup() {
 	_vm->_parser->_inputTextPos = 0;
 	_vm->_parser->_quote = true;
 
+	_vm->_animation->setDirection(kDirStopped);
+	_vm->_animation->resetAnims();
+
 	drawToolbar();
 	_vm->_dialogs->setReadyLight(2);
 
-	_vm->_animation->setDirection(kDirStopped);
-	_vm->_animation->loadAnims();
-
 	dawn();
 	_vm->_parser->_cursorState = false;
 	_vm->_parser->cursorOn();


Commit: b3f6ce975ff7eb50eb775ce3c5113e85e60c1434
    https://github.com/scummvm/scummvm/commit/b3f6ce975ff7eb50eb775ce3c5113e85e60c1434
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T12:24:52-07:00

Commit Message:
AVALANCHE: Use People enum as a type for several variables, modify functions accordingly

Changed paths:
  A engines/avalanche/enums.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 9abdd9c..90d2542 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -672,9 +672,9 @@ void Avalot::findPeople(byte room) {
 	for (int i = 1; i < 29; i++) {
 		if (_whereIs[i] == room) {
 			if (i < 25)
-				_him = i + 150;
+				_him = (People)(150 + i);
 			else
-				_her = i + 150;
+				_her = (People)(150 + i);
 		}
 	}
 }
@@ -1434,9 +1434,9 @@ void Avalot::checkClick() {
 				if (_thinkThing) {
 					_vm->_parser->_thing = _thinks;
 					_vm->_parser->_thing += 49;
-					_vm->_parser->_person = _vm->_parser->kPardon;
+					_vm->_parser->_person = kPeoplePardon;
 				} else {
-					_vm->_parser->_person = _thinks;
+					_vm->_parser->_person = (People) _thinks;
 					_vm->_parser->_thing = _vm->_parser->kPardon;
 				}
 				callVerb(Parser::kVerbCodeExam);
@@ -1702,10 +1702,10 @@ void Avalot::newGame() {
 	avvy->appear(300, 117, kDirRight); // Needed to initialize Avalot.
 	//for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil;
 	// fillchar(previous^,sizeof(previous^),#0); { blank out array }
-	_him = Parser::kPardon;
-	_her = Parser::kPardon;
+	_him = kPeoplePardon;
+	_her = kPeoplePardon;
 	_it = Parser::kPardon;
-	_lastPerson = Parser::kPardon; // = Pardon?
+	_lastPerson = kPeoplePardon; // = Pardon?
 	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
@@ -1743,7 +1743,7 @@ bool Avalot::decreaseMoney(uint16 howmuchby) {
 		return true;
 }
 
-Common::String Avalot::getName(byte whose) {
+Common::String Avalot::getName(People whose) {
 	static const Common::String kLads[17] = {
 		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
 		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
@@ -1752,20 +1752,20 @@ Common::String Avalot::getName(byte whose) {
 
 	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
 
-	if (whose < 175)
-		return kLads[whose - 150];
+	if (whose < kPeopleArkata)
+		return kLads[whose - kPeopleAvalot];
 	else
-		return kLasses[whose - 175];
+		return kLasses[whose - kPeopleArkata];
 }
 
-byte Avalot::getNameChar(byte whose) {
+byte Avalot::getNameChar(People whose) {
 	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
 	static const char kLassChar[] = "kG\0xB1o";
 
-	if (whose < 175)
-		return kLadChar[whose - 150];
+	if (whose < kPeopleArkata)
+		return kLadChar[whose - kPeopleAvalot];
 	else
-		return kLassChar[whose - 175];
+		return kLassChar[whose - kPeopleArkata];
 }
 
 Common::String Avalot::getThing(byte which) {
@@ -2049,11 +2049,11 @@ void Avalot::openDoor(Room whither, byte ped, byte magicnum) {
 	_vm->_sequence->startToOpen();
 }
 
-void Avalot::setRoom(byte persId, Room roomId) {
-	_whereIs[persId - 150] = roomId;	
+void Avalot::setRoom(People persId, Room roomId) {
+	_whereIs[persId - kPeopleAvalot] = roomId;	
 }
 
-Room Avalot::getRoom(byte persId) {
-	return _whereIs[persId - 150];	
+Room Avalot::getRoom(People persId) {
+	return _whereIs[persId - kPeopleAvalot];	
 }
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 92cc456..3999c19 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -63,76 +63,6 @@ private:
 	void chime();
 };
 
-enum Color {
-	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
-	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
-	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
-	kColorWhite
-};
-
-// CHECKME: kRoomBossKey is a guess
-enum Room {
-	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
-	kRoomYourHall = 5,      kRoomMusicRoom = 7,    kRoomOutsideArgentPub = 9,      kRoomArgentRoad = 10,
-	kRoomWiseWomans = 11,   kRoomSpludwicks = 12,  kRoomInsideAbbey = 13,          kRoomOutsideAbbey = 14,
-	kRoomAvvysGarden = 15,  kRoomAylesOffice = 16, kRoomArgentPub = 19,            kRoomBrummieRoad = 20,
-	kRoomBridge = 21,       kRoomLusties = 22,     kRoomLustiesRoom = 23,          kRoomWestHall = 25,
-	kRoomEastHall = 26,     kRoomOubliette = 27,   kRoomGeidas = 28,               kRoomCatacombs = 29,
-	kRoomEntranceHall = 40, kRoomRobins = 42,      kRoomOutsideNottsPub = 46,      kRoomNottsPub = 47,
-	kRoomOutsideDucks = 50, kRoomDucks = 51,       kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71,
-	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
-};
-
-// Objects you can hold:
-enum Object {
-	kObjectWine = 1,
-	kObjectMoney,
-	kObjectBodkin,
-	kObjectPotion,
-	kObjectChastity,
-	kObjectBolt,
-	kObjectCrossbow,
-	kObjectLute,
-	kObjectBadge,
-	kObjectMushroom,
-	kObjectKey,
-	kObjectBell,
-	kObjectPrescription,
-	kObjectPen,
-	kObjectInk,
-	kObjectClothes,
-	kObjectHabit,
-	kObjectOnion,
-	kObjectDummy = 177
-};
-
-// People who hang around this game.
-enum People {
-	// Boys:
-	kPeopleAvalot = 150,
-	kPeopleSpludwick = 151,
-	kPeopleCrapulus = 152,
-	kPeopleDrDuck = 153,
-	kPeopleMalagauche = 154,
-	kPeopleFriarTuck = 155,
-	kPeopleRobinHood = 156,
-	kPeopleCwytalot = 157,
-	kPeopleDuLustie = 158,
-	kPeopleDuke = 159,
-	kPeopleDogfood = 160,
-	kPeopleTrader = 161,
-	kPeopleIbythneth = 162,
-	kPeopleAyles = 163,
-	kPeoplePort = 164,
-	kPeopleSpurge = 165,
-	kPeopleJacques = 166,
-	// Girls:
-	kPeopleArkata = 175,
-	kPeopleGeida = 176,
-	kPeopleInvisible = 177,
-	kPeopleWisewoman = 178
-};
-
 static const byte kObjectNum = 18; // always preface with a #
 static const int16 kCarryLimit = 12;  // carry limit
 
@@ -169,7 +99,7 @@ typedef int8 TuneType[31];
 
 struct QuasipedType {
 	byte _whichPed, _foregroundColor, _room, _backgroundColor;
-	uint16 _who;
+	People _who;
 };
 
 #if 0
@@ -346,10 +276,11 @@ public:
 	Common::String _subject; // What you're talking to them about.
 	byte _subjectNum; // The same thing.
 	bool _keyboardClick; // Is a keyboard click noise wanted?
-	byte _him, _her, _it;
+	People _him, _her;
+	byte _it;
 	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
-	byte _lastPerson; // Last person to have been selected using the People menu.
+	People _lastPerson; // Last person to have been selected using the People menu.
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 	bool _isLoaded; // Is it a loaded gamestate?
@@ -404,8 +335,8 @@ public:
 	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
 	void hangAroundForAWhile();
 	
-	Common::String getName(byte whose);
-	byte getNameChar(byte whose);
+	Common::String getName(People whose);
+	byte getNameChar(People whose);
 	Common::String getThing(byte which);
 	char getThingChar(byte which);
 	Common::String getItem(byte which); // Called get_better in the original.
@@ -414,8 +345,8 @@ public:
 	void openDoor(Room whither, byte ped, byte magicnum); // Handles slidey-open doors.
 	void flipRoom(Room room, byte ped);
 
-	void setRoom(byte persId, Room roomId);
-	Room getRoom(byte persId);
+	void setRoom(People persId, Room roomId);
+	Room getRoom(People persId);
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index e9d89c2..68bd2c2 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -954,8 +954,8 @@ void Dialogs::speak(byte who, byte subject) {
 }
 
 void Dialogs::talkTo(byte whom) {
-	if (_vm->_parser->_person == _vm->_parser->kPardon) {
-		_vm->_parser->_person = _vm->_avalot->_subjectNum;
+	if (_vm->_parser->_person == kPeoplePardon) {
+		_vm->_parser->_person = (People)_vm->_avalot->_subjectNum;
 		_vm->_avalot->_subjectNum = 0;
 	}
 
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
new file mode 100644
index 0000000..9965091
--- /dev/null
+++ b/engines/avalanche/enums.h
@@ -0,0 +1,107 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef AVALANCHE_ENUMS_H
+#define AVALANCHE_ENUMS_H
+
+namespace Avalanche {
+enum Color {
+	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
+	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
+	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
+	kColorWhite
+};
+
+// CHECKME: kRoomBossKey is a guess
+enum Room {
+	kRoomNowhere = 0,       kRoomYours = 1,        kRoomOutsideYours = 2,          kRoomOutsideSpludwicks = 3,
+	kRoomYourHall = 5,      kRoomMusicRoom = 7,    kRoomOutsideArgentPub = 9,      kRoomArgentRoad = 10,
+	kRoomWiseWomans = 11,   kRoomSpludwicks = 12,  kRoomInsideAbbey = 13,          kRoomOutsideAbbey = 14,
+	kRoomAvvysGarden = 15,  kRoomAylesOffice = 16, kRoomArgentPub = 19,            kRoomBrummieRoad = 20,
+	kRoomBridge = 21,       kRoomLusties = 22,     kRoomLustiesRoom = 23,          kRoomWestHall = 25,
+	kRoomEastHall = 26,     kRoomOubliette = 27,   kRoomGeidas = 28,               kRoomCatacombs = 29,
+	kRoomEntranceHall = 40, kRoomRobins = 42,      kRoomOutsideNottsPub = 46,      kRoomNottsPub = 47,
+	kRoomOutsideDucks = 50, kRoomDucks = 51,       kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71,
+	kRoomBossKey = 98,      kRoomMap = 99,         kRoomDummy = 177 // Dummy room
+};
+
+// Objects you can hold:
+enum Object {
+	kObjectWine = 1,
+	kObjectMoney,
+	kObjectBodkin,
+	kObjectPotion,
+	kObjectChastity,
+	kObjectBolt,
+	kObjectCrossbow,
+	kObjectLute,
+	kObjectBadge,
+	kObjectMushroom,
+	kObjectKey,
+	kObjectBell,
+	kObjectPrescription,
+	kObjectPen,
+	kObjectInk,
+	kObjectClothes,
+	kObjectHabit,
+	kObjectOnion,
+	kObjectDummy = 177
+};
+
+// People who hang around this game.
+enum People {
+	// Boys:
+	kPeopleAvalot = 150,
+	kPeopleSpludwick = 151,
+	kPeopleCrapulus = 152,
+	kPeopleDrDuck = 153,
+	kPeopleMalagauche = 154,
+	kPeopleFriarTuck = 155,
+	kPeopleRobinHood = 156,
+	kPeopleCwytalot = 157,
+	kPeopleDuLustie = 158,
+	kPeopleDuke = 159,
+	kPeopleDogfood = 160,
+	kPeopleTrader = 161,
+	kPeopleIbythneth = 162,
+	kPeopleAyles = 163,
+	kPeoplePort = 164,
+	kPeopleSpurge = 165,
+	kPeopleJacques = 166,
+	// Girls:
+	kPeopleArkata = 175,
+	kPeopleGeida = 176,
+	kPeopleInvisible = 177,
+	kPeopleWisewoman = 178,
+	//
+	kPeoplePardon = 254,
+	kPeopleNone = 0
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 6af0e79..0686fbb 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -451,9 +451,9 @@ void Menu::setupMenuPeople() {
 
 	_activeMenuItem.reset();
 
-	for (int i = 150; i <= 178; i++) {
-		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) {
-			_activeMenuItem.setupOption(_vm->_avalot->getName(i), _vm->_avalot->getNameChar(i), "", true);
+	for (int i = kPeopleAvalot; i <= kPeopleWisewoman; i++) {
+		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) {
+			_activeMenuItem.setupOption(_vm->_avalot->getName((People)i), _vm->_avalot->getNameChar((People)i), "", true);
 			people += i;
 		}
 	}
@@ -582,7 +582,7 @@ void Menu::runMenuAction() {
 	// Get up, pause game, open door, look, inventory, walk/run.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_parser->_person = _vm->_parser->kPardon;
+		_vm->_parser->_person = kPeoplePardon;
 		_vm->_parser->_thing = _vm->_parser->kPardon;
 		f5Does = _vm->_avalot->f5Does();
 		_vm->_avalot->callVerb(f5Does[0]);
@@ -619,7 +619,7 @@ void Menu::runMenuObjects() {
 
 void Menu::runMenuPeople() {
 	_vm->_avalot->thinkAbout(people[_activeMenuItem._choiceNum], Avalot::kPerson);
-	_vm->_avalot->_lastPerson = people[_activeMenuItem._choiceNum];
+	_vm->_avalot->_lastPerson = (People)people[_activeMenuItem._choiceNum];
 }
 
 void Menu::runMenuWith() {
@@ -631,7 +631,7 @@ void Menu::runMenuWith() {
 		if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive)
 			_vm->_parser->_person = _vm->_avalot->_lastPerson;
 		else
-			_vm->_parser->_person = Parser::kPardon;
+			_vm->_parser->_person = kPeoplePardon;
 	} else {
 		switch (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
@@ -659,7 +659,7 @@ void Menu::runMenuWith() {
 			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
 			return;
 		default:
-			_vm->_parser->_person = _vm->_parser->_thing;
+			_vm->_parser->_person = (People)_vm->_parser->_thing;
 			_vm->_parser->_thing = Parser::kPardon;
 			_vm->_avalot->_subjectNum = 0;
 		}
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 8e60a56..3e31855 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -421,7 +421,7 @@ void Parser::handleReturn() {
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
 	case Common::KEYCODE_F5:
-		_person = kPardon;
+		_person = kPeoplePardon;
 		_thing = kPardon;
 		_vm->_avalot->callVerb(_vm->_avalot->f5Does()[0]);
 		break;
@@ -591,7 +591,7 @@ void Parser::displayWhat(byte target, bool animate, bool &ambiguous) {
 			_vm->_dialogs->displayText("What?");
 	} else {
 		if (animate) {
-			Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName(target).c_str());
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName((People)target).c_str());
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			Common::String z = _vm->_avalot->getItem(target);
@@ -713,7 +713,7 @@ void Parser::parse() {
 	_verb = kPardon;
 	_thing = kPardon;
 	_thing2 = kPardon;
-	_person = kPardon;
+	_person = kPeoplePardon;
 	clearWords();
 
 
@@ -868,14 +868,15 @@ void Parser::parse() {
 	}
 
 	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
-		if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49)))
-			_verb = (byte)_thats[i];
-		else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) {
+		byte curChar = (byte)_thats[i];
+		if ((curChar == 253) || (curChar == 249) || ((1 <= curChar) && (curChar <= 49)))
+			_verb = curChar;
+		else if ((50 <= curChar) && (curChar <= 149)) {
 			_thing2 = _thing;
-			_thing = (byte)_thats[i];
-		} else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199))
-			_person = (byte)_thats[i];
-		else if ((byte)_thats[i] == 251)
+			_thing = curChar;
+		} else if ((150 <= curChar) && (curChar <= 199))
+			_person = (People)curChar;
+		else if (curChar == 251)
 			_polite = true;
 	}
 
@@ -929,7 +930,7 @@ void Parser::examineObject() {
 }
 
 bool Parser::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPardon) || (_person == 0) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room))
+	if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room))
 		return true;
 	else {
 		Common::String tmpStr;
@@ -959,7 +960,8 @@ void Parser::exampers() {
 		if ((_person == kPeopleAyles) && !_vm->_avalot->_aylesIsAwake)
 			_vm->_dialogs->displayScrollChain('Q', 13);
 
-		_person = newPerson;
+		// CHECKME: Present in the original, but it doesn't make sense.
+		// _person = newPerson;
 	}
 }
 
@@ -1004,7 +1006,7 @@ void Parser::openBox(bool isOpening) {
 
 void Parser::examine() {
 	// EITHER it's an object OR it's an Also OR it's a _person OR it's something else.
-	if ((_person == kPardon) && (_thing != kPardon)) {
+	if ((_person == kPeoplePardon) && (_thing != kPardon)) {
 		if (isHolding()) {
 			// Remember: it's been slipped! Ie subtract 49.
 			if ((1 <= _thing) && (_thing <= 49)) // Standard object
@@ -1108,7 +1110,7 @@ void Parser::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
 	for (int i = 151; i < 179; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room)
+		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room)
 			numPeople++;
 	}
 
@@ -1118,14 +1120,14 @@ void Parser::peopleInRoom() {
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
 	for (int i = 151; i < 179; i++) {
-		if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) {
+		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				tmpStr = _vm->_avalot->getName(i + 150);
+				tmpStr = _vm->_avalot->getName((People)i);
 			else if (actPerson < numPeople) // The middle...
-				tmpStr += ", " + _vm->_avalot->getName(i + 150);
+				tmpStr += ", " + _vm->_avalot->getName((People)i);
 			else // The end.
-				tmpStr += " and " + _vm->_avalot->getName(i + 150);
+				tmpStr += " and " + _vm->_avalot->getName((People)i);
 		}
 	}
 
@@ -1185,7 +1187,7 @@ void Parser::openDoor() {
 		if (_vm->_animation->inField(1)) {
 			// Opening the box.
 			_thing = 54; // The box.
-			_person = kPardon;
+			_person = kPeoplePardon;
 			examine();
 			return;
 		}
@@ -1551,8 +1553,8 @@ void Parser::winSequence() {
 }
 
 Common::String Parser::personSpeaks() {
-	if ((_person == kPardon) || (_person == 0)) {
-		if ((_vm->_avalot->_him == kPardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room))
+	if ((_person == kPeoplePardon) || (_person == kPeopleNone)) {
+		if ((_vm->_avalot->_him == kPeoplePardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room))
 			_person = _vm->_avalot->_her;
 		else
 			_person = _vm->_avalot->_him;
@@ -1642,7 +1644,7 @@ void Parser::doThat() {
 			else
 				getProc(_thing);
 		} else { // Not... ditto.
-			if (_person != kPardon)
+			if (_person != kPeoplePardon)
 				_vm->_dialogs->displayText("You can't sweep folk off their feet!");
 			else
 				_vm->_dialogs->displayText("I assure you, you don't need it.");
@@ -1656,7 +1658,7 @@ void Parser::doThat() {
 		inventory();
 		break;
 	case kVerbCodeTalk:
-		if (_person == kPardon) {
+		if (_person == kPeoplePardon) {
 			if (_vm->_avalot->_subjectNum == 99) { // They typed "say password".
 				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
 				_vm->_dialogs->displayText(tmpStr);
@@ -1670,9 +1672,9 @@ void Parser::doThat() {
 				doThat();
 				return;
 			} else {
-				_person = _vm->_avalot->_subjectNum;
+				_person = (People)_vm->_avalot->_subjectNum;
 				_vm->_avalot->_subjectNum = 0;
-				if ((_person == 0) || (_person == kPardon))
+				if ((_person == kPeopleNone) || (_person == kPeoplePardon))
 					_vm->_dialogs->displayText("Talk to whom?");
 				else if (isPersonHere())
 					_vm->_dialogs->talkTo(_person);
@@ -1682,7 +1684,7 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeGive:
 		if (isHolding()) {
-			if (_person == kPardon)
+			if (_person == kPeoplePardon)
 				_vm->_dialogs->displayText("Give to whom?");
 			else if (isPersonHere()) {
 				switch (_thing) {
@@ -2221,7 +2223,7 @@ void Parser::doThat() {
 		standUp();
 		break;
 	case kVerbCodeKiss:
-		if (_person == kPardon)
+		if (_person == kPeoplePardon)
 			_vm->_dialogs->displayText("Kiss whom?");
 		else if (isPersonHere()) {
 			switch (_person) {
@@ -2258,7 +2260,7 @@ void Parser::doThat() {
 	case kVerbCodeWake:
 		if (isPersonHere())
 			switch (_person) {
-			case kPardon:
+			case kPeoplePardon:
 			case kPeopleAvalot:
 			case 0:
 				if (!_vm->_avalot->_avvyIsAwake) {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 30b5929..a0e2681 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -28,6 +28,8 @@
 #ifndef AVALANCHE_PARSER_H
 #define AVALANCHE_PARSER_H
 
+#include "avalanche/enums.h"
+
 #include "common/events.h"
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -71,7 +73,8 @@ public:
 	VocabEntry _vocabulary[kParserWordsNum];
 
 	Common::String _realWords[11];
-	byte _verb, _person, _thing;
+	byte _verb, _thing;
+	People _person;
 	bool _polite;
 	Common::String _inputText; // Original name: current
 	Common::String _inputTextBackup;


Commit: b4a81fc2ac46484f9111eccb099562c3cfa5fc0f
    https://github.com/scummvm/scummvm/commit/b4a81fc2ac46484f9111eccb099562c3cfa5fc0f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T13:36:57-07:00

Commit Message:
AVALANCHE: Use enum for verbs

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/enums.h
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 90d2542..5d18234 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -37,6 +37,7 @@
 #include "avalanche/timer.h"
 #include "avalanche/background.h"
 #include "avalanche/closing.h"
+#include "avalanche/enums.h"
 
 #include "common/file.h"
 #include "common/random.h"
@@ -469,7 +470,7 @@ void Avalot::init() {
  * Call a given Verb
  * @remarks	Originally called 'callverb'
  */
-void Avalot::callVerb(byte id) {
+void Avalot::callVerb(VerbCode id) {
 	if (id == _vm->_parser->kPardon) {
 		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
 			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
@@ -1439,13 +1440,13 @@ void Avalot::checkClick() {
 					_vm->_parser->_person = (People) _thinks;
 					_vm->_parser->_thing = _vm->_parser->kPardon;
 				}
-				callVerb(Parser::kVerbCodeExam);
+				callVerb(kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
 					_vm->updateEvents();
 				} while (_holdLeftMouse);
 
-				callVerb(Parser::kVerbCodeScore);
+				callVerb(kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
 				_vm->_animation->_sprites[0]._speedX = kWalk;
 				_vm->_animation->updateSpeed();
@@ -1864,29 +1865,29 @@ Common::String Avalot::f5Does() {
 	switch (_room) {
 	case kRoomYours:
 		if (!_avvyIsAwake)
-			return Common::String::format("%cWWake up", Parser::kVerbCodeWake);
+			return Common::String::format("%cWWake up", kVerbCodeWake);
 		else if (_avvyInBed)
-			return Common::String::format("%cGGet up", Parser::kVerbCodeStand);
+			return Common::String::format("%cGGet up", kVerbCodeStand);
 		break;
 	case kRoomInsideCardiffCastle:
 		if (_standingOnDais)
-			return Common::String::format("%cCClimb down", Parser::kVerbCodeClimb);
+			return Common::String::format("%cCClimb down", kVerbCodeClimb);
 		else
-			return Common::String::format("%cCClimb up", Parser::kVerbCodeClimb);
+			return Common::String::format("%cCClimb up", kVerbCodeClimb);
 		break;
 	case kRoomNottsPub:
 		if (_sittingInPub)
-			return Common::String::format("%cSStand up", Parser::kVerbCodeStand);
+			return Common::String::format("%cSStand up", kVerbCodeStand);
 		else
-			return Common::String::format("%cSSit down", Parser::kVerbCodeSit);
+			return Common::String::format("%cSSit down", kVerbCodeSit);
 		break;
 	case kRoomMusicRoom:
 		if (_vm->_animation->inField(5))
-			return Common::String::format("%cPPlay the harp", Parser::kVerbCodePlay);
+			return Common::String::format("%cPPlay the harp", kVerbCodePlay);
 		break;
 	}
 
-	return Common::String::format("%c", _vm->_parser->kPardon); // If all else fails...
+	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
 }
 
 void Avalot::loadMouse(byte which) {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 3999c19..ae4024a 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -291,7 +291,7 @@ public:
 	void runAvalot();
 
 	void init();
-	void callVerb(byte id);
+	void callVerb(VerbCode id);
 	void drawAlsoLines();
 	void loadRoom(byte num);
 	void exitRoom(byte x);
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 9965091..c3c9a54 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -51,55 +51,38 @@ enum Room {
 
 // Objects you can hold:
 enum Object {
-	kObjectWine = 1,
-	kObjectMoney,
-	kObjectBodkin,
-	kObjectPotion,
-	kObjectChastity,
-	kObjectBolt,
-	kObjectCrossbow,
-	kObjectLute,
-	kObjectBadge,
-	kObjectMushroom,
-	kObjectKey,
-	kObjectBell,
-	kObjectPrescription,
-	kObjectPen,
-	kObjectInk,
-	kObjectClothes,
-	kObjectHabit,
-	kObjectOnion,
-	kObjectDummy = 177
+	kObjectWine = 1, kObjectMoney,    kObjectBodkin,       kObjectPotion, kObjectChastity,
+	kObjectBolt,     kObjectCrossbow, kObjectLute,         kObjectBadge,  kObjectMushroom,
+	kObjectKey,      kObjectBell,     kObjectPrescription, kObjectPen,    kObjectInk,
+	kObjectClothes,  kObjectHabit,    kObjectOnion,        kObjectDummy = 177
 };
 
 // People who hang around this game.
 enum People {
 	// Boys:
-	kPeopleAvalot = 150,
-	kPeopleSpludwick = 151,
-	kPeopleCrapulus = 152,
-	kPeopleDrDuck = 153,
-	kPeopleMalagauche = 154,
-	kPeopleFriarTuck = 155,
-	kPeopleRobinHood = 156,
-	kPeopleCwytalot = 157,
-	kPeopleDuLustie = 158,
-	kPeopleDuke = 159,
-	kPeopleDogfood = 160,
-	kPeopleTrader = 161,
-	kPeopleIbythneth = 162,
-	kPeopleAyles = 163,
-	kPeoplePort = 164,
-	kPeopleSpurge = 165,
+	kPeopleAvalot = 150,     kPeopleSpludwick = 151, kPeopleCrapulus = 152,  kPeopleDrDuck = 153,
+	kPeopleMalagauche = 154, kPeopleFriarTuck = 155, kPeopleRobinHood = 156, kPeopleCwytalot = 157,
+	kPeopleDuLustie = 158,   kPeopleDuke = 159,      kPeopleDogfood = 160,   kPeopleTrader = 161,
+	kPeopleIbythneth = 162,  kPeopleAyles = 163,     kPeoplePort = 164,      kPeopleSpurge = 165,
 	kPeopleJacques = 166,
 	// Girls:
-	kPeopleArkata = 175,
-	kPeopleGeida = 176,
-	kPeopleInvisible = 177,
-	kPeopleWisewoman = 178,
+	kPeopleArkata = 175,     kPeopleGeida = 176,     kPeopleInvisible = 177, kPeopleWisewoman = 178,
 	//
-	kPeoplePardon = 254,
-	kPeopleNone = 0
+	kPeoplePardon = 254,     kPeopleNone = 0
+};
+
+enum VerbCode {
+	kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
+	kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
+	kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
+	kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
+	kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
+	kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
+	kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
+	kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
+	kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
+	kVerbCodeHello = 46,   kVerbCodeThanks = 47, 
+	kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253, kVerbCodePardon = 254
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 0686fbb..42a787e 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -266,26 +266,26 @@ void Menu::findWhatYouCanDoWithIt() {
 	case kObjectWine:
 	case kObjectPotion:
 	case kObjectInk:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeDrink;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeDrink;
 		break;
 	case kObjectBell:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeRing;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeRing;
 		break;
 	case kObjectChastity:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	case kObjectLute:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodePlay;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodePlay;
 		break;
 	case kObjectMushroom:
 	case kObjectOnion:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeEat;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeEat;
 		break;
 	case kObjectClothes:
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeWear;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	default:
-		_vm->_avalot->_verbStr = Parser::kVerbCodeExam; // Anything else.
+		_vm->_avalot->_verbStr = kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -492,21 +492,21 @@ void Menu::setupMenuWith() {
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_avalot->getName(_vm->_avalot->_lastPerson), 'G', "", true);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodeGive;
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
 		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_avalot->_thinks), 'T', "", true);
-		_vm->_avalot->_verbStr = Common::String(Parser::kVerbCodeExam) + Parser::kVerbCodeTalk;
+		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeTalk;
 		switch (_vm->_avalot->_thinks) {
 		case kPeopleGeida:
 		case kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodeKiss;
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodeKiss;
 			break;
 		case kPeopleDogfood:
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_avalot->_wonNim); // True if you HAVEN'T won.
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + Parser::kVerbCodePlay;
+			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodePlay;
 			break;
 		case kPeopleMalagauche: {
 			bool isSober = !_vm->_avalot->_teetotal;
@@ -531,19 +531,19 @@ void Menu::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_avalot->callVerb(Parser::kVerbCodeHelp);
+		_vm->_avalot->callVerb(kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_avalot->callVerb(Parser::kVerbCodeBoss);
+		_vm->_avalot->callVerb(kVerbCodeBoss);
 		break;
 	case 2:
 		_vm->_avalot->majorRedraw();
 		break;
 	case 3:
-		_vm->_avalot->callVerb(Parser::kVerbCodeScore);
+		_vm->_avalot->callVerb(kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_avalot->callVerb(Parser::kVerbCodeInfo);
+		_vm->_avalot->callVerb(kVerbCodeInfo);
 		break;
 	}
 }
@@ -552,17 +552,17 @@ void Menu::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_avalot->callVerb(Parser::kVerbCodeRestart);
+		_vm->_avalot->callVerb(kVerbCodeRestart);
 		break;
 	case 1:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_avalot->callVerb(Parser::kVerbCodeLoad);
+		_vm->_avalot->callVerb(kVerbCodeLoad);
 		break;
 	case 2:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_avalot->callVerb(Parser::kVerbCodeSave);
+		_vm->_avalot->callVerb(kVerbCodeSave);
 		break;
 	case 3:
 		//_vm->_basher->filename_edit();
@@ -572,34 +572,35 @@ void Menu::runMenuFile() {
 		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		_vm->_avalot->callVerb(Parser::kVerbCodeQuit);
+		_vm->_avalot->callVerb(kVerbCodeQuit);
 		break;
 	}
 }
 
 void Menu::runMenuAction() {
-	Common::String f5Does;
 	// Get up, pause game, open door, look, inventory, walk/run.
 	switch (_activeMenuItem._choiceNum) {
-	case 0:
+	case 0: {
 		_vm->_parser->_person = kPeoplePardon;
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		f5Does = _vm->_avalot->f5Does();
-		_vm->_avalot->callVerb(f5Does[0]);
+		Common::String f5Does = _vm->_avalot->f5Does();
+		VerbCode verb = (VerbCode)f5Does[0];
+		_vm->_avalot->callVerb(verb);
+		}
 		break;
 	case 1:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_avalot->callVerb(Parser::kVerbCodePause);
+		_vm->_avalot->callVerb(kVerbCodePause);
 		break;
 	case 2:
-		_vm->_avalot->callVerb(Parser::kVerbCodeOpen);
+		_vm->_avalot->callVerb(kVerbCodeOpen);
 		break;
 	case 3:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_avalot->callVerb(Parser::kVerbCodeLook);
+		_vm->_avalot->callVerb(kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_avalot->callVerb(Parser::kVerbCodeInv);
+		_vm->_avalot->callVerb(kVerbCodeInv);
 		break;
 	case 5: {
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
@@ -628,7 +629,7 @@ void Menu::runMenuWith() {
 	if (_vm->_avalot->_thinkThing) {
 		_vm->_parser->_thing += 49;
 
-		if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive)
+		if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
 			_vm->_parser->_person = _vm->_avalot->_lastPerson;
 		else
 			_vm->_parser->_person = kPeoplePardon;
@@ -636,27 +637,27 @@ void Menu::runMenuWith() {
 		switch (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
 			_vm->_parser->_thing = 100;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		case 101: // Wine
 			_vm->_parser->_thing = 50;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		case 102: // Whisky
 			_vm->_parser->_thing = 102;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		case 103: // Cider
 			_vm->_parser->_thing = 103;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		case 104: // Mead
 			_vm->_parser->_thing = 107;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		case 105: // Onion (trader)
 			_vm->_parser->_thing = 67;
-			_vm->_avalot->callVerb(Parser::kVerbCodeBuy);
+			_vm->_avalot->callVerb(kVerbCodeBuy);
 			return;
 		default:
 			_vm->_parser->_person = (People)_vm->_parser->_thing;
@@ -664,7 +665,7 @@ void Menu::runMenuWith() {
 			_vm->_avalot->_subjectNum = 0;
 		}
 	}
-	_vm->_avalot->callVerb(_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]);
+	_vm->_avalot->callVerb((VerbCode)_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Menu::setup() {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 3e31855..0685bcf 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -420,13 +420,16 @@ void Parser::handleReturn() {
 
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
-	case Common::KEYCODE_F5:
+	case Common::KEYCODE_F5: {
 		_person = kPeoplePardon;
 		_thing = kPardon;
-		_vm->_avalot->callVerb(_vm->_avalot->f5Does()[0]);
+		Common::String f5does = _vm->_avalot->f5Does();
+		VerbCode verb = (VerbCode)f5does[0];
+		_vm->_avalot->callVerb(verb);
+		}
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_avalot->callVerb(Parser::kVerbCodeOpen);
+		_vm->_avalot->callVerb(kVerbCodeOpen);
 		break;
 	default:
 		break;
@@ -710,7 +713,7 @@ void Parser::parse() {
 
 	byte n = 0;
 	_polite = false;
-	_verb = kPardon;
+	_verb = kVerbCodePardon;
 	_thing = kPardon;
 	_thing2 = kPardon;
 	_person = kPeoplePardon;
@@ -870,7 +873,7 @@ void Parser::parse() {
 	for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used.
 		byte curChar = (byte)_thats[i];
 		if ((curChar == 253) || (curChar == 249) || ((1 <= curChar) && (curChar <= 49)))
-			_verb = curChar;
+			_verb = (VerbCode)curChar;
 		else if ((50 <= curChar) && (curChar <= 149)) {
 			_thing2 = _thing;
 			_thing = curChar;
@@ -1668,7 +1671,7 @@ void Parser::doThat() {
 				for (int i = 0; i < 10; i++)
 					_realWords[i] = _realWords[i + 1];
 
-				_verb = _vm->_avalot->_subjectNum;
+				_verb = (VerbCode)_vm->_avalot->_subjectNum;
 				doThat();
 				return;
 			} else {
@@ -2310,7 +2313,7 @@ void Parser::doThat() {
 			_vm->_avalot->dawn();
 		}
 		break;
-	case kPardon:
+	case kVerbCodePardon:
 		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
 		break;
 	case kVerbCodeHello: {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index a0e2681..e45d668 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -41,19 +41,6 @@ class AvalancheEngine;
 
 class Parser {
 public:
-	enum VerbCode {
-		kVerbCodeExam = 1,     kVerbCodeOpen = 2,    kVerbCodePause = 3,   kVerbCodeGet = 4,       kVerbCodeDrop = 5,
-		kVerbCodeInv = 6,      kVerbCodeTalk = 7,    kVerbCodeGive = 8,    kVerbCodeDrink = 9,     kVerbCodeLoad = 10,
-		kVerbCodeSave = 11,    kVerbCodePay = 12,    kVerbCodeLook = 13,   kVerbCodeBreak = 14,    kVerbCodeQuit = 15,
-		kVerbCodeSit = 16,     kVerbCodeStand = 17,  kVerbCodeGo = 18,     kVerbCodeInfo = 19,     kVerbCodeUndress = 20,
-		kVerbCodeWear = 21,    kVerbCodePlay = 22,   kVerbCodeRing = 23,   kVerbCodeHelp = 24,     kVerbCodeLarrypass = 25,
-		kVerbCodePhaon = 26,   kVerbCodeBoss = 27,   kVerbCodePee = 28,    kVerbCodeCheat = 29,    kVerbCodeMagic = 30,
-		kVerbCodeRestart = 31, kVerbCodeEat = 32,    kVerbCodeListen = 33, kVerbCodeBuy = 34,      kVerbCodeAttack = 35,
-		kVerbCodePasswd = 36,  kVerbCodeDir = 37,    kVerbCodeDie = 38,    kVerbCodeScore = 39,    kVerbCodePut = 40,
-		kVerbCodeKiss = 41,    kVerbCodeClimb = 42,  kVerbCodeJump = 43,   kVerbCodeHiscores = 44, kVerbCodeWake = 45,
-		kVerbCodeHello = 46,   kVerbCodeThanks = 47, kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253
-	};
-
 	static const byte kPardon = 254; // Didn't understand / wasn't given.
 	static const int16 kParserWordsNum = 277; // How many words does the parser know?
 	static const byte kNothing = 250;
@@ -73,7 +60,8 @@ public:
 	VocabEntry _vocabulary[kParserWordsNum];
 
 	Common::String _realWords[11];
-	byte _verb, _thing;
+	VerbCode _verb;
+	byte _thing;
 	People _person;
 	bool _polite;
 	Common::String _inputText; // Original name: current
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 425feea..342ed7b 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -658,7 +658,7 @@ void Timer::winning() {
 #endif
 	// TODO: To be implemented with Pingo::winningPic().
 
-	_vm->_avalot->callVerb(Parser::kVerbCodeScore);
+	_vm->_avalot->callVerb(kVerbCodeScore);
 	_vm->_dialogs->displayText(" T H E    E N D ");
 	_vm->_avalot->_letMeOut = true;
 }


Commit: 929dcd42f5a3dfb233df545ee6434a71511e5174
    https://github.com/scummvm/scummvm/commit/929dcd42f5a3dfb233df545ee6434a71511e5174
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T22:18:08-07:00

Commit Message:
AVALANCHE: Reduce verbosity in Background, remove a useless variable

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/background.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h
    engines/avalanche/sequence.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5fd109a..1369031 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -448,59 +448,59 @@ void Animation::catacombMove(byte ped) {
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27);
+		_vm->_background->draw(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_background->drawBackgroundSprite(-1, -1, 28); // ...shield.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 29); // ...door, and...
+		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 4);  // ...window.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_background->drawBackgroundSprite(-1, -1, 4); // ...window.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 29); // ...door, and...
+		_vm->_background->draw(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // No door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 27); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 29); // ...door, and...
-		_vm->_background->drawBackgroundSprite(-1, -1, 6); // ...torches.
+		_vm->_background->draw(-1, -1, 27); // Wall, plus...
+		_vm->_background->draw(-1, -1, 29); // ...door, and...
+		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // Sloping wall.
@@ -515,44 +515,44 @@ void Animation::catacombMove(byte ped) {
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18);
+		_vm->_background->draw(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...window.
+		_vm->_background->draw(-1, -1, 18); // Wall, plus...
+		_vm->_background->draw(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door.
+		_vm->_background->draw(-1, -1, 18); // Wall, plus...
+		_vm->_background->draw(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 19); // ...door, and...
-		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...window.
+		_vm->_background->draw(-1, -1, 18); // Wall, plus...
+		_vm->_background->draw(-1, -1, 19); // ...door, and...
+		_vm->_background->draw(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // No door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
+		_vm->_background->draw(-1, -1, 18); // Wall, plus...
+		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
 		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 18); // Wall, plus...
-		_vm->_background->drawBackgroundSprite(-1, -1, 20); // ...door, and...
-		_vm->_background->drawBackgroundSprite(-1, -1, 17); // ...torches.
+		_vm->_background->draw(-1, -1, 18); // Wall, plus...
+		_vm->_background->draw(-1, -1, 20); // ...door, and...
+		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
 		_vm->_avalot->_magics[4]._operation = Avalot::kMagicNothing; // Sloping wall.
@@ -568,7 +568,7 @@ void Animation::catacombMove(byte ped) {
 		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x1:
-		_vm->_background->drawBackgroundSprite(-1, -1, 21);
+		_vm->_background->draw(-1, -1, 21);
 
 		if ((xy_uint16 == 2051) && (_vm->_avalot->_geidaFollows))
 			_vm->_avalot->_magics[12]._operation = Avalot::kMagicExclaim;
@@ -579,13 +579,13 @@ void Animation::catacombMove(byte ped) {
 		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x2:
-		_vm->_background->drawBackgroundSprite(-1, -1, 22);
+		_vm->_background->draw(-1, -1, 22);
 		_vm->_avalot->_magics[6]._operation = Avalot::kMagicSpecial; // Middle exit south.
 		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
 		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
 		break;
 	case 0x3:
-		_vm->_background->drawBackgroundSprite(-1, -1, 23);
+		_vm->_background->draw(-1, -1, 23);
 		_vm->_avalot->_magics[11]._operation = Avalot::kMagicSpecial; // Left exit south.
 		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
 		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
@@ -606,7 +606,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x2:
-		_vm->_background->drawBackgroundSprite(-1, -1, 3);
+		_vm->_background->draw(-1, -1, 3);
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
@@ -624,7 +624,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 #endif
 	case 0x5:
-		_vm->_background->drawBackgroundSprite(-1, -1, 2);
+		_vm->_background->draw(-1, -1, 2);
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
@@ -639,12 +639,12 @@ void Animation::catacombMove(byte ped) {
 	case 0x7:
 	case 0x8:
 	case 0x9:
-		_vm->_background->drawBackgroundSprite(-1, -1, 5);
+		_vm->_background->draw(-1, -1, 5);
 
 		if (((here & 0xf000) >> 12) > 0x7)
-			_vm->_background->drawBackgroundSprite(-1, -1, 30);
+			_vm->_background->draw(-1, -1, 30);
 		if (((here & 0xf000) >> 12) == 0x9)
-			_vm->_background->drawBackgroundSprite(-1, -1, 31);
+			_vm->_background->draw(-1, -1, 31);
 
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicSpecial; // Middle arch north.
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
@@ -653,50 +653,50 @@ void Animation::catacombMove(byte ped) {
 	case 0xd: // No connection + WINDOW
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 13);
+		_vm->_background->draw(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 7);
+		_vm->_background->draw(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
 		_vm->_avalot->_magics[0]._operation = Avalot::kMagicNothing; // Door to Geida's room.
-		_vm->_background->drawBackgroundSprite(-1, -1, 0);
+		_vm->_background->draw(-1, -1, 0);
 		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
 		break;
 	}
 
 	switch (xy_uint16) {
 	case 514:
-		_vm->_background->drawBackgroundSprite(-1, -1, 16);
+		_vm->_background->draw(-1, -1, 16);
 		break;     // [2,2] : "Art Gallery" sign over door.
 	case 264:
-		_vm->_background->drawBackgroundSprite(-1, -1, 8);
+		_vm->_background->draw(-1, -1, 8);
 		break;      // [8,1] : "The Wrong Way!" sign.
 	case 1797:
-		_vm->_background->drawBackgroundSprite(-1, -1, 1);
+		_vm->_background->draw(-1, -1, 1);
 		break;      // [5,7] : "Ite Mingite" sign.
 	case 258:
 		for (int i = 0; i <= 2; i++) { // [2,1] : Art gallery - pictures
-			_vm->_background->drawBackgroundSprite(130 + i * 120, 70, 14);
-			_vm->_background->drawBackgroundSprite(184 + i * 120, 78, 15);
+			_vm->_background->draw(130 + i * 120, 70, 14);
+			_vm->_background->draw(184 + i * 120, 78, 15);
 		}
 		break;
 	case 1287:
 		for (int i = 10; i <= 13; i++)
-			_vm->_background->drawBackgroundSprite(-1, -1, i - 1);
+			_vm->_background->draw(-1, -1, i - 1);
 		break; // [7,5] : 4 candles.
 	case 776:
-		_vm->_background->drawBackgroundSprite(-1, -1, 9);
+		_vm->_background->draw(-1, -1, 9);
 		break;     // [8,3] : 1 candle.
 	case 2049:
-		_vm->_background->drawBackgroundSprite(-1, -1, 10);
+		_vm->_background->draw(-1, -1, 10);
 		break;     // [1,8] : another candle.
 	case 257:
-		_vm->_background->drawBackgroundSprite(-1, -1, 11);
-		_vm->_background->drawBackgroundSprite(-1, -1, 12);
+		_vm->_background->draw(-1, -1, 11);
+		_vm->_background->draw(-1, -1, 12);
 		break; // [1,1] : the other two.
 	}
 
@@ -717,7 +717,7 @@ void Animation::dawnDelay() {
 void Animation::callSpecial(uint16 which) {
 	switch (which) {
 	case 1: // _vm->_avalot->special 1: Room 22: top of stairs.
-		_vm->_background->drawBackgroundSprite(-1, -1, 0);
+		_vm->_background->draw(-1, -1, 0);
 		_vm->_avalot->_brummieStairs = 1;
 		_vm->_avalot->_magics[9]._operation = Avalot::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
@@ -764,7 +764,7 @@ void Animation::callSpecial(uint16 which) {
 			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 			_vm->_dialogs->displayScrollChain('q', 36);
 			_vm->_avalot->_tiedUp = true;
 			_vm->_avalot->_friarWillTieYouUp = false;
@@ -979,7 +979,7 @@ void Animation::arrowProcs(byte tripnum) {
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
-		_vm->_background->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door.
+		_vm->_background->draw(-1, -1, 2); // Show pic of arrow stuck into the door.
 		_vm->_avalot->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
@@ -1189,7 +1189,7 @@ void Animation::hideInCupboard() {
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Dialogs::kControlParagraph);
 		_vm->_dialogs->displayText(tmpStr);
 		_vm->_avalot->_avvysInTheCupboard = true;
-		_vm->_background->drawBackgroundSprite(-1, -1, 7);
+		_vm->_background->draw(-1, -1, 7);
 	}
 }
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 4e92901..0720341 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -416,7 +416,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		_avalot->dawn();
 	}
 
-	_background->forgetBackgroundSprites();
+	_background->release();
 	_avalot->minorRedraw();
 	_menu->setup();
 	_avalot->setRoom(kPeopleAvalot, _avalot->_room);
@@ -426,7 +426,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_avalot->drawDirection();
 	_avalot->_onToolbar = false;
 	_animation->animLink();
-	_background->updateBackgroundSprites();
+	_background->update();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
 		Dialogs::kControlItalic, Dialogs::kControlRoman, description.c_str(), Dialogs::kControlCenter, 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5d18234..e0881ac 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -404,7 +404,7 @@ void Avalot::runAvalot() {
 
 		_clock.update();
 		_vm->_menu->update();
-		_vm->_background->updateBackgroundSprites();
+		_vm->_background->update();
 		_vm->_animation->animLink();
 		checkClick();
 		_vm->_timer->updateTimer();
@@ -643,7 +643,7 @@ void Avalot::loadRoom(byte num) {
 	file.close();
 
 	loadAlso(num);
-	_vm->_background->loadBackgroundSprites(num);
+	_vm->_background->load(num);
 	CursorMan.showMouse(true);
 }
 
@@ -682,7 +682,7 @@ void Avalot::findPeople(byte room) {
 
 void Avalot::exitRoom(byte x) {
 	_vm->_sound->stopSound();
-	_vm->_background->forgetBackgroundSprites();
+	_vm->_background->release();
 	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
@@ -782,7 +782,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	switch (roomId) {
 	case kRoomYours:
 		if (_avvyInBed) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
 		}
@@ -880,7 +880,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomBridge:
 		if (_drawbridgeOpen == 4) { // open
-			_vm->_background->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge
+			_vm->_background->draw(-1, -1, 2); // Position of drawbridge
 			_vm->_graphics->refreshBackground();
 			_magics[kColorGreen - 1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
 		}
@@ -904,10 +904,10 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		}
 
 		if (_tiedUp)
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 
 		if (!_mushroomGrowing)
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 		_vm->_graphics->refreshBackground();
 		break;
 
@@ -979,11 +979,11 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomArgentPub:
 		if (_wonNim)
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);   // No lute by the settle.
+			_vm->_background->draw(-1, -1, 0);   // No lute by the settle.
 		_malagauche = 0; // Ready to boot Malagauche
 		if (_givenBadgeToIby) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 7);
-			_vm->_background->drawBackgroundSprite(-1, -1, 8);
+			_vm->_background->draw(-1, -1, 7);
+			_vm->_background->draw(-1, -1, 8);
 		}
 		_vm->_graphics->refreshBackground();
 		break;
@@ -999,7 +999,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (_geidaFollows) {
 			putGeidaAt(4, ped);
 			if (_lustieIsAsleep) {
-				_vm->_background->drawBackgroundSprite(-1, -1, 4);
+				_vm->_background->draw(-1, -1, 4);
 				_vm->_graphics->refreshBackground();
 			}
 		}
@@ -1008,14 +1008,14 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	case kRoomMusicRoom:
 		if (_jacquesState > 0) {
 			_jacquesState = 5;
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_background->drawBackgroundSprite(-1, -1, 3);
+			_vm->_background->draw(-1, -1, 3);
 			_magics[kColorBrown - 1]._operation = Avalot::kMagicNothing;
 			_whereIs[kPeopleJacques - 150] = kRoomNowhere;
 		}
 		if (ped != 0) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->draw(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -1026,7 +1026,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomOutsideNottsPub:
 		if (ped == 2) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->thenShow(2);
@@ -1038,7 +1038,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomOutsideArgentPub:
 		if (ped == 2)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
+			_vm->_background->draw(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(6);
 			_vm->_sequence->thenShow(5);
@@ -1066,7 +1066,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
 			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);
+			_vm->_background->draw(-1, -1, 0);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(1);
 			if (_arrowInTheDoor)
@@ -1075,22 +1075,22 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 				_vm->_sequence->thenShow(2);
 
 			if (_takenPen)
-				_vm->_background->drawBackgroundSprite(-1, -1, 3);
+				_vm->_background->draw(-1, -1, 3);
 
 			_vm->_sequence->startToClose();
 		} else {
-			_vm->_background->drawBackgroundSprite(-1, -1, 0);
+			_vm->_background->draw(-1, -1, 0);
 			if (_arrowInTheDoor)
-				_vm->_background->drawBackgroundSprite(-1, -1, 2);
+				_vm->_background->draw(-1, -1, 2);
 			else
-				_vm->_background->drawBackgroundSprite(-1, -1, 1);
+				_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 		}
 		break;
 
 	case kRoomAvvysGarden:
 		if (ped == 1)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -1111,7 +1111,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 			_vm->_sequence->start_to_close();
 #endif
 
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(2);
 			_vm->_sequence->thenShow(1);
@@ -1122,7 +1122,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomAylesOffice:
 		if (_aylesIsAwake)
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 		_vm->_graphics->refreshBackground();
 		break; // Ayles awake.
 
@@ -1143,14 +1143,14 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomNottsPub:
 		if (_sittingInPub)
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 		_npcFacing = 1; // Port.
 		break;
 
 	case kRoomOutsideDucks:
 		if (ped == 2) {
 			// Shut the door
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
 			_vm->_sequence->firstShow(3);
 			_vm->_sequence->firstShow(2);
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 9da9161..b243078 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -43,32 +43,32 @@ Background::Background(AvalancheEngine *vm) {
 }
 
 Background::~Background() {
-	forgetBackgroundSprites();
+	release();
 }
 
 /**
  * @remarks	Originally called 'pics_link'
  */
-void Background::updateBackgroundSprites() {
+void Background::update() {
 	if (_vm->_menu->isActive())
 		return; // No animation when the menus are up.
 
 	switch (_vm->_avalot->_room) {
 	case kRoomOutsideArgentPub:
 		if ((_vm->_avalot->_roomTime % 12) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 12) % 4);
+			draw(-1, -1, (_vm->_avalot->_roomTime / 12) % 4);
 		break;
 	case kRoomBrummieRoad:
 		if ((_vm->_avalot->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 2) % 4);
+			draw(-1, -1, (_vm->_avalot->_roomTime / 2) % 4);
 		break;
 	case kRoomBridge:
 		if ((_vm->_avalot->_roomTime % 2) == 0)
-			drawBackgroundSprite(-1, -1, 3 + (_vm->_avalot->_roomTime / 2) % 4);
+			draw(-1, -1, 3 + (_vm->_avalot->_roomTime / 2) % 4);
 		break;
 	case kRoomYours:
 		if ((!_vm->_avalot->_avvyIsAwake) && ((_vm->_avalot->_roomTime % 4) == 0))
-			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 12) % 2);
+			draw(-1, -1, (_vm->_avalot->_roomTime / 12) % 2);
 		break;
 	case kRoomArgentPub:
 		if (((_vm->_avalot->_roomTime % 7) == 1) && (_vm->_avalot->_malagauche != 177)) {
@@ -78,16 +78,16 @@ void Background::updateBackgroundSprites() {
 			case 1:
 			case 11:
 			case 21:
-				drawBackgroundSprite(-1, -1, 11); // Looks forwards.
+				draw(-1, -1, 11); // Looks forwards.
 				break;
 			case 8:
 			case 18:
 			case 28:
 			case 32:
-				drawBackgroundSprite(-1, -1, 10); // Looks at you.
+				draw(-1, -1, 10); // Looks at you.
 				break;
 			case 30:
-				drawBackgroundSprite(-1, -1, 12); // Winks.
+				draw(-1, -1, 12); // Winks.
 				break;
 			case 33:
 				_vm->_avalot->_malagauche = 0;
@@ -98,14 +98,14 @@ void Background::updateBackgroundSprites() {
 		switch (_vm->_avalot->_roomTime % 200) {
 		case 179:
 		case 197:
-			drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle.
+			draw(-1, -1, 4); // Dogfood's drinking cycle.
 			break;
 		case 182:
 		case 194:
-			drawBackgroundSprite(-1, -1, 5);
+			draw(-1, -1, 5);
 			break;
 		case 185:
-			drawBackgroundSprite(-1, -1, 6);
+			draw(-1, -1, 6);
 			break;
 		case 199:
 			_vm->_avalot->_npcFacing = 177; // Impossible value for this.
@@ -123,7 +123,7 @@ void Background::updateBackgroundSprites() {
 				direction = 4;
 
 			if (direction != _vm->_avalot->_npcFacing) { // Dogfood.
-				drawBackgroundSprite(-1, -1, direction - 1);
+				draw(-1, -1, direction - 1);
 				_vm->_avalot->_npcFacing = direction;
 			}
 		}
@@ -132,16 +132,16 @@ void Background::updateBackgroundSprites() {
 		if ((_vm->_avalot->_roomTime % 3) == 0) {
 			switch ((_vm->_avalot->_roomTime / int32(3)) % int32(6)) {
 			case 4:
-				drawBackgroundSprite(-1, -1, 0);
+				draw(-1, -1, 0);
 				break;
 			case 1:
 			case 3:
 			case 5:
-				drawBackgroundSprite(-1, -1, 1);
+				draw(-1, -1, 1);
 				break;
 			case 0:
 			case 2:
-				drawBackgroundSprite(-1, -1, 2);
+				draw(-1, -1, 2);
 				break;
 			}
 		}
@@ -161,7 +161,7 @@ void Background::updateBackgroundSprites() {
 				direction = 3; // Right.
 
 			if (direction != _vm->_avalot->_npcFacing) { // du Lustie.
-				drawBackgroundSprite(-1, -1, direction - 1);
+				draw(-1, -1, direction - 1);
 				_vm->_avalot->_npcFacing = direction;
 			}
 		}
@@ -170,10 +170,10 @@ void Background::updateBackgroundSprites() {
 		if ((!_vm->_avalot->_aylesIsAwake) && (_vm->_avalot->_roomTime % 14 == 0)) {
 			switch ((_vm->_avalot->_roomTime / 14) % 2) {
 			case 0:
-				drawBackgroundSprite(-1, -1, 0);  // Frame 2: EGA.
+				draw(-1, -1, 0);  // Frame 2: EGA.
 				break;
 			case 1:
-				drawBackgroundSprite(-1, -1, 2); // Frame 1: Natural.
+				draw(-1, -1, 2); // Frame 1: Natural.
 				break;
 			}
 		}
@@ -182,10 +182,10 @@ void Background::updateBackgroundSprites() {
 		if (_vm->_avalot->_tiedUp) {
 			switch (_vm->_avalot->_roomTime % 54) {
 			case 20:
-				drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks.
+				draw(-1, -1, 3); // Frame 4: Avalot blinks.
 				break;
 			case 23:
-				drawBackgroundSprite(-1, -1, 1); // Frame 1: Back to normal.
+				draw(-1, -1, 1); // Frame 1: Back to normal.
 				break;
 			}
 		}
@@ -205,23 +205,23 @@ void Background::updateBackgroundSprites() {
 			direction--; // Blinks.
 
 		if (direction != _vm->_avalot->_npcFacing) { // Port.
-			drawBackgroundSprite(-1, -1, direction - 1);
+			draw(-1, -1, direction - 1);
 			_vm->_avalot->_npcFacing = direction;
 		}
 
 		switch (_vm->_avalot->_roomTime % 50) {
 		case 45 :
-			drawBackgroundSprite(-1, -1, 8); // Spurge blinks.
+			draw(-1, -1, 8); // Spurge blinks.
 			break;
 		case 49 :
-			drawBackgroundSprite(-1, -1, 9);
+			draw(-1, -1, 9);
 			break;
 		}
 		break;
 	  }
 	case kRoomDucks: {
 		if ((_vm->_avalot->_roomTime % 3) == 0) // The fire flickers.
-			drawBackgroundSprite(-1, -1, (_vm->_avalot->_roomTime / 3) % 3);
+			draw(-1, -1, (_vm->_avalot->_roomTime / 3) % 3);
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
@@ -237,7 +237,7 @@ void Background::updateBackgroundSprites() {
 			direction++; // Duck blinks.
 
 		if (direction != _vm->_avalot->_npcFacing) { // Duck.
-			drawBackgroundSprite(-1, -1, direction - 1);
+			draw(-1, -1, direction - 1);
 			_vm->_avalot->_npcFacing = direction;
 		}
 		break;
@@ -261,7 +261,7 @@ void Background::updateBackgroundSprites() {
 	}
 }
 
-void Background::loadBackgroundSprites(byte number) {
+void Background::load(byte number) {
 	Common::File f;
 	_filename = _filename.format("chunk%d.avd", number);
 	if (!f.open(_filename))
@@ -276,7 +276,7 @@ void Background::loadBackgroundSprites(byte number) {
 		f.seek(_offsets[i]);
 
 		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
+		sprite._type = (PictureType)(f.readByte());
 		sprite._x = f.readSint16LE();
 		sprite._y = f.readSint16LE();
 		sprite._xl = f.readSint16LE();
@@ -311,7 +311,7 @@ void Background::loadBackgroundSprites(byte number) {
 	f.close();
 }
 
-void Background::forgetBackgroundSprites() {
+void Background::release() {
 	for (int i = 0; i < _spriteNum; i++) {
 		if (_sprites[i]._x > kOnDisk)
 			_sprites[i]._picture.free();
@@ -322,7 +322,7 @@ void Background::forgetBackgroundSprites() {
  * Draw background animation
  * @remarks	Originally called 'show_one'
  */
-void Background::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
+void Background::draw(int16 destX, int16 destY, byte sprId) {
 	if (_sprites[sprId]._x > kOnDisk) {
 		if (destX < 0) {
 			destX = _sprites[sprId]._x * 8;
@@ -337,13 +337,13 @@ void Background::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) {
 		f.seek(_offsets[sprId]);
 
 		SpriteType sprite;
-		sprite._type = PictureType(f.readByte());
+		sprite._type = (PictureType)(f.readByte());
 		sprite._x = f.readSint16LE();
 		sprite._y = f.readSint16LE();
 		sprite._xl = f.readSint16LE();
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
-		f.skip(2); // For the now not existing natural and memorize data members of the SpriteType (called chunkblocktype in the original).
+		f.skip(2); // Natural and Memorize are used in Load()
 		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
 
 		if (destX < 0) {
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index d38106d..8d88cb3 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -44,14 +44,14 @@ public:
 	Background(AvalancheEngine *vm);
 	~Background();
 
-	void updateBackgroundSprites();
-	void loadBackgroundSprites(byte number);
-	void forgetBackgroundSprites();
+	void update();
+	void load(byte number);
+	void release();
 
 	// Setting the destination to negative coordinates means the picture should be drawn to it's original position.
 	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
 	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
-	void drawBackgroundSprite(int16 destX, int16 destY, byte sprId);
+	void draw(int16 destX, int16 destY, byte sprId);
 
 private:
 	enum PictureType {kEga, kBgi, kNaturalImage};
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 0685bcf..4abdb31 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -46,7 +46,6 @@ Parser::Parser(AvalancheEngine *vm) {
 }
 
 void Parser::init() {
-	_leftMargin = 0;
 	if (!_inputText.empty())
 		_inputText.clear();
 	_inputTextPos = 0;
@@ -396,7 +395,7 @@ void Parser::handleBackspace() {
 	if (_vm->_menu->_activeMenuItem._activeNow)
 		return;
 
-	if (_inputTextPos > _leftMargin) {
+	if (_inputTextPos > 0) {
 		_inputTextPos--;
 		if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
 			_quote = !_quote;
@@ -990,17 +989,17 @@ bool Parser::isHolding() {
 
 void Parser::openBox(bool isOpening) {
 	if ((_vm->_avalot->_room == kRoomYours) && (_thing == 54)) {
-		_vm->_background->drawBackgroundSprite(-1, -1, 4);
+		_vm->_background->draw(-1, -1, 4);
 
-		_vm->_background->updateBackgroundSprites();
+		_vm->_background->update();
 		_vm->_animation->animLink();
 		_vm->_graphics->refreshScreen();
 
 		_vm->_system->delayMillis(55);
 
 		if (!isOpening) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 5);
-			_vm->_background->updateBackgroundSprites();
+			_vm->_background->draw(-1, -1, 5);
+			_vm->_background->update();
 			_vm->_animation->animLink();
 			_vm->_graphics->refreshScreen();
 		}
@@ -1432,7 +1431,7 @@ void Parser::standUp() {
 			_vm->_avalot->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->setDirection(kDirLeft);
-			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow.
+			_vm->_background->draw(-1, -1, 3); // Picture of empty pillow.
 			_vm->_avalot->incScore(1);
 			_vm->_avalot->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
@@ -1446,7 +1445,7 @@ void Parser::standUp() {
 
 	case kRoomNottsPub:
 		if (_vm->_avalot->_sittingInPub)  {
-			_vm->_background->drawBackgroundSprite(-1, -1, 3); // Not sitting down.
+			_vm->_background->draw(-1, -1, 3); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(0, 3); // And walking away.
 			_vm->_avalot->_sittingInPub = false; // Really not sitting down.
@@ -1464,12 +1463,12 @@ void Parser::getProc(char thing) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
 			if (_vm->_avalot->_boxContent == thing) {
-				_vm->_background->drawBackgroundSprite(-1, -1, 4);
+				_vm->_background->draw(-1, -1, 4);
 				_vm->_dialogs->displayText("OK, I've got it.");
 				_vm->_avalot->_objects[thing - 1] = true;
 				_vm->_avalot->refreshObjectList();
 				_vm->_avalot->_boxContent = kNothing;
-				_vm->_background->drawBackgroundSprite(-1, -1, 5);
+				_vm->_background->draw(-1, -1, 5);
 			} else {
 				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_avalot->getItem(thing).c_str());
 				_vm->_dialogs->displayText(tmpStr);
@@ -1485,7 +1484,7 @@ void Parser::getProc(char thing) {
 					_vm->_dialogs->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
-					_vm->_background->drawBackgroundSprite(-1, -1, 3); // No pen there now.
+					_vm->_background->draw(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
 					_vm->_avalot->_takenPen = true;
 					_vm->_avalot->_objects[kObjectPen - 1] = true;
@@ -1506,7 +1505,7 @@ void Parser::getProc(char thing) {
 		break;
 	case kRoomRobins:
 		if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) {
-			_vm->_background->drawBackgroundSprite(-1, -1, 2);
+			_vm->_background->draw(-1, -1, 2);
 			_vm->_dialogs->displayText("Got it!");
 			_vm->_avalot->_mushroomGrowing = false;
 			_vm->_avalot->_takenMushroom = true;
@@ -1726,8 +1725,8 @@ void Parser::doThat() {
 							_vm->_avalot->_objects[kObjectBadge - 1] = false;
 							_vm->_avalot->_objects[kObjectHabit - 1] = true;
 							_vm->_avalot->_givenBadgeToIby = true;
-							_vm->_background->drawBackgroundSprite(-1, -1, 7);
-							_vm->_background->drawBackgroundSprite(-1, -1, 8);
+							_vm->_background->draw(-1, -1, 7);
+							_vm->_background->draw(-1, -1, 8);
 						} else
 							heyThanks();
 						break;
@@ -1909,7 +1908,7 @@ void Parser::doThat() {
 				_vm->_avalot->_objects[kObjectLute - 1] = true;
 				_vm->_avalot->refreshObjectList();
 				_vm->_avalot->_wonNim = true;
-				_vm->_background->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it.
+				_vm->_background->draw(-1, -1, 0); // Show the settle with no lute on it.
 				_vm->_avalot->incScore(7); // 7 points for winning!
 
 				if (_playedNim == 1)
@@ -2070,11 +2069,11 @@ void Parser::doThat() {
 					if (_alcoholLevel == 0)
 						_vm->_avalot->incScore(3);
 
-					_vm->_background->drawBackgroundSprite(-1, -1, 11);
+					_vm->_background->draw(-1, -1, 11);
 					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
 					_vm->_avalot->_drinking = _thing;
 
-					_vm->_background->drawBackgroundSprite(-1, -1, 9);
+					_vm->_background->draw(-1, -1, 9);
 					_vm->_avalot->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
@@ -2095,12 +2094,12 @@ void Parser::doThat() {
 							return;
 						}
 
-						_vm->_background->drawBackgroundSprite(-1, -1, 11);
+						_vm->_background->draw(-1, -1, 11);
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 						_vm->_dialogs->displayText(tmpStr);
 						if (_alcoholLevel == 0)
 							_vm->_avalot->incScore(3);
-						_vm->_background->drawBackgroundSprite(-1, -1, 9);
+						_vm->_background->draw(-1, -1, 9);
 						_vm->_avalot->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
@@ -2270,7 +2269,7 @@ void Parser::doThat() {
 					_vm->_avalot->_avvyIsAwake = true;
 					_vm->_avalot->incScore(1);
 					_vm->_avalot->_avvyInBed = true;
-					_vm->_background->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed.
+					_vm->_background->draw(-1, -1, 2); // Picture of Avvy, awake in bed.
 					if (_vm->_avalot->_teetotal)
 						_vm->_dialogs->displayScrollChain('d', 13);
 				} else
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index e45d668..4ec7fe6 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -68,7 +68,6 @@ public:
 	Common::String _inputTextBackup;
 	byte _inputTextPos; // Original name: curpos
 	bool _quote; // 66 or 99 next?
-	byte _leftMargin;
 	bool _cursorState;
 
 	byte _wearing; // what you're wearing
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 0d26cbb..61de6b8 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -97,7 +97,7 @@ void Sequence::callSequencer() {
 	}
 
 	if (curSeq <= 176) { // Show a frame.
-		_vm->_background->drawBackgroundSprite(-1, -1, curSeq - 1);
+		_vm->_background->draw(-1, -1, curSeq - 1);
 		shoveLeft();
 	}
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 342ed7b..52a5bff 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -229,7 +229,7 @@ void Timer::loseTimer(byte which) {
 
 void Timer::openDrawbridge() {
 	_vm->_avalot->_drawbridgeOpen++;
-	_vm->_background->drawBackgroundSprite(-1, -1, _vm->_avalot->_drawbridgeOpen - 2);
+	_vm->_background->draw(-1, -1, _vm->_avalot->_drawbridgeOpen - 2);
 
 	if (_vm->_avalot->_drawbridgeOpen == 4)
 		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
@@ -271,7 +271,7 @@ void Timer::bang2() {
 void Timer::stairs() {
 	_vm->_sound->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
-	_vm->_background->drawBackgroundSprite(-1, -1, 1);
+	_vm->_background->draw(-1, -1, 1);
 	_vm->_avalot->_brummieStairs = 2;
 	_vm->_avalot->_magics[10]._operation = Avalot::kMagicSpecial;
 	_vm->_avalot->_magics[10]._data = 2; // Reached the bottom of the stairs.
@@ -389,17 +389,17 @@ void Timer::jacquesWakesUp() {
 
 	switch (_vm->_avalot->_jacquesState) { // Additional pictures.
 	case 1 :
-		_vm->_background->drawBackgroundSprite(-1, -1, 0); // Eyes open.
+		_vm->_background->draw(-1, -1, 0); // Eyes open.
 		_vm->_dialogs->displayScrollChain('Q', 45);
 		break;
 	case 2 : // Going through the door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor.
-		_vm->_background->drawBackgroundSprite(-1, -1, 2); // But going through the door.
+		_vm->_background->draw(-1, -1, 1); // Not on the floor.
+		_vm->_background->draw(-1, -1, 2); // But going through the door.
 		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
-		_vm->_background->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either.
-		_vm->_background->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open.
+		_vm->_background->draw(-1, -1, 1); // Not on the floor, either.
+		_vm->_background->draw(-1, -1, 3); // He's gone... so the door's open.
 		_vm->_avalot->setRoom(kPeopleJacques, kRoomNowhere); // Gone!
 		break;
 	}
@@ -429,7 +429,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 	spr->walkTo(2); // He walks over to you.
 
 	// Let's get the door opening.
-	_vm->_background->drawBackgroundSprite(-1, -1, 0);
+	_vm->_background->draw(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 
@@ -445,7 +445,7 @@ void Timer::naughtyDuke2() {
 }
 
 void Timer::naughtyDuke3() {
-	_vm->_background->drawBackgroundSprite(-1, -1, 0);
+	_vm->_background->draw(-1, -1, 0);
 	_vm->_sequence->firstShow(2);
 	_vm->_sequence->startToClose();
 }
@@ -487,7 +487,7 @@ void Timer::jump() {
 		if (_vm->_avalot->_carryNum >= kCarryLimit)
 			_vm->_dialogs->displayText("You fail to grab it, because your hands are full.");
 		else {
-			_vm->_background->drawBackgroundSprite(-1, -1, 1);
+			_vm->_background->draw(-1, -1, 1);
 			_vm->_avalot->_arrowInTheDoor = false; // You've got it.
 			_vm->_avalot->_objects[kObjectBolt - 1] = true;
 			_vm->_avalot->refreshObjectList();
@@ -503,7 +503,7 @@ void Timer::crapulusSaysSpludOut() {
 }
 
 void Timer::buyDrinks() {
-	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
+	_vm->_background->draw(-1, -1, 10); // Malagauche gets up again.
 	_vm->_avalot->_malagauche = 0;
 
 	_vm->_dialogs->displayScrollChain('D', _vm->_avalot->_drinking); // Display message about it.
@@ -515,7 +515,7 @@ void Timer::buyDrinks() {
 }
 
 void Timer::buyWine() {
-	_vm->_background->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again.
+	_vm->_background->draw(-1, -1, 10); // Malagauche gets up again.
 	_vm->_avalot->_malagauche = 0;
 
 	_vm->_dialogs->displayScrollChain('D', 50); // You buy the wine.
@@ -625,7 +625,7 @@ void Timer::avvySitDown() {
 	if (avvy->_homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
-		_vm->_background->drawBackgroundSprite(-1, -1, 2);
+		_vm->_background->draw(-1, -1, 2);
 		_vm->_avalot->_sittingInPub = true;
 		_vm->_avalot->_userMovesAvvy = false;
 		avvy->_visible = false;


Commit: 5637987bd74c9d5670b6b9b1a2578717abf52dfb
    https://github.com/scummvm/scummvm/commit/5637987bd74c9d5670b6b9b1a2578717abf52dfb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T22:35:56-07:00

Commit Message:
AVALANCHE: Simplify loadMouse()

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e0881ac..c9ffdff 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1908,9 +1908,10 @@ void Avalot::loadMouse(byte which) {
 
 	for (int j = 0; j < mask.h; j++) {
 		for (int i = 0; i < mask.w; i++) {
-			for (int k = 0; k < 2; k++) {
-				if (*(byte *)mask.getBasePtr(i, j) == 0)
-					*(byte *)cursor.getBasePtr(i, j * 2 + k) = 0;
+			byte pixel = *(byte *)mask.getBasePtr(i, j);
+			if (pixel == 0) {
+				*(byte *)cursor.getBasePtr(i, j * 2    ) = 0;
+				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = 0;
 			}
 		}
 	}
@@ -1924,10 +1925,10 @@ void Avalot::loadMouse(byte which) {
 
 	for (int j = 0; j < mask.h; j++) {
 		for (int i = 0; i < mask.w; i++) {
-			for (int k = 0; k < 2; k++) {
-				byte pixel = *(byte *)mask.getBasePtr(i, j);
-				if (pixel != 0)
-					*(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel;
+			byte pixel = *(byte *)mask.getBasePtr(i, j);
+			if (pixel != 0) {
+				*(byte *)cursor.getBasePtr(i, j * 2    ) = pixel;
+				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = pixel;
 			}
 		}
 	}


Commit: 1b1655d0c859bae76ad2f418eb2f7ef62414f2da
    https://github.com/scummvm/scummvm/commit/1b1655d0c859bae76ad2f418eb2f7ef62414f2da
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T22:46:09-07:00

Commit Message:
AVALANCHE: use nullptr for empty pointers

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c9ffdff..b6c3f0b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -264,7 +264,7 @@ Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogati
 	// Needed because of Lucerna::load_also()
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++)
-			_also[i][j] = 0;
+			_also[i][j] = nullptr;
 	}
 
 	_totalTime = 0;
@@ -273,9 +273,9 @@ Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogati
 Avalot::~Avalot() {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
-			if (_also[i][j] != 0)  {
+			if (_also[i][j] != nullptr)  {
 				delete _also[i][j];
-				_also[i][j] = 0;
+				_also[i][j] = nullptr;
 			}
 		}
 	}
@@ -437,7 +437,7 @@ void Avalot::runAvalot() {
 void Avalot::init() {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++)
-			_also[i][j] = 0;
+			_also[i][j] = nullptr;
 	}
 
 #if 0
@@ -520,7 +520,7 @@ void Avalot::scram(Common::String &str) {
 void Avalot::unScramble() {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
-			if (_also[i][j] != 0)
+			if (_also[i][j] != nullptr)
 				scram(*_also[i][j]);
 		}
 	}
@@ -531,9 +531,9 @@ void Avalot::unScramble() {
 void Avalot::loadAlso(byte num) {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
-			if (_also[i][j] != 0)  {
+			if (_also[i][j] != nullptr)  {
 				delete _also[i][j];
-				_also[i][j] = 0;
+				_also[i][j] = nullptr;
 			}
 		}
 	}
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 4abdb31..30e08c7 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -761,7 +761,7 @@ void Parser::parse() {
 		// Check also[] first, which contains words about the actual room.
 		if (!thisword.empty()) {
 			for (int i = 0; i < 31; i++) {
-				if ((_vm->_avalot->_also[i][0] != 0) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) {
+				if ((_vm->_avalot->_also[i][0]) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) {
 					_thats += Common::String(99 + i);
 					notfound = false;
 				}


Commit: 890eed446c628c8087d728dcc0b9bfba74ec4fcc
    https://github.com/scummvm/scummvm/commit/890eed446c628c8087d728dcc0b9bfba74ec4fcc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-24T22:57:57-07:00

Commit Message:
AVALANCHE: rename a parameter, remove a useless (unitialized) variable, disable some menu entries

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index b6c3f0b..a315d5c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1734,8 +1734,8 @@ bool Avalot::setFlag(char x) {
 	return false;
 }
 
-bool Avalot::decreaseMoney(uint16 howmuchby) {
-	_money -= howmuchby;
+bool Avalot::decreaseMoney(uint16 amount) {
+	_money -= amount;
 	if (_money < 0) {
 		_vm->_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
 		gameOver();
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index ae4024a..bbd01d7 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -265,7 +265,6 @@ public:
 	byte _fieldNum;
 	Common::String _flags;
 	Common::String _listen;
-	Common::String _atKey; // For XTs, set to "alt-". For ATs, set to "f1".
 	byte _cp, _ledStatus, _defaultLed;
 	FontType _font;
 	bool _alive;
@@ -332,7 +331,7 @@ public:
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
 	bool setFlag(char x);
-	bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original.
+	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
 	void hangAroundForAWhile();
 	
 	Common::String getName(People whose);
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 42a787e..c3caec7 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -401,7 +401,7 @@ Common::String Menu::selectGender(byte x) {
 void Menu::setupMenuGame() {
 	_activeMenuItem.reset();
 	_activeMenuItem.setupOption("Help...", 'H', "f1", true);
-	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true);
+	_activeMenuItem.setupOption("Boss Key", 'B', "alt-B", false);
 	_activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true);
 	_activeMenuItem.setupOption("Score and rank", 'S', "f9", true);
 	_activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true);
@@ -414,7 +414,7 @@ void Menu::setupMenuFile() {
 	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
 	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_avalot->_alive);
 	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_avalot->_alive);
-	_activeMenuItem.setupOption("DOS Shell", 'D', _vm->_avalot->_atKey + '1', true);
+	_activeMenuItem.setupOption("DOS Shell", 'D', "alt-1", false);
 	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
 	_activeMenuItem.display();
 }


Commit: 6cd9bd141ce6d94c274d5fe054a36f46d6064aa0
    https://github.com/scummvm/scummvm/commit/6cd9bd141ce6d94c274d5fe054a36f46d6064aa0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-25T14:54:35-07:00

Commit Message:
AVALANCHE: Move some variables to Animation, break savegame compatibility

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 1369031..662ac52 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -414,7 +414,7 @@ void Animation::catacombMove(byte ped) {
 	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 	// catacombs has a different number for it.
 	xy_uint16 = _vm->_avalot->_catacombX + _vm->_avalot->_catacombY * 256;
-	_vm->_avalot->_geidaSpin = 0;
+	_geidaSpin = 0;
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
@@ -1025,20 +1025,20 @@ void Animation::spin(Direction dir, byte &tripnum) {
 	if (_sprites[tripnum]._id == 2)
 		return; // Not for Spludwick
 
-	_vm->_avalot->_geidaSpin += 1;
-	_vm->_avalot->_geidaTime = 20;
-	if (_vm->_avalot->_geidaSpin == 5) {
+	_geidaSpin++;
+	_geidaTime = 20;
+	if (_geidaSpin == 5) {
 		_vm->_dialogs->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
-		_vm->_avalot->_geidaSpin = 0;
-		_vm->_avalot->_geidaTime = 0; // knock out records
+		_geidaSpin = 0;
+		_geidaTime = 0; // knock out records
 	}
 }
 
 void Animation::geidaProcs(byte tripnum) {
-	if (_vm->_avalot->_geidaTime > 0) {
-		_vm->_avalot->_geidaTime--;
-		if (_vm->_avalot->_geidaTime == 0)
-			_vm->_avalot->_geidaSpin = 0;
+	if (_geidaTime > 0) {
+		_geidaTime--;
+		if (_geidaTime == 0)
+			_geidaSpin = 0;
 	}
 
 	if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
@@ -1307,8 +1307,66 @@ Direction Animation::getOldDirection() {
 	return _oldDirection;
 }
 
+void Animation::resetVariables() {
+	_geidaSpin = 0;
+	_geidaTime = 0;
+}
+
 void Animation::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_direction);
+	sz.syncAsByte(_geidaSpin);
+	sz.syncAsByte(_geidaTime);
+
+	byte spriteNum = 0;
+	if (sz.isSaving()) {
+		for (int i = 0; i < kSpriteNumbMax; i++) {
+			if (_sprites[i]._quick)
+				spriteNum++;
+		}
+	}
+	sz.syncAsByte(spriteNum);
+
+	if (sz.isLoading()) {
+		for (int i = 0; i < kSpriteNumbMax; i++) { // Deallocate sprites.
+			AnimationType *spr = &_sprites[i];
+			if (spr->_quick)
+				spr->remove();
+		}
+	}
+
+	for (int i = 0; i < spriteNum; i++) {
+		AnimationType *spr = &_sprites[i];
+		sz.syncAsByte(spr->_id);
+		sz.syncAsByte(spr->_doCheck);
+
+		if (sz.isLoading()) {
+			spr->_quick = true;
+			spr->init(spr->_id, spr->_doCheck, this);
+		}
+
+		sz.syncAsByte(spr->_moveX);
+		sz.syncAsByte(spr->_moveY);
+		sz.syncAsByte(spr->_facingDir);
+		sz.syncAsByte(spr->_stepNum);
+		sz.syncAsByte(spr->_visible);
+		sz.syncAsByte(spr->_homing);
+		sz.syncAsByte(spr->_count);
+		sz.syncAsByte(spr->_info._xWidth);
+		sz.syncAsByte(spr->_speedX);
+		sz.syncAsByte(spr->_speedY);
+		sz.syncAsByte(spr->_animCount);
+		sz.syncAsSint16LE(spr->_homingX);
+		sz.syncAsSint16LE(spr->_homingY);
+		sz.syncAsByte(spr->_callEachStepFl);
+		sz.syncAsByte(spr->_eachStepProc);
+		sz.syncAsByte(spr->_vanishIfStill);
+		sz.syncAsSint16LE(spr->_x);
+		sz.syncAsSint16LE(spr->_y);
+
+		if (sz.isLoading() && spr->_visible)
+			spr->appear(spr->_x, spr->_y, spr->_facingDir);
+	}
+
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 47fab38..1b616f9 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -136,11 +136,14 @@ public:
 	Direction getDirection();
 	Direction getOldDirection();
 
+	void resetVariables();
 	void synchronize(Common::Serializer &sz);
 private:
 	Direction _direction; // The direction Avvy is currently facing.
 	Direction _oldDirection;
 
+	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
+
 	AvalancheEngine *_vm;
 
 	byte checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0720341..cddb8ba 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -238,8 +238,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_catacombY);
 	sz.syncAsByte(_avalot->_avvysInTheCupboard);
 	sz.syncAsByte(_avalot->_geidaFollows);
-	sz.syncAsByte(_avalot->_geidaSpin);
-	sz.syncAsByte(_avalot->_geidaTime);
 	sz.syncAsByte(_avalot->_nextBell);
 	sz.syncAsByte(_avalot->_givenPotionToGeida);
 	sz.syncAsByte(_avalot->_lustieIsAsleep);
@@ -253,56 +251,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_givenPenToAyles);
 	sz.syncAsByte(_avalot->_askedDogfoodAboutNim);
 
-	byte spriteNum = 0;
-	if (sz.isSaving()) {
-		for (int i = 0; i < _animation->kSpriteNumbMax; i++) {
-			if (_animation->_sprites[i]._quick)
-				spriteNum++;
-		}
-	}
-	sz.syncAsByte(spriteNum);
-
-	if (sz.isLoading()) {
-		for (int i = 0; i < _animation->kSpriteNumbMax; i++) { // Deallocate sprites.
-			AnimationType *spr = &_animation->_sprites[i];
-			if (spr->_quick)
-				spr->remove();
-		}
-	}
-
-	for (int i = 0; i < spriteNum; i++) {
-		AnimationType *spr = &_animation->_sprites[i];
-		sz.syncAsByte(spr->_id);
-		sz.syncAsByte(spr->_doCheck);
-
-		if (sz.isLoading()) {
-			spr->_quick = true;
-			spr->init(spr->_id, spr->_doCheck, _animation);
-		}
-
-		sz.syncAsByte(spr->_moveX);
-		sz.syncAsByte(spr->_moveY);
-		sz.syncAsByte(spr->_facingDir);
-		sz.syncAsByte(spr->_stepNum);
-		sz.syncAsByte(spr->_visible);
-		sz.syncAsByte(spr->_homing);
-		sz.syncAsByte(spr->_count);
-		sz.syncAsByte(spr->_info._xWidth);
-		sz.syncAsByte(spr->_speedX);
-		sz.syncAsByte(spr->_speedY);
-		sz.syncAsByte(spr->_animCount);
-		sz.syncAsSint16LE(spr->_homingX);
-		sz.syncAsSint16LE(spr->_homingY);
-		sz.syncAsByte(spr->_callEachStepFl);
-		sz.syncAsByte(spr->_eachStepProc);
-		sz.syncAsByte(spr->_vanishIfStill);
-		sz.syncAsSint16LE(spr->_x);
-		sz.syncAsSint16LE(spr->_y);
-
-		if (sz.isLoading() && spr->_visible)
-			spr->appear(spr->_x, spr->_y, spr->_facingDir);
-	}
-
 	for (int i = 0; i < 7; i++) {
 		sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
 		sz.syncAsByte(_timer->_times[i]._action);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a315d5c..78bcc26 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1650,8 +1650,6 @@ void Avalot::resetVariables() {
 	_catacombY = 0;
 	_avvysInTheCupboard = false;
 	_geidaFollows = false;
-	_geidaSpin = 0;
-	_geidaTime = 0;
 	_nextBell = 0;
 	_givenPotionToGeida = false;
 	_lustieIsAsleep = false;
@@ -1666,6 +1664,7 @@ void Avalot::resetVariables() {
 	_askedDogfoodAboutNim = false;
 
 	_vm->_parser->resetVariables();
+	_vm->_animation->resetVariables();
 }
 
 void Avalot::newGame() {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index bbd01d7..2a5234a 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -222,7 +222,6 @@ public:
 	byte _catacombX, _catacombY;   // XY coords in the catacombs.
 	bool _avvysInTheCupboard; // On screen 22.
 	bool _geidaFollows; // Is Geida following you?
-	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
 	byte _nextBell; // For the ringing.
 	bool _givenPotionToGeida; // Does Geida have the potion?
 	bool _lustieIsAsleep; // Is BDL asleep?


Commit: 90c6e6a6899cd8af6ca01dbac80d039c9f93e8a3
    https://github.com/scummvm/scummvm/commit/90c6e6a6899cd8af6ca01dbac80d039c9f93e8a3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-25T14:57:08-07:00

Commit Message:
AVALANCHE: Janitorial - Use ++ and -- when possible

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/background.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 662ac52..11e0555 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -848,7 +848,7 @@ void Animation::callSpecial(uint16 which) {
 		break;
 	case 12: // _vm->_avalot->special 12: transfer south in catacombs.
 		_vm->_avalot->dusk();
-		_vm->_avalot->_catacombY += 1;
+		_vm->_avalot->_catacombY++;
 		catacombMove(2);
 		if (_vm->_avalot->_room != kRoomCatacombs)
 			return;
@@ -924,13 +924,13 @@ void Animation::followAvalotY(byte tripnum) {
 		_sprites[tripnum]._homingY = _sprites[1]._y;
 	else {
 		if (_sprites[tripnum]._y < _sprites[1]._y)
-			_sprites[tripnum]._y += 1;
+			_sprites[tripnum]._y++;
 		else if (_sprites[tripnum]._y > _sprites[1]._y)
-			_sprites[tripnum]._y -= 1;
+			_sprites[tripnum]._y--;
 		else
 			return;
 		if (_sprites[tripnum]._moveX == 0)  {
-			_sprites[tripnum]._stepNum += 1;
+			_sprites[tripnum]._stepNum++;
 			if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
 				_sprites[tripnum]._stepNum = 0;
 			_sprites[tripnum]._count = 0;
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index b243078..00c51be 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -73,7 +73,7 @@ void Background::update() {
 	case kRoomArgentPub:
 		if (((_vm->_avalot->_roomTime % 7) == 1) && (_vm->_avalot->_malagauche != 177)) {
 			// Malagauche cycle.
-			_vm->_avalot->_malagauche += 1;
+			_vm->_avalot->_malagauche++;
 			switch (_vm->_avalot->_malagauche) {
 			case 1:
 			case 11:
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 68bd2c2..930bb40 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -145,7 +145,7 @@ void Dialogs::scrollModeNormal() {
 		do {
 			_vm->_avalot->check(); // was "checkclick;"
 
-//#ifdef RECORD slowdown(); basher::count += 1; #endif
+//#ifdef RECORD slowdown(); basher::count++; #endif
 
 			if (_vm->_enhanced->keypressede())
 				break;
@@ -192,7 +192,7 @@ bool Dialogs::theyMatch(TuneType &played) {
 
 	for (unsigned int i = 0; i < sizeof(played); i++) {
 		if (played[i] != _vm->_avalot->kTune[i])
-			mistakes += 1;
+			mistakes++;
 	}
 
 	return mistakes < 5;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 30e08c7..064d6aa 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1386,7 +1386,7 @@ bool Parser::giveToSpludwick() {
 }
 
 void Parser::drink() {
-	_alcoholLevel += 1;
+	_alcoholLevel++;
 	if (_alcoholLevel == 5) {
 		_vm->_avalot->_objects[kObjectKey - 1] = true; // Get the key.
 		_vm->_avalot->_teetotal = true;


Commit: 8efaa45425cdb8d10d7f3fbc58a3a143c3033ff2
    https://github.com/scummvm/scummvm/commit/8efaa45425cdb8d10d7f3fbc58a3a143c3033ff2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-26T10:22:48-07:00

Commit Message:
AVALANCHE: Partially implement (there are still missing features: icon, keyboard control) the last missing type of scrolls: dialogs. Move some functions/variables, remove unused code in order to do so.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 78bcc26..42f2942 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -51,15 +51,15 @@ const char *Avalot::kVersionNum = "1.30";
 const char *Avalot::kCopyright = "1995";
 
 const MouseHotspotType Avalot::kMouseHotSpots[9] = {
-	{8,0}, // 1 - up-arrow
-	{0,0}, // 2 - screwdriver
-	{15,6}, // 3 - right-arrow
-	{0,0}, // 4 - fletch
-	{8,7}, // 5 - hourglass
-	{4,0}, // 6 - TTHand
-	{8,5}, // 7- Mark's crosshairs
-	{8,7}, // 8- I-beam
-	{0,0} // 9 - question mark
+	{8,0}, // 0 - up-arrow
+	{0,0}, // 1 - screwdriver
+	{15,6}, // 2 - right-arrow
+	{0,0}, // 3 - fletch
+	{8,7}, // 4 - hourglass
+	{4,0}, // 5 - TTHand
+	{8,5}, // 6 - Mark's crosshairs
+	{8,7}, // 7 - I-beam
+	{0,0} // 8 - question mark
 };
 
 // Art gallery at 2,1; notice about this at 2,2.
@@ -1581,14 +1581,6 @@ void Avalot::setMousePointerWait() {
 	newMouse(4);
 }
 
-void Avalot::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
-	warning("STUB: Avalot::shadow()");
-}
-
-void Avalot::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
-	warning("STUB: Avalot::shbox()");
-}
-
 void Avalot::resetVariables() {
 	_vm->_animation->setDirection(kDirUp);
 	_carryNum = 0;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 2a5234a..fa61690 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -237,7 +237,7 @@ public:
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
 	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
-	bool _dropsOk, _scReturn, _soundFx, _cheat;
+	bool _dropsOk, _soundFx, _cheat;
 	Common::String _mouseText;
 	bool _weirdWord;
 	bool _letMeOut;
@@ -324,8 +324,7 @@ public:
 	void loadMouse(byte which);
 
 	void setBackgroundColor(byte x);
-	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t);
-
+	
 	void resetVariables();
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
@@ -367,8 +366,6 @@ private:
 	int8 fades(int8 x);
 	void fadeOut(byte n);
 	void fadeIn(byte n);
-
-	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 930bb40..7eb8d50 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -178,8 +178,60 @@ void Dialogs::scrollModeNormal() {
 	warning("STUB: Scrolls::scrollModeNormal()");
 }
 
+void Dialogs::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
+	for (byte i = 0; i < 2; i ++) {
+		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x1 + i + 1, y2 - i), kColorWhite);
+		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x2 - i, y1 + i + 1), kColorWhite);
+
+		_vm->_graphics->_scrolls.fillRect(Common::Rect(x2 - i, y1 + i, x2 - i + 1, y2 - i + 1), kColorDarkgray);
+		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y2 - i, x2 - i, y2 - i + 1), kColorDarkgray);
+	}
+}
+
+void Dialogs::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text) {
+	CursorMan.showMouse(false);
+	
+	drawShadow(x1, y1, x2, y2);
+
+	bool offset = text.size() % 2;
+	x1 = (x2 - x1) / 2 + x1 - text.size() / 2 * 8 - offset * 3;
+	y1 = (y2 - y1) / 2 + y1 - 4;
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, _vm->_avalot->_font, 8, x1, y1, kColorBlue);
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, Common::String('_'), _vm->_avalot->_font, 8, x1, y1, kColorBlue);
+
+	CursorMan.showMouse(true);
+}
+
 void Dialogs::scrollModeDialogue() {
 	warning("STUB: Scrolls::scrollModeDialogue()");
+	// It should work with keypresses too! TODO: Implement it!
+
+	_vm->_avalot->loadMouse(5);
+
+	::Graphics::Surface temp;
+	temp.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+
+	Common::Event event;
+	while (!_vm->shouldQuit()) {
+		_vm->_graphics->refreshScreen();
+
+		_vm->getEvent(event);
+		Common::Point cursorPos = _vm->getMousePos();
+		cursorPos.y /= 2;
+		if (_vm->shouldQuit() || (event.type == Common::EVENT_LBUTTONUP)) {
+			if ((cursorPos.x >= _shadowBoxX - 65) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX - 5) && (cursorPos.y <= _shadowBoxY - 10)) {
+				_scReturn = true;
+				break;
+			} else if ((cursorPos.x >= _shadowBoxX + 5) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX + 65) && (cursorPos.y <= _shadowBoxY - 10)) {
+				_scReturn = false;
+				break;
+			}
+		}
+	}
+
+	_vm->_graphics->_surface.copyFrom(temp);
+	temp.free();
 }
 
 void Dialogs::store(byte what, TuneType &played) {
@@ -457,14 +509,11 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 				_vm->_avalot->_scroll[i].deleteLastChar();
 				break;
 			case kControlQuestion:
-				//settextjustify(1, 1);
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
 				_vm->_avalot->_scroll[i].setChar(' ', 0);
-				// byte groi = *_vm->_graphics->getPixel(0, 0);
-				// inc(diy,14);
-				_vm->_avalot->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
-				_vm->_avalot->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
+				drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
+				drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				break;
 			}
 
@@ -561,11 +610,6 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	resetScrollDriver();
 }
 
-bool Dialogs::displayQuestion(Common::String question) {
-	warning("STUB: Scrolls::displayQuestion()");
-	return true;
-}
-
 void Dialogs::reset() {
 	_vm->_avalot->_scrollNum = 1;
 	for (int i = 0; i < 15; i++) {
@@ -628,7 +672,7 @@ void Dialogs::callDialogDriver() {
 	_vm->_sound->stopSound();
 
 	setReadyLight(0);
-	_vm->_avalot->_scReturn = false;
+	_scReturn = false;
 	bool mouthnext = false;
 	bool call_spriterun = true; // Only call sprite_run the FIRST time.
 
@@ -670,7 +714,7 @@ void Dialogs::callDialogDriver() {
 
 				reset();
 
-				if (_vm->_avalot->_scReturn)
+				if (_scReturn)
 					return;
 				break;
 			case kControlBell:
@@ -712,7 +756,7 @@ void Dialogs::callDialogDriver() {
 
 				reset();
 
-				if (_vm->_avalot->_scReturn)
+				if (_scReturn)
 					return;
 				break;
 
@@ -809,6 +853,12 @@ void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A
 	callDialogDriver();
 }
 
+bool Dialogs::displayQuestion(Common::String question) {
+	displayText(question + kControlNewLine + kControlQuestion);
+	warning("STUB: Dialogs::displayQuestion()");
+	return _scReturn;
+}
+
 void Dialogs::loadFont() {
 	Common::File file;
 
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 9cb4470..d754eb1 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -97,10 +97,15 @@ private:
 	Common::Point _dodgeCoord;
 	byte _param; // For using arguments code
 	byte _useIcon;
+	bool _scReturn;
 
-	// These 3 functions are always passed as ScrollsFunctionType parameters.
+	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
 	void scrollModeNormal();
+	// The "asking" scroll. Used indirectly in diplayQuestion().
+	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2);
+	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
 	void scrollModeDialogue();
+	// Part of the harp mini-game.
 	void scrollModeMusic();
 
 	// These 2 are used only in musicalScroll().


Commit: df3fe7b0ec1c3afbba1539bf3cea510cef798ee1
    https://github.com/scummvm/scummvm/commit/df3fe7b0ec1c3afbba1539bf3cea510cef798ee1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T11:16:33-07:00

Commit Message:
AVALANCHE: Objectify Sequence. This commit breaks savegames.

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 11e0555..101eccb 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1177,9 +1177,7 @@ void Animation::hideInCupboard() {
 			appearPed(0, 2); // Walk out of the cupboard.
 			_vm->_dialogs->displayText("You leave the cupboard. Nice to be out of there!");
 			_vm->_avalot->_avvysInTheCupboard = false;
-			_vm->_sequence->firstShow(8);
-			_vm->_sequence->thenShow(7);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startCupboardSeq();
 		}
 	} else {
 		// Not hiding in the cupboard
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index cddb8ba..339d027 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -115,6 +115,7 @@ const char *AvalancheEngine::getCopyrightString() const {
 void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	_animation->synchronize(sz);
 	_parser->synchronize(sz);
+	_sequence->synchronize(sz);
 
 	sz.syncAsByte(_avalot->_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
@@ -256,8 +257,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(_timer->_times[i]._action);
 		sz.syncAsByte(_timer->_times[i]._reason);
 	}
-
-	sz.syncBytes(_sequence->_seq, _sequence->kSeqLength);
+	
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 42f2942..a290c73 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1017,10 +1017,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped != 0) {
 			_vm->_background->draw(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(6);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(7);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startMusicRoomSeq();
 		}
 		break;
 
@@ -1028,11 +1025,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped == 2) {
 			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(3);
-			_vm->_sequence->thenShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(4);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startNottsSeq();
 		}
 		break;
 
@@ -1040,10 +1033,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped == 2)  {
 			_vm->_background->draw(-1, -1, 5);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(6);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(7);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startMusicRoomSeq();
 		}
 		break;
 
@@ -1068,16 +1058,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
 			_vm->_background->draw(-1, -1, 0);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(1);
-			if (_arrowInTheDoor)
-				_vm->_sequence->thenShow(3);
-			else
-				_vm->_sequence->thenShow(2);
-
-			if (_takenPen)
-				_vm->_background->draw(-1, -1, 3);
-
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startCardiffSeq2();
 		} else {
 			_vm->_background->draw(-1, -1, 0);
 			if (_arrowInTheDoor)
@@ -1092,10 +1073,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped == 1)  {
 			_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(3);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startGardenSeq();
 		}
 		break;
 
@@ -1113,10 +1091,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 			_vm->_background->draw(-1, -1, 1);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(3);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startGardenSeq();
 		}
 		break;
 
@@ -1152,11 +1127,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 			// Shut the door
 			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->firstShow(3);
-			_vm->_sequence->firstShow(2);
-			_vm->_sequence->thenShow(1);
-			_vm->_sequence->thenShow(4);
-			_vm->_sequence->startToClose();
+			_vm->_sequence->startDuckSeq();
 		}
 		break;
 
@@ -1993,53 +1964,42 @@ void Avalot::openDoor(Room whither, byte ped, byte magicnum) {
 	case kRoomOutsideYours:
 	case kRoomOutsideNottsPub:
 	case kRoomOutsideDucks:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(2);
-		_vm->_sequence->thenShow(3);
+		_vm->_sequence->startOutsideSeq(whither, ped);
 		break;
 	case kRoomInsideCardiffCastle:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(5);
+		_vm->_sequence->startCardiffSeq(whither, ped);
 		break;
 	case kRoomAvvysGarden:
 	case kRoomEntranceHall:
 	case kRoomInsideAbbey:
 	case kRoomYourHall:
-		_vm->_sequence->firstShow(1);
-		_vm->_sequence->thenShow(2);
+		_vm->_sequence->startHallSeq(whither, ped);
 		break;
 	case kRoomMusicRoom:
 	case kRoomOutsideArgentPub:
-		_vm->_sequence->firstShow(5);
-		_vm->_sequence->thenShow(6);
+		_vm->_sequence->startMusicRoomSeq2(whither, ped);
 		break;
 	case kRoomLusties:
 		switch (magicnum) {
 		case 14:
 			if (_avvysInTheCupboard) {
 				_vm->_animation->hideInCupboard();
-				_vm->_sequence->firstShow(8);
-				_vm->_sequence->thenShow(7);
-				_vm->_sequence->startToClose();
+				_vm->_sequence->startLustiesSeq1();
 				return;
 			} else {
 				_vm->_animation->appearPed(0, 5);
-				_vm->_animation->_sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995
-				_vm->_sequence->firstShow(8);
-				_vm->_sequence->thenShow(9);
+				_vm->_animation->_sprites[0]._facingDir = kDirRight;
+				_vm->_sequence->startLustiesSeq2(whither, ped);
 			}
 			break;
 		case 12:
-			_vm->_sequence->firstShow(4);
-			_vm->_sequence->thenShow(5);
-			_vm->_sequence->thenShow(6);
+			_vm->_sequence->startLustiesSeq3(whither, ped);
 			break;
 		}
 		break;
+	default:
+		_vm->_sequence->startDummySeq(whither, ped);
 	}
-
-	_vm->_sequence->thenFlip(whither, ped);
-	_vm->_sequence->startToOpen();
 }
 
 void Avalot::setRoom(People persId, Room roomId) {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 064d6aa..b8b461b 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1547,10 +1547,7 @@ void Parser::playHarp() {
 
 void Parser::winSequence() {
 	_vm->_dialogs->displayScrollChain('q', 78);
-	_vm->_sequence->firstShow(7);
-	_vm->_sequence->thenShow(8);
-	_vm->_sequence->thenShow(9);
-	_vm->_sequence->startToClose();
+	_vm->_sequence->startWinSeq();
 	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
 }
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 61de6b8..472dca9 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -104,4 +104,130 @@ void Sequence::callSequencer() {
 	startToClose(); // Make sure this PROC gets called again.
 }
 
+void Sequence::startHallSeq(Room whither, byte ped) {
+	firstShow(1);
+	thenShow(2);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startOutsideSeq(Room whither, byte ped) {
+	firstShow(1);
+	thenShow(2);
+	thenShow(3);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startCardiffSeq(Room whither, byte ped) {
+	firstShow(1);
+	thenShow(5);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startNaughtyDukeSeq() {
+	firstShow(2);
+	startToClose();
+}
+
+void Sequence::startGardenSeq() {
+	firstShow(2);
+	thenShow(1);
+	thenShow(3);
+	startToClose();
+}
+
+// FIXME! 2 firstShow()!
+void Sequence::startDuckSeq() {
+	firstShow(3);
+	firstShow(2);
+	thenShow(1);
+	thenShow(4);
+	startToClose();
+}
+
+void Sequence::startNottsSeq() {
+	firstShow(3);
+	thenShow(2);
+	thenShow(1);
+	thenShow(4);
+	startToClose();
+}
+
+void Sequence::startLustiesSeq3(Room whither, byte ped) {
+	firstShow(4);
+	thenShow(5);
+	thenShow(6);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startMusicRoomSeq2(Room whither, byte ped) {
+	firstShow(5);
+	thenShow(6);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startGeidaLuteSeq() {
+	firstShow(5);
+	thenShow(6); // He falls asleep...
+	startToClose(); // Not really closing, but we're using the same procedure.
+}
+
+void Sequence::startMusicRoomSeq() {
+	firstShow(6);
+	thenShow(5);
+	thenShow(7);
+	startToClose();
+}
+
+void Sequence::startWinSeq() {
+	firstShow(7);
+	thenShow(8);
+	thenShow(9);
+	startToClose();
+}
+
+void Sequence::startCupboardSeq() {
+	firstShow(8);
+	thenShow(7);
+	startToClose();
+}
+
+void Sequence::startLustiesSeq1() {
+	firstShow(8);
+	thenShow(7);
+	startToClose();
+}
+
+void Sequence::startLustiesSeq2(Room whither, byte ped) {
+	firstShow(8);
+	thenShow(9);
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::startCardiffSeq2() {
+	firstShow(1);
+	if (_vm->_avalot->_arrowInTheDoor)
+		thenShow(3);
+	else
+		thenShow(2);
+
+	if (_vm->_avalot->_takenPen)
+		_vm->_background->draw(-1, -1, 3);
+
+	startToClose();
+}
+
+void Sequence::startDummySeq(Room whither, byte ped) {
+	thenFlip(whither, ped);
+	startToOpen();
+}
+
+void Sequence::synchronize(Common::Serializer &sz) {
+	sz.syncBytes(_seq, kSeqLength);
+}
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index a160b58..2c84abb 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -36,25 +36,45 @@ namespace Avalanche {
 class AvalancheEngine;
 
 class Sequence {
-public:
+private:
 	static const int16 kNowFlip = 177;
 	static const int16 kSeqLength = 10;
 
+public:
 	byte _seq[kSeqLength];
 
 	Sequence(AvalancheEngine *vm);
+	void synchronize(Common::Serializer &sz);
 
-	void firstShow(byte what);
-	void thenShow(byte what);
-	void thenFlip(Room where, byte ped);
-	void startToClose();
-	void startToOpen();
 	void callSequencer();
 
+	void startCupboardSeq();
+	void startMusicRoomSeq();
+	void startMusicRoomSeq2(Room whither, byte ped);
+	void startGardenSeq();
+	void startGeidaLuteSeq();
+	void startWinSeq();
+	void startNaughtyDukeSeq();
+	void startLustiesSeq1();
+	void startLustiesSeq2(Room whither, byte ped);
+	void startLustiesSeq3(Room whither, byte ped);
+	void startHallSeq(Room whither, byte ped);
+	void startCardiffSeq(Room whither, byte ped);
+	void startOutsideSeq(Room whither, byte ped);
+	void startDuckSeq();
+	void startCardiffSeq2();
+	void startNottsSeq();
+	void startDummySeq(Room whither, byte ped);
+
 private:
 	AvalancheEngine *_vm;
 
 	void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
+	void firstShow(byte what);
+	void thenShow(byte what);
+	void thenFlip(Room where, byte ped);
+	void startToClose();
+	void startToOpen();
 };
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 52a5bff..d1d25ba 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -430,8 +430,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 
 	// Let's get the door opening.
 	_vm->_background->draw(-1, -1, 0);
-	_vm->_sequence->firstShow(2);
-	_vm->_sequence->startToClose();
+	_vm->_sequence->startNaughtyDukeSeq();
 
 	addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
 }
@@ -441,13 +440,13 @@ void Timer::naughtyDuke2() {
 	_vm->_dialogs->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 	spr->walkTo(0); // Walk to the door.
 	spr->_vanishIfStill = true; // Then go away!
+
 	addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
 }
 
 void Timer::naughtyDuke3() {
 	_vm->_background->draw(-1, -1, 0);
-	_vm->_sequence->firstShow(2);
-	_vm->_sequence->startToClose();
+	_vm->_sequence->startNaughtyDukeSeq();
 }
 
 void Timer::jump() {
@@ -694,9 +693,7 @@ void Timer::giveLuteToGeida() { // Moved here from Acci.
 	_vm->_dialogs->displayScrollChain('Q', 86);
 	_vm->_avalot->incScore(4);
 	_vm->_avalot->_lustieIsAsleep = true;
-	_vm->_sequence->firstShow(5);
-	_vm->_sequence->thenShow(6); // He falls asleep...
-	_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.
+	_vm->_sequence->startGeidaLuteSeq();
 }
 
 } // End of namespace Avalanche.


Commit: 03cae64498d853c2f42dfd3e01b34cdb94b27089
    https://github.com/scummvm/scummvm/commit/03cae64498d853c2f42dfd3e01b34cdb94b27089
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-26T11:31:11-07:00

Commit Message:
AVALANCHE: Fix bug in Sequence.

Changed paths:
    engines/avalanche/sequence.cpp



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 472dca9..10e3dbc 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -138,10 +138,9 @@ void Sequence::startGardenSeq() {
 	startToClose();
 }
 
-// FIXME! 2 firstShow()!
 void Sequence::startDuckSeq() {
 	firstShow(3);
-	firstShow(2);
+	thenShow(2);
 	thenShow(1);
 	thenShow(4);
 	startToClose();


Commit: dc3471bc099b15fe79f5d5d54b6daa1dac1c4240
    https://github.com/scummvm/scummvm/commit/dc3471bc099b15fe79f5d5d54b6daa1dac1c4240
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T15:09:47-07:00

Commit Message:
AVALANCHE: Rename Sequence functions

Changed paths:
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 10e3dbc..54c7dcc 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -41,14 +41,14 @@ Sequence::Sequence(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-void Sequence::firstShow(byte what) {
+void Sequence::init(byte what) {
 	_seq[0] = what;
 
 	for (int i = 1; i < kSeqLength; i++)
 		_seq[i] = 0;
 }
 
-void Sequence::thenShow(byte what) {
+void Sequence::add(byte what) {
 	for (int16 i = 0; i < kSeqLength; i++) {
 		if (_seq[i] == 0) {
 			_seq[i] = what;
@@ -57,22 +57,22 @@ void Sequence::thenShow(byte what) {
 	}
 }
 
-void Sequence::thenFlip(Room where, byte ped) {
-	thenShow(kNowFlip);
+void Sequence::switchRoom(Room where, byte ped) {
+	add(kNowFlip);
 
 	_vm->_avalot->_flipToWhere = where;
 	_vm->_avalot->_flipToPed = ped;
 }
 
-void Sequence::startToClose() {
+void Sequence::startTimer() {
 	_vm->_timer->loseTimer(Timer::kReasonSequencer);
 	_vm->_timer->addTimer(7, Timer::kProcSequence, Timer::kReasonSequencer);
 }
 
-void Sequence::startToOpen() {
+void Sequence::startTimerImmobilized() {
 	_vm->_avalot->_userMovesAvvy = false; // They can't move.
 	_vm->_animation->stopWalking(); // And they're not moving now.
-	startToClose(); // Apart from that, it's the same thing.
+	startTimer(); // Apart from that, it's the same thing.
 }
 
 void Sequence::shoveLeft() {
@@ -101,129 +101,129 @@ void Sequence::callSequencer() {
 		shoveLeft();
 	}
 
-	startToClose(); // Make sure this PROC gets called again.
+	startTimer(); // Make sure this PROC gets called again.
 }
 
 void Sequence::startHallSeq(Room whither, byte ped) {
-	firstShow(1);
-	thenShow(2);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(1);
+	add(2);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startOutsideSeq(Room whither, byte ped) {
-	firstShow(1);
-	thenShow(2);
-	thenShow(3);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(1);
+	add(2);
+	add(3);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startCardiffSeq(Room whither, byte ped) {
-	firstShow(1);
-	thenShow(5);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(1);
+	add(5);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startNaughtyDukeSeq() {
-	firstShow(2);
-	startToClose();
+	init(2);
+	startTimer();
 }
 
 void Sequence::startGardenSeq() {
-	firstShow(2);
-	thenShow(1);
-	thenShow(3);
-	startToClose();
+	init(2);
+	add(1);
+	add(3);
+	startTimer();
 }
 
 void Sequence::startDuckSeq() {
-	firstShow(3);
-	thenShow(2);
-	thenShow(1);
-	thenShow(4);
-	startToClose();
+	init(3);
+	add(2);
+	add(1);
+	add(4);
+	startTimer();
 }
 
 void Sequence::startNottsSeq() {
-	firstShow(3);
-	thenShow(2);
-	thenShow(1);
-	thenShow(4);
-	startToClose();
+	init(3);
+	add(2);
+	add(1);
+	add(4);
+	startTimer();
 }
 
 void Sequence::startLustiesSeq3(Room whither, byte ped) {
-	firstShow(4);
-	thenShow(5);
-	thenShow(6);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(4);
+	add(5);
+	add(6);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startMusicRoomSeq2(Room whither, byte ped) {
-	firstShow(5);
-	thenShow(6);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(5);
+	add(6);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startGeidaLuteSeq() {
-	firstShow(5);
-	thenShow(6); // He falls asleep...
-	startToClose(); // Not really closing, but we're using the same procedure.
+	init(5);
+	add(6); // He falls asleep...
+	startTimer(); // Not really closing, but we're using the same procedure.
 }
 
 void Sequence::startMusicRoomSeq() {
-	firstShow(6);
-	thenShow(5);
-	thenShow(7);
-	startToClose();
+	init(6);
+	add(5);
+	add(7);
+	startTimer();
 }
 
 void Sequence::startWinSeq() {
-	firstShow(7);
-	thenShow(8);
-	thenShow(9);
-	startToClose();
+	init(7);
+	add(8);
+	add(9);
+	startTimer();
 }
 
 void Sequence::startCupboardSeq() {
-	firstShow(8);
-	thenShow(7);
-	startToClose();
+	init(8);
+	add(7);
+	startTimer();
 }
 
 void Sequence::startLustiesSeq1() {
-	firstShow(8);
-	thenShow(7);
-	startToClose();
+	init(8);
+	add(7);
+	startTimer();
 }
 
 void Sequence::startLustiesSeq2(Room whither, byte ped) {
-	firstShow(8);
-	thenShow(9);
-	thenFlip(whither, ped);
-	startToOpen();
+	init(8);
+	add(9);
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::startCardiffSeq2() {
-	firstShow(1);
+	init(1);
 	if (_vm->_avalot->_arrowInTheDoor)
-		thenShow(3);
+		add(3);
 	else
-		thenShow(2);
+		add(2);
 
 	if (_vm->_avalot->_takenPen)
 		_vm->_background->draw(-1, -1, 3);
 
-	startToClose();
+	startTimer();
 }
 
 void Sequence::startDummySeq(Room whither, byte ped) {
-	thenFlip(whither, ped);
-	startToOpen();
+	switchRoom(whither, ped);
+	startTimerImmobilized();
 }
 
 void Sequence::synchronize(Common::Serializer &sz) {
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 2c84abb..b026ef3 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -70,11 +70,11 @@ private:
 	AvalancheEngine *_vm;
 
 	void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
-	void firstShow(byte what);
-	void thenShow(byte what);
-	void thenFlip(Room where, byte ped);
-	void startToClose();
-	void startToOpen();
+	void init(byte what);
+	void add(byte what);
+	void switchRoom(Room where, byte ped);
+	void startTimer();
+	void startTimerImmobilized();
 };
 
 } // End of namespace Avalanche.


Commit: 75cbbda822714fdc07906adcdb123a2eab217089
    https://github.com/scummvm/scummvm/commit/75cbbda822714fdc07906adcdb123a2eab217089
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T15:21:59-07:00

Commit Message:
AVALANCHE: More function deduplication, remove a magic value

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index a290c73..397d1b7 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1025,7 +1025,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped == 2) {
 			_vm->_background->draw(-1, -1, 2);
 			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startNottsSeq();
+			_vm->_sequence->startDuckSeq();
 		}
 		break;
 
@@ -1984,7 +1984,7 @@ void Avalot::openDoor(Room whither, byte ped, byte magicnum) {
 		case 14:
 			if (_avvysInTheCupboard) {
 				_vm->_animation->hideInCupboard();
-				_vm->_sequence->startLustiesSeq1();
+				_vm->_sequence->startCupboardSeq();
 				return;
 			} else {
 				_vm->_animation->appearPed(0, 5);
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 54c7dcc..707cd9f 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -88,10 +88,11 @@ void Sequence::callSequencer() {
 	case 0:
 		return; // No more routines.
 		break;
-	case 177: // Flip room.
+	case kNowFlip: // Flip room.
 		_vm->_avalot->_userMovesAvvy = true;
 		_vm->_avalot->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
-		if (curSeq == 177)
+		// CHECKME: Always true?
+		if (curSeq == kNowFlip)
 			shoveLeft();
 		break;
 	}
@@ -146,14 +147,6 @@ void Sequence::startDuckSeq() {
 	startTimer();
 }
 
-void Sequence::startNottsSeq() {
-	init(3);
-	add(2);
-	add(1);
-	add(4);
-	startTimer();
-}
-
 void Sequence::startLustiesSeq3(Room whither, byte ped) {
 	init(4);
 	add(5);
@@ -195,12 +188,6 @@ void Sequence::startCupboardSeq() {
 	startTimer();
 }
 
-void Sequence::startLustiesSeq1() {
-	init(8);
-	add(7);
-	startTimer();
-}
-
 void Sequence::startLustiesSeq2(Room whither, byte ped) {
 	init(8);
 	add(9);
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index b026ef3..7f16485 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -55,7 +55,6 @@ public:
 	void startGeidaLuteSeq();
 	void startWinSeq();
 	void startNaughtyDukeSeq();
-	void startLustiesSeq1();
 	void startLustiesSeq2(Room whither, byte ped);
 	void startLustiesSeq3(Room whither, byte ped);
 	void startHallSeq(Room whither, byte ped);
@@ -63,7 +62,6 @@ public:
 	void startOutsideSeq(Room whither, byte ped);
 	void startDuckSeq();
 	void startCardiffSeq2();
-	void startNottsSeq();
 	void startDummySeq(Room whither, byte ped);
 
 private:


Commit: e166f6fc44be9322cd502520af0cd1daa6b07813
    https://github.com/scummvm/scummvm/commit/e166f6fc44be9322cd502520af0cd1daa6b07813
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T15:33:08-07:00

Commit Message:
AVALANCHE: Move a couple of variables to Sequence, more private variables

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/sequence.cpp
    engines/avalanche/sequence.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 339d027..222414c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -242,8 +242,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_avalot->_nextBell);
 	sz.syncAsByte(_avalot->_givenPotionToGeida);
 	sz.syncAsByte(_avalot->_lustieIsAsleep);
-	sz.syncAsByte(_avalot->_flipToWhere);
-	sz.syncAsByte(_avalot->_flipToPed);
 	sz.syncAsByte(_avalot->_beenTiedUp);
 	sz.syncAsByte(_avalot->_sittingInPub);
 	sz.syncAsByte(_avalot->_spurgeTalkCount);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 397d1b7..6bf1b46 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1616,8 +1616,6 @@ void Avalot::resetVariables() {
 	_nextBell = 0;
 	_givenPotionToGeida = false;
 	_lustieIsAsleep = false;
-	_flipToWhere = kRoomNowhere;
-	_flipToPed = 0;
 	_beenTiedUp = false;
 	_sittingInPub = false;
 	_spurgeTalkCount = 0;
@@ -1628,6 +1626,7 @@ void Avalot::resetVariables() {
 
 	_vm->_parser->resetVariables();
 	_vm->_animation->resetVariables();
+	_vm->_sequence->resetVariables();
 }
 
 void Avalot::newGame() {
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index fa61690..a80d80d 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -225,8 +225,6 @@ public:
 	byte _nextBell; // For the ringing.
 	bool _givenPotionToGeida; // Does Geida have the potion?
 	bool _lustieIsAsleep; // Is BDL asleep?
-	Room _flipToWhere;
-	byte _flipToPed; // For the sequencer.
 	bool _beenTiedUp; // In r__Robins.
 	bool _sittingInPub; // Are you sitting down in the pub?
 	byte _spurgeTalkCount; // Count for talking to Spurge.
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index 707cd9f..bbbbf62 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -41,6 +41,11 @@ Sequence::Sequence(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
+void Sequence::resetVariables() {
+	_flipToWhere = kRoomNowhere;
+	_flipToPed = 0;
+}
+
 void Sequence::init(byte what) {
 	_seq[0] = what;
 
@@ -60,8 +65,8 @@ void Sequence::add(byte what) {
 void Sequence::switchRoom(Room where, byte ped) {
 	add(kNowFlip);
 
-	_vm->_avalot->_flipToWhere = where;
-	_vm->_avalot->_flipToPed = ped;
+	_flipToWhere = where;
+	_flipToPed = ped;
 }
 
 void Sequence::startTimer() {
@@ -90,7 +95,7 @@ void Sequence::callSequencer() {
 		break;
 	case kNowFlip: // Flip room.
 		_vm->_avalot->_userMovesAvvy = true;
-		_vm->_avalot->flipRoom(_vm->_avalot->_flipToWhere, _vm->_avalot->_flipToPed);
+		_vm->_avalot->flipRoom(_flipToWhere, _flipToPed);
 		// CHECKME: Always true?
 		if (curSeq == kNowFlip)
 			shoveLeft();
@@ -215,5 +220,7 @@ void Sequence::startDummySeq(Room whither, byte ped) {
 
 void Sequence::synchronize(Common::Serializer &sz) {
 	sz.syncBytes(_seq, kSeqLength);
+	sz.syncAsByte(_flipToWhere);
+	sz.syncAsByte(_flipToPed);
 }
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 7f16485..94025ba 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -27,8 +27,8 @@
 
 /* SEQUENCE		The sequencer. */
 
-#ifndef AVALANCHE_SEQUENCE2_H
-#define AVALANCHE_SEQUENCE2_H
+#ifndef AVALANCHE_SEQUENCE_H
+#define AVALANCHE_SEQUENCE_H
 
 #include "common/scummsys.h"
 
@@ -40,12 +40,24 @@ private:
 	static const int16 kNowFlip = 177;
 	static const int16 kSeqLength = 10;
 
-public:
 	byte _seq[kSeqLength];
 
+	Room _flipToWhere;
+	byte _flipToPed;
+
+	AvalancheEngine *_vm;
+
+	void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
+	void init(byte what);
+	void add(byte what);
+	void switchRoom(Room where, byte ped);
+	void startTimer();
+	void startTimerImmobilized();
+
+public:
 	Sequence(AvalancheEngine *vm);
 	void synchronize(Common::Serializer &sz);
-
+	void resetVariables();
 	void callSequencer();
 
 	void startCupboardSeq();
@@ -63,18 +75,8 @@ public:
 	void startDuckSeq();
 	void startCardiffSeq2();
 	void startDummySeq(Room whither, byte ped);
-
-private:
-	AvalancheEngine *_vm;
-
-	void shoveLeft(); // This is called by Timer when it's time to do another frame. It shifts everything to the left.
-	void init(byte what);
-	void add(byte what);
-	void switchRoom(Room where, byte ped);
-	void startTimer();
-	void startTimerImmobilized();
 };
 
 } // End of namespace Avalanche.
 
-#endif // AVALANCHE_SEQUENCE2_H
+#endif // AVALANCHE_SEQUENCE_H


Commit: 08883a807f8c568109430910836aeee6b96b64f2
    https://github.com/scummvm/scummvm/commit/08883a807f8c568109430910836aeee6b96b64f2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T16:34:38-07:00

Commit Message:
AVALANCHE: Merge Avalot and AvalancheEngine

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/background.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 101eccb..cb64bb8 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -147,8 +147,8 @@ void AnimationType::turn(Direction whichway) {
 void AnimationType::appear(int16 wx, int16 wy, Direction wf) {
 	_x = (wx / 8) * 8;
 	_y = wy;
-	_oldX[_anim->_vm->_avalot->_cp] = wx;
-	_oldY[_anim->_vm->_avalot->_cp] = wy;
+	_oldX[_anim->_vm->_cp] = wx;
+	_oldY[_anim->_vm->_cp] = wy;
 	turn(wf);
 	_visible = true;
 	_moveX = 0;
@@ -180,9 +180,9 @@ void AnimationType::walk() {
 		r._y2 = _y + _info._yLength + 2;
 	}
 
-	if (!_anim->_vm->_avalot->_doingSpriteRun) {
-		_oldX[_anim->_vm->_avalot->_cp] = _x;
-		_oldY[_anim->_vm->_avalot->_cp] = _y;
+	if (!_anim->_vm->_doingSpriteRun) {
+		_oldX[_anim->_vm->_cp] = _x;
+		_oldY[_anim->_vm->_cp] = _y;
 		if (_homing)
 			homeStep();
 		_x += _moveX;
@@ -195,40 +195,40 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_avalot->_cp], _y, _info._yLength) - 1;
+		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((magicColor != 255) & (!_anim->_vm->_avalot->_doingSpriteRun)) {
-			MagicType *magic = &_anim->_vm->_avalot->_magics[magicColor];
+		if ((magicColor != 255) & (!_anim->_vm->_doingSpriteRun)) {
+			MagicType *magic = &_anim->_vm->_magics[magicColor];
 			switch (magic->_operation) {
-			case Avalot::kMagicExclaim:
+			case AvalancheEngine::kMagicExclaim:
 				bounce();
 				_anim->_mustExclaim = true;
 				_anim->_sayWhat = magic->_data;
 				break;
-			case Avalot::kMagicBounce:
+			case AvalancheEngine::kMagicBounce:
 				bounce();
 				break;
-			case Avalot::kMagicTransport:
-				_anim->_vm->_avalot->flipRoom((Room)(magic->_data >> 8), magic->_data & 0xff);
+			case AvalancheEngine::kMagicTransport:
+				_anim->_vm->flipRoom((Room)(magic->_data >> 8), magic->_data & 0xff);
 				break;
-			case Avalot::kMagicUnfinished: {
+			case AvalancheEngine::kMagicUnfinished: {
 				bounce();
 				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Dialogs::kControlBell, Dialogs::kControlCenter, Dialogs::kControlRoman);
 				_anim->_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
-			case Avalot::kMagicSpecial:
+			case AvalancheEngine::kMagicSpecial:
 				_anim->callSpecial(magic->_data);
 				break;
-			case Avalot::kMagicOpenDoor:
-				_anim->_vm->_avalot->openDoor((Room)(magic->_data >> 8), magic->_data & 0xff, magicColor);
+			case AvalancheEngine::kMagicOpenDoor:
+				_anim->_vm->openDoor((Room)(magic->_data >> 8), magic->_data & 0xff, magicColor);
 				break;
 			}
 		}
 	}
 
-	if (!_anim->_vm->_avalot->_doingSpriteRun) {
+	if (!_anim->_vm->_doingSpriteRun) {
 		_count++;
 		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
 			_stepNum++;
@@ -240,13 +240,13 @@ void AnimationType::walk() {
 }
 
 void AnimationType::bounce() {
-	_x = _oldX[_anim->_vm->_avalot->_cp];
-	_y = _oldY[_anim->_vm->_avalot->_cp];
+	_x = _oldX[_anim->_vm->_cp];
+	_y = _oldY[_anim->_vm->_cp];
 	if (_doCheck)
 		_anim->stopWalking();
 	else
 		stopWalk();
-	_anim->_vm->_avalot->drawDirection();
+	_anim->_vm->drawDirection();
 }
 
 int8 AnimationType::getSign(int16 val) {
@@ -259,7 +259,7 @@ int8 AnimationType::getSign(int16 val) {
 }
 
 void AnimationType::walkTo(byte pedNum) {
-	PedType *curPed = &_anim->_vm->_avalot->_peds[pedNum];
+	PedType *curPed = &_anim->_vm->_peds[pedNum];
 
 	setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y));
 	_homingX = curPed->_x - _info._xLength / 2;
@@ -327,10 +327,10 @@ void AnimationType::stopWalk() {
 }
 
 void AnimationType::chatter() {
-	_anim->_vm->_avalot->_talkX = _x + _info._xLength / 2;
-	_anim->_vm->_avalot->_talkY = _y;
-	_anim->_vm->_avalot->_talkFontColor = _stat._fgBubbleCol;
-	_anim->_vm->_avalot->_talkBackgroundColor = _stat._bgBubbleCol;
+	_anim->_vm->_talkX = _x + _info._xLength / 2;
+	_anim->_vm->_talkY = _y;
+	_anim->_vm->_talkFontColor = _stat._fgBubbleCol;
+	_anim->_vm->_talkBackgroundColor = _stat._bgBubbleCol;
 }
 
 void AnimationType::remove() {
@@ -368,7 +368,7 @@ void Animation::resetAnims() {
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
-	if (!_vm->_avalot->_alive)
+	if (!_vm->_alive)
 		return 0;
 
 	if (x1 < 0)
@@ -413,98 +413,98 @@ void Animation::catacombMove(byte ped) {
 
 	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
 	// catacombs has a different number for it.
-	xy_uint16 = _vm->_avalot->_catacombX + _vm->_avalot->_catacombY * 256;
+	xy_uint16 = _vm->_catacombX + _vm->_catacombY * 256;
 	_geidaSpin = 0;
 
 	switch (xy_uint16) {
 	case 1801: // Exit catacombs
-		_vm->_avalot->flipRoom(kRoomLustiesRoom, 4);
+		_vm->flipRoom(kRoomLustiesRoom, 4);
 		_vm->_dialogs->displayText("Phew! Nice to be out of there!");
 		return;
 	case 1033:{ // Oubliette
-		_vm->_avalot->flipRoom(kRoomOubliette, 1);
+		_vm->flipRoom(kRoomOubliette, 1);
 		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		return;
 	case 4:
-		_vm->_avalot->flipRoom(kRoomGeidas, 1);
+		_vm->flipRoom(kRoomGeidas, 1);
 		return;
 	case 2307:
-		_vm->_avalot->flipRoom(kRoomLusties, 5);
+		_vm->flipRoom(kRoomLusties, 5);
 		_vm->_dialogs->displayText("Oh no... here we go again...");
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_userMovesAvvy = false;
 		_sprites[0]._moveY = 1;
 		_sprites[0]._moveX = 0;
 		return;
 	}
 
-	if (!_vm->_avalot->_enterCatacombsFromLustiesRoom)
-		_vm->_avalot->loadRoom(29);
-	here = _vm->_avalot->kCatacombMap[_vm->_avalot->_catacombY - 1][_vm->_avalot->_catacombX - 1];
+	if (!_vm->_enterCatacombsFromLustiesRoom)
+		_vm->loadRoom(29);
+	here = _vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicNothing; // No door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // No door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[4]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // Sloping wall.
-		_vm->_avalot->_magics[2]._operation = Avalot::kMagicSpecial; // Straight wall.
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing; // Sloping wall.
+		_vm->_magics[2]._operation = AvalancheEngine::kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -512,127 +512,127 @@ void Animation::catacombMove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 19); // ...door, and...
 		_vm->_background->draw(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // No door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // No door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 20); // ...door, and...
 		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_avalot->_magics[4]._operation = Avalot::kMagicNothing; // Sloping wall.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicSpecial; // Straight wall.
-		_vm->_avalot->_portals[6]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = AvalancheEngine::kMagicNothing; // Sloping wall.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicSpecial; // Straight wall.
+		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
 		break;
 	}
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
+		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_background->draw(-1, -1, 21);
 
-		if ((xy_uint16 == 2051) && (_vm->_avalot->_geidaFollows))
-			_vm->_avalot->_magics[12]._operation = Avalot::kMagicExclaim;
+		if ((xy_uint16 == 2051) && (_vm->_geidaFollows))
+			_vm->_magics[12]._operation = AvalancheEngine::kMagicExclaim;
 		else
-			_vm->_avalot->_magics[12]._operation = Avalot::kMagicSpecial; // Right exit south.
+			_vm->_magics[12]._operation = AvalancheEngine::kMagicSpecial; // Right exit south.
 
-		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
+		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_background->draw(-1, -1, 22);
-		_vm->_avalot->_magics[6]._operation = Avalot::kMagicSpecial; // Middle exit south.
-		_vm->_avalot->_magics[11]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
+		_vm->_magics[6]._operation = AvalancheEngine::kMagicSpecial; // Middle exit south.
+		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_background->draw(-1, -1, 23);
-		_vm->_avalot->_magics[11]._operation = Avalot::kMagicSpecial; // Left exit south.
-		_vm->_avalot->_magics[6]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_magics[12]._operation = Avalot::kMagicBounce;
+		_vm->_magics[11]._operation = AvalancheEngine::kMagicSpecial; // Left exit south.
+		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
 		break;
 	// LEFT handles:
 #if 0
 	case 0x1:
 		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
+		_vm->magics[1].op = _vm->bounces; // { Left exit north. } { Change magic number! }
+		_vm->portals[12].op = _vm->special; // { Door. }
 		break;
 #endif
 	case 0x2:
 		_vm->_background->draw(-1, -1, 3);
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce; // Middle exit north.
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
 		_vm->_celer->show_one(-1, -1, 4);
-		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Right exit north. } { Change magic number! }
-		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
+		_vm->magics[1].op = _vm->bounces; // { Right exit north. } { Change magic number! }
+		_vm->portals[12].op = _vm->special; // { Door. }
 		break;
 	// RIGHT handles:
 	case 0x4:
 		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Left exit north. } { Change magic number! }
-		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
+		_vm->magics[1].op = _vm->bounces; // { Left exit north. } { Change magic number! }
+		_vm->portals[12].op = _vm->special; // { Door. }
 		break;
 #endif
 	case 0x5:
 		_vm->_background->draw(-1, -1, 2);
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce; // Middle exit north.
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce; // Middle exit north.
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
 		_vm->_celer->show_one(-1, -1, 3);
-		_vm->_avalot->magics[1].op = _vm->_avalot->bounces; // { Right exit north. }
-		_vm->_avalot->portals[12].op = _vm->_avalot->special; // { Door. }
+		_vm->magics[1].op = _vm->bounces; // { Right exit north. }
+		_vm->portals[12].op = _vm->special; // { Door. }
 		break;
 #endif
 	// ARCHWAYS:
@@ -646,25 +646,25 @@ void Animation::catacombMove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_background->draw(-1, -1, 31);
 
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicSpecial; // Middle arch north.
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicSpecial; // Middle arch north.
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
 		break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicBounce;
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_avalot->_magics[0]._operation = Avalot::kMagicNothing; // Door to Geida's room.
+		_vm->_magics[0]._operation = AvalancheEngine::kMagicNothing; // Door to Geida's room.
 		_vm->_background->draw(-1, -1, 0);
-		_vm->_avalot->_portals[3]._operation = Avalot::kMagicSpecial; // Door.
+		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
 		break;
 	}
 
@@ -700,7 +700,7 @@ void Animation::catacombMove(byte ped) {
 		break; // [1,1] : the other two.
 	}
 
-	if ((_vm->_avalot->_geidaFollows) && (ped > 0)) {
+	if ((_vm->_geidaFollows) && (ped > 0)) {
 		if (!_sprites[1]._quick)  // If we don't already have her...
 			_sprites[1].init(5, true, this); // ...Load Geida.
 		appearPed(1, geidaPed(ped));
@@ -709,36 +709,36 @@ void Animation::catacombMove(byte ped) {
 	}
 }
 
-// This proc gets called whenever you touch a line defined as _vm->_avalot->special.
+// This proc gets called whenever you touch a line defined as _vm->special.
 void Animation::dawnDelay() {
 	_vm->_timer->addTimer(2, Timer::kProcDawnDelay, Timer::kReasonDawndelay);
 }
 
 void Animation::callSpecial(uint16 which) {
 	switch (which) {
-	case 1: // _vm->_avalot->special 1: Room 22: top of stairs.
+	case 1: // _vm->special 1: Room 22: top of stairs.
 		_vm->_background->draw(-1, -1, 0);
-		_vm->_avalot->_brummieStairs = 1;
-		_vm->_avalot->_magics[9]._operation = Avalot::kMagicNothing;
+		_vm->_brummieStairs = 1;
+		_vm->_magics[9]._operation = AvalancheEngine::kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
 		stopWalking();
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_userMovesAvvy = false;
 		break;
-	case 2: // _vm->_avalot->special 2: Room 22: bottom of stairs.
-		_vm->_avalot->_brummieStairs = 3;
-		_vm->_avalot->_magics[10]._operation = Avalot::kMagicNothing;
-		_vm->_avalot->_magics[11]._operation = Avalot::kMagicExclaim;
-		_vm->_avalot->_magics[11]._data = 5;
-		_vm->_avalot->_magics[3]._operation = Avalot::kMagicBounce; // Now works as planned!
+	case 2: // _vm->special 2: Room 22: bottom of stairs.
+		_vm->_brummieStairs = 3;
+		_vm->_magics[10]._operation = AvalancheEngine::kMagicNothing;
+		_vm->_magics[11]._operation = AvalancheEngine::kMagicExclaim;
+		_vm->_magics[11]._data = 5;
+		_vm->_magics[3]._operation = AvalancheEngine::kMagicBounce; // Now works as planned!
 		stopWalking();
 		_vm->_dialogs->displayScrollChain('q', 26);
-		_vm->_avalot->_userMovesAvvy = true;
+		_vm->_userMovesAvvy = true;
 		break;
-	case 3: // _vm->_avalot->special 3: Room 71: triggers dart.
+	case 3: // _vm->special 3: Room 71: triggers dart.
 		_sprites[0].bounce(); // Must include that.
 
-		if (!_vm->_avalot->_arrowTriggered) {
-			_vm->_avalot->_arrowTriggered = true;
+		if (!_vm->_arrowTriggered) {
+			_vm->_arrowTriggered = true;
 			appearPed(1, 3); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
@@ -752,80 +752,80 @@ void Animation::callSpecial(uint16 which) {
 		}
 		break;
 	case 4: // This is the ghost room link.
-		_vm->_avalot->dusk();
+		_vm->dusk();
 		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
 		//_vm->_enid->backToBootstrap(3); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		if (_vm->_avalot->_friarWillTieYouUp) {
-			// _vm->_avalot->special 5: Room 42: touched tree, and get tied up.
-			_vm->_avalot->_magics[4]._operation = Avalot::kMagicBounce; // Boundary effect is now working again.
+		if (_vm->_friarWillTieYouUp) {
+			// _vm->special 5: Room 42: touched tree, and get tied up.
+			_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Boundary effect is now working again.
 			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_background->draw(-1, -1, 1);
 			_vm->_dialogs->displayScrollChain('q', 36);
-			_vm->_avalot->_tiedUp = true;
-			_vm->_avalot->_friarWillTieYouUp = false;
+			_vm->_tiedUp = true;
+			_vm->_friarWillTieYouUp = false;
 			_sprites[1].walkTo(2);
 			_sprites[1]._vanishIfStill = true;
 			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
-			_vm->_avalot->setRoom(kPeopleFriarTuck, kRoomDummy); // Not here, then.
+			_vm->setRoom(kPeopleFriarTuck, kRoomDummy); // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
-	case 6: // _vm->_avalot->special 6: fall down oubliette.
-		_vm->_avalot->_userMovesAvvy = false;
+	case 6: // _vm->special 6: fall down oubliette.
+		_vm->_userMovesAvvy = false;
 		_sprites[0]._moveX = 3;
 		_sprites[0]._moveY = 0;
 		_sprites[0]._facingDir = kDirRight;
 		_vm->_timer->addTimer(1, Timer::kProcFallDownOubliette, Timer::kReasonFallingDownOubliette);
 		break;
-	case 7: // _vm->_avalot->special 7: stop falling down oubliette.
+	case 7: // _vm->special 7: stop falling down oubliette.
 		_sprites[0]._visible = false;
-		_vm->_avalot->_magics[9]._operation = Avalot::kMagicNothing;
+		_vm->_magics[9]._operation = AvalancheEngine::kMagicNothing;
 		stopWalking();
 		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
-		//_vm->_avalot->mblit(12, 80, 38, 160, 3, 0);
-		//_vm->_avalot->mblit(12, 80, 38, 160, 3, 1);
+		//_vm->mblit(12, 80, 38, 160, 3, 0);
+		//_vm->mblit(12, 80, 38, 160, 3, 1);
 		_vm->_dialogs->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
 		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
-	case 8:        // _vm->_avalot->special 8: leave du Lustie's room.
-		if ((_vm->_avalot->_geidaFollows) && (!_vm->_avalot->_lustieIsAsleep)) {
+	case 8:        // _vm->special 8: leave du Lustie's room.
+		if ((_vm->_geidaFollows) && (!_vm->_lustieIsAsleep)) {
 			_vm->_dialogs->displayScrollChain('q', 63);
 			_sprites[1].turn(kDirDown);
 			_sprites[1].stopWalk();
 			_sprites[1]._callEachStepFl = false; // Geida
-			_vm->_avalot->gameOver();
+			_vm->gameOver();
 		}
 		break;
-	case 9: // _vm->_avalot->special 9: lose Geida to Robin Hood...
-		if (!_vm->_avalot->_geidaFollows)
+	case 9: // _vm->special 9: lose Geida to Robin Hood...
+		if (!_vm->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
 		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
 		_sprites[1].walkTo(3); // She walks to somewhere...
 		_sprites[0].remove();     // Lose Avvy.
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
 		break;
-	case 10: // _vm->_avalot->special 10: transfer north in catacombs.
-		if ((_vm->_avalot->_catacombX == 4) && (_vm->_avalot->_catacombY == 1)) {
+	case 10: // _vm->special 10: transfer north in catacombs.
+		if ((_vm->_catacombX == 4) && (_vm->_catacombY == 1)) {
 			// Into Geida's room.
-			if (_vm->_avalot->_objects[kObjectKey - 1])
+			if (_vm->_objects[kObjectKey - 1])
 				_vm->_dialogs->displayScrollChain('q', 62);
 			else {
 				_vm->_dialogs->displayScrollChain('q', 61);
 				return;
 			}
 		}
-		_vm->_avalot->dusk();
-		_vm->_avalot->_catacombY--;
+		_vm->dusk();
+		_vm->_catacombY--;
 		catacombMove(4);
-		if (_vm->_avalot->_room != kRoomCatacombs)
+		if (_vm->_room != kRoomCatacombs)
 			return;
-		switch ((_vm->_avalot->kCatacombMap[_vm->_avalot->_catacombY - 1][_vm->_avalot->_catacombX - 1] & 0xf00) >> 8) {
+		switch ((_vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			appearPed(0, 11);
 			break;
@@ -837,29 +837,29 @@ void Animation::callSpecial(uint16 which) {
 		}
 		dawnDelay();
 		break;
-	case 11: // _vm->_avalot->special 11: transfer east in catacombs.
-		_vm->_avalot->dusk();
-		_vm->_avalot->_catacombX++;
+	case 11: // _vm->special 11: transfer east in catacombs.
+		_vm->dusk();
+		_vm->_catacombX++;
 		catacombMove(1);
-		if (_vm->_avalot->_room != kRoomCatacombs)
+		if (_vm->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 0);
 		dawnDelay();
 		break;
-	case 12: // _vm->_avalot->special 12: transfer south in catacombs.
-		_vm->_avalot->dusk();
-		_vm->_avalot->_catacombY++;
+	case 12: // _vm->special 12: transfer south in catacombs.
+		_vm->dusk();
+		_vm->_catacombY++;
 		catacombMove(2);
-		if (_vm->_avalot->_room != kRoomCatacombs)
+		if (_vm->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 1);
 		dawnDelay();
 		break;
-	case 13: // _vm->_avalot->special 13: transfer west in catacombs.
-		_vm->_avalot->dusk();
-		_vm->_avalot->_catacombX--;
+	case 13: // _vm->special 13: transfer west in catacombs.
+		_vm->dusk();
+		_vm->_catacombX--;
 		catacombMove(3);
-		if (_vm->_avalot->_room != kRoomCatacombs)
+		if (_vm->_room != kRoomCatacombs)
 			return;
 		appearPed(0, 2);
 		dawnDelay();
@@ -872,7 +872,7 @@ void Animation::updateSpeed() {
 
 	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
 
-	if (_sprites[0]._speedX == _vm->_avalot->kRun) {
+	if (_sprites[0]._speedX == _vm->kRun) {
 		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	} else {
@@ -912,7 +912,7 @@ void Animation::setMoveSpeed(byte t, Direction dir) {
 
 void Animation::appearPed(byte sprNum, byte pedNum) {
 	AnimationType *curSpr = &_sprites[sprNum];
-	PedType *curPed = &_vm->_avalot->_peds[pedNum];
+	PedType *curPed = &_vm->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
 	setMoveSpeed(sprNum, curPed->_direction);
 }
@@ -972,15 +972,15 @@ void Animation::arrowProcs(byte tripnum) {
 			_vm->_dialogs->displayScrollChain('Q', 47); // Complaint!
 			_sprites[tripnum].remove(); // Deallocate the arrow.
 
-			_vm->_avalot->gameOver();
+			_vm->gameOver();
 
-			_vm->_avalot->_userMovesAvvy = false; // Stop the user from moving him.
+			_vm->_userMovesAvvy = false; // Stop the user from moving him.
 			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
 		_sprites[tripnum].remove(); // Deallocate the arrow.
 		_vm->_background->draw(-1, -1, 2); // Show pic of arrow stuck into the door.
-		_vm->_avalot->_arrowInTheDoor = true; // So that we can pick it up.
+		_vm->_arrowInTheDoor = true; // So that we can pick it up.
 	}
 
 }
@@ -1114,7 +1114,7 @@ void Animation::drawSprites() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	if (_vm->_menu->isActive() | _vm->_avalot->_onToolbar | _vm->_avalot->_seeScroll)
+	if (_vm->_menu->isActive() | _vm->_onToolbar | _vm->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
@@ -1158,7 +1158,7 @@ void Animation::animLink() {
 void Animation::stopWalking() {
 	_sprites[0].stopWalk();
 	_direction = kDirStopped;
-	if (_vm->_avalot->_alive)
+	if (_vm->_alive)
 		_sprites[0]._stepNum = 1;
 }
 
@@ -1167,39 +1167,39 @@ void Animation::stopWalking() {
  * @remarks	Originally called 'hide_in_the_cupboard'
  */
 void Animation::hideInCupboard() {
-	if (_vm->_avalot->_avvysInTheCupboard) {
+	if (_vm->_avvysInTheCupboard) {
 		if (_vm->_parser->_wearing == kObjectDummy) {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			_sprites[0]._visible = true;
-			_vm->_avalot->_userMovesAvvy = true;
+			_vm->_userMovesAvvy = true;
 			appearPed(0, 2); // Walk out of the cupboard.
 			_vm->_dialogs->displayText("You leave the cupboard. Nice to be out of there!");
-			_vm->_avalot->_avvysInTheCupboard = false;
+			_vm->_avvysInTheCupboard = false;
 			_vm->_sequence->startCupboardSeq();
 		}
 	} else {
 		// Not hiding in the cupboard
 		_sprites[0]._visible = false;
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Dialogs::kControlParagraph);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_avalot->_avvysInTheCupboard = true;
+		_vm->_avvysInTheCupboard = true;
 		_vm->_background->draw(-1, -1, 7);
 	}
 }
 
 bool Animation::inField(byte which) {
-	FieldType *curField = &_vm->_avalot->_fields[which];
+	FieldType *curField = &_vm->_fields[which];
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
 
 	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
 bool Animation::nearDoor() {
-	if (_vm->_avalot->_fieldNum < 8) {
+	if (_vm->_fieldNum < 8) {
 		// there ARE no doors here!
 		return false;
 	}
@@ -1207,8 +1207,8 @@ bool Animation::nearDoor() {
 	int16 ux = _sprites[0]._x;
 	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
 
-	for (int i = 8; i < _vm->_avalot->_fieldNum; i++) {
-		FieldType *curField = &_vm->_avalot->_fields[i];
+	for (int i = 8; i < _vm->_fieldNum; i++) {
+		FieldType *curField = &_vm->_fields[i];
 		if ((ux >= curField->_x1) && (ux <= curField->_x2) && (uy >= curField->_y1) && (uy <= curField->_y2))
 			return true;
 	}
@@ -1217,7 +1217,7 @@ bool Animation::nearDoor() {
 }
 
 void Animation::handleMoveKey(const Common::Event &event) {
-	if (!_vm->_avalot->_userMovesAvvy)
+	if (!_vm->_userMovesAvvy)
 		return;
 
 	if (_vm->_menu->_activeMenuItem._activeNow)
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 222414c..cd94351 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -45,13 +45,21 @@ namespace Avalanche {
 
 AvalancheEngine *AvalancheEngine::s_Engine = 0;
 
-AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) {
+AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd), _fxHidden(false), _interrogation(0) {
 	_system = syst;
 	s_Engine = this;
 	_console = new AvalancheConsole(this);
 
 	_rnd = new Common::RandomSource("avalanche");
 	_rnd->setSeed(42);
+
+	// Needed because of Lucerna::load_also()
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++)
+			_also[i][j] = nullptr;
+	}
+
+	_totalTime = 0;
 }
 
 AvalancheEngine::~AvalancheEngine() {
@@ -61,7 +69,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _graphics;
 	delete _parser;
 
-	delete _avalot;
+	delete _clock;
 	delete _pingo;
 	delete _dialogs;
 	delete _background;
@@ -71,13 +79,28 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _menu;
 	delete _closing;
 	delete _sound;
+
+	for (int i = 0; i < 31; i++) {
+		for (int j = 0; j < 2; j++) {
+			if (_also[i][j] != nullptr)  {
+				delete _also[i][j];
+				_also[i][j] = nullptr;
+			}
+		}
+	}
+
+	for (int i = 0; i < 9; i++) {
+		_digits[i].free();
+		_directions[i].free();
+	}
+	_digits[9].free();
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
 	_graphics = new Graphics(this);
 	_parser = new Parser(this);
 
-	_avalot = new Avalot(this);
+	_clock = new Clock(this);
 	_pingo = new Pingo(this);
 	_dialogs = new Dialogs(this);
 	_background = new Background(this);
@@ -90,7 +113,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 
 	_graphics->init();
 	_dialogs->init();
-	_avalot->init();
+	init();
 	_parser->init();
 
 	return Common::kNoError;
@@ -117,138 +140,138 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	_parser->synchronize(sz);
 	_sequence->synchronize(sz);
 
-	sz.syncAsByte(_avalot->_carryNum);
+	sz.syncAsByte(_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
-		sz.syncAsByte(_avalot->_objects[i]);
-	sz.syncAsSint16LE(_avalot->_dnascore);
-	sz.syncAsSint32LE(_avalot->_money);
-	sz.syncAsByte(_avalot->_room);
+		sz.syncAsByte(_objects[i]);
+	sz.syncAsSint16LE(_dnascore);
+	sz.syncAsSint32LE(_money);
+	sz.syncAsByte(_room);
 	if (sz.isSaving())
 		_saveNum++;
 	sz.syncAsByte(_saveNum);
-	sz.syncBytes(_avalot->_roomCount, 100);
-	sz.syncAsByte(_avalot->_wonNim);
-	sz.syncAsByte(_avalot->_wineState);
-	sz.syncAsByte(_avalot->_cwytalotGone);
-	sz.syncAsByte(_avalot->_passwordNum);
-	sz.syncAsByte(_avalot->_aylesIsAwake);
-	sz.syncAsByte(_avalot->_drawbridgeOpen);
-	sz.syncAsByte(_avalot->_avariciusTalk);
-	sz.syncAsByte(_avalot->_rottenOnion);
-	sz.syncAsByte(_avalot->_onionInVinegar);
-	sz.syncAsByte(_avalot->_givenToSpludwick);
-	sz.syncAsByte(_avalot->_brummieStairs);
-	sz.syncAsByte(_avalot->_cardiffQuestionNum);
-	sz.syncAsByte(_avalot->_passedCwytalotInHerts);
-	sz.syncAsByte(_avalot->_avvyIsAwake);
-	sz.syncAsByte(_avalot->_avvyInBed);
-	sz.syncAsByte(_avalot->_userMovesAvvy);
-	sz.syncAsByte(_avalot->_npcFacing);
-	sz.syncAsByte(_avalot->_givenBadgeToIby);
-	sz.syncAsByte(_avalot->_friarWillTieYouUp);
-	sz.syncAsByte(_avalot->_tiedUp);
-	sz.syncAsByte(_avalot->_boxContent);
-	sz.syncAsByte(_avalot->_talkedToCrapulus);
-	sz.syncAsByte(_avalot->_jacquesState);
-	sz.syncAsByte(_avalot->_bellsAreRinging);
-	sz.syncAsByte(_avalot->_standingOnDais);
-	sz.syncAsByte(_avalot->_takenPen);
-	sz.syncAsByte(_avalot->_arrowTriggered);
-	sz.syncAsByte(_avalot->_arrowInTheDoor);
+	sz.syncBytes(_roomCount, 100);
+	sz.syncAsByte(_wonNim);
+	sz.syncAsByte(_wineState);
+	sz.syncAsByte(_cwytalotGone);
+	sz.syncAsByte(_passwordNum);
+	sz.syncAsByte(_aylesIsAwake);
+	sz.syncAsByte(_drawbridgeOpen);
+	sz.syncAsByte(_avariciusTalk);
+	sz.syncAsByte(_rottenOnion);
+	sz.syncAsByte(_onionInVinegar);
+	sz.syncAsByte(_givenToSpludwick);
+	sz.syncAsByte(_brummieStairs);
+	sz.syncAsByte(_cardiffQuestionNum);
+	sz.syncAsByte(_passedCwytalotInHerts);
+	sz.syncAsByte(_avvyIsAwake);
+	sz.syncAsByte(_avvyInBed);
+	sz.syncAsByte(_userMovesAvvy);
+	sz.syncAsByte(_npcFacing);
+	sz.syncAsByte(_givenBadgeToIby);
+	sz.syncAsByte(_friarWillTieYouUp);
+	sz.syncAsByte(_tiedUp);
+	sz.syncAsByte(_boxContent);
+	sz.syncAsByte(_talkedToCrapulus);
+	sz.syncAsByte(_jacquesState);
+	sz.syncAsByte(_bellsAreRinging);
+	sz.syncAsByte(_standingOnDais);
+	sz.syncAsByte(_takenPen);
+	sz.syncAsByte(_arrowTriggered);
+	sz.syncAsByte(_arrowInTheDoor);
 
 	if (sz.isSaving()) {
-		uint16 like2drinkSize = _avalot->_favouriteDrink.size();
+		uint16 like2drinkSize = _favouriteDrink.size();
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
-			char actChr = _avalot->_favouriteDrink[i];
+			char actChr = _favouriteDrink[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 favourite_songSize = _avalot->_favouriteSong.size();
+		uint16 favourite_songSize = _favouriteSong.size();
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
-			char actChr = _avalot->_favouriteSong[i];
+			char actChr = _favouriteSong[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 worst_place_on_earthSize = _avalot->_worstPlaceOnEarth.size();
+		uint16 worst_place_on_earthSize = _worstPlaceOnEarth.size();
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
-			char actChr = _avalot->_worstPlaceOnEarth[i];
+			char actChr = _worstPlaceOnEarth[i];
 			sz.syncAsByte(actChr);
 		}
 
-		uint16 spare_eveningSize = _avalot->_spareEvening.size();
+		uint16 spare_eveningSize = _spareEvening.size();
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
-			char actChr = _avalot->_spareEvening[i];
+			char actChr = _spareEvening[i];
 			sz.syncAsByte(actChr);
 		}
 	} else {
-		if (!_avalot->_favouriteDrink.empty())
-			_avalot->_favouriteDrink.clear();
+		if (!_favouriteDrink.empty())
+			_favouriteDrink.clear();
 		uint16 like2drinkSize = 0;
 		char actChr = ' ';
 		sz.syncAsUint16LE(like2drinkSize);
 		for (uint16 i = 0; i < like2drinkSize; i++) {
 			sz.syncAsByte(actChr);
-			_avalot->_favouriteDrink += actChr;
+			_favouriteDrink += actChr;
 		}
 
-		if (!_avalot->_favouriteSong.empty())
-			_avalot->_favouriteSong.clear();
+		if (!_favouriteSong.empty())
+			_favouriteSong.clear();
 		uint16 favourite_songSize = 0;
 		sz.syncAsUint16LE(favourite_songSize);
 		for (uint16 i = 0; i < favourite_songSize; i++) {
 			sz.syncAsByte(actChr);
-			_avalot->_favouriteSong += actChr;
+			_favouriteSong += actChr;
 		}
 
-		if (!_avalot->_worstPlaceOnEarth.empty())
-			_avalot->_worstPlaceOnEarth.clear();
+		if (!_worstPlaceOnEarth.empty())
+			_worstPlaceOnEarth.clear();
 		uint16 worst_place_on_earthSize = 0;
 		sz.syncAsUint16LE(worst_place_on_earthSize);
 		for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
 			sz.syncAsByte(actChr);
-			_avalot->_worstPlaceOnEarth += actChr;
+			_worstPlaceOnEarth += actChr;
 		}
 
-		if (!_avalot->_spareEvening.empty())
-			_avalot->_spareEvening.clear();
+		if (!_spareEvening.empty())
+			_spareEvening.clear();
 		uint16 spare_eveningSize = 0;
 		sz.syncAsUint16LE(spare_eveningSize);
 		for (uint16 i = 0; i < spare_eveningSize; i++) {
 			sz.syncAsByte(actChr);
-			_avalot->_spareEvening += actChr;
+			_spareEvening += actChr;
 		}
 	}
 
-	sz.syncAsSint32LE(_avalot->_totalTime);
-	sz.syncAsByte(_avalot->_jumpStatus);
-	sz.syncAsByte(_avalot->_mushroomGrowing);
-	sz.syncAsByte(_avalot->_spludwickAtHome);
-	sz.syncAsByte(_avalot->_lastRoom);
-	sz.syncAsByte(_avalot->_lastRoomNotMap);
-	sz.syncAsByte(_avalot->_crapulusWillTell);
-	sz.syncAsByte(_avalot->_enterCatacombsFromLustiesRoom);
-	sz.syncAsByte(_avalot->_teetotal);
-	sz.syncAsByte(_avalot->_malagauche);
-	sz.syncAsByte(_avalot->_drinking);
-	sz.syncAsByte(_avalot->_enteredLustiesRoomAsMonk);
-	sz.syncAsByte(_avalot->_catacombX);
-	sz.syncAsByte(_avalot->_catacombY);
-	sz.syncAsByte(_avalot->_avvysInTheCupboard);
-	sz.syncAsByte(_avalot->_geidaFollows);
-	sz.syncAsByte(_avalot->_nextBell);
-	sz.syncAsByte(_avalot->_givenPotionToGeida);
-	sz.syncAsByte(_avalot->_lustieIsAsleep);
-	sz.syncAsByte(_avalot->_beenTiedUp);
-	sz.syncAsByte(_avalot->_sittingInPub);
-	sz.syncAsByte(_avalot->_spurgeTalkCount);
-	sz.syncAsByte(_avalot->_metAvaroid);
-	sz.syncAsByte(_avalot->_takenMushroom);
-	sz.syncAsByte(_avalot->_givenPenToAyles);
-	sz.syncAsByte(_avalot->_askedDogfoodAboutNim);
+	sz.syncAsSint32LE(_totalTime);
+	sz.syncAsByte(_jumpStatus);
+	sz.syncAsByte(_mushroomGrowing);
+	sz.syncAsByte(_spludwickAtHome);
+	sz.syncAsByte(_lastRoom);
+	sz.syncAsByte(_lastRoomNotMap);
+	sz.syncAsByte(_crapulusWillTell);
+	sz.syncAsByte(_enterCatacombsFromLustiesRoom);
+	sz.syncAsByte(_teetotal);
+	sz.syncAsByte(_malagauche);
+	sz.syncAsByte(_drinking);
+	sz.syncAsByte(_enteredLustiesRoomAsMonk);
+	sz.syncAsByte(_catacombX);
+	sz.syncAsByte(_catacombY);
+	sz.syncAsByte(_avvysInTheCupboard);
+	sz.syncAsByte(_geidaFollows);
+	sz.syncAsByte(_nextBell);
+	sz.syncAsByte(_givenPotionToGeida);
+	sz.syncAsByte(_lustieIsAsleep);
+	sz.syncAsByte(_beenTiedUp);
+	sz.syncAsByte(_sittingInPub);
+	sz.syncAsByte(_spurgeTalkCount);
+	sz.syncAsByte(_metAvaroid);
+	sz.syncAsByte(_takenMushroom);
+	sz.syncAsByte(_givenPenToAyles);
+	sz.syncAsByte(_askedDogfoodAboutNim);
 
 	for (int i = 0; i < 7; i++) {
 		sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
@@ -259,7 +282,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 }
 
 bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
-	return (!_avalot->_seeScroll && _avalot->_alive);
+	return (!_seeScroll && _alive);
 }
 
 Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
@@ -305,7 +328,7 @@ Common::String AvalancheEngine::getSaveFileName(const int slot) {
 }
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!
-	return (!_avalot->_seeScroll);
+	return (!_seeScroll);
 }
 
 Common::Error AvalancheEngine::loadGameState(int slot) {
@@ -354,29 +377,29 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	synchronize(sz);
 	delete f;
 
-	_avalot->_isLoaded = true;
-	_avalot->_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
+	_isLoaded = true;
+	_seeScroll = true;  // This prevents display of the new sprites before the new picture is loaded.
 
-	if (_avalot->_holdTheDawn) {
-		_avalot->_holdTheDawn = false;
-		_avalot->dawn();
+	if (_holdTheDawn) {
+		_holdTheDawn = false;
+		dawn();
 	}
 
 	_background->release();
-	_avalot->minorRedraw();
+	minorRedraw();
 	_menu->setup();
-	_avalot->setRoom(kPeopleAvalot, _avalot->_room);
-	_avalot->_alive = true;
-	_avalot->refreshObjectList();
+	setRoom(kPeopleAvalot, _room);
+	_alive = true;
+	refreshObjectList();
 	_animation->updateSpeed();
-	_avalot->drawDirection();
-	_avalot->_onToolbar = false;
+	drawDirection();
+	_onToolbar = false;
 	_animation->animLink();
 	_background->update();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
 		Dialogs::kControlItalic, Dialogs::kControlRoman, description.c_str(), Dialogs::kControlCenter, 
-		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _avalot->_roomnName.c_str(), Dialogs::kControlNewLine, 
+		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _roomnName.c_str(), Dialogs::kControlNewLine, 
 		Dialogs::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_dialogs->displayText(tmpStr);
 
@@ -393,7 +416,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 	};
 
 	Common::String month = months[m];
-	Common::String day = _avalot->intToStr(d);
+	Common::String day = intToStr(d);
 
 	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
 		switch (d % 10) {
@@ -410,7 +433,7 @@ Common::String AvalancheEngine::expandDate(int d, int m, int y) {
 			day += "th";
 		}
 
-	return day + ' ' + month + ' ' + _avalot->intToStr(y + 1900);
+	return day + ' ' + month + ' ' + intToStr(y + 1900);
 }
 
 void AvalancheEngine::updateEvents() {
@@ -419,13 +442,13 @@ void AvalancheEngine::updateEvents() {
 	while (_eventMan->pollEvent(event)) {
 		switch (event.type) {
 		case Common::EVENT_LBUTTONDOWN:
-			_avalot->_holdLeftMouse = true; // Used in Avalot::checkclick() and Menu::menu_link().
+			_holdLeftMouse = true; // Used in checkclick() and Menu::menu_link().
 			break;
 		case Common::EVENT_LBUTTONUP:
-			_avalot->_holdLeftMouse = false; // Same as above.
+			_holdLeftMouse = false; // Same as above.
 			break;
 		case Common::EVENT_KEYDOWN:
-			_avalot->handleKeyDown(event);
+			handleKeyDown(event);
 			break;
 		default:
 			break;
@@ -447,7 +470,7 @@ Common::Error AvalancheEngine::run() {
 		return err;
 
 	do {
-		_avalot->runAvalot();
+		runAvalot();
 
 #if 0
 		switch (_storage._operation) {
@@ -466,7 +489,7 @@ Common::Error AvalancheEngine::run() {
 		}
 #endif
 
-	} while (!_avalot->_letMeOut && !shouldQuit());
+	} while (!_letMeOut && !shouldQuit());
 
 	return Common::kNoError;
 }
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 27a5bd6..5977721 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -59,11 +59,18 @@ struct AvalancheGameDescription;
 
 static const int kSavegameVersion = 1;
 
+enum Pitch {
+	kPitchInvalid,
+	kPitchLower,
+	kPitchSame,
+	kPitchHigher
+};
+
 class AvalancheEngine : public Engine {
 public:
 	byte _saveNum; // number of times this game has been saved
 
-	Avalot *_avalot;
+	Clock *_clock;
 	Graphics *_graphics;
 	Parser *_parser;
 	Pingo *_pingo;
@@ -153,6 +160,244 @@ private:
 	void cursorOn();
 	void quit();
 #endif
+
+public:
+	static const int16 kXW = 30;
+	static const int16 kYW = 36; // x width & y whatsit
+	static const int16 kMargin = 5;
+	static const MouseHotspotType kMouseHotSpots[9];
+	static const int16 kMaxSprites = 2; // Current max no. of sprites.
+
+	// For Thinkabout:
+	static const bool kThing = true;
+	static const bool kPerson = false;
+
+	// Magic/portal constants:
+	enum Magics {
+		kMagicNothing, // Ignore it if this line is touched.
+		kMagicBounce, // Bounce off this line. Not valid for portals.
+		kMagicExclaim, // Put up a chain of scrolls.
+		kMagicTransport, // Enter new room.
+		kMagicUnfinished, // Unfinished connection.
+		kMagicSpecial, // Special function.
+		kMagicOpenDoor // Opening door.
+	};
+
+	// These following static constants should be included in CFG when it's written.
+
+	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
+	static const int16 kBorder = 1; // size of border on shadowboxes
+	static const int16 kWalk = 3;
+	static const int16 kRun = 5;
+	static const int32 kCatacombMap[8][8];
+	static const char kSpludwicksOrder[3];
+	static const QuasipedType kQuasipeds[16];
+
+	static const uint16 kNotes[12];
+	static const TuneType kTune;
+
+	static const char *kVersionNum;
+	static const char *kCopyright;
+	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
+	static const int16 kGameCode = 2; // Avalot's code number
+
+	bool _holdLeftMouse;
+	
+	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
+	// If a scroll comes up, or you leave the room, it's automatically set to zero.
+	byte _interrogation;
+
+	// Former DNA structure
+	byte _carryNum; // How many objects you're carrying...
+	bool _objects[kObjectNum]; // ...and which ones they are.
+	int16 _dnascore; // your score, of course
+	int32 _money; // your current amount of dosh
+	Room _room; // your current room
+	byte _roomCount[100]; // Add one to each every time you enter a room
+	bool _wonNim; // Have you *won* Nim? (That's harder.)
+	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
+	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
+	byte _passwordNum; // Number of the passw for this game.
+	bool _aylesIsAwake; // pretty obvious!
+	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
+	byte _avariciusTalk; // How much Avaricius has said to you.
+	bool _rottenOnion; // And has it rotted?
+	bool _onionInVinegar; // Is the onion in the vinegar?
+	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
+	byte _brummieStairs; // Progression through the stairs trick.
+	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
+	bool _avvyInBed; // True if Avvy's in bed, but awake.
+	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
+	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
+	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
+	bool _friarWillTieYouUp; // If you're going to get tied up.
+	bool _tiedUp; // You ARE tied up!
+	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
+	bool _talkedToCrapulus; // Pretty self-explanatory.
+	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
+	bool _bellsAreRinging; // Is Jacques ringing the bells?
+	bool _standingOnDais; // In room 71, inside Cardiff Castle.
+	bool _takenPen; // Have you taken the pen (in Cardiff?)
+	bool _arrowTriggered; // And has the arrow been triggered?
+	bool _arrowInTheDoor;  // Did the arrow hit the wall?
+	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
+	uint32 _totalTime; // Your total time playing this game, in ticks.
+	byte _jumpStatus; // Fixes how high you're jumping.
+	bool _mushroomGrowing; // Is the mushroom growing in 42?
+	bool _spludwickAtHome; // Is Spludwick at home?
+	byte _lastRoom;
+	byte _lastRoomNotMap;
+	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
+	bool _enterCatacombsFromLustiesRoom;
+	bool _teetotal; // Are we touching any more drinks?
+	byte _malagauche; // Position of Malagauche. See Celer for more info.
+	char _drinking; // What's he getting you?
+	bool _enteredLustiesRoomAsMonk;
+	byte _catacombX, _catacombY;   // XY coords in the catacombs.
+	bool _avvysInTheCupboard; // On screen 22.
+	bool _geidaFollows; // Is Geida following you?
+	byte _nextBell; // For the ringing.
+	bool _givenPotionToGeida; // Does Geida have the potion?
+	bool _lustieIsAsleep; // Is BDL asleep?
+	bool _beenTiedUp; // In r__Robins.
+	bool _sittingInPub; // Are you sitting down in the pub?
+	byte _spurgeTalkCount; // Count for talking to Spurge.
+	bool _metAvaroid;
+	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
+	// End of former DNA Structure
+
+	byte _lineNum; // Number of lines.
+	LineType _lines[50]; // For Also.
+	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
+	bool _dropsOk, _soundFx, _cheat;
+	Common::String _mouseText;
+	bool _weirdWord;
+	bool _letMeOut;
+	Common::String _scroll[15];
+	byte _scrollNum, _whichwas;
+	byte _thinks;
+	bool _thinkThing;
+	int16 _talkX, _talkY;
+	byte _talkBackgroundColor, _talkFontColor;
+	byte _scrollBells; // no. of times to ring the bell
+	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
+	char _objectList[10];
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	// Called .free() for them in ~Gyro().
+	int8 _scoreToDisplay[3];
+	byte _currentMouse; // current mouse-void
+	Common::String _verbStr; // what you can do with your object. :-)
+	Common::String *_also[31][2];
+	PedType _peds[15];
+	MagicType _magics[15];
+	MagicType _portals[7];
+	FieldType _fields[30];
+	byte _fieldNum;
+	Common::String _flags;
+	Common::String _listen;
+	byte _cp, _ledStatus, _defaultLed;
+	FontType _font;
+	bool _alive;
+	byte _buffer[2000];
+	uint16 _bufSize;
+	int16 _underScroll; // Y-coord of just under the scroll text.
+	Common::String _roomnName; // Name of actual room
+	Common::String _subject; // What you're talking to them about.
+	byte _subjectNum; // The same thing.
+	bool _keyboardClick; // Is a keyboard click noise wanted?
+	People _him, _her;
+	byte _it;
+	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
+
+	People _lastPerson; // Last person to have been selected using the People menu.
+	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
+	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
+	bool _isLoaded; // Is it a loaded gamestate?
+	Common::String _enidFilename;
+
+	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
+	void setup();
+	void runAvalot();
+
+	void init();
+	void callVerb(VerbCode id);
+	void drawAlsoLines();
+	void loadRoom(byte num);
+	void exitRoom(byte x);
+	void enterRoom(Room room, byte ped);
+	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
+	void loadDigits(); // Load the scoring digits & rwlites
+	void drawToolbar();
+	void drawScore();
+	void incScore(byte num); // Add on no. of points
+	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
+	void fxToggle();
+	void refreshObjectList();
+	void checkClick();
+	void errorLed();
+	void dusk();
+	void dawn();
+	void drawDirection(); // Draws the little icon at the left end of the text input field.
+	void gameOver();
+	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
+	void fixFlashers();
+	void loadAlso(byte num);
+
+	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
+	void minorRedraw();
+	void majorRedraw();
+
+	void spriteRun();
+
+	Common::String intToStr(int32 num);
+	void newMouse(byte id);
+	void setMousePointerWait();    // Makes hourglass.
+	void loadMouse(byte which);
+
+	void setBackgroundColor(byte x);
+	
+	void resetVariables();
+	void newGame(); // This sets up the DNA for a completely new game.
+	void slowDown();
+	bool setFlag(char x);
+	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
+	void hangAroundForAWhile();
+	
+	Common::String getName(People whose);
+	byte getNameChar(People whose);
+	Common::String getThing(byte which);
+	char getThingChar(byte which);
+	Common::String getItem(byte which); // Called get_better in the original.
+	Common::String f5Does(); // This procedure determines what f5 does.
+
+	void openDoor(Room whither, byte ped, byte magicnum); // Handles slidey-open doors.
+	void flipRoom(Room room, byte ped);
+
+	void setRoom(People persId, Room roomId);
+	Room getRoom(People persId);
+private:
+	static Room _whereIs[29];
+
+	Common::File file;
+	Common::String readAlsoStringFromFile();
+	void scram(Common::String &str);
+	void unScramble();
+
+	void zoomOut(int16 x, int16 y); // Only used when entering the map.
+	void enterNewTown();
+	void findPeople(byte room);
+	void putGeidaAt(byte whichPed, byte ped);
+	void guideAvvy(Common::Point cursorPos);
+
+	// Will be used in dusk() and dawn().
+	bool _fxHidden;
+
+	int8 fades(int8 x);
+	void fadeOut(byte n);
+	void fadeIn(byte n);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6bf1b46..e5ed210 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -28,16 +28,6 @@
 /* AVALOT		The kernel of the program. */
 
 #include "avalanche/avalanche.h"
-#include "avalanche/graphics.h"
-#include "avalanche/avalot.h"
-#include "avalanche/animation.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/menu.h"
-#include "avalanche/pingo.h"
-#include "avalanche/timer.h"
-#include "avalanche/background.h"
-#include "avalanche/closing.h"
-#include "avalanche/enums.h"
 
 #include "common/file.h"
 #include "common/random.h"
@@ -47,10 +37,10 @@
 
 namespace Avalanche {
 
-const char *Avalot::kVersionNum = "1.30";
-const char *Avalot::kCopyright = "1995";
+const char *AvalancheEngine::kVersionNum = "1.30";
+const char *AvalancheEngine::kCopyright = "1995";
 
-const MouseHotspotType Avalot::kMouseHotSpots[9] = {
+const MouseHotspotType AvalancheEngine::kMouseHotSpots[9] = {
 	{8,0}, // 0 - up-arrow
 	{0,0}, // 1 - screwdriver
 	{15,6}, // 2 - right-arrow
@@ -63,7 +53,7 @@ const MouseHotspotType Avalot::kMouseHotSpots[9] = {
 };
 
 // Art gallery at 2,1; notice about this at 2,2.
-const int32 Avalot::kCatacombMap[8][8] = {
+const int32 AvalancheEngine::kCatacombMap[8][8] = {
 	// Geida's room
 	// 1       2	   3     | 4	   5	   6	   7       8
 	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
@@ -113,11 +103,11 @@ const int32 Avalot::kCatacombMap[8][8] = {
 		7     = wall with door and candles,
 		F     = straight-through corridor. */
 
-const char Avalot::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
+const char AvalancheEngine::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
 
 // A quasiped defines how people who aren't sprites talk. For example, quasiped
 // "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
-const QuasipedType Avalot::kQuasipeds[16] = {
+const QuasipedType AvalancheEngine::kQuasipeds[16] = {
 //_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
 	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
 	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
@@ -137,14 +127,14 @@ const QuasipedType Avalot::kQuasipeds[16] = {
 	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
 };
 
-const uint16 Avalot::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
-const TuneType Avalot::kTune = {
+const uint16 AvalancheEngine::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
+const TuneType AvalancheEngine::kTune = {
 	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
 	kPitchLower, kPitchHigher, kPitchHigher, kPitchSame, kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchHigher,
 	kPitchHigher, kPitchLower, kPitchLower, kPitchLower, kPitchLower, kPitchSame, kPitchLower, kPitchHigher, kPitchSame, kPitchLower, kPitchHigher
 };
 
-Room Avalot::_whereIs[29] = {
+Room AvalancheEngine::_whereIs[29] = {
 	// The Lads
 	kRoomYours, // Avvy
 	kRoomSpludwicks, // Spludwick
@@ -240,14 +230,14 @@ void Clock::plotHands() {
 }
 
 void Clock::chime() {
-	if ((_oldHour == 17717) || (!_vm->_avalot->_soundFx)) // Too high - must be first time around
+	if ((_oldHour == 17717) || (!_vm->_soundFx)) // Too high - must be first time around
 		return;
 	
 	byte hour = _hour % 12;
 	if (hour == 0)
 		hour = 12;
 
-	_vm->_avalot->setMousePointerWait();
+	_vm->setMousePointerWait();
 
 	for (int i = 1; i <= hour; i++) {
 		for (int j = 1; j <= 3; j++)
@@ -258,42 +248,13 @@ void Clock::chime() {
 }
 
 
-Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogation(0) {
-	_vm = vm;
-
-	// Needed because of Lucerna::load_also()
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++)
-			_also[i][j] = nullptr;
-	}
-
-	_totalTime = 0;
-}
-
-Avalot::~Avalot() {
-	for (int i = 0; i < 31; i++) {
-		for (int j = 0; j < 2; j++) {
-			if (_also[i][j] != nullptr)  {
-				delete _also[i][j];
-				_also[i][j] = nullptr;
-			}
-		}
-	}
-
-	for (int i = 0; i < 9; i++) {
-		_digits[i].free();
-		_directions[i].free();
-	}
-	_digits[9].free();
-}
-
-void Avalot::handleKeyDown(Common::Event &event) {
-	_vm->_sound->click();
+void AvalancheEngine::handleKeyDown(Common::Event &event) {
+	_sound->click();
 
 	if ((Common::KEYCODE_F1 <= event.kbd.keycode) && (event.kbd.keycode <= Common::KEYCODE_F15))
-		_vm->_parser->handleFunctionKey(event);
+		_parser->handleFunctionKey(event);
 	else if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
-		_vm->_parser->handleInputText(event);
+		_parser->handleInputText(event);
 	else
 		switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
 		case Common::KEYCODE_KP8:
@@ -335,15 +296,15 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	case Common::KEYCODE_END:
 	case Common::KEYCODE_KP5:
 		if (_alive && _avvyIsAwake) {
-			_vm->_animation->handleMoveKey(event); // Fallthroughs are intended.
+			_animation->handleMoveKey(event); // Fallthroughs are intended.
 			drawDirection();
 			return;
 		}
 	case Common::KEYCODE_BACKSPACE:
-		_vm->_parser->handleBackspace();
+		_parser->handleBackspace();
 		break;
 	case Common::KEYCODE_RETURN:
-		_vm->_parser->handleReturn();
+		_parser->handleReturn();
 		break;
 	default:
 		break;
@@ -352,89 +313,89 @@ void Avalot::handleKeyDown(Common::Event &event) {
 	drawDirection();
 }
 
-void Avalot::setup() {
+void AvalancheEngine::setup() {
 	init();
 
-	_vm->_dialogs->reset();
+	_dialogs->reset();
 	dusk();
 	loadDigits();
 
-	_vm->_parser->_inputTextPos = 0;
-	_vm->_parser->_quote = true;
+	_parser->_inputTextPos = 0;
+	_parser->_quote = true;
 
-	_vm->_animation->setDirection(kDirStopped);
-	_vm->_animation->resetAnims();
+	_animation->setDirection(kDirStopped);
+	_animation->resetAnims();
 
 	drawToolbar();
-	_vm->_dialogs->setReadyLight(2);
+	_dialogs->setReadyLight(2);
 
 	dawn();
-	_vm->_parser->_cursorState = false;
-	_vm->_parser->cursorOn();
-	_vm->_animation->_sprites[0]._speedX = kWalk;
-	_vm->_animation->updateSpeed();
+	_parser->_cursorState = false;
+	_parser->cursorOn();
+	_animation->_sprites[0]._speedX = kWalk;
+	_animation->updateSpeed();
 
-	_vm->_menu->init();
+	_menu->init();
 
 	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_thinks = 2; // You always have money.
-		thinkAbout(kObjectMoney, Avalot::kThing);
+		thinkAbout(kObjectMoney, kThing);
 
-		_vm->loadGame(loadSlot);
+		loadGame(loadSlot);
 	} else {
 		_isLoaded = false; // Set to true in _vm->loadGame().
 		newGame();
 
 		_soundFx = !_soundFx;
 		fxToggle();
-		thinkAbout(kObjectMoney, Avalot::kThing);
+		thinkAbout(kObjectMoney, kThing);
 
-		_vm->_dialogs->displayScrollChain('q', 83); // Info on the game, etc.
+		_dialogs->displayScrollChain('q', 83); // Info on the game, etc.
 	}
 }
 
-void Avalot::runAvalot() {
+void AvalancheEngine::runAvalot() {
 	setup();
 
 	do {
-		uint32 beginLoop = _vm->_system->getMillis();
+		uint32 beginLoop = _system->getMillis();
 
-		_vm->updateEvents(); // The event handler.
+		updateEvents(); // The event handler.
 
-		_clock.update();
-		_vm->_menu->update();
-		_vm->_background->update();
-		_vm->_animation->animLink();
+		_clock->update();
+		_menu->update();
+		_background->update();
+		_animation->animLink();
 		checkClick();
-		_vm->_timer->updateTimer();
+		_timer->updateTimer();
 
 #ifdef DEBUG
 		for (int i = 0; i < _lineNum; i++) {
 			LineType *curLine = &_lines[i];
-			_vm->_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
+			_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
 		}
 
 		for (int i = 0; i < _fieldNum; i++) {
 			FieldType *curField = &_fields[i];
 			if (curField->_x1 < 640)
-				_vm->_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
+				_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
 		}
 #endif
 
-		_vm->_graphics->refreshScreen();
+		_graphics->refreshScreen();
 
-		uint32 delay = _vm->_system->getMillis() - beginLoop;
+		uint32 delay = _system->getMillis() - beginLoop;
 		if (delay <= 55)
-			_vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
-	} while (!_letMeOut && !_vm->shouldQuit());
+			_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
+	} while (!_letMeOut && !shouldQuit());
 
-	warning("STUB: Avalot::run()");
+	warning("STUB: run()");
 
-	_vm->_closing->exitGame();
+	_closing->exitGame();
 }
 
-void Avalot::init() {
+void AvalancheEngine::init() {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++)
 			_also[i][j] = nullptr;
@@ -470,31 +431,31 @@ void Avalot::init() {
  * Call a given Verb
  * @remarks	Originally called 'callverb'
  */
-void Avalot::callVerb(VerbCode id) {
-	if (id == _vm->_parser->kPardon) {
+void AvalancheEngine::callVerb(VerbCode id) {
+	if (id == _parser->kPardon) {
 		Common::String tmpStr = Common::String::format("The f5 key lets you do a particular action in certain " \
 			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
 			"what the current setting of this key is.");
-		_vm->_dialogs->displayText(tmpStr);
+		_dialogs->displayText(tmpStr);
 	} else {
 		_weirdWord = false;
-		_vm->_parser->_polite = true;
-		_vm->_parser->_verb = id;
-		_vm->_parser->doThat();
+		_parser->_polite = true;
+		_parser->_verb = id;
+		_parser->doThat();
 	}
 }
 
-void Avalot::drawAlsoLines() {
+void AvalancheEngine::drawAlsoLines() {
 	CursorMan.showMouse(false);
 
-	_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
-	_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
+	_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
+	_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 
 	for (int i = 0; i < _lineNum; i++) {
 		// We had to check if the lines are within the borders of the screen.
-		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < _vm->_graphics->kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < _vm->_graphics->kScreenHeight)
-		 && (_lines[i]._x2 >= 0) && (_lines[i]._x2 < _vm->_graphics->kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < _vm->_graphics->kScreenHeight))
-			_vm->_graphics->_magics.drawLine(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
+		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < _graphics->kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < _graphics->kScreenHeight)
+		 && (_lines[i]._x2 >= 0) && (_lines[i]._x2 < _graphics->kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < _graphics->kScreenHeight))
+			_graphics->_magics.drawLine(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
 	}
 
 	CursorMan.showMouse(true);
@@ -504,7 +465,7 @@ void Avalot::drawAlsoLines() {
  * Check is it's possible to give something to Spludwick
  * @remarks	Originally called 'nextstring'
  */
-Common::String Avalot::readAlsoStringFromFile() {
+Common::String AvalancheEngine::readAlsoStringFromFile() {
 	Common::String str;
 	byte length = file.readByte();
 	for (int i = 0; i < length; i++)
@@ -512,12 +473,12 @@ Common::String Avalot::readAlsoStringFromFile() {
 	return str;
 }
 
-void Avalot::scram(Common::String &str) {
+void AvalancheEngine::scram(Common::String &str) {
 	for (uint i = 0; i < str.size(); i++)
 		str.setChar(str[i] ^ 177, i);
 }
 
-void Avalot::unScramble() {
+void AvalancheEngine::unScramble() {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
 			if (_also[i][j] != nullptr)
@@ -528,7 +489,7 @@ void Avalot::unScramble() {
 	scram(_flags);
 }
 
-void Avalot::loadAlso(byte num) {
+void AvalancheEngine::loadAlso(byte num) {
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
 			if (_also[i][j] != nullptr)  {
@@ -616,10 +577,10 @@ void Avalot::loadAlso(byte num) {
 	}
 }
 
-void Avalot::loadRoom(byte num) {
+void AvalancheEngine::loadRoom(byte num) {
 	CursorMan.showMouse(false);
 
-	_vm->_graphics->fleshColors();
+	_graphics->fleshColors();
 
 	Common::String filename = Common::String::format("place%d.avd", num);
 	if (!file.open(filename))
@@ -637,21 +598,21 @@ void Avalot::loadRoom(byte num) {
 
 	file.seek(177);
 
-	_vm->_graphics->_background = _vm->_graphics->loadPictureRow(file, _vm->_graphics->kBackgroundWidth, _vm->_graphics->kBackgroundHeight);
-	_vm->_graphics->refreshBackground();
+	_graphics->_background = _graphics->loadPictureRow(file, _graphics->kBackgroundWidth, _graphics->kBackgroundHeight);
+	_graphics->refreshBackground();
 
 	file.close();
 
 	loadAlso(num);
-	_vm->_background->load(num);
+	_background->load(num);
 	CursorMan.showMouse(true);
 }
 
-void Avalot::zoomOut(int16 x, int16 y) {
+void AvalancheEngine::zoomOut(int16 x, int16 y) {
 	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
 
 	::Graphics::Surface backup;
-	backup.copyFrom(_vm->_graphics->_surface);
+	backup.copyFrom(_graphics->_surface);
 	
 	for (byte i = 1; i <= 20; i ++) {
 		int16 x1 = x - (x / 20) * i;
@@ -659,17 +620,17 @@ void Avalot::zoomOut(int16 x, int16 y) {
 		int16 x2 = x + (((639 - x) / 20) * i);
 		int16 y2 = y + (((161 - y) / 20) * i);
 
-		_vm->_graphics->_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
-		_vm->_graphics->refreshScreen();
-		_vm->_system->delayMillis(17);
-		_vm->_graphics->_surface.copyFrom(backup);
-		_vm->_graphics->refreshScreen();
+		_graphics->_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
+		_graphics->refreshScreen();
+		_system->delayMillis(17);
+		_graphics->_surface.copyFrom(backup);
+		_graphics->refreshScreen();
 	}
 
 	backup.free();
 }
 
-void Avalot::findPeople(byte room) {
+void AvalancheEngine::findPeople(byte room) {
 	for (int i = 1; i < 29; i++) {
 		if (_whereIs[i] == room) {
 			if (i < 25)
@@ -680,28 +641,28 @@ void Avalot::findPeople(byte room) {
 	}
 }
 
-void Avalot::exitRoom(byte x) {
-	_vm->_sound->stopSound();
-	_vm->_background->release();
+void AvalancheEngine::exitRoom(byte x) {
+	_sound->stopSound();
+	_background->release();
 	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	switch (x) {
 	case kRoomSpludwicks:
-		_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks);
+		_timer->loseTimer(Timer::kReasonAvariciusTalks);
 		 _avariciusTalk = 0;
 		// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
 		break;
 	case kRoomBridge:
 		if (_drawbridgeOpen > 0) {
 			_drawbridgeOpen = 4; // Fully open.
-			_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
+			_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
 		}
 		break;
 	case kRoomOutsideCardiffCastle:
-		_vm->_timer->loseTimer(Timer::kReasonCardiffsurvey);
+		_timer->loseTimer(Timer::kReasonCardiffsurvey);
 		break;
 	case kRoomRobins:
-		_vm->_timer->loseTimer(Timer::kReasonGettingTiedUp);
+		_timer->loseTimer(Timer::kReasonGettingTiedUp);
 		break;
 	}
 
@@ -719,8 +680,8 @@ void Avalot::exitRoom(byte x) {
  * but choosing another from the map.
  * @remarks	Originally called 'new_town'
  */
-void Avalot::enterNewTown() {
-	_vm->_menu->setup();
+void AvalancheEngine::enterNewTown() {
+	_menu->setup();
 
 	switch (_room) {
 	case kRoomOutsideNottsPub: // Entry into Nottingham.
@@ -744,18 +705,18 @@ void Avalot::enterNewTown() {
 		_rottenOnion = true; // You're holding the onion
 }
 
-void Avalot::putGeidaAt(byte whichPed, byte ped) {
+void AvalancheEngine::putGeidaAt(byte whichPed, byte ped) {
 	if (ped == 0)
 		return;
-	AnimationType *spr1 = &_vm->_animation->_sprites[1];
+	AnimationType *spr1 = &_animation->_sprites[1];
 
-	spr1->init(5, false, _vm->_animation); // load Geida
-	_vm->_animation->appearPed(1, whichPed);
+	spr1->init(5, false, _animation); // load Geida
+	_animation->appearPed(1, whichPed);
 	spr1->_callEachStepFl = true;
 	spr1->_eachStepProc = Animation::kProcGeida;
 }
 
-void Avalot::enterRoom(Room roomId, byte ped) {
+void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 	_seeScroll = true;  // This stops the trippancy system working over the length of this procedure.
 
 	findPeople(roomId);
@@ -782,24 +743,24 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	switch (roomId) {
 	case kRoomYours:
 		if (_avvyInBed) {
-			_vm->_background->draw(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
+			_background->draw(-1, -1, 2);
+			_graphics->refreshBackground();
+			_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
 		}
 		break;
 
 	case kRoomOutsideYours:
 		if (ped > 0) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			AnimationType *spr1 = &_animation->_sprites[1];
 			if (!_talkedToCrapulus) {
 				_whereIs[kPeopleCrapulus - 150] = kRoomOutsideYours;
-				spr1->init(8, false, _vm->_animation); // load Crapulus
+				spr1->init(8, false, _animation); // load Crapulus
 
 				if (_roomCount[kRoomOutsideYours] == 1) {
-					_vm->_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
+					_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
 					spr1->walkTo(4); // Walks up to greet you.
 				} else {
-					_vm->_animation->appearPed(1, 4); // Starts where he was before.
+					_animation->appearPed(1, 4); // Starts where he was before.
 					spr1->_facingDir = kDirLeft;
 				}
 
@@ -810,10 +771,10 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 				_whereIs[kPeopleCrapulus - 150] = kRoomNowhere;
 
 			if (_crapulusWillTell) {
-				spr1->init(8, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
+				spr1->init(8, false, _animation);
+				_animation->appearPed(1, 1);
 				spr1->walkTo(3);
-				_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
+				_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
 				_crapulusWillTell = false;
 			}
 		}
@@ -821,17 +782,17 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomOutsideSpludwicks:
 		if ((_roomCount[kRoomOutsideSpludwicks] == 1) && (ped == 1)) {
-			_vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
+			_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
 			_spludwickAtHome = true;
 		}
 		break;
 
 	case kRoomSpludwicks:
 		if (_spludwickAtHome) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			AnimationType *spr1 = &_animation->_sprites[1];
 			if (ped > 0) {
-				spr1->init(2, false, _vm->_animation); // load Spludwick
-				_vm->_animation->appearPed(1, 1);
+				spr1->init(2, false, _animation); // load Spludwick
+				_animation->appearPed(1, 1);
 				_whereIs[kPeopleSpludwick - 150] = kRoomSpludwicks;
 			}
 
@@ -845,21 +806,21 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (_geidaFollows)
 			putGeidaAt(4, ped);
 		if (_cwytalotGone) {
-			_magics[kColorLightred - 1]._operation = Avalot::kMagicNothing;
+			_magics[kColorLightred - 1]._operation = kMagicNothing;
 			_whereIs[kPeopleCwytalot - 150] = kRoomNowhere;
 		} else if (ped > 0) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot
+			AnimationType *spr1 = &_animation->_sprites[1];
+			spr1->init(4, false, _animation); // 4 = Cwytalot
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcFollowAvvyY;
 			_whereIs[kPeopleCwytalot - 150] = kRoomBrummieRoad;
 
 			if (_roomCount[kRoomBrummieRoad] == 1) { // First time here...
-				_vm->_animation->appearPed(1, 1); // He appears on the right of the screen...
+				_animation->appearPed(1, 1); // He appears on the right of the screen...
 				spr1->walkTo(3); // ...and he walks up...
 			} else {
 				// You've been here before.
-				_vm->_animation->appearPed(1, 3); // He's standing in your way straight away...
+				_animation->appearPed(1, 3); // He's standing in your way straight away...
 				spr1->_facingDir = kDirLeft;
 			}
 		}
@@ -867,22 +828,22 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomArgentRoad:
 		if ((_cwytalotGone) && (!_passedCwytalotInHerts) && (ped == 2) && (_roomCount[kRoomArgentRoad] > 3)) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again
-			_vm->_animation->appearPed(1, 0);
+			AnimationType *spr1 = &_animation->_sprites[1];
+			spr1->init(4, false, _animation); // 4 = Cwytalot again
+			_animation->appearPed(1, 0);
 			spr1->walkTo(1);
 			spr1->_vanishIfStill = true;
 			_passedCwytalotInHerts = true;
 			// whereis[#157] = r__Nowhere; // can we fit this in?
-			_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
+			_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
 		}
 		break;
 
 	case kRoomBridge:
 		if (_drawbridgeOpen == 4) { // open
-			_vm->_background->draw(-1, -1, 2); // Position of drawbridge
-			_vm->_graphics->refreshBackground();
-			_magics[kColorGreen - 1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
+			_background->draw(-1, -1, 2); // Position of drawbridge
+			_graphics->refreshBackground();
+			_magics[kColorGreen - 1]._operation = kMagicNothing; // You may enter the drawbridge.
 		}
 		if (_geidaFollows)
 			putGeidaAt(ped + 2, ped); // load Geida
@@ -891,11 +852,11 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	case kRoomRobins:
 		if ((ped > 0) && (!_beenTiedUp)) {
 			// A welcome party... or maybe not...
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
-			spr1->init(6, false, _vm->_animation);
-			_vm->_animation->appearPed(1, 1);
+			AnimationType *spr1 = &_animation->_sprites[1];
+			spr1->init(6, false, _animation);
+			_animation->appearPed(1, 1);
 			spr1->walkTo(2);
-			_vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
+			_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
 		}
 
 		if (_beenTiedUp) {
@@ -904,31 +865,31 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		}
 
 		if (_tiedUp)
-			_vm->_background->draw(-1, -1, 1);
+			_background->draw(-1, -1, 1);
 
 		if (!_mushroomGrowing)
-			_vm->_background->draw(-1, -1, 2);
-		_vm->_graphics->refreshBackground();
+			_background->draw(-1, -1, 2);
+		_graphics->refreshBackground();
 		break;
 
 	case kRoomOutsideCardiffCastle:
 		if (ped > 0) {
-			AnimationType *spr1 = &_vm->_animation->_sprites[1];
+			AnimationType *spr1 = &_animation->_sprites[1];
 			switch (_cardiffQuestionNum) {
 			case 0 : // You've answered NONE of his questions.
-				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 1);
+				spr1->init(9, false, _animation);
+				_animation->appearPed(1, 1);
 				spr1->walkTo(2);
-				_vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
+				_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
 				break;
 			case 5 :
-				_magics[1]._operation = Avalot::kMagicNothing;
+				_magics[1]._operation = kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: // You've answered SOME of his questions.
-				spr1->init(9, false, _vm->_animation);
-				_vm->_animation->appearPed(1, 2);
+				spr1->init(9, false, _animation);
+				_animation->appearPed(1, 2);
 				spr1->_facingDir = kDirRight;
-				_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
+				_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
 			}
 		}
 
@@ -945,12 +906,12 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 			zoomOut(_peds[ped]._x, _peds[ped]._y);
 
 		if ((_objects[kObjectWine - 1]) && (_wineState != 3)) {
-			_vm->_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
+			_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
 			_objects[kObjectWine - 1] = false;
 			refreshObjectList();
 		}
 
-		_vm->_dialogs->displayScrollChain('q', 69);
+		_dialogs->displayScrollChain('q', 69);
 		break;
 
 	case kRoomCatacombs:
@@ -972,35 +933,35 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 			}
 
 			_enterCatacombsFromLustiesRoom = true;
-			_vm->_animation->catacombMove(ped);
+			_animation->catacombMove(ped);
 			_enterCatacombsFromLustiesRoom = false;
 		}
 		break;
 
 	case kRoomArgentPub:
 		if (_wonNim)
-			_vm->_background->draw(-1, -1, 0);   // No lute by the settle.
+			_background->draw(-1, -1, 0);   // No lute by the settle.
 		_malagauche = 0; // Ready to boot Malagauche
 		if (_givenBadgeToIby) {
-			_vm->_background->draw(-1, -1, 7);
-			_vm->_background->draw(-1, -1, 8);
+			_background->draw(-1, -1, 7);
+			_background->draw(-1, -1, 8);
 		}
-		_vm->_graphics->refreshBackground();
+		_graphics->refreshBackground();
 		break;
 
 	case kRoomLustiesRoom:
 		_npcFacing = 1; // du Lustie.
-		if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
-			_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
+		if (_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
+			_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
 		else if (!_enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
-			_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
+			_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
 
 		if (_geidaFollows) {
 			putGeidaAt(4, ped);
 			if (_lustieIsAsleep) {
-				_vm->_background->draw(-1, -1, 4);
-				_vm->_graphics->refreshBackground();
+				_background->draw(-1, -1, 4);
+				_graphics->refreshBackground();
 			}
 		}
 		break;
@@ -1008,43 +969,43 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	case kRoomMusicRoom:
 		if (_jacquesState > 0) {
 			_jacquesState = 5;
-			_vm->_background->draw(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_background->draw(-1, -1, 3);
-			_magics[kColorBrown - 1]._operation = Avalot::kMagicNothing;
+			_background->draw(-1, -1, 1);
+			_graphics->refreshBackground();
+			_background->draw(-1, -1, 3);
+			_magics[kColorBrown - 1]._operation = kMagicNothing;
 			_whereIs[kPeopleJacques - 150] = kRoomNowhere;
 		}
 		if (ped != 0) {
-			_vm->_background->draw(-1, -1, 5);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startMusicRoomSeq();
+			_background->draw(-1, -1, 5);
+			_graphics->refreshBackground();
+			_sequence->startMusicRoomSeq();
 		}
 		break;
 
 	case kRoomOutsideNottsPub:
 		if (ped == 2) {
-			_vm->_background->draw(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startDuckSeq();
+			_background->draw(-1, -1, 2);
+			_graphics->refreshBackground();
+			_sequence->startDuckSeq();
 		}
 		break;
 
 	case kRoomOutsideArgentPub:
 		if (ped == 2)  {
-			_vm->_background->draw(-1, -1, 5);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startMusicRoomSeq();
+			_background->draw(-1, -1, 5);
+			_graphics->refreshBackground();
+			_sequence->startMusicRoomSeq();
 		}
 		break;
 
 	case kRoomWiseWomans: {
-		AnimationType *spr1 = &_vm->_animation->_sprites[1];
-		spr1->init(11, false, _vm->_animation);
+		AnimationType *spr1 = &_animation->_sprites[1];
+		spr1->init(11, false, _animation);
 		if ((_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
-			_vm->_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
+			_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
 			spr1->walkTo(3); // Walks up to greet you.
 		} else {
-			_vm->_animation->appearPed(1, 3); // Starts where she was before.
+			_animation->appearPed(1, 3); // Starts where she was before.
 			spr1->_facingDir = kDirLeft;
 		}
 
@@ -1055,25 +1016,25 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
-			_vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart.
-			_vm->_background->draw(-1, -1, 0);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startCardiffSeq2();
+			_animation->_sprites[1].init(10, false, _animation); // Define the dart.
+			_background->draw(-1, -1, 0);
+			_graphics->refreshBackground();
+			_sequence->startCardiffSeq2();
 		} else {
-			_vm->_background->draw(-1, -1, 0);
+			_background->draw(-1, -1, 0);
 			if (_arrowInTheDoor)
-				_vm->_background->draw(-1, -1, 2);
+				_background->draw(-1, -1, 2);
 			else
-				_vm->_background->draw(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
+				_background->draw(-1, -1, 1);
+			_graphics->refreshBackground();
 		}
 		break;
 
 	case kRoomAvvysGarden:
 		if (ped == 1)  {
-			_vm->_background->draw(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startGardenSeq();
+			_background->draw(-1, -1, 1);
+			_graphics->refreshBackground();
+			_sequence->startGardenSeq();
 		}
 		break;
 
@@ -1083,22 +1044,22 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 		if (ped == 2)  {
 #if 0
 			// It was the original:
-			_vm->_celer->show_one(-1, -1, 2);
-			_vm->_sequence->first_show(1);
-			_vm->_sequence->then_show(3);
-			_vm->_sequence->start_to_close();
+			_celer->show_one(-1, -1, 2);
+			_sequence->first_show(1);
+			_sequence->then_show(3);
+			_sequence->start_to_close();
 #endif
 
-			_vm->_background->draw(-1, -1, 1);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startGardenSeq();
+			_background->draw(-1, -1, 1);
+			_graphics->refreshBackground();
+			_sequence->startGardenSeq();
 		}
 		break;
 
 	case kRoomAylesOffice:
 		if (_aylesIsAwake)
-			_vm->_background->draw(-1, -1, 1);
-		_vm->_graphics->refreshBackground();
+			_background->draw(-1, -1, 1);
+		_graphics->refreshBackground();
 		break; // Ayles awake.
 
 	case kRoomGeidas:
@@ -1118,16 +1079,16 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 
 	case kRoomNottsPub:
 		if (_sittingInPub)
-			_vm->_background->draw(-1, -1, 2);
+			_background->draw(-1, -1, 2);
 		_npcFacing = 1; // Port.
 		break;
 
 	case kRoomOutsideDucks:
 		if (ped == 2) {
 			// Shut the door
-			_vm->_background->draw(-1, -1, 2);
-			_vm->_graphics->refreshBackground();
-			_vm->_sequence->startDuckSeq();
+			_background->draw(-1, -1, 2);
+			_graphics->refreshBackground();
+			_sequence->startDuckSeq();
 		}
 		break;
 
@@ -1140,7 +1101,7 @@ void Avalot::enterRoom(Room roomId, byte ped) {
 	_isLoaded = false;
 }
 
-void Avalot::thinkAbout(byte object, bool type) {
+void AvalancheEngine::thinkAbout(byte object, bool type) {
 	const int16 picSize = 966;
 
 	_thinks = object;
@@ -1148,10 +1109,10 @@ void Avalot::thinkAbout(byte object, bool type) {
 
 	setMousePointerWait();
 
-	if (type == Avalot::kThing) {
+	if (type == kThing) {
 		if (!file.open("thinks.avd"))
 			error("AVALANCHE: Lucerna: File not found: thinks.avd");
-	} else { // Avalot::kPerson
+	} else { // kPerson
 		if (!file.open("folk.avd"))
 			error("AVALANCHE: Lucerna: File not found: folk.avd");
 
@@ -1165,8 +1126,8 @@ void Avalot::thinkAbout(byte object, bool type) {
 	CursorMan.showMouse(false);
 
 	file.seek(object * picSize + 65);
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 205, 170);
+	::Graphics::Surface picture = _graphics->loadPictureGraphic(file);
+	_graphics->drawPicture(_graphics->_surface, picture, 205, 170);
 
 	picture.free();
 	file.close();
@@ -1175,7 +1136,7 @@ void Avalot::thinkAbout(byte object, bool type) {
 	_thinkThing = type;
 }
 
-void Avalot::loadDigits() {   // Load the scoring digits & rwlites
+void AvalancheEngine::loadDigits() {   // Load the scoring digits & rwlites
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
@@ -1184,36 +1145,36 @@ void Avalot::loadDigits() {   // Load the scoring digits & rwlites
 
 	for (int i = 0; i < 10; i++) {
 		file.seek(i * digitsize);
-		_digits[i] = _vm->_graphics->loadPictureGraphic(file);
+		_digits[i] = _graphics->loadPictureGraphic(file);
 	}
 
 	for (int i = 0; i < 9; i++) {
 		file.seek(10 * digitsize + i * rwlitesize);
-		_directions[i] = _vm->_graphics->loadPictureGraphic(file);
+		_directions[i] = _graphics->loadPictureGraphic(file);
 	}
 
 	file.close();
 }
 
-void Avalot::drawToolbar() {
+void AvalancheEngine::drawToolbar() {
 	if (!file.open("useful.avd"))
 		error("AVALANCHE: Lucerna: File not found: useful.avd");
 
 	file.seek(40);
 
 	CursorMan.showMouse(false);
-	::Graphics::Surface picture = _vm->_graphics->loadPictureGraphic(file);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, picture, 5, 169);
+	::Graphics::Surface picture = _graphics->loadPictureGraphic(file);
+	_graphics->drawPicture(_graphics->_surface, picture, 5, 169);
 
 	picture.free();
 	file.close();
 
 	CursorMan.showMouse(true);
-	_vm->_animation->setOldDirection(kDirNone);
+	_animation->setOldDirection(kDirNone);
 	drawDirection();
 }
 
-void Avalot::drawScore() {
+void AvalancheEngine::drawScore() {
 	uint16 score = _dnascore;
 	int8 numbers[3] = {0, 0, 0};
 	for (int i = 0; i < 2; i++) {
@@ -1229,7 +1190,7 @@ void Avalot::drawScore() {
 
 	for (int i = 0; i < 3; i++) {
 		if (_scoreToDisplay[i] != numbers[i])
-			_vm->_graphics->drawPicture(_vm->_graphics->_surface, _digits[numbers[i]], 250 + (i + 1) * 15, 177);
+			_graphics->drawPicture(_graphics->_surface, _digits[numbers[i]], 250 + (i + 1) * 15, 177);
 	}
 
 	CursorMan.showMouse(true);
@@ -1238,63 +1199,63 @@ void Avalot::drawScore() {
 		_scoreToDisplay[i] = numbers[i];
 }
 
-void Avalot::incScore(byte num) {    
+void AvalancheEngine::incScore(byte num) {    
 	for (int i = 1; i <= num; i++) {
 		_dnascore++;
 
 		if (_soundFx) {
 			for (int j = 1; j <= 97; j++)
 				// Length os 2 is a guess, the original doesn't have a delay specified
-				_vm->_sound->playNote(177 + _dnascore * 3, 2);
+				_sound->playNote(177 + _dnascore * 3, 2);
 		}
 	}
-	warning("STUB: Avalot::points()");
+	warning("STUB: points()");
 
 	drawScore();
 }
 
-void Avalot::useCompass(const Common::Point &cursorPos) {
-	byte color = *(byte *)_vm->_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
+void AvalancheEngine::useCompass(const Common::Point &cursorPos) {
+	byte color = *(byte *)_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
 
 	switch (color) {
 	case kColorGreen:
-		_vm->_animation->setDirection(kDirUp);
-		_vm->_animation->setMoveSpeed(0, kDirUp);
+		_animation->setDirection(kDirUp);
+		_animation->setMoveSpeed(0, kDirUp);
 		drawDirection();
 		break;
 	case kColorBrown:
-		_vm->_animation->setDirection(kDirDown);
-		_vm->_animation->setMoveSpeed(0, kDirDown);
+		_animation->setDirection(kDirDown);
+		_animation->setMoveSpeed(0, kDirDown);
 		drawDirection();
 		break;
 	case kColorCyan:
-		_vm->_animation->setDirection(kDirLeft);
-		_vm->_animation->setMoveSpeed(0, kDirLeft);
+		_animation->setDirection(kDirLeft);
+		_animation->setMoveSpeed(0, kDirLeft);
 		drawDirection();
 		break;
 	case kColorLightmagenta:
-		_vm->_animation->setDirection(kDirRight);
-		_vm->_animation->setMoveSpeed(0, kDirRight);
+		_animation->setDirection(kDirRight);
+		_animation->setMoveSpeed(0, kDirRight);
 		drawDirection();
 		break;
 	case kColorRed:
 	case kColorWhite:
 	case kColorLightcyan:
 	case kColorYellow: // Fall-throughs are intended.
-		_vm->_animation->stopWalking();
+		_animation->stopWalking();
 		drawDirection();
 		break;
 	}
 }
 
-void Avalot::fxToggle() {
-	warning("STUB: Avalot::fxtoggle()");
+void AvalancheEngine::fxToggle() {
+	warning("STUB: fxtoggle()");
 }
 
-void Avalot::refreshObjectList() {
+void AvalancheEngine::refreshObjectList() {
 	_carryNum = 0;
 	if (_thinkThing && !_objects[_thinks - 1])
-		thinkAbout(kObjectMoney, Avalot::kThing); // you always have money
+		thinkAbout(kObjectMoney, kThing); // you always have money
 
 	for (int i = 0; i < kObjectNum; i++) {
 		if (_objects[i]) {
@@ -1307,15 +1268,15 @@ void Avalot::refreshObjectList() {
 /**
  * @remarks	Originally called 'verte'
  */
-void Avalot::guideAvvy(Common::Point cursorPos) {
+void AvalancheEngine::guideAvvy(Common::Point cursorPos) {
 	if (!_userMovesAvvy)
 		return;
 
 	cursorPos.y /= 2;
 	byte what;
 
-	// _vm->_animation->tr[0] is Avalot.)
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	// _animation->tr[0] is Avalot.)
+	AnimationType *avvy = &_animation->_sprites[0];
 	if (cursorPos.x < avvy->_x)
 		what = 1;
 	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
@@ -1330,39 +1291,39 @@ void Avalot::guideAvvy(Common::Point cursorPos) {
 
 	switch (what) {
 	case 0:
-		_vm->_animation->stopWalking();
+		_animation->stopWalking();
 		break; // Clicked on Avvy: no movement.
 	case 1:
-		_vm->_animation->setMoveSpeed(0, kDirLeft);
+		_animation->setMoveSpeed(0, kDirLeft);
 		break;
 	case 2:
-		_vm->_animation->setMoveSpeed(0, kDirRight);
+		_animation->setMoveSpeed(0, kDirRight);
 		break;
 	case 3:
-		_vm->_animation->setMoveSpeed(0, kDirUp);
+		_animation->setMoveSpeed(0, kDirUp);
 		break;
 	case 4:
-		_vm->_animation->setMoveSpeed(0, kDirUpLeft);
+		_animation->setMoveSpeed(0, kDirUpLeft);
 		break;
 	case 5:
-		_vm->_animation->setMoveSpeed(0, kDirUpRight);
+		_animation->setMoveSpeed(0, kDirUpRight);
 		break;
 	case 6:
-		_vm->_animation->setMoveSpeed(0, kDirDown);
+		_animation->setMoveSpeed(0, kDirDown);
 		break;
 	case 7:
-		_vm->_animation->setMoveSpeed(0, kDirDownLeft);
+		_animation->setMoveSpeed(0, kDirDownLeft);
 		break;
 	case 8:
-		_vm->_animation->setMoveSpeed(0, kDirDownRight);
+		_animation->setMoveSpeed(0, kDirDownRight);
 		break;
 	}    // No other values are possible.
 
 	drawDirection();
 }
 
-void Avalot::checkClick() {
-	Common::Point cursorPos = _vm->getMousePos();
+void AvalancheEngine::checkClick() {
+	Common::Point cursorPos = getMousePos();
 	_onToolbar = kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 
 	/*if (mrelease > 0)
@@ -1374,7 +1335,7 @@ void Avalot::checkClick() {
 		newMouse(7); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
 		newMouse(1); // screwdriver
-	else if (!_vm->_menu->isActive()) { // Dropdown can handle its own pointers.
+	else if (!_menu->isActive()) { // Dropdown can handle its own pointers.
 		if (_holdLeftMouse) {
 			newMouse(6); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
@@ -1385,45 +1346,45 @@ void Avalot::checkClick() {
 	if (_holdLeftMouse) {
 		if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu.
 			if (_dropsOk)
-				_vm->_menu->update();
+				_menu->update();
 		} else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line.
-			_vm->_parser->_inputTextPos = (cursorPos.x - 23) / 8;
-			if (_vm->_parser->_inputTextPos > _vm->_parser->_inputText.size() + 1)
-				_vm->_parser->_inputTextPos = _vm->_parser->_inputText.size() + 1;
-			if (_vm->_parser->_inputTextPos < 1)
-				_vm->_parser->_inputTextPos = 1;
-			_vm->_parser->_inputTextPos--;
-			_vm->_parser->plotText();
+			_parser->_inputTextPos = (cursorPos.x - 23) / 8;
+			if (_parser->_inputTextPos > _parser->_inputText.size() + 1)
+				_parser->_inputTextPos = _parser->_inputText.size() + 1;
+			if (_parser->_inputTextPos < 1)
+				_parser->_inputTextPos = 1;
+			_parser->_inputTextPos--;
+			_parser->plotText();
 		} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
 			if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass.
 				if (_alive && _avvyIsAwake)
 					useCompass(cursorPos);
 			} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
 				do {
-					_vm->updateEvents();
+					updateEvents();
 				} while (_holdLeftMouse);
 
 				if (_thinkThing) {
-					_vm->_parser->_thing = _thinks;
-					_vm->_parser->_thing += 49;
-					_vm->_parser->_person = kPeoplePardon;
+					_parser->_thing = _thinks;
+					_parser->_thing += 49;
+					_parser->_person = kPeoplePardon;
 				} else {
-					_vm->_parser->_person = (People) _thinks;
-					_vm->_parser->_thing = _vm->_parser->kPardon;
+					_parser->_person = (People) _thinks;
+					_parser->_thing = _parser->kPardon;
 				}
 				callVerb(kVerbCodeExam);
 			} else if ((261 <= cursorPos.x) && (cursorPos.x <= 319)) { // Display the score.
 				do {
-					_vm->updateEvents();
+					updateEvents();
 				} while (_holdLeftMouse);
 
 				callVerb(kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_vm->_animation->_sprites[0]._speedX = kWalk;
-				_vm->_animation->updateSpeed();
+				_animation->_sprites[0]._speedX = kWalk;
+				_animation->updateSpeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_vm->_animation->_sprites[0]._speedX = kRun;
-				_vm->_animation->updateSpeed();
+				_animation->_sprites[0]._speedX = kRun;
+				_animation->updateSpeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
@@ -1433,60 +1394,60 @@ void Avalot::checkClick() {
 	}
 }
 
-void Avalot::errorLed() {
-	warning("STUB: Avalot::errorled()");
+void AvalancheEngine::errorLed() {
+	warning("STUB: errorled()");
 }
 
-int8 Avalot::fades(int8 x) {
-	warning("STUB: Avalot::fades()");
+int8 AvalancheEngine::fades(int8 x) {
+	warning("STUB: fades()");
 	return 0;
 }
 
-void Avalot::fadeOut(byte n) {
-	warning("STUB: Avalot::fadeOut()");
+void AvalancheEngine::fadeOut(byte n) {
+	warning("STUB: fadeOut()");
 }
 
-void Avalot::dusk() {
-	warning("STUB: Avalot::dusk()");
+void AvalancheEngine::dusk() {
+	warning("STUB: dusk()");
 }
 
-void Avalot::fadeIn(byte n) {
-	warning("STUB: Avalot::fadeIn()");
+void AvalancheEngine::fadeIn(byte n) {
+	warning("STUB: fadeIn()");
 }
 
-void Avalot::dawn() {
-	warning("STUB: Avalot::dawn()");
+void AvalancheEngine::dawn() {
+	warning("STUB: dawn()");
 }
 
-void Avalot::drawDirection() { // It's data is loaded in load_digits().
-	if (_vm->_animation->getOldDirection() == _vm->_animation->getDirection())
+void AvalancheEngine::drawDirection() { // It's data is loaded in load_digits().
+	if (_animation->getOldDirection() == _animation->getDirection())
 		return;
 
-	_vm->_animation->setOldDirection(_vm->_animation->getDirection());
+	_animation->setOldDirection(_animation->getDirection());
 
 	CursorMan.showMouse(false);
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _directions[_vm->_animation->getDirection()], 0, 161);
+	_graphics->drawPicture(_graphics->_surface, _directions[_animation->getDirection()], 0, 161);
 	CursorMan.showMouse(true);
 }
 
 
-void Avalot::gameOver() {
+void AvalancheEngine::gameOver() {
 	_userMovesAvvy = false;
 
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = &_animation->_sprites[0];
 	int16 sx = avvy->_x;
 	int16 sy = avvy->_y;
 
 	avvy->remove();
-	avvy->init(12, true, _vm->_animation); // 12 = Avalot falls
+	avvy->init(12, true, _animation); // 12 = Avalot falls
 	avvy->_stepNum = 0;
 	avvy->appear(sx, sy, kDirUp);
 
-	_vm->_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
+	_timer->addTimer(3, Timer::kProcAvalotFalls, Timer::kReasonFallingOver);
 	_alive = false;
 }
 
-void Avalot::minorRedraw() {
+void AvalancheEngine::minorRedraw() {
 	dusk();
 
 	enterRoom(_room, 0); // Ped unknown or non-existant.
@@ -1498,13 +1459,13 @@ void Avalot::minorRedraw() {
 	dawn();
 }
 
-void Avalot::majorRedraw() {
-	warning("STUB: Avalot::major_redraw()");
+void AvalancheEngine::majorRedraw() {
+	warning("STUB: major_redraw()");
 }
 
-uint16 Avalot::bearing(byte whichPed) {
+uint16 AvalancheEngine::bearing(byte whichPed) {
 	static const double rad2deg = 180 / 3.14; // Pi
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = &_animation->_sprites[0];
 	PedType *curPed = &_peds[whichPed];
 
 	if (avvy->_x == curPed->_x)
@@ -1519,24 +1480,24 @@ uint16 Avalot::bearing(byte whichPed) {
 /** 
  * @remarks	Originally called 'sprite_run'
  */
-void Avalot::spriteRun() {
+void AvalancheEngine::spriteRun() {
 	_doingSpriteRun = true;
-	_vm->_animation->animLink();
+	_animation->animLink();
 	_doingSpriteRun = false;
 }
 
-void Avalot::fixFlashers() {
+void AvalancheEngine::fixFlashers() {
 	_ledStatus = 177;
-	_vm->_animation->setOldDirection(kDirNone);
-	_vm->_dialogs->setReadyLight(2);
+	_animation->setOldDirection(kDirNone);
+	_dialogs->setReadyLight(2);
 	drawDirection();
 }
 
-Common::String Avalot::intToStr(int32 num) {
+Common::String AvalancheEngine::intToStr(int32 num) {
 	return Common::String::format("%d", num);
 }
 
-void Avalot::newMouse(byte id) {
+void AvalancheEngine::newMouse(byte id) {
 	if (id == _currentMouse)
 		return;
 
@@ -1548,12 +1509,12 @@ void Avalot::newMouse(byte id) {
  * Set the mouse pointer to 'HourGlass"
  * @remarks	Originally called 'wait'
  */
-void Avalot::setMousePointerWait() {
+void AvalancheEngine::setMousePointerWait() {
 	newMouse(4);
 }
 
-void Avalot::resetVariables() {
-	_vm->_animation->setDirection(kDirUp);
+void AvalancheEngine::resetVariables() {
+	_animation->setDirection(kDirUp);
 	_carryNum = 0;
 	for (int i = 0; i < kObjectNum; i++)
 		_objects[i] = false;
@@ -1561,7 +1522,7 @@ void Avalot::resetVariables() {
 	_dnascore = 0;
 	_money = 0;
 	_room = kRoomNowhere;
-	_vm->_saveNum = 0;
+	_saveNum = 0;
 	for (int i = 0; i < 100; i++)
 		_roomCount[i] = 0;
 
@@ -1624,32 +1585,32 @@ void Avalot::resetVariables() {
 	_givenPenToAyles = false;
 	_askedDogfoodAboutNim = false;
 
-	_vm->_parser->resetVariables();
-	_vm->_animation->resetVariables();
-	_vm->_sequence->resetVariables();
+	_parser->resetVariables();
+	_animation->resetVariables();
+	_sequence->resetVariables();
 }
 
-void Avalot::newGame() {
+void AvalancheEngine::newGame() {
 	for (int i = 0; i < kMaxSprites; i++) {
-		AnimationType *spr = &_vm->_animation->_sprites[i];
+		AnimationType *spr = &_animation->_sprites[i];
 		if (spr->_quick)
 			spr->remove();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	avvy->init(0, true, _vm->_animation);
+	AnimationType *avvy = &_animation->_sprites[0];
+	avvy->init(0, true, _animation);
 
 	_alive = true;
 	resetVariables();
 
-	_vm->_dialogs->setBubbleStateNatural();
+	_dialogs->setBubbleStateNatural();
 
 	_spareEvening = "answer a questionnaire";
 	_favouriteDrink = "beer";
 	_money = 30; // 2/6
-	_vm->_animation->setDirection(kDirStopped);
-	_vm->_parser->_wearing = kObjectClothes;
+	_animation->setDirection(kDirStopped);
+	_parser->_wearing = kObjectClothes;
 	_objects[kObjectMoney - 1] = true;
 	_objects[kObjectBodkin - 1] = true;
 	_objects[kObjectBell - 1] = true;
@@ -1668,7 +1629,7 @@ void Avalot::newGame() {
 	_her = kPeoplePardon;
 	_it = Parser::kPardon;
 	_lastPerson = kPeoplePardon; // = Pardon?
-	_passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_passwordNum = _rnd->getRandomNumber(30) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
 	_avvyInBed = true;
@@ -1677,16 +1638,16 @@ void Avalot::newGame() {
 	enterRoom(kRoomYours, 1);
 	avvy->_visible = false;
 	drawScore();
-	_vm->_menu->setup();
-	_clock.update();
+	_menu->setup();
+	_clock->update();
 	spriteRun();
 }
 
-void Avalot::slowDown() {
-	warning("STUB: Avalot::slowdown()");
+void AvalancheEngine::slowDown() {
+	warning("STUB: slowdown()");
 }
 
-bool Avalot::setFlag(char x) {
+bool AvalancheEngine::setFlag(char x) {
 	for (uint16 i = 0; i < _flags.size(); i++) {
 		if (_flags[i] == x)
 			return true;
@@ -1695,17 +1656,17 @@ bool Avalot::setFlag(char x) {
 	return false;
 }
 
-bool Avalot::decreaseMoney(uint16 amount) {
+bool AvalancheEngine::decreaseMoney(uint16 amount) {
 	_money -= amount;
 	if (_money < 0) {
-		_vm->_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
+		_dialogs->displayScrollChain('Q', 2); // "You are now denariusless!"
 		gameOver();
 		return false;
 	} else
 		return true;
 }
 
-Common::String Avalot::getName(People whose) {
+Common::String AvalancheEngine::getName(People whose) {
 	static const Common::String kLads[17] = {
 		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
 		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
@@ -1720,7 +1681,7 @@ Common::String Avalot::getName(People whose) {
 		return kLasses[whose - kPeopleArkata];
 }
 
-byte Avalot::getNameChar(People whose) {
+byte AvalancheEngine::getNameChar(People whose) {
 	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
 	static const char kLassChar[] = "kG\0xB1o";
 
@@ -1730,7 +1691,7 @@ byte Avalot::getNameChar(People whose) {
 		return kLassChar[whose - kPeopleArkata];
 }
 
-Common::String Avalot::getThing(byte which) {
+Common::String AvalancheEngine::getThing(byte which) {
 	static const Common::String kThings[kObjectNum] = {
 		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
 		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
@@ -1762,7 +1723,7 @@ Common::String Avalot::getThing(byte which) {
 	return get_thing_result;
 }
 
-char Avalot::getThingChar(byte which) {
+char AvalancheEngine::getThingChar(byte which) {
 	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
 
 	char get_thingchar_result;
@@ -1779,7 +1740,7 @@ char Avalot::getThingChar(byte which) {
 	return get_thingchar_result;
 }
 
-Common::String Avalot::getItem(byte which) {
+Common::String AvalancheEngine::getItem(byte which) {
 	static const Common::String kItems[kObjectNum] = {
 		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
 		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
@@ -1821,8 +1782,7 @@ Common::String Avalot::getItem(byte which) {
 	return get_better_result;
 }
 
-
-Common::String Avalot::f5Does() {
+Common::String AvalancheEngine::f5Does() {
 	switch (_room) {
 	case kRoomYours:
 		if (!_avvyIsAwake)
@@ -1843,7 +1803,7 @@ Common::String Avalot::f5Does() {
 			return Common::String::format("%cSSit down", kVerbCodeSit);
 		break;
 	case kRoomMusicRoom:
-		if (_vm->_animation->inField(5))
+		if (_animation->inField(5))
 			return Common::String::format("%cPPlay the harp", kVerbCodePlay);
 		break;
 	}
@@ -1851,7 +1811,7 @@ Common::String Avalot::f5Does() {
 	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
 }
 
-void Avalot::loadMouse(byte which) {
+void AvalancheEngine::loadMouse(byte which) {
 	Common::File f;
 
 	if (!f.open("mice.avd"))
@@ -1865,7 +1825,7 @@ void Avalot::loadMouse(byte which) {
 	// The AND mask.
 	f.seek(kMouseSize * 2 * which + 134);
 
-	::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f);
+	::Graphics::Surface mask = _graphics->loadPictureGraphic(f);
 
 	for (int j = 0; j < mask.h; j++) {
 		for (int i = 0; i < mask.w; i++) {
@@ -1882,7 +1842,7 @@ void Avalot::loadMouse(byte which) {
 	// The OR mask.
 	f.seek(kMouseSize * 2 * which + 134 * 2);
 
-	mask = _vm->_graphics->loadPictureGraphic(f);
+	mask = _graphics->loadPictureGraphic(f);
 
 	for (int j = 0; j < mask.h; j++) {
 		for (int i = 0; i < mask.w; i++) {
@@ -1901,51 +1861,51 @@ void Avalot::loadMouse(byte which) {
 	cursor.free();
 }
 
-void Avalot::setBackgroundColor(byte x) {
-	warning("STUB: Avalot::background()");
+void AvalancheEngine::setBackgroundColor(byte x) {
+	warning("STUB: background()");
 }
 
-void Avalot::hangAroundForAWhile() {
+void AvalancheEngine::hangAroundForAWhile() {
 	for (int i = 0; i < 28; i++)
 		slowDown();
 }
 
-void Avalot::flipRoom(Room room, byte ped) {
+void AvalancheEngine::flipRoom(Room room, byte ped) {
 	assert((ped > 0) && (ped < 15));
 	if (!_alive) {
 		// You can't leave the room if you're dead.
-		_vm->_animation->_sprites[0]._moveX = 0;
-		_vm->_animation->_sprites[0]._moveY = 0; // Stop him from moving.
+		_animation->_sprites[0]._moveX = 0;
+		_animation->_sprites[0]._moveY = 0; // Stop him from moving.
 		return;
 	}
 
 	if ((room == kRoomDummy) && (_room == kRoomLusties)) {
-		_vm->_animation->hideInCupboard();
+		_animation->hideInCupboard();
 		return;
 	}
 
 	if ((_jumpStatus > 0) && (_room == kRoomInsideCardiffCastle)) {
 		// You can't *jump* out of Cardiff Castle!
-		_vm->_animation->_sprites[0]._moveX = 0;
+		_animation->_sprites[0]._moveX = 0;
 		return;
 	}
 
 	exitRoom(_room);
 	dusk();
 
-	for (int16 i = 1; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._quick)
-			_vm->_animation->_sprites[i].remove();
+	for (int16 i = 1; i < _animation->kSpriteNumbMax; i++) {
+		if (_animation->_sprites[i]._quick)
+			_animation->_sprites[i].remove();
 	} // Deallocate sprite
 
 	if (_room == kRoomLustiesRoom)
 		_enterCatacombsFromLustiesRoom = true;
 
 	enterRoom(room, ped);
-	_vm->_animation->appearPed(0, ped - 1);
+	_animation->appearPed(0, ped - 1);
 	_enterCatacombsFromLustiesRoom = false;
-	_vm->_animation->setOldDirection(_vm->_animation->getDirection());
-	_vm->_animation->setDirection(_vm->_animation->_sprites[0]._facingDir);
+	_animation->setOldDirection(_animation->getDirection());
+	_animation->setDirection(_animation->_sprites[0]._facingDir);
 	drawDirection();
 
 	dawn();
@@ -1958,54 +1918,54 @@ void Avalot::flipRoom(Room room, byte ped) {
  * here.
  * @remarks	Originally called 'open_the_door'
  */
-void Avalot::openDoor(Room whither, byte ped, byte magicnum) {
+void AvalancheEngine::openDoor(Room whither, byte ped, byte magicnum) {
 	switch (_room) {
 	case kRoomOutsideYours:
 	case kRoomOutsideNottsPub:
 	case kRoomOutsideDucks:
-		_vm->_sequence->startOutsideSeq(whither, ped);
+		_sequence->startOutsideSeq(whither, ped);
 		break;
 	case kRoomInsideCardiffCastle:
-		_vm->_sequence->startCardiffSeq(whither, ped);
+		_sequence->startCardiffSeq(whither, ped);
 		break;
 	case kRoomAvvysGarden:
 	case kRoomEntranceHall:
 	case kRoomInsideAbbey:
 	case kRoomYourHall:
-		_vm->_sequence->startHallSeq(whither, ped);
+		_sequence->startHallSeq(whither, ped);
 		break;
 	case kRoomMusicRoom:
 	case kRoomOutsideArgentPub:
-		_vm->_sequence->startMusicRoomSeq2(whither, ped);
+		_sequence->startMusicRoomSeq2(whither, ped);
 		break;
 	case kRoomLusties:
 		switch (magicnum) {
 		case 14:
 			if (_avvysInTheCupboard) {
-				_vm->_animation->hideInCupboard();
-				_vm->_sequence->startCupboardSeq();
+				_animation->hideInCupboard();
+				_sequence->startCupboardSeq();
 				return;
 			} else {
-				_vm->_animation->appearPed(0, 5);
-				_vm->_animation->_sprites[0]._facingDir = kDirRight;
-				_vm->_sequence->startLustiesSeq2(whither, ped);
+				_animation->appearPed(0, 5);
+				_animation->_sprites[0]._facingDir = kDirRight;
+				_sequence->startLustiesSeq2(whither, ped);
 			}
 			break;
 		case 12:
-			_vm->_sequence->startLustiesSeq3(whither, ped);
+			_sequence->startLustiesSeq3(whither, ped);
 			break;
 		}
 		break;
 	default:
-		_vm->_sequence->startDummySeq(whither, ped);
+		_sequence->startDummySeq(whither, ped);
 	}
 }
 
-void Avalot::setRoom(People persId, Room roomId) {
+void AvalancheEngine::setRoom(People persId, Room roomId) {
 	_whereIs[persId - kPeopleAvalot] = roomId;	
 }
 
-Room Avalot::getRoom(People persId) {
+Room AvalancheEngine::getRoom(People persId) {
 	return _whereIs[persId - kPeopleAvalot];	
 }
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index a80d80d..af7ba2c 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -111,261 +111,6 @@ struct Sundry { // Things which must be saved over a backtobootstrap, outside DN
 };
 #endif
 
-class Avalot {
-public:
-	static const int16 kXW = 30;
-	static const int16 kYW = 36; // x width & y whatsit
-	static const int16 kMargin = 5;
-	static const MouseHotspotType kMouseHotSpots[9];
-	static const int16 kMaxSprites = 2; // Current max no. of sprites.
-
-	// For Thinkabout:
-	static const bool kThing = true;
-	static const bool kPerson = false;
-
-	// Magic/portal constants:
-	enum Magics {
-		kMagicNothing, // Ignore it if this line is touched.
-		kMagicBounce, // Bounce off this line. Not valid for portals.
-		kMagicExclaim, // Put up a chain of scrolls.
-		kMagicTransport, // Enter new room.
-		kMagicUnfinished, // Unfinished connection.
-		kMagicSpecial, // Special function.
-		kMagicOpenDoor // Opening door.
-	};
-
-	// These following static constants should be included in CFG when it's written.
-
-	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
-	static const int16 kBorder = 1; // size of border on shadowboxes
-	static const int16 kWalk = 3;
-	static const int16 kRun = 5;
-	static const int32 kCatacombMap[8][8];
-	static const char kSpludwicksOrder[3];
-	static const QuasipedType kQuasipeds[16];
-
-	enum Pitch {
-		kPitchInvalid,
-		kPitchLower,
-		kPitchSame,
-		kPitchHigher
-	};
-
-	static const uint16 kNotes[12];
-	static const TuneType kTune;
-
-	static const char *kVersionNum;
-	static const char *kCopyright;
-	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
-	static const int16 kGameCode = 2; // Avalot's code number
-
-
-
-	Avalot(AvalancheEngine *vm);
-	~Avalot();
-
-	bool _holdLeftMouse;
-	Clock _clock;
-	
-	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
-	// If a scroll comes up, or you leave the room, it's automatically set to zero.
-	byte _interrogation;
-
-	// Former DNA structure
-	byte _carryNum; // How many objects you're carrying...
-	bool _objects[kObjectNum]; // ...and which ones they are.
-	int16 _dnascore; // your score, of course
-	int32 _money; // your current amount of dosh
-	Room _room; // your current room
-	byte _roomCount[100]; // Add one to each every time you enter a room
-	bool _wonNim; // Have you *won* Nim? (That's harder.)
-	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
-	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
-	byte _passwordNum; // Number of the passw for this game.
-	bool _aylesIsAwake; // pretty obvious!
-	byte _drawbridgeOpen; // Between 0 (shut) and 4 (open).
-	byte _avariciusTalk; // How much Avaricius has said to you.
-	bool _rottenOnion; // And has it rotted?
-	bool _onionInVinegar; // Is the onion in the vinegar?
-	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
-	byte _brummieStairs; // Progression through the stairs trick.
-	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
-	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
-	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
-	bool _avvyInBed; // True if Avvy's in bed, but awake.
-	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
-	byte _npcFacing; // If there's an NPC in the current room which turns it's head according to Avvy's movement (keep looking at him), this variable tells which way it's facing at the moment.
-	bool _givenBadgeToIby; // Have you given the badge to Iby yet?
-	bool _friarWillTieYouUp; // If you're going to get tied up.
-	bool _tiedUp; // You ARE tied up!
-	byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box.
-	bool _talkedToCrapulus; // Pretty self-explanatory.
-	byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone.
-	bool _bellsAreRinging; // Is Jacques ringing the bells?
-	bool _standingOnDais; // In room 71, inside Cardiff Castle.
-	bool _takenPen; // Have you taken the pen (in Cardiff?)
-	bool _arrowTriggered; // And has the arrow been triggered?
-	bool _arrowInTheDoor;  // Did the arrow hit the wall?
-	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
-	uint32 _totalTime; // Your total time playing this game, in ticks.
-	byte _jumpStatus; // Fixes how high you're jumping.
-	bool _mushroomGrowing; // Is the mushroom growing in 42?
-	bool _spludwickAtHome; // Is Spludwick at home?
-	byte _lastRoom;
-	byte _lastRoomNotMap;
-	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
-	bool _enterCatacombsFromLustiesRoom;
-	bool _teetotal; // Are we touching any more drinks?
-	byte _malagauche; // Position of Malagauche. See Celer for more info.
-	char _drinking; // What's he getting you?
-	bool _enteredLustiesRoomAsMonk;
-	byte _catacombX, _catacombY;   // XY coords in the catacombs.
-	bool _avvysInTheCupboard; // On screen 22.
-	bool _geidaFollows; // Is Geida following you?
-	byte _nextBell; // For the ringing.
-	bool _givenPotionToGeida; // Does Geida have the potion?
-	bool _lustieIsAsleep; // Is BDL asleep?
-	bool _beenTiedUp; // In r__Robins.
-	bool _sittingInPub; // Are you sitting down in the pub?
-	byte _spurgeTalkCount; // Count for talking to Spurge.
-	bool _metAvaroid;
-	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
-	// End of former DNA Structure
-
-	byte _lineNum; // Number of lines.
-	LineType _lines[50]; // For Also.
-	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
-	bool _dropsOk, _soundFx, _cheat;
-	Common::String _mouseText;
-	bool _weirdWord;
-	bool _letMeOut;
-	Common::String _scroll[15];
-	byte _scrollNum, _whichwas;
-	byte _thinks;
-	bool _thinkThing;
-	int16 _talkX, _talkY;
-	byte _talkBackgroundColor, _talkFontColor;
-	byte _scrollBells; // no. of times to ring the bell
-	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
-	char _objectList[10];
-	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
-	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
-	// Called .free() for them in ~Gyro().
-	int8 _scoreToDisplay[3];
-	byte _currentMouse; // current mouse-void
-	Common::String _verbStr; // what you can do with your object. :-)
-	Common::String *_also[31][2];
-	PedType _peds[15];
-	MagicType _magics[15];
-	MagicType _portals[7];
-	FieldType _fields[30];
-	byte _fieldNum;
-	Common::String _flags;
-	Common::String _listen;
-	byte _cp, _ledStatus, _defaultLed;
-	FontType _font;
-	bool _alive;
-	byte _buffer[2000];
-	uint16 _bufSize;
-	int16 _underScroll; // Y-coord of just under the scroll text.
-	Common::String _roomnName; // Name of actual room
-	Common::String _subject; // What you're talking to them about.
-	byte _subjectNum; // The same thing.
-	bool _keyboardClick; // Is a keyboard click noise wanted?
-	People _him, _her;
-	byte _it;
-	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
-
-	People _lastPerson; // Last person to have been selected using the People menu.
-	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
-	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
-	bool _isLoaded; // Is it a loaded gamestate?
-	Common::String _enidFilename;
-
-	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
-	void setup();
-	void runAvalot();
-
-	void init();
-	void callVerb(VerbCode id);
-	void drawAlsoLines();
-	void loadRoom(byte num);
-	void exitRoom(byte x);
-	void enterRoom(Room room, byte ped);
-	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
-	void loadDigits(); // Load the scoring digits & rwlites
-	void drawToolbar();
-	void drawScore();
-	void incScore(byte num); // Add on no. of points
-	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
-	void fxToggle();
-	void refreshObjectList();
-	void checkClick();
-	void errorLed();
-	void dusk();
-	void dawn();
-	void drawDirection(); // Draws the little icon at the left end of the text input field.
-	void gameOver();
-	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
-	void fixFlashers();
-	void loadAlso(byte num);
-
-	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
-	void minorRedraw();
-	void majorRedraw();
-
-	void spriteRun();
-
-	Common::String intToStr(int32 num);
-	void newMouse(byte id);
-	void setMousePointerWait();    // Makes hourglass.
-	void loadMouse(byte which);
-
-	void setBackgroundColor(byte x);
-	
-	void resetVariables();
-	void newGame(); // This sets up the DNA for a completely new game.
-	void slowDown();
-	bool setFlag(char x);
-	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
-	void hangAroundForAWhile();
-	
-	Common::String getName(People whose);
-	byte getNameChar(People whose);
-	Common::String getThing(byte which);
-	char getThingChar(byte which);
-	Common::String getItem(byte which); // Called get_better in the original.
-	Common::String f5Does(); // This procedure determines what f5 does.
-
-	void openDoor(Room whither, byte ped, byte magicnum); // Handles slidey-open doors.
-	void flipRoom(Room room, byte ped);
-
-	void setRoom(People persId, Room roomId);
-	Room getRoom(People persId);
-private:
-	AvalancheEngine *_vm;
-
-	static Room _whereIs[29];
-
-	Common::File file;
-	Common::String readAlsoStringFromFile();
-	void scram(Common::String &str);
-	void unScramble();
-
-	void zoomOut(int16 x, int16 y); // Only used when entering the map.
-	void enterNewTown();
-	void findPeople(byte room);
-	void putGeidaAt(byte whichPed, byte ped);
-	void guideAvvy(Common::Point cursorPos);
-
-	// Will be used in dusk() and dawn().
-	bool _fxHidden;
-
-	int8 fades(int8 x);
-	void fadeOut(byte n);
-	void fadeIn(byte n);
-};
-
 } // End of namespace Avalanche
 
 #endif // AVALANCHE_AVALOT_H
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 00c51be..c4abc66 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -53,28 +53,28 @@ void Background::update() {
 	if (_vm->_menu->isActive())
 		return; // No animation when the menus are up.
 
-	switch (_vm->_avalot->_room) {
+	switch (_vm->_room) {
 	case kRoomOutsideArgentPub:
-		if ((_vm->_avalot->_roomTime % 12) == 0)
-			draw(-1, -1, (_vm->_avalot->_roomTime / 12) % 4);
+		if ((_vm->_roomTime % 12) == 0)
+			draw(-1, -1, (_vm->_roomTime / 12) % 4);
 		break;
 	case kRoomBrummieRoad:
-		if ((_vm->_avalot->_roomTime % 2) == 0)
-			draw(-1, -1, (_vm->_avalot->_roomTime / 2) % 4);
+		if ((_vm->_roomTime % 2) == 0)
+			draw(-1, -1, (_vm->_roomTime / 2) % 4);
 		break;
 	case kRoomBridge:
-		if ((_vm->_avalot->_roomTime % 2) == 0)
-			draw(-1, -1, 3 + (_vm->_avalot->_roomTime / 2) % 4);
+		if ((_vm->_roomTime % 2) == 0)
+			draw(-1, -1, 3 + (_vm->_roomTime / 2) % 4);
 		break;
 	case kRoomYours:
-		if ((!_vm->_avalot->_avvyIsAwake) && ((_vm->_avalot->_roomTime % 4) == 0))
-			draw(-1, -1, (_vm->_avalot->_roomTime / 12) % 2);
+		if ((!_vm->_avvyIsAwake) && ((_vm->_roomTime % 4) == 0))
+			draw(-1, -1, (_vm->_roomTime / 12) % 2);
 		break;
 	case kRoomArgentPub:
-		if (((_vm->_avalot->_roomTime % 7) == 1) && (_vm->_avalot->_malagauche != 177)) {
+		if (((_vm->_roomTime % 7) == 1) && (_vm->_malagauche != 177)) {
 			// Malagauche cycle.
-			_vm->_avalot->_malagauche++;
-			switch (_vm->_avalot->_malagauche) {
+			_vm->_malagauche++;
+			switch (_vm->_malagauche) {
 			case 1:
 			case 11:
 			case 21:
@@ -90,12 +90,12 @@ void Background::update() {
 				draw(-1, -1, 12); // Winks.
 				break;
 			case 33:
-				_vm->_avalot->_malagauche = 0;
+				_vm->_malagauche = 0;
 				break;
 			}
 		}
 
-		switch (_vm->_avalot->_roomTime % 200) {
+		switch (_vm->_roomTime % 200) {
 		case 179:
 		case 197:
 			draw(-1, -1, 4); // Dogfood's drinking cycle.
@@ -108,13 +108,13 @@ void Background::update() {
 			draw(-1, -1, 6);
 			break;
 		case 199:
-			_vm->_avalot->_npcFacing = 177; // Impossible value for this.
+			_vm->_npcFacing = 177; // Impossible value for this.
 			break;
 		}
 
-		if ((_vm->_avalot->_roomTime % 200 >= 0) && (_vm->_avalot->_roomTime % 200 <= 178)) { // Normally.
+		if ((_vm->_roomTime % 200 >= 0) && (_vm->_roomTime % 200 <= 178)) { // Normally.
 			byte direction = 0;
-			uint16 angle = _vm->_avalot->bearing(1);
+			uint16 angle = _vm->bearing(1);
 			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
 				direction = 3;
 			else if ((angle >= 293) && (angle <= 357))
@@ -122,15 +122,15 @@ void Background::update() {
 			else if ((angle >= 271) && (angle <= 292))
 				direction = 4;
 
-			if (direction != _vm->_avalot->_npcFacing) { // Dogfood.
+			if (direction != _vm->_npcFacing) { // Dogfood.
 				draw(-1, -1, direction - 1);
-				_vm->_avalot->_npcFacing = direction;
+				_vm->_npcFacing = direction;
 			}
 		}
 		break;
 	case kRoomWestHall:
-		if ((_vm->_avalot->_roomTime % 3) == 0) {
-			switch ((_vm->_avalot->_roomTime / int32(3)) % int32(6)) {
+		if ((_vm->_roomTime % 3) == 0) {
+			switch ((_vm->_roomTime / int32(3)) % int32(6)) {
 			case 4:
 				draw(-1, -1, 0);
 				break;
@@ -147,10 +147,10 @@ void Background::update() {
 		}
 		break;
 	case kRoomLustiesRoom:
-		if (!(_vm->_avalot->_lustieIsAsleep)) {
+		if (!(_vm->_lustieIsAsleep)) {
 			byte direction = 0;
-			uint16 angle = _vm->_avalot->bearing(1);
-			if ((_vm->_avalot->_roomTime % 45) > 42)
+			uint16 angle = _vm->bearing(1);
+			if ((_vm->_roomTime % 45) > 42)
 				direction = 4; // du Lustie blinks.
 			// Bearing of Avvy from du Lustie.
 			else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
@@ -160,15 +160,15 @@ void Background::update() {
 			else if ((angle >= 181) && (angle <= 314))
 				direction = 3; // Right.
 
-			if (direction != _vm->_avalot->_npcFacing) { // du Lustie.
+			if (direction != _vm->_npcFacing) { // du Lustie.
 				draw(-1, -1, direction - 1);
-				_vm->_avalot->_npcFacing = direction;
+				_vm->_npcFacing = direction;
 			}
 		}
 		break;
 	case kRoomAylesOffice:
-		if ((!_vm->_avalot->_aylesIsAwake) && (_vm->_avalot->_roomTime % 14 == 0)) {
-			switch ((_vm->_avalot->_roomTime / 14) % 2) {
+		if ((!_vm->_aylesIsAwake) && (_vm->_roomTime % 14 == 0)) {
+			switch ((_vm->_roomTime / 14) % 2) {
 			case 0:
 				draw(-1, -1, 0);  // Frame 2: EGA.
 				break;
@@ -179,8 +179,8 @@ void Background::update() {
 		}
 		break;
 	case kRoomRobins:
-		if (_vm->_avalot->_tiedUp) {
-			switch (_vm->_avalot->_roomTime % 54) {
+		if (_vm->_tiedUp) {
+			switch (_vm->_roomTime % 54) {
 			case 20:
 				draw(-1, -1, 3); // Frame 4: Avalot blinks.
 				break;
@@ -193,7 +193,7 @@ void Background::update() {
 	case kRoomNottsPub: {
 		// Bearing of Avvy from Port.
 		byte direction = 0;
-		uint16 angle = _vm->_avalot->bearing(4);
+		uint16 angle = _vm->bearing(4);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 2; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
@@ -201,15 +201,15 @@ void Background::update() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_avalot->_roomTime % 60) > 57)
+		if ((_vm->_roomTime % 60) > 57)
 			direction--; // Blinks.
 
-		if (direction != _vm->_avalot->_npcFacing) { // Port.
+		if (direction != _vm->_npcFacing) { // Port.
 			draw(-1, -1, direction - 1);
-			_vm->_avalot->_npcFacing = direction;
+			_vm->_npcFacing = direction;
 		}
 
-		switch (_vm->_avalot->_roomTime % 50) {
+		switch (_vm->_roomTime % 50) {
 		case 45 :
 			draw(-1, -1, 8); // Spurge blinks.
 			break;
@@ -220,12 +220,12 @@ void Background::update() {
 		break;
 	  }
 	case kRoomDucks: {
-		if ((_vm->_avalot->_roomTime % 3) == 0) // The fire flickers.
-			draw(-1, -1, (_vm->_avalot->_roomTime / 3) % 3);
+		if ((_vm->_roomTime % 3) == 0) // The fire flickers.
+			draw(-1, -1, (_vm->_roomTime / 3) % 3);
 
 		// Bearing of Avvy from Duck.
 		byte direction = 0;
-		uint16 angle = _vm->_avalot->bearing(1);
+		uint16 angle = _vm->bearing(1);
 		if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
 			direction = 4; // Middle.
 		else if ((angle >= 45) && (angle <= 180))
@@ -233,26 +233,26 @@ void Background::update() {
 		else if ((angle >= 181) && (angle <= 314))
 			direction = 8; // Right.
 
-		if ((_vm->_avalot->_roomTime % 45) > 42)
+		if ((_vm->_roomTime % 45) > 42)
 			direction++; // Duck blinks.
 
-		if (direction != _vm->_avalot->_npcFacing) { // Duck.
+		if (direction != _vm->_npcFacing) { // Duck.
 			draw(-1, -1, direction - 1);
-			_vm->_avalot->_npcFacing = direction;
+			_vm->_npcFacing = direction;
 		}
 		break;
 	   }
 	}
 
-	if ((_vm->_avalot->_bellsAreRinging) && (_vm->_avalot->setFlag('B'))) {
+	if ((_vm->_bellsAreRinging) && (_vm->setFlag('B'))) {
 		// They're ringing the bells.
-		switch (_vm->_avalot->_roomTime % 4) {
+		switch (_vm->_roomTime % 4) {
 		case 1:
-			if (_vm->_avalot->_nextBell < 5)
-				_vm->_avalot->_nextBell = 12;
-			_vm->_avalot->_nextBell--;
+			if (_vm->_nextBell < 5)
+				_vm->_nextBell = 12;
+			_vm->_nextBell--;
 			// CHECKME: 2 is a guess. No length in the original? 
-			_vm->_sound->playNote(_vm->_avalot->kNotes[_vm->_avalot->_nextBell], 2);
+			_vm->_sound->playNote(_vm->kNotes[_vm->_nextBell], 2);
 			break;
 		case 2:
 			_vm->_sound->stopSound();
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 7eb8d50..c8fe128 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -48,7 +48,7 @@ void Dialogs::init() {
 }
 
 void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
-	if (_vm->_avalot->_ledStatus == state)
+	if (_vm->_ledStatus == state)
 		return; // Already like that!
 
 	byte color = kColorBlack;
@@ -69,7 +69,7 @@ void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
 	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 
 	CursorMan.showMouse(true);
-	_vm->_avalot->_ledStatus = state;
+	_vm->_ledStatus = state;
 }
 
 void Dialogs::easterEgg() {
@@ -114,8 +114,8 @@ void Dialogs::scrollModeNormal() {
 	Common::String e = "(c) 1994";
 
 	setReadyLight(3);
-	_vm->_avalot->_seeScroll = true;
-	_vm->_avalot->newMouse(3);
+	_vm->_seeScroll = true;
+	_vm->newMouse(3);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -143,7 +143,7 @@ void Dialogs::scrollModeNormal() {
 	bool oktoexit;
 	do {
 		do {
-			_vm->_avalot->check(); // was "checkclick;"
+			_vm->check(); // was "checkclick;"
 
 //#ifdef RECORD slowdown(); basher::count++; #endif
 
@@ -168,12 +168,12 @@ void Dialogs::scrollModeNormal() {
 
 //#ifdef RECORD record_one(); #endif
 
-	_vm->_avalot->screturn = r == '#'; // "back door"
+	_vm->screturn = r == '#'; // "back door"
 #endif
 
 	setReadyLight(0);
-	_vm->_avalot->_seeScroll = false;
-	_vm->_avalot->_holdLeftMouse = false; // Used in Lucerna::checkclick().
+	_vm->_seeScroll = false;
+	_vm->_holdLeftMouse = false; // Used in Lucerna::checkclick().
 
 	warning("STUB: Scrolls::scrollModeNormal()");
 }
@@ -196,8 +196,8 @@ void Dialogs::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Stri
 	bool offset = text.size() % 2;
 	x1 = (x2 - x1) / 2 + x1 - text.size() / 2 * 8 - offset * 3;
 	y1 = (y2 - y1) / 2 + y1 - 4;
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, _vm->_avalot->_font, 8, x1, y1, kColorBlue);
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, Common::String('_'), _vm->_avalot->_font, 8, x1, y1, kColorBlue);
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, _vm->_font, 8, x1, y1, kColorBlue);
+	_vm->_graphics->drawText(_vm->_graphics->_scrolls, Common::String('_'), _vm->_font, 8, x1, y1, kColorBlue);
 
 	CursorMan.showMouse(true);
 }
@@ -206,7 +206,7 @@ void Dialogs::scrollModeDialogue() {
 	warning("STUB: Scrolls::scrollModeDialogue()");
 	// It should work with keypresses too! TODO: Implement it!
 
-	_vm->_avalot->loadMouse(5);
+	_vm->loadMouse(5);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -243,7 +243,7 @@ bool Dialogs::theyMatch(TuneType &played) {
 	byte mistakes = 0;
 
 	for (unsigned int i = 0; i < sizeof(played); i++) {
-		if (played[i] != _vm->_avalot->kTune[i])
+		if (played[i] != _vm->kTune[i])
 			mistakes++;
 	}
 
@@ -252,16 +252,16 @@ bool Dialogs::theyMatch(TuneType &played) {
 
 void Dialogs::scrollModeMusic() {
 	setReadyLight(3);
-	_vm->_avalot->_seeScroll = true;
+	_vm->_seeScroll = true;
 	CursorMan.showMouse(false);
-	_vm->_avalot->newMouse(3);
+	_vm->newMouse(3);
 
 	TuneType played;
 	for (unsigned int i = 0; i < sizeof(played); i++)
-		played[i] = Avalot::kPitchInvalid;
+		played[i] = kPitchInvalid;
 	int8 lastOne = -1, thisOne = -1; // Invalid values.
 
-	_vm->_avalot->_seeScroll = true;
+	_vm->_seeScroll = true;
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -332,16 +332,16 @@ void Dialogs::scrollModeMusic() {
 				lastOne = thisOne;
 				thisOne = value;
 
-				_vm->_sound->playNote(_vm->_avalot->kNotes[thisOne], 100);
+				_vm->_sound->playNote(_vm->kNotes[thisOne], 100);
 				_vm->_system->delayMillis(200);
 
-				if (!_vm->_avalot->_bellsAreRinging) { // These handle playing the right tune.
+				if (!_vm->_bellsAreRinging) { // These handle playing the right tune.
 					if (thisOne < lastOne)
-						store(Avalot::kPitchLower, played);
+						store(kPitchLower, played);
 					else if (thisOne == lastOne)
-						store(Avalot::kPitchSame, played);
+						store(kPitchSame, played);
 					else
-						store(Avalot::kPitchHigher, played);
+						store(kPitchHigher, played);
 				}
 				
 				if (theyMatch(played)) {
@@ -354,30 +354,30 @@ void Dialogs::scrollModeMusic() {
 
 	_vm->_graphics->_surface.copyFrom(temp);
 	temp.free();
-	_vm->_avalot->_seeScroll = false;
+	_vm->_seeScroll = false;
 	CursorMan.showMouse(true);
 }
 
 void Dialogs::resetScrollDriver() {
-	_vm->_avalot->_scrollBells = 0;
+	_vm->_scrollBells = 0;
 	_currentFont = kFontStyleRoman;
 	_useIcon = 0;
-	_vm->_avalot->_interrogation = 0; // Always reset after a scroll comes up.
+	_vm->_interrogation = 0; // Always reset after a scroll comes up.
 }
 
 void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (int i = 0; i < _vm->_avalot->_scrollBells; i++)
-		_vm->_avalot->errorLed(); // Ring the bell "x" times.
+	for (int i = 0; i < _vm->_scrollBells; i++)
+		_vm->errorLed(); // Ring the bell "x" times.
 }
 
 void Dialogs::dodgem() {
 	_dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(_dodgeCoord.x, _vm->_avalot->_underScroll); // Move the pointer off the scroll.
+	g_system->warpMouse(_dodgeCoord.x, _vm->_underScroll); // Move the pointer off the scroll.
 }
 
 void Dialogs::unDodgem() {
 	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_avalot->_underScroll))
+	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_underScroll))
 		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
@@ -408,7 +408,7 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 
 #if 0
-	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_avalot->cp) * _vm->_avalot->pagetop);
+	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->cp) * _vm->pagetop);
 	byte bit;
 	for (uint16 i = 1; i <= yl; i++)
 		for (bit = 0; bit <= 3; bit++) {
@@ -428,10 +428,10 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
-	int16 ly = (_vm->_avalot->_scrollNum) * 6;
+	int16 ly = (_vm->_scrollNum) * 6;
 	int16 ex;
-	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
-		ex = _vm->_avalot->_scroll[i].size() * 8;
+	for (int i = 0; i < _vm->_scrollNum; i++) {
+		ex = _vm->_scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
 	}
@@ -497,44 +497,44 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
-		if (!_vm->_avalot->_scroll[i].empty())
-			switch (_vm->_avalot->_scroll[i][_vm->_avalot->_scroll[i].size() - 1]) {
+	for (int i = 0; i < _vm->_scrollNum; i++) {
+		if (!_vm->_scroll[i].empty())
+			switch (_vm->_scroll[i][_vm->_scroll[i].size() - 1]) {
 			case kControlCenter:
 				centre = true;
-				_vm->_avalot->_scroll[i].deleteLastChar();
+				_vm->_scroll[i].deleteLastChar();
 				break;
 			case kControlLeftJustified:
 				centre = false;
-				_vm->_avalot->_scroll[i].deleteLastChar();
+				_vm->_scroll[i].deleteLastChar();
 				break;
 			case kControlQuestion:
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
-				_vm->_avalot->_scroll[i].setChar(' ', 0);
+				_vm->_scroll[i].setChar(' ', 0);
 				drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
 				drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				break;
 			}
 
 		if (centre)
-			say(320 - _vm->_avalot->_scroll[i].size() * 4 + iconIndent, my, _vm->_avalot->_scroll[i]);
+			say(320 - _vm->_scroll[i].size() * 4 + iconIndent, my, _vm->_scroll[i]);
 		else
-			say(mx + iconIndent, my, _vm->_avalot->_scroll[i]);
+			say(mx + iconIndent, my, _vm->_scroll[i]);
 
 		my += 12;
 	}
 
-	_vm->_avalot->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+	_vm->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
 	ringBell();
 	
-	_vm->_avalot->_dropsOk = false;
+	_vm->_dropsOk = false;
 	dodgem();
 
 	(this->*modeFunc)();
 
 	unDodgem();
-	_vm->_avalot->_dropsOk = true;
+	_vm->_dropsOk = true;
 	
 	resetScrollDriver();
 }
@@ -544,9 +544,9 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
-	int16 yl = _vm->_avalot->_scrollNum * 5;
-	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
-		uint16 textWidth = _vm->_avalot->_scroll[i].size() * 8;
+	int16 yl = _vm->_scrollNum * 5;
+	for (int i = 0; i < _vm->_scrollNum; i++) {
+		uint16 textWidth = _vm->_scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
 	}
@@ -557,90 +557,90 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	int16 my = yw * 2 - 2;
 	int16 xc = 0;
 
-	if ((_vm->_avalot->_talkX - xw) < 0)
-		xc = -(_vm->_avalot->_talkX - xw);
-	if ((_vm->_avalot->_talkX + xw) > 639)
-		xc = 639 - (_vm->_avalot->_talkX + xw);
+	if ((_vm->_talkX - xw) < 0)
+		xc = -(_vm->_talkX - xw);
+	if ((_vm->_talkX + xw) > 639)
+		xc = 639 - (_vm->_talkX + xw);
 
-	points[0].x = _vm->_avalot->_talkX - 10;
+	points[0].x = _vm->_talkX - 10;
 	points[0].y = yw;
-	points[1].x = _vm->_avalot->_talkX + 10;
+	points[1].x = _vm->_talkX + 10;
 	points[1].y = yw;
-	points[2].x = _vm->_avalot->_talkX;
-	points[2].y = _vm->_avalot->_talkY;
+	points[2].x = _vm->_talkX;
+	points[2].y = _vm->_talkY;
 
 	// Backup the screen before drawing the bubble.
 	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
 
 	// The body of the bubble.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_avalot->_talkX - xw + 9, 7, _vm->_avalot->_talkX + xw - 8 + xc, my + 1), _vm->_avalot->_talkBackgroundColor);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_avalot->_talkX - xw - 1, 12, _vm->_avalot->_talkX + xw + xc + 2, my - 4), _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _vm->_talkBackgroundColor);
+	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
 
 	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX + xw - 10, 11, 0, 90, 9, _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
 	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
 	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX - xw + 10, 11, 90, 180, 9, _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
 	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_avalot->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_avalot->_talkBackgroundColor);
+	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_talkBackgroundColor);
 
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
-	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used Avalot::characters instead.
+	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i < _vm->_avalot->_scrollNum; i++) {
-		int16 x = xc + _vm->_avalot->_talkX - _vm->_avalot->_scroll[i].size() / 2 * 8;
-		bool offset = _vm->_avalot->_scroll[i].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_avalot->_scroll[i], _vm->_avalot->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_avalot->_talkFontColor);
+	for (int i = 0; i < _vm->_scrollNum; i++) {
+		int16 x = xc + _vm->_talkX - _vm->_scroll[i].size() / 2 * 8;
+		bool offset = _vm->_scroll[i].size() % 2;
+		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
 	}
 
 	ringBell();
 	CursorMan.showMouse(false);
-	_vm->_avalot->_dropsOk = false;
+	_vm->_dropsOk = false;
 
 	// This does the actual drawing to the screen.
 	(this->*modeFunc)();
 
-	_vm->_avalot->_dropsOk = true;
+	_vm->_dropsOk = true;
 	CursorMan.showMouse(true); // sink;
 	resetScrollDriver();
 }
 
 void Dialogs::reset() {
-	_vm->_avalot->_scrollNum = 1;
+	_vm->_scrollNum = 1;
 	for (int i = 0; i < 15; i++) {
-		if (!_vm->_avalot->_scroll[i].empty())
-			_vm->_avalot->_scroll[i].clear();
+		if (!_vm->_scroll[i].empty())
+			_vm->_scroll[i].clear();
 	}
 }
 
 void Dialogs::setBubbleStateNatural() {
-	_vm->_avalot->_talkX = 320;
-	_vm->_avalot->_talkY = 200;
-	_vm->_avalot->_talkBackgroundColor = 8;
-	_vm->_avalot->_talkFontColor = 15;
+	_vm->_talkX = 320;
+	_vm->_talkY = 200;
+	_vm->_talkBackgroundColor = 8;
+	_vm->_talkFontColor = 15;
 }
 
 Common::String Dialogs::displayMoney() {
 	Common::String result;
 
-	if (_vm->_avalot->_money < 12) { // just pence
-		result = Common::String::format("%dd", _vm->_avalot->_money);
-	} else if (_vm->_avalot->_money < 240) { // shillings & pence
-		if ((_vm->_avalot->_money % 12) == 0)
-			result = Common::String::format("%d/-", _vm->_avalot->_money / 12);
+	if (_vm->_money < 12) { // just pence
+		result = Common::String::format("%dd", _vm->_money);
+	} else if (_vm->_money < 240) { // shillings & pence
+		if ((_vm->_money % 12) == 0)
+			result = Common::String::format("%d/-", _vm->_money / 12);
 		else
-			result = Common::String::format("%d/%d", _vm->_avalot->_money / 12, _vm->_avalot->_money % 12);
+			result = Common::String::format("%d/%d", _vm->_money / 12, _vm->_money % 12);
 	} else { // L, s & d
-		result = Common::String::format("\x9C%d.%d.%d", _vm->_avalot->_money / 240, (_vm->_avalot->_money / 12) % 20, 
-		                _vm->_avalot->_money % 12);
+		result = Common::String::format("\x9C%d.%d.%d", _vm->_money / 240, (_vm->_money / 12) % 20, 
+		                _vm->_money % 12);
 	}
-	if (_vm->_avalot->_money > 12) {
-		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_avalot->_money);
+	if (_vm->_money > 12) {
+		Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_money);
 		result += extraStr;
 	}
 
@@ -653,16 +653,16 @@ void Dialogs::stripTrailingSpaces(Common::String &str) {
 }
 
 void Dialogs::solidify(byte n) {
-	if (!_vm->_avalot->_scroll[n].contains(' '))
+	if (!_vm->_scroll[n].contains(' '))
 		return; // No spaces.
 
 	// So there MUST be a space there, somewhere...
 	do {
-		_vm->_avalot->_scroll[n + 1] = _vm->_avalot->_scroll[n][_vm->_avalot->_scroll[n].size() - 1] + _vm->_avalot->_scroll[n + 1];
-		_vm->_avalot->_scroll[n].deleteLastChar();
-	} while (_vm->_avalot->_scroll[n][_vm->_avalot->_scroll[n].size() - 1] != ' ');
+		_vm->_scroll[n + 1] = _vm->_scroll[n][_vm->_scroll[n].size() - 1] + _vm->_scroll[n + 1];
+		_vm->_scroll[n].deleteLastChar();
+	} while (_vm->_scroll[n][_vm->_scroll[n].size() - 1] != ' ');
 
-	stripTrailingSpaces(_vm->_avalot->_scroll[n]);
+	stripTrailingSpaces(_vm->_scroll[n]);
 }
 
 void Dialogs::callDialogDriver() {
@@ -676,38 +676,38 @@ void Dialogs::callDialogDriver() {
 	bool mouthnext = false;
 	bool call_spriterun = true; // Only call sprite_run the FIRST time.
 
-	switch (_vm->_avalot->_buffer[_vm->_avalot->_bufSize - 1]) {
+	switch (_vm->_buffer[_vm->_bufSize - 1]) {
 	case kControlToBuffer:
-		_vm->_avalot->_bufSize--;
+		_vm->_bufSize--;
 		break; // ^D = (D)on't include pagebreak
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
 	default:
-		_vm->_avalot->_buffer[_vm->_avalot->_bufSize] = kControlParagraph;
-		_vm->_avalot->_bufSize++;
+		_vm->_buffer[_vm->_bufSize] = kControlParagraph;
+		_vm->_bufSize++;
 	}
 
-	uint16 size = _vm->_avalot->_bufSize;
+	uint16 size = _vm->_bufSize;
 
 	for (uint16 i = 0; i < size; i++) {
 		if (mouthnext) {
-			if (_vm->_avalot->_buffer[i] == kControlRegister)
+			if (_vm->_buffer[i] == kControlRegister)
 				_param = 0;
-			else if (('0' <= _vm->_avalot->_buffer[i]) && (_vm->_avalot->_buffer[i] <= '9'))
-				_param = _vm->_avalot->_buffer[i] - 48;
-			else if (('A' <= _vm->_avalot->_buffer[i]) && (_vm->_avalot->_buffer[i] <= 'Z'))
-				_param = _vm->_avalot->_buffer[i] - 55;
+			else if (('0' <= _vm->_buffer[i]) && (_vm->_buffer[i] <= '9'))
+				_param = _vm->_buffer[i] - 48;
+			else if (('A' <= _vm->_buffer[i]) && (_vm->_buffer[i] <= 'Z'))
+				_param = _vm->_buffer[i] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_vm->_avalot->_buffer[i]) {
+			switch (_vm->_buffer[i]) {
 			case kControlParagraph:
-				if ((_vm->_avalot->_scrollNum == 1) && (_vm->_avalot->_scroll[0].empty()))
+				if ((_vm->_scrollNum == 1) && (_vm->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
-					_vm->_avalot->spriteRun();
+					_vm->spriteRun();
 				call_spriterun = false;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeNormal);
@@ -718,14 +718,14 @@ void Dialogs::callDialogDriver() {
 					return;
 				break;
 			case kControlBell:
-				_vm->_avalot->_scrollBells++;
+				_vm->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble:
-				if ((_vm->_avalot->_scrollNum == 1) && (_vm->_avalot->_scroll[0].empty()))
+				if ((_vm->_scrollNum == 1) && (_vm->_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
-					_vm->_avalot->spriteRun();
+					_vm->spriteRun();
 				call_spriterun = false;
 
 				if (_param == 0)
@@ -733,7 +733,7 @@ void Dialogs::callDialogDriver() {
 				else if ((1 <= _param) && (_param <= 9)) {
 					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
 					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
-						_vm->_avalot->errorLed();
+						_vm->errorLed();
 						setBubbleStateNatural();
 					} else
 						spr->chatter(); // Normal sprite talking routine.
@@ -741,14 +741,14 @@ void Dialogs::callDialogDriver() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					PedType *quasiPed = &_vm->_avalot->_peds[_vm->_avalot->kQuasipeds[_param - 10]._whichPed];
-					_vm->_avalot->_talkX = quasiPed->_x;
-					_vm->_avalot->_talkY = quasiPed->_y; // Position.
+					PedType *quasiPed = &_vm->_peds[_vm->kQuasipeds[_param - 10]._whichPed];
+					_vm->_talkX = quasiPed->_x;
+					_vm->_talkY = quasiPed->_y; // Position.
 
-					_vm->_avalot->_talkFontColor = _vm->_avalot->kQuasipeds[_param - 10]._foregroundColor;
-					_vm->_avalot->_talkBackgroundColor = _vm->_avalot->kQuasipeds[_param - 10]._backgroundColor; // Colors.
+					_vm->_talkFontColor = _vm->kQuasipeds[_param - 10]._foregroundColor;
+					_vm->_talkBackgroundColor = _vm->kQuasipeds[_param - 10]._backgroundColor; // Colors.
 				} else {
-					_vm->_avalot->errorLed(); // Not valid.
+					_vm->errorLed(); // Not valid.
 					setBubbleStateNatural();
 				}
 
@@ -767,46 +767,46 @@ void Dialogs::callDialogDriver() {
 					displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
 					break;
 				case 2: {
-					int pwdId = _vm->_parser->kFirstPassword + _vm->_avalot->_passwordNum;
+					int pwdId = _vm->_parser->kFirstPassword + _vm->_passwordNum;
 					displayText(_vm->_parser->_vocabulary[pwdId]._word + kControlToBuffer);
 					}
 					break;
 				case 3:
-					displayText(_vm->_avalot->_favouriteDrink + kControlToBuffer);
+					displayText(_vm->_favouriteDrink + kControlToBuffer);
 					break;
 				case 4:
-					displayText(_vm->_avalot->_favouriteSong + kControlToBuffer);
+					displayText(_vm->_favouriteSong + kControlToBuffer);
 					break;
 				case 5:
-					displayText(_vm->_avalot->_worstPlaceOnEarth + kControlToBuffer);
+					displayText(_vm->_worstPlaceOnEarth + kControlToBuffer);
 					break;
 				case 6:
-					displayText(_vm->_avalot->_spareEvening + kControlToBuffer);
+					displayText(_vm->_spareEvening + kControlToBuffer);
 					break;
 				case 9: {
-					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_avalot->_catacombX, _vm->_avalot->_catacombY, kControlToBuffer);
+					Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_catacombX, _vm->_catacombY, kControlToBuffer);
 					displayText(tmpStr);
 					}
 					break;
 				case 10:
-					switch (_vm->_avalot->_boxContent) {
+					switch (_vm->_boxContent) {
 					case 0: // Sixpence.
 						displayScrollChain('q', 37); // You find the sixpence.
-						_vm->_avalot->_money += 6;
-						_vm->_avalot->_boxContent = _vm->_parser->kNothing;
-						_vm->_avalot->incScore(2);
+						_vm->_money += 6;
+						_vm->_boxContent = _vm->_parser->kNothing;
+						_vm->incScore(2);
 						return;
 					case Parser::kNothing:
 						displayText("nothing at all. It's completely empty.");
 						break;
 					default:
-						displayText(_vm->_avalot->getItem(_vm->_avalot->_boxContent) + '.');
+						displayText(_vm->getItem(_vm->_boxContent) + '.');
 					}
 					break;
 				case 11:
 					for (int j = 0; j < kObjectNum; j++) {
-						if (_vm->_avalot->_objects[j]) 
-							displayText(_vm->_avalot->getItem(j) + ", " + kControlToBuffer);
+						if (_vm->_objects[j]) 
+							displayText(_vm->getItem(j) + ", " + kControlToBuffer);
 					}
 					break;
 				}
@@ -815,15 +815,15 @@ void Dialogs::callDialogDriver() {
 				_useIcon = _param;
 				break;
 			case kControlNewLine:
-				_vm->_avalot->_scrollNum++;
+				_vm->_scrollNum++;
 				break;
 			case kControlQuestion:
 				if (call_spriterun)
-					_vm->_avalot->spriteRun();
+					_vm->spriteRun();
 				call_spriterun = false;
 
-				_vm->_avalot->_scroll[_vm->_avalot->_scrollNum] = kControlQuestion;
-				_vm->_avalot->_scrollNum++;
+				_vm->_scroll[_vm->_scrollNum] = kControlQuestion;
+				_vm->_scrollNum++;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
 				reset();
@@ -833,14 +833,14 @@ void Dialogs::callDialogDriver() {
 				break;
 			case kControlInsertSpaces:
 				for (int j = 0; j < 9; j++)
-					_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1] += ' ';
+					_vm->_scroll[_vm->_scrollNum - 1] += ' ';
 				break;
 			default: // Add new char.
-				if (_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1].size() == 50) {
-					solidify(_vm->_avalot->_scrollNum - 1);
-					_vm->_avalot->_scrollNum++;
+				if (_vm->_scroll[_vm->_scrollNum - 1].size() == 50) {
+					solidify(_vm->_scrollNum - 1);
+					_vm->_scrollNum++;
 				}
-				_vm->_avalot->_scroll[_vm->_avalot->_scrollNum - 1] += _vm->_avalot->_buffer[i];
+				_vm->_scroll[_vm->_scrollNum - 1] += _vm->_buffer[i];
 				break;
 			}
 		}
@@ -848,8 +848,8 @@ void Dialogs::callDialogDriver() {
 }
 
 void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_avalot->_bufSize = text.size();
-	memcpy(_vm->_avalot->_buffer, text.c_str(), _vm->_avalot->_bufSize);
+	_vm->_bufSize = text.size();
+	memcpy(_vm->_buffer, text.c_str(), _vm->_bufSize);
 	callDialogDriver();
 }
 
@@ -880,7 +880,7 @@ void Dialogs::loadFont() {
 		error("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
 
 	for (int16 i = 0; i < 256; i++)
-		file.read(_vm->_avalot->_font[i],16);
+		file.read(_vm->_font[i],16);
 	file.close();
 }
 
@@ -889,7 +889,7 @@ void Dialogs::displayMusicalScroll() {
 		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
 	displayText(tmpStr);
 
-	_vm->_avalot->spriteRun();
+	_vm->spriteRun();
 	CursorMan.showMouse(false);
 	drawScroll(&Avalanche::Dialogs::scrollModeMusic);
 	CursorMan.showMouse(true);
@@ -899,13 +899,13 @@ void Dialogs::displayMusicalScroll() {
 // From Visa:
 
 void Dialogs::unSkrimble() {
-	for (uint16  i = 0; i < _vm->_avalot->_bufSize; i++)
-		_vm->_avalot->_buffer[i] = (~(_vm->_avalot->_buffer[i] - (i + 1))) % 256;
+	for (uint16  i = 0; i < _vm->_bufSize; i++)
+		_vm->_buffer[i] = (~(_vm->_buffer[i] - (i + 1))) % 256;
 }
 
 void Dialogs::doTheBubble() {
-	_vm->_avalot->_buffer[_vm->_avalot->_bufSize] = 2;
-	_vm->_avalot->_bufSize++;
+	_vm->_buffer[_vm->_bufSize] = 2;
+	_vm->_bufSize++;
 }
 
 /**
@@ -946,8 +946,8 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 		::error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_vm->_avalot->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_avalot->_buffer, _vm->_avalot->_bufSize);
+	_vm->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_buffer, _vm->_bufSize);
 	sezfile.close();
 	unSkrimble();
 
@@ -992,8 +992,8 @@ void Dialogs::speak(byte who, byte subject) {
 		error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_vm->_avalot->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_avalot->_buffer, _vm->_avalot->_bufSize);
+	_vm->_bufSize = sezfile.readUint16LE();
+	sezfile.read(_vm->_buffer, _vm->_bufSize);
 	sezfile.close();
 
 	unSkrimble();
@@ -1005,26 +1005,26 @@ void Dialogs::speak(byte who, byte subject) {
 
 void Dialogs::talkTo(byte whom) {
 	if (_vm->_parser->_person == kPeoplePardon) {
-		_vm->_parser->_person = (People)_vm->_avalot->_subjectNum;
-		_vm->_avalot->_subjectNum = 0;
+		_vm->_parser->_person = (People)_vm->_subjectNum;
+		_vm->_subjectNum = 0;
 	}
 
-	if (_vm->_avalot->_subjectNum == 0) {
+	if (_vm->_subjectNum == 0) {
 		switch (whom) {
 		case kPeopleSpludwick:
-			if ((_vm->_avalot->_lustieIsAsleep) & (!_vm->_avalot->_objects[kObjectPotion - 1])) {
+			if ((_vm->_lustieIsAsleep) & (!_vm->_objects[kObjectPotion - 1])) {
 				displayScrollChain('q', 68);
-				_vm->_avalot->_objects[kObjectPotion - 1] = true;
-				_vm->_avalot->refreshObjectList();
-				_vm->_avalot->incScore(3);
+				_vm->_objects[kObjectPotion - 1] = true;
+				_vm->refreshObjectList();
+				_vm->incScore(3);
 				return;
-			} else if (_vm->_avalot->_talkedToCrapulus) {
+			} else if (_vm->_talkedToCrapulus) {
 				// Spludwick - what does he need?
 				// 0 - let it through to use normal routine.
-				switch (_vm->_avalot->_givenToSpludwick) {
+				switch (_vm->_givenToSpludwick) {
 				case 1: // Fallthrough is intended.
 				case 2: {
-					Common::String objStr = _vm->_avalot->getItem(Avalot::kSpludwicksOrder[_vm->_avalot->_givenToSpludwick]);
+					Common::String objStr = _vm->getItem(AvalancheEngine::kSpludwicksOrder[_vm->_givenToSpludwick]);
 					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 					displayText(tmpStr);
 					}
@@ -1039,23 +1039,23 @@ void Dialogs::talkTo(byte whom) {
 			}
 			break;
 		case kPeopleIbythneth:
-			if (_vm->_avalot->_givenBadgeToIby) {
+			if (_vm->_givenBadgeToIby) {
 				displayScrollChain('q', 33); // Thanks a lot!
 				return; // And leave the proc.
 			}
 			break; // Or... just continue, 'cos he hasn't got it.
 		case kPeopleDogfood:
-			if (_vm->_avalot->_wonNim) { // We've won the game.
+			if (_vm->_wonNim) { // We've won the game.
 				displayScrollChain('q', 6); // "I'm Not Playing!"
 				return; // Zap back.
 			} else
-				_vm->_avalot->_askedDogfoodAboutNim = true;
+				_vm->_askedDogfoodAboutNim = true;
 			break;
 		case kPeopleAyles:
-			if (!_vm->_avalot->_aylesIsAwake) {
+			if (!_vm->_aylesIsAwake) {
 				displayScrollChain('q', 43); // He's fast asleep!
 				return;
-			} else if (!_vm->_avalot->_givenPenToAyles) {
+			} else if (!_vm->_givenPenToAyles) {
 				displayScrollChain('q', 44); // Can you get me a pen, Avvy?
 				return;
 			}
@@ -1066,29 +1066,29 @@ void Dialogs::talkTo(byte whom) {
 			return;
 
 		case kPeopleGeida:
-			if (_vm->_avalot->_givenPotionToGeida)
-				_vm->_avalot->_geidaFollows = true;
+			if (_vm->_givenPotionToGeida)
+				_vm->_geidaFollows = true;
 			else {
 				displayScrollChain('u', 17);
 				return;
 			}
 			break;
 		case kPeopleSpurge:
-			if (!_vm->_avalot->_sittingInPub) {
+			if (!_vm->_sittingInPub) {
 				displayScrollChain('q', 71); // Try going over and sitting down.
 				return;
 			} else {
-				if (_vm->_avalot->_spurgeTalkCount < 5)
-					_vm->_avalot->_spurgeTalkCount++;
-				if (_vm->_avalot->_spurgeTalkCount > 1) { // no. 1 falls through
-					displayScrollChain('q', 70 + _vm->_avalot->_spurgeTalkCount);
+				if (_vm->_spurgeTalkCount < 5)
+					_vm->_spurgeTalkCount++;
+				if (_vm->_spurgeTalkCount > 1) { // no. 1 falls through
+					displayScrollChain('q', 70 + _vm->_spurgeTalkCount);
 					return;
 				}
 			}
 			break;
 		}
 	// On a subject. Is there any reason to block it?
-	} else if ((whom == kPeopleAyles) && (!_vm->_avalot->_aylesIsAwake)) {
+	} else if ((whom == kPeopleAyles) && (!_vm->_aylesIsAwake)) {
 		displayScrollChain('q', 43); // He's fast asleep!
 		return;
 	}
@@ -1111,23 +1111,23 @@ void Dialogs::talkTo(byte whom) {
 		displayText(tmpStr);
 	}
 
-	speak(whom, _vm->_avalot->_subjectNum);
+	speak(whom, _vm->_subjectNum);
 
 	if (!_noError)
 		displayScrollChain('n', whom); // File not found!
 
-	if ((_vm->_avalot->_subjectNum == 0) && ((whom + 149) == kPeopleCrapulus)) { // Crapulus: get the badge - first time only
-		_vm->_avalot->_objects[kObjectBadge - 1] = true;
-		_vm->_avalot->refreshObjectList();
+	if ((_vm->_subjectNum == 0) && ((whom + 149) == kPeopleCrapulus)) { // Crapulus: get the badge - first time only
+		_vm->_objects[kObjectBadge - 1] = true;
+		_vm->refreshObjectList();
 		displayScrollChain('q', 1); // Circular from Cardiff.
-		_vm->_avalot->_talkedToCrapulus = true;
-		_vm->_avalot->setRoom(kPeopleCrapulus, kRoomDummy); // Crapulus walks off.
+		_vm->_talkedToCrapulus = true;
+		_vm->setRoom(kPeopleCrapulus, kRoomDummy); // Crapulus walks off.
 
 		AnimationType *spr = &_vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
 		spr->walkTo(2); // Walks away.
 
-		_vm->_avalot->incScore(2);
+		_vm->incScore(2);
 	}
 }
 
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index c3caec7..7264cbc 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -65,7 +65,7 @@ void HeadType::highlight() {
 	_menu->_activeMenuItem._activeNum = _position;
 	_menu->_menuActive = true;
 
-	_menu->_vm->_avalot->_currentMouse = 177; // Force redraw of cursor.
+	_menu->_vm->_currentMouse = 177; // Force redraw of cursor.
 }
 
 bool HeadType::parseAltTrigger(char key) {
@@ -135,8 +135,8 @@ void MenuItem::display() {
 	for (int y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 
-	_dr->_vm->_avalot->_defaultLed = 1;
-	_dr->_vm->_avalot->_currentMouse = 177;
+	_dr->_vm->_defaultLed = 1;
+	_dr->_vm->_currentMouse = 177;
 
 	CursorMan.showMouse(true); // 4 = fletch
 }
@@ -149,7 +149,7 @@ void MenuItem::wipe() {
 	_activeNow = false;
 	_dr->_menuActive = false;
 	_firstlix = false;
-	_dr->_vm->_avalot->_defaultLed = 2;
+	_dr->_vm->_defaultLed = 2;
 
 	CursorMan.showMouse(true);
 }
@@ -218,13 +218,13 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Menu
 void MenuBar::draw() {
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
 
-	byte savecp = _dr->_vm->_avalot->_cp;
-	_dr->_vm->_avalot->_cp = 3;
+	byte savecp = _dr->_vm->_cp;
+	_dr->_vm->_cp = 3;
 
 	for (int i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
 
-	_dr->_vm->_avalot->_cp = savecp;
+	_dr->_vm->_cp = savecp;
 }
 
 void MenuBar::parseAltTrigger(char c) {
@@ -262,30 +262,30 @@ Menu::Menu(AvalancheEngine *vm) {
 }
 
 void Menu::findWhatYouCanDoWithIt() {
-	switch (_vm->_avalot->_thinks) {
+	switch (_vm->_thinks) {
 	case kObjectWine:
 	case kObjectPotion:
 	case kObjectInk:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeDrink;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeDrink;
 		break;
 	case kObjectBell:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeRing;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeRing;
 		break;
 	case kObjectChastity:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	case kObjectLute:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodePlay;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodePlay;
 		break;
 	case kObjectMushroom:
 	case kObjectOnion:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeEat;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeEat;
 		break;
 	case kObjectClothes:
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	default:
-		_vm->_avalot->_verbStr = kVerbCodeExam; // Anything else.
+		_vm->_verbStr = kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -310,7 +310,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 	for (uint i = 0; i < text.size(); i++) {
 		for (int j = 0; j < 8; j++) {
 			byte idx = text[i];
-			font[idx][j] = _vm->_avalot->_font[idx][j] & ander; // Set the font.
+			font[idx][j] = _vm->_font[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
 			for (int k = 0; k < 8; k++)
 				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
@@ -412,8 +412,8 @@ void Menu::setupMenuFile() {
 	_activeMenuItem.reset();
 	_activeMenuItem.setupOption("New game", 'N', "f4", true);
 	_activeMenuItem.setupOption("Load...", 'L', "^f3", true);
-	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_avalot->_alive);
-	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_avalot->_alive);
+	_activeMenuItem.setupOption("Save", 'S', "^f2", _vm->_alive);
+	_activeMenuItem.setupOption("Save As...", 'v', "", _vm->_alive);
 	_activeMenuItem.setupOption("DOS Shell", 'D', "alt-1", false);
 	_activeMenuItem.setupOption("Quit", 'Q', "alt-X", true);
 	_activeMenuItem.display();
@@ -422,7 +422,7 @@ void Menu::setupMenuFile() {
 void Menu::setupMenuAction() {
 	_activeMenuItem.reset();
 
-	Common::String f5Does = _vm->_avalot->f5Does();
+	Common::String f5Does = _vm->f5Does();
 	for (int i = 0; i < 2; i++)
 		if (!f5Does.empty())
 			f5Does.deleteChar(0);
@@ -431,13 +431,13 @@ void Menu::setupMenuAction() {
 	else
 		_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
 	_activeMenuItem.setupOption("Pause game", 'P', "f6", true);
-	if (_vm->_avalot->_room == kRoomMap)
+	if (_vm->_room == kRoomMap)
 		_activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
 	else
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]._speedX == _vm->_avalot->kWalk)
+	if (_vm->_animation->_sprites[0]._speedX == _vm->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -452,8 +452,8 @@ void Menu::setupMenuPeople() {
 	_activeMenuItem.reset();
 
 	for (int i = kPeopleAvalot; i <= kPeopleWisewoman; i++) {
-		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) {
-			_activeMenuItem.setupOption(_vm->_avalot->getName((People)i), _vm->_avalot->getNameChar((People)i), "", true);
+		if (_vm->getRoom((People)i) == _vm->_room) {
+			_activeMenuItem.setupOption(_vm->getName((People)i), _vm->getNameChar((People)i), "", true);
 			people += i;
 		}
 	}
@@ -464,8 +464,8 @@ void Menu::setupMenuPeople() {
 void Menu::setupMenuObjects() {
 	_activeMenuItem.reset();
 	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_avalot->_objects[i])
-			_activeMenuItem.setupOption(_vm->_avalot->getThing(i + 1), _vm->_avalot->getThingChar(i + 1), "", true);
+		if (_vm->_objects[i])
+			_activeMenuItem.setupOption(_vm->getThing(i + 1), _vm->getThingChar(i + 1), "", true);
 	}
 	_activeMenuItem.display();
 }
@@ -473,54 +473,54 @@ void Menu::setupMenuObjects() {
 void Menu::setupMenuWith() {
 	_activeMenuItem.reset();
 
-	if (_vm->_avalot->_thinkThing) {
+	if (_vm->_thinkThing) {
 		findWhatYouCanDoWithIt();
 
-		for (uint i = 0; i < _vm->_avalot->_verbStr.size(); i++) {
+		for (uint i = 0; i < _vm->_verbStr.size(); i++) {
 			char vbchar;
 			Common::String verb;
 
-			_vm->_parser->verbOpt(_vm->_avalot->_verbStr[i], verb, vbchar);
+			_vm->_parser->verbOpt(_vm->_verbStr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_avalot->_lastPerson == kPeopleAvalot) || (_vm->_avalot->_lastPerson == _vm->_parser->kNothing)
-			|| (_vm->_avalot->getRoom(_vm->_avalot->_lastPerson) != _vm->_avalot->_room))
+		if ((_vm->_lastPerson == kPeopleAvalot) || (_vm->_lastPerson == _vm->_parser->kNothing)
+			|| (_vm->getRoom(_vm->_lastPerson) != _vm->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_avalot->getName(_vm->_avalot->_lastPerson), 'G', "", true);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodeGive;
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_vm->_lastPerson), 'G', "", true);
+			_vm->_verbStr = _vm->_verbStr + kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
-		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_avalot->_thinks), 'T', "", true);
-		_vm->_avalot->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeTalk;
-		switch (_vm->_avalot->_thinks) {
+		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_thinks), 'T', "", true);
+		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeTalk;
+		switch (_vm->_thinks) {
 		case kPeopleGeida:
 		case kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodeKiss;
+			_vm->_verbStr = _vm->_verbStr + kVerbCodeKiss;
 			break;
 		case kPeopleDogfood:
-			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_avalot->_wonNim); // True if you HAVEN'T won.
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + kVerbCodePlay;
+			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_wonNim); // True if you HAVEN'T won.
+			_vm->_verbStr = _vm->_verbStr + kVerbCodePlay;
 			break;
 		case kPeopleMalagauche: {
-			bool isSober = !_vm->_avalot->_teetotal;
-			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_avalot->_objects[kObjectWine - 1]);
+			bool isSober = !_vm->_teetotal;
+			_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_objects[kObjectWine - 1]);
 			_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
 			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 101 + 100 + 102 + 103 + 104;
+			_vm->_verbStr = _vm->_verbStr + 101 + 100 + 102 + 103 + 104;
 			}
 			break;
 		case kPeopleTrader:
-			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_avalot->_objects[kObjectOnion - 1]);
-			_vm->_avalot->_verbStr = _vm->_avalot->_verbStr + 105;
+			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_objects[kObjectOnion - 1]);
+			_vm->_verbStr = _vm->_verbStr + 105;
 			break;
 		}
 	}
@@ -531,19 +531,19 @@ void Menu::runMenuGame() {
 	// Help, boss, untrash screen.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_avalot->callVerb(kVerbCodeHelp);
+		_vm->callVerb(kVerbCodeHelp);
 		break;
 	case 1:
-		_vm->_avalot->callVerb(kVerbCodeBoss);
+		_vm->callVerb(kVerbCodeBoss);
 		break;
 	case 2:
-		_vm->_avalot->majorRedraw();
+		_vm->majorRedraw();
 		break;
 	case 3:
-		_vm->_avalot->callVerb(kVerbCodeScore);
+		_vm->callVerb(kVerbCodeScore);
 		break;
 	case 4:
-		_vm->_avalot->callVerb(kVerbCodeInfo);
+		_vm->callVerb(kVerbCodeInfo);
 		break;
 	}
 }
@@ -552,17 +552,17 @@ void Menu::runMenuFile() {
 	// New game, load, save, save as, DOS shell, about, quit.
 	switch (_activeMenuItem._choiceNum) {
 	case 0:
-		_vm->_avalot->callVerb(kVerbCodeRestart);
+		_vm->callVerb(kVerbCodeRestart);
 		break;
 	case 1:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_avalot->callVerb(kVerbCodeLoad);
+		_vm->callVerb(kVerbCodeLoad);
 		break;
 	case 2:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
-		_vm->_avalot->callVerb(kVerbCodeSave);
+		_vm->callVerb(kVerbCodeSave);
 		break;
 	case 3:
 		//_vm->_basher->filename_edit();
@@ -572,7 +572,7 @@ void Menu::runMenuFile() {
 		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
 	case 5:
-		_vm->_avalot->callVerb(kVerbCodeQuit);
+		_vm->callVerb(kVerbCodeQuit);
 		break;
 	}
 }
@@ -583,31 +583,31 @@ void Menu::runMenuAction() {
 	case 0: {
 		_vm->_parser->_person = kPeoplePardon;
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		Common::String f5Does = _vm->_avalot->f5Does();
+		Common::String f5Does = _vm->f5Does();
 		VerbCode verb = (VerbCode)f5Does[0];
-		_vm->_avalot->callVerb(verb);
+		_vm->callVerb(verb);
 		}
 		break;
 	case 1:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_avalot->callVerb(kVerbCodePause);
+		_vm->callVerb(kVerbCodePause);
 		break;
 	case 2:
-		_vm->_avalot->callVerb(kVerbCodeOpen);
+		_vm->callVerb(kVerbCodeOpen);
 		break;
 	case 3:
 		_vm->_parser->_thing = _vm->_parser->kPardon;
-		_vm->_avalot->callVerb(kVerbCodeLook);
+		_vm->callVerb(kVerbCodeLook);
 		break;
 	case 4:
-		_vm->_avalot->callVerb(kVerbCodeInv);
+		_vm->callVerb(kVerbCodeInv);
 		break;
 	case 5: {
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
-		if (avvy->_speedX == _vm->_avalot->kWalk)
-			avvy->_speedX = _vm->_avalot->kRun;
+		if (avvy->_speedX == _vm->kWalk)
+			avvy->_speedX = _vm->kRun;
 		else
-			avvy->_speedX = _vm->_avalot->kWalk;
+			avvy->_speedX = _vm->kWalk;
 		_vm->_animation->updateSpeed();
 		}
 		break;
@@ -615,57 +615,57 @@ void Menu::runMenuAction() {
 }
 
 void Menu::runMenuObjects() {
-	_vm->_avalot->thinkAbout(_vm->_avalot->_objectList[_activeMenuItem._choiceNum], Avalot::kThing);
+	_vm->thinkAbout(_vm->_objectList[_activeMenuItem._choiceNum], AvalancheEngine::kThing);
 }
 
 void Menu::runMenuPeople() {
-	_vm->_avalot->thinkAbout(people[_activeMenuItem._choiceNum], Avalot::kPerson);
-	_vm->_avalot->_lastPerson = (People)people[_activeMenuItem._choiceNum];
+	_vm->thinkAbout(people[_activeMenuItem._choiceNum], AvalancheEngine::kPerson);
+	_vm->_lastPerson = (People)people[_activeMenuItem._choiceNum];
 }
 
 void Menu::runMenuWith() {
-	_vm->_parser->_thing = _vm->_avalot->_thinks;
+	_vm->_parser->_thing = _vm->_thinks;
 
-	if (_vm->_avalot->_thinkThing) {
+	if (_vm->_thinkThing) {
 		_vm->_parser->_thing += 49;
 
-		if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
-			_vm->_parser->_person = _vm->_avalot->_lastPerson;
+		if (_vm->_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
+			_vm->_parser->_person = _vm->_lastPerson;
 		else
 			_vm->_parser->_person = kPeoplePardon;
 	} else {
-		switch (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]) {
+		switch (_vm->_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
 			_vm->_parser->_thing = 100;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 101: // Wine
 			_vm->_parser->_thing = 50;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 102: // Whisky
 			_vm->_parser->_thing = 102;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 103: // Cider
 			_vm->_parser->_thing = 103;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 104: // Mead
 			_vm->_parser->_thing = 107;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 105: // Onion (trader)
 			_vm->_parser->_thing = 67;
-			_vm->_avalot->callVerb(kVerbCodeBuy);
+			_vm->callVerb(kVerbCodeBuy);
 			return;
 		default:
 			_vm->_parser->_person = (People)_vm->_parser->_thing;
 			_vm->_parser->_thing = Parser::kPardon;
-			_vm->_avalot->_subjectNum = 0;
+			_vm->_subjectNum = 0;
 		}
 	}
-	_vm->_avalot->callVerb((VerbCode)_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]);
+	_vm->callVerb((VerbCode)_vm->_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Menu::setup() {
@@ -687,11 +687,11 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 	::Graphics::Surface backup;
 	backup.copyFrom(_vm->_graphics->_surface);
 
-	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_avalot->_holdLeftMouse) {
+	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_holdLeftMouse) {
 		_menuBar.chooseMenuItem(cursorPos.x);
 		do
 			_vm->updateEvents();
-		while (_vm->_avalot->_holdLeftMouse);
+		while (_vm->_holdLeftMouse);
 
 		while (!_vm->shouldQuit()) {
 			do {
@@ -701,28 +701,28 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_avalot->newMouse(0); // Up arrow
+					_vm->newMouse(0); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->_avalot->newMouse(2); // Right-arrow
+						_vm->newMouse(2); // Right-arrow
 					else
-						_vm->_avalot->newMouse(3); // Fletch
+						_vm->newMouse(3); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_avalot->newMouse(1); // Screwdriver
+					_vm->newMouse(1); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 
 				_vm->_graphics->refreshScreen();
-			} while (!_vm->_avalot->_holdLeftMouse);
+			} while (!_vm->_holdLeftMouse);
 
-			if (_vm->_avalot->_holdLeftMouse) {
+			if (_vm->_holdLeftMouse) {
 				if (cursorPos.y > 21) {
 					if (!((_activeMenuItem._firstlix) && ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8)
 						&& (cursorPos.y >= 24) && (cursorPos.y <= (_activeMenuItem._fly * 2 + 1))))) {
 							// Clicked OUTSIDE the menu.
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
-								_vm->_avalot->_holdLeftMouse = false;
+								_vm->_holdLeftMouse = false;
 								backup.free();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
@@ -736,11 +736,11 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
-							_vm->_avalot->_holdLeftMouse = false;
+							_vm->_holdLeftMouse = false;
 							backup.free();
 							return;
 						} else {
-							_vm->_avalot->_holdLeftMouse = true;
+							_vm->_holdLeftMouse = true;
 							break;
 						}
 					}
@@ -757,7 +757,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 						_vm->_graphics->refreshScreen();
 
 						_vm->updateEvents();
-						if (!_vm->_avalot->_holdLeftMouse)
+						if (!_vm->_holdLeftMouse)
 							break;
 					}
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index b8b461b..f8f0d44 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -50,7 +50,7 @@ void Parser::init() {
 		_inputText.clear();
 	_inputTextPos = 0;
 
-	_vm->_avalot->_weirdWord = false;
+	_vm->_weirdWord = false;
 
 	// Initailaze the vocabulary.
 	// Verbs: 1-49
@@ -422,13 +422,13 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F5: {
 		_person = kPeoplePardon;
 		_thing = kPardon;
-		Common::String f5does = _vm->_avalot->f5Does();
+		Common::String f5does = _vm->f5Does();
 		VerbCode verb = (VerbCode)f5does[0];
-		_vm->_avalot->callVerb(verb);
+		_vm->callVerb(verb);
 		}
 		break;
 	case Common::KEYCODE_F7:
-		_vm->_avalot->callVerb(kVerbCodeOpen);
+		_vm->callVerb(kVerbCodeOpen);
 		break;
 	default:
 		break;
@@ -440,7 +440,7 @@ void Parser::plotText() {
 	cursorOff();
 
 	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_avalot->_font, 8, 24, 161, kColorWhite);
+	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);
@@ -539,7 +539,7 @@ Common::String Parser::rank() {
 	};
 
 	for (int i = 0; i < 8; i++) {
-		if ((_vm->_avalot->_dnascore >= kRanks[i]._score) && (_vm->_avalot->_dnascore < kRanks[i + 1]._score)) {
+		if ((_vm->_dnascore >= kRanks[i]._score) && (_vm->_dnascore < kRanks[i + 1]._score)) {
 			return kRanks[i]._title;
 		}
 	}
@@ -551,7 +551,7 @@ Common::String Parser::totalTime() {
 	const double ticksInOneSec = (double)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = (uint16)floor(_vm->_avalot->_totalTime / ticksInOneSec); // No. of seconds.
+	h = (uint16)floor(_vm->_totalTime / ticksInOneSec); // No. of seconds.
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;
@@ -593,10 +593,10 @@ void Parser::displayWhat(byte target, bool animate, bool &ambiguous) {
 			_vm->_dialogs->displayText("What?");
 	} else {
 		if (animate) {
-			Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName((People)target).c_str());
+			Common::String tmpStr = Common::String::format("{ %s }", _vm->getName((People)target).c_str());
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
-			Common::String z = _vm->_avalot->getItem(target);
+			Common::String z = _vm->getItem(target);
 			if (z != "") {
 				Common::String tmpStr = Common::String::format("{ %s }", z.c_str());
 				_vm->_dialogs->displayText(tmpStr);
@@ -612,16 +612,16 @@ bool Parser::doPronouns() {
 		byte wordCode = _thats[i];
 		switch (wordCode) {
 		case 200:
-			displayWhat(_vm->_avalot->_him, true, ambiguous);
-			_thats.setChar(_vm->_avalot->_him, i);
+			displayWhat(_vm->_him, true, ambiguous);
+			_thats.setChar(_vm->_him, i);
 			break;
 		case 201:
-			displayWhat(_vm->_avalot->_her, true, ambiguous);
-			_thats.setChar(_vm->_avalot->_her, i);
+			displayWhat(_vm->_her, true, ambiguous);
+			_thats.setChar(_vm->_her, i);
 			break;
 		case 202:
-			displayWhat(_vm->_avalot->_it, false, ambiguous);
-			_thats.setChar(_vm->_avalot->_it, i);
+			displayWhat(_vm->_it, false, ambiguous);
+			_thats.setChar(_vm->_it, i);
 			break;
 		}
 	}
@@ -666,32 +666,32 @@ void Parser::storeInterrogation(byte interrogation) {
 	case 1:
 		_inputText.toLowercase();
 		sayIt();
-		_vm->_avalot->_favouriteDrink = _inputText;
-		_vm->_avalot->_cardiffQuestionNum = 2;
+		_vm->_favouriteDrink = _inputText;
+		_vm->_cardiffQuestionNum = 2;
 		break;
 	case 2:
 		properNouns();
 		sayIt();
-		_vm->_avalot->_favouriteSong = _inputText;
-		_vm->_avalot->_cardiffQuestionNum = 3;
+		_vm->_favouriteSong = _inputText;
+		_vm->_cardiffQuestionNum = 3;
 		break;
 	case 3:
 		properNouns();
 		sayIt();
-		_vm->_avalot->_worstPlaceOnEarth = _inputText;
-		_vm->_avalot->_cardiffQuestionNum = 4;
+		_vm->_worstPlaceOnEarth = _inputText;
+		_vm->_cardiffQuestionNum = 4;
 		break;
 	case 4:
 		_inputText.toLowercase();
 		sayIt();
-		if (!_vm->_avalot->_spareEvening.empty())
-			_vm->_avalot->_spareEvening.clear();
-		_vm->_avalot->_spareEvening = _inputText;
+		if (!_vm->_spareEvening.empty())
+			_vm->_spareEvening.clear();
+		_vm->_spareEvening = _inputText;
 		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing;
-		_vm->_avalot->_cardiffQuestionNum = 5;
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing;
+		_vm->_cardiffQuestionNum = 5;
 		break;
 	case 99:
 		//store_high(_inputText);
@@ -727,9 +727,9 @@ void Parser::parse() {
 	}
 
 	// Are we being interrogated right now?
-	if (_vm->_avalot->_interrogation > 0) {
-		storeInterrogation(_vm->_avalot->_interrogation);
-		_vm->_avalot->_weirdWord = true;
+	if (_vm->_interrogation > 0) {
+		storeInterrogation(_vm->_interrogation);
+		_vm->_weirdWord = true;
 		return;
 	}
 
@@ -761,7 +761,7 @@ void Parser::parse() {
 		// Check also[] first, which contains words about the actual room.
 		if (!thisword.empty()) {
 			for (int i = 0; i < 31; i++) {
-				if ((_vm->_avalot->_also[i][0]) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) {
+				if ((_vm->_also[i][0]) && (getPos(',' + thisword, *_vm->_also[i][0]) > -1)) {
 					_thats += Common::String(99 + i);
 					notfound = false;
 				}
@@ -813,12 +813,12 @@ void Parser::parse() {
 	replace(Common::String("\x4\xE5"),  20); // "take off" = "doff"
 
 	// Words that could mean more than one _person
-	if (_vm->_avalot->_room == kRoomNottsPub)
+	if (_vm->_room == kRoomNottsPub)
 		replace(Common::String('\xCC'), 164); // Barman = Port
 	else
 		replace(Common::String('\xCC'), 154); // Barman = Malagauche
 
-	switch (_vm->_avalot->_room) {
+	switch (_vm->_room) {
 	case kRoomAylesOffice:
 		replace(Common::String('\xCB'), 163); // Monk = Ayles
 		break;
@@ -830,39 +830,39 @@ void Parser::parse() {
 	}
 
 	if (doPronouns()) {
-		_vm->_avalot->_weirdWord = true;
+		_vm->_weirdWord = true;
 		_thats = kNothing;
 		return;
 	}
 
 	// Second parsing.
-	if (!_vm->_avalot->_subject.empty())
-		_vm->_avalot->_subject.clear();
-	_vm->_avalot->_subjectNum = 0; // Find subject of conversation.
+	if (!_vm->_subject.empty())
+		_vm->_subject.clear();
+	_vm->_subjectNum = 0; // Find subject of conversation.
 
 	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
 		if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) {
-			_vm->_avalot->_subjectNum = (byte)_thats[i];
+			_vm->_subjectNum = (byte)_thats[i];
 			_thats.setChar(kMoved, i);
 			break;
 		}
 	}
 
-	if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // Still not found.
+	if ((_vm->_subjectNum == 0) && !_thats.empty()) { // Still not found.
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if ((byte)_thats[i] == 252) { // The word is "about", or something similar.
-				_vm->_avalot->_subjectNum = (byte)_thats[i + 1];
+				_vm->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
 		}
 	}
 
-	if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
+	if ((_vm->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say".
 		for (uint16 i = 0; i < _thats.size() - 1; i++) {
 			if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) {
 				// SAY not followed by a preposition
-				_vm->_avalot->_subjectNum = (byte)_thats[i + 1];
+				_vm->_subjectNum = (byte)_thats[i + 1];
 				_thats.setChar(0, i + 1);
 				break;
 			}
@@ -885,30 +885,30 @@ void Parser::parse() {
 	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_avalot->_weirdWord = true;
+		_vm->_weirdWord = true;
 	} else
-		_vm->_avalot->_weirdWord = false;
+		_vm->_weirdWord = false;
 
 	if (_thats.empty())
 		_thats = kNothing;
 
 	if (_thing != kPardon)
-		_vm->_avalot->_it = _thing;
+		_vm->_it = _thing;
 
 	if (_person != kPardon) {
 		if (_person < kPeopleArkata)
-			_vm->_avalot->_him = _person;
+			_vm->_him = _person;
 		else
-			_vm->_avalot->_her = _person;
+			_vm->_her = _person;
 	}
 }
 
 void Parser::examineObject() {
-	if (_thing != _vm->_avalot->_thinks)
-		_vm->_avalot->thinkAbout(_thing, Avalot::kThing);
+	if (_thing != _vm->_thinks)
+		_vm->thinkAbout(_thing, AvalancheEngine::kThing);
 	switch (_thing) {
 	case kObjectWine :
-		switch (_vm->_avalot->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
+		switch (_vm->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
 		case 1:
 			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
 			break;
@@ -921,7 +921,7 @@ void Parser::examineObject() {
 		}
 		break;
 	case kObjectOnion:
-		if (_vm->_avalot->_rottenOnion)
+		if (_vm->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
 		else
 			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
@@ -932,7 +932,7 @@ void Parser::examineObject() {
 }
 
 bool Parser::isPersonHere() { // Person equivalent of "holding".
-	if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room))
+	if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->getRoom(_person) == _vm->_room))
 		return true;
 	else {
 		Common::String tmpStr;
@@ -947,19 +947,19 @@ bool Parser::isPersonHere() { // Person equivalent of "holding".
 
 void Parser::exampers() {
 	if (isPersonHere()) {
-		if (_thing != _vm->_avalot->_thinks)
-			_vm->_avalot->thinkAbout(_person, Avalot::kPerson);
+		if (_thing != _vm->_thinks)
+			_vm->thinkAbout(_person, AvalancheEngine::kPerson);
 
 		byte newPerson = _person - 149;
 
-		if ((_person == kPeopleDogfood) && _vm->_avalot->_wonNim)
+		if ((_person == kPeopleDogfood) && _vm->_wonNim)
 			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
-		else if ((_person == kPeopleDuLustie) && _vm->_avalot->_lustieIsAsleep)
+		else if ((_person == kPeopleDuLustie) && _vm->_lustieIsAsleep)
 			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
 		else
 			_vm->_dialogs->displayScrollChain('p', newPerson);
 
-		if ((_person == kPeopleAyles) && !_vm->_avalot->_aylesIsAwake)
+		if ((_person == kPeopleAyles) && !_vm->_aylesIsAwake)
 			_vm->_dialogs->displayScrollChain('Q', 13);
 
 		// CHECKME: Present in the original, but it doesn't make sense.
@@ -979,7 +979,7 @@ bool Parser::isHolding() {
 
 	if (_thing > 100)
 		_vm->_dialogs->displayText("Be reasonable!");
-	else if (!_vm->_avalot->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+	else if (!_vm->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
 		_vm->_dialogs->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
@@ -988,7 +988,7 @@ bool Parser::isHolding() {
 }
 
 void Parser::openBox(bool isOpening) {
-	if ((_vm->_avalot->_room == kRoomYours) && (_thing == 54)) {
+	if ((_vm->_room == kRoomYours) && (_thing == 54)) {
 		_vm->_background->draw(-1, -1, 4);
 
 		_vm->_background->update();
@@ -1015,7 +1015,7 @@ void Parser::examine() {
 				examineObject();
 			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
 				openBox(true);
-				_vm->_dialogs->displayText(*_vm->_avalot->_also[_thing - 50][1]);
+				_vm->_dialogs->displayText(*_vm->_also[_thing - 50][1]);
 				openBox(false);
 			}
 		}
@@ -1030,17 +1030,17 @@ void Parser::inventory() {
 	Common::String tmpStr = Common::String("You're carrying ");
 
 	for (int i = 0; i < kObjectNum; i++) {
-		if (_vm->_avalot->_objects[i]) {
+		if (_vm->_objects[i]) {
 			itemNum++;
-			if (itemNum == _vm->_avalot->_carryNum)
+			if (itemNum == _vm->_carryNum)
 				tmpStr += "and ";
 
-			tmpStr += _vm->_avalot->getItem(i + 1);
+			tmpStr += _vm->getItem(i + 1);
 
 			if ((i + 1) == _wearing)
 				tmpStr += ", which you're wearing";
 
-			if (itemNum < _vm->_avalot->_carryNum)
+			if (itemNum < _vm->_carryNum)
 				tmpStr += ", ";
 		}
 	}
@@ -1056,17 +1056,17 @@ void Parser::inventory() {
 void Parser::swallow() { // Eat something.
 	switch (_thing) {
 	case kObjectWine:
-		switch (_vm->_avalot->_wineState) { // 4 is perfect
+		switch (_vm->_wineState) { // 4 is perfect
 		case 1:
-			if (_vm->_avalot->_teetotal)  {
+			if (_vm->_teetotal)  {
 				_vm->_dialogs->displayScrollChain('D', 6);
 				return;
 			}
 			_vm->_dialogs->displayScrollChain('U', 1);
 			_vm->_pingo->wobble();
 			_vm->_dialogs->displayScrollChain('U', 2);
-			_vm->_avalot->_objects[kObjectWine - 1] = false;
-			_vm->_avalot->refreshObjectList();
+			_vm->_objects[kObjectWine - 1] = false;
+			_vm->refreshObjectList();
 			drink();
 			break;
 		case 2:
@@ -1076,10 +1076,10 @@ void Parser::swallow() { // Eat something.
 		}
 		break;
 	case kObjectPotion:
-		_vm->_avalot->setBackgroundColor(4);
+		_vm->setBackgroundColor(4);
 		_vm->_dialogs->displayScrollChain('U', 3);
-		_vm->_avalot->gameOver();
-		_vm->_avalot->setBackgroundColor(0);
+		_vm->gameOver();
+		_vm->setBackgroundColor(0);
 		break;
 	case kObjectInk:
 		_vm->_dialogs->displayScrollChain('U', 4);
@@ -1089,19 +1089,19 @@ void Parser::swallow() { // Eat something.
 		break;
 	case kObjectMushroom:
 		_vm->_dialogs->displayScrollChain('U', 6);
-		_vm->_avalot->gameOver();
+		_vm->gameOver();
 		break;
 	case kObjectOnion:
-		if (_vm->_avalot->_rottenOnion)
+		if (_vm->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('U', 11);
 		else {
 			_vm->_dialogs->displayScrollChain('U', 8);
-			_vm->_avalot->_objects[kObjectOnion - 1] = false;
-			_vm->_avalot->refreshObjectList();
+			_vm->_objects[kObjectOnion - 1] = false;
+			_vm->refreshObjectList();
 		}
 		break;
 	default:
-		if ((_vm->_avalot->_room == kRoomArgentPub) || (_vm->_avalot->_room == kRoomNottsPub))
+		if ((_vm->_room == kRoomArgentPub) || (_vm->_room == kRoomNottsPub))
 			_vm->_dialogs->displayText("Try BUYing things before you drink them!");
 		else
 			_vm->_dialogs->displayText("The taste of it makes you retch!");
@@ -1112,7 +1112,7 @@ void Parser::peopleInRoom() {
 	byte numPeople = 0; // Number of people in the room.
 
 	for (int i = 151; i < 179; i++) { // Start at 1 so we don't list Avvy himself!
-		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room)
+		if (_vm->getRoom((People)i) == _vm->_room)
 			numPeople++;
 	}
 
@@ -1122,14 +1122,14 @@ void Parser::peopleInRoom() {
 	Common::String tmpStr;
 	byte actPerson = 0; // Actually listed people.
 	for (int i = 151; i < 179; i++) {
-		if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) {
+		if (_vm->getRoom((People)i) == _vm->_room) {
 			actPerson++;
 			if (actPerson == 1) // First on the list.
-				tmpStr = _vm->_avalot->getName((People)i);
+				tmpStr = _vm->getName((People)i);
 			else if (actPerson < numPeople) // The middle...
-				tmpStr += ", " + _vm->_avalot->getName((People)i);
+				tmpStr += ", " + _vm->getName((People)i);
 			else // The end.
-				tmpStr += " and " + _vm->_avalot->getName((People)i);
+				tmpStr += " and " + _vm->getName((People)i);
 		}
 	}
 
@@ -1142,30 +1142,30 @@ void Parser::peopleInRoom() {
 }
 
 void Parser::lookAround() {
-	_vm->_dialogs->displayText(*_vm->_avalot->_also[0][1]);
-	switch (_vm->_avalot->_room) {
+	_vm->_dialogs->displayText(*_vm->_also[0][1]);
+	switch (_vm->_room) {
 	case kRoomSpludwicks:
-		if (_vm->_avalot->_avariciusTalk > 0)
+		if (_vm->_avariciusTalk > 0)
 			_vm->_dialogs->displayScrollChain('q', 23);
 		else
 			peopleInRoom();
 		break;
 	case kRoomRobins:
-		if (_vm->_avalot->_tiedUp)
+		if (_vm->_tiedUp)
 			_vm->_dialogs->displayScrollChain('q', 38);
-		if (_vm->_avalot->_mushroomGrowing)
+		if (_vm->_mushroomGrowing)
 			_vm->_dialogs->displayScrollChain('q', 55);
 		break;
 	case kRoomInsideCardiffCastle:
-		if (!_vm->_avalot->_takenPen)
+		if (!_vm->_takenPen)
 			_vm->_dialogs->displayScrollChain('q', 49);
 		break;
 	case kRoomLustiesRoom:
-		if (_vm->_avalot->_lustieIsAsleep)
+		if (_vm->_lustieIsAsleep)
 			_vm->_dialogs->displayScrollChain('q', 65);
 		break;
 	case kRoomCatacombs:
-		switch (_vm->_avalot->_catacombY * 256 + _vm->_avalot->_catacombX) {
+		switch (_vm->_catacombY * 256 + _vm->_catacombX) {
 		case 258 :
 			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
 			break;
@@ -1184,7 +1184,7 @@ void Parser::lookAround() {
 
 void Parser::openDoor() {
 	// Special cases.
-	switch (_vm->_avalot->_room) {
+	switch (_vm->_room) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
 			// Opening the box.
@@ -1202,29 +1202,29 @@ void Parser::openDoor() {
 		break;
 	}
 
-	if ((!_vm->_avalot->_userMovesAvvy) && (_vm->_avalot->_room != kRoomLusties))
+	if ((!_vm->_userMovesAvvy) && (_vm->_room != kRoomLusties))
 		return; // No doors can open if you can't move Avvy.
 
 	for (int i = 0; i < 7; i++) {
 		if (_vm->_animation->inField(i + 8)) {
-			MagicType *portal = &_vm->_avalot->_portals[i];
+			MagicType *portal = &_vm->_portals[i];
 			switch (portal->_operation) {
-			case Avalot::kMagicExclaim:
+			case AvalancheEngine::kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
-			case Avalot::kMagicTransport:
-				_vm->_avalot->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
+			case AvalancheEngine::kMagicTransport:
+				_vm->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
 				break;
-			case Avalot::kMagicUnfinished:
+			case AvalancheEngine::kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
 				break;
-			case Avalot::kMagicSpecial:
+			case AvalancheEngine::kMagicSpecial:
 				_vm->_animation->callSpecial(portal->_data);
 				break;
-			case Avalot::kMagicOpenDoor:
-				_vm->_avalot->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9);
+			case AvalancheEngine::kMagicOpenDoor:
+				_vm->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9);
 				break;
 			}
 
@@ -1232,7 +1232,7 @@ void Parser::openDoor() {
 		}
 	}
 
-	if (_vm->_avalot->_room == kRoomMap)
+	if (_vm->_room == kRoomMap)
 		_vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \
 				"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
 	else
@@ -1258,15 +1258,15 @@ void Parser::putProc() {
 	switch (_thing2) {
 	case kObjectWine:
 		if (_thing == kObjectOnion) {
-			if (_vm->_avalot->_rottenOnion)
+			if (_vm->_rottenOnion)
 				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
-				if (_vm->_avalot->_wineState != 3) {
+				if (_vm->_wineState != 3) {
 					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 					_vm->_dialogs->displayText(tmpStr);
 				} else { // Put onion into vinegar! Yes!
-					_vm->_avalot->_onionInVinegar = true;
-					_vm->_avalot->incScore(7);
+					_vm->_onionInVinegar = true;
+					_vm->incScore(7);
 					_vm->_dialogs->displayScrollChain('u', 9);
 				}
 			}
@@ -1275,8 +1275,8 @@ void Parser::putProc() {
 		break;
 
 	case 54:
-		if (_vm->_avalot->_room == kRoomYours) { // Put something into the box.
-			if (_vm->_avalot->_boxContent != kNothing)
+		if (_vm->_room == kRoomYours) { // Put something into the box.
+			if (_vm->_boxContent != kNothing)
 				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
 				switch (_thing) {
@@ -1294,14 +1294,14 @@ void Parser::putProc() {
 					break;
 				default: // Put the object into the box...
 					if (_wearing == _thing) {
-						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_avalot->getItem(_thing).c_str());
+						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->getItem(_thing).c_str());
 						_vm->_dialogs->displayText(tmpStr);
 					} else {
 						openBox(true); // Open box.
 
-						_vm->_avalot->_boxContent = _thing;
-						_vm->_avalot->_objects[_thing - 1] = false;
-						_vm->_avalot->refreshObjectList();
+						_vm->_boxContent = _thing;
+						_vm->_objects[_thing - 1] = false;
+						_vm->refreshObjectList();
 						_vm->_dialogs->displayText("OK, it's in the box.");
 
 						openBox(false); // Shut box.
@@ -1322,7 +1322,7 @@ void Parser::putProc() {
  * @remarks	Originally called 'not_in_order'
  */
 void Parser::notInOrder() {
-	Common::String itemStr = _vm->_avalot->getItem(_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick]);
+	Common::String itemStr = _vm->getItem(_vm->kSpludwicksOrder[_vm->_givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
 		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
@@ -1343,40 +1343,40 @@ void Parser::goToCauldron() {
  * @remarks	Originally called 'give2spludwick'
  */
 bool Parser::giveToSpludwick() {
-	if (_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick] != _thing) {
+	if (_vm->kSpludwicksOrder[_vm->_givenToSpludwick] != _thing) {
 		notInOrder();
 		return false;
 	}
 
 	switch (_thing) {
 	case kObjectOnion:
-		_vm->_avalot->_objects[kObjectOnion - 1] = false;
-		if (_vm->_avalot->_rottenOnion)
+		_vm->_objects[kObjectOnion - 1] = false;
+		if (_vm->_rottenOnion)
 			_vm->_dialogs->displayScrollChain('q', 22);
 		else {
-			_vm->_avalot->_givenToSpludwick++;
+			_vm->_givenToSpludwick++;
 			_vm->_dialogs->displayScrollChain('q', 20);
 			goToCauldron();
-			_vm->_avalot->incScore(3);
+			_vm->incScore(3);
 		}
-		_vm->_avalot->refreshObjectList();
+		_vm->refreshObjectList();
 		break;
 	case kObjectInk:
-		_vm->_avalot->_objects[kObjectInk - 1] = false;
-		_vm->_avalot->refreshObjectList();
-		_vm->_avalot->_givenToSpludwick++;
+		_vm->_objects[kObjectInk - 1] = false;
+		_vm->refreshObjectList();
+		_vm->_givenToSpludwick++;
 		_vm->_dialogs->displayScrollChain('q', 24);
 		goToCauldron();
-		_vm->_avalot->incScore(3);
+		_vm->incScore(3);
 		break;
 	case kObjectMushroom:
-		_vm->_avalot->_objects[kObjectMushroom - 1] = false;
+		_vm->_objects[kObjectMushroom - 1] = false;
 		_vm->_dialogs->displayScrollChain('q', 25);
-		_vm->_avalot->incScore(5);
-		_vm->_avalot->_givenToSpludwick++;
+		_vm->incScore(5);
+		_vm->_givenToSpludwick++;
 		goToCauldron();
-		_vm->_avalot->_objects[kObjectPotion - 1] = true;
-		_vm->_avalot->refreshObjectList();
+		_vm->_objects[kObjectPotion - 1] = true;
+		_vm->refreshObjectList();
 		break;
 	default:
 		return true;
@@ -1388,27 +1388,27 @@ bool Parser::giveToSpludwick() {
 void Parser::drink() {
 	_alcoholLevel++;
 	if (_alcoholLevel == 5) {
-		_vm->_avalot->_objects[kObjectKey - 1] = true; // Get the key.
-		_vm->_avalot->_teetotal = true;
-		_vm->_avalot->_avvyIsAwake = false;
-		_vm->_avalot->_avvyInBed = true;
-		_vm->_avalot->refreshObjectList();
-		_vm->_avalot->dusk();
-		_vm->_avalot->hangAroundForAWhile();
-		_vm->_avalot->flipRoom(kRoomYours, 1);
-		_vm->_avalot->setBackgroundColor(14);
+		_vm->_objects[kObjectKey - 1] = true; // Get the key.
+		_vm->_teetotal = true;
+		_vm->_avvyIsAwake = false;
+		_vm->_avvyInBed = true;
+		_vm->refreshObjectList();
+		_vm->dusk();
+		_vm->hangAroundForAWhile();
+		_vm->flipRoom(kRoomYours, 1);
+		_vm->setBackgroundColor(14);
 		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
 
 void Parser::cardiffClimbing() {
-	if (_vm->_avalot->_standingOnDais) { // Clamber up.
+	if (_vm->_standingOnDais) { // Clamber up.
 		_vm->_dialogs->displayText("You climb down, back onto the floor.");
-		_vm->_avalot->_standingOnDais = false;
+		_vm->_standingOnDais = false;
 		_vm->_animation->appearPed(0, 2);
 	} else if (_vm->_animation->inField(0)) { // Clamber down
 		_vm->_dialogs->displayText("You clamber up onto the dais.");
-		_vm->_avalot->_standingOnDais = true;
+		_vm->_standingOnDais = true;
 		_vm->_animation->appearPed(0, 1);
 	} else
 			_vm->_dialogs->displayText("Get a bit closer, Avvy.");
@@ -1419,21 +1419,21 @@ void Parser::already() {
 }
 
 void Parser::standUp() {
-	switch (_vm->_avalot->_room) {
+	switch (_vm->_room) {
 	case kRoomYours: // Avvy isn't asleep.
-		if (_vm->_avalot->_avvyIsAwake && _vm->_avalot->_avvyInBed) {  // But he's in bed.
-			if (_vm->_avalot->_teetotal) {
+		if (_vm->_avvyIsAwake && _vm->_avvyInBed) {  // But he's in bed.
+			if (_vm->_teetotal) {
 				_vm->_dialogs->displayScrollChain('d', 12);
-				_vm->_avalot->setBackgroundColor(0);
+				_vm->setBackgroundColor(0);
 				_vm->_dialogs->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
-			_vm->_avalot->_userMovesAvvy = true;
+			_vm->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->setDirection(kDirLeft);
 			_vm->_background->draw(-1, -1, 3); // Picture of empty pillow.
-			_vm->_avalot->incScore(1);
-			_vm->_avalot->_avvyInBed = false;
+			_vm->incScore(1);
+			_vm->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
 		} else
 			already();
@@ -1444,12 +1444,12 @@ void Parser::standUp() {
 		break;
 
 	case kRoomNottsPub:
-		if (_vm->_avalot->_sittingInPub)  {
+		if (_vm->_sittingInPub)  {
 			_vm->_background->draw(-1, -1, 3); // Not sitting down.
 			_vm->_animation->_sprites[0]._visible = true; // But standing up.
 			_vm->_animation->appearPed(0, 3); // And walking away.
-			_vm->_avalot->_sittingInPub = false; // Really not sitting down.
-			_vm->_avalot->_userMovesAvvy = true; // And ambulant.
+			_vm->_sittingInPub = false; // Really not sitting down.
+			_vm->_userMovesAvvy = true; // And ambulant.
 		} else
 			already();
 		break;
@@ -1459,18 +1459,18 @@ void Parser::standUp() {
 }
 
 void Parser::getProc(char thing) {
-	switch (_vm->_avalot->_room) {
+	switch (_vm->_room) {
 	case kRoomYours:
 		if (_vm->_animation->inField(1)) {
-			if (_vm->_avalot->_boxContent == thing) {
+			if (_vm->_boxContent == thing) {
 				_vm->_background->draw(-1, -1, 4);
 				_vm->_dialogs->displayText("OK, I've got it.");
-				_vm->_avalot->_objects[thing - 1] = true;
-				_vm->_avalot->refreshObjectList();
-				_vm->_avalot->_boxContent = kNothing;
+				_vm->_objects[thing - 1] = true;
+				_vm->refreshObjectList();
+				_vm->_boxContent = kNothing;
 				_vm->_background->draw(-1, -1, 5);
 			} else {
-				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_avalot->getItem(thing).c_str());
+				Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->getItem(thing).c_str());
 				_vm->_dialogs->displayText(tmpStr);
 			}
 		} else
@@ -1480,18 +1480,18 @@ void Parser::getProc(char thing) {
 		switch (thing) {
 		case kObjectPen:
 			if (_vm->_animation->inField(1)) { // Standing on the dais.
-				if (_vm->_avalot->_takenPen)
+				if (_vm->_takenPen)
 					_vm->_dialogs->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
 					_vm->_background->draw(-1, -1, 3); // No pen there now.
 					_vm->_animation->callSpecial(3); // Zap!
-					_vm->_avalot->_takenPen = true;
-					_vm->_avalot->_objects[kObjectPen - 1] = true;
-					_vm->_avalot->refreshObjectList();
+					_vm->_takenPen = true;
+					_vm->_objects[kObjectPen - 1] = true;
+					_vm->refreshObjectList();
 					_vm->_dialogs->displayText("Taken.");
 				}
-			} else if (_vm->_avalot->_standingOnDais)
+			} else if (_vm->_standingOnDais)
 				_vm->_dialogs->displayScrollChain('q', 53);
 			else
 				_vm->_dialogs->displayScrollChain('q', 51);
@@ -1504,14 +1504,14 @@ void Parser::getProc(char thing) {
 		}
 		break;
 	case kRoomRobins:
-		if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) {
+		if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_mushroomGrowing)) {
 			_vm->_background->draw(-1, -1, 2);
 			_vm->_dialogs->displayText("Got it!");
-			_vm->_avalot->_mushroomGrowing = false;
-			_vm->_avalot->_takenMushroom = true;
-			_vm->_avalot->_objects[kObjectMushroom - 1] = true;
-			_vm->_avalot->refreshObjectList();
-			_vm->_avalot->incScore(3);
+			_vm->_mushroomGrowing = false;
+			_vm->_takenMushroom = true;
+			_vm->_objects[kObjectMushroom - 1] = true;
+			_vm->refreshObjectList();
+			_vm->incScore(3);
 		} else
 			_vm->_dialogs->displayScrollChain('q', 57);
 		break;
@@ -1525,13 +1525,13 @@ void Parser::getProc(char thing) {
  * @remarks	Originally called 'give_Geida_the_lute'
  */
 void Parser::giveGeidaTheLute() {
-	if (_vm->_avalot->_room != kRoomLustiesRoom) {
+	if (_vm->_room != kRoomLustiesRoom) {
 		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		return;
 	}
-	_vm->_avalot->_objects[kObjectLute - 1] = false;
-	_vm->_avalot->refreshObjectList();
+	_vm->_objects[kObjectLute - 1] = false;
+	_vm->refreshObjectList();
 	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
@@ -1553,13 +1553,13 @@ void Parser::winSequence() {
 
 Common::String Parser::personSpeaks() {
 	if ((_person == kPeoplePardon) || (_person == kPeopleNone)) {
-		if ((_vm->_avalot->_him == kPeoplePardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room))
-			_person = _vm->_avalot->_her;
+		if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room))
+			_person = _vm->_her;
 		else
-			_person = _vm->_avalot->_him;
+			_person = _vm->_him;
 	}
 
-	if (_vm->_avalot->getRoom(_person) != _vm->_avalot->_room) {
+	if (_vm->getRoom(_person) != _vm->_room) {
 		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
 	}
 
@@ -1577,7 +1577,7 @@ Common::String Parser::personSpeaks() {
 		return tmpStr;
 
 	for (int i = 0; i < 16; i++) {
-		if ((_vm->_avalot->kQuasipeds[i]._who == _person) && (_vm->_avalot->kQuasipeds[i]._room == _vm->_avalot->_room))
+		if ((_vm->kQuasipeds[i]._who == _person) && (_vm->kQuasipeds[i]._room == _vm->_room))
 			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
 	}
 
@@ -1588,7 +1588,7 @@ void Parser::heyThanks() {
 	Common::String tmpStr = personSpeaks();
 	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
-	_vm->_avalot->_objects[_thing - 1] = false;
+	_vm->_objects[_thing - 1] = false;
 }
 
 /**
@@ -1604,7 +1604,7 @@ void Parser::doThat() {
 		return;
 	}
 
-	if (_vm->_avalot->_weirdWord)
+	if (_vm->_weirdWord)
 		return;
 
 	if (_thing < 200)
@@ -1614,11 +1614,11 @@ void Parser::doThat() {
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
-		if (!_vm->_avalot->_alive) {
+		if (!_vm->_alive) {
 			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
 			return;
 		}
-		if (!_vm->_avalot->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+		if (!_vm->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
 			_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
 			return;
 		}
@@ -1638,7 +1638,7 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeGet:
 		if (_thing != kPardon) { // Legitimate try to pick something up.
-			if (_vm->_avalot->_carryNum >= kCarryLimit)
+			if (_vm->_carryNum >= kCarryLimit)
 				_vm->_dialogs->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
@@ -1658,21 +1658,21 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeTalk:
 		if (_person == kPeoplePardon) {
-			if (_vm->_avalot->_subjectNum == 99) { // They typed "say password".
+			if (_vm->_subjectNum == 99) { // They typed "say password".
 				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
 				_vm->_dialogs->displayText(tmpStr);
-			} else if (((1 <= _vm->_avalot->_subjectNum) && (_vm->_avalot->_subjectNum <= 49)) || (_vm->_avalot->_subjectNum == 253) || (_vm->_avalot->_subjectNum == 249)) {
+			} else if (((1 <= _vm->_subjectNum) && (_vm->_subjectNum <= 49)) || (_vm->_subjectNum == 253) || (_vm->_subjectNum == 249)) {
 				_thats.deleteChar(0);
 
 				for (int i = 0; i < 10; i++)
 					_realWords[i] = _realWords[i + 1];
 
-				_verb = (VerbCode)_vm->_avalot->_subjectNum;
+				_verb = (VerbCode)_vm->_subjectNum;
 				doThat();
 				return;
 			} else {
-				_person = (People)_vm->_avalot->_subjectNum;
-				_vm->_avalot->_subjectNum = 0;
+				_person = (People)_vm->_subjectNum;
+				_vm->_subjectNum = 0;
 				if ((_person == kPeopleNone) || (_person == kPeoplePardon))
 					_vm->_dialogs->displayText("Talk to whom?");
 				else if (isPersonHere())
@@ -1701,7 +1701,7 @@ void Parser::doThat() {
 					case kPeopleCrapulus:
 						if (_thing == kObjectWine) {
 							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
-							_vm->_avalot->_objects[kObjectWine - 1] = false;
+							_vm->_objects[kObjectWine - 1] = false;
 						} else
 							heyThanks();
 						break;
@@ -1718,24 +1718,24 @@ void Parser::doThat() {
 					case kPeopleIbythneth:
 						if (_thing == kObjectBadge) {
 							_vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
-							_vm->_avalot->incScore(3);
-							_vm->_avalot->_objects[kObjectBadge - 1] = false;
-							_vm->_avalot->_objects[kObjectHabit - 1] = true;
-							_vm->_avalot->_givenBadgeToIby = true;
+							_vm->incScore(3);
+							_vm->_objects[kObjectBadge - 1] = false;
+							_vm->_objects[kObjectHabit - 1] = true;
+							_vm->_givenBadgeToIby = true;
 							_vm->_background->draw(-1, -1, 7);
 							_vm->_background->draw(-1, -1, 8);
 						} else
 							heyThanks();
 						break;
 					case kPeopleAyles:
-						if (_vm->_avalot->_aylesIsAwake) {
+						if (_vm->_aylesIsAwake) {
 							if (_thing == kObjectPen) {
-								_vm->_avalot->_objects[kObjectPen - 1] = false;
+								_vm->_objects[kObjectPen - 1] = false;
 								_vm->_dialogs->displayScrollChain('q', 54);
-								_vm->_avalot->_objects[kObjectInk - 1] = true;
-								_vm->_avalot->_givenPenToAyles = true;
-								_vm->_avalot->refreshObjectList();
-								_vm->_avalot->incScore(2);
+								_vm->_objects[kObjectInk - 1] = true;
+								_vm->_givenPenToAyles = true;
+								_vm->refreshObjectList();
+								_vm->incScore(2);
 							} else
 								heyThanks();
 						} else
@@ -1744,11 +1744,11 @@ void Parser::doThat() {
 					case kPeopleGeida:
 						switch (_thing) {
 						case kObjectPotion:
-							_vm->_avalot->_objects[kObjectPotion - 1] = false;
+							_vm->_objects[kObjectPotion - 1] = false;
 							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
-							_vm->_avalot->incScore(2);
-							_vm->_avalot->_givenPotionToGeida = true;
-							_vm->_avalot->refreshObjectList();
+							_vm->incScore(2);
+							_vm->_givenPotionToGeida = true;
+							_vm->refreshObjectList();
 							break;
 						case kObjectLute:
 							giveGeidaTheLute();
@@ -1760,7 +1760,7 @@ void Parser::doThat() {
 					case kPeopleArkata:
 						switch (_thing) {
 						case kObjectPotion:
-							if (_vm->_avalot->_givenPotionToGeida)
+							if (_vm->_givenPotionToGeida)
 								winSequence();
 							else
 								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
@@ -1774,7 +1774,7 @@ void Parser::doThat() {
 					}
 				}
 			}
-			_vm->_avalot->refreshObjectList(); // Just in case...
+			_vm->refreshObjectList(); // Just in case...
 		}
 		break;
 
@@ -1805,7 +1805,7 @@ void Parser::doThat() {
 		else {
 			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
 			if (_vm->_dialogs->displayQuestion(tmpStr))
-				_vm->_avalot->_letMeOut = true;
+				_vm->_letMeOut = true;
 		}
 		break;
 	case kVerbCodeGo:
@@ -1820,8 +1820,8 @@ void Parser::doThat() {
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
 			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
 			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
-			+ "version " + _vm->_avalot->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
-			+ _vm->_avalot->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+			+ "version " + _vm->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
+			+ _vm->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
 		_vm->_dialogs->displayText(toDisplay);
 		_vm->_dialogs->_aboutBox = false;
 		}
@@ -1829,11 +1829,11 @@ void Parser::doThat() {
 	case kVerbCodeUndress:
 		if (_wearing == kNothing)
 			_vm->_dialogs->displayText("You're already stark naked!");
-		else if (_vm->_avalot->_avvysInTheCupboard) {
-			Common::String tmpStr = Common::String::format("You take off %s.", _vm->_avalot->getItem(_wearing).c_str());
+		else if (_vm->_avvysInTheCupboard) {
+			Common::String tmpStr = Common::String::format("You take off %s.", _vm->getItem(_wearing).c_str());
 			_vm->_dialogs->displayText(tmpStr);
 			_wearing = kNothing;
-			_vm->_avalot->refreshObjectList();
+			_vm->refreshObjectList();
 		} else
 			_vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?");
 		break;
@@ -1855,7 +1855,7 @@ void Parser::doThat() {
 				} else
 					_wearing = _thing;
 
-				_vm->_avalot->refreshObjectList();
+				_vm->refreshObjectList();
 
 				byte i;
 				if (_thing == kObjectHabit)
@@ -1880,19 +1880,19 @@ void Parser::doThat() {
 		break;
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
-			switch (_vm->_avalot->_room) { // They just typed "play"...
+			switch (_vm->_room) { // They just typed "play"...
 			case kRoomArgentPub: // ...in the pub, => play Nim.
 				warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
 				// play_nim();
 				// The following parts are copied from play_nim().
 				// The player automatically wins the game everytime he wins, until I implement the mini-game.
 
-				if (_vm->_avalot->_wonNim) { // Already won the game.
+				if (_vm->_wonNim) { // Already won the game.
 					_vm->_dialogs->displayScrollChain('Q', 6);
 					return;
 				}
 
-				if (!_vm->_avalot->_askedDogfoodAboutNim) {
+				if (!_vm->_askedDogfoodAboutNim) {
 					_vm->_dialogs->displayScrollChain('q', 84);
 					return;
 				}
@@ -1902,14 +1902,14 @@ void Parser::doThat() {
 
 				// You won - strange!
 				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
-				_vm->_avalot->_objects[kObjectLute - 1] = true;
-				_vm->_avalot->refreshObjectList();
-				_vm->_avalot->_wonNim = true;
+				_vm->_objects[kObjectLute - 1] = true;
+				_vm->refreshObjectList();
+				_vm->_wonNim = true;
 				_vm->_background->draw(-1, -1, 0); // Show the settle with no lute on it.
-				_vm->_avalot->incScore(7); // 7 points for winning!
+				_vm->incScore(7); // 7 points for winning!
 
 				if (_playedNim == 1)
-					_vm->_avalot->incScore(3); // 3 points for playing your 1st game.
+					_vm->incScore(3); // 3 points for playing your 1st game.
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
@@ -1924,20 +1924,20 @@ void Parser::doThat() {
 			case kObjectLute :
 					_vm->_dialogs->displayScrollChain('U', 7);
 
-					if (_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room)
+					if (_vm->getRoom(kPeopleCwytalot) == _vm->_room)
 						_vm->_dialogs->displayScrollChain('U', 10);
 
-					if (_vm->_avalot->getRoom(kPeopleDuLustie) == _vm->_avalot->_room)
+					if (_vm->getRoom(kPeopleDuLustie) == _vm->_room)
 						_vm->_dialogs->displayScrollChain('U', 15);
 				break;
 			case 52:
-				if (_vm->_avalot->_room == kRoomMusicRoom)
+				if (_vm->_room == kRoomMusicRoom)
 					playHarp();
 				else
 					_vm->_dialogs->displayText(kWhat);
 				break;
 			case 55:
-				if (_vm->_avalot->_room == kRoomArgentPub)
+				if (_vm->_room == kRoomArgentPub)
 					// play_nim();
 					warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
 				else
@@ -1952,7 +1952,7 @@ void Parser::doThat() {
 		if (isHolding()) {
 			if (_thing == kObjectBell) {
 				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
+				if ((_vm->_bellsAreRinging) & (_vm->setFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
 					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
@@ -1974,7 +1974,7 @@ void Parser::doThat() {
 		warning("STUB: Parser::doThat() - case kVerbCodeboss");
 		break;
 	case kVerbCodePee:
-		if (_vm->_avalot->setFlag('P')) {
+		if (_vm->setFlag('P')) {
 			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else {
@@ -1985,16 +1985,16 @@ void Parser::doThat() {
 	case kVerbCodeCheat: {
 		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_avalot->_cheat = true;
+		_vm->_cheat = true;
 		}
 		break;
 	case kVerbCodeMagic:
-		if (_vm->_avalot->_avariciusTalk > 0)
+		if (_vm->_avariciusTalk > 0)
 			_vm->_dialogs->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_avalot->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
+			if ((_vm->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
 				_vm->_dialogs->displayScrollChain('q', 17);
-				if (_vm->_avalot->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
+				if (_vm->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
 					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -2003,7 +2003,7 @@ void Parser::doThat() {
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
 					spr->_eachStepProc = Animation::kProcBackAndForth;
-					_vm->_avalot->_avariciusTalk = 14;
+					_vm->_avariciusTalk = 14;
 					_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
 				}
 			} else
@@ -2031,21 +2031,21 @@ void Parser::doThat() {
 			_vm->_pingo->zonk();
 			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
-			_vm->_avalot->gameOver();
+			_vm->gameOver();
 			}
 		}
 		_sworeNum++;
 		break;
 	case kVerbCodeListen:
-		if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B')))
+		if ((_vm->_bellsAreRinging) & (_vm->setFlag('B')))
 			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
-		else if (_vm->_avalot->_listen.empty())
+		else if (_vm->_listen.empty())
 			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");
 		else
-			_vm->_dialogs->displayText(_vm->_avalot->_listen);
+			_vm->_dialogs->displayText(_vm->_listen);
 		break;
 	case kVerbCodeBuy: // What are they trying to buy?
-		switch (_vm->_avalot->_room) {
+		switch (_vm->_room) {
 		case kRoomArgentPub:
 			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
 				switch (_thing) {
@@ -2053,40 +2053,40 @@ void Parser::doThat() {
 				case 53:
 				case 54:
 				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_avalot->_malagauche == 177) { // Already getting us one.
+					if (_vm->_malagauche == 177) { // Already getting us one.
 						_vm->_dialogs->displayScrollChain('D', 15);
 						return;
 					}
 
-					if (_vm->_avalot->_teetotal)  {
+					if (_vm->_teetotal)  {
 						_vm->_dialogs->displayScrollChain('D', 6);
 						return;
 					}
 
 					if (_alcoholLevel == 0)
-						_vm->_avalot->incScore(3);
+						_vm->incScore(3);
 
 					_vm->_background->draw(-1, -1, 11);
 					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
-					_vm->_avalot->_drinking = _thing;
+					_vm->_drinking = _thing;
 
 					_vm->_background->draw(-1, -1, 9);
-					_vm->_avalot->_malagauche = 177;
+					_vm->_malagauche = 177;
 					_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
 					break;
 				case 52:
 					examine();
 					break; // We have a right one here - buy Pepsi??!
 				case kObjectWine:
-					if (_vm->_avalot->_objects[kObjectWine - 1])  // We've already got the wine!
+					if (_vm->_objects[kObjectWine - 1])  // We've already got the wine!
 						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
 					else {
-						if (_vm->_avalot->_malagauche == 177) { // Already getting us one.
+						if (_vm->_malagauche == 177) { // Already getting us one.
 							_vm->_dialogs->displayScrollChain('D', 15);
 							return;
 						}
 
-						if (_vm->_avalot->_carryNum >= kCarryLimit) {
+						if (_vm->_carryNum >= kCarryLimit) {
 							_vm->_dialogs->displayText("Your hands are full.");
 							return;
 						}
@@ -2095,9 +2095,9 @@ void Parser::doThat() {
 						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
 						_vm->_dialogs->displayText(tmpStr);
 						if (_alcoholLevel == 0)
-							_vm->_avalot->incScore(3);
+							_vm->incScore(3);
 						_vm->_background->draw(-1, -1, 9);
-						_vm->_avalot->_malagauche = 177;
+						_vm->_malagauche = 177;
 
 						_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
 					}
@@ -2110,23 +2110,23 @@ void Parser::doThat() {
 		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(5)) {
 				if (_thing == kObjectOnion) {
-					if (_vm->_avalot->_objects[kObjectOnion - 1])
+					if (_vm->_objects[kObjectOnion - 1])
 						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
-					else if (_vm->_avalot->_carryNum >= kCarryLimit)
+					else if (_vm->_carryNum >= kCarryLimit)
 						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
 					else {
 						if (_boughtOnion)
 							_vm->_dialogs->displayScrollChain('D', 11);
 						else {
 							_vm->_dialogs->displayScrollChain('D', 9);
-							_vm->_avalot->incScore(3);
+							_vm->incScore(3);
 						}
-						_vm->_avalot->decreaseMoney(3); // It costs thruppence.
-						_vm->_avalot->_objects[kObjectOnion - 1] = true;
-						_vm->_avalot->refreshObjectList();
+						_vm->decreaseMoney(3); // It costs thruppence.
+						_vm->_objects[kObjectOnion - 1] = true;
+						_vm->refreshObjectList();
 						_boughtOnion = true;
-						_vm->_avalot->_rottenOnion = false; // It's OK when it leaves the stall!
-						_vm->_avalot->_onionInVinegar = false;
+						_vm->_rottenOnion = false; // It's OK when it leaves the stall!
+						_vm->_onionInVinegar = false;
 					}
 				} else
 					_vm->_dialogs->displayScrollChain('D', 0);
@@ -2142,33 +2142,33 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeAttack:
-		if ((_vm->_avalot->_room == kRoomBrummieRoad) &&
+		if ((_vm->_room == kRoomBrummieRoad) &&
 			((_person == kPeopleCwytalot) || (_thing == kObjectCrossbow) || (_thing == kObjectBolt)) &&
-			(_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room)) {
-			switch (_vm->_avalot->_objects[kObjectBolt - 1] + _vm->_avalot->_objects[kObjectCrossbow - 1] * 2) {
+			(_vm->getRoom(kPeopleCwytalot) == _vm->_room)) {
+			switch (_vm->_objects[kObjectBolt - 1] + _vm->_objects[kObjectCrossbow - 1] * 2) {
 				// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
 			case 0:
 				_vm->_dialogs->displayScrollChain('Q', 10);
 				_vm->_dialogs->displayText("(At the very least, don't use your bare hands!)");
 				break;
 			case 1:
-				_vm->_dialogs->displayText("Attack _vm->_avalot->him with only a crossbow bolt? Are you planning on playing darts?!");
+				_vm->_dialogs->displayText("Attack _vm->him with only a crossbow bolt? Are you planning on playing darts?!");
 				break;
 			case 2:
 				_vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!");
 				break;
 			case 3:
 				_vm->_dialogs->displayScrollChain('Q', 11);
-				_vm->_avalot->_cwytalotGone = true;
-				_vm->_avalot->_objects[kObjectBolt - 1] = false;
-				_vm->_avalot->_objects[kObjectCrossbow - 1] = false;
-				_vm->_avalot->refreshObjectList();
-				_vm->_avalot->_magics[11]._operation = Avalot::kMagicNothing;
-				_vm->_avalot->incScore(7);
+				_vm->_cwytalotGone = true;
+				_vm->_objects[kObjectBolt - 1] = false;
+				_vm->_objects[kObjectCrossbow - 1] = false;
+				_vm->refreshObjectList();
+				_vm->_magics[11]._operation = AvalancheEngine::kMagicNothing;
+				_vm->incScore(7);
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
 				_vm->_animation->_sprites[1]._callEachStepFl = false;
-				_vm->_avalot->setRoom(kPeopleCwytalot, kRoomDummy);
+				_vm->setRoom(kPeopleCwytalot, kRoomDummy);
 				break;
 			default:
 				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
@@ -2177,14 +2177,14 @@ void Parser::doThat() {
 			_vm->_dialogs->displayScrollChain('Q', 10);
 		break;
 	case kVerbCodePasswd:
-		if (_vm->_avalot->_room != kRoomBridge)
+		if (_vm->_room != kRoomBridge)
 			_vm->_dialogs->displayScrollChain('Q', 12);
 		else {
 			bool ok = true;
 			for (uint i = 0; i < _thats.size(); i++) {
 				Common::String temp = _realWords[i];
 				temp.toUppercase();
-				int pwdId = _vm->_avalot->_passwordNum + kFirstPassword;
+				int pwdId = _vm->_passwordNum + kFirstPassword;
 				for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) {
 					if (_vocabulary[pwdId]._word[j] != temp[j])
 						ok = false;
@@ -2192,13 +2192,13 @@ void Parser::doThat() {
 			}
 
 			if (ok) {
-				if (_vm->_avalot->_drawbridgeOpen != 0)
+				if (_vm->_drawbridgeOpen != 0)
 					_vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again.");
 				else {
-					_vm->_avalot->incScore(4);
+					_vm->incScore(4);
 					_vm->_dialogs->displayText("The drawbridge opens!");
 					_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
-					_vm->_avalot->_drawbridgeOpen = 1;
+					_vm->_drawbridgeOpen = 1;
 				}
 			} else
 				_vm->_dialogs->displayScrollChain('Q', 12);
@@ -2208,10 +2208,10 @@ void Parser::doThat() {
 		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
 		break;
 	case kVerbCodeDie:
-		_vm->_avalot->gameOver();
+		_vm->gameOver();
 		break;
 	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_avalot->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -2243,14 +2243,14 @@ void Parser::doThat() {
 
 		break;
 	case kVerbCodeClimb:
-		if (_vm->_avalot->_room == kRoomInsideCardiffCastle)
+		if (_vm->_room == kRoomInsideCardiffCastle)
 			cardiffClimbing();
 		else // In the wrong room!
 			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
 		_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_userMovesAvvy = false;
 		break;
 	case kVerbCodeHiscores:
 		//	show_highs();
@@ -2262,18 +2262,18 @@ void Parser::doThat() {
 			case kPeoplePardon:
 			case kPeopleAvalot:
 			case 0:
-				if (!_vm->_avalot->_avvyIsAwake) {
-					_vm->_avalot->_avvyIsAwake = true;
-					_vm->_avalot->incScore(1);
-					_vm->_avalot->_avvyInBed = true;
+				if (!_vm->_avvyIsAwake) {
+					_vm->_avvyIsAwake = true;
+					_vm->incScore(1);
+					_vm->_avvyInBed = true;
 					_vm->_background->draw(-1, -1, 2); // Picture of Avvy, awake in bed.
-					if (_vm->_avalot->_teetotal)
+					if (_vm->_teetotal)
 						_vm->_dialogs->displayScrollChain('d', 13);
 				} else
 					_vm->_dialogs->displayText("You're already awake, Avvy!");
 				break;
 			case kPeopleAyles:
-				if (!_vm->_avalot->_aylesIsAwake)
+				if (!_vm->_aylesIsAwake)
 					_vm->_dialogs->displayText("You can't seem to wake him by yourself.");
 				break;
 			case kPeopleJacques: {
@@ -2287,26 +2287,26 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeSit:
-		if (_vm->_avalot->_room == kRoomNottsPub) {
-			if (_vm->_avalot->_sittingInPub)
+		if (_vm->_room == kRoomNottsPub) {
+			if (_vm->_sittingInPub)
 				_vm->_dialogs->displayText("You're already sitting!");
 			else {
 				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else { // Default doodah.
-			_vm->_avalot->dusk();
-			_vm->_avalot->hangAroundForAWhile();
-			_vm->_avalot->dawn();
+			_vm->dusk();
+			_vm->hangAroundForAWhile();
+			_vm->dawn();
 			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
 			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeRestart:
 		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
-			_vm->_avalot->dusk();
-			_vm->_avalot->newGame();
-			_vm->_avalot->dawn();
+			_vm->dusk();
+			_vm->newGame();
+			_vm->dawn();
 		}
 		break;
 	case kVerbCodePardon:
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 368fa0d..9a11e6f 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -76,7 +76,7 @@ void Pingo::zonk() {
 
 void Pingo::winningPic() {
 	Common::File f;
-	_vm->_avalot->dusk();
+	_vm->dusk();
 
 	if (!f.open("finale.avd"))
 		error("AVALANCHE: Lucerna: File not found: finale.avd");
@@ -95,11 +95,11 @@ void Pingo::winningPic() {
 
 	warning("STUB: Pingo::winningPic()");
 
-	_vm->_avalot->dawn();
+	_vm->dawn();
 
 #if 0
 	do {
-		_vm->_avalot->check();
+		_vm->check();
 	} while (!(keypressed() || (mrelease > 0)));
 	while (keypressed())
 		char r = readkey();
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index bbbbf62..fecbc0c 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -75,7 +75,7 @@ void Sequence::startTimer() {
 }
 
 void Sequence::startTimerImmobilized() {
-	_vm->_avalot->_userMovesAvvy = false; // They can't move.
+	_vm->_userMovesAvvy = false; // They can't move.
 	_vm->_animation->stopWalking(); // And they're not moving now.
 	startTimer(); // Apart from that, it's the same thing.
 }
@@ -94,8 +94,8 @@ void Sequence::callSequencer() {
 		return; // No more routines.
 		break;
 	case kNowFlip: // Flip room.
-		_vm->_avalot->_userMovesAvvy = true;
-		_vm->_avalot->flipRoom(_flipToWhere, _flipToPed);
+		_vm->_userMovesAvvy = true;
+		_vm->flipRoom(_flipToWhere, _flipToPed);
 		// CHECKME: Always true?
 		if (curSeq == kNowFlip)
 			shoveLeft();
@@ -202,12 +202,12 @@ void Sequence::startLustiesSeq2(Room whither, byte ped) {
 
 void Sequence::startCardiffSeq2() {
 	init(1);
-	if (_vm->_avalot->_arrowInTheDoor)
+	if (_vm->_arrowInTheDoor)
 		add(3);
 	else
 		add(2);
 
-	if (_vm->_avalot->_takenPen)
+	if (_vm->_takenPen)
 		_vm->_background->draw(-1, -1, 3);
 
 	startTimer();
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index d1d25ba..5576a48 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -54,7 +54,7 @@ Timer::Timer(AvalancheEngine *vm) {
  * @remarks	Originally called 'set_up_timer'
  */
 void Timer::addTimer(int32 duration, byte action, byte reason) {
-	if ((_vm->_avalot->_isLoaded == false) || (_timerLost == true)) {
+	if ((_vm->_isLoaded == false) || (_timerLost == true)) {
 		byte i = 0;
 		while ((i < 7) && (_times[i]._timeLeft != 0))
 			i++;
@@ -67,7 +67,7 @@ void Timer::addTimer(int32 duration, byte action, byte reason) {
 		_times[i]._action = action;
 		_times[i]._reason = reason;
 	} else {
-		_vm->_avalot->_isLoaded = false;
+		_vm->_isLoaded = false;
 		return;
 	}
 }
@@ -155,7 +155,7 @@ void Timer::updateTimer() {
 				crapulusSaysSpludOut();
 				break;
 			case kProcDawnDelay:
-				_vm->_avalot->dawn();
+				_vm->dawn();
 				break;
 			case kProcBuyDrinks:
 				buyDrinks();
@@ -214,8 +214,8 @@ void Timer::updateTimer() {
 			}
 		}
 	}
-	_vm->_avalot->_roomTime++; // Cycles since you've been in this room.
-	_vm->_avalot->_totalTime++; // Total amount of time for this game.
+	_vm->_roomTime++; // Cycles since you've been in this room.
+	_vm->_totalTime++; // Total amount of time for this game.
 }
 
 void Timer::loseTimer(byte which) {
@@ -228,29 +228,29 @@ void Timer::loseTimer(byte which) {
 }
 
 void Timer::openDrawbridge() {
-	_vm->_avalot->_drawbridgeOpen++;
-	_vm->_background->draw(-1, -1, _vm->_avalot->_drawbridgeOpen - 2);
+	_vm->_drawbridgeOpen++;
+	_vm->_background->draw(-1, -1, _vm->_drawbridgeOpen - 2);
 
-	if (_vm->_avalot->_drawbridgeOpen == 4)
-		_vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; // You may enter the drawbridge.
+	if (_vm->_drawbridgeOpen == 4)
+		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing; // You may enter the drawbridge.
 	else
 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
 
 void Timer::avariciusTalks() {
-	_vm->_dialogs->displayScrollChain('q', _vm->_avalot->_avariciusTalk);
-	_vm->_avalot->_avariciusTalk++;
+	_vm->_dialogs->displayScrollChain('q', _vm->_avariciusTalk);
+	_vm->_avariciusTalk++;
 
-	if (_vm->_avalot->_avariciusTalk < 17)
+	if (_vm->_avariciusTalk < 17)
 		addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
 	else
-		_vm->_avalot->incScore(3);
+		_vm->incScore(3);
 }
 
 void Timer::urinate() {
 	_vm->_animation->_sprites[0].turn(kDirUp);
 	_vm->_animation->stopWalking();
-	_vm->_avalot->drawDirection();
+	_vm->drawDirection();
 	addTimer(14, kProcToilet, kReasonGoToToilet);
 }
 
@@ -272,20 +272,20 @@ void Timer::stairs() {
 	_vm->_sound->blip();
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_background->draw(-1, -1, 1);
-	_vm->_avalot->_brummieStairs = 2;
-	_vm->_avalot->_magics[10]._operation = Avalot::kMagicSpecial;
-	_vm->_avalot->_magics[10]._data = 2; // Reached the bottom of the stairs.
-	_vm->_avalot->_magics[3]._operation = Avalot::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+	_vm->_brummieStairs = 2;
+	_vm->_magics[10]._operation = AvalancheEngine::kMagicSpecial;
+	_vm->_magics[10]._data = 2; // Reached the bottom of the stairs.
+	_vm->_magics[3]._operation = AvalancheEngine::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timer::cardiffSurvey() {
-	if (_vm->_avalot->_cardiffQuestionNum == 0) {
-		_vm->_avalot->_cardiffQuestionNum++;
+	if (_vm->_cardiffQuestionNum == 0) {
+		_vm->_cardiffQuestionNum++;
 		_vm->_dialogs->displayScrollChain('q', 27);
 	}
 
-	_vm->_dialogs->displayScrollChain('z', _vm->_avalot->_cardiffQuestionNum);
-	_vm->_avalot->_interrogation = _vm->_avalot->_cardiffQuestionNum;
+	_vm->_dialogs->displayScrollChain('z', _vm->_cardiffQuestionNum);
+	_vm->_interrogation = _vm->_cardiffQuestionNum;
 	addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
 }
 
@@ -300,8 +300,8 @@ void Timer::cwytalotInHerts() {
 
 void Timer::getTiedUp() {
 	_vm->_dialogs->displayScrollChain('q', 34); // ...Trouble!
-	_vm->_avalot->_userMovesAvvy = false;
-	_vm->_avalot->_beenTiedUp = true;
+	_vm->_userMovesAvvy = false;
+	_vm->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
 
 	AnimationType *spr = &_vm->_animation->_sprites[1];
@@ -315,8 +315,8 @@ void Timer::getTiedUp() {
 void Timer::getTiedUp2() {
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_animation->_sprites[1].walkTo(4);
-	_vm->_avalot->_magics[3]._operation = Avalot::kMagicNothing; // No effect when you touch the boundaries.
-	_vm->_avalot->_friarWillTieYouUp = true;
+	_vm->_magics[3]._operation = AvalancheEngine::kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
@@ -324,7 +324,7 @@ void Timer::hangAround() {
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->init(7, true, _vm->_animation); // Robin Hood
-	_vm->_avalot->setRoom(kPeopleRobinHood, kRoomRobins);
+	_vm->setRoom(kPeopleRobinHood, kRoomRobins);
 	_vm->_animation->appearPed(0, 1);
 	_vm->_dialogs->displayScrollChain('q', 39);
 	avvy->walkTo(6);
@@ -336,7 +336,7 @@ void Timer::hangAround2() {
 	AnimationType *spr = &_vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
-	_vm->_avalot->setRoom(kPeopleFriarTuck, kRoomRobins);
+	_vm->setRoom(kPeopleFriarTuck, kRoomRobins);
 	_vm->_dialogs->displayScrollChain('q', 41);
 	_vm->_animation->_sprites[0].remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -344,20 +344,20 @@ void Timer::hangAround2() {
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
 	// Immediately call the following proc (when you have a chance).
 
-	_vm->_avalot->_tiedUp = false;
+	_vm->_tiedUp = false;
 
 	// _vm->_enid->backToBootstrap(1); Call the shoot-'em-up. TODO: Replace it with proper ScummVM-friendly function(s)! Do not remove until then!
 }
 
 void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
-	_vm->_avalot->flipRoom(_vm->_avalot->_room, 1);
+	_vm->flipRoom(_vm->_room, 1);
 
 	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
 	_vm->_animation->appearPed(0, 1);
-	_vm->_avalot->_userMovesAvvy = true;
-	_vm->_avalot->_objects[kObjectCrossbow - 1] = true;
-	_vm->_avalot->refreshObjectList();
+	_vm->_userMovesAvvy = true;
+	_vm->_objects[kObjectCrossbow - 1] = true;
+	_vm->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
 	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
@@ -385,9 +385,9 @@ void Timer::afterTheShootemup() {
 }
 
 void Timer::jacquesWakesUp() {
-	_vm->_avalot->_jacquesState++;
+	_vm->_jacquesState++;
 
-	switch (_vm->_avalot->_jacquesState) { // Additional pictures.
+	switch (_vm->_jacquesState) { // Additional pictures.
 	case 1 :
 		_vm->_background->draw(-1, -1, 0); // Eyes open.
 		_vm->_dialogs->displayScrollChain('Q', 45);
@@ -395,22 +395,22 @@ void Timer::jacquesWakesUp() {
 	case 2 : // Going through the door.
 		_vm->_background->draw(-1, -1, 1); // Not on the floor.
 		_vm->_background->draw(-1, -1, 2); // But going through the door.
-		_vm->_avalot->_magics[5]._operation = Avalot::kMagicNothing; // You can't wake him up now.
+		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_background->draw(-1, -1, 1); // Not on the floor, either.
 		_vm->_background->draw(-1, -1, 3); // He's gone... so the door's open.
-		_vm->_avalot->setRoom(kPeopleJacques, kRoomNowhere); // Gone!
+		_vm->setRoom(kPeopleJacques, kRoomNowhere); // Gone!
 		break;
 	}
 
-	if (_vm->_avalot->_jacquesState == 5) {
-		_vm->_avalot->_bellsAreRinging = true;
-		_vm->_avalot->_aylesIsAwake = true;
-		_vm->_avalot->incScore(2);
+	if (_vm->_jacquesState == 5) {
+		_vm->_bellsAreRinging = true;
+		_vm->_aylesIsAwake = true;
+		_vm->incScore(2);
 	}
 
-	switch (_vm->_avalot->_jacquesState) {
+	switch (_vm->_jacquesState) {
 	case 1:
 	case 2:
 	case 3:
@@ -452,8 +452,8 @@ void Timer::naughtyDuke3() {
 void Timer::jump() {
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 
-	_vm->_avalot->_jumpStatus++;
-	switch (_vm->_avalot->_jumpStatus) {
+	_vm->_jumpStatus++;
+	switch (_vm->_jumpStatus) {
 	case 1:
 	case 2:
 	case 3:
@@ -472,73 +472,73 @@ void Timer::jump() {
 		break;
 	}
 
-	if (_vm->_avalot->_jumpStatus == 20) { // End of jump.
-		_vm->_avalot->_userMovesAvvy = true;
-		_vm->_avalot->_jumpStatus = 0;
+	if (_vm->_jumpStatus == 20) { // End of jump.
+		_vm->_userMovesAvvy = true;
+		_vm->_jumpStatus = 0;
 	} else // Still jumping.
 		addTimer(1, kProcJump, kReasonJumping);
 
-	if ((_vm->_avalot->_jumpStatus == 10) // You're at the highest point of your jump.
-			&& (_vm->_avalot->_room == kRoomInsideCardiffCastle)
-			&& (_vm->_avalot->_arrowInTheDoor == true)
+	if ((_vm->_jumpStatus == 10) // You're at the highest point of your jump.
+			&& (_vm->_room == kRoomInsideCardiffCastle)
+			&& (_vm->_arrowInTheDoor == true)
 			&& (_vm->_animation->inField(2))) { // Beside the wall
 		// Grab the arrow!
-		if (_vm->_avalot->_carryNum >= kCarryLimit)
+		if (_vm->_carryNum >= kCarryLimit)
 			_vm->_dialogs->displayText("You fail to grab it, because your hands are full.");
 		else {
 			_vm->_background->draw(-1, -1, 1);
-			_vm->_avalot->_arrowInTheDoor = false; // You've got it.
-			_vm->_avalot->_objects[kObjectBolt - 1] = true;
-			_vm->_avalot->refreshObjectList();
+			_vm->_arrowInTheDoor = false; // You've got it.
+			_vm->_objects[kObjectBolt - 1] = true;
+			_vm->refreshObjectList();
 			_vm->_dialogs->displayScrollChain('q', 50);
-			_vm->_avalot->incScore(3);
+			_vm->incScore(3);
 		}
 	}
 }
 
 void Timer::crapulusSaysSpludOut() {
 	_vm->_dialogs->displayScrollChain('q', 56);
-	_vm->_avalot->_crapulusWillTell = false;
+	_vm->_crapulusWillTell = false;
 }
 
 void Timer::buyDrinks() {
 	_vm->_background->draw(-1, -1, 10); // Malagauche gets up again.
-	_vm->_avalot->_malagauche = 0;
+	_vm->_malagauche = 0;
 
-	_vm->_dialogs->displayScrollChain('D', _vm->_avalot->_drinking); // Display message about it.
+	_vm->_dialogs->displayScrollChain('D', _vm->_drinking); // Display message about it.
 	_vm->_pingo->wobble(); // Do the special effects.
 	_vm->_dialogs->displayScrollChain('D', 1); // That'll be thruppence.
-	if (_vm->_avalot->decreaseMoney(3)) // Pay 3d.
+	if (_vm->decreaseMoney(3)) // Pay 3d.
 		_vm->_dialogs->displayScrollChain('D', 3); // Tell 'em you paid up.
 	_vm->_parser->drink();
 }
 
 void Timer::buyWine() {
 	_vm->_background->draw(-1, -1, 10); // Malagauche gets up again.
-	_vm->_avalot->_malagauche = 0;
+	_vm->_malagauche = 0;
 
 	_vm->_dialogs->displayScrollChain('D', 50); // You buy the wine.
 	_vm->_dialogs->displayScrollChain('D', 1); // It'll be thruppence.
-	if (_vm->_avalot->decreaseMoney(3)) {
+	if (_vm->decreaseMoney(3)) {
 		_vm->_dialogs->displayScrollChain('D', 4); // You paid up.
-		_vm->_avalot->_objects[kObjectWine - 1] = true;
-		_vm->_avalot->refreshObjectList();
-		_vm->_avalot->_wineState = 1; // OK Wine.
+		_vm->_objects[kObjectWine - 1] = true;
+		_vm->refreshObjectList();
+		_vm->_wineState = 1; // OK Wine.
 	}
 }
 
 void Timer::callsGuards() {
 	_vm->_dialogs->displayScrollChain('Q', 58); // "GUARDS!!!"
-	_vm->_avalot->gameOver();
+	_vm->gameOver();
 }
 
 void Timer::greetsMonk() {
 	_vm->_dialogs->displayScrollChain('Q', 59);
-	_vm->_avalot->_enteredLustiesRoomAsMonk = true;
+	_vm->_enteredLustiesRoomAsMonk = true;
 }
 
 void Timer::fallDownOubliette() {
-	_vm->_avalot->_magics[8]._operation = Avalot::kMagicNothing;
+	_vm->_magics[8]._operation = AvalancheEngine::kMagicNothing;
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->_moveY++; // Increments dx/dy!
@@ -547,13 +547,13 @@ void Timer::fallDownOubliette() {
 }
 
 void Timer::meetAvaroid() {
-	if (_vm->_avalot->_metAvaroid) {
+	if (_vm->_metAvaroid) {
 		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Dialogs::kControlItalic, Dialogs::kControlRoman);
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_avalot->gameOver();
+		_vm->gameOver();
 	} else {
 		_vm->_dialogs->displayScrollChain('Q', 60);
-		_vm->_avalot->_metAvaroid = true;
+		_vm->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
 		AnimationType *avvy = &_vm->_animation->_sprites[0];
@@ -562,7 +562,7 @@ void Timer::meetAvaroid() {
 		avvy->_moveX = -3;
 		avvy->_moveY = -5;
 
-		_vm->_avalot->setBackgroundColor(2);
+		_vm->setBackgroundColor(2);
 	}
 }
 
@@ -574,7 +574,7 @@ void Timer::riseUpOubliette() {
 	if (avvy->_moveY > 0)
 		addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 	else
-		_vm->_avalot->_userMovesAvvy = true;
+		_vm->_userMovesAvvy = true;
 }
 
 void Timer::robinHoodAndGeida() {
@@ -587,7 +587,7 @@ void Timer::robinHoodAndGeida() {
 	spr->stopWalk();
 	spr->_facingDir = kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
-	_vm->_avalot->_geidaFollows = false;
+	_vm->_geidaFollows = false;
 }
 
 void Timer::robinHoodAndGeidaTalk() {
@@ -611,7 +611,7 @@ void Timer::avalotReturns() {
 	avvy->init(0, true, _vm->_animation);
 	_vm->_animation->appearPed(0, 0);
 	_vm->_dialogs->displayScrollChain('q', 67);
-	_vm->_avalot->_userMovesAvvy = true;
+	_vm->_userMovesAvvy = true;
 }
 
 /**
@@ -625,8 +625,8 @@ void Timer::avvySitDown() {
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
 		_vm->_background->draw(-1, -1, 2);
-		_vm->_avalot->_sittingInPub = true;
-		_vm->_avalot->_userMovesAvvy = false;
+		_vm->_sittingInPub = true;
+		_vm->_userMovesAvvy = false;
 		avvy->_visible = false;
 	}
 }
@@ -638,7 +638,7 @@ void Timer::ghostRoomPhew() {
 }
 
 void Timer::arkataShouts() {
-	if (_vm->_avalot->_teetotal)
+	if (_vm->_teetotal)
 		return;
 
 	_vm->_dialogs->displayScrollChain('q', 76);
@@ -652,14 +652,14 @@ void Timer::winning() {
 	warning("STUB: Timer::winning()");
 #if 0
 	do {
-		_vm->_avalot->checkclick();
-	} while (!(_vm->_avalot->mrelease == 0));
+		_vm->checkclick();
+	} while (!(_vm->mrelease == 0));
 #endif
 	// TODO: To be implemented with Pingo::winningPic().
 
-	_vm->_avalot->callVerb(kVerbCodeScore);
+	_vm->callVerb(kVerbCodeScore);
 	_vm->_dialogs->displayText(" T H E    E N D ");
-	_vm->_avalot->_letMeOut = true;
+	_vm->_letMeOut = true;
 }
 
 void Timer::avalotFalls() {
@@ -691,8 +691,8 @@ void Timer::spludwickLeavesCauldron() {
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.
 	_vm->_dialogs->displayScrollChain('Q', 86);
-	_vm->_avalot->incScore(4);
-	_vm->_avalot->_lustieIsAsleep = true;
+	_vm->incScore(4);
+	_vm->_lustieIsAsleep = true;
 	_vm->_sequence->startGeidaLuteSeq();
 }
 


Commit: 64f799773e94838f8e0d5226692f4113e9bf0bf2
    https://github.com/scummvm/scummvm/commit/64f799773e94838f8e0d5226692f4113e9bf0bf2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T23:21:04-07:00

Commit Message:
AVALANCHE: Misc minor polishing

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index cb64bb8..960705f 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -363,6 +363,7 @@ Animation::~Animation() {
 }
 
 void Animation::resetAnims() {
+	setDirection(kDirStopped);
 	for (int16 i = 0; i < kSpriteNumbMax; i++)
 		_sprites[i].reset();
 }
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e5ed210..e542ee4 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -323,7 +323,6 @@ void AvalancheEngine::setup() {
 	_parser->_inputTextPos = 0;
 	_parser->_quote = true;
 
-	_animation->setDirection(kDirStopped);
 	_animation->resetAnims();
 
 	drawToolbar();
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index c8fe128..a3cbd63 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1131,4 +1131,10 @@ void Dialogs::talkTo(byte whom) {
 	}
 }
 
+void Dialogs::sayIt(Common::String str) {
+	Common::String x = str;
+	x.setChar(toupper(x[0]), 0);
+	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", kControlRegister, x.c_str(), kControlSpeechBubble, kControlRegister);
+	displayText(tmpStr);
+}
 } // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index d754eb1..9904ec6 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -82,6 +82,8 @@ public:
 	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
 	void talkTo(byte whom);
 
+	void sayIt(Common::String str);  // This makes Avalot say the response.
+
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index f8f0d44..e4c91a8 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -569,8 +569,6 @@ void Parser::cheatParse(Common::String codes) {
 	warning("STUB: Parser::cheatParse()");
 }
 
-
-
 void Parser::stripPunctuation(Common::String &word) {
 	const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
 
@@ -642,14 +640,6 @@ void Parser::properNouns() {
 	_inputText.setChar(toupper(_inputText[0]), 0);
 }
 
-void Parser::sayIt() {
-	Common::String x = _inputText;
-	x.setChar(toupper(x[0]), 0);
-	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", Dialogs::kControlRegister, x.c_str(), 
-		                                           Dialogs::kControlSpeechBubble, Dialogs::kControlRegister);
-	_vm->_dialogs->displayText(tmpStr);
-}
-
 void Parser::storeInterrogation(byte interrogation) {
 	if (_inputText.empty())
 		return;
@@ -665,25 +655,25 @@ void Parser::storeInterrogation(byte interrogation) {
 	switch (interrogation) {
 	case 1:
 		_inputText.toLowercase();
-		sayIt();
+		_vm->_dialogs->sayIt(_inputText);
 		_vm->_favouriteDrink = _inputText;
 		_vm->_cardiffQuestionNum = 2;
 		break;
 	case 2:
 		properNouns();
-		sayIt();
+		_vm->_dialogs->sayIt(_inputText);
 		_vm->_favouriteSong = _inputText;
 		_vm->_cardiffQuestionNum = 3;
 		break;
 	case 3:
 		properNouns();
-		sayIt();
+		_vm->_dialogs->sayIt(_inputText);
 		_vm->_worstPlaceOnEarth = _inputText;
 		_vm->_cardiffQuestionNum = 4;
 		break;
 	case 4:
 		_inputText.toLowercase();
-		sayIt();
+		_vm->_dialogs->sayIt(_inputText);
 		if (!_vm->_spareEvening.empty())
 			_vm->_spareEvening.clear();
 		_vm->_spareEvening = _inputText;
@@ -710,7 +700,6 @@ void Parser::parse() {
 	if (!_thats.empty())
 		_thats.clear();
 
-	byte n = 0;
 	_polite = false;
 	_verb = kVerbCodePardon;
 	_thing = kPardon;
@@ -736,6 +725,7 @@ void Parser::parse() {
 	// Actually process the command.
 	Common::String inputText = _inputText + ' ';
 	Common::String inputTextUpper = inputText;
+	byte n = 0;
 	inputTextUpper.toUppercase();
 	while (!inputTextUpper.empty()) {
 		while ((!inputTextUpper.empty()) && (inputTextUpper[0] == ' ')) {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 4ec7fe6..4d58893 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -121,7 +121,6 @@ private:
 	bool doPronouns();
 	void properNouns();
 	void lookAround(); // This is called when you say "look".
-	void sayIt();  // This makes Avalot say the response.
 	void openDoor();
 	void storeInterrogation(byte interrogation);
 	void examineObject(); // Examine a standard object-thing


Commit: d7230fe8560ef49b1958ba53109af85a40267fca
    https://github.com/scummvm/scummvm/commit/d7230fe8560ef49b1958ba53109af85a40267fca
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-26T23:33:58-07:00

Commit Message:
AVALANCHE: Remove a couple of unused variables

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 5977721..91473e1 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -270,7 +270,6 @@ public:
 
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
-	enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
 	bool _dropsOk, _soundFx, _cheat;
 	Common::String _mouseText;
 	bool _weirdWord;
@@ -316,7 +315,6 @@ public:
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 	bool _isLoaded; // Is it a loaded gamestate?
-	Common::String _enidFilename;
 
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 	void setup();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e542ee4..f77b54f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -407,7 +407,6 @@ void AvalancheEngine::init() {
 		atkey = "alt-";
 #endif
 
-	_mouse = kMouseStateNo;
 	_letMeOut = false;
 	_holdTheDawn = true;
 	_currentMouse = 177;
@@ -417,7 +416,6 @@ void AvalancheEngine::init() {
 	_cp = 0;
 	_ledStatus = 177;
 	_defaultLed = 2;
-	_enidFilename = ""; // Undefined.
 	for (int i = 0; i < 3; i++)
 		_scoreToDisplay[i] = -1; // Impossible digits.
 	_holdTheDawn = false;
@@ -1632,7 +1630,6 @@ void AvalancheEngine::newGame() {
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
 	_avvyInBed = true;
-	_enidFilename = "";
 
 	enterRoom(kRoomYours, 1);
 	avvy->_visible = false;


Commit: 649fa6e5f02e7d6d3d8a6265f90d9f2a68a76887
    https://github.com/scummvm/scummvm/commit/649fa6e5f02e7d6d3d8a6265f90d9f2a68a76887
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-27T12:57:24-07:00

Commit Message:
AVALANCHE: Use the Color enum, remove some magic values, identify some dead variables

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/enums.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 960705f..5d60a73 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -81,8 +81,8 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	_info._yLength = inf.readByte();
 	_stat._seq = inf.readByte();
 	_info._size = inf.readUint16LE();
-	_stat._fgBubbleCol = inf.readByte();
-	_stat._bgBubbleCol = inf.readByte();
+	_stat._fgBubbleCol = (Color)inf.readByte();
+	_stat._bgBubbleCol = (Color)inf.readByte();
 	_stat._acciNum = inf.readByte();
 
 	_animCount = 0; // = 1;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 1b616f9..591e955 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -50,7 +50,7 @@ struct StatType {
 	Common::String _comment; // Comment.
 	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
-	byte _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
+	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
 	byte _acciNum; // The number according to Acci. (1=Avvy, etc.)
 };
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 91473e1..212840b 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -279,7 +279,7 @@ public:
 	byte _thinks;
 	bool _thinkThing;
 	int16 _talkX, _talkY;
-	byte _talkBackgroundColor, _talkFontColor;
+	Color _talkBackgroundColor, _talkFontColor;
 	byte _scrollBells; // no. of times to ring the bell
 	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f77b54f..2bf5a93 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -201,7 +201,7 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 	_oldMinute = _minute;
 }
 
-void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color) {
+void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color) {
 	if (angle > 900) {
 		endPoint.x = 177;
 		return;
@@ -210,7 +210,7 @@ void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte
 	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color);
 }
 
-void Clock::drawHand(const Common::Point &endPoint, byte color) {
+void Clock::drawHand(const Common::Point &endPoint, Color color) {
 	if (endPoint.x == 177)
 		return;
 
@@ -522,7 +522,7 @@ void AvalancheEngine::loadAlso(byte num) {
 		curLine->_y1 = file.readSint16LE();
 		curLine->_x2 = file.readSint16LE();
 		curLine->_y2 = file.readSint16LE();
-		curLine->_color = file.readByte();
+		curLine->_color = (Color)file.readByte();
 	}
 
 	memset(_peds, 177, sizeof(_peds));
@@ -1483,6 +1483,7 @@ void AvalancheEngine::spriteRun() {
 	_doingSpriteRun = false;
 }
 
+// CHECKME: Unused function
 void AvalancheEngine::fixFlashers() {
 	_ledStatus = 177;
 	_animation->setOldDirection(kDirNone);
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index af7ba2c..189b9cb 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -57,8 +57,8 @@ private:
 	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
 	Common::Point _clockHandHour, _clockHandMinute;
 
-	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, byte color);
-	void drawHand(const Common::Point &endPoint, byte color);
+	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color);
+	void drawHand(const Common::Point &endPoint, Color color);
 	void plotHands();
 	void chime();
 };
@@ -92,13 +92,16 @@ struct ByteField {
 };
 
 struct LineType : public FieldType {
-	byte _color;
+	Color _color;
 };
 
 typedef int8 TuneType[31];
 
 struct QuasipedType {
-	byte _whichPed, _foregroundColor, _room, _backgroundColor;
+	byte   _whichPed;
+	Color  _foregroundColor;
+	Room   _room;
+	Color  _backgroundColor;
 	People _who;
 };
 
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index a3cbd63..3970f68 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -51,7 +51,7 @@ void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
 	if (_vm->_ledStatus == state)
 		return; // Already like that!
 
-	byte color = kColorBlack;
+	Color color = kColorBlack;
 	switch (state) {
 	case 0:
 		color = kColorBlack;
@@ -621,8 +621,8 @@ void Dialogs::reset() {
 void Dialogs::setBubbleStateNatural() {
 	_vm->_talkX = 320;
 	_vm->_talkY = 200;
-	_vm->_talkBackgroundColor = 8;
-	_vm->_talkFontColor = 15;
+	_vm->_talkBackgroundColor = kColorDarkgray;
+	_vm->_talkFontColor = kColorWhite;
 }
 
 Common::String Dialogs::displayMoney() {
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index c3c9a54..a25b58e 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -30,10 +30,10 @@
 
 namespace Avalanche {
 enum Color {
-	kColorBlack,      kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
-	kColorMagenta,    kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
-	kColorLightgreen, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
-	kColorWhite
+	kColorBlack = 0,       kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
+	kColorMagenta = 5,     kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
+	kColorLightgreen = 10, kColorLightcyan, kColorLightred,  kColorLightmagenta, kColorYellow,
+	kColorWhite = 15
 };
 
 // CHECKME: kRoomBossKey is a guess
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 643025f..bc0a83a 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -76,7 +76,7 @@ void Graphics::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
 }
 
-Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	Common::Point endPoint;
 	const double pi = 3.14;
 	const double convfac = pi / 180.0;
@@ -162,12 +162,12 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	return endPoint;
 }
 
-void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	while (radius > 0)
 		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
 }
 
-void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color) {
+void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color) {
 	// Draw the borders with a marking color.
 	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255);
 	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255);
@@ -204,7 +204,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte
 	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
 }
 
-void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color) {
+void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
 	for (uint i = 0; i < text.size(); i++) {
 		for (int j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 4cf338b..e83dbf6 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -32,6 +32,7 @@
 #include "common/rect.h"
 
 #include "graphics/surface.h"
+#include "avalanche/enums.h"
 
 namespace Avalanche {
 class AvalancheEngine;
@@ -74,11 +75,11 @@ public:
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
 	// TODO: Make it more accurate later.
-	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 
-	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
-	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, byte color);
-	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, byte color);
+	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
+	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color);
+	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 7264cbc..81fb818 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -103,11 +103,11 @@ void MenuItem::setupOption(Common::String title, char trigger, Common::String sh
 }
 
 void MenuItem::displayOption(byte y, bool highlit) {
-	byte backgroundColor;
+	Color backgroundColor;
 	if (highlit)
-		backgroundColor = 0;
+		backgroundColor = kColorBlack;
 	else
-		backgroundColor = 7;
+		backgroundColor = kColorLightgray;
 	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
 
 	Common::String text = _options[y]._title;
@@ -290,8 +290,8 @@ void Menu::findWhatYouCanDoWithIt() {
 }
 
 void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) {
-	byte fontColor;
-	byte backgroundColor;
+	Color fontColor;
+	Color backgroundColor;
 	if (highlighted) {
 		fontColor = kColorWhite;
 		backgroundColor = kColorBlack;
@@ -339,7 +339,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 }
 
 void Menu::bleep() {
-	warning("STUB: Dropdown::bleep()");
+	warning("STUB: Menu::bleep()");
 }
 
 void Menu::parseKey(char r, char re) {
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index e1d4205..815ff23 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -131,12 +131,14 @@ private:
 	static const byte kIndent = 5;
 	static const byte kSpacing = 10;
 
-	static const byte kMenuBackgroundColor = kColorLightgray;
-	static const byte kMenuFontColor = kColorBlack;
-	static const byte kMenuBorderColor = kColorBlack;
-	static const byte kHighlightBackgroundColor = kColorBlack;
-	static const byte kHighlightFontColor = kColorWhite;
-	static const byte kDisabledColor = kColorDarkgray;
+	static const Color kMenuBackgroundColor = kColorLightgray;
+	static const Color kMenuBorderColor = kColorBlack;
+
+//	Checkme: Useless constants?
+//	static const Color kMenuFontColor = kColorBlack;
+//	static const Color kHighlightBackgroundColor = kColorBlack;
+//	static const Color kHighlightFontColor = kColorWhite;
+//	static const Color kDisabledColor = kColorDarkgray;
 
 	bool _menuActive; // Kludge so we don't have to keep referring to the menu.
 


Commit: 75258758ef64ae606a7aa6c4949bcb2b22ad1451
    https://github.com/scummvm/scummvm/commit/75258758ef64ae606a7aa6c4949bcb2b22ad1451
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-27T14:22:36-07:00

Commit Message:
AVALANCHE: Move Zoom to Graphics

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 212840b..024b484 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -384,7 +384,6 @@ private:
 	void scram(Common::String &str);
 	void unScramble();
 
-	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 	void enterNewTown();
 	void findPeople(byte room);
 	void putGeidaAt(byte whichPed, byte ped);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2bf5a93..27f7338 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -605,28 +605,6 @@ void AvalancheEngine::loadRoom(byte num) {
 	CursorMan.showMouse(true);
 }
 
-void AvalancheEngine::zoomOut(int16 x, int16 y) {
-	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
-
-	::Graphics::Surface backup;
-	backup.copyFrom(_graphics->_surface);
-	
-	for (byte i = 1; i <= 20; i ++) {
-		int16 x1 = x - (x / 20) * i;
-		int16 y1 = y - ((y - 10) / 20) * i;
-		int16 x2 = x + (((639 - x) / 20) * i);
-		int16 y2 = y + (((161 - y) / 20) * i);
-
-		_graphics->_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
-		_graphics->refreshScreen();
-		_system->delayMillis(17);
-		_graphics->_surface.copyFrom(backup);
-		_graphics->refreshScreen();
-	}
-
-	backup.free();
-}
-
 void AvalancheEngine::findPeople(byte room) {
 	for (int i = 1; i < 29; i++) {
 		if (_whereIs[i] == room) {
@@ -900,7 +878,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 		// You're entering the map.
 		dawn();
 		if (ped > 0)
-			zoomOut(_peds[ped]._x, _peds[ped]._y);
+			_graphics->zoomOut(_peds[ped]._x, _peds[ped]._y);
 
 		if ((_objects[kObjectWine - 1]) && (_wineState != 3)) {
 			_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index bc0a83a..a209904 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -30,11 +30,8 @@
 
 #include "common/system.h"
 #include "common/rect.h"
-
 #include "engines/util.h"
-
 #include "graphics/palette.h"
-
 #include "math.h"
 
 namespace Avalanche {
@@ -312,7 +309,29 @@ void Graphics::refreshScreen() {
 }
 
 void Graphics::refreshBackground() {
-	_vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10);
+	drawPicture(_surface, _background, 0, 10);
+}
+
+void Graphics::zoomOut(int16 x, int16 y) {
+	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
+
+	::Graphics::Surface backup;
+	backup.copyFrom(_surface);
+
+	for (byte i = 1; i <= 20; i ++) {
+		int16 x1 = x - (x / 20) * i;
+		int16 y1 = y - ((y - 10) / 20) * i;
+		int16 x2 = x + (((639 - x) / 20) * i);
+		int16 y2 = y + (((161 - y) / 20) * i);
+
+		_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
+		refreshScreen();
+		_vm->_system->delayMillis(17);
+		_surface.copyFrom(backup);
+		refreshScreen();
+	}
+
+	backup.free();
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index e83dbf6..979b372 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -90,6 +90,7 @@ public:
 	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 	void refreshScreen();
 	void refreshBackground();
+	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 
 private:
 	AvalancheEngine *_vm;


Commit: 00e5a4830bda004f5b4193c9d0d97a21f3e253ba
    https://github.com/scummvm/scummvm/commit/00e5a4830bda004f5b4193c9d0d97a21f3e253ba
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-27T14:48:53-07:00

Commit Message:
AVALANCHE: Move background loading to Graphics

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 27f7338..0e71f60 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -595,7 +595,7 @@ void AvalancheEngine::loadRoom(byte num) {
 
 	file.seek(177);
 
-	_graphics->_background = _graphics->loadPictureRow(file, _graphics->kBackgroundWidth, _graphics->kBackgroundHeight);
+	_graphics->loadBackground(file);
 	_graphics->refreshBackground();
 
 	file.close();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a209904..79df06b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -308,6 +308,10 @@ void Graphics::refreshScreen() {
 	g_system->updateScreen();
 }
 
+void Graphics::loadBackground(Common::File &file) {
+	_background = loadPictureRow(file, kBackgroundWidth, kBackgroundHeight);
+}
+
 void Graphics::refreshBackground() {
 	drawPicture(_surface, _background, 0, 10);
 }
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 979b372..b1b186a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -89,6 +89,7 @@ public:
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
 	void refreshScreen();
+	void loadBackground(Common::File &file);
 	void refreshBackground();
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 


Commit: 7a8d252ddb9115d4cfea0bdc5e94b38ac3ddad23
    https://github.com/scummvm/scummvm/commit/7a8d252ddb9115d4cfea0bdc5e94b38ac3ddad23
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T00:43:28-07:00

Commit Message:
AVALANCHE: Move Digits and Directions to Graphics

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index cd94351..729bb8b 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -88,12 +88,6 @@ AvalancheEngine::~AvalancheEngine() {
 			}
 		}
 	}
-
-	for (int i = 0; i < 9; i++) {
-		_digits[i].free();
-		_directions[i].free();
-	}
-	_digits[9].free();
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 024b484..2e2724f 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -283,8 +283,6 @@ public:
 	byte _scrollBells; // no. of times to ring the bell
 	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
-	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
-	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	// Called .free() for them in ~Gyro().
 	int8 _scoreToDisplay[3];
 	byte _currentMouse; // current mouse-void
@@ -327,7 +325,6 @@ public:
 	void exitRoom(byte x);
 	void enterRoom(Room room, byte ped);
 	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
-	void loadDigits(); // Load the scoring digits & rwlites
 	void drawToolbar();
 	void drawScore();
 	void incScore(byte num); // Add on no. of points
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0e71f60..096a5d7 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -318,7 +318,7 @@ void AvalancheEngine::setup() {
 
 	_dialogs->reset();
 	dusk();
-	loadDigits();
+	_graphics->loadDigits(file);
 
 	_parser->_inputTextPos = 0;
 	_parser->_quote = true;
@@ -1111,26 +1111,6 @@ void AvalancheEngine::thinkAbout(byte object, bool type) {
 	_thinkThing = type;
 }
 
-void AvalancheEngine::loadDigits() {   // Load the scoring digits & rwlites
-	const byte digitsize = 134;
-	const byte rwlitesize = 126;
-
-	if (!file.open("digit.avd"))
-		error("AVALANCHE: Lucerna: File not found: digit.avd");
-
-	for (int i = 0; i < 10; i++) {
-		file.seek(i * digitsize);
-		_digits[i] = _graphics->loadPictureGraphic(file);
-	}
-
-	for (int i = 0; i < 9; i++) {
-		file.seek(10 * digitsize + i * rwlitesize);
-		_directions[i] = _graphics->loadPictureGraphic(file);
-	}
-
-	file.close();
-}
-
 void AvalancheEngine::drawToolbar() {
 	if (!file.open("useful.avd"))
 		error("AVALANCHE: Lucerna: File not found: useful.avd");
@@ -1138,10 +1118,11 @@ void AvalancheEngine::drawToolbar() {
 	file.seek(40);
 
 	CursorMan.showMouse(false);
+
 	::Graphics::Surface picture = _graphics->loadPictureGraphic(file);
 	_graphics->drawPicture(_graphics->_surface, picture, 5, 169);
-
 	picture.free();
+
 	file.close();
 
 	CursorMan.showMouse(true);
@@ -1165,7 +1146,7 @@ void AvalancheEngine::drawScore() {
 
 	for (int i = 0; i < 3; i++) {
 		if (_scoreToDisplay[i] != numbers[i])
-			_graphics->drawPicture(_graphics->_surface, _digits[numbers[i]], 250 + (i + 1) * 15, 177);
+			_graphics->drawDigit(numbers[i], 250 + (i + 1) * 15, 177);
 	}
 
 	CursorMan.showMouse(true);
@@ -1401,7 +1382,7 @@ void AvalancheEngine::drawDirection() { // It's data is loaded in load_digits().
 	_animation->setOldDirection(_animation->getDirection());
 
 	CursorMan.showMouse(false);
-	_graphics->drawPicture(_graphics->_surface, _directions[_animation->getDirection()], 0, 161);
+	_graphics->drawDirection(_animation->getDirection(), 0, 161);
 	CursorMan.showMouse(true);
 }
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 79df06b..efed0fa 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -48,6 +48,11 @@ Graphics::~Graphics() {
 	_background.free();
 	_screen.free();
 	_scrolls.free();
+
+	for (int i = 0; i < 10; i++)
+		_digits[i].free();
+	for (int i = 0; i < 9; i++)
+		_directions[i].free();
 }
 
 void Graphics::init() {
@@ -68,6 +73,26 @@ void Graphics::init() {
 	_scrolls.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
 }
 
+void Graphics::loadDigits(Common::File &file) {   // Load the scoring digits & rwlites
+	const byte digitsize = 134;
+	const byte rwlitesize = 126;
+
+	if (!file.open("digit.avd"))
+		error("AVALANCHE: Lucerna: File not found: digit.avd");
+
+	for (int i = 0; i < 10; i++) {
+		file.seek(i * digitsize);
+		_digits[i] = loadPictureGraphic(file);
+	}
+
+	for (int i = 0; i < 9; i++) {
+		file.seek(10 * digitsize + i * rwlitesize);
+		_directions[i] = loadPictureGraphic(file);
+	}
+
+	file.close();
+}
+
 void Graphics::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
@@ -214,6 +239,14 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	}
 }
 
+void Graphics::drawDigit(int index, int x, int y) {
+	drawPicture(_surface, _digits[index], x, y);
+}
+
+void Graphics::drawDirection(int index, int x, int y) {
+	drawPicture(_surface, _directions[index], x, y);
+}
+
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index b1b186a..ea05ef1 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -70,6 +70,8 @@ public:
 	Graphics(AvalancheEngine *vm);
 	~Graphics();
 	void init();
+	void loadDigits(Common::File &file); // Load the scoring digits & rwlites
+
 	void fleshColors();
 
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
@@ -80,6 +82,8 @@ public:
 	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color);
 	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+	void drawDigit(int index, int x, int y);
+	void drawDirection(int index, int x, int y);
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
@@ -94,12 +98,14 @@ public:
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 
 private:
-	AvalancheEngine *_vm;
-
 	static const byte kEgaPaletteIndex[16];
-
-	byte _egaPalette[64][3];
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
+	byte _egaPalette[64][3];
+
+	AvalancheEngine *_vm;
+
 };
 
 } // End of namespace Avalanche


Commit: 7d66cdf417f4e4673004fd5802e4a9649e38d179
    https://github.com/scummvm/scummvm/commit/7d66cdf417f4e4673004fd5802e4a9649e38d179
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T01:00:23-07:00

Commit Message:
AVALANCHE: Move mouse cursor display functions to Graphics

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp
    engines/avalanche/pingo.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 2e2724f..1d36c4c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -348,9 +348,7 @@ public:
 	void spriteRun();
 
 	Common::String intToStr(int32 num);
-	void newMouse(byte id);
 	void setMousePointerWait();    // Makes hourglass.
-	void loadMouse(byte which);
 
 	void setBackgroundColor(byte x);
 	
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 096a5d7..33bffb0 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -498,7 +498,7 @@ void AvalancheEngine::loadAlso(byte num) {
 	Common::String filename;
 	filename = Common::String::format("also%d.avd", num);
 	if (!file.open(filename))
-		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+		error("AVALANCHE: File not found: %s", filename.c_str());
 
 	file.seek(128);
 
@@ -581,7 +581,7 @@ void AvalancheEngine::loadRoom(byte num) {
 
 	Common::String filename = Common::String::format("place%d.avd", num);
 	if (!file.open(filename))
-		error("AVALANCHE: Lucerna: File not found: %s", filename.c_str());
+		error("AVALANCHE: File not found: %s", filename.c_str());
 
 	file.seek(146);
 	if (!_roomnName.empty())
@@ -1086,10 +1086,10 @@ void AvalancheEngine::thinkAbout(byte object, bool type) {
 
 	if (type == kThing) {
 		if (!file.open("thinks.avd"))
-			error("AVALANCHE: Lucerna: File not found: thinks.avd");
+			error("AVALANCHE: File not found: thinks.avd");
 	} else { // kPerson
 		if (!file.open("folk.avd"))
-			error("AVALANCHE: Lucerna: File not found: folk.avd");
+			error("AVALANCHE: File not found: folk.avd");
 
 		object -= 149;
 		if (object >= 25)
@@ -1113,7 +1113,7 @@ void AvalancheEngine::thinkAbout(byte object, bool type) {
 
 void AvalancheEngine::drawToolbar() {
 	if (!file.open("useful.avd"))
-		error("AVALANCHE: Lucerna: File not found: useful.avd");
+		error("AVALANCHE: File not found: useful.avd");
 
 	file.seek(40);
 
@@ -1286,17 +1286,17 @@ void AvalancheEngine::checkClick() {
 		after_the_scroll = false;*/
 
 	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		newMouse(0); // up arrow
+		_graphics->loadMouse(0); // up arrow
 	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
-		newMouse(7); //I-beam
+		_graphics->loadMouse(7); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		newMouse(1); // screwdriver
+		_graphics->loadMouse(1); // screwdriver
 	else if (!_menu->isActive()) { // Dropdown can handle its own pointers.
 		if (_holdLeftMouse) {
-			newMouse(6); // Mark's crosshairs
+			_graphics->loadMouse(6); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
-			newMouse(3); // fletch
+			_graphics->loadMouse(3); // fletch
 	}
 
 	if (_holdLeftMouse) {
@@ -1454,20 +1454,12 @@ Common::String AvalancheEngine::intToStr(int32 num) {
 	return Common::String::format("%d", num);
 }
 
-void AvalancheEngine::newMouse(byte id) {
-	if (id == _currentMouse)
-		return;
-
-	_currentMouse = id;
-	loadMouse(id);
-}
-
 /**
  * Set the mouse pointer to 'HourGlass"
  * @remarks	Originally called 'wait'
  */
 void AvalancheEngine::setMousePointerWait() {
-	newMouse(4);
+	_graphics->loadMouse(4);
 }
 
 void AvalancheEngine::resetVariables() {
@@ -1767,56 +1759,6 @@ Common::String AvalancheEngine::f5Does() {
 	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
 }
 
-void AvalancheEngine::loadMouse(byte which) {
-	Common::File f;
-
-	if (!f.open("mice.avd"))
-		error("AVALANCHE: Gyro: File not found: mice.avd");
-
-	::Graphics::Surface cursor;
-	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
-	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
-
-
-	// The AND mask.
-	f.seek(kMouseSize * 2 * which + 134);
-
-	::Graphics::Surface mask = _graphics->loadPictureGraphic(f);
-
-	for (int j = 0; j < mask.h; j++) {
-		for (int i = 0; i < mask.w; i++) {
-			byte pixel = *(byte *)mask.getBasePtr(i, j);
-			if (pixel == 0) {
-				*(byte *)cursor.getBasePtr(i, j * 2    ) = 0;
-				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = 0;
-			}
-		}
-	}
-
-	mask.free();
-
-	// The OR mask.
-	f.seek(kMouseSize * 2 * which + 134 * 2);
-
-	mask = _graphics->loadPictureGraphic(f);
-
-	for (int j = 0; j < mask.h; j++) {
-		for (int i = 0; i < mask.w; i++) {
-			byte pixel = *(byte *)mask.getBasePtr(i, j);
-			if (pixel != 0) {
-				*(byte *)cursor.getBasePtr(i, j * 2    ) = pixel;
-				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = pixel;
-			}
-		}
-	}
-
-	mask.free();
-	f.close();
-
-	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which]._horizontal, kMouseHotSpots[which]._vertical * 2, 255, false);
-	cursor.free();
-}
-
 void AvalancheEngine::setBackgroundColor(byte x) {
 	warning("STUB: background()");
 }
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 3970f68..d37d759 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -115,7 +115,7 @@ void Dialogs::scrollModeNormal() {
 
 	setReadyLight(3);
 	_vm->_seeScroll = true;
-	_vm->newMouse(3);
+	_vm->_graphics->loadMouse(3);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -206,7 +206,7 @@ void Dialogs::scrollModeDialogue() {
 	warning("STUB: Scrolls::scrollModeDialogue()");
 	// It should work with keypresses too! TODO: Implement it!
 
-	_vm->loadMouse(5);
+	_vm->_graphics->loadMouse(5);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -254,7 +254,7 @@ void Dialogs::scrollModeMusic() {
 	setReadyLight(3);
 	_vm->_seeScroll = true;
 	CursorMan.showMouse(false);
-	_vm->newMouse(3);
+	_vm->_graphics->loadMouse(3);
 
 	TuneType played;
 	for (unsigned int i = 0; i < sizeof(played); i++)
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index efed0fa..744876d 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -78,7 +78,7 @@ void Graphics::loadDigits(Common::File &file) {   // Load the scoring digits & r
 	const byte rwlitesize = 126;
 
 	if (!file.open("digit.avd"))
-		error("AVALANCHE: Lucerna: File not found: digit.avd");
+		error("AVALANCHE: File not found: digit.avd");
 
 	for (int i = 0; i < 10; i++) {
 		file.seek(i * digitsize);
@@ -93,6 +93,60 @@ void Graphics::loadDigits(Common::File &file) {   // Load the scoring digits & r
 	file.close();
 }
 
+void Graphics::loadMouse(byte which) {
+	if (which == _vm->_currentMouse)
+		return;
+
+	_vm->_currentMouse = which;
+
+	Common::File f;
+	if (!f.open("mice.avd"))
+		error("AVALANCHE: Gyro: File not found: mice.avd");
+
+	::Graphics::Surface cursor;
+	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
+	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
+
+
+	// The AND mask.
+	f.seek(kMouseSize * 2 * which + 134);
+
+	::Graphics::Surface mask = loadPictureGraphic(f);
+
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			byte pixel = *(byte *)mask.getBasePtr(i, j);
+			if (pixel == 0) {
+				*(byte *)cursor.getBasePtr(i, j * 2    ) = 0;
+				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = 0;
+			}
+		}
+	}
+
+	mask.free();
+
+	// The OR mask.
+	f.seek(kMouseSize * 2 * which + 134 * 2);
+
+	mask = loadPictureGraphic(f);
+
+	for (int j = 0; j < mask.h; j++) {
+		for (int i = 0; i < mask.w; i++) {
+			byte pixel = *(byte *)mask.getBasePtr(i, j);
+			if (pixel != 0) {
+				*(byte *)cursor.getBasePtr(i, j * 2    ) = pixel;
+				*(byte *)cursor.getBasePtr(i, j * 2 + 1) = pixel;
+			}
+		}
+	}
+
+	mask.free();
+	f.close();
+
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, AvalancheEngine::kMouseHotSpots[which]._horizontal, AvalancheEngine::kMouseHotSpots[which]._vertical * 2, 255, false);
+	cursor.free();
+}
+
 void Graphics::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ea05ef1..137d3e4 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -71,11 +71,12 @@ public:
 	~Graphics();
 	void init();
 	void loadDigits(Common::File &file); // Load the scoring digits & rwlites
+	void loadMouse(byte which);
 
 	void fleshColors();
 
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
-	// Returns the end point of the arc. (Needed in Lucerna::lucerna_clock().)
+	// Returns the end point of the arc. (Needed in Clock.)
 	// TODO: Make it more accurate later.
 	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 
@@ -91,7 +92,7 @@ public:
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example.
+	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
 	void refreshScreen();
 	void loadBackground(Common::File &file);
 	void refreshBackground();
@@ -99,7 +100,7 @@ public:
 
 private:
 	static const byte kEgaPaletteIndex[16];
-	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!!
+	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
 	byte _egaPalette[64][3];
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 81fb818..c868765 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -701,14 +701,14 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->newMouse(0); // Up arrow
+					_vm->_graphics->loadMouse(0); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->newMouse(2); // Right-arrow
+						_vm->_graphics->loadMouse(2); // Right-arrow
 					else
-						_vm->newMouse(3); // Fletch
+						_vm->_graphics->loadMouse(3); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->newMouse(1); // Screwdriver
+					_vm->_graphics->loadMouse(1); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 9a11e6f..bffceab 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -79,7 +79,7 @@ void Pingo::winningPic() {
 	_vm->dusk();
 
 	if (!f.open("finale.avd"))
-		error("AVALANCHE: Lucerna: File not found: finale.avd");
+		error("AVALANCHE: File not found: finale.avd");
 
 #if 0
 	for (int bit = 0; bit <= 3; bit++) {


Commit: 726fa64bbf04dc84b78d9a165652cdeced7f4cde
    https://github.com/scummvm/scummvm/commit/726fa64bbf04dc84b78d9a165652cdeced7f4cde
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T01:11:21-07:00

Commit Message:
AVALANCHE: Use an enum for the Mouse cursor identifier

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/enums.h
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 1d36c4c..5736291 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -348,7 +348,6 @@ public:
 	void spriteRun();
 
 	Common::String intToStr(int32 num);
-	void setMousePointerWait();    // Makes hourglass.
 
 	void setBackgroundColor(byte x);
 	
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 33bffb0..bb69de8 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -237,7 +237,7 @@ void Clock::chime() {
 	if (hour == 0)
 		hour = 12;
 
-	_vm->setMousePointerWait();
+	_vm->_graphics->loadMouse(kCurWait);
 
 	for (int i = 1; i <= hour; i++) {
 		for (int j = 1; j <= 3; j++)
@@ -420,7 +420,7 @@ void AvalancheEngine::init() {
 		_scoreToDisplay[i] = -1; // Impossible digits.
 	_holdTheDawn = false;
 
-	setMousePointerWait();
+	_graphics->loadMouse(kCurWait);
 	CursorMan.showMouse(true);
 }
 
@@ -1082,7 +1082,7 @@ void AvalancheEngine::thinkAbout(byte object, bool type) {
 	_thinks = object;
 	object--;
 
-	setMousePointerWait();
+	_graphics->loadMouse(kCurWait);
 
 	if (type == kThing) {
 		if (!file.open("thinks.avd"))
@@ -1286,17 +1286,17 @@ void AvalancheEngine::checkClick() {
 		after_the_scroll = false;*/
 
 	if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-		_graphics->loadMouse(0); // up arrow
+		_graphics->loadMouse(kCurUpArrow); // up arrow
 	else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
-		_graphics->loadMouse(7); //I-beam
+		_graphics->loadMouse(kCurIBeam); //I-beam
 	else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-		_graphics->loadMouse(1); // screwdriver
+		_graphics->loadMouse(kCurScrewDriver); // screwdriver
 	else if (!_menu->isActive()) { // Dropdown can handle its own pointers.
 		if (_holdLeftMouse) {
-			_graphics->loadMouse(6); // Mark's crosshairs
+			_graphics->loadMouse(kCurCrosshair); // Mark's crosshairs
 			guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around.
 		} else
-			_graphics->loadMouse(3); // fletch
+			_graphics->loadMouse(kCurFletch); // fletch
 	}
 
 	if (_holdLeftMouse) {
@@ -1454,14 +1454,6 @@ Common::String AvalancheEngine::intToStr(int32 num) {
 	return Common::String::format("%d", num);
 }
 
-/**
- * Set the mouse pointer to 'HourGlass"
- * @remarks	Originally called 'wait'
- */
-void AvalancheEngine::setMousePointerWait() {
-	_graphics->loadMouse(4);
-}
-
 void AvalancheEngine::resetVariables() {
 	_animation->setDirection(kDirUp);
 	_carryNum = 0;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index d37d759..32bf369 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -115,7 +115,7 @@ void Dialogs::scrollModeNormal() {
 
 	setReadyLight(3);
 	_vm->_seeScroll = true;
-	_vm->_graphics->loadMouse(3);
+	_vm->_graphics->loadMouse(kCurFletch);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -206,7 +206,7 @@ void Dialogs::scrollModeDialogue() {
 	warning("STUB: Scrolls::scrollModeDialogue()");
 	// It should work with keypresses too! TODO: Implement it!
 
-	_vm->_graphics->loadMouse(5);
+	_vm->_graphics->loadMouse(kCurHand);
 
 	::Graphics::Surface temp;
 	temp.copyFrom(_vm->_graphics->_surface);
@@ -254,7 +254,7 @@ void Dialogs::scrollModeMusic() {
 	setReadyLight(3);
 	_vm->_seeScroll = true;
 	CursorMan.showMouse(false);
-	_vm->_graphics->loadMouse(3);
+	_vm->_graphics->loadMouse(kCurFletch);
 
 	TuneType played;
 	for (unsigned int i = 0; i < sizeof(played); i++)
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index a25b58e..4abd35c 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -87,4 +87,8 @@ enum VerbCode {
 
 } // End of namespace Avalanche
 
+enum MouseCursor {
+	kCurUpArrow = 0,   kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5, 
+	kCurCrosshair = 6, kCurIBeam = 7
+};
 #endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index c868765..7beacc8 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -697,18 +697,18 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 			do {
 				_vm->updateEvents();
 
-				// We updadte the cursor's picture.
+				// We update the cursor's picture.
 				cursorPos = _vm->getMousePos();
 				// Change arrow...
 				if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
-					_vm->_graphics->loadMouse(0); // Up arrow
+					_vm->_graphics->loadMouse(kCurUpArrow); // Up arrow
 				else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) {
 					if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1))
-						_vm->_graphics->loadMouse(2); // Right-arrow
+						_vm->_graphics->loadMouse(kCurRightArrow); // Right-arrow
 					else
-						_vm->_graphics->loadMouse(3); // Fletch
+						_vm->_graphics->loadMouse(kCurFletch); // Fletch
 				} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
-					_vm->_graphics->loadMouse(1); // Screwdriver
+					_vm->_graphics->loadMouse(kCurScrewDriver); // Screwdriver
 
 				_activeMenuItem.lightUp(cursorPos);
 


Commit: fdbcb5f785dcc4a4bf8b178c11f4a92d07467e6c
    https://github.com/scummvm/scummvm/commit/fdbcb5f785dcc4a4bf8b178c11f4a92d07467e6c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T01:41:52-07:00

Commit Message:
AVALANCHE: Move some more functions to Graphics

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/enums.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 5736291..ae490e0 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -320,7 +320,6 @@ public:
 
 	void init();
 	void callVerb(VerbCode id);
-	void drawAlsoLines();
 	void loadRoom(byte num);
 	void exitRoom(byte x);
 	void enterRoom(Room room, byte ped);
@@ -349,8 +348,6 @@ public:
 
 	Common::String intToStr(int32 num);
 
-	void setBackgroundColor(byte x);
-	
 	void resetVariables();
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index bb69de8..bcd5010 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -442,22 +442,6 @@ void AvalancheEngine::callVerb(VerbCode id) {
 	}
 }
 
-void AvalancheEngine::drawAlsoLines() {
-	CursorMan.showMouse(false);
-
-	_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
-	_graphics->_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
-
-	for (int i = 0; i < _lineNum; i++) {
-		// We had to check if the lines are within the borders of the screen.
-		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < _graphics->kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < _graphics->kScreenHeight)
-		 && (_lines[i]._x2 >= 0) && (_lines[i]._x2 < _graphics->kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < _graphics->kScreenHeight))
-			_graphics->_magics.drawLine(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
-	}
-
-	CursorMan.showMouse(true);
-}
-
 /**
  * Check is it's possible to give something to Spludwick
  * @remarks	Originally called 'nextstring'
@@ -564,7 +548,7 @@ void AvalancheEngine::loadAlso(byte num) {
 	for (int i = 0; i < listen_length; i++)
 		_listen += file.readByte();
 
-	drawAlsoLines();
+	_graphics->drawAlsoLines();
 
 	file.close();
 	unScramble();
@@ -1077,19 +1061,14 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 }
 
 void AvalancheEngine::thinkAbout(byte object, bool type) {
-	const int16 picSize = 966;
-
 	_thinks = object;
 	object--;
 
-	_graphics->loadMouse(kCurWait);
-
+	Common::String filename;
 	if (type == kThing) {
-		if (!file.open("thinks.avd"))
-			error("AVALANCHE: File not found: thinks.avd");
+		filename = "thinks.avd";
 	} else { // kPerson
-		if (!file.open("folk.avd"))
-			error("AVALANCHE: File not found: folk.avd");
+		filename = "folk.avd";
 
 		object -= 149;
 		if (object >= 25)
@@ -1098,34 +1077,16 @@ void AvalancheEngine::thinkAbout(byte object, bool type) {
 			object--; // Last time...
 	}
 
+	_graphics->loadMouse(kCurWait);
 	CursorMan.showMouse(false);
-
-	file.seek(object * picSize + 65);
-	::Graphics::Surface picture = _graphics->loadPictureGraphic(file);
-	_graphics->drawPicture(_graphics->_surface, picture, 205, 170);
-
-	picture.free();
-	file.close();
-
+	_graphics->drawThinkPic(filename, object);
 	CursorMan.showMouse(true);
+
 	_thinkThing = type;
 }
 
 void AvalancheEngine::drawToolbar() {
-	if (!file.open("useful.avd"))
-		error("AVALANCHE: File not found: useful.avd");
-
-	file.seek(40);
-
-	CursorMan.showMouse(false);
-
-	::Graphics::Surface picture = _graphics->loadPictureGraphic(file);
-	_graphics->drawPicture(_graphics->_surface, picture, 5, 169);
-	picture.free();
-
-	file.close();
-
-	CursorMan.showMouse(true);
+	_graphics->drawToolbar();
 	_animation->setOldDirection(kDirNone);
 	drawDirection();
 }
@@ -1751,10 +1712,6 @@ Common::String AvalancheEngine::f5Does() {
 	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
 }
 
-void AvalancheEngine::setBackgroundColor(byte x) {
-	warning("STUB: background()");
-}
-
 void AvalancheEngine::hangAroundForAWhile() {
 	for (int i = 0; i < 28; i++)
 		slowDown();
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 4abd35c..e10033a 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -91,4 +91,8 @@ enum MouseCursor {
 	kCurUpArrow = 0,   kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5, 
 	kCurCrosshair = 6, kCurIBeam = 7
 };
+
+static const int16 kScreenWidth = 640;
+static const int16 kScreenHeight = 200;
+
 #endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 744876d..9c7c07e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -147,6 +147,36 @@ void Graphics::loadMouse(byte which) {
 	cursor.free();
 }
 
+void Graphics::drawThinkPic(Common::String filename, int id) {
+	static const int16 kPicSize = 966;
+	Common::File file;
+	if (!file.open(filename))
+		error("drawThinkPic(): File not found: %s", filename.c_str());
+
+	file.seek(id * kPicSize + 65);
+	::Graphics::Surface picture = loadPictureGraphic(file);
+	drawPicture(_surface, picture, 205, 170);
+
+	picture.free();
+	file.close();
+}
+
+void Graphics::drawToolbar() {
+	Common::File file;
+	if (!file.open("useful.avd"))
+		error("drawToolbar(): File not found: useful.avd");
+
+	file.seek(40);
+
+	CursorMan.showMouse(false);
+	::Graphics::Surface picture = loadPictureGraphic(file);
+	drawPicture(_surface, picture, 5, 169);
+	CursorMan.showMouse(true);
+
+	picture.free();
+	file.close();
+}
+
 void Graphics::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
@@ -349,6 +379,22 @@ void Graphics::drawDirection(int index, int x, int y) {
 	return picture;
 }
 
+void Graphics::drawAlsoLines() {
+	CursorMan.showMouse(false);
+
+	_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
+	_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
+
+	for (int i = 0; i < _vm->_lineNum; i++) {
+		// We had to check if the lines are within the borders of the screen.
+		if ((_vm->_lines[i]._x1 >= 0) && (_vm->_lines[i]._x1 < kScreenWidth) && (_vm->_lines[i]._y1 >= 0) && (_vm->_lines[i]._y1 < kScreenHeight)
+			&& (_vm->_lines[i]._x2 >= 0) && (_vm->_lines[i]._x2 < kScreenWidth) && (_vm->_lines[i]._y2 >= 0) && (_vm->_lines[i]._y2 < kScreenHeight))
+			_magics.drawLine(_vm->_lines[i]._x1, _vm->_lines[i]._y1, _vm->_lines[i]._x2, _vm->_lines[i]._y2, _vm->_lines[i]._color);
+	}
+
+	CursorMan.showMouse(true);
+}
+
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the spirte blank.
 	for (int j = 0; j < sprite._yLength; j++) {
@@ -425,4 +471,9 @@ void Graphics::zoomOut(int16 x, int16 y) {
 	backup.free();
 }
 
+// Original name background()
+void Graphics::setBackgroundColor(Color x) {
+	warning("STUB: setBackgroundColor(%d)", x);
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 137d3e4..3df5972 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -56,12 +56,6 @@ public:
 
 class Graphics {
 public:
-	static const int16 kScreenWidth = 640;
-	static const int16 kScreenHeight = 200;
-	static const uint16 kBackgroundWidth = kScreenWidth;
-	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151.
-	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
-
 	::Graphics::Surface _surface;
 	::Graphics::Surface _background;
 	::Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
@@ -85,20 +79,30 @@ public:
 	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 	void drawDigit(int index, int x, int y);
 	void drawDirection(int index, int x, int y);
+	void drawAlsoLines();
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
-	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
 	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
 	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
+
+	void drawThinkPic(Common::String filename, int id);
+	void drawToolbar();
+
 	void refreshScreen();
 	void loadBackground(Common::File &file);
 	void refreshBackground();
+	void setBackgroundColor(Color x);
+
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 
 private:
+	static const uint16 kBackgroundWidth = kScreenWidth;
+	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151.
+	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
+
 	static const byte kEgaPaletteIndex[16];
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
@@ -107,6 +111,7 @@ private:
 
 	AvalancheEngine *_vm;
 
+	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e4c91a8..95bf535 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1066,10 +1066,10 @@ void Parser::swallow() { // Eat something.
 		}
 		break;
 	case kObjectPotion:
-		_vm->setBackgroundColor(4);
+		_vm->_graphics->setBackgroundColor(kColorRed);
 		_vm->_dialogs->displayScrollChain('U', 3);
 		_vm->gameOver();
-		_vm->setBackgroundColor(0);
+		_vm->_graphics->setBackgroundColor(kColorBlack);
 		break;
 	case kObjectInk:
 		_vm->_dialogs->displayScrollChain('U', 4);
@@ -1386,7 +1386,7 @@ void Parser::drink() {
 		_vm->dusk();
 		_vm->hangAroundForAWhile();
 		_vm->flipRoom(kRoomYours, 1);
-		_vm->setBackgroundColor(14);
+		_vm->_graphics->setBackgroundColor(kColorYellow);
 		_vm->_animation->_sprites[0]._visible = false;
 	}
 }
@@ -1414,7 +1414,7 @@ void Parser::standUp() {
 		if (_vm->_avvyIsAwake && _vm->_avvyInBed) {  // But he's in bed.
 			if (_vm->_teetotal) {
 				_vm->_dialogs->displayScrollChain('d', 12);
-				_vm->setBackgroundColor(0);
+				_vm->_graphics->setBackgroundColor(kColorBlack);
 				_vm->_dialogs->displayScrollChain('d', 14);
 			}
 			_vm->_animation->_sprites[0]._visible = true;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 5576a48..1d145e4 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -562,7 +562,7 @@ void Timer::meetAvaroid() {
 		avvy->_moveX = -3;
 		avvy->_moveY = -5;
 
-		_vm->setBackgroundColor(2);
+		_vm->_graphics->setBackgroundColor(kColorGreen);
 	}
 }
 


Commit: 0edb0e0434359d5ced78fa4f0a32ed1dafc51103
    https://github.com/scummvm/scummvm/commit/0edb0e0434359d5ced78fa4f0a32ed1dafc51103
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T05:31:54-07:00

Commit Message:
AVALANCHE: Set the Magic surface as private, some associated rework

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 5d60a73..2a309f3 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -379,16 +379,8 @@ byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
 
 	int16 minY = MIN(oy, y) + yl;
 	int16 maxY = MAX(oy, y) + yl;
-	byte returnColor = 0;
 
-	for (int16 i = x1; i <= x2; i++) {
-		for (int16 j = minY; j <= maxY; j++) {
-			byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
-			returnColor = MAX(returnColor, actColor);
-		}
-	}
-
-	return returnColor;
+	return _vm->_graphics->getAlsoColor(x1, minY, x2, maxY);
 }
 
 byte Animation::geidaPed(byte ped) {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index bcd5010..7527bb6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -543,14 +543,24 @@ void AvalancheEngine::loadAlso(byte num) {
 	for (int i = 0;  i < 26; i++)
 		_flags += file.readByte();
 
-	int16 listen_length = file.readByte();
+	int16 size = file.readByte();
 	_listen.clear();
-	for (int i = 0; i < listen_length; i++)
+	for (int i = 0; i < size; i++)
 		_listen += file.readByte();
 
-	_graphics->drawAlsoLines();
+	_graphics->prepareAlsoDisplay();
+
+	CursorMan.showMouse(false);
+	for (int i = 0; i < _lineNum; i++) {
+		// We had to check if the lines are within the borders of the screen.
+		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < kScreenHeight)
+			&& (_lines[i]._x2 >= 0) && (_lines[i]._x2 < kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < kScreenHeight))
+			_graphics->drawAlsoLines(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
+	}
+	CursorMan.showMouse(true);
 
 	file.close();
+
 	unScramble();
 	for (int i = 0; i <= alsoNum; i++) {
 		tmpStr = Common::String::format(",%s,", _also[i][0]->c_str());
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9c7c07e..12e4367 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -379,24 +379,29 @@ void Graphics::drawDirection(int index, int x, int y) {
 	return picture;
 }
 
-void Graphics::drawAlsoLines() {
-	CursorMan.showMouse(false);
-
+void Graphics::prepareAlsoDisplay() {
 	_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
+}
 
-	for (int i = 0; i < _vm->_lineNum; i++) {
-		// We had to check if the lines are within the borders of the screen.
-		if ((_vm->_lines[i]._x1 >= 0) && (_vm->_lines[i]._x1 < kScreenWidth) && (_vm->_lines[i]._y1 >= 0) && (_vm->_lines[i]._y1 < kScreenHeight)
-			&& (_vm->_lines[i]._x2 >= 0) && (_vm->_lines[i]._x2 < kScreenWidth) && (_vm->_lines[i]._y2 >= 0) && (_vm->_lines[i]._y2 < kScreenHeight))
-			_magics.drawLine(_vm->_lines[i]._x1, _vm->_lines[i]._y1, _vm->_lines[i]._x2, _vm->_lines[i]._y2, _vm->_lines[i]._color);
+void Graphics::drawAlsoLines(int x1, int y1, int x2, int y2, Color color) {
+	_magics.drawLine(x1, y1, x2, y2, color);
+}
+
+byte Graphics::getAlsoColor(int x1, int y1, int x2, int y2) {
+	byte returnColor = 0;
+	for (int16 i = x1; i <= x2; i++) {
+		for (int16 j = y1; j <= y2; j++) {
+			byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+			returnColor = MAX(returnColor, actColor);
+		}
 	}
 
-	CursorMan.showMouse(true);
+	return returnColor;
 }
 
 void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
-	// First we make the pixels of the spirte blank.
+	// First we make the pixels of the sprite blank.
 	for (int j = 0; j < sprite._yLength; j++) {
 		for (int i = 0; i < sprite._xLength; i++) {
 			if (((*sprite._sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 3df5972..b1b65ed 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -58,7 +58,6 @@ class Graphics {
 public:
 	::Graphics::Surface _surface;
 	::Graphics::Surface _background;
-	::Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
 	::Graphics::Surface _scrolls;
 
 	Graphics(AvalancheEngine *vm);
@@ -79,7 +78,9 @@ public:
 	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 	void drawDigit(int index, int x, int y);
 	void drawDirection(int index, int x, int y);
-	void drawAlsoLines();
+	void prepareAlsoDisplay();
+	void drawAlsoLines(int x1, int y1, int x2, int y2, Color color);
+	byte getAlsoColor(int x1, int y1, int x2, int y2);
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
@@ -104,6 +105,7 @@ private:
 	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
 
 	static const byte kEgaPaletteIndex[16];
+	::Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)


Commit: 6a7326ec26b4882061a17cf399fa2f685c3d776e
    https://github.com/scummvm/scummvm/commit/6a7326ec26b4882061a17cf399fa2f685c3d776e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T06:08:41-07:00

Commit Message:
AVALANCHE: More rework on Graphic code

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7527bb6..6622a8d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -548,14 +548,14 @@ void AvalancheEngine::loadAlso(byte num) {
 	for (int i = 0; i < size; i++)
 		_listen += file.readByte();
 
-	_graphics->prepareAlsoDisplay();
+	_graphics->clearAlso();
 
 	CursorMan.showMouse(false);
 	for (int i = 0; i < _lineNum; i++) {
 		// We had to check if the lines are within the borders of the screen.
 		if ((_lines[i]._x1 >= 0) && (_lines[i]._x1 < kScreenWidth) && (_lines[i]._y1 >= 0) && (_lines[i]._y1 < kScreenHeight)
 			&& (_lines[i]._x2 >= 0) && (_lines[i]._x2 < kScreenWidth) && (_lines[i]._y2 >= 0) && (_lines[i]._y2 < kScreenHeight))
-			_graphics->drawAlsoLines(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
+			_graphics->setAlsoLine(_lines[i]._x1, _lines[i]._y1, _lines[i]._x2, _lines[i]._y2, _lines[i]._color);
 	}
 	CursorMan.showMouse(true);
 
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 32bf369..9367c07 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -99,7 +99,7 @@ void Dialogs::say(int16 x, int16 y, Common::String z) {
 			// We have to draw the characters one-by-one because of the accidental font changes.
 			i++;
 			Common::String chr(z[xx]);
-			_vm->_graphics->drawText(_vm->_graphics->_scrolls, chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, kColorBlack);
+			_vm->_graphics->drawScrollText(chr, itw, 12, (x - 1) * 8 + offset * 4 + i * 8, y, kColorBlack);
 			}
 		}
 	}
@@ -178,30 +178,6 @@ void Dialogs::scrollModeNormal() {
 	warning("STUB: Scrolls::scrollModeNormal()");
 }
 
-void Dialogs::drawShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
-	for (byte i = 0; i < 2; i ++) {
-		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x1 + i + 1, y2 - i), kColorWhite);
-		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x2 - i, y1 + i + 1), kColorWhite);
-
-		_vm->_graphics->_scrolls.fillRect(Common::Rect(x2 - i, y1 + i, x2 - i + 1, y2 - i + 1), kColorDarkgray);
-		_vm->_graphics->_scrolls.fillRect(Common::Rect(x1 + i, y2 - i, x2 - i, y2 - i + 1), kColorDarkgray);
-	}
-}
-
-void Dialogs::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text) {
-	CursorMan.showMouse(false);
-	
-	drawShadow(x1, y1, x2, y2);
-
-	bool offset = text.size() % 2;
-	x1 = (x2 - x1) / 2 + x1 - text.size() / 2 * 8 - offset * 3;
-	y1 = (y2 - y1) / 2 + y1 - 4;
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, text, _vm->_font, 8, x1, y1, kColorBlue);
-	_vm->_graphics->drawText(_vm->_graphics->_scrolls, Common::String('_'), _vm->_font, 8, x1, y1, kColorBlue);
-
-	CursorMan.showMouse(true);
-}
-
 void Dialogs::scrollModeDialogue() {
 	warning("STUB: Scrolls::scrollModeDialogue()");
 	// It should work with keypresses too! TODO: Implement it!
@@ -448,8 +424,8 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	CursorMan.showMouse(false);
 
 	// The right corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorLightgray);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorLightgray);
+	_vm->_graphics->drawPieSlice(mx + lx, my - ly, 0, 90, 15, kColorLightgray);
+	_vm->_graphics->drawPieSlice(mx + lx, my + ly, 270, 360, 15, kColorLightgray);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
 
@@ -459,10 +435,10 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
 
 	// The left corners of the scroll.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
+	_vm->_graphics->drawPieSlice(mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
 	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
+	_vm->_graphics->drawPieSlice(mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
 	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
 	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
 
@@ -512,8 +488,8 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
 				_vm->_scroll[i].setChar(' ', 0);
-				drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
-				drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
+				_vm->_graphics->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
+				_vm->_graphics->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				break;
 			}
 
@@ -577,16 +553,16 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
 
 	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
 	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
 	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
 	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
+	_vm->_graphics->drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(_vm->_graphics->_scrolls, points, _vm->_talkBackgroundColor);
+	_vm->_graphics->drawTriangle(points, _vm->_talkBackgroundColor);
 
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
@@ -595,7 +571,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	for (int i = 0; i < _vm->_scrollNum; i++) {
 		int16 x = xc + _vm->_talkX - _vm->_scroll[i].size() / 2 * 8;
 		bool offset = _vm->_scroll[i].size() % 2;
-		_vm->_graphics->drawText(_vm->_graphics->_scrolls, _vm->_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
+		_vm->_graphics->drawScrollText(_vm->_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
 	}
 
 	ringBell();
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 9904ec6..d3088ec 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -104,8 +104,6 @@ private:
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
 	void scrollModeNormal();
 	// The "asking" scroll. Used indirectly in diplayQuestion().
-	void drawShadow(int16 x1, int16 y1, int16 x2, int16 y2);
-	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
 	void scrollModeDialogue();
 	// Part of the harp mini-game.
 	void scrollModeMusic();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 12e4367..007c510 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -268,12 +268,12 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	return endPoint;
 }
 
-void Graphics::drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
+void Graphics::drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	while (radius > 0)
-		drawArc(surface, x, y, stAngle, endAngle, radius--, color);
+		drawArc(_scrolls, x, y, stAngle, endAngle, radius--, color);
 }
 
-void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color) {
+void Graphics::drawTriangle(Common::Point *p, Color color) {
 	// Draw the borders with a marking color.
 	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255);
 	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255);
@@ -310,7 +310,7 @@ void Graphics::drawTriangle(::Graphics::Surface &surface, Common::Point *p, Colo
 	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
 }
 
-void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+void Graphics::drawText(::Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
 	for (uint i = 0; i < text.size(); i++) {
 		for (int j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];
@@ -323,6 +323,14 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text
 	}
 }
 
+void Graphics::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+	_vm->_graphics->drawText(_surface, text, font, fontHeight, x, y, color);
+}
+
+void Graphics::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+	_vm->_graphics->drawText(_scrolls, text, font, fontHeight, x, y, color);
+}
+
 void Graphics::drawDigit(int index, int x, int y) {
 	drawPicture(_surface, _digits[index], x, y);
 }
@@ -331,6 +339,30 @@ void Graphics::drawDirection(int index, int x, int y) {
 	drawPicture(_surface, _directions[index], x, y);
 }
 
+void Graphics::drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
+	for (byte i = 0; i < 2; i ++) {
+		_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x1 + i + 1, y2 - i), kColorWhite);
+		_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x2 - i, y1 + i + 1), kColorWhite);
+
+		_scrolls.fillRect(Common::Rect(x2 - i, y1 + i, x2 - i + 1, y2 - i + 1), kColorDarkgray);
+		_scrolls.fillRect(Common::Rect(x1 + i, y2 - i, x2 - i, y2 - i + 1), kColorDarkgray);
+	}
+}
+
+void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text) {
+	CursorMan.showMouse(false);
+
+	drawScrollShadow(x1, y1, x2, y2);
+
+	bool offset = text.size() % 2;
+	x1 = (x2 - x1) / 2 + x1 - text.size() / 2 * 8 - offset * 3;
+	y1 = (y2 - y1) / 2 + y1 - 4;
+	drawScrollText(text, _vm->_font, 8, x1, y1, kColorBlue);
+	drawScrollText(Common::String('_'), _vm->_font, 8, x1, y1, kColorBlue);
+
+	CursorMan.showMouse(true);
+}
+
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
@@ -379,12 +411,16 @@ void Graphics::drawDirection(int index, int x, int y) {
 	return picture;
 }
 
-void Graphics::prepareAlsoDisplay() {
+void Graphics::clearAlso() {
 	_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 }
 
-void Graphics::drawAlsoLines(int x1, int y1, int x2, int y2, Color color) {
+void Graphics::clearTextBar() {
+	_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
+}
+
+void Graphics::setAlsoLine(int x1, int y1, int x2, int y2, Color color) {
 	_magics.drawLine(x1, y1, x2, y2, color);
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index b1b65ed..de27231 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -73,13 +73,17 @@ public:
 	// TODO: Make it more accurate later.
 	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 
-	void drawPieSlice(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
-	void drawTriangle(::Graphics::Surface &surface, Common::Point *p, Color color);
-	void drawText(::Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+	void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
+	void drawTriangle(Common::Point *p, Color color);
+	void drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+	void drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 	void drawDigit(int index, int x, int y);
 	void drawDirection(int index, int x, int y);
-	void prepareAlsoDisplay();
-	void drawAlsoLines(int x1, int y1, int x2, int y2, Color color);
+	void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2);
+	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
+	void clearAlso();
+	void clearTextBar();
+	void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
 	byte getAlsoColor(int x1, int y1, int x2, int y2);
 
 	// The caller has to .free() the returned Surfaces!!!
@@ -114,6 +118,7 @@ private:
 	AvalancheEngine *_vm;
 
 	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
+	void drawText(::Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 7beacc8..24183f8 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -317,7 +317,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 		}
 	}
 
-	_vm->_graphics->drawText(_vm->_graphics->_surface, text, font, 8, x * 8, y, fontColor);
+	_vm->_graphics->drawNormalText(text, font, 8, x * 8, y, fontColor);
 
 	// Underline the selected character.
 	if ((trigger == 0) || !text.contains(trigger) )
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 95bf535..b86cc63 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -439,8 +439,8 @@ void Parser::plotText() {
 	CursorMan.showMouse(false);
 	cursorOff();
 
-	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
-	_vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_font, 8, 24, 161, kColorWhite);
+	_vm->_graphics->clearTextBar();
+	_vm->_graphics->drawNormalText(_inputText, _vm->_font, 8, 24, 161, kColorWhite);
 
 	cursorOn();
 	CursorMan.showMouse(true);


Commit: ef8b661c3d80a498f0bacf0b954764084c95262b
    https://github.com/scummvm/scummvm/commit/ef8b661c3d80a498f0bacf0b954764084c95262b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-28T08:09:50-07:00

Commit Message:
AVALANCHE: Partially move drawScroll to Graphics

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 9367c07..d2c4131 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -419,34 +419,8 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	if ((1 <= _useIcon) && (_useIcon <= 34))
 		lx += kHalfIconWidth;
 
-	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
-
 	CursorMan.showMouse(false);
-
-	// The right corners of the scroll.
-	_vm->_graphics->drawPieSlice(mx + lx, my - ly, 0, 90, 15, kColorLightgray);
-	_vm->_graphics->drawPieSlice(mx + lx, my + ly, 270, 360, 15, kColorLightgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
-
-	// The body of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
-
-	// The left corners of the scroll.
-	_vm->_graphics->drawPieSlice(mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
-	_vm->_graphics->drawPieSlice(mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
-	_vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
-	_vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
-
-	// The rear borders of the scroll.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
+	_vm->_graphics->drawScroll(mx, lx, my, ly);
 
 	mx -= lx;
 	my -= ly + 2;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 007c510..1961ce9 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -363,6 +363,36 @@ void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Str
 	CursorMan.showMouse(true);
 }
 
+void Graphics::drawScroll(int mx, int lx, int my, int ly) {
+	_scrolls.copyFrom(_surface);
+
+	// The right corners of the scroll.
+	drawPieSlice(mx + lx, my - ly, 0, 90, 15, kColorLightgray);
+	drawPieSlice(mx + lx, my + ly, 270, 360, 15, kColorLightgray);
+	drawArc(_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed);
+	drawArc(_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed);
+
+	// The body of the scroll.
+	_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray);
+	_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray);
+	_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray);
+
+	// The left corners of the scroll.
+	drawPieSlice(mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray);
+	drawArc(_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed);
+	_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed);
+	drawPieSlice(mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray);
+	drawArc(_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed);
+	_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed);
+
+	// The rear borders of the scroll.
+	_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed);
+	_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
+	_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
+	_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
+
+}
+
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index de27231..8fdc39f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -81,6 +81,7 @@ public:
 	void drawDirection(int index, int x, int y);
 	void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2);
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
+	void drawScroll(int mx, int lx, int my, int ly);
 	void clearAlso();
 	void clearTextBar();
 	void setAlsoLine(int x1, int y1, int x2, int y2, Color color);


Commit: 1af03774ccda57e153b3d3664613818645f5f4ff
    https://github.com/scummvm/scummvm/commit/1af03774ccda57e153b3d3664613818645f5f4ff
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T02:26:21-07:00

Commit Message:
AVALANCHE: Add some more graphic functions

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 2a309f3..bf97328 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -861,17 +861,9 @@ void Animation::callSpecial(uint16 which) {
 }
 
 void Animation::updateSpeed() {
-	// Given that you've just changed the speed in triptype._speedX, this adjusts _moveX.
-
+	// Given that you've just changed the speed in _speedX, this adjusts _moveX.
 	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
-
-	if (_sprites[0]._speedX == _vm->kRun) {
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorLightblue);
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorYellow);
-	} else {
-		_vm->_graphics->_surface.drawLine(371, 199, 373, 199, kColorLightblue);
-		_vm->_graphics->_surface.drawLine(336, 199, 338, 199, kColorYellow);
-	}
+	_vm->_graphics->drawSpeedBar(_sprites[0]._speedX);
 }
 
 void Animation::setMoveSpeed(byte t, Direction dir) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 1961ce9..2d0a45e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -48,6 +48,7 @@ Graphics::~Graphics() {
 	_background.free();
 	_screen.free();
 	_scrolls.free();
+	_backup.free();
 
 	for (int i = 0; i < 10; i++)
 		_digits[i].free();
@@ -363,6 +364,15 @@ void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Str
 	CursorMan.showMouse(true);
 }
 
+void Graphics::drawSpeedBar(int speed) {
+	if (speed == _vm->kRun) {
+		_surface.drawLine(336, 199, 338, 199, kColorLightblue);
+		_surface.drawLine(371, 199, 373, 199, kColorYellow);
+	} else {
+		_surface.drawLine(371, 199, 373, 199, kColorLightblue);
+		_surface.drawLine(336, 199, 338, 199, kColorYellow);
+	}
+}
 void Graphics::drawScroll(int mx, int lx, int my, int ly) {
 	_scrolls.copyFrom(_surface);
 
@@ -390,7 +400,6 @@ void Graphics::drawScroll(int mx, int lx, int my, int ly) {
 	_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed);
 	_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed);
 	_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
-
 }
 
 ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
@@ -523,9 +532,7 @@ void Graphics::refreshBackground() {
 void Graphics::zoomOut(int16 x, int16 y) {
 	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
 
-	::Graphics::Surface backup;
-	backup.copyFrom(_surface);
-
+	saveScreen();
 	for (byte i = 1; i <= 20; i ++) {
 		int16 x1 = x - (x / 20) * i;
 		int16 y1 = y - ((y - 10) / 20) * i;
@@ -535,11 +542,10 @@ void Graphics::zoomOut(int16 x, int16 y) {
 		_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite);
 		refreshScreen();
 		_vm->_system->delayMillis(17);
-		_surface.copyFrom(backup);
-		refreshScreen();
-	}
 
-	backup.free();
+		restoreScreen();
+	}
+	removeBackup();
 }
 
 // Original name background()
@@ -547,4 +553,16 @@ void Graphics::setBackgroundColor(Color x) {
 	warning("STUB: setBackgroundColor(%d)", x);
 }
 
+void Graphics::saveScreen() {
+	_backup.copyFrom(_surface);
+}
+
+void Graphics::removeBackup() {
+	_backup.free();
+}
+
+void Graphics::restoreScreen() {
+	_surface.copyFrom(_backup);
+	refreshScreen();
+}
 } // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 8fdc39f..c6f1f60 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -82,6 +82,8 @@ public:
 	void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2);
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
 	void drawScroll(int mx, int lx, int my, int ly);
+	void drawSpeedBar(int speed);
+
 	void clearAlso();
 	void clearTextBar();
 	void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
@@ -104,6 +106,9 @@ public:
 
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 
+	void saveScreen();
+	void removeBackup();
+	void restoreScreen();
 private:
 	static const uint16 kBackgroundWidth = kScreenWidth;
 	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151.
@@ -114,6 +119,7 @@ private:
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
+	::Graphics::Surface _backup;
 	byte _egaPalette[64][3];
 
 	AvalancheEngine *_vm;
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 24183f8..8d9d105 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -683,10 +683,9 @@ void Menu::setup() {
 }
 
 void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
-	Common::Point cursorPos = _vm->getMousePos();
-	::Graphics::Surface backup;
-	backup.copyFrom(_vm->_graphics->_surface);
+	_vm->_graphics->saveScreen();
 
+	Common::Point cursorPos = _vm->getMousePos();
 	while (!_activeMenuItem._activeNow && (cursorPos.y <= 21) && _vm->_holdLeftMouse) {
 		_menuBar.chooseMenuItem(cursorPos.x);
 		do
@@ -723,7 +722,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 							if (_activeMenuItem._activeNow) {
 								_activeMenuItem.wipe();
 								_vm->_holdLeftMouse = false;
-								backup.free();
+								_vm->_graphics->removeBackup();
 								return;
 							} // No "else"- clicking on menu has no effect (only releasing).
 						}
@@ -731,13 +730,12 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 					// Clicked on menu bar.
 					if (_activeMenuItem._activeNow) {
 						_activeMenuItem.wipe();
-						_vm->_graphics->_surface.copyFrom(backup);
-						_vm->_graphics->refreshScreen();
+						_vm->_graphics->restoreScreen();
 
 						if (((_activeMenuItem._left * 8) <= cursorPos.x) && (cursorPos.x <= (_activeMenuItem._left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
 							// If we clicked on the same menu item (the one that is already active) on the bar...
 							_vm->_holdLeftMouse = false;
-							backup.free();
+							_vm->_graphics->removeBackup();
 							return;
 						} else {
 							_vm->_holdLeftMouse = true;
@@ -764,7 +762,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 					uint16 which = (cursorPos.y - 26) / 20;
 					_activeMenuItem.select(which);
 					if (_activeMenuItem._options[which]._valid) { // If the menu item wasn't active, we do nothing.
-						backup.free();
+						_vm->_graphics->removeBackup();
 						return;
 					}
 				}
@@ -772,7 +770,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 		}
 	}
 
-	backup.free();
+	_vm->_graphics->removeBackup();
 }
 
 bool Menu::isActive() {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index b86cc63..8d01996 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -481,7 +481,7 @@ void Parser::wipeText() {
 	CursorMan.showMouse(false);
 	cursorOff();
 
-	_vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
+	_vm->_graphics->clearTextBar();
 
 	_quote = true;
 	_inputTextPos = 0;


Commit: ffbe4646c16b7620040c6b63d20779d5fa50bd6b
    https://github.com/scummvm/scummvm/commit/ffbe4646c16b7620040c6b63d20779d5fa50bd6b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T03:13:06-07:00

Commit Message:
AVALANCHE: move some more functions to Graphics

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index d2c4131..9868c77 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -65,9 +65,7 @@ void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
 	warning("STUB: Scrolls::state()");
 
 	CursorMan.showMouse(false);
-
-	_vm->_graphics->_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
-
+	_vm->_graphics->drawReadyLight(color);
 	CursorMan.showMouse(true);
 	_vm->_ledStatus = state;
 }
@@ -117,9 +115,8 @@ void Dialogs::scrollModeNormal() {
 	_vm->_seeScroll = true;
 	_vm->_graphics->loadMouse(kCurFletch);
 
-	::Graphics::Surface temp;
-	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+	_vm->_graphics->saveScreen();
+	_vm->_graphics->showScroll();
 
 	Common::Event event;
 	while (!_vm->shouldQuit()) {
@@ -134,8 +131,8 @@ void Dialogs::scrollModeNormal() {
 			break;
 	}
 
-	_vm->_graphics->_surface.copyFrom(temp);
-	temp.free();
+	_vm->_graphics->restoreScreen();
+	_vm->_graphics->removeBackup();
 
 	warning("STUB: scrollModeNormal() - Check Easter Egg trigger");
 #if 0
@@ -184,9 +181,8 @@ void Dialogs::scrollModeDialogue() {
 
 	_vm->_graphics->loadMouse(kCurHand);
 
-	::Graphics::Surface temp;
-	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+	_vm->_graphics->saveScreen();
+	_vm->_graphics->showScroll();
 
 	Common::Event event;
 	while (!_vm->shouldQuit()) {
@@ -206,8 +202,8 @@ void Dialogs::scrollModeDialogue() {
 		}
 	}
 
-	_vm->_graphics->_surface.copyFrom(temp);
-	temp.free();
+	_vm->_graphics->restoreScreen();
+	_vm->_graphics->removeBackup();
 }
 
 void Dialogs::store(byte what, TuneType &played) {
@@ -239,9 +235,8 @@ void Dialogs::scrollModeMusic() {
 
 	_vm->_seeScroll = true;
 
-	::Graphics::Surface temp;
-	temp.copyFrom(_vm->_graphics->_surface);
-	_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
+	_vm->_graphics->saveScreen();
+	_vm->_graphics->showScroll();
 
 	Common::Event event;
 	while (!_vm->shouldQuit()) {
@@ -328,8 +323,9 @@ void Dialogs::scrollModeMusic() {
 		}
 	}
 
-	_vm->_graphics->_surface.copyFrom(temp);
-	temp.free();
+	_vm->_graphics->restoreScreen();
+	_vm->_graphics->removeBackup();
+
 	_vm->_seeScroll = false;
 	CursorMan.showMouse(true);
 }
@@ -512,6 +508,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	if ((_vm->_talkX + xw) > 639)
 		xc = 639 - (_vm->_talkX + xw);
 
+	// Compute triangle coords for the tail of the bubble
 	points[0].x = _vm->_talkX - 10;
 	points[0].y = yw;
 	points[1].x = _vm->_talkX + 10;
@@ -519,25 +516,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	points[2].x = _vm->_talkX;
 	points[2].y = _vm->_talkY;
 
-	// Backup the screen before drawing the bubble.
-	_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
-
-	// The body of the bubble.
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _vm->_talkBackgroundColor);
-	_vm->_graphics->_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
-
-	// Top right corner of the bubble.
-	_vm->_graphics->drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
-	// Bottom right corner of the bubble.
-	_vm->_graphics->drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
-	// Top left corner of the bubble.
-	_vm->_graphics->drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
-	// Bottom left corner of the bubble.
-	_vm->_graphics->drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
-
-	// "Tail" of the speech bubble.
-	_vm->_graphics->drawTriangle(points, _vm->_talkBackgroundColor);
-
+	_vm->_graphics->prepareBubble(xc, xw, my, points);
 
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 2d0a45e..f39cd6a 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -325,11 +325,11 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String text,
 }
 
 void Graphics::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
-	_vm->_graphics->drawText(_surface, text, font, fontHeight, x, y, color);
+	drawText(_surface, text, font, fontHeight, x, y, color);
 }
 
 void Graphics::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
-	_vm->_graphics->drawText(_scrolls, text, font, fontHeight, x, y, color);
+	drawText(_scrolls, text, font, fontHeight, x, y, color);
 }
 
 void Graphics::drawDigit(int index, int x, int y) {
@@ -467,7 +467,7 @@ byte Graphics::getAlsoColor(int x1, int y1, int x2, int y2) {
 	byte returnColor = 0;
 	for (int16 i = x1; i <= x2; i++) {
 		for (int16 j = y1; j <= y2; j++) {
-			byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+			byte actColor = *(byte *)_magics.getBasePtr(i, j);
 			returnColor = MAX(returnColor, actColor);
 		}
 	}
@@ -508,6 +508,38 @@ void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surfac
 	}
 }
 
+void Graphics::drawCursor(byte pos) {
+	int pixPos = 24 + (pos * 8);
+	// Draw the '_' character.
+	for (int i = 0; i < 8; i++)
+		*(byte *)_surface.getBasePtr(pixPos + i, 168) = kColorWhite;
+}
+
+void Graphics::drawReadyLight(Color color) {
+	_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
+}
+
+void Graphics::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
+	// Backup the screen before drawing the bubble.
+	_scrolls.copyFrom(_surface);
+
+	// The body of the bubble.
+	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _vm->_talkBackgroundColor);
+	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
+
+	// Top right corner of the bubble.
+	drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
+	// Bottom right corner of the bubble.
+	drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
+	// Top left corner of the bubble.
+	drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
+	// Bottom left corner of the bubble.
+	drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
+
+	// "Tail" of the speech bubble.
+	drawTriangle(points, _vm->_talkBackgroundColor);
+}
+
 void Graphics::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
@@ -548,9 +580,8 @@ void Graphics::zoomOut(int16 x, int16 y) {
 	removeBackup();
 }
 
-// Original name background()
-void Graphics::setBackgroundColor(Color x) {
-	warning("STUB: setBackgroundColor(%d)", x);
+void Graphics::showScroll() {
+	_surface.copyFrom(_scrolls); // TODO: Rework it using getSubArea !!!!!!!
 }
 
 void Graphics::saveScreen() {
@@ -565,4 +596,10 @@ void Graphics::restoreScreen() {
 	_surface.copyFrom(_backup);
 	refreshScreen();
 }
+
+// Original name background()
+void Graphics::setBackgroundColor(Color x) {
+	warning("STUB: setBackgroundColor(%d)", x);
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index c6f1f60..fbedf4c 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -98,6 +98,10 @@ public:
 
 	void drawThinkPic(Common::String filename, int id);
 	void drawToolbar();
+	void drawCursor(byte pos);
+	void drawReadyLight(Color color);
+
+	void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
 
 	void refreshScreen();
 	void loadBackground(Common::File &file);
@@ -106,6 +110,8 @@ public:
 
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 
+	void showScroll();
+
 	void saveScreen();
 	void removeBackup();
 	void restoreScreen();
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 8d01996..f2bea80 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -449,14 +449,14 @@ void Parser::plotText() {
 void Parser::cursorOn() {
 	if (_cursorState == true)
 		return;
-	drawCursor();
+	_vm->_graphics->drawCursor(_inputTextPos);
 	_cursorState = true;
 }
 
 void Parser::cursorOff() {
 	if (_cursorState == false)
 		return;
-	drawCursor();
+	_vm->_graphics->drawCursor(_inputTextPos);
 	_cursorState = false;
 }
 
@@ -471,12 +471,6 @@ int16 Parser::getPos(const Common::String &crit, const Common::String &src) {
 		return -1;
 }
 
-void Parser::drawCursor() {
-	// Draw the '_' character.
-	for (int bit = 0; bit < 8; bit++)
-		*(byte *)_vm->_graphics->_surface.getBasePtr(24 + _inputTextPos * 8 + 7 - bit, 168) = kColorWhite;
-}
-
 void Parser::wipeText() {
 	CursorMan.showMouse(false);
 	cursorOff();
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 4d58893..f7d3eb1 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -147,7 +147,6 @@ private:
 	Common::String personSpeaks();
 	void heyThanks();
 
-	void drawCursor();
 	void wipeText();
 
 };


Commit: 063bc8d8c95e74732e1b78f2dc62f36b43e03fc1
    https://github.com/scummvm/scummvm/commit/063bc8d8c95e74732e1b78f2dc62f36b43e03fc1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T03:14:15-07:00

Commit Message:
AVALANCHE: Scrolls is now set to private

Changed paths:
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index fbedf4c..c05f809 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -58,7 +58,6 @@ class Graphics {
 public:
 	::Graphics::Surface _surface;
 	::Graphics::Surface _background;
-	::Graphics::Surface _scrolls;
 
 	Graphics(AvalancheEngine *vm);
 	~Graphics();
@@ -125,6 +124,7 @@ private:
 	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
 	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
+	::Graphics::Surface _scrolls;
 	::Graphics::Surface _backup;
 	byte _egaPalette[64][3];
 


Commit: de12f46db5d636c005118db2743bbb7b8a8e6287
    https://github.com/scummvm/scummvm/commit/de12f46db5d636c005118db2743bbb7b8a8e6287
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T08:54:03-07:00

Commit Message:
AVALANCHE: Rename Graphics to avoid confusion, add drawBackgroundSprite(), set _background private

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/background.cpp
    engines/avalanche/background.h
    engines/avalanche/detection.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 729bb8b..617d23c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -91,7 +91,7 @@ AvalancheEngine::~AvalancheEngine() {
 }
 
 Common::ErrorCode AvalancheEngine::initialize() {
-	_graphics = new Graphics(this);
+	_graphics = new GraphicManager(this);
 	_parser = new Parser(this);
 
 	_clock = new Clock(this);
@@ -299,7 +299,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 
 	f->writeUint32LE(desc.size());
 	f->write(desc.c_str(), desc.size());
-	::Graphics::saveThumbnail(*f);
+	Graphics::saveThumbnail(*f);
 
 	TimeDate t;
 	_system->getTimeAndDate(t);
@@ -359,7 +359,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	}
 
 	description.toUppercase();
-	::Graphics::skipThumbnail(*f);
+	Graphics::skipThumbnail(*f);
 
 	// Read the time the game was saved.
 	TimeDate t;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index ae490e0..69fba35 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -71,7 +71,7 @@ public:
 	byte _saveNum; // number of times this game has been saved
 
 	Clock *_clock;
-	Graphics *_graphics;
+	GraphicManager *_graphics;
 	Parser *_parser;
 	Pingo *_pingo;
 	Dialogs *_dialogs;
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index c4abc66..3f2c812 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -295,7 +295,7 @@ void Background::load(byte number) {
 			if (natural) {
 				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
 				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
-				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, ::Graphics::PixelFormat::createFormatCLUT8());
+				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, Graphics::PixelFormat::createFormatCLUT8());
 
 				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
 					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
@@ -373,7 +373,7 @@ void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
 	}
 
 	// These pictures are practically parts of the background. -10 is for the drop-down menu.
-	_vm->_graphics->drawPicture(_vm->_graphics->_background, sprite._picture, x, y - 10);
+	_vm->_graphics->drawBackgroundSprite(x, y - 10, sprite);
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 8d88cb3..1ce70e8 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -39,6 +39,16 @@
 namespace Avalanche {
 class AvalancheEngine;
 
+enum PictureType {kEga, kBgi, kNaturalImage};
+
+struct SpriteType {
+	PictureType _type;
+	int16 _x, _y;
+	int16 _xl, _yl;
+	int32 _size;
+	Graphics::Surface _picture;
+};
+
 class Background {
 public:
 	Background(AvalancheEngine *vm);
@@ -54,16 +64,6 @@ public:
 	void draw(int16 destX, int16 destY, byte sprId);
 
 private:
-	enum PictureType {kEga, kBgi, kNaturalImage};
-
-	struct SpriteType {
-		PictureType _type;
-		int16 _x, _y;
-		int16 _xl, _yl;
-		int32 _size;
-		::Graphics::Surface _picture;
-	};
-
 	AvalancheEngine *_vm;
 
 	int32 _offsets[40];
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 1b243d2..8afd8e5 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -204,7 +204,7 @@ SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target,
 
 		SaveStateDescriptor desc(slot, description);
 
-		::Graphics::Surface *const thumbnail = ::Graphics::loadThumbnail(*f);
+		Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*f);
 		desc.setThumbnail(thumbnail);
 
 		delete f;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index f39cd6a..61cb40a 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -36,13 +36,13 @@
 
 namespace Avalanche {
 
-const byte Graphics::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
+const byte GraphicManager::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
 
-Graphics::Graphics(AvalancheEngine *vm) {
+GraphicManager::GraphicManager(AvalancheEngine *vm) {
 	_vm = vm;
 }
 
-Graphics::~Graphics() {
+GraphicManager::~GraphicManager() {
 	_surface.free();
 	_magics.free();
 	_background.free();
@@ -56,7 +56,7 @@ Graphics::~Graphics() {
 		_directions[i].free();
 }
 
-void Graphics::init() {
+void GraphicManager::init() {
 	initGraphics(kScreenWidth, kScreenHeight * 2, true); // Doubling the height.
 
 	for (int i = 0; i < 64; ++i) {
@@ -68,13 +68,13 @@ void Graphics::init() {
 	for (int i = 0; i < 16; i++)
 		g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[i]], i, 1);
 
-	_surface.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-	_magics.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
-	_screen.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
-	_scrolls.create(kScreenWidth, kScreenHeight, ::Graphics::PixelFormat::createFormatCLUT8());
+	_surface.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
+	_magics.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
+	_screen.create(kScreenWidth, kScreenHeight * 2, Graphics::PixelFormat::createFormatCLUT8());
+	_scrolls.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
 }
 
-void Graphics::loadDigits(Common::File &file) {   // Load the scoring digits & rwlites
+void GraphicManager::loadDigits(Common::File &file) {   // Load the scoring digits & rwlites
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
@@ -94,7 +94,7 @@ void Graphics::loadDigits(Common::File &file) {   // Load the scoring digits & r
 	file.close();
 }
 
-void Graphics::loadMouse(byte which) {
+void GraphicManager::loadMouse(byte which) {
 	if (which == _vm->_currentMouse)
 		return;
 
@@ -104,15 +104,15 @@ void Graphics::loadMouse(byte which) {
 	if (!f.open("mice.avd"))
 		error("AVALANCHE: Gyro: File not found: mice.avd");
 
-	::Graphics::Surface cursor;
-	cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8());
+	Graphics::Surface cursor;
+	cursor.create(16, 32, Graphics::PixelFormat::createFormatCLUT8());
 	cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
 
 
 	// The AND mask.
 	f.seek(kMouseSize * 2 * which + 134);
 
-	::Graphics::Surface mask = loadPictureGraphic(f);
+	Graphics::Surface mask = loadPictureGraphic(f);
 
 	for (int j = 0; j < mask.h; j++) {
 		for (int i = 0; i < mask.w; i++) {
@@ -148,21 +148,21 @@ void Graphics::loadMouse(byte which) {
 	cursor.free();
 }
 
-void Graphics::drawThinkPic(Common::String filename, int id) {
+void GraphicManager::drawThinkPic(Common::String filename, int id) {
 	static const int16 kPicSize = 966;
 	Common::File file;
 	if (!file.open(filename))
 		error("drawThinkPic(): File not found: %s", filename.c_str());
 
 	file.seek(id * kPicSize + 65);
-	::Graphics::Surface picture = loadPictureGraphic(file);
+	Graphics::Surface picture = loadPictureGraphic(file);
 	drawPicture(_surface, picture, 205, 170);
 
 	picture.free();
 	file.close();
 }
 
-void Graphics::drawToolbar() {
+void GraphicManager::drawToolbar() {
 	Common::File file;
 	if (!file.open("useful.avd"))
 		error("drawToolbar(): File not found: useful.avd");
@@ -170,7 +170,7 @@ void Graphics::drawToolbar() {
 	file.seek(40);
 
 	CursorMan.showMouse(false);
-	::Graphics::Surface picture = loadPictureGraphic(file);
+	Graphics::Surface picture = loadPictureGraphic(file);
 	drawPicture(_surface, picture, 5, 169);
 	CursorMan.showMouse(true);
 
@@ -178,12 +178,12 @@ void Graphics::drawToolbar() {
 	file.close();
 }
 
-void Graphics::fleshColors() {
+void GraphicManager::fleshColors() {
 	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
 	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
 }
 
-Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
+Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	Common::Point endPoint;
 	const double pi = 3.14;
 	const double convfac = pi / 180.0;
@@ -269,12 +269,12 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
 	return endPoint;
 }
 
-void Graphics::drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
+void GraphicManager::drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	while (radius > 0)
 		drawArc(_scrolls, x, y, stAngle, endAngle, radius--, color);
 }
 
-void Graphics::drawTriangle(Common::Point *p, Color color) {
+void GraphicManager::drawTriangle(Common::Point *p, Color color) {
 	// Draw the borders with a marking color.
 	_scrolls.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, 255);
 	_scrolls.drawLine(p[1].x, p[1].y, p[2].x, p[2].y, 255);
@@ -311,7 +311,7 @@ void Graphics::drawTriangle(Common::Point *p, Color color) {
 	_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
 }
 
-void Graphics::drawText(::Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+void GraphicManager::drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
 	for (uint i = 0; i < text.size(); i++) {
 		for (int j = 0; j < fontHeight; j++) {
 			byte pixel = font[(byte)text[i]][j];
@@ -324,23 +324,23 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String text,
 	}
 }
 
-void Graphics::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+void GraphicManager::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
 	drawText(_surface, text, font, fontHeight, x, y, color);
 }
 
-void Graphics::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
+void GraphicManager::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
 	drawText(_scrolls, text, font, fontHeight, x, y, color);
 }
 
-void Graphics::drawDigit(int index, int x, int y) {
+void GraphicManager::drawDigit(int index, int x, int y) {
 	drawPicture(_surface, _digits[index], x, y);
 }
 
-void Graphics::drawDirection(int index, int x, int y) {
+void GraphicManager::drawDirection(int index, int x, int y) {
 	drawPicture(_surface, _directions[index], x, y);
 }
 
-void Graphics::drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
+void GraphicManager::drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
 	for (byte i = 0; i < 2; i ++) {
 		_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x1 + i + 1, y2 - i), kColorWhite);
 		_scrolls.fillRect(Common::Rect(x1 + i, y1 + i, x2 - i, y1 + i + 1), kColorWhite);
@@ -350,7 +350,7 @@ void Graphics::drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2) {
 	}
 }
 
-void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text) {
+void GraphicManager::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text) {
 	CursorMan.showMouse(false);
 
 	drawScrollShadow(x1, y1, x2, y2);
@@ -364,7 +364,7 @@ void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Str
 	CursorMan.showMouse(true);
 }
 
-void Graphics::drawSpeedBar(int speed) {
+void GraphicManager::drawSpeedBar(int speed) {
 	if (speed == _vm->kRun) {
 		_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 		_surface.drawLine(371, 199, 373, 199, kColorYellow);
@@ -373,7 +373,7 @@ void Graphics::drawSpeedBar(int speed) {
 		_surface.drawLine(336, 199, 338, 199, kColorYellow);
 	}
 }
-void Graphics::drawScroll(int mx, int lx, int my, int ly) {
+void GraphicManager::drawScroll(int mx, int lx, int my, int ly) {
 	_scrolls.copyFrom(_surface);
 
 	// The right corners of the scroll.
@@ -402,14 +402,18 @@ void Graphics::drawScroll(int mx, int lx, int my, int ly) {
 	_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed);
 }
 
-::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) {
+void GraphicManager::drawBackgroundSprite(int16 x, int16 y, SpriteType &sprite) {
+	drawPicture(_background, sprite._picture, x, y);
+}
+
+Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
 	uint16 width = file.readUint16LE() + 1;
 	uint16 height = file.readUint16LE() + 1;
 
-	::Graphics::Surface picture; // We make a Surface object for the picture itself.
-	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
+	Graphics::Surface picture; // We make a Surface object for the picture itself.
+	picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
 	for (int y = 0; y < height; y++) {
@@ -427,13 +431,13 @@ void Graphics::drawScroll(int mx, int lx, int my, int ly) {
 	return picture;
 }
 
-::Graphics::Surface Graphics::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
+Graphics::Surface GraphicManager::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
 	// This function is our own creation, very much like the one above. The main differences are that
 	// we don't read the width and the height from the file, the planes are in a different order
 	// and we read the picture plane-by-plane.
 
-	::Graphics::Surface picture;
-	picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8());
+	Graphics::Surface picture;
+	picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
 
 	for (int plane = 0; plane < 4; plane++) {
 		for (uint16 y = 0; y < height; y++) {
@@ -450,20 +454,20 @@ void Graphics::drawScroll(int mx, int lx, int my, int ly) {
 	return picture;
 }
 
-void Graphics::clearAlso() {
+void GraphicManager::clearAlso() {
 	_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
 	_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
 }
 
-void Graphics::clearTextBar() {
+void GraphicManager::clearTextBar() {
 	_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text.
 }
 
-void Graphics::setAlsoLine(int x1, int y1, int x2, int y2, Color color) {
+void GraphicManager::setAlsoLine(int x1, int y1, int x2, int y2, Color color) {
 	_magics.drawLine(x1, y1, x2, y2, color);
 }
 
-byte Graphics::getAlsoColor(int x1, int y1, int x2, int y2) {
+byte GraphicManager::getAlsoColor(int x1, int y1, int x2, int y2) {
 	byte returnColor = 0;
 	for (int16 i = x1; i <= x2; i++) {
 		for (int16 j = y1; j <= y2; j++) {
@@ -475,7 +479,7 @@ byte Graphics::getAlsoColor(int x1, int y1, int x2, int y2) {
 	return returnColor;
 }
 
-void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the sprite blank.
 	for (int j = 0; j < sprite._yLength; j++) {
 		for (int i = 0; i < sprite._xLength; i++) {
@@ -500,7 +504,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16
 	}
 }
 
-void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
 		for (uint16 x = 0; x < picture.w; x++)
@@ -508,18 +512,18 @@ void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surfac
 	}
 }
 
-void Graphics::drawCursor(byte pos) {
+void GraphicManager::drawCursor(byte pos) {
 	int pixPos = 24 + (pos * 8);
 	// Draw the '_' character.
 	for (int i = 0; i < 8; i++)
 		*(byte *)_surface.getBasePtr(pixPos + i, 168) = kColorWhite;
 }
 
-void Graphics::drawReadyLight(Color color) {
+void GraphicManager::drawReadyLight(Color color) {
 	_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 }
 
-void Graphics::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
+void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
 	// Backup the screen before drawing the bubble.
 	_scrolls.copyFrom(_surface);
 
@@ -540,7 +544,7 @@ void Graphics::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
 	drawTriangle(points, _vm->_talkBackgroundColor);
 }
 
-void Graphics::refreshScreen() {
+void GraphicManager::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
 		for (uint16 x = 0; x < _screen.w; x++) {
@@ -553,15 +557,15 @@ void Graphics::refreshScreen() {
 	g_system->updateScreen();
 }
 
-void Graphics::loadBackground(Common::File &file) {
+void GraphicManager::loadBackground(Common::File &file) {
 	_background = loadPictureRow(file, kBackgroundWidth, kBackgroundHeight);
 }
 
-void Graphics::refreshBackground() {
+void GraphicManager::refreshBackground() {
 	drawPicture(_surface, _background, 0, 10);
 }
 
-void Graphics::zoomOut(int16 x, int16 y) {
+void GraphicManager::zoomOut(int16 x, int16 y) {
 	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
 
 	saveScreen();
@@ -580,25 +584,25 @@ void Graphics::zoomOut(int16 x, int16 y) {
 	removeBackup();
 }
 
-void Graphics::showScroll() {
+void GraphicManager::showScroll() {
 	_surface.copyFrom(_scrolls); // TODO: Rework it using getSubArea !!!!!!!
 }
 
-void Graphics::saveScreen() {
+void GraphicManager::saveScreen() {
 	_backup.copyFrom(_surface);
 }
 
-void Graphics::removeBackup() {
+void GraphicManager::removeBackup() {
 	_backup.free();
 }
 
-void Graphics::restoreScreen() {
+void GraphicManager::restoreScreen() {
 	_surface.copyFrom(_backup);
 	refreshScreen();
 }
 
 // Original name background()
-void Graphics::setBackgroundColor(Color x) {
+void GraphicManager::setBackgroundColor(Color x) {
 	warning("STUB: setBackgroundColor(%d)", x);
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index c05f809..5c5f91d 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -36,6 +36,7 @@
 
 namespace Avalanche {
 class AvalancheEngine;
+struct SpriteType;
 
 typedef byte FontType[256][16];
 
@@ -54,13 +55,12 @@ public:
 	uint16 _size; // The size of one picture.
 };
 
-class Graphics {
+class GraphicManager {
 public:
-	::Graphics::Surface _surface;
-	::Graphics::Surface _background;
+	Graphics::Surface _surface;
 
-	Graphics(AvalancheEngine *vm);
-	~Graphics();
+	GraphicManager(AvalancheEngine *vm);
+	~GraphicManager();
 	void init();
 	void loadDigits(Common::File &file); // Load the scoring digits & rwlites
 	void loadMouse(byte which);
@@ -70,7 +70,7 @@ public:
 	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
 	// Returns the end point of the arc. (Needed in Clock.)
 	// TODO: Make it more accurate later.
-	Common::Point drawArc(::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
+	Common::Point drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 
 	void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawTriangle(Common::Point *p, Color color);
@@ -82,6 +82,7 @@ public:
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
 	void drawScroll(int mx, int lx, int my, int ly);
 	void drawSpeedBar(int speed);
+	void drawBackgroundSprite(int16 x, int16 y, SpriteType &sprite);
 
 	void clearAlso();
 	void clearTextBar();
@@ -90,10 +91,10 @@ public:
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
-	::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
+	Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
+	void drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
 
 	void drawThinkPic(Common::String filename, int id);
 	void drawToolbar();
@@ -120,18 +121,19 @@ private:
 	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
 
 	static const byte kEgaPaletteIndex[16];
-	::Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
-	::Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
-	::Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
-	::Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
-	::Graphics::Surface _scrolls;
-	::Graphics::Surface _backup;
+	Graphics::Surface _background;
+	Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
+	Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
+	Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
+	Graphics::Surface _scrolls;
+	Graphics::Surface _backup;
 	byte _egaPalette[64][3];
 
 	AvalancheEngine *_vm;
 
-	::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
-	void drawText(::Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+	Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
+	void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
 };
 
 } // End of namespace Avalanche


Commit: 6b41b38049d4a7450f0b4a2c6e71c1ba22f8cb70
    https://github.com/scummvm/scummvm/commit/6b41b38049d4a7450f0b4a2c6e71c1ba22f8cb70
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T10:03:52-07:00

Commit Message:
AVALANCHE: Move code from Menu to Graphics

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 61cb40a..77113ee 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -364,6 +364,14 @@ void GraphicManager::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Commo
 	CursorMan.showMouse(true);
 }
 
+void GraphicManager::drawMenuBar(Color color) {
+	_surface.fillRect(Common::Rect(0, 0, 640, 10), color);
+}
+
+void GraphicManager::drawMenuBlock(int x1, int y1, int x2, int y2, Color color) {
+	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
+}
+
 void GraphicManager::drawSpeedBar(int speed) {
 	if (speed == _vm->kRun) {
 		_surface.drawLine(336, 199, 338, 199, kColorLightblue);
@@ -544,6 +552,20 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
 	drawTriangle(points, _vm->_talkBackgroundColor);
 }
 
+// And set the background of the text to the desired color.
+void GraphicManager::wipeChar(int x, int y, Color color) {
+	for (int k = 0; k < 8; k++)
+		*(byte *)_surface.getBasePtr(x + k, y) = color;
+}
+
+void GraphicManager::drawChar(byte ander, int x, int y, Color color) {
+	byte pixel = ander;
+	for (int bit = 0; bit < 8; bit++) {
+		byte pixelBit = (pixel >> bit) & 1;
+		if (pixelBit)
+			*(byte *)_surface.getBasePtr(x + 7 - bit, y) = color;
+	}
+}
 void GraphicManager::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 5c5f91d..383370d 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -81,8 +81,12 @@ public:
 	void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2);
 	void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text);
 	void drawScroll(int mx, int lx, int my, int ly);
+	void drawMenuBar(Color color);
 	void drawSpeedBar(int speed);
 	void drawBackgroundSprite(int16 x, int16 y, SpriteType &sprite);
+	void drawMenuBlock(int x1, int y1, int x2, int y2, Color color);
+	void wipeChar(int x, int y, Color color);
+	void drawChar(byte ander, int x, int y, Color color);
 
 	void clearAlso();
 	void clearTextBar();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 8d9d105..21ed2d5 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -103,18 +103,18 @@ void MenuItem::setupOption(Common::String title, char trigger, Common::String sh
 }
 
 void MenuItem::displayOption(byte y, bool highlit) {
+	Common::String text = _options[y]._title;
+	while (text.size() + _options[y]._shortcut.size() < _width)
+		text += ' '; // Pad _options[y] with spaces.
+	text += _options[y]._shortcut;
+
 	Color backgroundColor;
 	if (highlit)
 		backgroundColor = kColorBlack;
 	else
 		backgroundColor = kColorLightgray;
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10), backgroundColor);
-
-	Common::String text = _options[y]._title;
-	while (text.size() + _options[y]._shortcut.size() < _width)
-		text += ' '; // Pad _options[y] with spaces.
-	text += _options[y]._shortcut;
 
+	_dr->_vm->_graphics->drawMenuBlock((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10, backgroundColor);
 	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
 }
 
@@ -128,8 +128,8 @@ void MenuItem::display() {
 	_activeNow = true;
 	_dr->_menuActive = true;
 
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), _dr->kMenuBackgroundColor);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), _dr->kMenuBorderColor);
+	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), kMenuBackgroundColor);
+	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), kMenuBorderColor);
 
 	displayOption(0, true);
 	for (int y = 1; y < _optionNum; y++)
@@ -216,7 +216,7 @@ void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, Menu
 }
 
 void MenuBar::draw() {
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect(0, 0, 640, 10), _dr->kMenuBackgroundColor);
+	_dr->_vm->_graphics->drawMenuBar(kMenuBackgroundColor);
 
 	byte savecp = _dr->_vm->_cp;
 	_dr->_vm->_cp = 3;
@@ -312,8 +312,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 			byte idx = text[i];
 			font[idx][j] = _vm->_font[idx][j] & ander; // Set the font.
 			// And set the background of the text to the desired color.
-			for (int k = 0; k < 8; k++)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + k, y + j) = backgroundColor;
+			_vm->_graphics->wipeChar(x * 8 + i * 8, y + j, backgroundColor);
 		}
 	}
 
@@ -327,12 +326,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 		for (i = 0; text[i] != trigger; i++)
 			; // Search for the character in the string.
 
-		byte pixel = ander;
-		for (int bit = 0; bit < 8; bit++) {
-			byte pixelBit = (pixel >> bit) & 1;
-			if (pixelBit)
-				*(byte *)_vm->_graphics->_surface.getBasePtr(x * 8 + i * 8 + 7 - bit, y + 8) = fontColor;
-		}
+		_vm->_graphics->drawChar(ander, x * 8 + i * 8, y + 8, fontColor);
 	}
 
 	_vm->_graphics->refreshScreen();
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index 815ff23..eb357f5 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -39,6 +39,8 @@ class AvalancheEngine;
 class Menu;
 
 typedef void (Menu::*MenuFunc)();
+static const Color kMenuBackgroundColor = kColorLightgray;
+static const Color kMenuBorderColor = kColorBlack;
 
 class HeadType {
 public:
@@ -131,9 +133,6 @@ private:
 	static const byte kIndent = 5;
 	static const byte kSpacing = 10;
 
-	static const Color kMenuBackgroundColor = kColorLightgray;
-	static const Color kMenuBorderColor = kColorBlack;
-
 //	Checkme: Useless constants?
 //	static const Color kMenuFontColor = kColorBlack;
 //	static const Color kHighlightBackgroundColor = kColorBlack;


Commit: 1c9ac623fa6ccd3f28095b9a8763ce79cb1ac358
    https://github.com/scummvm/scummvm/commit/1c9ac623fa6ccd3f28095b9a8763ce79cb1ac358
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T10:49:57-07:00

Commit Message:
AVALANCHE: Rework calcHand, move another function to Graphics

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 6622a8d..c73208c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -201,13 +201,12 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 	_oldMinute = _minute;
 }
 
-void Clock::calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color) {
+Common::Point Clock::calcHand(uint16 angle, uint16 length, Color color) {
 	if (angle > 900) {
-		endPoint.x = 177;
-		return;
+		return(Common::Point(177, 177));
 	}
 
-	endPoint = _vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color);
+	return(_vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color));
 }
 
 void Clock::drawHand(const Common::Point &endPoint, Color color) {
@@ -218,13 +217,13 @@ void Clock::drawHand(const Common::Point &endPoint, Color color) {
 }
 
 void Clock::plotHands() {
-	calcHand(_oldHourAngle, 14, _clockHandHour, kColorYellow);
-	calcHand(_oldMinute * 6, 17, _clockHandMinute, kColorYellow);
+	_clockHandHour = calcHand(_oldHourAngle, 14, kColorYellow);
+	_clockHandMinute = calcHand(_oldMinute * 6, 17, kColorYellow);
 	drawHand(_clockHandHour, kColorBrown);
 	drawHand(_clockHandMinute, kColorBrown);
 
-	calcHand(_hourAngle, 14, _clockHandHour, kColorBrown);
-	calcHand(_minute * 6, 17, _clockHandMinute, kColorBrown);
+	_clockHandHour = calcHand(_hourAngle, 14, kColorBrown);
+	_clockHandMinute = calcHand(_minute * 6, 17, kColorBrown);
 	drawHand(_clockHandHour, kColorYellow);
 	drawHand(_clockHandMinute, kColorYellow);
 }
@@ -1142,7 +1141,7 @@ void AvalancheEngine::incScore(byte num) {
 }
 
 void AvalancheEngine::useCompass(const Common::Point &cursorPos) {
-	byte color = *(byte *)_graphics->_surface.getBasePtr(cursorPos.x, cursorPos.y / 2);
+	byte color = _graphics->getScreenColor(cursorPos);
 
 	switch (color) {
 	case kColorGreen:
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 189b9cb..6c5ef31 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -57,7 +57,7 @@ private:
 	uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
 	Common::Point _clockHandHour, _clockHandMinute;
 
-	void calcHand(uint16 angle, uint16 length, Common::Point &endPoint, Color color);
+	Common::Point calcHand(uint16 angle, uint16 length, Color color);
 	void drawHand(const Common::Point &endPoint, Color color);
 	void plotHands();
 	void chime();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 77113ee..c4846d5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -372,6 +372,11 @@ void GraphicManager::drawMenuBlock(int x1, int y1, int x2, int y2, Color color)
 	_surface.fillRect(Common::Rect(x1, y1, x2, y2), color);
 }
 
+void GraphicManager::drawMenuItem(int x1, int y1, int x2, int y2) {
+	_surface.fillRect(Common::Rect(x1, y1, x2, y2), kMenuBackgroundColor);
+	_surface.frameRect(Common::Rect(x1 - 1, y1 - 1, x2 + 1, y2 + 1), kMenuBorderColor);
+}
+
 void GraphicManager::drawSpeedBar(int speed) {
 	if (speed == _vm->kRun) {
 		_surface.drawLine(336, 199, 338, 199, kColorLightblue);
@@ -487,6 +492,10 @@ byte GraphicManager::getAlsoColor(int x1, int y1, int x2, int y2) {
 	return returnColor;
 }
 
+byte GraphicManager::getScreenColor(Common::Point pos) {
+	return *(byte *)_surface.getBasePtr(pos.x, pos.y / 2);
+}
+
 void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the sprite blank.
 	for (int j = 0; j < sprite._yLength; j++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 383370d..7af1f8a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -85,6 +85,7 @@ public:
 	void drawSpeedBar(int speed);
 	void drawBackgroundSprite(int16 x, int16 y, SpriteType &sprite);
 	void drawMenuBlock(int x1, int y1, int x2, int y2, Color color);
+	void drawMenuItem(int x1, int y1, int x2, int y2);
 	void wipeChar(int x, int y, Color color);
 	void drawChar(byte ander, int x, int y, Color color);
 
@@ -92,6 +93,7 @@ public:
 	void clearTextBar();
 	void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
 	byte getAlsoColor(int x1, int y1, int x2, int y2);
+	byte getScreenColor(Common::Point pos);
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 21ed2d5..f1c6389 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -128,8 +128,7 @@ void MenuItem::display() {
 	_activeNow = true;
 	_dr->_menuActive = true;
 
-	_dr->_vm->_graphics->_surface.fillRect(Common::Rect((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly), kMenuBackgroundColor);
-	_dr->_vm->_graphics->_surface.frameRect(Common::Rect((_flx1 + 1) * 8 - 1, 11, (_flx2 + 1) * 8 + 1, _fly + 1), kMenuBorderColor);
+	_dr->_vm->_graphics->drawMenuItem((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly);
 
 	displayOption(0, true);
 	for (int y = 1; y < _optionNum; y++)


Commit: 4464409d7378d82f255ff04c7d22c7b802d4b511
    https://github.com/scummvm/scummvm/commit/4464409d7378d82f255ff04c7d22c7b802d4b511
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T12:28:43-07:00

Commit Message:
AVALANCHE: Set drawArc private

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c73208c..10b4dfc 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -206,7 +206,7 @@ Common::Point Clock::calcHand(uint16 angle, uint16 length, Color color) {
 		return(Common::Point(177, 177));
 	}
 
-	return(_vm->_graphics->drawArc(_vm->_graphics->_surface, kCenterX, kCenterY, 449 - angle, 450 - angle, length, color));
+	return(_vm->_graphics->drawScreenArc(kCenterX, kCenterY, 449 - angle, 450 - angle, length, color));
 }
 
 void Clock::drawHand(const Common::Point &endPoint, Color color) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index c4846d5..9fb9ec1 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -269,6 +269,10 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16
 	return endPoint;
 }
 
+Common::Point GraphicManager::drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
+	return drawArc(_surface, x, y, stAngle, endAngle, radius, color);
+}
+
 void GraphicManager::drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	while (radius > 0)
 		drawArc(_scrolls, x, y, stAngle, endAngle, radius--, color);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 7af1f8a..100a5da 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -67,11 +67,7 @@ public:
 
 	void fleshColors();
 
-	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
-	// Returns the end point of the arc. (Needed in Clock.)
-	// TODO: Make it more accurate later.
-	Common::Point drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
-
+	Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawTriangle(Common::Point *p, Color color);
 	void drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
@@ -140,6 +136,10 @@ private:
 
 	Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
 	void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+	// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
+	// Returns the end point of the arc. (Needed in Clock.)
+	// TODO: Make it more accurate later.
+	Common::Point drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 };
 
 } // End of namespace Avalanche


Commit: bea6980529daed3ba02f02cacd459df61c463d0b
    https://github.com/scummvm/scummvm/commit/bea6980529daed3ba02f02cacd459df61c463d0b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T13:19:12-07:00

Commit Message:
AVALANCHE: Move debug display of magic lines to debugger

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/console.cpp
    engines/avalanche/console.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 617d23c..0a4e7b1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -60,6 +60,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	}
 
 	_totalTime = 0;
+	_showDebugLines = false;
 }
 
 AvalancheEngine::~AvalancheEngine() {
@@ -442,7 +443,12 @@ void AvalancheEngine::updateEvents() {
 			_holdLeftMouse = false; // Same as above.
 			break;
 		case Common::EVENT_KEYDOWN:
-			handleKeyDown(event);
+			if ((event.kbd.keycode == Common::KEYCODE_d) && (event.kbd.flags & Common::KBD_CTRL)) {
+				// Attach to the debugger
+				_console->attach();
+				_console->onFrame();
+			} else
+				handleKeyDown(event);
 			break;
 		default:
 			break;
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 69fba35..fdb303e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -202,7 +202,7 @@ public:
 	static const int16 kGameCode = 2; // Avalot's code number
 
 	bool _holdLeftMouse;
-	
+
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
 	// If a scroll comes up, or you leave the room, it's automatically set to zero.
 	byte _interrogation;
@@ -268,6 +268,7 @@ public:
 	bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim;
 	// End of former DNA Structure
 
+	bool _showDebugLines;
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
 	bool _dropsOk, _soundFx, _cheat;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 10b4dfc..bf0bc35 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -368,19 +368,7 @@ void AvalancheEngine::runAvalot() {
 		checkClick();
 		_timer->updateTimer();
 
-#ifdef DEBUG
-		for (int i = 0; i < _lineNum; i++) {
-			LineType *curLine = &_lines[i];
-			_graphics->_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->col);
-		}
-
-		for (int i = 0; i < _fieldNum; i++) {
-			FieldType *curField = &_fields[i];
-			if (curField->_x1 < 640)
-				_graphics->_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
-		}
-#endif
-
+		_graphics->drawDebugLines();
 		_graphics->refreshScreen();
 
 		uint32 delay = _system->getMillis() - beginLoop;
diff --git a/engines/avalanche/console.cpp b/engines/avalanche/console.cpp
index 03f198f..656cc19 100644
--- a/engines/avalanche/console.cpp
+++ b/engines/avalanche/console.cpp
@@ -30,10 +30,25 @@
 
 namespace Avalanche {
 
-	AvalancheConsole::AvalancheConsole(AvalancheEngine *vm) : GUI::Debugger(), _vm(vm) {
-	}
+AvalancheConsole::AvalancheConsole(AvalancheEngine *vm) : GUI::Debugger(), _vm(vm) {
+	DCmd_Register("magic_lines", WRAP_METHOD(AvalancheConsole, Cmd_MagicLines));
+}
+
+AvalancheConsole::~AvalancheConsole() {
+}
 
-	AvalancheConsole::~AvalancheConsole() {
+/**
+ * This command loads up the specified new scene number
+ */
+bool AvalancheConsole::Cmd_MagicLines(int argc, const char **argv) {
+	if (argc != 1) {
+		DebugPrintf("Usage: %s\n", argv[0]);
+		return true;
 	}
 
+	_vm->_showDebugLines = !_vm->_showDebugLines;
+	return false;
+}
+
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/console.h b/engines/avalanche/console.h
index 138c3db..166515d 100644
--- a/engines/avalanche/console.h
+++ b/engines/avalanche/console.h
@@ -32,16 +32,19 @@
 
 namespace Avalanche {
 
-	class AvalancheEngine;
+class AvalancheEngine;
 
-	class AvalancheConsole : public GUI::Debugger {
-	public:
-		AvalancheConsole(AvalancheEngine *vm);
-		virtual ~AvalancheConsole(void);
+class AvalancheConsole : public GUI::Debugger {
+public:
+	AvalancheConsole(AvalancheEngine *vm);
+	virtual ~AvalancheConsole(void);
 
-	private:
-		AvalancheEngine *_vm;
-	};
+protected:
+	bool Cmd_MagicLines(int argc, const char **argv);
+
+private:
+	AvalancheEngine *_vm;
+};
 
 } // End of namespace Avalanche
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9fb9ec1..4db93c4 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -423,6 +423,22 @@ void GraphicManager::drawBackgroundSprite(int16 x, int16 y, SpriteType &sprite)
 	drawPicture(_background, sprite._picture, x, y);
 }
 
+void GraphicManager::drawDebugLines() {
+	if (!_vm->_showDebugLines)
+		return;
+
+	for (int i = 0; i < _vm->_lineNum; i++) {
+		LineType *curLine = &_vm->_lines[i];
+		_surface.drawLine(curLine->_x1, curLine->_y1, curLine->_x2, curLine->_y2, curLine->_color);
+	}
+
+	for (int i = 0; i < _vm->_fieldNum; i++) {
+		FieldType *curField = &_vm->_fields[i];
+		if (curField->_x1 < 640)
+			_surface.frameRect(Common::Rect(curField->_x1, curField->_y1, curField->_x2, curField->_y2), kColorLightmagenta);
+	}
+}
+
 Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
 	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 100a5da..80724f8 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -84,6 +84,7 @@ public:
 	void drawMenuItem(int x1, int y1, int x2, int y2);
 	void wipeChar(int x, int y, Color color);
 	void drawChar(byte ander, int x, int y, Color color);
+	void drawDebugLines();
 
 	void clearAlso();
 	void clearTextBar();


Commit: 24bca9d9277d9557571295d62ff75eb3ce45ac23
    https://github.com/scummvm/scummvm/commit/24bca9d9277d9557571295d62ff75eb3ce45ac23
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T14:33:48-07:00

Commit Message:
AVALANCHE: Silent warnings reported by wjp

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index f2bea80..a0051b2 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1184,6 +1184,8 @@ void Parser::openDoor() {
 			return;
 		}
 		break;
+	default:
+		break;
 	}
 
 	if ((!_vm->_userMovesAvvy) && (_vm->_room != kRoomLusties))
@@ -1902,6 +1904,8 @@ void Parser::doThat() {
 			case kRoomMusicRoom:
 				playHarp();
 				break;
+			default:
+				break;
 			}
 		} else if (isHolding()) {
 			switch (_thing) {


Commit: 55a3af61c99e621f7306b416f23df7ccc0478942
    https://github.com/scummvm/scummvm/commit/55a3af61c99e621f7306b416f23df7ccc0478942
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T14:59:01-07:00

Commit Message:
AVALANCHE: Fix more gcc warnings reported by wjp

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index bf97328..57f9cdb 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -892,6 +892,8 @@ void Animation::setMoveSpeed(byte t, Direction dir) {
 	case kDirDownRight:
 		_sprites[t].setSpeed(_sprites[t]._speedX, _sprites[t]._speedY);
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index bf0bc35..5d7877d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -655,6 +655,8 @@ void AvalancheEngine::enterNewTown() {
 		if (_boxContent == kObjectWine)
 			_wineState = 3; // Vinegar
 		break;
+	default:
+		break;
 	}
 
 	if ((_room != kRoomOutsideDucks) && (_objects[kObjectOnion - 1]) && !(_onionInVinegar))
@@ -1051,6 +1053,9 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 	case kRoomDucks:
 		_npcFacing = 1; // Duck.
 		break; 
+
+	default:
+		break;
 	}
 
 	_seeScroll = false; // Now it can work again!
@@ -1704,6 +1709,8 @@ Common::String AvalancheEngine::f5Does() {
 		if (_animation->inField(5))
 			return Common::String::format("%cPPlay the harp", kVerbCodePlay);
 		break;
+	default:
+		break;
 	}
 
 	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 3f2c812..8e6b4e5 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -242,6 +242,8 @@ void Background::update() {
 		}
 		break;
 	   }
+	default:
+		break;
 	}
 
 	if ((_vm->_bellsAreRinging) && (_vm->setFlag('B'))) {


Commit: ec41600795716c610a11e0556f5ea60dee3d7015
    https://github.com/scummvm/scummvm/commit/ec41600795716c610a11e0556f5ea60dee3d7015
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T22:04:24-07:00

Commit Message:
AVALANCHE: Rename getFlag(), change _roomTime to uint32

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index fdb303e..70e2e86 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -308,7 +308,7 @@ public:
 	bool _keyboardClick; // Is a keyboard click noise wanted?
 	People _him, _her;
 	byte _it;
-	int32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
+	uint32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
 	People _lastPerson; // Last person to have been selected using the People menu.
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
@@ -352,7 +352,7 @@ public:
 	void resetVariables();
 	void newGame(); // This sets up the DNA for a completely new game.
 	void slowDown();
-	bool setFlag(char x);
+	bool getFlag(char x);
 	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
 	void hangAroundForAWhile();
 	
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5d7877d..7973018 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -684,7 +684,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	loadRoom(roomId);
 
-	if ((_roomCount[roomId] == 0) && (!setFlag('S')))
+	if ((_roomCount[roomId] == 0) && (!getFlag('S')))
 		incScore(1);
 
 	_whereIs[kPeopleAvalot - 150] = _room;
@@ -1550,7 +1550,7 @@ void AvalancheEngine::slowDown() {
 	warning("STUB: slowdown()");
 }
 
-bool AvalancheEngine::setFlag(char x) {
+bool AvalancheEngine::getFlag(char x) {
 	for (uint16 i = 0; i < _flags.size(); i++) {
 		if (_flags[i] == x)
 			return true;
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 8e6b4e5..e5835ab 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -130,7 +130,7 @@ void Background::update() {
 		break;
 	case kRoomWestHall:
 		if ((_vm->_roomTime % 3) == 0) {
-			switch ((_vm->_roomTime / int32(3)) % int32(6)) {
+			switch ((_vm->_roomTime / 3) % 6) {
 			case 4:
 				draw(-1, -1, 0);
 				break;
@@ -246,7 +246,7 @@ void Background::update() {
 		break;
 	}
 
-	if ((_vm->_bellsAreRinging) && (_vm->setFlag('B'))) {
+	if ((_vm->_bellsAreRinging) && (_vm->getFlag('B'))) {
 		// They're ringing the bells.
 		switch (_vm->_roomTime % 4) {
 		case 1:
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index a0051b2..658c8fe 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1940,7 +1940,7 @@ void Parser::doThat() {
 		if (isHolding()) {
 			if (_thing == kObjectBell) {
 				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
-				if ((_vm->_bellsAreRinging) & (_vm->setFlag('B')))
+				if ((_vm->_bellsAreRinging) & (_vm->getFlag('B')))
 					// \? are used to avoid that ??! is parsed as a trigraph
 					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
@@ -1962,7 +1962,7 @@ void Parser::doThat() {
 		warning("STUB: Parser::doThat() - case kVerbCodeboss");
 		break;
 	case kVerbCodePee:
-		if (_vm->setFlag('P')) {
+		if (_vm->getFlag('P')) {
 			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else {
@@ -2025,7 +2025,7 @@ void Parser::doThat() {
 		_sworeNum++;
 		break;
 	case kVerbCodeListen:
-		if ((_vm->_bellsAreRinging) & (_vm->setFlag('B')))
+		if ((_vm->_bellsAreRinging) & (_vm->getFlag('B')))
 			_vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells.");
 		else if (_vm->_listen.empty())
 			_vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy.");


Commit: c2da192e7f9bf836e3abd9e87ab155be9a490770
    https://github.com/scummvm/scummvm/commit/c2da192e7f9bf836e3abd9e87ab155be9a490770
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-29T22:22:59-07:00

Commit Message:
AVALANCHE: Remove bytefields, which are set but never used

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.h
    engines/avalanche/background.cpp
    engines/avalanche/background.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 57f9cdb..89fd16f 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -170,16 +170,6 @@ bool AnimationType::checkCollision() {
 }
 
 void AnimationType::walk() {
-	if (_visible) {
-		ByteField r;
-		r._x1 = (_x / 8) - 1;
-		if (r._x1 == 255)
-			r._x1 = 0;
-		r._y1 = _y - 2;
-		r._x2 = ((_x + _info._xLength) / 8) + 1;
-		r._y2 = _y + _info._yLength + 2;
-	}
-
 	if (!_anim->_vm->_doingSpriteRun) {
 		_oldX[_anim->_vm->_cp] = _x;
 		_oldY[_anim->_vm->_cp] = _y;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 6c5ef31..a9ec69f 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -87,10 +87,6 @@ struct FieldType {
 	int16 _x1, _y1, _x2, _y2;
 };
 
-struct ByteField {
-	byte _x1, _y1, _x2, _y2;
-};
-
 struct LineType : public FieldType {
 	Color _color;
 };
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index e5835ab..e9d3672 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -359,21 +359,10 @@ void Background::draw(int16 destX, int16 destY, byte sprId) {
 	}
 }
 
+/**
+ * @remarks	Originally called 'display_it'
+ */
 void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
-	_r._x1 = x;
-	_r._y1 = y;
-	_r._y2 = y + sprite._yl;
-
-	switch (sprite._type) {
-	case kNaturalImage: // Allow fallthrough on purpose.
-	case kBgi:
-		_r._x2 = x + sprite._xl + 1;
-		break;
-	case kEga:
-		_r._x2 = x + sprite._xl;
-		break;
-	}
-
 	// These pictures are practically parts of the background. -10 is for the drop-down menu.
 	_vm->_graphics->drawBackgroundSprite(x, y - 10, sprite);
 }
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 1ce70e8..36bb1d4 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -69,7 +69,6 @@ private:
 	int32 _offsets[40];
 	byte _spriteNum;
 	SpriteType _sprites[40];
-	ByteField _r;
 	Common::String _filename;
 	static const int16 kOnDisk; // Value of _sprites[fv]._x when it's not in memory.
 


Commit: 53f6c2f693755014b0dfe1652e85eeab9cfc18a9
    https://github.com/scummvm/scummvm/commit/53f6c2f693755014b0dfe1652e85eeab9cfc18a9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-30T03:44:06-07:00

Commit Message:
AVALANCHE: Implement keyboard control in Dialogs::scrollModeDialogue().

Changed paths:
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 9868c77..d991ca7 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -176,9 +176,6 @@ void Dialogs::scrollModeNormal() {
 }
 
 void Dialogs::scrollModeDialogue() {
-	warning("STUB: Scrolls::scrollModeDialogue()");
-	// It should work with keypresses too! TODO: Implement it!
-
 	_vm->_graphics->loadMouse(kCurHand);
 
 	_vm->_graphics->saveScreen();
@@ -189,13 +186,25 @@ void Dialogs::scrollModeDialogue() {
 		_vm->_graphics->refreshScreen();
 
 		_vm->getEvent(event);
+
 		Common::Point cursorPos = _vm->getMousePos();
 		cursorPos.y /= 2;
-		if (_vm->shouldQuit() || (event.type == Common::EVENT_LBUTTONUP)) {
-			if ((cursorPos.x >= _shadowBoxX - 65) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX - 5) && (cursorPos.y <= _shadowBoxY - 10)) {
+
+		char inChar = 0;
+		if (event.type == Common::EVENT_KEYDOWN) {
+			inChar = (char)event.kbd.ascii;
+			Common::String temp(inChar);
+			temp.toUppercase();
+			inChar = temp[0];
+		}
+
+		if (_vm->shouldQuit() || (event.type == Common::EVENT_LBUTTONUP) || (event.type == Common::EVENT_KEYDOWN)) {
+			if (((cursorPos.x >= _shadowBoxX - 65) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX - 5) && (cursorPos.y <= _shadowBoxY - 10))
+				|| (inChar == 'Y') || (inChar == 'J') || (inChar == 'O')) { // Yes, Ja, Oui
 				_scReturn = true;
 				break;
-			} else if ((cursorPos.x >= _shadowBoxX + 5) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX + 65) && (cursorPos.y <= _shadowBoxY - 10)) {
+			} else if (((cursorPos.x >= _shadowBoxX + 5) && (cursorPos.y >= _shadowBoxY - 24) && (cursorPos.x <= _shadowBoxX + 65) && (cursorPos.y <= _shadowBoxY - 10))
+						|| (inChar == 'N')){ // No, Non, Nein
 				_scReturn = false;
 				break;
 			}


Commit: b160a156c1653f32c57ce9479cb27c44e5ed4dc7
    https://github.com/scummvm/scummvm/commit/b160a156c1653f32c57ce9479cb27c44e5ed4dc7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T11:53:06-07:00

Commit Message:
AVALANCHE: Little refactoring in background

Changed paths:
    engines/avalanche/background.cpp



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index e9d3672..0d350c1 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -110,21 +110,21 @@ void Background::update() {
 		case 199:
 			_vm->_npcFacing = 177; // Impossible value for this.
 			break;
-		}
-
-		if ((_vm->_roomTime % 200 >= 0) && (_vm->_roomTime % 200 <= 178)) { // Normally.
-			byte direction = 0;
-			uint16 angle = _vm->bearing(1);
-			if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
-				direction = 3;
-			else if ((angle >= 293) && (angle <= 357))
-				direction = 2;
-			else if ((angle >= 271) && (angle <= 292))
-				direction = 4;
-
-			if (direction != _vm->_npcFacing) { // Dogfood.
-				draw(-1, -1, direction - 1);
-				_vm->_npcFacing = direction;
+		default:
+			if (_vm->_roomTime % 200 <= 178) { // Normally.
+				byte direction = 0;
+				uint16 angle = _vm->bearing(1);
+				if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
+					direction = 3;
+				else if ((angle >= 293) && (angle <= 357))
+					direction = 2;
+				else if ((angle >= 271) && (angle <= 292))
+					direction = 4;
+
+				if (direction != _vm->_npcFacing) { // Dogfood.
+					draw(-1, -1, direction - 1);
+					_vm->_npcFacing = direction;
+				}
 			}
 		}
 		break;


Commit: 98b5fe757f2559acd90b05f20ce4425ab8c73b0f
    https://github.com/scummvm/scummvm/commit/98b5fe757f2559acd90b05f20ce4425ab8c73b0f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T13:00:05-07:00

Commit Message:
AVALANCHE: Remove various dead variables and associated code

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 89fd16f..f7f103d 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1091,7 +1091,7 @@ void Animation::drawSprites() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	if (_vm->_menu->isActive() | _vm->_onToolbar | _vm->_seeScroll)
+	if (_vm->_menu->isActive() | _vm->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0a4e7b1..54bede1 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -388,7 +388,6 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	refreshObjectList();
 	_animation->updateSpeed();
 	drawDirection();
-	_onToolbar = false;
 	_animation->animLink();
 	_background->update();
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 70e2e86..e27848c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -162,9 +162,6 @@ private:
 #endif
 
 public:
-	static const int16 kXW = 30;
-	static const int16 kYW = 36; // x width & y whatsit
-	static const int16 kMargin = 5;
 	static const MouseHotspotType kMouseHotSpots[9];
 	static const int16 kMaxSprites = 2; // Current max no. of sprites.
 
@@ -184,8 +181,6 @@ public:
 	};
 
 	// These following static constants should be included in CFG when it's written.
-
-	static const bool kSlowComputer = false; // Stops walking when mouse touches toolbar.
 	static const int16 kBorder = 1; // size of border on shadowboxes
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
@@ -282,7 +277,7 @@ public:
 	int16 _talkX, _talkY;
 	Color _talkBackgroundColor, _talkFontColor;
 	byte _scrollBells; // no. of times to ring the bell
-	bool _onToolbar, _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
+	bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
 	// Called .free() for them in ~Gyro().
 	int8 _scoreToDisplay[3];
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7973018..1e73970 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1243,7 +1243,6 @@ void AvalancheEngine::guideAvvy(Common::Point cursorPos) {
 
 void AvalancheEngine::checkClick() {
 	Common::Point cursorPos = getMousePos();
-	_onToolbar = kSlowComputer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
 
 	/*if (mrelease > 0)
 		after_the_scroll = false;*/
@@ -1523,7 +1522,6 @@ void AvalancheEngine::newGame() {
 	_thinkThing = true;
 	_thinks = 2;
 	refreshObjectList();
-	_onToolbar = false;
 	_seeScroll = false;
 
 	avvy->appear(300, 117, kDirRight); // Needed to initialize Avalot.


Commit: 9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0
    https://github.com/scummvm/scummvm/commit/9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T15:12:28-07:00

Commit Message:
AVALANCHE: Move several variables to make them private

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/background.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f7f103d..3de2c7c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -720,8 +720,8 @@ void Animation::callSpecial(uint16 which) {
 	case 3: // _vm->special 3: Room 71: triggers dart.
 		_sprites[0].bounce(); // Must include that.
 
-		if (!_vm->_arrowTriggered) {
-			_vm->_arrowTriggered = true;
+		if (!_arrowTriggered) {
+			_arrowTriggered = true;
 			appearPed(1, 3); // The dart starts at ped 4, and...
 			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
 			_sprites[1]._facingDir = kDirUp; // Only face.
@@ -1285,6 +1285,7 @@ Direction Animation::getOldDirection() {
 void Animation::resetVariables() {
 	_geidaSpin = 0;
 	_geidaTime = 0;
+	_arrowTriggered = false;
 }
 
 void Animation::synchronize(Common::Serializer &sz) {
@@ -1342,6 +1343,7 @@ void Animation::synchronize(Common::Serializer &sz) {
 			spr->appear(spr->_x, spr->_y, spr->_facingDir);
 	}
 
+	sz.syncAsByte(_arrowTriggered);
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 54bede1..251cc0c 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -134,6 +134,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	_animation->synchronize(sz);
 	_parser->synchronize(sz);
 	_sequence->synchronize(sz);
+	_background->synchronize(sz);
 
 	sz.syncAsByte(_carryNum);
 	for (int i = 0; i < kObjectNum; i++)
@@ -171,7 +172,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_bellsAreRinging);
 	sz.syncAsByte(_standingOnDais);
 	sz.syncAsByte(_takenPen);
-	sz.syncAsByte(_arrowTriggered);
 	sz.syncAsByte(_arrowInTheDoor);
 
 	if (sz.isSaving()) {
@@ -257,7 +257,6 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
 	sz.syncAsByte(_catacombY);
 	sz.syncAsByte(_avvysInTheCupboard);
 	sz.syncAsByte(_geidaFollows);
-	sz.syncAsByte(_nextBell);
 	sz.syncAsByte(_givenPotionToGeida);
 	sz.syncAsByte(_lustieIsAsleep);
 	sz.syncAsByte(_beenTiedUp);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e27848c..db4434a 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -181,7 +181,6 @@ public:
 	};
 
 	// These following static constants should be included in CFG when it's written.
-	static const int16 kBorder = 1; // size of border on shadowboxes
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
 	static const int32 kCatacombMap[8][8];
@@ -193,8 +192,6 @@ public:
 
 	static const char *kVersionNum;
 	static const char *kCopyright;
-	static const int16 kVersionCode = 130; // Same as kVersionCode, but numerically & without the ".".
-	static const int16 kGameCode = 2; // Avalot's code number
 
 	bool _holdLeftMouse;
 
@@ -208,7 +205,6 @@ public:
 	int16 _dnascore; // your score, of course
 	int32 _money; // your current amount of dosh
 	Room _room; // your current room
-	byte _roomCount[100]; // Add one to each every time you enter a room
 	bool _wonNim; // Have you *won* Nim? (That's harder.)
 	byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar.
 	bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet?
@@ -221,7 +217,6 @@ public:
 	byte _givenToSpludwick; // 0 = nothing given, 1 = onion...
 	byte _brummieStairs; // Progression through the stairs trick.
 	byte _cardiffQuestionNum; // Things you get asked in Cardiff.
-	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.)
 	bool _avvyInBed; // True if Avvy's in bed, but awake.
 	bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements.
@@ -235,15 +230,11 @@ public:
 	bool _bellsAreRinging; // Is Jacques ringing the bells?
 	bool _standingOnDais; // In room 71, inside Cardiff Castle.
 	bool _takenPen; // Have you taken the pen (in Cardiff?)
-	bool _arrowTriggered; // And has the arrow been triggered?
 	bool _arrowInTheDoor;  // Did the arrow hit the wall?
 	Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's
 	uint32 _totalTime; // Your total time playing this game, in ticks.
 	byte _jumpStatus; // Fixes how high you're jumping.
 	bool _mushroomGrowing; // Is the mushroom growing in 42?
-	bool _spludwickAtHome; // Is Spludwick at home?
-	byte _lastRoom;
-	byte _lastRoomNotMap;
 	bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away?
 	bool _enterCatacombsFromLustiesRoom;
 	bool _teetotal; // Are we touching any more drinks?
@@ -253,7 +244,6 @@ public:
 	byte _catacombX, _catacombY;   // XY coords in the catacombs.
 	bool _avvysInTheCupboard; // On screen 22.
 	bool _geidaFollows; // Is Geida following you?
-	byte _nextBell; // For the ringing.
 	bool _givenPotionToGeida; // Does Geida have the potion?
 	bool _lustieIsAsleep; // Is BDL asleep?
 	bool _beenTiedUp; // In r__Robins.
@@ -366,6 +356,12 @@ public:
 private:
 	static Room _whereIs[29];
 
+	bool _spludwickAtHome; // Is Spludwick at home?
+	byte _lastRoom;
+	byte _lastRoomNotMap;
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	byte _roomCount[100]; // Add one to each every time you enter a room
+
 	Common::File file;
 	Common::String readAlsoStringFromFile();
 	void scram(Common::String &str);
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 1e73970..922be91 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1455,7 +1455,6 @@ void AvalancheEngine::resetVariables() {
 	_bellsAreRinging = false;
 	_standingOnDais = false;
 	_takenPen = false;
-	_arrowTriggered = false;
 	_arrowInTheDoor = false;
 	_favouriteDrink = "";
 	_favouriteSong = "";
@@ -1477,7 +1476,6 @@ void AvalancheEngine::resetVariables() {
 	_catacombY = 0;
 	_avvysInTheCupboard = false;
 	_geidaFollows = false;
-	_nextBell = 0;
 	_givenPotionToGeida = false;
 	_lustieIsAsleep = false;
 	_beenTiedUp = false;
@@ -1491,6 +1489,7 @@ void AvalancheEngine::resetVariables() {
 	_parser->resetVariables();
 	_animation->resetVariables();
 	_sequence->resetVariables();
+	_background->resetVariables();
 }
 
 void AvalancheEngine::newGame() {
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 0d350c1..e72e4a4 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -250,11 +250,11 @@ void Background::update() {
 		// They're ringing the bells.
 		switch (_vm->_roomTime % 4) {
 		case 1:
-			if (_vm->_nextBell < 5)
-				_vm->_nextBell = 12;
-			_vm->_nextBell--;
+			if (_nextBell < 5)
+				_nextBell = 12;
+			_nextBell--;
 			// CHECKME: 2 is a guess. No length in the original? 
-			_vm->_sound->playNote(_vm->kNotes[_vm->_nextBell], 2);
+			_vm->_sound->playNote(_vm->kNotes[_nextBell], 2);
 			break;
 		case 2:
 			_vm->_sound->stopSound();
@@ -367,4 +367,11 @@ void Background::drawSprite(int16 x, int16 y, SpriteType &sprite) {
 	_vm->_graphics->drawBackgroundSprite(x, y - 10, sprite);
 }
 
+void Background::resetVariables() {
+	_nextBell = 0;
+}
+
+void Background::synchronize(Common::Serializer &sz) {
+	sz.syncAsByte(_nextBell);
+}
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 36bb1d4..f4fcd38 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -62,10 +62,13 @@ public:
 	// If you give it positive values, the picture will be plotted to the desired coordinates on the screen.
 	// By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication.
 	void draw(int16 destX, int16 destY, byte sprId);
+	void resetVariables();
+	void synchronize(Common::Serializer &sz);
 
 private:
 	AvalancheEngine *_vm;
 
+	byte _nextBell; // For the ringing.
 	int32 _offsets[40];
 	byte _spriteNum;
 	SpriteType _sprites[40];


Commit: 6c11712373c536a0a0e84c7e4f5d5f39ce79467e
    https://github.com/scummvm/scummvm/commit/6c11712373c536a0a0e84c7e4f5d5f39ce79467e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T21:50:27-07:00

Commit Message:
AVALANCHE: More refactoring

Changed paths:
    engines/avalanche/animation.h
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 591e955..d5d8510 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -141,6 +141,7 @@ public:
 private:
 	Direction _direction; // The direction Avvy is currently facing.
 	Direction _oldDirection;
+	bool _arrowTriggered; // And has the arrow been triggered?
 
 	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index db4434a..e9e7643 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -256,9 +256,8 @@ public:
 	bool _showDebugLines;
 	byte _lineNum; // Number of lines.
 	LineType _lines[50]; // For Also.
-	bool _dropsOk, _soundFx, _cheat;
-	Common::String _mouseText;
-	bool _weirdWord;
+	bool _dropsOk;
+	bool _cheat; // CHECKME: Currently unused
 	bool _letMeOut;
 	Common::String _scroll[15];
 	byte _scrollNum, _whichwas;
@@ -299,6 +298,7 @@ public:
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 	bool _isLoaded; // Is it a loaded gamestate?
+	bool _soundFx;
 
 	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 	void setup();
@@ -361,6 +361,7 @@ private:
 	byte _lastRoomNotMap;
 	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	byte _roomCount[100]; // Add one to each every time you enter a room
+	Common::String _mouseText;
 
 	Common::File file;
 	Common::String readAlsoStringFromFile();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 922be91..79f8953 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -421,12 +421,8 @@ void AvalancheEngine::callVerb(VerbCode id) {
 			"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
 			"what the current setting of this key is.");
 		_dialogs->displayText(tmpStr);
-	} else {
-		_weirdWord = false;
-		_parser->_polite = true;
-		_parser->_verb = id;
-		_parser->doThat();
-	}
+	} else
+		_parser->doVerb(id);
 }
 
 /**
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 658c8fe..2064fa7 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -50,7 +50,7 @@ void Parser::init() {
 		_inputText.clear();
 	_inputTextPos = 0;
 
-	_vm->_weirdWord = false;
+	_weirdWord = false;
 
 	// Initailaze the vocabulary.
 	// Verbs: 1-49
@@ -712,7 +712,7 @@ void Parser::parse() {
 	// Are we being interrogated right now?
 	if (_vm->_interrogation > 0) {
 		storeInterrogation(_vm->_interrogation);
-		_vm->_weirdWord = true;
+		_weirdWord = true;
 		return;
 	}
 
@@ -814,7 +814,7 @@ void Parser::parse() {
 	}
 
 	if (doPronouns()) {
-		_vm->_weirdWord = true;
+		_weirdWord = true;
 		_thats = kNothing;
 		return;
 	}
@@ -869,9 +869,9 @@ void Parser::parse() {
 	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
 		_vm->_dialogs->displayText(tmpStr);
-		_vm->_weirdWord = true;
+		_weirdWord = true;
 	} else
-		_vm->_weirdWord = false;
+		_weirdWord = false;
 
 	if (_thats.empty())
 		_thats = kNothing;
@@ -1590,7 +1590,7 @@ void Parser::doThat() {
 		return;
 	}
 
-	if (_vm->_weirdWord)
+	if (_weirdWord)
 		return;
 
 	if (_thing < 200)
@@ -2351,6 +2351,13 @@ void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
 	}
 }
 
+void Parser::doVerb(VerbCode id) {
+	_weirdWord = false;
+	_polite = true;
+	_verb = id;
+	doThat();
+}
+
 void Parser::resetVariables() {
 	_wearing = 0;
 	_sworeNum = 0;
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index f7d3eb1..f20aa90 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -69,6 +69,7 @@ public:
 	byte _inputTextPos; // Original name: curpos
 	bool _quote; // 66 or 99 next?
 	bool _cursorState;
+	bool _weirdWord;
 
 	byte _wearing; // what you're wearing
 
@@ -89,6 +90,7 @@ public:
 	void cursorOff();
 	void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
 	int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+	void doVerb(VerbCode id);
 
 	void resetVariables();
 	void synchronize(Common::Serializer &sz);


Commit: 15acaa1a77b5f6cba5829d5274d3ffe99fa56fbb
    https://github.com/scummvm/scummvm/commit/15acaa1a77b5f6cba5829d5274d3ffe99fa56fbb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T22:11:20-07:00

Commit Message:
AVALANCHE: Move _scroll and _scrollNum to Dialogs. Remove a useless variable

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e9e7643..06d7e68 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -259,8 +259,10 @@ public:
 	bool _dropsOk;
 	bool _cheat; // CHECKME: Currently unused
 	bool _letMeOut;
-	Common::String _scroll[15];
-	byte _scrollNum, _whichwas;
+
+
+
+
 	byte _thinks;
 	bool _thinkThing;
 	int16 _talkX, _talkY;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index d991ca7..43b85cf 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -409,10 +409,10 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
-	int16 ly = (_vm->_scrollNum) * 6;
+	int16 ly = (_scrollNum) * 6;
 	int16 ex;
-	for (int i = 0; i < _vm->_scrollNum; i++) {
-		ex = _vm->_scroll[i].size() * 8;
+	for (int i = 0; i < _scrollNum; i++) {
+		ex = _scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
 	}
@@ -452,30 +452,30 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-	for (int i = 0; i < _vm->_scrollNum; i++) {
-		if (!_vm->_scroll[i].empty())
-			switch (_vm->_scroll[i][_vm->_scroll[i].size() - 1]) {
+	for (int i = 0; i < _scrollNum; i++) {
+		if (!_scroll[i].empty())
+			switch (_scroll[i][_scroll[i].size() - 1]) {
 			case kControlCenter:
 				centre = true;
-				_vm->_scroll[i].deleteLastChar();
+				_scroll[i].deleteLastChar();
 				break;
 			case kControlLeftJustified:
 				centre = false;
-				_vm->_scroll[i].deleteLastChar();
+				_scroll[i].deleteLastChar();
 				break;
 			case kControlQuestion:
 				_shadowBoxX = mx + lx;
 				_shadowBoxY = my + ly;
-				_vm->_scroll[i].setChar(' ', 0);
+				_scroll[i].setChar(' ', 0);
 				_vm->_graphics->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
 				_vm->_graphics->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
 				break;
 			}
 
 		if (centre)
-			say(320 - _vm->_scroll[i].size() * 4 + iconIndent, my, _vm->_scroll[i]);
+			say(320 - _scroll[i].size() * 4 + iconIndent, my, _scroll[i]);
 		else
-			say(mx + iconIndent, my, _vm->_scroll[i]);
+			say(mx + iconIndent, my, _scroll[i]);
 
 		my += 12;
 	}
@@ -499,9 +499,9 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
-	int16 yl = _vm->_scrollNum * 5;
-	for (int i = 0; i < _vm->_scrollNum; i++) {
-		uint16 textWidth = _vm->_scroll[i].size() * 8;
+	int16 yl = _scrollNum * 5;
+	for (int i = 0; i < _scrollNum; i++) {
+		uint16 textWidth = _scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
 	}
@@ -530,10 +530,10 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i < _vm->_scrollNum; i++) {
-		int16 x = xc + _vm->_talkX - _vm->_scroll[i].size() / 2 * 8;
-		bool offset = _vm->_scroll[i].size() % 2;
-		_vm->_graphics->drawScrollText(_vm->_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
+	for (int i = 0; i < _scrollNum; i++) {
+		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
+		bool offset = _scroll[i].size() % 2;
+		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
 	}
 
 	ringBell();
@@ -549,10 +549,10 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 }
 
 void Dialogs::reset() {
-	_vm->_scrollNum = 1;
+	_scrollNum = 1;
 	for (int i = 0; i < 15; i++) {
-		if (!_vm->_scroll[i].empty())
-			_vm->_scroll[i].clear();
+		if (!_scroll[i].empty())
+			_scroll[i].clear();
 	}
 }
 
@@ -591,16 +591,16 @@ void Dialogs::stripTrailingSpaces(Common::String &str) {
 }
 
 void Dialogs::solidify(byte n) {
-	if (!_vm->_scroll[n].contains(' '))
+	if (!_scroll[n].contains(' '))
 		return; // No spaces.
 
 	// So there MUST be a space there, somewhere...
 	do {
-		_vm->_scroll[n + 1] = _vm->_scroll[n][_vm->_scroll[n].size() - 1] + _vm->_scroll[n + 1];
-		_vm->_scroll[n].deleteLastChar();
-	} while (_vm->_scroll[n][_vm->_scroll[n].size() - 1] != ' ');
+		_scroll[n + 1] = _scroll[n][_scroll[n].size() - 1] + _scroll[n + 1];
+		_scroll[n].deleteLastChar();
+	} while (_scroll[n][_scroll[n].size() - 1] != ' ');
 
-	stripTrailingSpaces(_vm->_scroll[n]);
+	stripTrailingSpaces(_scroll[n]);
 }
 
 void Dialogs::callDialogDriver() {
@@ -641,7 +641,7 @@ void Dialogs::callDialogDriver() {
 		} else {
 			switch (_vm->_buffer[i]) {
 			case kControlParagraph:
-				if ((_vm->_scrollNum == 1) && (_vm->_scroll[0].empty()))
+				if ((_scrollNum == 1) && (_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -659,7 +659,7 @@ void Dialogs::callDialogDriver() {
 				_vm->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble:
-				if ((_vm->_scrollNum == 1) && (_vm->_scroll[0].empty()))
+				if ((_scrollNum == 1) && (_scroll[0].empty()))
 					break;
 
 				if (call_spriterun)
@@ -753,15 +753,15 @@ void Dialogs::callDialogDriver() {
 				_useIcon = _param;
 				break;
 			case kControlNewLine:
-				_vm->_scrollNum++;
+				_scrollNum++;
 				break;
 			case kControlQuestion:
 				if (call_spriterun)
 					_vm->spriteRun();
 				call_spriterun = false;
 
-				_vm->_scroll[_vm->_scrollNum] = kControlQuestion;
-				_vm->_scrollNum++;
+				_scroll[_scrollNum] = kControlQuestion;
+				_scrollNum++;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
 				reset();
@@ -771,14 +771,14 @@ void Dialogs::callDialogDriver() {
 				break;
 			case kControlInsertSpaces:
 				for (int j = 0; j < 9; j++)
-					_vm->_scroll[_vm->_scrollNum - 1] += ' ';
+					_scroll[_scrollNum - 1] += ' ';
 				break;
 			default: // Add new char.
-				if (_vm->_scroll[_vm->_scrollNum - 1].size() == 50) {
-					solidify(_vm->_scrollNum - 1);
-					_vm->_scrollNum++;
+				if (_scroll[_scrollNum - 1].size() == 50) {
+					solidify(_scrollNum - 1);
+					_scrollNum++;
 				}
-				_vm->_scroll[_vm->_scrollNum - 1] += _vm->_buffer[i];
+				_scroll[_scrollNum - 1] += _vm->_buffer[i];
 				break;
 			}
 		}
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index d3088ec..5e0a06a 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -96,9 +96,11 @@ private:
 
 	int16 _shadowBoxX, _shadowBoxY;
 	byte _currentFont; // Current font
+	Common::String _scroll[15];
 	Common::Point _dodgeCoord;
 	byte _param; // For using arguments code
 	byte _useIcon;
+	byte _scrollNum;
 	bool _scReturn;
 
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.


Commit: bc4a8f8671470a063e13f7b079b337d673207ffa
    https://github.com/scummvm/scummvm/commit/bc4a8f8671470a063e13f7b079b337d673207ffa
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T22:29:15-07:00

Commit Message:
AVALANCHE: _scrollNum is now a C index

Changed paths:
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 43b85cf..a07b0c6 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -409,9 +409,9 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
-	int16 ly = (_scrollNum) * 6;
+	int16 ly = (_scrollNum + 1) * 6;
 	int16 ex;
-	for (int i = 0; i < _scrollNum; i++) {
+	for (int i = 0; i <= _scrollNum; i++) {
 		ex = _scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
@@ -452,7 +452,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-	for (int i = 0; i < _scrollNum; i++) {
+	for (int i = 0; i <= _scrollNum; i++) {
 		if (!_scroll[i].empty())
 			switch (_scroll[i][_scroll[i].size() - 1]) {
 			case kControlCenter:
@@ -499,8 +499,8 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
-	int16 yl = _scrollNum * 5;
-	for (int i = 0; i < _scrollNum; i++) {
+	int16 yl = (_scrollNum + 1) * 5;
+	for (int i = 0; i <= _scrollNum; i++) {
 		uint16 textWidth = _scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
@@ -530,7 +530,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i < _scrollNum; i++) {
+	for (int i = 0; i <= _scrollNum; i++) {
 		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
 		bool offset = _scroll[i].size() % 2;
 		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
@@ -549,7 +549,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 }
 
 void Dialogs::reset() {
-	_scrollNum = 1;
+	_scrollNum = 0;
 	for (int i = 0; i < 15; i++) {
 		if (!_scroll[i].empty())
 			_scroll[i].clear();
@@ -612,7 +612,7 @@ void Dialogs::callDialogDriver() {
 	setReadyLight(0);
 	_scReturn = false;
 	bool mouthnext = false;
-	bool call_spriterun = true; // Only call sprite_run the FIRST time.
+	bool callSpriteRun = true; // Only call sprite_run the FIRST time.
 
 	switch (_vm->_buffer[_vm->_bufSize - 1]) {
 	case kControlToBuffer:
@@ -641,12 +641,12 @@ void Dialogs::callDialogDriver() {
 		} else {
 			switch (_vm->_buffer[i]) {
 			case kControlParagraph:
-				if ((_scrollNum == 1) && (_scroll[0].empty()))
+				if ((_scrollNum == 0) && (_scroll[0].empty()))
 					break;
 
-				if (call_spriterun)
+				if (callSpriteRun)
 					_vm->spriteRun();
-				call_spriterun = false;
+				callSpriteRun = false;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeNormal);
 
@@ -659,12 +659,12 @@ void Dialogs::callDialogDriver() {
 				_vm->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble:
-				if ((_scrollNum == 1) && (_scroll[0].empty()))
+				if ((_scrollNum == 0) && (_scroll[0].empty()))
 					break;
 
-				if (call_spriterun)
+				if (callSpriteRun)
 					_vm->spriteRun();
-				call_spriterun = false;
+				callSpriteRun = false;
 
 				if (_param == 0)
 					setBubbleStateNatural();
@@ -756,12 +756,12 @@ void Dialogs::callDialogDriver() {
 				_scrollNum++;
 				break;
 			case kControlQuestion:
-				if (call_spriterun)
+				if (callSpriteRun)
 					_vm->spriteRun();
-				call_spriterun = false;
+				callSpriteRun = false;
 
-				_scroll[_scrollNum] = kControlQuestion;
 				_scrollNum++;
+				_scroll[_scrollNum] = kControlQuestion;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
 				reset();
@@ -771,14 +771,14 @@ void Dialogs::callDialogDriver() {
 				break;
 			case kControlInsertSpaces:
 				for (int j = 0; j < 9; j++)
-					_scroll[_scrollNum - 1] += ' ';
+					_scroll[_scrollNum] += ' ';
 				break;
 			default: // Add new char.
-				if (_scroll[_scrollNum - 1].size() == 50) {
-					solidify(_scrollNum - 1);
+				if (_scroll[_scrollNum].size() == 50) {
+					solidify(_scrollNum);
 					_scrollNum++;
 				}
-				_scroll[_scrollNum - 1] += _vm->_buffer[i];
+				_scroll[_scrollNum] += _vm->_buffer[i];
 				break;
 			}
 		}


Commit: a06bbb4fe78fc9722fde2dbd7d3d39ec64430f7e
    https://github.com/scummvm/scummvm/commit/a06bbb4fe78fc9722fde2dbd7d3d39ec64430f7e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T22:31:13-07:00

Commit Message:
AVALANCHE: Rename _scrollNum to improve readibility

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index a07b0c6..f15216c 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -409,9 +409,9 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
-	int16 ly = (_scrollNum + 1) * 6;
+	int16 ly = (_maxLineNum + 1) * 6;
 	int16 ex;
-	for (int i = 0; i <= _scrollNum; i++) {
+	for (int i = 0; i <= _maxLineNum; i++) {
 		ex = _scroll[i].size() * 8;
 		if (lx < ex)
 			lx = ex;
@@ -452,7 +452,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 53;
 	}
 
-	for (int i = 0; i <= _scrollNum; i++) {
+	for (int i = 0; i <= _maxLineNum; i++) {
 		if (!_scroll[i].empty())
 			switch (_scroll[i][_scroll[i].size() - 1]) {
 			case kControlCenter:
@@ -499,8 +499,8 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 
 	CursorMan.showMouse(false);
 	int16 xl = 0;
-	int16 yl = (_scrollNum + 1) * 5;
-	for (int i = 0; i <= _scrollNum; i++) {
+	int16 yl = (_maxLineNum + 1) * 5;
+	for (int i = 0; i <= _maxLineNum; i++) {
 		uint16 textWidth = _scroll[i].size() * 8;
 		if (textWidth > xl)
 			xl = textWidth;
@@ -530,7 +530,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	// Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify().
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
-	for (int i = 0; i <= _scrollNum; i++) {
+	for (int i = 0; i <= _maxLineNum; i++) {
 		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
 		bool offset = _scroll[i].size() % 2;
 		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
@@ -549,7 +549,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 }
 
 void Dialogs::reset() {
-	_scrollNum = 0;
+	_maxLineNum = 0;
 	for (int i = 0; i < 15; i++) {
 		if (!_scroll[i].empty())
 			_scroll[i].clear();
@@ -641,7 +641,7 @@ void Dialogs::callDialogDriver() {
 		} else {
 			switch (_vm->_buffer[i]) {
 			case kControlParagraph:
-				if ((_scrollNum == 0) && (_scroll[0].empty()))
+				if ((_maxLineNum == 0) && (_scroll[0].empty()))
 					break;
 
 				if (callSpriteRun)
@@ -659,7 +659,7 @@ void Dialogs::callDialogDriver() {
 				_vm->_scrollBells++;
 				break; // #7 = "Bel"
 			case kControlSpeechBubble:
-				if ((_scrollNum == 0) && (_scroll[0].empty()))
+				if ((_maxLineNum == 0) && (_scroll[0].empty()))
 					break;
 
 				if (callSpriteRun)
@@ -753,15 +753,15 @@ void Dialogs::callDialogDriver() {
 				_useIcon = _param;
 				break;
 			case kControlNewLine:
-				_scrollNum++;
+				_maxLineNum++;
 				break;
 			case kControlQuestion:
 				if (callSpriteRun)
 					_vm->spriteRun();
 				callSpriteRun = false;
 
-				_scrollNum++;
-				_scroll[_scrollNum] = kControlQuestion;
+				_maxLineNum++;
+				_scroll[_maxLineNum] = kControlQuestion;
 
 				drawScroll(&Avalanche::Dialogs::scrollModeDialogue);
 				reset();
@@ -771,14 +771,14 @@ void Dialogs::callDialogDriver() {
 				break;
 			case kControlInsertSpaces:
 				for (int j = 0; j < 9; j++)
-					_scroll[_scrollNum] += ' ';
+					_scroll[_maxLineNum] += ' ';
 				break;
 			default: // Add new char.
-				if (_scroll[_scrollNum].size() == 50) {
-					solidify(_scrollNum);
-					_scrollNum++;
+				if (_scroll[_maxLineNum].size() == 50) {
+					solidify(_maxLineNum);
+					_maxLineNum++;
 				}
-				_scroll[_scrollNum] += _vm->_buffer[i];
+				_scroll[_maxLineNum] += _vm->_buffer[i];
 				break;
 			}
 		}
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 5e0a06a..a7eb231 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -100,7 +100,7 @@ private:
 	Common::Point _dodgeCoord;
 	byte _param; // For using arguments code
 	byte _useIcon;
-	byte _scrollNum;
+	byte _maxLineNum;
 	bool _scReturn;
 
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.


Commit: 63f43aa9590607e18157bb08c7f0de68ff8ae0a0
    https://github.com/scummvm/scummvm/commit/63f43aa9590607e18157bb08c7f0de68ff8ae0a0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-09-30T22:43:21-07:00

Commit Message:
AVALANCHE: Move some more variables out of Avalanche

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 3de2c7c..836864b 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -319,8 +319,7 @@ void AnimationType::stopWalk() {
 void AnimationType::chatter() {
 	_anim->_vm->_talkX = _x + _info._xLength / 2;
 	_anim->_vm->_talkY = _y;
-	_anim->_vm->_talkFontColor = _stat._fgBubbleCol;
-	_anim->_vm->_talkBackgroundColor = _stat._bgBubbleCol;
+	_anim->_vm->_graphics->setDialogColor(_stat._bgBubbleCol, _stat._fgBubbleCol);
 }
 
 void AnimationType::remove() {
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 06d7e68..845aa09 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -259,15 +259,12 @@ public:
 	bool _dropsOk;
 	bool _cheat; // CHECKME: Currently unused
 	bool _letMeOut;
+	byte _thinks;
+	bool _thinkThing;
 
 
 
-
-	byte _thinks;
-	bool _thinkThing;
 	int16 _talkX, _talkY;
-	Color _talkBackgroundColor, _talkFontColor;
-	byte _scrollBells; // no. of times to ring the bell
 	bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
 	// Called .free() for them in ~Gyro().
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index a9ec69f..292596b 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -95,7 +95,7 @@ typedef int8 TuneType[31];
 
 struct QuasipedType {
 	byte   _whichPed;
-	Color  _foregroundColor;
+	Color  _textColor;
 	Room   _room;
 	Color  _backgroundColor;
 	People _who;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index f15216c..551b45e 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -340,14 +340,14 @@ void Dialogs::scrollModeMusic() {
 }
 
 void Dialogs::resetScrollDriver() {
-	_vm->_scrollBells = 0;
+	_scrollBells = 0;
 	_currentFont = kFontStyleRoman;
 	_useIcon = 0;
 	_vm->_interrogation = 0; // Always reset after a scroll comes up.
 }
 
 void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
-	for (int i = 0; i < _vm->_scrollBells; i++)
+	for (int i = 0; i < _scrollBells; i++)
 		_vm->errorLed(); // Ring the bell "x" times.
 }
 
@@ -533,7 +533,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	for (int i = 0; i <= _maxLineNum; i++) {
 		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
 		bool offset = _scroll[i].size() % 2;
-		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor);
+		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_graphics->_talkFontColor);
 	}
 
 	ringBell();
@@ -559,8 +559,7 @@ void Dialogs::reset() {
 void Dialogs::setBubbleStateNatural() {
 	_vm->_talkX = 320;
 	_vm->_talkY = 200;
-	_vm->_talkBackgroundColor = kColorDarkgray;
-	_vm->_talkFontColor = kColorWhite;
+	_vm->_graphics->setDialogColor(kColorDarkgray, kColorWhite);
 }
 
 Common::String Dialogs::displayMoney() {
@@ -656,8 +655,8 @@ void Dialogs::callDialogDriver() {
 					return;
 				break;
 			case kControlBell:
-				_vm->_scrollBells++;
-				break; // #7 = "Bel"
+				_scrollBells++;
+				break;
 			case kControlSpeechBubble:
 				if ((_maxLineNum == 0) && (_scroll[0].empty()))
 					break;
@@ -682,9 +681,8 @@ void Dialogs::callDialogDriver() {
 					PedType *quasiPed = &_vm->_peds[_vm->kQuasipeds[_param - 10]._whichPed];
 					_vm->_talkX = quasiPed->_x;
 					_vm->_talkY = quasiPed->_y; // Position.
-
-					_vm->_talkFontColor = _vm->kQuasipeds[_param - 10]._foregroundColor;
-					_vm->_talkBackgroundColor = _vm->kQuasipeds[_param - 10]._backgroundColor; // Colors.
+					
+					_vm->_graphics->setDialogColor(_vm->kQuasipeds[_param - 10]._backgroundColor, _vm->kQuasipeds[_param - 10]._textColor);
 				} else {
 					_vm->errorLed(); // Not valid.
 					setBubbleStateNatural();
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index a7eb231..fec8429 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -102,6 +102,7 @@ private:
 	byte _useIcon;
 	byte _maxLineNum;
 	bool _scReturn;
+	byte _scrollBells; // no. of times to ring the bell
 
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
 	void scrollModeNormal();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 4db93c4..2d3d82e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -565,20 +565,20 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
 	_scrolls.copyFrom(_surface);
 
 	// The body of the bubble.
-	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _vm->_talkBackgroundColor);
-	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
+	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
+	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
 
 	// Top right corner of the bubble.
-	drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
+	drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
 	// Bottom right corner of the bubble.
-	drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
+	drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
 	// Top left corner of the bubble.
-	drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
+	drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
 	// Bottom left corner of the bubble.
-	drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
+	drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
-	drawTriangle(points, _vm->_talkBackgroundColor);
+	drawTriangle(points, _talkBackgroundColor);
 }
 
 // And set the background of the text to the desired color.
@@ -652,6 +652,11 @@ void GraphicManager::restoreScreen() {
 	refreshScreen();
 }
 
+void GraphicManager::setDialogColor(Color bg, Color text) {
+	_talkBackgroundColor = bg;
+	_talkFontColor = text;
+}
+
 // Original name background()
 void GraphicManager::setBackgroundColor(Color x) {
 	warning("STUB: setBackgroundColor(%d)", x);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 80724f8..c78ac56 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -58,6 +58,7 @@ public:
 class GraphicManager {
 public:
 	Graphics::Surface _surface;
+	Color _talkBackgroundColor, _talkFontColor;
 
 	GraphicManager(AvalancheEngine *vm);
 	~GraphicManager();
@@ -110,6 +111,7 @@ public:
 	void loadBackground(Common::File &file);
 	void refreshBackground();
 	void setBackgroundColor(Color x);
+	void setDialogColor(Color bg, Color text);
 
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
 


Commit: bfb28c7a399662bca7269f9e5dbc8788b7bb4d58
    https://github.com/scummvm/scummvm/commit/bfb28c7a399662bca7269f9e5dbc8788b7bb4d58
Author: uruk (koppirnyo at gmail.com)
Date: 2013-09-30T23:51:40-07:00

Commit Message:
AVALANCHE: Move drawSign() from Dialogs to Graphics. Implement it.

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 551b45e..9557b36 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -381,32 +381,6 @@ void Dialogs::getIcon(int16 x, int16 y, byte which) {
 	file.close();
 }
 
-void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
-	Common::File file;
-	Common::String filename = Common::String::format("%s.avd", fn.c_str());
-
-	if (!file.open(filename))
-		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
-
-#if 0
-	uint16 st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->cp) * _vm->pagetop);
-	byte bit;
-	for (uint16 i = 1; i <= yl; i++)
-		for (bit = 0; bit <= 3; bit++) {
-			port[0x3c4] = 2;
-			port[0x3ce] = 4;
-			port[0x3c5] = 1 << bit;
-			port[0x3cf] = bit;
-			blockread(f, mem[0xa000 * st + (i * 80)], xl);
-		}
-	bit = getpixel(0, 0);
-#endif
-
-	warning("STUB: Scrolls::drawSign()");
-
-	file.close();
-}
-
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
 	int16 ly = (_maxLineNum + 1) * 6;
@@ -438,11 +412,11 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		iconIndent = 0;
 		break; // No icon.
 	case 34:
-		drawSign("about", 28, 76, 15);
+		_vm->_graphics->drawSign("about", 28, 76, 15);
 		iconIndent = 0;
 		break;
 	case 35:
-		drawSign("gameover", 52, 59, 71);
+		_vm->_graphics->drawSign("gameover", 52, 59, 71);
 		iconIndent = 0;
 		break;
 	}
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index fec8429..19ee9e3 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -126,7 +126,6 @@ private:
 	void resetScrollDriver();
 	void ringBell(); // Original: dingdongbell
 	void getIcon(int16 x, int16 y, byte which);
-	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
 	void loadFont();
 
 	// From Visa:
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 2d3d82e..4435e59 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -560,6 +560,40 @@ void GraphicManager::drawReadyLight(Color color) {
 	_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 }
 
+void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
+	Common::File file;
+	Common::String filename = Common::String::format("%s.avd", fn.c_str());
+
+	if (!file.open(filename))
+		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
+
+	// I know it looks very similar to the loadPicture methods, but in truth it's the combination of the two.
+
+	uint16 width = xl * 8;
+	uint16 height = yl;
+
+	Graphics::Surface sign; // We make a Surface object for the picture itself.
+	sign.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
+	for (int y = 0; y < height; y++) {
+		for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order.
+			for (uint16 x = 0; x < width; x += 8) {
+				byte pixel = file.readByte();
+				for (int bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					if (pixelBit != 0)
+						*(byte *)sign.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+				}
+			}
+		}
+	}
+	
+	drawPicture(_scrolls, sign, kScreenWidth / 2 - width / 2, y);
+
+	file.close();
+}
+
 void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
 	// Backup the screen before drawing the bubble.
 	_scrolls.copyFrom(_surface);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index c78ac56..aa9c209 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -104,6 +104,7 @@ public:
 	void drawToolbar();
 	void drawCursor(byte pos);
 	void drawReadyLight(Color color);
+	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
 
 	void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
 


Commit: 8408fa46c73de4923e456ee13210f171953ad820
    https://github.com/scummvm/scummvm/commit/8408fa46c73de4923e456ee13210f171953ad820
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-01T00:40:41-07:00

Commit Message:
AVALANCHE: Implement Dialogs::displayQuestion(), repair setSeed() and getRandomNumber() calls.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 251cc0c..6451784 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -51,7 +51,9 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	_console = new AvalancheConsole(this);
 
 	_rnd = new Common::RandomSource("avalanche");
-	_rnd->setSeed(42);
+	TimeDate time;
+	_system->getTimeAndDate(time);
+	_rnd->setSeed(time.tm_sec + time.tm_min + time.tm_hour);
 
 	// Needed because of Lucerna::load_also()
 	for (int i = 0; i < 31; i++) {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 79f8953..4dac2cc 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1526,7 +1526,7 @@ void AvalancheEngine::newGame() {
 	_her = kPeoplePardon;
 	_it = Parser::kPardon;
 	_lastPerson = kPeoplePardon; // = Pardon?
-	_passwordNum = _rnd->getRandomNumber(30) + 1; //Random(30) + 1;
+	_passwordNum = _rnd->getRandomNumber(29) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
 	_avvyInBed = true;
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 8221484..e7314a0 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -66,8 +66,8 @@ void Closing::exitGame() {
 	_vm->_sound->stopSound();
 
 	getScreen(kScreenNagScreen);
-	byte nounId = _vm->_rnd->getRandomNumber(12);
-	byte verbId = _vm->_rnd->getRandomNumber(12);
+	byte nounId = _vm->_rnd->getRandomNumber(11);
+	byte verbId = _vm->_rnd->getRandomNumber(11);
 	Common::String result = nouns[nounId] + " will " + verbs[verbId] + " you";
 	putIn(result, 1628);
 	showScreen(); // No halt- it's already set up.
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 9557b36..c038304 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -34,6 +34,7 @@
 
 #include "common/textconsole.h"
 #include "common/file.h"
+#include "common/random.h"
 
 namespace Avalanche {
 
@@ -765,7 +766,17 @@ void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A
 
 bool Dialogs::displayQuestion(Common::String question) {
 	displayText(question + kControlNewLine + kControlQuestion);
-	warning("STUB: Dialogs::displayQuestion()");
+	
+	if (_scReturn && (_vm->_rnd->getRandomNumber(1) == 0)) { // Half-and-half chance.
+		Common::String tmpStr = Common::String::format("...Positive about that?%cI%c%c%c", kControlRegister, kControlIcon, kControlNewLine, kControlQuestion);
+		displayText(tmpStr); // Be annoying!
+		if (_scReturn && (_vm->_rnd->getRandomNumber(3) == 3)) { // Another 25% chance
+			// \? are used to avoid that ??! is parsed as a trigraph
+			tmpStr = Common::String::format("%c100%% certain\?\?!%c%c%c%c", kControlInsertSpaces, kControlInsertSpaces, kControlIcon, kControlNewLine, kControlQuestion);
+			displayText(tmpStr); // Be very annoying!
+		}
+	}
+
 	return _scReturn;
 }
 


Commit: bb8157772cca0f5c7192781a8816af35b09e88e2
    https://github.com/scummvm/scummvm/commit/bb8157772cca0f5c7192781a8816af35b09e88e2
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-01T00:57:41-07:00

Commit Message:
AVALANCHE: Rename getIcon() to drawIcon(), move it to Graphics from Dialogs, implement it. Repair Dialogs::scrollModeDialogue().

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index c038304..34c32c0 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -192,7 +192,7 @@ void Dialogs::scrollModeDialogue() {
 		cursorPos.y /= 2;
 
 		char inChar = 0;
-		if (event.type == Common::EVENT_KEYDOWN) {
+		if ((event.type == Common::EVENT_KEYDOWN) && (event.kbd.ascii <= 122) && (event.kbd.ascii >= 97)) {
 			inChar = (char)event.kbd.ascii;
 			Common::String temp(inChar);
 			temp.toUppercase();
@@ -363,25 +363,6 @@ void Dialogs::unDodgem() {
 		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
-void Dialogs::getIcon(int16 x, int16 y, byte which) {
-	Common::File file;
-
-	if (!file.open("icons.avd"))
-		error("AVALANCHE: Scrolls: File not found: icons.avd");
-
-	which--;
-	file.seek(which * 426);
-
-	byte *p = new byte[426];
-	file.read(p, 426);
-
-	//putimage(x, y, p, 0);
-	warning("STUB: Scrolls::getIcon()");
-
-	delete[] p;
-	file.close();
-}
-
 void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	int16 lx = 0;
 	int16 ly = (_maxLineNum + 1) * 6;
@@ -423,7 +404,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 	}
 
 	if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon.
-		getIcon(mx, my + ly / 2, _useIcon);
+		_vm->_graphics->drawIcon(mx, my + ly / 2, _useIcon);
 		iconIndent = 53;
 	}
 
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 19ee9e3..745169d 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -125,7 +125,6 @@ private:
 	void say(int16 x, int16 y, Common::String text);
 	void resetScrollDriver();
 	void ringBell(); // Original: dingdongbell
-	void getIcon(int16 x, int16 y, byte which);
 	void loadFont();
 
 	// From Visa:
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 4435e59..a7d9c39 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -594,6 +594,22 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	file.close();
 }
 
+void GraphicManager::drawIcon(int16 x, int16 y, byte which) {
+	Common::File file;
+
+	if (!file.open("icons.avd"))
+		error("AVALANCHE: Scrolls: File not found: icons.avd");
+
+	which--;
+	file.seek(which * 426);
+
+	Graphics::Surface icon = loadPictureGraphic(file);
+	drawPicture(_scrolls, icon, x, y);
+
+	icon.free();
+	file.close();
+}
+
 void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
 	// Backup the screen before drawing the bubble.
 	_scrolls.copyFrom(_surface);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index aa9c209..a09552f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -105,6 +105,7 @@ public:
 	void drawCursor(byte pos);
 	void drawReadyLight(Color color);
 	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
+	void drawIcon(int16 x, int16 y, byte which); // Draws an icon to the current scroll.
 
 	void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
 


Commit: f9a5eb4629472df1d1d8ba62f9c2e54f1c9a383a
    https://github.com/scummvm/scummvm/commit/f9a5eb4629472df1d1d8ba62f9c2e54f1c9a383a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T12:04:37-07:00

Commit Message:
AVALANCHE: Set private some more variables

Changed paths:
    engines/avalanche/animation.h
    engines/avalanche/avalanche.h
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h



diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index d5d8510..e880fbf 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -61,7 +61,6 @@ public:
 	Direction _facingDir;
 	byte _stepNum;
 	int16 _x, _y; // Current xy coords.
-	int16 _oldX[2], _oldY[2];  // Last xy coords.
 	int8 _moveX, _moveY; // Amount to move sprite by, each step.
 	byte _id;
 	bool _quick, _visible, _homing, _doCheck;
@@ -91,6 +90,8 @@ public:
 private:
 	Animation *_anim;
 
+	int16 _oldX[2], _oldY[2];  // Last xy coords.
+
 	bool checkCollision();
 	int8 getSign(int16 val);
 };
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 845aa09..6f03132 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -261,16 +261,12 @@ public:
 	bool _letMeOut;
 	byte _thinks;
 	bool _thinkThing;
-
-
-
 	int16 _talkX, _talkY;
 	bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
 	// Called .free() for them in ~Gyro().
-	int8 _scoreToDisplay[3];
+
 	byte _currentMouse; // current mouse-void
-	Common::String _verbStr; // what you can do with your object. :-)
 	Common::String *_also[31][2];
 	PedType _peds[15];
 	MagicType _magics[15];
@@ -361,6 +357,7 @@ private:
 	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	byte _roomCount[100]; // Add one to each every time you enter a room
 	Common::String _mouseText;
+	int8 _scoreToDisplay[3];
 
 	Common::File file;
 	Common::String readAlsoStringFromFile();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index f1c6389..a2670ed 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -265,26 +265,26 @@ void Menu::findWhatYouCanDoWithIt() {
 	case kObjectWine:
 	case kObjectPotion:
 	case kObjectInk:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeDrink;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeDrink;
 		break;
 	case kObjectBell:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeRing;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeRing;
 		break;
 	case kObjectChastity:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	case kObjectLute:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodePlay;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodePlay;
 		break;
 	case kObjectMushroom:
 	case kObjectOnion:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeEat;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeEat;
 		break;
 	case kObjectClothes:
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeWear;
 		break;
 	default:
-		_vm->_verbStr = kVerbCodeExam; // Anything else.
+		_verbStr = kVerbCodeExam; // Anything else.
 	}
 }
 
@@ -469,11 +469,11 @@ void Menu::setupMenuWith() {
 	if (_vm->_thinkThing) {
 		findWhatYouCanDoWithIt();
 
-		for (uint i = 0; i < _vm->_verbStr.size(); i++) {
+		for (uint i = 0; i < _verbStr.size(); i++) {
 			char vbchar;
 			Common::String verb;
 
-			_vm->_parser->verbOpt(_vm->_verbStr[i], verb, vbchar);
+			_vm->_parser->verbOpt(_verbStr[i], verb, vbchar);
 			_activeMenuItem.setupOption(verb, vbchar, "", true);
 		}
 
@@ -485,21 +485,21 @@ void Menu::setupMenuWith() {
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
 			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_vm->_lastPerson), 'G', "", true);
-			_vm->_verbStr = _vm->_verbStr + kVerbCodeGive;
+			_verbStr = _verbStr + kVerbCodeGive;
 		}
 	} else {
 		_activeMenuItem.setupOption("Examine", 'x', "", true);
 		_activeMenuItem.setupOption(Common::String("Talk to h") + selectGender(_vm->_thinks), 'T', "", true);
-		_vm->_verbStr = Common::String(kVerbCodeExam) + kVerbCodeTalk;
+		_verbStr = Common::String(kVerbCodeExam) + kVerbCodeTalk;
 		switch (_vm->_thinks) {
 		case kPeopleGeida:
 		case kPeopleArkata:
 			_activeMenuItem.setupOption("Kiss her", 'K', "", true);
-			_vm->_verbStr = _vm->_verbStr + kVerbCodeKiss;
+			_verbStr = _verbStr + kVerbCodeKiss;
 			break;
 		case kPeopleDogfood:
 			_activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_wonNim); // True if you HAVEN'T won.
-			_vm->_verbStr = _vm->_verbStr + kVerbCodePlay;
+			_verbStr = _verbStr + kVerbCodePlay;
 			break;
 		case kPeopleMalagauche: {
 			bool isSober = !_vm->_teetotal;
@@ -508,12 +508,12 @@ void Menu::setupMenuWith() {
 			_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
 			_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
 			_activeMenuItem.setupOption("Buy some mead", 'm', "", isSober);
-			_vm->_verbStr = _vm->_verbStr + 101 + 100 + 102 + 103 + 104;
+			_verbStr = _verbStr + 101 + 100 + 102 + 103 + 104;
 			}
 			break;
 		case kPeopleTrader:
 			_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_objects[kObjectOnion - 1]);
-			_vm->_verbStr = _vm->_verbStr + 105;
+			_verbStr = _verbStr + 105;
 			break;
 		}
 	}
@@ -622,12 +622,12 @@ void Menu::runMenuWith() {
 	if (_vm->_thinkThing) {
 		_vm->_parser->_thing += 49;
 
-		if (_vm->_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
+		if (_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
 			_vm->_parser->_person = _vm->_lastPerson;
 		else
 			_vm->_parser->_person = kPeoplePardon;
 	} else {
-		switch (_vm->_verbStr[_activeMenuItem._choiceNum]) {
+		switch (_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
 			_vm->_parser->_thing = 100;
 			_vm->callVerb(kVerbCodeBuy);
@@ -658,7 +658,7 @@ void Menu::runMenuWith() {
 			_vm->_subjectNum = 0;
 		}
 	}
-	_vm->callVerb((VerbCode)_vm->_verbStr[_activeMenuItem._choiceNum]);
+	_vm->callVerb((VerbCode)_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Menu::setup() {
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index eb357f5..ef74e73 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -139,6 +139,7 @@ private:
 //	static const Color kHighlightFontColor = kColorWhite;
 //	static const Color kDisabledColor = kColorDarkgray;
 
+	Common::String _verbStr; // what you can do with your object. :-)
 	bool _menuActive; // Kludge so we don't have to keep referring to the menu.
 
 	AvalancheEngine *_vm;


Commit: ce50d8698727bb22b33a86f0d804071247c53fe3
    https://github.com/scummvm/scummvm/commit/ce50d8698727bb22b33a86f0d804071247c53fe3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T12:58:01-07:00

Commit Message:
AVALANCHE: Remove useless variable, move variables to dialogs

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 6f03132..f024f24 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -273,13 +273,10 @@ public:
 	MagicType _portals[7];
 	FieldType _fields[30];
 	byte _fieldNum;
-	Common::String _flags;
 	Common::String _listen;
-	byte _cp, _ledStatus, _defaultLed;
+	byte _cp, _ledStatus;
 	FontType _font;
 	bool _alive;
-	byte _buffer[2000];
-	uint16 _bufSize;
 	int16 _underScroll; // Y-coord of just under the scroll text.
 	Common::String _roomnName; // Name of actual room
 	Common::String _subject; // What you're talking to them about.
@@ -357,6 +354,7 @@ private:
 	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	byte _roomCount[100]; // Add one to each every time you enter a room
 	Common::String _mouseText;
+	Common::String _flags;
 	int8 _scoreToDisplay[3];
 
 	Common::File file;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4dac2cc..0c5685b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -402,7 +402,6 @@ void AvalancheEngine::init() {
 	_cheat = false;
 	_cp = 0;
 	_ledStatus = 177;
-	_defaultLed = 2;
 	for (int i = 0; i < 3; i++)
 		_scoreToDisplay[i] = -1; // Impossible digits.
 	_holdTheDawn = false;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 34c32c0..f04c233 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -569,32 +569,30 @@ void Dialogs::callDialogDriver() {
 	bool mouthnext = false;
 	bool callSpriteRun = true; // Only call sprite_run the FIRST time.
 
-	switch (_vm->_buffer[_vm->_bufSize - 1]) {
+	switch (_buffer[_bufSize - 1]) {
 	case kControlToBuffer:
-		_vm->_bufSize--;
+		_bufSize--;
 		break; // ^D = (D)on't include pagebreak
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
 	default:
-		_vm->_buffer[_vm->_bufSize] = kControlParagraph;
-		_vm->_bufSize++;
+		_buffer[_bufSize] = kControlParagraph;
+		_bufSize++;
 	}
 
-	uint16 size = _vm->_bufSize;
-
-	for (uint16 i = 0; i < size; i++) {
+	for (uint16 i = 0; i < _bufSize; i++) {
 		if (mouthnext) {
-			if (_vm->_buffer[i] == kControlRegister)
+			if (_buffer[i] == kControlRegister)
 				_param = 0;
-			else if (('0' <= _vm->_buffer[i]) && (_vm->_buffer[i] <= '9'))
-				_param = _vm->_buffer[i] - 48;
-			else if (('A' <= _vm->_buffer[i]) && (_vm->_buffer[i] <= 'Z'))
-				_param = _vm->_buffer[i] - 55;
+			else if (('0' <= _buffer[i]) && (_buffer[i] <= '9'))
+				_param = _buffer[i] - 48;
+			else if (('A' <= _buffer[i]) && (_buffer[i] <= 'Z'))
+				_param = _buffer[i] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_vm->_buffer[i]) {
+			switch (_buffer[i]) {
 			case kControlParagraph:
 				if ((_maxLineNum == 0) && (_scroll[0].empty()))
 					break;
@@ -732,7 +730,7 @@ void Dialogs::callDialogDriver() {
 					solidify(_maxLineNum);
 					_maxLineNum++;
 				}
-				_scroll[_maxLineNum] += _vm->_buffer[i];
+				_scroll[_maxLineNum] += _buffer[i];
 				break;
 			}
 		}
@@ -740,8 +738,8 @@ void Dialogs::callDialogDriver() {
 }
 
 void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_vm->_bufSize = text.size();
-	memcpy(_vm->_buffer, text.c_str(), _vm->_bufSize);
+	_bufSize = text.size();
+	memcpy(_buffer, text.c_str(), _bufSize);
 	callDialogDriver();
 }
 
@@ -801,13 +799,14 @@ void Dialogs::displayMusicalScroll() {
 // From Visa:
 
 void Dialogs::unSkrimble() {
-	for (uint16  i = 0; i < _vm->_bufSize; i++)
-		_vm->_buffer[i] = (~(_vm->_buffer[i] - (i + 1))) % 256;
+	for (uint16  i = 0; i < _bufSize; i++)
+		_buffer[i] = (~(_buffer[i] - (i + 1))) % 256;
 }
 
 void Dialogs::doTheBubble() {
-	_vm->_buffer[_vm->_bufSize] = 2;
-	_vm->_bufSize++;
+	_buffer[_bufSize] = 2;
+	_bufSize++;
+	assert(_bufSize < 2000);
 }
 
 /**
@@ -848,8 +847,9 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 		::error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_vm->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_buffer, _vm->_bufSize);
+	_bufSize = sezfile.readUint16LE();
+	assert(_bufSize < 2000);
+	sezfile.read(_buffer, _bufSize);
 	sezfile.close();
 	unSkrimble();
 
@@ -884,8 +884,8 @@ void Dialogs::speak(byte who, byte subject) {
 		return;
 
 	indexfile.seek(idx_offset + subject * 2);
-	uint16 sez_offset = indexfile.readUint16LE();
-	if ((sez_offset == 0) || (indexfile.err()))
+	uint16 sezOffset = indexfile.readUint16LE();
+	if ((sezOffset == 0) || (indexfile.err()))
 		return;
 	indexfile.close();
 
@@ -893,9 +893,10 @@ void Dialogs::speak(byte who, byte subject) {
 	if (!sezfile.open("avalot.sez"))
 		error("AVALANCHE: Visa: File not found: avalot.sez");
 
-	sezfile.seek(sez_offset);
-	_vm->_bufSize = sezfile.readUint16LE();
-	sezfile.read(_vm->_buffer, _vm->_bufSize);
+	sezfile.seek(sezOffset);
+	_bufSize = sezfile.readUint16LE();
+	assert(_bufSize < 2000);
+	sezfile.read(_buffer, _bufSize);
 	sezfile.close();
 
 	unSkrimble();
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 745169d..9c70767 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -103,6 +103,8 @@ private:
 	byte _maxLineNum;
 	bool _scReturn;
 	byte _scrollBells; // no. of times to ring the bell
+	byte _buffer[2000];
+	uint16 _bufSize;
 
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
 	void scrollModeNormal();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index a2670ed..23c49cc 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -134,7 +134,6 @@ void MenuItem::display() {
 	for (int y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 
-	_dr->_vm->_defaultLed = 1;
 	_dr->_vm->_currentMouse = 177;
 
 	CursorMan.showMouse(true); // 4 = fletch
@@ -148,7 +147,6 @@ void MenuItem::wipe() {
 	_activeNow = false;
 	_dr->_menuActive = false;
 	_firstlix = false;
-	_dr->_vm->_defaultLed = 2;
 
 	CursorMan.showMouse(true);
 }


Commit: ae456719738cfbcfa5f756d0fd1cfc82a99057fd
    https://github.com/scummvm/scummvm/commit/ae456719738cfbcfa5f756d0fd1cfc82a99057fd
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T13:52:30-07:00

Commit Message:
AVALANCHE: More work on variables

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f024f24..cbbc469 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -277,46 +277,27 @@ public:
 	byte _cp, _ledStatus;
 	FontType _font;
 	bool _alive;
-	int16 _underScroll; // Y-coord of just under the scroll text.
-	Common::String _roomnName; // Name of actual room
-	Common::String _subject; // What you're talking to them about.
 	byte _subjectNum; // The same thing.
-	bool _keyboardClick; // Is a keyboard click noise wanted?
 	People _him, _her;
 	byte _it;
 	uint32 _roomTime; // Set to 0 when you enter a room, added to in every loop.
 
-	People _lastPerson; // Last person to have been selected using the People menu.
 	bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
-	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 	bool _isLoaded; // Is it a loaded gamestate?
 	bool _soundFx;
 
-	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
-	void setup();
-	void runAvalot();
-
-	void init();
 	void callVerb(VerbCode id);
 	void loadRoom(byte num);
-	void exitRoom(byte x);
-	void enterRoom(Room room, byte ped);
 	void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!!
-	void drawToolbar();
-	void drawScore();
 	void incScore(byte num); // Add on no. of points
-	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
 	void fxToggle();
 	void refreshObjectList();
-	void checkClick();
 	void errorLed();
 	void dusk();
 	void dawn();
 	void drawDirection(); // Draws the little icon at the left end of the text input field.
 	void gameOver();
 	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
-	void fixFlashers();
-	void loadAlso(byte num);
 
 	// There are two kinds of redraw: Major and Minor. Minor is what happens when you load a game, etc. Major redraws EVERYTHING.
 	void minorRedraw();
@@ -326,12 +307,13 @@ public:
 
 	Common::String intToStr(int32 num);
 
-	void resetVariables();
+
+
+
+
 	void newGame(); // This sets up the DNA for a completely new game.
-	void slowDown();
 	bool getFlag(char x);
 	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
-	void hangAroundForAWhile();
 	
 	Common::String getName(People whose);
 	byte getNameChar(People whose);
@@ -348,31 +330,45 @@ public:
 private:
 	static Room _whereIs[29];
 
+	// Will be used in dusk() and dawn().
+	bool _fxHidden;
 	bool _spludwickAtHome; // Is Spludwick at home?
+	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
+	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
 	byte _lastRoom;
 	byte _lastRoomNotMap;
-	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	byte _roomCount[100]; // Add one to each every time you enter a room
 	Common::String _mouseText;
 	Common::String _flags;
+	Common::String _roomnName; // Name of actual room
 	int8 _scoreToDisplay[3];
 
 	Common::File file;
 	Common::String readAlsoStringFromFile();
+
+	void runAvalot();
+	void init();
+	void setup();
 	void scram(Common::String &str);
 	void unScramble();
-
+	void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
 	void enterNewTown();
 	void findPeople(byte room);
 	void putGeidaAt(byte whichPed, byte ped);
 	void guideAvvy(Common::Point cursorPos);
-
-	// Will be used in dusk() and dawn().
-	bool _fxHidden;
-
-	int8 fades(int8 x);
 	void fadeOut(byte n);
 	void fadeIn(byte n);
+	void enterRoom(Room room, byte ped);
+	void exitRoom(byte x);
+	void drawToolbar();
+	void drawScore();
+	void useCompass(const Common::Point &cursorPos); // Click on the compass on the toolbar to control Avvy's movement.
+	void checkClick();
+	void fixFlashers();
+	void loadAlso(byte num);
+	void resetVariables();
+
+	int8 fades(int8 x);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0c5685b..29224c1 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1485,6 +1485,7 @@ void AvalancheEngine::resetVariables() {
 	_animation->resetVariables();
 	_sequence->resetVariables();
 	_background->resetVariables();
+	_menu->resetVariables();
 }
 
 void AvalancheEngine::newGame() {
@@ -1524,7 +1525,6 @@ void AvalancheEngine::newGame() {
 	_him = kPeoplePardon;
 	_her = kPeoplePardon;
 	_it = Parser::kPardon;
-	_lastPerson = kPeoplePardon; // = Pardon?
 	_passwordNum = _rnd->getRandomNumber(29) + 1; //Random(30) + 1;
 	_userMovesAvvy = false;
 	_doingSpriteRun = false;
@@ -1538,10 +1538,6 @@ void AvalancheEngine::newGame() {
 	spriteRun();
 }
 
-void AvalancheEngine::slowDown() {
-	warning("STUB: slowdown()");
-}
-
 bool AvalancheEngine::getFlag(char x) {
 	for (uint16 i = 0; i < _flags.size(); i++) {
 		if (_flags[i] == x)
@@ -1708,11 +1704,6 @@ Common::String AvalancheEngine::f5Does() {
 	return Common::String::format("%c", kVerbCodePardon); // If all else fails...
 }
 
-void AvalancheEngine::hangAroundForAWhile() {
-	for (int i = 0; i < 28; i++)
-		slowDown();
-}
-
 void AvalancheEngine::flipRoom(Room room, byte ped) {
 	assert((ped > 0) && (ped < 15));
 	if (!_alive) {
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index f04c233..926f662 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -354,12 +354,12 @@ void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
 
 void Dialogs::dodgem() {
 	_dodgeCoord = _vm->getMousePos();
-	g_system->warpMouse(_dodgeCoord.x, _vm->_underScroll); // Move the pointer off the scroll.
+	g_system->warpMouse(_dodgeCoord.x, _underScroll); // Move the pointer off the scroll.
 }
 
 void Dialogs::unDodgem() {
 	Common::Point actCoord = _vm->getMousePos();
-	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _vm->_underScroll))
+	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _underScroll))
 		g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position.
 }
 
@@ -436,7 +436,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
 		my += 12;
 	}
 
-	_vm->_underScroll = my * 2 + 6; // Multiplying because of the doubled screen height.
+	_underScroll = (my + 3) * 2; // Multiplying because of the doubled screen height.
 	ringBell();
 	
 	_vm->_dropsOk = false;
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 9c70767..9cd4e72 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -105,6 +105,7 @@ private:
 	byte _scrollBells; // no. of times to ring the bell
 	byte _buffer[2000];
 	uint16 _bufSize;
+	int16 _underScroll; // Y-coord of just under the scroll text.
 
 	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
 	void scrollModeNormal();
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 23c49cc..92949c5 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -478,11 +478,11 @@ void Menu::setupMenuWith() {
 		// We disable the "give" option if: (a), you haven't selected anybody, (b), the _person you've selected isn't in the room,
 		// or (c), the _person you've selected is YOU!
 
-		if ((_vm->_lastPerson == kPeopleAvalot) || (_vm->_lastPerson == _vm->_parser->kNothing)
-			|| (_vm->getRoom(_vm->_lastPerson) != _vm->_room))
+		if ((_lastPerson == kPeopleAvalot) || (_lastPerson == _vm->_parser->kNothing)
+			|| (_vm->getRoom(_lastPerson) != _vm->_room))
 			_activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
 		else {
-			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_vm->_lastPerson), 'G', "", true);
+			_activeMenuItem.setupOption(Common::String("Give to ") + _vm->getName(_lastPerson), 'G', "", true);
 			_verbStr = _verbStr + kVerbCodeGive;
 		}
 	} else {
@@ -611,7 +611,7 @@ void Menu::runMenuObjects() {
 
 void Menu::runMenuPeople() {
 	_vm->thinkAbout(people[_activeMenuItem._choiceNum], AvalancheEngine::kPerson);
-	_vm->_lastPerson = (People)people[_activeMenuItem._choiceNum];
+	_lastPerson = (People)people[_activeMenuItem._choiceNum];
 }
 
 void Menu::runMenuWith() {
@@ -621,7 +621,7 @@ void Menu::runMenuWith() {
 		_vm->_parser->_thing += 49;
 
 		if (_verbStr[_activeMenuItem._choiceNum] == kVerbCodeGive)
-			_vm->_parser->_person = _vm->_lastPerson;
+			_vm->_parser->_person = _lastPerson;
 		else
 			_vm->_parser->_person = kPeoplePardon;
 	} else {
@@ -771,4 +771,8 @@ bool Menu::isActive() {
 void Menu::init() {
 	_menuActive = false;
 }
+
+void Menu::resetVariables() {
+	_lastPerson = kPeoplePardon; // = Pardon?
+}
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index ef74e73..5de54a2 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -128,6 +128,7 @@ public:
 	void setup(); // Standard menu bar.
 	bool isActive();
 	void init();
+	void resetVariables();
 
 private:
 	static const byte kIndent = 5;
@@ -141,6 +142,7 @@ private:
 
 	Common::String _verbStr; // what you can do with your object. :-)
 	bool _menuActive; // Kludge so we don't have to keep referring to the menu.
+	People _lastPerson; // Last person to have been selected using the People menu.
 
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 2064fa7..beb683a 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -820,8 +820,6 @@ void Parser::parse() {
 	}
 
 	// Second parsing.
-	if (!_vm->_subject.empty())
-		_vm->_subject.clear();
 	_vm->_subjectNum = 0; // Find subject of conversation.
 
 	for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) {
@@ -1380,7 +1378,6 @@ void Parser::drink() {
 		_vm->_avvyInBed = true;
 		_vm->refreshObjectList();
 		_vm->dusk();
-		_vm->hangAroundForAWhile();
 		_vm->flipRoom(kRoomYours, 1);
 		_vm->_graphics->setBackgroundColor(kColorYellow);
 		_vm->_animation->_sprites[0]._visible = false;
@@ -2284,7 +2281,6 @@ void Parser::doThat() {
 			}
 		} else { // Default doodah.
 			_vm->dusk();
-			_vm->hangAroundForAWhile();
 			_vm->dawn();
 			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
 			_vm->_dialogs->displayText(tmpStr);
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index f20aa90..4ebf559 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -148,9 +148,7 @@ private:
 	void winSequence();
 	Common::String personSpeaks();
 	void heyThanks();
-
 	void wipeText();
-
 };
 
 } // End of namespace Avalanche


Commit: 199ba0ddf4ec0251c0e70bd56a8f4be0cb6282b7
    https://github.com/scummvm/scummvm/commit/199ba0ddf4ec0251c0e70bd56a8f4be0cb6282b7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T14:15:53-07:00

Commit Message:
AVALANCHE: Remove verbosity related to the use of Magics enum

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/enums.h
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 836864b..fd7da57 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -191,27 +191,27 @@ void AnimationType::walk() {
 		if ((magicColor != 255) & (!_anim->_vm->_doingSpriteRun)) {
 			MagicType *magic = &_anim->_vm->_magics[magicColor];
 			switch (magic->_operation) {
-			case AvalancheEngine::kMagicExclaim:
+			case kMagicExclaim:
 				bounce();
 				_anim->_mustExclaim = true;
 				_anim->_sayWhat = magic->_data;
 				break;
-			case AvalancheEngine::kMagicBounce:
+			case kMagicBounce:
 				bounce();
 				break;
-			case AvalancheEngine::kMagicTransport:
+			case kMagicTransport:
 				_anim->_vm->flipRoom((Room)(magic->_data >> 8), magic->_data & 0xff);
 				break;
-			case AvalancheEngine::kMagicUnfinished: {
+			case kMagicUnfinished: {
 				bounce();
 				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Dialogs::kControlBell, Dialogs::kControlCenter, Dialogs::kControlRoman);
 				_anim->_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
-			case AvalancheEngine::kMagicSpecial:
+			case kMagicSpecial:
 				_anim->callSpecial(magic->_data);
 				break;
-			case AvalancheEngine::kMagicOpenDoor:
+			case kMagicOpenDoor:
 				_anim->_vm->openDoor((Room)(magic->_data >> 8), magic->_data & 0xff, magicColor);
 				break;
 			}
@@ -427,66 +427,66 @@ void Animation::catacombMove(byte ped) {
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27);
 		break;
 	case 0x1: // no connection (wall + shield),
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x2: // wall with door
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door.
 		break;
 	case 0x3: // wall with door and shield
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 28); // ...shield.
 		break;
 	case 0x4: // no connection (wall + window),
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 4);  // ...window.
 		break;
 	case 0x5: // wall with door and window
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 4); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicNothing; // No door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicNothing; // No door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[4]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[1]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[4]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 27); // Wall, plus...
 		_vm->_background->draw(-1, -1, 29); // ...door, and...
 		_vm->_background->draw(-1, -1, 6); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing; // Sloping wall.
-		_vm->_magics[2]._operation = AvalancheEngine::kMagicSpecial; // Straight wall.
+		_vm->_magics[1]._operation = kMagicNothing; // Sloping wall.
+		_vm->_magics[2]._operation = kMagicSpecial; // Straight wall.
 		break;
 	}
 
@@ -494,90 +494,90 @@ void Animation::catacombMove(byte ped) {
 
 	switch ((here & 0xf0) >> 4) { // East
 	case 0: // no connection (wall)
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 18);
 		break;
 	case 0x1: // no connection (wall + window),
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 19); // ...window.
 		break;
 	case 0x2: // wall with door
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 20); // ...door.
 		break;
 	case 0x3: // wall with door and window
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 19); // ...door, and...
 		_vm->_background->draw(-1, -1, 20); // ...window.
 		break;
 	case 0x6: // no connection (wall + torches),
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // No door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicNothing; // No door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0x7: // wall with door and torches
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[4]._operation = kMagicBounce; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicNothing; // Straight wall.
+		_vm->_portals[6]._operation = kMagicSpecial; // Door.
 		_vm->_background->draw(-1, -1, 18); // Wall, plus...
 		_vm->_background->draw(-1, -1, 20); // ...door, and...
 		_vm->_background->draw(-1, -1, 17); // ...torches.
 		break;
 	case 0xf: // straight-through corridor.
-		_vm->_magics[4]._operation = AvalancheEngine::kMagicNothing; // Sloping wall.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicSpecial; // Straight wall.
-		_vm->_portals[6]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[4]._operation = kMagicNothing; // Sloping wall.
+		_vm->_magics[5]._operation = kMagicSpecial; // Straight wall.
+		_vm->_portals[6]._operation = kMagicNothing; // Door.
 		break;
 	}
 
 	switch ((here & 0xf00) >> 8) { // South
 	case 0: // No connection.
-		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[6]._operation = kMagicBounce;
+		_vm->_magics[11]._operation = kMagicBounce;
+		_vm->_magics[12]._operation = kMagicBounce;
 		break;
 	case 0x1:
 		_vm->_background->draw(-1, -1, 21);
 
 		if ((xy_uint16 == 2051) && (_vm->_geidaFollows))
-			_vm->_magics[12]._operation = AvalancheEngine::kMagicExclaim;
+			_vm->_magics[12]._operation = kMagicExclaim;
 		else
-			_vm->_magics[12]._operation = AvalancheEngine::kMagicSpecial; // Right exit south.
+			_vm->_magics[12]._operation = kMagicSpecial; // Right exit south.
 
-		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[6]._operation = kMagicBounce;
+		_vm->_magics[11]._operation = kMagicBounce;
 		break;
 	case 0x2:
 		_vm->_background->draw(-1, -1, 22);
-		_vm->_magics[6]._operation = AvalancheEngine::kMagicSpecial; // Middle exit south.
-		_vm->_magics[11]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[6]._operation = kMagicSpecial; // Middle exit south.
+		_vm->_magics[11]._operation = kMagicBounce;
+		_vm->_magics[12]._operation = kMagicBounce;
 		break;
 	case 0x3:
 		_vm->_background->draw(-1, -1, 23);
-		_vm->_magics[11]._operation = AvalancheEngine::kMagicSpecial; // Left exit south.
-		_vm->_magics[6]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_magics[12]._operation = AvalancheEngine::kMagicBounce;
+		_vm->_magics[11]._operation = kMagicSpecial; // Left exit south.
+		_vm->_magics[6]._operation = kMagicBounce;
+		_vm->_magics[12]._operation = kMagicBounce;
 		break;
 	}
 
 	switch ((here & 0xf000) >> 12) { // North
 	case 0: // No connection
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = kMagicBounce;
+		_vm->_portals[3]._operation = kMagicNothing; // Door.
 		break;
 	// LEFT handles:
 #if 0
@@ -589,8 +589,8 @@ void Animation::catacombMove(byte ped) {
 #endif
 	case 0x2:
 		_vm->_background->draw(-1, -1, 3);
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce; // Middle exit north.
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[0]._operation = kMagicBounce; // Middle exit north.
+		_vm->_portals[3]._operation = kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x3:
@@ -607,8 +607,8 @@ void Animation::catacombMove(byte ped) {
 #endif
 	case 0x5:
 		_vm->_background->draw(-1, -1, 2);
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce; // Middle exit north.
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_magics[0]._operation = kMagicBounce; // Middle exit north.
+		_vm->_portals[3]._operation = kMagicSpecial; // Door.
 		break;
 #if 0
 	case 0x6:
@@ -628,25 +628,25 @@ void Animation::catacombMove(byte ped) {
 		if (((here & 0xf000) >> 12) == 0x9)
 			_vm->_background->draw(-1, -1, 31);
 
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicSpecial; // Middle arch north.
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = kMagicSpecial; // Middle arch north.
+		_vm->_portals[3]._operation = kMagicNothing; // Door.
 		break;
 	// DECORATIONS:
 	case 0xd: // No connection + WINDOW
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = kMagicBounce;
+		_vm->_portals[3]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 13);
 		break;
 	case 0xe: // No connection + TORCH
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicBounce;
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicNothing; // Door.
+		_vm->_magics[0]._operation = kMagicBounce;
+		_vm->_portals[3]._operation = kMagicNothing; // Door.
 		_vm->_background->draw(-1, -1, 7);
 		break;
 	// Recessed door:
 	case 0xf:
-		_vm->_magics[0]._operation = AvalancheEngine::kMagicNothing; // Door to Geida's room.
+		_vm->_magics[0]._operation = kMagicNothing; // Door to Geida's room.
 		_vm->_background->draw(-1, -1, 0);
-		_vm->_portals[3]._operation = AvalancheEngine::kMagicSpecial; // Door.
+		_vm->_portals[3]._operation = kMagicSpecial; // Door.
 		break;
 	}
 
@@ -701,17 +701,17 @@ void Animation::callSpecial(uint16 which) {
 	case 1: // _vm->special 1: Room 22: top of stairs.
 		_vm->_background->draw(-1, -1, 0);
 		_vm->_brummieStairs = 1;
-		_vm->_magics[9]._operation = AvalancheEngine::kMagicNothing;
+		_vm->_magics[9]._operation = kMagicNothing;
 		_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
 		stopWalking();
 		_vm->_userMovesAvvy = false;
 		break;
 	case 2: // _vm->special 2: Room 22: bottom of stairs.
 		_vm->_brummieStairs = 3;
-		_vm->_magics[10]._operation = AvalancheEngine::kMagicNothing;
-		_vm->_magics[11]._operation = AvalancheEngine::kMagicExclaim;
+		_vm->_magics[10]._operation = kMagicNothing;
+		_vm->_magics[11]._operation = kMagicExclaim;
 		_vm->_magics[11]._data = 5;
-		_vm->_magics[3]._operation = AvalancheEngine::kMagicBounce; // Now works as planned!
+		_vm->_magics[3]._operation = kMagicBounce; // Now works as planned!
 		stopWalking();
 		_vm->_dialogs->displayScrollChain('q', 26);
 		_vm->_userMovesAvvy = true;
@@ -742,7 +742,7 @@ void Animation::callSpecial(uint16 which) {
 	case 5:
 		if (_vm->_friarWillTieYouUp) {
 			// _vm->special 5: Room 42: touched tree, and get tied up.
-			_vm->_magics[4]._operation = AvalancheEngine::kMagicBounce; // Boundary effect is now working again.
+			_vm->_magics[4]._operation = kMagicBounce; // Boundary effect is now working again.
 			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0].remove();
 			//tr[1].vanishifstill:=true;
@@ -766,7 +766,7 @@ void Animation::callSpecial(uint16 which) {
 		break;
 	case 7: // _vm->special 7: stop falling down oubliette.
 		_sprites[0]._visible = false;
-		_vm->_magics[9]._operation = AvalancheEngine::kMagicNothing;
+		_vm->_magics[9]._operation = kMagicNothing;
 		stopWalking();
 		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
 		//_vm->mblit(12, 80, 38, 160, 3, 0);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index cbbc469..d7941ee 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -169,17 +169,6 @@ public:
 	static const bool kThing = true;
 	static const bool kPerson = false;
 
-	// Magic/portal constants:
-	enum Magics {
-		kMagicNothing, // Ignore it if this line is touched.
-		kMagicBounce, // Bounce off this line. Not valid for portals.
-		kMagicExclaim, // Put up a chain of scrolls.
-		kMagicTransport, // Enter new room.
-		kMagicUnfinished, // Unfinished connection.
-		kMagicSpecial, // Special function.
-		kMagicOpenDoor // Opening door.
-	};
-
 	// These following static constants should be included in CFG when it's written.
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
@@ -306,19 +295,11 @@ public:
 	void spriteRun();
 
 	Common::String intToStr(int32 num);
-
-
-
-
-
 	void newGame(); // This sets up the DNA for a completely new game.
 	bool getFlag(char x);
 	bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
 	
 	Common::String getName(People whose);
-	byte getNameChar(People whose);
-	Common::String getThing(byte which);
-	char getThingChar(byte which);
 	Common::String getItem(byte which); // Called get_better in the original.
 	Common::String f5Does(); // This procedure determines what f5 does.
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 29224c1..4732bbb 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1572,65 +1572,6 @@ Common::String AvalancheEngine::getName(People whose) {
 		return kLasses[whose - kPeopleArkata];
 }
 
-byte AvalancheEngine::getNameChar(People whose) {
-	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
-	static const char kLassChar[] = "kG\0xB1o";
-
-	if (whose < kPeopleArkata)
-		return kLadChar[whose - kPeopleAvalot];
-	else
-		return kLassChar[whose - kPeopleArkata];
-}
-
-Common::String AvalancheEngine::getThing(byte which) {
-	static const Common::String kThings[kObjectNum] = {
-		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
-		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
-		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
-	};
-
-	Common::String get_thing_result;
-	switch (which) {
-	case kObjectWine:
-		switch (_wineState) {
-		case 1:
-		case 4:
-			get_thing_result = kThings[which - 1];
-			break;
-		case 3:
-			get_thing_result = "Vinegar";
-			break;
-		}
-		break;
-	case kObjectOnion:
-		if (_rottenOnion)
-			get_thing_result = "rotten onion";
-		else
-			get_thing_result = kThings[which - 1];
-		break;
-	default:
-		get_thing_result = kThings[which - 1];
-	}
-	return get_thing_result;
-}
-
-char AvalancheEngine::getThingChar(byte which) {
-	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
-
-	char get_thingchar_result;
-	switch (which) {
-	case kObjectWine:
-		if (_wineState == 3)
-			get_thingchar_result = 'V'; // Vinegar
-		else
-			get_thingchar_result = kThingsChar[which - 1];
-		break;
-	default:
-		get_thingchar_result = kThingsChar[which - 1];
-	}
-	return get_thingchar_result;
-}
-
 Common::String AvalancheEngine::getItem(byte which) {
 	static const Common::String kItems[kObjectNum] = {
 		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index e10033a..779bfb7 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -85,14 +85,25 @@ enum VerbCode {
 	kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253, kVerbCodePardon = 254
 };
 
-} // End of namespace Avalanche
-
 enum MouseCursor {
 	kCurUpArrow = 0,   kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5, 
 	kCurCrosshair = 6, kCurIBeam = 7
 };
 
+// Magic/portal constants:
+enum Magics {
+	kMagicNothing, // Ignore it if this line is touched.
+	kMagicBounce, // Bounce off this line. Not valid for portals.
+	kMagicExclaim, // Put up a chain of scrolls.
+	kMagicTransport, // Enter new room.
+	kMagicUnfinished, // Unfinished connection.
+	kMagicSpecial, // Special function.
+	kMagicOpenDoor // Opening door.
+};
+
 static const int16 kScreenWidth = 640;
 static const int16 kScreenHeight = 200;
 
+} // End of namespace Avalanche
+
 #endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 92949c5..2a3e3d9 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -444,7 +444,7 @@ void Menu::setupMenuPeople() {
 
 	for (int i = kPeopleAvalot; i <= kPeopleWisewoman; i++) {
 		if (_vm->getRoom((People)i) == _vm->_room) {
-			_activeMenuItem.setupOption(_vm->getName((People)i), _vm->getNameChar((People)i), "", true);
+			_activeMenuItem.setupOption(_vm->getName((People)i), getNameChar((People)i), "", true);
 			people += i;
 		}
 	}
@@ -456,7 +456,7 @@ void Menu::setupMenuObjects() {
 	_activeMenuItem.reset();
 	for (int i = 0; i < kObjectNum; i++) {
 		if (_vm->_objects[i])
-			_activeMenuItem.setupOption(_vm->getThing(i + 1), _vm->getThingChar(i + 1), "", true);
+			_activeMenuItem.setupOption(getThing(i + 1), getThingChar(i + 1), "", true);
 	}
 	_activeMenuItem.display();
 }
@@ -764,6 +764,65 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 	_vm->_graphics->removeBackup();
 }
 
+char Menu::getThingChar(byte which) {
+	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+
+	char result;
+	switch (which) {
+	case kObjectWine:
+		if (_vm->_wineState == 3)
+			result = 'V'; // Vinegar
+		else
+			result = kThingsChar[which - 1];
+		break;
+	default:
+		result = kThingsChar[which - 1];
+	}
+	return result;
+}
+
+byte Menu::getNameChar(People whose) {
+	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
+	static const char kLassChar[] = "kG\0xB1o";
+
+	if (whose < kPeopleArkata)
+		return kLadChar[whose - kPeopleAvalot];
+	else
+		return kLassChar[whose - kPeopleArkata];
+}
+
+Common::String Menu::getThing(byte which) {
+	static const Common::String kThings[kObjectNum] = {
+		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
+		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
+		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
+	};
+
+	Common::String result;
+	switch (which) {
+	case kObjectWine:
+		switch (_vm->_wineState) {
+	case 1:
+	case 4:
+		result = kThings[which - 1];
+		break;
+	case 3:
+		result = "Vinegar";
+		break;
+		}
+		break;
+	case kObjectOnion:
+		if (_vm->_rottenOnion)
+			result = "rotten onion";
+		else
+			result = kThings[which - 1];
+		break;
+	default:
+		result = kThings[which - 1];
+	}
+	return result;
+}
+
 bool Menu::isActive() {
 	return _menuActive;
 }
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index 5de54a2..a71093b 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -151,6 +151,10 @@ private:
 	void drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted);
 	void bleep();
 
+	char getThingChar(byte which);
+	byte getNameChar(People whose);
+	Common::String getThing(byte which);
+
 	void setupMenuGame();
 	void setupMenuFile();
 	void setupMenuAction();
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index beb683a..979c451 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -674,7 +674,7 @@ void Parser::storeInterrogation(byte interrogation) {
 		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
 		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
 		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing;
+		_vm->_magics[1]._operation = kMagicNothing;
 		_vm->_cardiffQuestionNum = 5;
 		break;
 	case 99:
@@ -1193,21 +1193,21 @@ void Parser::openDoor() {
 		if (_vm->_animation->inField(i + 8)) {
 			MagicType *portal = &_vm->_portals[i];
 			switch (portal->_operation) {
-			case AvalancheEngine::kMagicExclaim:
+			case kMagicExclaim:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
-			case AvalancheEngine::kMagicTransport:
+			case kMagicTransport:
 				_vm->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
 				break;
-			case AvalancheEngine::kMagicUnfinished:
+			case kMagicUnfinished:
 				_vm->_animation->_sprites[0].bounce();
 				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
 				break;
-			case AvalancheEngine::kMagicSpecial:
+			case kMagicSpecial:
 				_vm->_animation->callSpecial(portal->_data);
 				break;
-			case AvalancheEngine::kMagicOpenDoor:
+			case kMagicOpenDoor:
 				_vm->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9);
 				break;
 			}
@@ -2148,7 +2148,7 @@ void Parser::doThat() {
 				_vm->_objects[kObjectBolt - 1] = false;
 				_vm->_objects[kObjectCrossbow - 1] = false;
 				_vm->refreshObjectList();
-				_vm->_magics[11]._operation = AvalancheEngine::kMagicNothing;
+				_vm->_magics[11]._operation = kMagicNothing;
 				_vm->incScore(7);
 				_vm->_animation->_sprites[1].walkTo(1);
 				_vm->_animation->_sprites[1]._vanishIfStill = true;
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 1d145e4..ff5cf82 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -232,7 +232,7 @@ void Timer::openDrawbridge() {
 	_vm->_background->draw(-1, -1, _vm->_drawbridgeOpen - 2);
 
 	if (_vm->_drawbridgeOpen == 4)
-		_vm->_magics[1]._operation = AvalancheEngine::kMagicNothing; // You may enter the drawbridge.
+		_vm->_magics[1]._operation = kMagicNothing; // You may enter the drawbridge.
 	else
 		addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
 }
@@ -273,9 +273,9 @@ void Timer::stairs() {
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_background->draw(-1, -1, 1);
 	_vm->_brummieStairs = 2;
-	_vm->_magics[10]._operation = AvalancheEngine::kMagicSpecial;
+	_vm->_magics[10]._operation = kMagicSpecial;
 	_vm->_magics[10]._data = 2; // Reached the bottom of the stairs.
-	_vm->_magics[3]._operation = AvalancheEngine::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
+	_vm->_magics[3]._operation = kMagicNothing; // Stop them hitting the sides (or the game will hang.)
 }
 
 void Timer::cardiffSurvey() {
@@ -315,7 +315,7 @@ void Timer::getTiedUp() {
 void Timer::getTiedUp2() {
 	_vm->_animation->_sprites[0].walkTo(3);
 	_vm->_animation->_sprites[1].walkTo(4);
-	_vm->_magics[3]._operation = AvalancheEngine::kMagicNothing; // No effect when you touch the boundaries.
+	_vm->_magics[3]._operation = kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_friarWillTieYouUp = true;
 }
 
@@ -395,7 +395,7 @@ void Timer::jacquesWakesUp() {
 	case 2 : // Going through the door.
 		_vm->_background->draw(-1, -1, 1); // Not on the floor.
 		_vm->_background->draw(-1, -1, 2); // But going through the door.
-		_vm->_magics[5]._operation = AvalancheEngine::kMagicNothing; // You can't wake him up now.
+		_vm->_magics[5]._operation = kMagicNothing; // You can't wake him up now.
 		break;
 	case 3 :  // Gone through the door.
 		_vm->_background->draw(-1, -1, 1); // Not on the floor, either.
@@ -538,7 +538,7 @@ void Timer::greetsMonk() {
 }
 
 void Timer::fallDownOubliette() {
-	_vm->_magics[8]._operation = AvalancheEngine::kMagicNothing;
+	_vm->_magics[8]._operation = kMagicNothing;
 
 	AnimationType *avvy = &_vm->_animation->_sprites[0];
 	avvy->_moveY++; // Increments dx/dy!


Commit: c9432b8467ee5ef489a2d99f91edefb26dd31d60
    https://github.com/scummvm/scummvm/commit/c9432b8467ee5ef489a2d99f91edefb26dd31d60
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T14:23:07-07:00

Commit Message:
AVALANCHE: more work on variables

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index d7941ee..a54e092 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -179,9 +179,6 @@ public:
 	static const uint16 kNotes[12];
 	static const TuneType kTune;
 
-	static const char *kVersionNum;
-	static const char *kCopyright;
-
 	bool _holdLeftMouse;
 
 	// If this is greater than zero, the next line you type is stored in the DNA in a position dictated by the value.
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4732bbb..5ccb1ca 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -37,9 +37,6 @@
 
 namespace Avalanche {
 
-const char *AvalancheEngine::kVersionNum = "1.30";
-const char *AvalancheEngine::kCopyright = "1995";
-
 const MouseHotspotType AvalancheEngine::kMouseHotSpots[9] = {
 	{8,0}, // 0 - up-arrow
 	{0,0}, // 1 - screwdriver
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 979c451..cc65386 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -41,6 +41,9 @@
 
 namespace Avalanche {
 
+const char *Parser::kCopyright = "1995";
+const char *Parser::kVersionNum = "1.30";
+
 Parser::Parser(AvalancheEngine *vm) {
 	_vm = vm;
 }
@@ -1803,8 +1806,8 @@ void Parser::doThat() {
 		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
 			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
 			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
-			+ "version " + _vm->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
-			+ _vm->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+			+ "version " + kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
+			+ kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
 		_vm->_dialogs->displayText(toDisplay);
 		_vm->_dialogs->_aboutBox = false;
 		}
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 4ebf559..98adc3b 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -103,6 +103,9 @@ private:
 		Common::String _title;
 	};
 
+	static const char *kCopyright;
+	static const char *kVersionNum;
+
 	Common::String _thats;
 	byte _thing2;
 	byte _sworeNum; // number of times you've sworn


Commit: 5a4bd0d837a780be737a9c7d978d23a4c2954606
    https://github.com/scummvm/scummvm/commit/5a4bd0d837a780be737a9c7d978d23a4c2954606
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T14:31:31-07:00

Commit Message:
AVALANCHE: some more work on variables

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/avalot.h
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index a54e092..d68d837 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -162,9 +162,6 @@ private:
 #endif
 
 public:
-	static const MouseHotspotType kMouseHotSpots[9];
-	static const int16 kMaxSprites = 2; // Current max no. of sprites.
-
 	// For Thinkabout:
 	static const bool kThing = true;
 	static const bool kPerson = false;
@@ -306,6 +303,7 @@ public:
 	void setRoom(People persId, Room roomId);
 	Room getRoom(People persId);
 private:
+	static const int16 kMaxSprites = 2; // Current max no. of sprites.
 	static Room _whereIs[29];
 
 	// Will be used in dusk() and dawn().
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5ccb1ca..aa4f73d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -37,18 +37,6 @@
 
 namespace Avalanche {
 
-const MouseHotspotType AvalancheEngine::kMouseHotSpots[9] = {
-	{8,0}, // 0 - up-arrow
-	{0,0}, // 1 - screwdriver
-	{15,6}, // 2 - right-arrow
-	{0,0}, // 3 - fletch
-	{8,7}, // 4 - hourglass
-	{4,0}, // 5 - TTHand
-	{8,5}, // 6 - Mark's crosshairs
-	{8,7}, // 7 - I-beam
-	{0,0} // 8 - question mark
-};
-
 // Art gallery at 2,1; notice about this at 2,2.
 const int32 AvalancheEngine::kCatacombMap[8][8] = {
 	// Geida's room
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 292596b..5381edd 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -69,10 +69,6 @@ static const int16 kCarryLimit = 12;  // carry limit
 static const int16 kNumlockCode = 32;  // Code for Num Lock
 static const int16 kMouseSize = 134;
 
-struct MouseHotspotType { // mouse-void
-	int16 _horizontal, _vertical;
-};
-
 struct PedType {
 	int16 _x, _y;
 	Direction _direction;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a7d9c39..4c398df 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -38,6 +38,18 @@ namespace Avalanche {
 
 const byte GraphicManager::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
 
+const MouseHotspotType GraphicManager::kMouseHotSpots[9] = {
+	{8,0}, // 0 - up-arrow
+	{0,0}, // 1 - screwdriver
+	{15,6}, // 2 - right-arrow
+	{0,0}, // 3 - fletch
+	{8,7}, // 4 - hourglass
+	{4,0}, // 5 - TTHand
+	{8,5}, // 6 - Mark's crosshairs
+	{8,7}, // 7 - I-beam
+	{0,0} // 8 - question mark
+};
+
 GraphicManager::GraphicManager(AvalancheEngine *vm) {
 	_vm = vm;
 }
@@ -144,7 +156,7 @@ void GraphicManager::loadMouse(byte which) {
 	mask.free();
 	f.close();
 
-	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, AvalancheEngine::kMouseHotSpots[which]._horizontal, AvalancheEngine::kMouseHotSpots[which]._vertical * 2, 255, false);
+	CursorMan.replaceCursor(cursor.getPixels(), 16, 32, kMouseHotSpots[which]._horizontal, kMouseHotSpots[which]._vertical * 2, 255, false);
 	cursor.free();
 }
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index a09552f..b371074 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -55,8 +55,14 @@ public:
 	uint16 _size; // The size of one picture.
 };
 
+struct MouseHotspotType { // mouse-void
+	int16 _horizontal, _vertical;
+};
+
 class GraphicManager {
 public:
+	static const MouseHotspotType kMouseHotSpots[9];
+
 	Graphics::Surface _surface;
 	Color _talkBackgroundColor, _talkFontColor;
 


Commit: 546e911af998bb4948e4c930abfc731391d04509
    https://github.com/scummvm/scummvm/commit/546e911af998bb4948e4c930abfc731391d04509
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T22:25:20-07:00

Commit Message:
AVALANCHE: Use Doxygen comments in Animation

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index fd7da57..74307e7 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -40,6 +40,9 @@
 
 namespace Avalanche {
 
+/**
+ * Loads & sets up the sprite.
+ */
 void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	_anim = anim;
 
@@ -123,11 +126,19 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	inf.close();
 }
 
+/**
+ * Just sets 'quick' to false.
+ * @remarks	Originally called 'original'
+ */
 void AnimationType::reset() {
 	_quick = false;
 	_id = 177;
 }
 
+/**
+ * Drops sprite onto screen.
+ * @remarks	Originally called 'andexor'
+ */
 void AnimationType::draw() {
 	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
@@ -137,6 +148,9 @@ void AnimationType::draw() {
 	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
 
+/**
+ * Turns character round.
+ */
 void AnimationType::turn(Direction whichway) {
 	if (whichway == 8)
 		_facingDir = kDirUp;
@@ -144,6 +158,9 @@ void AnimationType::turn(Direction whichway) {
 		_facingDir = whichway;
 }
 
+/**
+ * Switches it on.
+ */
 void AnimationType::appear(int16 wx, int16 wy, Direction wf) {
 	_x = (wx / 8) * 8;
 	_y = wy;
@@ -169,6 +186,9 @@ bool AnimationType::checkCollision() {
 	return false;
 }
 
+/**
+ * Prepares for draw(), etc.
+ */
 void AnimationType::walk() {
 	if (!_anim->_vm->_doingSpriteRun) {
 		_oldX[_anim->_vm->_cp] = _x;
@@ -229,6 +249,9 @@ void AnimationType::walk() {
 	}
 }
 
+/**
+ * Bounces off walls
+ */
 void AnimationType::bounce() {
 	_x = _oldX[_anim->_vm->_cp];
 	_y = _oldY[_anim->_vm->_cp];
@@ -248,6 +271,9 @@ int8 AnimationType::getSign(int16 val) {
 		return 0;
 }
 
+/**
+ * Home in on a point.
+ */
 void AnimationType::walkTo(byte pedNum) {
 	PedType *curPed = &_anim->_vm->_peds[pedNum];
 
@@ -261,6 +287,9 @@ void AnimationType::stopHoming() {
 	_homing = false;
 }
 
+/**
+ * Calculates ix & iy for one homing step.
+ */
 void AnimationType::homeStep() {
 	int16 temp;
 
@@ -291,6 +320,9 @@ void AnimationType::homeStep() {
 	}
 }
 
+/**
+ * Sets ix & iy, non-homing, etc.
+ */
 void AnimationType::setSpeed(int8 xx, int8 yy) {
 	_moveX = xx;
 	_moveY = yy;
@@ -310,12 +342,18 @@ void AnimationType::setSpeed(int8 xx, int8 yy) {
 	}
 }
 
+/**
+ * Stops the sprite from moving.
+ */
 void AnimationType::stopWalk() {
 	_moveX = 0;
 	_moveY = 0;
 	_homing = false;
 }
 
+/**
+ * Sets up talk vars.
+ */
 void AnimationType::chatter() {
 	_anim->_vm->_talkX = _x + _info._xLength / 2;
 	_anim->_vm->_talkY = _y;
@@ -351,6 +389,10 @@ Animation::~Animation() {
 	}
 }
 
+/**
+ * Resets Animation variables.
+ * @remarks	Originally called 'loadtrip'
+ */
 void Animation::resetAnims() {
 	setDirection(kDirStopped);
 	for (int16 i = 0; i < kSpriteNumbMax; i++)
@@ -389,6 +431,11 @@ byte Animation::geidaPed(byte ped) {
 	}
 }
 
+/**
+ * When you enter a new position in the catacombs, this procedure should be
+ * called. It changes the 'also' codes so that they may match the picture
+ * on the screen.
+ */
 void Animation::catacombMove(byte ped) {
 	int32 here;
 	uint16 xy_uint16;
@@ -691,7 +738,9 @@ void Animation::catacombMove(byte ped) {
 	}
 }
 
-// This proc gets called whenever you touch a line defined as _vm->special.
+/**
+ * This proc gets called whenever you touch a line defined as _vm->special.
+ */
 void Animation::dawnDelay() {
 	_vm->_timer->addTimer(2, Timer::kProcDawnDelay, Timer::kReasonDawndelay);
 }
@@ -893,6 +942,9 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
 	setMoveSpeed(sprNum, curPed->_direction);
 }
 
+/**
+ * @remarks	Originally called 'follow_avvy_y'
+ */
 void Animation::followAvalotY(byte tripnum) {
 	if (_sprites[0]._facingDir == kDirLeft)
 		return;
@@ -1048,8 +1100,9 @@ void Animation::geidaProcs(byte tripnum) {
 		_sprites[tripnum]._moveX = 0;
 }
 
-// That's all...
-
+/**
+ * @remarks	Originally called 'call_andexors'
+ */
 void Animation::drawSprites() {
 	int8 order[5];
 	byte temp;
@@ -1167,6 +1220,9 @@ void Animation::hideInCupboard() {
 	}
 }
 
+/**
+ * Returns true if you're within field "which".
+ */
 bool Animation::inField(byte which) {
 	FieldType *curField = &_vm->_fields[which];
 	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
@@ -1174,6 +1230,9 @@ bool Animation::inField(byte which) {
 	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
+/**
+ * Returns True if you're near a door.
+ */
 bool Animation::nearDoor() {
 	if (_vm->_fieldNum < 8) {
 		// there ARE no doors here!
@@ -1192,6 +1251,9 @@ bool Animation::nearDoor() {
 	return false;
 }
 
+/**
+ * @remarks	Originally called 'tripkey'
+ */
 void Animation::handleMoveKey(const Common::Event &event) {
 	if (!_vm->_userMovesAvvy)
 		return;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index e880fbf..b975e03 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -72,19 +72,19 @@ public:
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
 
-	void init(byte spritenum, bool doCheck, Animation *anim); // Loads & sets up the sprite.
-	void reset(); // Just sets 'quick' to false. Original name: original().
-	void draw(); // Drops sprite onto screen. Original: andexor().
-	void turn(Direction whichway); // Turns character round.
-	void appear(int16 wx, int16 wy, Direction wf); // Switches it on.
-	void bounce(); // Bounces off walls.
-	void walk(); // Prepares for andexor, etc.
-	void walkTo(byte pednum); // Home in on a point.
-	void stopHoming(); // Self-explanatory.
-	void homeStep(); // Calculates ix & iy for one homing step.
-	void setSpeed(int8 xx, int8 yy); // Sets ix & iy, non-homing, etc.
-	void stopWalk(); // Stops the sprite from moving.
-	void chatter();  // Sets up talk vars.
+	void init(byte spritenum, bool doCheck, Animation *anim);
+	void reset();
+	void draw();
+	void turn(Direction whichway);
+	void appear(int16 wx, int16 wy, Direction wf);
+	void bounce();
+	void walk();
+	void walkTo(byte pednum);
+	void stopHoming();
+	void homeStep();
+	void setSpeed(int8 xx, int8 yy);
+	void stopWalk();
+	void chatter();
 	void remove();
 
 private:
@@ -113,23 +113,21 @@ public:
 	};
 
 	AnimationType _sprites[kSpriteNumbMax];
-	bool _mustExclaim;
-	uint16 _sayWhat;
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
 
 	void animLink();
-	void resetAnims(); // Original: loadtrip().
+	void resetAnims();
 	void callSpecial(uint16 which);
-	void catacombMove(byte ped); // When you enter a new position in the catacombs, this procedure should be called. It changes the 'also' codes so that they may match the picture on the screen.
+	void catacombMove(byte ped);
 	void stopWalking();
 	void setMoveSpeed(byte t, Direction dir);
 	void appearPed(byte sprNum, byte pedNum);
-	bool inField(byte which); // Returns true if you're within field "which".
-	bool nearDoor(); // Returns True if you're near a door.
+	bool inField(byte which);
+	bool nearDoor();
 	void updateSpeed();
-	void handleMoveKey(const Common::Event &event); // To replace tripkey().
+	void handleMoveKey(const Common::Event &event);
 	void hideInCupboard();
 
 	void setDirection(Direction dir);
@@ -143,8 +141,9 @@ private:
 	Direction _direction; // The direction Avvy is currently facing.
 	Direction _oldDirection;
 	bool _arrowTriggered; // And has the arrow been triggered?
-
+	bool _mustExclaim;
 	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
+	uint16 _sayWhat;
 
 	AvalancheEngine *_vm;
 
@@ -156,7 +155,7 @@ private:
 	void arrowProcs(byte tripnum);
 
 	// Different movements for NPCs:
-	void followAvalotY(byte tripnum); // Original: follow_avvy_y().
+	void followAvalotY(byte tripnum);
 	void backAndForth(byte tripnum);
 	void faceAvvy(byte tripnum);
 	
@@ -165,7 +164,7 @@ private:
 	void takeAStep(byte &tripnum);
 	void geidaProcs(byte tripnum);
 
-	void drawSprites(); // Original: call_andexors().
+	void drawSprites();
 };
 
 } // End of namespace Avalanche.


Commit: 4b93e2543548e994a2b8c25c6f1513d20b0beccf
    https://github.com/scummvm/scummvm/commit/4b93e2543548e994a2b8c25c6f1513d20b0beccf
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-01T22:26:17-07:00

Commit Message:
AVALANCHE: Repair shadowed variable.

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 4c398df..ff998a0 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -588,14 +588,14 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	sign.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Produce the picture. We read it in row-by-row, and every row has 4 planes.
-	for (int y = 0; y < height; y++) {
+	for (int yy = 0; yy < height; yy++) {
 		for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order.
-			for (uint16 x = 0; x < width; x += 8) {
+			for (uint16 xx = 0; xx < width; xx += 8) {
 				byte pixel = file.readByte();
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
 					if (pixelBit != 0)
-						*(byte *)sign.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+						*(byte *)sign.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
 				}
 			}
 		}


Commit: 8652224e58ba462763e80efe7f93d484380dd64e
    https://github.com/scummvm/scummvm/commit/8652224e58ba462763e80efe7f93d484380dd64e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-01T22:49:32-07:00

Commit Message:
AVALANCHE: Move ControlCharacter enum to enums

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/enums.h
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 74307e7..f415d90 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -224,7 +224,8 @@ void AnimationType::walk() {
 				break;
 			case kMagicUnfinished: {
 				bounce();
-				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", Dialogs::kControlBell, Dialogs::kControlCenter, Dialogs::kControlRoman);
+				Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!", 
+					kControlBell, kControlCenter, kControlRoman);
 				_anim->_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
@@ -452,7 +453,7 @@ void Animation::catacombMove(byte ped) {
 		return;
 	case 1033:{ // Oubliette
 		_vm->flipRoom(kRoomOubliette, 1);
-		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", kControlRegister, kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		return;
@@ -1198,7 +1199,7 @@ void Animation::stopWalking() {
 void Animation::hideInCupboard() {
 	if (_vm->_avvysInTheCupboard) {
 		if (_vm->_parser->_wearing == kObjectDummy) {
-			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", kControlItalic, kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
 			_sprites[0]._visible = true;
@@ -1213,7 +1214,7 @@ void Animation::hideInCupboard() {
 		_sprites[0]._visible = false;
 		_vm->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
-			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Dialogs::kControlParagraph);
+			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", kControlParagraph);
 		_vm->_dialogs->displayText(tmpStr);
 		_vm->_avvysInTheCupboard = true;
 		_vm->_background->draw(-1, -1, 7);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 6451784..26d7671 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -393,9 +393,9 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	_background->update();
 
 	Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.", 
-		Dialogs::kControlItalic, Dialogs::kControlRoman, description.c_str(), Dialogs::kControlCenter, 
-		Dialogs::kControlNewLine, Dialogs::kControlNewLine, _roomnName.c_str(), Dialogs::kControlNewLine, 
-		Dialogs::kControlNewLine, expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
+		kControlItalic, kControlRoman, description.c_str(), kControlCenter, kControlNewLine, 
+		kControlNewLine, _roomnName.c_str(), kControlNewLine, kControlNewLine, 
+		expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_dialogs->displayText(tmpStr);
 
 	AnimationType *avvy = &_animation->_sprites[0];
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index aa4f73d..4f30b82 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -178,7 +178,7 @@ void Clock::update() { // TODO: Move variables from Gyro to here (or at least so
 	if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
 		Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
 			"midnight. Are you having an all-night Avvy session? Glad you like the game that much!", 
-			Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			kControlNewLine, kControlNewLine);
 		_vm->_dialogs->displayText(tmpStr);
 	}
 	_oldHour = _hour;
@@ -1286,7 +1286,7 @@ void AvalancheEngine::checkClick() {
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
-				_mouseText.insertChar(Dialogs::kControlNewLine, 0);
+				_mouseText.insertChar(kControlNewLine, 0);
 		} else if (!_dropsOk)
 			_mouseText = Common::String(13) + _mouseText;
 	}
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 926f662..f3b2688 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -836,7 +836,7 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 
 	if (error) {
 		if (report) {
-			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", Dialogs::kControlBell, block, point);
+			Common::String todisplay = Common::String::format("%cError accessing scroll %c%d", kControlBell, block, point);
 			displayText(todisplay);
 		}
 		return;
@@ -928,7 +928,8 @@ void Dialogs::talkTo(byte whom) {
 				case 1: // Fallthrough is intended.
 				case 2: {
 					Common::String objStr = _vm->getItem(AvalancheEngine::kSpludwicksOrder[_vm->_givenToSpludwick]);
-					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+					Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", 
+						objStr.c_str(), kControlRegister, kControlSpeechBubble);
 					displayText(tmpStr);
 					}
 					return;
@@ -1002,7 +1003,7 @@ void Dialogs::talkTo(byte whom) {
 	bool noMatches = true;
 	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
-			Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, i + 49, Dialogs::kControlToBuffer);
+			Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, i + 49, kControlToBuffer);
 			displayText(tmpStr);
 			noMatches = false;
 			break;
@@ -1010,7 +1011,7 @@ void Dialogs::talkTo(byte whom) {
 	}
 
 	if (noMatches) {
-		Common::String tmpStr = Common::String::format("%c%c%c", Dialogs::kControlRegister, Dialogs::kControlRegister, Dialogs::kControlToBuffer);
+		Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, kControlRegister, kControlToBuffer);
 		displayText(tmpStr);
 	}
 
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 9cd4e72..94ffaf9 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -41,26 +41,6 @@ typedef void (Dialogs::*DialogFunctionType)();
 
 class Dialogs {
 public:
-	// Constants to replace the command characters from Pascal.
-	// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
-	enum ControlCharacter {
-		kControlSpeechBubble = 2, // ^B
-		kControlCenter = 3, // ^C
-		kControlToBuffer = 4, // ^D
-		kControlItalic = 6, // ^F
-		kControlBell = 7, // ^G
-		kControlBackspace = 8, // ^H
-		kControlInsertSpaces = 9, // ^I
-		kControlLeftJustified = 12, // ^L
-		kControlNewLine = 13, // ^M
-		kControlParagraph = 16, // ^P
-		kControlQuestion = 17, // ^Q
-		kControlRoman = 18, // ^R
-		kControlRegister = 19, // ^S
-		kControlNegative = 21, // ^U
-		kControlIcon = 22 // ^V
-	};
-
 	bool _aboutBox; // Is this the about box?
 	FontType _fonts[2];
 
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 779bfb7..155c9ac06 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -101,6 +101,26 @@ enum Magics {
 	kMagicOpenDoor // Opening door.
 };
 
+// Constants to replace the command characters from Pascal.
+// For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers
+enum ControlCharacter {
+	kControlSpeechBubble = 2, // ^B
+	kControlCenter = 3, // ^C
+	kControlToBuffer = 4, // ^D
+	kControlItalic = 6, // ^F
+	kControlBell = 7, // ^G
+	kControlBackspace = 8, // ^H
+	kControlInsertSpaces = 9, // ^I
+	kControlLeftJustified = 12, // ^L
+	kControlNewLine = 13, // ^M
+	kControlParagraph = 16, // ^P
+	kControlQuestion = 17, // ^Q
+	kControlRoman = 18, // ^R
+	kControlRegister = 19, // ^S
+	kControlNegative = 21, // ^U
+	kControlIcon = 22 // ^V
+};
+
 static const int16 kScreenWidth = 640;
 static const int16 kScreenHeight = 200;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index cc65386..115b566 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -867,7 +867,8 @@ void Parser::parse() {
 			_polite = true;
 	}
 
-	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
+	if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && 
+		(_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
 		Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
 		_vm->_dialogs->displayText(tmpStr);
 		_weirdWord = true;
@@ -1031,7 +1032,7 @@ void Parser::inventory() {
 	}
 
 	if (_wearing == kNothing)
-		tmpStr += Common::String::format("...%c%c...and you're stark naked!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+		tmpStr += Common::String::format("...%c%c...and you're stark naked!", kControlNewLine, kControlNewLine);
 	else
 		tmpStr += '.';
 
@@ -1249,7 +1250,8 @@ void Parser::putProc() {
 				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
 			else { // Put onion into wine?
 				if (_vm->_wineState != 3) {
-					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!",
+						kControlItalic, kControlRoman);
 					_vm->_dialogs->displayText(tmpStr);
 				} else { // Put onion into vinegar! Yes!
 					_vm->_onionInVinegar = true;
@@ -1311,7 +1313,7 @@ void Parser::putProc() {
 void Parser::notInOrder() {
 	Common::String itemStr = _vm->getItem(_vm->kSpludwicksOrder[_vm->_givenToSpludwick]);
 	Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \
-		"What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		"What I need next is %s%c2%c", itemStr.c_str(), kControlRegister, kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
 }
 
@@ -1512,7 +1514,7 @@ void Parser::getProc(char thing) {
  */
 void Parser::giveGeidaTheLute() {
 	if (_vm->_room != kRoomLustiesRoom) {
-		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+		Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", kControlRegister, kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		return;
 	}
@@ -1546,7 +1548,7 @@ Common::String Parser::personSpeaks() {
 	}
 
 	if (_vm->getRoom(_person) != _vm->_room) {
-		return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself!
+		return Common::String::format("%c1", kControlRegister); // Avvy himself!
 	}
 
 	bool found = false; // The _person we're looking for's code is in _person.
@@ -1554,7 +1556,7 @@ Common::String Parser::personSpeaks() {
 
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, '1' + i);
+			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
 			found = true;
 		}
 	}
@@ -1564,7 +1566,7 @@ Common::String Parser::personSpeaks() {
 
 	for (int i = 0; i < 16; i++) {
 		if ((_vm->kQuasipeds[i]._who == _person) && (_vm->kQuasipeds[i]._room == _vm->_room))
-			tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i);
+			tmpStr += Common::String::format("%c%c", kControlRegister, 'A' + i);
 	}
 
 	return tmpStr;
@@ -1572,7 +1574,7 @@ Common::String Parser::personSpeaks() {
 
 void Parser::heyThanks() {
 	Common::String tmpStr = personSpeaks();
-	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble);
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
 	_vm->_dialogs->displayText(tmpStr);
 	_vm->_objects[_thing - 1] = false;
 }
@@ -1601,7 +1603,8 @@ void Parser::doThat() {
 	&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
 	&& (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) {
 		if (!_vm->_alive) {
-			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!");
+			_vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? " \
+				"Try restarting, or restoring a saved game!");
 			return;
 		}
 		if (!_vm->_avvyIsAwake  && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
@@ -1617,8 +1620,11 @@ void Parser::doThat() {
 	case kVerbCodeOpen:
 		openDoor();
 		break;
-	case kVerbCodePause: { // Note that the original game doesn't care about the "O.K." box neither, it accepts clicks from everywhere on the screen to continue. Just like my code.
-		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the `O.K.\" box to continue.", Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+	case kVerbCodePause: { 
+		// Note that the original game doesn't care about the "O.K." box neither, it accepts
+		// clicks from everywhere on the screen to continue. Just like my code.
+		Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the `O.K.\" " \
+			"box to continue.", kControlCenter, kControlNewLine, kControlNewLine);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -1645,7 +1651,7 @@ void Parser::doThat() {
 	case kVerbCodeTalk:
 		if (_person == kPeoplePardon) {
 			if (_vm->_subjectNum == 99) { // They typed "say password".
-				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman);
+				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", kControlItalic, kControlRoman);
 				_vm->_dialogs->displayText(tmpStr);
 			} else if (((1 <= _vm->_subjectNum) && (_vm->_subjectNum <= 49)) || (_vm->_subjectNum == 253) || (_vm->_subjectNum == 249)) {
 				_thats.deleteChar(0);
@@ -1789,7 +1795,7 @@ void Parser::doThat() {
 		if (!_polite)
 			_vm->_dialogs->displayText("How about a `please\", Avvy?");
 		else {
-			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon);
+			Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", kControlRegister, kControlIcon);
 			if (_vm->_dialogs->displayQuestion(tmpStr))
 				_vm->_letMeOut = true;
 		}
@@ -1802,12 +1808,12 @@ void Parser::doThat() {
 
 		Common::String toDisplay;
 		for (int i = 0; i < 7; i++)
-			toDisplay += Dialogs::kControlNewLine;
-		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine
-			+ "The medi\x91val descendant of" + Dialogs::kControlNewLine
-			+ "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine
-			+ "version " + kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF "
-			+ kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon;
+			toDisplay += kControlNewLine;
+		toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + kControlCenter + kControlNewLine
+			+ "The medi\x91val descendant of" + kControlNewLine
+			+ "Denarius Avaricius Sextus" + kControlNewLine + kControlNewLine
+			+ "version " + kVersionNum + kControlNewLine + kControlNewLine + "Copyright \xEF "
+			+ kCopyright + ", Mark, Mike and Thomas Thurman." + kControlRegister + 'Y' + kControlIcon;
 		_vm->_dialogs->displayText(toDisplay);
 		_vm->_dialogs->_aboutBox = false;
 		}
@@ -1898,8 +1904,9 @@ void Parser::doThat() {
 					_vm->incScore(3); // 3 points for playing your 1st game.
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
-				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.")
-					+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
+				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", " \
+					"but I haven't implemented it yet: you win and get the lute automatically.")
+					+ kControlNewLine + kControlNewLine + "Peter (uruk)");
 				break;
 			case kRoomMusicRoom:
 				playHarp();
@@ -1966,12 +1973,12 @@ void Parser::doThat() {
 			_vm->_dialogs->displayText("Hmm, I don't think anyone will notice...");
 			_vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet);
 		} else {
-			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+			Common::String tmpStr = Common::String::format("It would be %cVERY%c unwise to do that here, Avvy!", kControlItalic, kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeCheat: {
-		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic);
+		Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", kControlItalic);
 		_vm->_dialogs->displayText(tmpStr);
 		_vm->_cheat = true;
 		}
@@ -2005,19 +2012,20 @@ void Parser::doThat() {
 		switch (_sworeNum) {
 		case 0: {
 			Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \
-				"(I shouldn't say it again, if I were you!)", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+				"(I shouldn't say it again, if I were you!)", kControlNewLine, kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
 			}
 			break;
 		case 1: {
 			Common::String tmpStr = Common::String::format("You hear a distant rumble of thunder. Must you always" \
-				"do things I tell you not to?%c%cDon't do it again!", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+				"do things I tell you not to?%c%cDon't do it again!", kControlNewLine, kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
 			}
 			break;
 		default: {
 			_vm->_pingo->zonk();
-			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine);
+			Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you." \
+				"%c%c(`Such is the anger of the gods, Avvy!\")", kControlNewLine, kControlNewLine);
 			_vm->_dialogs->displayText(tmpStr);
 			_vm->gameOver();
 			}
@@ -2055,7 +2063,7 @@ void Parser::doThat() {
 						_vm->incScore(3);
 
 					_vm->_background->draw(-1, -1, 11);
-					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble);
+					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + kControlRegister + '1' + kControlSpeechBubble);
 					_vm->_drinking = _thing;
 
 					_vm->_background->draw(-1, -1, 9);
@@ -2080,7 +2088,7 @@ void Parser::doThat() {
 						}
 
 						_vm->_background->draw(-1, -1, 11);
-						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+						Common::String tmpStr = Common::String::format("Wine, please.%c1%c", kControlRegister, kControlSpeechBubble);
 						_vm->_dialogs->displayText(tmpStr);
 						if (_alcoholLevel == 0)
 							_vm->incScore(3);
@@ -2199,7 +2207,9 @@ void Parser::doThat() {
 		_vm->gameOver();
 		break;
 	case kVerbCodeScore: {
-		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str());
+		Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%c " \
+			"This gives you a rank of %s.%c%c%s", _vm->_dnascore, kControlCenter, kControlNewLine, kControlNewLine, 
+			kControlNewLine, rank().c_str(), kControlNewLine, kControlNewLine, totalTime().c_str());
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -2266,7 +2276,7 @@ void Parser::doThat() {
 				break;
 			case kPeopleJacques: {
 				Common::String tmpStr = Common::String::format("Brother Jacques, Brother Jacques, are you asleep?%c1%c" \
-					"Hmmm... that doesn't seem to do any good...", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble);
+					"Hmmm... that doesn't seem to do any good...", kControlRegister, kControlSpeechBubble);
 				_vm->_dialogs->displayText(tmpStr);
 				}
 				break;
@@ -2285,7 +2295,7 @@ void Parser::doThat() {
 		} else { // Default doodah.
 			_vm->dusk();
 			_vm->dawn();
-			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph);
+			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", kControlParagraph);
 			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
@@ -2301,18 +2311,18 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeHello: {
 		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("Hello.%c", Dialogs::kControlSpeechBubble);
+		tmpStr += Common::String::format("Hello.%c", kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeThanks: {
 		Common::String tmpStr = personSpeaks();
-		tmpStr += Common::String::format("That's OK.%c", Dialogs::kControlSpeechBubble);
+		tmpStr += Common::String::format("That's OK.%c", kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	default:
-		Common::String tmpStr = Common::String::format("%cParser bug!", Dialogs::kControlBell);
+		Common::String tmpStr = Common::String::format("%cParser bug!", kControlBell);
 		_vm->_dialogs->displayText(tmpStr);
 	}
 }
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index ff5cf82..f345317 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -259,7 +259,7 @@ void Timer::toilet() {
 }
 
 void Timer::bang() {
-	Common::String tmpStr = Common::String::format("%c< BANG! >", Dialogs::kControlItalic);
+	Common::String tmpStr = Common::String::format("%c< BANG! >", kControlItalic);
 	_vm->_dialogs->displayText(tmpStr);
 	addTimer(30, kProcBang2, kReasonExplosion);
 }
@@ -360,8 +360,8 @@ void Timer::afterTheShootemup() {
 	_vm->refreshObjectList();
 
 	// Same as the added line above: TODO: Remove it later!!!
-	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
-		+ Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Peter (uruk)");
+	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", " \
+		"but I haven't implemented it yet: you get the crossbow automatically.") + kControlNewLine + kControlNewLine + "Peter (uruk)");
 
 #if 0
 	byte shootscore, gain;
@@ -548,7 +548,8 @@ void Timer::fallDownOubliette() {
 
 void Timer::meetAvaroid() {
 	if (_vm->_metAvaroid) {
-		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Dialogs::kControlItalic, Dialogs::kControlRoman);
+		Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!",
+			kControlItalic, kControlRoman);
 		_vm->_dialogs->displayText(tmpStr);
 		_vm->gameOver();
 	} else {
@@ -633,7 +634,7 @@ void Timer::avvySitDown() {
 
 void Timer::ghostRoomPhew() {
 	Common::String tmpStr = Common::String::format("%cPHEW!%c You're glad to get out of %cthere!",
-		Dialogs::kControlItalic, Dialogs::kControlRoman, Dialogs::kControlItalic);
+		kControlItalic, kControlRoman, kControlItalic);
 	_vm->_dialogs->displayText(tmpStr);
 }
 
@@ -669,11 +670,10 @@ void Timer::avalotFalls() {
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
 	} else {
 		Common::String toDisplay = Common::String::format("%c%c%c%c%c%c%c%c%c%c%c%c%cZ%c",
-			Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine,
-			Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine,
-			Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces,
-			Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces, Dialogs::kControlInsertSpaces,
-			Dialogs::kControlRegister, Dialogs::kControlIcon);
+			kControlNewLine, kControlNewLine, kControlNewLine, kControlNewLine,
+			kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlInsertSpaces,
+			kControlInsertSpaces, kControlInsertSpaces, kControlInsertSpaces,
+			kControlInsertSpaces, kControlRegister, kControlIcon);
 		_vm->_dialogs->displayText(toDisplay);
 	}
 }


Commit: 9093b2c258c9f39a594265fa856af1a62a2a283a
    https://github.com/scummvm/scummvm/commit/9093b2c258c9f39a594265fa856af1a62a2a283a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-02T12:56:01-07:00

Commit Message:
AVALANCHE: Use Doxygen comments in Dialogs, set private some members

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index f3b2688..fd2e47b 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -48,7 +48,11 @@ void Dialogs::init() {
 	resetScrollDriver();
 }
 
-void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
+/**
+ * Determine the color of the ready light and draw it
+ * @remarks	Originally called 'state'
+ */
+void Dialogs::setReadyLight(byte state) {
 	if (_vm->_ledStatus == state)
 		return; // Already like that!
 
@@ -63,7 +67,7 @@ void Dialogs::setReadyLight(byte state) {     // Sets "Ready" light to whatever
 		color = kColorGreen;
 		break; // Hit a key
 	}
-	warning("STUB: Scrolls::state()");
+	warning("STUB: Dialogs::setReadyLight()");
 
 	CursorMan.showMouse(false);
 	_vm->_graphics->drawReadyLight(color);
@@ -104,6 +108,10 @@ void Dialogs::say(int16 x, int16 y, Common::String z) {
 	}
 }
 
+/**
+ * One of the 3 "Mode" functions passed as ScrollsFunctionType parameters.
+ * @remarks	Originally called 'normscroll'
+ */
 void Dialogs::scrollModeNormal() {
 	// Original code is:
 	// egg : array[1..8] of char = ^P^L^U^G^H+'***';
@@ -124,11 +132,10 @@ void Dialogs::scrollModeNormal() {
 		_vm->_graphics->refreshScreen();
 
 		_vm->getEvent(event);
-		if (_vm->shouldQuit() || 
-			(event.type == Common::EVENT_LBUTTONUP) ||
-			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE)
-			|| (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH)
-			|| (event.kbd.keycode == Common::KEYCODE_PLUS))))
+		if ((event.type == Common::EVENT_LBUTTONUP) ||
+			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) ||
+			(event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) ||
+			(event.kbd.keycode == Common::KEYCODE_PLUS))))
 			break;
 	}
 
@@ -176,6 +183,11 @@ void Dialogs::scrollModeNormal() {
 	warning("STUB: Scrolls::scrollModeNormal()");
 }
 
+/**
+ * One of the 3 "Mode" functions passed as ScrollsFunctionType parameters.
+ * The "asking" scroll. Used indirectly in diplayQuestion().
+ * @remarks	Originally called 'dialogue'
+ */
 void Dialogs::scrollModeDialogue() {
 	_vm->_graphics->loadMouse(kCurHand);
 
@@ -232,6 +244,11 @@ bool Dialogs::theyMatch(TuneType &played) {
 	return mistakes < 5;
 }
 
+/**
+ * One of the 3 "Mode" functions passed as ScrollsFunctionType parameters.
+ * Part of the harp mini-game.
+ * @remarks	Originally called 'music_Scroll'
+ */
 void Dialogs::scrollModeMusic() {
 	setReadyLight(3);
 	_vm->_seeScroll = true;
@@ -347,16 +364,29 @@ void Dialogs::resetScrollDriver() {
 	_vm->_interrogation = 0; // Always reset after a scroll comes up.
 }
 
-void Dialogs::ringBell() {   // Pussy's in the well. Who put her in? Little...
+/**
+ * Rings the bell x times
+ * @remarks	Originally called 'dingdongbell'
+ */
+void Dialogs::ringBell() {
 	for (int i = 0; i < _scrollBells; i++)
-		_vm->errorLed(); // Ring the bell "x" times.
+		_vm->errorLed(); // Ring the bell "_scrollBells" times.
 }
 
+/**
+ * This moves the mouse pointer off the scroll so that you can read it.
+ * @remarks	Originally called 'dodgem'
+ */
 void Dialogs::dodgem() {
 	_dodgeCoord = _vm->getMousePos();
 	g_system->warpMouse(_dodgeCoord.x, _underScroll); // Move the pointer off the scroll.
 }
 
+/**
+ * This is the opposite of Dodgem.
+ * It moves the mouse pointer back, IF you haven't moved it in the meantime.
+ * @remarks	Originally called 'undodgem'
+ */
 void Dialogs::unDodgem() {
 	Common::Point actCoord = _vm->getMousePos();
 	if ((actCoord.x == _dodgeCoord.x) && (actCoord.y == _underScroll))
@@ -512,6 +542,10 @@ void Dialogs::reset() {
 	}
 }
 
+/**
+ * Natural state of bubbles
+ * @remarks	Originally called 'natural'
+ */
 void Dialogs::setBubbleStateNatural() {
 	_vm->_talkX = 320;
 	_vm->_talkY = 200;
@@ -540,11 +574,18 @@ Common::String Dialogs::displayMoney() {
 	return result;
 }
 
+/**
+ * Strip trailing character in a string
+ * @remarks	Originally called 'strip'
+ */
 void Dialogs::stripTrailingSpaces(Common::String &str) {
-	while (str[str.size() - 1] == ' ')
+	while (str.lastChar() == ' ')
 		str.deleteLastChar();
 }
 
+/**
+ * Does the word wrapping.
+ */
 void Dialogs::solidify(byte n) {
 	if (!_scroll[n].contains(' '))
 		return; // No spaces.
@@ -558,6 +599,9 @@ void Dialogs::solidify(byte n) {
 	stripTrailingSpaces(_scroll[n]);
 }
 
+/**
+ * @remarks	Originally called 'calldriver'
+ */
 void Dialogs::callDialogDriver() {
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
 	warning("STUB: Scrolls::calldrivers()");
@@ -737,6 +781,10 @@ void Dialogs::callDialogDriver() {
 	}
 }
 
+/**
+ * Display text by calling the dialog driver
+ * @remarks	Originally called 'display'
+ */
 void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
 	_bufSize = text.size();
 	memcpy(_buffer, text.c_str(), _bufSize);
@@ -784,6 +832,10 @@ void Dialogs::loadFont() {
 	file.close();
 }
 
+/**
+ * Practically this one is a mini-game which called when you play the harp in the monastery.
+ * @remarks	Originally called 'musical_scroll'
+ */
 void Dialogs::displayMusicalScroll() {
 	Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c", 
 		        kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
@@ -796,8 +848,6 @@ void Dialogs::displayMusicalScroll() {
 	reset();
 }
 
-// From Visa:
-
 void Dialogs::unSkrimble() {
 	for (uint16  i = 0; i < _bufSize; i++)
 		_buffer[i] = (~(_buffer[i] - (i + 1))) % 256;
@@ -1035,6 +1085,10 @@ void Dialogs::talkTo(byte whom) {
 	}
 }
 
+/**
+ * This makes Avalot say the response.
+ * @remarks	Originally called 'sayit'
+ */
 void Dialogs::sayIt(Common::String str) {
 	Common::String x = str;
 	x.setChar(toupper(x[0]), 0);
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 94ffaf9..d8c205a 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -41,28 +41,21 @@ typedef void (Dialogs::*DialogFunctionType)();
 
 class Dialogs {
 public:
-	bool _aboutBox; // Is this the about box?
+	bool _aboutBox; // Is this the about box? - Used in scrollModeNormal(), not yet fully implemented
 	FontType _fonts[2];
 
 	Dialogs(AvalancheEngine *vm);
 
 	void init();
-	void setReadyLight(byte state); // Sets "Ready" light to whatever.
-	void drawScroll(DialogFunctionType modeFunc);
-	void drawBubble(DialogFunctionType modeFunc);
 	void reset();
-	void callDialogDriver();
+	void setReadyLight(byte state);
 	void displayText(Common::String text);
 	bool displayQuestion(Common::String question);
-	void setBubbleStateNatural(); // Natural state of bubbles
-	Common::String displayMoney();
-	void displayMusicalScroll(); // Practically this one is a mini-game which called when you play the harp in the monastery.
-
-	// From Visa:
+	void setBubbleStateNatural();
+	void displayMusicalScroll();
 	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
 	void talkTo(byte whom);
-
-	void sayIt(Common::String str);  // This makes Avalot say the response.
+	void sayIt(Common::String str);
 
 private:
 	AvalancheEngine *_vm;
@@ -72,46 +65,44 @@ private:
 		kFontStyleItalic
 	};
 
-	static const int16 kHalfIconWidth = 19; // Half the width of an icon.
+	static const int16 kHalfIconWidth = 19;
 
-	int16 _shadowBoxX, _shadowBoxY;
-	byte _currentFont; // Current font
 	Common::String _scroll[15];
 	Common::Point _dodgeCoord;
-	byte _param; // For using arguments code
-	byte _useIcon;
 	byte _maxLineNum;
 	bool _scReturn;
+	bool _noError;
+	byte _currentFont;
+	byte _param; // For using arguments code
+	byte _useIcon;
 	byte _scrollBells; // no. of times to ring the bell
 	byte _buffer[2000];
 	uint16 _bufSize;
 	int16 _underScroll; // Y-coord of just under the scroll text.
+	int16 _shadowBoxX, _shadowBoxY;
 
-	// These 3 "Mode" functions are always passed as ScrollsFunctionType parameters.
+	void callDialogDriver();
+	void drawBubble(DialogFunctionType modeFunc);
+	void drawScroll(DialogFunctionType modeFunc);
 	void scrollModeNormal();
-	// The "asking" scroll. Used indirectly in diplayQuestion().
 	void scrollModeDialogue();
-	// Part of the harp mini-game.
 	void scrollModeMusic();
 
 	// These 2 are used only in musicalScroll().
 	void store(byte what, TuneType &played);
 	bool theyMatch(TuneType &played);
+	void stripTrailingSpaces(Common::String &str);
+	void solidify(byte n);
+	void dodgem();
+	void unDodgem();
 
-	void stripTrailingSpaces(Common::String &str); // Original: strip.
-	void solidify(byte n); // Does the word wrapping.
-
-	void dodgem(); // This moves the mouse pointer off the scroll so that you can read it.
-	void unDodgem(); // This is the opposite of Dodgem. It moves the mouse pointer back, IF you haven't moved it in the meantime.
-
+	Common::String displayMoney();
 	void easterEgg();
 	void say(int16 x, int16 y, Common::String text);
 	void resetScrollDriver();
-	void ringBell(); // Original: dingdongbell
+	void ringBell();
 	void loadFont();
 
-	// From Visa:
-	bool _noError;
 	void unSkrimble();
 	void doTheBubble();
 	void speak(byte who, byte subject);


Commit: efe6236e7ba901571123e11d4a2c9d36ba0a9069
    https://github.com/scummvm/scummvm/commit/efe6236e7ba901571123e11d4a2c9d36ba0a9069
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-02T14:39:18-07:00

Commit Message:
AVALANCHE: Make _surface private

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 4f30b82..8cc1191 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -198,7 +198,7 @@ void Clock::drawHand(const Common::Point &endPoint, Color color) {
 	if (endPoint.x == 177)
 		return;
 
-	_vm->_graphics->_surface.drawLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
+	_vm->_graphics->drawScreenLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
 }
 
 void Clock::plotHands() {
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index e72e4a4..99bb446 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -294,16 +294,9 @@ void Background::load(byte number) {
 			_sprites[i]._yl = sprite._yl;
 			_sprites[i]._type = sprite._type;
 
-			if (natural) {
-				_sprites[i]._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
-				_sprites[i]._size = _sprites[i]._xl * 8 * _sprites[i]._yl + 1;
-				_sprites[i]._picture.create(_sprites[i]._xl * 8, _sprites[i]._yl + 1, Graphics::PixelFormat::createFormatCLUT8());
-
-				for (uint16 y = 0; y < _sprites[i]._yl + 1; y++) {
-					for (uint16 x = 0; x < _sprites[i]._xl * 8; x++)
-						*(byte *)_sprites[i]._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(_sprites[i]._x * 8 + x, _sprites[i]._y + y);
-				}
-			} else {
+			if (natural)
+				_vm->_graphics->getNaturalPicture(_sprites[i]);
+			else {
 				_sprites[i]._size = sprite._size;
 				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
 			}
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index ff998a0..a733dfa 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -86,7 +86,11 @@ void GraphicManager::init() {
 	_scrolls.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
 }
 
-void GraphicManager::loadDigits(Common::File &file) {   // Load the scoring digits & rwlites
+/**
+ * Load the scoring digits & rwlites
+ * @remarks	Originally called 'load_digits'
+ */
+void GraphicManager::loadDigits(Common::File &file) {
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
@@ -512,6 +516,10 @@ void GraphicManager::setAlsoLine(int x1, int y1, int x2, int y2, Color color) {
 	_magics.drawLine(x1, y1, x2, y2, color);
 }
 
+void GraphicManager::drawScreenLine(int16 x, int16 y, int16 x2, int16 y2, Color color) {
+	_surface.drawLine(x, y, x2, y2, color);
+}
+
 byte GraphicManager::getAlsoColor(int x1, int y1, int x2, int y2) {
 	byte returnColor = 0;
 	for (int16 i = x1; i <= x2; i++) {
@@ -553,7 +561,7 @@ void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x,
 	}
 }
 
-void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY) {
+void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
 	for (uint16 y = 0; y < picture.h; y++) {
 		for (uint16 x = 0; x < picture.w; x++)
@@ -701,6 +709,16 @@ void GraphicManager::showScroll() {
 	_surface.copyFrom(_scrolls); // TODO: Rework it using getSubArea !!!!!!!
 }
 
+void GraphicManager::getNaturalPicture(SpriteType &sprite) {
+	sprite._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
+	sprite._size = sprite._xl * 8 * sprite._yl + 1;
+	sprite._picture.create(sprite._xl * 8, sprite._yl + 1, Graphics::PixelFormat::createFormatCLUT8());
+	for (uint16 y = 0; y < sprite._yl + 1; y++) {
+		for (uint16 x = 0; x < sprite._xl * 8; x++)
+			*(byte *)sprite._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(sprite._x * 8 + x, sprite._y + y);
+	}
+}
+
 void GraphicManager::saveScreen() {
 	_backup.copyFrom(_surface);
 }
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index b371074..8a9d26c 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -39,11 +39,7 @@ class AvalancheEngine;
 struct SpriteType;
 
 typedef byte FontType[256][16];
-
 typedef byte ManiType[2049];
-// manitype = array[5..2053] of byte;
-// Be aware!!!
-
 typedef byte SilType[51][11]; // 35, 4
 
 class SpriteInfo {
@@ -55,21 +51,19 @@ public:
 	uint16 _size; // The size of one picture.
 };
 
-struct MouseHotspotType { // mouse-void
+struct MouseHotspotType {
 	int16 _horizontal, _vertical;
 };
 
 class GraphicManager {
 public:
 	static const MouseHotspotType kMouseHotSpots[9];
-
-	Graphics::Surface _surface;
 	Color _talkBackgroundColor, _talkFontColor;
 
 	GraphicManager(AvalancheEngine *vm);
 	~GraphicManager();
 	void init();
-	void loadDigits(Common::File &file); // Load the scoring digits & rwlites
+	void loadDigits(Common::File &file);
 	void loadMouse(byte which);
 
 	void fleshColors();
@@ -104,7 +98,7 @@ public:
 	Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
+	void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
 
 	void drawThinkPic(Common::String filename, int id);
 	void drawToolbar();
@@ -112,6 +106,7 @@ public:
 	void drawReadyLight(Color color);
 	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
 	void drawIcon(int16 x, int16 y, byte which); // Draws an icon to the current scroll.
+	void drawScreenLine(int16 x, int16 y, int16 x2, int16 y2, Color color);
 
 	void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
 
@@ -122,25 +117,28 @@ public:
 	void setDialogColor(Color bg, Color text);
 
 	void zoomOut(int16 x, int16 y); // Only used when entering the map.
-
 	void showScroll();
 
+	void getNaturalPicture(SpriteType &sprite);
+
 	void saveScreen();
 	void removeBackup();
 	void restoreScreen();
+
 private:
 	static const uint16 kBackgroundWidth = kScreenWidth;
+	static const byte kEgaPaletteIndex[16];
 	static const byte kBackgroundHeight = 8 * 12080 / kScreenWidth; // With 640 width it's 151.
 	// The 8 = number of bits in a byte, and 12080 comes from Lucerna::load().
 
-	static const byte kEgaPaletteIndex[16];
 	Graphics::Surface _background;
-	Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
+	Graphics::Surface _backup;
 	Graphics::Surface _digits[10]; // digitsize and rwlitesize are defined in loadDigits() !!!
 	Graphics::Surface _directions[9]; // Maybe it will be needed to move them to the class itself instead.
+	Graphics::Surface _magics; // Lucerna::draw_also_lines() draws the "magical" lines here. Further information: https://github.com/urukgit/avalot/wiki/Also
 	Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
 	Graphics::Surface _scrolls;
-	Graphics::Surface _backup;
+	Graphics::Surface _surface;
 	byte _egaPalette[64][3];
 
 	AvalancheEngine *_vm;


Commit: 26626125d983d62132afb4b8649f65c11adfb565
    https://github.com/scummvm/scummvm/commit/26626125d983d62132afb4b8649f65c11adfb565
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-02T22:14:36-07:00

Commit Message:
AVALANCHE: Use Doxygen comments in Graphics

Changed paths:
    engines/avalanche/background.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 99bb446..cb280ba 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -298,7 +298,7 @@ void Background::load(byte number) {
 				_vm->_graphics->getNaturalPicture(_sprites[i]);
 			else {
 				_sprites[i]._size = sprite._size;
-				_sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
+				_sprites[i]._picture = _vm->_graphics->loadPictureRaw(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
 			}
 		} else
 			_sprites[i]._x = kOnDisk;
@@ -339,7 +339,7 @@ void Background::draw(int16 destX, int16 destY, byte sprId) {
 		sprite._yl = f.readSint16LE();
 		sprite._size = f.readSint32LE();
 		f.skip(2); // Natural and Memorize are used in Load()
-		sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
+		sprite._picture = _vm->_graphics->loadPictureRaw(f, sprite._xl * 8, sprite._yl + 1);
 
 		if (destX < 0) {
 			destX = sprite._x * 8;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a733dfa..5e17dcd 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -455,8 +455,10 @@ void GraphicManager::drawDebugLines() {
 	}
 }
 
+/**
+ * This function mimics Pascal's getimage().
+ */
 Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
-	// This function mimics Pascal's getimage().
 	// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
 	uint16 width = file.readUint16LE() + 1;
 	uint16 height = file.readUint16LE() + 1;
@@ -480,11 +482,13 @@ Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
 	return picture;
 }
 
-Graphics::Surface GraphicManager::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
-	// This function is our own creation, very much like the one above. The main differences are that
-	// we don't read the width and the height from the file, the planes are in a different order
-	// and we read the picture plane-by-plane.
-
+/**
+ * Reads Row-planar EGA data.
+ * This function is our own creation, very much like the one above. The main differences are that
+ * we don't read the width and the height from the file, the planes are in a different order
+ * and we read the picture plane-by-plane.
+ */
+Graphics::Surface GraphicManager::loadPictureRaw(Common::File &file, uint16 width, uint16 height) {
 	Graphics::Surface picture;
 	picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
 
@@ -580,6 +584,9 @@ void GraphicManager::drawReadyLight(Color color) {
 	_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
 }
 
+/**
+ * This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
+ */
 void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	Common::File file;
 	Common::String filename = Common::String::format("%s.avd", fn.c_str());
@@ -588,7 +595,6 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 		error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
 
 	// I know it looks very similar to the loadPicture methods, but in truth it's the combination of the two.
-
 	uint16 width = xl * 8;
 	uint16 height = yl;
 
@@ -614,6 +620,10 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
 	file.close();
 }
 
+/**
+ * Draws an icon to the current scroll.
+ * @remarks	Originally called 'geticon'
+ */
 void GraphicManager::drawIcon(int16 x, int16 y, byte which) {
 	Common::File file;
 
@@ -638,20 +648,19 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
 	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
 	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
 
-	// Top right corner of the bubble.
+	// Top the 4 rounded corners of the bubble.
 	drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
-	// Bottom right corner of the bubble.
 	drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
-	// Top left corner of the bubble.
 	drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
-	// Bottom left corner of the bubble.
 	drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
 	drawTriangle(points, _talkBackgroundColor);
 }
 
-// And set the background of the text to the desired color.
+/** 
+ * Set the background of the text to the desired color.
+ */
 void GraphicManager::wipeChar(int x, int y, Color color) {
 	for (int k = 0; k < 8; k++)
 		*(byte *)_surface.getBasePtr(x + k, y) = color;
@@ -679,13 +688,17 @@ void GraphicManager::refreshScreen() {
 }
 
 void GraphicManager::loadBackground(Common::File &file) {
-	_background = loadPictureRow(file, kBackgroundWidth, kBackgroundHeight);
+	_background = loadPictureRaw(file, kBackgroundWidth, kBackgroundHeight);
 }
 
 void GraphicManager::refreshBackground() {
 	drawPicture(_surface, _background, 0, 10);
 }
 
+/**
+ * Only used when entering the map.
+ * @remarks	Originally called 'zoomout'
+ */
 void GraphicManager::zoomOut(int16 x, int16 y) {
 	//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 8a9d26c..9930e28 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -95,30 +95,26 @@ public:
 
 	// The caller has to .free() the returned Surfaces!!!
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
-	Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
+	Graphics::Surface loadPictureRaw(Common::File &file, uint16 width, uint16 height);
 
 	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
-	void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
-
+	void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
 	void drawThinkPic(Common::String filename, int id);
 	void drawToolbar();
 	void drawCursor(byte pos);
 	void drawReadyLight(Color color);
-	void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
-	void drawIcon(int16 x, int16 y, byte which); // Draws an icon to the current scroll.
+	void drawSign(Common::String name, int16 xl, int16 yl, int16 y);
+	void drawIcon(int16 x, int16 y, byte which);
 	void drawScreenLine(int16 x, int16 y, int16 x2, int16 y2, Color color);
-
 	void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
-
 	void refreshScreen();
 	void loadBackground(Common::File &file);
 	void refreshBackground();
 	void setBackgroundColor(Color x);
 	void setDialogColor(Color bg, Color text);
 
-	void zoomOut(int16 x, int16 y); // Only used when entering the map.
+	void zoomOut(int16 x, int16 y);
 	void showScroll();
-
 	void getNaturalPicture(SpriteType &sprite);
 
 	void saveScreen();


Commit: 2d8fa4fdad188470a11db19e188d0283ed057f42
    https://github.com/scummvm/scummvm/commit/2d8fa4fdad188470a11db19e188d0283ed057f42
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-02T22:49:29-07:00

Commit Message:
AVALANCHE: Set some variables private in Menu

Changed paths:
    engines/avalanche/menu.cpp
    engines/avalanche/menu.h



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 2a3e3d9..146a743 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -74,12 +74,12 @@ bool HeadType::parseAltTrigger(char key) {
 	return false;
 }
 
-void MenuItem::init(Menu *dr) {
-	_dr = dr;
+void MenuItem::init(Menu *menu) {
+	_menu = menu;
 
 	_activeNow = false;
 	_activeNum = 1;
-	_dr->_menuActive = false;
+	_menu->_menuActive = false;
 }
 
 void MenuItem::reset() {
@@ -114,8 +114,8 @@ void MenuItem::displayOption(byte y, bool highlit) {
 	else
 		backgroundColor = kColorLightgray;
 
-	_dr->_vm->_graphics->drawMenuBlock((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10, backgroundColor);
-	_dr->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
+	_menu->_vm->_graphics->drawMenuBlock((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10, backgroundColor);
+	_menu->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit);
 }
 
 void MenuItem::display() {
@@ -126,15 +126,15 @@ void MenuItem::display() {
 	_flx2 = _left + _width;
 	_fly = 15 + _optionNum * 10;
 	_activeNow = true;
-	_dr->_menuActive = true;
+	_menu->_menuActive = true;
 
-	_dr->_vm->_graphics->drawMenuItem((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly);
+	_menu->_vm->_graphics->drawMenuItem((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly);
 
 	displayOption(0, true);
 	for (int y = 1; y < _optionNum; y++)
 		displayOption(y, false);
 
-	_dr->_vm->_currentMouse = 177;
+	_menu->_vm->_currentMouse = 177;
 
 	CursorMan.showMouse(true); // 4 = fletch
 }
@@ -142,10 +142,12 @@ void MenuItem::display() {
 void MenuItem::wipe() {
 	CursorMan.showMouse(false);
 
-	_dr->drawMenuText(_dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._xpos, 1, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._trigger, _dr->_menuBar._menuItems[_dr->_activeMenuItem._activeNum]._title, true, false);
+	_menu->drawMenuText(_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._xpos, 1, 
+		_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._trigger, 
+		_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._title, true, false);
 
 	_activeNow = false;
-	_dr->_menuActive = false;
+	_menu->_menuActive = false;
 	_firstlix = false;
 
 	CursorMan.showMouse(true);
@@ -165,6 +167,10 @@ void MenuItem::moveHighlight(int8 inc) {
 	CursorMan.showMouse(true);
 }
 
+/**
+ * This makes the menu highlight follow the mouse.
+ * @remarks	Originally called 'lightup'
+ */
 void MenuItem::lightUp(Common::Point cursorPos) {
 	if ((cursorPos.x < _flx1 * 8) || (cursorPos.x > _flx2 * 8) || (cursorPos.y <= 25) || (cursorPos.y > ((_fly - 3) * 2 + 1)))
 		return;
@@ -186,7 +192,7 @@ void MenuItem::select(byte which) {
 	if (_choiceNum > _optionNum)
 		_choiceNum = 0; // Off the top, I suppose.
 
-	(_dr->*_dr->_menuBar._menuItems[_activeNum]._chooseFunc)();
+	(_menu->*_menu->_menuBar._menuItems[_activeNum]._chooseFunc)();
 }
 
 void MenuItem::parseKey(char c) {
@@ -199,29 +205,29 @@ void MenuItem::parseKey(char c) {
 		}
 	}
 	if (!found)
-		_dr->_vm->_sound->blip();
+		_menu->_vm->_sound->blip();
 }
 
-void MenuBar::init(Menu *dr) {
-	_dr = dr;
+void MenuBar::init(Menu *menu) {
+	_menu = menu;
 	_menuNum = 0;
 }
 
 void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc) {
-	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dr);
+	_menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _menu);
 	_menuNum++;
 }
 
 void MenuBar::draw() {
-	_dr->_vm->_graphics->drawMenuBar(kMenuBackgroundColor);
+	_menu->_vm->_graphics->drawMenuBar(kMenuBackgroundColor);
 
-	byte savecp = _dr->_vm->_cp;
-	_dr->_vm->_cp = 3;
+	byte savecp = _menu->_vm->_cp;
+	_menu->_vm->_cp = 3;
 
 	for (int i = 0; i < _menuNum; i++)
 		_menuItems[i].draw();
 
-	_dr->_vm->_cp = savecp;
+	_menu->_vm->_cp = savecp;
 }
 
 void MenuBar::parseAltTrigger(char c) {
@@ -234,13 +240,13 @@ void MenuBar::parseAltTrigger(char c) {
 }
 
 void MenuBar::setupMenuItem(byte which) {
-	if (_dr->_activeMenuItem._activeNow) {
-		_dr->_activeMenuItem.wipe(); // Get rid of menu.
-		if (_dr->_activeMenuItem._activeNum == _menuItems[which]._position)
+	if (_menu->_activeMenuItem._activeNow) {
+		_menu->_activeMenuItem.wipe(); // Get rid of menu.
+		if (_menu->_activeMenuItem._activeNum == _menuItems[which]._position)
 			return; // Clicked on own highlight.
 	}
 	_menuItems[which].highlight();
-	(_dr->*_menuItems[which]._setupFunc)();
+	(_menu->*_menuItems[which]._setupFunc)();
 }
 
 void MenuBar::chooseMenuItem(int16 x) {
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index a71093b..ab0456e 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -50,7 +50,7 @@ public:
 	int16 _xpos, _xright;
 	MenuFunc _setupFunc, _chooseFunc;
 
-	void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *dr);
+	void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *menu);
 	void draw();
 	void highlight();
 	bool parseAltTrigger(char key);
@@ -69,29 +69,33 @@ struct OptionType {
 class MenuItem {
 public:
 	OptionType _options[12];
-	byte _optionNum;
 	uint16 _width, _left;
 	bool _firstlix;
 	int16 _flx1, _flx2, _fly;
-	byte _oldY; // used by lightUp
 	bool _activeNow; // Is there an active option now?
 	byte _activeNum; // And if so, which is it?
 	byte _choiceNum; // Your choice?
-	byte _highlightNum;
 
-	void init(Menu *dr);
+	void init(Menu *menu);
 	void reset();
 	void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid);
 	void display();
 	void wipe();
-	void lightUp(Common::Point cursorPos); // This makes the menu highlight follow the mouse.
+	void lightUp(Common::Point cursorPos);
+	void select(byte which);
+
+private:
+	byte _oldY; // used by lightUp
+	byte _optionNum;
+	byte _highlightNum;
+
+	Menu *_menu;
+
 	void displayOption(byte y, bool highlit);
 	void moveHighlight(int8 inc);
-	void select(byte which); // Choose which one you want.
-	void parseKey(char c);
 
-private:
-	Menu *_dr;
+	// CHECKME: Useless function?
+	void parseKey(char c);
 };
 
 class MenuBar {
@@ -99,15 +103,17 @@ public:
 	HeadType _menuItems[8];
 	byte _menuNum;
 
-	void init(Menu *dr);
+	void init(Menu *menu);
 	void createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc);
 	void draw();
-	void parseAltTrigger(char c);
-	void setupMenuItem(byte which);
 	void chooseMenuItem(int16 x);
 
 private:
-	Menu *_dr;
+	Menu *_menu;
+
+	void setupMenuItem(byte which);
+	// CHECKME: Useless function
+	void parseAltTrigger(char c);
 };
 
 class Menu {
@@ -119,11 +125,8 @@ public:
 	MenuItem _activeMenuItem;
 	MenuBar _menuBar;
 
-	Common::String people;
-
 	Menu(AvalancheEngine *vm);
 
-	void parseKey(char r, char re);
 	void update();
 	void setup(); // Standard menu bar.
 	bool isActive();
@@ -140,6 +143,7 @@ private:
 //	static const Color kHighlightFontColor = kColorWhite;
 //	static const Color kDisabledColor = kColorDarkgray;
 
+	Common::String people;
 	Common::String _verbStr; // what you can do with your object. :-)
 	bool _menuActive; // Kludge so we don't have to keep referring to the menu.
 	People _lastPerson; // Last person to have been selected using the People menu.
@@ -168,6 +172,9 @@ private:
 	void runMenuObjects();
 	void runMenuPeople();
 	void runMenuWith();
+
+	// CHECKME: Useless function?
+	void parseKey(char r, char re);
 };
 
 } // End of namespace Avalanche.


Commit: a6bdec5ca5dd92c4613b0e684f838326ec89939b
    https://github.com/scummvm/scummvm/commit/a6bdec5ca5dd92c4613b0e684f838326ec89939b
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-03T14:48:14-07:00

Commit Message:
AVALANCHE: Don't refresh screen after every event in scroll mode

Changed paths:
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index fd2e47b..0c90d12 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -128,15 +128,18 @@ void Dialogs::scrollModeNormal() {
 	_vm->_graphics->showScroll();
 
 	Common::Event event;
-	while (!_vm->shouldQuit()) {
+	bool escape = false;
+	while (!_vm->shouldQuit() && !escape) {
 		_vm->_graphics->refreshScreen();
-
-		_vm->getEvent(event);
-		if ((event.type == Common::EVENT_LBUTTONUP) ||
-			((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) ||
-			(event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) ||
-			(event.kbd.keycode == Common::KEYCODE_PLUS))))
-			break;
+		while (_vm->getEvent(event)) {
+			if ((event.type == Common::EVENT_LBUTTONUP) ||
+				((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) ||
+				(event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) ||
+				(event.kbd.keycode == Common::KEYCODE_PLUS)))) {
+				escape = true;
+				break;
+			}
+		}
 	}
 
 	_vm->_graphics->restoreScreen();


Commit: 97f26f679408fe8d9196ea36924c3e24adc11d3e
    https://github.com/scummvm/scummvm/commit/97f26f679408fe8d9196ea36924c3e24adc11d3e
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-03T14:48:56-07:00

Commit Message:
AVALANCHE: Use memcpy in refreshScreen

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 5e17dcd..23807ac 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -677,10 +677,8 @@ void GraphicManager::drawChar(byte ander, int x, int y, Color color) {
 void GraphicManager::refreshScreen() {
 	// These cycles are for doubling the screen height.
 	for (uint16 y = 0; y < _screen.h / 2; y++) {
-		for (uint16 x = 0; x < _screen.w; x++) {
-			for (int j = 0; j < 2; j++)
-				*(byte *)_screen.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);
-		}
+		memcpy(_screen.getBasePtr(0, y * 2), _surface.getBasePtr(0, y), _screen.w);
+		memcpy(_screen.getBasePtr(0, y * 2 + 1), _surface.getBasePtr(0, y), _screen.w);
 	}
 	// Now we copy the stretched picture to the screen.
 	g_system->copyRectToScreen(_screen.getPixels(), _screen.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);


Commit: 9a4d1683c996220f911e5b2c84f01c7e508e90f1
    https://github.com/scummvm/scummvm/commit/9a4d1683c996220f911e5b2c84f01c7e508e90f1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:07:59-07:00

Commit Message:
AVALANCHE: Remove code commented in the original but not in the engine.

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f415d90..3af3295 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -103,16 +103,12 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
 	}
 	_animCount++;
 
-	CursorMan.showMouse(true);
 	_x = 0;
 	_y = 0;
 	_quick = true;
 	_visible = false;
 	_speedX = 3;
 	_speedY = 1;
-	if (spritenum == 1)
-		_anim->updateSpeed(); // Just for the lights.
-
 	_homing = false;
 	_moveX = 0;
 	_moveY = 0;


Commit: 49960992caaa7e67ae75463de74b30932254c0f8
    https://github.com/scummvm/scummvm/commit/49960992caaa7e67ae75463de74b30932254c0f8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:12:35-07:00

Commit Message:
AVALANCHE: Fix naming convention, reduce the scope of a couple of variables

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 3af3295..f274fc7 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -434,15 +434,12 @@ byte Animation::geidaPed(byte ped) {
  * on the screen.
  */
 void Animation::catacombMove(byte ped) {
-	int32 here;
-	uint16 xy_uint16;
-
-	// XY_uint16 is cat_x+cat_y*256. Thus, every room in the
+	// XY_uint16 is _catacombX+_catacombY*256. Thus, every room in the
 	// catacombs has a different number for it.
-	xy_uint16 = _vm->_catacombX + _vm->_catacombY * 256;
+	uint16 xy = _vm->_catacombX + _vm->_catacombY * 256;
 	_geidaSpin = 0;
 
-	switch (xy_uint16) {
+	switch (xy) {
 	case 1801: // Exit catacombs
 		_vm->flipRoom(kRoomLustiesRoom, 4);
 		_vm->_dialogs->displayText("Phew! Nice to be out of there!");
@@ -467,7 +464,7 @@ void Animation::catacombMove(byte ped) {
 
 	if (!_vm->_enterCatacombsFromLustiesRoom)
 		_vm->loadRoom(29);
-	here = _vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
+	int32 here = _vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
@@ -596,7 +593,7 @@ void Animation::catacombMove(byte ped) {
 	case 0x1:
 		_vm->_background->draw(-1, -1, 21);
 
-		if ((xy_uint16 == 2051) && (_vm->_geidaFollows))
+		if ((xy == 2051) && (_vm->_geidaFollows))
 			_vm->_magics[12]._operation = kMagicExclaim;
 		else
 			_vm->_magics[12]._operation = kMagicSpecial; // Right exit south.
@@ -694,7 +691,7 @@ void Animation::catacombMove(byte ped) {
 		break;
 	}
 
-	switch (xy_uint16) {
+	switch (xy) {
 	case 514:
 		_vm->_background->draw(-1, -1, 16);
 		break;     // [2,2] : "Art Gallery" sign over door.


Commit: 9b9462bcee4031f4222ba4649f8c8434a1bd9111
    https://github.com/scummvm/scummvm/commit/9b9462bcee4031f4222ba4649f8c8434a1bd9111
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:15:24-07:00

Commit Message:
AVALANCHE: Check | occurrence as pointed by LordHoto

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f274fc7..08dffd5 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -1137,7 +1137,7 @@ void Animation::drawSprites() {
  * @remarks	Originally called 'trippancy_link'
  */
 void Animation::animLink() {
-	if (_vm->_menu->isActive() | _vm->_seeScroll)
+	if (_vm->_menu->isActive() || _vm->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
 		if (_sprites[i]._quick && _sprites[i]._visible)
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 8cc1191..cff9446 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -40,7 +40,7 @@ namespace Avalanche {
 // Art gallery at 2,1; notice about this at 2,2.
 const int32 AvalancheEngine::kCatacombMap[8][8] = {
 	// Geida's room
-	// 1       2	   3     | 4	   5	   6	   7       8
+	// 1	   2	   3	   4	   5	   6	   7	   8
 	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
 	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
 	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},


Commit: 19cc272763bd4094508c9ec4862403aef8626dae
    https://github.com/scummvm/scummvm/commit/19cc272763bd4094508c9ec4862403aef8626dae
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:16:54-07:00

Commit Message:
AVALANCHE: Remove s_engine

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 26d7671..29045d7 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -43,11 +43,8 @@
 
 namespace Avalanche {
 
-AvalancheEngine *AvalancheEngine::s_Engine = 0;
-
 AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd), _fxHidden(false), _interrogation(0) {
 	_system = syst;
-	s_Engine = this;
 	_console = new AvalancheConsole(this);
 
 	_rnd = new Common::RandomSource("avalanche");
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index d68d837..4cb78f7 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -119,8 +119,6 @@ protected:
 	Common::Error run();
 
 private:
-	static AvalancheEngine *s_Engine;
-
 	AvalancheConsole *_console;
 	Common::Platform _platform;
 


Commit: 650613f5cab24ad5975282255dbf4d41baef822d
    https://github.com/scummvm/scummvm/commit/650613f5cab24ad5975282255dbf4d41baef822d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:30:16-07:00

Commit Message:
AVALANCHE: Use MKTAG for signature. This breaks prior savegames.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 29045d7..3d059b6 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -290,8 +290,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 		return false;
 	}
 
-	const char *signature = "AVAL";
-	f->write(signature, 4);
+	f->writeUint32LE(MKTAG('A', 'V', 'A', 'L'));
 
 	// Write version. We can't restore from obsolete versions.
 	f->writeByte(kSavegameVersion);
@@ -334,11 +333,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	if (!f)
 		return false;
 
-	// Check for our signature.
-	Common::String signature;
-	for (int i = 0; i < 4; i++)
-		signature += f->readByte();
-	if (signature != "AVAL")
+	uint32 signature = f->readUint32LE();
+	if (signature != MKTAG('A', 'V', 'A', 'L'))
 		return false;
 
 	// Check version. We can't restore from obsolete versions.
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 8afd8e5..6630ab8 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -129,10 +129,8 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
 			if (file) {
 				// Check for our signature.
-				Common::String signature;
-				for (int i = 0; i < 4; i++)
-					signature += file->readByte();
-				if (signature != "AVAL") {
+				uint32 signature = file->readUint32LE();
+				if (signature != MKTAG('A', 'V', 'A', 'L')) {
 					warning("Savegame of incompatible type!");
 					delete file;
 					continue;
@@ -177,10 +175,8 @@ SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target,
 
 	if (f) {
 		// Check for our signature.
-		Common::String signature;
-		for (int i = 0; i < 4; i++)
-			signature += f->readByte();
-		if (signature != "AVAL") {
+		uint32 signature = f->readUint32LE();
+		if (signature != MKTAG('A', 'V', 'A', 'L')) {
 			warning("Savegame of incompatible type!");
 			delete f;
 			return SaveStateDescriptor();
@@ -188,8 +184,8 @@ SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target,
 
 		// Check version.
 		byte saveVersion = f->readByte();
-		if (saveVersion != kSavegameVersion) {
-			warning("Savegame of incompatible version!");
+		if (saveVersion > kSavegameVersion) {
+			warning("Savegame of a too recent version!");
 			delete f;
 			return SaveStateDescriptor();
 		}


Commit: 493c02ae224c0ce2f2d095e380c279ff1311a558
    https://github.com/scummvm/scummvm/commit/493c02ae224c0ce2f2d095e380c279ff1311a558
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:33:13-07:00

Commit Message:
AVALANCHE: Use ConfMan short name

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index cff9446..03a1774 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -320,7 +320,7 @@ void AvalancheEngine::setup() {
 
 	_menu->init();
 
-	int16 loadSlot = Common::ConfigManager::instance().getInt("save_slot");
+	int16 loadSlot = ConfMan.instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_thinks = 2; // You always have money.
 		thinkAbout(kObjectMoney, kThing);


Commit: 89559e07a3b337a27798aedb1ef64f257fdfe649
    https://github.com/scummvm/scummvm/commit/89559e07a3b337a27798aedb1ef64f257fdfe649
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:40:24-07:00

Commit Message:
AVALANCHE: Remove file variable from AvalancheEngine

Changed paths:
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 4cb78f7..1ef5d50 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -317,9 +317,7 @@ private:
 	Common::String _roomnName; // Name of actual room
 	int8 _scoreToDisplay[3];
 
-	Common::File file;
-	Common::String readAlsoStringFromFile();
-
+	Common::String readAlsoStringFromFile(Common::File &file);
 	void runAvalot();
 	void init();
 	void setup();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 03a1774..5b28629 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -302,7 +302,7 @@ void AvalancheEngine::setup() {
 
 	_dialogs->reset();
 	dusk();
-	_graphics->loadDigits(file);
+	_graphics->loadDigits();
 
 	_parser->_inputTextPos = 0;
 	_parser->_quote = true;
@@ -413,7 +413,7 @@ void AvalancheEngine::callVerb(VerbCode id) {
  * Check is it's possible to give something to Spludwick
  * @remarks	Originally called 'nextstring'
  */
-Common::String AvalancheEngine::readAlsoStringFromFile() {
+Common::String AvalancheEngine::readAlsoStringFromFile(Common::File &file) {
 	Common::String str;
 	byte length = file.readByte();
 	for (int i = 0; i < length; i++)
@@ -448,6 +448,7 @@ void AvalancheEngine::loadAlso(byte num) {
 	}
 	Common::String filename;
 	filename = Common::String::format("also%d.avd", num);
+	Common::File file;
 	if (!file.open(filename))
 		error("AVALANCHE: File not found: %s", filename.c_str());
 
@@ -458,7 +459,7 @@ void AvalancheEngine::loadAlso(byte num) {
 	for (int i = 0; i <= alsoNum; i++) {
 		for (int j = 0; j < 2; j++) {
 			_also[i][j] = new Common::String;
-			*_also[i][j] = readAlsoStringFromFile();
+			*_also[i][j] = readAlsoStringFromFile(file);
 		}
 		tmpStr = Common::String::format("\x9D%s\x9D", _also[i][0]->c_str());
 		*_also[i][0] = tmpStr;
@@ -541,6 +542,7 @@ void AvalancheEngine::loadRoom(byte num) {
 	_graphics->fleshColors();
 
 	Common::String filename = Common::String::format("place%d.avd", num);
+	Common::File file;
 	if (!file.open(filename))
 		error("AVALANCHE: File not found: %s", filename.c_str());
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 5e17dcd..b3eeed5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -90,10 +90,11 @@ void GraphicManager::init() {
  * Load the scoring digits & rwlites
  * @remarks	Originally called 'load_digits'
  */
-void GraphicManager::loadDigits(Common::File &file) {
+void GraphicManager::loadDigits() {
 	const byte digitsize = 134;
 	const byte rwlitesize = 126;
 
+	Common::File file;
 	if (!file.open("digit.avd"))
 		error("AVALANCHE: File not found: digit.avd");
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 9930e28..876bcea 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -63,7 +63,7 @@ public:
 	GraphicManager(AvalancheEngine *vm);
 	~GraphicManager();
 	void init();
-	void loadDigits(Common::File &file);
+	void loadDigits();
 	void loadMouse(byte which);
 
 	void fleshColors();


Commit: 300859aa43bf4f14afc005fdcebb392cf2a88000
    https://github.com/scummvm/scummvm/commit/300859aa43bf4f14afc005fdcebb392cf2a88000
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:52:12-07:00

Commit Message:
AVALANCHE: Fix static array names

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 5b28629..ef33b4c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1545,22 +1545,22 @@ bool AvalancheEngine::decreaseMoney(uint16 amount) {
 }
 
 Common::String AvalancheEngine::getName(People whose) {
-	static const Common::String kLads[17] = {
+	static const Common::String lads[17] = {
 		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
 		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
 		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
 	};
 
-	static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
+	static const Common::String lasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
 
 	if (whose < kPeopleArkata)
-		return kLads[whose - kPeopleAvalot];
+		return lads[whose - kPeopleAvalot];
 	else
-		return kLasses[whose - kPeopleArkata];
+		return lasses[whose - kPeopleArkata];
 }
 
 Common::String AvalancheEngine::getItem(byte which) {
-	static const Common::String kItems[kObjectNum] = {
+	static const Common::String items[kObjectNum] = {
 		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
 		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
 		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
@@ -1577,7 +1577,7 @@ Common::String AvalancheEngine::getItem(byte which) {
 		case 0:
 		case 1:
 		case 4:
-			get_better_result = kItems[which - 1];
+			get_better_result = items[which - 1];
 			break;
 		case 3:
 			get_better_result = "some vinegar";
@@ -1590,11 +1590,11 @@ Common::String AvalancheEngine::getItem(byte which) {
 		else if (_onionInVinegar)
 			get_better_result = "a pickled onion (in the vinegar)";
 		else
-			get_better_result = kItems[which - 1];
+			get_better_result = items[which - 1];
 		break;
 	default:
 		if ((which < kObjectNum) && (which > 0))
-			get_better_result = kItems[which - 1];
+			get_better_result = items[which - 1];
 		else
 			get_better_result = "";
 	}
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b3eeed5..92a9f0b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -166,12 +166,12 @@ void GraphicManager::loadMouse(byte which) {
 }
 
 void GraphicManager::drawThinkPic(Common::String filename, int id) {
-	static const int16 kPicSize = 966;
+	static const int16 picSize = 966;
 	Common::File file;
 	if (!file.open(filename))
 		error("drawThinkPic(): File not found: %s", filename.c_str());
 
-	file.seek(id * kPicSize + 65);
+	file.seek(id * picSize + 65);
 	Graphics::Surface picture = loadPictureGraphic(file);
 	drawPicture(_surface, picture, 205, 170);
 
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 146a743..14fa74c 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -771,7 +771,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 }
 
 char Menu::getThingChar(byte which) {
-	static const char kThingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
+	static const char thingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar
 
 	char result;
 	switch (which) {
@@ -779,26 +779,26 @@ char Menu::getThingChar(byte which) {
 		if (_vm->_wineState == 3)
 			result = 'V'; // Vinegar
 		else
-			result = kThingsChar[which - 1];
+			result = thingsChar[which - 1];
 		break;
 	default:
-		result = kThingsChar[which - 1];
+		result = thingsChar[which - 1];
 	}
 	return result;
 }
 
 byte Menu::getNameChar(People whose) {
-	static const char kLadChar[] = "ASCDMTRwLfgeIyPu";
-	static const char kLassChar[] = "kG\0xB1o";
+	static const char ladChar[] = "ASCDMTRwLfgeIyPu";
+	static const char lassChar[] = "kG\0xB1o";
 
 	if (whose < kPeopleArkata)
-		return kLadChar[whose - kPeopleAvalot];
+		return ladChar[whose - kPeopleAvalot];
 	else
-		return kLassChar[whose - kPeopleArkata];
+		return lassChar[whose - kPeopleArkata];
 }
 
 Common::String Menu::getThing(byte which) {
-	static const Common::String kThings[kObjectNum] = {
+	static const Common::String things[kObjectNum] = {
 		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
 		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
 		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
@@ -810,7 +810,7 @@ Common::String Menu::getThing(byte which) {
 		switch (_vm->_wineState) {
 	case 1:
 	case 4:
-		result = kThings[which - 1];
+		result = things[which - 1];
 		break;
 	case 3:
 		result = "Vinegar";
@@ -821,10 +821,10 @@ Common::String Menu::getThing(byte which) {
 		if (_vm->_rottenOnion)
 			result = "rotten onion";
 		else
-			result = kThings[which - 1];
+			result = things[which - 1];
 		break;
 	default:
-		result = kThings[which - 1];
+		result = things[which - 1];
 	}
 	return result;
 }
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 115b566..fc6085b 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -527,7 +527,7 @@ void Parser::replace(Common::String oldChars, byte newChar) {
 }
 
 Common::String Parser::rank() {
-	static const RankType kRanks[9] = {
+	static const RankType ranks[9] = {
 		{0, "Beginner"},     {10, "Novice"},
 		{20, "Improving"},   {35, "Not bad"},
 		{50, "Passable"},    {65, "Good"},
@@ -536,8 +536,8 @@ Common::String Parser::rank() {
 	};
 
 	for (int i = 0; i < 8; i++) {
-		if ((_vm->_dnascore >= kRanks[i]._score) && (_vm->_dnascore < kRanks[i + 1]._score)) {
-			return kRanks[i]._title;
+		if ((_vm->_dnascore >= ranks[i]._score) && (_vm->_dnascore < ranks[i + 1]._score)) {
+			return ranks[i]._title;
 		}
 	}
 	return "";


Commit: 1cbe175a74099a4ca54503933b12c84352a98e82
    https://github.com/scummvm/scummvm/commit/1cbe175a74099a4ca54503933b12c84352a98e82
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T08:55:40-07:00

Commit Message:
AVALANCHE: Fix naming conventions in getItem()

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ef33b4c..f45341e 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1567,7 +1567,7 @@ Common::String AvalancheEngine::getItem(byte which) {
 		"an onion"
 	};
 
-	Common::String get_better_result;
+	Common::String result;
 	if (which > 150)
 		which -= 149;
 
@@ -1577,28 +1577,28 @@ Common::String AvalancheEngine::getItem(byte which) {
 		case 0:
 		case 1:
 		case 4:
-			get_better_result = items[which - 1];
+			result = items[which - 1];
 			break;
 		case 3:
-			get_better_result = "some vinegar";
+			result = "some vinegar";
 			break;
 		}
 		break;
 	case kObjectOnion:
 		if (_rottenOnion)
-			get_better_result = "a rotten onion";
+			result = "a rotten onion";
 		else if (_onionInVinegar)
-			get_better_result = "a pickled onion (in the vinegar)";
+			result = "a pickled onion (in the vinegar)";
 		else
-			get_better_result = items[which - 1];
+			result = items[which - 1];
 		break;
 	default:
 		if ((which < kObjectNum) && (which > 0))
-			get_better_result = items[which - 1];
+			result = items[which - 1];
 		else
-			get_better_result = "";
+			result = "";
 	}
-	return get_better_result;
+	return result;
 }
 
 Common::String AvalancheEngine::f5Does() {


Commit: 221faca2868f4c1dae3e23e4ca608968c8042620
    https://github.com/scummvm/scummvm/commit/221faca2868f4c1dae3e23e4ca608968c8042620
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T09:00:56-07:00

Commit Message:
AVALANCHE: Fix ifndef check in header files

Changed paths:
    engines/avalanche/background.h
    engines/avalanche/closing.h
    engines/avalanche/menu.h
    engines/avalanche/pingo.h



diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index f4fcd38..be09cc4 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -27,8 +27,8 @@
 
 /* Original name: CELER		The unit for updating the screen pics. */
 
-#ifndef AVALANCHE_CELER2_H
-#define AVALANCHE_CELER2_H
+#ifndef AVALANCHE_BACKGROUND_H
+#define AVALANCHE_BACKGROUND_H
 
 #include "common/scummsys.h"
 #include "common/file.h"
@@ -80,4 +80,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // AVALANCHE_CELER2_H
+#endif // AVALANCHE_BACKGROUND_H
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index b4c80a8..cfda3cc 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -27,8 +27,8 @@
 
 /* CLOSING		The closing screen and error handler. */
 
-#ifndef AVALANCHE_CLOSING2_H
-#define AVALANCHE_CLOSING2_H
+#ifndef AVALANCHE_CLOSING_H
+#define AVALANCHE_CLOSING_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -60,4 +60,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // AVALANCHE_CLOSING2_H
+#endif // AVALANCHE_CLOSING_H
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index ab0456e..f856747 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -27,8 +27,8 @@
 
 /* Original name: DROPDOWN		A customized version of Oopmenu (qv). */
 
-#ifndef AVALANCHE_DROPDOWN2_H
-#define AVALANCHE_DROPDOWN2_H
+#ifndef AVALANCHE_MENU_H
+#define AVALANCHE_MENU_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -179,4 +179,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // AVALANCHE_DROPDOWN2_H
+#endif // AVALANCHE_MENU_H
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index ee4fb58..296d9de 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -27,8 +27,8 @@
 
 /* PINGO	Full-screen sub-parts of the game. */
 
-#ifndef AVALANCHE_PINGO2_H
-#define AVALANCHE_PINGO2_H
+#ifndef AVALANCHE_PINGO_H
+#define AVALANCHE_PINGO_H
 
 #include "common/scummsys.h"
 #include "common/str.h"
@@ -57,4 +57,4 @@ private:
 
 } // End of namespace Avalanche.
 
-#endif // AVALANCHE_PINGO2_H
+#endif // AVALANCHE_PINGO_H


Commit: 0ec40a5f80ca04842bd4b98e34a114a34821e691
    https://github.com/scummvm/scummvm/commit/0ec40a5f80ca04842bd4b98e34a114a34821e691
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T09:02:51-07:00

Commit Message:
AVALANCHE: Add static to 2 array definitions in closing

Changed paths:
    engines/avalanche/closing.cpp



diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index e7314a0..5aea377 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -53,12 +53,12 @@ void Closing::putIn(Common::String str, uint16 where) {
 }
 
 void Closing::exitGame() {
-	const Common::String nouns[12] = {
+	static const Common::String nouns[12] = {
 		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
 		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
 	};
 
-	const Common::String verbs[12] = {
+	static const Common::String verbs[12] = {
 		"haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
 		"ignore", "stare at", "shriek at", "frighten", "quieten"
 	};


Commit: 72d1f587337e32ef378c15e54bde2ba52edbf419
    https://github.com/scummvm/scummvm/commit/72d1f587337e32ef378c15e54bde2ba52edbf419
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T09:10:17-07:00

Commit Message:
AVALANCHE: Fix savegame naming. This breaks previous savegames

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3d059b6..7c4f765 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -314,9 +314,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 }
 
 Common::String AvalancheEngine::getSaveFileName(const int slot) {
-	Common::String upperName = _targetName;
-	upperName.toUppercase();
-	return upperName+ Common::String::format("-%02d.SAV", slot);
+	return Common::String::format("%s.%03d", _targetName, slot);
 }
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!


Commit: c53917ec64eae2bdc2e5eed52cf1f542a07cccbd
    https://github.com/scummvm/scummvm/commit/c53917ec64eae2bdc2e5eed52cf1f542a07cccbd
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T09:12:13-07:00

Commit Message:
AVALANCHE: Add indentation on REGISTER_PLUGIN_* lines

Changed paths:
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 6630ab8..7fd85c5 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -212,7 +212,7 @@ SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target,
 } // End of namespace Avalanche
 
 #if PLUGIN_ENABLED_DYNAMIC(AVALANCHE)
-REGISTER_PLUGIN_DYNAMIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
+	REGISTER_PLUGIN_DYNAMIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
 #else
-REGISTER_PLUGIN_STATIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
+	REGISTER_PLUGIN_STATIC(AVALANCHE, PLUGIN_TYPE_ENGINE, Avalanche::AvalancheMetaEngine);
 #endif


Commit: b0a498c1e5b0d1e9db7f37e7119c2a49d589b721
    https://github.com/scummvm/scummvm/commit/b0a498c1e5b0d1e9db7f37e7119c2a49d589b721
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T09:14:47-07:00

Commit Message:
Merge branch 'avalanche' of https://github.com/urukgit/scummvm into avalanche

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp





Commit: 304ab6da154dcc0f9815b42682a5568d49d81ef2
    https://github.com/scummvm/scummvm/commit/304ab6da154dcc0f9815b42682a5568d49d81ef2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T11:50:28-07:00

Commit Message:
AVALANCHE: Start cleaning includes - remove useless include in header files

Changed paths:
    engines/avalanche/animation.h
    engines/avalanche/avalot.h
    engines/avalanche/background.h
    engines/avalanche/closing.h
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.h
    engines/avalanche/menu.h
    engines/avalanche/parser.h
    engines/avalanche/pingo.h
    engines/avalanche/sequence.h
    engines/avalanche/timer.h



diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index b975e03..2669c99 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -30,11 +30,6 @@
 #ifndef AVALANCHE_ANIMATION_H
 #define AVALANCHE_ANIMATION_H
 
-#include "avalanche/graphics.h"
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 class Animation;
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index 5381edd..ab78f5c 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -32,13 +32,6 @@
 
 #include "avalanche/animation.h"
 
-#include "common/events.h"
-#include "common/system.h"
-#include "common/str.h"
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "graphics/surface.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index be09cc4..34d7a9a 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -30,12 +30,8 @@
 #ifndef AVALANCHE_BACKGROUND_H
 #define AVALANCHE_BACKGROUND_H
 
-#include "common/scummsys.h"
-#include "common/file.h"
 #include "common/str.h"
 
-#include "graphics/surface.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/closing.h b/engines/avalanche/closing.h
index cfda3cc..25217e3 100644
--- a/engines/avalanche/closing.h
+++ b/engines/avalanche/closing.h
@@ -30,7 +30,6 @@
 #ifndef AVALANCHE_CLOSING_H
 #define AVALANCHE_CLOSING_H
 
-#include "common/scummsys.h"
 #include "common/str.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index d8c205a..7263c47 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -30,8 +30,6 @@
 #ifndef AVALANCHE_DIALOGS_H
 #define AVALANCHE_DIALOGS_H
 
-#include "common/system.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 876bcea..a6be3af 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -28,11 +28,11 @@
 #ifndef AVALANCHE_GRAPHICS_H
 #define AVALANCHE_GRAPHICS_H
 
+#include "avalanche/enums.h"
+
 #include "common/file.h"
 #include "common/rect.h"
-
 #include "graphics/surface.h"
-#include "avalanche/enums.h"
 
 namespace Avalanche {
 class AvalancheEngine;
diff --git a/engines/avalanche/menu.h b/engines/avalanche/menu.h
index f856747..a7ec8bf 100644
--- a/engines/avalanche/menu.h
+++ b/engines/avalanche/menu.h
@@ -30,7 +30,6 @@
 #ifndef AVALANCHE_MENU_H
 #define AVALANCHE_MENU_H
 
-#include "common/scummsys.h"
 #include "common/str.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 98adc3b..0375367 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -31,7 +31,6 @@
 #include "avalanche/enums.h"
 
 #include "common/events.h"
-#include "common/scummsys.h"
 #include "common/str.h"
 #include "common/serializer.h"
 
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index 296d9de..72fdb54 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -30,7 +30,6 @@
 #ifndef AVALANCHE_PINGO_H
 #define AVALANCHE_PINGO_H
 
-#include "common/scummsys.h"
 #include "common/str.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/sequence.h b/engines/avalanche/sequence.h
index 94025ba..d3c1b54 100644
--- a/engines/avalanche/sequence.h
+++ b/engines/avalanche/sequence.h
@@ -30,8 +30,6 @@
 #ifndef AVALANCHE_SEQUENCE_H
 #define AVALANCHE_SEQUENCE_H
 
-#include "common/scummsys.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 
diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h
index 134a4dc..6cd894b 100644
--- a/engines/avalanche/timer.h
+++ b/engines/avalanche/timer.h
@@ -30,8 +30,6 @@
 #ifndef AVALANCHE_TIMER_H
 #define AVALANCHE_TIMER_H
 
-#include "common/scummsys.h"
-
 namespace Avalanche {
 class AvalancheEngine;
 


Commit: a357dc4d0c0416dfc9a7e3aafb7f840eee5e5d6b
    https://github.com/scummvm/scummvm/commit/a357dc4d0c0416dfc9a7e3aafb7f840eee5e5d6b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T16:55:41-07:00

Commit Message:
AVALANCHE: Cleaning includes - remove useless includes in cpp files

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/detection.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/sequence.cpp
    engines/avalanche/sound.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 08dffd5..6a7bad1 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -29,14 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/animation.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/background.h"
-#include "avalanche/sequence.h"
-#include "avalanche/timer.h"
-
-#include "common/scummsys.h"
-#include "common/textconsole.h"
-#include "common/file.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 7c4f765..89dca21 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -27,18 +27,8 @@
 
 #include "avalanche/avalanche.h"
 
-#include "common/system.h"
 #include "common/random.h"
-#include "common/error.h"
-#include "common/events.h"
-#include "common/debug-channels.h"
-#include "common/config-manager.h"
-#include "common/textconsole.h"
 #include "common/savefile.h"
-
-#include "engines/util.h"
-
-#include "gui/saveload.h"
 #include "graphics/thumbnail.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f45341e..ad71ce5 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -28,11 +28,7 @@
 /* AVALOT		The kernel of the program. */
 
 #include "avalanche/avalanche.h"
-
-#include "common/file.h"
 #include "common/random.h"
-#include "common/str.h"
-#include "common/textconsole.h"
 #include "common/config-manager.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index cb280ba..54ab459 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -29,9 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/background.h"
-#include "avalanche/animation.h"
-
-#include "common/textconsole.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 5aea377..93caa02 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -30,7 +30,6 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/closing.h"
 
-#include "common/textconsole.h"
 #include "common/random.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 7fd85c5..38700af 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -31,7 +31,6 @@
 #include "common/savefile.h"
 
 #include "engines/advancedDetector.h"
-
 #include "graphics/thumbnail.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 0c90d12..fdc90bb 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -29,11 +29,7 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/dialogs.h"
-#include "avalanche/animation.h"
-#include "avalanche/timer.h"
 
-#include "common/textconsole.h"
-#include "common/file.h"
 #include "common/random.h"
 
 namespace Avalanche {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index be397f5..12a1cb5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -28,11 +28,8 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/graphics.h"
 
-#include "common/system.h"
-#include "common/rect.h"
 #include "engines/util.h"
 #include "graphics/palette.h"
-#include "math.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 14fa74c..272948d 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -29,9 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/menu.h"
-#include "avalanche/animation.h"
-
-#include "common/textconsole.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index fc6085b..7227550 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -27,17 +27,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/parser.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/timer.h"
-#include "avalanche/animation.h"
-#include "avalanche/background.h"
-#include "avalanche/pingo.h"
-#include "avalanche/sequence.h"
-
-#include "common/textconsole.h"
-
-#include <cstring>
-#include <cmath>
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index bffceab..7b45397 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -28,13 +28,7 @@
 /* PINGO	Full-screen sub-parts of the game. */
 
 #include "avalanche/avalanche.h"
-
 #include "avalanche/pingo.h"
-#include "avalanche/animation.h"
-#include "avalanche/dialogs.h"
-
-#include "common/textconsole.h"
-#include "common/file.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index fecbc0c..a9de50f 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -29,11 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/sequence.h"
-#include "avalanche/timer.h"
-#include "avalanche/background.h"
-#include "avalanche/animation.h"
-
-#include "common/scummsys.h"
 
 namespace Avalanche {
 
diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index dba679e..2674c9b 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -20,11 +20,10 @@
  *
  */
 
-#include "audio/audiostream.h"
-
 #include "avalanche/avalanche.h"
 #include "avalanche/sound.h"
 
+#include "audio/audiostream.h"
 #include "common/system.h"
 #include "common/config-manager.h"
 
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index f345317..28cdc3b 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -29,12 +29,6 @@
 
 #include "avalanche/avalanche.h"
 #include "avalanche/timer.h"
-#include "avalanche/animation.h"
-#include "avalanche/dialogs.h"
-#include "avalanche/sequence.h"
-#include "avalanche/pingo.h"
-
-#include "common/textconsole.h"
 
 namespace Avalanche {
 


Commit: eeabd8a0dd111437ad740477bdf80aa39d2d9663
    https://github.com/scummvm/scummvm/commit/eeabd8a0dd111437ad740477bdf80aa39d2d9663
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T17:16:30-07:00

Commit Message:
AVALANCHE: Answer a couple of comments made by LordHoto

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/sound.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 12a1cb5..62ac165 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -684,6 +684,7 @@ void GraphicManager::refreshScreen() {
 }
 
 void GraphicManager::loadBackground(Common::File &file) {
+	_background.free();
 	_background = loadPictureRaw(file, kBackgroundWidth, kBackgroundHeight);
 }
 
diff --git a/engines/avalanche/sound.h b/engines/avalanche/sound.h
index da2ece3..25b6b26 100644
--- a/engines/avalanche/sound.h
+++ b/engines/avalanche/sound.h
@@ -50,4 +50,4 @@ private:
 
 } // End of namespace Avalanche
 
-#endif //AVALANCHE_SOUND_H
+#endif // AVALANCHE_SOUND_H


Commit: 03ca6ef76f3d0087d7ddf855bf84fc0d327b17c2
    https://github.com/scummvm/scummvm/commit/03ca6ef76f3d0087d7ddf855bf84fc0d327b17c2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-04T23:54:47-07:00

Commit Message:
AVALANCHE: Fix bug introduced in badc727883c14d13702fc61a0a6912a3d61ce9a4

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 89dca21..31fd053 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -304,7 +304,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
 }
 
 Common::String AvalancheEngine::getSaveFileName(const int slot) {
-	return Common::String::format("%s.%03d", _targetName, slot);
+	return Common::String::format("%s.%03d", _targetName.c_str(), slot);
 }
 
 bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!!


Commit: d3cd7e237a017af32962bc20c4dd8f510a4b7c80
    https://github.com/scummvm/scummvm/commit/d3cd7e237a017af32962bc20c4dd8f510a4b7c80
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-05T00:04:33-07:00

Commit Message:
AVALANCHE: Change disposeAfterUse value in Sound handler as suggested by LordHoto

Changed paths:
    engines/avalanche/sound.cpp



diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index 2674c9b..b10a5db 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -33,12 +33,11 @@ SoundHandler::SoundHandler(AvalancheEngine *vm) : _vm(vm) {
 	_soundFl = true;
 	_speakerStream = new Audio::PCSpeaker(_vm->_mixer->getOutputRate());
 	_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
-						_speakerStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
+						_speakerStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::YES, true);
 }
 
 SoundHandler::~SoundHandler() {
 	_vm->_mixer->stopHandle(_speakerHandle);
-	delete _speakerStream;
 }
 
 /**


Commit: b6d6c17727755fe50bbbb02ddc126ab7c887683c
    https://github.com/scummvm/scummvm/commit/b6d6c17727755fe50bbbb02ddc126ab7c887683c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-05T05:37:20-07:00

Commit Message:
AVALANCHE: Replace static strings by static char*

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/closing.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 31fd053..43943f2 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -387,11 +387,11 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 }
 
 Common::String AvalancheEngine::expandDate(int d, int m, int y) {
-	static const Common::String months[12] = {
+	static const char months[12][10] = {
 		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
 	};
 
-	Common::String month = months[m];
+	Common::String month = Common::String(months[m]);
 	Common::String day = intToStr(d);
 
 	if (((1 <= d) && (d <= 9)) || ((21 <= d) && (d <= 31)))
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ad71ce5..f80a915 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1541,26 +1541,27 @@ bool AvalancheEngine::decreaseMoney(uint16 amount) {
 }
 
 Common::String AvalancheEngine::getName(People whose) {
-	static const Common::String lads[17] = {
-		"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck",
-		"Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood",
-		"A trader", "Ibythneth", "Ayles", "Port", "Spurge", "Jacques"
+	static const char lads[17][20] = {
+		"Avalot",     "Spludwick",  "Crapulus",  "Dr. Duck",  "Malagauche",
+		"Friar Tuck", "Robin Hood", "Cwytalot",  "du Lustie", "the Duke of Cardiff",
+		"Dogfood",    "A trader",   "Ibythneth", "Ayles",     "Port", 
+		"Spurge",     "Jacques"
 	};
 
-	static const Common::String lasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
+	static const char lasses[4][15] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
 
 	if (whose < kPeopleArkata)
-		return lads[whose - kPeopleAvalot];
+		return Common::String(lads[whose - kPeopleAvalot]);
 	else
-		return lasses[whose - kPeopleArkata];
+		return Common::String(lasses[whose - kPeopleArkata]);
 }
 
 Common::String AvalancheEngine::getItem(byte which) {
-	static const Common::String items[kObjectNum] = {
-		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
-		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
-		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
-		"an onion"
+	static const char items[kObjectNum][18] = {
+		"some wine",       "your money-bag", "your bodkin", "a potion",          "a chastity belt",
+		"a crossbow bolt", "a crossbow",     "a lute",      "a pilgrim's badge", "a mushroom",
+		"a key",           "a bell",         "a scroll",    "a pen",             "some ink",
+		"your clothes",    "a habit",        "an onion"
 	};
 
 	Common::String result;
@@ -1573,7 +1574,7 @@ Common::String AvalancheEngine::getItem(byte which) {
 		case 0:
 		case 1:
 		case 4:
-			result = items[which - 1];
+			result = Common::String(items[which - 1]);
 			break;
 		case 3:
 			result = "some vinegar";
@@ -1586,11 +1587,11 @@ Common::String AvalancheEngine::getItem(byte which) {
 		else if (_onionInVinegar)
 			result = "a pickled onion (in the vinegar)";
 		else
-			result = items[which - 1];
+			result = Common::String(items[which - 1]);
 		break;
 	default:
 		if ((which < kObjectNum) && (which > 0))
-			result = items[which - 1];
+			result = Common::String(items[which - 1]);
 		else
 			result = "";
 	}
diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 93caa02..00a7589 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -52,14 +52,14 @@ void Closing::putIn(Common::String str, uint16 where) {
 }
 
 void Closing::exitGame() {
-	static const Common::String nouns[12] = {
-		"sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
-		"abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
+	static const char nouns[12][14] = {
+		"sackbut", "harpsichord", "camel",   "conscience", "ice-cream", "serf",
+		"abacus",  "castle",      "carrots", "megaphone",  "manticore", "drawbridge"
 	};
 
-	static const Common::String verbs[12] = {
-		"haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
-		"ignore", "stare at", "shriek at", "frighten", "quieten"
+	static const char verbs[12][12] = {
+		"haunt",    "daunt",  "tickle",   "gobble",    "erase",    "provoke",
+		"surprise", "ignore", "stare at", "shriek at", "frighten", "quieten"
 	};
 
 	_vm->_sound->stopSound();
@@ -67,7 +67,7 @@ void Closing::exitGame() {
 	getScreen(kScreenNagScreen);
 	byte nounId = _vm->_rnd->getRandomNumber(11);
 	byte verbId = _vm->_rnd->getRandomNumber(11);
-	Common::String result = nouns[nounId] + " will " + verbs[verbId] + " you";
+	Common::String result = Common::String::format("%s will %d you", nouns[nounId], verbs[verbId]);
 	putIn(result, 1628);
 	showScreen(); // No halt- it's already set up.
 }
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 272948d..1f349d2 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -795,7 +795,7 @@ byte Menu::getNameChar(People whose) {
 }
 
 Common::String Menu::getThing(byte which) {
-	static const Common::String things[kObjectNum] = {
+	static const char things[kObjectNum][20] = {
 		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
 		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
 		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
@@ -807,7 +807,7 @@ Common::String Menu::getThing(byte which) {
 		switch (_vm->_wineState) {
 	case 1:
 	case 4:
-		result = things[which - 1];
+		result = Common::String(things[which - 1]);
 		break;
 	case 3:
 		result = "Vinegar";
@@ -816,12 +816,12 @@ Common::String Menu::getThing(byte which) {
 		break;
 	case kObjectOnion:
 		if (_vm->_rottenOnion)
-			result = "rotten onion";
+			result = Common::String("rotten onion");
 		else
-			result = things[which - 1];
+			result = Common::String(things[which - 1]);
 		break;
 	default:
-		result = things[which - 1];
+		result = Common::String(things[which - 1]);
 	}
 	return result;
 }
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 7227550..28c3b3b 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -525,9 +525,8 @@ Common::String Parser::rank() {
 	};
 
 	for (int i = 0; i < 8; i++) {
-		if ((_vm->_dnascore >= ranks[i]._score) && (_vm->_dnascore < ranks[i + 1]._score)) {
-			return ranks[i]._title;
-		}
+		if ((_vm->_dnascore >= ranks[i]._score) && (_vm->_dnascore < ranks[i + 1]._score))
+			return Common::String(ranks[i]._title);
 	}
 	return "";
 }
@@ -1572,7 +1571,7 @@ void Parser::heyThanks() {
  * @remarks	Originally called 'do_that'
  */
 void Parser::doThat() {
-	static const Common::String booze[] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
+	static const char booze[8][8] = {"Bitter", "GIED", "Whisky", "Cider", "", "", "", "Mead"};
 	static const char kWhat[] = "That's not possible!";
 
 	if (_thats == Common::String(kNothing))  {
@@ -2052,7 +2051,7 @@ void Parser::doThat() {
 						_vm->incScore(3);
 
 					_vm->_background->draw(-1, -1, 11);
-					_vm->_dialogs->displayText(booze[_thing - 51] + ", please." + kControlRegister + '1' + kControlSpeechBubble);
+					_vm->_dialogs->displayText(Common::String(booze[_thing - 51]) + ", please." + kControlRegister + '1' + kControlSpeechBubble);
 					_vm->_drinking = _thing;
 
 					_vm->_background->draw(-1, -1, 9);
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 0375367..892b81e 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -99,7 +99,7 @@ private:
 
 	struct RankType {
 		uint16 _score;
-		Common::String _title;
+		char _title[20];
 	};
 
 	static const char *kCopyright;


Commit: 1844dcf05cdf57a42d8336ef3c6ff1ffe02a951f
    https://github.com/scummvm/scummvm/commit/1844dcf05cdf57a42d8336ef3c6ff1ffe02a951f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-05T05:47:07-07:00

Commit Message:
AVALANCHE: Remove a missed useless include

Changed paths:
    engines/avalanche/sound.cpp



diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index b10a5db..c324df4 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -24,7 +24,6 @@
 #include "avalanche/sound.h"
 
 #include "audio/audiostream.h"
-#include "common/system.h"
 #include "common/config-manager.h"
 
 namespace Avalanche {


Commit: bf41366fd7e042c1ef48ffc4ff5366fee27e756f
    https://github.com/scummvm/scummvm/commit/bf41366fd7e042c1ef48ffc4ff5366fee27e756f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-05T06:09:00-07:00

Commit Message:
AVALANCHE: Fix error not reported by MSVC

Changed paths:
    engines/avalanche/closing.cpp



diff --git a/engines/avalanche/closing.cpp b/engines/avalanche/closing.cpp
index 00a7589..1cb2e84 100644
--- a/engines/avalanche/closing.cpp
+++ b/engines/avalanche/closing.cpp
@@ -67,7 +67,7 @@ void Closing::exitGame() {
 	getScreen(kScreenNagScreen);
 	byte nounId = _vm->_rnd->getRandomNumber(11);
 	byte verbId = _vm->_rnd->getRandomNumber(11);
-	Common::String result = Common::String::format("%s will %d you", nouns[nounId], verbs[verbId]);
+	Common::String result = Common::String::format("%s will %s you", nouns[nounId], verbs[verbId]);
 	putIn(result, 1628);
 	showScreen(); // No halt- it's already set up.
 }


Commit: 0f42dd4511ed4cc279acb075344fb62bc25300a9
    https://github.com/scummvm/scummvm/commit/0f42dd4511ed4cc279acb075344fb62bc25300a9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-05T15:03:49-07:00

Commit Message:
AVALANCHE: Use floats instead of double. Use M_PI where it is possible.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f80a915..e6cf310 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -30,6 +30,7 @@
 #include "avalanche/avalanche.h"
 #include "common/random.h"
 #include "common/config-manager.h"
+#include <math.h>
 
 namespace Avalanche {
 
@@ -1360,7 +1361,7 @@ void AvalancheEngine::majorRedraw() {
 }
 
 uint16 AvalancheEngine::bearing(byte whichPed) {
-	static const double rad2deg = 180 / 3.14; // Pi
+	const float rad2deg = 180 / M_PI;
 	AnimationType *avvy = &_animation->_sprites[0];
 	PedType *curPed = &_peds[whichPed];
 
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 62ac165..d442c13 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -199,8 +199,7 @@ void GraphicManager::fleshColors() {
 
 Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	Common::Point endPoint;
-	const double pi = 3.14;
-	const double convfac = pi / 180.0;
+	const float convfac = M_PI / 180.0;
 
 	int32 xRadius = radius;
 	int32 yRadius = radius * kScreenWidth / (8 * kScreenHeight); // Just don't ask why...
@@ -233,20 +232,20 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16
 	uint16 numOfPixels = (uint16)floor(sqrt(3.0) * sqrt(pow(double(xRadius), 2) + pow(double(yRadius), 2)) + 0.5);
 
 	// Calculate the angle precision required.
-	double delta = 90.0 / numOfPixels;
+	float delta = 90.0 / numOfPixels;
 
 	// Always just go over the first 90 degrees. Could be optimized a
 	// bit if startAngle and endAngle lie in the same quadrant, left as an
 	// exercise for the reader. :)
-	double j = 0;
+	float j = 0;
 
 	// Calculate stop position, go 1 further than 90 because otherwise 1 pixel is sometimes not drawn.
 	uint16 deltaEnd = 91;
 
 	// Set the end point.
-	double tempTerm = endAngle * convfac;
+	float tempTerm = endAngle * convfac;
 	endPoint.x = (int16)floor(xRadius * cos(tempTerm) + 0.5) + x;
-	endPoint.y = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5) + y;
+	endPoint.y = (int16)floor(yRadius * sin(tempTerm + M_PI) + 0.5) + y;
 
 	// Calculate points.
 	int16 xNext = xRadius;
@@ -258,7 +257,7 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16
 		tempTerm = (j + delta) * convfac;
 
 		xNext = (int16)floor(xRadius * cos(tempTerm) + 0.5);
-		yNext = (int16)floor(yRadius * sin(tempTerm + pi) + 0.5);
+		yNext = (int16)floor(yRadius * sin(tempTerm + M_PI) + 0.5);
 
 		int16 xp = x + xTemp;
 		int16 xm = x - xTemp;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 28c3b3b..05d4026 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -533,7 +533,7 @@ Common::String Parser::rank() {
 
 Common::String Parser::totalTime() {
 	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	const double ticksInOneSec = (double)(65535) / 3600;
+	const float ticksInOneSec = (float)(65535) / 3600;
 	uint16 h, m, s;
 
 	h = (uint16)floor(_vm->_totalTime / ticksInOneSec); // No. of seconds.


Commit: 61983d027a590400acd0a5f6b6ff8250d42fb460
    https://github.com/scummvm/scummvm/commit/61983d027a590400acd0a5f6b6ff8250d42fb460
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-05T15:24:11-07:00

Commit Message:
AVALANCHE: Add a comment to Dialogs::stripTrailingSpaces().

Changed paths:
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index fdc90bb..e126e5e 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -580,6 +580,7 @@ Common::String Dialogs::displayMoney() {
 void Dialogs::stripTrailingSpaces(Common::String &str) {
 	while (str.lastChar() == ' ')
 		str.deleteLastChar();
+	// We don't use String::trim() here because we need the leading whitespaces.
 }
 
 /**


Commit: fed85464440fbe08e8f99edfddb018519b680a69
    https://github.com/scummvm/scummvm/commit/fed85464440fbe08e8f99edfddb018519b680a69
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-05T16:20:20-07:00

Commit Message:
AVALANCHE: Update credit files.

Changed paths:
    AUTHORS
    devtools/credits.pl
    gui/credits.h



diff --git a/AUTHORS b/AUTHORS
index fd5407b..e561aec 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -61,6 +61,10 @@ ScummVM Team
        Travis Howell
        Oliver Kiehl            - (retired)
        Ludvig Strigeus         - (retired)
+	   
+	AVALANCHE:
+	   Peter Bozso
+	   Arnaud Boutonne
 
     CGE:
        Arnaud Boutonne
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 45018a5..50efb42 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -541,6 +541,11 @@ begin_credits("Credits");
 				add_person("Oliver Kiehl", "olki", "(retired)");
 				add_person("Ludvig Strigeus", "ludde", "(retired)");
 			end_section();
+			
+			begin_section("AVALANCHE");
+				add_person("Peter Bozs&oacute", "uruk", "");
+				add_person("Arnaud Boutonné", "Strangerke", "");
+			end_section();
 
 			begin_section("CGE");
 				add_person("Arnaud Boutonné", "Strangerke", "");
diff --git a/gui/credits.h b/gui/credits.h
index 3a4d776..6bb0523 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -77,6 +77,11 @@ static const char *credits[] = {
 "C0""Ludvig Strigeus",
 "C2""(retired)",
 "",
+"C1""AVALANCHE",
+"A0""Peter Bozso",
+"C0""Peter Bozs\363",
+"C0""Arnaud Boutonn\351",
+"",
 "C1""CGE",
 "A0""Arnaud Boutonne",
 "C0""Arnaud Boutonn\351",


Commit: 14dee780e07ec819a3ed2520e326bed2d056460f
    https://github.com/scummvm/scummvm/commit/14dee780e07ec819a3ed2520e326bed2d056460f
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-06T01:35:58-07:00

Commit Message:
AVALANCHE: Get rid of FP in Parser::totalTime().

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 05d4026..5d8e50c 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -532,11 +532,9 @@ Common::String Parser::rank() {
 }
 
 Common::String Parser::totalTime() {
-	// There are 65535 clock ticks in a second, 1092.25 in a minute, and 65535 in an hour.
-	const float ticksInOneSec = (float)(65535) / 3600;
 	uint16 h, m, s;
 
-	h = (uint16)floor(_vm->_totalTime / ticksInOneSec); // No. of seconds.
+	h = (uint16) _vm->_totalTime / 65535 / 3600;
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;


Commit: ac231eb83870c189261b231d44eff366e354b6dd
    https://github.com/scummvm/scummvm/commit/ac231eb83870c189261b231d44eff366e354b6dd
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T05:22:42-07:00

Commit Message:
AVALANCHE: Rework totalTime()

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 5d8e50c..98deefa 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -534,7 +534,7 @@ Common::String Parser::rank() {
 Common::String Parser::totalTime() {
 	uint16 h, m, s;
 
-	h = (uint16) _vm->_totalTime / 65535 / 3600;
+	h = (uint16)((_vm->_totalTime * 3600) / 65535);
 	m = h % 3600;
 	h /= 3600;
 	s = m % 60;


Commit: 6216430428724e8d833736d00cb807b14507bd9c
    https://github.com/scummvm/scummvm/commit/6216430428724e8d833736d00cb807b14507bd9c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T05:38:52-07:00

Commit Message:
AVALANCHE: Rework bearing()

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e6cf310..8e70d7b 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -30,7 +30,6 @@
 #include "avalanche/avalanche.h"
 #include "common/random.h"
 #include "common/config-manager.h"
-#include <math.h>
 
 namespace Avalanche {
 
@@ -1361,16 +1360,18 @@ void AvalancheEngine::majorRedraw() {
 }
 
 uint16 AvalancheEngine::bearing(byte whichPed) {
-	const float rad2deg = 180 / M_PI;
 	AnimationType *avvy = &_animation->_sprites[0];
 	PedType *curPed = &_peds[whichPed];
 
 	if (avvy->_x == curPed->_x)
 		return 0;
-	else if (avvy->_x < curPed->_x) {
-		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 90);
+	
+	int16 deltaX = avvy->_x - curPed->_x;
+	int16 deltaY = avvy->_y - curPed->_y;
+	if (deltaX < 0) {
+		return (uint16)((atan((float)(deltaY / deltaX)) * 180 / M_PI) + 90);
 	} else {
-		return (uint16)((atan(double((avvy->_y - curPed->_y)) / (avvy->_x - curPed->_x)) * rad2deg) + 270);
+		return (uint16)((atan((float)(deltaY / deltaX)) * 180 / M_PI) + 270);
 	}
 }
 


Commit: b7f7644cc64afaa5c470e663fbd9387564856e88
    https://github.com/scummvm/scummvm/commit/b7f7644cc64afaa5c470e663fbd9387564856e88
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-06T05:47:30-07:00

Commit Message:
AVALANCHE: Fix potential integer overflow

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 98deefa..a9f9ea2 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -534,11 +534,10 @@ Common::String Parser::rank() {
 Common::String Parser::totalTime() {
 	uint16 h, m, s;
 
-	h = (uint16)((_vm->_totalTime * 3600) / 65535);
-	m = h % 3600;
-	h /= 3600;
-	s = m % 60;
-	m /= 60;
+	h = (uint16)(_vm->_totalTime / 65535);
+	s = (uint16)(_vm->_totalTime % 65535);
+	m = s / 60;
+	s = s % 60;
 
 	Common::String result = "You've been playing for ";
 	if (h > 0)


Commit: c99061e7c568454b0dcc209a49f82f75276e5c5a
    https://github.com/scummvm/scummvm/commit/c99061e7c568454b0dcc209a49f82f75276e5c5a
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-06T05:50:02-07:00

Commit Message:
AVALANCHE: Fix time output

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index a9f9ea2..fb2008d 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -543,7 +543,7 @@ Common::String Parser::totalTime() {
 	if (h > 0)
 		result += Common::String::format("%d hours, ", h);
 	if ((m > 0) || (h != 0))
-		result = Common::String::format("%d minutes and ", m);
+		result += Common::String::format("%d minutes and ", m);
 	return result + Common::String::format("%d seconds", s);
 }
 


Commit: a246dbad26de4e90dceb29b2b0fbd438b1e6072d
    https://github.com/scummvm/scummvm/commit/a246dbad26de4e90dceb29b2b0fbd438b1e6072d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T17:14:19-07:00

Commit Message:
AVALANCHE: Fix parser bug when pressing F5

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index fb2008d..bfce880 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -415,7 +415,7 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 		_person = kPeoplePardon;
 		_thing = kPardon;
 		Common::String f5does = _vm->f5Does();
-		VerbCode verb = (VerbCode)f5does[0];
+		VerbCode verb = (VerbCode)(byte)f5does[0];
 		_vm->callVerb(verb);
 		}
 		break;


Commit: a30cc19ca84562d79fa20343c5e8f01ef3355b0b
    https://github.com/scummvm/scummvm/commit/a30cc19ca84562d79fa20343c5e8f01ef3355b0b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T17:18:09-07:00

Commit Message:
AVALANCHE: Fix two other broken verb usages

Changed paths:
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 1f349d2..c799ef0 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -578,7 +578,7 @@ void Menu::runMenuAction() {
 		_vm->_parser->_person = kPeoplePardon;
 		_vm->_parser->_thing = _vm->_parser->kPardon;
 		Common::String f5Does = _vm->f5Does();
-		VerbCode verb = (VerbCode)f5Does[0];
+		VerbCode verb = (VerbCode)(byte)f5Does[0];
 		_vm->callVerb(verb);
 		}
 		break;
@@ -659,7 +659,7 @@ void Menu::runMenuWith() {
 			_vm->_subjectNum = 0;
 		}
 	}
-	_vm->callVerb((VerbCode)_verbStr[_activeMenuItem._choiceNum]);
+	_vm->callVerb((VerbCode)(byte)_verbStr[_activeMenuItem._choiceNum]);
 }
 
 void Menu::setup() {


Commit: 8430288fef4f831f51261b32e4ad1640006fad72
    https://github.com/scummvm/scummvm/commit/8430288fef4f831f51261b32e4ad1640006fad72
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T17:52:41-07:00

Commit Message:
AVALANCHE: Hook some more function keys

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index bfce880..e3383c7 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -411,6 +411,26 @@ void Parser::handleReturn() {
 
 void Parser::handleFunctionKey(const Common::Event &event) {
 	switch (event.kbd.keycode) {
+	case Common::KEYCODE_F1:
+		_vm->callVerb(kVerbCodeHelp);
+		break;
+	case Common::KEYCODE_F2:
+		if (event.kbd.flags & Common::KBD_CTRL) {
+			clearWords();
+			_vm->callVerb(kVerbCodeSave);
+		} else
+			_vm->_sound->toggleSound();
+		break;
+	case Common::KEYCODE_F3:
+		if (event.kbd.flags & Common::KBD_CTRL) {
+			clearWords();
+			_vm->callVerb(kVerbCodeLoad);
+		} else if (_inputText.size() < _inputTextBackup.size()) {
+			_inputText = _inputText + &(_inputTextBackup.c_str()[_inputText.size()]);
+			_inputTextPos = _inputText.size();
+			plotText();
+		}
+		break;
 	case Common::KEYCODE_F5: {
 		_person = kPeoplePardon;
 		_thing = kPardon;
@@ -422,6 +442,14 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 	case Common::KEYCODE_F7:
 		_vm->callVerb(kVerbCodeOpen);
 		break;
+	case Common::KEYCODE_F11:
+		clearWords();
+		_vm->callVerb(kVerbCodeSave);
+		break;
+	case Common::KEYCODE_F12:
+		clearWords();
+		_vm->callVerb(kVerbCodeLoad);
+		break;
 	default:
 		break;
 	}


Commit: 31b01f0d11307b82d3eeedbda9d70fe651313058
    https://github.com/scummvm/scummvm/commit/31b01f0d11307b82d3eeedbda9d70fe651313058
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-06T22:15:54-07:00

Commit Message:
AVALANCHE: Add save/load code

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e3383c7..6bca476 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -28,6 +28,8 @@
 #include "avalanche/avalanche.h"
 #include "avalanche/parser.h"
 
+#include "gui/saveload.h"
+
 namespace Avalanche {
 
 const char *Parser::kCopyright = "1995";
@@ -1789,9 +1791,28 @@ void Parser::doThat() {
 			swallow();
 		break;
 
-	case kVerbCodeLoad:
+	case kVerbCodeLoad: {
+		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore", false);
+		int16 savegameId = dialog->runModalWithCurrentTarget();
+		delete dialog;
+
+		if (savegameId < 0)                             // dialog aborted
+			return;
+		
+		_vm->loadGame(savegameId);
+		}
 		break;
-	case kVerbCodeSave:
+	case kVerbCodeSave: {
+		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save", true);
+		int16 savegameId = dialog->runModalWithCurrentTarget();
+		Common::String savegameDescription = dialog->getResultString();
+		delete dialog;
+
+		if (savegameId < 0)                             // dialog aborted
+			return;
+
+		_vm->saveGame(savegameId, savegameDescription);
+		}
 		break;
 	// We don't handle these two because we use ScummVM's save/load system.
 


Commit: 77c10447c3e3d52247598e6ce6c1531f87883ec8
    https://github.com/scummvm/scummvm/commit/77c10447c3e3d52247598e6ce6c1531f87883ec8
Author: uruk (koppirnyo at gmail.com)
Date: 2013-10-07T01:04:53-07:00

Commit Message:
AVALANCHE: Repair credits.h

Changed paths:
    gui/credits.h



diff --git a/gui/credits.h b/gui/credits.h
index 6bb0523..e375fa0 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -79,6 +79,7 @@ static const char *credits[] = {
 "",
 "C1""AVALANCHE",
 "A0""Peter Bozso",
+"A0""Arnaud Boutonne",
 "C0""Peter Bozs\363",
 "C0""Arnaud Boutonn\351",
 "",


Commit: 7b11be0a9245875fe6cd48ffd9e3f2f325d98c23
    https://github.com/scummvm/scummvm/commit/7b11be0a9245875fe6cd48ffd9e3f2f325d98c23
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T13:26:33-07:00

Commit Message:
AVALANCHE: Fix savegame patterns

Changed paths:
    engines/avalanche/detection.cpp
    gui/credits.h



diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 38700af..e454221 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -111,7 +111,7 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 	Common::StringArray filenames;
 	Common::String pattern = target;
 	pattern.toUppercase();
-	pattern += "-??.SAV";
+	pattern += ".???";
 
 	filenames = saveFileMan->listSavefiles(pattern);
 	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
@@ -164,12 +164,12 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 }
 
 void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const {
-	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	Common::String fileName = Common::String::format("%s.%03d", target, slot);
 	g_system->getSavefileManager()->removeSavefile(fileName);
 }
 
 SaveStateDescriptor AvalancheMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
-	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	Common::String fileName = Common::String::format("%s.%03d", target, slot);
 	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
 
 	if (f) {
diff --git a/gui/credits.h b/gui/credits.h
index e375fa0..74b1de8 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -79,8 +79,8 @@ static const char *credits[] = {
 "",
 "C1""AVALANCHE",
 "A0""Peter Bozso",
-"A0""Arnaud Boutonne",
 "C0""Peter Bozs\363",
+"A0""Arnaud Boutonne",
 "C0""Arnaud Boutonn\351",
 "",
 "C1""CGE",


Commit: c36adb83e2820dd6ad0f612c5a3a05a001220656
    https://github.com/scummvm/scummvm/commit/c36adb83e2820dd6ad0f612c5a3a05a001220656
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T13:38:32-07:00

Commit Message:
AVALANCHE: Fix savegames list

Changed paths:
    engines/avalanche/detection.cpp



diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index e454221..428e71f 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -117,15 +117,11 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
 	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
 
 	SaveStateList saveList;
-	char slot[3];
 	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
-		slot[0] = filename->c_str()[filename->size() - 6];
-		slot[1] = filename->c_str()[filename->size() - 5];
-		slot[2] = '\0';
-		// Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot
-		int slotNum = atoi(slot);
+		const Common::String &fname = *filename;
+		int slotNum = atoi(fname.c_str() + fname.size() - 3);
 		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
-			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+			Common::InSaveFile *file = saveFileMan->openForLoading(fname);
 			if (file) {
 				// Check for our signature.
 				uint32 signature = file->readUint32LE();


Commit: 10b4495b518b5143ba97cdcda738d678c4348b1f
    https://github.com/scummvm/scummvm/commit/10b4495b518b5143ba97cdcda738d678c4348b1f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T15:02:32-07:00

Commit Message:
AVALANCHE: Hook some more function keys

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 6bca476..e8ef17c 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -433,6 +433,12 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 			plotText();
 		}
 		break;
+	case Common::KEYCODE_F4:
+		if (event.kbd.flags & Common::KBD_ALT)
+			_vm->callVerb(kVerbCodeQuit);
+		else
+			_vm->callVerb(kVerbCodeRestart);
+		break;
 	case Common::KEYCODE_F5: {
 		_person = kPeoplePardon;
 		_thing = kPardon;
@@ -441,8 +447,23 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 		_vm->callVerb(verb);
 		}
 		break;
+	case Common::KEYCODE_F6:
+		_vm->callVerb(kVerbCodePause);
+		break;
 	case Common::KEYCODE_F7:
-		_vm->callVerb(kVerbCodeOpen);
+		if (event.kbd.flags & Common::KBD_CTRL)
+			_vm->majorRedraw();
+		else
+			_vm->callVerb(kVerbCodeOpen);
+		break;
+	case Common::KEYCODE_F8:
+		_vm->callVerb(kVerbCodeLook);
+		break;
+	case Common::KEYCODE_F9:
+		_vm->callVerb(kVerbCodeScore);
+		break;
+	case Common::KEYCODE_F10:
+		_vm->callVerb(kVerbCodeQuit);
 		break;
 	case Common::KEYCODE_F11:
 		clearWords();


Commit: eebbdfbfb364b01d1e9b79141e6cccdff5d2667a
    https://github.com/scummvm/scummvm/commit/eebbdfbfb364b01d1e9b79141e6cccdff5d2667a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T21:42:52-07:00

Commit Message:
AVALANCHE: Add code for Shift-F10

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index e8ef17c..eb94ae5 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -463,7 +463,10 @@ void Parser::handleFunctionKey(const Common::Event &event) {
 		_vm->callVerb(kVerbCodeScore);
 		break;
 	case Common::KEYCODE_F10:
-		_vm->callVerb(kVerbCodeQuit);
+		if (event.kbd.flags & Common::KBD_SHIFT)
+			_vm->callVerb(kVerbCodeInfo);
+		else
+			_vm->callVerb(kVerbCodeQuit);
 		break;
 	case Common::KEYCODE_F11:
 		clearWords();


Commit: 0bfe150dca3ede26a5fab9b95003f0a4d8eaf87f
    https://github.com/scummvm/scummvm/commit/0bfe150dca3ede26a5fab9b95003f0a4d8eaf87f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T21:43:36-07:00

Commit Message:
AVALANCHE: Fix coding conventions in Graphics

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index d442c13..bfeb727 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -265,16 +265,16 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16
 		int16 ym = y - yTemp;
 
 		if ((j >= stAngle) && (j <= endAngle))
-			*(byte *)_scrolls.getBasePtr(xp,yp) = color;
+			*(byte *)_scrolls.getBasePtr(xp, yp) = color;
 
-		if (((180-j) >= stAngle) && ((180-j) <= endAngle))
-			*(byte *)_scrolls.getBasePtr(xm,yp) = color;
+		if (((180 - j) >= stAngle) && ((180 - j) <= endAngle))
+			*(byte *)_scrolls.getBasePtr(xm, yp) = color;
 
-		if (((j+180) >= stAngle) && ((j+180) <= endAngle))
-			*(byte *)_scrolls.getBasePtr(xm,ym) = color;
+		if (((j + 180) >= stAngle) && ((j + 180) <= endAngle))
+			*(byte *)_scrolls.getBasePtr(xm, ym) = color;
 
-		if (((360-j) >= stAngle) && ((360-j) <= endAngle))
-			*(byte *)_scrolls.getBasePtr(xp,ym) = color;
+		if (((360 - j) >= stAngle) && ((360 - j) <= endAngle))
+			*(byte *)_scrolls.getBasePtr(xp, ym) = color;
 
 		j += delta;
 	} while (j <= deltaEnd);


Commit: cf36706b98ccc73ec50dd338a473f0672d0dff17
    https://github.com/scummvm/scummvm/commit/cf36706b98ccc73ec50dd338a473f0672d0dff17
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-07T22:15:58-07:00

Commit Message:
AVALANCHE: Remove empty case in verb handling, clarify output when the opcode is unhandled

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index eb94ae5..48000a9 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -2258,9 +2258,6 @@ void Parser::doThat() {
 				_vm->_dialogs->displayScrollChain('Q', 12);
 		}
 		break;
-	case kVerbCodeDir:
-		//_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)!
-		break;
 	case kVerbCodeDie:
 		_vm->gameOver();
 		break;
@@ -2380,7 +2377,7 @@ void Parser::doThat() {
 		}
 		break;
 	default:
-		Common::String tmpStr = Common::String::format("%cParser bug!", kControlBell);
+		Common::String tmpStr = Common::String::format("%cUnhandled verb: %d", kControlBell, _verb);
 		_vm->_dialogs->displayText(tmpStr);
 	}
 }


Commit: b0255c9406d2e90b076e7f9c5f42049e4e0ba2d4
    https://github.com/scummvm/scummvm/commit/b0255c9406d2e90b076e7f9c5f42049e4e0ba2d4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-08T21:45:51-07:00

Commit Message:
AVALANCHE: Implement fadeIn and fadeOut (dusk and dawn)

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/pingo.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 6a7bad1..08fe320 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -769,7 +769,7 @@ void Animation::callSpecial(uint16 which) {
 		}
 		break;
 	case 4: // This is the ghost room link.
-		_vm->dusk();
+		_vm->fadeOut();
 		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
 		//_vm->_enid->backToBootstrap(3); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
@@ -837,7 +837,7 @@ void Animation::callSpecial(uint16 which) {
 				return;
 			}
 		}
-		_vm->dusk();
+		_vm->fadeOut();
 		_vm->_catacombY--;
 		catacombMove(4);
 		if (_vm->_room != kRoomCatacombs)
@@ -855,7 +855,7 @@ void Animation::callSpecial(uint16 which) {
 		dawnDelay();
 		break;
 	case 11: // _vm->special 11: transfer east in catacombs.
-		_vm->dusk();
+		_vm->fadeOut();
 		_vm->_catacombX++;
 		catacombMove(1);
 		if (_vm->_room != kRoomCatacombs)
@@ -864,7 +864,7 @@ void Animation::callSpecial(uint16 which) {
 		dawnDelay();
 		break;
 	case 12: // _vm->special 12: transfer south in catacombs.
-		_vm->dusk();
+		_vm->fadeOut();
 		_vm->_catacombY++;
 		catacombMove(2);
 		if (_vm->_room != kRoomCatacombs)
@@ -873,7 +873,7 @@ void Animation::callSpecial(uint16 which) {
 		dawnDelay();
 		break;
 	case 13: // _vm->special 13: transfer west in catacombs.
-		_vm->dusk();
+		_vm->fadeOut();
 		_vm->_catacombX--;
 		catacombMove(3);
 		if (_vm->_room != kRoomCatacombs)
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 43943f2..3e0bdb0 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -50,6 +50,8 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 
 	_totalTime = 0;
 	_showDebugLines = false;
+
+	memset(_fxPal, 0, 16 * 16 * 3);
 }
 
 AvalancheEngine::~AvalancheEngine() {
@@ -359,7 +361,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 
 	if (_holdTheDawn) {
 		_holdTheDawn = false;
-		dawn();
+		fadeIn();
 	}
 
 	_background->release();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 1ef5d50..e9d2b1e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -274,8 +274,8 @@ public:
 	void fxToggle();
 	void refreshObjectList();
 	void errorLed();
-	void dusk();
-	void dawn();
+	void fadeOut();
+	void fadeIn();
 	void drawDirection(); // Draws the little icon at the left end of the text input field.
 	void gameOver();
 	uint16 bearing(byte whichPed); // Returns the bearing from ped 'whichped' to Avvy, in degrees.
@@ -306,6 +306,8 @@ private:
 
 	// Will be used in dusk() and dawn().
 	bool _fxHidden;
+	byte _fxPal[16][16][3];
+
 	bool _spludwickAtHome; // Is Spludwick at home?
 	bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
 	bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
@@ -328,8 +330,6 @@ private:
 	void findPeople(byte room);
 	void putGeidaAt(byte whichPed, byte ped);
 	void guideAvvy(Common::Point cursorPos);
-	void fadeOut(byte n);
-	void fadeIn(byte n);
 	void enterRoom(Room room, byte ped);
 	void exitRoom(byte x);
 	void drawToolbar();
@@ -339,8 +339,6 @@ private:
 	void fixFlashers();
 	void loadAlso(byte num);
 	void resetVariables();
-
-	int8 fades(int8 x);
 };
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 8e70d7b..2da1aea 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -28,8 +28,11 @@
 /* AVALOT		The kernel of the program. */
 
 #include "avalanche/avalanche.h"
+
 #include "common/random.h"
+#include "common/system.h"
 #include "common/config-manager.h"
+#include "graphics/palette.h"
 
 namespace Avalanche {
 
@@ -297,7 +300,7 @@ void AvalancheEngine::setup() {
 	init();
 
 	_dialogs->reset();
-	dusk();
+	fadeOut();
 	_graphics->loadDigits();
 
 	_parser->_inputTextPos = 0;
@@ -308,7 +311,7 @@ void AvalancheEngine::setup() {
 	drawToolbar();
 	_dialogs->setReadyLight(2);
 
-	dawn();
+	fadeIn();
 	_parser->_cursorState = false;
 	_parser->cursorOn();
 	_animation->_sprites[0]._speedX = kWalk;
@@ -376,7 +379,6 @@ void AvalancheEngine::init() {
 #endif
 
 	_letMeOut = false;
-	_holdTheDawn = true;
 	_currentMouse = 177;
 	_dropsOk = true;
 	_mouseText = "";
@@ -837,7 +839,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomMap:
 		// You're entering the map.
-		dawn();
+		fadeIn();
 		if (ped > 0)
 			_graphics->zoomOut(_peds[ped]._x, _peds[ped]._y);
 
@@ -1294,25 +1296,72 @@ void AvalancheEngine::errorLed() {
 	warning("STUB: errorled()");
 }
 
-int8 AvalancheEngine::fades(int8 x) {
-	warning("STUB: fades()");
-	return 0;
-}
+/**
+ * Displays a fade out, full screen.
+ * This version is different to the one in the original, which was fading in 3 steps.
+ * @remarks	Originally called 'dusk'
+ */
+void AvalancheEngine::fadeOut() {
+	byte pal[3], tmpPal[3];
 
-void AvalancheEngine::fadeOut(byte n) {
-	warning("STUB: fadeOut()");
-}
+	_graphics->setBackgroundColor(kColorBlack);
+	if (_fxHidden)
+		return;
+	_fxHidden = true;
+
+	for (int i = 0; i < 16; i++) {
+		for (int j = 0; j < 16; j++) {
+			g_system->getPaletteManager()->grabPalette((byte *)tmpPal, j, 1);
+			_fxPal[i][j][0] = tmpPal[0];
+			_fxPal[i][j][1] = tmpPal[1];
+			_fxPal[i][j][2] = tmpPal[2];
+			if (tmpPal[0] >= 16)
+				pal[0] = tmpPal[0] - 16;
+			else
+				pal[0] = 0;
 
-void AvalancheEngine::dusk() {
-	warning("STUB: dusk()");
-}
+			if (tmpPal[1] >= 16)
+				pal[1] = tmpPal[1] - 16;
+			else
+				pal[1] = 0;
 
-void AvalancheEngine::fadeIn(byte n) {
-	warning("STUB: fadeIn()");
+			if (tmpPal[2] >= 16)
+				pal[2] = tmpPal[2] - 16;
+			else
+				pal[2] = 0;
+
+			g_system->getPaletteManager()->setPalette(pal, j, 1);
+		}
+		_system->delayMillis(10);
+		_graphics->refreshScreen();
+	}
 }
 
-void AvalancheEngine::dawn() {
-	warning("STUB: dawn()");
+/**
+ * Displays a fade in, full screen.
+ * This version is different to the one in the original, which was fading in 3 steps.
+ * @remarks	Originally called 'dawn'
+ */
+void AvalancheEngine::fadeIn() {
+	if (_holdTheDawn || !_fxHidden)
+		return;
+	
+	_fxHidden = false;
+	
+	byte pal[3];
+	for (int i = 15; i >= 0; i--) {
+		for (int j = 0; j < 16; j++) {
+			pal[0] = _fxPal[i][j][0];
+			pal[1] = _fxPal[i][j][1];
+			pal[2] = _fxPal[i][j][2];
+			g_system->getPaletteManager()->setPalette(pal, j, 1);
+		}
+		_system->delayMillis(10);
+		_graphics->refreshScreen();
+	}
+
+	if ((_room == kRoomYours) && _avvyInBed && _teetotal)
+		_graphics->setBackgroundColor(kColorYellow);
 }
 
 void AvalancheEngine::drawDirection() { // It's data is loaded in load_digits().
@@ -1344,7 +1393,7 @@ void AvalancheEngine::gameOver() {
 }
 
 void AvalancheEngine::minorRedraw() {
-	dusk();
+	fadeOut();
 
 	enterRoom(_room, 0); // Ped unknown or non-existant.
 
@@ -1352,7 +1401,7 @@ void AvalancheEngine::minorRedraw() {
 		_scoreToDisplay[i] = -1; // impossible digits
 	drawScore();
 
-	dawn();
+	fadeIn();
 }
 
 void AvalancheEngine::majorRedraw() {
@@ -1652,7 +1701,7 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 	}
 
 	exitRoom(_room);
-	dusk();
+	fadeOut();
 
 	for (int16 i = 1; i < _animation->kSpriteNumbMax; i++) {
 		if (_animation->_sprites[i]._quick)
@@ -1669,7 +1718,7 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 	_animation->setDirection(_animation->_sprites[0]._facingDir);
 	drawDirection();
 
-	dawn();
+	fadeIn();
 }
 
 /**
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index bfeb727..0414bf5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -748,7 +748,7 @@ void GraphicManager::setDialogColor(Color bg, Color text) {
 
 // Original name background()
 void GraphicManager::setBackgroundColor(Color x) {
-	warning("STUB: setBackgroundColor(%d)", x);
+	warning("STUB: setBackgroundColor()");
 }
 
 } // End of namespace Avalanche
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 48000a9..ca97d4d 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1421,7 +1421,7 @@ void Parser::drink() {
 		_vm->_avvyIsAwake = false;
 		_vm->_avvyInBed = true;
 		_vm->refreshObjectList();
-		_vm->dusk();
+		_vm->fadeOut();
 		_vm->flipRoom(kRoomYours, 1);
 		_vm->_graphics->setBackgroundColor(kColorYellow);
 		_vm->_animation->_sprites[0]._visible = false;
@@ -2348,17 +2348,17 @@ void Parser::doThat() {
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else { // Default doodah.
-			_vm->dusk();
-			_vm->dawn();
+			_vm->fadeOut();
+			_vm->fadeIn();
 			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", kControlParagraph);
 			_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeRestart:
 		if (_vm->_dialogs->displayQuestion("Restart game and lose changes?"))  {
-			_vm->dusk();
+			_vm->fadeOut();
 			_vm->newGame();
-			_vm->dawn();
+			_vm->fadeIn();
 		}
 		break;
 	case kVerbCodePardon:
@@ -2383,12 +2383,12 @@ void Parser::doThat() {
 }
 
 void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
+	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
 	switch (verb) {
 	case kVerbCodeExam:
 		answer = "Examine";
 		ansKey = 'x';
-		break; // The ubiquitous one.
-	// kVerbCodegive isn't dealt with by this procedure, but by ddm__with.
+		break;
 	case kVerbCodeDrink:
 		answer = "Drink";
 		ansKey = 'D';
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 7b45397..433924f 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -70,7 +70,7 @@ void Pingo::zonk() {
 
 void Pingo::winningPic() {
 	Common::File f;
-	_vm->dusk();
+	_vm->fadeOut();
 
 	if (!f.open("finale.avd"))
 		error("AVALANCHE: File not found: finale.avd");
@@ -89,7 +89,7 @@ void Pingo::winningPic() {
 
 	warning("STUB: Pingo::winningPic()");
 
-	_vm->dawn();
+	_vm->fadeIn();
 
 #if 0
 	do {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 28cdc3b..b4ba028 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -149,7 +149,7 @@ void Timer::updateTimer() {
 				crapulusSaysSpludOut();
 				break;
 			case kProcDawnDelay:
-				_vm->dawn();
+				_vm->fadeIn();
 				break;
 			case kProcBuyDrinks:
 				buyDrinks();


Commit: 72e55fab7001166dfe04d000171435d6eb948e85
    https://github.com/scummvm/scummvm/commit/72e55fab7001166dfe04d000171435d6eb948e85
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-10T22:54:42-07:00

Commit Message:
AVALANCHE: Implement Bleep(), improve one comment

Changed paths:
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index c799ef0..4768f3e 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -333,7 +333,7 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo
 }
 
 void Menu::bleep() {
-	warning("STUB: Menu::bleep()");
+	_vm->_sound->playNote(177, 7);
 }
 
 void Menu::parseKey(char r, char re) {
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index ca97d4d..b9b1795 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -2006,7 +2006,7 @@ void Parser::doThat() {
 			if (_thing == kObjectBell) {
 				_vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong...");
 				if ((_vm->_bellsAreRinging) & (_vm->getFlag('B')))
-					// \? are used to avoid that ??! is parsed as a trigraph
+					// '\?' are used to avoid that '??!' is parsed as a trigraph
 					_vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)");
 			} else
 				_vm->_dialogs->displayText(kWhat);


Commit: f76284a95eb84f1a44da4c902c1e0ef802f15866
    https://github.com/scummvm/scummvm/commit/f76284a95eb84f1a44da4c902c1e0ef802f15866
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-10T23:01:43-07:00

Commit Message:
AVALANCHE: Polish 'File' menu

Changed paths:
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 4768f3e..d40397f 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -553,17 +553,15 @@ void Menu::runMenuFile() {
 			_vm->_parser->_realWords[1].clear();
 		_vm->callVerb(kVerbCodeLoad);
 		break;
+	// Case 2 is 'Save', Case 3 is 'Save As'. Both triggers ScummVM save screen.
 	case 2:
+	case 3:
 		if (!_vm->_parser->_realWords[1].empty())
 			_vm->_parser->_realWords[1].clear();
 		_vm->callVerb(kVerbCodeSave);
 		break;
-	case 3:
-		//_vm->_basher->filename_edit();
-		warning("STUB: Dropdown::runMenuFile()");
-		break;
 	case 4:
-		//_vm->_enid->backToBootstrap(2); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
+		// Command Prompt, disabled
 		break;
 	case 5:
 		_vm->callVerb(kVerbCodeQuit);


Commit: d202d898da38de1b56f4784c24398ffeb3351e09
    https://github.com/scummvm/scummvm/commit/d202d898da38de1b56f4784c24398ffeb3351e09
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-10T23:06:16-07:00

Commit Message:
AVALANCHE: Remove code duplicate in runMenuWith()

Changed paths:
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index d40397f..1f7006a 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -628,21 +628,15 @@ void Menu::runMenuWith() {
 	} else {
 		switch (_verbStr[_activeMenuItem._choiceNum]) {
 		case 100: // Beer
-			_vm->_parser->_thing = 100;
+		case 102: // Whisky
+		case 103: // Cider
+			_vm->_parser->_thing = _verbStr[_activeMenuItem._choiceNum];
 			_vm->callVerb(kVerbCodeBuy);
 			return;
 		case 101: // Wine
 			_vm->_parser->_thing = 50;
 			_vm->callVerb(kVerbCodeBuy);
 			return;
-		case 102: // Whisky
-			_vm->_parser->_thing = 102;
-			_vm->callVerb(kVerbCodeBuy);
-			return;
-		case 103: // Cider
-			_vm->_parser->_thing = 103;
-			_vm->callVerb(kVerbCodeBuy);
-			return;
 		case 104: // Mead
 			_vm->_parser->_thing = 107;
 			_vm->callVerb(kVerbCodeBuy);
@@ -833,6 +827,6 @@ void Menu::init() {
 }
 
 void Menu::resetVariables() {
-	_lastPerson = kPeoplePardon; // = Pardon?
+	_lastPerson = kPeoplePardon;
 }
 } // End of namespace Avalanche.


Commit: aba6b02b5b2bf7cb822e2d35023d2927622d007f
    https://github.com/scummvm/scummvm/commit/aba6b02b5b2bf7cb822e2d35023d2927622d007f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-10T23:10:43-07:00

Commit Message:
AVALANCHE: Fix two blocking loops not checking shouldQuit()

Changed paths:
    engines/avalanche/menu.cpp



diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 1f7006a..f722b12 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -676,7 +676,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 		_menuBar.chooseMenuItem(cursorPos.x);
 		do
 			_vm->updateEvents();
-		while (_vm->_holdLeftMouse);
+		while (_vm->_holdLeftMouse && !_vm->shouldQuit());
 
 		while (!_vm->shouldQuit()) {
 			do {
@@ -698,7 +698,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it...
 				_activeMenuItem.lightUp(cursorPos);
 
 				_vm->_graphics->refreshScreen();
-			} while (!_vm->_holdLeftMouse);
+			} while (!_vm->_holdLeftMouse && !_vm->shouldQuit());
 
 			if (_vm->_holdLeftMouse) {
 				if (cursorPos.y > 21) {


Commit: ccebfc78fdb1b9e330897e0119cd87b59344154a
    https://github.com/scummvm/scummvm/commit/ccebfc78fdb1b9e330897e0119cd87b59344154a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-10T23:16:38-07:00

Commit Message:
AVALANCHE: Remove useless check and move some comments in Sequence

Changed paths:
    engines/avalanche/sequence.cpp



diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index a9de50f..10fa7f0 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -70,9 +70,12 @@ void Sequence::startTimer() {
 }
 
 void Sequence::startTimerImmobilized() {
-	_vm->_userMovesAvvy = false; // They can't move.
-	_vm->_animation->stopWalking(); // And they're not moving now.
-	startTimer(); // Apart from that, it's the same thing.
+	// They can't move.
+	_vm->_userMovesAvvy = false;
+	// And they're not moving now.
+	_vm->_animation->stopWalking();
+	// Apart from that, it's the same thing.
+	startTimer();
 }
 
 void Sequence::shoveLeft() {
@@ -86,23 +89,25 @@ void Sequence::callSequencer() {
 
 	switch (curSeq) {
 	case 0:
-		return; // No more routines.
+		// No more routines.
+		return;
 		break;
-	case kNowFlip: // Flip room.
+	case kNowFlip:
+		// Flip room.
 		_vm->_userMovesAvvy = true;
 		_vm->flipRoom(_flipToWhere, _flipToPed);
-		// CHECKME: Always true?
-		if (curSeq == kNowFlip)
-			shoveLeft();
+		shoveLeft();
 		break;
 	}
 
-	if (curSeq <= 176) { // Show a frame.
+	if (curSeq <= 176) {
+		// Show a frame.
 		_vm->_background->draw(-1, -1, curSeq - 1);
 		shoveLeft();
 	}
 
-	startTimer(); // Make sure this PROC gets called again.
+	// Make sure this PROC gets called again.
+	startTimer();
 }
 
 void Sequence::startHallSeq(Room whither, byte ped) {
@@ -164,8 +169,10 @@ void Sequence::startMusicRoomSeq2(Room whither, byte ped) {
 
 void Sequence::startGeidaLuteSeq() {
 	init(5);
-	add(6); // He falls asleep...
-	startTimer(); // Not really closing, but we're using the same procedure.
+	// He falls asleep...
+	add(6);
+	// Not really closing, but we're using the same procedure.
+	startTimer();
 }
 
 void Sequence::startMusicRoomSeq() {


Commit: 46c5bfa50889eacbf88620fbccf5c3b435565875
    https://github.com/scummvm/scummvm/commit/46c5bfa50889eacbf88620fbccf5c3b435565875
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-11T16:52:43-07:00

Commit Message:
AVALANCHE: Move some variables around

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 08fe320..e873415 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -32,6 +32,20 @@
 
 namespace Avalanche {
 
+// Art gallery at 2,1; notice about this at 2,2.
+const int32 Animation::kCatacombMap[8][8] = {
+	// Geida's room
+	// 1	   2	   3	   4	   5	   6	   7	   8
+	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
+	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
+	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
+	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
+	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
+	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
+	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
+	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
+};
+
 /**
  * Loads & sets up the sprite.
  */
@@ -456,7 +470,7 @@ void Animation::catacombMove(byte ped) {
 
 	if (!_vm->_enterCatacombsFromLustiesRoom)
 		_vm->loadRoom(29);
-	int32 here = _vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
+	int32 here = kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
 
 	switch (here & 0xf) { // West.
 	case 0: // no connection (wall)
@@ -842,7 +856,7 @@ void Animation::callSpecial(uint16 which) {
 		catacombMove(4);
 		if (_vm->_room != kRoomCatacombs)
 			return;
-		switch ((_vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1] & 0xf00) >> 8) {
+		switch ((kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1] & 0xf00) >> 8) {
 		case 0x1:
 			appearPed(0, 11);
 			break;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 2669c99..ad70645 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -135,6 +135,7 @@ public:
 private:
 	Direction _direction; // The direction Avvy is currently facing.
 	Direction _oldDirection;
+	static const int32 kCatacombMap[8][8];
 	bool _arrowTriggered; // And has the arrow been triggered?
 	bool _mustExclaim;
 	byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e9d2b1e..7141d3c 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -167,9 +167,7 @@ public:
 	// These following static constants should be included in CFG when it's written.
 	static const int16 kWalk = 3;
 	static const int16 kRun = 5;
-	static const int32 kCatacombMap[8][8];
 	static const char kSpludwicksOrder[3];
-	static const QuasipedType kQuasipeds[16];
 
 	static const uint16 kNotes[12];
 	static const TuneType kTune;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2da1aea..f74239c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -36,19 +36,6 @@
 
 namespace Avalanche {
 
-// Art gallery at 2,1; notice about this at 2,2.
-const int32 AvalancheEngine::kCatacombMap[8][8] = {
-	// Geida's room
-	// 1	   2	   3	   4	   5	   6	   7	   8
-	{0x204,	 0x200,  0xd0f0, 0xf0ff, 0xff,   0xd20f, 0xd200, 0x200},
-	{0x50f1, 0x20ff, 0x2ff,  0xff,   0xe0ff, 0x20ff, 0x200f, 0x7210},
-	{0xe3f0, 0xe10f, 0x72f0, 0xff,   0xe0ff, 0xff,   0xff,   0x800f},
-	{0x2201, 0x2030, 0x800f, 0x220,  0x20f,  0x30,   0xff,   0x23f}, // >> Oubliette
-	{0x5024, 0xf3,   0xff,   0x200f, 0x22f0, 0x20f,  0x200,  0x7260},
-	{0xf0,   0x2ff,  0xe2ff, 0xff,   0x200f, 0x50f0, 0x72ff, 0x201f},
-	{0xf6,   0x220f, 0x22f0, 0x30f,  0xf0,   0x20f,  0x8200, 0x2f0}, // <<< In here
-	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
-};
 // vv Stairs trap.
 
 /* Explanation: $NSEW.
@@ -88,29 +75,6 @@ const int32 AvalancheEngine::kCatacombMap[8][8] = {
 		F     = straight-through corridor. */
 
 const char AvalancheEngine::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
-
-// A quasiped defines how people who aren't sprites talk. For example, quasiped
-// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
-const QuasipedType AvalancheEngine::kQuasipeds[16] = {
-//_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
-	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
-	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
-	{2, kColorWhite,        kRoomYours,        kColorMagenta,  kPeopleArkata},    // C: Arkata (screen 1).
-	{2, kColorBlack,        kRoomLustiesRoom,  kColorRed,      kPeopleInvisible}, // D: Hawk (screen 23).
-	{2, kColorLightgreen,   kRoomOutsideDucks, kColorBrown,    kPeopleTrader},    // E: Trader (screen 50).
-	{5, kColorYellow,       kRoomRobins,       kColorRed,      kPeopleAvalot},    // F: Avvy, tied up (scr.42)
-	{1, kColorBlue,         kRoomAylesOffice,  kColorWhite,    kPeopleAyles},     // G: Ayles (screen 16).
-	{1, kColorBrown,        kRoomMusicRoom,    kColorWhite,    kPeopleJacques},   // H: Jacques (screen 7).
-	{1, kColorLightgreen,   kRoomNottsPub,     kColorGreen,    kPeopleSpurge},    // I: Spurge (screen 47).
-	{2, kColorYellow,       kRoomNottsPub,     kColorRed,      kPeopleAvalot},    // J: Avalot (screen 47).
-	{1, kColorLightgray,    kRoomLustiesRoom,  kColorBlack,    kPeopleDuLustie},  // K: du Lustie (screen 23).
-	{1, kColorYellow,       kRoomOubliette,    kColorRed,      kPeopleAvalot},    // L: Avalot (screen 27).
-	{2, kColorWhite,        kRoomOubliette,    kColorRed,      kPeopleInvisible}, // M: Avaroid (screen 27).
-	{3, kColorLightgray,    kRoomArgentPub,    kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
-	{4, kColorLightmagenta, kRoomNottsPub,     kColorRed,      kPeoplePort},      // O: Port (screen 47).
-	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
-};
-
 const uint16 AvalancheEngine::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
 const TuneType AvalancheEngine::kTune = {
 	kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index e126e5e..97c7869 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -34,6 +34,28 @@
 
 namespace Avalanche {
 
+// A quasiped defines how people who aren't sprites talk. For example, quasiped
+// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
+const QuasipedType Dialogs::kQuasipeds[16] = {
+	//_whichPed, _foregroundColor,   _room,      _backgroundColor,     _who
+	{1, kColorLightgray,    kRoomArgentPub,    kColorBrown,    kPeopleDogfood},   // A: Dogfood (screen 19).
+	{2, kColorGreen,        kRoomArgentPub,    kColorWhite,    kPeopleIbythneth}, // B: Ibythneth (screen 19).
+	{2, kColorWhite,        kRoomYours,        kColorMagenta,  kPeopleArkata},    // C: Arkata (screen 1).
+	{2, kColorBlack,        kRoomLustiesRoom,  kColorRed,      kPeopleInvisible}, // D: Hawk (screen 23).
+	{2, kColorLightgreen,   kRoomOutsideDucks, kColorBrown,    kPeopleTrader},    // E: Trader (screen 50).
+	{5, kColorYellow,       kRoomRobins,       kColorRed,      kPeopleAvalot},    // F: Avvy, tied up (scr.42)
+	{1, kColorBlue,         kRoomAylesOffice,  kColorWhite,    kPeopleAyles},     // G: Ayles (screen 16).
+	{1, kColorBrown,        kRoomMusicRoom,    kColorWhite,    kPeopleJacques},   // H: Jacques (screen 7).
+	{1, kColorLightgreen,   kRoomNottsPub,     kColorGreen,    kPeopleSpurge},    // I: Spurge (screen 47).
+	{2, kColorYellow,       kRoomNottsPub,     kColorRed,      kPeopleAvalot},    // J: Avalot (screen 47).
+	{1, kColorLightgray,    kRoomLustiesRoom,  kColorBlack,    kPeopleDuLustie},  // K: du Lustie (screen 23).
+	{1, kColorYellow,       kRoomOubliette,    kColorRed,      kPeopleAvalot},    // L: Avalot (screen 27).
+	{2, kColorWhite,        kRoomOubliette,    kColorRed,      kPeopleInvisible}, // M: Avaroid (screen 27).
+	{3, kColorLightgray,    kRoomArgentPub,    kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
+	{4, kColorLightmagenta, kRoomNottsPub,     kColorRed,      kPeoplePort},      // O: Port (screen 47).
+	{1, kColorLightgreen,   kRoomDucks,        kColorDarkgray, kPeopleDrDuck}     // P: Duck (screen 51).
+};
+
 Dialogs::Dialogs(AvalancheEngine *vm) {
 	_vm = vm;
 	_noError = true;
@@ -676,11 +698,11 @@ void Dialogs::callDialogDriver() {
 					// Quasi-peds. (This routine performs the same
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
-					PedType *quasiPed = &_vm->_peds[_vm->kQuasipeds[_param - 10]._whichPed];
+					PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed];
 					_vm->_talkX = quasiPed->_x;
 					_vm->_talkY = quasiPed->_y; // Position.
 					
-					_vm->_graphics->setDialogColor(_vm->kQuasipeds[_param - 10]._backgroundColor, _vm->kQuasipeds[_param - 10]._textColor);
+					_vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);
 				} else {
 					_vm->errorLed(); // Not valid.
 					setBubbleStateNatural();
@@ -1095,4 +1117,45 @@ void Dialogs::sayIt(Common::String str) {
 	Common::String tmpStr = Common::String::format("%c1%s.%c%c2", kControlRegister, x.c_str(), kControlSpeechBubble, kControlRegister);
 	displayText(tmpStr);
 }
+
+Common::String Dialogs::personSpeaks() {
+	if ((_vm->_parser->_person == kPeoplePardon) || (_vm->_parser->_person == kPeopleNone)) {
+		if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room))
+			_vm->_parser->_person = _vm->_her;
+		else
+			_vm->_parser->_person = _vm->_him;
+	}
+
+	if (_vm->getRoom(_vm->_parser->_person) != _vm->_room) {
+		return Common::String::format("%c1", kControlRegister); // Avvy himself!
+	}
+
+	bool found = false; // The _person we're looking for's code is in _person.
+	Common::String tmpStr;
+
+	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _vm->_parser->_person)) {
+			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
+			found = true;
+		}
+	}
+
+	if (found)
+		return tmpStr;
+
+	for (int i = 0; i < 16; i++) {
+		if ((kQuasipeds[i]._who == _vm->_parser->_person) && (kQuasipeds[i]._room == _vm->_room))
+			tmpStr += Common::String::format("%c%c", kControlRegister, 'A' + i);
+	}
+
+	return tmpStr;
+}
+
+void Dialogs::heyThanks(byte thing) {
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
+	displayText(tmpStr);
+	_vm->_objects[thing] = false;
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 7263c47..1026637 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -54,6 +54,8 @@ public:
 	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
 	void talkTo(byte whom);
 	void sayIt(Common::String str);
+	Common::String personSpeaks();
+	void heyThanks(byte thing);
 
 private:
 	AvalancheEngine *_vm;
@@ -64,6 +66,7 @@ private:
 	};
 
 	static const int16 kHalfIconWidth = 19;
+	static const QuasipedType kQuasipeds[16];
 
 	Common::String _scroll[15];
 	Common::Point _dodgeCoord;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index b9b1795..aa1324e 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1578,46 +1578,6 @@ void Parser::winSequence() {
 	_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
 }
 
-Common::String Parser::personSpeaks() {
-	if ((_person == kPeoplePardon) || (_person == kPeopleNone)) {
-		if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room))
-			_person = _vm->_her;
-		else
-			_person = _vm->_him;
-	}
-
-	if (_vm->getRoom(_person) != _vm->_room) {
-		return Common::String::format("%c1", kControlRegister); // Avvy himself!
-	}
-
-	bool found = false; // The _person we're looking for's code is in _person.
-	Common::String tmpStr;
-
-	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
-			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
-			found = true;
-		}
-	}
-
-	if (found)
-		return tmpStr;
-
-	for (int i = 0; i < 16; i++) {
-		if ((_vm->kQuasipeds[i]._who == _person) && (_vm->kQuasipeds[i]._room == _vm->_room))
-			tmpStr += Common::String::format("%c%c", kControlRegister, 'A' + i);
-	}
-
-	return tmpStr;
-}
-
-void Parser::heyThanks() {
-	Common::String tmpStr = personSpeaks();
-	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
-	_vm->_dialogs->displayText(tmpStr);
-	_vm->_objects[_thing - 1] = false;
-}
-
 /**
  * @remarks	Originally called 'do_that'
  */
@@ -1734,17 +1694,17 @@ void Parser::doThat() {
 							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
 							_vm->_objects[kObjectWine - 1] = false;
 						} else
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						break;
 					case kPeopleCwytalot:
 						if ((_thing == kObjectCrossbow) || (_thing == kObjectBolt))
 							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						break;
 					case kPeopleSpludwick:
 						if (giveToSpludwick())
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						break;
 					case kPeopleIbythneth:
 						if (_thing == kObjectBadge) {
@@ -1756,7 +1716,7 @@ void Parser::doThat() {
 							_vm->_background->draw(-1, -1, 7);
 							_vm->_background->draw(-1, -1, 8);
 						} else
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						break;
 					case kPeopleAyles:
 						if (_vm->_aylesIsAwake) {
@@ -1768,7 +1728,7 @@ void Parser::doThat() {
 								_vm->refreshObjectList();
 								_vm->incScore(2);
 							} else
-								heyThanks();
+								_vm->_dialogs->heyThanks(_thing - 1);
 						} else
 							_vm->_dialogs->displayText("But he's asleep!");
 						break;
@@ -1785,7 +1745,7 @@ void Parser::doThat() {
 							giveGeidaTheLute();
 							break;
 						default:
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						}
 						break;
 					case kPeopleArkata:
@@ -1797,11 +1757,11 @@ void Parser::doThat() {
 								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
 							break;
 						default:
-							heyThanks();
+							_vm->_dialogs->heyThanks(_thing - 1);
 						}
 						break;
 					default:
-						heyThanks();
+						_vm->_dialogs->heyThanks(_thing - 1);
 					}
 				}
 			}
@@ -2365,13 +2325,13 @@ void Parser::doThat() {
 		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
 		break;
 	case kVerbCodeHello: {
-		Common::String tmpStr = personSpeaks();
+		Common::String tmpStr = _vm->_dialogs->personSpeaks();
 		tmpStr += Common::String::format("Hello.%c", kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
 		break;
 	case kVerbCodeThanks: {
-		Common::String tmpStr = personSpeaks();
+		Common::String tmpStr = _vm->_dialogs->personSpeaks();
 		tmpStr += Common::String::format("That's OK.%c", kControlSpeechBubble);
 		_vm->_dialogs->displayText(tmpStr);
 		}
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 892b81e..db22be2 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -148,8 +148,6 @@ private:
 	void giveGeidaTheLute();
 	void playHarp();
 	void winSequence();
-	Common::String personSpeaks();
-	void heyThanks();
 	void wipeText();
 };
 


Commit: 0deb94c1b8a19c790cbdda3790190e7ef25c4dc6
    https://github.com/scummvm/scummvm/commit/0deb94c1b8a19c790cbdda3790190e7ef25c4dc6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-12T03:36:06-07:00

Commit Message:
AVALANCHE: Move some parser functions to Dialogs. Improve some comments

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/parser.cpp
    engines/avalanche/parser.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 97c7869..e9cc1c7 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1151,11 +1151,41 @@ Common::String Dialogs::personSpeaks() {
 	return tmpStr;
 }
 
-void Dialogs::heyThanks(byte thing) {
+/**
+ * Display a message when (uselessly) giving an object away
+ * @remarks	Originally called 'heythanks'
+ */
+void Dialogs::sayThanks(byte thing) {
 	Common::String tmpStr = personSpeaks();
 	tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
 	displayText(tmpStr);
 	_vm->_objects[thing] = false;
 }
 
+/**
+ * Display a 'Hello' message
+ */
+void Dialogs::sayHello() {
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("Hello.%c", kControlSpeechBubble);
+	displayText(tmpStr);
+}
+
+/**
+ * Display a 'OK' message
+ */
+void Dialogs::sayOK() {
+	Common::String tmpStr = personSpeaks();
+	tmpStr += Common::String::format("That's OK.%c", kControlSpeechBubble);
+	displayText(tmpStr);
+}
+
+/**
+ * Display a 'Silly' message
+ * @remarks	Originally called 'silly'
+ */
+void Dialogs::saySilly() {
+	displayText("Don't be silly!");
+}
+
 } // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 1026637..5d10524 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -55,8 +55,10 @@ public:
 	void talkTo(byte whom);
 	void sayIt(Common::String str);
 	Common::String personSpeaks();
-	void heyThanks(byte thing);
-
+	void sayThanks(byte thing);
+	void sayHello();
+	void sayOK();
+	void saySilly();
 private:
 	AvalancheEngine *_vm;
 
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index aa1324e..060d317 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -933,30 +933,38 @@ void Parser::examineObject() {
 		_vm->thinkAbout(_thing, AvalancheEngine::kThing);
 	switch (_thing) {
 	case kObjectWine :
-		switch (_vm->_wineState) {// 4 is perfect wine. 0 is not holding the wine.
+		// 4 is perfect wine. 0 is not holding the wine.
+		switch (_vm->_wineState) {
 		case 1:
-			_vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll
+			// Normal examine wine scroll
+			_vm->_dialogs->displayScrollChain('t', 1);
 			break;
 		case 2:
-			_vm->_dialogs->displayScrollChain('d', 6); // Bad wine
+			// Bad wine
+			_vm->_dialogs->displayScrollChain('d', 6);
 			break;
 		case 3:
-			_vm->_dialogs->displayScrollChain('d', 7); // Vinegar
+			// Vinegar
+			_vm->_dialogs->displayScrollChain('d', 7);
 			break;
 		}
 		break;
 	case kObjectOnion:
 		if (_vm->_rottenOnion)
-			_vm->_dialogs->displayScrollChain('q', 21); // Yucky onion
+			// Yucky onion
+			_vm->_dialogs->displayScrollChain('q', 21);
 		else
-			_vm->_dialogs->displayScrollChain('t', 18);  // Normal onion
+			// Normal onion
+			_vm->_dialogs->displayScrollChain('t', 18);
 		break;
 	default:
-		_vm->_dialogs->displayScrollChain('t', _thing); // Ordinarily
+		// Ordinarily
+		_vm->_dialogs->displayScrollChain('t', _thing);
 	}
 }
 
-bool Parser::isPersonHere() { // Person equivalent of "holding".
+bool Parser::isPersonHere() {
+	// Person equivalent of "isHolding".
 	if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->getRoom(_person) == _vm->_room))
 		return true;
 	else {
@@ -978,9 +986,11 @@ void Parser::exampers() {
 		byte newPerson = _person - 149;
 
 		if ((_person == kPeopleDogfood) && _vm->_wonNim)
-			_vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!"
+			// "I'm Not Playing!"
+			_vm->_dialogs->displayScrollChain('Q', 8);
 		else if ((_person == kPeopleDuLustie) && _vm->_lustieIsAsleep)
-			_vm->_dialogs->displayScrollChain('Q', 65); // He's asleep.
+			// He's asleep.
+			_vm->_dialogs->displayScrollChain('Q', 65);
 		else
 			_vm->_dialogs->displayScrollChain('p', newPerson);
 
@@ -997,14 +1007,16 @@ void Parser::exampers() {
  * @remarks	Originally called 'holding'
  */
 bool Parser::isHolding() {
-	if ((51 <= _thing) && (_thing <= 99)) // Also.
+	// Also object
+	if ((51 <= _thing) && (_thing <= 99))
 		return true;
 
 	bool holdingResult = false;
 
 	if (_thing > 100)
 		_vm->_dialogs->displayText("Be reasonable!");
-	else if (!_vm->_objects[_thing - 1])  // Verbs that need "_thing" to be in the inventory.
+	else if (!_vm->_objects[_thing - 1])
+		// Verbs that need "_thing" to be in the inventory.
 		_vm->_dialogs->displayText("You're not holding it, Avvy.");
 	else
 		holdingResult = true;
@@ -1036,9 +1048,11 @@ void Parser::examine() {
 	if ((_person == kPeoplePardon) && (_thing != kPardon)) {
 		if (isHolding()) {
 			// Remember: it's been slipped! Ie subtract 49.
-			if ((1 <= _thing) && (_thing <= 49)) // Standard object
+			if ((1 <= _thing) && (_thing <= 49))
+				// Standard object
 				examineObject();
-			else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing
+			else if ((50 <= _thing) && (_thing <= 100)) {
+				// Also _thing
 				openBox(true);
 				_vm->_dialogs->displayText(*_vm->_also[_thing - 50][1]);
 				openBox(false);
@@ -1047,7 +1061,8 @@ void Parser::examine() {
 	} else if (_person != kPardon)
 		exampers();
 	else
-		_vm->_dialogs->displayText("It's just as it looks on the picture.");  // Don't know: guess.
+		// Don't know: guess.
+		_vm->_dialogs->displayText("It's just as it looks on the picture.");
 }
 
 void Parser::inventory() {
@@ -1078,10 +1093,14 @@ void Parser::inventory() {
 	_vm->_dialogs->displayText(tmpStr);
 }
 
-void Parser::swallow() { // Eat something.
+/**
+ * Eat something.
+ */
+void Parser::swallow() {
 	switch (_thing) {
 	case kObjectWine:
-		switch (_vm->_wineState) { // 4 is perfect
+		// _wineState == 4 for perfect wine
+		switch (_vm->_wineState) {
 		case 1:
 			if (_vm->_teetotal)  {
 				_vm->_dialogs->displayScrollChain('D', 6);
@@ -1096,8 +1115,9 @@ void Parser::swallow() { // Eat something.
 			break;
 		case 2:
 		case 3:
+			// You can't drink it!
 			_vm->_dialogs->displayScrollChain('d', 8);
-			break; // You can't drink it!
+			break;
 		}
 		break;
 	case kObjectPotion:
@@ -1134,26 +1154,30 @@ void Parser::swallow() { // Eat something.
 }
 
 void Parser::peopleInRoom() {
-	byte numPeople = 0; // Number of people in the room.
-
+	// First compute the number of people in the room.
+	byte numPeople = 0;
 	for (int i = 151; i < 179; i++) { // Start at 1 so we don't list Avvy himself!
 		if (_vm->getRoom((People)i) == _vm->_room)
 			numPeople++;
 	}
 
-	if (numPeople == 0) // If nobody's here, we can cut out straight away.
+	// If nobody's here, we can cut out straight away.
+	if (numPeople == 0)
 		return;
 
 	Common::String tmpStr;
-	byte actPerson = 0; // Actually listed people.
+	byte actPerson = 0;
 	for (int i = 151; i < 179; i++) {
 		if (_vm->getRoom((People)i) == _vm->_room) {
 			actPerson++;
-			if (actPerson == 1) // First on the list.
+			if (actPerson == 1)
+				// Display first name on the list.
 				tmpStr = _vm->getName((People)i);
-			else if (actPerson < numPeople) // The middle...
+			else if (actPerson < numPeople)
+				// Display one the names in the middle of the list
 				tmpStr += ", " + _vm->getName((People)i);
-			else // The end.
+			else
+				// Display the last name of the list
 				tmpStr += " and " + _vm->getName((People)i);
 		}
 	}
@@ -1163,7 +1187,7 @@ void Parser::peopleInRoom() {
 	else
 		tmpStr += " are";
 
-	_vm->_dialogs->displayText(tmpStr + " here."); // End and display it.
+	_vm->_dialogs->displayText(tmpStr + " here.");
 }
 
 void Parser::lookAround() {
@@ -1192,13 +1216,16 @@ void Parser::lookAround() {
 	case kRoomCatacombs:
 		switch (_vm->_catacombY * 256 + _vm->_catacombX) {
 		case 258 :
-			_vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery.
+			// Inside art gallery.
+			_vm->_dialogs->displayScrollChain('q', 80);
 			break;
 		case 514 :
-			_vm->_dialogs->displayScrollChain('q', 81); // Outside ditto.
+			// Outside ditto.
+			_vm->_dialogs->displayScrollChain('q', 81);
 			break;
 		case 260 :
-			_vm->_dialogs->displayScrollChain('q', 82); // Outside Geida's room.
+			// Outside Geida's room.
+			_vm->_dialogs->displayScrollChain('q', 82);
 			break;
 		}
 		break;
@@ -1230,7 +1257,8 @@ void Parser::openDoor() {
 	}
 
 	if ((!_vm->_userMovesAvvy) && (_vm->_room != kRoomLusties))
-		return; // No doors can open if you can't move Avvy.
+		// No doors can open if you can't move Avvy.
+		return;
 
 	for (int i = 0; i < 7; i++) {
 		if (_vm->_animation->inField(i + 8)) {
@@ -1266,15 +1294,12 @@ void Parser::openDoor() {
 		_vm->_dialogs->displayText("Door? What door?");
 }
 
-void Parser::silly() {
-	_vm->_dialogs->displayText("Don't be silly!");
-}
-
 void Parser::putProc() {
 	if (!isHolding())
 		return;
 
-	_thing2 -= 49; // Slip the second object.
+	// Slip the second object.
+	_thing2 -= 49;
 	char temp = _thing;
 	_thing = _thing2;
 	if (!isHolding())
@@ -1287,23 +1312,26 @@ void Parser::putProc() {
 		if (_thing == kObjectOnion) {
 			if (_vm->_rottenOnion)
 				_vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!");
-			else { // Put onion into wine?
+			else {
+				// Put onion into wine?
 				if (_vm->_wineState != 3) {
 					Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!",
 						kControlItalic, kControlRoman);
 					_vm->_dialogs->displayText(tmpStr);
-				} else { // Put onion into vinegar! Yes!
+				} else {
+					// Put onion into vinegar! Yes!
 					_vm->_onionInVinegar = true;
 					_vm->incScore(7);
 					_vm->_dialogs->displayScrollChain('u', 9);
 				}
 			}
 		} else
-			silly();
+			_vm->_dialogs->saySilly();
 		break;
 
 	case 54:
-		if (_vm->_room == kRoomYours) { // Put something into the box.
+		if (_vm->_room == kRoomYours) {
+			// Put something into the box.
 			if (_vm->_boxContent != kNothing)
 				_vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first.");
 			else {
@@ -1320,28 +1348,31 @@ void Parser::putProc() {
 				case kObjectOnion:
 					_vm->_dialogs->displayText("Just give it to Spludwick, Avvy!");
 					break;
-				default: // Put the object into the box...
+				default:
+					// Put the object into the box...
 					if (_wearing == _thing) {
 						Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->getItem(_thing).c_str());
 						_vm->_dialogs->displayText(tmpStr);
 					} else {
-						openBox(true); // Open box.
+						// Open box.
+						openBox(true);
 
 						_vm->_boxContent = _thing;
 						_vm->_objects[_thing - 1] = false;
 						_vm->refreshObjectList();
 						_vm->_dialogs->displayText("OK, it's in the box.");
 
-						openBox(false); // Shut box.
+						// Shut box.
+						openBox(false);
 					}
 				}
 			}
 		} else
-			silly();
+			_vm->_dialogs->saySilly();
 		break;
 
 	default:
-		silly();
+		_vm->_dialogs->saySilly();
 	}
 }
 
@@ -1361,7 +1392,8 @@ void Parser::notInOrder() {
  * @remarks	Originally called 'go_to_cauldron'
  */
 void Parser::goToCauldron() {
-	_vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs.
+	// Stops Geida_Procs.
+	_vm->_animation->_sprites[1]._callEachStepFl = false;
 	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
 	_vm->_animation->_sprites[1].walkTo(1);
 }
@@ -1409,14 +1441,14 @@ bool Parser::giveToSpludwick() {
 	default:
 		return true;
 	}
-
 	return false;
 }
 
 void Parser::drink() {
 	_alcoholLevel++;
 	if (_alcoholLevel == 5) {
-		_vm->_objects[kObjectKey - 1] = true; // Get the key.
+		// Get the key.
+		_vm->_objects[kObjectKey - 1] = true;
 		_vm->_teetotal = true;
 		_vm->_avvyIsAwake = false;
 		_vm->_avvyInBed = true;
@@ -1429,11 +1461,13 @@ void Parser::drink() {
 }
 
 void Parser::cardiffClimbing() {
-	if (_vm->_standingOnDais) { // Clamber up.
+	if (_vm->_standingOnDais) {
+		// Clamber up.
 		_vm->_dialogs->displayText("You climb down, back onto the floor.");
 		_vm->_standingOnDais = false;
 		_vm->_animation->appearPed(0, 2);
-	} else if (_vm->_animation->inField(0)) { // Clamber down
+	} else if (_vm->_animation->inField(0)) {
+		// Clamber down
 		_vm->_dialogs->displayText("You clamber up onto the dais.");
 		_vm->_standingOnDais = true;
 		_vm->_animation->appearPed(0, 1);
@@ -1447,8 +1481,10 @@ void Parser::already() {
 
 void Parser::standUp() {
 	switch (_vm->_room) {
-	case kRoomYours: // Avvy isn't asleep.
-		if (_vm->_avvyIsAwake && _vm->_avvyInBed) {  // But he's in bed.
+	case kRoomYours:
+		// Avvy isn't asleep.
+		if (_vm->_avvyIsAwake && _vm->_avvyInBed) {
+			// But he's in bed.
 			if (_vm->_teetotal) {
 				_vm->_dialogs->displayScrollChain('d', 12);
 				_vm->_graphics->setBackgroundColor(kColorBlack);
@@ -1458,7 +1494,8 @@ void Parser::standUp() {
 			_vm->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->setDirection(kDirLeft);
-			_vm->_background->draw(-1, -1, 3); // Picture of empty pillow.
+			// Display a picture of empty pillow in the background.
+			_vm->_background->draw(-1, -1, 3);
 			_vm->incScore(1);
 			_vm->_avvyInBed = false;
 			_vm->_timer->loseTimer(Timer::kReasonArkataShouts);
@@ -1472,11 +1509,16 @@ void Parser::standUp() {
 
 	case kRoomNottsPub:
 		if (_vm->_sittingInPub)  {
-			_vm->_background->draw(-1, -1, 3); // Not sitting down.
-			_vm->_animation->_sprites[0]._visible = true; // But standing up.
-			_vm->_animation->appearPed(0, 3); // And walking away.
-			_vm->_sittingInPub = false; // Really not sitting down.
-			_vm->_userMovesAvvy = true; // And ambulant.
+			// Not sitting down.
+			_vm->_background->draw(-1, -1, 3);
+			// But standing up.
+			_vm->_animation->_sprites[0]._visible = true;
+			// And walking away.
+			_vm->_animation->appearPed(0, 3);
+			// Really not sitting down.
+			_vm->_sittingInPub = false;
+			// And ambulant.
+			_vm->_userMovesAvvy = true;
 		} else
 			already();
 		break;
@@ -1694,17 +1736,17 @@ void Parser::doThat() {
 							_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
 							_vm->_objects[kObjectWine - 1] = false;
 						} else
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						break;
 					case kPeopleCwytalot:
 						if ((_thing == kObjectCrossbow) || (_thing == kObjectBolt))
 							_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
 						else
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						break;
 					case kPeopleSpludwick:
 						if (giveToSpludwick())
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						break;
 					case kPeopleIbythneth:
 						if (_thing == kObjectBadge) {
@@ -1716,7 +1758,7 @@ void Parser::doThat() {
 							_vm->_background->draw(-1, -1, 7);
 							_vm->_background->draw(-1, -1, 8);
 						} else
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						break;
 					case kPeopleAyles:
 						if (_vm->_aylesIsAwake) {
@@ -1728,7 +1770,7 @@ void Parser::doThat() {
 								_vm->refreshObjectList();
 								_vm->incScore(2);
 							} else
-								_vm->_dialogs->heyThanks(_thing - 1);
+								_vm->_dialogs->sayThanks(_thing - 1);
 						} else
 							_vm->_dialogs->displayText("But he's asleep!");
 						break;
@@ -1745,7 +1787,7 @@ void Parser::doThat() {
 							giveGeidaTheLute();
 							break;
 						default:
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						}
 						break;
 					case kPeopleArkata:
@@ -1757,11 +1799,11 @@ void Parser::doThat() {
 								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
 							break;
 						default:
-							_vm->_dialogs->heyThanks(_thing - 1);
+							_vm->_dialogs->sayThanks(_thing - 1);
 						}
 						break;
 					default:
-						_vm->_dialogs->heyThanks(_thing - 1);
+						_vm->_dialogs->sayThanks(_thing - 1);
 					}
 				}
 			}
@@ -2324,17 +2366,11 @@ void Parser::doThat() {
 	case kVerbCodePardon:
 		_vm->_dialogs->displayText("Hey, a verb would be helpful!");
 		break;
-	case kVerbCodeHello: {
-		Common::String tmpStr = _vm->_dialogs->personSpeaks();
-		tmpStr += Common::String::format("Hello.%c", kControlSpeechBubble);
-		_vm->_dialogs->displayText(tmpStr);
-		}
+	case kVerbCodeHello:
+		_vm->_dialogs->sayHello();
 		break;
-	case kVerbCodeThanks: {
-		Common::String tmpStr = _vm->_dialogs->personSpeaks();
-		tmpStr += Common::String::format("That's OK.%c", kControlSpeechBubble);
-		_vm->_dialogs->displayText(tmpStr);
-		}
+	case kVerbCodeThanks:
+		_vm->_dialogs->sayOK();
 		break;
 	default:
 		Common::String tmpStr = Common::String::format("%cUnhandled verb: %d", kControlBell, _verb);
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index db22be2..261e5ec 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -136,7 +136,6 @@ private:
 	void inventory();
 	void swallow();
 	void peopleInRoom(); // This lists the other people in the room.
-	void silly();
 	void putProc();  // Called when you call kVerbCodeput.
 	void notInOrder();
 	void goToCauldron();


Commit: 1a40c8c5d23f92beabbc18dc841e3d3198be8f2c
    https://github.com/scummvm/scummvm/commit/1a40c8c5d23f92beabbc18dc841e3d3198be8f2c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-12T05:44:03-07:00

Commit Message:
AVALANCHE: Move/Improve some comments in parser

Changed paths:
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 060d317..36d0349 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1548,13 +1548,16 @@ void Parser::getProc(char thing) {
 	case kRoomInsideCardiffCastle:
 		switch (thing) {
 		case kObjectPen:
-			if (_vm->_animation->inField(1)) { // Standing on the dais.
+			if (_vm->_animation->inField(1)) {
+				// Standing on the dais.
 				if (_vm->_takenPen)
 					_vm->_dialogs->displayText("It's not there, Avvy.");
 				else {
 					// OK: we're taking the pen, and it's there.
-					_vm->_background->draw(-1, -1, 3); // No pen there now.
-					_vm->_animation->callSpecial(3); // Zap!
+					// No pen there now.
+					_vm->_background->draw(-1, -1, 3);
+					// Zap!
+					_vm->_animation->callSpecial(3);
 					_vm->_takenPen = true;
 					_vm->_objects[kObjectPen - 1] = true;
 					_vm->refreshObjectList();
@@ -1601,7 +1604,8 @@ void Parser::giveGeidaTheLute() {
 	}
 	_vm->_objects[kObjectLute - 1] = false;
 	_vm->refreshObjectList();
-	_vm->_dialogs->displayScrollChain('q', 64); // She plays it.
+	// She plays it.
+	_vm->_dialogs->displayScrollChain('q', 64);
 
 	_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
 	//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
@@ -1637,7 +1641,8 @@ void Parser::doThat() {
 		return;
 
 	if (_thing < 200)
-		_thing -= 49; // "Slip"
+		// "Slip" object
+		_thing -= 49;
 
 
 	if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
@@ -1670,12 +1675,14 @@ void Parser::doThat() {
 		}
 		break;
 	case kVerbCodeGet:
-		if (_thing != kPardon) { // Legitimate try to pick something up.
+		if (_thing != kPardon) {
+			// Legitimate try to pick something up.
 			if (_vm->_carryNum >= kCarryLimit)
 				_vm->_dialogs->displayText("You can't carry any more!");
 			else
 				getProc(_thing);
-		} else { // Not... ditto.
+		} else {
+			// Not... ditto.
 			if (_person != kPeoplePardon)
 				_vm->_dialogs->displayText("You can't sweep folk off their feet!");
 			else
@@ -1691,7 +1698,8 @@ void Parser::doThat() {
 		break;
 	case kVerbCodeTalk:
 		if (_person == kPeoplePardon) {
-			if (_vm->_subjectNum == 99) { // They typed "say password".
+			if (_vm->_subjectNum == 99) {
+				// They typed "say password".
 				Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", kControlItalic, kControlRoman);
 				_vm->_dialogs->displayText(tmpStr);
 			} else if (((1 <= _vm->_subjectNum) && (_vm->_subjectNum <= 49)) || (_vm->_subjectNum == 253) || (_vm->_subjectNum == 249)) {
@@ -1778,7 +1786,8 @@ void Parser::doThat() {
 						switch (_thing) {
 						case kObjectPotion:
 							_vm->_objects[kObjectPotion - 1] = false;
-							_vm->_dialogs->displayScrollChain('u', 16); // She drinks it.
+							// She drinks it.
+							_vm->_dialogs->displayScrollChain('u', 16);
 							_vm->incScore(2);
 							_vm->_givenPotionToGeida = true;
 							_vm->refreshObjectList();
@@ -1796,7 +1805,8 @@ void Parser::doThat() {
 							if (_vm->_givenPotionToGeida)
 								winSequence();
 							else
-								_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
+								// That Geida woman!
+								_vm->_dialogs->displayScrollChain('q', 77);
 							break;
 						default:
 							_vm->_dialogs->sayThanks(_thing - 1);
@@ -1807,7 +1817,8 @@ void Parser::doThat() {
 					}
 				}
 			}
-			_vm->refreshObjectList(); // Just in case...
+			// Just in case...
+			_vm->refreshObjectList();
 		}
 		break;
 
@@ -1822,7 +1833,8 @@ void Parser::doThat() {
 		int16 savegameId = dialog->runModalWithCurrentTarget();
 		delete dialog;
 
-		if (savegameId < 0)                             // dialog aborted
+		if (savegameId < 0)
+			// dialog aborted, nothing to load
 			return;
 		
 		_vm->loadGame(savegameId);
@@ -1834,14 +1846,13 @@ void Parser::doThat() {
 		Common::String savegameDescription = dialog->getResultString();
 		delete dialog;
 
-		if (savegameId < 0)                             // dialog aborted
+		if (savegameId < 0)
+			// dialog aborted, nothing to save
 			return;
 
 		_vm->saveGame(savegameId, savegameDescription);
 		}
 		break;
-	// We don't handle these two because we use ScummVM's save/load system.
-
 	case kVerbCodePay:
 		_vm->_dialogs->displayText("No money need change hands.");
 		break;
@@ -1851,7 +1862,7 @@ void Parser::doThat() {
 	case kVerbCodeBreak:
 		_vm->_dialogs->displayText("Vandalism is prohibited within this game!");
 		break;
-	case kVerbCodeQuit: // quit
+	case kVerbCodeQuit:
 		if (!_polite)
 			_vm->_dialogs->displayText("How about a `please\", Avvy?");
 		else {
@@ -1897,7 +1908,8 @@ void Parser::doThat() {
 				_vm->_dialogs->displayText("Hey, what kind of a weirdo are you\?\?!");
 				break;
 			case kObjectClothes:
-			case kObjectHabit: { // Change this!
+			case kObjectHabit: {
+				// Change clothes!
 				if (_wearing != kNothing) {
 					if (_wearing == _thing)
 						_vm->_dialogs->displayText("You're already wearing that.");
@@ -1932,13 +1944,15 @@ void Parser::doThat() {
 		break;
 	case kVerbCodePlay:
 		if (_thing == kPardon) {
-			switch (_vm->_room) { // They just typed "play"...
-			case kRoomArgentPub: // ...in the pub, => play Nim.
+			// They just typed "play"...
+			switch (_vm->_room) {
+			case kRoomArgentPub:
+				// ...in the pub, => play Nim.
 				warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
 				// play_nim();
+
 				// The following parts are copied from play_nim().
 				// The player automatically wins the game everytime he wins, until I implement the mini-game.
-
 				if (_vm->_wonNim) { // Already won the game.
 					_vm->_dialogs->displayScrollChain('Q', 6);
 					return;
@@ -1953,15 +1967,20 @@ void Parser::doThat() {
 				_playedNim++;
 
 				// You won - strange!
-				_vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute!
+
+				// You won! Give us a lute!
+				_vm->_dialogs->displayScrollChain('Q', 7);
 				_vm->_objects[kObjectLute - 1] = true;
 				_vm->refreshObjectList();
 				_vm->_wonNim = true;
-				_vm->_background->draw(-1, -1, 0); // Show the settle with no lute on it.
-				_vm->incScore(7); // 7 points for winning!
+				// Show the settle with no lute on it.
+				_vm->_background->draw(-1, -1, 0);
+				// 7 points for winning!
+				_vm->incScore(7);
 
 				if (_playedNim == 1)
-					_vm->incScore(3); // 3 points for playing your 1st game.
+					// 3 points for playing your 1st game.
+					_vm->incScore(3);
 
 				// A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
 				_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", " \
@@ -2047,13 +2066,15 @@ void Parser::doThat() {
 		if (_vm->_avariciusTalk > 0)
 			_vm->_dialogs->displayScrollChain('q', 19);
 		else {
-			if ((_vm->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears!
+			if ((_vm->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) {
+				// Avaricius appears!
 				_vm->_dialogs->displayScrollChain('q', 17);
 				if (_vm->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
 					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
 					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
-					spr->init(1, false, _vm->_animation); // Avaricius
+					// Avaricius
+					spr->init(1, false, _vm->_animation);
 					_vm->_animation->appearPed(1, 3);
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
@@ -2100,16 +2121,20 @@ void Parser::doThat() {
 		else
 			_vm->_dialogs->displayText(_vm->_listen);
 		break;
-	case kVerbCodeBuy: // What are they trying to buy?
+	case kVerbCodeBuy:
+		// What are they trying to buy?
 		switch (_vm->_room) {
 		case kRoomArgentPub:
-			if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar.
+			// We're in a pub, and near the bar.
+			if (_vm->_animation->inField(5)) {
 				switch (_thing) {
 				case 51:
 				case 53:
 				case 54:
-				case 58: // Beer, whisky, cider or mead.
-					if (_vm->_malagauche == 177) { // Already getting us one.
+				case 58:
+					// Beer, whisky, cider or mead.
+					if (_vm->_malagauche == 177) {
+						// Already getting us one.
 						_vm->_dialogs->displayScrollChain('D', 15);
 						return;
 					}
@@ -2134,10 +2159,13 @@ void Parser::doThat() {
 					examine();
 					break; // We have a right one here - buy Pepsi??!
 				case kObjectWine:
-					if (_vm->_objects[kObjectWine - 1])  // We've already got the wine!
-						_vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent!
+					if (_vm->_objects[kObjectWine - 1])
+						// We've already got the wine!
+						// 1 bottle's shufishent!
+						_vm->_dialogs->displayScrollChain('D', 2);
 					else {
-						if (_vm->_malagauche == 177) { // Already getting us one.
+						if (_vm->_malagauche == 177) {
+							// Already getting us one.
 							_vm->_dialogs->displayScrollChain('D', 15);
 							return;
 						}
@@ -2160,14 +2188,16 @@ void Parser::doThat() {
 					break;
 				}
 			} else
-				_vm->_dialogs->displayScrollChain('D', 5); // Go to the bar!
+				// Go to the bar!
+				_vm->_dialogs->displayScrollChain('D', 5);
 			break;
 
 		case kRoomOutsideDucks:
 			if (_vm->_animation->inField(5)) {
 				if (_thing == kObjectOnion) {
 					if (_vm->_objects[kObjectOnion - 1])
-						_vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things!
+						// Not planning to juggle with the things!
+						_vm->_dialogs->displayScrollChain('D', 10);
 					else if (_vm->_carryNum >= kCarryLimit)
 						_vm->_dialogs->displayText("Before you ask, you remember that your hands are full.");
 					else {
@@ -2177,11 +2207,13 @@ void Parser::doThat() {
 							_vm->_dialogs->displayScrollChain('D', 9);
 							_vm->incScore(3);
 						}
-						_vm->decreaseMoney(3); // It costs thruppence.
+						// It costs thruppence.
+						_vm->decreaseMoney(3);
 						_vm->_objects[kObjectOnion - 1] = true;
 						_vm->refreshObjectList();
 						_boughtOnion = true;
-						_vm->_rottenOnion = false; // It's OK when it leaves the stall!
+						// It's OK when it leaves the stall!
+						_vm->_rottenOnion = false;
 						_vm->_onionInVinegar = false;
 					}
 				} else
@@ -2191,10 +2223,12 @@ void Parser::doThat() {
 			break;
 
 		case kRoomNottsPub:
-			_vm->_dialogs->displayScrollChain('n', 15); // Can't sell to southerners.
+			// Can't sell to southerners.
+			_vm->_dialogs->displayScrollChain('n', 15);
 			break;
 		default:
-			_vm->_dialogs->displayScrollChain('D', 0); // Can't buy that.
+			// Can't buy that.
+			_vm->_dialogs->displayScrollChain('D', 0);
 		}
 		break;
 	case kVerbCodeAttack:
@@ -2227,7 +2261,8 @@ void Parser::doThat() {
 				_vm->setRoom(kPeopleCwytalot, kRoomDummy);
 				break;
 			default:
-				_vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent!
+				// Please try not to be so violent!
+				_vm->_dialogs->displayScrollChain('Q', 10);
 			}
 		} else
 			_vm->_dialogs->displayScrollChain('Q', 10);
@@ -2291,7 +2326,8 @@ void Parser::doThat() {
 				_vm->_dialogs->displayScrollChain('U', 14);
 				break;
 			default:
-				_vm->_dialogs->displayScrollChain('U', 5); // You WHAT?
+				// You WHAT?
+				_vm->_dialogs->displayScrollChain('U', 5);
 			}
 		} else if ((kPeopleAvalot <= _person) && (_person < kPeopleArkata))
 			_vm->_dialogs->displayText("Hey, what kind of a weirdo are you??");
@@ -2300,7 +2336,8 @@ void Parser::doThat() {
 	case kVerbCodeClimb:
 		if (_vm->_room == kRoomInsideCardiffCastle)
 			cardiffClimbing();
-		else // In the wrong room!
+		else
+			// In the wrong room!
 			_vm->_dialogs->displayText("Not with your head for heights, Avvy!");
 		break;
 	case kVerbCodeJump:
@@ -2321,7 +2358,8 @@ void Parser::doThat() {
 					_vm->_avvyIsAwake = true;
 					_vm->incScore(1);
 					_vm->_avvyInBed = true;
-					_vm->_background->draw(-1, -1, 2); // Picture of Avvy, awake in bed.
+					// Picture of Avvy, awake in bed.
+					_vm->_background->draw(-1, -1, 2);
 					if (_vm->_teetotal)
 						_vm->_dialogs->displayScrollChain('d', 13);
 				} else
@@ -2346,10 +2384,12 @@ void Parser::doThat() {
 			if (_vm->_sittingInPub)
 				_vm->_dialogs->displayText("You're already sitting!");
 			else {
-				_vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down.
+				// Move Avvy to the place, and sit him down.
+				_vm->_animation->_sprites[0].walkTo(3);
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
-		} else { // Default doodah.
+		} else {
+			// Default doodah.
 			_vm->fadeOut();
 			_vm->fadeIn();
 			Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", kControlParagraph);


Commit: 91e70ce2a876e5d08994d7c5b045bf867b376305
    https://github.com/scummvm/scummvm/commit/91e70ce2a876e5d08994d7c5b045bf867b376305
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T10:10:23-07:00

Commit Message:
AVALANCHE: Modifiy AnimationType initialization, add private Animation pointer

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index e873415..f419034 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -46,12 +46,14 @@ const int32 Animation::kCatacombMap[8][8] = {
 	{0x34,   0x200f, 0x51f0, 0x201f, 0xf1,   0x50ff, 0x902f, 0x2062}
 };
 
+AnimationType::AnimationType(Animation *anim) {
+	_anim = anim;
+}
+
 /**
  * Loads & sets up the sprite.
  */
-void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) {
-	_anim = anim;
-
+void AnimationType::init(byte spritenum, bool doCheck) {
 	const int32 idshould = -1317732048;
 
 	if (spritenum == 177)
@@ -180,7 +182,7 @@ void AnimationType::appear(int16 wx, int16 wy, Direction wf) {
  */
 bool AnimationType::checkCollision() {
 	for (int i = 0; i < _anim->kSpriteNumbMax; i++) {
-		AnimationType *spr = &_anim->_sprites[i];
+		AnimationType *spr = _anim->_sprites[i];
 		if (spr->_quick && (spr->_id != _id) && (_x + _info._xLength > spr->_x) && (_x < spr->_x + spr->_info._xLength) && (spr->_y == _y))
 			return true;
 	}
@@ -381,14 +383,18 @@ void AnimationType::remove() {
 
 Animation::Animation(AvalancheEngine *vm) {
 	_vm = vm;
-
 	_mustExclaim = false;
+
+	for (int16 i = 0; i < kSpriteNumbMax; i++) {
+		_sprites[i] = new AnimationType(this);
+	}
 }
 
 Animation::~Animation() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]._quick)
-			_sprites[i].remove();
+		if (_sprites[i]->_quick)
+			_sprites[i]->remove();
+		delete(_sprites[i]);
 	}
 }
 
@@ -399,7 +405,7 @@ Animation::~Animation() {
 void Animation::resetAnims() {
 	setDirection(kDirStopped);
 	for (int16 i = 0; i < kSpriteNumbMax; i++)
-		_sprites[i].reset();
+		_sprites[i]->reset();
 }
 
 byte Animation::checkFeet(int16 x1, int16 x2, int16 oy, int16 y, byte yl) {
@@ -463,8 +469,8 @@ void Animation::catacombMove(byte ped) {
 		_vm->flipRoom(kRoomLusties, 5);
 		_vm->_dialogs->displayText("Oh no... here we go again...");
 		_vm->_userMovesAvvy = false;
-		_sprites[0]._moveY = 1;
-		_sprites[0]._moveX = 0;
+		_sprites[0]->_moveY = 1;
+		_sprites[0]->_moveX = 0;
 		return;
 	}
 
@@ -730,11 +736,11 @@ void Animation::catacombMove(byte ped) {
 	}
 
 	if ((_vm->_geidaFollows) && (ped > 0)) {
-		if (!_sprites[1]._quick)  // If we don't already have her...
-			_sprites[1].init(5, true, this); // ...Load Geida.
+		if (!_sprites[1]->_quick)  // If we don't already have her...
+			_sprites[1]->init(5, true); // ...Load Geida.
 		appearPed(1, geidaPed(ped));
-		_sprites[1]._callEachStepFl = true;
-		_sprites[1]._eachStepProc = kProcGeida;
+		_sprites[1]->_callEachStepFl = true;
+		_sprites[1]->_eachStepProc = kProcGeida;
 	}
 }
 
@@ -766,25 +772,25 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_userMovesAvvy = true;
 		break;
 	case 3: // _vm->special 3: Room 71: triggers dart.
-		_sprites[0].bounce(); // Must include that.
+		_sprites[0]->bounce(); // Must include that.
 
 		if (!_arrowTriggered) {
 			_arrowTriggered = true;
 			appearPed(1, 3); // The dart starts at ped 4, and...
-			_sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
-			_sprites[1]._facingDir = kDirUp; // Only face.
+			_sprites[1]->walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
+			_sprites[1]->_facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
 			// graphic of the arrow buried in the plaster. */
 
 			// OK!
-			_sprites[1]._callEachStepFl = true;
-			_sprites[1]._eachStepProc = kProcArrow;
+			_sprites[1]->_callEachStepFl = true;
+			_sprites[1]->_eachStepProc = kProcArrow;
 		}
 		break;
 	case 4: // This is the ghost room link.
 		_vm->fadeOut();
-		_sprites[0].turn(kDirRight); // you'll see this after we get back from bootstrap
+		_sprites[0]->turn(kDirRight); // you'll see this after we get back from bootstrap
 		_vm->_timer->addTimer(1, Timer::kProcGhostRoomPhew, Timer::kReasonGhostRoomPhew);
 		//_vm->_enid->backToBootstrap(3); TODO: Replace it with proper ScummVM-friendly function(s)!  Do not remove until then!
 		break;
@@ -793,28 +799,28 @@ void Animation::callSpecial(uint16 which) {
 			// _vm->special 5: Room 42: touched tree, and get tied up.
 			_vm->_magics[4]._operation = kMagicBounce; // Boundary effect is now working again.
 			_vm->_dialogs->displayScrollChain('q', 35);
-			_sprites[0].remove();
+			_sprites[0]->remove();
 			//tr[1].vanishifstill:=true;
 			_vm->_background->draw(-1, -1, 1);
 			_vm->_dialogs->displayScrollChain('q', 36);
 			_vm->_tiedUp = true;
 			_vm->_friarWillTieYouUp = false;
-			_sprites[1].walkTo(2);
-			_sprites[1]._vanishIfStill = true;
-			_sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
+			_sprites[1]->walkTo(2);
+			_sprites[1]->_vanishIfStill = true;
+			_sprites[1]->_doCheck = true; // One of them must have Check_Me switched on.
 			_vm->setRoom(kPeopleFriarTuck, kRoomDummy); // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
 	case 6: // _vm->special 6: fall down oubliette.
 		_vm->_userMovesAvvy = false;
-		_sprites[0]._moveX = 3;
-		_sprites[0]._moveY = 0;
-		_sprites[0]._facingDir = kDirRight;
+		_sprites[0]->_moveX = 3;
+		_sprites[0]->_moveY = 0;
+		_sprites[0]->_facingDir = kDirRight;
 		_vm->_timer->addTimer(1, Timer::kProcFallDownOubliette, Timer::kReasonFallingDownOubliette);
 		break;
 	case 7: // _vm->special 7: stop falling down oubliette.
-		_sprites[0]._visible = false;
+		_sprites[0]->_visible = false;
 		_vm->_magics[9]._operation = kMagicNothing;
 		stopWalking();
 		_vm->_timer->loseTimer(Timer::kReasonFallingDownOubliette);
@@ -826,18 +832,18 @@ void Animation::callSpecial(uint16 which) {
 	case 8:        // _vm->special 8: leave du Lustie's room.
 		if ((_vm->_geidaFollows) && (!_vm->_lustieIsAsleep)) {
 			_vm->_dialogs->displayScrollChain('q', 63);
-			_sprites[1].turn(kDirDown);
-			_sprites[1].stopWalk();
-			_sprites[1]._callEachStepFl = false; // Geida
+			_sprites[1]->turn(kDirDown);
+			_sprites[1]->stopWalk();
+			_sprites[1]->_callEachStepFl = false; // Geida
 			_vm->gameOver();
 		}
 		break;
 	case 9: // _vm->special 9: lose Geida to Robin Hood...
 		if (!_vm->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
-		_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
-		_sprites[1].walkTo(3); // She walks to somewhere...
-		_sprites[0].remove();     // Lose Avvy.
+		_sprites[1]->_callEachStepFl = false; // She no longer follows Avvy around.
+		_sprites[1]->walkTo(3); // She walks to somewhere...
+		_sprites[0]->remove();     // Lose Avvy.
 		_vm->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
 		break;
@@ -900,35 +906,35 @@ void Animation::callSpecial(uint16 which) {
 
 void Animation::updateSpeed() {
 	// Given that you've just changed the speed in _speedX, this adjusts _moveX.
-	_sprites[0]._moveX = (_sprites[0]._moveX / 3) * _sprites[0]._speedX;
-	_vm->_graphics->drawSpeedBar(_sprites[0]._speedX);
+	_sprites[0]->_moveX = (_sprites[0]->_moveX / 3) * _sprites[0]->_speedX;
+	_vm->_graphics->drawSpeedBar(_sprites[0]->_speedX);
 }
 
 void Animation::setMoveSpeed(byte t, Direction dir) {
 	switch (dir) {
 	case kDirUp:
-		_sprites[t].setSpeed(0, -_sprites[t]._speedY);
+		_sprites[t]->setSpeed(0, -_sprites[t]->_speedY);
 		break;
 	case kDirDown:
-		_sprites[t].setSpeed(0, _sprites[t]._speedY);
+		_sprites[t]->setSpeed(0, _sprites[t]->_speedY);
 		break;
 	case kDirLeft:
-		_sprites[t].setSpeed(-_sprites[t]._speedX,  0);
+		_sprites[t]->setSpeed(-_sprites[t]->_speedX,  0);
 		break;
 	case kDirRight:
-		_sprites[t].setSpeed(_sprites[t]._speedX,  0);
+		_sprites[t]->setSpeed(_sprites[t]->_speedX,  0);
 		break;
 	case kDirUpLeft:
-		_sprites[t].setSpeed(-_sprites[t]._speedX, -_sprites[t]._speedY);
+		_sprites[t]->setSpeed(-_sprites[t]->_speedX, -_sprites[t]->_speedY);
 		break;
 	case kDirUpRight:
-		_sprites[t].setSpeed(_sprites[t]._speedX, -_sprites[t]._speedY);
+		_sprites[t]->setSpeed(_sprites[t]->_speedX, -_sprites[t]->_speedY);
 		break;
 	case kDirDownLeft:
-		_sprites[t].setSpeed(-_sprites[t]._speedX, _sprites[t]._speedY);
+		_sprites[t]->setSpeed(-_sprites[t]->_speedX, _sprites[t]->_speedY);
 		break;
 	case kDirDownRight:
-		_sprites[t].setSpeed(_sprites[t]._speedX, _sprites[t]._speedY);
+		_sprites[t]->setSpeed(_sprites[t]->_speedX, _sprites[t]->_speedY);
 		break;
 	default:
 		break;
@@ -936,7 +942,7 @@ void Animation::setMoveSpeed(byte t, Direction dir) {
 }
 
 void Animation::appearPed(byte sprNum, byte pedNum) {
-	AnimationType *curSpr = &_sprites[sprNum];
+	AnimationType *curSpr = _sprites[sprNum];
 	PedType *curPed = &_vm->_peds[pedNum];
 	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
 	setMoveSpeed(sprNum, curPed->_direction);
@@ -946,59 +952,59 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
  * @remarks	Originally called 'follow_avvy_y'
  */
 void Animation::followAvalotY(byte tripnum) {
-	if (_sprites[0]._facingDir == kDirLeft)
+	if (_sprites[0]->_facingDir == kDirLeft)
 		return;
-	if (_sprites[tripnum]._homing)
-		_sprites[tripnum]._homingY = _sprites[1]._y;
+	if (_sprites[tripnum]->_homing)
+		_sprites[tripnum]->_homingY = _sprites[1]->_y;
 	else {
-		if (_sprites[tripnum]._y < _sprites[1]._y)
-			_sprites[tripnum]._y++;
-		else if (_sprites[tripnum]._y > _sprites[1]._y)
-			_sprites[tripnum]._y--;
+		if (_sprites[tripnum]->_y < _sprites[1]->_y)
+			_sprites[tripnum]->_y++;
+		else if (_sprites[tripnum]->_y > _sprites[1]->_y)
+			_sprites[tripnum]->_y--;
 		else
 			return;
-		if (_sprites[tripnum]._moveX == 0)  {
-			_sprites[tripnum]._stepNum++;
-			if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
-				_sprites[tripnum]._stepNum = 0;
-			_sprites[tripnum]._count = 0;
+		if (_sprites[tripnum]->_moveX == 0)  {
+			_sprites[tripnum]->_stepNum++;
+			if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
+				_sprites[tripnum]->_stepNum = 0;
+			_sprites[tripnum]->_count = 0;
 		}
 	}
 }
 
 void Animation::backAndForth(byte tripnum) {
-	if (!_sprites[tripnum]._homing) {
-		if (_sprites[tripnum]._facingDir == kDirRight)
-			_sprites[tripnum].walkTo(3);
+	if (!_sprites[tripnum]->_homing) {
+		if (_sprites[tripnum]->_facingDir == kDirRight)
+			_sprites[tripnum]->walkTo(3);
 		else
-			_sprites[tripnum].walkTo(4);
+			_sprites[tripnum]->walkTo(4);
 	}
 }
 
 void Animation::faceAvvy(byte tripnum) {
-	if (!_sprites[tripnum]._homing) {
-		if (_sprites[0]._x >= _sprites[tripnum]._x)
-			_sprites[tripnum]._facingDir = kDirRight;
+	if (!_sprites[tripnum]->_homing) {
+		if (_sprites[0]->_x >= _sprites[tripnum]->_x)
+			_sprites[tripnum]->_facingDir = kDirRight;
 		else
-			_sprites[tripnum]._facingDir = kDirLeft;
+			_sprites[tripnum]->_facingDir = kDirLeft;
 	}
 }
 
 void Animation::arrowProcs(byte tripnum) {
-	if (_sprites[tripnum]._homing) {
+	if (_sprites[tripnum]->_homing) {
 		// Arrow is still in flight.
 		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((_sprites[tripnum]._y + _sprites[tripnum]._info._yLength) >= _sprites[0]._y) // A
-				&& (_sprites[tripnum]._x <= (_sprites[0]._x + _sprites[0]._info._xLength)) // B
-				&& ((_sprites[tripnum]._x + _sprites[tripnum]._info._xLength) >= _sprites[0]._x)) { // C
+		if (((_sprites[tripnum]->_y + _sprites[tripnum]->_info._yLength) >= _sprites[0]->_y) // A
+				&& (_sprites[tripnum]->_x <= (_sprites[0]->_x + _sprites[0]->_info._xLength)) // B
+				&& ((_sprites[tripnum]->_x + _sprites[tripnum]->_info._xLength) >= _sprites[0]->_x)) { // C
 			// OK, it's hit him... what now?
 
-			_sprites[1]._callEachStepFl = false; // prevent recursion.
+			_sprites[1]->_callEachStepFl = false; // prevent recursion.
 			_vm->_dialogs->displayScrollChain('Q', 47); // Complaint!
-			_sprites[tripnum].remove(); // Deallocate the arrow.
+			_sprites[tripnum]->remove(); // Deallocate the arrow.
 
 			_vm->gameOver();
 
@@ -1006,7 +1012,7 @@ void Animation::arrowProcs(byte tripnum) {
 			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
-		_sprites[tripnum].remove(); // Deallocate the arrow.
+		_sprites[tripnum]->remove(); // Deallocate the arrow.
 		_vm->_background->draw(-1, -1, 2); // Show pic of arrow stuck into the door.
 		_vm->_arrowInTheDoor = true; // So that we can pick it up.
 	}
@@ -1014,43 +1020,43 @@ void Animation::arrowProcs(byte tripnum) {
 }
 
 void Animation::grabAvvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
-	int16 tox = _sprites[0]._x + 17;
-	int16 toy = _sprites[0]._y - 1;
-	if ((_sprites[tripnum]._x == tox) && (_sprites[tripnum]._y == toy)) {
-		_sprites[tripnum]._callEachStepFl = false;
-		_sprites[tripnum]._facingDir = kDirLeft;
-		_sprites[tripnum].stopWalk();
+	int16 tox = _sprites[0]->_x + 17;
+	int16 toy = _sprites[0]->_y - 1;
+	if ((_sprites[tripnum]->_x == tox) && (_sprites[tripnum]->_y == toy)) {
+		_sprites[tripnum]->_callEachStepFl = false;
+		_sprites[tripnum]->_facingDir = kDirLeft;
+		_sprites[tripnum]->stopWalk();
 		// ... whatever ...
 	} else {
 		// Still some way to go.
-		if (_sprites[tripnum]._x < tox) {
-			_sprites[tripnum]._x += 5;
-			if (_sprites[tripnum]._x > tox)
-				_sprites[tripnum]._x = tox;
+		if (_sprites[tripnum]->_x < tox) {
+			_sprites[tripnum]->_x += 5;
+			if (_sprites[tripnum]->_x > tox)
+				_sprites[tripnum]->_x = tox;
 		}
-		if (_sprites[tripnum]._y < toy)
-			_sprites[tripnum]._y++;
-		_sprites[tripnum]._stepNum++;
-		if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
-			_sprites[tripnum]._stepNum = 0;
+		if (_sprites[tripnum]->_y < toy)
+			_sprites[tripnum]->_y++;
+		_sprites[tripnum]->_stepNum++;
+		if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
+			_sprites[tripnum]->_stepNum = 0;
 	}
 }
 
 void Animation::takeAStep(byte &tripnum) {
-	if (_sprites[tripnum]._moveX == 0) {
-		_sprites[tripnum]._stepNum++;
-		if (_sprites[tripnum]._stepNum == _sprites[tripnum]._stat._seq)
-			_sprites[tripnum]._stepNum = 0;
-		_sprites[tripnum]._count = 0;
+	if (_sprites[tripnum]->_moveX == 0) {
+		_sprites[tripnum]->_stepNum++;
+		if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
+			_sprites[tripnum]->_stepNum = 0;
+		_sprites[tripnum]->_count = 0;
 	}
 }
 
 void Animation::spin(Direction dir, byte &tripnum) {
-	if (_sprites[tripnum]._facingDir == dir)
+	if (_sprites[tripnum]->_facingDir == dir)
 		return;
 
-	_sprites[tripnum]._facingDir = dir;
-	if (_sprites[tripnum]._id == 2)
+	_sprites[tripnum]->_facingDir = dir;
+	if (_sprites[tripnum]->_id == 2)
 		return; // Not for Spludwick
 
 	_geidaSpin++;
@@ -1069,35 +1075,35 @@ void Animation::geidaProcs(byte tripnum) {
 			_geidaSpin = 0;
 	}
 
-	if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
+	if (_sprites[tripnum]->_y < (_sprites[0]->_y - 2)) {
 		// Geida is further from the screen than Avvy.
 		spin(kDirDown, tripnum);
-		_sprites[tripnum]._moveY = 1;
-		_sprites[tripnum]._moveX = 0;
+		_sprites[tripnum]->_moveY = 1;
+		_sprites[tripnum]->_moveX = 0;
 		takeAStep(tripnum);
 		return;
-	} else if (_sprites[tripnum]._y > (_sprites[0]._y + 2)) {
+	} else if (_sprites[tripnum]->_y > (_sprites[0]->_y + 2)) {
 		// Avvy is further from the screen than Geida.
 		spin(kDirUp, tripnum);
-		_sprites[tripnum]._moveY = -1;
-		_sprites[tripnum]._moveX = 0;
+		_sprites[tripnum]->_moveY = -1;
+		_sprites[tripnum]->_moveX = 0;
 		takeAStep(tripnum);
 		return;
 	}
 
-	_sprites[tripnum]._moveY = 0;
+	_sprites[tripnum]->_moveY = 0;
 	// These 12-s are not in the original, I added them to make the following method more "smooth".
 	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
-	if (_sprites[tripnum]._x < _sprites[0]._x - _sprites[0]._speedX * 8 - 12) {
-		_sprites[tripnum]._moveX = _sprites[0]._speedX;
+	if (_sprites[tripnum]->_x < _sprites[0]->_x - _sprites[0]->_speedX * 8 - 12) {
+		_sprites[tripnum]->_moveX = _sprites[0]->_speedX;
 		spin(kDirRight, tripnum);
 		takeAStep(tripnum);
-	} else if (_sprites[tripnum]._x > _sprites[0]._x + _sprites[0]._speedX * 8 + 12) {
-		_sprites[tripnum]._moveX = -_sprites[0]._speedX;
+	} else if (_sprites[tripnum]->_x > _sprites[0]->_x + _sprites[0]->_speedX * 8 + 12) {
+		_sprites[tripnum]->_moveX = -_sprites[0]->_speedX;
 		spin(kDirLeft, tripnum);
 		takeAStep(tripnum);
 	} else
-		_sprites[tripnum]._moveX = 0;
+		_sprites[tripnum]->_moveX = 0;
 }
 
 /**
@@ -1112,7 +1118,7 @@ void Animation::drawSprites() {
 		order[i] = -1;
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]._quick && _sprites[i]._visible)
+		if (_sprites[i]->_quick && _sprites[i]->_visible)
 			order[i] = i;
 	}
 
@@ -1120,7 +1126,7 @@ void Animation::drawSprites() {
 		ok = true;
 		for (int i = 0; i < 4; i++) {
 			if (((order[i] != -1) && (order[i + 1] != -1))
-					&& (_sprites[order[i]]._y > _sprites[order[i + 1]]._y)) {
+					&& (_sprites[order[i]]->_y > _sprites[order[i + 1]]->_y)) {
 				// Swap them!
 				temp = order[i];
 				order[i] = order[i + 1];
@@ -1134,7 +1140,7 @@ void Animation::drawSprites() {
 
 	for (int i = 0; i < 5; i++) {
 		if (order[i] > -1)
-			_sprites[order[i]].draw();
+			_sprites[order[i]]->draw();
 	}
 }
 
@@ -1146,15 +1152,15 @@ void Animation::animLink() {
 	if (_vm->_menu->isActive() || _vm->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]._quick && _sprites[i]._visible)
-			_sprites[i].walk();
+		if (_sprites[i]->_quick && _sprites[i]->_visible)
+			_sprites[i]->walk();
 	}
 
 	drawSprites();
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]._quick && _sprites[i]._callEachStepFl) {
-			switch (_sprites[i]._eachStepProc) {
+		if (_sprites[i]->_quick && _sprites[i]->_callEachStepFl) {
+			switch (_sprites[i]->_eachStepProc) {
 			case kProcFollowAvvyY :
 				followAvalotY(i);
 				break;
@@ -1185,10 +1191,10 @@ void Animation::animLink() {
 }
 
 void Animation::stopWalking() {
-	_sprites[0].stopWalk();
+	_sprites[0]->stopWalk();
 	_direction = kDirStopped;
 	if (_vm->_alive)
-		_sprites[0]._stepNum = 1;
+		_sprites[0]->_stepNum = 1;
 }
 
 /**
@@ -1201,7 +1207,7 @@ void Animation::hideInCupboard() {
 			Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", kControlItalic, kControlRoman);
 			_vm->_dialogs->displayText(tmpStr);
 		} else {
-			_sprites[0]._visible = true;
+			_sprites[0]->_visible = true;
 			_vm->_userMovesAvvy = true;
 			appearPed(0, 2); // Walk out of the cupboard.
 			_vm->_dialogs->displayText("You leave the cupboard. Nice to be out of there!");
@@ -1210,7 +1216,7 @@ void Animation::hideInCupboard() {
 		}
 	} else {
 		// Not hiding in the cupboard
-		_sprites[0]._visible = false;
+		_sprites[0]->_visible = false;
 		_vm->_userMovesAvvy = false;
 		Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \
 			"but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", kControlParagraph);
@@ -1225,9 +1231,9 @@ void Animation::hideInCupboard() {
  */
 bool Animation::inField(byte which) {
 	FieldType *curField = &_vm->_fields[which];
-	int16 yy = _sprites[0]._y + _sprites[0]._info._yLength;
+	int16 yy = _sprites[0]->_y + _sprites[0]->_info._yLength;
 
-	return (_sprites[0]._x >= curField->_x1) && (_sprites[0]._x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
+	return (_sprites[0]->_x >= curField->_x1) && (_sprites[0]->_x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
 /**
@@ -1239,8 +1245,8 @@ bool Animation::nearDoor() {
 		return false;
 	}
 
-	int16 ux = _sprites[0]._x;
-	int16 uy = _sprites[0]._y + _sprites[0]._info._yLength;
+	int16 ux = _sprites[0]->_x;
+	int16 uy = _sprites[0]->_y + _sprites[0]->_info._yLength;
 
 	for (int i = 8; i < _vm->_fieldNum; i++) {
 		FieldType *curField = &_vm->_fields[i];
@@ -1357,7 +1363,7 @@ void Animation::synchronize(Common::Serializer &sz) {
 	byte spriteNum = 0;
 	if (sz.isSaving()) {
 		for (int i = 0; i < kSpriteNumbMax; i++) {
-			if (_sprites[i]._quick)
+			if (_sprites[i]->_quick)
 				spriteNum++;
 		}
 	}
@@ -1365,20 +1371,20 @@ void Animation::synchronize(Common::Serializer &sz) {
 
 	if (sz.isLoading()) {
 		for (int i = 0; i < kSpriteNumbMax; i++) { // Deallocate sprites.
-			AnimationType *spr = &_sprites[i];
+			AnimationType *spr = _sprites[i];
 			if (spr->_quick)
 				spr->remove();
 		}
 	}
 
 	for (int i = 0; i < spriteNum; i++) {
-		AnimationType *spr = &_sprites[i];
+		AnimationType *spr = _sprites[i];
 		sz.syncAsByte(spr->_id);
 		sz.syncAsByte(spr->_doCheck);
 
 		if (sz.isLoading()) {
 			spr->_quick = true;
-			spr->init(spr->_id, spr->_doCheck, this);
+			spr->init(spr->_id, spr->_doCheck);
 		}
 
 		sz.syncAsByte(spr->_moveX);
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index ad70645..ac247b8 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -67,7 +67,9 @@ public:
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
 
-	void init(byte spritenum, bool doCheck, Animation *anim);
+	AnimationType(Animation *anim);
+
+	void init(byte spritenum, bool doCheck);
 	void reset();
 	void draw();
 	void turn(Direction whichway);
@@ -107,7 +109,7 @@ public:
 		kProcGeida // Spludwick uses it as well for homing! TODO: Unify it with kProcSpludwick.
 	};
 
-	AnimationType _sprites[kSpriteNumbMax];
+	AnimationType *_sprites[kSpriteNumbMax];
 
 	Animation(AvalancheEngine *vm);
 	~Animation();
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3e0bdb0..29e9d02 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -381,7 +381,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 		expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
 	_dialogs->displayText(tmpStr);
 
-	AnimationType *avvy = &_animation->_sprites[0];
+	AnimationType *avvy = _animation->_sprites[0];
 	if (avvy->_quick && avvy->_visible)
 		_animation->setMoveSpeed(0, _animation->getDirection()); // We push Avvy in the right direction is he was moving.
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index f74239c..fdc2ddd 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -278,7 +278,7 @@ void AvalancheEngine::setup() {
 	fadeIn();
 	_parser->_cursorState = false;
 	_parser->cursorOn();
-	_animation->_sprites[0]._speedX = kWalk;
+	_animation->_sprites[0]->_speedX = kWalk;
 	_animation->updateSpeed();
 
 	_menu->init();
@@ -610,9 +610,9 @@ void AvalancheEngine::enterNewTown() {
 void AvalancheEngine::putGeidaAt(byte whichPed, byte ped) {
 	if (ped == 0)
 		return;
-	AnimationType *spr1 = &_animation->_sprites[1];
+	AnimationType *spr1 = _animation->_sprites[1];
 
-	spr1->init(5, false, _animation); // load Geida
+	spr1->init(5, false); // load Geida
 	_animation->appearPed(1, whichPed);
 	spr1->_callEachStepFl = true;
 	spr1->_eachStepProc = Animation::kProcGeida;
@@ -653,10 +653,10 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomOutsideYours:
 		if (ped > 0) {
-			AnimationType *spr1 = &_animation->_sprites[1];
+			AnimationType *spr1 = _animation->_sprites[1];
 			if (!_talkedToCrapulus) {
 				_whereIs[kPeopleCrapulus - 150] = kRoomOutsideYours;
-				spr1->init(8, false, _animation); // load Crapulus
+				spr1->init(8, false); // load Crapulus
 
 				if (_roomCount[kRoomOutsideYours] == 1) {
 					_animation->appearPed(1, 3); // Start on the right-hand side of the screen.
@@ -673,7 +673,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 				_whereIs[kPeopleCrapulus - 150] = kRoomNowhere;
 
 			if (_crapulusWillTell) {
-				spr1->init(8, false, _animation);
+				spr1->init(8, false);
 				_animation->appearPed(1, 1);
 				spr1->walkTo(3);
 				_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
@@ -691,9 +691,9 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomSpludwicks:
 		if (_spludwickAtHome) {
-			AnimationType *spr1 = &_animation->_sprites[1];
+			AnimationType *spr1 = _animation->_sprites[1];
 			if (ped > 0) {
-				spr1->init(2, false, _animation); // load Spludwick
+				spr1->init(2, false); // load Spludwick
 				_animation->appearPed(1, 1);
 				_whereIs[kPeopleSpludwick - 150] = kRoomSpludwicks;
 			}
@@ -711,8 +711,8 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 			_magics[kColorLightred - 1]._operation = kMagicNothing;
 			_whereIs[kPeopleCwytalot - 150] = kRoomNowhere;
 		} else if (ped > 0) {
-			AnimationType *spr1 = &_animation->_sprites[1];
-			spr1->init(4, false, _animation); // 4 = Cwytalot
+			AnimationType *spr1 = _animation->_sprites[1];
+			spr1->init(4, false); // 4 = Cwytalot
 			spr1->_callEachStepFl = true;
 			spr1->_eachStepProc = Animation::kProcFollowAvvyY;
 			_whereIs[kPeopleCwytalot - 150] = kRoomBrummieRoad;
@@ -730,8 +730,8 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomArgentRoad:
 		if ((_cwytalotGone) && (!_passedCwytalotInHerts) && (ped == 2) && (_roomCount[kRoomArgentRoad] > 3)) {
-			AnimationType *spr1 = &_animation->_sprites[1];
-			spr1->init(4, false, _animation); // 4 = Cwytalot again
+			AnimationType *spr1 = _animation->_sprites[1];
+			spr1->init(4, false); // 4 = Cwytalot again
 			_animation->appearPed(1, 0);
 			spr1->walkTo(1);
 			spr1->_vanishIfStill = true;
@@ -754,8 +754,8 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 	case kRoomRobins:
 		if ((ped > 0) && (!_beenTiedUp)) {
 			// A welcome party... or maybe not...
-			AnimationType *spr1 = &_animation->_sprites[1];
-			spr1->init(6, false, _animation);
+			AnimationType *spr1 = _animation->_sprites[1];
+			spr1->init(6, false);
 			_animation->appearPed(1, 1);
 			spr1->walkTo(2);
 			_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp);
@@ -776,10 +776,10 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomOutsideCardiffCastle:
 		if (ped > 0) {
-			AnimationType *spr1 = &_animation->_sprites[1];
+			AnimationType *spr1 = _animation->_sprites[1];
 			switch (_cardiffQuestionNum) {
 			case 0 : // You've answered NONE of his questions.
-				spr1->init(9, false, _animation);
+				spr1->init(9, false);
 				_animation->appearPed(1, 1);
 				spr1->walkTo(2);
 				_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey);
@@ -788,7 +788,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 				_magics[1]._operation = kMagicNothing;
 				break; // You've answered ALL his questions. => nothing happens.
 			default: // You've answered SOME of his questions.
-				spr1->init(9, false, _animation);
+				spr1->init(9, false);
 				_animation->appearPed(1, 2);
 				spr1->_facingDir = kDirRight;
 				_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
@@ -853,7 +853,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomLustiesRoom:
 		_npcFacing = 1; // du Lustie.
-		if (_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
+		if (_animation->_sprites[0]->_id == 0) // Avvy in his normal clothes
 			_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
 		else if (!_enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
@@ -901,8 +901,8 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 		break;
 
 	case kRoomWiseWomans: {
-		AnimationType *spr1 = &_animation->_sprites[1];
-		spr1->init(11, false, _animation);
+		AnimationType *spr1 = _animation->_sprites[1];
+		spr1->init(11, false);
 		if ((_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) {
 			_animation->appearPed(1, 1); // Start on the right-hand side of the screen.
 			spr1->walkTo(3); // Walks up to greet you.
@@ -918,7 +918,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomInsideCardiffCastle:
 		if (ped > 0) {
-			_animation->_sprites[1].init(10, false, _animation); // Define the dart.
+			_animation->_sprites[1]->init(10, false); // Define the dart.
 			_background->draw(-1, -1, 0);
 			_graphics->refreshBackground();
 			_sequence->startCardiffSeq2();
@@ -1139,7 +1139,7 @@ void AvalancheEngine::guideAvvy(Common::Point cursorPos) {
 	byte what;
 
 	// _animation->tr[0] is Avalot.)
-	AnimationType *avvy = &_animation->_sprites[0];
+	AnimationType *avvy = _animation->_sprites[0];
 	if (cursorPos.x < avvy->_x)
 		what = 1;
 	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
@@ -1242,10 +1242,10 @@ void AvalancheEngine::checkClick() {
 
 				callVerb(kVerbCodeScore);
 			} else if ((320 <= cursorPos.x) && (cursorPos.x <= 357)) { // Change speed.
-				_animation->_sprites[0]._speedX = kWalk;
+				_animation->_sprites[0]->_speedX = kWalk;
 				_animation->updateSpeed();
 			} else if ((358 <= cursorPos.x) && (cursorPos.x <= 395)) { // Change speed.
-				_animation->_sprites[0]._speedX = kRun;
+				_animation->_sprites[0]->_speedX = kRun;
 				_animation->updateSpeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
 				fxToggle();
@@ -1343,12 +1343,12 @@ void AvalancheEngine::drawDirection() { // It's data is loaded in load_digits().
 void AvalancheEngine::gameOver() {
 	_userMovesAvvy = false;
 
-	AnimationType *avvy = &_animation->_sprites[0];
+	AnimationType *avvy = _animation->_sprites[0];
 	int16 sx = avvy->_x;
 	int16 sy = avvy->_y;
 
 	avvy->remove();
-	avvy->init(12, true, _animation); // 12 = Avalot falls
+	avvy->init(12, true); // 12 = Avalot falls
 	avvy->_stepNum = 0;
 	avvy->appear(sx, sy, kDirUp);
 
@@ -1373,7 +1373,7 @@ void AvalancheEngine::majorRedraw() {
 }
 
 uint16 AvalancheEngine::bearing(byte whichPed) {
-	AnimationType *avvy = &_animation->_sprites[0];
+	AnimationType *avvy = _animation->_sprites[0];
 	PedType *curPed = &_peds[whichPed];
 
 	if (avvy->_x == curPed->_x)
@@ -1488,14 +1488,14 @@ void AvalancheEngine::resetVariables() {
 
 void AvalancheEngine::newGame() {
 	for (int i = 0; i < kMaxSprites; i++) {
-		AnimationType *spr = &_animation->_sprites[i];
+		AnimationType *spr = _animation->_sprites[i];
 		if (spr->_quick)
 			spr->remove();
 	}
 	// Deallocate sprite. Sorry, beta testers!
 
-	AnimationType *avvy = &_animation->_sprites[0];
-	avvy->init(0, true, _animation);
+	AnimationType *avvy = _animation->_sprites[0];
+	avvy->init(0, true);
 
 	_alive = true;
 	resetVariables();
@@ -1648,8 +1648,8 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 	assert((ped > 0) && (ped < 15));
 	if (!_alive) {
 		// You can't leave the room if you're dead.
-		_animation->_sprites[0]._moveX = 0;
-		_animation->_sprites[0]._moveY = 0; // Stop him from moving.
+		_animation->_sprites[0]->_moveX = 0;
+		_animation->_sprites[0]->_moveY = 0; // Stop him from moving.
 		return;
 	}
 
@@ -1660,7 +1660,7 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 
 	if ((_jumpStatus > 0) && (_room == kRoomInsideCardiffCastle)) {
 		// You can't *jump* out of Cardiff Castle!
-		_animation->_sprites[0]._moveX = 0;
+		_animation->_sprites[0]->_moveX = 0;
 		return;
 	}
 
@@ -1668,8 +1668,8 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 	fadeOut();
 
 	for (int16 i = 1; i < _animation->kSpriteNumbMax; i++) {
-		if (_animation->_sprites[i]._quick)
-			_animation->_sprites[i].remove();
+		if (_animation->_sprites[i]->_quick)
+			_animation->_sprites[i]->remove();
 	} // Deallocate sprite
 
 	if (_room == kRoomLustiesRoom)
@@ -1679,7 +1679,7 @@ void AvalancheEngine::flipRoom(Room room, byte ped) {
 	_animation->appearPed(0, ped - 1);
 	_enterCatacombsFromLustiesRoom = false;
 	_animation->setOldDirection(_animation->getDirection());
-	_animation->setDirection(_animation->_sprites[0]._facingDir);
+	_animation->setDirection(_animation->_sprites[0]->_facingDir);
 	drawDirection();
 
 	fadeIn();
@@ -1721,7 +1721,7 @@ void AvalancheEngine::openDoor(Room whither, byte ped, byte magicnum) {
 				return;
 			} else {
 				_animation->appearPed(0, 5);
-				_animation->_sprites[0]._facingDir = kDirRight;
+				_animation->_sprites[0]->_facingDir = kDirRight;
 				_sequence->startLustiesSeq2(whither, ped);
 			}
 			break;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index e9cc1c7..84dbed4 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -688,7 +688,7 @@ void Dialogs::callDialogDriver() {
 				if (_param == 0)
 					setBubbleStateNatural();
 				else if ((1 <= _param) && (_param <= 9)) {
-					AnimationType *spr = &_vm->_animation->_sprites[_param - 1];
+					AnimationType *spr = _vm->_animation->_sprites[_param - 1];
 					if ((_param > _vm->_animation->kSpriteNumbMax) || (!spr->_quick)) { // Not valid.
 						_vm->errorLed();
 						setBubbleStateNatural();
@@ -1074,7 +1074,7 @@ void Dialogs::talkTo(byte whom) {
 
 	bool noMatches = true;
 	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._stat._acciNum == whom) {
+		if (_vm->_animation->_sprites[i]->_stat._acciNum == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, i + 49, kControlToBuffer);
 			displayText(tmpStr);
 			noMatches = false;
@@ -1099,7 +1099,7 @@ void Dialogs::talkTo(byte whom) {
 		_vm->_talkedToCrapulus = true;
 		_vm->setRoom(kPeopleCrapulus, kRoomDummy); // Crapulus walks off.
 
-		AnimationType *spr = &_vm->_animation->_sprites[1];
+		AnimationType *spr = _vm->_animation->_sprites[1];
 		spr->_vanishIfStill = true;
 		spr->walkTo(2); // Walks away.
 
@@ -1134,7 +1134,7 @@ Common::String Dialogs::personSpeaks() {
 	Common::String tmpStr;
 
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _vm->_parser->_person)) {
+		if (_vm->_animation->_sprites[i]->_quick && ((_vm->_animation->_sprites[i]->_stat._acciNum + 149) == _vm->_parser->_person)) {
 			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
 			found = true;
 		}
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index f722b12..59ac38f 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -431,7 +431,7 @@ void Menu::setupMenuAction() {
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]._speedX == _vm->kWalk)
+	if (_vm->_animation->_sprites[0]->_speedX == _vm->kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -595,7 +595,7 @@ void Menu::runMenuAction() {
 		_vm->callVerb(kVerbCodeInv);
 		break;
 	case 5: {
-		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		AnimationType *avvy = _vm->_animation->_sprites[0];
 		if (avvy->_speedX == _vm->kWalk)
 			avvy->_speedX = _vm->kRun;
 		else
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 36d0349..d85e550 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -714,8 +714,8 @@ void Parser::storeInterrogation(byte interrogation) {
 			_vm->_spareEvening.clear();
 		_vm->_spareEvening = _inputText;
 		_vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
-		_vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge
-		_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
+		_vm->_animation->_sprites[1]->walkTo(3); // The end of the drawbridge
+		_vm->_animation->_sprites[1]->_vanishIfStill = true; // Then go away!
 		_vm->_magics[1]._operation = kMagicNothing;
 		_vm->_cardiffQuestionNum = 5;
 		break;
@@ -1265,14 +1265,14 @@ void Parser::openDoor() {
 			MagicType *portal = &_vm->_portals[i];
 			switch (portal->_operation) {
 			case kMagicExclaim:
-				_vm->_animation->_sprites[0].bounce();
+				_vm->_animation->_sprites[0]->bounce();
 				_vm->_dialogs->displayScrollChain('x', portal->_data);
 				break;
 			case kMagicTransport:
 				_vm->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
 				break;
 			case kMagicUnfinished:
-				_vm->_animation->_sprites[0].bounce();
+				_vm->_animation->_sprites[0]->bounce();
 				_vm->_dialogs->displayText("Sorry. This place is not available yet!");
 				break;
 			case kMagicSpecial:
@@ -1393,9 +1393,9 @@ void Parser::notInOrder() {
  */
 void Parser::goToCauldron() {
 	// Stops Geida_Procs.
-	_vm->_animation->_sprites[1]._callEachStepFl = false;
+	_vm->_animation->_sprites[1]->_callEachStepFl = false;
 	_vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk);
-	_vm->_animation->_sprites[1].walkTo(1);
+	_vm->_animation->_sprites[1]->walkTo(1);
 }
 
 /**
@@ -1456,7 +1456,7 @@ void Parser::drink() {
 		_vm->fadeOut();
 		_vm->flipRoom(kRoomYours, 1);
 		_vm->_graphics->setBackgroundColor(kColorYellow);
-		_vm->_animation->_sprites[0]._visible = false;
+		_vm->_animation->_sprites[0]->_visible = false;
 	}
 }
 
@@ -1490,7 +1490,7 @@ void Parser::standUp() {
 				_vm->_graphics->setBackgroundColor(kColorBlack);
 				_vm->_dialogs->displayScrollChain('d', 14);
 			}
-			_vm->_animation->_sprites[0]._visible = true;
+			_vm->_animation->_sprites[0]->_visible = true;
 			_vm->_userMovesAvvy = true;
 			_vm->_animation->appearPed(0, 1);
 			_vm->_animation->setDirection(kDirLeft);
@@ -1512,7 +1512,7 @@ void Parser::standUp() {
 			// Not sitting down.
 			_vm->_background->draw(-1, -1, 3);
 			// But standing up.
-			_vm->_animation->_sprites[0]._visible = true;
+			_vm->_animation->_sprites[0]->_visible = true;
 			// And walking away.
 			_vm->_animation->appearPed(0, 3);
 			// Really not sitting down.
@@ -1926,12 +1926,12 @@ void Parser::doThat() {
 					i = 3;
 				else
 					i = 0;
-				Avalanche::AnimationType *spr = &_vm->_animation->_sprites[0];
+				Avalanche::AnimationType *spr = _vm->_animation->_sprites[0];
 				if (spr->_id != i) {
 					int16 x = spr->_x;
 					int16 y = spr->_y;
 					spr->remove();
-					spr->init(i, true, _vm->_animation);
+					spr->init(i, true);
 					spr->appear(x, y, kDirLeft);
 					spr->_visible = false;
 				}
@@ -2072,9 +2072,9 @@ void Parser::doThat() {
 				if (_vm->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
 					_vm->_dialogs->displayScrollChain('q', 18);
 				else {
-					Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1];
+					Avalanche::AnimationType *spr = _vm->_animation->_sprites[1];
 					// Avaricius
-					spr->init(1, false, _vm->_animation);
+					spr->init(1, false);
 					_vm->_animation->appearPed(1, 3);
 					spr->walkTo(4);
 					spr->_callEachStepFl = true;
@@ -2255,9 +2255,9 @@ void Parser::doThat() {
 				_vm->refreshObjectList();
 				_vm->_magics[11]._operation = kMagicNothing;
 				_vm->incScore(7);
-				_vm->_animation->_sprites[1].walkTo(1);
-				_vm->_animation->_sprites[1]._vanishIfStill = true;
-				_vm->_animation->_sprites[1]._callEachStepFl = false;
+				_vm->_animation->_sprites[1]->walkTo(1);
+				_vm->_animation->_sprites[1]->_vanishIfStill = true;
+				_vm->_animation->_sprites[1]->_callEachStepFl = false;
 				_vm->setRoom(kPeopleCwytalot, kRoomDummy);
 				break;
 			default:
@@ -2385,7 +2385,7 @@ void Parser::doThat() {
 				_vm->_dialogs->displayText("You're already sitting!");
 			else {
 				// Move Avvy to the place, and sit him down.
-				_vm->_animation->_sprites[0].walkTo(3);
+				_vm->_animation->_sprites[0]->walkTo(3);
 				_vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown);
 			}
 		} else {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index b4ba028..4e90c7f 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -242,7 +242,7 @@ void Timer::avariciusTalks() {
 }
 
 void Timer::urinate() {
-	_vm->_animation->_sprites[0].turn(kDirUp);
+	_vm->_animation->_sprites[0]->turn(kDirUp);
 	_vm->_animation->stopWalking();
 	_vm->drawDirection();
 	addTimer(14, kProcToilet, kReasonGoToToilet);
@@ -264,7 +264,7 @@ void Timer::bang2() {
 
 void Timer::stairs() {
 	_vm->_sound->blip();
-	_vm->_animation->_sprites[0].walkTo(3);
+	_vm->_animation->_sprites[0]->walkTo(3);
 	_vm->_background->draw(-1, -1, 1);
 	_vm->_brummieStairs = 2;
 	_vm->_magics[10]._operation = kMagicSpecial;
@@ -298,7 +298,7 @@ void Timer::getTiedUp() {
 	_vm->_beenTiedUp = true;
 	_vm->_animation->stopWalking();
 
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	spr->stopWalk();
 	spr->stopHoming();
 	spr->_callEachStepFl = true;
@@ -307,17 +307,17 @@ void Timer::getTiedUp() {
 }
 
 void Timer::getTiedUp2() {
-	_vm->_animation->_sprites[0].walkTo(3);
-	_vm->_animation->_sprites[1].walkTo(4);
+	_vm->_animation->_sprites[0]->walkTo(3);
+	_vm->_animation->_sprites[1]->walkTo(4);
 	_vm->_magics[3]._operation = kMagicNothing; // No effect when you touch the boundaries.
 	_vm->_friarWillTieYouUp = true;
 }
 
 void Timer::hangAround() {
-	_vm->_animation->_sprites[1]._doCheck = false;
+	_vm->_animation->_sprites[1]->_doCheck = false;
 
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	avvy->init(7, true, _vm->_animation); // Robin Hood
+	AnimationType *avvy = _vm->_animation->_sprites[0];
+	avvy->init(7, true); // Robin Hood
 	_vm->setRoom(kPeopleRobinHood, kRoomRobins);
 	_vm->_animation->appearPed(0, 1);
 	_vm->_dialogs->displayScrollChain('q', 39);
@@ -327,12 +327,12 @@ void Timer::hangAround() {
 
 void Timer::hangAround2() {
 	_vm->_dialogs->displayScrollChain('q', 40);
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	spr->_vanishIfStill = false;
 	spr->walkTo(3);
 	_vm->setRoom(kPeopleFriarTuck, kRoomRobins);
 	_vm->_dialogs->displayScrollChain('q', 41);
-	_vm->_animation->_sprites[0].remove();
+	_vm->_animation->_sprites[0]->remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
 
 	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
@@ -347,7 +347,7 @@ void Timer::afterTheShootemup() {
 	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 	_vm->flipRoom(_vm->_room, 1);
 
-	_vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot.
+	_vm->_animation->_sprites[0]->init(0, true); // Avalot.
 	_vm->_animation->appearPed(0, 1);
 	_vm->_userMovesAvvy = true;
 	_vm->_objects[kObjectCrossbow - 1] = true;
@@ -417,8 +417,8 @@ void Timer::jacquesWakesUp() {
 }
 
 void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
-	AnimationType *spr = &_vm->_animation->_sprites[1];
-	spr->init(9, false, _vm->_animation); // Here comes the Duke.
+	AnimationType *spr = _vm->_animation->_sprites[1];
+	spr->init(9, false); // Here comes the Duke.
 	_vm->_animation->appearPed(1, 0); // He starts at the door...
 	spr->walkTo(2); // He walks over to you.
 
@@ -430,7 +430,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
 }
 
 void Timer::naughtyDuke2() {
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	_vm->_dialogs->displayScrollChain('q', 48); // "Ha ha, it worked again!"
 	spr->walkTo(0); // Walk to the door.
 	spr->_vanishIfStill = true; // Then go away!
@@ -444,7 +444,7 @@ void Timer::naughtyDuke3() {
 }
 
 void Timer::jump() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
 
 	_vm->_jumpStatus++;
 	switch (_vm->_jumpStatus) {
@@ -534,7 +534,7 @@ void Timer::greetsMonk() {
 void Timer::fallDownOubliette() {
 	_vm->_magics[8]._operation = kMagicNothing;
 
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
 	avvy->_moveY++; // Increments dx/dy!
 	avvy->_y += avvy->_moveY;   // Dowwwn we go...
 	addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
@@ -551,7 +551,7 @@ void Timer::meetAvaroid() {
 		_vm->_metAvaroid = true;
 		addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
 
-		AnimationType *avvy = &_vm->_animation->_sprites[0];
+		AnimationType *avvy = _vm->_animation->_sprites[0];
 		avvy->_facingDir = kDirLeft;
 		avvy->_x = 151;
 		avvy->_moveX = -3;
@@ -562,7 +562,7 @@ void Timer::meetAvaroid() {
 }
 
 void Timer::riseUpOubliette() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
 	avvy->_visible = true;
 	avvy->_moveY++; // Decrements dx/dy!
 	avvy->_y -= avvy->_moveY; // Uuuupppp we go...
@@ -573,12 +573,12 @@ void Timer::riseUpOubliette() {
 }
 
 void Timer::robinHoodAndGeida() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	avvy->init(7, true, _vm->_animation);
+	AnimationType *avvy = _vm->_animation->_sprites[0];
+	avvy->init(7, true);
 	_vm->_animation->appearPed(0, 6);
 	avvy->walkTo(5);
 
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	spr->stopWalk();
 	spr->_facingDir = kDirLeft;
 	addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
@@ -588,8 +588,8 @@ void Timer::robinHoodAndGeida() {
 void Timer::robinHoodAndGeidaTalk() {
 	_vm->_dialogs->displayScrollChain('q', 66);
 
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	avvy->walkTo(1);
 	spr->walkTo(1);
 	avvy->_vanishIfStill = true;
@@ -599,11 +599,11 @@ void Timer::robinHoodAndGeidaTalk() {
 }
 
 void Timer::avalotReturns() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
-	AnimationType *spr = &_vm->_animation->_sprites[1];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
+	AnimationType *spr = _vm->_animation->_sprites[1];
 	avvy->remove();
 	spr->remove();
-	avvy->init(0, true, _vm->_animation);
+	avvy->init(0, true);
 	_vm->_animation->appearPed(0, 0);
 	_vm->_dialogs->displayScrollChain('q', 67);
 	_vm->_userMovesAvvy = true;
@@ -615,7 +615,7 @@ void Timer::avalotReturns() {
  * @remarks	Originally called 'avvy_sit_down'
  */
 void Timer::avvySitDown() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
 	if (avvy->_homing)    // Still walking.
 		addTimer(1, kProcAvvySitDown, kReasonSittingDown);
 	else {
@@ -658,7 +658,7 @@ void Timer::winning() {
 }
 
 void Timer::avalotFalls() {
-	AnimationType *avvy = &_vm->_animation->_sprites[0];
+	AnimationType *avvy = _vm->_animation->_sprites[0];
 	if (avvy->_stepNum < 5) {
 		avvy->_stepNum++;
 		addTimer(3, kProcAvalotFalls, kReasonFallingOver);
@@ -673,14 +673,14 @@ void Timer::avalotFalls() {
 }
 
 void Timer::spludwickGoesToCauldron() {
-	if (_vm->_animation->_sprites[1]._homing)
+	if (_vm->_animation->_sprites[1]->_homing)
 		addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludwickWalk);
 	else
 		addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludwickWalk);
 }
 
 void Timer::spludwickLeavesCauldron() {
-	_vm->_animation->_sprites[1]._callEachStepFl = true; // So that normal procs will continue.
+	_vm->_animation->_sprites[1]->_callEachStepFl = true; // So that normal procs will continue.
 }
 
 void Timer::giveLuteToGeida() { // Moved here from Acci.


Commit: 609846ab8aeaeef533d867f2740143d6ffbdbed4
    https://github.com/scummvm/scummvm/commit/609846ab8aeaeef533d867f2740143d6ffbdbed4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T12:18:56-07:00

Commit Message:
AVALANCHE: Reduce verbosity in Animation and AnimationType

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index f419034..4bf2c69 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -954,57 +954,68 @@ void Animation::appearPed(byte sprNum, byte pedNum) {
 void Animation::followAvalotY(byte tripnum) {
 	if (_sprites[0]->_facingDir == kDirLeft)
 		return;
-	if (_sprites[tripnum]->_homing)
-		_sprites[tripnum]->_homingY = _sprites[1]->_y;
+
+	AnimationType *tripSpr = _sprites[tripnum];
+
+	if (tripSpr->_homing)
+		tripSpr->_homingY = _sprites[1]->_y;
 	else {
-		if (_sprites[tripnum]->_y < _sprites[1]->_y)
-			_sprites[tripnum]->_y++;
-		else if (_sprites[tripnum]->_y > _sprites[1]->_y)
-			_sprites[tripnum]->_y--;
+		if (tripSpr->_y < _sprites[1]->_y)
+			tripSpr->_y++;
+		else if (tripSpr->_y > _sprites[1]->_y)
+			tripSpr->_y--;
 		else
 			return;
-		if (_sprites[tripnum]->_moveX == 0)  {
-			_sprites[tripnum]->_stepNum++;
-			if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
-				_sprites[tripnum]->_stepNum = 0;
-			_sprites[tripnum]->_count = 0;
+
+		if (tripSpr->_moveX == 0)  {
+			tripSpr->_stepNum++;
+			if (tripSpr->_stepNum == tripSpr->_stat._seq)
+				tripSpr->_stepNum = 0;
+			tripSpr->_count = 0;
 		}
 	}
 }
 
 void Animation::backAndForth(byte tripnum) {
-	if (!_sprites[tripnum]->_homing) {
-		if (_sprites[tripnum]->_facingDir == kDirRight)
-			_sprites[tripnum]->walkTo(3);
+	AnimationType *tripSpr = _sprites[tripnum];
+
+	if (!tripSpr->_homing) {
+		if (tripSpr->_facingDir == kDirRight)
+			tripSpr->walkTo(3);
 		else
-			_sprites[tripnum]->walkTo(4);
+			tripSpr->walkTo(4);
 	}
 }
 
 void Animation::faceAvvy(byte tripnum) {
-	if (!_sprites[tripnum]->_homing) {
-		if (_sprites[0]->_x >= _sprites[tripnum]->_x)
-			_sprites[tripnum]->_facingDir = kDirRight;
+	AnimationType *tripSpr = _sprites[tripnum];
+
+	if (!tripSpr->_homing) {
+		if (_sprites[0]->_x >= tripSpr->_x)
+			tripSpr->_facingDir = kDirRight;
 		else
-			_sprites[tripnum]->_facingDir = kDirLeft;
+			tripSpr->_facingDir = kDirLeft;
 	}
 }
 
 void Animation::arrowProcs(byte tripnum) {
-	if (_sprites[tripnum]->_homing) {
+	AnimationType *tripSpr = _sprites[tripnum];
+	AnimationType *avvy = _sprites[tripnum];
+
+	if (tripSpr->_homing) {
 		// Arrow is still in flight.
 		// We must check whether or not the arrow has collided tr[tripnum] Avvy's head.
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((_sprites[tripnum]->_y + _sprites[tripnum]->_info._yLength) >= _sprites[0]->_y) // A
-				&& (_sprites[tripnum]->_x <= (_sprites[0]->_x + _sprites[0]->_info._xLength)) // B
-				&& ((_sprites[tripnum]->_x + _sprites[tripnum]->_info._xLength) >= _sprites[0]->_x)) { // C
+		if (((tripSpr->_y + tripSpr->_info._yLength) >= avvy->_y) // A
+				&& (tripSpr->_x <= (avvy->_x + avvy->_info._xLength)) // B
+				&& ((tripSpr->_x + tripSpr->_info._xLength) >= avvy->_x)) { // C
 			// OK, it's hit him... what now?
 
 			_sprites[1]->_callEachStepFl = false; // prevent recursion.
 			_vm->_dialogs->displayScrollChain('Q', 47); // Complaint!
-			_sprites[tripnum]->remove(); // Deallocate the arrow.
+			tripSpr->remove(); // Deallocate the arrow.
 
 			_vm->gameOver();
 
@@ -1012,51 +1023,57 @@ void Animation::arrowProcs(byte tripnum) {
 			_vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
 		}
 	} else { // Arrow has hit the wall!
-		_sprites[tripnum]->remove(); // Deallocate the arrow.
+		tripSpr->remove(); // Deallocate the arrow.
 		_vm->_background->draw(-1, -1, 2); // Show pic of arrow stuck into the door.
 		_vm->_arrowInTheDoor = true; // So that we can pick it up.
 	}
-
 }
 
 void Animation::grabAvvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
-	int16 tox = _sprites[0]->_x + 17;
-	int16 toy = _sprites[0]->_y - 1;
-	if ((_sprites[tripnum]->_x == tox) && (_sprites[tripnum]->_y == toy)) {
-		_sprites[tripnum]->_callEachStepFl = false;
-		_sprites[tripnum]->_facingDir = kDirLeft;
-		_sprites[tripnum]->stopWalk();
+	AnimationType *tripSpr = _sprites[tripnum];
+	AnimationType *avvy = _sprites[tripnum];
+
+	int16 tox = avvy->_x + 17;
+	int16 toy = avvy->_y - 1;
+	if ((tripSpr->_x == tox) && (tripSpr->_y == toy)) {
+		tripSpr->_callEachStepFl = false;
+		tripSpr->_facingDir = kDirLeft;
+		tripSpr->stopWalk();
 		// ... whatever ...
 	} else {
 		// Still some way to go.
-		if (_sprites[tripnum]->_x < tox) {
-			_sprites[tripnum]->_x += 5;
-			if (_sprites[tripnum]->_x > tox)
-				_sprites[tripnum]->_x = tox;
+		if (tripSpr->_x < tox) {
+			tripSpr->_x += 5;
+			if (tripSpr->_x > tox)
+				tripSpr->_x = tox;
 		}
-		if (_sprites[tripnum]->_y < toy)
-			_sprites[tripnum]->_y++;
-		_sprites[tripnum]->_stepNum++;
-		if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
-			_sprites[tripnum]->_stepNum = 0;
+		if (tripSpr->_y < toy)
+			tripSpr->_y++;
+		tripSpr->_stepNum++;
+		if (tripSpr->_stepNum == tripSpr->_stat._seq)
+			tripSpr->_stepNum = 0;
 	}
 }
 
 void Animation::takeAStep(byte &tripnum) {
-	if (_sprites[tripnum]->_moveX == 0) {
-		_sprites[tripnum]->_stepNum++;
-		if (_sprites[tripnum]->_stepNum == _sprites[tripnum]->_stat._seq)
-			_sprites[tripnum]->_stepNum = 0;
-		_sprites[tripnum]->_count = 0;
+	AnimationType *tripSpr = _sprites[tripnum];
+
+	if (tripSpr->_moveX == 0) {
+		tripSpr->_stepNum++;
+		if (tripSpr->_stepNum == tripSpr->_stat._seq)
+			tripSpr->_stepNum = 0;
+		tripSpr->_count = 0;
 	}
 }
 
 void Animation::spin(Direction dir, byte &tripnum) {
-	if (_sprites[tripnum]->_facingDir == dir)
+	AnimationType *tripSpr = _sprites[tripnum];
+
+	if (tripSpr->_facingDir == dir)
 		return;
 
-	_sprites[tripnum]->_facingDir = dir;
-	if (_sprites[tripnum]->_id == 2)
+	tripSpr->_facingDir = dir;
+	if (tripSpr->_id == 2)
 		return; // Not for Spludwick
 
 	_geidaSpin++;
@@ -1069,41 +1086,44 @@ void Animation::spin(Direction dir, byte &tripnum) {
 }
 
 void Animation::geidaProcs(byte tripnum) {
+	AnimationType *tripSpr = _sprites[tripnum];
+	AnimationType *avvy = _sprites[0];
+
 	if (_geidaTime > 0) {
 		_geidaTime--;
 		if (_geidaTime == 0)
 			_geidaSpin = 0;
 	}
 
-	if (_sprites[tripnum]->_y < (_sprites[0]->_y - 2)) {
+	if (tripSpr->_y < (avvy->_y - 2)) {
 		// Geida is further from the screen than Avvy.
 		spin(kDirDown, tripnum);
-		_sprites[tripnum]->_moveY = 1;
-		_sprites[tripnum]->_moveX = 0;
+		tripSpr->_moveY = 1;
+		tripSpr->_moveX = 0;
 		takeAStep(tripnum);
 		return;
-	} else if (_sprites[tripnum]->_y > (_sprites[0]->_y + 2)) {
+	} else if (tripSpr->_y > (avvy->_y + 2)) {
 		// Avvy is further from the screen than Geida.
 		spin(kDirUp, tripnum);
-		_sprites[tripnum]->_moveY = -1;
-		_sprites[tripnum]->_moveX = 0;
+		tripSpr->_moveY = -1;
+		tripSpr->_moveX = 0;
 		takeAStep(tripnum);
 		return;
 	}
 
-	_sprites[tripnum]->_moveY = 0;
+	tripSpr->_moveY = 0;
 	// These 12-s are not in the original, I added them to make the following method more "smooth".
 	// Now the NPC which is following Avvy won't block his way and will walk next to him properly.
-	if (_sprites[tripnum]->_x < _sprites[0]->_x - _sprites[0]->_speedX * 8 - 12) {
-		_sprites[tripnum]->_moveX = _sprites[0]->_speedX;
+	if (tripSpr->_x < avvy->_x - avvy->_speedX * 8 - 12) {
+		tripSpr->_moveX = avvy->_speedX;
 		spin(kDirRight, tripnum);
 		takeAStep(tripnum);
-	} else if (_sprites[tripnum]->_x > _sprites[0]->_x + _sprites[0]->_speedX * 8 + 12) {
-		_sprites[tripnum]->_moveX = -_sprites[0]->_speedX;
+	} else if (tripSpr->_x > avvy->_x + avvy->_speedX * 8 + 12) {
+		tripSpr->_moveX = -avvy->_speedX;
 		spin(kDirLeft, tripnum);
 		takeAStep(tripnum);
 	} else
-		_sprites[tripnum]->_moveX = 0;
+		tripSpr->_moveX = 0;
 }
 
 /**
@@ -1118,7 +1138,8 @@ void Animation::drawSprites() {
 		order[i] = -1;
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]->_quick && _sprites[i]->_visible)
+		AnimationType *curSpr = _sprites[i];
+		if (curSpr->_quick && curSpr->_visible)
 			order[i] = i;
 	}
 
@@ -1152,15 +1173,17 @@ void Animation::animLink() {
 	if (_vm->_menu->isActive() || _vm->_seeScroll)
 		return;
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]->_quick && _sprites[i]->_visible)
-			_sprites[i]->walk();
+		AnimationType *curSpr = _sprites[i];
+		if (curSpr->_quick && curSpr->_visible)
+			curSpr->walk();
 	}
 
 	drawSprites();
 
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]->_quick && _sprites[i]->_callEachStepFl) {
-			switch (_sprites[i]->_eachStepProc) {
+		AnimationType *curSpr = _sprites[i];
+		if (curSpr->_quick && curSpr->_callEachStepFl) {
+			switch (curSpr->_eachStepProc) {
 			case kProcFollowAvvyY :
 				followAvalotY(i);
 				break;
@@ -1191,10 +1214,12 @@ void Animation::animLink() {
 }
 
 void Animation::stopWalking() {
-	_sprites[0]->stopWalk();
+	AnimationType *avvy = _sprites[0];
+
+	avvy->stopWalk();
 	_direction = kDirStopped;
 	if (_vm->_alive)
-		_sprites[0]->_stepNum = 1;
+		avvy->_stepNum = 1;
 }
 
 /**
@@ -1230,23 +1255,26 @@ void Animation::hideInCupboard() {
  * Returns true if you're within field "which".
  */
 bool Animation::inField(byte which) {
+	AnimationType *avvy = _sprites[0];
+
 	FieldType *curField = &_vm->_fields[which];
-	int16 yy = _sprites[0]->_y + _sprites[0]->_info._yLength;
+	int16 yy = avvy->_y + avvy->_info._yLength;
 
-	return (_sprites[0]->_x >= curField->_x1) && (_sprites[0]->_x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
+	return (avvy->_x >= curField->_x1) && (avvy->_x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
 
 /**
  * Returns True if you're near a door.
  */
 bool Animation::nearDoor() {
-	if (_vm->_fieldNum < 8) {
+	if (_vm->_fieldNum < 8)
 		// there ARE no doors here!
 		return false;
-	}
 
-	int16 ux = _sprites[0]->_x;
-	int16 uy = _sprites[0]->_y + _sprites[0]->_info._yLength;
+	AnimationType *avvy = _sprites[0];
+
+	int16 ux = avvy->_x;
+	int16 uy = avvy->_y + avvy->_info._yLength;
 
 	for (int i = 8; i < _vm->_fieldNum; i++) {
 		FieldType *curField = &_vm->_fields[i];


Commit: cb5424376399e8f79a18800446916f601e02721c
    https://github.com/scummvm/scummvm/commit/cb5424376399e8f79a18800446916f601e02721c
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-14T12:59:06-07:00

Commit Message:
AVALANCHE: Remove GraphicManager::fleshColors(), move everything from it to GraphicManager::init().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index fdc2ddd..b1c6f96 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -501,8 +501,6 @@ void AvalancheEngine::loadAlso(byte num) {
 void AvalancheEngine::loadRoom(byte num) {
 	CursorMan.showMouse(false);
 
-	_graphics->fleshColors();
-
 	Common::String filename = Common::String::format("place%d.avd", num);
 	Common::File file;
 	if (!file.open(filename))
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0414bf5..bedb7f5 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -77,6 +77,10 @@ void GraphicManager::init() {
 	for (int i = 0; i < 16; i++)
 		g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[i]], i, 1);
 
+	// Set the "flesh colors":
+	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
+	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
+
 	_surface.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
 	_magics.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
 	_screen.create(kScreenWidth, kScreenHeight * 2, Graphics::PixelFormat::createFormatCLUT8());
@@ -192,11 +196,6 @@ void GraphicManager::drawToolbar() {
 	file.close();
 }
 
-void GraphicManager::fleshColors() {
-	g_system->getPaletteManager()->setPalette(_egaPalette[39], 13, 1);
-	g_system->getPaletteManager()->setPalette(_egaPalette[28], 5, 1);
-}
-
 Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
 	Common::Point endPoint;
 	const float convfac = M_PI / 180.0;
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index a6be3af..b45d37e 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -66,8 +66,6 @@ public:
 	void loadDigits();
 	void loadMouse(byte which);
 
-	void fleshColors();
-
 	Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
 	void drawTriangle(Common::Point *p, Color color);


Commit: 2c09933641cf2d8fb2a8134746a2fcbef1534121
    https://github.com/scummvm/scummvm/commit/2c09933641cf2d8fb2a8134746a2fcbef1534121
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T13:43:12-07:00

Commit Message:
AVALANCHE: Remove StatType, reduce verbosity some more

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 4bf2c69..a1d289d 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -75,32 +75,32 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	// Replace variable named 'soa' in the original code.
 	inf.skip(2);
 
-	if (!_stat._name.empty())
-		_stat._name.clear();
+	if (!_name.empty())
+		_name.clear();
 	byte nameSize = inf.readByte();
 	for (int i = 0; i < nameSize; i++)
-		_stat._name += inf.readByte();
+		_name += inf.readByte();
 	inf.skip(12 - nameSize);
 
 	byte commentSize = inf.readByte();
 	for (int i = 0; i < commentSize; i++)
-		_stat._comment += inf.readByte();
+		_comment += inf.readByte();
 	inf.skip(16 - commentSize);
 
-	_stat._frameNum = inf.readByte();
+	_frameNum = inf.readByte();
 	_info._xLength = inf.readByte();
 	_info._yLength = inf.readByte();
-	_stat._seq = inf.readByte();
+	_seq = inf.readByte();
 	_info._size = inf.readUint16LE();
-	_stat._fgBubbleCol = (Color)inf.readByte();
-	_stat._bgBubbleCol = (Color)inf.readByte();
-	_stat._acciNum = inf.readByte();
+	_fgBubbleCol = (Color)inf.readByte();
+	_bgBubbleCol = (Color)inf.readByte();
+	_acciNum = inf.readByte();
 
 	_animCount = 0; // = 1;
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (int i = 0; i < _stat._frameNum; i++) {
+	for (int i = 0; i < _frameNum; i++) {
 		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
 		_info._mani[_animCount] = new ManiType[_info._size - 6];
 		for (int j = 0; j <= _info._yLength; j++)
@@ -147,7 +147,7 @@ void AnimationType::draw() {
 	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
 		return;
 
-	byte picnum = _facingDir * _stat._seq + _stepNum;
+	byte picnum = _facingDir * _seq + _stepNum;
 
 	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
 }
@@ -247,7 +247,7 @@ void AnimationType::walk() {
 		_count++;
 		if (((_moveX != 0) || (_moveY != 0)) && (_count > 1)) {
 			_stepNum++;
-			if (_stepNum == _stat._seq)
+			if (_stepNum == _seq)
 				_stepNum = 0;
 			_count = 0;
 		}
@@ -362,7 +362,7 @@ void AnimationType::stopWalk() {
 void AnimationType::chatter() {
 	_anim->_vm->_talkX = _x + _info._xLength / 2;
 	_anim->_vm->_talkY = _y;
-	_anim->_vm->_graphics->setDialogColor(_stat._bgBubbleCol, _stat._fgBubbleCol);
+	_anim->_vm->_graphics->setDialogColor(_bgBubbleCol, _fgBubbleCol);
 }
 
 void AnimationType::remove() {
@@ -370,7 +370,7 @@ void AnimationType::remove() {
 	_info._xWidth = _info._xLength / 8;
 	if ((_info._xLength % 8) > 0)
 		_info._xWidth++;
-	for (int i = 0; i < _stat._frameNum; i++) {
+	for (int i = 0; i < _frameNum; i++) {
 		assert(_animCount > 0);
 		_animCount--;
 		delete[] _info._mani[_animCount];
@@ -392,9 +392,11 @@ Animation::Animation(AvalancheEngine *vm) {
 
 Animation::~Animation() {
 	for (int16 i = 0; i < kSpriteNumbMax; i++) {
-		if (_sprites[i]->_quick)
-			_sprites[i]->remove();
-		delete(_sprites[i]);
+		AnimationType *curSpr = _sprites[i];
+
+		if (curSpr->_quick)
+			curSpr->remove();
+		delete(curSpr);
 	}
 }
 
@@ -736,11 +738,13 @@ void Animation::catacombMove(byte ped) {
 	}
 
 	if ((_vm->_geidaFollows) && (ped > 0)) {
-		if (!_sprites[1]->_quick)  // If we don't already have her...
-			_sprites[1]->init(5, true); // ...Load Geida.
+		AnimationType *spr1 = _sprites[1];
+
+		if (!spr1->_quick)  // If we don't already have her...
+			spr1->init(5, true); // ...Load Geida.
 		appearPed(1, geidaPed(ped));
-		_sprites[1]->_callEachStepFl = true;
-		_sprites[1]->_eachStepProc = kProcGeida;
+		spr1->_callEachStepFl = true;
+		spr1->_eachStepProc = kProcGeida;
 	}
 }
 
@@ -776,16 +780,18 @@ void Animation::callSpecial(uint16 which) {
 
 		if (!_arrowTriggered) {
 			_arrowTriggered = true;
+
+			AnimationType *spr1 = _sprites[1];
 			appearPed(1, 3); // The dart starts at ped 4, and...
-			_sprites[1]->walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
-			_sprites[1]->_facingDir = kDirUp; // Only face.
+			spr1->walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion).
+			spr1->_facingDir = kDirUp; // Only face.
 			// Should call some kind of Eachstep procedure which will deallocate
 			// the sprite when it hits the wall, and replace it with the chunk
 			// graphic of the arrow buried in the plaster. */
 
 			// OK!
-			_sprites[1]->_callEachStepFl = true;
-			_sprites[1]->_eachStepProc = kProcArrow;
+			spr1->_callEachStepFl = true;
+			spr1->_eachStepProc = kProcArrow;
 		}
 		break;
 	case 4: // This is the ghost room link.
@@ -801,23 +807,28 @@ void Animation::callSpecial(uint16 which) {
 			_vm->_dialogs->displayScrollChain('q', 35);
 			_sprites[0]->remove();
 			//tr[1].vanishifstill:=true;
+
+			AnimationType *spr1 = _sprites[1];
 			_vm->_background->draw(-1, -1, 1);
 			_vm->_dialogs->displayScrollChain('q', 36);
 			_vm->_tiedUp = true;
 			_vm->_friarWillTieYouUp = false;
-			_sprites[1]->walkTo(2);
-			_sprites[1]->_vanishIfStill = true;
-			_sprites[1]->_doCheck = true; // One of them must have Check_Me switched on.
+			spr1->walkTo(2);
+			spr1->_vanishIfStill = true;
+			spr1->_doCheck = true; // One of them must have Check_Me switched on.
 			_vm->setRoom(kPeopleFriarTuck, kRoomDummy); // Not here, then.
 			_vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround);
 		}
 		break;
-	case 6: // _vm->special 6: fall down oubliette.
+	case 6: {
+		// _vm->special 6: fall down oubliette.
+		AnimationType *avvy = _sprites[0];
 		_vm->_userMovesAvvy = false;
-		_sprites[0]->_moveX = 3;
-		_sprites[0]->_moveY = 0;
-		_sprites[0]->_facingDir = kDirRight;
+		avvy->_moveX = 3;
+		avvy->_moveY = 0;
+		avvy->_facingDir = kDirRight;
 		_vm->_timer->addTimer(1, Timer::kProcFallDownOubliette, Timer::kReasonFallingDownOubliette);
+		}
 		break;
 	case 7: // _vm->special 7: stop falling down oubliette.
 		_sprites[0]->_visible = false;
@@ -831,21 +842,25 @@ void Animation::callSpecial(uint16 which) {
 		break;
 	case 8:        // _vm->special 8: leave du Lustie's room.
 		if ((_vm->_geidaFollows) && (!_vm->_lustieIsAsleep)) {
+			AnimationType *spr1 = _sprites[1];
 			_vm->_dialogs->displayScrollChain('q', 63);
-			_sprites[1]->turn(kDirDown);
-			_sprites[1]->stopWalk();
-			_sprites[1]->_callEachStepFl = false; // Geida
+			spr1->turn(kDirDown);
+			spr1->stopWalk();
+			spr1->_callEachStepFl = false; // Geida
 			_vm->gameOver();
 		}
 		break;
-	case 9: // _vm->special 9: lose Geida to Robin Hood...
+	case 9: {
+		// _vm->special 9: lose Geida to Robin Hood...
 		if (!_vm->_geidaFollows)
 			return;   // DOESN'T COUNT: no Geida.
-		_sprites[1]->_callEachStepFl = false; // She no longer follows Avvy around.
-		_sprites[1]->walkTo(3); // She walks to somewhere...
+		AnimationType *spr1 = _sprites[1];
+		spr1->_callEachStepFl = false; // She no longer follows Avvy around.
+		spr1->walkTo(3); // She walks to somewhere...
 		_sprites[0]->remove();     // Lose Avvy.
 		_vm->_userMovesAvvy = false;
 		_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
+		}
 		break;
 	case 10: // _vm->special 10: transfer north in catacombs.
 		if ((_vm->_catacombX == 4) && (_vm->_catacombY == 1)) {
@@ -905,36 +920,38 @@ void Animation::callSpecial(uint16 which) {
 }
 
 void Animation::updateSpeed() {
+	AnimationType *avvy = _sprites[0];
 	// Given that you've just changed the speed in _speedX, this adjusts _moveX.
-	_sprites[0]->_moveX = (_sprites[0]->_moveX / 3) * _sprites[0]->_speedX;
-	_vm->_graphics->drawSpeedBar(_sprites[0]->_speedX);
+	avvy->_moveX = (avvy->_moveX / 3) * avvy->_speedX;
+	_vm->_graphics->drawSpeedBar(avvy->_speedX);
 }
 
 void Animation::setMoveSpeed(byte t, Direction dir) {
+	AnimationType *spr = _sprites[t];
 	switch (dir) {
 	case kDirUp:
-		_sprites[t]->setSpeed(0, -_sprites[t]->_speedY);
+		spr->setSpeed(0, -spr->_speedY);
 		break;
 	case kDirDown:
-		_sprites[t]->setSpeed(0, _sprites[t]->_speedY);
+		spr->setSpeed(0, spr->_speedY);
 		break;
 	case kDirLeft:
-		_sprites[t]->setSpeed(-_sprites[t]->_speedX,  0);
+		spr->setSpeed(-spr->_speedX,  0);
 		break;
 	case kDirRight:
-		_sprites[t]->setSpeed(_sprites[t]->_speedX,  0);
+		spr->setSpeed(spr->_speedX,  0);
 		break;
 	case kDirUpLeft:
-		_sprites[t]->setSpeed(-_sprites[t]->_speedX, -_sprites[t]->_speedY);
+		spr->setSpeed(-spr->_speedX, -spr->_speedY);
 		break;
 	case kDirUpRight:
-		_sprites[t]->setSpeed(_sprites[t]->_speedX, -_sprites[t]->_speedY);
+		spr->setSpeed(spr->_speedX, -spr->_speedY);
 		break;
 	case kDirDownLeft:
-		_sprites[t]->setSpeed(-_sprites[t]->_speedX, _sprites[t]->_speedY);
+		spr->setSpeed(-spr->_speedX, spr->_speedY);
 		break;
 	case kDirDownRight:
-		_sprites[t]->setSpeed(_sprites[t]->_speedX, _sprites[t]->_speedY);
+		spr->setSpeed(spr->_speedX, spr->_speedY);
 		break;
 	default:
 		break;
@@ -956,20 +973,21 @@ void Animation::followAvalotY(byte tripnum) {
 		return;
 
 	AnimationType *tripSpr = _sprites[tripnum];
+	AnimationType *spr1 = _sprites[1];
 
 	if (tripSpr->_homing)
-		tripSpr->_homingY = _sprites[1]->_y;
+		tripSpr->_homingY = spr1->_y;
 	else {
-		if (tripSpr->_y < _sprites[1]->_y)
+		if (tripSpr->_y < spr1->_y)
 			tripSpr->_y++;
-		else if (tripSpr->_y > _sprites[1]->_y)
+		else if (tripSpr->_y > spr1->_y)
 			tripSpr->_y--;
 		else
 			return;
 
 		if (tripSpr->_moveX == 0)  {
 			tripSpr->_stepNum++;
-			if (tripSpr->_stepNum == tripSpr->_stat._seq)
+			if (tripSpr->_stepNum == tripSpr->_seq)
 				tripSpr->_stepNum = 0;
 			tripSpr->_count = 0;
 		}
@@ -1050,7 +1068,7 @@ void Animation::grabAvvy(byte tripnum) {     // For Friar Tuck, in Nottingham.
 		if (tripSpr->_y < toy)
 			tripSpr->_y++;
 		tripSpr->_stepNum++;
-		if (tripSpr->_stepNum == tripSpr->_stat._seq)
+		if (tripSpr->_stepNum == tripSpr->_seq)
 			tripSpr->_stepNum = 0;
 	}
 }
@@ -1060,7 +1078,7 @@ void Animation::takeAStep(byte &tripnum) {
 
 	if (tripSpr->_moveX == 0) {
 		tripSpr->_stepNum++;
-		if (tripSpr->_stepNum == tripSpr->_stat._seq)
+		if (tripSpr->_stepNum == tripSpr->_seq)
 			tripSpr->_stepNum = 0;
 		tripSpr->_count = 0;
 	}
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index ac247b8..297f911 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -40,19 +40,19 @@ enum Direction {
 	kDirStopped, kDirNone = 177
 };
 
-struct StatType {
+class AnimationType {
+public:
+	SpriteInfo _info;
+
+	// Former Stat structure
 	Common::String _name; // Name of character.
 	Common::String _comment; // Comment.
 	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
 	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
 	byte _acciNum; // The number according to Acci. (1=Avvy, etc.)
-};
+	//
 
-class AnimationType {
-public:
-	SpriteInfo _info;
-	StatType _stat; // Vital statistics.
 	Direction _facingDir;
 	byte _stepNum;
 	int16 _x, _y; // Current xy coords.
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 84dbed4..8a1031b 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1074,7 +1074,7 @@ void Dialogs::talkTo(byte whom) {
 
 	bool noMatches = true;
 	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]->_stat._acciNum == whom) {
+		if (_vm->_animation->_sprites[i]->_acciNum == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, i + 49, kControlToBuffer);
 			displayText(tmpStr);
 			noMatches = false;
@@ -1134,7 +1134,8 @@ Common::String Dialogs::personSpeaks() {
 	Common::String tmpStr;
 
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]->_quick && ((_vm->_animation->_sprites[i]->_stat._acciNum + 149) == _vm->_parser->_person)) {
+		AnimationType *curSpr = _vm->_animation->_sprites[i];
+		if (curSpr->_quick && (curSpr->_acciNum + 149 == _vm->_parser->_person)) {
 			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
 			found = true;
 		}


Commit: 652331a3a97a7f0505692085a16083ca0e925900
    https://github.com/scummvm/scummvm/commit/652331a3a97a7f0505692085a16083ca0e925900
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T14:18:34-07:00

Commit Message:
AVALANCHE: Remove some extra parenthesis in Animation

Changed paths:
    engines/avalanche/animation.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index a1d289d..a785c9c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -144,7 +144,7 @@ void AnimationType::reset() {
  * @remarks	Originally called 'andexor'
  */
 void AnimationType::draw() {
-	if ((_vanishIfStill) && (_moveX == 0) && (_moveY == 0))
+	if (_vanishIfStill && (_moveX == 0) && (_moveY == 0))
 		return;
 
 	byte picnum = _facingDir * _seq + _stepNum;
@@ -212,7 +212,7 @@ void AnimationType::walk() {
 		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_cp], _y, _info._yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
-		if ((magicColor != 255) & (!_anim->_vm->_doingSpriteRun)) {
+		if ((magicColor != 255) & !_anim->_vm->_doingSpriteRun) {
 			MagicType *magic = &_anim->_vm->_magics[magicColor];
 			switch (magic->_operation) {
 			case kMagicExclaim:
@@ -607,7 +607,7 @@ void Animation::catacombMove(byte ped) {
 	case 0x1:
 		_vm->_background->draw(-1, -1, 21);
 
-		if ((xy == 2051) && (_vm->_geidaFollows))
+		if ((xy == 2051) && _vm->_geidaFollows)
 			_vm->_magics[12]._operation = kMagicExclaim;
 		else
 			_vm->_magics[12]._operation = kMagicSpecial; // Right exit south.
@@ -737,7 +737,7 @@ void Animation::catacombMove(byte ped) {
 		break; // [1,1] : the other two.
 	}
 
-	if ((_vm->_geidaFollows) && (ped > 0)) {
+	if (_vm->_geidaFollows && (ped > 0)) {
 		AnimationType *spr1 = _sprites[1];
 
 		if (!spr1->_quick)  // If we don't already have her...
@@ -841,7 +841,7 @@ void Animation::callSpecial(uint16 which) {
 		_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
 		break;
 	case 8:        // _vm->special 8: leave du Lustie's room.
-		if ((_vm->_geidaFollows) && (!_vm->_lustieIsAsleep)) {
+		if (_vm->_geidaFollows && !_vm->_lustieIsAsleep) {
 			AnimationType *spr1 = _sprites[1];
 			_vm->_dialogs->displayScrollChain('q', 63);
 			spr1->turn(kDirDown);
@@ -1026,9 +1026,9 @@ void Animation::arrowProcs(byte tripnum) {
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if (((tripSpr->_y + tripSpr->_info._yLength) >= avvy->_y) // A
-				&& (tripSpr->_x <= (avvy->_x + avvy->_info._xLength)) // B
-				&& ((tripSpr->_x + tripSpr->_info._xLength) >= avvy->_x)) { // C
+		if ((tripSpr->_y + tripSpr->_info._yLength >= avvy->_y) // A
+			&& (tripSpr->_x <= avvy->_x + avvy->_info._xLength) // B
+			&& (tripSpr->_x + tripSpr->_info._xLength >= avvy->_x)) { // C
 			// OK, it's hit him... what now?
 
 			_sprites[1]->_callEachStepFl = false; // prevent recursion.
@@ -1164,8 +1164,7 @@ void Animation::drawSprites() {
 	do {
 		ok = true;
 		for (int i = 0; i < 4; i++) {
-			if (((order[i] != -1) && (order[i + 1] != -1))
-					&& (_sprites[order[i]]->_y > _sprites[order[i + 1]]->_y)) {
+			if ((order[i] != -1) && (order[i + 1] != -1) && (_sprites[order[i]]->_y > _sprites[order[i + 1]]->_y)) {
 				// Swap them!
 				temp = order[i];
 				order[i] = order[i + 1];


Commit: 597690ae9d401844a6e842654e368710d60b2fc8
    https://github.com/scummvm/scummvm/commit/597690ae9d401844a6e842654e368710d60b2fc8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T15:09:08-07:00

Commit Message:
AVALANCHE: Fix memory corruption in background (drawpicture) blitting

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index bedb7f5..151879d 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -563,8 +563,17 @@ void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x,
 
 void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY) {
 	// Copy the picture to the given place on the screen.
-	for (uint16 y = 0; y < picture.h; y++) {
-		for (uint16 x = 0; x < picture.w; x++)
+	uint16 maxX = picture.w;
+	uint16 maxY = picture.h;
+
+	if (destX + maxX > target.w)
+		maxX = target.w - destX;
+	
+	if (destY + maxY > target.h)
+		maxY = target.h - destY;
+
+	for (uint16 y = 0; y < maxY; y++) {
+		for (uint16 x = 0; x < maxX; x++)
 			*(byte *)target.getBasePtr(x + destX, y + destY) = *(const byte *)picture.getBasePtr(x, y);
 	}
 }


Commit: 6437179de324d60343e7a4db8696dfdc513a4956
    https://github.com/scummvm/scummvm/commit/6437179de324d60343e7a4db8696dfdc513a4956
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T16:07:26-07:00

Commit Message:
AVALANCHE: Get rid of SpriteInfo

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalot.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index a785c9c..71070b2 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -88,24 +88,24 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	inf.skip(16 - commentSize);
 
 	_frameNum = inf.readByte();
-	_info._xLength = inf.readByte();
-	_info._yLength = inf.readByte();
+	_xLength = inf.readByte();
+	_yLength = inf.readByte();
 	_seq = inf.readByte();
-	_info._size = inf.readUint16LE();
+	_size = inf.readUint16LE();
 	_fgBubbleCol = (Color)inf.readByte();
 	_bgBubbleCol = (Color)inf.readByte();
 	_acciNum = inf.readByte();
 
 	_animCount = 0; // = 1;
-	_info._xWidth = _info._xLength / 8;
-	if ((_info._xLength % 8) > 0)
-		_info._xWidth++;
+	_xWidth = _xLength / 8;
+	if ((_xLength % 8) > 0)
+		_xWidth++;
 	for (int i = 0; i < _frameNum; i++) {
-		_info._sil[_animCount] = new SilType[11 * (_info._yLength + 1)];
-		_info._mani[_animCount] = new ManiType[_info._size - 6];
-		for (int j = 0; j <= _info._yLength; j++)
-			inf.read((*_info._sil[_animCount])[j], _info._xWidth);
-		inf.read(*_info._mani[_animCount], _info._size - 6);
+		_sil[_animCount] = new SilType[11 * (_yLength + 1)];
+		_mani[_animCount] = new ManiType[_size - 6];
+		for (int j = 0; j <= _yLength; j++)
+			inf.read((*_sil[_animCount])[j], _xWidth);
+		inf.read(*_mani[_animCount], _size - 6);
 
 		_animCount++;
 	}
@@ -149,7 +149,7 @@ void AnimationType::draw() {
 
 	byte picnum = _facingDir * _seq + _stepNum;
 
-	_anim->_vm->_graphics->drawSprite(_info, picnum, _x, _y);
+	_anim->_vm->_graphics->drawSprite(this, picnum, _x, _y);
 }
 
 /**
@@ -183,7 +183,7 @@ void AnimationType::appear(int16 wx, int16 wy, Direction wf) {
 bool AnimationType::checkCollision() {
 	for (int i = 0; i < _anim->kSpriteNumbMax; i++) {
 		AnimationType *spr = _anim->_sprites[i];
-		if (spr->_quick && (spr->_id != _id) && (_x + _info._xLength > spr->_x) && (_x < spr->_x + spr->_info._xLength) && (spr->_y == _y))
+		if (spr->_quick && (spr->_id != _id) && (_x + _xLength > spr->_x) && (_x < spr->_x + spr->_xLength) && (spr->_y == _y))
 			return true;
 	}
 
@@ -209,7 +209,7 @@ void AnimationType::walk() {
 			return;
 		}
 
-		byte magicColor = _anim->checkFeet(_x, _x + _info._xLength, _oldY[_anim->_vm->_cp], _y, _info._yLength) - 1;
+		byte magicColor = _anim->checkFeet(_x, _x + _xLength, _oldY[_anim->_vm->_cp], _y, _yLength) - 1;
 		// -1  is because the modified array indexes of magics[] compared to Pascal .
 
 		if ((magicColor != 255) & !_anim->_vm->_doingSpriteRun) {
@@ -283,8 +283,8 @@ void AnimationType::walkTo(byte pedNum) {
 	PedType *curPed = &_anim->_vm->_peds[pedNum];
 
 	setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y));
-	_homingX = curPed->_x - _info._xLength / 2;
-	_homingY = curPed->_y - _info._yLength;
+	_homingX = curPed->_x - _xLength / 2;
+	_homingY = curPed->_y - _yLength;
 	_homing = true;
 }
 
@@ -360,21 +360,21 @@ void AnimationType::stopWalk() {
  * Sets up talk vars.
  */
 void AnimationType::chatter() {
-	_anim->_vm->_talkX = _x + _info._xLength / 2;
+	_anim->_vm->_talkX = _x + _xLength / 2;
 	_anim->_vm->_talkY = _y;
 	_anim->_vm->_graphics->setDialogColor(_bgBubbleCol, _fgBubbleCol);
 }
 
 void AnimationType::remove() {
 	_animCount--;
-	_info._xWidth = _info._xLength / 8;
-	if ((_info._xLength % 8) > 0)
-		_info._xWidth++;
+	_xWidth = _xLength / 8;
+	if ((_xLength % 8) > 0)
+		_xWidth++;
 	for (int i = 0; i < _frameNum; i++) {
 		assert(_animCount > 0);
 		_animCount--;
-		delete[] _info._mani[_animCount];
-		delete[] _info._sil[_animCount];
+		delete[] _mani[_animCount];
+		delete[] _sil[_animCount];
 	}
 
 	_quick = false;
@@ -961,7 +961,7 @@ void Animation::setMoveSpeed(byte t, Direction dir) {
 void Animation::appearPed(byte sprNum, byte pedNum) {
 	AnimationType *curSpr = _sprites[sprNum];
 	PedType *curPed = &_vm->_peds[pedNum];
-	curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction);
+	curSpr->appear(curPed->_x - curSpr->_xLength / 2, curPed->_y - curSpr->_yLength, curPed->_direction);
 	setMoveSpeed(sprNum, curPed->_direction);
 }
 
@@ -1026,9 +1026,9 @@ void Animation::arrowProcs(byte tripnum) {
 		// This is so if: a) the bottom of the arrow is below Avvy's head,
 		// b) the left of the arrow is left of the right of Avvy's head, and
 		// c) the right of the arrow is right of the left of Avvy's head.
-		if ((tripSpr->_y + tripSpr->_info._yLength >= avvy->_y) // A
-			&& (tripSpr->_x <= avvy->_x + avvy->_info._xLength) // B
-			&& (tripSpr->_x + tripSpr->_info._xLength >= avvy->_x)) { // C
+		if ((tripSpr->_y + tripSpr->_yLength >= avvy->_y) // A
+			&& (tripSpr->_x <= avvy->_x + avvy->_xLength) // B
+			&& (tripSpr->_x + tripSpr->_xLength >= avvy->_x)) { // C
 			// OK, it's hit him... what now?
 
 			_sprites[1]->_callEachStepFl = false; // prevent recursion.
@@ -1275,7 +1275,7 @@ bool Animation::inField(byte which) {
 	AnimationType *avvy = _sprites[0];
 
 	FieldType *curField = &_vm->_fields[which];
-	int16 yy = avvy->_y + avvy->_info._yLength;
+	int16 yy = avvy->_y + avvy->_yLength;
 
 	return (avvy->_x >= curField->_x1) && (avvy->_x <= curField->_x2) && (yy >= curField->_y1) && (yy <= curField->_y2);
 }
@@ -1291,7 +1291,7 @@ bool Animation::nearDoor() {
 	AnimationType *avvy = _sprites[0];
 
 	int16 ux = avvy->_x;
-	int16 uy = avvy->_y + avvy->_info._yLength;
+	int16 uy = avvy->_y + avvy->_yLength;
 
 	for (int i = 8; i < _vm->_fieldNum; i++) {
 		FieldType *curField = &_vm->_fields[i];
@@ -1439,7 +1439,7 @@ void Animation::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(spr->_visible);
 		sz.syncAsByte(spr->_homing);
 		sz.syncAsByte(spr->_count);
-		sz.syncAsByte(spr->_info._xWidth);
+		sz.syncAsByte(spr->_xWidth);
 		sz.syncAsByte(spr->_speedX);
 		sz.syncAsByte(spr->_speedY);
 		sz.syncAsByte(spr->_animCount);
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 297f911..5dbaa5a 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -42,7 +42,12 @@ enum Direction {
 
 class AnimationType {
 public:
-	SpriteInfo _info;
+	// Former SpriteInfo structure
+	byte _xWidth;
+	byte _xLength, _yLength;
+	ManiType *_mani[24];
+	SilType *_sil[24];
+	uint16 _size; // The size of one picture.
 
 	// Former Stat structure
 	Common::String _name; // Name of character.
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index b1c6f96..352ac6a 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1140,14 +1140,14 @@ void AvalancheEngine::guideAvvy(Common::Point cursorPos) {
 	AnimationType *avvy = _animation->_sprites[0];
 	if (cursorPos.x < avvy->_x)
 		what = 1;
-	else if (cursorPos.x > (avvy->_x + avvy->_info._xLength))
+	else if (cursorPos.x > (avvy->_x + avvy->_xLength))
 		what = 2;
 	else
 		what = 0; // On top
 
 	if (cursorPos.y < avvy->_y)
 		what += 3;
-	else if (cursorPos.y > (avvy->_y + avvy->_info._yLength))
+	else if (cursorPos.y > (avvy->_y + avvy->_yLength))
 		what += 6;
 
 	switch (what) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 151879d..0b16590 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -536,11 +536,11 @@ byte GraphicManager::getScreenColor(Common::Point pos) {
 	return *(byte *)_surface.getBasePtr(pos.x, pos.y / 2);
 }
 
-void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
+void GraphicManager::drawSprite(AnimationType *sprite, byte picnum, int16 x, int16 y) {
 	// First we make the pixels of the sprite blank.
-	for (int j = 0; j < sprite._yLength; j++) {
-		for (int i = 0; i < sprite._xLength; i++) {
-			if (((*sprite._sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
+	for (int j = 0; j < sprite->_yLength; j++) {
+		for (int i = 0; i < sprite->_xLength; i++) {
+			if (((*sprite->_sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
 				*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
 		}
 	}
@@ -548,10 +548,10 @@ void GraphicManager::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x,
 	// Then we draw the picture to the blank places.
 	uint16 maniPos = 0; // Because the original manitype starts at 5!!! See Graphics.h for definition.
 
-	for (int j = 0; j < sprite._yLength; j++) {
+	for (int j = 0; j < sprite->_yLength; j++) {
 		for (int8 plane = 3; plane >= 0; plane--) { // The planes are in the opposite way.
-			for (uint16 i = 0; i  < sprite._xLength; i += 8) {
-				byte pixel = (*sprite._mani[picnum])[maniPos++];
+			for (uint16 i = 0; i < sprite->_xLength; i += 8) {
+				byte pixel = (*sprite->_mani[picnum])[maniPos++];
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
 					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index b45d37e..4af6d4e 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -36,21 +36,13 @@
 
 namespace Avalanche {
 class AvalancheEngine;
+class AnimationType;
 struct SpriteType;
 
 typedef byte FontType[256][16];
 typedef byte ManiType[2049];
 typedef byte SilType[51][11]; // 35, 4
 
-class SpriteInfo {
-public:
-	byte _xWidth;
-	byte _xLength, _yLength;
-	ManiType *_mani[24];
-	SilType *_sil[24];
-	uint16 _size; // The size of one picture.
-};
-
 struct MouseHotspotType {
 	int16 _horizontal, _vertical;
 };
@@ -95,7 +87,7 @@ public:
 	// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
 	Graphics::Surface loadPictureRaw(Common::File &file, uint16 width, uint16 height);
 
-	void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
+	void drawSprite(AnimationType *sprite, byte picnum, int16 x, int16 y);
 	void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
 	void drawThinkPic(Common::String filename, int id);
 	void drawToolbar();


Commit: 1f943c03627a98984b6199790e67515f23b35df6
    https://github.com/scummvm/scummvm/commit/1f943c03627a98984b6199790e67515f23b35df6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-14T23:10:37-07:00

Commit Message:
AVALANCHE: Fix crash when entering inn, add safeguards

Changed paths:
    engines/avalanche/background.cpp
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 54ab459..fc17287 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -109,7 +109,7 @@ void Background::update() {
 			break;
 		default:
 			if (_vm->_roomTime % 200 <= 178) { // Normally.
-				byte direction = 0;
+				byte direction = 1;
 				uint16 angle = _vm->bearing(1);
 				if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360)))
 					direction = 3;
@@ -315,6 +315,8 @@ void Background::release() {
  * @remarks	Originally called 'show_one'
  */
 void Background::draw(int16 destX, int16 destY, byte sprId) {
+	assert(sprId < 40);
+
 	if (_sprites[sprId]._x > kOnDisk) {
 		if (destX < 0) {
 			destX = _sprites[sprId]._x * 8;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 0b16590..b3ba95f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -540,8 +540,10 @@ void GraphicManager::drawSprite(AnimationType *sprite, byte picnum, int16 x, int
 	// First we make the pixels of the sprite blank.
 	for (int j = 0; j < sprite->_yLength; j++) {
 		for (int i = 0; i < sprite->_xLength; i++) {
-			if (((*sprite->_sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
-				*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
+			if ((x + i < _surface.w) && (y + j < _surface.h)) {
+				if (((*sprite->_sil[picnum])[j][i / 8] >> ((7 - i % 8)) & 1) == 0)
+					*(byte *)_surface.getBasePtr(x + i, y + j) = 0;
+			}
 		}
 	}
 
@@ -553,8 +555,10 @@ void GraphicManager::drawSprite(AnimationType *sprite, byte picnum, int16 x, int
 			for (uint16 i = 0; i < sprite->_xLength; i += 8) {
 				byte pixel = (*sprite->_mani[picnum])[maniPos++];
 				for (int bit = 0; bit < 8; bit++) {
-					byte pixelBit = (pixel >> bit) & 1;
-					*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
+					if ((x + i + 7 < _surface.w) && (y + j < _surface.h)) {
+						byte pixelBit = (pixel >> bit) & 1;
+						*(byte *)_surface.getBasePtr(x + i + 7 - bit, y + j) += (pixelBit << plane);
+					}
 				}
 			}
 		}


Commit: f24267874e73c615bedcdf7a5743537803892e2e
    https://github.com/scummvm/scummvm/commit/f24267874e73c615bedcdf7a5743537803892e2e
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-15T01:05:22-07:00

Commit Message:
AVALANCHE: Fix iteration in Dialogs::talkTo().

Changed paths:
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 8a1031b..364343b 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1073,7 +1073,7 @@ void Dialogs::talkTo(byte whom) {
 		whom -= 149;
 
 	bool noMatches = true;
-	for (int i = 0; i <= _vm->_animation->kSpriteNumbMax; i++) {
+	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		if (_vm->_animation->_sprites[i]->_acciNum == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, i + 49, kControlToBuffer);
 			displayText(tmpStr);


Commit: 964fd22e4aebb30f22ff6358ea7140dec28c5d9a
    https://github.com/scummvm/scummvm/commit/964fd22e4aebb30f22ff6358ea7140dec28c5d9a
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-17T13:16:24-07:00

Commit Message:
AVALANCHE: Fix crash on "With" after loading from Launcher.

The faulty uninitialized variable was _lastPerson. Better to call the
whole resetVariables() so hopefully nothing similar will happen from now.

Changed paths:
    engines/avalanche/avalanche.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 29e9d02..4f38687 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -352,6 +352,8 @@ bool AvalancheEngine::loadGame(const int16 slot) {
 	t.tm_mon = f->readSint16LE();
 	t.tm_year = f->readSint16LE();
 
+	resetVariables();
+
 	Common::Serializer sz(f, NULL);
 	synchronize(sz);
 	delete f;


Commit: 96ae25eca9492a113d8d89f85edec8a98632b3eb
    https://github.com/scummvm/scummvm/commit/96ae25eca9492a113d8d89f85edec8a98632b3eb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-17T13:17:09-07:00

Commit Message:
AVALANCHE: Remove a couple of useless variables from Animation. This breaks savegames.

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 71070b2..05c9026 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -91,21 +91,22 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	_xLength = inf.readByte();
 	_yLength = inf.readByte();
 	_seq = inf.readByte();
-	_size = inf.readUint16LE();
+	uint16 size = inf.readUint16LE();
+	assert (size > 6);
 	_fgBubbleCol = (Color)inf.readByte();
 	_bgBubbleCol = (Color)inf.readByte();
 	_acciNum = inf.readByte();
 
 	_animCount = 0; // = 1;
-	_xWidth = _xLength / 8;
+	byte xWidth = _xLength / 8;
 	if ((_xLength % 8) > 0)
-		_xWidth++;
+		xWidth++;
 	for (int i = 0; i < _frameNum; i++) {
 		_sil[_animCount] = new SilType[11 * (_yLength + 1)];
-		_mani[_animCount] = new ManiType[_size - 6];
+		_mani[_animCount] = new ManiType[size - 6];
 		for (int j = 0; j <= _yLength; j++)
-			inf.read((*_sil[_animCount])[j], _xWidth);
-		inf.read(*_mani[_animCount], _size - 6);
+			inf.read((*_sil[_animCount])[j], xWidth);
+		inf.read(*_mani[_animCount], size - 6);
 
 		_animCount++;
 	}
@@ -367,9 +368,6 @@ void AnimationType::chatter() {
 
 void AnimationType::remove() {
 	_animCount--;
-	_xWidth = _xLength / 8;
-	if ((_xLength % 8) > 0)
-		_xWidth++;
 	for (int i = 0; i < _frameNum; i++) {
 		assert(_animCount > 0);
 		_animCount--;
@@ -1439,7 +1437,6 @@ void Animation::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(spr->_visible);
 		sz.syncAsByte(spr->_homing);
 		sz.syncAsByte(spr->_count);
-		sz.syncAsByte(spr->_xWidth);
 		sz.syncAsByte(spr->_speedX);
 		sz.syncAsByte(spr->_speedY);
 		sz.syncAsByte(spr->_animCount);
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 5dbaa5a..74cf56a 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -43,11 +43,9 @@ enum Direction {
 class AnimationType {
 public:
 	// Former SpriteInfo structure
-	byte _xWidth;
 	byte _xLength, _yLength;
 	ManiType *_mani[24];
 	SilType *_sil[24];
-	uint16 _size; // The size of one picture.
 
 	// Former Stat structure
 	Common::String _name; // Name of character.


Commit: b82a5e6a8b0c2998622392292f5ada4fc4b7e7de
    https://github.com/scummvm/scummvm/commit/b82a5e6a8b0c2998622392292f5ada4fc4b7e7de
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-17T13:17:09-07:00

Commit Message:
AVALANCHE: Rework AvalancheEngine::bearing(), repair Background::update().

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/background.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 352ac6a..d7d8007 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1379,10 +1379,11 @@ uint16 AvalancheEngine::bearing(byte whichPed) {
 	
 	int16 deltaX = avvy->_x - curPed->_x;
 	int16 deltaY = avvy->_y - curPed->_y;
-	if (deltaX < 0) {
-		return (uint16)((atan((float)(deltaY / deltaX)) * 180 / M_PI) + 90);
+	uint16 result = (uint16)(atan((float)(deltaY / deltaX)) * 180 / M_PI);
+	if (avvy->_x < curPed->_x) {
+		return result + 90;
 	} else {
-		return (uint16)((atan((float)(deltaY / deltaX)) * 180 / M_PI) + 270);
+		return result + 270;
 	}
 }
 
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index fc17287..c84c049 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -115,7 +115,7 @@ void Background::update() {
 					direction = 3;
 				else if ((angle >= 293) && (angle <= 357))
 					direction = 2;
-				else if ((angle >= 271) && (angle <= 292))
+				else if ((angle >= 270) && (angle <= 292))
 					direction = 4;
 
 				if (direction != _vm->_npcFacing) { // Dogfood.


Commit: ecb1bf69b9f3cfd16d35ff8bb326c192c88daa84
    https://github.com/scummvm/scummvm/commit/ecb1bf69b9f3cfd16d35ff8bb326c192c88daa84
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: Repair parameters for calling zoomOut().

Changed paths:
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index d7d8007..497812c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -803,7 +803,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 		// You're entering the map.
 		fadeIn();
 		if (ped > 0)
-			_graphics->zoomOut(_peds[ped]._x, _peds[ped]._y);
+			_graphics->zoomOut(_peds[ped - 1]._x, _peds[ped - 1]._y);
 
 		if ((_objects[kObjectWine - 1]) && (_wineState != 3)) {
 			_dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!


Commit: 06f94c10854162dd0fdfade2879880ea454bd11f
    https://github.com/scummvm/scummvm/commit/06f94c10854162dd0fdfade2879880ea454bd11f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: Remove 3 useless variables in Animation

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 05c9026..d1d3fd1 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -74,20 +74,12 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 
 	// Replace variable named 'soa' in the original code.
 	inf.skip(2);
+	// Skip real name Size (1 byte) then fixed sized zone containing name (12 bytes)
+	inf.skip(1 + 12);
+	// Skip real comment size (1 byte) then fixed sized zone containing comment (16 bytes)
+	inf.skip(1 + 16);
 
-	if (!_name.empty())
-		_name.clear();
-	byte nameSize = inf.readByte();
-	for (int i = 0; i < nameSize; i++)
-		_name += inf.readByte();
-	inf.skip(12 - nameSize);
-
-	byte commentSize = inf.readByte();
-	for (int i = 0; i < commentSize; i++)
-		_comment += inf.readByte();
-	inf.skip(16 - commentSize);
-
-	_frameNum = inf.readByte();
+	byte frameNum = inf.readByte();
 	_xLength = inf.readByte();
 	_yLength = inf.readByte();
 	_seq = inf.readByte();
@@ -101,7 +93,7 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	byte xWidth = _xLength / 8;
 	if ((_xLength % 8) > 0)
 		xWidth++;
-	for (int i = 0; i < _frameNum; i++) {
+	for (int i = 0; i < frameNum; i++) {
 		_sil[_animCount] = new SilType[11 * (_yLength + 1)];
 		_mani[_animCount] = new ManiType[size - 6];
 		for (int j = 0; j <= _yLength; j++)
@@ -367,12 +359,9 @@ void AnimationType::chatter() {
 }
 
 void AnimationType::remove() {
-	_animCount--;
-	for (int i = 0; i < _frameNum; i++) {
-		assert(_animCount > 0);
-		_animCount--;
-		delete[] _mani[_animCount];
-		delete[] _sil[_animCount];
+	for (int i = _animCount - 2; i > 0; i--) {
+		delete[] _mani[i];
+		delete[] _sil[i];
 	}
 
 	_quick = false;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 74cf56a..787f60e 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -48,9 +48,6 @@ public:
 	SilType *_sil[24];
 
 	// Former Stat structure
-	Common::String _name; // Name of character.
-	Common::String _comment; // Comment.
-	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
 	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
 	byte _acciNum; // The number according to Acci. (1=Avvy, etc.)


Commit: 5f180a06baa3e9e63015b2efb698770e897875df
    https://github.com/scummvm/scummvm/commit/5f180a06baa3e9e63015b2efb698770e897875df
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: Rework animation init/remove some more

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/dialogs.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index d1d3fd1..d2c700a 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -79,7 +79,7 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	// Skip real comment size (1 byte) then fixed sized zone containing comment (16 bytes)
 	inf.skip(1 + 16);
 
-	byte frameNum = inf.readByte();
+	_frameNum = inf.readByte();
 	_xLength = inf.readByte();
 	_yLength = inf.readByte();
 	_seq = inf.readByte();
@@ -87,22 +87,18 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	assert (size > 6);
 	_fgBubbleCol = (Color)inf.readByte();
 	_bgBubbleCol = (Color)inf.readByte();
-	_acciNum = inf.readByte();
+	_characterId = inf.readByte();
 
-	_animCount = 0; // = 1;
 	byte xWidth = _xLength / 8;
 	if ((_xLength % 8) > 0)
 		xWidth++;
-	for (int i = 0; i < frameNum; i++) {
-		_sil[_animCount] = new SilType[11 * (_yLength + 1)];
-		_mani[_animCount] = new ManiType[size - 6];
+	for (int i = 0; i < _frameNum; i++) {
+		_sil[i] = new SilType[11 * (_yLength + 1)];
+		_mani[i] = new ManiType[size - 6];
 		for (int j = 0; j <= _yLength; j++)
-			inf.read((*_sil[_animCount])[j], xWidth);
-		inf.read(*_mani[_animCount], size - 6);
-
-		_animCount++;
+			inf.read((*_sil[i])[j], xWidth);
+		inf.read(*_mani[i], size - 6);
 	}
-	_animCount++;
 
 	_x = 0;
 	_y = 0;
@@ -359,7 +355,7 @@ void AnimationType::chatter() {
 }
 
 void AnimationType::remove() {
-	for (int i = _animCount - 2; i > 0; i--) {
+	for (int i = 0; i < _frameNum; i++) {
 		delete[] _mani[i];
 		delete[] _sil[i];
 	}
@@ -1428,7 +1424,7 @@ void Animation::synchronize(Common::Serializer &sz) {
 		sz.syncAsByte(spr->_count);
 		sz.syncAsByte(spr->_speedX);
 		sz.syncAsByte(spr->_speedY);
-		sz.syncAsByte(spr->_animCount);
+		sz.syncAsByte(spr->_frameNum);
 		sz.syncAsSint16LE(spr->_homingX);
 		sz.syncAsSint16LE(spr->_homingY);
 		sz.syncAsByte(spr->_callEachStepFl);
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 787f60e..703d35c 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -48,9 +48,10 @@ public:
 	SilType *_sil[24];
 
 	// Former Stat structure
+	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
 	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
-	byte _acciNum; // The number according to Acci. (1=Avvy, etc.)
+	byte _characterId; // The number according to Acci. (1=Avvy, etc.)
 	//
 
 	Direction _facingDir;
@@ -62,7 +63,6 @@ public:
 	int16 _homingX, _homingY; // Homing x & y coords.
 	byte _count; // Counts before changing step.
 	byte _speedX, _speedY; // x & y speed.
-	byte _animCount; // Total number of sprites.
 	bool _vanishIfStill; // Do we show this sprite if it's still?
 	bool _callEachStepFl; // Do we call the eachstep procedure?
 	byte _eachStepProc;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 364343b..750dd80 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1074,7 +1074,7 @@ void Dialogs::talkTo(byte whom) {
 
 	bool noMatches = true;
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
-		if (_vm->_animation->_sprites[i]->_acciNum == whom) {
+		if (_vm->_animation->_sprites[i]->_characterId == whom) {
 			Common::String tmpStr = Common::String::format("%c%c%c", kControlRegister, i + 49, kControlToBuffer);
 			displayText(tmpStr);
 			noMatches = false;
@@ -1135,7 +1135,7 @@ Common::String Dialogs::personSpeaks() {
 
 	for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
 		AnimationType *curSpr = _vm->_animation->_sprites[i];
-		if (curSpr->_quick && (curSpr->_acciNum + 149 == _vm->_parser->_person)) {
+		if (curSpr->_quick && (curSpr->_characterId + 149 == _vm->_parser->_person)) {
 			tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
 			found = true;
 		}


Commit: 5f0361c03a5cfd328872684d8bba51ae12f3d1c0
    https://github.com/scummvm/scummvm/commit/5f0361c03a5cfd328872684d8bba51ae12f3d1c0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: Move Bubble pos to Dialogs, make them private

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index d2c700a..8542c6c 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -349,8 +349,7 @@ void AnimationType::stopWalk() {
  * Sets up talk vars.
  */
 void AnimationType::chatter() {
-	_anim->_vm->_talkX = _x + _xLength / 2;
-	_anim->_vm->_talkY = _y;
+	_anim->_vm->_dialogs->setTalkPos(_x + _xLength / 2, _y);
 	_anim->_vm->_graphics->setDialogColor(_bgBubbleCol, _fgBubbleCol);
 }
 
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 7141d3c..f4d5f6a 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -240,7 +240,6 @@ public:
 	bool _letMeOut;
 	byte _thinks;
 	bool _thinkThing;
-	int16 _talkX, _talkY;
 	bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
 	char _objectList[10];
 	// Called .free() for them in ~Gyro().
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 750dd80..444b157 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -519,18 +519,18 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	int16 my = yw * 2 - 2;
 	int16 xc = 0;
 
-	if ((_vm->_talkX - xw) < 0)
-		xc = -(_vm->_talkX - xw);
-	if ((_vm->_talkX + xw) > 639)
-		xc = 639 - (_vm->_talkX + xw);
+	if (_talkX - xw < 0)
+		xc = -(_talkX - xw);
+	if (_talkX + xw > 639)
+		xc = 639 - (_talkX + xw);
 
 	// Compute triangle coords for the tail of the bubble
-	points[0].x = _vm->_talkX - 10;
+	points[0].x = _talkX - 10;
 	points[0].y = yw;
-	points[1].x = _vm->_talkX + 10;
+	points[1].x = _talkX + 10;
 	points[1].y = yw;
-	points[2].x = _vm->_talkX;
-	points[2].y = _vm->_talkY;
+	points[2].x = _talkX;
+	points[2].y = _talkY;
 
 	_vm->_graphics->prepareBubble(xc, xw, my, points);
 
@@ -538,7 +538,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
 	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
 	// It's almost the same, only notable differences are '?', '!', etc.
 	for (int i = 0; i <= _maxLineNum; i++) {
-		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
+		int16 x = xc + _talkX - _scroll[i].size() / 2 * 8;
 		bool offset = _scroll[i].size() % 2;
 		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_graphics->_talkFontColor);
 	}
@@ -568,8 +568,8 @@ void Dialogs::reset() {
  * @remarks	Originally called 'natural'
  */
 void Dialogs::setBubbleStateNatural() {
-	_vm->_talkX = 320;
-	_vm->_talkY = 200;
+	_talkX = 320;
+	_talkY = 200;
 	_vm->_graphics->setDialogColor(kColorDarkgray, kColorWhite);
 }
 
@@ -699,8 +699,8 @@ void Dialogs::callDialogDriver() {
 					// thing with QPs as triptype.chatter does with the
 					// sprites.)
 					PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed];
-					_vm->_talkX = quasiPed->_x;
-					_vm->_talkY = quasiPed->_y; // Position.
+					_talkX = quasiPed->_x;
+					_talkY = quasiPed->_y; // Position.
 					
 					_vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);
 				} else {
@@ -803,6 +803,15 @@ void Dialogs::callDialogDriver() {
 	}
 }
 
+void Dialogs::setTalkPos(int16 x, int16 y) {
+	_talkX = x;
+	_talkY = y;
+}
+
+int16 Dialogs::getTalkPosX() {
+	return _talkX;
+}
+
 /**
  * Display text by calling the dialog driver
  * @remarks	Originally called 'display'
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 5d10524..aa24db6 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -49,6 +49,8 @@ public:
 	void setReadyLight(byte state);
 	void displayText(Common::String text);
 	bool displayQuestion(Common::String question);
+	void setTalkPos(int16 x, int16 y);
+	int16 getTalkPosX();
 	void setBubbleStateNatural();
 	void displayMusicalScroll();
 	void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
@@ -61,6 +63,7 @@ public:
 	void saySilly();
 private:
 	AvalancheEngine *_vm;
+	int16 _talkX, _talkY;
 
 	enum FontStyle {
 		kFontStyleRoman,
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b3ba95f..a802a01 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -653,15 +653,16 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
 	// Backup the screen before drawing the bubble.
 	_scrolls.copyFrom(_surface);
 
+	int16 talkX = _vm->_dialogs->getTalkPosX();
 	// The body of the bubble.
-	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
-	_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
+	_scrolls.fillRect(Common::Rect(xc + talkX - xw + 9, 7, talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
+	_scrolls.fillRect(Common::Rect(xc + talkX - xw - 1, 12, talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
 
 	// Top the 4 rounded corners of the bubble.
-	drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
-	drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
-	drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
-	drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
+	drawPieSlice(xc + talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
+	drawPieSlice(xc + talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
+	drawPieSlice(xc + talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
+	drawPieSlice(xc + talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
 
 	// "Tail" of the speech bubble.
 	drawTriangle(points, _talkBackgroundColor);


Commit: 1c3fcf22a1b3665fc4bfb0343b6de315bbf9a324
    https://github.com/scummvm/scummvm/commit/1c3fcf22a1b3665fc4bfb0343b6de315bbf9a324
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: Some more refactoring

Changed paths:
    engines/avalanche/animation.cpp
    engines/avalanche/animation.h
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp
    engines/avalanche/enums.h
    engines/avalanche/graphics.cpp
    engines/avalanche/menu.cpp
    engines/avalanche/parser.cpp



diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 8542c6c..ef30faa 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -104,7 +104,7 @@ void AnimationType::init(byte spritenum, bool doCheck) {
 	_y = 0;
 	_quick = true;
 	_visible = false;
-	_speedX = 3;
+	_speedX = kWalk;
 	_speedY = 1;
 	_homing = false;
 	_moveX = 0;
@@ -1376,6 +1376,23 @@ Direction Animation::getOldDirection() {
 	return _oldDirection;
 }
 
+void Animation::setAvvyClothes(int id) {
+	AnimationType *spr = _sprites[0];
+	if (spr->_id == id)
+		return;
+
+	int16 x = spr->_x;
+	int16 y = spr->_y;
+	spr->remove();
+	spr->init(id, true);
+	spr->appear(x, y, kDirLeft);
+	spr->_visible = false;
+}
+
+int Animation::getAvvyClothes() {
+	return _sprites[0]->_id;
+}
+
 void Animation::resetVariables() {
 	_geidaSpin = 0;
 	_geidaTime = 0;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 703d35c..33f6ab0 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -42,29 +42,25 @@ enum Direction {
 
 class AnimationType {
 public:
-	// Former SpriteInfo structure
+	byte _id;
+
 	byte _xLength, _yLength;
 	ManiType *_mani[24];
 	SilType *_sil[24];
-
-	// Former Stat structure
 	byte _frameNum; // Number of pictures.
 	byte _seq; // How many in one stride.
-	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
 	byte _characterId; // The number according to Acci. (1=Avvy, etc.)
-	//
+	byte _count; // Counts before changing step.
 
 	Direction _facingDir;
 	byte _stepNum;
 	int16 _x, _y; // Current xy coords.
 	int8 _moveX, _moveY; // Amount to move sprite by, each step.
-	byte _id;
 	bool _quick, _visible, _homing, _doCheck;
 	int16 _homingX, _homingY; // Homing x & y coords.
-	byte _count; // Counts before changing step.
-	byte _speedX, _speedY; // x & y speed.
-	bool _vanishIfStill; // Do we show this sprite if it's still?
-	bool _callEachStepFl; // Do we call the eachstep procedure?
+	byte _speedX, _speedY;
+	bool _vanishIfStill;
+	bool _callEachStepFl;
 	byte _eachStepProc;
 
 	AnimationType(Animation *anim);
@@ -78,7 +74,6 @@ public:
 	void walk();
 	void walkTo(byte pednum);
 	void stopHoming();
-	void homeStep();
 	void setSpeed(int8 xx, int8 yy);
 	void stopWalk();
 	void chatter();
@@ -88,9 +83,11 @@ private:
 	Animation *_anim;
 
 	int16 _oldX[2], _oldY[2];  // Last xy coords.
+	Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
 
 	bool checkCollision();
 	int8 getSign(int16 val);
+	void homeStep();
 };
 
 class Animation {
@@ -132,6 +129,9 @@ public:
 	Direction getDirection();
 	Direction getOldDirection();
 
+	void setAvvyClothes(int id);
+	int getAvvyClothes();
+
 	void resetVariables();
 	void synchronize(Common::Serializer &sz);
 private:
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index f4d5f6a..cc9a34d 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -164,9 +164,6 @@ public:
 	static const bool kThing = true;
 	static const bool kPerson = false;
 
-	// These following static constants should be included in CFG when it's written.
-	static const int16 kWalk = 3;
-	static const int16 kRun = 5;
 	static const char kSpludwicksOrder[3];
 
 	static const uint16 kNotes[12];
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 497812c..8ef41a2 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -851,7 +851,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
 
 	case kRoomLustiesRoom:
 		_npcFacing = 1; // du Lustie.
-		if (_animation->_sprites[0]->_id == 0) // Avvy in his normal clothes
+		if (_animation->getAvvyClothes() == 0) // Avvy in his normal clothes
 			_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks);
 		else if (!_enteredLustiesRoomAsMonk) // already
 			// Presumably, Avvy dressed as a monk.
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 155c9ac06..604c62d 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -124,6 +124,10 @@ enum ControlCharacter {
 static const int16 kScreenWidth = 640;
 static const int16 kScreenHeight = 200;
 
+static const int16 kWalk = 3;
+static const int16 kRun = 5;
+
+
 } // End of namespace Avalanche
 
 #endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a802a01..25b01d6 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -394,7 +394,7 @@ void GraphicManager::drawMenuItem(int x1, int y1, int x2, int y2) {
 }
 
 void GraphicManager::drawSpeedBar(int speed) {
-	if (speed == _vm->kRun) {
+	if (speed == kRun) {
 		_surface.drawLine(336, 199, 338, 199, kColorLightblue);
 		_surface.drawLine(371, 199, 373, 199, kColorYellow);
 	} else {
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 59ac38f..bba8e86 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -62,7 +62,9 @@ void HeadType::highlight() {
 	_menu->_activeMenuItem._activeNum = _position;
 	_menu->_menuActive = true;
 
-	_menu->_vm->_currentMouse = 177; // Force redraw of cursor.
+	// Force reload and redraw of cursor.
+	_menu->_vm->_currentMouse = 177;
+	
 }
 
 bool HeadType::parseAltTrigger(char key) {
@@ -431,7 +433,7 @@ void Menu::setupMenuAction() {
 		_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
 	_activeMenuItem.setupOption("Look around", 'L', "f8", true);
 	_activeMenuItem.setupOption("Inventory", 'I', "Tab", true);
-	if (_vm->_animation->_sprites[0]->_speedX == _vm->kWalk)
+	if (_vm->_animation->_sprites[0]->_speedX == kWalk)
 		_activeMenuItem.setupOption("Run fast", 'R', "^R", true);
 	else
 		_activeMenuItem.setupOption("Walk slowly", 'W', "^W", true);
@@ -596,10 +598,10 @@ void Menu::runMenuAction() {
 		break;
 	case 5: {
 		AnimationType *avvy = _vm->_animation->_sprites[0];
-		if (avvy->_speedX == _vm->kWalk)
-			avvy->_speedX = _vm->kRun;
+		if (avvy->_speedX == kWalk)
+			avvy->_speedX = kRun;
 		else
-			avvy->_speedX = _vm->kWalk;
+			avvy->_speedX = kWalk;
 		_vm->_animation->updateSpeed();
 		}
 		break;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index d85e550..fc176c7 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1926,15 +1926,8 @@ void Parser::doThat() {
 					i = 3;
 				else
 					i = 0;
-				Avalanche::AnimationType *spr = _vm->_animation->_sprites[0];
-				if (spr->_id != i) {
-					int16 x = spr->_x;
-					int16 y = spr->_y;
-					spr->remove();
-					spr->init(i, true);
-					spr->appear(x, y, kDirLeft);
-					spr->_visible = false;
-				}
+
+				_vm->_animation->setAvvyClothes(i);
 				}
 				break;
 			default:


Commit: 38b842ba71aceb0e9bd1b174cb4a660eef1df16b
    https://github.com/scummvm/scummvm/commit/38b842ba71aceb0e9bd1b174cb4a660eef1df16b
Author: urukgit (bozpet92 at gmail.com)
Date: 2013-10-17T13:17:10-07:00

Commit Message:
AVALANCHE: callDialogDriver, displayText, unSkrimble, doTheBubble string cleanup

Unify callDialogDriver() and displayText(). Rework it, unSkrimble() and
doTheBubble() to use Common::String instead of a private buffer. This
fixes the bug regarding examining the money bag.

Changed paths:
    engines/avalanche/dialogs.cpp
    engines/avalanche/dialogs.h



diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 444b157..e5acd9c 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -623,8 +623,10 @@ void Dialogs::solidify(byte n) {
 
 /**
  * @remarks	Originally called 'calldriver'
+ * Display text by calling the dialog driver. It unifies the function of the original 
+ * 'calldriver' and 'display' by using Common::String instead of a private buffer.
  */
-void Dialogs::callDialogDriver() {
+void Dialogs::displayText(Common::String text) {
 //	bool was_virtual; // Was the mouse cursor virtual on entry to this proc?
 	warning("STUB: Scrolls::calldrivers()");
 
@@ -635,30 +637,29 @@ void Dialogs::callDialogDriver() {
 	bool mouthnext = false;
 	bool callSpriteRun = true; // Only call sprite_run the FIRST time.
 
-	switch (_buffer[_bufSize - 1]) {
+	switch (text.lastChar()) {
 	case kControlToBuffer:
-		_bufSize--;
+		text.deleteLastChar();
 		break; // ^D = (D)on't include pagebreak
 	case kControlSpeechBubble:
 	case kControlQuestion:
 		break; // ^B = speech (B)ubble, ^Q = (Q)uestion in dialogue box
 	default:
-		_buffer[_bufSize] = kControlParagraph;
-		_bufSize++;
+		text.insertChar(kControlParagraph, text.size());
 	}
 
-	for (uint16 i = 0; i < _bufSize; i++) {
+	for (uint16 i = 0; i < text.size(); i++) {
 		if (mouthnext) {
-			if (_buffer[i] == kControlRegister)
+			if (text[i] == kControlRegister)
 				_param = 0;
-			else if (('0' <= _buffer[i]) && (_buffer[i] <= '9'))
-				_param = _buffer[i] - 48;
-			else if (('A' <= _buffer[i]) && (_buffer[i] <= 'Z'))
-				_param = _buffer[i] - 55;
+			else if (('0' <= text[i]) && (text[i] <= '9'))
+				_param = text[i] - 48;
+			else if (('A' <= text[i]) && (text[i] <= 'Z'))
+				_param = text[i] - 55;
 
 			mouthnext = false;
 		} else {
-			switch (_buffer[i]) {
+			switch (text[i]) {
 			case kControlParagraph:
 				if ((_maxLineNum == 0) && (_scroll[0].empty()))
 					break;
@@ -796,7 +797,7 @@ void Dialogs::callDialogDriver() {
 					solidify(_maxLineNum);
 					_maxLineNum++;
 				}
-				_scroll[_maxLineNum] += _buffer[i];
+				_scroll[_maxLineNum] += text[i];
 				break;
 			}
 		}
@@ -812,16 +813,6 @@ int16 Dialogs::getTalkPosX() {
 	return _talkX;
 }
 
-/**
- * Display text by calling the dialog driver
- * @remarks	Originally called 'display'
- */
-void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A STRING!!!!!!!!!!
-	_bufSize = text.size();
-	memcpy(_buffer, text.c_str(), _bufSize);
-	callDialogDriver();
-}
-
 bool Dialogs::displayQuestion(Common::String question) {
 	displayText(question + kControlNewLine + kControlQuestion);
 	
@@ -879,15 +870,14 @@ void Dialogs::displayMusicalScroll() {
 	reset();
 }
 
-void Dialogs::unSkrimble() {
-	for (uint16  i = 0; i < _bufSize; i++)
-		_buffer[i] = (~(_buffer[i] - (i + 1))) % 256;
+void Dialogs::unSkrimble(Common::String &text) {
+	for (uint16  i = 0; i < text.size(); i++)
+		text.setChar((~(text[i] - (i + 1))) % 256, i);
 }
 
-void Dialogs::doTheBubble() {
-	_buffer[_bufSize] = 2;
-	_bufSize++;
-	assert(_bufSize < 2000);
+void Dialogs::doTheBubble(Common::String &text) {
+	text.insertChar(kControlSpeechBubble, text.size());
+	assert(text.size() < 2000);
 }
 
 /**
@@ -928,16 +918,18 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
 		::error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sez_offset);
-	_bufSize = sezfile.readUint16LE();
+	uint16 _bufSize = sezfile.readUint16LE();
 	assert(_bufSize < 2000);
+	char *_buffer = new char[_bufSize];
 	sezfile.read(_buffer, _bufSize);
 	sezfile.close();
-	unSkrimble();
+	Common::String text(_buffer, _bufSize);
+	delete[] _buffer;
 
+	unSkrimble(text);
 	if (bubbling)
-		doTheBubble();
-
-	callDialogDriver();
+		doTheBubble(text);
+	displayText(text);
 }
 
 /**
@@ -975,15 +967,18 @@ void Dialogs::speak(byte who, byte subject) {
 		error("AVALANCHE: Visa: File not found: avalot.sez");
 
 	sezfile.seek(sezOffset);
-	_bufSize = sezfile.readUint16LE();
+	uint16 _bufSize = sezfile.readUint16LE();
 	assert(_bufSize < 2000);
+	char *_buffer = new char[_bufSize];
 	sezfile.read(_buffer, _bufSize);
 	sezfile.close();
+	Common::String text(_buffer, _bufSize);
+	delete[] _buffer;
 
-	unSkrimble();
-	doTheBubble();
+	unSkrimble(text);
+	doTheBubble(text);
+	displayText(text);
 
-	callDialogDriver();
 	_noError = true;
 }
 
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index aa24db6..43e6a4f 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -82,12 +82,9 @@ private:
 	byte _param; // For using arguments code
 	byte _useIcon;
 	byte _scrollBells; // no. of times to ring the bell
-	byte _buffer[2000];
-	uint16 _bufSize;
 	int16 _underScroll; // Y-coord of just under the scroll text.
 	int16 _shadowBoxX, _shadowBoxY;
 
-	void callDialogDriver();
 	void drawBubble(DialogFunctionType modeFunc);
 	void drawScroll(DialogFunctionType modeFunc);
 	void scrollModeNormal();
@@ -109,8 +106,8 @@ private:
 	void ringBell();
 	void loadFont();
 
-	void unSkrimble();
-	void doTheBubble();
+	void unSkrimble(Common::String &text);
+	void doTheBubble(Common::String &text);
 	void speak(byte who, byte subject);
 };
 


Commit: 748ba2475a2486196484246dc461d435c2564aba
    https://github.com/scummvm/scummvm/commit/748ba2475a2486196484246dc461d435c2564aba
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-17T13:32:49-07:00

Commit Message:
AVALANCHE: Fix broken xml entity in credits

Changed paths:
    AUTHORS
    devtools/credits.pl



diff --git a/AUTHORS b/AUTHORS
index e561aec..5d043ba 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -61,10 +61,10 @@ ScummVM Team
        Travis Howell
        Oliver Kiehl            - (retired)
        Ludvig Strigeus         - (retired)
-	   
-	AVALANCHE:
-	   Peter Bozso
-	   Arnaud Boutonne
+
+    AVALANCHE:
+       Peter Bozso
+       Arnaud Boutonne
 
     CGE:
        Arnaud Boutonne
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 50efb42..f652773 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -543,7 +543,7 @@ begin_credits("Credits");
 			end_section();
 			
 			begin_section("AVALANCHE");
-				add_person("Peter Bozs&oacute", "uruk", "");
+				add_person("Peter Bozsó", "uruk", "");
 				add_person("Arnaud Boutonné", "Strangerke", "");
 			end_section();
 


Commit: 17711622429c980a0c3a3c549a7b55dbab7a2239
    https://github.com/scummvm/scummvm/commit/17711622429c980a0c3a3c549a7b55dbab7a2239
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-17T13:33:15-07:00

Commit Message:
Merge branch 'avalanche'

This merges pull request 399 for the Avalanche engine developed during
GSoC2013.

Changed paths:
  A engines/avalanche/animation.cpp
  A engines/avalanche/animation.h
  A engines/avalanche/avalanche.cpp
  A engines/avalanche/avalanche.h
  A engines/avalanche/avalot.cpp
  A engines/avalanche/avalot.h
  A engines/avalanche/background.cpp
  A engines/avalanche/background.h
  A engines/avalanche/closing.cpp
  A engines/avalanche/closing.h
  A engines/avalanche/console.cpp
  A engines/avalanche/console.h
  A engines/avalanche/detection.cpp
  A engines/avalanche/dialogs.cpp
  A engines/avalanche/dialogs.h
  A engines/avalanche/enums.h
  A engines/avalanche/graphics.cpp
  A engines/avalanche/graphics.h
  A engines/avalanche/menu.cpp
  A engines/avalanche/menu.h
  A engines/avalanche/module.mk
  A engines/avalanche/parser.cpp
  A engines/avalanche/parser.h
  A engines/avalanche/pingo.cpp
  A engines/avalanche/pingo.h
  A engines/avalanche/sequence.cpp
  A engines/avalanche/sequence.h
  A engines/avalanche/sound.cpp
  A engines/avalanche/sound.h
  A engines/avalanche/timer.cpp
  A engines/avalanche/timer.h
    AUTHORS
    devtools/credits.pl
    engines/configure.engines
    engines/engines.mk
    engines/plugins_table.h
    gui/credits.h









More information about the Scummvm-git-logs mailing list